UNPKG

@angular/router-deprecated

Version:
2 lines 78.1 kB
var __extends=this&&this.__extends||function(d,b){function __(){this.constructor=d}for(var p in b)b.hasOwnProperty(p)&&(d[p]=b[p]);d.prototype=null===b?Object.create(b):(__.prototype=b.prototype,new __)};!function(global,factory){"object"==typeof exports&&"undefined"!=typeof module?factory(exports,require("@angular/common"),require("@angular/core"),require("rxjs/Subject"),require("rxjs/observable/PromiseObservable"),require("rxjs/operator/toPromise"),require("rxjs/Observable"),require("@angular/platform-browser")):"function"==typeof define&&define.amd?define(["exports","@angular/common","@angular/core","rxjs/Subject","rxjs/observable/PromiseObservable","rxjs/operator/toPromise","rxjs/Observable","@angular/platform-browser"],factory):factory((global.ng=global.ng||{},global.ng.router_deprecated=global.ng.router_deprecated||{}),global.ng.common,global.ng.core,global.Rx,global.Rx,global.Rx.Observable.prototype,global.Rx,global.ng.platformBrowser)}(this,function(exports,_angular_common,_angular_core,rxjs_Subject,rxjs_observable_PromiseObservable,rxjs_operator_toPromise,rxjs_Observable,_angular_platformBrowser){"use strict";function getTypeNameForDebugging(type){return type.name?type.name:typeof type}function isPresent(obj){return void 0!==obj&&null!==obj}function isBlank(obj){return void 0===obj||null===obj}function isString(obj){return"string"==typeof obj}function isFunction(obj){return"function"==typeof obj}function isType(obj){return isFunction(obj)}function isStringMap(obj){return"object"==typeof obj&&null!==obj}function isArray(obj){return Array.isArray(obj)}function noop(){}function normalizeBlank(obj){return isBlank(obj)?null:obj}function _flattenArray(source,target){if(isPresent(source))for(var i=0;i<source.length;i++){var item=source[i];isArray(item)?_flattenArray(item,target):target.push(item)}return target}function hasLifecycleHook(e,type){return type instanceof _angular_core.Type?e.name in type.prototype:!1}function getCanActivateHook(type){for(var annotations=reflector.annotations(type),i=0;i<annotations.length;i+=1){var annotation=annotations[i];if(annotation instanceof CanActivateAnnotation)return annotation.fn}return null}function convertUrlParamsToArray(urlParams){var paramsArray=[];return isBlank(urlParams)?[]:(StringMapWrapper.forEach(urlParams,function(value,key){paramsArray.push(value===!0?key:key+"="+value)}),paramsArray)}function serializeParams(urlParams,joiner){return void 0===joiner&&(joiner="&"),convertUrlParamsToArray(urlParams).join(joiner)}function matchUrlSegment(str){var match=RegExpWrapper.firstMatch(SEGMENT_RE,str);return isPresent(match)?match[0]:""}function matchUrlQueryParamValue(str){var match=RegExpWrapper.firstMatch(QUERY_PARAM_VALUE_RE,str);return isPresent(match)?match[0]:""}function normalizeString(obj){return isBlank(obj)?null:obj.toString()}function encodeDynamicSegment(value){return isBlank(value)?null:(value=StringWrapper.replaceAll(value,REGEXP_PERCENT,"%25"),value=StringWrapper.replaceAll(value,REGEXP_SLASH,"%2F"),value=StringWrapper.replaceAll(value,REGEXP_OPEN_PARENT,"%28"),value=StringWrapper.replaceAll(value,REGEXP_CLOSE_PARENT,"%29"),value=StringWrapper.replaceAll(value,REGEXP_SEMICOLON,"%3B"))}function decodeDynamicSegment(value){return isBlank(value)?null:(value=StringWrapper.replaceAll(value,REGEXP_ENC_SEMICOLON,";"),value=StringWrapper.replaceAll(value,REGEXP_ENC_CLOSE_PARENT,")"),value=StringWrapper.replaceAll(value,REGEXP_ENC_OPEN_PARENT,"("),value=StringWrapper.replaceAll(value,REGEXP_ENC_SLASH,"/"),value=StringWrapper.replaceAll(value,REGEXP_ENC_PERCENT,"%"))}function computeNumberOfRegexGroups(regex){var test_regex=RegExpWrapper.create(regex+"|"),matcher=RegExpWrapper.matcher(test_regex,""),match=RegExpMatcherWrapper.next(matcher);return match.length}function normalizeRouteConfig(config,registry){if(config instanceof AsyncRoute){var wrappedLoader=wrapLoaderToReconfigureRegistry(config.loader,registry);return new AsyncRoute({path:config.path,loader:wrappedLoader,name:config.name,data:config.data,useAsDefault:config.useAsDefault})}if(config instanceof Route||config instanceof Redirect||config instanceof AuxRoute)return config;if(1!=+!!config.component+ +!!config.redirectTo+ +!!config.loader)throw new BaseException$1('Route config should contain exactly one "component", "loader", or "redirectTo" property.');if(config.loader){var wrappedLoader=wrapLoaderToReconfigureRegistry(config.loader,registry);return new AsyncRoute({path:config.path,loader:wrappedLoader,name:config.name,data:config.data,useAsDefault:config.useAsDefault})}if(config.aux)return new AuxRoute({path:config.aux,component:config.component,name:config.name});if(config.component){if("object"==typeof config.component){var componentDefinitionObject=config.component;if("constructor"==componentDefinitionObject.type)return new Route({path:config.path,component:componentDefinitionObject.constructor,name:config.name,data:config.data,useAsDefault:config.useAsDefault});if("loader"==componentDefinitionObject.type)return new AsyncRoute({path:config.path,loader:componentDefinitionObject.loader,name:config.name,data:config.data,useAsDefault:config.useAsDefault});throw new BaseException$1('Invalid component type "'+componentDefinitionObject.type+'". Valid types are "constructor" and "loader".')}return new Route(config)}return config.redirectTo?new Redirect({path:config.path,redirectTo:config.redirectTo}):config}function wrapLoaderToReconfigureRegistry(loader,registry){return function(){return loader().then(function(componentType){return registry.configFromComponent(componentType),componentType})}}function assertComponentExists(component,path){if(!isType(component))throw new BaseException$1('Component for route "'+path+'" is not defined, or is not a class.')}function splitAndFlattenLinkParams(linkParams){var accumulation=[];return linkParams.forEach(function(item){if(isString(item)){var strItem=item;accumulation=accumulation.concat(strItem.split("/"))}else accumulation.push(item)}),accumulation}function mostSpecific(instructions){if(instructions=instructions.filter(function(instruction){return isPresent(instruction)}),0==instructions.length)return null;if(1==instructions.length)return instructions[0];var first=instructions[0],rest=instructions.slice(1);return rest.reduce(function(instruction,contender){return-1==compareSpecificityStrings(contender.specificity,instruction.specificity)?contender:instruction},first)}function compareSpecificityStrings(a,b){for(var l=Math.min(a.length,b.length),i=0;l>i;i+=1){var ai=StringWrapper.charCodeAt(a,i),bi=StringWrapper.charCodeAt(b,i),difference=bi-ai;if(0!=difference)return difference}return a.length-b.length}function assertTerminalComponent(component,path){if(isType(component)){var annotations=reflector.annotations(component);if(isPresent(annotations))for(var i=0;i<annotations.length;i++){var annotation=annotations[i];if(annotation instanceof RouteConfigAnnotation)throw new BaseException$1('Child routes are not allowed for "'+path+'". Use "..." on the parent\'s route path.')}}}function canActivateOne(nextInstruction,prevInstruction){var next=_resolveToTrue;return isBlank(nextInstruction.component)?next:(isPresent(nextInstruction.child)&&(next=canActivateOne(nextInstruction.child,isPresent(prevInstruction)?prevInstruction.child:null)),next.then(function(result){if(0==result)return!1;if(nextInstruction.component.reuse)return!0;var hook=getCanActivateHook(nextInstruction.component.componentType);return isPresent(hook)?hook(nextInstruction.component,isPresent(prevInstruction)?prevInstruction.component:null):!0}))}function routerFactory(registry,location,primaryComponent,appRef){var rootRouter=new exports.RootRouter(registry,location,primaryComponent);return appRef.registerDisposeListener(function(){return rootRouter.dispose()}),rootRouter}function routerPrimaryComponentFactory(app){if(0==app.componentTypes.length)throw new BaseException$1("Bootstrap at least one component before injecting Router.");return app.componentTypes[0]}var globalScope;globalScope="undefined"==typeof window?"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:global:window;var global$1=globalScope,Type$1=Function,Math=global$1.Math;global$1.assert=function(){};var StringWrapper=function(){function StringWrapper(){}return StringWrapper.fromCharCode=function(code){return String.fromCharCode(code)},StringWrapper.charCodeAt=function(s,index){return s.charCodeAt(index)},StringWrapper.split=function(s,regExp){return s.split(regExp)},StringWrapper.equals=function(s,s2){return s===s2},StringWrapper.stripLeft=function(s,charVal){if(s&&s.length){for(var pos=0,i=0;i<s.length&&s[i]==charVal;i++)pos++;s=s.substring(pos)}return s},StringWrapper.stripRight=function(s,charVal){if(s&&s.length){for(var pos=s.length,i=s.length-1;i>=0&&s[i]==charVal;i--)pos--;s=s.substring(0,pos)}return s},StringWrapper.replace=function(s,from,replace){return s.replace(from,replace)},StringWrapper.replaceAll=function(s,from,replace){return s.replace(from,replace)},StringWrapper.slice=function(s,from,to){return void 0===from&&(from=0),void 0===to&&(to=null),s.slice(from,null===to?void 0:to)},StringWrapper.replaceAllMapped=function(s,from,cb){return s.replace(from,function(){for(var matches=[],_i=0;_i<arguments.length;_i++)matches[_i-0]=arguments[_i];return matches.splice(-2,2),cb(matches)})},StringWrapper.contains=function(s,substr){return-1!=s.indexOf(substr)},StringWrapper.compare=function(a,b){return b>a?-1:a>b?1:0},StringWrapper}(),RegExpWrapper=function(){function RegExpWrapper(){}return RegExpWrapper.create=function(regExpStr,flags){return void 0===flags&&(flags=""),flags=flags.replace(/g/g,""),new global$1.RegExp(regExpStr,flags+"g")},RegExpWrapper.firstMatch=function(regExp,input){return regExp.lastIndex=0,regExp.exec(input)},RegExpWrapper.test=function(regExp,input){return regExp.lastIndex=0,regExp.test(input)},RegExpWrapper.matcher=function(regExp,input){return regExp.lastIndex=0,{re:regExp,input:input}},RegExpWrapper.replaceAll=function(regExp,input,replace){var c=regExp.exec(input),res="";regExp.lastIndex=0;for(var prev=0;c;)res+=input.substring(prev,c.index),res+=replace(c),prev=c.index+c[0].length,regExp.lastIndex=prev,c=regExp.exec(input);return res+=input.substring(prev)},RegExpWrapper}(),RegExpMatcherWrapper=function(){function RegExpMatcherWrapper(){}return RegExpMatcherWrapper.next=function(matcher){return matcher.re.exec(matcher.input)},RegExpMatcherWrapper}(),PromiseCompleter=function(){function PromiseCompleter(){var _this=this;this.promise=new Promise(function(res,rej){_this.resolve=res,_this.reject=rej})}return PromiseCompleter}(),PromiseWrapper=function(){function PromiseWrapper(){}return PromiseWrapper.resolve=function(obj){return Promise.resolve(obj)},PromiseWrapper.reject=function(obj){return Promise.reject(obj)},PromiseWrapper.catchError=function(promise,onError){return promise.catch(onError)},PromiseWrapper.all=function(promises){return 0==promises.length?Promise.resolve([]):Promise.all(promises)},PromiseWrapper.then=function(promise,success,rejection){return promise.then(success,rejection)},PromiseWrapper.wrap=function(computation){return new Promise(function(res,rej){try{res(computation())}catch(e){rej(e)}})},PromiseWrapper.scheduleMicrotask=function(computation){PromiseWrapper.then(PromiseWrapper.resolve(null),computation,function(){})},PromiseWrapper.isPromise=function(obj){return obj instanceof Promise},PromiseWrapper.completer=function(){return new PromiseCompleter},PromiseWrapper}(),ObservableWrapper=function(){function ObservableWrapper(){}return ObservableWrapper.subscribe=function(emitter,onNext,onError,onComplete){return void 0===onComplete&&(onComplete=function(){}),onError="function"==typeof onError&&onError||noop,onComplete="function"==typeof onComplete&&onComplete||noop,emitter.subscribe({next:onNext,error:onError,complete:onComplete})},ObservableWrapper.isObservable=function(obs){return!!obs.subscribe},ObservableWrapper.hasSubscribers=function(obs){return obs.observers.length>0},ObservableWrapper.dispose=function(subscription){subscription.unsubscribe()},ObservableWrapper.callNext=function(emitter,value){emitter.next(value)},ObservableWrapper.callEmit=function(emitter,value){emitter.emit(value)},ObservableWrapper.callError=function(emitter,error){emitter.error(error)},ObservableWrapper.callComplete=function(emitter){emitter.complete()},ObservableWrapper.fromPromise=function(promise){return rxjs_observable_PromiseObservable.PromiseObservable.create(promise)},ObservableWrapper.toPromise=function(obj){return rxjs_operator_toPromise.toPromise.call(obj)},ObservableWrapper}(),EventEmitter=function(_super){function EventEmitter(isAsync){void 0===isAsync&&(isAsync=!1),_super.call(this),this.__isAsync=isAsync}return __extends(EventEmitter,_super),EventEmitter.prototype.emit=function(value){_super.prototype.next.call(this,value)},EventEmitter.prototype.next=function(value){_super.prototype.next.call(this,value)},EventEmitter.prototype.subscribe=function(generatorOrNext,error,complete){var schedulerFn,errorFn=function(){return null},completeFn=function(){return null};return generatorOrNext&&"object"==typeof generatorOrNext?(schedulerFn=this.__isAsync?function(value){setTimeout(function(){return generatorOrNext.next(value)})}:function(value){generatorOrNext.next(value)},generatorOrNext.error&&(errorFn=this.__isAsync?function(err){setTimeout(function(){return generatorOrNext.error(err)})}:function(err){generatorOrNext.error(err)}),generatorOrNext.complete&&(completeFn=this.__isAsync?function(){setTimeout(function(){return generatorOrNext.complete()})}:function(){generatorOrNext.complete()})):(schedulerFn=this.__isAsync?function(value){setTimeout(function(){return generatorOrNext(value)})}:function(value){generatorOrNext(value)},error&&(errorFn=this.__isAsync?function(err){setTimeout(function(){return error(err)})}:function(err){error(err)}),complete&&(completeFn=this.__isAsync?function(){setTimeout(function(){return complete()})}:function(){complete()})),_super.prototype.subscribe.call(this,schedulerFn,errorFn,completeFn)},EventEmitter}(rxjs_Subject.Subject),Map$1=global$1.Map,Set=global$1.Set;!function(){try{if(1===new Map$1([[1,2]]).size)return function(pairs){return new Map$1(pairs)}}catch(e){}return function(pairs){for(var map=new Map$1,i=0;i<pairs.length;i++){var pair=pairs[i];map.set(pair[0],pair[1])}return map}}(),function(){try{if(new Map$1(new Map$1))return function(m){return new Map$1(m)}}catch(e){}return function(m){var map=new Map$1;return m.forEach(function(v,k){map.set(k,v)}),map}}(),function(){return(new Map$1).keys().next?function(m){for(var k,keyIterator=m.keys();!(k=keyIterator.next()).done;)m.set(k.value,null)}:function(m){m.forEach(function(v,k){m.set(k,null)})}}(),function(){try{if((new Map$1).values().next)return function(m,getValues){return getValues?Array.from(m.values()):Array.from(m.keys())}}catch(e){}return function(m,getValues){var res=ListWrapper.createFixedSize(m.size),i=0;return m.forEach(function(v,k){res[i]=getValues?v:k,i++}),res}}();var StringMapWrapper=function(){function StringMapWrapper(){}return StringMapWrapper.create=function(){return{}},StringMapWrapper.contains=function(map,key){return map.hasOwnProperty(key)},StringMapWrapper.get=function(map,key){return map.hasOwnProperty(key)?map[key]:void 0},StringMapWrapper.set=function(map,key,value){map[key]=value},StringMapWrapper.keys=function(map){return Object.keys(map)},StringMapWrapper.values=function(map){return Object.keys(map).reduce(function(r,a){return r.push(map[a]),r},[])},StringMapWrapper.isEmpty=function(map){for(var prop in map)return!1;return!0},StringMapWrapper.delete=function(map,key){delete map[key]},StringMapWrapper.forEach=function(map,callback){for(var prop in map)map.hasOwnProperty(prop)&&callback(map[prop],prop)},StringMapWrapper.merge=function(m1,m2){var m={};for(var attr in m1)m1.hasOwnProperty(attr)&&(m[attr]=m1[attr]);for(var attr in m2)m2.hasOwnProperty(attr)&&(m[attr]=m2[attr]);return m},StringMapWrapper.equals=function(m1,m2){var k1=Object.keys(m1),k2=Object.keys(m2);if(k1.length!=k2.length)return!1;for(var key,i=0;i<k1.length;i++)if(key=k1[i],m1[key]!==m2[key])return!1;return!0},StringMapWrapper}(),ListWrapper=function(){function ListWrapper(){}return ListWrapper.createFixedSize=function(size){return new Array(size)},ListWrapper.createGrowableSize=function(size){return new Array(size)},ListWrapper.clone=function(array){return array.slice(0)},ListWrapper.forEachWithIndex=function(array,fn){for(var i=0;i<array.length;i++)fn(array[i],i)},ListWrapper.first=function(array){return array?array[0]:null},ListWrapper.last=function(array){return array&&0!=array.length?array[array.length-1]:null},ListWrapper.indexOf=function(array,value,startIndex){return void 0===startIndex&&(startIndex=0),array.indexOf(value,startIndex)},ListWrapper.contains=function(list,el){return-1!==list.indexOf(el)},ListWrapper.reversed=function(array){var a=ListWrapper.clone(array);return a.reverse()},ListWrapper.concat=function(a,b){return a.concat(b)},ListWrapper.insert=function(list,index,value){list.splice(index,0,value)},ListWrapper.removeAt=function(list,index){var res=list[index];return list.splice(index,1),res},ListWrapper.removeAll=function(list,items){for(var i=0;i<items.length;++i){var index=list.indexOf(items[i]);list.splice(index,1)}},ListWrapper.remove=function(list,el){var index=list.indexOf(el);return index>-1?(list.splice(index,1),!0):!1},ListWrapper.clear=function(list){list.length=0},ListWrapper.isEmpty=function(list){return 0==list.length},ListWrapper.fill=function(list,value,start,end){void 0===start&&(start=0),void 0===end&&(end=null),list.fill(value,start,null===end?list.length:end)},ListWrapper.equals=function(a,b){if(a.length!=b.length)return!1;for(var i=0;i<a.length;++i)if(a[i]!==b[i])return!1;return!0},ListWrapper.slice=function(l,from,to){return void 0===from&&(from=0),void 0===to&&(to=null),l.slice(from,null===to?void 0:to)},ListWrapper.splice=function(l,from,length){return l.splice(from,length)},ListWrapper.sort=function(l,compareFn){isPresent(compareFn)?l.sort(compareFn):l.sort()},ListWrapper.toString=function(l){return l.toString()},ListWrapper.toJSON=function(l){return JSON.stringify(l)},ListWrapper.maximum=function(list,predicate){if(0==list.length)return null;for(var solution=null,maxValue=-1/0,index=0;index<list.length;index++){var candidate=list[index];if(!isBlank(candidate)){var candidateValue=predicate(candidate);candidateValue>maxValue&&(solution=candidate,maxValue=candidateValue)}}return solution},ListWrapper.flatten=function(list){var target=[];return _flattenArray(list,target),target},ListWrapper.addAll=function(list,source){for(var i=0;i<source.length;i++)list.push(source[i])},ListWrapper}();!function(){var test=new Set([1,2,3]);return 3===test.size?function(lst){return new Set(lst)}:function(lst){var res=new Set(lst);if(res.size!==lst.length)for(var i=0;i<lst.length;i++)res.add(lst[i]);return res}}();var BaseException$1=function(_super){function BaseException$1(message){void 0===message&&(message="--"),_super.call(this,message),this.message=message,this.stack=new Error(message).stack}return __extends(BaseException$1,_super),BaseException$1.prototype.toString=function(){return this.message},BaseException$1}(Error),RouteParams=function(){function RouteParams(params){this.params=params}return RouteParams.prototype.get=function(param){return normalizeBlank(StringMapWrapper.get(this.params,param))},RouteParams}(),RouteData=function(){function RouteData(data){void 0===data&&(data={}),this.data=data}return RouteData.prototype.get=function(key){return normalizeBlank(StringMapWrapper.get(this.data,key))},RouteData}(),BLANK_ROUTE_DATA=new RouteData,Instruction=function(){function Instruction(component,child,auxInstruction){this.component=component,this.child=child,this.auxInstruction=auxInstruction}return Object.defineProperty(Instruction.prototype,"urlPath",{get:function(){return isPresent(this.component)?this.component.urlPath:""},enumerable:!0,configurable:!0}),Object.defineProperty(Instruction.prototype,"urlParams",{get:function(){return isPresent(this.component)?this.component.urlParams:[]},enumerable:!0,configurable:!0}),Object.defineProperty(Instruction.prototype,"specificity",{get:function(){var total="";return isPresent(this.component)&&(total+=this.component.specificity),isPresent(this.child)&&(total+=this.child.specificity),total},enumerable:!0,configurable:!0}),Instruction.prototype.toRootUrl=function(){return this.toUrlPath()+this.toUrlQuery()},Instruction.prototype._toNonRootUrl=function(){return this._stringifyPathMatrixAuxPrefixed()+(isPresent(this.child)?this.child._toNonRootUrl():"")},Instruction.prototype.toUrlQuery=function(){return this.urlParams.length>0?"?"+this.urlParams.join("&"):""},Instruction.prototype.replaceChild=function(child){return new ResolvedInstruction(this.component,child,this.auxInstruction)},Instruction.prototype.toUrlPath=function(){return this.urlPath+this._stringifyAux()+(isPresent(this.child)?this.child._toNonRootUrl():"")},Instruction.prototype.toLinkUrl=function(){return this.urlPath+this._stringifyAux()+(isPresent(this.child)?this.child._toLinkUrl():"")+this.toUrlQuery()},Instruction.prototype._toLinkUrl=function(){return this._stringifyPathMatrixAuxPrefixed()+(isPresent(this.child)?this.child._toLinkUrl():"")},Instruction.prototype._stringifyPathMatrixAuxPrefixed=function(){var primary=this._stringifyPathMatrixAux();return primary.length>0&&(primary="/"+primary),primary},Instruction.prototype._stringifyMatrixParams=function(){return this.urlParams.length>0?";"+this.urlParams.join(";"):""},Instruction.prototype._stringifyPathMatrixAux=function(){return isBlank(this.component)&&isBlank(this.urlPath)?"":this.urlPath+this._stringifyMatrixParams()+this._stringifyAux()},Instruction.prototype._stringifyAux=function(){var routes=[];return StringMapWrapper.forEach(this.auxInstruction,function(auxInstruction){routes.push(auxInstruction._stringifyPathMatrixAux())}),routes.length>0?"("+routes.join("//")+")":""},Instruction}(),ResolvedInstruction=function(_super){function ResolvedInstruction(component,child,auxInstruction){_super.call(this,component,child,auxInstruction)}return __extends(ResolvedInstruction,_super),ResolvedInstruction.prototype.resolveComponent=function(){return PromiseWrapper.resolve(this.component)},ResolvedInstruction}(Instruction),DefaultInstruction=function(_super){function DefaultInstruction(component,child){_super.call(this,component,child,{})}return __extends(DefaultInstruction,_super),DefaultInstruction.prototype.toLinkUrl=function(){return""},DefaultInstruction.prototype._toLinkUrl=function(){return""},DefaultInstruction}(ResolvedInstruction),UnresolvedInstruction=function(_super){function UnresolvedInstruction(_resolver,_urlPath,_urlParams){void 0===_urlPath&&(_urlPath=""),void 0===_urlParams&&(_urlParams=[]),_super.call(this,null,null,{}),this._resolver=_resolver,this._urlPath=_urlPath,this._urlParams=_urlParams}return __extends(UnresolvedInstruction,_super),Object.defineProperty(UnresolvedInstruction.prototype,"urlPath",{get:function(){return isPresent(this.component)?this.component.urlPath:isPresent(this._urlPath)?this._urlPath:""},enumerable:!0,configurable:!0}),Object.defineProperty(UnresolvedInstruction.prototype,"urlParams",{get:function(){return isPresent(this.component)?this.component.urlParams:isPresent(this._urlParams)?this._urlParams:[]},enumerable:!0,configurable:!0}),UnresolvedInstruction.prototype.resolveComponent=function(){var _this=this;return isPresent(this.component)?PromiseWrapper.resolve(this.component):this._resolver().then(function(instruction){return _this.child=isPresent(instruction)?instruction.child:null,_this.component=isPresent(instruction)?instruction.component:null})},UnresolvedInstruction}(Instruction),RedirectInstruction=function(_super){function RedirectInstruction(component,child,auxInstruction,_specificity){_super.call(this,component,child,auxInstruction),this._specificity=_specificity}return __extends(RedirectInstruction,_super),Object.defineProperty(RedirectInstruction.prototype,"specificity",{get:function(){return this._specificity},enumerable:!0,configurable:!0}),RedirectInstruction}(ResolvedInstruction),ComponentInstruction=function(){function ComponentInstruction(urlPath,urlParams,data,componentType,terminal,specificity,params,routeName){void 0===params&&(params=null),this.urlPath=urlPath,this.urlParams=urlParams,this.componentType=componentType,this.terminal=terminal,this.specificity=specificity,this.params=params,this.routeName=routeName,this.reuse=!1,this.routeData=isPresent(data)?data:BLANK_ROUTE_DATA}return ComponentInstruction}(),makeDecorator=_angular_core.__core_private__.makeDecorator,reflector=_angular_core.__core_private__.reflector,RouteLifecycleHook=function(){function RouteLifecycleHook(name){this.name=name}return RouteLifecycleHook}(),CanActivateAnnotation=function(){function CanActivateAnnotation(fn){this.fn=fn}return CanActivateAnnotation}(),routerCanReuse=new RouteLifecycleHook("routerCanReuse"),routerCanDeactivate=new RouteLifecycleHook("routerCanDeactivate"),routerOnActivate=new RouteLifecycleHook("routerOnActivate"),routerOnReuse=new RouteLifecycleHook("routerOnReuse"),routerOnDeactivate=new RouteLifecycleHook("routerOnDeactivate"),RouteConfigAnnotation=function(){function RouteConfigAnnotation(configs){this.configs=configs}return RouteConfigAnnotation}(),AbstractRoute=function(){function AbstractRoute(_a){var name=_a.name,useAsDefault=_a.useAsDefault,path=_a.path,regex=_a.regex,regex_group_names=_a.regex_group_names,serializer=_a.serializer,data=_a.data;this.name=name,this.useAsDefault=useAsDefault,this.path=path,this.regex=regex,this.regex_group_names=regex_group_names,this.serializer=serializer,this.data=data}return AbstractRoute}(),Route=function(_super){function Route(_a){var name=_a.name,useAsDefault=_a.useAsDefault,path=_a.path,regex=_a.regex,regex_group_names=_a.regex_group_names,serializer=_a.serializer,data=_a.data,component=_a.component;_super.call(this,{name:name,useAsDefault:useAsDefault,path:path,regex:regex,regex_group_names:regex_group_names,serializer:serializer,data:data}),this.aux=null,this.component=component}return __extends(Route,_super),Route}(AbstractRoute),AuxRoute=function(_super){function AuxRoute(_a){var name=_a.name,useAsDefault=_a.useAsDefault,path=_a.path,regex=_a.regex,regex_group_names=_a.regex_group_names,serializer=_a.serializer,data=_a.data,component=_a.component;_super.call(this,{name:name,useAsDefault:useAsDefault,path:path,regex:regex,regex_group_names:regex_group_names,serializer:serializer,data:data}),this.component=component}return __extends(AuxRoute,_super),AuxRoute}(AbstractRoute),AsyncRoute=function(_super){function AsyncRoute(_a){var name=_a.name,useAsDefault=_a.useAsDefault,path=_a.path,regex=_a.regex,regex_group_names=_a.regex_group_names,serializer=_a.serializer,data=_a.data,loader=_a.loader;_super.call(this,{name:name,useAsDefault:useAsDefault,path:path,regex:regex,regex_group_names:regex_group_names,serializer:serializer,data:data}),this.aux=null,this.loader=loader}return __extends(AsyncRoute,_super),AsyncRoute}(AbstractRoute),Redirect=function(_super){function Redirect(_a){var name=_a.name,useAsDefault=_a.useAsDefault,path=_a.path,regex=_a.regex,regex_group_names=_a.regex_group_names,serializer=_a.serializer,data=_a.data,redirectTo=_a.redirectTo;_super.call(this,{name:name,useAsDefault:useAsDefault,path:path,regex:regex,regex_group_names:regex_group_names,serializer:serializer,data:data}),this.redirectTo=redirectTo}return __extends(Redirect,_super),Redirect}(AbstractRoute),Url=function(){function Url(path,child,auxiliary,params){void 0===child&&(child=null),void 0===auxiliary&&(auxiliary=[]),void 0===params&&(params={}),this.path=path,this.child=child,this.auxiliary=auxiliary,this.params=params}return Url.prototype.toString=function(){return this.path+this._matrixParamsToString()+this._auxToString()+this._childString()},Url.prototype.segmentToString=function(){return this.path+this._matrixParamsToString()},Url.prototype._auxToString=function(){return this.auxiliary.length>0?"("+this.auxiliary.map(function(sibling){return sibling.toString()}).join("//")+")":""},Url.prototype._matrixParamsToString=function(){var paramString=serializeParams(this.params,";");return paramString.length>0?";"+paramString:""},Url.prototype._childString=function(){return isPresent(this.child)?"/"+this.child.toString():""},Url}(),RootUrl=function(_super){function RootUrl(path,child,auxiliary,params){void 0===child&&(child=null),void 0===auxiliary&&(auxiliary=[]),void 0===params&&(params=null),_super.call(this,path,child,auxiliary,params)}return __extends(RootUrl,_super),RootUrl.prototype.toString=function(){return this.path+this._auxToString()+this._childString()+this._queryParamsToString()},RootUrl.prototype.segmentToString=function(){return this.path+this._queryParamsToString()},RootUrl.prototype._queryParamsToString=function(){return isBlank(this.params)?"":"?"+serializeParams(this.params)},RootUrl}(Url),SEGMENT_RE=RegExpWrapper.create("^[^\\/\\(\\)\\?;=&#]+"),QUERY_PARAM_VALUE_RE=RegExpWrapper.create("^[^\\(\\)\\?;&#]+"),UrlParser=function(){function UrlParser(){}return UrlParser.prototype.peekStartsWith=function(str){return this._remaining.startsWith(str)},UrlParser.prototype.capture=function(str){if(!this._remaining.startsWith(str))throw new BaseException$1('Expected "'+str+'".');this._remaining=this._remaining.substring(str.length)},UrlParser.prototype.parse=function(url){return this._remaining=url,""==url||"/"==url?new Url(""):this.parseRoot()},UrlParser.prototype.parseRoot=function(){this.peekStartsWith("/")&&this.capture("/");var path=matchUrlSegment(this._remaining);this.capture(path);var aux=[];this.peekStartsWith("(")&&(aux=this.parseAuxiliaryRoutes()),this.peekStartsWith(";")&&this.parseMatrixParams();var child=null;this.peekStartsWith("/")&&!this.peekStartsWith("//")&&(this.capture("/"),child=this.parseSegment());var queryParams=null;return this.peekStartsWith("?")&&(queryParams=this.parseQueryParams()),new RootUrl(path,child,aux,queryParams)},UrlParser.prototype.parseSegment=function(){if(0==this._remaining.length)return null;this.peekStartsWith("/")&&this.capture("/");var path=matchUrlSegment(this._remaining);this.capture(path);var matrixParams=null;this.peekStartsWith(";")&&(matrixParams=this.parseMatrixParams());var aux=[];this.peekStartsWith("(")&&(aux=this.parseAuxiliaryRoutes());var child=null;return this.peekStartsWith("/")&&!this.peekStartsWith("//")&&(this.capture("/"),child=this.parseSegment()),new Url(path,child,aux,matrixParams)},UrlParser.prototype.parseQueryParams=function(){var params={};for(this.capture("?"),this.parseQueryParam(params);this._remaining.length>0&&this.peekStartsWith("&");)this.capture("&"),this.parseQueryParam(params);return params},UrlParser.prototype.parseMatrixParams=function(){for(var params={};this._remaining.length>0&&this.peekStartsWith(";");)this.capture(";"),this.parseParam(params);return params},UrlParser.prototype.parseParam=function(params){var key=matchUrlSegment(this._remaining);if(!isBlank(key)){this.capture(key);var value=!0;if(this.peekStartsWith("=")){this.capture("=");var valueMatch=matchUrlSegment(this._remaining);isPresent(valueMatch)&&(value=valueMatch,this.capture(value))}params[key]=value}},UrlParser.prototype.parseQueryParam=function(params){var key=matchUrlSegment(this._remaining);if(!isBlank(key)){this.capture(key);var value=!0;if(this.peekStartsWith("=")){this.capture("=");var valueMatch=matchUrlQueryParamValue(this._remaining);isPresent(valueMatch)&&(value=valueMatch,this.capture(value))}params[key]=value}},UrlParser.prototype.parseAuxiliaryRoutes=function(){var routes=[];for(this.capture("(");!this.peekStartsWith(")")&&this._remaining.length>0;)routes.push(this.parseSegment()),this.peekStartsWith("//")&&this.capture("//"); return this.capture(")"),routes},UrlParser}(),parser=new UrlParser,RouteMatch=function(){function RouteMatch(){}return RouteMatch}(),PathMatch=function(_super){function PathMatch(instruction,remaining,remainingAux){_super.call(this),this.instruction=instruction,this.remaining=remaining,this.remainingAux=remainingAux}return __extends(PathMatch,_super),PathMatch}(RouteMatch),RedirectMatch=function(_super){function RedirectMatch(redirectTo,specificity){_super.call(this),this.redirectTo=redirectTo,this.specificity=specificity}return __extends(RedirectMatch,_super),RedirectMatch}(RouteMatch),RedirectRule=function(){function RedirectRule(_pathRecognizer,redirectTo){this._pathRecognizer=_pathRecognizer,this.redirectTo=redirectTo,this.hash=this._pathRecognizer.hash}return Object.defineProperty(RedirectRule.prototype,"path",{get:function(){return this._pathRecognizer.toString()},set:function(){throw new BaseException$1("you cannot set the path of a RedirectRule directly")},enumerable:!0,configurable:!0}),RedirectRule.prototype.recognize=function(beginningSegment){var match=null;return isPresent(this._pathRecognizer.matchUrl(beginningSegment))&&(match=new RedirectMatch(this.redirectTo,this._pathRecognizer.specificity)),PromiseWrapper.resolve(match)},RedirectRule.prototype.generate=function(){throw new BaseException$1("Tried to generate a redirect.")},RedirectRule}(),RouteRule=function(){function RouteRule(_routePath,handler,_routeName){this._routePath=_routePath,this.handler=handler,this._routeName=_routeName,this._cache=new Map$1,this.specificity=this._routePath.specificity,this.hash=this._routePath.hash,this.terminal=this._routePath.terminal}return Object.defineProperty(RouteRule.prototype,"path",{get:function(){return this._routePath.toString()},set:function(){throw new BaseException$1("you cannot set the path of a RouteRule directly")},enumerable:!0,configurable:!0}),RouteRule.prototype.recognize=function(beginningSegment){var _this=this,res=this._routePath.matchUrl(beginningSegment);return isBlank(res)?null:this.handler.resolveComponentType().then(function(){var componentInstruction=_this._getInstruction(res.urlPath,res.urlParams,res.allParams);return new PathMatch(componentInstruction,res.rest,res.auxiliary)})},RouteRule.prototype.generate=function(params){var generated=this._routePath.generateUrl(params),urlPath=generated.urlPath,urlParams=generated.urlParams;return this._getInstruction(urlPath,convertUrlParamsToArray(urlParams),params)},RouteRule.prototype.generateComponentPathValues=function(params){return this._routePath.generateUrl(params)},RouteRule.prototype._getInstruction=function(urlPath,urlParams,params){if(isBlank(this.handler.componentType))throw new BaseException$1("Tried to get instruction before the type was loaded.");var hashKey=urlPath+"?"+urlParams.join("&");if(this._cache.has(hashKey))return this._cache.get(hashKey);var instruction=new ComponentInstruction(urlPath,urlParams,this.handler.data,this.handler.componentType,this.terminal,this.specificity,params,this._routeName);return this._cache.set(hashKey,instruction),instruction},RouteRule}(),AsyncRouteHandler=function(){function AsyncRouteHandler(_loader,data){void 0===data&&(data=null),this._loader=_loader,this._resolvedComponent=null,this.data=isPresent(data)?new RouteData(data):BLANK_ROUTE_DATA}return AsyncRouteHandler.prototype.resolveComponentType=function(){var _this=this;return isPresent(this._resolvedComponent)?this._resolvedComponent:this._resolvedComponent=this._loader().then(function(componentType){return _this.componentType=componentType,componentType})},AsyncRouteHandler}(),SyncRouteHandler=function(){function SyncRouteHandler(componentType,data){this.componentType=componentType,this._resolvedComponent=null,this._resolvedComponent=PromiseWrapper.resolve(componentType),this.data=isPresent(data)?new RouteData(data):BLANK_ROUTE_DATA}return SyncRouteHandler.prototype.resolveComponentType=function(){return this._resolvedComponent},SyncRouteHandler}(),TouchMap=function(){function TouchMap(map){var _this=this;this.map={},this.keys={},isPresent(map)&&StringMapWrapper.forEach(map,function(value,key){_this.map[key]=isPresent(value)?value.toString():null,_this.keys[key]=!0})}return TouchMap.prototype.get=function(key){return StringMapWrapper.delete(this.keys,key),this.map[key]},TouchMap.prototype.getUnused=function(){var _this=this,unused={},keys=StringMapWrapper.keys(this.keys);return keys.forEach(function(key){return unused[key]=StringMapWrapper.get(_this.map,key)}),unused},TouchMap}(),MatchedUrl=function(){function MatchedUrl(urlPath,urlParams,allParams,auxiliary,rest){this.urlPath=urlPath,this.urlParams=urlParams,this.allParams=allParams,this.auxiliary=auxiliary,this.rest=rest}return MatchedUrl}(),GeneratedUrl=function(){function GeneratedUrl(urlPath,urlParams){this.urlPath=urlPath,this.urlParams=urlParams}return GeneratedUrl}(),ContinuationPathSegment=function(){function ContinuationPathSegment(){this.name="",this.specificity="",this.hash="..."}return ContinuationPathSegment.prototype.generate=function(){return""},ContinuationPathSegment.prototype.match=function(){return!0},ContinuationPathSegment}(),StaticPathSegment=function(){function StaticPathSegment(path){this.path=path,this.name="",this.specificity="2",this.hash=path}return StaticPathSegment.prototype.match=function(path){return path==this.path},StaticPathSegment.prototype.generate=function(){return this.path},StaticPathSegment}(),DynamicPathSegment=function(){function DynamicPathSegment(name){this.name=name,this.specificity="1",this.hash=":"}return DynamicPathSegment.prototype.match=function(path){return path.length>0},DynamicPathSegment.prototype.generate=function(params){if(!StringMapWrapper.contains(params.map,this.name))throw new BaseException$1("Route generator for '"+this.name+"' was not included in parameters passed.");return encodeDynamicSegment(normalizeString(params.get(this.name)))},DynamicPathSegment}();DynamicPathSegment.paramMatcher=/^:([^\/]+)$/g;var StarPathSegment=function(){function StarPathSegment(name){this.name=name,this.specificity="0",this.hash="*"}return StarPathSegment.prototype.match=function(){return!0},StarPathSegment.prototype.generate=function(params){return normalizeString(params.get(this.name))},StarPathSegment}();StarPathSegment.wildcardMatcher=/^\*([^\/]+)$/g;var ParamRoutePath=function(){function ParamRoutePath(routePath){this.routePath=routePath,this.terminal=!0,this._assertValidPath(routePath),this._parsePathString(routePath),this.specificity=this._calculateSpecificity(),this.hash=this._calculateHash();var lastSegment=this._segments[this._segments.length-1];this.terminal=!(lastSegment instanceof ContinuationPathSegment)}return ParamRoutePath.prototype.matchUrl=function(url){for(var currentUrlSegment,nextUrlSegment=url,positionalParams={},captured=[],i=0;i<this._segments.length;i+=1){var pathSegment=this._segments[i];if(pathSegment instanceof ContinuationPathSegment)break;if(currentUrlSegment=nextUrlSegment,isPresent(currentUrlSegment)){if(pathSegment instanceof StarPathSegment){positionalParams[pathSegment.name]=currentUrlSegment.toString(),captured.push(currentUrlSegment.toString()),nextUrlSegment=null;break}if(captured.push(currentUrlSegment.path),pathSegment instanceof DynamicPathSegment)positionalParams[pathSegment.name]=decodeDynamicSegment(currentUrlSegment.path);else if(!pathSegment.match(currentUrlSegment.path))return null;nextUrlSegment=currentUrlSegment.child}else if(!pathSegment.match(""))return null}if(this.terminal&&isPresent(nextUrlSegment))return null;var urlPath=captured.join("/"),auxiliary=[],urlParams=[],allParams=positionalParams;if(isPresent(currentUrlSegment)){var paramsSegment=url instanceof RootUrl?url:currentUrlSegment;isPresent(paramsSegment.params)?(allParams=StringMapWrapper.merge(paramsSegment.params,positionalParams),urlParams=convertUrlParamsToArray(paramsSegment.params)):allParams=positionalParams,auxiliary=currentUrlSegment.auxiliary}return new MatchedUrl(urlPath,urlParams,allParams,auxiliary,nextUrlSegment)},ParamRoutePath.prototype.generateUrl=function(params){for(var paramTokens=new TouchMap(params),path=[],i=0;i<this._segments.length;i++){var segment=this._segments[i];segment instanceof ContinuationPathSegment||path.push(segment.generate(paramTokens))}var urlPath=path.join("/"),nonPositionalParams=paramTokens.getUnused(),urlParams=nonPositionalParams;return new GeneratedUrl(urlPath,urlParams)},ParamRoutePath.prototype.toString=function(){return this.routePath},ParamRoutePath.prototype._parsePathString=function(routePath){routePath.startsWith("/")&&(routePath=routePath.substring(1));var segmentStrings=routePath.split("/");this._segments=[];for(var limit=segmentStrings.length-1,i=0;limit>=i;i++){var match,segment=segmentStrings[i];if(isPresent(match=RegExpWrapper.firstMatch(DynamicPathSegment.paramMatcher,segment)))this._segments.push(new DynamicPathSegment(match[1]));else if(isPresent(match=RegExpWrapper.firstMatch(StarPathSegment.wildcardMatcher,segment)))this._segments.push(new StarPathSegment(match[1]));else if("..."==segment){if(limit>i)throw new BaseException$1('Unexpected "..." before the end of the path for "'+routePath+'".');this._segments.push(new ContinuationPathSegment)}else this._segments.push(new StaticPathSegment(segment))}},ParamRoutePath.prototype._calculateSpecificity=function(){var i,specificity,length=this._segments.length;if(0==length)specificity+="2";else for(specificity="",i=0;length>i;i++)specificity+=this._segments[i].specificity;return specificity},ParamRoutePath.prototype._calculateHash=function(){var i,length=this._segments.length,hashParts=[];for(i=0;length>i;i++)hashParts.push(this._segments[i].hash);return hashParts.join("/")},ParamRoutePath.prototype._assertValidPath=function(path){if(StringWrapper.contains(path,"#"))throw new BaseException$1('Path "'+path+'" should not include "#". Use "HashLocationStrategy" instead.');var illegalCharacter=RegExpWrapper.firstMatch(ParamRoutePath.RESERVED_CHARS,path);if(isPresent(illegalCharacter))throw new BaseException$1('Path "'+path+'" contains "'+illegalCharacter[0]+'" which is not allowed in a route config.')},ParamRoutePath}();ParamRoutePath.RESERVED_CHARS=RegExpWrapper.create("//|\\(|\\)|;|\\?|=");var REGEXP_PERCENT=/%/g,REGEXP_SLASH=/\//g,REGEXP_OPEN_PARENT=/\(/g,REGEXP_CLOSE_PARENT=/\)/g,REGEXP_SEMICOLON=/;/g,REGEXP_ENC_SEMICOLON=/%3B/gi,REGEXP_ENC_CLOSE_PARENT=/%29/gi,REGEXP_ENC_OPEN_PARENT=/%28/gi,REGEXP_ENC_SLASH=/%2F/gi,REGEXP_ENC_PERCENT=/%25/gi,RegexRoutePath=function(){function RegexRoutePath(_reString,_serializer,_groupNames){if(this._reString=_reString,this._serializer=_serializer,this._groupNames=_groupNames,this.terminal=!0,this.specificity="2",this.hash=this._reString,this._regex=RegExpWrapper.create(this._reString),null!=this._groupNames){var groups=computeNumberOfRegexGroups(this._reString);if(groups!=_groupNames.length)throw new _angular_core.BaseException("Regex group names ["+this._groupNames.join(",")+"] must contain names for each matching group and a name for the complete match as its first element of regex '"+this._reString+"'. "+groups+" group names are expected.")}}return RegexRoutePath.prototype.matchUrl=function(url){var urlPath=url.toString(),params={},matcher=RegExpWrapper.matcher(this._regex,urlPath),match=RegExpMatcherWrapper.next(matcher);if(isBlank(match))return null;for(var i=0;i<match.length;i+=1)params[null!=this._groupNames?this._groupNames[i]:i.toString()]=match[i];return new MatchedUrl(urlPath,[],params,[],null)},RegexRoutePath.prototype.generateUrl=function(params){return this._serializer(params)},RegexRoutePath.prototype.toString=function(){return this._reString},RegexRoutePath}(),RuleSet=function(){function RuleSet(){this.rulesByName=new Map$1,this.auxRulesByName=new Map$1,this.auxRulesByPath=new Map$1,this.rules=[],this.defaultRule=null}return RuleSet.prototype.config=function(config){var handler;if(isPresent(config.name)&&config.name[0].toUpperCase()!=config.name[0]){var suggestedName=config.name[0].toUpperCase()+config.name.substring(1);throw new BaseException$1('Route "'+config.path+'" with name "'+config.name+'" does not begin with an uppercase letter. Route names should be PascalCase like "'+suggestedName+'".')}if(config instanceof AuxRoute){handler=new SyncRouteHandler(config.component,config.data);var routePath_1=this._getRoutePath(config),auxRule=new RouteRule(routePath_1,handler,config.name);return this.auxRulesByPath.set(routePath_1.toString(),auxRule),isPresent(config.name)&&this.auxRulesByName.set(config.name,auxRule),auxRule.terminal}var useAsDefault=!1;if(config instanceof Redirect){var routePath_2=this._getRoutePath(config),redirector=new RedirectRule(routePath_2,config.redirectTo);return this._assertNoHashCollision(redirector.hash,config.path),this.rules.push(redirector),!0}config instanceof Route?(handler=new SyncRouteHandler(config.component,config.data),useAsDefault=isPresent(config.useAsDefault)&&config.useAsDefault):config instanceof AsyncRoute&&(handler=new AsyncRouteHandler(config.loader,config.data),useAsDefault=isPresent(config.useAsDefault)&&config.useAsDefault);var routePath=this._getRoutePath(config),newRule=new RouteRule(routePath,handler,config.name);if(this._assertNoHashCollision(newRule.hash,config.path),useAsDefault){if(isPresent(this.defaultRule))throw new BaseException$1("Only one route can be default");this.defaultRule=newRule}return this.rules.push(newRule),isPresent(config.name)&&this.rulesByName.set(config.name,newRule),newRule.terminal},RuleSet.prototype.recognize=function(urlParse){var solutions=[];return this.rules.forEach(function(routeRecognizer){var pathMatch=routeRecognizer.recognize(urlParse);isPresent(pathMatch)&&solutions.push(pathMatch)}),0==solutions.length&&isPresent(urlParse)&&urlParse.auxiliary.length>0?[PromiseWrapper.resolve(new PathMatch(null,null,urlParse.auxiliary))]:solutions},RuleSet.prototype.recognizeAuxiliary=function(urlParse){var routeRecognizer=this.auxRulesByPath.get(urlParse.path);return isPresent(routeRecognizer)?[routeRecognizer.recognize(urlParse)]:[PromiseWrapper.resolve(null)]},RuleSet.prototype.hasRoute=function(name){return this.rulesByName.has(name)},RuleSet.prototype.componentLoaded=function(name){return this.hasRoute(name)&&isPresent(this.rulesByName.get(name).handler.componentType)},RuleSet.prototype.loadComponent=function(name){return this.rulesByName.get(name).handler.resolveComponentType()},RuleSet.prototype.generate=function(name,params){var rule=this.rulesByName.get(name);return isBlank(rule)?null:rule.generate(params)},RuleSet.prototype.generateAuxiliary=function(name,params){var rule=this.auxRulesByName.get(name);return isBlank(rule)?null:rule.generate(params)},RuleSet.prototype._assertNoHashCollision=function(hash,path){this.rules.forEach(function(rule){if(hash==rule.hash)throw new BaseException$1("Configuration '"+path+"' conflicts with existing route '"+rule.path+"'")})},RuleSet.prototype._getRoutePath=function(config){if(isPresent(config.regex)){if(isFunction(config.serializer))return new RegexRoutePath(config.regex,config.serializer,config.regex_group_names);throw new BaseException$1("Route provides a regex property, '"+config.regex+"', but no serializer property")}if(isPresent(config.path)){var path=config instanceof AuxRoute&&config.path.startsWith("/")?config.path.substring(1):config.path;return new ParamRoutePath(path)}throw new BaseException$1("Route must provide either a path or regex property")},RuleSet}(),RouteConfig=makeDecorator(RouteConfigAnnotation),__decorate$2=this&&this.__decorate||function(decorators,target,key,desc){var d,c=arguments.length,r=3>c?target:null===desc?desc=Object.getOwnPropertyDescriptor(target,key):desc;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(decorators,target,key,desc);else for(var i=decorators.length-1;i>=0;i--)(d=decorators[i])&&(r=(3>c?d(r):c>3?d(target,key,r):d(target,key))||r);return c>3&&r&&Object.defineProperty(target,key,r),r},__metadata$2=this&&this.__metadata||function(k,v){return"object"==typeof Reflect&&"function"==typeof Reflect.metadata?Reflect.metadata(k,v):void 0},__param$1=this&&this.__param||function(paramIndex,decorator){return function(target,key){decorator(target,key,paramIndex)}},_resolveToNull=PromiseWrapper.resolve(null),ROUTER_PRIMARY_COMPONENT=new _angular_core.OpaqueToken("RouterPrimaryComponent");exports.RouteRegistry=function(){function RouteRegistry(_rootComponent){this._rootComponent=_rootComponent,this._rules=new Map$1}return RouteRegistry.prototype.config=function(parentComponent,config){config=normalizeRouteConfig(config,this),config instanceof Route?assertComponentExists(config.component,config.path):config instanceof AuxRoute&&assertComponentExists(config.component,config.path);var rules=this._rules.get(parentComponent);isBlank(rules)&&(rules=new RuleSet,this._rules.set(parentComponent,rules));var terminal=rules.config(config);config instanceof Route&&(terminal?assertTerminalComponent(config.component,config.path):this.configFromComponent(config.component))},RouteRegistry.prototype.configFromComponent=function(component){var _this=this;if(isType(component)&&!this._rules.has(component)){var annotations=reflector.annotations(component);if(isPresent(annotations))for(var i=0;i<annotations.length;i++){var annotation=annotations[i];if(annotation instanceof RouteConfigAnnotation){var routeCfgs=annotation.configs;routeCfgs.forEach(function(config){return _this.config(component,config)})}}}},RouteRegistry.prototype.recognize=function(url){var parsedUrl=parser.parse(url);return this._recognize(parsedUrl,[])},RouteRegistry.prototype._recognize=function(parsedUrl,ancestorInstructions,_aux){var _this=this;void 0===_aux&&(_aux=!1);var parentInstruction=ListWrapper.last(ancestorInstructions),parentComponent=isPresent(parentInstruction)?parentInstruction.component.componentType:this._rootComponent,rules=this._rules.get(parentComponent);if(is