@angular/router 4.2.3 → 4.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/@angular/router/testing.es5.js +1 -1
- package/@angular/router/testing.js +1 -1
- package/@angular/router/upgrade.es5.js +1 -1
- package/@angular/router/upgrade.js +1 -1
- package/@angular/router.es5.js +6 -5
- package/@angular/router.es5.js.map +1 -1
- package/@angular/router.js +5 -4
- package/@angular/router.js.map +1 -1
- package/bundles/router-testing.umd.js +2 -2
- package/bundles/router-testing.umd.min.js +2 -2
- package/bundles/router-upgrade.umd.js +2 -2
- package/bundles/router-upgrade.umd.min.js +2 -2
- package/bundles/router.umd.js +7 -6
- package/bundles/router.umd.js.map +1 -1
- package/bundles/router.umd.min.js +3 -3
- package/bundles/router.umd.min.js.map +1 -1
- package/package.json +4 -4
- package/router.metadata.json +1 -1
- package/src/router.d.ts +1 -1
- package/testing.d.ts +1 -1
- package/upgrade.d.ts +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v4.2.
|
|
2
|
+
* @license Angular v4.2.4
|
|
3
3
|
* (c) 2010-2017 Google, Inc. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -39,7 +39,7 @@ function createUrlTree(route,urlTree,commands,queryParams,fragment){if(0===comma
|
|
|
39
39
|
* found in the LICENSE file at https://angular.io/license
|
|
40
40
|
*/
|
|
41
41
|
function defaultErrorHandler(error){throw error}function defaultRouterHook(snapshot){return rxjs_observable_of.of(null)}function advanceActivatedRouteNodeAndItsChildren(node){advanceActivatedRoute(node.value),node.children.forEach(advanceActivatedRouteNodeAndItsChildren)}function parentLoadedConfig(snapshot){for(var s=snapshot.parent;s;s=s.parent){var route=s._routeConfig;if(route&&route._loadedConfig)return route._loadedConfig;if(route&&route.component)return null}return null}function closestLoadedConfig(snapshot){if(!snapshot)return null;for(var s=snapshot.parent;s;s=s.parent){var route=s._routeConfig;if(route&&route._loadedConfig)return route._loadedConfig}return null}function nodeChildrenAsMap(node){var map$$1={};return node&&node.children.forEach(function(child){return map$$1[child.value.outlet]=child}),map$$1}function validateCommands(commands){for(var i=0;i<commands.length;i++){var cmd=commands[i];if(null==cmd)throw new Error("The requested path contains "+cmd+" segment at index "+i)}}function attrBoolValue(s){return""===s||!!s}function routerNgProbeToken(){return new _angular_core.NgProbeToken("Router",Router)}function provideLocationStrategy(platformLocationStrategy,baseHref,options){return void 0===options&&(options={}),options.useHash?new _angular_common.HashLocationStrategy(platformLocationStrategy,baseHref):new _angular_common.PathLocationStrategy(platformLocationStrategy,baseHref)}function provideForRootGuard(router){if(router)throw new Error("RouterModule.forRoot() called twice. Lazy loaded modules should use RouterModule.forChild() instead.");return"guarded"}function provideRoutes(routes){return[{provide:_angular_core.ANALYZE_FOR_ENTRY_COMPONENTS,multi:!0,useValue:routes},{provide:ROUTES,multi:!0,useValue:routes}]}function setupRouter(ref,urlSerializer,contexts,location,injector,loader,compiler,config,opts,urlHandlingStrategy,routeReuseStrategy){void 0===opts&&(opts={});var router=new Router(null,urlSerializer,contexts,location,injector,loader,compiler,flatten(config));if(urlHandlingStrategy&&(router.urlHandlingStrategy=urlHandlingStrategy),routeReuseStrategy&&(router.routeReuseStrategy=routeReuseStrategy),opts.errorHandler&&(router.errorHandler=opts.errorHandler),opts.enableTracing){var dom_1=_angular_platformBrowser.ɵgetDOM();router.events.subscribe(function(e){dom_1.logGroup("Router Event: "+e.constructor.name),dom_1.log(e.toString()),dom_1.log(e),dom_1.logGroupEnd()})}return router}function rootRoute(router){return router.routerState.root}function getAppInitializer(r){return r.appInitializer.bind(r)}function getBootstrapListener(r){return r.bootstrapListener.bind(r)}function provideRouterInitializer(){return[RouterInitializer,{provide:_angular_core.APP_INITIALIZER,multi:!0,useFactory:getAppInitializer,deps:[RouterInitializer]},{provide:ROUTER_INITIALIZER,useFactory:getBootstrapListener,deps:[RouterInitializer]},{provide:_angular_core.APP_BOOTSTRAP_LISTENER,multi:!0,useExisting:ROUTER_INITIALIZER}]}var extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,b){d.__proto__=b}||function(d,b){for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p])},NavigationStart=function(){function NavigationStart(id,url){this.id=id,this.url=url}return NavigationStart.prototype.toString=function(){return"NavigationStart(id: "+this.id+", url: '"+this.url+"')"},NavigationStart}(),NavigationEnd=function(){function NavigationEnd(id,url,urlAfterRedirects){this.id=id,this.url=url,this.urlAfterRedirects=urlAfterRedirects}return NavigationEnd.prototype.toString=function(){return"NavigationEnd(id: "+this.id+", url: '"+this.url+"', urlAfterRedirects: '"+this.urlAfterRedirects+"')"},NavigationEnd}(),NavigationCancel=function(){function NavigationCancel(id,url,reason){this.id=id,this.url=url,this.reason=reason}return NavigationCancel.prototype.toString=function(){return"NavigationCancel(id: "+this.id+", url: '"+this.url+"')"},NavigationCancel}(),NavigationError=function(){function NavigationError(id,url,error){this.id=id,this.url=url,this.error=error}return NavigationError.prototype.toString=function(){return"NavigationError(id: "+this.id+", url: '"+this.url+"', error: "+this.error+")"},NavigationError}(),RoutesRecognized=function(){function RoutesRecognized(id,url,urlAfterRedirects,state){this.id=id,this.url=url,this.urlAfterRedirects=urlAfterRedirects,this.state=state}return RoutesRecognized.prototype.toString=function(){return"RoutesRecognized(id: "+this.id+", url: '"+this.url+"', urlAfterRedirects: '"+this.urlAfterRedirects+"', state: "+this.state+")"},RoutesRecognized}(),RouteConfigLoadStart=function(){function RouteConfigLoadStart(route){this.route=route}return RouteConfigLoadStart.prototype.toString=function(){return"RouteConfigLoadStart(path: "+this.route.path+")"},RouteConfigLoadStart}(),RouteConfigLoadEnd=function(){function RouteConfigLoadEnd(route){this.route=route}return RouteConfigLoadEnd.prototype.toString=function(){return"RouteConfigLoadEnd(path: "+this.route.path+")"},RouteConfigLoadEnd}(),PRIMARY_OUTLET="primary",ParamsAsMap=function(){function ParamsAsMap(params){this.params=params||{}}return ParamsAsMap.prototype.has=function(name){return this.params.hasOwnProperty(name)},ParamsAsMap.prototype.get=function(name){if(this.has(name)){var v=this.params[name];return Array.isArray(v)?v[0]:v}return null},ParamsAsMap.prototype.getAll=function(name){if(this.has(name)){var v=this.params[name];return Array.isArray(v)?v:[v]}return[]},Object.defineProperty(ParamsAsMap.prototype,"keys",{get:function(){return Object.keys(this.params)},enumerable:!0,configurable:!0}),ParamsAsMap}(),NAVIGATION_CANCELING_ERROR="ngNavigationCancelingError",LoadedRouterConfig=function(){function LoadedRouterConfig(routes,module){this.routes=routes,this.module=module}return LoadedRouterConfig}(),UrlTree=function(){function UrlTree(root,queryParams,fragment){this.root=root,this.queryParams=queryParams,this.fragment=fragment}return Object.defineProperty(UrlTree.prototype,"queryParamMap",{get:function(){return this._queryParamMap||(this._queryParamMap=convertToParamMap(this.queryParams)),this._queryParamMap},enumerable:!0,configurable:!0}),UrlTree.prototype.toString=function(){return DEFAULT_SERIALIZER.serialize(this)},UrlTree}(),UrlSegmentGroup=function(){function UrlSegmentGroup(segments,children){var _this=this;this.segments=segments,this.children=children,this.parent=null,forEach(children,function(v,k){return v.parent=_this})}return UrlSegmentGroup.prototype.hasChildren=function(){return this.numberOfChildren>0},Object.defineProperty(UrlSegmentGroup.prototype,"numberOfChildren",{get:function(){return Object.keys(this.children).length},enumerable:!0,configurable:!0}),UrlSegmentGroup.prototype.toString=function(){return serializePaths(this)},UrlSegmentGroup}(),UrlSegment=function(){function UrlSegment(path,parameters){this.path=path,this.parameters=parameters}return Object.defineProperty(UrlSegment.prototype,"parameterMap",{get:function(){return this._parameterMap||(this._parameterMap=convertToParamMap(this.parameters)),this._parameterMap},enumerable:!0,configurable:!0}),UrlSegment.prototype.toString=function(){return serializePath(this)},UrlSegment}(),UrlSerializer=function(){function UrlSerializer(){}return UrlSerializer.prototype.parse=function(url){},UrlSerializer.prototype.serialize=function(tree){},UrlSerializer}(),DefaultUrlSerializer=function(){function DefaultUrlSerializer(){}return DefaultUrlSerializer.prototype.parse=function(url){var p=new UrlParser(url);return new UrlTree(p.parseRootSegment(),p.parseQueryParams(),p.parseFragment())},DefaultUrlSerializer.prototype.serialize=function(tree){var segment="/"+serializeSegment(tree.root,!0),query=serializeQueryParams(tree.queryParams),fragment="string"==typeof tree.fragment?"#"+encodeURI(tree.fragment):"";return""+segment+query+fragment},DefaultUrlSerializer}(),DEFAULT_SERIALIZER=new DefaultUrlSerializer,SEGMENT_RE=/^[^\/()?;=&#]+/,QUERY_PARAM_RE=/^[^=?&#]+/,QUERY_PARAM_VALUE_RE=/^[^?&#]+/,UrlParser=function(){function UrlParser(url){this.url=url,this.remaining=url}return UrlParser.prototype.parseRootSegment=function(){return this.consumeOptional("/"),""===this.remaining||this.peekStartsWith("?")||this.peekStartsWith("#")?new UrlSegmentGroup([],{}):new UrlSegmentGroup([],this.parseChildren())},UrlParser.prototype.parseQueryParams=function(){var params={};if(this.consumeOptional("?"))do this.parseQueryParam(params);while(this.consumeOptional("&"));return params},UrlParser.prototype.parseFragment=function(){return this.consumeOptional("#")?decodeURI(this.remaining):null},UrlParser.prototype.parseChildren=function(){if(""===this.remaining)return{};this.consumeOptional("/");var segments=[];for(this.peekStartsWith("(")||segments.push(this.parseSegment());this.peekStartsWith("/")&&!this.peekStartsWith("//")&&!this.peekStartsWith("/(");)this.capture("/"),segments.push(this.parseSegment());var children={};this.peekStartsWith("/(")&&(this.capture("/"),children=this.parseParens(!0));var res={};return this.peekStartsWith("(")&&(res=this.parseParens(!1)),(segments.length>0||Object.keys(children).length>0)&&(res[PRIMARY_OUTLET]=new UrlSegmentGroup(segments,children)),res},UrlParser.prototype.parseSegment=function(){var path=matchSegments(this.remaining);if(""===path&&this.peekStartsWith(";"))throw new Error("Empty path url segment cannot have parameters: '"+this.remaining+"'.");return this.capture(path),new UrlSegment(decode(path),this.parseMatrixParams())},UrlParser.prototype.parseMatrixParams=function(){for(var params={};this.consumeOptional(";");)this.parseParam(params);return params},UrlParser.prototype.parseParam=function(params){var key=matchSegments(this.remaining);if(key){this.capture(key);var value="";if(this.consumeOptional("=")){var valueMatch=matchSegments(this.remaining);valueMatch&&(value=valueMatch,this.capture(value))}params[decode(key)]=decode(value)}},UrlParser.prototype.parseQueryParam=function(params){var key=matchQueryParams(this.remaining);if(key){this.capture(key);var value="";if(this.consumeOptional("=")){var valueMatch=matchUrlQueryParamValue(this.remaining);valueMatch&&(value=valueMatch,this.capture(value))}var decodedKey=decode(key),decodedVal=decode(value);if(params.hasOwnProperty(decodedKey)){var currentVal=params[decodedKey];Array.isArray(currentVal)||(currentVal=[currentVal],params[decodedKey]=currentVal),currentVal.push(decodedVal)}else params[decodedKey]=decodedVal}},UrlParser.prototype.parseParens=function(allowPrimary){var segments={};for(this.capture("(");!this.consumeOptional(")")&&this.remaining.length>0;){var path=matchSegments(this.remaining),next=this.remaining[path.length];if("/"!==next&&")"!==next&&";"!==next)throw new Error("Cannot parse url '"+this.url+"'");var outletName=void 0;path.indexOf(":")>-1?(outletName=path.substr(0,path.indexOf(":")),this.capture(outletName),this.capture(":")):allowPrimary&&(outletName=PRIMARY_OUTLET);var children=this.parseChildren();segments[outletName]=1===Object.keys(children).length?children[PRIMARY_OUTLET]:new UrlSegmentGroup([],children),this.consumeOptional("//")}return segments},UrlParser.prototype.peekStartsWith=function(str){return this.remaining.startsWith(str)},UrlParser.prototype.consumeOptional=function(str){return!!this.peekStartsWith(str)&&(this.remaining=this.remaining.substring(str.length),!0)},UrlParser.prototype.capture=function(str){if(!this.consumeOptional(str))throw new Error('Expected "'+str+'".')},UrlParser}(),NoMatch=function(){function NoMatch(segmentGroup){this.segmentGroup=segmentGroup||null}return NoMatch}(),AbsoluteRedirect=function(){function AbsoluteRedirect(urlTree){this.urlTree=urlTree}return AbsoluteRedirect}(),ApplyRedirects=function(){function ApplyRedirects(moduleInjector,configLoader,urlSerializer,urlTree,config){this.configLoader=configLoader,this.urlSerializer=urlSerializer,this.urlTree=urlTree,this.config=config,this.allowRedirects=!0,this.ngModule=moduleInjector.get(_angular_core.NgModuleRef)}return ApplyRedirects.prototype.apply=function(){var _this=this,expanded$=this.expandSegmentGroup(this.ngModule,this.config,this.urlTree.root,PRIMARY_OUTLET),urlTrees$=rxjs_operator_map.map.call(expanded$,function(rootSegmentGroup){return _this.createUrlTree(rootSegmentGroup,_this.urlTree.queryParams,_this.urlTree.fragment)});return rxjs_operator_catch._catch.call(urlTrees$,function(e){if(e instanceof AbsoluteRedirect)return _this.allowRedirects=!1,_this.match(e.urlTree);if(e instanceof NoMatch)throw _this.noMatchError(e);throw e})},ApplyRedirects.prototype.match=function(tree){var _this=this,expanded$=this.expandSegmentGroup(this.ngModule,this.config,tree.root,PRIMARY_OUTLET),mapped$=rxjs_operator_map.map.call(expanded$,function(rootSegmentGroup){return _this.createUrlTree(rootSegmentGroup,tree.queryParams,tree.fragment)});return rxjs_operator_catch._catch.call(mapped$,function(e){if(e instanceof NoMatch)throw _this.noMatchError(e);throw e})},ApplyRedirects.prototype.noMatchError=function(e){return new Error("Cannot match any routes. URL Segment: '"+e.segmentGroup+"'")},ApplyRedirects.prototype.createUrlTree=function(rootCandidate,queryParams,fragment){var root=rootCandidate.segments.length>0?new UrlSegmentGroup([],(_a={},_a[PRIMARY_OUTLET]=rootCandidate,_a)):rootCandidate;return new UrlTree(root,queryParams,fragment);var _a},ApplyRedirects.prototype.expandSegmentGroup=function(ngModule,routes,segmentGroup,outlet){return 0===segmentGroup.segments.length&&segmentGroup.hasChildren()?rxjs_operator_map.map.call(this.expandChildren(ngModule,routes,segmentGroup),function(children){return new UrlSegmentGroup([],children)}):this.expandSegment(ngModule,segmentGroup,routes,segmentGroup.segments,outlet,!0)},ApplyRedirects.prototype.expandChildren=function(ngModule,routes,segmentGroup){var _this=this;return waitForMap(segmentGroup.children,function(childOutlet,child){return _this.expandSegmentGroup(ngModule,routes,child,childOutlet)})},ApplyRedirects.prototype.expandSegment=function(ngModule,segmentGroup,routes,segments,outlet,allowRedirects){var _this=this,routes$=rxjs_observable_of.of.apply(void 0,routes),processedRoutes$=rxjs_operator_map.map.call(routes$,function(r){var expanded$=_this.expandSegmentAgainstRoute(ngModule,segmentGroup,routes,r,segments,outlet,allowRedirects);return rxjs_operator_catch._catch.call(expanded$,function(e){if(e instanceof NoMatch)return rxjs_observable_of.of(null);throw e})}),concattedProcessedRoutes$=rxjs_operator_concatAll.concatAll.call(processedRoutes$),first$=rxjs_operator_first.first.call(concattedProcessedRoutes$,function(s){return!!s});return rxjs_operator_catch._catch.call(first$,function(e,_){if(e instanceof rxjs_util_EmptyError.EmptyError){if(_this.noLeftoversInUrl(segmentGroup,segments,outlet))return rxjs_observable_of.of(new UrlSegmentGroup([],{}));throw new NoMatch(segmentGroup)}throw e})},ApplyRedirects.prototype.noLeftoversInUrl=function(segmentGroup,segments,outlet){return 0===segments.length&&!segmentGroup.children[outlet]},ApplyRedirects.prototype.expandSegmentAgainstRoute=function(ngModule,segmentGroup,routes,route,paths,outlet,allowRedirects){return getOutlet(route)!==outlet?noMatch(segmentGroup):void 0===route.redirectTo?this.matchSegmentAgainstRoute(ngModule,segmentGroup,route,paths):allowRedirects&&this.allowRedirects?this.expandSegmentAgainstRouteUsingRedirect(ngModule,segmentGroup,routes,route,paths,outlet):noMatch(segmentGroup)},ApplyRedirects.prototype.expandSegmentAgainstRouteUsingRedirect=function(ngModule,segmentGroup,routes,route,segments,outlet){return"**"===route.path?this.expandWildCardWithParamsAgainstRouteUsingRedirect(ngModule,routes,route,outlet):this.expandRegularSegmentAgainstRouteUsingRedirect(ngModule,segmentGroup,routes,route,segments,outlet)},ApplyRedirects.prototype.expandWildCardWithParamsAgainstRouteUsingRedirect=function(ngModule,routes,route,outlet){var _this=this,newTree=this.applyRedirectCommands([],route.redirectTo,{});return route.redirectTo.startsWith("/")?absoluteRedirect(newTree):rxjs_operator_mergeMap.mergeMap.call(this.lineralizeSegments(route,newTree),function(newSegments){var group=new UrlSegmentGroup(newSegments,{});return _this.expandSegment(ngModule,group,routes,newSegments,outlet,!1)})},ApplyRedirects.prototype.expandRegularSegmentAgainstRouteUsingRedirect=function(ngModule,segmentGroup,routes,route,segments,outlet){var _this=this,_a=match(segmentGroup,route,segments),matched=_a.matched,consumedSegments=_a.consumedSegments,lastChild=_a.lastChild,positionalParamSegments=_a.positionalParamSegments;if(!matched)return noMatch(segmentGroup);var newTree=this.applyRedirectCommands(consumedSegments,route.redirectTo,positionalParamSegments);return route.redirectTo.startsWith("/")?absoluteRedirect(newTree):rxjs_operator_mergeMap.mergeMap.call(this.lineralizeSegments(route,newTree),function(newSegments){return _this.expandSegment(ngModule,segmentGroup,routes,newSegments.concat(segments.slice(lastChild)),outlet,!1)})},ApplyRedirects.prototype.matchSegmentAgainstRoute=function(ngModule,rawSegmentGroup,route,segments){var _this=this;if("**"===route.path)return route.loadChildren?rxjs_operator_map.map.call(this.configLoader.load(ngModule.injector,route),function(cfg){return route._loadedConfig=cfg,new UrlSegmentGroup(segments,{})}):rxjs_observable_of.of(new UrlSegmentGroup(segments,{}));var _a=match(rawSegmentGroup,route,segments),matched=_a.matched,consumedSegments=_a.consumedSegments,lastChild=_a.lastChild;if(!matched)return noMatch(rawSegmentGroup);var rawSlicedSegments=segments.slice(lastChild),childConfig$=this.getChildConfig(ngModule,route);return rxjs_operator_mergeMap.mergeMap.call(childConfig$,function(routerConfig){var childModule=routerConfig.module,childConfig=routerConfig.routes,_a=split(rawSegmentGroup,consumedSegments,rawSlicedSegments,childConfig),segmentGroup=_a.segmentGroup,slicedSegments=_a.slicedSegments;if(0===slicedSegments.length&&segmentGroup.hasChildren()){var expanded$_1=_this.expandChildren(childModule,childConfig,segmentGroup);return rxjs_operator_map.map.call(expanded$_1,function(children){return new UrlSegmentGroup(consumedSegments,children)})}if(0===childConfig.length&&0===slicedSegments.length)return rxjs_observable_of.of(new UrlSegmentGroup(consumedSegments,{}));var expanded$=_this.expandSegment(childModule,segmentGroup,childConfig,slicedSegments,PRIMARY_OUTLET,!0);return rxjs_operator_map.map.call(expanded$,function(cs){return new UrlSegmentGroup(consumedSegments.concat(cs.segments),cs.children)})})},ApplyRedirects.prototype.getChildConfig=function(ngModule,route){var _this=this;return route.children?rxjs_observable_of.of(new LoadedRouterConfig(route.children,ngModule)):route.loadChildren?void 0!==route._loadedConfig?rxjs_observable_of.of(route._loadedConfig):rxjs_operator_mergeMap.mergeMap.call(runCanLoadGuard(ngModule.injector,route),function(shouldLoad){return shouldLoad?rxjs_operator_map.map.call(_this.configLoader.load(ngModule.injector,route),function(cfg){return route._loadedConfig=cfg,cfg}):canLoadFails(route)}):rxjs_observable_of.of(new LoadedRouterConfig([],ngModule))},ApplyRedirects.prototype.lineralizeSegments=function(route,urlTree){for(var res=[],c=urlTree.root;;){if(res=res.concat(c.segments),0===c.numberOfChildren)return rxjs_observable_of.of(res);if(c.numberOfChildren>1||!c.children[PRIMARY_OUTLET])return namedOutletsRedirect(route.redirectTo);c=c.children[PRIMARY_OUTLET]}},ApplyRedirects.prototype.applyRedirectCommands=function(segments,redirectTo,posParams){return this.applyRedirectCreatreUrlTree(redirectTo,this.urlSerializer.parse(redirectTo),segments,posParams)},ApplyRedirects.prototype.applyRedirectCreatreUrlTree=function(redirectTo,urlTree,segments,posParams){var newRoot=this.createSegmentGroup(redirectTo,urlTree.root,segments,posParams);return new UrlTree(newRoot,this.createQueryParams(urlTree.queryParams,this.urlTree.queryParams),urlTree.fragment)},ApplyRedirects.prototype.createQueryParams=function(redirectToParams,actualParams){var res={};return forEach(redirectToParams,function(v,k){var copySourceValue="string"==typeof v&&v.startsWith(":");if(copySourceValue){var sourceName=v.substring(1);res[k]=actualParams[sourceName]}else res[k]=v}),res},ApplyRedirects.prototype.createSegmentGroup=function(redirectTo,group,segments,posParams){var _this=this,updatedSegments=this.createSegments(redirectTo,group.segments,segments,posParams),children={};return forEach(group.children,function(child,name){children[name]=_this.createSegmentGroup(redirectTo,child,segments,posParams)}),new UrlSegmentGroup(updatedSegments,children)},ApplyRedirects.prototype.createSegments=function(redirectTo,redirectToSegments,actualSegments,posParams){var _this=this;return redirectToSegments.map(function(s){return s.path.startsWith(":")?_this.findPosParam(redirectTo,s,posParams):_this.findOrReturn(s,actualSegments)})},ApplyRedirects.prototype.findPosParam=function(redirectTo,redirectToUrlSegment,posParams){var pos=posParams[redirectToUrlSegment.path.substring(1)];if(!pos)throw new Error("Cannot redirect to '"+redirectTo+"'. Cannot find '"+redirectToUrlSegment.path+"'.");return pos},ApplyRedirects.prototype.findOrReturn=function(redirectToUrlSegment,actualSegments){for(var idx=0,_i=0,actualSegments_1=actualSegments;_i<actualSegments_1.length;_i++){var s=actualSegments_1[_i];if(s.path===redirectToUrlSegment.path)return actualSegments.splice(idx),s;idx++}return redirectToUrlSegment},ApplyRedirects}(),Tree=function(){function Tree(root){this._root=root}return Object.defineProperty(Tree.prototype,"root",{get:function(){return this._root.value},enumerable:!0,configurable:!0}),Tree.prototype.parent=function(t){var p=this.pathFromRoot(t);return p.length>1?p[p.length-2]:null},Tree.prototype.children=function(t){var n=findNode(t,this._root);return n?n.children.map(function(t){return t.value}):[]},Tree.prototype.firstChild=function(t){var n=findNode(t,this._root);return n&&n.children.length>0?n.children[0].value:null},Tree.prototype.siblings=function(t){var p=findPath(t,this._root);if(p.length<2)return[];var c=p[p.length-2].children.map(function(c){return c.value});return c.filter(function(cc){return cc!==t})},Tree.prototype.pathFromRoot=function(t){return findPath(t,this._root).map(function(s){return s.value})},Tree}(),TreeNode=function(){function TreeNode(value,children){this.value=value,this.children=children}return TreeNode.prototype.toString=function(){return"TreeNode("+this.value+")"},TreeNode}(),RouterState=function(_super){function RouterState(root,snapshot){var _this=_super.call(this,root)||this;return _this.snapshot=snapshot,setRouterState(_this,root),_this}return __extends(RouterState,_super),RouterState.prototype.toString=function(){return this.snapshot.toString()},RouterState}(Tree),ActivatedRoute=function(){function ActivatedRoute(url,params,queryParams,fragment,data,outlet,component,futureSnapshot){this.url=url,this.params=params,this.queryParams=queryParams,this.fragment=fragment,this.data=data,this.outlet=outlet,this.component=component,this._futureSnapshot=futureSnapshot}return Object.defineProperty(ActivatedRoute.prototype,"routeConfig",{get:function(){return this._futureSnapshot.routeConfig},enumerable:!0,configurable:!0}),Object.defineProperty(ActivatedRoute.prototype,"root",{get:function(){return this._routerState.root},enumerable:!0,configurable:!0}),Object.defineProperty(ActivatedRoute.prototype,"parent",{get:function(){return this._routerState.parent(this)},enumerable:!0,configurable:!0}),Object.defineProperty(ActivatedRoute.prototype,"firstChild",{get:function(){return this._routerState.firstChild(this)},enumerable:!0,configurable:!0}),Object.defineProperty(ActivatedRoute.prototype,"children",{get:function(){return this._routerState.children(this)},enumerable:!0,configurable:!0}),Object.defineProperty(ActivatedRoute.prototype,"pathFromRoot",{get:function(){return this._routerState.pathFromRoot(this)},enumerable:!0,configurable:!0}),Object.defineProperty(ActivatedRoute.prototype,"paramMap",{get:function(){return this._paramMap||(this._paramMap=rxjs_operator_map.map.call(this.params,function(p){return convertToParamMap(p)})),this._paramMap},enumerable:!0,configurable:!0}),Object.defineProperty(ActivatedRoute.prototype,"queryParamMap",{get:function(){return this._queryParamMap||(this._queryParamMap=rxjs_operator_map.map.call(this.queryParams,function(p){return convertToParamMap(p)})),this._queryParamMap},enumerable:!0,configurable:!0}),ActivatedRoute.prototype.toString=function(){return this.snapshot?this.snapshot.toString():"Future("+this._futureSnapshot+")"},ActivatedRoute}(),ActivatedRouteSnapshot=function(){function ActivatedRouteSnapshot(url,params,queryParams,fragment,data,outlet,component,routeConfig,urlSegment,lastPathIndex,resolve){this.url=url,this.params=params,this.queryParams=queryParams,this.fragment=fragment,this.data=data,this.outlet=outlet,this.component=component,this._routeConfig=routeConfig,this._urlSegment=urlSegment,this._lastPathIndex=lastPathIndex,this._resolve=resolve}return Object.defineProperty(ActivatedRouteSnapshot.prototype,"routeConfig",{get:function(){return this._routeConfig},enumerable:!0,configurable:!0}),Object.defineProperty(ActivatedRouteSnapshot.prototype,"root",{get:function(){return this._routerState.root},enumerable:!0,configurable:!0}),Object.defineProperty(ActivatedRouteSnapshot.prototype,"parent",{get:function(){return this._routerState.parent(this)},enumerable:!0,configurable:!0}),Object.defineProperty(ActivatedRouteSnapshot.prototype,"firstChild",{get:function(){return this._routerState.firstChild(this)},enumerable:!0,configurable:!0}),Object.defineProperty(ActivatedRouteSnapshot.prototype,"children",{get:function(){return this._routerState.children(this)},enumerable:!0,configurable:!0}),Object.defineProperty(ActivatedRouteSnapshot.prototype,"pathFromRoot",{get:function(){return this._routerState.pathFromRoot(this)},enumerable:!0,configurable:!0}),Object.defineProperty(ActivatedRouteSnapshot.prototype,"paramMap",{get:function(){return this._paramMap||(this._paramMap=convertToParamMap(this.params)),this._paramMap},enumerable:!0,configurable:!0}),Object.defineProperty(ActivatedRouteSnapshot.prototype,"queryParamMap",{get:function(){return this._queryParamMap||(this._queryParamMap=convertToParamMap(this.queryParams)),this._queryParamMap},enumerable:!0,configurable:!0}),ActivatedRouteSnapshot.prototype.toString=function(){var url=this.url.map(function(segment){return segment.toString()}).join("/"),matched=this._routeConfig?this._routeConfig.path:"";return"Route(url:'"+url+"', path:'"+matched+"')"},ActivatedRouteSnapshot}(),RouterStateSnapshot=function(_super){function RouterStateSnapshot(url,root){var _this=_super.call(this,root)||this;return _this.url=url,setRouterState(_this,root),_this}return __extends(RouterStateSnapshot,_super),RouterStateSnapshot.prototype.toString=function(){return serializeNode(this._root)},RouterStateSnapshot}(Tree),Navigation=function(){function Navigation(isAbsolute,numberOfDoubleDots,commands){if(this.isAbsolute=isAbsolute,this.numberOfDoubleDots=numberOfDoubleDots,this.commands=commands,isAbsolute&&commands.length>0&&isMatrixParams(commands[0]))throw new Error("Root segment cannot have matrix parameters");var cmdWithOutlet=commands.find(function(c){return"object"==typeof c&&null!=c&&c.outlets});if(cmdWithOutlet&&cmdWithOutlet!==last$1(commands))throw new Error("{outlets:{}} has to be the last command")}return Navigation.prototype.toRoot=function(){return this.isAbsolute&&1===this.commands.length&&"/"==this.commands[0]},Navigation}(),Position=function(){function Position(segmentGroup,processChildren,index){this.segmentGroup=segmentGroup,this.processChildren=processChildren,this.index=index}return Position}(),NoMatch$1=function(){function NoMatch$1(){}return NoMatch$1}(),Recognizer=function(){function Recognizer(rootComponentType,config,urlTree,url){this.rootComponentType=rootComponentType,this.config=config,this.urlTree=urlTree,this.url=url}return Recognizer.prototype.recognize=function(){try{var rootSegmentGroup=split$1(this.urlTree.root,[],[],this.config).segmentGroup,children=this.processSegmentGroup(this.config,rootSegmentGroup,PRIMARY_OUTLET),root=new ActivatedRouteSnapshot([],Object.freeze({}),Object.freeze(this.urlTree.queryParams),this.urlTree.fragment,{},PRIMARY_OUTLET,this.rootComponentType,null,this.urlTree.root,(-1),{}),rootNode=new TreeNode(root,children),routeState=new RouterStateSnapshot(this.url,rootNode);return this.inheritParamsAndData(routeState._root),rxjs_observable_of.of(routeState)}catch(e){return new rxjs_Observable.Observable(function(obs){return obs.error(e)})}},Recognizer.prototype.inheritParamsAndData=function(routeNode){var _this=this,route=routeNode.value,i=inheritedParamsDataResolve(route);route.params=Object.freeze(i.params),route.data=Object.freeze(i.data),routeNode.children.forEach(function(n){return _this.inheritParamsAndData(n)})},Recognizer.prototype.processSegmentGroup=function(config,segmentGroup,outlet){return 0===segmentGroup.segments.length&&segmentGroup.hasChildren()?this.processChildren(config,segmentGroup):this.processSegment(config,segmentGroup,segmentGroup.segments,outlet)},Recognizer.prototype.processChildren=function(config,segmentGroup){var _this=this,children=mapChildrenIntoArray(segmentGroup,function(child,childOutlet){return _this.processSegmentGroup(config,child,childOutlet)});return checkOutletNameUniqueness(children),sortActivatedRouteSnapshots(children),children},Recognizer.prototype.processSegment=function(config,segmentGroup,segments,outlet){for(var _i=0,config_1=config;_i<config_1.length;_i++){var r=config_1[_i];try{return this.processSegmentAgainstRoute(r,segmentGroup,segments,outlet)}catch(e){if(!(e instanceof NoMatch$1))throw e}}if(this.noLeftoversInUrl(segmentGroup,segments,outlet))return[];throw new NoMatch$1},Recognizer.prototype.noLeftoversInUrl=function(segmentGroup,segments,outlet){return 0===segments.length&&!segmentGroup.children[outlet]},Recognizer.prototype.processSegmentAgainstRoute=function(route,rawSegment,segments,outlet){if(route.redirectTo)throw new NoMatch$1;if((route.outlet||PRIMARY_OUTLET)!==outlet)throw new NoMatch$1;if("**"===route.path){var params=segments.length>0?last$1(segments).parameters:{},snapshot_1=new ActivatedRouteSnapshot(segments,params,Object.freeze(this.urlTree.queryParams),this.urlTree.fragment,getData(route),outlet,route.component,route,getSourceSegmentGroup(rawSegment),getPathIndexShift(rawSegment)+segments.length,getResolve(route));return[new TreeNode(snapshot_1,[])]}var _a=match$1(rawSegment,route,segments),consumedSegments=_a.consumedSegments,parameters=_a.parameters,lastChild=_a.lastChild,rawSlicedSegments=segments.slice(lastChild),childConfig=getChildConfig(route),_b=split$1(rawSegment,consumedSegments,rawSlicedSegments,childConfig),segmentGroup=_b.segmentGroup,slicedSegments=_b.slicedSegments,snapshot=new ActivatedRouteSnapshot(consumedSegments,parameters,Object.freeze(this.urlTree.queryParams),this.urlTree.fragment,getData(route),outlet,route.component,route,getSourceSegmentGroup(rawSegment),getPathIndexShift(rawSegment)+consumedSegments.length,getResolve(route));if(0===slicedSegments.length&&segmentGroup.hasChildren()){var children_3=this.processChildren(childConfig,segmentGroup);return[new TreeNode(snapshot,children_3)]}if(0===childConfig.length&&0===slicedSegments.length)return[new TreeNode(snapshot,[])];var children=this.processSegment(childConfig,segmentGroup,slicedSegments,PRIMARY_OUTLET);return[new TreeNode(snapshot,children)]},Recognizer}(),RouteReuseStrategy=function(){function RouteReuseStrategy(){}return RouteReuseStrategy.prototype.shouldDetach=function(route){},RouteReuseStrategy.prototype.store=function(route,handle){},RouteReuseStrategy.prototype.shouldAttach=function(route){},RouteReuseStrategy.prototype.retrieve=function(route){},RouteReuseStrategy.prototype.shouldReuseRoute=function(future,curr){},RouteReuseStrategy}(),DefaultRouteReuseStrategy=function(){
|
|
42
|
-
function DefaultRouteReuseStrategy(){}return DefaultRouteReuseStrategy.prototype.shouldDetach=function(route){return!1},DefaultRouteReuseStrategy.prototype.store=function(route,detachedTree){},DefaultRouteReuseStrategy.prototype.shouldAttach=function(route){return!1},DefaultRouteReuseStrategy.prototype.retrieve=function(route){return null},DefaultRouteReuseStrategy.prototype.shouldReuseRoute=function(future,curr){return future.routeConfig===curr.routeConfig},DefaultRouteReuseStrategy}(),ROUTES=new _angular_core.InjectionToken("ROUTES"),RouterConfigLoader=function(){function RouterConfigLoader(loader,compiler,onLoadStartListener,onLoadEndListener){this.loader=loader,this.compiler=compiler,this.onLoadStartListener=onLoadStartListener,this.onLoadEndListener=onLoadEndListener}return RouterConfigLoader.prototype.load=function(parentInjector,route){var _this=this;this.onLoadStartListener&&this.onLoadStartListener(route);var moduleFactory$=this.loadModuleFactory(route.loadChildren);return rxjs_operator_map.map.call(moduleFactory$,function(factory){_this.onLoadEndListener&&_this.onLoadEndListener(route);var module=factory.create(parentInjector);return new LoadedRouterConfig(flatten(module.injector.get(ROUTES)),module)})},RouterConfigLoader.prototype.loadModuleFactory=function(loadChildren){var _this=this;return"string"==typeof loadChildren?rxjs_observable_fromPromise.fromPromise(this.loader.load(loadChildren)):rxjs_operator_mergeMap.mergeMap.call(wrapIntoObservable(loadChildren()),function(t){return t instanceof _angular_core.NgModuleFactory?rxjs_observable_of.of(t):rxjs_observable_fromPromise.fromPromise(_this.compiler.compileModuleAsync(t))})},RouterConfigLoader}(),UrlHandlingStrategy=function(){function UrlHandlingStrategy(){}return UrlHandlingStrategy.prototype.shouldProcessUrl=function(url){},UrlHandlingStrategy.prototype.extract=function(url){},UrlHandlingStrategy.prototype.merge=function(newUrlPart,rawUrl){},UrlHandlingStrategy}(),DefaultUrlHandlingStrategy=function(){function DefaultUrlHandlingStrategy(){}return DefaultUrlHandlingStrategy.prototype.shouldProcessUrl=function(url){return!0},DefaultUrlHandlingStrategy.prototype.extract=function(url){return url},DefaultUrlHandlingStrategy.prototype.merge=function(newUrlPart,wholeUrl){return newUrlPart},DefaultUrlHandlingStrategy}(),Router=function(){function Router(rootComponentType,urlSerializer,rootContexts,location,injector,loader,compiler,config){var _this=this;this.rootComponentType=rootComponentType,this.urlSerializer=urlSerializer,this.rootContexts=rootContexts,this.location=location,this.config=config,this.navigations=new rxjs_BehaviorSubject.BehaviorSubject(null),this.routerEvents=new rxjs_Subject.Subject,this.navigationId=0,this.errorHandler=defaultErrorHandler,this.navigated=!1,this.hooks={beforePreactivation:defaultRouterHook,afterPreactivation:defaultRouterHook},this.urlHandlingStrategy=new DefaultUrlHandlingStrategy,this.routeReuseStrategy=new DefaultRouteReuseStrategy;var onLoadStart=function(r){return _this.triggerEvent(new RouteConfigLoadStart(r))},onLoadEnd=function(r){return _this.triggerEvent(new RouteConfigLoadEnd(r))};this.ngModule=injector.get(_angular_core.NgModuleRef),this.resetConfig(config),this.currentUrlTree=createEmptyUrlTree(),this.rawUrlTree=this.currentUrlTree,this.configLoader=new RouterConfigLoader(loader,compiler,onLoadStart,onLoadEnd),this.currentRouterState=createEmptyState(this.currentUrlTree,this.rootComponentType),this.processNavigations()}return Router.prototype.resetRootComponentType=function(rootComponentType){this.rootComponentType=rootComponentType,this.currentRouterState.root.component=this.rootComponentType},Router.prototype.initialNavigation=function(){this.setUpLocationChangeListener(),0===this.navigationId&&this.navigateByUrl(this.location.path(!0),{replaceUrl:!0})},Router.prototype.setUpLocationChangeListener=function(){var _this=this;this.locationSubscription||(this.locationSubscription=this.location.subscribe(Zone.current.wrap(function(change){var rawUrlTree=_this.urlSerializer.parse(change.url),source="popstate"===change.type?"popstate":"hashchange";setTimeout(function(){_this.scheduleNavigation(rawUrlTree,source,{replaceUrl:!0})},0)})))},Object.defineProperty(Router.prototype,"routerState",{get:function(){return this.currentRouterState},enumerable:!0,configurable:!0}),Object.defineProperty(Router.prototype,"url",{get:function(){return this.serializeUrl(this.currentUrlTree)},enumerable:!0,configurable:!0}),Object.defineProperty(Router.prototype,"events",{get:function(){return this.routerEvents},enumerable:!0,configurable:!0}),Router.prototype.triggerEvent=function(e){this.routerEvents.next(e)},Router.prototype.resetConfig=function(config){validateConfig(config),this.config=config},Router.prototype.ngOnDestroy=function(){this.dispose()},Router.prototype.dispose=function(){this.locationSubscription&&(this.locationSubscription.unsubscribe(),this.locationSubscription=null)},Router.prototype.createUrlTree=function(commands,_a){var _b=void 0===_a?{}:_a,relativeTo=_b.relativeTo,queryParams=_b.queryParams,fragment=_b.fragment,preserveQueryParams=_b.preserveQueryParams,queryParamsHandling=_b.queryParamsHandling,preserveFragment=_b.preserveFragment;_angular_core.isDevMode()&&preserveQueryParams&&console&&console.warn&&console.warn("preserveQueryParams is deprecated, use queryParamsHandling instead.");var a=relativeTo||this.routerState.root,f=preserveFragment?this.currentUrlTree.fragment:fragment,q=null;if(queryParamsHandling)switch(queryParamsHandling){case"merge":q=Object.assign({},this.currentUrlTree.queryParams,queryParams);break;case"preserve":q=this.currentUrlTree.queryParams;break;default:q=queryParams||null}else q=preserveQueryParams?this.currentUrlTree.queryParams:queryParams||null;return createUrlTree(a,this.currentUrlTree,commands,q,f)},Router.prototype.navigateByUrl=function(url,extras){void 0===extras&&(extras={skipLocationChange:!1});var urlTree=url instanceof UrlTree?url:this.parseUrl(url),mergedTree=this.urlHandlingStrategy.merge(urlTree,this.rawUrlTree);return this.scheduleNavigation(mergedTree,"imperative",extras)},Router.prototype.navigate=function(commands,extras){return void 0===extras&&(extras={skipLocationChange:!1}),validateCommands(commands),"object"==typeof extras.queryParams&&null!==extras.queryParams&&(extras.queryParams=this.removeEmptyProps(extras.queryParams)),this.navigateByUrl(this.createUrlTree(commands,extras),extras)},Router.prototype.serializeUrl=function(url){return this.urlSerializer.serialize(url)},Router.prototype.parseUrl=function(url){return this.urlSerializer.parse(url)},Router.prototype.isActive=function(url,exact){if(url instanceof UrlTree)return containsTree(this.currentUrlTree,url,exact);var urlTree=this.urlSerializer.parse(url);return containsTree(this.currentUrlTree,urlTree,exact)},Router.prototype.removeEmptyProps=function(params){return Object.keys(params).reduce(function(result,key){var value=params[key];return null!==value&&void 0!==value&&(result[key]=value),result},{})},Router.prototype.processNavigations=function(){var _this=this;rxjs_operator_concatMap.concatMap.call(this.navigations,function(nav){return nav?(_this.executeScheduledNavigation(nav),nav.promise.catch(function(){})):rxjs_observable_of.of(null)}).subscribe(function(){})},Router.prototype.scheduleNavigation=function(rawUrl,source,extras){var lastNavigation=this.navigations.value;if(lastNavigation&&"imperative"!==source&&"imperative"===lastNavigation.source&&lastNavigation.rawUrl.toString()===rawUrl.toString())return Promise.resolve(!0);if(lastNavigation&&"hashchange"==source&&"popstate"===lastNavigation.source&&lastNavigation.rawUrl.toString()===rawUrl.toString())return Promise.resolve(!0);var resolve=null,reject=null,promise=new Promise(function(res,rej){resolve=res,reject=rej}),id=++this.navigationId;return this.navigations.next({id:id,source:source,rawUrl:rawUrl,extras:extras,resolve:resolve,reject:reject,promise:promise}),promise.catch(function(e){return Promise.reject(e)})},Router.prototype.executeScheduledNavigation=function(_a){var _this=this,id=_a.id,rawUrl=_a.rawUrl,extras=_a.extras,resolve=_a.resolve,reject=_a.reject,url=this.urlHandlingStrategy.extract(rawUrl),urlTransition=!this.navigated||url.toString()!==this.currentUrlTree.toString();urlTransition&&this.urlHandlingStrategy.shouldProcessUrl(rawUrl)?(this.routerEvents.next(new NavigationStart(id,this.serializeUrl(url))),Promise.resolve().then(function(_){return _this.runNavigate(url,rawUrl,!!extras.skipLocationChange,!!extras.replaceUrl,id,null)}).then(resolve,reject)):urlTransition&&this.rawUrlTree&&this.urlHandlingStrategy.shouldProcessUrl(this.rawUrlTree)?(this.routerEvents.next(new NavigationStart(id,this.serializeUrl(url))),Promise.resolve().then(function(_){return _this.runNavigate(url,rawUrl,!1,!1,id,createEmptyState(url,_this.rootComponentType).snapshot)}).then(resolve,reject)):(this.rawUrlTree=rawUrl,resolve(null))},Router.prototype.runNavigate=function(url,rawUrl,shouldPreventPushState,shouldReplaceUrl,id,precreatedState){var _this=this;return id!==this.navigationId?(this.location.go(this.urlSerializer.serialize(this.currentUrlTree)),this.routerEvents.next(new NavigationCancel(id,this.serializeUrl(url),"Navigation ID "+id+" is not equal to the current navigation id "+this.navigationId)),Promise.resolve(!1)):new Promise(function(resolvePromise,rejectPromise){var urlAndSnapshot$;if(precreatedState)urlAndSnapshot$=rxjs_observable_of.of({appliedUrl:url,snapshot:precreatedState});else{var moduleInjector=_this.ngModule.injector,redirectsApplied$=applyRedirects(moduleInjector,_this.configLoader,_this.urlSerializer,url,_this.config);urlAndSnapshot$=rxjs_operator_mergeMap.mergeMap.call(redirectsApplied$,function(appliedUrl){return rxjs_operator_map.map.call(recognize(_this.rootComponentType,_this.config,appliedUrl,_this.serializeUrl(appliedUrl)),function(snapshot){return _this.routerEvents.next(new RoutesRecognized(id,_this.serializeUrl(url),_this.serializeUrl(appliedUrl),snapshot)),{appliedUrl:appliedUrl,snapshot:snapshot}})})}var preActivation,navigationIsSuccessful,beforePreactivationDone$=rxjs_operator_mergeMap.mergeMap.call(urlAndSnapshot$,function(p){return rxjs_operator_map.map.call(_this.hooks.beforePreactivation(p.snapshot),function(){return p})}),preactivationTraverse$=rxjs_operator_map.map.call(beforePreactivationDone$,function(_a){var appliedUrl=_a.appliedUrl,snapshot=_a.snapshot,moduleInjector=_this.ngModule.injector;return preActivation=new PreActivation(snapshot,_this.currentRouterState.snapshot,moduleInjector),preActivation.traverse(_this.rootContexts),{appliedUrl:appliedUrl,snapshot:snapshot}}),preactivationCheckGuards$=rxjs_operator_mergeMap.mergeMap.call(preactivationTraverse$,function(_a){var appliedUrl=_a.appliedUrl,snapshot=_a.snapshot;return _this.navigationId!==id?rxjs_observable_of.of(!1):rxjs_operator_map.map.call(preActivation.checkGuards(),function(shouldActivate){return{appliedUrl:appliedUrl,snapshot:snapshot,shouldActivate:shouldActivate}})}),preactivationResolveData$=rxjs_operator_mergeMap.mergeMap.call(preactivationCheckGuards$,function(p){return _this.navigationId!==id?rxjs_observable_of.of(!1):p.shouldActivate?rxjs_operator_map.map.call(preActivation.resolveData(),function(){return p}):rxjs_observable_of.of(p)}),preactivationDone$=rxjs_operator_mergeMap.mergeMap.call(preactivationResolveData$,function(p){return rxjs_operator_map.map.call(_this.hooks.afterPreactivation(p.snapshot),function(){return p})}),routerState$=rxjs_operator_map.map.call(preactivationDone$,function(_a){var appliedUrl=_a.appliedUrl,snapshot=_a.snapshot,shouldActivate=_a.shouldActivate;if(shouldActivate){var state=createRouterState(_this.routeReuseStrategy,snapshot,_this.currentRouterState);return{appliedUrl:appliedUrl,state:state,shouldActivate:shouldActivate}}return{appliedUrl:appliedUrl,state:null,shouldActivate:shouldActivate}}),storedState=_this.currentRouterState,storedUrl=_this.currentUrlTree;routerState$.forEach(function(_a){var appliedUrl=_a.appliedUrl,state=_a.state,shouldActivate=_a.shouldActivate;if(!shouldActivate||id!==_this.navigationId)return void(navigationIsSuccessful=!1);if(_this.currentUrlTree=appliedUrl,_this.rawUrlTree=_this.urlHandlingStrategy.merge(_this.currentUrlTree,rawUrl),_this.currentRouterState=state,!shouldPreventPushState){var path=_this.urlSerializer.serialize(_this.rawUrlTree);_this.location.isCurrentPathEqualTo(path)||shouldReplaceUrl?_this.location.replaceState(path):_this.location.go(path)}new ActivateRoutes(_this.routeReuseStrategy,state,storedState).activate(_this.rootContexts),navigationIsSuccessful=!0}).then(function(){navigationIsSuccessful?(_this.navigated=!0,_this.routerEvents.next(new NavigationEnd(id,_this.serializeUrl(url),_this.serializeUrl(_this.currentUrlTree))),resolvePromise(!0)):(_this.resetUrlToCurrentUrlTree(),_this.routerEvents.next(new NavigationCancel(id,_this.serializeUrl(url),"")),resolvePromise(!1))},function(e){if(isNavigationCancelingError(e))_this.resetUrlToCurrentUrlTree(),_this.navigated=!0,_this.routerEvents.next(new NavigationCancel(id,_this.serializeUrl(url),e.message)),resolvePromise(!1);else{_this.routerEvents.next(new NavigationError(id,_this.serializeUrl(url),e));try{resolvePromise(_this.errorHandler(e))}catch(ee){rejectPromise(ee)}}_this.currentRouterState=storedState,_this.currentUrlTree=storedUrl,_this.rawUrlTree=_this.urlHandlingStrategy.merge(_this.currentUrlTree,rawUrl),_this.location.replaceState(_this.serializeUrl(_this.rawUrlTree))})})},Router.prototype.resetUrlToCurrentUrlTree=function(){var path=this.urlSerializer.serialize(this.rawUrlTree);this.location.replaceState(path)},Router}(),CanActivate=function(){function CanActivate(path){this.path=path}return Object.defineProperty(CanActivate.prototype,"route",{get:function(){return this.path[this.path.length-1]},enumerable:!0,configurable:!0}),CanActivate}(),CanDeactivate=function(){function CanDeactivate(component,route){this.component=component,this.route=route}return CanDeactivate}(),PreActivation=function(){function PreActivation(future,curr,moduleInjector){this.future=future,this.curr=curr,this.moduleInjector=moduleInjector,this.canActivateChecks=[],this.canDeactivateChecks=[]}return PreActivation.prototype.traverse=function(parentContexts){var futureRoot=this.future._root,currRoot=this.curr?this.curr._root:null;this.traverseChildRoutes(futureRoot,currRoot,parentContexts,[futureRoot.value])},PreActivation.prototype.checkGuards=function(){var _this=this;if(0===this.canDeactivateChecks.length&&0===this.canActivateChecks.length)return rxjs_observable_of.of(!0);var canDeactivate$=this.runCanDeactivateChecks();return rxjs_operator_mergeMap.mergeMap.call(canDeactivate$,function(canDeactivate){return canDeactivate?_this.runCanActivateChecks():rxjs_observable_of.of(!1)})},PreActivation.prototype.resolveData=function(){var _this=this;if(0===this.canActivateChecks.length)return rxjs_observable_of.of(null);var checks$=rxjs_observable_from.from(this.canActivateChecks),runningChecks$=rxjs_operator_concatMap.concatMap.call(checks$,function(check){return _this.runResolve(check.route)});return rxjs_operator_reduce.reduce.call(runningChecks$,function(_,__){return _})},PreActivation.prototype.traverseChildRoutes=function(futureNode,currNode,contexts,futurePath){var _this=this,prevChildren=nodeChildrenAsMap(currNode);futureNode.children.forEach(function(c){_this.traverseRoutes(c,prevChildren[c.value.outlet],contexts,futurePath.concat([c.value])),delete prevChildren[c.value.outlet]}),forEach(prevChildren,function(v,k){return _this.deactivateRouteAndItsChildren(v,contexts.getContext(k))})},PreActivation.prototype.traverseRoutes=function(futureNode,currNode,parentContexts,futurePath){var future=futureNode.value,curr=currNode?currNode.value:null,context=parentContexts?parentContexts.getContext(futureNode.value.outlet):null;if(curr&&future._routeConfig===curr._routeConfig){if(this.shouldRunGuardsAndResolvers(curr,future,future._routeConfig.runGuardsAndResolvers)){this.canActivateChecks.push(new CanActivate(futurePath));var outlet=context.outlet;this.canDeactivateChecks.push(new CanDeactivate(outlet.component,curr))}else future.data=curr.data,future._resolvedData=curr._resolvedData;future.component?this.traverseChildRoutes(futureNode,currNode,context?context.children:null,futurePath):this.traverseChildRoutes(futureNode,currNode,parentContexts,futurePath)}else curr&&this.deactivateRouteAndItsChildren(currNode,context),this.canActivateChecks.push(new CanActivate(futurePath)),future.component?this.traverseChildRoutes(futureNode,null,context?context.children:null,futurePath):this.traverseChildRoutes(futureNode,null,parentContexts,futurePath)},PreActivation.prototype.shouldRunGuardsAndResolvers=function(curr,future,mode){switch(mode){case"always":return!0;case"paramsOrQueryParamsChange":return!equalParamsAndUrlSegments(curr,future)||!shallowEqual(curr.queryParams,future.queryParams);case"paramsChange":default:return!equalParamsAndUrlSegments(curr,future)}},PreActivation.prototype.deactivateRouteAndItsChildren=function(route,context){var _this=this,children=nodeChildrenAsMap(route),r=route.value;forEach(children,function(node,childName){r.component?context?_this.deactivateRouteAndItsChildren(node,context.children.getContext(childName)):_this.deactivateRouteAndItsChildren(node,null):_this.deactivateRouteAndItsChildren(node,context)}),r.component&&context&&context.outlet&&context.outlet.isActivated?this.canDeactivateChecks.push(new CanDeactivate(context.outlet.component,r)):this.canDeactivateChecks.push(new CanDeactivate(null,r))},PreActivation.prototype.runCanDeactivateChecks=function(){var _this=this,checks$=rxjs_observable_from.from(this.canDeactivateChecks),runningChecks$=rxjs_operator_mergeMap.mergeMap.call(checks$,function(check){return _this.runCanDeactivate(check.component,check.route)});return rxjs_operator_every.every.call(runningChecks$,function(result){return result===!0})},PreActivation.prototype.runCanActivateChecks=function(){var _this=this,checks$=rxjs_observable_from.from(this.canActivateChecks),runningChecks$=rxjs_operator_mergeMap.mergeMap.call(checks$,function(check){return andObservables(rxjs_observable_from.from([_this.runCanActivateChild(check.path),_this.runCanActivate(check.route)]))});return rxjs_operator_every.every.call(runningChecks$,function(result){return result===!0})},PreActivation.prototype.runCanActivate=function(future){var _this=this,canActivate=future._routeConfig?future._routeConfig.canActivate:null;if(!canActivate||0===canActivate.length)return rxjs_observable_of.of(!0);var obs=rxjs_operator_map.map.call(rxjs_observable_from.from(canActivate),function(c){var observable,guard=_this.getToken(c,future);return observable=wrapIntoObservable(guard.canActivate?guard.canActivate(future,_this.future):guard(future,_this.future)),rxjs_operator_first.first.call(observable)});return andObservables(obs)},PreActivation.prototype.runCanActivateChild=function(path){var _this=this,future=path[path.length-1],canActivateChildGuards=path.slice(0,path.length-1).reverse().map(function(p){return _this.extractCanActivateChild(p)}).filter(function(_){return null!==_});return andObservables(rxjs_operator_map.map.call(rxjs_observable_from.from(canActivateChildGuards),function(d){var obs=rxjs_operator_map.map.call(rxjs_observable_from.from(d.guards),function(c){var observable,guard=_this.getToken(c,d.node);return observable=wrapIntoObservable(guard.canActivateChild?guard.canActivateChild(future,_this.future):guard(future,_this.future)),rxjs_operator_first.first.call(observable)});return andObservables(obs)}))},PreActivation.prototype.extractCanActivateChild=function(p){var canActivateChild=p._routeConfig?p._routeConfig.canActivateChild:null;return canActivateChild&&0!==canActivateChild.length?{node:p,guards:canActivateChild}:null},PreActivation.prototype.runCanDeactivate=function(component,curr){var _this=this,canDeactivate=curr&&curr._routeConfig?curr._routeConfig.canDeactivate:null;if(!canDeactivate||0===canDeactivate.length)return rxjs_observable_of.of(!0);var canDeactivate$=rxjs_operator_mergeMap.mergeMap.call(rxjs_observable_from.from(canDeactivate),function(c){var observable,guard=_this.getToken(c,curr);return observable=wrapIntoObservable(guard.canDeactivate?guard.canDeactivate(component,curr,_this.curr,_this.future):guard(component,curr,_this.curr,_this.future)),rxjs_operator_first.first.call(observable)});return rxjs_operator_every.every.call(canDeactivate$,function(result){return result===!0})},PreActivation.prototype.runResolve=function(future){var resolve=future._resolve;return rxjs_operator_map.map.call(this.resolveNode(resolve,future),function(resolvedData){return future._resolvedData=resolvedData,future.data=Object.assign({},future.data,inheritedParamsDataResolve(future).resolve),null})},PreActivation.prototype.resolveNode=function(resolve,future){var _this=this;return waitForMap(resolve,function(k,v){var resolver=_this.getToken(v,future);return wrapIntoObservable(resolver.resolve?resolver.resolve(future,_this.future):resolver(future,_this.future))})},PreActivation.prototype.getToken=function(token,snapshot){var config=closestLoadedConfig(snapshot),injector=config?config.module.injector:this.moduleInjector;return injector.get(token)},PreActivation}(),ActivateRoutes=function(){function ActivateRoutes(routeReuseStrategy,futureState,currState){this.routeReuseStrategy=routeReuseStrategy,this.futureState=futureState,this.currState=currState}return ActivateRoutes.prototype.activate=function(parentContexts){var futureRoot=this.futureState._root,currRoot=this.currState?this.currState._root:null;this.deactivateChildRoutes(futureRoot,currRoot,parentContexts),advanceActivatedRoute(this.futureState.root),this.activateChildRoutes(futureRoot,currRoot,parentContexts)},ActivateRoutes.prototype.deactivateChildRoutes=function(futureNode,currNode,contexts){var _this=this,children=nodeChildrenAsMap(currNode);futureNode.children.forEach(function(futureChild){var childOutletName=futureChild.value.outlet;_this.deactivateRoutes(futureChild,children[childOutletName],contexts),delete children[childOutletName]}),forEach(children,function(v,childName){_this.deactivateRouteAndItsChildren(v,contexts)})},ActivateRoutes.prototype.deactivateRoutes=function(futureNode,currNode,parentContext){var future=futureNode.value,curr=currNode?currNode.value:null;if(future===curr)if(future.component){var context=parentContext.getContext(future.outlet);context&&this.deactivateChildRoutes(futureNode,currNode,context.children)}else this.deactivateChildRoutes(futureNode,currNode,parentContext);else curr&&this.deactivateRouteAndItsChildren(currNode,parentContext)},ActivateRoutes.prototype.deactivateRouteAndItsChildren=function(route,parentContexts){this.routeReuseStrategy.shouldDetach(route.value.snapshot)?this.detachAndStoreRouteSubtree(route,parentContexts):this.deactivateRouteAndOutlet(route,parentContexts)},ActivateRoutes.prototype.detachAndStoreRouteSubtree=function(route,parentContexts){var context=parentContexts.getContext(route.value.outlet);if(context&&context.outlet){var componentRef=context.outlet.detach(),contexts=context.children.onOutletDeactivated();this.routeReuseStrategy.store(route.value.snapshot,{componentRef:componentRef,route:route,contexts:contexts})}},ActivateRoutes.prototype.deactivateRouteAndOutlet=function(route,parentContexts){var _this=this,context=parentContexts.getContext(route.value.outlet);if(context){var children=nodeChildrenAsMap(route),contexts_1=route.value.component?context.children:parentContexts;forEach(children,function(v,k){_this.deactivateRouteAndItsChildren(v,contexts_1)}),context.outlet&&(context.outlet.deactivate(),context.children.onOutletDeactivated())}},ActivateRoutes.prototype.activateChildRoutes=function(futureNode,currNode,contexts){var _this=this,children=nodeChildrenAsMap(currNode);futureNode.children.forEach(function(c){_this.activateRoutes(c,children[c.value.outlet],contexts)})},ActivateRoutes.prototype.activateRoutes=function(futureNode,currNode,parentContexts){var future=futureNode.value,curr=currNode?currNode.value:null;if(advanceActivatedRoute(future),future===curr)if(future.component){var context=parentContexts.getOrCreateContext(future.outlet);this.activateChildRoutes(futureNode,currNode,context.children)}else this.activateChildRoutes(futureNode,currNode,parentContexts);else if(future.component){var context=parentContexts.getOrCreateContext(future.outlet);if(this.routeReuseStrategy.shouldAttach(future.snapshot)){var stored=this.routeReuseStrategy.retrieve(future.snapshot);this.routeReuseStrategy.store(future.snapshot,null),context.children.onOutletReAttached(stored.contexts),context.attachRef=stored.componentRef,context.route=stored.route.value,context.outlet&&context.outlet.attach(stored.componentRef,stored.route.value),advanceActivatedRouteNodeAndItsChildren(stored.route)}else{var config=parentLoadedConfig(future.snapshot),cmpFactoryResolver=config?config.module.componentFactoryResolver:null;context.route=future,context.resolver=cmpFactoryResolver,context.outlet&&context.outlet.activateWith(future,cmpFactoryResolver),this.activateChildRoutes(futureNode,null,context.children)}}else this.activateChildRoutes(futureNode,null,parentContexts)},ActivateRoutes}(),RouterLink=function(){function RouterLink(router,route,tabIndex,renderer,el){this.router=router,this.route=route,this.commands=[],null==tabIndex&&renderer.setElementAttribute(el.nativeElement,"tabindex","0")}return Object.defineProperty(RouterLink.prototype,"routerLink",{set:function(commands){null!=commands?this.commands=Array.isArray(commands)?commands:[commands]:this.commands=[]},enumerable:!0,configurable:!0}),Object.defineProperty(RouterLink.prototype,"preserveQueryParams",{set:function(value){_angular_core.isDevMode()&&console&&console.warn&&console.warn("preserveQueryParams is deprecated!, use queryParamsHandling instead."),this.preserve=value},enumerable:!0,configurable:!0}),RouterLink.prototype.onClick=function(){var extras={skipLocationChange:attrBoolValue(this.skipLocationChange),replaceUrl:attrBoolValue(this.replaceUrl)};return this.router.navigateByUrl(this.urlTree,extras),!0},Object.defineProperty(RouterLink.prototype,"urlTree",{get:function(){return this.router.createUrlTree(this.commands,{relativeTo:this.route,queryParams:this.queryParams,fragment:this.fragment,preserveQueryParams:attrBoolValue(this.preserve),queryParamsHandling:this.queryParamsHandling,preserveFragment:attrBoolValue(this.preserveFragment)})},enumerable:!0,configurable:!0}),RouterLink}();RouterLink.decorators=[{type:_angular_core.Directive,args:[{selector:":not(a)[routerLink]"}]}],RouterLink.ctorParameters=function(){return[{type:Router},{type:ActivatedRoute},{type:void 0,decorators:[{type:_angular_core.Attribute,args:["tabindex"]}]},{type:_angular_core.Renderer},{type:_angular_core.ElementRef}]},RouterLink.propDecorators={queryParams:[{type:_angular_core.Input}],fragment:[{type:_angular_core.Input}],queryParamsHandling:[{type:_angular_core.Input}],preserveFragment:[{type:_angular_core.Input}],skipLocationChange:[{type:_angular_core.Input}],replaceUrl:[{type:_angular_core.Input}],routerLink:[{type:_angular_core.Input}],preserveQueryParams:[{type:_angular_core.Input}],onClick:[{type:_angular_core.HostListener,args:["click"]}]};var RouterLinkWithHref=function(){function RouterLinkWithHref(router,route,locationStrategy){var _this=this;this.router=router,this.route=route,this.locationStrategy=locationStrategy,this.commands=[],this.subscription=router.events.subscribe(function(s){s instanceof NavigationEnd&&_this.updateTargetUrlAndHref()})}return Object.defineProperty(RouterLinkWithHref.prototype,"routerLink",{set:function(commands){null!=commands?this.commands=Array.isArray(commands)?commands:[commands]:this.commands=[]},enumerable:!0,configurable:!0}),Object.defineProperty(RouterLinkWithHref.prototype,"preserveQueryParams",{set:function(value){_angular_core.isDevMode()&&console&&console.warn&&console.warn("preserveQueryParams is deprecated, use queryParamsHandling instead."),this.preserve=value},enumerable:!0,configurable:!0}),RouterLinkWithHref.prototype.ngOnChanges=function(changes){this.updateTargetUrlAndHref()},RouterLinkWithHref.prototype.ngOnDestroy=function(){this.subscription.unsubscribe()},RouterLinkWithHref.prototype.onClick=function(button,ctrlKey,metaKey,shiftKey){if(0!==button||ctrlKey||metaKey||shiftKey)return!0;if("string"==typeof this.target&&"_self"!=this.target)return!0;var extras={skipLocationChange:attrBoolValue(this.skipLocationChange),replaceUrl:attrBoolValue(this.replaceUrl)};return this.router.navigateByUrl(this.urlTree,extras),!1},RouterLinkWithHref.prototype.updateTargetUrlAndHref=function(){this.href=this.locationStrategy.prepareExternalUrl(this.router.serializeUrl(this.urlTree))},Object.defineProperty(RouterLinkWithHref.prototype,"urlTree",{get:function(){return this.router.createUrlTree(this.commands,{relativeTo:this.route,queryParams:this.queryParams,fragment:this.fragment,preserveQueryParams:attrBoolValue(this.preserve),queryParamsHandling:this.queryParamsHandling,preserveFragment:attrBoolValue(this.preserveFragment)})},enumerable:!0,configurable:!0}),RouterLinkWithHref}();RouterLinkWithHref.decorators=[{type:_angular_core.Directive,args:[{selector:"a[routerLink]"}]}],RouterLinkWithHref.ctorParameters=function(){return[{type:Router},{type:ActivatedRoute},{type:_angular_common.LocationStrategy}]},RouterLinkWithHref.propDecorators={target:[{type:_angular_core.HostBinding,args:["attr.target"]},{type:_angular_core.Input}],queryParams:[{type:_angular_core.Input}],fragment:[{type:_angular_core.Input}],queryParamsHandling:[{type:_angular_core.Input}],preserveFragment:[{type:_angular_core.Input}],skipLocationChange:[{type:_angular_core.Input}],replaceUrl:[{type:_angular_core.Input}],href:[{type:_angular_core.HostBinding}],routerLink:[{type:_angular_core.Input}],preserveQueryParams:[{type:_angular_core.Input}],onClick:[{type:_angular_core.HostListener,args:["click",["$event.button","$event.ctrlKey","$event.metaKey","$event.shiftKey"]]}]};/**
|
|
42
|
+
function DefaultRouteReuseStrategy(){}return DefaultRouteReuseStrategy.prototype.shouldDetach=function(route){return!1},DefaultRouteReuseStrategy.prototype.store=function(route,detachedTree){},DefaultRouteReuseStrategy.prototype.shouldAttach=function(route){return!1},DefaultRouteReuseStrategy.prototype.retrieve=function(route){return null},DefaultRouteReuseStrategy.prototype.shouldReuseRoute=function(future,curr){return future.routeConfig===curr.routeConfig},DefaultRouteReuseStrategy}(),ROUTES=new _angular_core.InjectionToken("ROUTES"),RouterConfigLoader=function(){function RouterConfigLoader(loader,compiler,onLoadStartListener,onLoadEndListener){this.loader=loader,this.compiler=compiler,this.onLoadStartListener=onLoadStartListener,this.onLoadEndListener=onLoadEndListener}return RouterConfigLoader.prototype.load=function(parentInjector,route){var _this=this;this.onLoadStartListener&&this.onLoadStartListener(route);var moduleFactory$=this.loadModuleFactory(route.loadChildren);return rxjs_operator_map.map.call(moduleFactory$,function(factory){_this.onLoadEndListener&&_this.onLoadEndListener(route);var module=factory.create(parentInjector);return new LoadedRouterConfig(flatten(module.injector.get(ROUTES)),module)})},RouterConfigLoader.prototype.loadModuleFactory=function(loadChildren){var _this=this;return"string"==typeof loadChildren?rxjs_observable_fromPromise.fromPromise(this.loader.load(loadChildren)):rxjs_operator_mergeMap.mergeMap.call(wrapIntoObservable(loadChildren()),function(t){return t instanceof _angular_core.NgModuleFactory?rxjs_observable_of.of(t):rxjs_observable_fromPromise.fromPromise(_this.compiler.compileModuleAsync(t))})},RouterConfigLoader}(),UrlHandlingStrategy=function(){function UrlHandlingStrategy(){}return UrlHandlingStrategy.prototype.shouldProcessUrl=function(url){},UrlHandlingStrategy.prototype.extract=function(url){},UrlHandlingStrategy.prototype.merge=function(newUrlPart,rawUrl){},UrlHandlingStrategy}(),DefaultUrlHandlingStrategy=function(){function DefaultUrlHandlingStrategy(){}return DefaultUrlHandlingStrategy.prototype.shouldProcessUrl=function(url){return!0},DefaultUrlHandlingStrategy.prototype.extract=function(url){return url},DefaultUrlHandlingStrategy.prototype.merge=function(newUrlPart,wholeUrl){return newUrlPart},DefaultUrlHandlingStrategy}(),Router=function(){function Router(rootComponentType,urlSerializer,rootContexts,location,injector,loader,compiler,config){var _this=this;this.rootComponentType=rootComponentType,this.urlSerializer=urlSerializer,this.rootContexts=rootContexts,this.location=location,this.config=config,this.navigations=new rxjs_BehaviorSubject.BehaviorSubject(null),this.routerEvents=new rxjs_Subject.Subject,this.navigationId=0,this.errorHandler=defaultErrorHandler,this.navigated=!1,this.hooks={beforePreactivation:defaultRouterHook,afterPreactivation:defaultRouterHook},this.urlHandlingStrategy=new DefaultUrlHandlingStrategy,this.routeReuseStrategy=new DefaultRouteReuseStrategy;var onLoadStart=function(r){return _this.triggerEvent(new RouteConfigLoadStart(r))},onLoadEnd=function(r){return _this.triggerEvent(new RouteConfigLoadEnd(r))};this.ngModule=injector.get(_angular_core.NgModuleRef),this.resetConfig(config),this.currentUrlTree=createEmptyUrlTree(),this.rawUrlTree=this.currentUrlTree,this.configLoader=new RouterConfigLoader(loader,compiler,onLoadStart,onLoadEnd),this.currentRouterState=createEmptyState(this.currentUrlTree,this.rootComponentType),this.processNavigations()}return Router.prototype.resetRootComponentType=function(rootComponentType){this.rootComponentType=rootComponentType,this.currentRouterState.root.component=this.rootComponentType},Router.prototype.initialNavigation=function(){this.setUpLocationChangeListener(),0===this.navigationId&&this.navigateByUrl(this.location.path(!0),{replaceUrl:!0})},Router.prototype.setUpLocationChangeListener=function(){var _this=this;this.locationSubscription||(this.locationSubscription=this.location.subscribe(Zone.current.wrap(function(change){var rawUrlTree=_this.urlSerializer.parse(change.url),source="popstate"===change.type?"popstate":"hashchange";setTimeout(function(){_this.scheduleNavigation(rawUrlTree,source,{replaceUrl:!0})},0)})))},Object.defineProperty(Router.prototype,"routerState",{get:function(){return this.currentRouterState},enumerable:!0,configurable:!0}),Object.defineProperty(Router.prototype,"url",{get:function(){return this.serializeUrl(this.currentUrlTree)},enumerable:!0,configurable:!0}),Object.defineProperty(Router.prototype,"events",{get:function(){return this.routerEvents},enumerable:!0,configurable:!0}),Router.prototype.triggerEvent=function(e){this.routerEvents.next(e)},Router.prototype.resetConfig=function(config){validateConfig(config),this.config=config},Router.prototype.ngOnDestroy=function(){this.dispose()},Router.prototype.dispose=function(){this.locationSubscription&&(this.locationSubscription.unsubscribe(),this.locationSubscription=null)},Router.prototype.createUrlTree=function(commands,navigationExtras){void 0===navigationExtras&&(navigationExtras={});var relativeTo=navigationExtras.relativeTo,queryParams=navigationExtras.queryParams,fragment=navigationExtras.fragment,preserveQueryParams=navigationExtras.preserveQueryParams,queryParamsHandling=navigationExtras.queryParamsHandling,preserveFragment=navigationExtras.preserveFragment;_angular_core.isDevMode()&&preserveQueryParams&&console&&console.warn&&console.warn("preserveQueryParams is deprecated, use queryParamsHandling instead.");var a=relativeTo||this.routerState.root,f=preserveFragment?this.currentUrlTree.fragment:fragment,q=null;if(queryParamsHandling)switch(queryParamsHandling){case"merge":q=Object.assign({},this.currentUrlTree.queryParams,queryParams);break;case"preserve":q=this.currentUrlTree.queryParams;break;default:q=queryParams||null}else q=preserveQueryParams?this.currentUrlTree.queryParams:queryParams||null;return createUrlTree(a,this.currentUrlTree,commands,q,f)},Router.prototype.navigateByUrl=function(url,extras){void 0===extras&&(extras={skipLocationChange:!1});var urlTree=url instanceof UrlTree?url:this.parseUrl(url),mergedTree=this.urlHandlingStrategy.merge(urlTree,this.rawUrlTree);return this.scheduleNavigation(mergedTree,"imperative",extras)},Router.prototype.navigate=function(commands,extras){return void 0===extras&&(extras={skipLocationChange:!1}),validateCommands(commands),"object"==typeof extras.queryParams&&null!==extras.queryParams&&(extras.queryParams=this.removeEmptyProps(extras.queryParams)),this.navigateByUrl(this.createUrlTree(commands,extras),extras)},Router.prototype.serializeUrl=function(url){return this.urlSerializer.serialize(url)},Router.prototype.parseUrl=function(url){return this.urlSerializer.parse(url)},Router.prototype.isActive=function(url,exact){if(url instanceof UrlTree)return containsTree(this.currentUrlTree,url,exact);var urlTree=this.urlSerializer.parse(url);return containsTree(this.currentUrlTree,urlTree,exact)},Router.prototype.removeEmptyProps=function(params){return Object.keys(params).reduce(function(result,key){var value=params[key];return null!==value&&void 0!==value&&(result[key]=value),result},{})},Router.prototype.processNavigations=function(){var _this=this;rxjs_operator_concatMap.concatMap.call(this.navigations,function(nav){return nav?(_this.executeScheduledNavigation(nav),nav.promise.catch(function(){})):rxjs_observable_of.of(null)}).subscribe(function(){})},Router.prototype.scheduleNavigation=function(rawUrl,source,extras){var lastNavigation=this.navigations.value;if(lastNavigation&&"imperative"!==source&&"imperative"===lastNavigation.source&&lastNavigation.rawUrl.toString()===rawUrl.toString())return Promise.resolve(!0);if(lastNavigation&&"hashchange"==source&&"popstate"===lastNavigation.source&&lastNavigation.rawUrl.toString()===rawUrl.toString())return Promise.resolve(!0);var resolve=null,reject=null,promise=new Promise(function(res,rej){resolve=res,reject=rej}),id=++this.navigationId;return this.navigations.next({id:id,source:source,rawUrl:rawUrl,extras:extras,resolve:resolve,reject:reject,promise:promise}),promise.catch(function(e){return Promise.reject(e)})},Router.prototype.executeScheduledNavigation=function(_a){var _this=this,id=_a.id,rawUrl=_a.rawUrl,extras=_a.extras,resolve=_a.resolve,reject=_a.reject,url=this.urlHandlingStrategy.extract(rawUrl),urlTransition=!this.navigated||url.toString()!==this.currentUrlTree.toString();urlTransition&&this.urlHandlingStrategy.shouldProcessUrl(rawUrl)?(this.routerEvents.next(new NavigationStart(id,this.serializeUrl(url))),Promise.resolve().then(function(_){return _this.runNavigate(url,rawUrl,!!extras.skipLocationChange,!!extras.replaceUrl,id,null)}).then(resolve,reject)):urlTransition&&this.rawUrlTree&&this.urlHandlingStrategy.shouldProcessUrl(this.rawUrlTree)?(this.routerEvents.next(new NavigationStart(id,this.serializeUrl(url))),Promise.resolve().then(function(_){return _this.runNavigate(url,rawUrl,!1,!1,id,createEmptyState(url,_this.rootComponentType).snapshot)}).then(resolve,reject)):(this.rawUrlTree=rawUrl,resolve(null))},Router.prototype.runNavigate=function(url,rawUrl,shouldPreventPushState,shouldReplaceUrl,id,precreatedState){var _this=this;return id!==this.navigationId?(this.location.go(this.urlSerializer.serialize(this.currentUrlTree)),this.routerEvents.next(new NavigationCancel(id,this.serializeUrl(url),"Navigation ID "+id+" is not equal to the current navigation id "+this.navigationId)),Promise.resolve(!1)):new Promise(function(resolvePromise,rejectPromise){var urlAndSnapshot$;if(precreatedState)urlAndSnapshot$=rxjs_observable_of.of({appliedUrl:url,snapshot:precreatedState});else{var moduleInjector=_this.ngModule.injector,redirectsApplied$=applyRedirects(moduleInjector,_this.configLoader,_this.urlSerializer,url,_this.config);urlAndSnapshot$=rxjs_operator_mergeMap.mergeMap.call(redirectsApplied$,function(appliedUrl){return rxjs_operator_map.map.call(recognize(_this.rootComponentType,_this.config,appliedUrl,_this.serializeUrl(appliedUrl)),function(snapshot){return _this.routerEvents.next(new RoutesRecognized(id,_this.serializeUrl(url),_this.serializeUrl(appliedUrl),snapshot)),{appliedUrl:appliedUrl,snapshot:snapshot}})})}var preActivation,navigationIsSuccessful,beforePreactivationDone$=rxjs_operator_mergeMap.mergeMap.call(urlAndSnapshot$,function(p){return rxjs_operator_map.map.call(_this.hooks.beforePreactivation(p.snapshot),function(){return p})}),preactivationTraverse$=rxjs_operator_map.map.call(beforePreactivationDone$,function(_a){var appliedUrl=_a.appliedUrl,snapshot=_a.snapshot,moduleInjector=_this.ngModule.injector;return preActivation=new PreActivation(snapshot,_this.currentRouterState.snapshot,moduleInjector),preActivation.traverse(_this.rootContexts),{appliedUrl:appliedUrl,snapshot:snapshot}}),preactivationCheckGuards$=rxjs_operator_mergeMap.mergeMap.call(preactivationTraverse$,function(_a){var appliedUrl=_a.appliedUrl,snapshot=_a.snapshot;return _this.navigationId!==id?rxjs_observable_of.of(!1):rxjs_operator_map.map.call(preActivation.checkGuards(),function(shouldActivate){return{appliedUrl:appliedUrl,snapshot:snapshot,shouldActivate:shouldActivate}})}),preactivationResolveData$=rxjs_operator_mergeMap.mergeMap.call(preactivationCheckGuards$,function(p){return _this.navigationId!==id?rxjs_observable_of.of(!1):p.shouldActivate?rxjs_operator_map.map.call(preActivation.resolveData(),function(){return p}):rxjs_observable_of.of(p)}),preactivationDone$=rxjs_operator_mergeMap.mergeMap.call(preactivationResolveData$,function(p){return rxjs_operator_map.map.call(_this.hooks.afterPreactivation(p.snapshot),function(){return p})}),routerState$=rxjs_operator_map.map.call(preactivationDone$,function(_a){var appliedUrl=_a.appliedUrl,snapshot=_a.snapshot,shouldActivate=_a.shouldActivate;if(shouldActivate){var state=createRouterState(_this.routeReuseStrategy,snapshot,_this.currentRouterState);return{appliedUrl:appliedUrl,state:state,shouldActivate:shouldActivate}}return{appliedUrl:appliedUrl,state:null,shouldActivate:shouldActivate}}),storedState=_this.currentRouterState,storedUrl=_this.currentUrlTree;routerState$.forEach(function(_a){var appliedUrl=_a.appliedUrl,state=_a.state,shouldActivate=_a.shouldActivate;if(!shouldActivate||id!==_this.navigationId)return void(navigationIsSuccessful=!1);if(_this.currentUrlTree=appliedUrl,_this.rawUrlTree=_this.urlHandlingStrategy.merge(_this.currentUrlTree,rawUrl),_this.currentRouterState=state,!shouldPreventPushState){var path=_this.urlSerializer.serialize(_this.rawUrlTree);_this.location.isCurrentPathEqualTo(path)||shouldReplaceUrl?_this.location.replaceState(path):_this.location.go(path)}new ActivateRoutes(_this.routeReuseStrategy,state,storedState).activate(_this.rootContexts),navigationIsSuccessful=!0}).then(function(){navigationIsSuccessful?(_this.navigated=!0,_this.routerEvents.next(new NavigationEnd(id,_this.serializeUrl(url),_this.serializeUrl(_this.currentUrlTree))),resolvePromise(!0)):(_this.resetUrlToCurrentUrlTree(),_this.routerEvents.next(new NavigationCancel(id,_this.serializeUrl(url),"")),resolvePromise(!1))},function(e){if(isNavigationCancelingError(e))_this.resetUrlToCurrentUrlTree(),_this.navigated=!0,_this.routerEvents.next(new NavigationCancel(id,_this.serializeUrl(url),e.message)),resolvePromise(!1);else{_this.routerEvents.next(new NavigationError(id,_this.serializeUrl(url),e));try{resolvePromise(_this.errorHandler(e))}catch(ee){rejectPromise(ee)}}_this.currentRouterState=storedState,_this.currentUrlTree=storedUrl,_this.rawUrlTree=_this.urlHandlingStrategy.merge(_this.currentUrlTree,rawUrl),_this.location.replaceState(_this.serializeUrl(_this.rawUrlTree))})})},Router.prototype.resetUrlToCurrentUrlTree=function(){var path=this.urlSerializer.serialize(this.rawUrlTree);this.location.replaceState(path)},Router}(),CanActivate=function(){function CanActivate(path){this.path=path}return Object.defineProperty(CanActivate.prototype,"route",{get:function(){return this.path[this.path.length-1]},enumerable:!0,configurable:!0}),CanActivate}(),CanDeactivate=function(){function CanDeactivate(component,route){this.component=component,this.route=route}return CanDeactivate}(),PreActivation=function(){function PreActivation(future,curr,moduleInjector){this.future=future,this.curr=curr,this.moduleInjector=moduleInjector,this.canActivateChecks=[],this.canDeactivateChecks=[]}return PreActivation.prototype.traverse=function(parentContexts){var futureRoot=this.future._root,currRoot=this.curr?this.curr._root:null;this.traverseChildRoutes(futureRoot,currRoot,parentContexts,[futureRoot.value])},PreActivation.prototype.checkGuards=function(){var _this=this;if(0===this.canDeactivateChecks.length&&0===this.canActivateChecks.length)return rxjs_observable_of.of(!0);var canDeactivate$=this.runCanDeactivateChecks();return rxjs_operator_mergeMap.mergeMap.call(canDeactivate$,function(canDeactivate){return canDeactivate?_this.runCanActivateChecks():rxjs_observable_of.of(!1)})},PreActivation.prototype.resolveData=function(){var _this=this;if(0===this.canActivateChecks.length)return rxjs_observable_of.of(null);var checks$=rxjs_observable_from.from(this.canActivateChecks),runningChecks$=rxjs_operator_concatMap.concatMap.call(checks$,function(check){return _this.runResolve(check.route)});return rxjs_operator_reduce.reduce.call(runningChecks$,function(_,__){return _})},PreActivation.prototype.traverseChildRoutes=function(futureNode,currNode,contexts,futurePath){var _this=this,prevChildren=nodeChildrenAsMap(currNode);futureNode.children.forEach(function(c){_this.traverseRoutes(c,prevChildren[c.value.outlet],contexts,futurePath.concat([c.value])),delete prevChildren[c.value.outlet]}),forEach(prevChildren,function(v,k){return _this.deactivateRouteAndItsChildren(v,contexts.getContext(k))})},PreActivation.prototype.traverseRoutes=function(futureNode,currNode,parentContexts,futurePath){var future=futureNode.value,curr=currNode?currNode.value:null,context=parentContexts?parentContexts.getContext(futureNode.value.outlet):null;if(curr&&future._routeConfig===curr._routeConfig){if(this.shouldRunGuardsAndResolvers(curr,future,future._routeConfig.runGuardsAndResolvers)){this.canActivateChecks.push(new CanActivate(futurePath));var outlet=context.outlet;this.canDeactivateChecks.push(new CanDeactivate(outlet.component,curr))}else future.data=curr.data,future._resolvedData=curr._resolvedData;future.component?this.traverseChildRoutes(futureNode,currNode,context?context.children:null,futurePath):this.traverseChildRoutes(futureNode,currNode,parentContexts,futurePath)}else curr&&this.deactivateRouteAndItsChildren(currNode,context),this.canActivateChecks.push(new CanActivate(futurePath)),future.component?this.traverseChildRoutes(futureNode,null,context?context.children:null,futurePath):this.traverseChildRoutes(futureNode,null,parentContexts,futurePath)},PreActivation.prototype.shouldRunGuardsAndResolvers=function(curr,future,mode){switch(mode){case"always":return!0;case"paramsOrQueryParamsChange":return!equalParamsAndUrlSegments(curr,future)||!shallowEqual(curr.queryParams,future.queryParams);case"paramsChange":default:return!equalParamsAndUrlSegments(curr,future)}},PreActivation.prototype.deactivateRouteAndItsChildren=function(route,context){var _this=this,children=nodeChildrenAsMap(route),r=route.value;forEach(children,function(node,childName){r.component?context?_this.deactivateRouteAndItsChildren(node,context.children.getContext(childName)):_this.deactivateRouteAndItsChildren(node,null):_this.deactivateRouteAndItsChildren(node,context)}),r.component&&context&&context.outlet&&context.outlet.isActivated?this.canDeactivateChecks.push(new CanDeactivate(context.outlet.component,r)):this.canDeactivateChecks.push(new CanDeactivate(null,r))},PreActivation.prototype.runCanDeactivateChecks=function(){var _this=this,checks$=rxjs_observable_from.from(this.canDeactivateChecks),runningChecks$=rxjs_operator_mergeMap.mergeMap.call(checks$,function(check){return _this.runCanDeactivate(check.component,check.route)});return rxjs_operator_every.every.call(runningChecks$,function(result){return result===!0})},PreActivation.prototype.runCanActivateChecks=function(){var _this=this,checks$=rxjs_observable_from.from(this.canActivateChecks),runningChecks$=rxjs_operator_mergeMap.mergeMap.call(checks$,function(check){return andObservables(rxjs_observable_from.from([_this.runCanActivateChild(check.path),_this.runCanActivate(check.route)]))});return rxjs_operator_every.every.call(runningChecks$,function(result){return result===!0})},PreActivation.prototype.runCanActivate=function(future){var _this=this,canActivate=future._routeConfig?future._routeConfig.canActivate:null;if(!canActivate||0===canActivate.length)return rxjs_observable_of.of(!0);var obs=rxjs_operator_map.map.call(rxjs_observable_from.from(canActivate),function(c){var observable,guard=_this.getToken(c,future);return observable=wrapIntoObservable(guard.canActivate?guard.canActivate(future,_this.future):guard(future,_this.future)),rxjs_operator_first.first.call(observable)});return andObservables(obs)},PreActivation.prototype.runCanActivateChild=function(path){var _this=this,future=path[path.length-1],canActivateChildGuards=path.slice(0,path.length-1).reverse().map(function(p){return _this.extractCanActivateChild(p)}).filter(function(_){return null!==_});return andObservables(rxjs_operator_map.map.call(rxjs_observable_from.from(canActivateChildGuards),function(d){var obs=rxjs_operator_map.map.call(rxjs_observable_from.from(d.guards),function(c){var observable,guard=_this.getToken(c,d.node);return observable=wrapIntoObservable(guard.canActivateChild?guard.canActivateChild(future,_this.future):guard(future,_this.future)),rxjs_operator_first.first.call(observable)});return andObservables(obs)}))},PreActivation.prototype.extractCanActivateChild=function(p){var canActivateChild=p._routeConfig?p._routeConfig.canActivateChild:null;return canActivateChild&&0!==canActivateChild.length?{node:p,guards:canActivateChild}:null},PreActivation.prototype.runCanDeactivate=function(component,curr){var _this=this,canDeactivate=curr&&curr._routeConfig?curr._routeConfig.canDeactivate:null;if(!canDeactivate||0===canDeactivate.length)return rxjs_observable_of.of(!0);var canDeactivate$=rxjs_operator_mergeMap.mergeMap.call(rxjs_observable_from.from(canDeactivate),function(c){var observable,guard=_this.getToken(c,curr);return observable=wrapIntoObservable(guard.canDeactivate?guard.canDeactivate(component,curr,_this.curr,_this.future):guard(component,curr,_this.curr,_this.future)),rxjs_operator_first.first.call(observable)});return rxjs_operator_every.every.call(canDeactivate$,function(result){return result===!0})},PreActivation.prototype.runResolve=function(future){var resolve=future._resolve;return rxjs_operator_map.map.call(this.resolveNode(resolve,future),function(resolvedData){return future._resolvedData=resolvedData,future.data=Object.assign({},future.data,inheritedParamsDataResolve(future).resolve),null})},PreActivation.prototype.resolveNode=function(resolve,future){var _this=this;return waitForMap(resolve,function(k,v){var resolver=_this.getToken(v,future);return wrapIntoObservable(resolver.resolve?resolver.resolve(future,_this.future):resolver(future,_this.future))})},PreActivation.prototype.getToken=function(token,snapshot){var config=closestLoadedConfig(snapshot),injector=config?config.module.injector:this.moduleInjector;return injector.get(token)},PreActivation}(),ActivateRoutes=function(){function ActivateRoutes(routeReuseStrategy,futureState,currState){this.routeReuseStrategy=routeReuseStrategy,this.futureState=futureState,this.currState=currState}return ActivateRoutes.prototype.activate=function(parentContexts){var futureRoot=this.futureState._root,currRoot=this.currState?this.currState._root:null;this.deactivateChildRoutes(futureRoot,currRoot,parentContexts),advanceActivatedRoute(this.futureState.root),this.activateChildRoutes(futureRoot,currRoot,parentContexts)},ActivateRoutes.prototype.deactivateChildRoutes=function(futureNode,currNode,contexts){var _this=this,children=nodeChildrenAsMap(currNode);futureNode.children.forEach(function(futureChild){var childOutletName=futureChild.value.outlet;_this.deactivateRoutes(futureChild,children[childOutletName],contexts),delete children[childOutletName]}),forEach(children,function(v,childName){_this.deactivateRouteAndItsChildren(v,contexts)})},ActivateRoutes.prototype.deactivateRoutes=function(futureNode,currNode,parentContext){var future=futureNode.value,curr=currNode?currNode.value:null;if(future===curr)if(future.component){var context=parentContext.getContext(future.outlet);context&&this.deactivateChildRoutes(futureNode,currNode,context.children)}else this.deactivateChildRoutes(futureNode,currNode,parentContext);else curr&&this.deactivateRouteAndItsChildren(currNode,parentContext)},ActivateRoutes.prototype.deactivateRouteAndItsChildren=function(route,parentContexts){this.routeReuseStrategy.shouldDetach(route.value.snapshot)?this.detachAndStoreRouteSubtree(route,parentContexts):this.deactivateRouteAndOutlet(route,parentContexts)},ActivateRoutes.prototype.detachAndStoreRouteSubtree=function(route,parentContexts){var context=parentContexts.getContext(route.value.outlet);if(context&&context.outlet){var componentRef=context.outlet.detach(),contexts=context.children.onOutletDeactivated();this.routeReuseStrategy.store(route.value.snapshot,{componentRef:componentRef,route:route,contexts:contexts})}},ActivateRoutes.prototype.deactivateRouteAndOutlet=function(route,parentContexts){var _this=this,context=parentContexts.getContext(route.value.outlet);if(context){var children=nodeChildrenAsMap(route),contexts_1=route.value.component?context.children:parentContexts;forEach(children,function(v,k){_this.deactivateRouteAndItsChildren(v,contexts_1)}),context.outlet&&(context.outlet.deactivate(),context.children.onOutletDeactivated())}},ActivateRoutes.prototype.activateChildRoutes=function(futureNode,currNode,contexts){var _this=this,children=nodeChildrenAsMap(currNode);futureNode.children.forEach(function(c){_this.activateRoutes(c,children[c.value.outlet],contexts)})},ActivateRoutes.prototype.activateRoutes=function(futureNode,currNode,parentContexts){var future=futureNode.value,curr=currNode?currNode.value:null;if(advanceActivatedRoute(future),future===curr)if(future.component){var context=parentContexts.getOrCreateContext(future.outlet);this.activateChildRoutes(futureNode,currNode,context.children)}else this.activateChildRoutes(futureNode,currNode,parentContexts);else if(future.component){var context=parentContexts.getOrCreateContext(future.outlet);if(this.routeReuseStrategy.shouldAttach(future.snapshot)){var stored=this.routeReuseStrategy.retrieve(future.snapshot);this.routeReuseStrategy.store(future.snapshot,null),context.children.onOutletReAttached(stored.contexts),context.attachRef=stored.componentRef,context.route=stored.route.value,context.outlet&&context.outlet.attach(stored.componentRef,stored.route.value),advanceActivatedRouteNodeAndItsChildren(stored.route)}else{var config=parentLoadedConfig(future.snapshot),cmpFactoryResolver=config?config.module.componentFactoryResolver:null;context.route=future,context.resolver=cmpFactoryResolver,context.outlet&&context.outlet.activateWith(future,cmpFactoryResolver),this.activateChildRoutes(futureNode,null,context.children)}}else this.activateChildRoutes(futureNode,null,parentContexts)},ActivateRoutes}(),RouterLink=function(){function RouterLink(router,route,tabIndex,renderer,el){this.router=router,this.route=route,this.commands=[],null==tabIndex&&renderer.setElementAttribute(el.nativeElement,"tabindex","0")}return Object.defineProperty(RouterLink.prototype,"routerLink",{set:function(commands){null!=commands?this.commands=Array.isArray(commands)?commands:[commands]:this.commands=[]},enumerable:!0,configurable:!0}),Object.defineProperty(RouterLink.prototype,"preserveQueryParams",{set:function(value){_angular_core.isDevMode()&&console&&console.warn&&console.warn("preserveQueryParams is deprecated!, use queryParamsHandling instead."),this.preserve=value},enumerable:!0,configurable:!0}),RouterLink.prototype.onClick=function(){var extras={skipLocationChange:attrBoolValue(this.skipLocationChange),replaceUrl:attrBoolValue(this.replaceUrl)};return this.router.navigateByUrl(this.urlTree,extras),!0},Object.defineProperty(RouterLink.prototype,"urlTree",{get:function(){return this.router.createUrlTree(this.commands,{relativeTo:this.route,queryParams:this.queryParams,fragment:this.fragment,preserveQueryParams:attrBoolValue(this.preserve),queryParamsHandling:this.queryParamsHandling,preserveFragment:attrBoolValue(this.preserveFragment)})},enumerable:!0,configurable:!0}),RouterLink}();RouterLink.decorators=[{type:_angular_core.Directive,args:[{selector:":not(a)[routerLink]"}]}],RouterLink.ctorParameters=function(){return[{type:Router},{type:ActivatedRoute},{type:void 0,decorators:[{type:_angular_core.Attribute,args:["tabindex"]}]},{type:_angular_core.Renderer},{type:_angular_core.ElementRef}]},RouterLink.propDecorators={queryParams:[{type:_angular_core.Input}],fragment:[{type:_angular_core.Input}],queryParamsHandling:[{type:_angular_core.Input}],preserveFragment:[{type:_angular_core.Input}],skipLocationChange:[{type:_angular_core.Input}],replaceUrl:[{type:_angular_core.Input}],routerLink:[{type:_angular_core.Input}],preserveQueryParams:[{type:_angular_core.Input}],onClick:[{type:_angular_core.HostListener,args:["click"]}]};var RouterLinkWithHref=function(){function RouterLinkWithHref(router,route,locationStrategy){var _this=this;this.router=router,this.route=route,this.locationStrategy=locationStrategy,this.commands=[],this.subscription=router.events.subscribe(function(s){s instanceof NavigationEnd&&_this.updateTargetUrlAndHref()})}return Object.defineProperty(RouterLinkWithHref.prototype,"routerLink",{set:function(commands){null!=commands?this.commands=Array.isArray(commands)?commands:[commands]:this.commands=[]},enumerable:!0,configurable:!0}),Object.defineProperty(RouterLinkWithHref.prototype,"preserveQueryParams",{set:function(value){_angular_core.isDevMode()&&console&&console.warn&&console.warn("preserveQueryParams is deprecated, use queryParamsHandling instead."),this.preserve=value},enumerable:!0,configurable:!0}),RouterLinkWithHref.prototype.ngOnChanges=function(changes){this.updateTargetUrlAndHref()},RouterLinkWithHref.prototype.ngOnDestroy=function(){this.subscription.unsubscribe()},RouterLinkWithHref.prototype.onClick=function(button,ctrlKey,metaKey,shiftKey){if(0!==button||ctrlKey||metaKey||shiftKey)return!0;if("string"==typeof this.target&&"_self"!=this.target)return!0;var extras={skipLocationChange:attrBoolValue(this.skipLocationChange),replaceUrl:attrBoolValue(this.replaceUrl)};return this.router.navigateByUrl(this.urlTree,extras),!1},RouterLinkWithHref.prototype.updateTargetUrlAndHref=function(){this.href=this.locationStrategy.prepareExternalUrl(this.router.serializeUrl(this.urlTree))},Object.defineProperty(RouterLinkWithHref.prototype,"urlTree",{get:function(){return this.router.createUrlTree(this.commands,{relativeTo:this.route,queryParams:this.queryParams,fragment:this.fragment,preserveQueryParams:attrBoolValue(this.preserve),queryParamsHandling:this.queryParamsHandling,preserveFragment:attrBoolValue(this.preserveFragment)})},enumerable:!0,configurable:!0}),RouterLinkWithHref}();RouterLinkWithHref.decorators=[{type:_angular_core.Directive,args:[{selector:"a[routerLink]"}]}],RouterLinkWithHref.ctorParameters=function(){return[{type:Router},{type:ActivatedRoute},{type:_angular_common.LocationStrategy}]},RouterLinkWithHref.propDecorators={target:[{type:_angular_core.HostBinding,args:["attr.target"]},{type:_angular_core.Input}],queryParams:[{type:_angular_core.Input}],fragment:[{type:_angular_core.Input}],queryParamsHandling:[{type:_angular_core.Input}],preserveFragment:[{type:_angular_core.Input}],skipLocationChange:[{type:_angular_core.Input}],replaceUrl:[{type:_angular_core.Input}],href:[{type:_angular_core.HostBinding}],routerLink:[{type:_angular_core.Input}],preserveQueryParams:[{type:_angular_core.Input}],onClick:[{type:_angular_core.HostListener,args:["click",["$event.button","$event.ctrlKey","$event.metaKey","$event.shiftKey"]]}]};/**
|
|
43
43
|
* @license
|
|
44
44
|
* Copyright Google Inc. All Rights Reserved.
|
|
45
45
|
*
|
|
@@ -60,5 +60,5 @@ var OutletContext=function(){function OutletContext(){this.outlet=null,this.rout
|
|
|
60
60
|
* Use of this source code is governed by an MIT-style license that can be
|
|
61
61
|
* found in the LICENSE file at https://angular.io/license
|
|
62
62
|
*/
|
|
63
|
-
var ROUTER_DIRECTIVES=[RouterOutlet,RouterLink,RouterLinkWithHref,RouterLinkActive],ROUTER_CONFIGURATION=new _angular_core.InjectionToken("ROUTER_CONFIGURATION"),ROUTER_FORROOT_GUARD=new _angular_core.InjectionToken("ROUTER_FORROOT_GUARD"),ROUTER_PROVIDERS=[_angular_common.Location,{provide:UrlSerializer,useClass:DefaultUrlSerializer},{provide:Router,useFactory:setupRouter,deps:[_angular_core.ApplicationRef,UrlSerializer,ChildrenOutletContexts,_angular_common.Location,_angular_core.Injector,_angular_core.NgModuleFactoryLoader,_angular_core.Compiler,ROUTES,ROUTER_CONFIGURATION,[UrlHandlingStrategy,new _angular_core.Optional],[RouteReuseStrategy,new _angular_core.Optional]]},ChildrenOutletContexts,{provide:ActivatedRoute,useFactory:rootRoute,deps:[Router]},{provide:_angular_core.NgModuleFactoryLoader,useClass:_angular_core.SystemJsNgModuleLoader},RouterPreloader,NoPreloading,PreloadAllModules,{provide:ROUTER_CONFIGURATION,useValue:{enableTracing:!1}}],RouterModule=function(){function RouterModule(guard,router){}return RouterModule.forRoot=function(routes,config){return{ngModule:RouterModule,providers:[ROUTER_PROVIDERS,provideRoutes(routes),{provide:ROUTER_FORROOT_GUARD,useFactory:provideForRootGuard,deps:[[Router,new _angular_core.Optional,new _angular_core.SkipSelf]]},{provide:ROUTER_CONFIGURATION,useValue:config?config:{}},{provide:_angular_common.LocationStrategy,useFactory:provideLocationStrategy,deps:[_angular_common.PlatformLocation,[new _angular_core.Inject(_angular_common.APP_BASE_HREF),new _angular_core.Optional],ROUTER_CONFIGURATION]},{provide:PreloadingStrategy,useExisting:config&&config.preloadingStrategy?config.preloadingStrategy:NoPreloading},{provide:_angular_core.NgProbeToken,multi:!0,useFactory:routerNgProbeToken},provideRouterInitializer()]}},RouterModule.forChild=function(routes){return{ngModule:RouterModule,providers:[provideRoutes(routes)]}},RouterModule}();RouterModule.decorators=[{type:_angular_core.NgModule,args:[{declarations:ROUTER_DIRECTIVES,exports:ROUTER_DIRECTIVES}]}],RouterModule.ctorParameters=function(){return[{type:void 0,decorators:[{type:_angular_core.Optional},{type:_angular_core.Inject,args:[ROUTER_FORROOT_GUARD]}]},{type:Router,decorators:[{type:_angular_core.Optional}]}]};var RouterInitializer=function(){function RouterInitializer(injector){this.injector=injector,this.initNavigation=!1,this.resultOfPreactivationDone=new rxjs_Subject.Subject}return RouterInitializer.prototype.appInitializer=function(){var _this=this,p=this.injector.get(_angular_common.LOCATION_INITIALIZED,Promise.resolve(null));return p.then(function(){var resolve=null,res=new Promise(function(r){return resolve=r}),router=_this.injector.get(Router),opts=_this.injector.get(ROUTER_CONFIGURATION);if(_this.isLegacyDisabled(opts)||_this.isLegacyEnabled(opts))resolve(!0);else if("disabled"===opts.initialNavigation)router.setUpLocationChangeListener(),resolve(!0);else{if("enabled"!==opts.initialNavigation)throw new Error("Invalid initialNavigation options: '"+opts.initialNavigation+"'");router.hooks.afterPreactivation=function(){return _this.initNavigation?rxjs_observable_of.of(null):(_this.initNavigation=!0,resolve(!0),_this.resultOfPreactivationDone)},router.initialNavigation()}return res})},RouterInitializer.prototype.bootstrapListener=function(bootstrappedComponentRef){var opts=this.injector.get(ROUTER_CONFIGURATION),preloader=this.injector.get(RouterPreloader),router=this.injector.get(Router),ref=this.injector.get(_angular_core.ApplicationRef);bootstrappedComponentRef===ref.components[0]&&(this.isLegacyEnabled(opts)?router.initialNavigation():this.isLegacyDisabled(opts)&&router.setUpLocationChangeListener(),preloader.setUpPreloading(),router.resetRootComponentType(ref.componentTypes[0]),this.resultOfPreactivationDone.next(null),this.resultOfPreactivationDone.complete())},RouterInitializer.prototype.isLegacyEnabled=function(opts){return"legacy_enabled"===opts.initialNavigation||opts.initialNavigation===!0||void 0===opts.initialNavigation},RouterInitializer.prototype.isLegacyDisabled=function(opts){return"legacy_disabled"===opts.initialNavigation||opts.initialNavigation===!1},RouterInitializer}();RouterInitializer.decorators=[{type:_angular_core.Injectable}],RouterInitializer.ctorParameters=function(){return[{type:_angular_core.Injector}]};var ROUTER_INITIALIZER=new _angular_core.InjectionToken("Router Initializer"),VERSION=new _angular_core.Version("
|
|
63
|
+
var ROUTER_DIRECTIVES=[RouterOutlet,RouterLink,RouterLinkWithHref,RouterLinkActive],ROUTER_CONFIGURATION=new _angular_core.InjectionToken("ROUTER_CONFIGURATION"),ROUTER_FORROOT_GUARD=new _angular_core.InjectionToken("ROUTER_FORROOT_GUARD"),ROUTER_PROVIDERS=[_angular_common.Location,{provide:UrlSerializer,useClass:DefaultUrlSerializer},{provide:Router,useFactory:setupRouter,deps:[_angular_core.ApplicationRef,UrlSerializer,ChildrenOutletContexts,_angular_common.Location,_angular_core.Injector,_angular_core.NgModuleFactoryLoader,_angular_core.Compiler,ROUTES,ROUTER_CONFIGURATION,[UrlHandlingStrategy,new _angular_core.Optional],[RouteReuseStrategy,new _angular_core.Optional]]},ChildrenOutletContexts,{provide:ActivatedRoute,useFactory:rootRoute,deps:[Router]},{provide:_angular_core.NgModuleFactoryLoader,useClass:_angular_core.SystemJsNgModuleLoader},RouterPreloader,NoPreloading,PreloadAllModules,{provide:ROUTER_CONFIGURATION,useValue:{enableTracing:!1}}],RouterModule=function(){function RouterModule(guard,router){}return RouterModule.forRoot=function(routes,config){return{ngModule:RouterModule,providers:[ROUTER_PROVIDERS,provideRoutes(routes),{provide:ROUTER_FORROOT_GUARD,useFactory:provideForRootGuard,deps:[[Router,new _angular_core.Optional,new _angular_core.SkipSelf]]},{provide:ROUTER_CONFIGURATION,useValue:config?config:{}},{provide:_angular_common.LocationStrategy,useFactory:provideLocationStrategy,deps:[_angular_common.PlatformLocation,[new _angular_core.Inject(_angular_common.APP_BASE_HREF),new _angular_core.Optional],ROUTER_CONFIGURATION]},{provide:PreloadingStrategy,useExisting:config&&config.preloadingStrategy?config.preloadingStrategy:NoPreloading},{provide:_angular_core.NgProbeToken,multi:!0,useFactory:routerNgProbeToken},provideRouterInitializer()]}},RouterModule.forChild=function(routes){return{ngModule:RouterModule,providers:[provideRoutes(routes)]}},RouterModule}();RouterModule.decorators=[{type:_angular_core.NgModule,args:[{declarations:ROUTER_DIRECTIVES,exports:ROUTER_DIRECTIVES}]}],RouterModule.ctorParameters=function(){return[{type:void 0,decorators:[{type:_angular_core.Optional},{type:_angular_core.Inject,args:[ROUTER_FORROOT_GUARD]}]},{type:Router,decorators:[{type:_angular_core.Optional}]}]};var RouterInitializer=function(){function RouterInitializer(injector){this.injector=injector,this.initNavigation=!1,this.resultOfPreactivationDone=new rxjs_Subject.Subject}return RouterInitializer.prototype.appInitializer=function(){var _this=this,p=this.injector.get(_angular_common.LOCATION_INITIALIZED,Promise.resolve(null));return p.then(function(){var resolve=null,res=new Promise(function(r){return resolve=r}),router=_this.injector.get(Router),opts=_this.injector.get(ROUTER_CONFIGURATION);if(_this.isLegacyDisabled(opts)||_this.isLegacyEnabled(opts))resolve(!0);else if("disabled"===opts.initialNavigation)router.setUpLocationChangeListener(),resolve(!0);else{if("enabled"!==opts.initialNavigation)throw new Error("Invalid initialNavigation options: '"+opts.initialNavigation+"'");router.hooks.afterPreactivation=function(){return _this.initNavigation?rxjs_observable_of.of(null):(_this.initNavigation=!0,resolve(!0),_this.resultOfPreactivationDone)},router.initialNavigation()}return res})},RouterInitializer.prototype.bootstrapListener=function(bootstrappedComponentRef){var opts=this.injector.get(ROUTER_CONFIGURATION),preloader=this.injector.get(RouterPreloader),router=this.injector.get(Router),ref=this.injector.get(_angular_core.ApplicationRef);bootstrappedComponentRef===ref.components[0]&&(this.isLegacyEnabled(opts)?router.initialNavigation():this.isLegacyDisabled(opts)&&router.setUpLocationChangeListener(),preloader.setUpPreloading(),router.resetRootComponentType(ref.componentTypes[0]),this.resultOfPreactivationDone.next(null),this.resultOfPreactivationDone.complete())},RouterInitializer.prototype.isLegacyEnabled=function(opts){return"legacy_enabled"===opts.initialNavigation||opts.initialNavigation===!0||void 0===opts.initialNavigation},RouterInitializer.prototype.isLegacyDisabled=function(opts){return"legacy_disabled"===opts.initialNavigation||opts.initialNavigation===!1},RouterInitializer}();RouterInitializer.decorators=[{type:_angular_core.Injectable}],RouterInitializer.ctorParameters=function(){return[{type:_angular_core.Injector}]};var ROUTER_INITIALIZER=new _angular_core.InjectionToken("Router Initializer"),VERSION=new _angular_core.Version("4.2.4");exports.RouterLink=RouterLink,exports.RouterLinkWithHref=RouterLinkWithHref,exports.RouterLinkActive=RouterLinkActive,exports.RouterOutlet=RouterOutlet,exports.NavigationCancel=NavigationCancel,exports.NavigationEnd=NavigationEnd,exports.NavigationError=NavigationError,exports.NavigationStart=NavigationStart,exports.RouteConfigLoadEnd=RouteConfigLoadEnd,exports.RouteConfigLoadStart=RouteConfigLoadStart,exports.RoutesRecognized=RoutesRecognized,exports.RouteReuseStrategy=RouteReuseStrategy,exports.Router=Router,exports.ROUTES=ROUTES,exports.ROUTER_CONFIGURATION=ROUTER_CONFIGURATION,exports.ROUTER_INITIALIZER=ROUTER_INITIALIZER,exports.RouterModule=RouterModule,exports.provideRoutes=provideRoutes,exports.ChildrenOutletContexts=ChildrenOutletContexts,exports.OutletContext=OutletContext,exports.NoPreloading=NoPreloading,exports.PreloadAllModules=PreloadAllModules,exports.PreloadingStrategy=PreloadingStrategy,exports.RouterPreloader=RouterPreloader,exports.ActivatedRoute=ActivatedRoute,exports.ActivatedRouteSnapshot=ActivatedRouteSnapshot,exports.RouterState=RouterState,exports.RouterStateSnapshot=RouterStateSnapshot,exports.PRIMARY_OUTLET=PRIMARY_OUTLET,exports.convertToParamMap=convertToParamMap,exports.UrlHandlingStrategy=UrlHandlingStrategy,exports.DefaultUrlSerializer=DefaultUrlSerializer,exports.UrlSegment=UrlSegment,exports.UrlSegmentGroup=UrlSegmentGroup,exports.UrlSerializer=UrlSerializer,exports.UrlTree=UrlTree,exports.VERSION=VERSION,exports.ɵROUTER_PROVIDERS=ROUTER_PROVIDERS,exports.ɵflatten=flatten,exports.ɵa=ROUTER_FORROOT_GUARD,exports.ɵg=RouterInitializer,exports.ɵh=getAppInitializer,exports.ɵi=getBootstrapListener,exports.ɵd=provideForRootGuard,exports.ɵc=provideLocationStrategy,exports.ɵj=provideRouterInitializer,exports.ɵf=rootRoute,exports.ɵb=routerNgProbeToken,exports.ɵe=setupRouter,exports.ɵk=Tree,exports.ɵl=TreeNode,Object.defineProperty(exports,"__esModule",{value:!0})});
|
|
64
64
|
//# sourceMappingURL=router.umd.min.js.map
|