{"version":3,"sources":["webpack:///webpack/universalModuleDefinition?5ca6*","webpack:///webpack/bootstrap 8bdea59b292cdcd0a841?85c2*","webpack:///./ng1/stateEvents.ts"],"names":[],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uBAAe;AACf;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;;AChBA;;;;;;;;;;;;;;;;;;;;;;;;;;;IA2BG;AACH,KAAI,iBAAiB,CAAC;AAEtB;;;;;;;;;;;;;IAaG;AACH,KAAI,kBAAkB,CAAC;AAEvB;;;;;;;;;;;;;;IAcG;AACH,KAAI,mBAAmB,CAAC;AAExB;;;;;;;;;;;;;;;;;;;IAmBG;AACH,KAAI,iBAAiB,CAAC;AAEtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA+BG;AACH,KAAI,cAAc,CAAC;AAGnB,EAAC;KACM,mCAAU,EAAE,2BAAQ,CAAY;KAErC,oBAAoB,IAAI,EAAE,WAAkB;SAC1C,IAAI,GAAG,EAAE,KAAK,CAAC;SACf,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;aAAE,oBAAG,EAAE,sBAAK,CAAgB;SAC3D,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;aAAC,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;SACxE,IAAI,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;SAClB,MAAM,CAAC,IAAI,CAAC;KACd,CAAC;KAED,uBAAuB,CAAC,OAAO,GAAG,CAAC,cAAc,EAAE,cAAc,EAAE,YAAY,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAC;KACzG,iCAAiC,YAAwB,EAAE,YAA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EAAE,uBAAuB,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC,CAAC;aAEvE,MAAM,CAAC;iBACL,QAAQ,EAAE,oBAAoB,CAAC,SAAS,CAAC,QAAQ;cAClD,CAAC;SACJ,CAAC;KACH,CAAC;KAGD,OAAO,CAAC,MAAM,CAAC,wBAAwB,EAAE,CAAC,iBAAiB,CAAC,CAAC;UACxD,QAAQ,CAAC,cAAc,EAA4B,oBAAoB,CAAC;UACxE,GAAG,CAAC,CAAC,cAAc,EAAE,UAAU,YAAY;SAC5C,CAAC,CAAC,CAAC,CAAC;AACV,EAAC,CAAC,EAAE,CAAC","file":"stateEvents.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"angular-ui-router\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"angular-ui-router\"] = factory();\n\telse\n\t\troot[\"angular-ui-router\"] = factory();\n})(this, function() {\nreturn \n\n\n/** WEBPACK FOOTER **\n ** webpack/universalModuleDefinition\n **/"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap 8bdea59b292cdcd0a841\n **/","/**\n * Provides implementation of the UI-Router 0.2.x state events.\n *\n * The 0.2.x state events are deprecated. We recommend moving to Transition Hooks instead, as they\n * provide much more flexibility, support async, and provide the context (the Transition, etc) necessary\n * to implement meaningful application behaviors.\n *\n * To enable these state events, include the `stateEvents.js` file in your project, e.g.,\n * ```\n * \n * ```\n * and also make sure you depend on the `ui.router.state.events` angular module, e.g.,\n * ```\n * angular.module(\"myApplication\", ['ui.router', 'ui.router.state.events']\n * ```\n *\n * @module ng1_state_events\n */ /** */\nimport {IServiceProviderFactory} from \"angular\";\nimport {TargetState, StateService, StateProvider} from \"../state/module\";\nimport {Transition} from \"../transition/transition\";\n\n/**\n * An event broadcast on `$rootScope` when the state transition **begins**.\n *\n * You can use `event.preventDefault()`\n * to prevent the transition from happening and then the transition promise will be\n * rejected with a `'transition prevented'` value.\n *\n * Additional arguments to the event handler are provided:\n * - `toState`: the Transition Target state\n * - `toParams`: the Transition Target Params\n * - `fromState`: the state the transition is coming from\n * - `fromParams`: the parameters from the state the transition is coming from\n * - `options`: any Transition Options\n * - `$transition$`: the [[Transition]]\n *\n * @example\n * ```\n *\n * $rootScope.$on('$stateChangeStart', function(event, transition) {\n * event.preventDefault();\n * // transitionTo() promise will be rejected with\n * // a 'transition prevented' error\n * })\n * ```\n *\n * @deprecated use [[TransitionService.onStart]]\n * @event $stateChangeStart\n */\nvar $stateChangeStart;\n\n/**\n * An event broadcast on `$rootScope` if a transition is **cancelled**.\n *\n * Additional arguments to the event handler are provided:\n * - `toState`: the Transition Target state\n * - `toParams`: the Transition Target Params\n * - `fromState`: the state the transition is coming from\n * - `fromParams`: the parameters from the state the transition is coming from\n * - `options`: any Transition Options\n * - `$transition$`: the [[Transition]] that was cancelled\n *\n * @deprecated\n * @event $stateChangeCancel\n */\nvar $stateChangeCancel;\n\n/**\n *\n * An event broadcast on `$rootScope` once the state transition is **complete**.\n *\n * Additional arguments to the event handler are provided:\n * - `toState`: the Transition Target state\n * - `toParams`: the Transition Target Params\n * - `fromState`: the state the transition is coming from\n * - `fromParams`: the parameters from the state the transition is coming from\n * - `options`: any Transition Options\n * - `$transition$`: the [[Transition]] that just succeeded\n *\n * @deprecated use [[TransitionService.onStart]] and [[Transition.promise]], or [[Transition.onSuccess]]\n * @event $stateChangeSuccess\n */\nvar $stateChangeSuccess;\n\n/**\n * An event broadcast on `$rootScope` when an **error occurs** during transition.\n *\n * It's important to note that if you\n * have any errors in your resolve functions (javascript errors, non-existent services, etc)\n * they will not throw traditionally. You must listen for this $stateChangeError event to\n * catch **ALL** errors.\n *\n * Additional arguments to the event handler are provided:\n * - `toState`: the Transition Target state\n * - `toParams`: the Transition Target Params\n * - `fromState`: the state the transition is coming from\n * - `fromParams`: the parameters from the state the transition is coming from\n * - `error`: The reason the transition errored.\n * - `options`: any Transition Options\n * - `$transition$`: the [[Transition]] that errored\n *\n * @deprecated use [[TransitionService.onStart]] and [[Transition.promise]], or [[Transition.onError]]\n * @event $stateChangeError\n */\nvar $stateChangeError;\n\n/**\n * An event broadcast on `$rootScope` when a requested state **cannot be found** using the provided state name.\n *\n * The event is broadcast allowing any handlers a single chance to deal with the error (usually by\n * lazy-loading the unfound state). A `TargetState` object is passed to the listener handler,\n * you can see its properties in the example. You can use `event.preventDefault()` to abort the\n * transition and the promise returned from `transitionTo()` will be rejected with a\n * `'transition aborted'` error.\n *\n * Additional arguments to the event handler are provided:\n * - `unfoundState` Unfound State information. Contains: `to, toParams, options` properties.\n * - `fromState`: the state the transition is coming from\n * - `fromParams`: the parameters from the state the transition is coming from\n * - `options`: any Transition Options\n * @example\n *\n *
\n * // somewhere, assume lazy.state has not been defined\n * $state.go(\"lazy.state\", { a: 1, b: 2 }, { inherit: false });\n *\n * // somewhere else\n * $scope.$on('$stateNotFound', function(event, transition) {\n * function(event, unfoundState, fromState, fromParams){\n * console.log(unfoundState.to); // \"lazy.state\"\n * console.log(unfoundState.toParams); // {a:1, b:2}\n * console.log(unfoundState.options); // {inherit:false} + default options\n * });\n *\n *\n * @deprecated use [[StateProvider.onInvalid]] // TODO: Move to [[StateService.onInvalid]]\n * @event $stateNotFound\n */\nvar $stateNotFound;\n\n\n(function() {\n let {isFunction, isString} = angular;\n\n function applyPairs(memo, keyValTuple: any[]) {\n let key, value;\n if (Array.isArray(keyValTuple)) [key, value] = keyValTuple;\n if (!isString(key)) throw new Error(\"invalid parameters to applyPairs\");\n memo[key] = value;\n return memo;\n }\n\n stateChangeStartHandler.$inject = ['$transition$', '$stateEvents', '$rootScope', '$state', '$urlRouter'];\n function stateChangeStartHandler($transition$: Transition, $stateEvents, $rootScope, $state, $urlRouter) {\n if (!$transition$.options().notify || !$transition$.valid() || $transition$.ignored())\n return;\n\n let enabledEvents = $stateEvents.provider.enabled();\n\n\n let toParams = $transition$.params(\"to\");\n let fromParams = $transition$.params(\"from\");\n\n if (enabledEvents.$stateChangeSuccess) {\n let startEvent = $rootScope.$broadcast('$stateChangeStart', $transition$.to(), toParams, $transition$.from(), fromParams, $transition$.options(), $transition$);\n\n if (startEvent.defaultPrevented) {\n if (enabledEvents.$stateChangeCancel) {\n $rootScope.$broadcast('$stateChangeCancel', $transition$.to(), toParams, $transition$.from(), fromParams, $transition$.options(), $transition$);\n }\n //Don't update and resync url if there's been a new transition started. see issue #2238, #600\n if ($state.transition == null) $urlRouter.update();\n return false;\n }\n\n $transition$.promise.then(function () {\n $rootScope.$broadcast('$stateChangeSuccess', $transition$.to(), toParams, $transition$.from(), fromParams, $transition$.options(), $transition$);\n });\n }\n\n if (enabledEvents.$stateChangeError) {\n $transition$.promise[\"catch\"](function (error) {\n if (error && (error.type === 2 /* RejectType.SUPERSEDED */ || error.type === 3 /* RejectType.ABORTED */))\n return;\n\n\n let evt = $rootScope.$broadcast('$stateChangeError', $transition$.to(), toParams, $transition$.from(), fromParams, error, $transition$.options(), $transition$);\n\n if (!evt.defaultPrevented) {\n $urlRouter.update();\n }\n });\n }\n }\n\n stateNotFoundHandler.$inject = ['$to$', '$from$', '$state', '$rootScope', '$urlRouter'];\n function stateNotFoundHandler($to$: TargetState, $from$: TargetState, $state: StateService, $rootScope, $urlRouter) {\n let redirect = {to: $to$.identifier(), toParams: $to$.params(), options: $to$.options()};\n let e = $rootScope.$broadcast('$stateNotFound', redirect, $from$.state(), $from$.params());\n\n if (e.defaultPrevented || e.retry)\n $urlRouter.update();\n\n function redirectFn(): TargetState {\n return $state.target(redirect.to, redirect.toParams, redirect.options);\n }\n\n if (e.defaultPrevented) {\n return false;\n } else if (e.retry || !!$state.get(redirect.to)) {\n return e.retry && isFunction(e.retry.then) ? e.retry.then(redirectFn) : redirectFn();\n }\n }\n\n $StateEventsProvider.$inject = ['$stateProvider'];\n function $StateEventsProvider($stateProvider: StateProvider) {\n $StateEventsProvider.prototype.instance = this;\n\n interface IEventsToggle {\n $stateChangeStart: boolean;\n $stateNotFound: boolean;\n $stateChangeSuccess: boolean;\n $stateChangeError: boolean;\n }\n\n let runtime = false;\n let allEvents = ['$stateChangeStart', '$stateNotFound', '$stateChangeSuccess', '$stateChangeError'];\n let enabledStateEvents =