angular-ui-router.min.js 90 KB

12345678910
  1. /*!
  2. * State-based routing for AngularJS
  3. * @version v1.0.0-alpha.4
  4. * @link http://angular-ui.github.com/ui-router
  5. * @license MIT License, http://www.opensource.org/licenses/MIT
  6. */
  7. !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("angular-ui-router",[],e):"object"==typeof exports?exports["angular-ui-router"]=e():t["angular-ui-router"]=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return t[r].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";function r(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}r(n(1)),r(n(53)),r(n(54)),n(56),n(57),n(58),n(59),Object.defineProperty(e,"__esModule",{value:!0}),e["default"]="ui.router"},function(t,e,n){"use strict";function r(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}r(n(2)),r(n(20)),r(n(44)),r(n(40)),r(n(17)),r(n(13)),r(n(45)),r(n(49)),r(n(51));var i=n(52);e.UIRouter=i.UIRouter},function(t,e,n){"use strict";function r(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}r(n(3)),r(n(6)),r(n(7)),r(n(5)),r(n(4)),r(n(8)),r(n(9)),r(n(12))},function(t,e,n){"use strict";function r(t,e,n,r){return void 0===r&&(r=Object.keys(t)),r.filter(function(e){return"function"==typeof t[e]}).forEach(function(r){return e[r]=t[r].bind(n)})}function i(t){void 0===t&&(t={});for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var i=o.apply(null,[{}].concat(n));return e.extend({},i,c(t||{},Object.keys(i)))}function o(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return e.forEach(n,function(n){e.forEach(n,function(e,n){t.hasOwnProperty(n)||(t[n]=e)})}),t}function a(t,e){var n=[];for(var r in t.path){if(t.path[r]!==e.path[r])break;n.push(t.path[r])}return n}function s(t,e,n){void 0===n&&(n=Object.keys(t));for(var r=0;r<n.length;r++){var i=n[r];if(t[i]!=e[i])return!1}return!0}function u(t,e){var n={},r=P(arguments,2);for(var i in e)t(r,i)&&(n[i]=e[i]);return n}function c(t){return u.apply(null,[_].concat(P(arguments)))}function l(t){return u.apply(null,[C.not(_)].concat(P(arguments)))}function f(t,e){return v(t,C.prop(e))}function p(t,n){var r=k.isArray(t),i=r?[]:{},o=r?function(t){return i.push(t)}:function(t,e){return i[e]=t};return e.forEach(t,function(t,e){n(t,e)&&o(t,e)}),i}function h(t,n){var r;return e.forEach(t,function(t,e){r||n(t,e)&&(r=t)}),r}function v(t,n){var r=k.isArray(t)?[]:{};return e.forEach(t,function(t,e){return r[e]=n(t,e)}),r}function d(t,e){return t.push(e),t}function m(t,e){return void 0===e&&(e="assert failure"),function(n){if(!t(n))throw new Error(k.isFunction(e)?e(n):e);return!0}}function g(){for(var t=[],e=0;e<arguments.length;e++)t[e-0]=arguments[e];if(0===t.length)return[];var n=t.reduce(function(t,e){return Math.min(e.length,t)},9007199254740991);return Array.apply(null,Array(n)).map(function(e,n){return t.map(function(t){return t[n]})})}function y(t,e){var n,r;if(k.isArray(e)&&(n=e[0],r=e[1]),!k.isString(n))throw new Error("invalid parameters to applyPairs");return t[n]=r,t}function w(t){return t.length&&t[t.length-1]||void 0}function $(t,n){return n&&Object.keys(n).forEach(function(t){return delete n[t]}),n||(n={}),e.extend(n,t)}function b(t,e,n){return k.isArray(t)?t.forEach(e,n):void Object.keys(t).forEach(function(n){return e(t[n],n)})}function S(t,e){return Object.keys(e).forEach(function(n){return t[n]=e[n]}),t}function R(t,n){return P(arguments,1).filter(e.identity).reduce(S,t)}function x(t,e){if(t===e)return!0;if(null===t||null===e)return!1;if(t!==t&&e!==e)return!0;var n=typeof t,r=typeof e;if(n!==r||"object"!==n)return!1;var i=[t,e];if(C.all(k.isArray)(i))return E(t,e);if(C.all(k.isDate)(i))return t.getTime()===e.getTime();if(C.all(k.isRegExp)(i))return t.toString()===e.toString();if(C.all(k.isFunction)(i))return!0;var o=[k.isFunction,k.isArray,k.isDate,k.isRegExp];if(o.map(C.any).reduce(function(t,e){return t||!!e(i)},!1))return!1;var a,s={};for(a in t){if(!x(t[a],e[a]))return!1;s[a]=!0}for(a in e)if(!s[a])return!1;return!0}function E(t,e){return t.length!==e.length?!1:g(t,e).reduce(function(t,e){return t&&x(e[0],e[1])},!0)}var k=n(4),C=n(5),O=window.angular||{};e.fromJson=O.fromJson||JSON.parse.bind(JSON),e.toJson=O.toJson||JSON.stringify.bind(JSON),e.copy=O.copy||$,e.forEach=O.forEach||b,e.extend=O.extend||R,e.equals=O.equals||x,e.identity=function(t){return t},e.noop=function(){},e.abstractKey="abstract",e.bindFunctions=r,e.inherit=function(t,n){return e.extend(new(e.extend(function(){},{prototype:t})),n)};var P=function(t,e){return void 0===e&&(e=0),Array.prototype.concat.apply(Array.prototype,Array.prototype.slice.call(t,e))},_=function(t,e){return-1!==t.indexOf(e)};e.removeFrom=C.curry(function(t,e){var n=t.indexOf(e);return n>=0&&t.splice(n,1),t}),e.defaults=i,e.merge=o,e.mergeR=function(t,n){return e.extend(t,n)},e.ancestors=a,e.equalForKeys=s,e.pick=c,e.omit=l,e.pluck=f,e.filter=p,e.find=h,e.mapObj=v,e.map=v,e.values=function(t){return Object.keys(t).map(function(e){return t[e]})},e.allTrueR=function(t,e){return t&&e},e.anyTrueR=function(t,e){return t||e},e.unnestR=function(t,e){return t.concat(e)},e.flattenR=function(t,n){return k.isArray(n)?t.concat(n.reduce(e.flattenR,[])):d(t,n)},e.unnest=function(t){return t.reduce(e.unnestR,[])},e.flatten=function(t){return t.reduce(e.flattenR,[])},e.assertPredicate=m,e.pairs=function(t){return Object.keys(t).map(function(e){return[e,t[e]]})},e.arrayTuples=g,e.applyPairs=y,e.tail=w},function(t,e,n){"use strict";function r(t){if(e.isArray(t)&&t.length){var n=t.slice(0,-1),r=t.slice(-1);return!(n.filter(i.not(e.isString)).length||r.filter(i.not(e.isFunction)).length)}return e.isFunction(t)}var i=n(5),o=Object.prototype.toString,a=function(t){return function(e){return typeof e===t}};e.isUndefined=a("undefined"),e.isDefined=i.not(e.isUndefined),e.isNull=function(t){return null===t},e.isFunction=a("function"),e.isNumber=a("number"),e.isString=a("string"),e.isObject=function(t){return null!==t&&"object"==typeof t},e.isArray=Array.isArray,e.isDate=function(t){return"[object Date]"===o.call(t)},e.isRegExp=function(t){return"[object RegExp]"===o.call(t)},e.isInjectable=r,e.isPromise=i.and(e.isObject,i.pipe(i.prop("then"),e.isFunction))},function(t,e){"use strict";function n(t){function e(n){return n.length>=r?t.apply(null,n):function(){return e(n.concat([].slice.apply(arguments)))}}var n=[].slice.apply(arguments,[1]),r=t.length;return e(n)}function r(){var t=arguments,e=t.length-1;return function(){for(var n=e,r=t[e].apply(this,arguments);n--;)r=t[n].call(this,r);return r}}function i(){for(var t=[],e=0;e<arguments.length;e++)t[e-0]=arguments[e];return r.apply(null,[].slice.call(arguments).reverse())}function o(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r-0]=arguments[r];return t.apply(null,n)&&e.apply(null,n)}}function a(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r-0]=arguments[r];return t.apply(null,n)||e.apply(null,n)}}function s(t,e){return function(n){return n[t].apply(n,e)}}function u(t){return function(e){for(var n=0;n<t.length;n++)if(t[n][0](e))return t[n][1](e)}}e.curry=n,e.compose=r,e.pipe=i,e.prop=function(t){return function(e){return e&&e[t]}},e.propEq=n(function(t,e,n){return n&&n[t]===e}),e.parse=function(t){return i.apply(null,t.split(".").map(e.prop))},e.not=function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n-0]=arguments[n];return!t.apply(null,e)}},e.and=o,e.or=a,e.all=function(t){return function(e){return e.reduce(function(e,n){return e&&!!t(n)},!0)}},e.any=function(t){return function(e){return e.reduce(function(e,n){return e||!!t(n)},!1)}},e.none=e.not(e.any),e.is=function(t){return function(e){return null!=e&&e.constructor===t||e instanceof t}},e.eq=function(t){return function(e){return t===e}},e.val=function(t){return function(){return t}},e.invoke=s,e.pattern=u},function(t,e){"use strict";var n=function(t){return function(){throw new Error(t+"(): No coreservices implementation for UI-Router is loaded. You should include one of: ['angular1.js']")}},r={$q:void 0,$injector:void 0,location:{},locationConfig:{},template:{}};e.services=r,["replace","url","path","search","hash","onChange"].forEach(function(t){return r.location[t]=n(t)}),["port","protocol","host","baseHref","html5Mode","hashPrefix"].forEach(function(t){return r.locationConfig[t]=n(t)})},function(t,e){"use strict";var n=function(){function t(t){this.text=t,this.glob=t.split(".")}return t.prototype.matches=function(t){for(var e=t.split("."),n=0,r=this.glob.length;r>n;n++)"*"===this.glob[n]&&(e[n]="*");return"**"===this.glob[0]&&(e=e.slice(e.indexOf(this.glob[1])),e.unshift("**")),"**"===this.glob[this.glob.length-1]&&(e.splice(e.indexOf(this.glob[this.glob.length-2])+1,Number.MAX_VALUE),e.push("**")),this.glob.length!=e.length?!1:e.join("")===this.glob.join("")},t.is=function(t){return t.indexOf("*")>-1},t.fromString=function(e){return this.is(e)?new t(e):null},t}();e.Glob=n},function(t,e){"use strict";var n=function(){function t(t,e){void 0===t&&(t=[]),void 0===e&&(e=null),this._items=t,this._limit=e}return t.prototype.enqueue=function(t){var e=this._items;return e.push(t),this._limit&&e.length>this._limit&&e.shift(),t},t.prototype.dequeue=function(){return this.size()?this._items.splice(0,1)[0]:void 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(){return this.size()?this._items[0]:void 0},t}();e.Queue=n},function(t,e,n){"use strict";function r(t,e){return e.length<=t?e:e.substr(0,t-3)+"..."}function i(t,e){for(;e.length<t;)e+=" ";return e}function o(t){return p.is(l.TransitionRejection)(t.reason)?t.reason.toString():"Promise("+JSON.stringify(t)+")"}function a(t){var e=s(t),n=e.match(/^(function [^ ]+\([^)]*\))/);return n?n[1]:e}function s(t){var e=c.isArray(t)?t.slice(-1)[0]:t;return e&&e.toString()||"undefined"}function u(t){function e(t){if(c.isObject(t)){if(-1!==n.indexOf(t))return"[circular ref]";n.push(t)}return d(t)}var n=[];return JSON.stringify(t,function(t,n){return e(n)}).replace(/\\"/g,'"')}var c=n(4),l=n(10),f=n(3),p=n(5),h=n(11),v=n(32);e.maxLength=r,e.padString=i,e.kebobString=function(t){return t.replace(/([A-Z])/g,function(t){return"-"+t.toLowerCase()})},e.functionToString=a,e.fnToString=s;var d=p.pattern([[p.not(c.isDefined),p.val("undefined")],[c.isNull,p.val("null")],[c.isPromise,o],[p.is(h.Transition),p.invoke("toString")],[p.is(v.Resolvable),p.invoke("toString")],[c.isInjectable,a],[p.val(!0),f.identity]]);e.stringify=u},function(t,e,n){"use strict";var r=n(3),i=n(6),o=n(9);!function(t){t[t.SUPERSEDED=2]="SUPERSEDED",t[t.ABORTED=3]="ABORTED",t[t.INVALID=4]="INVALID",t[t.IGNORED=5]="IGNORED"}(e.RejectType||(e.RejectType={}));var a=e.RejectType,s=function(){function t(t,e,n){r.extend(this,{type:t,message:e,detail:n})}return t.prototype.toString=function(){var t=function(t){return t&&t.toString!==Object.prototype.toString?t.toString():o.stringify(t)},e=this.type,n=this.message,r=t(this.detail);return"TransitionRejection(type: "+e+", message: "+n+", detail: "+r+")"},t}();e.TransitionRejection=s;var u=function(){function t(){}return t.prototype.superseded=function(t,e){var n="The transition has been superseded by a different transition (see detail).",o=new s(a.SUPERSEDED,n,t);return e&&e.redirected&&(o.redirected=!0),r.extend(i.services.$q.reject(o),{reason:o})},t.prototype.redirected=function(t){return this.superseded(t,{redirected:!0})},t.prototype.invalid=function(t){var e="This transition is invalid (see detail)",n=new s(a.INVALID,e,t);return r.extend(i.services.$q.reject(n),{reason:n})},t.prototype.ignored=function(t){var e="The transition was ignored.",n=new s(a.IGNORED,e,t);return r.extend(i.services.$q.reject(n),{reason:n})},t.prototype.aborted=function(t){var e="The transition has been aborted.",n=new s(a.ABORTED,e,t);return r.extend(i.services.$q.reject(n),{reason:n})},t}();e.RejectFactory=u},function(t,e,n){"use strict";var r=n(12),i=n(6),o=n(3),a=n(4),s=n(5),u=n(13),c=n(39),l=n(38),f=n(17),p=n(20),h=n(40),v=0,d=new u.RejectFactory,m=s.prop("self"),g=function(){function t(t,e,n){var r=this;if(this._transitionService=n,this._deferred=i.services.$q.defer(),this.promise=this._deferred.promise,this.treeChanges=function(){return r._treeChanges},this.isActive=function(){return r===r._options.current()},!e.valid())throw new Error(e.error());u.HookRegistry.mixin(new u.HookRegistry,this),this._options=o.extend({current:s.val(this)},e.options()),this.$id=v++;var a=l.PathFactory.buildToPath(t,e);a=l.PathFactory.applyViewConfigs(n.$view,a),this._treeChanges=l.PathFactory.treeChanges(t,a,this._options.reloadState),l.PathFactory.bindTransitionResolve(this._treeChanges,this)}return t.prototype.$from=function(){return o.tail(this._treeChanges.from).state},t.prototype.$to=function(){return o.tail(this._treeChanges.to).state},t.prototype.from=function(){return this.$from().self},t.prototype.to=function(){return this.$to().self},t.prototype.is=function(e){return e instanceof t?this.is({to:e.$to().name,from:e.$from().name}):!(e.to&&!u.matchState(this.$to(),e.to)||e.from&&!u.matchState(this.$from(),e.from))},t.prototype.params=function(t){return void 0===t&&(t="to"),this._treeChanges[t].map(s.prop("paramValues")).reduce(o.mergeR,{})},t.prototype.resolves=function(){return o.map(o.tail(this._treeChanges.to).resolveContext.getResolvables(),function(t){return t.data})},t.prototype.addResolves=function(t,e){void 0===e&&(e="");var n="string"==typeof e?e:e.name,r=this._treeChanges.to,i=o.find(r,function(t){return t.state.name===n});o.tail(r).resolveContext.addResolvables(h.Resolvable.makeResolvables(t),i.state)},t.prototype.previous=function(){return this._options.previous||null},t.prototype.options=function(){return this._options},t.prototype.entering=function(){return o.map(this._treeChanges.entering,s.prop("state")).map(m)},t.prototype.exiting=function(){return o.map(this._treeChanges.exiting,s.prop("state")).map(m).reverse()},t.prototype.retained=function(){return o.map(this._treeChanges.retained,s.prop("state")).map(m)},t.prototype.views=function(t,e){void 0===t&&(t="entering");var n=this._treeChanges[t];return n=e?n.filter(s.propEq("state",e)):n,n.map(s.prop("views")).filter(o.identity).reduce(o.unnestR,[])},t.prototype.redirect=function(e){var n=o.extend({},this.options(),e.options(),{previous:this});e=new f.TargetState(e.identifier(),e.$state(),e.params(),n);var r=new t(this._treeChanges.from,e,this._transitionService),i=e.options().reloadState,a=this.treeChanges().to,s=c.Node.matching(r.treeChanges().to,a).filter(function(t){return!i||!i.includes[t.state.name]}),u=function(t,e){return-1===["$stateParams","$transition$"].indexOf(e)};return s.forEach(function(t,e){return o.extend(t.resolves,o.filter(a[e].resolves,u))}),r},t.prototype._changedParams=function(){var t=this._treeChanges,e=t.to,n=t.from;if(!this._options.reload&&o.tail(e).state===o.tail(n).state){var r=e.map(function(t){return t.paramSchema}),i=[e,n].map(function(t){return t.map(function(t){return t.paramValues})}),a=i[0],s=i[1],u=o.arrayTuples(r,a,s);return u.map(function(t){var e=t[0],n=t[1],r=t[2];return p.Param.changed(e,n,r)}).reduce(o.unnestR,[])}},t.prototype.dynamic=function(){var t=this._changedParams();return t?t.map(function(t){return t.dynamic}).reduce(o.anyTrueR,!1):!1},t.prototype.ignored=function(){var t=this._changedParams();return t?0===t.length:!1},t.prototype.hookBuilder=function(){return new u.HookBuilder(this._transitionService,this,{transition:this,current:this._options.current})},t.prototype.run=function(){var t=this,e=this.hookBuilder(),n=u.TransitionHook.runSynchronousHooks,o=function(){return n(e.getOnSuccessHooks(),{},!0)},a=function(t){return n(e.getOnErrorHooks(),{$error$:t},!0)};this.promise.then(o,a);var s=n(e.getOnBeforeHooks());if(u.TransitionHook.isRejection(s)){var c=s.reason;return this._deferred.reject(c),this.promise}if(!this.valid()){var l=new Error(this.error());return this._deferred.reject(l),this.promise}if(this.ignored()){r.trace.traceTransitionIgnored(this);var f=d.ignored();return this._deferred.reject(f.reason),this.promise}var p=function(){t.success=!0,t._deferred.resolve(t),r.trace.traceSuccess(t.$to(),t)},h=function(e){return t.success=!1,t._deferred.reject(e),r.trace.traceError(e,t),i.services.$q.reject(e)};r.trace.traceTransitionStart(this);var v=e.asyncHooks().reduce(function(t,e){return t.then(e.invokeStep)},s);return v.then(p,h),this.promise},t.prototype.valid=function(){return!this.error()},t.prototype.error=function(){var t=this.$to();return t.self[o.abstractKey]?"Cannot transition to abstract state '"+t.name+"'":p.Param.validates(t.parameters(),this.params())?void 0:"Param values not valid for state '"+t.name+"'"},t.prototype.toString=function(){var t=this.from(),e=this.to(),n=function(t){return null!==t["#"]&&void 0!==t["#"]?t:o.omit(t,"#")},r=this.$id,i=a.isObject(t)?t.name:t,u=o.toJson(n(this._treeChanges.from.map(s.prop("paramValues")).reduce(o.mergeR,{}))),c=this.valid()?"":"(X) ",l=a.isObject(e)?e.name:e,f=o.toJson(n(this.params()));return"Transition#"+r+"( '"+i+"'"+u+" -> "+c+"'"+l+"'"+f+" )"},t}();e.Transition=g},function(t,e,n){"use strict";function r(t){return t?"ui-view id#"+t.id+", contextual name '"+t.name+"@"+t.creationContext+"', fqn: '"+t.fqn+"'":"ui-view (defunct)"}function i(t){return a.isNumber(t)?c[t]:c[c[t]]}var o=n(5),a=n(4),s=n(9),u=function(t){return"ViewConfig targeting ui-view: '"+t.viewDecl.$uiViewName+"@"+t.viewDecl.$uiViewContextAnchor+"', context: '"+t.viewDecl.$context.name+"'"};!function(t){t[t.RESOLVE=0]="RESOLVE",t[t.TRANSITION=1]="TRANSITION",t[t.HOOK=2]="HOOK",t[t.INVOKE=3]="INVOKE",t[t.UIVIEW=4]="UIVIEW",t[t.VIEWCONFIG=5]="VIEWCONFIG"}(e.Category||(e.Category={}));var c=e.Category,l=function(){function t(){this._enabled={},this.approximateDigests=0}return t.prototype._set=function(t,e){var n=this;e.length||(e=Object.keys(c).filter(function(t){return isNaN(parseInt(t,10))}).map(function(t){return c[t]})),e.map(i).forEach(function(e){return n._enabled[e]=t})},t.prototype.enable=function(){for(var t=[],e=0;e<arguments.length;e++)t[e-0]=arguments[e];this._set(!0,t)},t.prototype.disable=function(){for(var t=[],e=0;e<arguments.length;e++)t[e-0]=arguments[e];this._set(!1,t)},t.prototype.enabled=function(t){return!!this._enabled[i(t)]},t.prototype.traceTransitionStart=function(t){if(this.enabled(c.TRANSITION)){var e=t.$id,n=this.approximateDigests,r=s.stringify(t);console.log("Transition #"+e+" Digest #"+n+": Started -> "+r)}},t.prototype.traceTransitionIgnored=function(t){if(this.enabled(c.TRANSITION)){var e=t.$id,n=this.approximateDigests,r=s.stringify(t);console.log("Transition #"+e+" Digest #"+n+": Ignored <> "+r)}},t.prototype.traceHookInvocation=function(t,e){if(this.enabled(c.HOOK)){var n=o.parse("transition.$id")(e),r=this.approximateDigests,i=o.parse("traceData.hookType")(e)||"internal",a=o.parse("traceData.context.state.name")(e)||o.parse("traceData.context")(e)||"unknown",u=s.functionToString(t.fn);console.log("Transition #"+n+" Digest #"+r+": Hook -> "+i+" context: "+a+", "+s.maxLength(200,u))}},t.prototype.traceHookResult=function(t,e,n){if(this.enabled(c.HOOK)){var r=o.parse("transition.$id")(n),i=this.approximateDigests,a=s.stringify(t),u=s.stringify(e);console.log("Transition #"+r+" Digest #"+i+": <- Hook returned: "+s.maxLength(200,a)+", transition result: "+s.maxLength(200,u))}},t.prototype.traceResolvePath=function(t,e){if(this.enabled(c.RESOLVE)){var n=o.parse("transition.$id")(e),r=this.approximateDigests,i=t&&t.toString(),a=e&&e.resolvePolicy;console.log("Transition #"+n+" Digest #"+r+": Resolving "+i+" ("+a+")")}},t.prototype.traceResolvePathElement=function(t,e,n){if(this.enabled(c.RESOLVE)&&e.length){var r=o.parse("transition.$id")(n),i=this.approximateDigests,a=Object.keys(e).join(", "),s=t&&t.toString(),u=n&&n.resolvePolicy;console.log("Transition #"+r+" Digest #"+i+": Resolve "+s+" resolvables: ["+a+"] ("+u+")")}},t.prototype.traceResolveResolvable=function(t,e){if(this.enabled(c.RESOLVE)){var n=o.parse("transition.$id")(e),r=this.approximateDigests,i=t&&t.toString();console.log("Transition #"+n+" Digest #"+r+": Resolving -> "+i)}},t.prototype.traceResolvableResolved=function(t,e){if(this.enabled(c.RESOLVE)){var n=o.parse("transition.$id")(e),r=this.approximateDigests,i=t&&t.toString(),a=s.stringify(t.data);console.log("Transition #"+n+" Digest #"+r+": <- Resolved "+i+" to: "+s.maxLength(200,a))}},t.prototype.tracePathElementInvoke=function(t,e,n,r){if(this.enabled(c.INVOKE)){var i=o.parse("transition.$id")(r),a=this.approximateDigests,u=t&&t.state&&t.state.toString(),l=s.functionToString(e);console.log("Transition #"+i+" Digest #"+a+": Invoke "+r.when+": context: "+u+" "+s.maxLength(200,l))}},t.prototype.traceError=function(t,e){if(this.enabled(c.TRANSITION)){var n=e.$id,r=this.approximateDigests,i=s.stringify(e);console.log("Transition #"+n+" Digest #"+r+": <- Rejected "+i+", reason: "+t)}},t.prototype.traceSuccess=function(t,e){if(this.enabled(c.TRANSITION)){var n=e.$id,r=this.approximateDigests,i=t.name,o=s.stringify(e);console.log("Transition #"+n+" Digest #"+r+": <- Success "+o+", final state: "+i)}},t.prototype.traceUiViewEvent=function(t,e,n){void 0===n&&(n=""),this.enabled(c.UIVIEW)&&console.log("ui-view: "+s.padString(30,t)+" "+r(e)+n)},t.prototype.traceUiViewConfigUpdated=function(t,e){this.enabled(c.UIVIEW)&&this.traceUiViewEvent("Updating",t," with ViewConfig from context='"+e+"'")},t.prototype.traceUiViewScopeCreated=function(t,e){this.enabled(c.UIVIEW)&&this.traceUiViewEvent("Created scope for",t,", scope #"+e.$id)},t.prototype.traceUiViewFill=function(t,e){this.enabled(c.UIVIEW)&&this.traceUiViewEvent("Fill",t," with: "+s.maxLength(200,e))},t.prototype.traceViewServiceEvent=function(t,e){this.enabled(c.VIEWCONFIG)&&console.log("$view.ViewConfig: "+t+" "+u(e))},t.prototype.traceViewServiceUiViewEvent=function(t,e){this.enabled(c.VIEWCONFIG)&&console.log("$view.ViewConfig: "+t+" "+r(e))},t}();e.Trace=l;var f=new l;e.trace=f},function(t,e,n){"use strict";function r(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}r(n(14)),r(n(15)),r(n(10)),r(n(11)),r(n(16)),r(n(43))},function(t,e,n){"use strict";function r(t){return void 0===t&&(t=!1),function(e,n){var r=t?-1:1,i=(e.node.state.path.length-n.node.state.path.length)*r;return 0!==i?i:n.hook.priority-e.hook.priority}}var i=n(3),o=n(4),a=n(13),s=function(){function t(t,e,n){var o=this;this.$transitions=t,this.transition=e,this.baseHookOptions=n,this.getOnBeforeHooks=function(){return o._buildNodeHooks("onBefore","to",r(),void 0,{async:!1})},this.getOnStartHooks=function(){return o._buildNodeHooks("onStart","to",r())},this.getOnExitHooks=function(){return o._buildNodeHooks("onExit","exiting",r(!0),function(t){return{$state$:t.state}})},this.getOnRetainHooks=function(){return o._buildNodeHooks("onRetain","retained",r(),function(t){return{$state$:t.state}})},this.getOnEnterHooks=function(){return o._buildNodeHooks("onEnter","entering",r(),function(t){return{$state$:t.state}})},this.getOnFinishHooks=function(){return o._buildNodeHooks("onFinish","to",r(),function(t){return{$treeChanges$:o.treeChanges}})},this.getOnSuccessHooks=function(){return o._buildNodeHooks("onSuccess","to",r(),void 0,{async:!1,rejectIfSuperseded:!1})},this.getOnErrorHooks=function(){return o._buildNodeHooks("onError","to",r(),void 0,{async:!1,rejectIfSuperseded:!1})},this.treeChanges=e.treeChanges(),this.toState=i.tail(this.treeChanges.to).state,this.fromState=i.tail(this.treeChanges.from).state,this.transitionOptions=e.options()}return t.prototype.asyncHooks=function(){var t=this.getOnStartHooks(),e=this.getOnExitHooks(),n=this.getOnRetainHooks(),r=this.getOnEnterHooks(),o=this.getOnFinishHooks(),a=[t,e,n,r,o];return a.reduce(i.unnestR,[]).filter(i.identity)},t.prototype._buildNodeHooks=function(t,e,n,r,o){var s=this;void 0===r&&(r=function(t){return{}});var u=this._matchingHooks(t,this.treeChanges);if(!u)return[];var c=function(n){var u=n.matches(s.treeChanges),c=u[e];return c.map(function(e){var u=i.extend({bind:n.bind,traceData:{hookType:t,context:e}},s.baseHookOptions,o),c=new a.TransitionHook(n.callback,r(e),e.resolveContext,u);return{hook:n,node:e,transitionHook:c}})};return u.map(c).reduce(i.unnestR,[]).sort(n).map(function(t){return t.transitionHook})},t.prototype._matchingHooks=function(t,e){return[this.transition,this.$transitions].map(function(e){return e.getHooks(t)}).filter(i.assertPredicate(o.isArray,"broken event named: "+t)).reduce(i.unnestR,[]).filter(function(t){return t.matches(e)})},t}();e.HookBuilder=s},function(t,e,n){"use strict";function r(t,e){function n(t){for(var e=r,n=0;n<e.length;n++){var i=s.Glob.fromString(e[n]);if(i&&i.matches(t.name)||!i&&e[n]===t.name)return!0}return!1}var r=a.isString(e)?[e]:e,i=a.isFunction(r)?r:n;return!!i(t)}function i(t,e){return function(n,r,i){void 0===i&&(i={});var a=new u(n,r,i);return t[e].push(a),function(){o.removeFrom(t[e])(a)}}}var o=n(3),a=n(4),s=n(7);e.matchState=r;var u=function(){function t(t,e,n){void 0===n&&(n={}),this.callback=e,this.matchCriteria=o.extend({to:!0,from:!0,exiting:!0,retained:!0,entering:!0},t),this.priority=n.priority||0,this.bind=n.bind||null}return t._matchingNodes=function(t,e){if(e===!0)return t;var n=t.filter(function(t){return r(t.state,e)});return n.length?n:null},t.prototype.matches=function(e){var n=this.matchCriteria,r=t._matchingNodes,i={to:r([o.tail(e.to)],n.to),from:r([o.tail(e.from)],n.from),exiting:r(e.exiting,n.exiting),retained:r(e.retained,n.retained),entering:r(e.entering,n.entering)},a=["to","from","exiting","retained","entering"].map(function(t){return i[t]}).reduce(o.allTrueR,!0);return a?i:null},t}();e.EventHook=u;var c=function(){function t(){var t=this;this._transitionEvents={onBefore:[],onStart:[],onEnter:[],onRetain:[],onExit:[],onFinish:[],onSuccess:[],onError:[]},this.getHooks=function(e){return t._transitionEvents[e]},this.onBefore=i(this._transitionEvents,"onBefore"),this.onStart=i(this._transitionEvents,"onStart"),this.onEnter=i(this._transitionEvents,"onEnter"),this.onRetain=i(this._transitionEvents,"onRetain"),this.onExit=i(this._transitionEvents,"onExit"),this.onFinish=i(this._transitionEvents,"onFinish"),this.onSuccess=i(this._transitionEvents,"onSuccess"),this.onError=i(this._transitionEvents,"onError")}return t.mixin=function(t,e){Object.keys(t._transitionEvents).concat(["getHooks"]).forEach(function(n){return e[n]=t[n]})},t}();e.HookRegistry=c},function(t,e,n){"use strict";var r=n(3),i=n(9),o=n(4),a=n(5),s=n(12),u=n(6),c=n(10),l=n(17),f=new c.RejectFactory,p={async:!0,rejectIfSuperseded:!0,current:r.noop,transition:null,traceData:{},bind:null},h=function(){function t(t,e,n,i){var u=this;this.fn=t,this.locals=e,this.resolveContext=n,this.options=i,this.isSuperseded=function(){return u.options.current()!==u.options.transition},this.mapHookResult=a.pattern([[this.isSuperseded,function(){return f.superseded(u.options.current())}],[a.eq(!1),function(){return f.aborted("Hook aborted transition")}],[a.is(l.TargetState),function(t){return f.redirected(t)}],[o.isPromise,function(t){return t.then(u.handleHookResult.bind(u))}]]),this.invokeStep=function(t){var e=u,n=e.options,i=e.fn,o=e.resolveContext,a=r.extend({},u.locals,t);if(s.trace.traceHookInvocation(u,n),n.rejectIfSuperseded&&u.isSuperseded())return f.superseded(n.current());if(!n.async){var c=o.invokeNow(i,a,n);return u.handleHookResult(c)}return o.invokeLater(i,a,n).then(u.handleHookResult.bind(u))},this.options=r.defaults(i,p)}return t.prototype.handleHookResult=function(t){if(o.isDefined(t)){s.trace.traceHookResult(t,void 0,this.options);var e=this.mapHookResult(t);return e&&s.trace.traceHookResult(t,e,this.options),e}},t.prototype.toString=function(){var t=this,e=t.options,n=t.fn,r=a.parse("traceData.hookType")(e)||"internal",o=a.parse("traceData.context.state.name")(e)||a.parse("traceData.context")(e)||"unknown",s=i.fnToString(n);return r+" context: "+o+", "+i.maxLength(200,s)},t.runSynchronousHooks=function(e,n,r){void 0===n&&(n={}),void 0===r&&(r=!1);for(var i=[],s=0;s<e.length;s++)try{i.push(e[s].invokeStep(n))}catch(c){if(!r)return f.aborted(c);console.log("Swallowed exception during synchronous hook handler: "+c)}var l=i.filter(t.isRejection);return l.length?l[0]:i.filter(a.not(t.isRejection)).filter(o.isPromise).reduce(function(t,e){return t.then(a.val(e))},u.services.$q.when())},t.isRejection=function(t){return t&&t.reason instanceof c.TransitionRejection&&t},t}();e.TransitionHook=h},function(t,e,n){"use strict";function r(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}r(n(18)),r(n(19)),r(n(26)),r(n(33)),r(n(34)),r(n(35)),r(n(36)),r(n(37)),r(n(27))},function(t,e,n){"use strict";var r=n(4),i=n(3),o=function(){function t(e){this.stateRegistry=e,this.invalidCallbacks=[],i.bindFunctions(t.prototype,this,this)}return t.prototype.decorator=function(t,e){return this.stateRegistry.decorator(t,e)||this},t.prototype.state=function(t,e){return r.isObject(t)?e=t:e.name=t,this.stateRegistry.register(e),this},t.prototype.onInvalid=function(t){this.invalidCallbacks.push(t)},t}();e.StateProvider=o},function(t,e,n){"use strict";var r=n(3),i=n(4),o=n(5),a=n(20),s=function(t){if(!i.isString(t))return!1;var e="^"===t.charAt(0);return{val:e?t.substring(1):t,root:e}},u=function(){function t(t,e){this.matcher=t;var n=this,i=function(t){return""===t.name},u=function(){return t.find("")};this.builders={self:[function(t){return t.self.$$state=function(){return t},t.self}],parent:[function(e){return i(e)?null:t.find(n.parentName(e))||u()}],data:[function(t){return t.parent&&t.parent.data&&(t.data=t.self.data=r.inherit(t.parent.data,t.data)),t.data}],url:[function(t){var n=t,i=s(n.url),o=t.parent,a=i?e.compile(i.val,{params:t.params||{},paramMap:function(t,e){return n.reloadOnSearch===!1&&e&&(t=r.extend(t||{},{dynamic:!0})),t}}):n.url;if(!a)return null;if(!e.isMatcher(a))throw new Error("Invalid url '"+a+"' in state '"+t+"'");return i&&i.root?a:(o&&o.navigable||u()).url.append(a)}],navigable:[function(t){return!i(t)&&t.url?t:t.parent?t.parent.navigable:null}],params:[function(t){var e=function(t,e){return a.Param.fromConfig(e,null,t)},n=t.url&&t.url.parameters({inherit:!1})||[],i=r.values(r.map(r.omit(t.params||{},n.map(o.prop("id"))),e));return n.concat(i).map(function(t){return[t.id,t]}).reduce(r.applyPairs,{})}],views:[],path:[function(t){return t.parent?t.parent.path.concat(t):[t]}],includes:[function(t){var e=t.parent?r.extend({},t.parent.includes):{};return e[t.name]=!0,e}]}}return t.prototype.builder=function(t,e){var n=this.builders,r=n[t]||[];return i.isString(t)&&!i.isDefined(e)?r.length>1?r:r[0]:i.isString(t)&&i.isFunction(e)?(n[t]=r,n[t].push(e),function(){return n[t].splice(n[t].indexOf(e,1))&&null}):void 0},t.prototype.build=function(t){var e=this,n=e.matcher,i=e.builders,o=this.parentName(t);if(o&&!n.find(o))return null;for(var a in i)if(i.hasOwnProperty(a)){var s=i[a].reduce(function(t,e){return function(n){return e(n,t)}},r.noop);t[a]=s(t)}return t},t.prototype.parentName=function(t){var e=t.name||"";return-1!==e.indexOf(".")?e.substring(0,e.lastIndexOf(".")):t.parent?i.isString(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 n=i.isString(t.parent)?t.parent:t.parent.name;return n?n+"."+e:e},t}();e.StateBuilder=u},function(t,e,n){"use strict";function r(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}r(n(21)),r(n(24)),r(n(25)),r(n(23))},function(t,e,n){"use strict";function r(t){return t=d(t)&&{value:t}||t,s.extend(t,{$$fn:c.isInjectable(t.value)?t.value:function(){return t.value}})}function i(t,e,n,r){if(t.type&&e&&"string"!==e.name)throw new Error("Param '"+r+"' has two type configurations.");return t.type&&e&&"string"===e.name&&h.paramTypes.type(t.type)?h.paramTypes.type(t.type):e?e:t.type?t.type instanceof p.Type?t.type:h.paramTypes.type(t.type):n===m.CONFIG?h.paramTypes.type("any"):h.paramTypes.type("string");
  8. }function o(t,e){var n=t.squash;if(!e||n===!1)return!1;if(!c.isDefined(n)||null==n)return f.matcherConfig.defaultSquashPolicy();if(n===!0||c.isString(n))return n;throw new Error("Invalid squash policy: '"+n+"'. Valid policies: false, true, or arbitrary string")}function a(t,e,n,r){var i,o,a=[{from:"",to:n||e?void 0:""},{from:null,to:n||e?void 0:""}];return i=c.isArray(t.replace)?t.replace:[],c.isString(r)&&i.push({from:r,to:void 0}),o=s.map(i,u.prop("from")),s.filter(a,function(t){return-1===o.indexOf(t.from)}).concat(i)}var s=n(3),u=n(5),c=n(4),l=n(6),f=n(22),p=n(23),h=n(24),v=Object.prototype.hasOwnProperty,d=function(t){return 0===["value","type","squash","array","dynamic"].filter(v.bind(t||{})).length};!function(t){t[t.PATH=0]="PATH",t[t.SEARCH=1]="SEARCH",t[t.CONFIG=2]="CONFIG"}(e.DefType||(e.DefType={}));var m=e.DefType,g=function(){function t(t,e,n,u){function c(){var e={array:u===m.SEARCH?"auto":!1},r=t.match(/\[\]$/)?{array:!0}:{};return s.extend(e,r,n).array}n=r(n),e=i(n,e,u,t);var l=c();e=l?e.$asArray(l,u===m.SEARCH):e;var f=void 0!==n.value,p=n.dynamic===!0,h=o(n,f),v=a(n,l,f,h);s.extend(this,{id:t,type:e,location:u,squash:h,replace:v,isOptional:f,dynamic:p,config:n,array:l})}return t.prototype.isDefaultValue=function(t){return this.isOptional&&this.type.equals(this.value(),t)},t.prototype.value=function(t){var e=this,n=function(){if(!l.services.$injector)throw new Error("Injectable functions cannot be called at configuration time");var t=l.services.$injector.invoke(e.config.$$fn);if(null!==t&&void 0!==t&&!e.type.is(t))throw new Error("Default value ("+t+") for parameter '"+e.id+"' is not an instance of Type ("+e.type.name+")");return t},r=function(t){var n=s.map(s.filter(e.replace,u.propEq("from",t)),u.prop("to"));return n.length?n[0]:t};return t=r(t),c.isDefined(t)?this.type.$normalize(t):n()},t.prototype.isSearch=function(){return this.location===m.SEARCH},t.prototype.validates=function(t){if((!c.isDefined(t)||null===t)&&this.isOptional)return!0;var e=this.type.$normalize(t);if(!this.type.is(e))return!1;var n=this.type.encode(e);return!(c.isString(n)&&!this.type.pattern.exec(n))},t.prototype.toString=function(){return"{Param:"+this.id+" "+this.type+" squash: '"+this.squash+"' optional: "+this.isOptional+"}"},t.fromConfig=function(e,n,r){return new t(e,n,r,m.CONFIG)},t.fromPath=function(e,n,r){return new t(e,n,r,m.PATH)},t.fromSearch=function(e,n,r){return new t(e,n,r,m.SEARCH)},t.values=function(t,e){return void 0===e&&(e={}),t.map(function(t){return[t.id,t.value(e[t.id])]}).reduce(s.applyPairs,{})},t.changed=function(t,e,n){return void 0===e&&(e={}),void 0===n&&(n={}),t.filter(function(t){return!t.type.equals(e[t.id],n[t.id])})},t.equals=function(e,n,r){return void 0===n&&(n={}),void 0===r&&(r={}),0===t.changed(e,n,r).length},t.validates=function(t,e){return void 0===e&&(e={}),t.map(function(t){return t.validates(e[t.id])}).reduce(s.allTrueR,!0)},t}();e.Param=g},function(t,e,n){"use strict";var r=n(4),i=function(){function t(){this._isCaseInsensitive=!1,this._isStrictMode=!0,this._defaultSquashPolicy=!1}return t.prototype.caseInsensitive=function(t){return this._isCaseInsensitive=r.isDefined(t)?t:this._isCaseInsensitive},t.prototype.strictMode=function(t){return this._isStrictMode=r.isDefined(t)?t:this._isStrictMode},t.prototype.defaultSquashPolicy=function(t){if(r.isDefined(t)&&t!==!0&&t!==!1&&!r.isString(t))throw new Error("Invalid squash policy: "+t+". Valid policies: false, true, arbitrary-string");return this._defaultSquashPolicy=r.isDefined(t)?t:this._defaultSquashPolicy},t}();e.MatcherConfig=i,e.matcherConfig=new i},function(t,e,n){"use strict";function r(t,e){function n(t){return o.isArray(t)?t:o.isDefined(t)?[t]:[]}function r(t){switch(t.length){case 0:return;case 1:return"auto"===e?t[0]:t;default:return t}}function a(t,e){return function(a){if(o.isArray(a)&&0===a.length)return a;var s=n(a),u=i.map(s,t);return e===!0?0===i.filter(u,function(t){return!t}).length:r(u)}}function s(t){return function(e,r){var i=n(e),o=n(r);if(i.length!==o.length)return!1;for(var a=0;a<i.length;a++)if(!t(i[a],o[a]))return!1;return!0}}var u=this;["encode","decode","equals","$normalize"].map(function(e){u[e]=("equals"===e?s:a)(t[e].bind(t))}),i.extend(this,{name:t.name,pattern:t.pattern,is:a(t.is.bind(t),!0),$arrayMode:e})}var i=n(3),o=n(4),a=function(){function t(t){this.pattern=/.*/,i.extend(this,t)}return t.prototype.is=function(t,e){return!0},t.prototype.encode=function(t,e){return t},t.prototype.decode=function(t,e){return t},t.prototype.equals=function(t,e){return t==e},t.prototype.$subPattern=function(){var t=this.pattern.toString();return t.substr(1,t.length-2)},t.prototype.toString=function(){return"{Type:"+this.name+"}"},t.prototype.$normalize=function(t){return this.is(t)?t:this.decode(t)},t.prototype.$asArray=function(t,e){if(!t)return this;if("auto"===t&&!e)throw new Error("'auto' array mode is for query parameters only");return new r(this,t)},t}();e.Type=a},function(t,e,n){"use strict";function r(t){return null!=t?t.toString().replace(/~/g,"~~").replace(/\//g,"~2F"):t}function i(t){return null!=t?t.toString().replace(/~2F/g,"/").replace(/~~/g,"~"):t}var o=n(3),a=n(4),s=n(5),u=n(6),c=n(23),l=function(){function t(){this.enqueue=!0,this.typeQueue=[],this.defaultTypes={hash:{encode:r,decode:i,is:s.is(String),pattern:/.*/,equals:s.val(!0)},string:{encode:r,decode:i,is:s.is(String),pattern:/[^\/]*/},"int":{encode:r,decode:function(t){return parseInt(t,10)},is:function(t){return a.isDefined(t)&&this.decode(t.toString())===t},pattern:/-?\d+/},bool:{encode:function(t){return t&&1||0},decode:function(t){return 0!==parseInt(t,10)},is:s.is(Boolean),pattern:/0|1/},date:{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(n,r){return n&&t[r]()===e[r]()},!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:{encode:o.toJson,decode:o.fromJson,is:s.is(Object),equals:o.equals,pattern:/[^\/]*/},any:{encode:o.identity,decode:o.identity,equals:o.equals,pattern:/.*/}};var t=function(t,e){return new c.Type(o.extend({name:e},t))};this.types=o.inherit(o.map(this.defaultTypes,t),{})}return t.prototype.type=function(t,e,n){if(!a.isDefined(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 c.Type(o.extend({name:t},e)),n&&(this.typeQueue.push({name:t,def:n}),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.");o.extend(this.types[t.name],u.services.$injector.invoke(t.def))}},t}();e.ParamTypes=l,e.paramTypes=new l},function(t,e,n){"use strict";var r=n(3),i=function(){function t(t){void 0===t&&(t={}),r.extend(this,t)}return t.prototype.$inherit=function(t,e,n){var i,o=r.ancestors(e,n),a={},s=[];for(var u in o)if(o[u]&&o[u].params&&(i=Object.keys(o[u].params),i.length))for(var c in i)s.indexOf(i[c])>=0||(s.push(i[c]),a[i[c]]=this[i[c]]);return r.extend({},a,t)},t}();e.StateParams=i},function(t,e,n){"use strict";var r=n(5),i=n(21),o=n(10),a=n(27),s=n(28),u=n(29),c=n(30),l=n(6),f=function(){function t(t,e,n,r,i,o){this.transition=t,this.$transitions=e,this.$urlRouter=n,this.$view=r,this.$state=i,this.globals=o,this.$q=l.services.$q,this.viewHooks=new s.ViewHooks(t,r),this.enterExitHooks=new u.EnterExitHooks(t),this.resolveHooks=new c.ResolveHooks(t),this.treeChanges=t.treeChanges(),this.registerUpdateGlobalState(),this.viewHooks.registerHooks(),this.enterExitHooks.registerHooks(),this.resolveHooks.registerHooks()}return t.prototype.runTransition=function(){var t=this;return this.globals.transitionHistory.enqueue(this.transition),this.transition.run().then(function(t){return t.to()})["catch"](function(e){return t.transRejected(e)})},t.prototype.registerUpdateGlobalState=function(){this.transition.onSuccess({},this.updateUrl.bind(this),{priority:9999})},t.prototype.transRejected=function(t){var e=this,n=e.transition,s=e.$state,u=e.$q;if(t instanceof o.TransitionRejection){if(t.type===o.RejectType.IGNORED){var c=s.$current.parameters().filter(r.prop("dynamic"));return i.Param.equals(c,s.params,n.params())||this.updateUrl(),s.current}if(t.type===o.RejectType.SUPERSEDED&&t.redirected&&t.detail instanceof a.TargetState)return this._redirectMgr(n.redirect(t.detail)).runTransition();t.type===o.RejectType.ABORTED&&this.$urlRouter.update()}return this.$transitions.defaultErrorHandler()(t),u.reject(t)},t.prototype.updateUrl=function(){var t=this.transition,e=this,n=e.$urlRouter,r=e.$state,i=t.options();t.$to();i.location&&r.$current.navigable&&n.push(r.$current.navigable.url,r.params,{replace:"replace"===i.location}),n.update(!0)},t.prototype._redirectMgr=function(e){var n=this,r=n.$transitions,i=n.$urlRouter,o=n.$view,a=n.$state,s=n.globals;return new t(e,r,i,o,a,s)},t}();e.TransitionManager=f},function(t,e){"use strict";var n=function(){function t(t,e,n,r){void 0===n&&(n={}),void 0===r&&(r={}),this._identifier=t,this._definition=e,this._options=r,this._params=n||{}}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}();e.TargetState=n},function(t,e,n){"use strict";var r=n(3),i=n(6),o=function(){function t(t,e){this.transition=t,this.$view=e,this.treeChanges=t.treeChanges(),this.enteringViews=t.views("entering"),this.exitingViews=t.views("exiting")}return t.prototype.loadAllEnteringViews=function(){return i.services.$q.all(this.enteringViews.map(function(t){return t.load()})).then(r.noop)},t.prototype.updateViews=function(){var t=this.$view;this.exitingViews.forEach(function(e){return t.deactivateViewConfig(e)}),this.enteringViews.forEach(function(e){return t.activateViewConfig(e)}),t.sync()},t.prototype.registerHooks=function(){this.enteringViews.length&&this.transition.onStart({},this.loadAllEnteringViews.bind(this)),(this.exitingViews.length||this.enteringViews.length)&&this.transition.onSuccess({},this.updateViews.bind(this))},t}();e.ViewHooks=o},function(t,e){"use strict";var n=function(){function t(t){this.transition=t}return t.prototype.registerHooks=function(){this.registerOnEnterHooks(),this.registerOnRetainHooks(),this.registerOnExitHooks()},t.prototype.registerOnEnterHooks=function(){var t=this;this.transition.entering().filter(function(t){return!!t.onEnter}).forEach(function(e){return t.transition.onEnter({entering:e.name},e.onEnter)})},t.prototype.registerOnRetainHooks=function(){var t=this;this.transition.retained().filter(function(t){return!!t.onRetain}).forEach(function(e){return t.transition.onRetain({retained:e.name},e.onRetain)})},t.prototype.registerOnExitHooks=function(){var t=this;this.transition.exiting().filter(function(t){return!!t.onExit}).forEach(function(e){return t.transition.onExit({exiting:e.name},e.onExit)})},t}();e.EnterExitHooks=n},function(t,e,n){"use strict";var r=n(3),i=n(5),o=n(31),a=n(5),s=n(32),u=o.ResolvePolicy[o.ResolvePolicy.LAZY],c=o.ResolvePolicy[o.ResolvePolicy.EAGER],l=function(){function t(t){this.transition=t}return t.prototype.registerHooks=function(){function t(t){return r.tail(n.to).resolveContext.resolvePath(r.extend({transition:t},{resolvePolicy:c}))}function e(t,e){var o=r.find(n.entering,i.propEq("state",t)),a=o.resolveContext,c=new s.Resolvable("$resolve$",function(){return r.map(a.getResolvables(),function(t){return t.data})}),l=r.extend({transition:e},{resolvePolicy:u});return a.resolvePathElement(o.state,l).then(function(){return c.resolveResolvable(a)}).then(function(){return a.addResolvables({$resolve$:c},o.state)})}var n=this.transition.treeChanges();t.$inject=["$transition$"],e.$inject=["$state$","$transition$"],this.transition.onStart({},t,{priority:1e3}),this.transition.onEnter({entering:a.val(!0)},e,{priority:1e3})},t}();e.ResolveHooks=l},function(t,e){"use strict";!function(t){t[t.JIT=0]="JIT",t[t.LAZY=1]="LAZY",t[t.EAGER=2]="EAGER"}(e.ResolvePolicy||(e.ResolvePolicy={}));e.ResolvePolicy},function(t,e,n){"use strict";var r=n(3),i=n(5),o=n(4),a=n(6),s=n(12),u=function(){function t(t,e,n){this.promise=void 0,r.extend(this,{name:t,resolveFn:e,deps:a.services.$injector.annotate(e,a.services.$injector.strictDi),data:n})}return t.prototype.resolveResolvable=function(t,e){var n=this;void 0===e&&(e={});var i=this,o=i.name,u=i.deps,c=i.resolveFn;s.trace.traceResolveResolvable(this,e);var l=a.services.$q.defer();this.promise=l.promise;var f=t.getResolvables(null,{omitOwnLocals:[o]}),p=r.pick(f,u),h=r.map(p,function(n){return n.get(t,e)});return a.services.$q.all(h).then(function(t){try{var e=a.services.$injector.invoke(c,null,t);l.resolve(e)}catch(r){l.reject(r)}return n.promise}).then(function(t){return n.data=t,s.trace.traceResolvableResolved(n,e),n.promise})},t.prototype.get=function(t,e){return this.promise||this.resolveResolvable(t,e)},t.prototype.toString=function(){return"Resolvable(name: "+this.name+", requires: ["+this.deps+"])"},t.makeResolvables=function(e){var n=r.filter(e,i.not(o.isInjectable)),a=Object.keys(n);if(a.length)throw new Error("Invalid resolve key/value: "+a[0]+"/"+n[a[0]]);return r.map(e,function(e,n){return new t(n,e)})},t}();e.Resolvable=u},function(t,e,n){"use strict";var r=n(3),i=n(5),o=function(){function t(t){r.extend(this,t)}return t.prototype.is=function(t){return this===t||this.self===t||this.fqn()===t},t.prototype.fqn=function(){if(!(this.parent&&this.parent instanceof this.constructor))return this.name;var t=this.parent.fqn();return t?t+"."+this.name:this.name},t.prototype.root=function(){return this.parent&&this.parent.root()||this},t.prototype.parameters=function(t){t=r.defaults(t,{inherit:!0});var e=t.inherit&&this.parent&&this.parent.parameters()||[];return e.concat(r.values(this.params))},t.prototype.parameter=function(t,e){return void 0===e&&(e={}),this.url&&this.url.parameter(t,e)||r.find(r.values(this.params),i.propEq("id",t))||e.inherit&&this.parent&&this.parent.parameter(t)},t.prototype.toString=function(){return this.fqn()},t}();e.State=o},function(t,e,n){"use strict";var r=n(4),i=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){if(t||""===t){var n=r.isString(t),i=n?t:t.name;this.isRelative(i)&&(i=this.resolvePath(i,e));var o=this._states[i];return!o||!n&&(n||o!==t&&o.self!==t)?void 0:o}},t.prototype.resolvePath=function(t,e){if(!e)throw new Error("No reference point given for path '"+t+"'");for(var n=this.find(e),r=t.split("."),i=0,o=r.length,a=n;o>i;i++)if(""!==r[i]||0!==i){if("^"!==r[i])break;if(!a.parent)throw new Error("Path '"+t+"' not valid for state '"+n.name+"'");a=a.parent}else a=n;var s=r.slice(i).join(".");return a.name+(a.name&&s?".":"")+s},t}();e.StateMatcher=i},function(t,e,n){"use strict";var r=n(3),i=n(4),o=n(17),a=function(){function t(t,e,n){this.states=t,this.builder=e,this.$urlRouterProvider=n,this.queue=[]}return t.prototype.register=function(t){var e=this,n=e.states,a=e.queue,s=e.$state,u=r.inherit(new o.State,r.extend({},t,{self:t,resolve:t.resolve||{},toString:function(){return t.name}}));if(!i.isString(u.name))throw new Error("State must have a valid name");if(n.hasOwnProperty(u.name)||-1!==r.pluck(a,"name").indexOf(u.name))throw new Error("State '"+u.name+"' is already defined");return a.push(u),this.$state&&this.flush(s),u},t.prototype.flush=function(t){for(var e,n,r,i=this,o=i.queue,a=i.states,s=i.builder,u=[],c={};o.length>0;)if(n=o.shift(),e=s.build(n),r=u.indexOf(n),e){if(a.hasOwnProperty(n.name))throw new Error("State '"+name+"' is already defined");a[n.name]=n,this.attachRoute(t,n),r>=0&&u.splice(r,1)}else{var l=c[n.name];if(c[n.name]=o.length,r>=0&&l===o.length)throw new Error("Cannot register orphaned state '"+n.name+"'");0>r&&u.push(n),o.push(n)}return a},t.prototype.autoFlush=function(t){this.$state=t,this.flush(t)},t.prototype.attachRoute=function(t,e){var n=this.$urlRouterProvider;!e[r.abstractKey]&&e.url&&n.when(e.url,["$match","$stateParams",function(n,i){t.$current.navigable===e&&r.equalForKeys(n,i)||t.transitionTo(e,n,{inherit:!0})}])},t}();e.StateQueueManager=a},function(t,e,n){"use strict";var r=n(34),i=n(19),o=n(35),a=function(){function t(t,e){this.states={},this.matcher=new r.StateMatcher(this.states),this.builder=new i.StateBuilder(this.matcher,t),this.stateQueue=new o.StateQueueManager(this.states,this.builder,e);var n={name:"",url:"^",views:null,params:{"#":{value:null,type:"hash"}},"abstract":!0},a=this._root=this.stateQueue.register(n);a.navigable=null}return t.prototype.root=function(){return this._root},t.prototype.register=function(t){return this.stateQueue.register(t)},t.prototype.get=function(t,e){var n=this;if(0===arguments.length)return Object.keys(this.states).map(function(t){return n.states[t].self});var r=this.matcher.find(t,e);return r&&r.self||null},t.prototype.decorator=function(t,e){return this.builder.builder(t,e)},t}();e.StateRegistry=a},function(t,e,n){"use strict";var r=n(3),i=n(4),o=n(8),a=n(6),s=n(38),u=n(39),c=n(43),l=n(10),f=n(27),p=n(26),h=n(21),v=n(7),d=n(3),m=n(3),g=function(){function t(e,n,r,i,o,a){this.$view=e,this.$urlRouter=n,this.$transitions=r,this.stateRegistry=i,this.stateProvider=o,this.globals=a,this.rejectFactory=new l.RejectFactory;var s=["current","$current","params","transition"],u=Object.keys(t.prototype).filter(function(t){return-1===s.indexOf(t)});m.bindFunctions(t.prototype,this,this,u)}return Object.defineProperty(t.prototype,"transition",{get:function(){return this.globals.transition},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"params",{get:function(){return this.globals.params},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"current",{get:function(){return this.globals.current},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"$current",{get:function(){return this.globals.$current},enumerable:!0,configurable:!0}),t.prototype._handleInvalidTargetState=function(t,e){function n(){var t=l.dequeue();return void 0===t?p.invalid(e.error()):d(t).then(m).then(function(t){return t||n()})}var r=this,i=function(){return r.globals.transitionHistory.peekTail()},u=i(),c=s.PathFactory.makeTargetState(t),l=new o.Queue([].concat(this.stateProvider.invalidCallbacks)),p=this.rejectFactory,h=a.services.$q,v=a.services.$injector,d=function(t){return h.when(v.invoke(t,null,{$to$:e,$from$:c}))},m=function(t){if(t instanceof f.TargetState){var e=t;return e=r.target(e.identifier(),e.params(),e.options()),e.valid()?i()!==u?p.superseded():r.transitionTo(e.identifier(),e.params(),e.options()):p.invalid(e.error())}};return n()},t.prototype.reload=function(t){return this.transitionTo(this.current,this.params,{reload:i.isDefined(t)?t:!0,inherit:!1,notify:!1})},t.prototype.go=function(t,e,n){var i={relative:this.$current,inherit:!0},o=r.defaults(n,i,c.defaultTransOpts);return this.transitionTo(t,e,o)},t.prototype.target=function(t,e,n){if(void 0===n&&(n={}),i.isObject(n.reload)&&!n.reload.name)throw new Error("Invalid reload state object");if(n.reloadState=n.reload===!0?this.stateRegistry.root():this.stateRegistry.matcher.find(n.reload,n.relative),n.reload&&!n.reloadState)throw new Error("No such reload state '"+(i.isString(n.reload)?n.reload:n.reload.name)+"'");var r=this.stateRegistry.matcher.find(t,n.relative);return new f.TargetState(t,r,e,n)},t.prototype.transitionTo=function(t,e,n){var i=this;void 0===e&&(e={}),void 0===n&&(n={});var o=this.globals.transitionHistory;n=r.defaults(n,c.defaultTransOpts),n=r.extend(n,{current:o.peekTail.bind(o)});var l=this.target(t,e,n),f=this.globals.successfulTransitions.peekTail(),h=function(){return s.PathFactory.bindTransNodesToPath([new u.Node(i.stateRegistry.root())])},v=f?f.treeChanges().to:h();if(!l.exists())return this._handleInvalidTargetState(v,l);if(!l.valid())return a.services.$q.reject(l.error());var d=this.$transitions.create(v,l),m=new p.TransitionManager(d,this.$transitions,this.$urlRouter,this.$view,this,this.globals),g=m.runTransition();return r.extend(g,{transition:d})},t.prototype.is=function(t,e,n){n=r.defaults(n,{relative:this.$current});var o=this.stateRegistry.matcher.find(t,n.relative);if(i.isDefined(o))return this.$current!==o?!1:i.isDefined(e)&&null!==e?h.Param.equals(o.parameters(),this.params,e):!0},t.prototype.includes=function(t,e,n){n=r.defaults(n,{relative:this.$current});var o=i.isString(t)&&v.Glob.fromString(t);if(o){if(!o.matches(this.$current.name))return!1;t=this.$current.name}var a=this.stateRegistry.matcher.find(t,n.relative),s=this.$current.includes;if(i.isDefined(a))return i.isDefined(s[a.name])?e?d.equalForKeys(h.Param.values(a.parameters(),e),this.params,Object.keys(e)):!0:!1},t.prototype.href=function(t,e,n){var o={lossy:!0,inherit:!0,absolute:!1,relative:this.$current};n=r.defaults(n,o);var a=this.stateRegistry.matcher.find(t,n.relative);if(!i.isDefined(a))return null;n.inherit&&(e=this.params.$inherit(e||{},this.$current,a));var s=a&&n.lossy?a.navigable:a;return s&&void 0!==s.url&&null!==s.url?this.$urlRouter.href(s.url,h.Param.values(a.parameters(),e),{absolute:n.absolute}):null},t.prototype.get=function(t,e){return 0===arguments.length?this.stateRegistry.get():this.stateRegistry.get(t,e||this.$current)},t}();e.StateService=g},function(t,e,n){"use strict";var r=n(3),i=n(5),o=n(17),a=n(39),s=n(40),u=function(){function t(){}return t.makeTargetState=function(t){var e=r.tail(t).state;return new o.TargetState(e,e,t.map(i.prop("paramValues")).reduce(r.mergeR,{}))},t.buildPath=function(t){var e=t.params();return t.$state().path.map(function(t){return new a.Node(t).applyRawParams(e)})},t.buildToPath=function(e,n){var r=t.buildPath(n);return n.options().inherit?t.inheritParams(e,r,Object.keys(n.params())):r},t.applyViewConfigs=function(t,e){return e.map(function(e){return r.extend(e,{views:r.values(e.state.views||{}).map(function(n){return t.createViewConfig(e,n)})})})},t.inheritParams=function(t,e,n){function o(t,e){var n=r.find(t,i.propEq("state",e));return r.extend({},n&&n.paramValues)}void 0===n&&(n=[]);var s=i.curry(function(t,e,n){var i=r.extend({},n&&n.paramValues),s=r.pick(i,e);i=r.omit(i,e);var u=o(t,n.state)||{},c=r.extend(i,u,s);return new a.Node(n.state).applyRawParams(c)});return e.map(s(t,n))},t.bindTransNodesToPath=function(t){var e=new s.ResolveContext(t);return t.forEach(function(t){t.resolveContext=e.isolateRootTo(t.state),t.resolveInjector=new s.ResolveInjector(t.resolveContext,t.state),t.resolves.$stateParams=new s.Resolvable("$stateParams",function(){return t.paramValues},t.paramValues)}),t},t.treeChanges=function(e,n,r){function o(t,e){var r=a.Node.clone(t);return r.paramValues=n[e].paramValues,r}for(var s=0,u=Math.min(e.length,n.length),c=function(t){return t.parameters({inherit:!1}).filter(i.not(i.prop("dynamic"))).map(i.prop("id"))},l=function(t,e){return t.equals(e,c(t.state))};u>s&&e[s].state!==r&&l(e[s],n[s]);)s++;var f,p,h,v,d,m,g,y;return f=e,p=f.slice(0,s),h=f.slice(s),m=p.map(o),g=n.slice(s),y=m.concat(g),d=t.bindTransNodesToPath(y),v=d.slice(s),{from:f,to:d,retained:p,exiting:h,entering:v}},t.bindTransitionResolve=function(t,e){var n=t.to[0];n.resolves.$transition$=new s.Resolvable("$transition$",function(){return e},e)},t.subPath=function(t,e){var n=r.find(t,function(t){return t.state===e}),i=t.indexOf(n);if(-1===i)throw new Error("The path does not contain the state: "+e);return t.slice(0,i+1)},t.paramValues=function(t){return t.reduce(function(t,e){return r.extend(t,e.paramValues)},{})},t}();e.PathFactory=u},function(t,e,n){"use strict";var r=n(3),i=n(5),o=n(40),a=function(){function t(e){if(e instanceof t){var n=e;this.state=n.state,this.paramSchema=n.paramSchema.slice(),this.paramValues=r.extend({},n.paramValues),this.resolves=r.extend({},n.resolves),this.views=n.views&&n.views.slice(),this.resolveContext=n.resolveContext,this.resolveInjector=n.resolveInjector}else this.state=e,this.paramSchema=e.parameters({inherit:!1}),this.paramValues={},this.resolves=r.mapObj(e.resolve,function(t,e){return new o.Resolvable(e,t)})}return t.prototype.applyRawParams=function(t){var e=function(e){return[e.id,e.value(t[e.id])]};return this.paramValues=this.paramSchema.reduce(function(t,n){return r.applyPairs(t,e(n))},{}),this},t.prototype.parameter=function(t){return r.find(this.paramSchema,i.propEq("id",t))},t.prototype.equals=function(t,e){var n=this;void 0===e&&(e=this.paramSchema.map(i.prop("id")));var o=function(e){return n.parameter(e).type.equals(n.paramValues[e],t.paramValues[e])};return this.state===t.state&&e.map(o).reduce(r.allTrueR,!0)},t.clone=function(e){return new t(e)},t.matching=function(t,e){var n=t.reduce(function(t,n,r){return t===r&&r<e.length&&n.state===e[r].state?r+1:t},0);return t.slice(0,n)},t}();e.Node=a},function(t,e,n){"use strict";function r(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}r(n(31)),r(n(32)),r(n(41)),r(n(42))},function(t,e,n){"use strict";function r(t,e){var n=a.isString(t)?t:null,r=a.isObject(t)?t:{},i=r[e.name]||n||p;return c.ResolvePolicy[i]}var i=n(3),o=n(5),a=n(4),s=n(12),u=n(6),c=n(31),l=n(3),f=n(38),p=c.ResolvePolicy[c.ResolvePolicy.LAZY],h=function(){function t(t){this._path=t,i.extend(this,{_nodeFor:function(t){return i.find(this._path,o.propEq("state",t))},_pathTo:function(t){return f.PathFactory.subPath(this._path,t)}})}return t.prototype.getResolvables=function(t,e){e=i.defaults(e,{omitOwnLocals:[]});var n=t?this._pathTo(t):this._path,r=i.tail(n);return n.reduce(function(t,n){var o=n===r?e.omitOwnLocals:[],a=i.omit(n.resolves,o);return i.extend(t,a)},{})},t.prototype.getResolvablesForFn=function(t){var e=u.services.$injector.annotate(t,u.services.$injector.strictDi);return i.pick(this.getResolvables(),e)},t.prototype.isolateRootTo=function(e){return new t(this._pathTo(e))},t.prototype.addResolvables=function(t,e){i.extend(this._nodeFor(e).resolves,t)},t.prototype.getOwnResolvables=function(t){return i.extend({},this._nodeFor(t).resolves)},t.prototype.resolvePath=function(t){var e=this;void 0===t&&(t={}),s.trace.traceResolvePath(this._path,t);var n=function(n){return e.resolvePathElement(n.state,t)};return u.services.$q.all(i.map(this._path,n)).then(function(t){return t.reduce(l.mergeR,{})})},t.prototype.resolvePathElement=function(t,e){var n=this;void 0===e&&(e={});var o=e&&e.resolvePolicy,a=c.ResolvePolicy[o||p],l=this.getOwnResolvables(t),f=function(e){return r(t.resolvePolicy,e)>=a},h=i.filter(l,f),v=function(r){return r.get(n.isolateRootTo(t),e)},d=i.map(h,v);return s.trace.traceResolvePathElement(this,h,e),u.services.$q.all(d)},t.prototype.invokeLater=function(t,e,n){var r=this;void 0===e&&(e={}),void 0===n&&(n={});var o=this.getResolvablesForFn(t);s.trace.tracePathElementInvoke(i.tail(this._path),t,Object.keys(o),i.extend({when:"Later"},n));var a=function(t){return t.get(r,n)},c=i.map(o,a);return u.services.$q.all(c).then(function(){try{return r.invokeNow(t,e,n)}catch(i){return u.services.$q.reject(i)}})},t.prototype.invokeNow=function(t,e,n){void 0===n&&(n={});var r=this.getResolvablesForFn(t);s.trace.tracePathElementInvoke(i.tail(this._path),t,Object.keys(r),i.extend({when:"Now "},n));var a=i.map(r,o.prop("data"));return u.services.$injector.invoke(t,n.bind||null,i.extend({},e,a))},t}();e.ResolveContext=h},function(t,e,n){"use strict";var r=n(3),i=function(){function t(t,e){this._resolveContext=t,this._state=e}return t.prototype.invokeLater=function(t,e){return this._resolveContext.invokeLater(t,e)},t.prototype.invokeNow=function(t,e){return this._resolveContext.invokeNow(null,t,e)},t.prototype.getLocals=function(t){var e=this,n=function(t){return t.get(e._resolveContext)};return r.map(this._resolveContext.getResolvablesForFn(t),n)},t}();e.ResolveInjector=i},function(t,e,n){"use strict";var r=n(11),i=n(15);e.defaultTransOpts={location:!0,relative:null,inherit:!1,notify:!0,reload:!1,custom:{},current:function(){return null}};var o=function(){function t(t){this.$view=t,this._defaultErrorHandler=function(t){t instanceof Error&&console.error(t)},i.HookRegistry.mixin(new i.HookRegistry,this)}return t.prototype.defaultErrorHandler=function(t){return this._defaultErrorHandler=t||this._defaultErrorHandler},t.prototype.create=function(t,e){return new r.Transition(t,e,this)},t}();e.TransitionService=o},function(t,e,n){"use strict";function r(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}r(n(39)),r(n(38))},function(t,e,n){"use strict";function r(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}r(n(46)),r(n(22)),r(n(47)),r(n(48))},function(t,e,n){"use strict";function r(t,e){var n=["",""],r=t.replace(/[\\\[\]\^$*+?.()|{}]/g,"\\$&");if(!e)return r;switch(e.squash){case!1:n=["(",")"+(e.isOptional?"?":"")];break;case!0:r=r.replace(/\/$/,""),n=["(?:/(",")|/)?"];break;default:n=["("+e.squash+"|",")?"]}return r+n[0]+e.type.pattern.source+n[1]}var i=n(3),o=n(5),a=n(4),s=n(20),u=n(4),c=n(21),l=n(3),f=n(3),p=function(t,e,n){return t[e]=t[e]||n()},h=function(){function t(e,n){var a=this;this.pattern=e,this.config=n,this._cache={path:[],pattern:null},this._children=[],this._params=[],this._segments=[],this._compiled=[],this.config=i.defaults(this.config,{params:{},strict:!0,caseInsensitive:!1,paramMap:i.identity});for(var u,c,l,f=/([:*])([\w\[\]]+)|\{([\w\[\]]+)(?:\:\s*((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g,p=/([:]?)([\w\[\].-]+)|\{([\w\[\].-]+)(?:\:\s*((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g,h=0,v=[],d=function(n){if(!t.nameValidator.test(n))throw new Error("Invalid parameter name '"+n+"' in pattern '"+e+"'");if(i.find(a._params,o.propEq("id",n)))throw new Error("Duplicate parameter name '"+n+"' in pattern '"+e+"'")},m=function(t,n){var r=t[2]||t[3],o=n?t[4]:t[4]||("*"===t[1]?".*":null);return{id:r,regexp:o,cfg:a.config.params[r],segment:e.substring(h,t.index),type:o?s.paramTypes.type(o||"string")||i.inherit(s.paramTypes.type("string"),{pattern:new RegExp(o,a.config.caseInsensitive?"i":void 0)}):null}};(u=f.exec(e))&&(c=m(u,!1),!(c.segment.indexOf("?")>=0));)d(c.id),this._params.push(s.Param.fromPath(c.id,c.type,this.config.paramMap(c.cfg,!1))),this._segments.push(c.segment),v.push([c.segment,i.tail(this._params)]),h=f.lastIndex;l=e.substring(h);var g=l.indexOf("?");if(g>=0){var y=l.substring(g);if(l=l.substring(0,g),y.length>0)for(h=0;u=p.exec(y);)c=m(u,!0),d(c.id),this._params.push(s.Param.fromSearch(c.id,c.type,this.config.paramMap(c.cfg,!0))),h=f.lastIndex}this._segments.push(l),i.extend(this,{_compiled:v.map(function(t){return r.apply(null,t)}).concat(r(l)),prefix:this._segments[0]}),Object.freeze(this)}return t.prototype.append=function(t){return this._children.push(t),i.forEach(t._cache,function(e,n){return t._cache[n]=a.isArray(e)?[]:null}),t._cache.path=this._cache.path.concat(this),t},t.prototype.isRoot=function(){return 0===this._cache.path.length},t.prototype.toString=function(){return this.pattern},t.prototype.exec=function(t,e,n,r){function a(t){
  9. var e=function(t){return t.split("").reverse().join("")},n=function(t){return t.replace(/\\-/g,"-")},r=e(t).split(/-(?!\\)/),o=i.map(r,e);return i.map(o,n).reverse()}var s=this;void 0===e&&(e={}),void 0===r&&(r={});var c=p(this._cache,"pattern",function(){return new RegExp(["^",i.unnest(s._cache.path.concat(s).map(o.prop("_compiled"))).join(""),s.config.strict===!1?"/?":"","$"].join(""),s.config.caseInsensitive?"i":void 0)}).exec(t);if(!c)return null;var l=this.parameters(),f=l.filter(function(t){return!t.isSearch()}),h=l.filter(function(t){return t.isSearch()}),v=this._cache.path.concat(this).map(function(t){return t._segments.length-1}).reduce(function(t,e){return t+e}),d={};if(v!==c.length-1)throw new Error("Unbalanced capture group in route '"+this.pattern+"'");for(var m=0;v>m;m++){for(var g=f[m],y=c[m+1],w=0;w<g.replace.length;w++)g.replace[w].from===y&&(y=g.replace[w].to);y&&g.array===!0&&(y=a(y)),u.isDefined(y)&&(y=g.type.decode(y)),d[g.id]=g.value(y)}return i.forEach(h,function(t){for(var n=e[t.id],r=0;r<t.replace.length;r++)t.replace[r].from===n&&(n=t.replace[r].to);u.isDefined(n)&&(n=t.type.decode(n)),d[t.id]=t.value(n)}),n&&(d["#"]=n),d},t.prototype.parameters=function(t){return void 0===t&&(t={}),t.inherit===!1?this._params:i.unnest(this._cache.path.concat(this).map(o.prop("_params")))},t.prototype.parameter=function(t,e){void 0===e&&(e={});var n=i.tail(this._cache.path);return i.find(this._params,o.propEq("id",t))||e.inherit!==!1&&n&&n.parameter(t)||null},t.prototype.validates=function(t){var e=this,n=function(t,e){return!t||t.validates(e)};return i.pairs(t||{}).map(function(t){var r=t[0],i=t[1];return n(e.parameter(r),i)}).reduce(i.allTrueR,!0)},t.prototype.format=function(e){function n(t){var n=t.value(e[t.id]),r=t.isDefaultValue(n),i=r?t.squash:!1,o=t.type.encode(n);return{param:t,value:n,isDefaultValue:r,squash:i,encoded:o}}if(void 0===e&&(e={}),!this.validates(e))return null;var r=this._cache.path.slice().concat(this),o=r.map(t.pathSegmentsAndParams).reduce(l.unnestR,[]),s=r.map(t.queryParams).reduce(l.unnestR,[]),u=o.reduce(function(e,r){if(a.isString(r))return e+r;var o=n(r),s=o.squash,u=o.encoded,c=o.param;return s===!0?e.match(/\/$/)?e.slice(0,-1):e:a.isString(s)?e+s:s!==!1?e:null==u?e:a.isArray(u)?e+i.map(u,t.encodeDashes).join("-"):c.type.raw?e+u:e+encodeURIComponent(u)},""),c=s.map(function(t){var e=n(t),r=e.squash,o=e.encoded,s=e.isDefaultValue;if(!(null==o||s&&r!==!1)&&(a.isArray(o)||(o=[o]),0!==o.length))return t.type.raw||(o=i.map(o,encodeURIComponent)),o.map(function(e){return t.id+"="+e})}).filter(i.identity).reduce(l.unnestR,[]).join("&");return u+(c?"?"+c:"")+(e["#"]?"#"+e["#"]:"")},t.encodeDashes=function(t){return encodeURIComponent(t).replace(/-/g,function(t){return"%5C%"+t.charCodeAt(0).toString(16).toUpperCase()})},t.pathSegmentsAndParams=function(t){var e=t._segments,n=t._params.filter(function(t){return t.location===c.DefType.PATH});return f.arrayTuples(e,n.concat(void 0)).reduce(l.unnestR,[]).filter(function(t){return""!==t&&u.isDefined(t)})},t.queryParams=function(t){return t._params.filter(function(t){return t.location===c.DefType.SEARCH})},t.nameValidator=/^\w+([-.]+\w+)*(?:\[\])?$/,t}();e.UrlMatcher=h},function(t,e,n){"use strict";function r(){return{strict:a.matcherConfig.strictMode(),caseInsensitive:a.matcherConfig.caseInsensitive()}}var i=n(3),o=n(4),a=n(45),s=n(20),u=function(){function t(){i.extend(this,{UrlMatcher:a.UrlMatcher,Param:s.Param})}return t.prototype.caseInsensitive=function(t){return a.matcherConfig.caseInsensitive(t)},t.prototype.strictMode=function(t){return a.matcherConfig.strictMode(t)},t.prototype.defaultSquashPolicy=function(t){return a.matcherConfig.defaultSquashPolicy(t)},t.prototype.compile=function(t,e){return new a.UrlMatcher(t,i.extend(r(),e))},t.prototype.isMatcher=function(t){if(!o.isObject(t))return!1;var e=!0;return i.forEach(a.UrlMatcher.prototype,function(n,r){o.isFunction(n)&&(e=e&&o.isDefined(t[r])&&o.isFunction(t[r]))}),e},t.prototype.type=function(t,e,n){var r=s.paramTypes.type(t,e,n);return o.isDefined(e)?this:r},t.prototype.$get=function(){return s.paramTypes.enqueue=!1,s.paramTypes._flushTypeQueue(),this},t}();e.UrlMatcherFactory=u},function(t,e,n){"use strict";function r(t){var e=/^\^((?:\\[^a-zA-Z0-9]|[^\\\[\]\^$*+?.()|{}]+)*)/.exec(t.source);return null!=e?e[1].replace(/\\(.)/g,"$1"):""}function i(t,e){return t.replace(/\$(\$|\d{1,2})/,function(t,n){return e["$"===n?0:Number(n)]})}function o(t,e,n,r){if(!r)return!1;var i=t.invoke(n,n,{$match:r,$stateParams:e});return c.isDefined(i)?i:!0}function a(t,e,n){var r=l.services.locationConfig.baseHref();return"/"===r?t:e?r.slice(0,-1)+t:n?r.slice(1)+t:t}function s(t,e,n){function r(t){var e=t(l.services.$injector,f);return e?(c.isString(e)&&(f.replace(),f.url(e)),!0):!1}if(!n||!n.defaultPrevented){var i,o=t.length;for(i=0;o>i;i++)if(r(t[i]))return;e&&r(e)}}var u=n(3),c=n(4),l=n(6),f=l.services.location,p=function(){function t(t,e){this.$urlMatcherFactory=t,this.$stateParams=e,this.rules=[],this.otherwiseFn=null,this.interceptDeferred=!1}return t.prototype.rule=function(t){if(!c.isFunction(t))throw new Error("'rule' must be a function");return this.rules.push(t),this},t.prototype.otherwise=function(t){if(!c.isFunction(t)&&!c.isString(t))throw new Error("'rule' must be a string or function");return this.otherwiseFn=c.isString(t)?function(){return t}:t,this},t.prototype.when=function(t,e){var n,a=this,s=a.$urlMatcherFactory,p=a.$stateParams,h=c.isString(e);if(c.isString(t)&&(t=s.compile(t)),!h&&!c.isFunction(e)&&!c.isArray(e))throw new Error("invalid 'handler' in when()");var v={matcher:function(t,e){return h&&(n=s.compile(e),e=["$match",n.format.bind(n)]),u.extend(function(){return o(l.services.$injector,p,e,t.exec(f.path(),f.search(),f.hash()))},{prefix:c.isString(t.prefix)?t.prefix:""})},regex:function(t,e){if(t.global||t.sticky)throw new Error("when() RegExp must not be global or sticky");return h&&(n=e,e=["$match",function(t){return i(n,t)}]),u.extend(function(){return o(l.services.$injector,p,e,t.exec(f.path()))},{prefix:r(t)})}},d={matcher:s.isMatcher(t),regex:t instanceof RegExp};for(var m in d)if(d[m])return this.rule(v[m](t,e));throw new Error("invalid 'what' in when()")},t.prototype.deferIntercept=function(t){void 0===t&&(t=!0),this.interceptDeferred=t},t}();e.UrlRouterProvider=p;var h=function(){function t(e){this.urlRouterProvider=e,u.bindFunctions(t.prototype,this,this)}return t.prototype.sync=function(){s(this.urlRouterProvider.rules,this.urlRouterProvider.otherwiseFn)},t.prototype.listen=function(){var t=this;return this.listener=this.listener||f.onChange(function(e){return s(t.urlRouterProvider.rules,t.urlRouterProvider.otherwiseFn,e)})},t.prototype.update=function(t){return t?void(this.location=f.url()):void(f.url()!==this.location&&(f.url(this.location),f.replace()))},t.prototype.push=function(t,e,n){f.url(t.format(e||{})),n&&n.replace&&f.replace()},t.prototype.href=function(t,e,n){if(!t.validates(e))return null;var r=t.format(e);n=n||{};var i=l.services.locationConfig,o=i.html5Mode();if(o||null===r||(r="#"+i.hashPrefix()+r),r=a(r,o,n.absolute),!n.absolute||!r)return r;var s=!o&&r?"/":"",u=i.port();return u=80===u||443===u?"":":"+u,[i.protocol(),"://",i.host(),u,s,r].join("")},t}();e.UrlRouter=h},function(t,e,n){"use strict";function r(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}r(n(50))},function(t,e,n){"use strict";var r=n(3),i=n(5),o=n(4),a=n(2),s=function(){function t(){var t=this;this.uiViews=[],this.viewConfigs=[],this._viewConfigFactories={},this.sync=function(){function e(t){return t.fqn.split(".").length}function n(t){for(var e=t.viewDecl.$context,n=0;++n&&e.parent;)e=e.parent;return n}var o=t.uiViews.map(function(t){return[t.fqn,t]}).reduce(r.applyPairs,{}),a=function(t){return function(e){var n=e.viewDecl,i=n.$uiViewName.split("."),a=t.fqn.split(".");if(!r.equals(i,a.slice(0-i.length)))return!1;var s=1-i.length||void 0,u=a.slice(0,s).join("."),c=o[u].creationContext;return n.$uiViewContextAnchor===(c&&c.name)}},s=i.curry(function(t,e,n,r){return e*(t(n)-t(r))}),u=function(e){var r=t.viewConfigs.filter(a(e));return r.length>1&&r.sort(s(n,-1)),[e,r[0]]},c=function(e){var n=e[0],r=e[1];-1!==t.uiViews.indexOf(n)&&n.configUpdated(r)};t.uiViews.sort(s(e,1)).map(u).forEach(c)}}return t.prototype.rootContext=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 n=this._viewConfigFactories[e.$type];if(!n)throw new Error("ViewService: No view config factory registered for type "+e.$type);return n(t,e)},t.prototype.deactivateViewConfig=function(t){a.trace.traceViewServiceEvent("<- Removing",t),r.removeFrom(this.viewConfigs,t)},t.prototype.activateViewConfig=function(t){a.trace.traceViewServiceEvent("-> Registering",t),this.viewConfigs.push(t)},t.prototype.registerUiView=function(t){a.trace.traceViewServiceUiViewEvent("-> Registering",t);var e=this.uiViews,n=function(e){return e.fqn===t.fqn};return e.filter(n).length&&a.trace.traceViewServiceUiViewEvent("!!!! duplicate uiView named:",t),e.push(t),this.sync(),function(){var n=e.indexOf(t);return 0>=n?void a.trace.traceViewServiceUiViewEvent("Tried removing non-registered uiView",t):(a.trace.traceViewServiceUiViewEvent("<- Deregistering",t),void r.removeFrom(e)(t))}},t.prototype.available=function(){return this.uiViews.map(i.prop("fqn"))},t.prototype.active=function(){return this.uiViews.filter(i.prop("$config")).map(i.prop("name"))},t.normalizeUiViewTarget=function(t,e){void 0===e&&(e="");var n=e.split("@"),r=n[0]||"$default",i=o.isString(n[1])?n[1]:"^",a=/^(\^(?:\.\^)*)\.(.*$)/.exec(r);a&&(i=a[1],r=a[2]),"!"===r.charAt(0)&&(r=r.substr(1),i="");var s=/^(\^(?:\.\^)*)$/;if(s.exec(i)){var u=i.split(".").reduce(function(t,e){return t.parent},t);i=u.name}return{uiViewName:r,uiViewContextAnchor:i}},t}();e.ViewService=s},function(t,e,n){"use strict";var r=n(25),i=n(8),o=n(3),a=function(){function t(t){var e=this;this.params=new r.StateParams,this.transitionHistory=new i.Queue([],1),this.successfulTransitions=new i.Queue([],1);var n=function(t){e.transition=t,e.transitionHistory.enqueue(t);var n=function(){e.successfulTransitions.enqueue(t),e.$current=t.$to(),e.current=e.$current.self,o.copy(t.params(),e.params)};t.onSuccess({},n,{priority:1e4});var r=function(){e.transition===t&&(e.transition=null)};t.promise.then(r,r)};t.onBefore({},["$transition$",n])}return t}();e.UIRouterGlobals=a},function(t,e,n){"use strict";var r=n(47),i=n(48),o=n(18),a=n(48),s=n(43),u=n(50),c=n(36),l=n(37),f=n(51),p=function(){function t(){this.viewService=new u.ViewService,this.transitionService=new s.TransitionService(this.viewService),this.globals=new f.UIRouterGlobals(this.transitionService),this.urlMatcherFactory=new r.UrlMatcherFactory,this.urlRouterProvider=new i.UrlRouterProvider(this.urlMatcherFactory,this.globals.params),this.urlRouter=new a.UrlRouter(this.urlRouterProvider),this.stateRegistry=new c.StateRegistry(this.urlMatcherFactory,this.urlRouterProvider),this.stateProvider=new o.StateProvider(this.stateRegistry),this.stateService=new l.StateService(this.viewService,this.urlRouter,this.transitionService,this.stateRegistry,this.stateProvider,this.globals),this.viewService.rootContext(this.stateRegistry.root()),this.globals.$current=this.stateRegistry.root(),this.globals.current=this.globals.$current.self}return t}();e.UIRouter=p},function(t,e,n){"use strict";function r(t){var e=f.services.$injector,n=e.get("$controller"),r=e.instantiate;try{var i;return e.instantiate=function(t){e.instantiate=r,i=e.annotate(t)},n(t,{$scope:{}}),i}finally{e.instantiate=r}}function i(t,e){f.services.$injector=t,f.services.$q=e}function o(t){function e(e,r,i,o,a,s){return o.$on("$locationChangeSuccess",function(t){return n.forEach(function(e){return e(t)})}),f.services.locationConfig.html5Mode=function(){var e=t.html5Mode();return e=v.isObject(e)?e.enabled:e,e&&i.history},f.services.template.get=function(t){return a.get(t,{cache:s,headers:{Accept:"text/html"}}).then(h.prop("data"))},p.bindFunctions(e,f.services.location,e,["replace","url","path","search","hash"]),p.bindFunctions(e,f.services.locationConfig,e,["port","protocol","host"]),p.bindFunctions(r,f.services.locationConfig,r,["baseHref"]),S}S=new l.UIRouter,S.stateRegistry.decorator("views",w.ng1ViewsBuilder),S.viewService.viewConfigFactory("ng1",w.ng1ViewConfigFactory),p.bindFunctions(t,f.services.locationConfig,t,["hashPrefix"]);var n=[];f.services.location.onChange=function(t){return n.push(t),function(){return p.removeFrom(n)(t)}},this.$get=e,e.$inject=["$location","$browser","$sniffer","$rootScope","$http","$templateCache"]}function a(){return S.urlRouterProvider.$get=function(){return S.urlRouter.update(!0),this.interceptDeferred||S.urlRouter.listen(),S.urlRouter},S.urlRouterProvider}function s(){return S.stateProvider.$get=function(){return S.stateRegistry.stateQueue.autoFlush(S.stateService),S.stateService},S.stateProvider}function u(){function t(t){var e=function(e){function n(){}var i=p.find(t.treeChanges().to,h.propEq("state",e.viewDecl.$context));if(!i)return f.services.$q.when();var o=i.resolveContext,a=r(e.controller),s=o.getResolvables();return n.$inject=a.filter(function(t){return s.hasOwnProperty(t)}),o.invokeLater(n).then(function(){return e.locals=p.map(s,function(t){return t.data})})},n=t.views("entering").filter(function(t){return!!t.controller}).map(e);return f.services.$q.all(n).then(p.noop)}return t.$inject=["$transition$"],S.transitionService.onFinish({},t),S.transitionService.$get=function(){return S.transitionService},S.transitionService}function c(t){t.$watch(function(){y.trace.approximateDigests++})}var l=n(52),f=n(6),p=n(3),h=n(5),v=n(4),d=n(44),m=n(40),g=n(17),y=n(12),w=n(54),$=n(55),b=angular.module("ui.router.angular1",[]);angular.module("ui.router.util",["ng","ui.router.init"]),angular.module("ui.router.router",["ui.router.util"]),angular.module("ui.router.state",["ui.router.router","ui.router.util","ui.router.angular1"]),angular.module("ui.router",["ui.router.init","ui.router.state","ui.router.angular1"]),angular.module("ui.router.compat",["ui.router"]),e.annotateController=r,i.$inject=["$injector","$q"],b.run(i);var S=null;o.$inject=["$locationProvider"];var R=function(){return{resolve:function(t,e,n){void 0===e&&(e={});var r=new d.Node(new g.State({params:{}})),i=new d.Node(new g.State({params:{}})),o=new m.ResolveContext([r,i]);o.addResolvables(m.Resolvable.makeResolvables(t),i.state);var a=function(t){var n=function(t){return m.Resolvable.makeResolvables(p.map(t,function(t){return function(){return t}}))};return o.addResolvables(n(t),r.state),o.addResolvables(n(e),i.state),o.resolvePath()};return n?n.then(a):a({})}}};angular.module("ui.router.init",[]).provider("ng1UIRouter",o),angular.module("ui.router.init").run(["ng1UIRouter",function(t){}]),angular.module("ui.router.util").provider("$urlMatcherFactory",["ng1UIRouterProvider",function(){return S.urlMatcherFactory}]),angular.module("ui.router.util").run(["$urlMatcherFactory",function(t){}]),angular.module("ui.router.router").provider("$urlRouter",["ng1UIRouterProvider",a]),angular.module("ui.router.router").run(["$urlRouter",function(t){}]),angular.module("ui.router.state").provider("$state",["ng1UIRouterProvider",s]),angular.module("ui.router.state").run(["$state",function(t){}]),angular.module("ui.router.state").factory("$stateParams",["ng1UIRouter",function(t){return t.globals.params}]),angular.module("ui.router.state").provider("$transitions",["ng1UIRouterProvider",u]),angular.module("ui.router.util").factory("$templateFactory",["ng1UIRouter",function(){return new $.TemplateFactory}]),angular.module("ui.router").factory("$view",function(){return S.viewService}),angular.module("ui.router").factory("$resolve",R),angular.module("ui.router").service("$trace",function(){return y.trace}),c.$inject=["$rootScope"],e.watchDigests=c,angular.module("ui.router").run(c)},function(t,e,n){"use strict";function r(t){var e=["templateProvider","templateUrl","template","notify","async"],n=["controller","controllerProvider","controllerAs","resolveAs"],r=["component","bindings"],c=e.concat(n),l=r.concat(c),f={},p=t.views||{$default:o.pick(t,l)};return o.forEach(p,function(e,n){if(n=n||"$default",u.isString(e)&&(e={component:e}),Object.keys(e).length){if(e.component){if(c.map(function(t){return u.isDefined(e[t])}).reduce(o.anyTrueR,!1))throw new Error("Cannot combine: "+r.join("|")+" with: "+c.join("|")+" in stateview: 'name@"+t.name+"'");e.templateProvider=["$injector",function(t){var n=function(t){return e.bindings&&e.bindings[t]||t},r=angular.version.minor>=3?"::":"",o=i(t,e.component).map(function(t){return a.kebobString(t)+"='"+r+"$resolve."+n(t)+"'"}).join(" "),s=a.kebobString(e.component);return"<"+s+" "+o+"></"+s+">"}]}e.resolveAs=e.resolveAs||"$resolve",e.$type="ng1",e.$context=t,e.$name=n;var l=s.ViewService.normalizeUiViewTarget(e.$context,e.$name);e.$uiViewName=l.uiViewName,e.$uiViewContextAnchor=l.uiViewContextAnchor,f[n]=e}}),f}function i(t,e){var n=t.get(e+"Directive");if(!n||!n.length)throw new Error("Unable to find component named '"+e+"'");return n.map(v).reduce(o.unnestR,[])}var o=n(3),a=n(9),s=n(50),u=n(4),c=n(6),l=n(12),f=n(55);e.ng1ViewConfigFactory=function(t,e){return new d(t,e)},e.ng1ViewsBuilder=r;var p=function(t){return Object.keys(t||{}).map(function(e){return[e,/^[=<](.*)/.exec(t[e])]}).filter(function(t){return u.isDefined(t[1])}).map(function(t){return t[1][1]||t[0]})},h=function(t){return Object.keys(t||{}).filter(function(e){return!!/[=<]/.exec(t[e].mode)}).map(function(e){return t[e].attrName})},v=function(t){return u.isObject(t.bindToController)?p(t.bindToController):t.$$bindings&&t.$$bindings.bindToController?h(t.$$bindings.bindToController):t.$$isolateBindings?h(t.$$isolateBindings):p(t.scope)},d=function(){function t(t,e){this.node=t,this.viewDecl=e,this.loaded=!1}return t.prototype.load=function(){var t=this,e=c.services.$q;if(!this.hasTemplate())throw new Error("No template configuration specified for '"+this.viewDecl.$uiViewName+"@"+this.viewDecl.$uiViewContextAnchor+"'");var n=this.node.resolveContext,r=this.node.paramValues,i={template:e.when(this.getTemplate(r,new f.TemplateFactory,n)),controller:e.when(this.getController(n))};return e.all(i).then(function(e){l.trace.traceViewServiceEvent("Loaded",t),t.controller=e.controller,t.template=e.template})},t.prototype.hasTemplate=function(){return!!(this.viewDecl.template||this.viewDecl.templateUrl||this.viewDecl.templateProvider)},t.prototype.getTemplate=function(t,e,n){return e.fromConfig(this.viewDecl,t,n.invokeLater.bind(n))},t.prototype.getController=function(t){var e=this.viewDecl.controllerProvider;return u.isInjectable(e)?t.invokeLater(e,{}):this.viewDecl.controller},t}();e.Ng1ViewConfig=d},function(t,e,n){"use strict";var r=n(4),i=n(6),o=function(){function t(){}return t.prototype.fromConfig=function(t,e,n){return r.isDefined(t.template)?this.fromString(t.template,e):r.isDefined(t.templateUrl)?this.fromUrl(t.templateUrl,e):r.isDefined(t.templateProvider)?this.fromProvider(t.templateProvider,e,n):null},t.prototype.fromString=function(t,e){return r.isFunction(t)?t(e):t},t.prototype.fromUrl=function(t,e){return r.isFunction(t)&&(t=t(e)),null==t?null:i.services.template.get(t)},t.prototype.fromProvider=function(t,e,n){return n(t)},t}();e.TemplateFactory=o},function(t,e,n){"use strict";function r(t,e){var n,r=t.match(/^\s*({[^}]*})\s*$/);if(r&&(t=e+"("+r[1]+")"),n=t.replace(/\n/g," ").match(/^([^(]+?)\s*(\((.*)\))?$/),!n||4!==n.length)throw new Error("Invalid state ref '"+t+"'");return{state:n[1],paramExpr:n[3]||null}}function i(t){var e=t.parent().inheritedData("$uiView"),n=l.parse("$cfg.node.state")(e);return n&&n.name?n:void 0}function o(t){var e="[object SVGAnimatedString]"===Object.prototype.toString.call(t.prop("href")),n="FORM"===t[0].nodeName;return{attr:n?"action":e?"xlink:href":"href",isAnchor:"A"===t.prop("tagName").toUpperCase(),clickable:!n}}function a(t,e,n,r,i){return function(o){var a=o.which||o.button,s=i();if(!(a>1||o.ctrlKey||o.metaKey||o.shiftKey||t.attr("target"))){var u=n(function(){e.go(s.state,s.params,s.options)});o.preventDefault();var c=r.isAnchor&&!s.href?1:0;o.preventDefault=function(){c--<=0&&n.cancel(u)}}}}function s(t,e){return{relative:i(t)||e.$current,inherit:!0}}var u=n(3),c=n(4),l=n(5),f=["$state","$timeout",function(t,e){return{restrict:"A",require:["?^uiSrefActive","?^uiSrefActiveEq"],link:function(n,i,c,l){var f=r(c.uiSref,t.current.name),p={state:f.state,href:null,params:null,options:null},h=o(i),v=l[1]||l[0],d=null;p.options=u.extend(s(i,t),c.uiSrefOpts?n.$eval(c.uiSrefOpts):{});var m=function(e){e&&(p.params=angular.copy(e)),p.href=t.href(f.state,p.params,p.options),d&&d(),v&&(d=v.$$addStateInfo(f.state,p.params)),null!==p.href&&c.$set(h.attr,p.href)};f.paramExpr&&(n.$watch(f.paramExpr,function(t){t!==p.params&&m(t)},!0),p.params=angular.copy(n.$eval(f.paramExpr))),m(),h.clickable&&i.bind("click",a(i,t,e,h,function(){return p}))}}}],p=["$state","$timeout",function(t,e){return{restrict:"A",require:["?^uiSrefActive","?^uiSrefActiveEq"],link:function(n,r,i,s){function u(e){h.state=e[0],h.params=e[1],h.options=e[2],h.href=t.href(h.state,h.params,h.options),v&&v(),l&&(v=l.$$addStateInfo(h.state,h.params)),h.href&&i.$set(c.attr,h.href)}var c=o(r),l=s[1]||s[0],f=[i.uiState,i.uiStateParams||null,i.uiStateOpts||null],p="["+f.map(function(t){return t||"null"}).join(", ")+"]",h={state:null,params:null,options:null,href:null},v=null;n.$watch(p,u,!0),u(n.$eval(p)),c.clickable&&r.bind("click",a(r,t,e,c,function(){return h}))}}}],h=["$state","$stateParams","$interpolate","$transitions",function(t,e,n,o){return{restrict:"A",controller:["$scope","$element","$attrs","$timeout",function(e,a,s,l){function f(e,n,r){var o=t.get(e,i(a)),s=p(e,n),u={state:o||{name:e},params:n,hash:s};return $.push(u),b[s]=r,function(){var t=$.indexOf(u);-1!==t&&$.splice(t,1)}}function p(t,n){if(!c.isString(t))throw new Error("state should be a string");return c.isObject(n)?t+u.toJson(n):(n=e.$eval(n),c.isObject(n)?t+u.toJson(n):t)}function h(){for(var t=0;t<$.length;t++)m($[t].state,$[t].params)?v(a,b[$[t].hash]):d(a,b[$[t].hash]),g($[t].state,$[t].params)?v(a,y):d(a,y)}function v(t,e){l(function(){t.addClass(e)})}function d(t,e){t.removeClass(e)}function m(e,n){return t.includes(e.name,n)}function g(e,n){return t.is(e.name,n)}var y,w,$=[],b={};y=n(s.uiSrefActiveEq||"",!1)(e);try{w=e.$eval(s.uiSrefActive)}catch(S){}w=w||n(s.uiSrefActive||"",!1)(e),c.isObject(w)&&u.forEach(w,function(n,i){if(c.isString(n)){var o=r(n,t.current.name);f(o.state,e.$eval(o.paramExpr),i)}}),this.$$addStateInfo=function(t,e){if(!(c.isObject(w)&&$.length>0)){var n=f(t,e,w);return h(),n}},e.$on("$stateChangeSuccess",h);var R=["$transition$",function(t){t.promise.then(h)}],x=o.onStart({},R);e.$on("$destroy",x),h()}]}}];angular.module("ui.router.state").directive("uiSref",f).directive("uiSrefActive",h).directive("uiSrefActiveEq",h).directive("uiState",p)},function(t,e){"use strict";function n(t){var e=function(e,n,r){return t.is(e,n,r)};return e.$stateful=!0,e}function r(t){var e=function(e,n,r){return t.includes(e,n,r)};return e.$stateful=!0,e}n.$inject=["$state"],e.$IsStateFilter=n,r.$inject=["$state"],e.$IncludedByStateFilter=r,angular.module("ui.router.state").filter("isState",n).filter("includedByState",r)},function(t,e,n){"use strict";function r(t,e,n,r,u){var f=c.parse("viewDecl.controllerAs"),p=c.parse("viewDecl.resolveAs"),h=c.parse("node.resolveContext");return{restrict:"ECA",priority:-400,compile:function(r){var u=r.html();return function(r,c){var v=c.data("$uiView");if(v){var d=v.$cfg||{viewDecl:{}};c.html(d.template||u),s.trace.traceUiViewFill(v.$uiView,c.html());var m=t(c.contents()),g=d.controller,y=f(d),w=p(d),$=h(d),b=$&&o.map($.getResolvables(),function(t){return t.data});if(r[w]=b,g){var S=e(g,o.extend({},b,{$scope:r,$element:c}));y&&(r[y]=S,r[y][w]=b),c.data("$ngControllerController",S),c.children().data("$ngControllerController",S),i(n,S,r,d)}if(a.isString(d.viewDecl.component))var R=d.viewDecl.component,x=l.kebobString(R),E=function(){var t=[].slice.call(c[0].children).filter(function(t){return t&&t.tagName&&t.tagName.toLowerCase()===x});return t&&angular.element(t).data("$"+R+"Controller")},k=r.$watch(E,function(t){t&&(i(n,t,r,d),k())});m(r)}}}}}function i(t,e,n,r){!a.isFunction(e.$onInit)||r.viewDecl.component&&p||e.$onInit();var i={bind:e};if(a.isFunction(e.uiOnParamsChanged)){var s=function(t){var n=r.node.resolveContext,i=n.getResolvables().$transition$.data;if(t!==i&&-1===t.exiting().indexOf(r.node.state.self)){var a=t.params("to"),s=t.params("from"),u=t.treeChanges().to.map(function(t){return t.paramSchema}).reduce(o.unnestR,[]),c=t.treeChanges().from.map(function(t){return t.paramSchema}).reduce(o.unnestR,[]),l=u.filter(function(t){var e=c.indexOf(t);return-1===e||!c[e].type.equals(a[t.id],s[t.id])});if(l.length){var f=l.map(function(t){return t.id});e.uiOnParamsChanged(o.filter(a,function(t,e){return-1!==f.indexOf(e)}),t)}}};n.$on("$destroy",t.onSuccess({},["$transition$",s]),i);var c=function(t,e){t.type===u.RejectType.IGNORED&&s(e)};n.$on("$destroy",t.onError({},["$error$","$transition$",c]),i)}if(a.isFunction(e.uiCanExit)){var l={exiting:r.node.state.name};n.$on("$destroy",t.onBefore(l,e.uiCanExit,i))}}var o=n(3),a=n(4),s=n(12),u=n(10),c=n(5),l=n(9),f=["$view","$animate","$uiViewScroll","$interpolate","$q",function(t,e,n,r,i){function o(t,n){return{enter:function(t,n,r){angular.version.minor>2?e.enter(t,null,n).then(r):e.enter(t,null,n,r)},leave:function(t,n){angular.version.minor>2?e.leave(t).then(n):e.leave(t,n)}}}function u(t,e){return t===e}var l={$cfg:{viewDecl:{$context:t.rootContext()}},$uiView:{}},f={count:0,restrict:"ECA",terminal:!0,priority:400,transclude:"element",compile:function(e,p,h){return function(e,p,v){function d(t){u(E,t)||(s.trace.traceUiViewConfigUpdated(O,t&&t.viewDecl&&t.viewDecl.$context),E=t,g(t))}function m(){if(y&&(s.trace.traceUiViewEvent("Removing (previous) el",y.data("$uiView")),y.remove(),y=null),$&&(s.trace.traceUiViewEvent("Destroying scope",O),$.$destroy(),$=null),w){var t=w.data("$uiView");s.trace.traceUiViewEvent("Animate out",t),x.leave(w,function(){t.$$animLeave.resolve(),y=null}),y=w,w=null}}function g(t){var r=e.$new();s.trace.traceUiViewScopeCreated(O,r);var o=i.defer(),u=i.defer(),c={$cfg:t,$uiView:O,$animEnter:o.promise,$animLeave:u.promise,$$animLeave:u},l=h(r,function(t){x.enter(t.data("$uiView",c),p,function(){o.resolve(),$&&$.$emit("$viewContentAnimationEnded"),(a.isDefined(R)&&!R||e.$eval(R))&&n(t)}),m()});w=l,$=r,$.$emit("$viewContentLoaded",t||E),$.$eval(S)}var y,w,$,b,S=v.onload||"",R=v.autoscroll,x=o(v,e),E=void 0,k=p.inheritedData("$uiView")||l,C=r(v.uiView||v.name||"")(e)||"$default",O={id:f.count++,name:C,fqn:k.$uiView.fqn?k.$uiView.fqn+"."+C:C,config:null,configUpdated:d,get creationContext(){return c.parse("$cfg.viewDecl.$context")(k)}};s.trace.traceUiViewEvent("Linking",O),p.data("$uiView",{$uiView:O}),g(),b=t.registerUiView(O),e.$on("$destroy",function(){s.trace.traceUiViewEvent("Destroying/Unregistering",O),b()})}}};return f}];r.$inject=["$compile","$controller","$transitions","$view","$timeout"];var p="function"==typeof angular.module("ui.router").component;angular.module("ui.router.state").directive("uiView",f),angular.module("ui.router.state").directive("uiView",r)},function(t,e){"use strict";function n(){var t=!1;this.useAnchorScroll=function(){t=!0},this.$get=["$anchorScroll","$timeout",function(e,n){return t?e:function(t){return n(function(){t[0].scrollIntoView()},0,!1)}}]}angular.module("ui.router.state").provider("$uiViewScroll",n)}])});
  10. //# sourceMappingURL=angular-ui-router.min.js.map