text: import * as tslib_1 from "tslib";
  import { sealed } from '@microsoft/decorators';
  import { SPError, Text, Validate } from '@microsoft/sp-core-library';
  import { Killswitches } from '../common/Killswitches';
  export var NavigationErrorCode;
  (function (NavigationErrorCode) {
      NavigationErrorCode[NavigationErrorCode["fetchData"] = 0] = "fetchData";
      NavigationErrorCode[NavigationErrorCode["parseData"] = 1] = "parseData";
      NavigationErrorCode[NavigationErrorCode["unknown"] = 2] = "unknown";
  })(NavigationErrorCode || (NavigationErrorCode = {}));
  var NavigationDataError =  (function (_super) {
      tslib_1.__extends(NavigationDataError, _super);
      function NavigationDataError(errorCode, errorMessage, innerError, isExpected, errorPayload) {
          if (isExpected === void 0) { isExpected = false; }
          var _this = _super.call(this, NavigationErrorCode[errorCode], errorMessage, errorPayload) || this;
          _this.__proto__ = NavigationDataError_1.prototype; 
          _this._errorId = errorCode;
          _this.innerError = innerError;
          _this._isExpected = isExpected;
          return _this;
      }
      NavigationDataError_1 = NavigationDataError;
      NavigationDataError.create = function (errorCode, innerError) {
          Validate.isNotNullOrUndefined(innerError, 'innerError');
          if (Killswitches.isNavigationDataErrorKSActive()) {
              return innerError;
          }
          var isExpected = NavigationDataError_1._isExpectedError(errorCode);
          var errorTemplate = NavigationDataError_1._errorTemplate(errorCode);
          var errorMessage = Text.format(errorTemplate, innerError.message);
          return new NavigationDataError_1(errorCode, errorMessage, innerError, isExpected);
      };
      NavigationDataError._isExpectedError = function (errorCode) {
          return errorCode === NavigationErrorCode.parseData;
      };
      NavigationDataError._errorTemplate = function (errorCode) {
          return NavigationDataError_1._errorCodeToTemplateMap[errorCode] || 'Failed to navigate. Error: {0}';
      };
      Object.defineProperty(NavigationDataError.prototype, "id", {
          get: function () {
              return this._errorId;
          },
          enumerable: true,
          configurable: true
      });
      Object.defineProperty(NavigationDataError.prototype, "category", {
          get: function () {
              return 'NavigationDataError';
          },
          enumerable: true,
          configurable: true
      });
      Object.defineProperty(NavigationDataError.prototype, "isExpected", {
          get: function () {
              return this._isExpected;
          },
          enumerable: true,
          configurable: true
      });
      var NavigationDataError_1;
      NavigationDataError._errorCodeToTemplateMap = new Map([
          [NavigationErrorCode.fetchData, 'Failed to retrieve navigation data. Error: {0}'],
          [NavigationErrorCode.parseData, 'Failed to parse navigation data. Error: {0}']
      ]);
      NavigationDataError = NavigationDataError_1 = tslib_1.__decorate([
          sealed
      ], NavigationDataError);
      return NavigationDataError;
  }(SPError));
  export default NavigationDataError;
  