Socket
Socket
Sign inDemoInstall

@angular/upgrade

Package Overview
Dependencies
Maintainers
1
Versions
838
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@angular/upgrade - npm Package Compare versions

Comparing version 4.0.0-rc.3 to 4.0.0-rc.4

@angular/upgrade.es5.js.map

7

bundles/upgrade-static.umd.min.js
/**
* @license Angular v4.0.0-rc.3
* @license Angular v4.0.0-rc.4
* (c) 2010-2017 Google, Inc. https://angular.io/
* License: MIT
*/
!function(global,factory){"object"==typeof exports&&"undefined"!=typeof module?factory(exports,require("@angular/core")):"function"==typeof define&&define.amd?define(["exports","@angular/core"],factory):factory((global.ng=global.ng||{},global.ng.upgrade=global.ng.upgrade||{},global.ng.upgrade.static=global.ng.upgrade.static||{}),global.ng.core)}(this,function(exports,_angular_core){"use strict";function controllerKey(name){return"$"+name+"Controller"}function getComponentName(component){return component.overriddenName||component.name||component.toString().split("\n")[0]}function supportsNgModel(component){return"function"==typeof component.writeValue&&"function"==typeof component.registerOnChange}function hookupNgModel(ngModel,component){ngModel&&supportsNgModel(component)&&(ngModel.$render=function(){component.writeValue(ngModel.$viewValue)},component.registerOnChange(ngModel.$setViewValue.bind(ngModel)))}function downgradeComponent(info){var idPrefix="NG2_UPGRADE_"+downgradeCount++ +"_",idCount=0,directiveFactory=function($compile,$injector,$parse){return{restrict:"E",terminal:!0,require:[REQUIRE_INJECTOR,REQUIRE_NG_MODEL],link:function(scope,element,attrs,required){var parentInjector=required[0]||$injector.get(INJECTOR_KEY),ngModel=required[1],downgradeFn=function(injector){var componentFactoryResolver=injector.get(_angular_core.ComponentFactoryResolver),componentFactory=componentFactoryResolver.resolveComponentFactory(info.component);if(!componentFactory)throw new Error("Expecting ComponentFactory for: "+getComponentName(info.component));var id=idPrefix+idCount++,injectorPromise=new ParentInjectorPromise(element),facade=new DowngradeComponentAdapter(id,info,element,attrs,scope,ngModel,injector,$injector,$compile,$parse,componentFactory),projectableNodes=facade.compileContents();facade.createComponent(projectableNodes),facade.setupInputs(),facade.setupOutputs(),facade.registerCleanup(),injectorPromise.resolve(facade.getInjector())};parentInjector instanceof ParentInjectorPromise?parentInjector.then(downgradeFn):downgradeFn(parentInjector)}}};return directiveFactory.$inject=[$COMPILE,$INJECTOR,$PARSE],directiveFactory}function downgradeInjectable(token){var factory=function(i){return i.get(token)};return factory.$inject=[INJECTOR_KEY],factory}/**
!function(global,factory){"object"==typeof exports&&"undefined"!=typeof module?factory(exports,require("@angular/core")):"function"==typeof define&&define.amd?define(["exports","@angular/core"],factory):factory((global.ng=global.ng||{},global.ng.upgrade=global.ng.upgrade||{},global.ng.upgrade.static=global.ng.upgrade.static||{}),global.ng.core)}(this,function(exports,_angular_core){"use strict";function getHtmlTagDefinition(tagName){return TAG_DEFINITIONS[tagName.toLowerCase()]||_DEFAULT_TAG_DEFINITION}function createElementCssSelector(elementName,attributes){var cssSelector=new CssSelector,elNameNoNs=splitNsName(elementName)[1];cssSelector.setElement(elNameNoNs);for(var i=0;i<attributes.length;i++){var attrName=attributes[i][0],attrNameNoNs=splitNsName(attrName)[1],attrValue=attributes[i][1];if(cssSelector.addAttribute(attrNameNoNs,attrValue),attrName.toLowerCase()==CLASS_ATTR){var classes=splitClasses(attrValue);classes.forEach(function(className){return cssSelector.addClassName(className)})}}return cssSelector}function splitNsName(elementName){if(":"!=elementName[0])return[null,elementName];var colonIndex=elementName.indexOf(":",1);if(colonIndex==-1)throw new Error('Unsupported format "'+elementName+'" expecting ":namespace:name"');return[elementName.slice(1,colonIndex),elementName.slice(colonIndex+1)]}function splitClasses(classAttrValue){return classAttrValue.trim().split(/\s+/g)}function controllerKey(name){return"$"+name+"Controller"}function getAttributesAsArray(node){var asArray,attributes=node.attributes;if(attributes){var attrLen=attributes.length;asArray=new Array(attrLen);for(var i=0;i<attrLen;i++)asArray[i]=[attributes[i].nodeName,attributes[i].nodeValue]}return asArray||[]}function getComponentName(component){return component.overriddenName||component.name||component.toString().split("\n")[0]}function supportsNgModel(component){return"function"==typeof component.writeValue&&"function"==typeof component.registerOnChange}function hookupNgModel(ngModel,component){ngModel&&supportsNgModel(component)&&(ngModel.$render=function(){component.writeValue(ngModel.$viewValue)},component.registerOnChange(ngModel.$setViewValue.bind(ngModel)))}function downgradeComponent(info){var idPrefix="NG2_UPGRADE_"+downgradeCount++ +"_",idCount=0,directiveFactory=function($compile,$injector,$parse){return{restrict:"E",terminal:!0,require:[REQUIRE_INJECTOR,REQUIRE_NG_MODEL],link:function(scope,element,attrs,required){var parentInjector=required[0]||$injector.get(INJECTOR_KEY),ngModel=required[1],downgradeFn=function(injector){var componentFactoryResolver=injector.get(_angular_core.ComponentFactoryResolver),componentFactory=componentFactoryResolver.resolveComponentFactory(info.component);if(!componentFactory)throw new Error("Expecting ComponentFactory for: "+getComponentName(info.component));var id=idPrefix+idCount++,injectorPromise=new ParentInjectorPromise(element),facade=new DowngradeComponentAdapter(id,info,element,attrs,scope,ngModel,injector,$injector,$compile,$parse,componentFactory),projectableNodes=facade.compileContents();facade.createComponent(projectableNodes),facade.setupInputs(),facade.setupOutputs(),facade.registerCleanup(),injectorPromise.resolve(facade.getInjector())};parentInjector instanceof ParentInjectorPromise?parentInjector.then(downgradeFn):downgradeFn(parentInjector)}}};return directiveFactory.$inject=[$COMPILE,$INJECTOR,$PARSE],directiveFactory}function downgradeInjectable(token){var factory=function(i){return i.get(token)};return factory.$inject=[INJECTOR_KEY],factory}/**
* @license

@@ -27,2 +27,3 @@ * Copyright Google Inc. All Rights Reserved.

*/
var $COMPILE="$compile",$CONTROLLER="$controller",$DELEGATE="$delegate",$HTTP_BACKEND="$httpBackend",$INJECTOR="$injector",$PARSE="$parse",$PROVIDE="$provide",$SCOPE="$scope",$TEMPLATE_CACHE="$templateCache",$$TESTABILITY="$$testability",INJECTOR_KEY="$$angularInjector",REQUIRE_INJECTOR="?^^"+INJECTOR_KEY,REQUIRE_NG_MODEL="?ngModel",UPGRADE_MODULE_NAME="$$UpgradeModule",PropertyBinding=function(){function PropertyBinding(binding){this.binding=binding,this.parseBinding()}return PropertyBinding.prototype.parseBinding=function(){var parts=this.binding.split(":");this.prop=parts[0].trim(),this.attr=(parts[1]||this.prop).trim(),this.bracketAttr="["+this.attr+"]",this.parenAttr="("+this.attr+")",this.bracketParenAttr="[("+this.attr+")]";var capitalAttr=this.attr.charAt(0).toUpperCase()+this.attr.substr(1);this.onAttr="on"+capitalAttr,this.bindAttr="bind"+capitalAttr,this.bindonAttr="bindon"+capitalAttr},PropertyBinding}(),ContentProjectionHelper=function(){function ContentProjectionHelper(){}return ContentProjectionHelper.prototype.groupProjectableNodes=function($injector,component,nodes){return[nodes]},ContentProjectionHelper}(),INITIAL_VALUE={__UNINITIALIZED__:!0},DowngradeComponentAdapter=function(){function DowngradeComponentAdapter(id,info,element,attrs,scope,ngModel,parentInjector,$injector,$compile,$parse,componentFactory){this.id=id,this.info=info,this.element=element,this.attrs=attrs,this.scope=scope,this.ngModel=ngModel,this.parentInjector=parentInjector,this.$injector=$injector,this.$compile=$compile,this.$parse=$parse,this.componentFactory=componentFactory,this.inputChangeCount=0,this.inputChanges=null,this.componentRef=null,this.component=null,this.changeDetector=null,this.element[0].id=id,this.componentScope=scope.$new()}return DowngradeComponentAdapter.prototype.compileContents=function(){var _this=this,compiledProjectableNodes=[],projectionHelper=this.parentInjector.get(ContentProjectionHelper),projectableNodes=projectionHelper.groupProjectableNodes(this.$injector,this.info.component,this.element.contents()),linkFns=projectableNodes.map(function(nodes){return _this.$compile(nodes)});return this.element.empty(),linkFns.forEach(function(linkFn){linkFn(_this.scope,function(clone){compiledProjectableNodes.push(clone),_this.element.append(clone)})}),compiledProjectableNodes},DowngradeComponentAdapter.prototype.createComponent=function(projectableNodes){var childInjector=_angular_core.ReflectiveInjector.resolveAndCreate([{provide:$SCOPE,useValue:this.componentScope}],this.parentInjector);this.componentRef=this.componentFactory.create(childInjector,projectableNodes,this.element[0]),this.changeDetector=this.componentRef.changeDetectorRef,this.component=this.componentRef.instance,hookupNgModel(this.ngModel,this.component)},DowngradeComponentAdapter.prototype.setupInputs=function(){for(var _this=this,attrs=this.attrs,inputs=this.info.inputs||[],i=0;i<inputs.length;i++){var input=new PropertyBinding(inputs[i]),expr=null;if(attrs.hasOwnProperty(input.attr)){var observeFn=function(prop){var prevValue=INITIAL_VALUE;return function(currValue){prevValue===INITIAL_VALUE&&(prevValue=currValue),_this.updateInput(prop,prevValue,currValue),prevValue=currValue}}(input.prop);attrs.$observe(input.attr,observeFn)}else attrs.hasOwnProperty(input.bindAttr)?expr=attrs[input.bindAttr]:attrs.hasOwnProperty(input.bracketAttr)?expr=attrs[input.bracketAttr]:attrs.hasOwnProperty(input.bindonAttr)?expr=attrs[input.bindonAttr]:attrs.hasOwnProperty(input.bracketParenAttr)&&(expr=attrs[input.bracketParenAttr]);if(null!=expr){var watchFn=function(prop){return function(currValue,prevValue){return _this.updateInput(prop,prevValue,currValue)}}(input.prop);this.componentScope.$watch(expr,watchFn)}}var prototype=this.info.component.prototype;prototype&&prototype.ngOnChanges&&(this.inputChanges={},this.componentScope.$watch(function(){return _this.inputChangeCount},function(){var inputChanges=_this.inputChanges;_this.inputChanges={},_this.component.ngOnChanges(inputChanges)})),this.componentScope.$watch(function(){return _this.changeDetector&&_this.changeDetector.detectChanges()})},DowngradeComponentAdapter.prototype.setupOutputs=function(){for(var _this=this,attrs=this.attrs,outputs=this.info.outputs||[],j=0;j<outputs.length;j++){var output=new PropertyBinding(outputs[j]),expr=null,assignExpr=!1,bindonAttr=output.bindonAttr?output.bindonAttr.substring(0,output.bindonAttr.length-6):null,bracketParenAttr=output.bracketParenAttr?"[("+output.bracketParenAttr.substring(2,output.bracketParenAttr.length-8)+")]":null;if(attrs.hasOwnProperty(output.onAttr)?expr=attrs[output.onAttr]:attrs.hasOwnProperty(output.parenAttr)?expr=attrs[output.parenAttr]:attrs.hasOwnProperty(bindonAttr)?(expr=attrs[bindonAttr],assignExpr=!0):attrs.hasOwnProperty(bracketParenAttr)&&(expr=attrs[bracketParenAttr],assignExpr=!0),null!=expr&&null!=assignExpr){var getter=this.$parse(expr),setter=getter.assign;if(assignExpr&&!setter)throw new Error("Expression '"+expr+"' is not assignable!");var emitter=this.component[output.prop];if(!emitter)throw new Error("Missing emitter '"+output.prop+"' on component '"+getComponentName(this.info.component)+"'!");emitter.subscribe({next:assignExpr?function(setter){return function(v){return setter(_this.scope,v)}}(setter):function(getter){return function(v){return getter(_this.scope,{$event:v})}}(getter)})}}},DowngradeComponentAdapter.prototype.registerCleanup=function(){var _this=this;this.element.bind("$destroy",function(){_this.componentScope.$destroy(),_this.componentRef.destroy()})},DowngradeComponentAdapter.prototype.getInjector=function(){return this.componentRef&&this.componentRef.injector},DowngradeComponentAdapter.prototype.updateInput=function(prop,prevValue,currValue){this.inputChanges&&(this.inputChangeCount++,this.inputChanges[prop]=new _angular_core.SimpleChange(prevValue,currValue,prevValue===currValue)),this.component[prop]=currValue},DowngradeComponentAdapter}(),downgradeCount=0,ParentInjectorPromise=function(){function ParentInjectorPromise(element){this.element=element,this.injectorKey=controllerKey(INJECTOR_KEY),this.callbacks=[],element.data(this.injectorKey,this)}return ParentInjectorPromise.prototype.then=function(callback){this.injector?callback(this.injector):this.callbacks.push(callback)},ParentInjectorPromise.prototype.resolve=function(injector){this.injector=injector,this.element.data(this.injectorKey,injector),this.element=null,this.callbacks.forEach(function(callback){return callback(injector)}),this.callbacks.length=0},ParentInjectorPromise}(),VERSION=new _angular_core.Version("4.0.0-rc.3"),angular={bootstrap:noNg,module:noNg,element:noNg,version:noNg,resumeBootstrap:noNg,getTestability:noNg};try{window.hasOwnProperty("angular")&&(angular=window.angular)}catch(e){}var tempInjectorRef,bootstrap=angular.bootstrap,module$1=angular.module,element=angular.element,REQUIRE_PREFIX_RE=/^(\^\^?)?(\?)?(\^\^?)?/,NOT_SUPPORTED="NOT_SUPPORTED",INITIAL_VALUE$1={__UNINITIALIZED__:!0},Bindings=function(){function Bindings(){this.twoWayBoundProperties=[],this.twoWayBoundLastValues=[],this.expressionBoundProperties=[],this.propertyToOutputMap={}}return Bindings}(),UpgradeComponent=function(){function UpgradeComponent(name,elementRef,injector){this.name=name,this.elementRef=elementRef,this.injector=injector,this.$injector=injector.get($INJECTOR),this.$compile=this.$injector.get($COMPILE),this.$templateCache=this.$injector.get($TEMPLATE_CACHE),this.$httpBackend=this.$injector.get($HTTP_BACKEND),this.$controller=this.$injector.get($CONTROLLER),this.element=elementRef.nativeElement,this.$element=element(this.element),this.directive=this.getDirective(name),this.bindings=this.initializeBindings(this.directive);var $parentScope=injector.get($SCOPE);this.$componentScope=$parentScope.$new(!!this.directive.scope),this.initializeOutputs()}return UpgradeComponent.prototype.ngOnInit=function(){var _this=this,contentChildNodes=this.extractChildNodes(this.element),linkFn=this.compileTemplate(this.directive),controllerType=this.directive.controller,bindToController=this.directive.bindToController;if(controllerType)this.controllerInstance=this.buildController(controllerType,this.$componentScope,this.$element,this.directive.controllerAs);else if(bindToController)throw new Error("Upgraded directive '"+this.directive.name+"' specifies 'bindToController' but no controller.");this.bindingDestination=bindToController?this.controllerInstance:this.$componentScope,this.bindOutputs();var directiveRequire=this.getDirectiveRequire(this.directive),requiredControllers=this.resolveRequire(this.directive.name,this.$element,directiveRequire);if(this.directive.bindToController&&isMap(directiveRequire)){var requiredControllersMap_1=requiredControllers;Object.keys(requiredControllersMap_1).forEach(function(key){_this.controllerInstance[key]=requiredControllersMap_1[key]})}if(this.pendingChanges&&(this.forwardChanges(this.pendingChanges),this.pendingChanges=null),this.controllerInstance&&isFunction(this.controllerInstance.$onInit)&&this.controllerInstance.$onInit(),this.controllerInstance&&isFunction(this.controllerInstance.$doCheck)){var callDoCheck=function(){return _this.controllerInstance.$doCheck()};this.unregisterDoCheckWatcher=this.$componentScope.$parent.$watch(callDoCheck),callDoCheck()}var link=this.directive.link,preLink="object"==typeof link&&link.pre,postLink="object"==typeof link?link.post:link,attrs=NOT_SUPPORTED,transcludeFn=NOT_SUPPORTED;preLink&&preLink(this.$componentScope,this.$element,attrs,requiredControllers,transcludeFn);var attachChildNodes=function(scope,cloneAttach){return cloneAttach(contentChildNodes)};linkFn(this.$componentScope,null,{parentBoundTranscludeFn:attachChildNodes}),postLink&&postLink(this.$componentScope,this.$element,attrs,requiredControllers,transcludeFn),this.controllerInstance&&isFunction(this.controllerInstance.$postLink)&&this.controllerInstance.$postLink()},UpgradeComponent.prototype.ngOnChanges=function(changes){this.bindingDestination?this.forwardChanges(changes):this.pendingChanges=changes},UpgradeComponent.prototype.ngDoCheck=function(){var _this=this,twoWayBoundProperties=this.bindings.twoWayBoundProperties,twoWayBoundLastValues=this.bindings.twoWayBoundLastValues,propertyToOutputMap=this.bindings.propertyToOutputMap;twoWayBoundProperties.forEach(function(propName,idx){var newValue=_this.bindingDestination[propName],oldValue=twoWayBoundLastValues[idx];if(!_angular_core.ɵlooseIdentical(newValue,oldValue)){var outputName=propertyToOutputMap[propName],eventEmitter=_this[outputName];eventEmitter.emit(newValue),twoWayBoundLastValues[idx]=newValue}})},UpgradeComponent.prototype.ngOnDestroy=function(){isFunction(this.unregisterDoCheckWatcher)&&this.unregisterDoCheckWatcher(),this.controllerInstance&&isFunction(this.controllerInstance.$onDestroy)&&this.controllerInstance.$onDestroy(),this.$componentScope.$destroy()},UpgradeComponent.prototype.getDirective=function(name){var directives=this.$injector.get(name+"Directive");if(directives.length>1)throw new Error("Only support single directive definition for: "+this.name);var directive=directives[0];directive.replace&&this.notSupported("replace"),directive.terminal&&this.notSupported("terminal"),directive.compile&&this.notSupported("compile");var link=directive.link;return"object"==typeof link&&link.post&&this.notSupported("link.post"),directive},UpgradeComponent.prototype.getDirectiveRequire=function(directive){var require=directive.require||directive.controller&&directive.name;return isMap(require)&&Object.keys(require).forEach(function(key){var value=require[key],match=value.match(REQUIRE_PREFIX_RE),name=value.substring(match[0].length);name||(require[key]=match[0]+key)}),require},UpgradeComponent.prototype.initializeBindings=function(directive){var _this=this,btcIsObject="object"==typeof directive.bindToController;if(btcIsObject&&Object.keys(directive.scope).length)throw new Error("Binding definitions on scope and controller at the same time is not supported.");var context=btcIsObject?directive.bindToController:directive.scope,bindings=new Bindings;return"object"==typeof context&&Object.keys(context).forEach(function(propName){var definition=context[propName],bindingType=definition.charAt(0);switch(bindingType){case"@":case"<":break;case"=":bindings.twoWayBoundProperties.push(propName),bindings.twoWayBoundLastValues.push(INITIAL_VALUE$1),bindings.propertyToOutputMap[propName]=propName+"Change";break;case"&":bindings.expressionBoundProperties.push(propName),bindings.propertyToOutputMap[propName]=propName;break;default:var json=JSON.stringify(context);throw new Error("Unexpected mapping '"+bindingType+"' in '"+json+"' in '"+_this.name+"' directive.")}}),bindings},UpgradeComponent.prototype.extractChildNodes=function(element){for(var childNode,childNodes=[];childNode=element.firstChild;)element.removeChild(childNode),childNodes.push(childNode);return childNodes},UpgradeComponent.prototype.compileTemplate=function(directive){if(void 0!==this.directive.template)return this.compileHtml(getOrCall(this.directive.template));if(this.directive.templateUrl){var url=getOrCall(this.directive.templateUrl),html=this.$templateCache.get(url);if(void 0!==html)return this.compileHtml(html);throw new Error("loading directive templates asynchronously is not supported")}throw new Error("Directive '"+this.name+"' is not a component, it is missing template.")},UpgradeComponent.prototype.buildController=function(controllerType,$scope,$element,controllerAs){var locals={$scope:$scope,$element:$element},controller=this.$controller(controllerType,locals,null,controllerAs);return $element.data(controllerKey(this.directive.name),controller),controller},UpgradeComponent.prototype.resolveRequire=function(directiveName,$element,require){var _this=this;if(require){if(Array.isArray(require))return require.map(function(req){return _this.resolveRequire(directiveName,$element,req)});if("object"==typeof require){var value_1={};return Object.keys(require).forEach(function(key){return value_1[key]=_this.resolveRequire(directiveName,$element,require[key])}),value_1}if("string"==typeof require){var match=require.match(REQUIRE_PREFIX_RE),inheritType=match[1]||match[3],name_1=require.substring(match[0].length),isOptional=!!match[2],searchParents=!!inheritType,startOnParent="^^"===inheritType,ctrlKey=controllerKey(name_1);startOnParent&&($element=$element.parent());var value=searchParents?$element.inheritedData(ctrlKey):$element.data(ctrlKey);if(!value&&!isOptional)throw new Error("Unable to find required '"+require+"' in upgraded directive '"+directiveName+"'.");return value}throw new Error("Unrecognized require syntax on upgraded directive '"+directiveName+"': "+require)}return null},UpgradeComponent.prototype.initializeOutputs=function(){var _this=this;this.bindings.twoWayBoundProperties.concat(this.bindings.expressionBoundProperties).forEach(function(propName){var outputName=_this.bindings.propertyToOutputMap[propName];_this[outputName]=new _angular_core.EventEmitter})},UpgradeComponent.prototype.bindOutputs=function(){var _this=this;this.bindings.expressionBoundProperties.forEach(function(propName){var outputName=_this.bindings.propertyToOutputMap[propName],emitter=_this[outputName];_this.bindingDestination[propName]=function(value){return emitter.emit(value)}})},UpgradeComponent.prototype.forwardChanges=function(changes){var _this=this;Object.keys(changes).forEach(function(propName){return _this.bindingDestination[propName]=changes[propName].currentValue}),isFunction(this.bindingDestination.$onChanges)&&this.bindingDestination.$onChanges(changes)},UpgradeComponent.prototype.notSupported=function(feature){throw new Error("Upgraded directive '"+this.name+"' contains unsupported feature: '"+feature+"'.")},UpgradeComponent.prototype.compileHtml=function(html){return this.element.innerHTML=html,this.$compile(this.element.childNodes)},UpgradeComponent}(),angular1Providers=[{provide:"$injector",useFactory:injectorFactory},{provide:"$rootScope",useFactory:rootScopeFactory,deps:["$injector"]},{provide:"$compile",useFactory:compileFactory,deps:["$injector"]},{provide:"$parse",useFactory:parseFactory,deps:["$injector"]}],UpgradeModule=function(){function UpgradeModule(injector,ngZone){this.injector=injector,this.ngZone=ngZone}return UpgradeModule.prototype.bootstrap=function(element$$,modules,config){var _this=this;void 0===modules&&(modules=[]);var INIT_MODULE_NAME=UPGRADE_MODULE_NAME+".init",upgradeModule=(module$1(INIT_MODULE_NAME,[]).value(INJECTOR_KEY,this.injector).config([$PROVIDE,$INJECTOR,function($provide,$injector){$injector.has($$TESTABILITY)&&$provide.decorator($$TESTABILITY,[$DELEGATE,function(testabilityDelegate){var originalWhenStable=testabilityDelegate.whenStable,injector=_this.injector,newWhenStable=function(callback){originalWhenStable.call(testabilityDelegate,function(){var ng2Testability=injector.get(_angular_core.Testability);ng2Testability.isStable()?callback():ng2Testability.whenStable(newWhenStable.bind(testabilityDelegate,callback))})};return testabilityDelegate.whenStable=newWhenStable,testabilityDelegate}])}]).run([$INJECTOR,function($injector){_this.$injector=$injector,setTempInjectorRef($injector),_this.injector.get($INJECTOR),element(element$$).data(controllerKey(INJECTOR_KEY),_this.injector),setTimeout(function(){var $rootScope=$injector.get("$rootScope"),subscription=_this.ngZone.onMicrotaskEmpty.subscribe(function(){return $rootScope.$digest()});$rootScope.$on("$destroy",function(){subscription.unsubscribe()})},0)}]),module$1(UPGRADE_MODULE_NAME,[INIT_MODULE_NAME].concat(modules))),windowAngular=window.angular;if(windowAngular.resumeBootstrap=void 0,this.ngZone.run(function(){bootstrap(element$$,[upgradeModule.name],config)}),windowAngular.resumeBootstrap){var originalResumeBootstrap_1=windowAngular.resumeBootstrap,ngZone_1=this.ngZone;windowAngular.resumeBootstrap=function(){var _this=this,args=arguments;windowAngular.resumeBootstrap=originalResumeBootstrap_1,ngZone_1.run(function(){windowAngular.resumeBootstrap.apply(_this,args)})}}},UpgradeModule}();UpgradeModule.decorators=[{type:_angular_core.NgModule,args:[{providers:[angular1Providers,ContentProjectionHelper]}]}],UpgradeModule.ctorParameters=function(){return[{type:_angular_core.Injector},{type:_angular_core.NgZone}]},exports.downgradeComponent=downgradeComponent,exports.downgradeInjectable=downgradeInjectable,exports.VERSION=VERSION,exports.UpgradeComponent=UpgradeComponent,exports.UpgradeModule=UpgradeModule});
var TagContentType,$COMPILE="$compile",$CONTROLLER="$controller",$DELEGATE="$delegate",$HTTP_BACKEND="$httpBackend",$INJECTOR="$injector",$PARSE="$parse",$PROVIDE="$provide",$SCOPE="$scope",$TEMPLATE_CACHE="$templateCache",$$TESTABILITY="$$testability",INJECTOR_KEY="$$angularInjector",REQUIRE_INJECTOR="?^^"+INJECTOR_KEY,REQUIRE_NG_MODEL="?ngModel",UPGRADE_MODULE_NAME="$$UpgradeModule";!function(TagContentType){TagContentType[TagContentType.RAW_TEXT=0]="RAW_TEXT",TagContentType[TagContentType.ESCAPABLE_RAW_TEXT=1]="ESCAPABLE_RAW_TEXT",TagContentType[TagContentType.PARSABLE_DATA=2]="PARSABLE_DATA"}(TagContentType||(TagContentType={}));var HtmlTagDefinition=function(){function HtmlTagDefinition(_a){var _b=void 0===_a?{}:_a,closedByChildren=_b.closedByChildren,requiredParents=_b.requiredParents,implicitNamespacePrefix=_b.implicitNamespacePrefix,_c=_b.contentType,contentType=void 0===_c?TagContentType.PARSABLE_DATA:_c,_d=_b.closedByParent,closedByParent=void 0!==_d&&_d,_e=_b.isVoid,isVoid=void 0!==_e&&_e,_f=_b.ignoreFirstLf,ignoreFirstLf=void 0!==_f&&_f,_this=this;this.closedByChildren={},this.closedByParent=!1,this.canSelfClose=!1,closedByChildren&&closedByChildren.length>0&&closedByChildren.forEach(function(tagName){return _this.closedByChildren[tagName]=!0}),this.isVoid=isVoid,this.closedByParent=closedByParent||isVoid,requiredParents&&requiredParents.length>0&&(this.requiredParents={},this.parentToAdd=requiredParents[0],requiredParents.forEach(function(tagName){return _this.requiredParents[tagName]=!0})),this.implicitNamespacePrefix=implicitNamespacePrefix,this.contentType=contentType,this.ignoreFirstLf=ignoreFirstLf}return HtmlTagDefinition.prototype.requireExtraParent=function(currentParent){if(!this.requiredParents)return!1;if(!currentParent)return!0;var lcParent=currentParent.toLowerCase(),isParentTemplate="template"===lcParent||"ng-template"===currentParent;return!isParentTemplate&&1!=this.requiredParents[lcParent]},HtmlTagDefinition.prototype.isClosedByChild=function(name){return this.isVoid||name.toLowerCase()in this.closedByChildren},HtmlTagDefinition}(),TAG_DEFINITIONS={base:new HtmlTagDefinition({isVoid:!0}),meta:new HtmlTagDefinition({isVoid:!0}),area:new HtmlTagDefinition({isVoid:!0}),embed:new HtmlTagDefinition({isVoid:!0}),link:new HtmlTagDefinition({isVoid:!0}),img:new HtmlTagDefinition({isVoid:!0}),input:new HtmlTagDefinition({isVoid:!0}),param:new HtmlTagDefinition({isVoid:!0}),hr:new HtmlTagDefinition({isVoid:!0}),br:new HtmlTagDefinition({isVoid:!0}),source:new HtmlTagDefinition({isVoid:!0}),track:new HtmlTagDefinition({isVoid:!0}),wbr:new HtmlTagDefinition({isVoid:!0}),p:new HtmlTagDefinition({closedByChildren:["address","article","aside","blockquote","div","dl","fieldset","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","main","nav","ol","p","pre","section","table","ul"],closedByParent:!0}),thead:new HtmlTagDefinition({closedByChildren:["tbody","tfoot"]}),tbody:new HtmlTagDefinition({closedByChildren:["tbody","tfoot"],closedByParent:!0}),tfoot:new HtmlTagDefinition({closedByChildren:["tbody"],closedByParent:!0}),tr:new HtmlTagDefinition({closedByChildren:["tr"],requiredParents:["tbody","tfoot","thead"],closedByParent:!0}),td:new HtmlTagDefinition({closedByChildren:["td","th"],closedByParent:!0}),th:new HtmlTagDefinition({closedByChildren:["td","th"],closedByParent:!0}),col:new HtmlTagDefinition({requiredParents:["colgroup"],isVoid:!0}),svg:new HtmlTagDefinition({implicitNamespacePrefix:"svg"}),math:new HtmlTagDefinition({implicitNamespacePrefix:"math"}),li:new HtmlTagDefinition({closedByChildren:["li"],closedByParent:!0}),dt:new HtmlTagDefinition({closedByChildren:["dt","dd"]}),dd:new HtmlTagDefinition({closedByChildren:["dt","dd"],closedByParent:!0}),rb:new HtmlTagDefinition({closedByChildren:["rb","rt","rtc","rp"],closedByParent:!0}),rt:new HtmlTagDefinition({closedByChildren:["rb","rt","rtc","rp"],closedByParent:!0}),rtc:new HtmlTagDefinition({closedByChildren:["rb","rtc","rp"],closedByParent:!0}),rp:new HtmlTagDefinition({closedByChildren:["rb","rt","rtc","rp"],closedByParent:!0}),optgroup:new HtmlTagDefinition({closedByChildren:["optgroup"],closedByParent:!0}),option:new HtmlTagDefinition({closedByChildren:["option","optgroup"],closedByParent:!0}),pre:new HtmlTagDefinition({ignoreFirstLf:!0}),listing:new HtmlTagDefinition({ignoreFirstLf:!0}),style:new HtmlTagDefinition({contentType:TagContentType.RAW_TEXT}),script:new HtmlTagDefinition({contentType:TagContentType.RAW_TEXT}),title:new HtmlTagDefinition({contentType:TagContentType.ESCAPABLE_RAW_TEXT}),textarea:new HtmlTagDefinition({contentType:TagContentType.ESCAPABLE_RAW_TEXT,ignoreFirstLf:!0})},_DEFAULT_TAG_DEFINITION=new HtmlTagDefinition,_SELECTOR_REGEXP=new RegExp("(\\:not\\()|([-\\w]+)|(?:\\.([-\\w]+))|(?:\\[([-.\\w*]+)(?:=([^\\]]*))?\\])|(\\))|(\\s*,\\s*)","g"),CssSelector=function(){function CssSelector(){this.element=null,this.classNames=[],this.attrs=[],this.notSelectors=[]}return CssSelector.parse=function(selector){var match,results=[],_addResult=function(res,cssSel){cssSel.notSelectors.length>0&&!cssSel.element&&0==cssSel.classNames.length&&0==cssSel.attrs.length&&(cssSel.element="*"),res.push(cssSel)},cssSelector=new CssSelector,current=cssSelector,inNot=!1;for(_SELECTOR_REGEXP.lastIndex=0;match=_SELECTOR_REGEXP.exec(selector);){if(match[1]){if(inNot)throw new Error("Nesting :not is not allowed in a selector");inNot=!0,current=new CssSelector,cssSelector.notSelectors.push(current)}if(match[2]&&current.setElement(match[2]),match[3]&&current.addClassName(match[3]),match[4]&&current.addAttribute(match[4],match[5]),match[6]&&(inNot=!1,current=cssSelector),match[7]){if(inNot)throw new Error("Multiple selectors in :not are not supported");_addResult(results,cssSelector),cssSelector=current=new CssSelector}}return _addResult(results,cssSelector),results},CssSelector.prototype.isElementSelector=function(){return this.hasElementSelector()&&0==this.classNames.length&&0==this.attrs.length&&0===this.notSelectors.length},CssSelector.prototype.hasElementSelector=function(){return!!this.element},CssSelector.prototype.setElement=function(element){void 0===element&&(element=null),this.element=element},CssSelector.prototype.getMatchingElementTemplate=function(){for(var tagName=this.element||"div",classAttr=this.classNames.length>0?' class="'+this.classNames.join(" ")+'"':"",attrs="",i=0;i<this.attrs.length;i+=2){var attrName=this.attrs[i],attrValue=""!==this.attrs[i+1]?'="'+this.attrs[i+1]+'"':"";attrs+=" "+attrName+attrValue}return getHtmlTagDefinition(tagName).isVoid?"<"+tagName+classAttr+attrs+"/>":"<"+tagName+classAttr+attrs+"></"+tagName+">"},CssSelector.prototype.addAttribute=function(name,value){void 0===value&&(value=""),this.attrs.push(name,value&&value.toLowerCase()||"")},CssSelector.prototype.addClassName=function(name){this.classNames.push(name.toLowerCase())},CssSelector.prototype.toString=function(){var res=this.element||"";if(this.classNames&&this.classNames.forEach(function(klass){return res+="."+klass}),this.attrs)for(var i=0;i<this.attrs.length;i+=2){var name_1=this.attrs[i],value=this.attrs[i+1];res+="["+name_1+(value?"="+value:"")+"]"}return this.notSelectors.forEach(function(notSelector){return res+=":not("+notSelector+")"}),res},CssSelector}(),SelectorMatcher=function(){function SelectorMatcher(){this._elementMap=new Map,this._elementPartialMap=new Map,this._classMap=new Map,this._classPartialMap=new Map,this._attrValueMap=new Map,this._attrValuePartialMap=new Map,this._listContexts=[]}return SelectorMatcher.createNotMatcher=function(notSelectors){var notMatcher=new SelectorMatcher;return notMatcher.addSelectables(notSelectors,null),notMatcher},SelectorMatcher.prototype.addSelectables=function(cssSelectors,callbackCtxt){var listContext=null;cssSelectors.length>1&&(listContext=new SelectorListContext(cssSelectors),this._listContexts.push(listContext));for(var i=0;i<cssSelectors.length;i++)this._addSelectable(cssSelectors[i],callbackCtxt,listContext)},SelectorMatcher.prototype._addSelectable=function(cssSelector,callbackCtxt,listContext){var matcher=this,element=cssSelector.element,classNames=cssSelector.classNames,attrs=cssSelector.attrs,selectable=new SelectorContext(cssSelector,callbackCtxt,listContext);if(element){var isTerminal=0===attrs.length&&0===classNames.length;isTerminal?this._addTerminal(matcher._elementMap,element,selectable):matcher=this._addPartial(matcher._elementPartialMap,element)}if(classNames)for(var i=0;i<classNames.length;i++){var isTerminal=0===attrs.length&&i===classNames.length-1,className=classNames[i];isTerminal?this._addTerminal(matcher._classMap,className,selectable):matcher=this._addPartial(matcher._classPartialMap,className)}if(attrs)for(var i=0;i<attrs.length;i+=2){var isTerminal=i===attrs.length-2,name_2=attrs[i],value=attrs[i+1];if(isTerminal){var terminalMap=matcher._attrValueMap,terminalValuesMap=terminalMap.get(name_2);terminalValuesMap||(terminalValuesMap=new Map,terminalMap.set(name_2,terminalValuesMap)),this._addTerminal(terminalValuesMap,value,selectable)}else{var partialMap=matcher._attrValuePartialMap,partialValuesMap=partialMap.get(name_2);partialValuesMap||(partialValuesMap=new Map,partialMap.set(name_2,partialValuesMap)),matcher=this._addPartial(partialValuesMap,value)}}},SelectorMatcher.prototype._addTerminal=function(map,name,selectable){var terminalList=map.get(name);terminalList||(terminalList=[],map.set(name,terminalList)),terminalList.push(selectable)},SelectorMatcher.prototype._addPartial=function(map,name){var matcher=map.get(name);return matcher||(matcher=new SelectorMatcher,map.set(name,matcher)),matcher},SelectorMatcher.prototype.match=function(cssSelector,matchedCallback){for(var result=!1,element=cssSelector.element,classNames=cssSelector.classNames,attrs=cssSelector.attrs,i=0;i<this._listContexts.length;i++)this._listContexts[i].alreadyMatched=!1;if(result=this._matchTerminal(this._elementMap,element,cssSelector,matchedCallback)||result,result=this._matchPartial(this._elementPartialMap,element,cssSelector,matchedCallback)||result,classNames)for(var i=0;i<classNames.length;i++){var className=classNames[i];result=this._matchTerminal(this._classMap,className,cssSelector,matchedCallback)||result,result=this._matchPartial(this._classPartialMap,className,cssSelector,matchedCallback)||result}if(attrs)for(var i=0;i<attrs.length;i+=2){var name_3=attrs[i],value=attrs[i+1],terminalValuesMap=this._attrValueMap.get(name_3);value&&(result=this._matchTerminal(terminalValuesMap,"",cssSelector,matchedCallback)||result),result=this._matchTerminal(terminalValuesMap,value,cssSelector,matchedCallback)||result;var partialValuesMap=this._attrValuePartialMap.get(name_3);value&&(result=this._matchPartial(partialValuesMap,"",cssSelector,matchedCallback)||result),result=this._matchPartial(partialValuesMap,value,cssSelector,matchedCallback)||result}return result},SelectorMatcher.prototype._matchTerminal=function(map,name,cssSelector,matchedCallback){if(!map||"string"!=typeof name)return!1;var selectables=map.get(name)||[],starSelectables=map.get("*");if(starSelectables&&(selectables=selectables.concat(starSelectables)),0===selectables.length)return!1;for(var selectable,result=!1,i=0;i<selectables.length;i++)selectable=selectables[i],result=selectable.finalize(cssSelector,matchedCallback)||result;return result},SelectorMatcher.prototype._matchPartial=function(map,name,cssSelector,matchedCallback){if(!map||"string"!=typeof name)return!1;var nestedSelector=map.get(name);return!!nestedSelector&&nestedSelector.match(cssSelector,matchedCallback)},SelectorMatcher}(),SelectorListContext=function(){function SelectorListContext(selectors){this.selectors=selectors,this.alreadyMatched=!1}return SelectorListContext}(),SelectorContext=function(){function SelectorContext(selector,cbContext,listContext){this.selector=selector,this.cbContext=cbContext,this.listContext=listContext,this.notSelectors=selector.notSelectors}return SelectorContext.prototype.finalize=function(cssSelector,callback){var result=!0;if(this.notSelectors.length>0&&(!this.listContext||!this.listContext.alreadyMatched)){var notMatcher=SelectorMatcher.createNotMatcher(this.notSelectors);result=!notMatcher.match(cssSelector,null)}return!result||!callback||this.listContext&&this.listContext.alreadyMatched||(this.listContext&&(this.listContext.alreadyMatched=!0),callback(this.selector,this.cbContext)),result},SelectorContext}(),CLASS_ATTR="class",PropertyBinding=function(){function PropertyBinding(binding){this.binding=binding,this.parseBinding()}return PropertyBinding.prototype.parseBinding=function(){var parts=this.binding.split(":");this.prop=parts[0].trim(),this.attr=(parts[1]||this.prop).trim(),this.bracketAttr="["+this.attr+"]",this.parenAttr="("+this.attr+")",this.bracketParenAttr="[("+this.attr+")]";var capitalAttr=this.attr.charAt(0).toUpperCase()+this.attr.substr(1);this.onAttr="on"+capitalAttr,this.bindAttr="bind"+capitalAttr,this.bindonAttr="bindon"+capitalAttr},PropertyBinding}(),NgContentSelectorHelper=function(){function NgContentSelectorHelper(){}return NgContentSelectorHelper.prototype.getNgContentSelectors=function(info){return info.selectors||["*"]},NgContentSelectorHelper}(),INITIAL_VALUE={__UNINITIALIZED__:!0},DowngradeComponentAdapter=function(){function DowngradeComponentAdapter(id,info,element,attrs,scope,ngModel,parentInjector,$injector,$compile,$parse,componentFactory){this.id=id,this.info=info,this.element=element,this.attrs=attrs,this.scope=scope,this.ngModel=ngModel,this.parentInjector=parentInjector,this.$injector=$injector,this.$compile=$compile,this.$parse=$parse,this.componentFactory=componentFactory,this.inputChangeCount=0,this.inputChanges=null,this.componentRef=null,this.component=null,this.changeDetector=null,this.element[0].id=id,this.componentScope=scope.$new()}return DowngradeComponentAdapter.prototype.compileContents=function(){var _this=this,compiledProjectableNodes=[],projectableNodes=this.groupProjectableNodes(),linkFns=projectableNodes.map(function(nodes){return _this.$compile(nodes)});return this.element.empty(),linkFns.forEach(function(linkFn){linkFn(_this.scope,function(clone){compiledProjectableNodes.push(clone),_this.element.append(clone)})}),compiledProjectableNodes},DowngradeComponentAdapter.prototype.createComponent=function(projectableNodes){var childInjector=_angular_core.ReflectiveInjector.resolveAndCreate([{provide:$SCOPE,useValue:this.componentScope}],this.parentInjector);this.componentRef=this.componentFactory.create(childInjector,projectableNodes,this.element[0]),this.changeDetector=this.componentRef.changeDetectorRef,this.component=this.componentRef.instance,hookupNgModel(this.ngModel,this.component)},DowngradeComponentAdapter.prototype.setupInputs=function(){for(var _this=this,attrs=this.attrs,inputs=this.info.inputs||[],i=0;i<inputs.length;i++){var input=new PropertyBinding(inputs[i]),expr=null;if(attrs.hasOwnProperty(input.attr)){var observeFn=function(prop){var prevValue=INITIAL_VALUE;return function(currValue){prevValue===INITIAL_VALUE&&(prevValue=currValue),_this.updateInput(prop,prevValue,currValue),prevValue=currValue}}(input.prop);attrs.$observe(input.attr,observeFn)}else attrs.hasOwnProperty(input.bindAttr)?expr=attrs[input.bindAttr]:attrs.hasOwnProperty(input.bracketAttr)?expr=attrs[input.bracketAttr]:attrs.hasOwnProperty(input.bindonAttr)?expr=attrs[input.bindonAttr]:attrs.hasOwnProperty(input.bracketParenAttr)&&(expr=attrs[input.bracketParenAttr]);if(null!=expr){var watchFn=function(prop){return function(currValue,prevValue){return _this.updateInput(prop,prevValue,currValue)}}(input.prop);this.componentScope.$watch(expr,watchFn)}}var prototype=this.info.component.prototype;prototype&&prototype.ngOnChanges&&(this.inputChanges={},this.componentScope.$watch(function(){return _this.inputChangeCount},function(){var inputChanges=_this.inputChanges;_this.inputChanges={},_this.component.ngOnChanges(inputChanges)})),this.componentScope.$watch(function(){return _this.changeDetector&&_this.changeDetector.detectChanges()})},DowngradeComponentAdapter.prototype.setupOutputs=function(){for(var _this=this,attrs=this.attrs,outputs=this.info.outputs||[],j=0;j<outputs.length;j++){var output=new PropertyBinding(outputs[j]),expr=null,assignExpr=!1,bindonAttr=output.bindonAttr?output.bindonAttr.substring(0,output.bindonAttr.length-6):null,bracketParenAttr=output.bracketParenAttr?"[("+output.bracketParenAttr.substring(2,output.bracketParenAttr.length-8)+")]":null;if(attrs.hasOwnProperty(output.onAttr)?expr=attrs[output.onAttr]:attrs.hasOwnProperty(output.parenAttr)?expr=attrs[output.parenAttr]:attrs.hasOwnProperty(bindonAttr)?(expr=attrs[bindonAttr],assignExpr=!0):attrs.hasOwnProperty(bracketParenAttr)&&(expr=attrs[bracketParenAttr],assignExpr=!0),null!=expr&&null!=assignExpr){var getter=this.$parse(expr),setter=getter.assign;if(assignExpr&&!setter)throw new Error("Expression '"+expr+"' is not assignable!");var emitter=this.component[output.prop];if(!emitter)throw new Error("Missing emitter '"+output.prop+"' on component '"+getComponentName(this.info.component)+"'!");emitter.subscribe({next:assignExpr?function(setter){return function(v){return setter(_this.scope,v)}}(setter):function(getter){return function(v){return getter(_this.scope,{$event:v})}}(getter)})}}},DowngradeComponentAdapter.prototype.registerCleanup=function(){var _this=this;this.element.bind("$destroy",function(){_this.componentScope.$destroy(),_this.componentRef.destroy()})},DowngradeComponentAdapter.prototype.getInjector=function(){return this.componentRef&&this.componentRef.injector},DowngradeComponentAdapter.prototype.updateInput=function(prop,prevValue,currValue){this.inputChanges&&(this.inputChangeCount++,this.inputChanges[prop]=new _angular_core.SimpleChange(prevValue,currValue,prevValue===currValue)),this.component[prop]=currValue},DowngradeComponentAdapter.prototype.groupProjectableNodes=function(){var ngContentSelectorHelper=this.parentInjector.get(NgContentSelectorHelper),ngContentSelectors=ngContentSelectorHelper.getNgContentSelectors(this.info);if(!ngContentSelectors)throw new Error("Expecting ngContentSelectors for: "+getComponentName(this.info.component));return this._groupNodesBySelector(ngContentSelectors,this.element.contents())},DowngradeComponentAdapter.prototype._groupNodesBySelector=function(ngContentSelectors,nodes){for(var wildcardNgContentIndex,projectableNodes=[],matcher=new SelectorMatcher,i=0,ii=ngContentSelectors.length;i<ii;++i){projectableNodes[i]=[];var selector=ngContentSelectors[i];"*"===selector?wildcardNgContentIndex=i:matcher.addSelectables(CssSelector.parse(selector),i)}for(var _loop_1=function(j,jj){var ngContentIndices=[],node=nodes[j],selector=createElementCssSelector(node.nodeName.toLowerCase(),getAttributesAsArray(node));matcher.match(selector,function(_,index){return ngContentIndices.push(index)}),ngContentIndices.sort(),void 0!==wildcardNgContentIndex&&ngContentIndices.push(wildcardNgContentIndex),ngContentIndices.length&&projectableNodes[ngContentIndices[0]].push(node)},j=0,jj=nodes.length;j<jj;++j)_loop_1(j,jj);return projectableNodes},DowngradeComponentAdapter}(),downgradeCount=0,ParentInjectorPromise=function(){function ParentInjectorPromise(element){this.element=element,this.injectorKey=controllerKey(INJECTOR_KEY),this.callbacks=[],element.data(this.injectorKey,this)}return ParentInjectorPromise.prototype.then=function(callback){this.injector?callback(this.injector):this.callbacks.push(callback)},ParentInjectorPromise.prototype.resolve=function(injector){this.injector=injector,this.element.data(this.injectorKey,injector),this.element=null,this.callbacks.forEach(function(callback){return callback(injector)}),this.callbacks.length=0},ParentInjectorPromise}(),VERSION=new _angular_core.Version("4.0.0-rc.4"),angular={bootstrap:noNg,module:noNg,element:noNg,version:noNg,resumeBootstrap:noNg,getTestability:noNg};try{window.hasOwnProperty("angular")&&(angular=window.angular)}catch(e){}var tempInjectorRef,bootstrap=angular.bootstrap,module$1=angular.module,element=angular.element,REQUIRE_PREFIX_RE=/^(\^\^?)?(\?)?(\^\^?)?/,NOT_SUPPORTED="NOT_SUPPORTED",INITIAL_VALUE$1={__UNINITIALIZED__:!0},Bindings=function(){function Bindings(){this.twoWayBoundProperties=[],this.twoWayBoundLastValues=[],this.expressionBoundProperties=[],this.propertyToOutputMap={}}return Bindings}(),UpgradeComponent=function(){function UpgradeComponent(name,elementRef,injector){this.name=name,this.elementRef=elementRef,this.injector=injector,this.$injector=injector.get($INJECTOR),this.$compile=this.$injector.get($COMPILE),this.$templateCache=this.$injector.get($TEMPLATE_CACHE),this.$httpBackend=this.$injector.get($HTTP_BACKEND),this.$controller=this.$injector.get($CONTROLLER),this.element=elementRef.nativeElement,this.$element=element(this.element),this.directive=this.getDirective(name),this.bindings=this.initializeBindings(this.directive);var $parentScope=injector.get($SCOPE);this.$componentScope=$parentScope.$new(!!this.directive.scope),this.initializeOutputs()}return UpgradeComponent.prototype.ngOnInit=function(){var _this=this,contentChildNodes=this.extractChildNodes(this.element),linkFn=this.compileTemplate(this.directive),controllerType=this.directive.controller,bindToController=this.directive.bindToController;if(controllerType)this.controllerInstance=this.buildController(controllerType,this.$componentScope,this.$element,this.directive.controllerAs);else if(bindToController)throw new Error("Upgraded directive '"+this.directive.name+"' specifies 'bindToController' but no controller.");this.bindingDestination=bindToController?this.controllerInstance:this.$componentScope,this.bindOutputs();var directiveRequire=this.getDirectiveRequire(this.directive),requiredControllers=this.resolveRequire(this.directive.name,this.$element,directiveRequire);if(this.directive.bindToController&&isMap(directiveRequire)){var requiredControllersMap_1=requiredControllers;Object.keys(requiredControllersMap_1).forEach(function(key){_this.controllerInstance[key]=requiredControllersMap_1[key]})}if(this.pendingChanges&&(this.forwardChanges(this.pendingChanges),this.pendingChanges=null),this.controllerInstance&&isFunction(this.controllerInstance.$onInit)&&this.controllerInstance.$onInit(),this.controllerInstance&&isFunction(this.controllerInstance.$doCheck)){var callDoCheck=function(){return _this.controllerInstance.$doCheck()};this.unregisterDoCheckWatcher=this.$componentScope.$parent.$watch(callDoCheck),callDoCheck()}var link=this.directive.link,preLink="object"==typeof link&&link.pre,postLink="object"==typeof link?link.post:link,attrs=NOT_SUPPORTED,transcludeFn=NOT_SUPPORTED;preLink&&preLink(this.$componentScope,this.$element,attrs,requiredControllers,transcludeFn);var attachChildNodes=function(scope,cloneAttach){return cloneAttach(contentChildNodes)};linkFn(this.$componentScope,null,{parentBoundTranscludeFn:attachChildNodes}),postLink&&postLink(this.$componentScope,this.$element,attrs,requiredControllers,transcludeFn),this.controllerInstance&&isFunction(this.controllerInstance.$postLink)&&this.controllerInstance.$postLink()},UpgradeComponent.prototype.ngOnChanges=function(changes){this.bindingDestination?this.forwardChanges(changes):this.pendingChanges=changes},UpgradeComponent.prototype.ngDoCheck=function(){var _this=this,twoWayBoundProperties=this.bindings.twoWayBoundProperties,twoWayBoundLastValues=this.bindings.twoWayBoundLastValues,propertyToOutputMap=this.bindings.propertyToOutputMap;twoWayBoundProperties.forEach(function(propName,idx){var newValue=_this.bindingDestination[propName],oldValue=twoWayBoundLastValues[idx];if(!_angular_core.ɵlooseIdentical(newValue,oldValue)){var outputName=propertyToOutputMap[propName],eventEmitter=_this[outputName];eventEmitter.emit(newValue),twoWayBoundLastValues[idx]=newValue}})},UpgradeComponent.prototype.ngOnDestroy=function(){isFunction(this.unregisterDoCheckWatcher)&&this.unregisterDoCheckWatcher(),this.controllerInstance&&isFunction(this.controllerInstance.$onDestroy)&&this.controllerInstance.$onDestroy(),this.$componentScope.$destroy()},UpgradeComponent.prototype.getDirective=function(name){var directives=this.$injector.get(name+"Directive");if(directives.length>1)throw new Error("Only support single directive definition for: "+this.name);var directive=directives[0];directive.replace&&this.notSupported("replace"),directive.terminal&&this.notSupported("terminal"),directive.compile&&this.notSupported("compile");var link=directive.link;return"object"==typeof link&&link.post&&this.notSupported("link.post"),directive},UpgradeComponent.prototype.getDirectiveRequire=function(directive){var require=directive.require||directive.controller&&directive.name;return isMap(require)&&Object.keys(require).forEach(function(key){var value=require[key],match=value.match(REQUIRE_PREFIX_RE),name=value.substring(match[0].length);name||(require[key]=match[0]+key)}),require},UpgradeComponent.prototype.initializeBindings=function(directive){var _this=this,btcIsObject="object"==typeof directive.bindToController;if(btcIsObject&&Object.keys(directive.scope).length)throw new Error("Binding definitions on scope and controller at the same time is not supported.");var context=btcIsObject?directive.bindToController:directive.scope,bindings=new Bindings;return"object"==typeof context&&Object.keys(context).forEach(function(propName){var definition=context[propName],bindingType=definition.charAt(0);switch(bindingType){case"@":case"<":break;case"=":bindings.twoWayBoundProperties.push(propName),bindings.twoWayBoundLastValues.push(INITIAL_VALUE$1),bindings.propertyToOutputMap[propName]=propName+"Change";break;case"&":bindings.expressionBoundProperties.push(propName),bindings.propertyToOutputMap[propName]=propName;break;default:var json=JSON.stringify(context);throw new Error("Unexpected mapping '"+bindingType+"' in '"+json+"' in '"+_this.name+"' directive.")}}),bindings},UpgradeComponent.prototype.extractChildNodes=function(element){for(var childNode,childNodes=[];childNode=element.firstChild;)element.removeChild(childNode),childNodes.push(childNode);return childNodes},UpgradeComponent.prototype.compileTemplate=function(directive){if(void 0!==this.directive.template)return this.compileHtml(getOrCall(this.directive.template));if(this.directive.templateUrl){var url=getOrCall(this.directive.templateUrl),html=this.$templateCache.get(url);if(void 0!==html)return this.compileHtml(html);throw new Error("loading directive templates asynchronously is not supported")}throw new Error("Directive '"+this.name+"' is not a component, it is missing template.")},UpgradeComponent.prototype.buildController=function(controllerType,$scope,$element,controllerAs){var locals={$scope:$scope,$element:$element},controller=this.$controller(controllerType,locals,null,controllerAs);return $element.data(controllerKey(this.directive.name),controller),controller},UpgradeComponent.prototype.resolveRequire=function(directiveName,$element,require){var _this=this;if(require){if(Array.isArray(require))return require.map(function(req){return _this.resolveRequire(directiveName,$element,req)});if("object"==typeof require){var value_1={};return Object.keys(require).forEach(function(key){return value_1[key]=_this.resolveRequire(directiveName,$element,require[key])}),value_1}if("string"==typeof require){var match=require.match(REQUIRE_PREFIX_RE),inheritType=match[1]||match[3],name_1=require.substring(match[0].length),isOptional=!!match[2],searchParents=!!inheritType,startOnParent="^^"===inheritType,ctrlKey=controllerKey(name_1);startOnParent&&($element=$element.parent());var value=searchParents?$element.inheritedData(ctrlKey):$element.data(ctrlKey);if(!value&&!isOptional)throw new Error("Unable to find required '"+require+"' in upgraded directive '"+directiveName+"'.");return value}throw new Error("Unrecognized require syntax on upgraded directive '"+directiveName+"': "+require)}return null},UpgradeComponent.prototype.initializeOutputs=function(){var _this=this;this.bindings.twoWayBoundProperties.concat(this.bindings.expressionBoundProperties).forEach(function(propName){var outputName=_this.bindings.propertyToOutputMap[propName];_this[outputName]=new _angular_core.EventEmitter})},UpgradeComponent.prototype.bindOutputs=function(){var _this=this;this.bindings.expressionBoundProperties.forEach(function(propName){var outputName=_this.bindings.propertyToOutputMap[propName],emitter=_this[outputName];_this.bindingDestination[propName]=function(value){return emitter.emit(value)}})},UpgradeComponent.prototype.forwardChanges=function(changes){var _this=this;Object.keys(changes).forEach(function(propName){return _this.bindingDestination[propName]=changes[propName].currentValue}),isFunction(this.bindingDestination.$onChanges)&&this.bindingDestination.$onChanges(changes)},UpgradeComponent.prototype.notSupported=function(feature){throw new Error("Upgraded directive '"+this.name+"' contains unsupported feature: '"+feature+"'.")},UpgradeComponent.prototype.compileHtml=function(html){return this.element.innerHTML=html,this.$compile(this.element.childNodes)},UpgradeComponent}(),angular1Providers=[{provide:"$injector",useFactory:injectorFactory},{provide:"$rootScope",useFactory:rootScopeFactory,deps:["$injector"]},{provide:"$compile",useFactory:compileFactory,deps:["$injector"]},{provide:"$parse",useFactory:parseFactory,deps:["$injector"]}],UpgradeModule=function(){function UpgradeModule(injector,ngZone){this.injector=injector,this.ngZone=ngZone}return UpgradeModule.prototype.bootstrap=function(element$$,modules,config){var _this=this;void 0===modules&&(modules=[]);var INIT_MODULE_NAME=UPGRADE_MODULE_NAME+".init",upgradeModule=(module$1(INIT_MODULE_NAME,[]).value(INJECTOR_KEY,this.injector).config([$PROVIDE,$INJECTOR,function($provide,$injector){$injector.has($$TESTABILITY)&&$provide.decorator($$TESTABILITY,[$DELEGATE,function(testabilityDelegate){var originalWhenStable=testabilityDelegate.whenStable,injector=_this.injector,newWhenStable=function(callback){originalWhenStable.call(testabilityDelegate,function(){var ng2Testability=injector.get(_angular_core.Testability);ng2Testability.isStable()?callback():ng2Testability.whenStable(newWhenStable.bind(testabilityDelegate,callback))})};return testabilityDelegate.whenStable=newWhenStable,testabilityDelegate}])}]).run([$INJECTOR,function($injector){_this.$injector=$injector,setTempInjectorRef($injector),_this.injector.get($INJECTOR),element(element$$).data(controllerKey(INJECTOR_KEY),_this.injector),setTimeout(function(){var $rootScope=$injector.get("$rootScope"),subscription=_this.ngZone.onMicrotaskEmpty.subscribe(function(){return $rootScope.$digest()});$rootScope.$on("$destroy",function(){subscription.unsubscribe()})},0)}]),module$1(UPGRADE_MODULE_NAME,[INIT_MODULE_NAME].concat(modules))),windowAngular=window.angular;if(windowAngular.resumeBootstrap=void 0,this.ngZone.run(function(){bootstrap(element$$,[upgradeModule.name],config)}),windowAngular.resumeBootstrap){var originalResumeBootstrap_1=windowAngular.resumeBootstrap,ngZone_1=this.ngZone;windowAngular.resumeBootstrap=function(){var _this=this,args=arguments;windowAngular.resumeBootstrap=originalResumeBootstrap_1,ngZone_1.run(function(){windowAngular.resumeBootstrap.apply(_this,args)})}}},UpgradeModule}();UpgradeModule.decorators=[{type:_angular_core.NgModule,args:[{providers:[angular1Providers,NgContentSelectorHelper]}]}],UpgradeModule.ctorParameters=function(){return[{type:_angular_core.Injector},{type:_angular_core.NgZone}]},exports.ɵf=NgContentSelectorHelper,exports.ɵe=angular1Providers,exports.ɵc=compileFactory,exports.ɵa=injectorFactory,exports.ɵd=parseFactory,exports.ɵb=rootScopeFactory,exports.downgradeComponent=downgradeComponent,exports.downgradeInjectable=downgradeInjectable,exports.VERSION=VERSION,exports.UpgradeComponent=UpgradeComponent,exports.UpgradeModule=UpgradeModule});
//# sourceMappingURL=upgrade-static.umd.min.js.map
/**
* @license Angular v4.0.0-rc.3
* @license Angular v4.0.0-rc.4
* (c) 2010-2017 Google, Inc. https://angular.io/

@@ -13,3 +13,3 @@ * License: MIT

*/
function noNg(){throw new Error("AngularJS v1.x is not loaded!")}/**
function noNg(){throw new Error("AngularJS v1.x is not loaded!")}function getHtmlTagDefinition(tagName){return TAG_DEFINITIONS[tagName.toLowerCase()]||_DEFAULT_TAG_DEFINITION}function createElementCssSelector(elementName,attributes){var cssSelector=new CssSelector,elNameNoNs=splitNsName(elementName)[1];cssSelector.setElement(elNameNoNs);for(var i=0;i<attributes.length;i++){var attrName=attributes[i][0],attrNameNoNs=splitNsName(attrName)[1],attrValue=attributes[i][1];if(cssSelector.addAttribute(attrNameNoNs,attrValue),attrName.toLowerCase()==CLASS_ATTR){var classes=splitClasses(attrValue);classes.forEach(function(className){return cssSelector.addClassName(className)})}}return cssSelector}function splitNsName(elementName){if(":"!=elementName[0])return[null,elementName];var colonIndex=elementName.indexOf(":",1);if(colonIndex==-1)throw new Error('Unsupported format "'+elementName+'" expecting ":namespace:name"');return[elementName.slice(1,colonIndex),elementName.slice(colonIndex+1)]}function splitClasses(classAttrValue){return classAttrValue.trim().split(/\s+/g)}/**
* @license

@@ -21,2 +21,4 @@ * Copyright Google Inc. All Rights Reserved.

*/
function onError(e){throw console.error?console.error(e,e.stack):console.log(e,e.stack),e}function controllerKey(name){return"$"+name+"Controller"}function getAttributesAsArray(node){var asArray,attributes=node.attributes;if(attributes){var attrLen=attributes.length;asArray=new Array(attrLen);for(var i=0;i<attrLen;i++)asArray[i]=[attributes[i].nodeName,attributes[i].nodeValue]}return asArray||[]}function getComponentName(component){return component.overriddenName||component.name||component.toString().split("\n")[0]}function supportsNgModel(component){return"function"==typeof component.writeValue&&"function"==typeof component.registerOnChange}function hookupNgModel(ngModel,component){ngModel&&supportsNgModel(component)&&(ngModel.$render=function(){component.writeValue(ngModel.$viewValue)},component.registerOnChange(ngModel.$setViewValue.bind(ngModel)))}function downgradeComponent(info){var idPrefix="NG2_UPGRADE_"+downgradeCount++ +"_",idCount=0,directiveFactory=function($compile,$injector,$parse){return{restrict:"E",terminal:!0,require:[REQUIRE_INJECTOR,REQUIRE_NG_MODEL],link:function(scope,element,attrs,required){var parentInjector=required[0]||$injector.get(INJECTOR_KEY),ngModel=required[1],downgradeFn=function(injector){var componentFactoryResolver=injector.get(_angular_core.ComponentFactoryResolver),componentFactory=componentFactoryResolver.resolveComponentFactory(info.component);if(!componentFactory)throw new Error("Expecting ComponentFactory for: "+getComponentName(info.component));var id=idPrefix+idCount++,injectorPromise=new ParentInjectorPromise$1(element),facade=new DowngradeComponentAdapter(id,info,element,attrs,scope,ngModel,injector,$injector,$compile,$parse,componentFactory),projectableNodes=facade.compileContents();facade.createComponent(projectableNodes),facade.setupInputs(),facade.setupOutputs(),facade.registerCleanup(),injectorPromise.resolve(facade.getInjector())};parentInjector instanceof ParentInjectorPromise$1?parentInjector.then(downgradeFn):downgradeFn(parentInjector)}}};return directiveFactory.$inject=[$COMPILE,$INJECTOR,$PARSE],directiveFactory}function downgradeInjectable(token){var factory=function(i){return i.get(token)};return factory.$inject=[INJECTOR_KEY],factory}function isFunction(value){return"function"==typeof value}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 __)},VERSION=new _angular_core.Version("4.0.0-rc.3"),angular={bootstrap:noNg,module:noNg,element:noNg,version:noNg,resumeBootstrap:noNg,getTestability:noNg};try{window.hasOwnProperty("angular")&&(angular=window.angular)}catch(e){}var bootstrap=angular.bootstrap,module$1=angular.module,element=angular.element,$COMPILE="$compile",$CONTROLLER="$controller",$HTTP_BACKEND="$httpBackend",$INJECTOR="$injector",$PARSE="$parse",$ROOT_SCOPE="$rootScope",$SCOPE="$scope",$TEMPLATE_CACHE="$templateCache",$$TESTABILITY="$$testability",COMPILER_KEY="$$angularCompiler",INJECTOR_KEY="$$angularInjector",NG_ZONE_KEY="$$angularNgZone",REQUIRE_INJECTOR="?^^"+INJECTOR_KEY,REQUIRE_NG_MODEL="?ngModel",ContentProjectionHelper=function(){function ContentProjectionHelper(){}return ContentProjectionHelper.prototype.groupProjectableNodes=function($injector,component,nodes){return[nodes]},ContentProjectionHelper}(),PropertyBinding=function(){function PropertyBinding(binding){this.binding=binding,this.parseBinding()}return PropertyBinding.prototype.parseBinding=function(){var parts=this.binding.split(":");this.prop=parts[0].trim(),this.attr=(parts[1]||this.prop).trim(),this.bracketAttr="["+this.attr+"]",this.parenAttr="("+this.attr+")",this.bracketParenAttr="[("+this.attr+")]";var capitalAttr=this.attr.charAt(0).toUpperCase()+this.attr.substr(1);this.onAttr="on"+capitalAttr,this.bindAttr="bind"+capitalAttr,this.bindonAttr="bindon"+capitalAttr},PropertyBinding}(),Deferred=function(){function Deferred(){var _this=this;this.promise=new Promise(function(res,rej){_this.resolve=res,_this.reject=rej})}return Deferred}(),INITIAL_VALUE={__UNINITIALIZED__:!0},DowngradeComponentAdapter=function(){function DowngradeComponentAdapter(id,info,element,attrs,scope,ngModel,parentInjector,$injector,$compile,$parse,componentFactory){this.id=id,this.info=info,this.element=element,this.attrs=attrs,this.scope=scope,this.ngModel=ngModel,this.parentInjector=parentInjector,this.$injector=$injector,this.$compile=$compile,this.$parse=$parse,this.componentFactory=componentFactory,this.inputChangeCount=0,this.inputChanges=null,this.componentRef=null,this.component=null,this.changeDetector=null,this.element[0].id=id,this.componentScope=scope.$new()}return DowngradeComponentAdapter.prototype.compileContents=function(){var _this=this,compiledProjectableNodes=[],projectionHelper=this.parentInjector.get(ContentProjectionHelper),projectableNodes=projectionHelper.groupProjectableNodes(this.$injector,this.info.component,this.element.contents()),linkFns=projectableNodes.map(function(nodes){return _this.$compile(nodes)});return this.element.empty(),linkFns.forEach(function(linkFn){linkFn(_this.scope,function(clone){compiledProjectableNodes.push(clone),_this.element.append(clone)})}),compiledProjectableNodes},DowngradeComponentAdapter.prototype.createComponent=function(projectableNodes){var childInjector=_angular_core.ReflectiveInjector.resolveAndCreate([{provide:$SCOPE,useValue:this.componentScope}],this.parentInjector);this.componentRef=this.componentFactory.create(childInjector,projectableNodes,this.element[0]),this.changeDetector=this.componentRef.changeDetectorRef,this.component=this.componentRef.instance,hookupNgModel(this.ngModel,this.component)},DowngradeComponentAdapter.prototype.setupInputs=function(){for(var _this=this,attrs=this.attrs,inputs=this.info.inputs||[],i=0;i<inputs.length;i++){var input=new PropertyBinding(inputs[i]),expr=null;if(attrs.hasOwnProperty(input.attr)){var observeFn=function(prop){var prevValue=INITIAL_VALUE;return function(currValue){prevValue===INITIAL_VALUE&&(prevValue=currValue),_this.updateInput(prop,prevValue,currValue),prevValue=currValue}}(input.prop);attrs.$observe(input.attr,observeFn)}else attrs.hasOwnProperty(input.bindAttr)?expr=attrs[input.bindAttr]:attrs.hasOwnProperty(input.bracketAttr)?expr=attrs[input.bracketAttr]:attrs.hasOwnProperty(input.bindonAttr)?expr=attrs[input.bindonAttr]:attrs.hasOwnProperty(input.bracketParenAttr)&&(expr=attrs[input.bracketParenAttr]);if(null!=expr){var watchFn=function(prop){return function(currValue,prevValue){return _this.updateInput(prop,prevValue,currValue)}}(input.prop);this.componentScope.$watch(expr,watchFn)}}var prototype=this.info.component.prototype;prototype&&prototype.ngOnChanges&&(this.inputChanges={},this.componentScope.$watch(function(){return _this.inputChangeCount},function(){var inputChanges=_this.inputChanges;_this.inputChanges={},_this.component.ngOnChanges(inputChanges)})),this.componentScope.$watch(function(){return _this.changeDetector&&_this.changeDetector.detectChanges()})},DowngradeComponentAdapter.prototype.setupOutputs=function(){for(var _this=this,attrs=this.attrs,outputs=this.info.outputs||[],j=0;j<outputs.length;j++){var output=new PropertyBinding(outputs[j]),expr=null,assignExpr=!1,bindonAttr=output.bindonAttr?output.bindonAttr.substring(0,output.bindonAttr.length-6):null,bracketParenAttr=output.bracketParenAttr?"[("+output.bracketParenAttr.substring(2,output.bracketParenAttr.length-8)+")]":null;if(attrs.hasOwnProperty(output.onAttr)?expr=attrs[output.onAttr]:attrs.hasOwnProperty(output.parenAttr)?expr=attrs[output.parenAttr]:attrs.hasOwnProperty(bindonAttr)?(expr=attrs[bindonAttr],assignExpr=!0):attrs.hasOwnProperty(bracketParenAttr)&&(expr=attrs[bracketParenAttr],assignExpr=!0),null!=expr&&null!=assignExpr){var getter=this.$parse(expr),setter=getter.assign;if(assignExpr&&!setter)throw new Error("Expression '"+expr+"' is not assignable!");var emitter=this.component[output.prop];if(!emitter)throw new Error("Missing emitter '"+output.prop+"' on component '"+getComponentName(this.info.component)+"'!");emitter.subscribe({next:assignExpr?function(setter){return function(v){return setter(_this.scope,v)}}(setter):function(getter){return function(v){return getter(_this.scope,{$event:v})}}(getter)})}}},DowngradeComponentAdapter.prototype.registerCleanup=function(){var _this=this;this.element.bind("$destroy",function(){_this.componentScope.$destroy(),_this.componentRef.destroy()})},DowngradeComponentAdapter.prototype.getInjector=function(){return this.componentRef&&this.componentRef.injector},DowngradeComponentAdapter.prototype.updateInput=function(prop,prevValue,currValue){this.inputChanges&&(this.inputChangeCount++,this.inputChanges[prop]=new _angular_core.SimpleChange(prevValue,currValue,prevValue===currValue)),this.component[prop]=currValue},DowngradeComponentAdapter}(),downgradeCount=0,ParentInjectorPromise$1=function(){function ParentInjectorPromise(element){this.element=element,this.injectorKey=controllerKey(INJECTOR_KEY),this.callbacks=[],element.data(this.injectorKey,this)}return ParentInjectorPromise.prototype.then=function(callback){this.injector?callback(this.injector):this.callbacks.push(callback)},ParentInjectorPromise.prototype.resolve=function(injector){this.injector=injector,this.element.data(this.injectorKey,injector),this.element=null,this.callbacks.forEach(function(callback){return callback(injector)}),this.callbacks.length=0},ParentInjectorPromise}(),DynamicContentProjectionHelper=function(_super){function DynamicContentProjectionHelper(){return null!==_super&&_super.apply(this,arguments)||this}return __extends(DynamicContentProjectionHelper,_super),DynamicContentProjectionHelper.prototype.groupProjectableNodes=function($injector,component,nodes){var ng2Compiler=$injector.get(COMPILER_KEY),ngContentSelectors=ng2Compiler.getNgContentSelectors(component);if(!ngContentSelectors)throw new Error("Expecting ngContentSelectors for: "+getComponentName(component));return this.groupNodesBySelector(ngContentSelectors,nodes)},DynamicContentProjectionHelper.prototype.groupNodesBySelector=function(ngContentSelectors,nodes){for(var wildcardNgContentIndex,projectableNodes=[],matcher=new _angular_compiler.SelectorMatcher,i=0,ii=ngContentSelectors.length;i<ii;++i){projectableNodes[i]=[];var selector=ngContentSelectors[i];"*"===selector?wildcardNgContentIndex=i:matcher.addSelectables(_angular_compiler.CssSelector.parse(selector),i)}for(var _loop_1=function(j,jj){var ngContentIndices=[],node=nodes[j],selector=_angular_compiler.createElementCssSelector(node.nodeName.toLowerCase(),getAttributesAsArray(node));matcher.match(selector,function(_,index){return ngContentIndices.push(index)}),ngContentIndices.sort(),void 0!==wildcardNgContentIndex&&ngContentIndices.push(wildcardNgContentIndex),ngContentIndices.length&&projectableNodes[ngContentIndices[0]].push(node)},j=0,jj=nodes.length;j<jj;++j)_loop_1(j,jj);return projectableNodes},DynamicContentProjectionHelper}(ContentProjectionHelper),CAMEL_CASE=/([A-Z])/g,INITIAL_VALUE$1={__UNINITIALIZED__:!0},NOT_SUPPORTED="NOT_SUPPORTED",UpgradeNg1ComponentAdapterBuilder=function(){function UpgradeNg1ComponentAdapterBuilder(name){this.name=name,this.inputs=[],this.inputsRename=[],this.outputs=[],this.outputsRename=[],this.propertyOutputs=[],this.checkProperties=[],this.propertyMap={},this.linkFn=null,this.directive=null,this.$controller=null;var selector=name.replace(CAMEL_CASE,function(all,next){return"-"+next.toLowerCase()}),self=this;this.type=_angular_core.Directive({selector:selector,inputs:this.inputsRename,outputs:this.outputsRename}).Class({constructor:[new _angular_core.Inject($SCOPE),_angular_core.ElementRef,function(scope,elementRef){return new UpgradeNg1ComponentAdapter(self.linkFn,scope,self.directive,elementRef,self.$controller,self.inputs,self.outputs,self.propertyOutputs,self.checkProperties,self.propertyMap)}],ngOnInit:function(){},ngOnChanges:function(){},ngDoCheck:function(){},ngOnDestroy:function(){}})}return UpgradeNg1ComponentAdapterBuilder.prototype.extractDirective=function(injector){var directives=injector.get(this.name+"Directive");if(directives.length>1)throw new Error("Only support single directive definition for: "+this.name);var directive=directives[0];directive.replace&&this.notSupported("replace"),directive.terminal&&this.notSupported("terminal");var link=directive.link;return"object"==typeof link&&link.post&&this.notSupported("link.post"),directive},UpgradeNg1ComponentAdapterBuilder.prototype.notSupported=function(feature){throw new Error("Upgraded directive '"+this.name+"' does not support '"+feature+"'.")},UpgradeNg1ComponentAdapterBuilder.prototype.extractBindings=function(){var btcIsObject="object"==typeof this.directive.bindToController;if(btcIsObject&&Object.keys(this.directive.scope).length)throw new Error("Binding definitions on scope and controller at the same time are not supported.");var context=btcIsObject?this.directive.bindToController:this.directive.scope;if("object"==typeof context)for(var name in context)if(context.hasOwnProperty(name)){var localName=context[name],type=localName.charAt(0),typeOptions=localName.charAt(1);localName="?"===typeOptions?localName.substr(2):localName.substr(1),localName=localName||name;var outputName="output_"+name,outputNameRename=outputName+": "+name,outputNameRenameChange=outputName+": "+name+"Change",inputName="input_"+name,inputNameRename=inputName+": "+name;switch(type){case"=":this.propertyOutputs.push(outputName),this.checkProperties.push(localName),this.outputs.push(outputName),this.outputsRename.push(outputNameRenameChange),this.propertyMap[outputName]=localName,this.inputs.push(inputName),this.inputsRename.push(inputNameRename),this.propertyMap[inputName]=localName;break;case"@":case"<":this.inputs.push(inputName),this.inputsRename.push(inputNameRename),this.propertyMap[inputName]=localName;break;case"&":this.outputs.push(outputName),this.outputsRename.push(outputNameRename),this.propertyMap[outputName]=localName;break;default:var json=JSON.stringify(context);throw new Error("Unexpected mapping '"+type+"' in '"+json+"' in '"+this.name+"' directive.")}}},UpgradeNg1ComponentAdapterBuilder.prototype.compileTemplate=function(compile,templateCache,httpBackend){function compileHtml(html){var div=document.createElement("div");return div.innerHTML=html,compile(div.childNodes)}var _this=this;if(void 0!==this.directive.template)this.linkFn=compileHtml(isFunction(this.directive.template)?this.directive.template():this.directive.template);else{if(!this.directive.templateUrl)throw new Error("Directive '"+this.name+"' is not a component, it is missing template.");var url_1=isFunction(this.directive.templateUrl)?this.directive.templateUrl():this.directive.templateUrl,html=templateCache.get(url_1);if(void 0===html)return new Promise(function(resolve,err){httpBackend("GET",url_1,null,function(status,response){200==status?resolve(_this.linkFn=compileHtml(templateCache.put(url_1,response))):err("GET "+url_1+" returned "+status+": "+response)})});this.linkFn=compileHtml(html)}return null},UpgradeNg1ComponentAdapterBuilder.resolve=function(exportedComponents,injector){var promises=[],compile=injector.get($COMPILE),templateCache=injector.get($TEMPLATE_CACHE),httpBackend=injector.get($HTTP_BACKEND),$controller=injector.get($CONTROLLER);for(var name in exportedComponents)if(exportedComponents.hasOwnProperty(name)){var exportedComponent=exportedComponents[name];exportedComponent.directive=exportedComponent.extractDirective(injector),exportedComponent.$controller=$controller,exportedComponent.extractBindings();var promise=exportedComponent.compileTemplate(compile,templateCache,httpBackend);promise&&promises.push(promise)}return Promise.all(promises)},UpgradeNg1ComponentAdapterBuilder}(),UpgradeNg1ComponentAdapter=function(){function UpgradeNg1ComponentAdapter(linkFn,scope,directive,elementRef,$controller,inputs,outputs,propOuts,checkProperties,propertyMap){this.linkFn=linkFn,this.directive=directive,this.$controller=$controller,this.inputs=inputs,this.outputs=outputs,this.propOuts=propOuts,this.checkProperties=checkProperties,this.propertyMap=propertyMap,this.controllerInstance=null,this.destinationObj=null,this.checkLastValues=[],this.$element=null,this.element=elementRef.nativeElement,this.componentScope=scope.$new(!!directive.scope),this.$element=element(this.element);var controllerType=directive.controller;directive.bindToController&&controllerType?(this.controllerInstance=this.buildController(controllerType),this.destinationObj=this.controllerInstance):this.destinationObj=this.componentScope;for(var i=0;i<inputs.length;i++)this[inputs[i]]=null;for(var j=0;j<outputs.length;j++){var emitter=this[outputs[j]]=new _angular_core.EventEmitter;this.setComponentProperty(outputs[j],function(emitter){return function(value){return emitter.emit(value)}}(emitter))}for(var k=0;k<propOuts.length;k++)this[propOuts[k]]=new _angular_core.EventEmitter,this.checkLastValues.push(INITIAL_VALUE$1)}return UpgradeNg1ComponentAdapter.prototype.ngOnInit=function(){var _this=this;!this.directive.bindToController&&this.directive.controller&&(this.controllerInstance=this.buildController(this.directive.controller)),this.controllerInstance&&isFunction(this.controllerInstance.$onInit)&&this.controllerInstance.$onInit();var link=this.directive.link;if("object"==typeof link&&(link=link.pre),link){var attrs=NOT_SUPPORTED,transcludeFn=NOT_SUPPORTED,linkController=this.resolveRequired(this.$element,this.directive.require);this.directive.link(this.componentScope,this.$element,attrs,linkController,transcludeFn)}for(var childNode,childNodes=[];childNode=this.element.firstChild;)this.element.removeChild(childNode),childNodes.push(childNode);this.linkFn(this.componentScope,function(clonedElement,scope){for(var i=0,ii=clonedElement.length;i<ii;i++)_this.element.appendChild(clonedElement[i])},{parentBoundTranscludeFn:function(scope,cloneAttach){cloneAttach(childNodes)}}),this.controllerInstance&&isFunction(this.controllerInstance.$postLink)&&this.controllerInstance.$postLink()},UpgradeNg1ComponentAdapter.prototype.ngOnChanges=function(changes){var _this=this,ng1Changes={};Object.keys(changes).forEach(function(name){var change=changes[name];_this.setComponentProperty(name,change.currentValue),ng1Changes[_this.propertyMap[name]]=change}),isFunction(this.destinationObj.$onChanges)&&this.destinationObj.$onChanges(ng1Changes)},UpgradeNg1ComponentAdapter.prototype.ngDoCheck=function(){for(var destinationObj=this.destinationObj,lastValues=this.checkLastValues,checkProperties=this.checkProperties,i=0;i<checkProperties.length;i++){var value=destinationObj[checkProperties[i]],last=lastValues[i];if(value!==last)if("number"==typeof value&&isNaN(value)&&"number"==typeof last&&isNaN(last));else{var eventEmitter=this[this.propOuts[i]];eventEmitter.emit(lastValues[i]=value)}}this.controllerInstance&&isFunction(this.controllerInstance.$doCheck)&&this.controllerInstance.$doCheck()},UpgradeNg1ComponentAdapter.prototype.ngOnDestroy=function(){this.controllerInstance&&isFunction(this.controllerInstance.$onDestroy)&&this.controllerInstance.$onDestroy()},UpgradeNg1ComponentAdapter.prototype.setComponentProperty=function(name,value){this.destinationObj[this.propertyMap[name]]=value},UpgradeNg1ComponentAdapter.prototype.buildController=function(controllerType){var locals={$scope:this.componentScope,$element:this.$element},controller=this.$controller(controllerType,locals,null,this.directive.controllerAs);return this.$element.data(controllerKey(this.directive.name),controller),controller},UpgradeNg1ComponentAdapter.prototype.resolveRequired=function($element,require){if(require){if("string"==typeof require){var name=require,isOptional=!1,startParent=!1,searchParents=!1;"?"==name.charAt(0)&&(isOptional=!0,name=name.substr(1)),"^"==name.charAt(0)&&(searchParents=!0,name=name.substr(1)),"^"==name.charAt(0)&&(startParent=!0,name=name.substr(1));var key=controllerKey(name);startParent&&($element=$element.parent());var dep=searchParents?$element.inheritedData(key):$element.data(key);if(!dep&&!isOptional)throw new Error("Can not locate '"+require+"' in '"+this.directive.name+"'.");return dep}if(require instanceof Array){for(var deps=[],i=0;i<require.length;i++)deps.push(this.resolveRequired($element,require[i]));return deps}throw new Error("Directive '"+this.directive.name+"' require syntax unrecognized: "+this.directive.require)}},UpgradeNg1ComponentAdapter}(),upgradeCount=0,UpgradeAdapter=function(){function UpgradeAdapter(ng2AppModule,compilerOptions){if(this.ng2AppModule=ng2AppModule,this.compilerOptions=compilerOptions,this.idPrefix="NG2_UPGRADE_"+upgradeCount++ +"_",this.directiveResolver=new _angular_compiler.DirectiveResolver,this.downgradedComponents=[],this.ng1ComponentsToBeUpgraded={},this.upgradedProviders=[],this.moduleRef=null,!ng2AppModule)throw new Error("UpgradeAdapter cannot be instantiated without an NgModule of the Angular app.")}return UpgradeAdapter.prototype.downgradeNg2Component=function(component){this.downgradedComponents.push(component);var metadata=this.directiveResolver.resolve(component),info={component:component,inputs:metadata.inputs,outputs:metadata.outputs};return downgradeComponent(info)},UpgradeAdapter.prototype.upgradeNg1Component=function(name){return this.ng1ComponentsToBeUpgraded.hasOwnProperty(name)?this.ng1ComponentsToBeUpgraded[name].type:(this.ng1ComponentsToBeUpgraded[name]=new UpgradeNg1ComponentAdapterBuilder(name)).type},UpgradeAdapter.prototype.registerForNg1Tests=function(modules){var _this=this,windowNgMock=window.angular.mock;if(!windowNgMock||!windowNgMock.module)throw new Error("Failed to find 'angular.mock.module'.");this.declareNg1Module(modules),windowNgMock.module(this.ng1Module.name);var upgrade=new UpgradeAdapterRef;return this.ng2BootstrapDeferred.promise.then(function(ng1Injector){upgrade._bootstrapDone(_this.moduleRef,ng1Injector)},onError),upgrade},UpgradeAdapter.prototype.bootstrap=function(element$$,modules,config){var _this=this;this.declareNg1Module(modules);var upgrade=new UpgradeAdapterRef,windowAngular=window.angular;windowAngular.resumeBootstrap=void 0,this.ngZone.run(function(){bootstrap(element$$,[_this.ng1Module.name],config)});var ng1BootstrapPromise=new Promise(function(resolve){if(windowAngular.resumeBootstrap){var originalResumeBootstrap_1=windowAngular.resumeBootstrap;windowAngular.resumeBootstrap=function(){windowAngular.resumeBootstrap=originalResumeBootstrap_1,windowAngular.resumeBootstrap.apply(this,arguments),resolve()}}else resolve()});return Promise.all([this.ng2BootstrapDeferred.promise,ng1BootstrapPromise]).then(function(_a){var ng1Injector=_a[0];element(element$$).data(controllerKey(INJECTOR_KEY),_this.moduleRef.injector),_this.moduleRef.injector.get(_angular_core.NgZone).run(function(){upgrade._bootstrapDone(_this.moduleRef,ng1Injector)})},onError),upgrade},UpgradeAdapter.prototype.upgradeNg1Provider=function(name,options){var token=options&&options.asToken||name;this.upgradedProviders.push({provide:token,useFactory:function($injector){return $injector.get(name)},deps:[$INJECTOR]})},UpgradeAdapter.prototype.downgradeNg2Provider=function(token){return downgradeInjectable(token)},UpgradeAdapter.prototype.declareNg1Module=function(modules){var _this=this;void 0===modules&&(modules=[]);var original$applyFn,rootScopePrototype,rootScope,delayApplyExps=[],upgradeAdapter=this,ng1Module=this.ng1Module=module$1(this.idPrefix,modules),platformRef=_angular_platformBrowserDynamic.platformBrowserDynamic();return this.ngZone=new _angular_core.NgZone({enableLongStackTrace:Zone.hasOwnProperty("longStackTraceZoneSpec")}),this.ng2BootstrapDeferred=new Deferred,ng1Module.factory(INJECTOR_KEY,function(){return _this.moduleRef.injector.get(_angular_core.Injector)}).constant(NG_ZONE_KEY,this.ngZone).factory(COMPILER_KEY,function(){return _this.moduleRef.injector.get(_angular_core.Compiler)}).config(["$provide","$injector",function(provide,ng1Injector){provide.decorator($ROOT_SCOPE,["$delegate",function(rootScopeDelegate){if(rootScopePrototype=rootScopeDelegate.constructor.prototype,!rootScopePrototype.hasOwnProperty("$apply"))throw new Error("Failed to find '$apply' on '$rootScope'!");return original$applyFn=rootScopePrototype.$apply,rootScopePrototype.$apply=function(exp){return delayApplyExps.push(exp)},rootScope=rootScopeDelegate}]),ng1Injector.has($$TESTABILITY)&&provide.decorator($$TESTABILITY,["$delegate",function(testabilityDelegate){var originalWhenStable=testabilityDelegate.whenStable,newWhenStable=function(callback){originalWhenStable.call(this,function(){var ng2Testability=upgradeAdapter.moduleRef.injector.get(_angular_core.Testability);ng2Testability.isStable()?callback.apply(this,arguments):ng2Testability.whenStable(newWhenStable.bind(this,callback))})};return testabilityDelegate.whenStable=newWhenStable,testabilityDelegate}])}]),ng1Module.run(["$injector","$rootScope",function(ng1Injector,rootScope){UpgradeNg1ComponentAdapterBuilder.resolve(_this.ng1ComponentsToBeUpgraded,ng1Injector).then(function(){var DynamicNgUpgradeModule=_angular_core.NgModule({providers:[{provide:$INJECTOR,useFactory:function(){return ng1Injector}},{provide:$COMPILE,useFactory:function(){return ng1Injector.get($COMPILE)}},{provide:ContentProjectionHelper,useClass:DynamicContentProjectionHelper},_this.upgradedProviders],imports:[_this.ng2AppModule],entryComponents:_this.downgradedComponents}).Class({constructor:function(){},ngDoBootstrap:function(){}});platformRef._bootstrapModuleWithZone(DynamicNgUpgradeModule,_this.compilerOptions,_this.ngZone).then(function(ref){_this.moduleRef=ref,_this.ngZone.run(function(){if(rootScopePrototype){for(rootScopePrototype.$apply=original$applyFn;delayApplyExps.length;)rootScope.$apply(delayApplyExps.shift());rootScopePrototype=null}})}).then(function(){return _this.ng2BootstrapDeferred.resolve(ng1Injector)},onError).then(function(){var subscription=_this.ngZone.onMicrotaskEmpty.subscribe({next:function(){return rootScope.$digest()}});rootScope.$on("$destroy",function(){subscription.unsubscribe()})})}).catch(function(e){return _this.ng2BootstrapDeferred.reject(e)})}]),ng1Module},UpgradeAdapter}(),UpgradeAdapterRef=function(){function UpgradeAdapterRef(){this._readyFn=null,this.ng1RootScope=null,this.ng1Injector=null,this.ng2ModuleRef=null,this.ng2Injector=null}return UpgradeAdapterRef.prototype._bootstrapDone=function(ngModuleRef,ng1Injector){this.ng2ModuleRef=ngModuleRef,this.ng2Injector=ngModuleRef.injector,this.ng1Injector=ng1Injector,this.ng1RootScope=ng1Injector.get($ROOT_SCOPE),this._readyFn&&this._readyFn(this)},UpgradeAdapterRef.prototype.ready=function(fn){this._readyFn=fn},UpgradeAdapterRef.prototype.dispose=function(){this.ng1Injector.get($ROOT_SCOPE).$destroy(),this.ng2ModuleRef.destroy()},UpgradeAdapterRef}();exports.VERSION=VERSION,exports.UpgradeAdapter=UpgradeAdapter,exports.UpgradeAdapterRef=UpgradeAdapterRef});
function onError(e){throw console.error?console.error(e,e.stack):console.log(e,e.stack),e}function controllerKey(name){return"$"+name+"Controller"}function getAttributesAsArray(node){var asArray,attributes=node.attributes;if(attributes){var attrLen=attributes.length;asArray=new Array(attrLen);for(var i=0;i<attrLen;i++)asArray[i]=[attributes[i].nodeName,attributes[i].nodeValue]}return asArray||[]}function getComponentName(component){return component.overriddenName||component.name||component.toString().split("\n")[0]}function supportsNgModel(component){return"function"==typeof component.writeValue&&"function"==typeof component.registerOnChange}function hookupNgModel(ngModel,component){ngModel&&supportsNgModel(component)&&(ngModel.$render=function(){component.writeValue(ngModel.$viewValue)},component.registerOnChange(ngModel.$setViewValue.bind(ngModel)))}function downgradeComponent(info){var idPrefix="NG2_UPGRADE_"+downgradeCount++ +"_",idCount=0,directiveFactory=function($compile,$injector,$parse){return{restrict:"E",terminal:!0,require:[REQUIRE_INJECTOR,REQUIRE_NG_MODEL],link:function(scope,element,attrs,required){var parentInjector=required[0]||$injector.get(INJECTOR_KEY),ngModel=required[1],downgradeFn=function(injector){var componentFactoryResolver=injector.get(_angular_core.ComponentFactoryResolver),componentFactory=componentFactoryResolver.resolveComponentFactory(info.component);if(!componentFactory)throw new Error("Expecting ComponentFactory for: "+getComponentName(info.component));var id=idPrefix+idCount++,injectorPromise=new ParentInjectorPromise$1(element),facade=new DowngradeComponentAdapter(id,info,element,attrs,scope,ngModel,injector,$injector,$compile,$parse,componentFactory),projectableNodes=facade.compileContents();facade.createComponent(projectableNodes),facade.setupInputs(),facade.setupOutputs(),facade.registerCleanup(),injectorPromise.resolve(facade.getInjector())};parentInjector instanceof ParentInjectorPromise$1?parentInjector.then(downgradeFn):downgradeFn(parentInjector)}}};return directiveFactory.$inject=[$COMPILE,$INJECTOR,$PARSE],directiveFactory}function downgradeInjectable(token){var factory=function(i){return i.get(token)};return factory.$inject=[INJECTOR_KEY],factory}function isFunction(value){return"function"==typeof value}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 __)},VERSION=new _angular_core.Version("4.0.0-rc.4"),angular={bootstrap:noNg,module:noNg,element:noNg,version:noNg,resumeBootstrap:noNg,getTestability:noNg};try{window.hasOwnProperty("angular")&&(angular=window.angular)}catch(e){}var bootstrap=angular.bootstrap,module$1=angular.module,element=angular.element,$COMPILE="$compile",$CONTROLLER="$controller",$HTTP_BACKEND="$httpBackend",$INJECTOR="$injector",$PARSE="$parse",$ROOT_SCOPE="$rootScope",$SCOPE="$scope",$TEMPLATE_CACHE="$templateCache",$$TESTABILITY="$$testability",COMPILER_KEY="$$angularCompiler",INJECTOR_KEY="$$angularInjector",NG_ZONE_KEY="$$angularNgZone",REQUIRE_INJECTOR="?^^"+INJECTOR_KEY,REQUIRE_NG_MODEL="?ngModel",TagContentType={};TagContentType.RAW_TEXT=0,TagContentType.ESCAPABLE_RAW_TEXT=1,TagContentType.PARSABLE_DATA=2,TagContentType[TagContentType.RAW_TEXT]="RAW_TEXT",TagContentType[TagContentType.ESCAPABLE_RAW_TEXT]="ESCAPABLE_RAW_TEXT",TagContentType[TagContentType.PARSABLE_DATA]="PARSABLE_DATA";var HtmlTagDefinition=function(){function HtmlTagDefinition(_a){var _b=void 0===_a?{}:_a,closedByChildren=_b.closedByChildren,requiredParents=_b.requiredParents,implicitNamespacePrefix=_b.implicitNamespacePrefix,_c=_b.contentType,contentType=void 0===_c?TagContentType.PARSABLE_DATA:_c,_d=_b.closedByParent,closedByParent=void 0!==_d&&_d,_e=_b.isVoid,isVoid=void 0!==_e&&_e,_f=_b.ignoreFirstLf,ignoreFirstLf=void 0!==_f&&_f,_this=this;this.closedByChildren={},this.closedByParent=!1,this.canSelfClose=!1,closedByChildren&&closedByChildren.length>0&&closedByChildren.forEach(function(tagName){return _this.closedByChildren[tagName]=!0}),this.isVoid=isVoid,this.closedByParent=closedByParent||isVoid,requiredParents&&requiredParents.length>0&&(this.requiredParents={},this.parentToAdd=requiredParents[0],requiredParents.forEach(function(tagName){return _this.requiredParents[tagName]=!0})),this.implicitNamespacePrefix=implicitNamespacePrefix,this.contentType=contentType,this.ignoreFirstLf=ignoreFirstLf}return HtmlTagDefinition.prototype.requireExtraParent=function(currentParent){if(!this.requiredParents)return!1;if(!currentParent)return!0;var lcParent=currentParent.toLowerCase(),isParentTemplate="template"===lcParent||"ng-template"===currentParent;return!isParentTemplate&&1!=this.requiredParents[lcParent]},HtmlTagDefinition.prototype.isClosedByChild=function(name){return this.isVoid||name.toLowerCase()in this.closedByChildren},HtmlTagDefinition}(),TAG_DEFINITIONS={base:new HtmlTagDefinition({isVoid:!0}),meta:new HtmlTagDefinition({isVoid:!0}),area:new HtmlTagDefinition({isVoid:!0}),embed:new HtmlTagDefinition({isVoid:!0}),link:new HtmlTagDefinition({isVoid:!0}),img:new HtmlTagDefinition({isVoid:!0}),input:new HtmlTagDefinition({isVoid:!0}),param:new HtmlTagDefinition({isVoid:!0}),hr:new HtmlTagDefinition({isVoid:!0}),br:new HtmlTagDefinition({isVoid:!0}),source:new HtmlTagDefinition({isVoid:!0}),track:new HtmlTagDefinition({isVoid:!0}),wbr:new HtmlTagDefinition({isVoid:!0}),p:new HtmlTagDefinition({closedByChildren:["address","article","aside","blockquote","div","dl","fieldset","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","main","nav","ol","p","pre","section","table","ul"],closedByParent:!0}),thead:new HtmlTagDefinition({closedByChildren:["tbody","tfoot"]}),tbody:new HtmlTagDefinition({closedByChildren:["tbody","tfoot"],closedByParent:!0}),tfoot:new HtmlTagDefinition({closedByChildren:["tbody"],closedByParent:!0}),tr:new HtmlTagDefinition({closedByChildren:["tr"],requiredParents:["tbody","tfoot","thead"],closedByParent:!0}),td:new HtmlTagDefinition({closedByChildren:["td","th"],closedByParent:!0}),th:new HtmlTagDefinition({closedByChildren:["td","th"],closedByParent:!0}),col:new HtmlTagDefinition({requiredParents:["colgroup"],isVoid:!0}),svg:new HtmlTagDefinition({implicitNamespacePrefix:"svg"}),math:new HtmlTagDefinition({implicitNamespacePrefix:"math"}),li:new HtmlTagDefinition({closedByChildren:["li"],closedByParent:!0}),dt:new HtmlTagDefinition({closedByChildren:["dt","dd"]}),dd:new HtmlTagDefinition({closedByChildren:["dt","dd"],closedByParent:!0}),rb:new HtmlTagDefinition({closedByChildren:["rb","rt","rtc","rp"],closedByParent:!0}),rt:new HtmlTagDefinition({closedByChildren:["rb","rt","rtc","rp"],closedByParent:!0}),rtc:new HtmlTagDefinition({closedByChildren:["rb","rtc","rp"],closedByParent:!0}),rp:new HtmlTagDefinition({closedByChildren:["rb","rt","rtc","rp"],closedByParent:!0}),optgroup:new HtmlTagDefinition({closedByChildren:["optgroup"],closedByParent:!0}),option:new HtmlTagDefinition({closedByChildren:["option","optgroup"],closedByParent:!0}),pre:new HtmlTagDefinition({ignoreFirstLf:!0}),listing:new HtmlTagDefinition({ignoreFirstLf:!0}),style:new HtmlTagDefinition({contentType:TagContentType.RAW_TEXT}),script:new HtmlTagDefinition({contentType:TagContentType.RAW_TEXT}),title:new HtmlTagDefinition({contentType:TagContentType.ESCAPABLE_RAW_TEXT}),textarea:new HtmlTagDefinition({contentType:TagContentType.ESCAPABLE_RAW_TEXT,ignoreFirstLf:!0})},_DEFAULT_TAG_DEFINITION=new HtmlTagDefinition,_SELECTOR_REGEXP=new RegExp("(\\:not\\()|([-\\w]+)|(?:\\.([-\\w]+))|(?:\\[([-.\\w*]+)(?:=([^\\]]*))?\\])|(\\))|(\\s*,\\s*)","g"),CssSelector=function(){function CssSelector(){this.element=null,this.classNames=[],this.attrs=[],this.notSelectors=[]}return CssSelector.parse=function(selector){var match,results=[],_addResult=function(res,cssSel){cssSel.notSelectors.length>0&&!cssSel.element&&0==cssSel.classNames.length&&0==cssSel.attrs.length&&(cssSel.element="*"),res.push(cssSel)},cssSelector=new CssSelector,current=cssSelector,inNot=!1;for(_SELECTOR_REGEXP.lastIndex=0;match=_SELECTOR_REGEXP.exec(selector);){if(match[1]){if(inNot)throw new Error("Nesting :not is not allowed in a selector");inNot=!0,current=new CssSelector,cssSelector.notSelectors.push(current)}if(match[2]&&current.setElement(match[2]),match[3]&&current.addClassName(match[3]),match[4]&&current.addAttribute(match[4],match[5]),match[6]&&(inNot=!1,current=cssSelector),match[7]){if(inNot)throw new Error("Multiple selectors in :not are not supported");_addResult(results,cssSelector),cssSelector=current=new CssSelector}}return _addResult(results,cssSelector),results},CssSelector.prototype.isElementSelector=function(){return this.hasElementSelector()&&0==this.classNames.length&&0==this.attrs.length&&0===this.notSelectors.length},CssSelector.prototype.hasElementSelector=function(){return!!this.element},CssSelector.prototype.setElement=function(element){void 0===element&&(element=null),this.element=element},CssSelector.prototype.getMatchingElementTemplate=function(){for(var tagName=this.element||"div",classAttr=this.classNames.length>0?' class="'+this.classNames.join(" ")+'"':"",attrs="",i=0;i<this.attrs.length;i+=2){var attrName=this.attrs[i],attrValue=""!==this.attrs[i+1]?'="'+this.attrs[i+1]+'"':"";attrs+=" "+attrName+attrValue}return getHtmlTagDefinition(tagName).isVoid?"<"+tagName+classAttr+attrs+"/>":"<"+tagName+classAttr+attrs+"></"+tagName+">"},CssSelector.prototype.addAttribute=function(name,value){void 0===value&&(value=""),this.attrs.push(name,value&&value.toLowerCase()||"")},CssSelector.prototype.addClassName=function(name){this.classNames.push(name.toLowerCase())},CssSelector.prototype.toString=function(){var res=this.element||"";if(this.classNames&&this.classNames.forEach(function(klass){return res+="."+klass}),this.attrs)for(var i=0;i<this.attrs.length;i+=2){var name=this.attrs[i],value=this.attrs[i+1];res+="["+name+(value?"="+value:"")+"]"}return this.notSelectors.forEach(function(notSelector){return res+=":not("+notSelector+")"}),res},CssSelector}(),SelectorMatcher=function(){function SelectorMatcher(){this._elementMap=new Map,this._elementPartialMap=new Map,this._classMap=new Map,this._classPartialMap=new Map,this._attrValueMap=new Map,this._attrValuePartialMap=new Map,this._listContexts=[]}return SelectorMatcher.createNotMatcher=function(notSelectors){var notMatcher=new SelectorMatcher;return notMatcher.addSelectables(notSelectors,null),notMatcher},SelectorMatcher.prototype.addSelectables=function(cssSelectors,callbackCtxt){var listContext=null;cssSelectors.length>1&&(listContext=new SelectorListContext(cssSelectors),this._listContexts.push(listContext));for(var i=0;i<cssSelectors.length;i++)this._addSelectable(cssSelectors[i],callbackCtxt,listContext)},SelectorMatcher.prototype._addSelectable=function(cssSelector,callbackCtxt,listContext){var matcher=this,element=cssSelector.element,classNames=cssSelector.classNames,attrs=cssSelector.attrs,selectable=new SelectorContext(cssSelector,callbackCtxt,listContext);if(element){var isTerminal=0===attrs.length&&0===classNames.length;isTerminal?this._addTerminal(matcher._elementMap,element,selectable):matcher=this._addPartial(matcher._elementPartialMap,element)}if(classNames)for(var i=0;i<classNames.length;i++){var isTerminal=0===attrs.length&&i===classNames.length-1,className=classNames[i];isTerminal?this._addTerminal(matcher._classMap,className,selectable):matcher=this._addPartial(matcher._classPartialMap,className)}if(attrs)for(var i=0;i<attrs.length;i+=2){var isTerminal=i===attrs.length-2,name=attrs[i],value=attrs[i+1];if(isTerminal){var terminalMap=matcher._attrValueMap,terminalValuesMap=terminalMap.get(name);terminalValuesMap||(terminalValuesMap=new Map,terminalMap.set(name,terminalValuesMap)),this._addTerminal(terminalValuesMap,value,selectable)}else{var partialMap=matcher._attrValuePartialMap,partialValuesMap=partialMap.get(name);partialValuesMap||(partialValuesMap=new Map,partialMap.set(name,partialValuesMap)),matcher=this._addPartial(partialValuesMap,value)}}},SelectorMatcher.prototype._addTerminal=function(map,name,selectable){var terminalList=map.get(name);terminalList||(terminalList=[],map.set(name,terminalList)),terminalList.push(selectable)},SelectorMatcher.prototype._addPartial=function(map,name){var matcher=map.get(name);return matcher||(matcher=new SelectorMatcher,map.set(name,matcher)),matcher},SelectorMatcher.prototype.match=function(cssSelector,matchedCallback){for(var result=!1,element=cssSelector.element,classNames=cssSelector.classNames,attrs=cssSelector.attrs,i=0;i<this._listContexts.length;i++)this._listContexts[i].alreadyMatched=!1;if(result=this._matchTerminal(this._elementMap,element,cssSelector,matchedCallback)||result,result=this._matchPartial(this._elementPartialMap,element,cssSelector,matchedCallback)||result,classNames)for(var i=0;i<classNames.length;i++){var className=classNames[i];result=this._matchTerminal(this._classMap,className,cssSelector,matchedCallback)||result,result=this._matchPartial(this._classPartialMap,className,cssSelector,matchedCallback)||result}if(attrs)for(var i=0;i<attrs.length;i+=2){var name=attrs[i],value=attrs[i+1],terminalValuesMap=this._attrValueMap.get(name);value&&(result=this._matchTerminal(terminalValuesMap,"",cssSelector,matchedCallback)||result),result=this._matchTerminal(terminalValuesMap,value,cssSelector,matchedCallback)||result;var partialValuesMap=this._attrValuePartialMap.get(name);value&&(result=this._matchPartial(partialValuesMap,"",cssSelector,matchedCallback)||result),result=this._matchPartial(partialValuesMap,value,cssSelector,matchedCallback)||result}return result},SelectorMatcher.prototype._matchTerminal=function(map,name,cssSelector,matchedCallback){if(!map||"string"!=typeof name)return!1;var selectables=map.get(name)||[],starSelectables=map.get("*");if(starSelectables&&(selectables=selectables.concat(starSelectables)),0===selectables.length)return!1;for(var selectable,result=!1,i=0;i<selectables.length;i++)selectable=selectables[i],result=selectable.finalize(cssSelector,matchedCallback)||result;return result},SelectorMatcher.prototype._matchPartial=function(map,name,cssSelector,matchedCallback){if(!map||"string"!=typeof name)return!1;var nestedSelector=map.get(name);return!!nestedSelector&&nestedSelector.match(cssSelector,matchedCallback)},SelectorMatcher}(),SelectorListContext=function(){function SelectorListContext(selectors){this.selectors=selectors,this.alreadyMatched=!1}return SelectorListContext}(),SelectorContext=function(){function SelectorContext(selector,cbContext,listContext){this.selector=selector,this.cbContext=cbContext,this.listContext=listContext,this.notSelectors=selector.notSelectors}return SelectorContext.prototype.finalize=function(cssSelector,callback){var result=!0;if(this.notSelectors.length>0&&(!this.listContext||!this.listContext.alreadyMatched)){var notMatcher=SelectorMatcher.createNotMatcher(this.notSelectors);result=!notMatcher.match(cssSelector,null)}return!result||!callback||this.listContext&&this.listContext.alreadyMatched||(this.listContext&&(this.listContext.alreadyMatched=!0),callback(this.selector,this.cbContext)),result},SelectorContext}(),CLASS_ATTR="class",PropertyBinding=function(){function PropertyBinding(binding){this.binding=binding,this.parseBinding()}return PropertyBinding.prototype.parseBinding=function(){var parts=this.binding.split(":");this.prop=parts[0].trim(),this.attr=(parts[1]||this.prop).trim(),this.bracketAttr="["+this.attr+"]",this.parenAttr="("+this.attr+")",this.bracketParenAttr="[("+this.attr+")]";var capitalAttr=this.attr.charAt(0).toUpperCase()+this.attr.substr(1);this.onAttr="on"+capitalAttr,this.bindAttr="bind"+capitalAttr,this.bindonAttr="bindon"+capitalAttr},PropertyBinding}(),NgContentSelectorHelper=function(){function NgContentSelectorHelper(){}return NgContentSelectorHelper.prototype.getNgContentSelectors=function(info){return info.selectors||["*"]},NgContentSelectorHelper}(),Deferred=function(){function Deferred(){var _this=this;this.promise=new Promise(function(res,rej){_this.resolve=res,_this.reject=rej})}return Deferred}(),INITIAL_VALUE={__UNINITIALIZED__:!0},DowngradeComponentAdapter=function(){function DowngradeComponentAdapter(id,info,element,attrs,scope,ngModel,parentInjector,$injector,$compile,$parse,componentFactory){this.id=id,this.info=info,this.element=element,this.attrs=attrs,this.scope=scope,this.ngModel=ngModel,this.parentInjector=parentInjector,this.$injector=$injector,this.$compile=$compile,this.$parse=$parse,this.componentFactory=componentFactory,this.inputChangeCount=0,this.inputChanges=null,this.componentRef=null,this.component=null,this.changeDetector=null,this.element[0].id=id,this.componentScope=scope.$new()}return DowngradeComponentAdapter.prototype.compileContents=function(){var _this=this,compiledProjectableNodes=[],projectableNodes=this.groupProjectableNodes(),linkFns=projectableNodes.map(function(nodes){return _this.$compile(nodes)});return this.element.empty(),linkFns.forEach(function(linkFn){linkFn(_this.scope,function(clone){compiledProjectableNodes.push(clone),_this.element.append(clone)})}),compiledProjectableNodes},DowngradeComponentAdapter.prototype.createComponent=function(projectableNodes){var childInjector=_angular_core.ReflectiveInjector.resolveAndCreate([{provide:$SCOPE,useValue:this.componentScope}],this.parentInjector);this.componentRef=this.componentFactory.create(childInjector,projectableNodes,this.element[0]),this.changeDetector=this.componentRef.changeDetectorRef,this.component=this.componentRef.instance,hookupNgModel(this.ngModel,this.component)},DowngradeComponentAdapter.prototype.setupInputs=function(){for(var _this=this,attrs=this.attrs,inputs=this.info.inputs||[],i=0;i<inputs.length;i++){var input=new PropertyBinding(inputs[i]),expr=null;if(attrs.hasOwnProperty(input.attr)){var observeFn=function(prop){var prevValue=INITIAL_VALUE;return function(currValue){prevValue===INITIAL_VALUE&&(prevValue=currValue),_this.updateInput(prop,prevValue,currValue),prevValue=currValue}}(input.prop);attrs.$observe(input.attr,observeFn)}else attrs.hasOwnProperty(input.bindAttr)?expr=attrs[input.bindAttr]:attrs.hasOwnProperty(input.bracketAttr)?expr=attrs[input.bracketAttr]:attrs.hasOwnProperty(input.bindonAttr)?expr=attrs[input.bindonAttr]:attrs.hasOwnProperty(input.bracketParenAttr)&&(expr=attrs[input.bracketParenAttr]);if(null!=expr){var watchFn=function(prop){return function(currValue,prevValue){return _this.updateInput(prop,prevValue,currValue)}}(input.prop);this.componentScope.$watch(expr,watchFn)}}var prototype=this.info.component.prototype;prototype&&prototype.ngOnChanges&&(this.inputChanges={},this.componentScope.$watch(function(){return _this.inputChangeCount},function(){var inputChanges=_this.inputChanges;_this.inputChanges={},_this.component.ngOnChanges(inputChanges)})),this.componentScope.$watch(function(){return _this.changeDetector&&_this.changeDetector.detectChanges()})},DowngradeComponentAdapter.prototype.setupOutputs=function(){for(var _this=this,attrs=this.attrs,outputs=this.info.outputs||[],j=0;j<outputs.length;j++){var output=new PropertyBinding(outputs[j]),expr=null,assignExpr=!1,bindonAttr=output.bindonAttr?output.bindonAttr.substring(0,output.bindonAttr.length-6):null,bracketParenAttr=output.bracketParenAttr?"[("+output.bracketParenAttr.substring(2,output.bracketParenAttr.length-8)+")]":null;if(attrs.hasOwnProperty(output.onAttr)?expr=attrs[output.onAttr]:attrs.hasOwnProperty(output.parenAttr)?expr=attrs[output.parenAttr]:attrs.hasOwnProperty(bindonAttr)?(expr=attrs[bindonAttr],assignExpr=!0):attrs.hasOwnProperty(bracketParenAttr)&&(expr=attrs[bracketParenAttr],assignExpr=!0),null!=expr&&null!=assignExpr){var getter=this.$parse(expr),setter=getter.assign;if(assignExpr&&!setter)throw new Error("Expression '"+expr+"' is not assignable!");var emitter=this.component[output.prop];if(!emitter)throw new Error("Missing emitter '"+output.prop+"' on component '"+getComponentName(this.info.component)+"'!");emitter.subscribe({next:assignExpr?function(setter){return function(v){return setter(_this.scope,v)}}(setter):function(getter){return function(v){return getter(_this.scope,{$event:v})}}(getter)})}}},DowngradeComponentAdapter.prototype.registerCleanup=function(){var _this=this;this.element.bind("$destroy",function(){_this.componentScope.$destroy(),_this.componentRef.destroy()})},DowngradeComponentAdapter.prototype.getInjector=function(){return this.componentRef&&this.componentRef.injector},DowngradeComponentAdapter.prototype.updateInput=function(prop,prevValue,currValue){this.inputChanges&&(this.inputChangeCount++,this.inputChanges[prop]=new _angular_core.SimpleChange(prevValue,currValue,prevValue===currValue)),this.component[prop]=currValue},DowngradeComponentAdapter.prototype.groupProjectableNodes=function(){var ngContentSelectorHelper=this.parentInjector.get(NgContentSelectorHelper),ngContentSelectors=ngContentSelectorHelper.getNgContentSelectors(this.info);if(!ngContentSelectors)throw new Error("Expecting ngContentSelectors for: "+getComponentName(this.info.component));return this._groupNodesBySelector(ngContentSelectors,this.element.contents())},DowngradeComponentAdapter.prototype._groupNodesBySelector=function(ngContentSelectors,nodes){for(var wildcardNgContentIndex,projectableNodes=[],matcher=new SelectorMatcher,i=0,ii=ngContentSelectors.length;i<ii;++i){projectableNodes[i]=[];var selector=ngContentSelectors[i];"*"===selector?wildcardNgContentIndex=i:matcher.addSelectables(CssSelector.parse(selector),i)}for(var _loop_1=function(j,jj){var ngContentIndices=[],node=nodes[j],selector=createElementCssSelector(node.nodeName.toLowerCase(),getAttributesAsArray(node));matcher.match(selector,function(_,index){return ngContentIndices.push(index)}),ngContentIndices.sort(),void 0!==wildcardNgContentIndex&&ngContentIndices.push(wildcardNgContentIndex),ngContentIndices.length&&projectableNodes[ngContentIndices[0]].push(node)},j=0,jj=nodes.length;j<jj;++j)_loop_1(j,jj);return projectableNodes},DowngradeComponentAdapter}(),downgradeCount=0,ParentInjectorPromise$1=function(){function ParentInjectorPromise$1(element){this.element=element,this.injectorKey=controllerKey(INJECTOR_KEY),this.callbacks=[],element.data(this.injectorKey,this)}return ParentInjectorPromise$1.prototype.then=function(callback){this.injector?callback(this.injector):this.callbacks.push(callback)},ParentInjectorPromise$1.prototype.resolve=function(injector){this.injector=injector,this.element.data(this.injectorKey,injector),this.element=null,this.callbacks.forEach(function(callback){return callback(injector)}),this.callbacks.length=0},ParentInjectorPromise$1}(),DynamicNgContentSelectorHelper=function(_super){function DynamicNgContentSelectorHelper(compiler){var _this=_super.call(this)||this;return _this.compiler=compiler,_this}return __extends(DynamicNgContentSelectorHelper,_super),DynamicNgContentSelectorHelper.prototype.getNgContentSelectors=function(info){return this.compiler.getNgContentSelectors(info.component)},DynamicNgContentSelectorHelper}(NgContentSelectorHelper);DynamicNgContentSelectorHelper.decorators=[{type:_angular_core.Injectable}],DynamicNgContentSelectorHelper.ctorParameters=function(){return[{type:_angular_core.Compiler}]};var CAMEL_CASE=/([A-Z])/g,INITIAL_VALUE$1={__UNINITIALIZED__:!0},NOT_SUPPORTED="NOT_SUPPORTED",UpgradeNg1ComponentAdapterBuilder=function(){function UpgradeNg1ComponentAdapterBuilder(name){this.name=name,this.inputs=[],this.inputsRename=[],this.outputs=[],this.outputsRename=[],this.propertyOutputs=[],this.checkProperties=[],this.propertyMap={},this.linkFn=null,this.directive=null,this.$controller=null;var selector=name.replace(CAMEL_CASE,function(all,next){return"-"+next.toLowerCase()}),self=this;this.type=_angular_core.Directive({selector:selector,inputs:this.inputsRename,outputs:this.outputsRename}).Class({constructor:[new _angular_core.Inject($SCOPE),_angular_core.ElementRef,function(scope,elementRef){return new UpgradeNg1ComponentAdapter(self.linkFn,scope,self.directive,elementRef,self.$controller,self.inputs,self.outputs,self.propertyOutputs,self.checkProperties,self.propertyMap)}],ngOnInit:function(){},ngOnChanges:function(){},ngDoCheck:function(){},ngOnDestroy:function(){}})}return UpgradeNg1ComponentAdapterBuilder.prototype.extractDirective=function(injector){var directives=injector.get(this.name+"Directive");if(directives.length>1)throw new Error("Only support single directive definition for: "+this.name);var directive=directives[0];directive.replace&&this.notSupported("replace"),directive.terminal&&this.notSupported("terminal");var link=directive.link;return"object"==typeof link&&link.post&&this.notSupported("link.post"),directive},UpgradeNg1ComponentAdapterBuilder.prototype.notSupported=function(feature){throw new Error("Upgraded directive '"+this.name+"' does not support '"+feature+"'.")},UpgradeNg1ComponentAdapterBuilder.prototype.extractBindings=function(){var btcIsObject="object"==typeof this.directive.bindToController;if(btcIsObject&&Object.keys(this.directive.scope).length)throw new Error("Binding definitions on scope and controller at the same time are not supported.");var context=btcIsObject?this.directive.bindToController:this.directive.scope;if("object"==typeof context)for(var name in context)if(context.hasOwnProperty(name)){var localName=context[name],type=localName.charAt(0),typeOptions=localName.charAt(1);localName="?"===typeOptions?localName.substr(2):localName.substr(1),localName=localName||name;var outputName="output_"+name,outputNameRename=outputName+": "+name,outputNameRenameChange=outputName+": "+name+"Change",inputName="input_"+name,inputNameRename=inputName+": "+name;switch(type){case"=":this.propertyOutputs.push(outputName),this.checkProperties.push(localName),this.outputs.push(outputName),this.outputsRename.push(outputNameRenameChange),this.propertyMap[outputName]=localName,this.inputs.push(inputName),this.inputsRename.push(inputNameRename),this.propertyMap[inputName]=localName;break;case"@":case"<":this.inputs.push(inputName),this.inputsRename.push(inputNameRename),this.propertyMap[inputName]=localName;break;case"&":this.outputs.push(outputName),this.outputsRename.push(outputNameRename),this.propertyMap[outputName]=localName;break;default:var json=JSON.stringify(context);throw new Error("Unexpected mapping '"+type+"' in '"+json+"' in '"+this.name+"' directive.")}}},UpgradeNg1ComponentAdapterBuilder.prototype.compileTemplate=function(compile,templateCache,httpBackend){function compileHtml(html){var div=document.createElement("div");return div.innerHTML=html,compile(div.childNodes)}var _this=this;if(void 0!==this.directive.template)this.linkFn=compileHtml(isFunction(this.directive.template)?this.directive.template():this.directive.template);else{if(!this.directive.templateUrl)throw new Error("Directive '"+this.name+"' is not a component, it is missing template.");var url_1=isFunction(this.directive.templateUrl)?this.directive.templateUrl():this.directive.templateUrl,html=templateCache.get(url_1);if(void 0===html)return new Promise(function(resolve,err){httpBackend("GET",url_1,null,function(status,response){200==status?resolve(_this.linkFn=compileHtml(templateCache.put(url_1,response))):err("GET "+url_1+" returned "+status+": "+response)})});this.linkFn=compileHtml(html)}return null},UpgradeNg1ComponentAdapterBuilder.resolve=function(exportedComponents,injector){var promises=[],compile=injector.get($COMPILE),templateCache=injector.get($TEMPLATE_CACHE),httpBackend=injector.get($HTTP_BACKEND),$controller=injector.get($CONTROLLER);for(var name in exportedComponents)if(exportedComponents.hasOwnProperty(name)){var exportedComponent=exportedComponents[name];exportedComponent.directive=exportedComponent.extractDirective(injector),exportedComponent.$controller=$controller,exportedComponent.extractBindings();var promise=exportedComponent.compileTemplate(compile,templateCache,httpBackend);promise&&promises.push(promise)}return Promise.all(promises)},UpgradeNg1ComponentAdapterBuilder}(),UpgradeNg1ComponentAdapter=function(){function UpgradeNg1ComponentAdapter(linkFn,scope,directive,elementRef,$controller,inputs,outputs,propOuts,checkProperties,propertyMap){this.linkFn=linkFn,this.directive=directive,this.$controller=$controller,this.inputs=inputs,this.outputs=outputs,this.propOuts=propOuts,this.checkProperties=checkProperties,this.propertyMap=propertyMap,this.controllerInstance=null,this.destinationObj=null,this.checkLastValues=[],this.$element=null,this.element=elementRef.nativeElement,this.componentScope=scope.$new(!!directive.scope),this.$element=element(this.element);var controllerType=directive.controller;directive.bindToController&&controllerType?(this.controllerInstance=this.buildController(controllerType),this.destinationObj=this.controllerInstance):this.destinationObj=this.componentScope;for(var i=0;i<inputs.length;i++)this[inputs[i]]=null;for(var j=0;j<outputs.length;j++){var emitter=this[outputs[j]]=new _angular_core.EventEmitter;this.setComponentProperty(outputs[j],function(emitter){return function(value){return emitter.emit(value)}}(emitter))}for(var k=0;k<propOuts.length;k++)this[propOuts[k]]=new _angular_core.EventEmitter,this.checkLastValues.push(INITIAL_VALUE$1)}return UpgradeNg1ComponentAdapter.prototype.ngOnInit=function(){var _this=this;!this.directive.bindToController&&this.directive.controller&&(this.controllerInstance=this.buildController(this.directive.controller)),this.controllerInstance&&isFunction(this.controllerInstance.$onInit)&&this.controllerInstance.$onInit();var link=this.directive.link;if("object"==typeof link&&(link=link.pre),link){var attrs=NOT_SUPPORTED,transcludeFn=NOT_SUPPORTED,linkController=this.resolveRequired(this.$element,this.directive.require);this.directive.link(this.componentScope,this.$element,attrs,linkController,transcludeFn)}for(var childNode,childNodes=[];childNode=this.element.firstChild;)this.element.removeChild(childNode),childNodes.push(childNode);this.linkFn(this.componentScope,function(clonedElement,scope){for(var i=0,ii=clonedElement.length;i<ii;i++)_this.element.appendChild(clonedElement[i])},{parentBoundTranscludeFn:function(scope,cloneAttach){cloneAttach(childNodes)}}),this.controllerInstance&&isFunction(this.controllerInstance.$postLink)&&this.controllerInstance.$postLink()},UpgradeNg1ComponentAdapter.prototype.ngOnChanges=function(changes){var _this=this,ng1Changes={};Object.keys(changes).forEach(function(name){var change=changes[name];_this.setComponentProperty(name,change.currentValue),ng1Changes[_this.propertyMap[name]]=change}),isFunction(this.destinationObj.$onChanges)&&this.destinationObj.$onChanges(ng1Changes)},UpgradeNg1ComponentAdapter.prototype.ngDoCheck=function(){for(var destinationObj=this.destinationObj,lastValues=this.checkLastValues,checkProperties=this.checkProperties,i=0;i<checkProperties.length;i++){var value=destinationObj[checkProperties[i]],last=lastValues[i];if(value!==last)if("number"==typeof value&&isNaN(value)&&"number"==typeof last&&isNaN(last));else{var eventEmitter=this[this.propOuts[i]];eventEmitter.emit(lastValues[i]=value)}}this.controllerInstance&&isFunction(this.controllerInstance.$doCheck)&&this.controllerInstance.$doCheck()},UpgradeNg1ComponentAdapter.prototype.ngOnDestroy=function(){this.controllerInstance&&isFunction(this.controllerInstance.$onDestroy)&&this.controllerInstance.$onDestroy()},UpgradeNg1ComponentAdapter.prototype.setComponentProperty=function(name,value){this.destinationObj[this.propertyMap[name]]=value},UpgradeNg1ComponentAdapter.prototype.buildController=function(controllerType){var locals={$scope:this.componentScope,$element:this.$element},controller=this.$controller(controllerType,locals,null,this.directive.controllerAs);return this.$element.data(controllerKey(this.directive.name),controller),controller},UpgradeNg1ComponentAdapter.prototype.resolveRequired=function($element,require){
if(require){if("string"==typeof require){var name=require,isOptional=!1,startParent=!1,searchParents=!1;"?"==name.charAt(0)&&(isOptional=!0,name=name.substr(1)),"^"==name.charAt(0)&&(searchParents=!0,name=name.substr(1)),"^"==name.charAt(0)&&(startParent=!0,name=name.substr(1));var key=controllerKey(name);startParent&&($element=$element.parent());var dep=searchParents?$element.inheritedData(key):$element.data(key);if(!dep&&!isOptional)throw new Error("Can not locate '"+require+"' in '"+this.directive.name+"'.");return dep}if(require instanceof Array){for(var deps=[],i=0;i<require.length;i++)deps.push(this.resolveRequired($element,require[i]));return deps}throw new Error("Directive '"+this.directive.name+"' require syntax unrecognized: "+this.directive.require)}},UpgradeNg1ComponentAdapter}(),upgradeCount=0,UpgradeAdapter=function(){function UpgradeAdapter(ng2AppModule,compilerOptions){if(this.ng2AppModule=ng2AppModule,this.compilerOptions=compilerOptions,this.idPrefix="NG2_UPGRADE_"+upgradeCount++ +"_",this.directiveResolver=new _angular_compiler.DirectiveResolver,this.downgradedComponents=[],this.ng1ComponentsToBeUpgraded={},this.upgradedProviders=[],this.moduleRef=null,!ng2AppModule)throw new Error("UpgradeAdapter cannot be instantiated without an NgModule of the Angular app.")}return UpgradeAdapter.prototype.downgradeNg2Component=function(component){this.downgradedComponents.push(component);var metadata=this.directiveResolver.resolve(component),info={component:component,inputs:metadata.inputs,outputs:metadata.outputs};return downgradeComponent(info)},UpgradeAdapter.prototype.upgradeNg1Component=function(name){return this.ng1ComponentsToBeUpgraded.hasOwnProperty(name)?this.ng1ComponentsToBeUpgraded[name].type:(this.ng1ComponentsToBeUpgraded[name]=new UpgradeNg1ComponentAdapterBuilder(name)).type},UpgradeAdapter.prototype.registerForNg1Tests=function(modules){var _this=this,windowNgMock=window.angular.mock;if(!windowNgMock||!windowNgMock.module)throw new Error("Failed to find 'angular.mock.module'.");this.declareNg1Module(modules),windowNgMock.module(this.ng1Module.name);var upgrade=new UpgradeAdapterRef;return this.ng2BootstrapDeferred.promise.then(function(ng1Injector){upgrade._bootstrapDone(_this.moduleRef,ng1Injector)},onError),upgrade},UpgradeAdapter.prototype.bootstrap=function(element$$,modules,config){var _this=this;this.declareNg1Module(modules);var upgrade=new UpgradeAdapterRef,windowAngular=window.angular;windowAngular.resumeBootstrap=void 0,this.ngZone.run(function(){bootstrap(element$$,[_this.ng1Module.name],config)});var ng1BootstrapPromise=new Promise(function(resolve){if(windowAngular.resumeBootstrap){var originalResumeBootstrap_1=windowAngular.resumeBootstrap;windowAngular.resumeBootstrap=function(){windowAngular.resumeBootstrap=originalResumeBootstrap_1,windowAngular.resumeBootstrap.apply(this,arguments),resolve()}}else resolve()});return Promise.all([this.ng2BootstrapDeferred.promise,ng1BootstrapPromise]).then(function(_a){var ng1Injector=_a[0];element(element$$).data(controllerKey(INJECTOR_KEY),_this.moduleRef.injector),_this.moduleRef.injector.get(_angular_core.NgZone).run(function(){upgrade._bootstrapDone(_this.moduleRef,ng1Injector)})},onError),upgrade},UpgradeAdapter.prototype.upgradeNg1Provider=function(name,options){var token=options&&options.asToken||name;this.upgradedProviders.push({provide:token,useFactory:function($injector){return $injector.get(name)},deps:[$INJECTOR]})},UpgradeAdapter.prototype.downgradeNg2Provider=function(token){return downgradeInjectable(token)},UpgradeAdapter.prototype.declareNg1Module=function(modules){var _this=this;void 0===modules&&(modules=[]);var original$applyFn,rootScopePrototype,rootScope,delayApplyExps=[],upgradeAdapter=this,ng1Module=this.ng1Module=module$1(this.idPrefix,modules),platformRef=_angular_platformBrowserDynamic.platformBrowserDynamic();return this.ngZone=new _angular_core.NgZone({enableLongStackTrace:Zone.hasOwnProperty("longStackTraceZoneSpec")}),this.ng2BootstrapDeferred=new Deferred,ng1Module.factory(INJECTOR_KEY,function(){return _this.moduleRef.injector.get(_angular_core.Injector)}).constant(NG_ZONE_KEY,this.ngZone).factory(COMPILER_KEY,function(){return _this.moduleRef.injector.get(_angular_core.Compiler)}).config(["$provide","$injector",function(provide,ng1Injector){provide.decorator($ROOT_SCOPE,["$delegate",function(rootScopeDelegate){if(rootScopePrototype=rootScopeDelegate.constructor.prototype,!rootScopePrototype.hasOwnProperty("$apply"))throw new Error("Failed to find '$apply' on '$rootScope'!");return original$applyFn=rootScopePrototype.$apply,rootScopePrototype.$apply=function(exp){return delayApplyExps.push(exp)},rootScope=rootScopeDelegate}]),ng1Injector.has($$TESTABILITY)&&provide.decorator($$TESTABILITY,["$delegate",function(testabilityDelegate){var originalWhenStable=testabilityDelegate.whenStable,newWhenStable=function(callback){originalWhenStable.call(this,function(){var ng2Testability=upgradeAdapter.moduleRef.injector.get(_angular_core.Testability);ng2Testability.isStable()?callback.apply(this,arguments):ng2Testability.whenStable(newWhenStable.bind(this,callback))})};return testabilityDelegate.whenStable=newWhenStable,testabilityDelegate}])}]),ng1Module.run(["$injector","$rootScope",function(ng1Injector,rootScope){UpgradeNg1ComponentAdapterBuilder.resolve(_this.ng1ComponentsToBeUpgraded,ng1Injector).then(function(){var DynamicNgUpgradeModule=_angular_core.NgModule({providers:[{provide:$INJECTOR,useFactory:function(){return ng1Injector}},{provide:$COMPILE,useFactory:function(){return ng1Injector.get($COMPILE)}},{provide:NgContentSelectorHelper,useClass:DynamicNgContentSelectorHelper},_this.upgradedProviders],imports:[_this.ng2AppModule],entryComponents:_this.downgradedComponents}).Class({constructor:function(){},ngDoBootstrap:function(){}});platformRef._bootstrapModuleWithZone(DynamicNgUpgradeModule,_this.compilerOptions,_this.ngZone).then(function(ref){_this.moduleRef=ref,_this.ngZone.run(function(){if(rootScopePrototype){for(rootScopePrototype.$apply=original$applyFn;delayApplyExps.length;)rootScope.$apply(delayApplyExps.shift());rootScopePrototype=null}})}).then(function(){return _this.ng2BootstrapDeferred.resolve(ng1Injector)},onError).then(function(){var subscription=_this.ngZone.onMicrotaskEmpty.subscribe({next:function(){return rootScope.$digest()}});rootScope.$on("$destroy",function(){subscription.unsubscribe()})})}).catch(function(e){return _this.ng2BootstrapDeferred.reject(e)})}]),ng1Module},UpgradeAdapter}(),UpgradeAdapterRef=function(){function UpgradeAdapterRef(){this._readyFn=null,this.ng1RootScope=null,this.ng1Injector=null,this.ng2ModuleRef=null,this.ng2Injector=null}return UpgradeAdapterRef.prototype._bootstrapDone=function(ngModuleRef,ng1Injector){this.ng2ModuleRef=ngModuleRef,this.ng2Injector=ngModuleRef.injector,this.ng1Injector=ng1Injector,this.ng1RootScope=ng1Injector.get($ROOT_SCOPE),this._readyFn&&this._readyFn(this)},UpgradeAdapterRef.prototype.ready=function(fn){this._readyFn=fn},UpgradeAdapterRef.prototype.dispose=function(){this.ng1Injector.get($ROOT_SCOPE).$destroy(),this.ng2ModuleRef.destroy()},UpgradeAdapterRef}();exports.VERSION=VERSION,exports.UpgradeAdapter=UpgradeAdapter,exports.UpgradeAdapterRef=UpgradeAdapterRef});
//# sourceMappingURL=upgrade.umd.min.js.map
{
"name": "@angular/upgrade",
"version": "4.0.0-rc.3",
"version": "4.0.0-rc.4",
"description": "Angular - the library for easing update from v1 to v2",

@@ -8,10 +8,10 @@ "main": "./bundles/upgrade.umd.js",

"es2015": "./@angular/upgrade.js",
"typings": "./typings/upgrade.d.ts",
"typings": "./upgrade.d.ts",
"author": "angular",
"license": "MIT",
"peerDependencies": {
"@angular/core": "4.0.0-rc.3",
"@angular/compiler": "4.0.0-rc.3",
"@angular/platform-browser": "4.0.0-rc.3",
"@angular/platform-browser-dynamic": "4.0.0-rc.3"
"@angular/core": "4.0.0-rc.4",
"@angular/compiler": "4.0.0-rc.4",
"@angular/platform-browser": "4.0.0-rc.4",
"@angular/platform-browser-dynamic": "4.0.0-rc.4"
},

@@ -18,0 +18,0 @@ "repository": {

{
"typings": "../typings/static/index.d.ts",
"typings": "../static.d.ts",
"main": "../bundles/upgrade-static.umd.js",

@@ -4,0 +4,0 @@ "module": "../@angular/upgrade/static.es5.js",

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc