/** * State-based routing for AngularJS 1.x * NOTICE: This monolithic bundle also bundles the @uirouter/core code. * This causes it to be incompatible with plugins that depend on @uirouter/core. * We recommend switching to the ui-router-core.js and ui-router-angularjs.js bundles instead. * For more information, see http://ui-router.github.io/blog/angular-ui-router-umd-bundles * @version v1.0.5 * @link https://ui-router.github.io * @license MIT License, http://www.opensource.org/licenses/MIT */ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("angular")):"function"==typeof define&&define.amd?define(["exports","angular"],e):e(t["@uirouter/angularjs"]=t["@uirouter/angularjs"]||{},t.angular)}(this,function(t,e){"use strict";function r(t){function e(r){return r.length>=n?t.apply(null,r):function(){return e(r.concat([].slice.apply(arguments)))}}var r=[].slice.apply(arguments,[1]),n=t.length;return e(r)}function n(){var t=arguments,e=t.length-1;return function(){for(var r=e,n=t[e].apply(this,arguments);r--;)n=t[r].call(this,n);return n}}function i(){for(var t=[],e=0;e=0&&t.splice(r,1),t}function v(t,e){return t.push(e),e}function m(t){for(var e=[],r=1;r1||o.ctrlKey||o.metaKey||o.shiftKey||t.attr("target"))){var s=r(function(){e.go(u.uiState,u.uiStateParams,u.uiStateOpts)});o.preventDefault();var c=n.isAnchor&&!u.href?1:0;o.preventDefault=function(){c--<=0&&r.cancel(s)}}}}function Ct(t,e){return{relative:St(t)||e.$current,inherit:!0,source:"sref"}}function Tt(t,e,r,n){var i;n&&(i=n.events),re(i)||(i=["click"]);for(var o=t.on?"on":"bind",a=0,u=i;athis._limit&&e.shift(),t},t.prototype.dequeue=function(){if(this.size())return this._items.splice(0,1)[0]},t.prototype.clear=function(){var t=this._items;return this._items=[],t},t.prototype.size=function(){return this._items.length},t.prototype.remove=function(t){var e=this._items.indexOf(t);return e>-1&&this._items.splice(e,1)[0]},t.prototype.peekTail=function(){return this._items[this._items.length-1]},t.prototype.peekHead=function(){if(this.size())return this._items[0]},t}();!function(t){t[t.SUPERSEDED=2]="SUPERSEDED",t[t.ABORTED=3]="ABORTED",t[t.INVALID=4]="INVALID",t[t.IGNORED=5]="IGNORED",t[t.ERROR=6]="ERROR"}(t.RejectType||(t.RejectType={}));var Fe=0,Ue=function(){function e(t,e,r){this.$id=Fe++,this.type=t,this.message=e,this.detail=r}return e.prototype.toString=function(){var t=function(t){return t&&t.toString!==Object.prototype.toString?t.toString():Q(t)}(this.detail),e=this;return"Transition Rejection($id: "+e.$id+" type: "+e.type+", message: "+e.message+", detail: "+t+")"},e.prototype.toPromise=function(){return ve(De(this),{_transitionRejection:this})},e.isRejectionPromise=function(t){return t&&"function"==typeof t.then&&Ut(e)(t._transitionRejection)},e.superseded=function(r,n){var i=new e(t.RejectType.SUPERSEDED,"The transition has been superseded by a different transition",r);return n&&n.redirected&&(i.redirected=!0),i},e.redirected=function(t){return e.superseded(t,{redirected:!0})},e.invalid=function(r){return new e(t.RejectType.INVALID,"This transition is invalid",r)},e.ignored=function(r){return new e(t.RejectType.IGNORED,"The transition was ignored",r)},e.aborted=function(r){return new e(t.RejectType.ABORTED,"The transition has been aborted",r)},e.errored=function(r){return new e(t.RejectType.ERROR,"The transition errored",r)},e.normalize=function(t){return Ut(e)(t)?t:e.errored(t)},e}(),Le=function(t){var e=t.viewDecl,r=e.$context.name||"(root)";return"[View#"+t.$id+" from '"+r+"' state]: target ui-view: '"+e.$uiViewName+"@"+e.$uiViewContextAnchor+"'"};!function(t){t[t.RESOLVE=0]="RESOLVE",t[t.TRANSITION=1]="TRANSITION",t[t.HOOK=2]="HOOK",t[t.UIVIEW=3]="UIVIEW",t[t.VIEWCONFIG=4]="VIEWCONFIG"}(t.Category||(t.Category={}));var Me=qt("$id"),Be=qt("router.$id"),Ge=function(t){return"Transition #"+Me(t)+"-"+Be(t)},We=function(){function e(){this._enabled={},this.approximateDigests=0}return e.prototype._set=function(e,r){var n=this;r.length||(r=Object.keys(t.Category).map(function(t){return parseInt(t,10)}).filter(function(t){return!isNaN(t)}).map(function(e){return t.Category[e]})),r.map(A).forEach(function(t){return n._enabled[t]=e})},e.prototype.enable=function(){for(var t=[],e=0;e "+Q(e))},e.prototype.traceTransitionIgnored=function(e){this.enabled(t.Category.TRANSITION)&&console.log(Ge(e)+": Ignored <> "+Q(e))},e.prototype.traceHookInvocation=function(e,r,n){if(this.enabled(t.Category.HOOK)){var i=qt("traceData.hookType")(n)||"internal",o=qt("traceData.context.state.name")(n)||qt("traceData.context")(n)||"unknown",a=z(e.registeredHook.callback);console.log(Ge(r)+": Hook -> "+i+" context: "+o+", "+B(200,a))}},e.prototype.traceHookResult=function(e,r,n){this.enabled(t.Category.HOOK)&&console.log(Ge(r)+": <- Hook returned: "+B(200,Q(e)))},e.prototype.traceResolvePath=function(e,r,n){this.enabled(t.Category.RESOLVE)&&console.log(Ge(n)+": Resolving "+e+" ("+r+")")},e.prototype.traceResolvableResolved=function(e,r){this.enabled(t.Category.RESOLVE)&&console.log(Ge(r)+": <- Resolved "+e+" to: "+B(200,Q(e.data)))},e.prototype.traceError=function(e,r){this.enabled(t.Category.TRANSITION)&&console.log(Ge(r)+": <- Rejected "+Q(r)+", reason: "+e)},e.prototype.traceSuccess=function(e,r){this.enabled(t.Category.TRANSITION)&&console.log(Ge(r)+": <- Success "+Q(r)+", final state: "+e.name)},e.prototype.traceUIViewEvent=function(e,r,n){void 0===n&&(n=""),this.enabled(t.Category.UIVIEW)&&console.log("ui-view: "+G(30,e)+" "+V(r)+n)},e.prototype.traceUIViewConfigUpdated=function(e,r){this.enabled(t.Category.UIVIEW)&&this.traceUIViewEvent("Updating",e," with ViewConfig from context='"+r+"'")},e.prototype.traceUIViewFill=function(e,r){this.enabled(t.Category.UIVIEW)&&this.traceUIViewEvent("Fill",e," with: "+B(200,r))},e.prototype.traceViewSync=function(e){if(this.enabled(t.Category.VIEWCONFIG)){var r=e.map(function(t){var e=t[0],r=t[1];return{"ui-view fqn":e.$type+":"+e.fqn,"state: view name":r&&r.viewDecl.$context.name+": "+r.viewDecl.$name+" ("+r.viewDecl.$type+")"}}).sort(function(t,e){return t["ui-view fqn"].localeCompare(e["ui-view fqn"])});console.table(r)}},e.prototype.traceViewServiceEvent=function(e,r){this.enabled(t.Category.VIEWCONFIG)&&console.log("VIEWCONFIG: "+e+" "+Le(r))},e.prototype.traceViewServiceUIViewEvent=function(e,r){this.enabled(t.Category.VIEWCONFIG)&&console.log("VIEWCONFIG: "+e+" "+V(r))},e}(),ze=new We;!function(t){t[t.CREATE=0]="CREATE",t[t.BEFORE=1]="BEFORE",t[t.RUN=2]="RUN",t[t.SUCCESS=3]="SUCCESS",t[t.ERROR=4]="ERROR"}(t.TransitionHookPhase||(t.TransitionHookPhase={})),function(t){t[t.TRANSITION=0]="TRANSITION",t[t.STATE=1]="STATE"}(t.TransitionHookScope||(t.TransitionHookScope={}));var Je=function(){function t(t,e,r,n){void 0===n&&(n={}),this._identifier=t,this._definition=e,this._options=n,this._params=r||{}}return t.prototype.name=function(){return this._definition&&this._definition.name||this._identifier},t.prototype.identifier=function(){return this._identifier},t.prototype.params=function(){return this._params},t.prototype.$state=function(){return this._definition},t.prototype.state=function(){return this._definition&&this._definition.self},t.prototype.options=function(){return this._options},t.prototype.exists=function(){return!(!this._definition||!this._definition.self)},t.prototype.valid=function(){return!this.error()},t.prototype.error=function(){var t=this.options().relative;if(!this._definition&&t){var e=t.name?t.name:t;return"Could not resolve '"+this.name()+"' from state '"+e+"'"}return this._definition?this._definition.self?void 0:"State '"+this.name()+"' has an invalid definition":"No such state '"+this.name()+"'"},t.prototype.toString=function(){return"'"+this.name()+"'"+pe(this.params())},t.isDef=function(t){return t&&t.state&&(te(t.state)||te(t.state.name))},t}(),Qe={current:l,transition:null,traceData:{},bind:null},Ke=function(){function e(e,r,n,i){var o=this;this.transition=e,this.stateContext=r,this.registeredHook=n,this.options=i,this.isSuperseded=function(){return o.type.hookPhase===t.TransitionHookPhase.RUN&&!o.options.transition.isActive()},this.options=m(i,Qe),this.type=n.eventType}return e.prototype.logError=function(t){this.transition.router.stateService.defaultErrorHandler()(t)},e.prototype.invokeHook=function(){var t=this,e=this.registeredHook;if(!e._deregistered){var r=this.getNotCurrentRejection();if(r)return r;var n=this.options;ze.traceHookInvocation(this,this.transition,n);var i=function(t){return Ue.normalize(t).toPromise()},o=function(r){return e.eventType.getErrorHandler(t)(r)},a=function(r){return e.eventType.getResultHandler(t)(r)};try{var u=function(){return e.callback.call(n.bind,t.transition,t.stateContext)}();return!this.type.synchronous&&ae(u)?u.catch(i).then(a,o):a(u)}catch(t){return o(Ue.normalize(t))}}},e.prototype.handleHookResult=function(t){var e=this,r=this.getNotCurrentRejection();return r||(ae(t)?t.then(function(t){return e.handleHookResult(t)}):(ze.traceHookResult(t,this.transition,this.options),!1===t?Ue.aborted("Hook aborted transition").toPromise():Ut(Je)(t)?Ue.redirected(t).toPromise():void 0))},e.prototype.getNotCurrentRejection=function(){var t=this.transition.router;return t._disposed?Ue.aborted("UIRouter instance #"+t.$id+" has been stopped (disposed)").toPromise():this.transition._aborted?Ue.aborted().toPromise():this.isSuperseded()?Ue.superseded(this.options.current()).toPromise():void 0},e.prototype.toString=function(){var t=this,e=t.options,r=t.registeredHook;return(qt("traceData.hookType")(e)||"internal")+" context: "+(qt("traceData.context.state.name")(e)||qt("traceData.context")(e)||"unknown")+", "+B(200,J(r.callback))},e.chain=function(t,e){var r=function(t,e){return t.then(function(){return e.invokeHook()})};return t.reduce(r,e||se.$q.when())},e.invokeHooks=function(t,r){for(var n=0;n20)throw new Error("Too many consecutive Transition redirects (20+)");var n={redirectedFrom:this,source:"redirect"};"url"===this.options().source&&!1!==t.options().location&&(n.location="replace");var i=ve({},this.options(),t.options(),n);t=new Je(t.identifier(),t.$state(),t.params(),i);var o=this.router.transitionService.create(this._treeChanges.from,t),a=this._treeChanges.entering,u=o._treeChanges.entering;return ir.matching(u,a,ir.nonDynamicParams).filter(Dt(function(t){return function(e){return t&&e.state.includes[t.name]}}(t.options().reloadState))).forEach(function(t,e){t.resolvables=a[e].resolvables}),o},e.prototype._changedParams=function(){var t=this._treeChanges;if(!this._options.reload&&!t.exiting.length&&!t.entering.length&&t.to.length===t.from.length){if(!C(t.to,t.from).map(function(t){return t[0].state!==t[1].state}).reduce(Ce,!1)){var e=t.to.map(function(t){return t.paramSchema}),r=[t.to,t.from].map(function(t){return t.map(function(t){return t.paramValues})});return C(e,r[0],r[1]).map(function(t){var e=t[0],r=t[1],n=t[2];return rr.changed(e,r,n)}).reduce(Te,[])}}},e.prototype.dynamic=function(){var t=this._changedParams();return!!t&&t.map(function(t){return t.dynamic}).reduce(Ce,!1)},e.prototype.ignored=function(){return!!this._ignoredReason()},e.prototype._ignoredReason=function(){var t=this.router.globals.transition,e=this._options.reloadState,r=function(t,r){if(t.length!==r.length)return!1;var n=ir.matching(t,r);return t.length===n.filter(function(t){return!e||!t.state.includes[e.name]}).length},n=this.treeChanges(),i=t&&t.treeChanges();return i&&r(i.to,n.to)&&r(i.exiting,n.exiting)?"SameAsPending":0===n.exiting.length&&0===n.entering.length&&r(n.from,n.to)?"SameAsCurrent":void 0},e.prototype.run=function(){var e=this,r=Ke.runAllHooks,n=function(t){return e._hookBuilder.buildHooksForPhase(t)},i=function(){ze.traceSuccess(e.$to(),e),e.success=!0,e._deferred.resolve(e.to()),r(n(t.TransitionHookPhase.SUCCESS))},o=function(i){ze.traceError(i,e),e.success=!1,e._deferred.reject(i),e._error=i,r(n(t.TransitionHookPhase.ERROR))},a=function(){var e=n(t.TransitionHookPhase.RUN),r=function(){return se.$q.when(void 0)};return Ke.invokeHooks(e,r)},u=function(){var t=e.router.globals;return t.lastStartedTransitionId=e.$id,t.transition=e,t.transitionHistory.enqueue(e),ze.traceTransitionStart(e),se.$q.when(void 0)},s=n(t.TransitionHookPhase.BEFORE);return Ke.invokeHooks(s,u).then(a).then(i,o),this.promise},e.prototype.valid=function(){return!this.error()||void 0!==this.success},e.prototype.abort=function(){Jt(this.success)&&(this._aborted=!0)},e.prototype.error=function(){var t=this.$to();if(t.self.abstract)return"Cannot transition to abstract state '"+t.name+"'";var e=t.parameters(),r=this.params(),n=e.filter(function(t){return!t.validates(r[t.id])});return n.length?"Param values not valid for state '"+t.name+"'. Invalid params: [ "+n.map(function(t){return t.id}).join(", ")+" ]":!1===this.success?this._error:void 0},e.prototype.toString=function(){var t=this.from(),e=this.to(),r=function(t){return null!==t["#"]&&void 0!==t["#"]?t:w(t,["#"])};return"Transition#"+this.$id+"( '"+(ee(t)?t.name:t)+"'"+pe(r(this._treeChanges.from.map(At("paramValues")).reduce(Se,{})))+" -> "+(this.valid()?"":"(X) ")+"'"+(ee(e)?e.name:e)+"'"+pe(r(this.params()))+" )"},e.diToken=e,e}(),mr=null,yr=function(t){var e=Ue.isRejectionPromise;return(mr=mr||s([[Dt(Qt),Mt("undefined")],[Kt,Mt("null")],[ae,Mt("[Promise]")],[e,function(t){return t._transitionRejection.toString()}],[Ut(Ue),u("toString")],[Ut(vr),u("toString")],[Ut(ar),u("toString")],[c,z],[Mt(!0),f]]))(t)},gr=function(t){return function(e){if(!e)return["",""];var r=e.indexOf(t);return-1===r?[e,""]:[e.substr(0,r),e.substr(r+1)]}},wr=function(){function t(){this.enqueue=!0,this.typeQueue=[],this.defaultTypes=g(t.prototype,["hash","string","query","path","int","bool","date","json","any"]);var e=function(t,e){return new Xe(ve({name:e},t))};this.types=ye(b(this.defaultTypes,e),{})}return t.prototype.dispose=function(){this.types={}},t.prototype.type=function(t,e,r){if(!Qt(e))return this.types[t];if(this.types.hasOwnProperty(t))throw new Error("A type named '"+t+"' has already been defined.");return this.types[t]=new Xe(ve({name:t},e)),r&&(this.typeQueue.push({name:t,def:r}),this.enqueue||this._flushTypeQueue()),this},t.prototype._flushTypeQueue=function(){for(;this.typeQueue.length;){var t=this.typeQueue.shift();if(t.pattern)throw new Error("You cannot override a type's .pattern at runtime.");ve(this.types[t.name],se.$injector.invoke(t.def))}},t}();!function(){var t=function(t){var e=function(t){return null!=t?t.toString():t},r={encode:e,decode:e,is:Ut(String),pattern:/.*/,equals:function(t,e){return t==e}};return ve({},r,t)};ve(wr.prototype,{string:t({}),path:t({pattern:/[^\/]*/}),query:t({}),hash:t({inherit:!1}),int:t({decode:function(t){return parseInt(t,10)},is:function(t){return!Yt(t)&&this.decode(t.toString())===t},pattern:/-?\d+/}),bool:t({encode:function(t){return t&&1||0},decode:function(t){return 0!==parseInt(t,10)},is:Ut(Boolean),pattern:/0|1/}),date:t({encode:function(t){return this.is(t)?[t.getFullYear(),("0"+(t.getMonth()+1)).slice(-2),("0"+t.getDate()).slice(-2)].join("-"):void 0},decode:function(t){if(this.is(t))return t;var e=this.capture.exec(t);return e?new Date(e[1],e[2]-1,e[3]):void 0},is:function(t){return t instanceof Date&&!isNaN(t.valueOf())},equals:function(t,e){return["getFullYear","getMonth","getDate"].reduce(function(r,n){return r&&t[n]()===e[n]()},!0)},pattern:/[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])/,capture:/([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/}),json:t({encode:pe,decode:le,is:Ut(Object),equals:me,pattern:/[^\/]*/}),any:t({encode:f,decode:f,is:function(){return!0},equals:me})})}();var _r,$r=function(){function t(t){void 0===t&&(t={}),ve(this,t)}return t.prototype.$inherit=function(t,e,r){var n,i=y(e,r),o={},a=[];for(var u in i)if(i[u]&&i[u].params&&(n=Object.keys(i[u].params),n.length))for(var s in n)a.indexOf(n[s])>=0||(a.push(n[s]),o[n[s]]=this[n[s]]);return ve({},o,t)},t}(),Sr=function(t){if(!te(t))return!1;var e="^"===t.charAt(0);return{val:e?t.substring(1):t,root:e}},br=function(t,e){return function(r){var n=r;n&&n.url&&n.name&&n.name.match(/\.\*\*$/)&&(n.url+="{remainder:any}");var i=Sr(n.url),o=r.parent,a=i?t.compile(i.val,{params:r.params||{},paramMap:function(t,e){return!1===n.reloadOnSearch&&e&&(t=ve(t||{},{dynamic:!0})),t}}):n.url;if(!a)return null;if(!t.isMatcher(a))throw new Error("Invalid url '"+a+"' in state '"+r+"'");return i&&i.root?a:(o&&o.navigable||e()).url.append(a)}},Rr=function(t){return function(e){return!t(e)&&e.url?e:e.parent?e.parent.navigable:null}},Er=function(t){return function(e){var r=function(e,r){return t.fromConfig(r,null,e)},n=e.url&&e.url.parameters({inherit:!1})||[],i=Re(be(w(e.params||{},n.map(At("id"))),r));return n.concat(i).map(function(t){return[t.id,t]}).reduce(T,{})}},Cr=function(){function t(t,e){function r(e){return o(e)?null:t.find(n.parentName(e))||i()}this.matcher=t;var n=this,i=function(){return t.find("")},o=function(t){return""===t.name};this.builders={name:[Z],self:[X],parent:[r],data:[tt],url:[br(e,i)],navigable:[Rr(o)],params:[Er(e.paramFactory)],views:[],path:[et],includes:[rt],resolvables:[nt]}}return t.prototype.builder=function(t,e){var r=this.builders,n=r[t]||[];return te(t)&&!Qt(e)?n.length>1?n:n[0]:te(t)&&Zt(e)?(r[t]=n,r[t].push(e),function(){return r[t].splice(r[t].indexOf(e,1))&&null}):void 0},t.prototype.build=function(t){var e=this,r=e.matcher,n=e.builders,i=this.parentName(t);if(i&&!r.find(i,void 0,!1))return null;for(var o in n)if(n.hasOwnProperty(o)){var a=n[o].reduce(function(t,e){return function(r){return e(r,t)}},l);t[o]=a(t)}return t},t.prototype.parentName=function(t){var e=t.name||"",r=e.split(".");if("**"===r.pop()&&r.pop(),r.length){if(t.parent)throw new Error("States that specify the 'parent:' property should not have a '.' in their name ("+e+")");return r.join(".")}return t.parent?te(t.parent)?t.parent:t.parent.name:""},t.prototype.name=function(t){var e=t.name;if(-1!==e.indexOf(".")||!t.parent)return e;var r=te(t.parent)?t.parent:t.parent.name;return r?r+"."+e:e},t}(),Tr=function(){function t(t){this._states=t}return t.prototype.isRelative=function(t){return t=t||"",0===t.indexOf(".")||0===t.indexOf("^")},t.prototype.find=function(t,e,r){if(void 0===r&&(r=!0),t||""===t){var n=te(t),i=n?t:t.name;this.isRelative(i)&&(i=this.resolvePath(i,e));var o=this._states[i];if(o&&(n||!(n||o!==t&&o.self!==t)))return o;if(n&&r){var a=Re(this._states),u=a.filter(function(t){return t.__stateObjectCache.nameGlob&&t.__stateObjectCache.nameGlob.matches(i)});return u.length>1&&console.log("stateMatcher.find: Found multiple matches for "+i+" using glob: ",u.map(function(t){return t.name})),u[0]}}},t.prototype.resolvePath=function(t,e){if(!e)throw new Error("No reference point given for path '"+t+"'");for(var r=this.find(e),n=t.split("."),i=0,o=n.length,a=r;i0;){var c=r.shift(),f=c.name,l=i.build(c),p=a.indexOf(c);if(l){var h=s(f);if(h&&h.name===f)throw new Error("State '"+f+"' is already defined");var d=s(f+".**");d&&this.$registry.deregister(d),n[f]=c,this.attachRoute(c),p>=0&&a.splice(p,1),o.push(c)}else{var v=u[f];if(u[f]=r.length,p>=0&&v===r.length)return r.push(c),n;p<0&&a.push(c),r.push(c)}}return o.length&&this.listeners.forEach(function(t){return t("registered",o.map(function(t){return t.self}))}),n},t.prototype.attachRoute=function(t){!t.abstract&&t.url&&this.$urlRouter.rule(this.$urlRouter.urlRuleFactory.create(t))},t}(),kr=function(){function t(t){this._router=t,this.states={},this.listeners=[],this.matcher=new Tr(this.states),this.builder=new Cr(this.matcher,t.urlMatcherFactory),this.stateQueue=new Pr(this,t.urlRouter,this.states,this.builder,this.listeners),this._registerRoot()}return t.prototype._registerRoot=function(){var t={name:"",url:"^",views:null,params:{"#":{value:null,type:"hash",dynamic:!0}},abstract:!0};(this._root=this.stateQueue.register(t)).navigable=null},t.prototype.dispose=function(){var t=this;this.stateQueue.dispose(),this.listeners=[],this.get().forEach(function(e){return t.get(e)&&t.deregister(e)})},t.prototype.onStatesChanged=function(t){return this.listeners.push(t),function(){we(this.listeners)(t)}.bind(this)},t.prototype.root=function(){return this._root},t.prototype.register=function(t){return this.stateQueue.register(t)},t.prototype._deregisterTree=function(t){var e=this,r=this.get().map(function(t){return t.$$state()}),n=function(t){var e=r.filter(function(e){return-1!==t.indexOf(e.parent)});return 0===e.length?e:e.concat(n(e))},i=n([t]),o=[t].concat(i).reverse();return o.forEach(function(t){var r=e._router.urlRouter;r.rules().filter(Ht("state",t)).forEach(r.removeRule.bind(r)),delete e.states[t.name]}),o},t.prototype.deregister=function(t){var e=this.get(t);if(!e)throw new Error("Can't deregister state; not found: "+t);var r=this._deregisterTree(e.$$state());return this.listeners.forEach(function(t){return t("deregistered",r.map(function(t){return t.self}))}),r},t.prototype.get=function(t,e){var r=this;if(0===arguments.length)return Object.keys(this.states).map(function(t){return r.states[t].self});var n=this.matcher.find(t,e);return n&&n.self||null},t.prototype.decorator=function(t,e){return this.builder.builder(t,e)},t}(),Or=function(t,e,r){return t[e]=t[e]||r()},xr=K("/"),jr=function(){function e(t,r,n,i){var o=this;this.config=i,this._cache={path:[this]},this._children=[],this._params=[],this._segments=[],this._compiled=[],this.pattern=t,this.config=m(this.config,{params:{},strict:!0,caseInsensitive:!1,paramMap:f});for(var a,u,s,c=/([:*])([\w\[\]]+)|\{([\w\[\]]+)(?:\:\s*((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g,l=/([:]?)([\w\[\].-]+)|\{([\w\[\].-]+)(?:\:\s*((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g,p=0,h=[],d=function(r){if(!e.nameValidator.test(r))throw new Error("Invalid parameter name '"+r+"' in pattern '"+t+"'");if(S(o._params,Ht("id",r)))throw new Error("Duplicate parameter name '"+r+"' in pattern '"+t+"'")},v=function(e,n){var i=e[2]||e[3],a=n?e[4]:e[4]||("*"===e[1]?"[\\s\\S]*":null);return{id:i,regexp:a,cfg:o.config.params[i],segment:t.substring(p,e.index),type:a?r.type(a)||function(t){return ye(r.type(n?"query":"path"),{pattern:new RegExp(t,o.config.caseInsensitive?"i":void 0)})}(a):null}};(a=c.exec(t))&&(u=v(a,!1),!(u.segment.indexOf("?")>=0));)d(u.id),this._params.push(n.fromPath(u.id,u.type,this.config.paramMap(u.cfg,!1))),this._segments.push(u.segment),h.push([u.segment,P(this._params)]),p=c.lastIndex;s=t.substring(p);var y=s.indexOf("?");if(y>=0){var g=s.substring(y);if(s=s.substring(0,y),g.length>0)for(p=0;a=l.exec(g);)u=v(a,!0),d(u.id),this._params.push(n.fromSearch(u.id,u.type,this.config.paramMap(u.cfg,!0))),p=c.lastIndex}this._segments.push(s),this._compiled=h.map(function(t){return it.apply(null,t)}).concat(it(s))}return e.prototype.append=function(t){return this._children.push(t),t._cache={path:this._cache.path.concat(t),parent:this,pattern:null},t},e.prototype.isRoot=function(){return this._cache.path[0]===this},e.prototype.toString=function(){return this.pattern},e.prototype.exec=function(t,e,r,n){var i=this;void 0===e&&(e={}),void 0===n&&(n={});var o=Or(this._cache,"pattern",function(){return new RegExp(["^",Oe(i._cache.path.map(At("_compiled"))).join(""),!1===i.config.strict?"/?":"","$"].join(""),i.config.caseInsensitive?"i":void 0)}).exec(t);if(!o)return null;var a=this.parameters(),u=a.filter(function(t){return!t.isSearch()}),s=a.filter(function(t){return t.isSearch()}),c=this._cache.path.map(function(t){return t._segments.length-1}).reduce(function(t,e){return t+e}),f={};if(c!==o.length-1)throw new Error("Unbalanced capture group in route '"+this.pattern+"'");for(var l=0;ln.weight?o:n}return n},t.prototype.sync=function(t){if(!t||!t.defaultPrevented){var e=this._router,r=e.urlService,n=e.stateService,i={path:r.path(),search:r.search(),hash:r.hash()},o=this.match(i);s([[te,function(t){return r.url(t,!0)}],[Je.isDef,function(t){return n.go(t.state,t.params,t.options)}],[Ut(Je),function(t){return n.go(t.state(),t.params(),t.options())}]])(o&&o.rule.handler(o.match,i,e))}},t.prototype.listen=function(t){var e=this;if(!1!==t)return this._stopFn=this._stopFn||this._router.urlService.onChange(function(t){return e.sync(t)});this._stopFn&&this._stopFn(),delete this._stopFn},t.prototype.update=function(t){var e=this._router.locationService;if(t)return void(this.location=e.path());e.path()!==this.location&&e.url(this.location,!0)},t.prototype.push=function(t,e,r){var n=r&&!!r.replace;this._router.urlService.url(t.format(e||{}),n)},t.prototype.href=function(t,e,r){var n=t.format(e);if(null==n)return null;r=r||{absolute:!1};var i=this._router.urlService.config,o=i.html5Mode();if(o||null===n||(n="#"+i.hashPrefix()+n),n=ot(n,o,r.absolute,i.baseHref()),!r.absolute||!n)return n;var a=!o&&n?"/":"",u=i.port();return u=80===u||443===u?"":":"+u,[i.protocol(),"://",i.host(),u,a,n].join("")},t.prototype.rule=function(t){var e=this;if(!Vr.isUrlRule(t))throw new Error("invalid rule");return t.$id=this._id++,t.priority=t.priority||0,this._rules.push(t),this._sorted=!1,function(){return e.removeRule(t)}},t.prototype.removeRule=function(t){we(this._rules,t)},t.prototype.rules=function(){return this.ensureSorted(),this._rules.slice()},t.prototype.otherwise=function(t){var e=at(t);this._otherwiseFn=this.urlRuleFactory.create(Mt(!0),e),this._sorted=!1},t.prototype.initial=function(t){var e=at(t),r=function(t,e){return 0===e.globals.transitionHistory.size()&&!!/^\/?$/.exec(t.path)};this.rule(this.urlRuleFactory.create(r,e))},t.prototype.when=function(t,e,r){var n=this.urlRuleFactory.create(t,e);return Qt(r&&r.priority)&&(n.priority=r.priority),this.rule(n),n},t.prototype.deferIntercept=function(t){void 0===t&&(t=!0),this.interceptDeferred=t},t}(),Dr=function(){function t(){var t=this;this._uiViews=[],this._viewConfigs=[],this._viewConfigFactories={},this._pluginapi={_rootViewContext:this._rootViewContext.bind(this),_viewConfigFactory:this._viewConfigFactory.bind(this),_registeredUIViews:function(){return t._uiViews},_activeViewConfigs:function(){return t._viewConfigs}}}return t.prototype._rootViewContext=function(t){return this._rootContext=t||this._rootContext},t.prototype._viewConfigFactory=function(t,e){this._viewConfigFactories[t]=e},t.prototype.createViewConfig=function(t,e){var r=this._viewConfigFactories[e.$type];if(!r)throw new Error("ViewService: No view config factory registered for type "+e.$type);var n=r(t,e);return re(n)?n:[n]},t.prototype.deactivateViewConfig=function(t){ze.traceViewServiceEvent("<- Removing",t),we(this._viewConfigs,t)},t.prototype.activateViewConfig=function(t){ze.traceViewServiceEvent("-> Registering",t),this._viewConfigs.push(t)},t.prototype.sync=function(){function e(t){var e=function(t){return t&&t.parent?e(t.parent)+1:1};return 1e4*t.fqn.split(".").length+e(t.creationContext)}function n(t){for(var e=t.viewDecl.$context,r=0;++r&&e.parent;)e=e.parent;return r}var i=this,o=this._uiViews.map(function(t){return[t.fqn,t]}).reduce(T,{}),a=r(function(t,e,r,n){return e*(t(r)-t(n))}),u=function(e){var r=i._viewConfigs.filter(t.matches(o,e));return r.length>1&&r.sort(a(n,-1)),[e,r[0]]},s=function(t){var e=t[0],r=t[1];-1!==i._uiViews.indexOf(e)&&e.configUpdated(r)},c=this._uiViews.sort(a(e,1)).map(u);ze.traceViewSync(c),c.forEach(s)},t.prototype.registerUIView=function(t){ze.traceViewServiceUIViewEvent("-> Registering",t);var e=this._uiViews,r=function(e){return e.fqn===t.fqn&&e.$type===t.$type};return e.filter(r).length&&ze.traceViewServiceUIViewEvent("!!!! duplicate uiView named:",t),e.push(t),this.sync(),function(){if(-1===e.indexOf(t))return void ze.traceViewServiceUIViewEvent("Tried removing non-registered uiView",t);ze.traceViewServiceUIViewEvent("<- Deregistering",t),we(e)(t)}},t.prototype.available=function(){return this._uiViews.map(At("fqn"))},t.prototype.active=function(){return this._uiViews.filter(At("$config")).map(At("name"))},t.normalizeUIViewTarget=function(t,e){void 0===e&&(e="");var r=e.split("@"),n=r[0]||"$default",i=te(r[1])?r[1]:"^",o=/^(\^(?:\.\^)*)\.(.*$)/.exec(n);(o&&(i=o[1],n=o[2]),"!"===n.charAt(0)&&(n=n.substr(1),i=""),/^(\^(?:\.\^)*)$/.exec(i))?i=i.split(".").reduce(function(t,e){return t.parent},t).name:"."===i&&(i=t.name);return{uiViewName:n,uiViewContextAnchor:i}},t.matches=function(t,e){return function(r){if(e.$type!==r.viewDecl.$type)return!1;var n=r.viewDecl,i=n.$uiViewName.split("."),o=e.fqn.split(".");if(!me(i,o.slice(0-i.length)))return!1;var a=1-i.length||void 0,u=o.slice(0,a).join("."),s=t[u].creationContext;return n.$uiViewContextAnchor===(s&&s.name)}},t}(),Nr=function(){function t(){this.params=new $r,this.lastStartedTransitionId=-1,this.transitionHistory=new Ne([],1),this.successfulTransitions=new Ne([],1)}return t.prototype.dispose=function(){this.transitionHistory.clear(),this.successfulTransitions.clear(),this.transition=null},t}(),Fr=function(t){return t.reduce(function(t,e){return t[e]=ue(e),t},{dispose:l})},Ur=["url","path","search","hash","onChange"],Lr=["port","protocol","host","baseHref","html5Mode","hashPrefix"],Mr=["type","caseInsensitive","strictMode","defaultSquashPolicy"],Br=["sort","when","initial","otherwise","rules","rule","removeRule"],Gr=["deferIntercept","listen","sync","match"],Wr=function(){function t(t,e){void 0===e&&(e=!0),this.router=t,this.rules={},this.config={};var r=function(){return t.locationService};p(r,this,r,Ur,e);var n=function(){return t.locationConfig};p(n,this.config,n,Lr,e);var i=function(){return t.urlMatcherFactory};p(i,this.config,i,Mr);var o=function(){return t.urlRouter};p(o,this.rules,o,Br),p(o,this,o,Gr)}return t.prototype.url=function(t,e,r){},t.prototype.path=function(){},t.prototype.search=function(){},t.prototype.hash=function(){},t.prototype.onChange=function(t){},t.prototype.parts=function(){return{path:this.path(),search:this.search(),hash:this.hash()}},t.prototype.dispose=function(){},t.prototype.sync=function(t){},t.prototype.listen=function(t){},t.prototype.deferIntercept=function(t){},t.prototype.match=function(t){},t.locationServiceStub=Fr(Ur),t.locationConfigStub=Fr(Lr),t}(),zr=0,Jr=function(){function t(t,e){void 0===t&&(t=Wr.locationServiceStub),void 0===e&&(e=Wr.locationConfigStub),this.locationService=t,this.locationConfig=e,this.$id=zr++,this._disposed=!1,this._disposables=[],this.trace=ze,this.viewService=new Dr,this.transitionService=new bn(this),this.globals=new Nr,this.urlMatcherFactory=new Ir,this.urlRouter=new qr(this),this.stateRegistry=new kr(this),this.stateService=new Rn(this),this.urlService=new Wr(this),this._plugins={},this.viewService._pluginapi._rootViewContext(this.stateRegistry.root()),this.globals.$current=this.stateRegistry.root(),this.globals.current=this.globals.$current.self,this.disposable(this.globals),this.disposable(this.stateService),this.disposable(this.stateRegistry),this.disposable(this.transitionService),this.disposable(this.urlRouter),this.disposable(t),this.disposable(e)}return t.prototype.disposable=function(t){this._disposables.push(t)},t.prototype.dispose=function(t){var e=this;if(t&&Zt(t.dispose))return void t.dispose(this);this._disposed=!0,this._disposables.slice().forEach(function(t){try{"function"==typeof t.dispose&&t.dispose(e),we(e._disposables,t)}catch(t){}})},t.prototype.plugin=function(t,e){void 0===e&&(e={});var r=new t(this,e);if(!r.name)throw new Error("Required property `name` missing on plugin: "+r);return this._disposables.push(r),this._plugins[r.name]=r},t.prototype.getPlugin=function(t){return t?this._plugins[t]:Re(this._plugins)},t}(),Qr=function(t){return t.onCreate({},ut)},Kr=function(t){function e(e){if(e)return e instanceof Je?e:te(e)?n.target(e,t.params(),t.options()):e.state||e.params?n.target(e.state||t.to(),e.params||t.params(),t.options()):void 0}var r=t.to().redirectTo;if(r){var n=t.router.stateService;return Zt(r)?se.$q.when(r(t)).then(e):e(r)}},Yr=function(t){return t.onStart({to:function(t){return!!t.redirectTo}},Kr)},Zr=st("onExit"),Xr=function(t){return t.onExit({exiting:function(t){return!!t.onExit}},Zr)},tn=st("onRetain"),en=function(t){return t.onRetain({retained:function(t){return!!t.onRetain}},tn)},rn=st("onEnter"),nn=function(t){return t.onEnter({entering:function(t){return!!t.onEnter}},rn)},on=function(t){return new pr(t.treeChanges().to).resolvePath("EAGER",t).then(l)},an=function(t){return t.onStart({},on,{priority:1e3})},un=function(t,e){return new pr(t.treeChanges().to).subContext(e.$$state()).resolvePath("LAZY",t).then(l)},sn=function(t){return t.onEnter({entering:Mt(!0)},un,{priority:1e3})},cn=function(t){var e=se.$q,r=t.views("entering");if(r.length)return e.all(r.map(function(t){return e.when(t.load())})).then(l)},fn=function(t){return t.onFinish({},cn)},ln=function(t){var e=t.views("entering"),r=t.views("exiting");if(e.length||r.length){var n=t.router.viewService;r.forEach(function(t){return n.deactivateViewConfig(t)}),e.forEach(function(t){return n.activateViewConfig(t)}),n.sync()}},pn=function(t){return t.onSuccess({},ln)},hn=function(t){var e=t.router.globals,r=function(){e.successfulTransitions.enqueue(t),e.$current=t.$to(),e.current=e.$current.self,he(t.params(),e.params)},n=function(){e.transition===t&&(e.transition=null)};t.onSuccess({},r,{priority:1e4}),t.promise.then(n,n)},dn=function(t){return t.onCreate({},hn)},vn=function(t){var e=t.options(),r=t.router.stateService,n=t.router.urlRouter;if("url"!==e.source&&e.location&&r.$current.navigable){var i={replace:"replace"===e.location};n.push(r.$current.navigable.url,r.params,i)}n.update(!0)},mn=function(t){return t.onSuccess({},vn,{priority:9999})},yn=function(t){function e(){if("url"!==t.originalTransition().options().source){var e=t.targetState();return r.stateService.target(e.identifier(),e.params(),e.options())}var n=r.urlService,i=n.match(n.parts()),o=i&&i.rule;if(o&&"STATE"===o.type){var a=o.state,u=i.match;return r.stateService.target(a,u,t.options())}r.urlService.sync()}var r=t.router,n=t.entering().filter(function(t){return!!t.$$state().lazyLoad}).map(function(e){return ct(t,e)});return se.$q.all(n).then(e)},gn=function(t){return t.onBefore({entering:function(t){return!!t.lazyLoad}},yn)},wn=function(){function t(t,e,r,n,i,o,a,u){void 0===i&&(i=!1),void 0===o&&(o=Ke.HANDLE_RESULT),void 0===a&&(a=Ke.REJECT_ERROR),void 0===u&&(u=!1),this.name=t,this.hookPhase=e,this.hookOrder=r,this.criteriaMatchPath=n,this.reverseSort=i,this.getResultHandler=o,this.getErrorHandler=a,this.synchronous=u}return t}(),_n=function(t){return t.onBefore({},ft,{priority:-9999})},$n=function(t){return t.onBefore({},lt,{priority:-1e4})},Sn={location:!0,relative:null,inherit:!1,notify:!0,reload:!1,custom:{},current:function(){return null},source:"unknown"},bn=function(){function e(t){this._transitionCount=0,this._eventTypes=[],this._registeredHooks={},this._criteriaPaths={},this._router=t,this.$view=t.viewService,this._deregisterHookFns={},this._pluginapi=p(Mt(this),{},Mt(this),["_definePathType","_defineEvent","_getPathTypes","_getEvents","getHooks"]),this._defineCorePaths(),this._defineCoreEvents(),this._registerCoreTransitionHooks()}return e.prototype.onCreate=function(t,e,r){},e.prototype.onBefore=function(t,e,r){},e.prototype.onStart=function(t,e,r){},e.prototype.onExit=function(t,e,r){},e.prototype.onRetain=function(t,e,r){},e.prototype.onEnter=function(t,e,r){},e.prototype.onFinish=function(t,e,r){},e.prototype.onSuccess=function(t,e,r){},e.prototype.onError=function(t,e,r){},e.prototype.dispose=function(t){Re(this._registeredHooks).forEach(function(t){return t.forEach(function(e){e._deregistered=!0,we(t,e)})})},e.prototype.create=function(t,e){return new vr(t,e,this._router)},e.prototype._defineCoreEvents=function(){var e=t.TransitionHookPhase,r=Ke,n=this._criteriaPaths;this._defineEvent("onCreate",e.CREATE,0,n.to,!1,r.LOG_REJECTED_RESULT,r.THROW_ERROR,!0),this._defineEvent("onBefore",e.BEFORE,0,n.to),this._defineEvent("onStart",e.RUN,0,n.to),this._defineEvent("onExit",e.RUN,100,n.exiting,!0),this._defineEvent("onRetain",e.RUN,200,n.retained),this._defineEvent("onEnter",e.RUN,300,n.entering),this._defineEvent("onFinish",e.RUN,400,n.to),this._defineEvent("onSuccess",e.SUCCESS,0,n.to,!1,r.LOG_REJECTED_RESULT,r.LOG_ERROR,!0),this._defineEvent("onError",e.ERROR,0,n.to,!1,r.LOG_REJECTED_RESULT,r.LOG_ERROR,!0)},e.prototype._defineCorePaths=function(){var e=t.TransitionHookScope.STATE,r=t.TransitionHookScope.TRANSITION;this._definePathType("to",r),this._definePathType("from",r),this._definePathType("exiting",e),this._definePathType("retained",e),this._definePathType("entering",e)},e.prototype._defineEvent=function(t,e,r,n,i,o,a,u){void 0===i&&(i=!1),void 0===o&&(o=Ke.HANDLE_RESULT),void 0===a&&(a=Ke.REJECT_ERROR),void 0===u&&(u=!1);var s=new wn(t,e,r,n,i,o,a,u);this._eventTypes.push(s),q(this,this,s)},e.prototype._getEvents=function(t){return(Qt(t)?this._eventTypes.filter(function(e){return e.hookPhase===t}):this._eventTypes.slice()).sort(function(t,e){var r=t.hookPhase-e.hookPhase;return 0===r?t.hookOrder-e.hookOrder:r})},e.prototype._definePathType=function(t,e){this._criteriaPaths[t]={name:t,scope:e}},e.prototype._getPathTypes=function(){return this._criteriaPaths},e.prototype.getHooks=function(t){return this._registeredHooks[t]},e.prototype._registerCoreTransitionHooks=function(){var t=this._deregisterHookFns;t.addCoreResolves=Qr(this),t.ignored=_n(this),t.invalid=$n(this),t.redirectTo=Yr(this),t.onExit=Xr(this),t.onRetain=en(this),t.onEnter=nn(this),t.eagerResolve=an(this),t.lazyResolve=sn(this),t.loadViews=fn(this),t.activateViews=pn(this),t.updateGlobals=dn(this),t.updateUrl=mn(this),t.lazyLoad=gn(this)},e}(),Rn=function(){function e(t){this.router=t,this.invalidCallbacks=[],this._defaultErrorHandler=function(t){t instanceof Error&&t.stack?(console.error(t),console.error(t.stack)):t instanceof Ue?(console.error(t.toString()),t.detail&&t.detail.stack&&console.error(t.detail.stack)):console.error(t)};var r=["current","$current","params","transition"],n=Object.keys(e.prototype).filter(Dt(ge(r)));p(Mt(e.prototype),this,Mt(this),n)}return Object.defineProperty(e.prototype,"transition",{get:function(){return this.router.globals.transition},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"params",{get:function(){return this.router.globals.params},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"current",{get:function(){return this.router.globals.current},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"$current",{get:function(){return this.router.globals.$current},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this.defaultErrorHandler(l),this.invalidCallbacks=[]},e.prototype._handleInvalidTargetState=function(t,e){function r(){var t=s.dequeue();return void 0===t?Ue.invalid(e.error()).toPromise():se.$q.when(t(e,i,c)).then(f).then(function(t){return t||r()})}var n=this,i=ir.makeTargetState(t),o=this.router.globals,a=function(){return o.transitionHistory.peekTail()},u=a(),s=new Ne(this.invalidCallbacks.slice()),c=new pr(t).injector(),f=function(t){if(t instanceof Je){var e=t;return e=n.target(e.identifier(),e.params(),e.options()),e.valid()?a()!==u?Ue.superseded().toPromise():n.transitionTo(e.identifier(),e.params(),e.options()):Ue.invalid(e.error()).toPromise()}};return r()},e.prototype.onInvalid=function(t){return this.invalidCallbacks.push(t),function(){we(this.invalidCallbacks)(t)}.bind(this)},e.prototype.reload=function(t){return this.transitionTo(this.current,this.params,{reload:!Qt(t)||t,inherit:!1,notify:!1})},e.prototype.go=function(t,e,r){var n={relative:this.$current,inherit:!0},i=m(r,n,Sn);return this.transitionTo(t,e,i)},e.prototype.target=function(t,e,r){if(void 0===r&&(r={}),ee(r.reload)&&!r.reload.name)throw new Error("Invalid reload state object");var n=this.router.stateRegistry;if(r.reloadState=!0===r.reload?n.root():n.matcher.find(r.reload,r.relative),r.reload&&!r.reloadState)throw new Error("No such reload state '"+(te(r.reload)?r.reload:r.reload.name)+"'");var i=n.matcher.find(t,r.relative);return new Je(t,i,e,r)},e.prototype.getCurrentPath=function(){var t=this,e=this.router.globals,r=e.successfulTransitions.peekTail();return r?r.treeChanges().to:function(){return[new nr(t.router.stateRegistry.root())]}()},e.prototype.transitionTo=function(e,r,n){var i=this;void 0===r&&(r={}),void 0===n&&(n={});var o=this.router,a=o.globals;n=m(n,Sn),n=ve(n,{current:function(){return a.transition}});var u=this.target(e,r,n),s=this.getCurrentPath();if(!u.exists())return this._handleInvalidTargetState(s,u);if(!u.valid())return De(u.error());var c=function(e){return function(r){if(r instanceof Ue){var n=o.globals.lastStartedTransitionId===e.$id;if(r.type===t.RejectType.IGNORED)return n&&o.urlRouter.update(),se.$q.when(a.current);var u=r.detail;if(r.type===t.RejectType.SUPERSEDED&&r.redirected&&u instanceof Je){var s=e.redirect(u);return s.run().catch(c(s))}if(r.type===t.RejectType.ABORTED)return n&&o.urlRouter.update(),se.$q.reject(r)}return i.defaultErrorHandler()(r),se.$q.reject(r)}},f=this.router.transitionService.create(s,u),l=f.run().catch(c(f));return qe(l),ve(l,{transition:f})},e.prototype.is=function(t,e,r){r=m(r,{relative:this.$current});var n=this.router.stateRegistry.matcher.find(t,r.relative);if(Qt(n)){if(this.$current!==n)return!1;if(!e)return!0;var i=n.parameters({inherit:!0,matchingKeys:e});return rr.equals(i,rr.values(i,e),this.params)}},e.prototype.includes=function(t,e,r){r=m(r,{relative:this.$current});var n=te(t)&&Bt.fromString(t);if(n){if(!n.matches(this.$current.name))return!1;t=this.$current.name}var i=this.router.stateRegistry.matcher.find(t,r.relative),o=this.$current.includes;if(Qt(i)){if(!Qt(o[i.name]))return!1;if(!e)return!0;var a=i.parameters({inherit:!0,matchingKeys:e});return rr.equals(a,rr.values(a,e),this.params)}},e.prototype.href=function(t,e,r){r=m(r,{lossy:!0,inherit:!0,absolute:!1,relative:this.$current}),e=e||{};var n=this.router.stateRegistry.matcher.find(t,r.relative);if(!Qt(n))return null;r.inherit&&(e=this.params.$inherit(e,this.$current,n));var i=n&&r.lossy?n.navigable:n;return i&&void 0!==i.url&&null!==i.url?this.router.urlRouter.href(i.url,e,{absolute:r.absolute}):null},e.prototype.defaultErrorHandler=function(t){return this._defaultErrorHandler=t||this._defaultErrorHandler},e.prototype.get=function(t,e){var r=this.router.stateRegistry;return 0===arguments.length?r.get():r.get(t,e||this.$current)},e.prototype.lazyLoad=function(t,e){var r=this.get(t);if(!r||!r.lazyLoad)throw new Error("Can not lazy load "+t);var n=this.getCurrentPath(),i=ir.makeTargetState(n);return e=e||this.router.transitionService.create(n,i),ct(e,r)},e}(),En={when:function(t){return new Promise(function(e,r){return e(t)})},reject:function(t){return new Promise(function(e,r){r(t)})},defer:function(){var t={};return t.promise=new Promise(function(e,r){t.resolve=e,t.reject=r}),t},all:function(t){if(re(t))return Promise.all(t);if(ee(t)){var e=Object.keys(t).map(function(e){return t[e].then(function(t){return{key:e,val:t}})});return En.all(e).then(function(t){return t.reduce(function(t,e){return t[e.key]=e.val,t},{})})}}},Cn={},Tn=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm,Pn=/([^\s,]+)/g,kn={get:function(t){return Cn[t]},has:function(t){return null!=kn.get(t)},invoke:function(t,e,r){var n=ve({},Cn,r||{}),i=kn.annotate(t),o=je(function(t){return n.hasOwnProperty(t)},function(t){return"DI can't find injectable: '"+t+"'"}),a=i.filter(o).map(function(t){return n[t]});return Zt(t)?t.apply(e,a):t.slice(-1)[0].apply(e,a)},annotate:function(t){if(!c(t))throw new Error("Not an injectable function: "+t);if(t&&t.$inject)return t.$inject;if(re(t))return t.slice(0,-1);var e=t.toString().replace(Tn,"");return e.slice(e.indexOf("(")+1,e.indexOf(")")).match(Pn)||[]}},On=function(t){return function(e){if(!e)return["",""];var r=e.indexOf(t);return-1===r?[e,""]:[e.substr(0,r),e.substr(r+1)]}},xn=On("#"),jn=On("?"),In=On("="),Vn=function(t){return t?t.replace(/^#/,""):""},An=function(t,e){var r=e[0],n=e[1];return t.hasOwnProperty(r)?re(t[r])?t[r].push(n):t[r]=[t[r],n]:t[r]=n,t},Hn=function(t){return t.split("&").filter(f).map(In).reduce(An,{})},qn=function(t){var e=t.path(),r=t.search(),n=t.hash(),i=Object.keys(r).map(function(t){var e=r[t];return(re(e)?e:[e]).map(function(e){return t+"="+e})}).reduce(Te,[]).join("&");return e+(i?"?"+i:"")+(n?"#"+n:"")},Dn=function(){function t(t,e){var r=this;this.fireAfterUpdate=e,this._listener=function(t){return r._listeners.forEach(function(e){return e(t)})},this._listeners=[],this.hash=function(){return pt(r._get()).hash},this.path=function(){return pt(r._get()).path},this.search=function(){return Hn(pt(r._get()).search)},this._location=window&&window.location,this._history=window&&window.history}return t.prototype.url=function(t,e){if(void 0===e&&(e=!0),Qt(t)&&t!==this._get()&&(this._set(null,null,t,e),this.fireAfterUpdate)){var r=ve(new Event("locationchange"),{url:t});this._listeners.forEach(function(t){return t(r)})}return qn(this)},t.prototype.onChange=function(t){var e=this;return this._listeners.push(t),function(){return we(e._listeners,t)}},t.prototype.dispose=function(t){$e(this._listeners)},t}(),Nn=function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Fn=function(t){function e(e){var r=t.call(this,e,!1)||this;return window.addEventListener("hashchange",r._listener,!1),r}return Nn(e,t),e.prototype._get=function(){return Vn(this._location.hash)},e.prototype._set=function(t,e,r,n){this._location.hash=r},e.prototype.dispose=function(e){t.prototype.dispose.call(this,e),window.removeEventListener("hashchange",this._listener)},e}(Dn),Un=function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ln=function(t){function e(e){return t.call(this,e,!0)||this}return Un(e,t),e.prototype._get=function(){return this._url},e.prototype._set=function(t,e,r,n){this._url=r},e}(Dn),Mn=function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Bn=function(t){function e(e){var r=t.call(this,e,!0)||this;return r._config=e.urlService.config,window.addEventListener("popstate",r._listener,!1),r}return Mn(e,t),e.prototype._get=function(){var t=this._location,e=t.pathname,r=t.hash,n=t.search;return n=jn(n)[1],r=xn(r)[1],e+(n?"?"+n:"")+(r?"$"+n:"")},e.prototype._set=function(t,e,r,n){var i=this,o=i._config,a=i._history,u=o.baseHref()+r;n?a.replaceState(t,e,u):a.pushState(t,e,u)},e.prototype.dispose=function(e){t.prototype.dispose.call(this,e),window.removeEventListener("popstate",this._listener)},e}(Dn),Gn=function(){function t(){var t=this;this._baseHref="",this._port=80,this._protocol="http",this._host="localhost",this._hashPrefix="",this.port=function(){return t._port},this.protocol=function(){return t._protocol},this.host=function(){return t._host},this.baseHref=function(){return t._baseHref},this.html5Mode=function(){return!1},this.hashPrefix=function(e){return Qt(e)?t._hashPrefix=e:t._hashPrefix},this.dispose=l}return t}(),Wn=function(){function t(t,e){void 0===e&&(e=!1),this._isHtml5=e,this._baseHref=void 0,this._hashPrefix=""}return t.prototype.port=function(){return location.port?Number(location.port):"https"===this.protocol()?443:80},t.prototype.protocol=function(){return location.protocol.replace(/:/g,"")},t.prototype.host=function(){return location.host},t.prototype.html5Mode=function(){return this._isHtml5},t.prototype.hashPrefix=function(t){return Qt(t)?this._hashPrefix=t:this._hashPrefix},t.prototype.baseHref=function(t){return Qt(t)?this._baseHref=t:this._baseHref||this.applyDocumentBaseHref()},t.prototype.applyDocumentBaseHref=function(){var t=document.getElementsByTagName("base");return this._baseHref=t.length?t[0].href.substr(location.origin.length):""},t.prototype.dispose=function(){},t}(),zn=ht("vanilla.hashBangLocation",!1,Fn,Wn),Jn=ht("vanilla.pushStateLocation",!0,Bn,Wn),Qn=ht("vanilla.memoryLocation",!1,Ln,Gn),Kn=function(){function t(){}return t.prototype.dispose=function(t){},t}(),Yn=Object.freeze({fromJson:le,toJson:pe,copy:he,forEach:de,extend:ve,equals:me,identity:f,noop:l,createProxyFunctions:p,inherit:ye,inArray:ge,_inArray:h,removeFrom:we,_removeFrom:d,pushTo:_e,_pushTo:v,deregAll:$e,defaults:m,mergeR:Se,ancestors:y,pick:g,omit:w,pluck:_,filter:$,find:S,mapObj:be,map:b,values:Re,allTrueR:Ee,anyTrueR:Ce,unnestR:Te,flattenR:Pe,pushR:R,uniqR:ke,unnest:Oe,flatten:xe,assertPredicate:je,assertMap:Ie,assertFn:E,pairs:Ve,arrayTuples:C,applyPairs:T,tail:P,_extend:x,sortBy:Ae,composeSort:He,silenceUncaughtInPromise:qe,silentRejection:De,notImplemented:ue,services:se,Glob:Bt,curry:r,compose:n,pipe:i,prop:At,propEq:Ht,parse:qt,not:Dt,and:o,or:a,all:Nt,any:Ft,is:Ut,eq:Lt,val:Mt,invoke:u,pattern:s,isUndefined:Jt,isDefined:Qt,isNull:Kt,isNullOrUndefined:Yt,isFunction:Zt,isNumber:Xt,isString:te,isObject:ee,isArray:re,isDate:ne,isRegExp:ie,isState:oe,isInjectable:c,isPromise:ae,Queue:Ne,maxLength:B,padString:G,kebobString:W,functionToString:z,fnToString:J,stringify:Q,beforeAfterSubstr:gr,splitOnDelim:K,joinNeighborsR:Y,get Category(){return t.Category},Trace:We,trace:ze,get DefType(){return t.DefType},Param:rr,ParamTypes:wr,StateParams:$r,ParamType:Xe,PathNode:nr,PathUtils:ir,resolvePolicies:ur,defaultResolvePolicy:or,Resolvable:ar,NATIVE_INJECTOR_TOKEN:lr,ResolveContext:pr,resolvablesBuilder:nt,StateBuilder:Cr,StateObject:Gt,StateMatcher:Tr,StateQueueManager:Pr,StateRegistry:kr,StateService:Rn,TargetState:Je,get TransitionHookPhase(){return t.TransitionHookPhase},get TransitionHookScope(){return t.TransitionHookScope},HookBuilder:Ze,matchState:H,RegisteredHook:Ye,makeEvent:q,get RejectType(){return t.RejectType},Rejection:Ue,Transition:vr,TransitionHook:Ke,TransitionEventType:wn,defaultTransOpts:Sn,TransitionService:bn,UrlMatcher:jr,UrlMatcherFactory:Ir,UrlRouter:qr,UrlRuleFactory:Vr,BaseUrlRule:Ar,UrlService:Wr,ViewService:Dr,UIRouterGlobals:Nr,UIRouter:Jr,$q:En,$injector:kn,BaseLocationServices:Dn,HashLocationService:Fn,MemoryLocationService:Ln,PushStateLocationService:Bn,MemoryLocationConfig:Gn,BrowserLocationConfig:Wn,splitHash:xn,splitQuery:jn,splitEqual:In,trimHashVal:Vn,keyValsToObjectR:An,getParams:Hn,parseUrl:pt,buildUrl:qn,locationPluginFactory:ht,servicesPlugin:dt,hashLocationPlugin:zn,pushStateLocationPlugin:Jn,memoryLocationPlugin:Qn,UIRouterPluginBase:Kn}),Zn=function(t,e){return t.reduce(function(t,r){return t||Qt(e[r])},!1)},Xn=0,ti=function(){function t(t,e,r){var n=this;this.path=t,this.viewDecl=e,this.factory=r,this.$id=Xn++,this.loaded=!1,this.getTemplate=function(t,e){return n.component?n.factory.makeComponentTemplate(t,e,n.component,n.viewDecl.bindings):n.template}}return t.prototype.load=function(){var t=this,e=se.$q,r=new pr(this.path),n=this.path.reduce(function(t,e){return ve(t,e.paramValues)},{}),i={template:e.when(this.factory.fromConfig(this.viewDecl,n,r)),controller:e.when(this.getController(r))};return e.all(i).then(function(e){return ze.traceViewServiceEvent("Loaded",t),t.controller=e.controller,ve(t,e.template),t})}, t.prototype.getController=function(t){var e=this.viewDecl.controllerProvider;if(!c(e))return this.viewDecl.controller;var r=se.$injector.annotate(e),n=re(e)?P(e):e;return new ar("",n,r).get(t)},t}(),ei=function(){function t(){var t=this;this._useHttp=Vt.version.minor<3,this.$get=["$http","$templateCache","$injector",function(e,r,n){return t.$templateRequest=n.has&&n.has("$templateRequest")&&n.get("$templateRequest"),t.$http=e,t.$templateCache=r,t}]}return t.prototype.useHttpService=function(t){this._useHttp=t},t.prototype.fromConfig=function(t,e,r){var n=function(t){return se.$q.when(t).then(function(t){return{template:t}})},i=function(t){return se.$q.when(t).then(function(t){return{component:t}})};return Qt(t.template)?n(this.fromString(t.template,e)):Qt(t.templateUrl)?n(this.fromUrl(t.templateUrl,e)):Qt(t.templateProvider)?n(this.fromProvider(t.templateProvider,e,r)):Qt(t.component)?i(t.component):Qt(t.componentProvider)?i(this.fromComponentProvider(t.componentProvider,e,r)):n("")},t.prototype.fromString=function(t,e){return Zt(t)?t(e):t},t.prototype.fromUrl=function(t,e){return Zt(t)&&(t=t(e)),null==t?null:this._useHttp?this.$http.get(t,{cache:this.$templateCache,headers:{Accept:"text/html"}}).then(function(t){return t.data}):this.$templateRequest(t)},t.prototype.fromProvider=function(t,e,r){var n=se.$injector.annotate(t),i=re(t)?P(t):t;return new ar("",i,n).get(r)},t.prototype.fromComponentProvider=function(t,e,r){var n=se.$injector.annotate(t),i=re(t)?P(t):t;return new ar("",i,n).get(r)},t.prototype.makeComponentTemplate=function(t,e,r,n){n=n||{};var i=Vt.version.minor>=3?"::":"",o=function(t){var e=W(t);return/^(x|data)-/.exec(e)?"x-"+e:e},a=function(r){var a=r.name,u=r.type,s=o(a);if(t.attr(s)&&!n[a])return s+"='"+t.attr(s)+"'";var c=n[a]||a;if("@"===u)return s+"='{{"+i+"$resolve."+c+"}}'";if("&"===u){var f=e.getResolvable(c),l=f&&f.data,p=l&&se.$injector.annotate(l)||[];return s+"='$resolve."+c+(re(l)?"["+(l.length-1)+"]":"")+"("+p.join(",")+")'"}return s+"='"+i+"$resolve."+c+"'"},u=yt(r).map(a).join(" "),s=o(r);return"<"+s+" "+u+">"},t}(),ri=function(t){return ni(ee(t.bindToController)?t.bindToController:t.scope)},ni=function(t){return Object.keys(t||{}).map(function(e){return[e,/^([=<@&])[?]?(.*)/.exec(t[e])]}).filter(function(t){return Qt(t)&&re(t[1])}).map(function(t){return{name:t[1][2]||t[0],type:t[1][1]}})},ii=function(){function t(e,r){this.stateRegistry=e,this.stateService=r,p(Mt(t.prototype),this,Mt(this))}return t.prototype.decorator=function(t,e){return this.stateRegistry.decorator(t,e)||this},t.prototype.state=function(t,e){return ee(t)?e=t:e.name=t,this.stateRegistry.register(e),this},t.prototype.onInvalid=function(t){return this.stateService.onInvalid(t)},t}(),oi=function(t){return function(e,r){function n(t,e){var r=new pr(t.treeChanges(o)),n=ve(gi(r),{$state$:e,$transition$:t});return se.$injector.invoke(i,this,n)}var i=e[t],o="onExit"===t?"from":"to";return i?n:void 0}},ai=function(){function t(t){this._urlListeners=[],this.$locationProvider=t;var e=Mt(t);p(e,this,e,["hashPrefix"])}return t.prototype.dispose=function(){},t.prototype.onChange=function(t){var e=this;return this._urlListeners.push(t),function(){return we(e._urlListeners)(t)}},t.prototype.html5Mode=function(){var t=this.$locationProvider.html5Mode();return(t=ee(t)?t.enabled:t)&&this.$sniffer.history},t.prototype.url=function(t,e,r){return void 0===e&&(e=!1),t&&this.$location.url(t),e&&this.$location.replace(),r&&this.$location.state(r),this.$location.url()},t.prototype._runtimeServices=function(t,e,r,n){var i=this;this.$location=e,this.$sniffer=r,t.$on("$locationChangeSuccess",function(t){return i._urlListeners.forEach(function(e){return e(t)})});var o=Mt(e),a=Mt(n);p(o,this,o,["replace","path","search","hash"]),p(o,this,o,["port","protocol","host"]),p(a,this,a,["baseHref"])},t.monkeyPatchPathParameterType=function(t){var e=t.urlMatcherFactory.type("path");e.encode=function(t){return null!=t?t.toString().replace(/(~|\/)/g,function(t){return{"~":"~~","/":"~2F"}[t]}):t},e.decode=function(t){return null!=t?t.toString().replace(/(~~|~2F)/g,function(t){return{"~~":"~","~2F":"/"}[t]}):t}},t}(),ui=function(){function t(t){this._router=t,this._urlRouter=t.urlRouter}return t.prototype.$get=function(){var t=this._urlRouter;return t.update(!0),t.interceptDeferred||t.listen(),t},t.prototype.rule=function(t){var e=this;if(!Zt(t))throw new Error("'rule' must be a function");var r=function(){return t(se.$injector,e._router.locationService)},n=new Ar(r,f);return this._urlRouter.rule(n),this},t.prototype.otherwise=function(t){var e=this,r=this._urlRouter;if(te(t))r.otherwise(t);else{if(!Zt(t))throw new Error("'rule' must be a string or function");r.otherwise(function(){return t(se.$injector,e._router.locationService)})}return this},t.prototype.when=function(e,r){return(re(r)||Zt(r))&&(r=t.injectableHandler(this._router,r)),this._urlRouter.when(e,r),this},t.injectableHandler=function(t,e){return function(r){return se.$injector.invoke(e,null,{$match:r,$stateParams:t.globals.params})}},t.prototype.deferIntercept=function(t){this._urlRouter.deferIntercept(t)},t}();Vt.module("ui.router.angular1",[]);var si=Vt.module("ui.router.init",[]),ci=Vt.module("ui.router.util",["ng","ui.router.init"]),fi=Vt.module("ui.router.router",["ui.router.util"]),li=Vt.module("ui.router.state",["ui.router.router","ui.router.util","ui.router.angular1"]),pi=Vt.module("ui.router",["ui.router.init","ui.router.state","ui.router.angular1"]),hi=(Vt.module("ui.router.compat",["ui.router"]),null);gt.$inject=["$locationProvider"];var di=function(t){return["$uiRouterProvider",function(e){var r=e.router[t];return r.$get=function(){return r},r}]};wt.$inject=["$injector","$q","$uiRouter"];var vi=function(t){return t.urlRouterProvider=new ui(t)},mi=function(){return ve(hi.stateProvider,{$get:function(){return hi.stateService}})};_t.$inject=["$rootScope"],si.provider("$uiRouter",gt),fi.provider("$urlRouter",["$uiRouterProvider",vi]),ci.provider("$urlService",di("urlService")),ci.provider("$urlMatcherFactory",["$uiRouterProvider",function(){return hi.urlMatcherFactory}]),ci.provider("$templateFactory",function(){return new ei}),li.provider("$stateRegistry",di("stateRegistry")),li.provider("$uiRouterGlobals",di("globals")),li.provider("$transitions",di("transitionService")),li.provider("$state",["$uiRouterProvider",mi]),li.factory("$stateParams",["$uiRouter",function(t){return t.globals.params}]),pi.factory("$view",function(){return hi.viewService}),pi.service("$trace",function(){return ze}),pi.run(_t),ci.run(["$urlMatcherFactory",function(t){}]),li.run(["$state",function(t){}]),fi.run(["$urlRouter",function(t){}]),si.run(wt);var yi,gi=function(t){return t.getTokens().filter(te).map(function(e){var r=t.getResolvable(e);return[e,"NOWAIT"===t.getPolicy(r).async?r.promise:r.data]}).reduce(T,{})};yi=["$uiRouter","$timeout",function(t,e){var r=t.stateService;return{restrict:"A",require:["?^uiSrefActive","?^uiSrefActiveEq"],link:function(n,i,o,a){function u(){var t=h();l&&l(),f&&(l=f.$$addStateInfo(t.uiState,t.uiStateParams)),null!=t.href&&o.$set(c.attr,t.href)}var s,c=Rt(i),f=a[1]||a[0],l=null,p={},h=function(){return bt(r,i,p)},d=$t(o.uiSref);p.uiState=d.state,p.uiStateOpts=o.uiSrefOpts?n.$eval(o.uiSrefOpts):{},d.paramExpr&&(n.$watch(d.paramExpr,function(t){p.uiStateParams=ve({},t),u()},!0),p.uiStateParams=ve({},n.$eval(d.paramExpr))),u(),n.$on("$destroy",t.stateRegistry.onStatesChanged(u)),n.$on("$destroy",t.transitionService.onSuccess({},u)),c.clickable&&(s=Et(i,r,e,c,h),Tt(i,n,s,p.uiStateOpts))}}}];var wi;wi=["$uiRouter","$timeout",function(t,e){var r=t.stateService;return{restrict:"A",require:["?^uiSrefActive","?^uiSrefActiveEq"],link:function(n,i,o,a){function u(){var t=d();p&&p(),f&&(p=f.$$addStateInfo(t.uiState,t.uiStateParams)),null!=t.href&&o.$set(c.attr,t.href)}var s,c=Rt(i),f=a[1]||a[0],p=null,h={},d=function(){return bt(r,i,h)},v=["uiState","uiStateParams","uiStateOpts"],m=v.reduce(function(t,e){return t[e]=l,t},{});v.forEach(function(t){h[t]=o[t]?n.$eval(o[t]):null,o.$observe(t,function(e){m[t](),m[t]=n.$watch(e,function(e){h[t]=e,u()},!0)})}),u(),n.$on("$destroy",t.stateRegistry.onStatesChanged(u)),n.$on("$destroy",t.transitionService.onSuccess({},u)),c.clickable&&(s=Et(i,r,e,c,d),Tt(i,n,s,h.uiStateOpts))}}}];var _i;_i=["$state","$stateParams","$interpolate","$uiRouter",function(t,e,r,n){return{restrict:"A",controller:["$scope","$element","$attrs",function(e,i,o){function a(t){t.promise.then(s,l)}function u(e,r,n){var o=t.get(e,St(i)),a={state:o||{name:e},params:r,activeClass:n};return h.push(a),function(){we(h)(a)}}function s(){var r=function(t){return t.split(/\s/).filter(f)},n=function(t){return t.map(function(t){return t.activeClass}).map(r).reduce(Te,[])},o=n(h).concat(r(c)).reduce(ke,[]),a=n(h.filter(function(e){return t.includes(e.state.name,e.params)})),u=!!h.filter(function(e){return t.is(e.state.name,e.params)}).length,s=u?r(c):[],l=a.concat(s).reduce(ke,[]),p=o.filter(function(t){return!ge(l,t)});e.$evalAsync(function(){l.forEach(function(t){return i.addClass(t)}),p.forEach(function(t){return i.removeClass(t)})})}var c,p,h=[];c=r(o.uiSrefActiveEq||"",!1)(e);try{p=e.$eval(o.uiSrefActive)}catch(t){}p=p||r(o.uiSrefActive||"",!1)(e),ee(p)&&de(p,function(t,r){if(te(t)){var n=$t(t);u(n.state,e.$eval(n.paramExpr),r)}}),this.$$addStateInfo=function(t,e){if(!(ee(p)&&h.length>0)){var r=u(t,e,p);return s(),r}},e.$on("$stateChangeSuccess",s),e.$on("$destroy",n.transitionService.onStart({},a)),n.globals.transition&&a(n.globals.transition),s()}]}}],Vt.module("ui.router.state").directive("uiSref",yi).directive("uiSrefActive",_i).directive("uiSrefActiveEq",_i).directive("uiState",wi),Pt.$inject=["$state"],kt.$inject=["$state"],Vt.module("ui.router.state").filter("isState",Pt).filter("includedByState",kt);var $i;$i=["$view","$animate","$uiViewScroll","$interpolate","$q",function(t,e,r,n,i){function o(t,r){return{enter:function(t,r,n){Vt.version.minor>2?e.enter(t,null,r).then(n):e.enter(t,null,r,n)},leave:function(t,r){Vt.version.minor>2?e.leave(t).then(r):e.leave(t,r)}}}function a(t,e){return t===e}var u={$cfg:{viewDecl:{$context:t._pluginapi._rootViewContext()}},$uiView:{}},s={count:0,restrict:"ECA",terminal:!0,priority:400,transclude:"element",compile:function(e,c,f){return function(e,c,l){function p(t){(!t||t instanceof ti)&&(a(S,t)||(ze.traceUIViewConfigUpdated(E,t&&t.viewDecl&&t.viewDecl.$context),S=t,d(t)))}function h(){if(v&&(ze.traceUIViewEvent("Removing (previous) el",v.data("$uiView")),v.remove(),v=null),y&&(ze.traceUIViewEvent("Destroying scope",E),y.$destroy(),y=null),m){var t=m.data("$uiViewAnim");ze.traceUIViewEvent("Animate out",t),$.leave(m,function(){t.$$animLeave.resolve(),v=null}),v=m,m=null}}function d(t){var n=e.$new(),o=i.defer(),a=i.defer(),u={$cfg:t,$uiView:E},s={$animEnter:o.promise,$animLeave:a.promise,$$animLeave:a};n.$emit("$viewContentLoading",R);var l=f(n,function(t){t.data("$uiViewAnim",s),t.data("$uiView",u),$.enter(t,c,function(){o.resolve(),y&&y.$emit("$viewContentAnimationEnded"),(Qt(_)&&!_||e.$eval(_))&&r(t)}),h()});m=l,y=n,y.$emit("$viewContentLoaded",t||S),y.$eval(w)}var v,m,y,g,w=l.onload||"",_=l.autoscroll,$=o(l,e),S=void 0,b=c.inheritedData("$uiView")||u,R=n(l.uiView||l.name||"")(e)||"$default",E={$type:"ng1",id:s.count++,name:R,fqn:b.$uiView.fqn?b.$uiView.fqn+"."+R:R,config:null,configUpdated:p,get creationContext(){var t=qt("$cfg.viewDecl.$context")(b),e=qt("$uiView.creationContext")(b);return t||e}};ze.traceUIViewEvent("Linking",E),c.data("$uiView",{$uiView:E}),d(),g=t.registerUIView(E),e.$on("$destroy",function(){ze.traceUIViewEvent("Destroying/Unregistering",E),g()})}}};return s}],Ot.$inject=["$compile","$controller","$transitions","$view","$q","$timeout"];var Si="function"==typeof Vt.module("ui.router").component,bi=0;Vt.module("ui.router.state").directive("uiView",$i),Vt.module("ui.router.state").directive("uiView",Ot),Vt.module("ui.router.state").provider("$uiViewScroll",jt);t.default="ui.router",t.core=Yn,t.watchDigests=_t,t.getLocals=gi,t.getNg1ViewConfigFactory=vt,t.ng1ViewsBuilder=mt,t.Ng1ViewConfig=ti,t.StateProvider=ii,t.UrlRouterProvider=ui,t.fromJson=le,t.toJson=pe,t.copy=he,t.forEach=de,t.extend=ve,t.equals=me,t.identity=f,t.noop=l,t.createProxyFunctions=p,t.inherit=ye,t.inArray=ge,t._inArray=h,t.removeFrom=we,t._removeFrom=d,t.pushTo=_e,t._pushTo=v,t.deregAll=$e,t.defaults=m,t.mergeR=Se,t.ancestors=y,t.pick=g,t.omit=w,t.pluck=_,t.filter=$,t.find=S,t.mapObj=be,t.map=b,t.values=Re,t.allTrueR=Ee,t.anyTrueR=Ce,t.unnestR=Te,t.flattenR=Pe,t.pushR=R,t.uniqR=ke,t.unnest=Oe,t.flatten=xe,t.assertPredicate=je,t.assertMap=Ie,t.assertFn=E,t.pairs=Ve,t.arrayTuples=C,t.applyPairs=T,t.tail=P,t._extend=x,t.sortBy=Ae,t.composeSort=He,t.silenceUncaughtInPromise=qe,t.silentRejection=De,t.notImplemented=ue,t.services=se,t.Glob=Bt,t.curry=r,t.compose=n,t.pipe=i,t.prop=At,t.propEq=Ht,t.parse=qt,t.not=Dt,t.and=o,t.or=a,t.all=Nt,t.any=Ft,t.is=Ut,t.eq=Lt,t.val=Mt,t.invoke=u,t.pattern=s,t.isUndefined=Jt,t.isDefined=Qt,t.isNull=Kt,t.isNullOrUndefined=Yt,t.isFunction=Zt,t.isNumber=Xt,t.isString=te,t.isObject=ee,t.isArray=re,t.isDate=ne,t.isRegExp=ie,t.isState=oe,t.isInjectable=c,t.isPromise=ae,t.Queue=Ne,t.maxLength=B,t.padString=G,t.kebobString=W,t.functionToString=z,t.fnToString=J,t.stringify=Q,t.beforeAfterSubstr=gr,t.splitOnDelim=K,t.joinNeighborsR=Y,t.Trace=We,t.trace=ze,t.Param=rr,t.ParamTypes=wr,t.StateParams=$r,t.ParamType=Xe,t.PathNode=nr,t.PathUtils=ir,t.resolvePolicies=ur,t.defaultResolvePolicy=or,t.Resolvable=ar,t.NATIVE_INJECTOR_TOKEN=lr,t.ResolveContext=pr,t.resolvablesBuilder=nt,t.StateBuilder=Cr,t.StateObject=Gt,t.StateMatcher=Tr,t.StateQueueManager=Pr,t.StateRegistry=kr,t.StateService=Rn,t.TargetState=Je,t.HookBuilder=Ze,t.matchState=H,t.RegisteredHook=Ye,t.makeEvent=q,t.Rejection=Ue,t.Transition=vr,t.TransitionHook=Ke,t.TransitionEventType=wn,t.defaultTransOpts=Sn,t.TransitionService=bn,t.UrlMatcher=jr,t.UrlMatcherFactory=Ir,t.UrlRouter=qr,t.UrlRuleFactory=Vr,t.BaseUrlRule=Ar,t.UrlService=Wr,t.ViewService=Dr,t.UIRouterGlobals=Nr,t.UIRouter=Jr,t.$q=En,t.$injector=kn,t.BaseLocationServices=Dn,t.HashLocationService=Fn,t.MemoryLocationService=Ln,t.PushStateLocationService=Bn,t.MemoryLocationConfig=Gn,t.BrowserLocationConfig=Wn,t.splitHash=xn,t.splitQuery=jn,t.splitEqual=In,t.trimHashVal=Vn,t.keyValsToObjectR=An,t.getParams=Hn,t.parseUrl=pt,t.buildUrl=qn,t.locationPluginFactory=ht,t.servicesPlugin=dt,t.hashLocationPlugin=zn,t.pushStateLocationPlugin=Jn,t.memoryLocationPlugin=Qn,t.UIRouterPluginBase=Kn,Object.defineProperty(t,"__esModule",{value:!0})}); //# sourceMappingURL=angular-ui-router.min.js.map