UNPKG

147 kBSource Map (JSON)View Raw
1{"version":3,"sources":["packages/upgrade/upgrade.umd.js"],"names":["global","factory","exports","module","require","define","amd","self","ng","upgrade","core","platformBrowserDynamic","this","VERSION","Version","extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","hasOwnProperty","__extends","__","constructor","prototype","create","__read","o","n","m","Symbol","iterator","r","e","i","call","ar","next","done","push","value","error","__spread","arguments","length","concat","noNg","Error","noNgElement","cleanData","angular","bootstrap","element","injector","version","undefined","resumeBootstrap","getTestability","window","_a","nodes","INJECTOR_KEY","PropertyBinding","prop","attr","parseBinding","bracketAttr","parenAttr","bracketParenAttr","capitalAttr","charAt","toUpperCase","substr","onAttr","bindAttr","bindonAttr","DIRECTIVE_PREFIX_REGEXP","DIRECTIVE_SPECIAL_CHARS_REGEXP","onError","console","stack","log","controllerKey","name","getTypeName","type","overriddenName","toString","split","getDowngradedModuleCount","$injector","has","get","getUpgradeAppType","isFunction","validateInjectionKey","downgradedModule","injectionKey","attemptedAction","upgradeAppType","downgradedModuleCount","Deferred","_this","promise","Promise","res","rej","resolve","reject","strictEquals","val1","val2","_matches","INITIAL_VALUE","__UNINITIALIZED__","DowngradeComponentAdapter","attrs","scope","ngModel","parentInjector","$compile","$parse","componentFactory","wrapCallback","implementsOnChanges","inputChangeCount","inputChanges","componentScope","$new","compileContents","compiledProjectableNodes","linkFns","groupProjectableNodes","map","empty","forEach","linkFn","clone","append","createComponent","projectableNodes","childInjector","Injector","providers","provide","useValue","parent","componentRef","viewChangeDetector","ChangeDetectorRef","changeDetector","changeDetectorRef","component","instance","testability","Testability","TestabilityRegistry","registerApplication","location","nativeElement","hookupNgModel","supportsNgModel","writeValue","registerOnChange","$render","$viewValue","$setViewValue","bind","registerOnTouched","$setTouched","setupInputs","manuallyAttachView","propagateDigest","inputs","_loop_1","prevValue","input","propName","templateName","expr","observeFn_1","currValue","updateInput","$observe","unwatch_1","this_1","$watch","watchFn","detectChanges","componentType","ngOnChanges","markForCheck","unwatch_2","ApplicationRef","attachView","hostView","setupOutputs","outputs","j","output","substring","subscribeToOutput","isAssignment","getter","setter","assign","emitter","subscribe","v","$event","registerCleanup","testabilityRegistry","destroyComponentRef","destroy","destroyed","on","$destroy","$on","unregisterApplication","getInjector","SimpleChange","groupNodesBySelector","ngContentSelectors","ii","jj","node","ngContentIndex","findMatchingNgContentIndex","contents","ngContentIndices","wildcardNgContentIndex","selector","matchesSelector","sort","el","elProto","Element","matches","mozMatchesSelector","msMatchesSelector","oMatchesSelector","webkitMatchesSelector","nodeType","Node","ELEMENT_NODE","SyncPromise","resolved","callbacks","all","valuesOrPromises","aggrPromise","resolvedCount","results","idx","isThenable","obj","then","callback","ParentInjectorPromise","_super","injectorKey","data","REQUIRE_PREFIX_RE","UpgradeHelper","elementRef","directive","$controller","$element","getDirective","directives","compile","link","notSupported","replace","terminal","getTemplate","fetchRemoteTemplate","template","getOrCall","templateUrl","$templateCache_1","url_1","$httpBackend","status","response","put","buildController","controllerType","$scope","controller","controllerAs","compileTemplate","compileHtml","onDestroy","controllerInstance","$onDestroy","querySelectorAll","prepareTransclusion","transclude","contentChildNodes","extractChildNodes","attachChildrenFn","cloneAttachFn","$template","slots_1","slotMap_1","filledSlots_1","keys","slotName","optional","directiveNormalize","_","letter","nodeName","toLowerCase","filter","cloneAttach","$$slots","TEXT_NODE","nodeValue","resolveAndBindRequiredControllers","directiveRequire","getDirectiveRequire","requiredControllers","resolveRequire","bindToController","isMap","requiredControllersMap_1","key","html","innerHTML","childNodes","childNode","firstChild","removeChild","match","isArray","req","value_1","inheritType","isOptional","searchParents","startOnParent","ctrlKey","elem","inheritedData","property","args","_i","apply","feature","CAMEL_CASE","INITIAL_VALUE$1","UpgradeNg1ComponentAdapterBuilder","inputsRename","outputsRename","propertyOutputs","checkProperties","propertyMap","MyClass","UpgradeNg1ComponentAdapter","decorators","Directive","jit","ctorParameters","Inject","ElementRef","extractBindings","btcIsObject","context","definition","bindingType","bindingOptions","attrName","inputName","inputNameRename","outputName","outputNameRename","outputNameRenameChange","json","JSON","stringify","exportedComponents","promises","exportedComponent","helper","propOuts","destinationObj","checkLastValues","EventEmitter","indexOf","setComponentProperty","emit","k","ngOnInit","attachChildNodes","$onInit","preLink","pre","postLink","post","parentBoundTranscludeFn","$postLink","changes","ng1Changes","change","currentValue","$onChanges","ngDoCheck","lastValues","$doCheck","ngOnDestroy","String","upgradeCount","UpgradeAdapter","ng2AppModule","compilerOptions","idPrefix","downgradedComponents","ng1ComponentsToBeUpgraded","upgradedProviders","moduleRef","downgradeNg2Component","downgradeComponent","info","directiveFactory","ngZone","isNgUpgradeLite","cb","NgZone","isInAngularZone","run","hasMultipleDowngradedModules","restrict","required","moduleInjector","ranAsync","lazyModuleRefKey","lazyModuleRef","doDowngrade","ComponentFactoryResolver","resolveComponentFactory","injectorPromise","facade","$evalAsync","downgradeFn","pInjector","mInjector","_b","upgradeNg1Component","registerForNg1Tests","modules","windowNgMock","mock","declareNg1Module","ng1Module","UpgradeAdapterRef","ng2BootstrapDeferred","ng1Injector","_bootstrapDone","element$1","config","windowAngular","ng1BootstrapPromise","originalResumeBootstrap_1","upgradeNg1Provider","options","asToken","useFactory","deps","downgradeNg2Provider","token","downgradeInjectable","injectableName","original$applyFn","rootScopePrototype","delayApplyExps","upgradeAdapter","platformRef","enableLongStackTrace","Zone","constant","Compiler","decorator","rootScopeDelegate","$apply","exp","testabilityDelegate","originalWhenStable","whenStable","newWhenStable","ng2Testability","isStable","rootScope","ngModule","imports","resolveForwardRef","entryComponents","DynamicNgUpgradeModule","ngDoBootstrap","NgModule","bootstrapModule","ref","shift","subscription","onMicrotaskEmpty","$$phase","isDevMode","warn","$digest","unsubscribe","catch","_readyFn","ng1RootScope","ng2ModuleRef","ng2Injector","ngModuleRef","ready","fn","dispose","defineProperty"],"mappings":";;;;;CAMC,SAAUA,EAAQC,GACI,iBAAZC,SAA0C,oBAAXC,OAAyBF,EAAQC,QAASE,QAAQ,iBAAkBA,QAAQ,sCAChG,mBAAXC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AAQ,SAAUC,GAC1C7f,KAAKuf,SAAWM,GAKpB9D,EAAkBhb,UAAU+e,QAAU,WAClC9f,KAAKic,YAAY9W,IA32DP,cA22DwB4H,WAClC/M,KAAKyf,aAAa7S,WAEfmP,EAlC2B;;;;;;;;;;;;;;;AA0DtCzc,EAAQ+Z,eAAiBA,EACzB/Z,EAAQyc,kBAAoBA,EAC5Bzc,EAAQW,QAAUA,EAElBK,OAAOyf,eAAezgB,EAAS,aAAc,CAAEyC,OAAO","sourcesContent":["/**\n * @license Angular v10.0.8\n * (c) 2010-2020 Google LLC. https://angular.io/\n * License: MIT\n */\n\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/platform-browser-dynamic')) :\n typeof define === 'function' && define.amd ? define('@angular/upgrade', ['exports', '@angular/core', '@angular/platform-browser-dynamic'], factory) :\n (global = global || self, factory((global.ng = global.ng || {}, global.ng.upgrade = {}), global.ng.core, global.ng.platformBrowserDynamic));\n}(this, (function (exports, core, platformBrowserDynamic) { 'use strict';\n\n /**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n /**\n * @publicApi\n */\n var VERSION = new core.Version('10.0.8');\n\n /*! *****************************************************************************\n Copyright (c) Microsoft Corporation.\n\n Permission to use, copy, modify, and/or distribute this software for any\n purpose with or without fee is hereby granted.\n\n THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\n REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\n AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\n INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\n LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\n OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n PERFORMANCE OF THIS SOFTWARE.\n ***************************************************************************** */\n /* global Reflect, Promise */\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b)\n if (b.hasOwnProperty(p))\n d[p] = b[p]; };\n return extendStatics(d, b);\n };\n function __extends(d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n }\n var __assign = function () {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s)\n if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n };\n function __rest(s, e) {\n var t = {};\n for (var p in s)\n if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n }\n function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\")\n r = Reflect.decorate(decorators, target, key, desc);\n else\n for (var i = decorators.length - 1; i >= 0; i--)\n if (d = decorators[i])\n r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n }\n function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); };\n }\n function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\")\n return Reflect.metadata(metadataKey, metadataValue);\n }\n function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try {\n step(generator.next(value));\n }\n catch (e) {\n reject(e);\n } }\n function rejected(value) { try {\n step(generator[\"throw\"](value));\n }\n catch (e) {\n reject(e);\n } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n }\n function __generator(thisArg, body) {\n var _ = { label: 0, sent: function () { if (t[0] & 1)\n throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function () { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f)\n throw new TypeError(\"Generator is already executing.\");\n while (_)\n try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)\n return t;\n if (y = 0, t)\n op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0:\n case 1:\n t = op;\n break;\n case 4:\n _.label++;\n return { value: op[1], done: false };\n case 5:\n _.label++;\n y = op[1];\n op = [0];\n continue;\n case 7:\n op = _.ops.pop();\n _.trys.pop();\n continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {\n _ = 0;\n continue;\n }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {\n _.label = op[1];\n break;\n }\n if (op[0] === 6 && _.label < t[1]) {\n _.label = t[1];\n t = op;\n break;\n }\n if (t && _.label < t[2]) {\n _.label = t[2];\n _.ops.push(op);\n break;\n }\n if (t[2])\n _.ops.pop();\n _.trys.pop();\n continue;\n }\n op = body.call(thisArg, _);\n }\n catch (e) {\n op = [6, e];\n y = 0;\n }\n finally {\n f = t = 0;\n }\n if (op[0] & 5)\n throw op[1];\n return { value: op[0] ? op[1] : void 0, done: true };\n }\n }\n var __createBinding = Object.create ? (function (o, m, k, k2) {\n if (k2 === undefined)\n k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });\n }) : (function (o, m, k, k2) {\n if (k2 === undefined)\n k2 = k;\n o[k2] = m[k];\n });\n function __exportStar(m, exports) {\n for (var p in m)\n if (p !== \"default\" && !exports.hasOwnProperty(p))\n __createBinding(exports, m, p);\n }\n function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m)\n return m.call(o);\n if (o && typeof o.length === \"number\")\n return {\n next: function () {\n if (o && i >= o.length)\n o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n }\n function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m)\n return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done)\n ar.push(r.value);\n }\n catch (error) {\n e = { error: error };\n }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"]))\n m.call(i);\n }\n finally {\n if (e)\n throw e.error;\n }\n }\n return ar;\n }\n function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n }\n function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++)\n s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n }\n ;\n function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n }\n function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator)\n throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\n function verb(n) { if (g[n])\n i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\n function resume(n, v) { try {\n step(g[n](v));\n }\n catch (e) {\n settle(q[0][3], e);\n } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length)\n resume(q[0][0], q[0][1]); }\n }\n function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\n }\n function __asyncValues(o) {\n if (!Symbol.asyncIterator)\n throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }\n }\n function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) {\n Object.defineProperty(cooked, \"raw\", { value: raw });\n }\n else {\n cooked.raw = raw;\n }\n return cooked;\n }\n ;\n var __setModuleDefault = Object.create ? (function (o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n }) : function (o, v) {\n o[\"default\"] = v;\n };\n function __importStar(mod) {\n if (mod && mod.__esModule)\n return mod;\n var result = {};\n if (mod != null)\n for (var k in mod)\n if (Object.hasOwnProperty.call(mod, k))\n __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n }\n function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n }\n function __classPrivateFieldGet(receiver, privateMap) {\n if (!privateMap.has(receiver)) {\n throw new TypeError(\"attempted to get private field on non-instance\");\n }\n return privateMap.get(receiver);\n }\n function __classPrivateFieldSet(receiver, privateMap, value) {\n if (!privateMap.has(receiver)) {\n throw new TypeError(\"attempted to set private field on non-instance\");\n }\n privateMap.set(receiver, value);\n return value;\n }\n\n /**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n function noNg() {\n throw new Error('AngularJS v1.x is not loaded!');\n }\n var noNgElement = (function () { return noNg(); });\n noNgElement.cleanData = noNg;\n var angular = {\n bootstrap: noNg,\n module: noNg,\n element: noNgElement,\n injector: noNg,\n version: undefined,\n resumeBootstrap: noNg,\n getTestability: noNg\n };\n try {\n if (window.hasOwnProperty('angular')) {\n angular = window.angular;\n }\n }\n catch (_a) {\n // ignore in CJS mode.\n }\n /**\n * @deprecated Use `setAngularJSGlobal` instead.\n *\n * @publicApi\n */\n function setAngularLib(ng) {\n setAngularJSGlobal(ng);\n }\n /**\n * @deprecated Use `getAngularJSGlobal` instead.\n *\n * @publicApi\n */\n function getAngularLib() {\n return getAngularJSGlobal();\n }\n /**\n * Resets the AngularJS global.\n *\n * Used when AngularJS is loaded lazily, and not available on `window`.\n *\n * @publicApi\n */\n function setAngularJSGlobal(ng) {\n angular = ng;\n }\n /**\n * Returns the current AngularJS global.\n *\n * @publicApi\n */\n function getAngularJSGlobal() {\n return angular;\n }\n var bootstrap = function (e, modules, config) { return angular.bootstrap(e, modules, config); };\n // Do not declare as `module` to avoid webpack bug\n // (see https://github.com/angular/angular/issues/30050).\n var module_ = function (prefix, dependencies) { return angular.module(prefix, dependencies); };\n var element = (function (e) { return angular.element(e); });\n element.cleanData = function (nodes) { return angular.element.cleanData(nodes); };\n var injector = function (modules, strictDi) { return angular.injector(modules, strictDi); };\n var resumeBootstrap = function () { return angular.resumeBootstrap(); };\n var getTestability = function (e) { return angular.getTestability(e); };\n\n /**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n var $COMPILE = '$compile';\n var $CONTROLLER = '$controller';\n var $DELEGATE = '$delegate';\n var $EXCEPTION_HANDLER = '$exceptionHandler';\n var $HTTP_BACKEND = '$httpBackend';\n var $INJECTOR = '$injector';\n var $INTERVAL = '$interval';\n var $PARSE = '$parse';\n var $PROVIDE = '$provide';\n var $ROOT_SCOPE = '$rootScope';\n var $SCOPE = '$scope';\n var $TEMPLATE_CACHE = '$templateCache';\n var $TEMPLATE_REQUEST = '$templateRequest';\n var $$TESTABILITY = '$$testability';\n var COMPILER_KEY = '$$angularCompiler';\n var DOWNGRADED_MODULE_COUNT_KEY = '$$angularDowngradedModuleCount';\n var GROUP_PROJECTABLE_NODES_KEY = '$$angularGroupProjectableNodes';\n var INJECTOR_KEY = '$$angularInjector';\n var LAZY_MODULE_REF = '$$angularLazyModuleRef';\n var NG_ZONE_KEY = '$$angularNgZone';\n var UPGRADE_APP_TYPE_KEY = '$$angularUpgradeAppType';\n var REQUIRE_INJECTOR = '?^^' + INJECTOR_KEY;\n var REQUIRE_NG_MODEL = '?ngModel';\n var UPGRADE_MODULE_NAME = '$$UpgradeModule';\n\n /**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n /**\n * A `PropertyBinding` represents a mapping between a property name\n * and an attribute name. It is parsed from a string of the form\n * `\"prop: attr\"`; or simply `\"propAndAttr\" where the property\n * and attribute have the same identifier.\n */\n var PropertyBinding = /** @class */ (function () {\n function PropertyBinding(prop, attr) {\n this.prop = prop;\n this.attr = attr;\n this.parseBinding();\n }\n PropertyBinding.prototype.parseBinding = function () {\n this.bracketAttr = \"[\" + this.attr + \"]\";\n this.parenAttr = \"(\" + this.attr + \")\";\n this.bracketParenAttr = \"[(\" + this.attr + \")]\";\n var capitalAttr = this.attr.charAt(0).toUpperCase() + this.attr.substr(1);\n this.onAttr = \"on\" + capitalAttr;\n this.bindAttr = \"bind\" + capitalAttr;\n this.bindonAttr = \"bindon\" + capitalAttr;\n };\n return PropertyBinding;\n }());\n\n /**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n var DIRECTIVE_PREFIX_REGEXP = /^(?:x|data)[:\\-_]/i;\n var DIRECTIVE_SPECIAL_CHARS_REGEXP = /[:\\-_]+(.)/g;\n function onError(e) {\n // TODO: (misko): We seem to not have a stack trace here!\n if (console.error) {\n console.error(e, e.stack);\n }\n else {\n // tslint:disable-next-line:no-console\n console.log(e, e.stack);\n }\n throw e;\n }\n function controllerKey(name) {\n return '$' + name + 'Controller';\n }\n function directiveNormalize(name) {\n return name.replace(DIRECTIVE_PREFIX_REGEXP, '')\n .replace(DIRECTIVE_SPECIAL_CHARS_REGEXP, function (_, letter) { return letter.toUpperCase(); });\n }\n function getTypeName(type) {\n // Return the name of the type or the first line of its stringified version.\n return type.overriddenName || type.name || type.toString().split('\\n')[0];\n }\n function getDowngradedModuleCount($injector) {\n return $injector.has(DOWNGRADED_MODULE_COUNT_KEY) ? $injector.get(DOWNGRADED_MODULE_COUNT_KEY) :\n 0;\n }\n function getUpgradeAppType($injector) {\n return $injector.has(UPGRADE_APP_TYPE_KEY) ? $injector.get(UPGRADE_APP_TYPE_KEY) :\n 0 /* None */;\n }\n function isFunction(value) {\n return typeof value === 'function';\n }\n function validateInjectionKey($injector, downgradedModule, injectionKey, attemptedAction) {\n var upgradeAppType = getUpgradeAppType($injector);\n var downgradedModuleCount = getDowngradedModuleCount($injector);\n // Check for common errors.\n switch (upgradeAppType) {\n case 1 /* Dynamic */:\n case 2 /* Static */:\n if (downgradedModule) {\n throw new Error(\"Error while \" + attemptedAction + \": 'downgradedModule' unexpectedly specified.\\n\" +\n 'You should not specify a value for \\'downgradedModule\\', unless you are downgrading ' +\n 'more than one Angular module (via \\'downgradeModule()\\').');\n }\n break;\n case 3 /* Lite */:\n if (!downgradedModule && (downgradedModuleCount >= 2)) {\n throw new Error(\"Error while \" + attemptedAction + \": 'downgradedModule' not specified.\\n\" +\n 'This application contains more than one downgraded Angular module, thus you need to ' +\n 'always specify \\'downgradedModule\\' when downgrading components and injectables.');\n }\n if (!$injector.has(injectionKey)) {\n throw new Error(\"Error while \" + attemptedAction + \": Unable to find the specified downgraded module.\\n\" +\n 'Did you forget to downgrade an Angular module or include it in the AngularJS ' +\n 'application?');\n }\n break;\n default:\n throw new Error(\"Error while \" + attemptedAction + \": Not a valid '@angular/upgrade' application.\\n\" +\n 'Did you forget to downgrade an Angular module or include it in the AngularJS ' +\n 'application?');\n }\n }\n var Deferred = /** @class */ (function () {\n function Deferred() {\n var _this = this;\n this.promise = new Promise(function (res, rej) {\n _this.resolve = res;\n _this.reject = rej;\n });\n }\n return Deferred;\n }());\n /**\n * @return Whether the passed-in component implements the subset of the\n * `ControlValueAccessor` interface needed for AngularJS `ng-model`\n * compatibility.\n */\n function supportsNgModel(component) {\n return typeof component.writeValue === 'function' &&\n typeof component.registerOnChange === 'function';\n }\n /**\n * Glue the AngularJS `NgModelController` (if it exists) to the component\n * (if it implements the needed subset of the `ControlValueAccessor` interface).\n */\n function hookupNgModel(ngModel, component) {\n if (ngModel && supportsNgModel(component)) {\n ngModel.$render = function () {\n component.writeValue(ngModel.$viewValue);\n };\n component.registerOnChange(ngModel.$setViewValue.bind(ngModel));\n if (typeof component.registerOnTouched === 'function') {\n component.registerOnTouched(ngModel.$setTouched.bind(ngModel));\n }\n }\n }\n /**\n * Test two values for strict equality, accounting for the fact that `NaN !== NaN`.\n */\n function strictEquals(val1, val2) {\n return val1 === val2 || (val1 !== val1 && val2 !== val2);\n }\n\n /**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n var INITIAL_VALUE = {\n __UNINITIALIZED__: true\n };\n var DowngradeComponentAdapter = /** @class */ (function () {\n function DowngradeComponentAdapter(element, attrs, scope, ngModel, parentInjector, $injector, $compile, $parse, componentFactory, wrapCallback) {\n this.element = element;\n this.attrs = attrs;\n this.scope = scope;\n this.ngModel = ngModel;\n this.parentInjector = parentInjector;\n this.$injector = $injector;\n this.$compile = $compile;\n this.$parse = $parse;\n this.componentFactory = componentFactory;\n this.wrapCallback = wrapCallback;\n this.implementsOnChanges = false;\n this.inputChangeCount = 0;\n this.inputChanges = {};\n this.componentScope = scope.$new();\n }\n DowngradeComponentAdapter.prototype.compileContents = function () {\n var _this = this;\n var compiledProjectableNodes = [];\n var projectableNodes = this.groupProjectableNodes();\n var linkFns = projectableNodes.map(function (nodes) { return _this.$compile(nodes); });\n this.element.empty();\n linkFns.forEach(function (linkFn) {\n linkFn(_this.scope, function (clone) {\n compiledProjectableNodes.push(clone);\n _this.element.append(clone);\n });\n });\n return compiledProjectableNodes;\n };\n DowngradeComponentAdapter.prototype.createComponent = function (projectableNodes) {\n var providers = [{ provide: $SCOPE, useValue: this.componentScope }];\n var childInjector = core.Injector.create({ providers: providers, parent: this.parentInjector, name: 'DowngradeComponentAdapter' });\n this.componentRef =\n this.componentFactory.create(childInjector, projectableNodes, this.element[0]);\n this.viewChangeDetector = this.componentRef.injector.get(core.ChangeDetectorRef);\n this.changeDetector = this.componentRef.changeDetectorRef;\n this.component = this.componentRef.instance;\n // testability hook is commonly added during component bootstrap in\n // packages/core/src/application_ref.bootstrap()\n // in downgraded application, component creation will take place here as well as adding the\n // testability hook.\n var testability = this.componentRef.injector.get(core.Testability, null);\n if (testability) {\n this.componentRef.injector.get(core.TestabilityRegistry)\n .registerApplication(this.componentRef.location.nativeElement, testability);\n }\n hookupNgModel(this.ngModel, this.component);\n };\n DowngradeComponentAdapter.prototype.setupInputs = function (manuallyAttachView, propagateDigest) {\n var _this = this;\n if (propagateDigest === void 0) { propagateDigest = true; }\n var attrs = this.attrs;\n var inputs = this.componentFactory.inputs || [];\n var _loop_1 = function (i) {\n var input = new PropertyBinding(inputs[i].propName, inputs[i].templateName);\n var expr = null;\n if (attrs.hasOwnProperty(input.attr)) {\n var observeFn_1 = (function (prop) {\n var prevValue = INITIAL_VALUE;\n return function (currValue) {\n // Initially, both `$observe()` and `$watch()` will call this function.\n if (!strictEquals(prevValue, currValue)) {\n if (prevValue === INITIAL_VALUE) {\n prevValue = currValue;\n }\n _this.updateInput(prop, prevValue, currValue);\n prevValue = currValue;\n }\n };\n })(input.prop);\n attrs.$observe(input.attr, observeFn_1);\n // Use `$watch()` (in addition to `$observe()`) in order to initialize the input in time\n // for `ngOnChanges()`. This is necessary if we are already in a `$digest`, which means that\n // `ngOnChanges()` (which is called by a watcher) will run before the `$observe()` callback.\n var unwatch_1 = this_1.componentScope.$watch(function () {\n unwatch_1();\n unwatch_1 = null;\n observeFn_1(attrs[input.attr]);\n });\n }\n else if (attrs.hasOwnProperty(input.bindAttr)) {\n expr = attrs[input.bindAttr];\n }\n else if (attrs.hasOwnProperty(input.bracketAttr)) {\n expr = attrs[input.bracketAttr];\n }\n else if (attrs.hasOwnProperty(input.bindonAttr)) {\n expr = attrs[input.bindonAttr];\n }\n else if (attrs.hasOwnProperty(input.bracketParenAttr)) {\n expr = attrs[input.bracketParenAttr];\n }\n if (expr != null) {\n var watchFn = (function (prop) { return function (currValue, prevValue) { return _this.updateInput(prop, prevValue, currValue); }; })(input.prop);\n this_1.componentScope.$watch(expr, watchFn);\n }\n };\n var this_1 = this;\n for (var i = 0; i < inputs.length; i++) {\n _loop_1(i);\n }\n // Invoke `ngOnChanges()` and Change Detection (when necessary)\n var detectChanges = function () { return _this.changeDetector.detectChanges(); };\n var prototype = this.componentFactory.componentType.prototype;\n this.implementsOnChanges = !!(prototype && prototype.ngOnChanges);\n this.componentScope.$watch(function () { return _this.inputChangeCount; }, this.wrapCallback(function () {\n // Invoke `ngOnChanges()`\n if (_this.implementsOnChanges) {\n var inputChanges = _this.inputChanges;\n _this.inputChanges = {};\n _this.component.ngOnChanges(inputChanges);\n }\n _this.viewChangeDetector.markForCheck();\n // If opted out of propagating digests, invoke change detection when inputs change.\n if (!propagateDigest) {\n detectChanges();\n }\n }));\n // If not opted out of propagating digests, invoke change detection on every digest\n if (propagateDigest) {\n this.componentScope.$watch(this.wrapCallback(detectChanges));\n }\n // If necessary, attach the view so that it will be dirty-checked.\n // (Allow time for the initial input values to be set and `ngOnChanges()` to be called.)\n if (manuallyAttachView || !propagateDigest) {\n var unwatch_2 = this.componentScope.$watch(function () {\n unwatch_2();\n unwatch_2 = null;\n var appRef = _this.parentInjector.get(core.ApplicationRef);\n appRef.attachView(_this.componentRef.hostView);\n });\n }\n };\n DowngradeComponentAdapter.prototype.setupOutputs = function () {\n var attrs = this.attrs;\n var outputs = this.componentFactory.outputs || [];\n for (var j = 0; j < outputs.length; j++) {\n var output = new PropertyBinding(outputs[j].propName, outputs[j].templateName);\n var bindonAttr = output.bindonAttr.substring(0, output.bindonAttr.length - 6);\n var bracketParenAttr = \"[(\" + output.bracketParenAttr.substring(2, output.bracketParenAttr.length - 8) + \")]\";\n // order below is important - first update bindings then evaluate expressions\n if (attrs.hasOwnProperty(bindonAttr)) {\n this.subscribeToOutput(output, attrs[bindonAttr], true);\n }\n if (attrs.hasOwnProperty(bracketParenAttr)) {\n this.subscribeToOutput(output, attrs[bracketParenAttr], true);\n }\n if (attrs.hasOwnProperty(output.onAttr)) {\n this.subscribeToOutput(output, attrs[output.onAttr]);\n }\n if (attrs.hasOwnProperty(output.parenAttr)) {\n this.subscribeToOutput(output, attrs[output.parenAttr]);\n }\n }\n };\n DowngradeComponentAdapter.prototype.subscribeToOutput = function (output, expr, isAssignment) {\n var _this = this;\n if (isAssignment === void 0) { isAssignment = false; }\n var getter = this.$parse(expr);\n var setter = getter.assign;\n if (isAssignment && !setter) {\n throw new Error(\"Expression '\" + expr + \"' is not assignable!\");\n }\n var emitter = this.component[output.prop];\n if (emitter) {\n emitter.subscribe({\n next: isAssignment ? function (v) { return setter(_this.scope, v); } :\n function (v) { return getter(_this.scope, { '$event': v }); }\n });\n }\n else {\n throw new Error(\"Missing emitter '\" + output.prop + \"' on component '\" + getTypeName(this.componentFactory.componentType) + \"'!\");\n }\n };\n DowngradeComponentAdapter.prototype.registerCleanup = function () {\n var _this = this;\n var testabilityRegistry = this.componentRef.injector.get(core.TestabilityRegistry);\n var destroyComponentRef = this.wrapCallback(function () { return _this.componentRef.destroy(); });\n var destroyed = false;\n this.element.on('$destroy', function () { return _this.componentScope.$destroy(); });\n this.componentScope.$on('$destroy', function () {\n if (!destroyed) {\n destroyed = true;\n testabilityRegistry.unregisterApplication(_this.componentRef.location.nativeElement);\n destroyComponentRef();\n }\n });\n };\n DowngradeComponentAdapter.prototype.getInjector = function () {\n return this.componentRef.injector;\n };\n DowngradeComponentAdapter.prototype.updateInput = function (prop, prevValue, currValue) {\n if (this.implementsOnChanges) {\n this.inputChanges[prop] = new core.SimpleChange(prevValue, currValue, prevValue === currValue);\n }\n this.inputChangeCount++;\n this.component[prop] = currValue;\n };\n DowngradeComponentAdapter.prototype.groupProjectableNodes = function () {\n var ngContentSelectors = this.componentFactory.ngContentSelectors;\n return groupNodesBySelector(ngContentSelectors, this.element.contents());\n };\n return DowngradeComponentAdapter;\n }());\n /**\n * Group a set of DOM nodes into `ngContent` groups, based on the given content selectors.\n */\n function groupNodesBySelector(ngContentSelectors, nodes) {\n var projectableNodes = [];\n var wildcardNgContentIndex;\n for (var i = 0, ii = ngContentSelectors.length; i < ii; ++i) {\n projectableNodes[i] = [];\n }\n for (var j = 0, jj = nodes.length; j < jj; ++j) {\n var node = nodes[j];\n var ngContentIndex = findMatchingNgContentIndex(node, ngContentSelectors);\n if (ngContentIndex != null) {\n projectableNodes[ngContentIndex].push(node);\n }\n }\n return projectableNodes;\n }\n function findMatchingNgContentIndex(element, ngContentSelectors) {\n var ngContentIndices = [];\n var wildcardNgContentIndex = -1;\n for (var i = 0; i < ngContentSelectors.length; i++) {\n var selector = ngContentSelectors[i];\n if (selector === '*') {\n wildcardNgContentIndex = i;\n }\n else {\n if (matchesSelector(element, selector)) {\n ngContentIndices.push(i);\n }\n }\n }\n ngContentIndices.sort();\n if (wildcardNgContentIndex !== -1) {\n ngContentIndices.push(wildcardNgContentIndex);\n }\n return ngContentIndices.length ? ngContentIndices[0] : null;\n }\n var _matches;\n function matchesSelector(el, selector) {\n if (!_matches) {\n var elProto = Element.prototype;\n _matches = elProto.matches || elProto.matchesSelector || elProto.mozMatchesSelector ||\n elProto.msMatchesSelector || elProto.oMatchesSelector || elProto.webkitMatchesSelector;\n }\n return el.nodeType === Node.ELEMENT_NODE ? _matches.call(el, selector) : false;\n }\n\n /**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n function isThenable(obj) {\n return !!obj && isFunction(obj.then);\n }\n /**\n * Synchronous, promise-like object.\n */\n var SyncPromise = /** @class */ (function () {\n function SyncPromise() {\n this.resolved = false;\n this.callbacks = [];\n }\n SyncPromise.all = function (valuesOrPromises) {\n var aggrPromise = new SyncPromise();\n var resolvedCount = 0;\n var results = [];\n var resolve = function (idx, value) {\n results[idx] = value;\n if (++resolvedCount === valuesOrPromises.length)\n aggrPromise.resolve(results);\n };\n valuesOrPromises.forEach(function (p, idx) {\n if (isThenable(p)) {\n p.then(function (v) { return resolve(idx, v); });\n }\n else {\n resolve(idx, p);\n }\n });\n return aggrPromise;\n };\n SyncPromise.prototype.resolve = function (value) {\n // Do nothing, if already resolved.\n if (this.resolved)\n return;\n this.value = value;\n this.resolved = true;\n // Run the queued callbacks.\n this.callbacks.forEach(function (callback) { return callback(value); });\n this.callbacks.length = 0;\n };\n SyncPromise.prototype.then = function (callback) {\n if (this.resolved) {\n callback(this.value);\n }\n else {\n this.callbacks.push(callback);\n }\n };\n return SyncPromise;\n }());\n\n /**\n * @description\n *\n * A helper function that allows an Angular component to be used from AngularJS.\n *\n * *Part of the [upgrade/static](api?query=upgrade%2Fstatic)\n * library for hybrid upgrade apps that support AOT compilation*\n *\n * This helper function returns a factory function to be used for registering\n * an AngularJS wrapper directive for \"downgrading\" an Angular component.\n *\n * @usageNotes\n * ### Examples\n *\n * Let's assume that you have an Angular component called `ng2Heroes` that needs\n * to be made available in AngularJS templates.\n *\n * {@example upgrade/static/ts/full/module.ts region=\"ng2-heroes\"}\n *\n * We must create an AngularJS [directive](https://docs.angularjs.org/guide/directive)\n * that will make this Angular component available inside AngularJS templates.\n * The `downgradeComponent()` function returns a factory function that we\n * can use to define the AngularJS directive that wraps the \"downgraded\" component.\n *\n * {@example upgrade/static/ts/full/module.ts region=\"ng2-heroes-wrapper\"}\n *\n * For more details and examples on downgrading Angular components to AngularJS components please\n * visit the [Upgrade guide](guide/upgrade#using-angular-components-from-angularjs-code).\n *\n * @param info contains information about the Component that is being downgraded:\n *\n * - `component: Type<any>`: The type of the Component that will be downgraded\n * - `downgradedModule?: string`: The name of the downgraded module (if any) that the component\n * \"belongs to\", as returned by a call to `downgradeModule()`. It is the module, whose\n * corresponding Angular module will be bootstrapped, when the component needs to be instantiated.\n * <br />\n * (This option is only necessary when using `downgradeModule()` to downgrade more than one\n * Angular module.)\n * - `propagateDigest?: boolean`: Whether to perform {@link ChangeDetectorRef#detectChanges\n * change detection} on the component on every\n * [$digest](https://docs.angularjs.org/api/ng/type/$rootScope.Scope#$digest). If set to `false`,\n * change detection will still be performed when any of the component's inputs changes.\n * (Default: true)\n *\n * @returns a factory function that can be used to register the component in an\n * AngularJS module.\n *\n * @publicApi\n */\n function downgradeComponent(info) {\n var directiveFactory = function ($compile, $injector, $parse) {\n // When using `downgradeModule()`, we need to handle certain things specially. For example:\n // - We always need to attach the component view to the `ApplicationRef` for it to be\n // dirty-checked.\n // - We need to ensure callbacks to Angular APIs (e.g. change detection) are run inside the\n // Angular zone.\n // NOTE: This is not needed, when using `UpgradeModule`, because `$digest()` will be run\n // inside the Angular zone (except if explicitly escaped, in which case we shouldn't\n // force it back in).\n var isNgUpgradeLite = getUpgradeAppType($injector) === 3 /* Lite */;\n var wrapCallback = !isNgUpgradeLite ? function (cb) { return cb; } : function (cb) { return function () { return core.NgZone.isInAngularZone() ? cb() : ngZone.run(cb); }; };\n var ngZone;\n // When downgrading multiple modules, special handling is needed wrt injectors.\n var hasMultipleDowngradedModules = isNgUpgradeLite && (getDowngradedModuleCount($injector) > 1);\n return {\n restrict: 'E',\n terminal: true,\n require: [REQUIRE_INJECTOR, REQUIRE_NG_MODEL],\n link: function (scope, element, attrs, required) {\n // We might have to compile the contents asynchronously, because this might have been\n // triggered by `UpgradeNg1ComponentAdapterBuilder`, before the Angular templates have\n // been compiled.\n var ngModel = required[1];\n var parentInjector = required[0];\n var moduleInjector = undefined;\n var ranAsync = false;\n if (!parentInjector || hasMultipleDowngradedModules) {\n var downgradedModule = info.downgradedModule || '';\n var lazyModuleRefKey = \"\" + LAZY_MODULE_REF + downgradedModule;\n var attemptedAction = \"instantiating component '\" + getTypeName(info.component) + \"'\";\n validateInjectionKey($injector, downgradedModule, lazyModuleRefKey, attemptedAction);\n var lazyModuleRef = $injector.get(lazyModuleRefKey);\n moduleInjector = lazyModuleRef.injector || lazyModuleRef.promise;\n }\n // Notes:\n //\n // There are two injectors: `finalModuleInjector` and `finalParentInjector` (they might be\n // the same instance, but that is irrelevant):\n // - `finalModuleInjector` is used to retrieve `ComponentFactoryResolver`, thus it must be\n // on the same tree as the `NgModule` that declares this downgraded component.\n // - `finalParentInjector` is used for all other injection purposes.\n // (Note that Angular knows to only traverse the component-tree part of that injector,\n // when looking for an injectable and then switch to the module injector.)\n //\n // There are basically three cases:\n // - If there is no parent component (thus no `parentInjector`), we bootstrap the downgraded\n // `NgModule` and use its injector as both `finalModuleInjector` and\n // `finalParentInjector`.\n // - If there is a parent component (and thus a `parentInjector`) and we are sure that it\n // belongs to the same `NgModule` as this downgraded component (e.g. because there is only\n // one downgraded module, we use that `parentInjector` as both `finalModuleInjector` and\n // `finalParentInjector`.\n // - If there is a parent component, but it may belong to a different `NgModule`, then we\n // use the `parentInjector` as `finalParentInjector` and this downgraded component's\n // declaring `NgModule`'s injector as `finalModuleInjector`.\n // Note 1: If the `NgModule` is already bootstrapped, we just get its injector (we don't\n // bootstrap again).\n // Note 2: It is possible that (while there are multiple downgraded modules) this\n // downgraded component and its parent component both belong to the same NgModule.\n // In that case, we could have used the `parentInjector` as both\n // `finalModuleInjector` and `finalParentInjector`, but (for simplicity) we are\n // treating this case as if they belong to different `NgModule`s. That doesn't\n // really affect anything, since `parentInjector` has `moduleInjector` as ancestor\n // and trying to resolve `ComponentFactoryResolver` from either one will return\n // the same instance.\n // If there is a parent component, use its injector as parent injector.\n // If this is a \"top-level\" Angular component, use the module injector.\n var finalParentInjector = parentInjector || moduleInjector;\n // If this is a \"top-level\" Angular component or the parent component may belong to a\n // different `NgModule`, use the module injector for module-specific dependencies.\n // If there is a parent component that belongs to the same `NgModule`, use its injector.\n var finalModuleInjector = moduleInjector || parentInjector;\n var doDowngrade = function (injector, moduleInjector) {\n // Retrieve `ComponentFactoryResolver` from the injector tied to the `NgModule` this\n // component belongs to.\n var componentFactoryResolver = moduleInjector.get(core.ComponentFactoryResolver);\n var componentFactory = componentFactoryResolver.resolveComponentFactory(info.component);\n if (!componentFactory) {\n throw new Error(\"Expecting ComponentFactory for: \" + getTypeName(info.component));\n }\n var injectorPromise = new ParentInjectorPromise(element);\n var facade = new DowngradeComponentAdapter(element, attrs, scope, ngModel, injector, $injector, $compile, $parse, componentFactory, wrapCallback);\n var projectableNodes = facade.compileContents();\n facade.createComponent(projectableNodes);\n facade.setupInputs(isNgUpgradeLite, info.propagateDigest);\n facade.setupOutputs();\n facade.registerCleanup();\n injectorPromise.resolve(facade.getInjector());\n if (ranAsync) {\n // If this is run async, it is possible that it is not run inside a\n // digest and initial input values will not be detected.\n scope.$evalAsync(function () { });\n }\n };\n var downgradeFn = !isNgUpgradeLite ? doDowngrade : function (pInjector, mInjector) {\n if (!ngZone) {\n ngZone = pInjector.get(core.NgZone);\n }\n wrapCallback(function () { return doDowngrade(pInjector, mInjector); })();\n };\n // NOTE:\n // Not using `ParentInjectorPromise.all()` (which is inherited from `SyncPromise`), because\n // Closure Compiler (or some related tool) complains:\n // `TypeError: ...$src$downgrade_component_ParentInjectorPromise.all is not a function`\n SyncPromise.all([finalParentInjector, finalModuleInjector])\n .then(function (_a) {\n var _b = __read(_a, 2), pInjector = _b[0], mInjector = _b[1];\n return downgradeFn(pInjector, mInjector);\n });\n ranAsync = true;\n }\n };\n };\n // bracket-notation because of closure - see #14441\n directiveFactory['$inject'] = [$COMPILE, $INJECTOR, $PARSE];\n return directiveFactory;\n }\n /**\n * Synchronous promise-like object to wrap parent injectors,\n * to preserve the synchronous nature of AngularJS's `$compile`.\n */\n var ParentInjectorPromise = /** @class */ (function (_super) {\n __extends(ParentInjectorPromise, _super);\n function ParentInjectorPromise(element) {\n var _this = _super.call(this) || this;\n _this.element = element;\n _this.injectorKey = controllerKey(INJECTOR_KEY);\n // Store the promise on the element.\n element.data(_this.injectorKey, _this);\n return _this;\n }\n ParentInjectorPromise.prototype.resolve = function (injector) {\n // Store the real injector on the element.\n this.element.data(this.injectorKey, injector);\n // Release the element to prevent memory leaks.\n this.element = null;\n // Resolve the promise.\n _super.prototype.resolve.call(this, injector);\n };\n return ParentInjectorPromise;\n }(SyncPromise));\n\n /**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n /**\n * @description\n *\n * A helper function to allow an Angular service to be accessible from AngularJS.\n *\n * *Part of the [upgrade/static](api?query=upgrade%2Fstatic)\n * library for hybrid upgrade apps that support AOT compilation*\n *\n * This helper function returns a factory function that provides access to the Angular\n * service identified by the `token` parameter.\n *\n * @usageNotes\n * ### Examples\n *\n * First ensure that the service to be downgraded is provided in an `NgModule`\n * that will be part of the upgrade application. For example, let's assume we have\n * defined `HeroesService`\n *\n * {@example upgrade/static/ts/full/module.ts region=\"ng2-heroes-service\"}\n *\n * and that we have included this in our upgrade app `NgModule`\n *\n * {@example upgrade/static/ts/full/module.ts region=\"ng2-module\"}\n *\n * Now we can register the `downgradeInjectable` factory function for the service\n * on an AngularJS module.\n *\n * {@example upgrade/static/ts/full/module.ts region=\"downgrade-ng2-heroes-service\"}\n *\n * Inside an AngularJS component's controller we can get hold of the\n * downgraded service via the name we gave when downgrading.\n *\n * {@example upgrade/static/ts/full/module.ts region=\"example-app\"}\n *\n * <div class=\"alert is-important\">\n *\n * When using `downgradeModule()`, downgraded injectables will not be available until the Angular\n * module that provides them is instantiated. In order to be safe, you need to ensure that the\n * downgraded injectables are not used anywhere _outside_ the part of the app where it is\n * guaranteed that their module has been instantiated.\n *\n * For example, it is _OK_ to use a downgraded service in an upgraded component that is only used\n * from a downgraded Angular component provided by the same Angular module as the injectable, but\n * it is _not OK_ to use it in an AngularJS component that may be used independently of Angular or\n * use it in a downgraded Angular component from a different module.\n *\n * </div>\n *\n * @param token an `InjectionToken` that identifies a service provided from Angular.\n * @param downgradedModule the name of the downgraded module (if any) that the injectable\n * \"belongs to\", as returned by a call to `downgradeModule()`. It is the module, whose injector will\n * be used for instantiating the injectable.<br />\n * (This option is only necessary when using `downgradeModule()` to downgrade more than one Angular\n * module.)\n *\n * @returns a [factory function](https://docs.angularjs.org/guide/di) that can be\n * used to register the service on an AngularJS module.\n *\n * @publicApi\n */\n function downgradeInjectable(token, downgradedModule) {\n if (downgradedModule === void 0) { downgradedModule = ''; }\n var factory = function ($injector) {\n var injectorKey = \"\" + INJECTOR_KEY + downgradedModule;\n var injectableName = isFunction(token) ? getTypeName(token) : String(token);\n var attemptedAction = \"instantiating injectable '\" + injectableName + \"'\";\n validateInjectionKey($injector, downgradedModule, injectorKey, attemptedAction);\n var injector = $injector.get(injectorKey);\n return injector.get(token);\n };\n factory['$inject'] = [$INJECTOR];\n return factory;\n }\n\n // Constants\n var REQUIRE_PREFIX_RE = /^(\\^\\^?)?(\\?)?(\\^\\^?)?/;\n // Classes\n var UpgradeHelper = /** @class */ (function () {\n function UpgradeHelper(injector, name, elementRef, directive) {\n this.injector = injector;\n this.name = name;\n this.$injector = injector.get($INJECTOR);\n this.$compile = this.$injector.get($COMPILE);\n this.$controller = this.$injector.get($CONTROLLER);\n this.element = elementRef.nativeElement;\n this.$element = element(this.element);\n this.directive = directive || UpgradeHelper.getDirective(this.$injector, name);\n }\n UpgradeHelper.getDirective = function ($injector, name) {\n var directives = $injector.get(name + 'Directive');\n if (directives.length > 1) {\n throw new Error(\"Only support single directive definition for: \" + name);\n }\n var directive = directives[0];\n // AngularJS will transform `link: xyz` to `compile: () => xyz`. So we can only tell there was a\n // user-defined `compile` if there is no `link`. In other cases, we will just ignore `compile`.\n if (directive.compile && !directive.link)\n notSupported(name, 'compile');\n if (directive.replace)\n notSupported(name, 'replace');\n if (directive.terminal)\n notSupported(name, 'terminal');\n return directive;\n };\n UpgradeHelper.getTemplate = function ($injector, directive, fetchRemoteTemplate, $element) {\n if (fetchRemoteTemplate === void 0) { fetchRemoteTemplate = false; }\n if (directive.template !== undefined) {\n return getOrCall(directive.template, $element);\n }\n else if (directive.templateUrl) {\n var $templateCache_1 = $injector.get($TEMPLATE_CACHE);\n var url_1 = getOrCall(directive.templateUrl, $element);\n var template = $templateCache_1.get(url_1);\n if (template !== undefined) {\n return template;\n }\n else if (!fetchRemoteTemplate) {\n throw new Error('loading directive templates asynchronously is not supported');\n }\n return new Promise(function (resolve, reject) {\n var $httpBackend = $injector.get($HTTP_BACKEND);\n $httpBackend('GET', url_1, null, function (status, response) {\n if (status === 200) {\n resolve($templateCache_1.put(url_1, response));\n }\n else {\n reject(\"GET component template from '\" + url_1 + \"' returned '\" + status + \": \" + response + \"'\");\n }\n });\n });\n }\n else {\n throw new Error(\"Directive '\" + directive.name + \"' is not a component, it is missing template.\");\n }\n };\n UpgradeHelper.prototype.buildController = function (controllerType, $scope) {\n // TODO: Document that we do not pre-assign bindings on the controller instance.\n // Quoted properties below so that this code can be optimized with Closure Compiler.\n var locals = { '$scope': $scope, '$element': this.$element };\n var controller = this.$controller(controllerType, locals, null, this.directive.controllerAs);\n this.$element.data(controllerKey(this.directive.name), controller);\n return controller;\n };\n UpgradeHelper.prototype.compileTemplate = function (template) {\n if (template === undefined) {\n template =\n UpgradeHelper.getTemplate(this.$injector, this.directive, false, this.$element);\n }\n return this.compileHtml(template);\n };\n UpgradeHelper.prototype.onDestroy = function ($scope, controllerInstance) {\n if (controllerInstance && isFunction(controllerInstance.$onDestroy)) {\n controllerInstance.$onDestroy();\n }\n $scope.$destroy();\n // Clean the jQuery/jqLite data on the component+child elements.\n // Equivelent to how jQuery/jqLite invoke `cleanData` on an Element (this.element)\n // https://github.com/jquery/jquery/blob/e743cbd28553267f955f71ea7248377915613fd9/src/manipulation.js#L223\n // https://github.com/angular/angular.js/blob/26ddc5f830f902a3d22f4b2aab70d86d4d688c82/src/jqLite.js#L306-L312\n // `cleanData` will invoke the AngularJS `$destroy` DOM event\n // https://github.com/angular/angular.js/blob/26ddc5f830f902a3d22f4b2aab70d86d4d688c82/src/Angular.js#L1911-L1924\n element.cleanData([this.element]);\n element.cleanData(this.element.querySelectorAll('*'));\n };\n UpgradeHelper.prototype.prepareTransclusion = function () {\n var _this = this;\n var transclude = this.directive.transclude;\n var contentChildNodes = this.extractChildNodes();\n var attachChildrenFn = function (scope, cloneAttachFn) {\n // Since AngularJS v1.5.8, `cloneAttachFn` will try to destroy the transclusion scope if\n // `$template` is empty. Since the transcluded content comes from Angular, not AngularJS,\n // there will be no transclusion scope here.\n // Provide a dummy `scope.$destroy()` method to prevent `cloneAttachFn` from throwing.\n scope = scope || { $destroy: function () { return undefined; } };\n return cloneAttachFn($template, scope);\n };\n var $template = contentChildNodes;\n if (transclude) {\n var slots_1 = Object.create(null);\n if (typeof transclude === 'object') {\n $template = [];\n var slotMap_1 = Object.create(null);\n var filledSlots_1 = Object.create(null);\n // Parse the element selectors.\n Object.keys(transclude).forEach(function (slotName) {\n var selector = transclude[slotName];\n var optional = selector.charAt(0) === '?';\n selector = optional ? selector.substring(1) : selector;\n slotMap_1[selector] = slotName;\n slots_1[slotName] = null; // `null`: Defined but not yet filled.\n filledSlots_1[slotName] = optional; // Consider optional slots as filled.\n });\n // Add the matching elements into their slot.\n contentChildNodes.forEach(function (node) {\n var slotName = slotMap_1[directiveNormalize(node.nodeName.toLowerCase())];\n if (slotName) {\n filledSlots_1[slotName] = true;\n slots_1[slotName] = slots_1[slotName] || [];\n slots_1[slotName].push(node);\n }\n else {\n $template.push(node);\n }\n });\n // Check for required slots that were not filled.\n Object.keys(filledSlots_1).forEach(function (slotName) {\n if (!filledSlots_1[slotName]) {\n throw new Error(\"Required transclusion slot '\" + slotName + \"' on directive: \" + _this.name);\n }\n });\n Object.keys(slots_1).filter(function (slotName) { return slots_1[slotName]; }).forEach(function (slotName) {\n var nodes = slots_1[slotName];\n slots_1[slotName] = function (scope, cloneAttach) {\n return cloneAttach(nodes, scope);\n };\n });\n }\n // Attach `$$slots` to default slot transclude fn.\n attachChildrenFn.$$slots = slots_1;\n // AngularJS v1.6+ ignores empty or whitespace-only transcluded text nodes. But Angular\n // removes all text content after the first interpolation and updates it later, after\n // evaluating the expressions. This would result in AngularJS failing to recognize text\n // nodes that start with an interpolation as transcluded content and use the fallback\n // content instead.\n // To avoid this issue, we add a\n // [zero-width non-joiner character](https://en.wikipedia.org/wiki/Zero-width_non-joiner)\n // to empty text nodes (which can only be a result of Angular removing their initial content).\n // NOTE: Transcluded text content that starts with whitespace followed by an interpolation\n // will still fail to be detected by AngularJS v1.6+\n $template.forEach(function (node) {\n if (node.nodeType === Node.TEXT_NODE && !node.nodeValue) {\n node.nodeValue = '\\u200C';\n }\n });\n }\n return attachChildrenFn;\n };\n UpgradeHelper.prototype.resolveAndBindRequiredControllers = function (controllerInstance) {\n var directiveRequire = this.getDirectiveRequire();\n var requiredControllers = this.resolveRequire(directiveRequire);\n if (controllerInstance && this.directive.bindToController && isMap(directiveRequire)) {\n var requiredControllersMap_1 = requiredControllers;\n Object.keys(requiredControllersMap_1).forEach(function (key) {\n controllerInstance[key] = requiredControllersMap_1[key];\n });\n }\n return requiredControllers;\n };\n UpgradeHelper.prototype.compileHtml = function (html) {\n this.element.innerHTML = html;\n return this.$compile(this.element.childNodes);\n };\n UpgradeHelper.prototype.extractChildNodes = function () {\n var childNodes = [];\n var childNode;\n while (childNode = this.element.firstChild) {\n this.element.removeChild(childNode);\n childNodes.push(childNode);\n }\n return childNodes;\n };\n UpgradeHelper.prototype.getDirectiveRequire = function () {\n var require = this.directive.require || (this.directive.controller && this.directive.name);\n if (isMap(require)) {\n Object.keys(require).forEach(function (key) {\n var value = require[key];\n var match = value.match(REQUIRE_PREFIX_RE);\n var name = value.substring(match[0].length);\n if (!name) {\n require[key] = match[0] + key;\n }\n });\n }\n return require;\n };\n UpgradeHelper.prototype.resolveRequire = function (require, controllerInstance) {\n var _this = this;\n if (!require) {\n return null;\n }\n else if (Array.isArray(require)) {\n return require.map(function (req) { return _this.resolveRequire(req); });\n }\n else if (typeof require === 'object') {\n var value_1 = {};\n Object.keys(require).forEach(function (key) { return value_1[key] = _this.resolveRequire(require[key]); });\n return value_1;\n }\n else if (typeof require === 'string') {\n var match = require.match(REQUIRE_PREFIX_RE);\n var inheritType = match[1] || match[3];\n var name = require.substring(match[0].length);\n var isOptional = !!match[2];\n var searchParents = !!inheritType;\n var startOnParent = inheritType === '^^';\n var ctrlKey = controllerKey(name);\n var elem = startOnParent ? this.$element.parent() : this.$element;\n var value = searchParents ? elem.inheritedData(ctrlKey) : elem.data(ctrlKey);\n if (!value && !isOptional) {\n throw new Error(\"Unable to find required '\" + require + \"' in upgraded directive '\" + this.name + \"'.\");\n }\n return value;\n }\n else {\n throw new Error(\"Unrecognized 'require' syntax on upgraded directive '\" + this.name + \"': \" + require);\n }\n };\n return UpgradeHelper;\n }());\n function getOrCall(property) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n return isFunction(property) ? property.apply(void 0, __spread(args)) : property;\n }\n // NOTE: Only works for `typeof T !== 'object'`.\n function isMap(value) {\n return value && !Array.isArray(value) && typeof value === 'object';\n }\n function notSupported(name, feature) {\n throw new Error(\"Upgraded directive '\" + name + \"' contains unsupported feature: '\" + feature + \"'.\");\n }\n\n var CAMEL_CASE = /([A-Z])/g;\n var INITIAL_VALUE$1 = {\n __UNINITIALIZED__: true\n };\n var NOT_SUPPORTED = 'NOT_SUPPORTED';\n var UpgradeNg1ComponentAdapterBuilder = /** @class */ (function () {\n function UpgradeNg1ComponentAdapterBuilder(name) {\n this.name = name;\n this.inputs = [];\n this.inputsRename = [];\n this.outputs = [];\n this.outputsRename = [];\n this.propertyOutputs = [];\n this.checkProperties = [];\n this.propertyMap = {};\n this.directive = null;\n var selector = name.replace(CAMEL_CASE, function (all, next) { return '-' + next.toLowerCase(); });\n var self = this;\n // Note: There is a bug in TS 2.4 that prevents us from\n // inlining this into @Directive\n // TODO(tbosch): find or file a bug against TypeScript for this.\n var directive = { selector: selector, inputs: this.inputsRename, outputs: this.outputsRename };\n var MyClass = /** @class */ (function (_super) {\n __extends(MyClass, _super);\n function MyClass(scope, injector, elementRef) {\n return _super.call(this, new UpgradeHelper(injector, name, elementRef, self.directive || undefined), scope, self.template, self.inputs, self.outputs, self.propertyOutputs, self.checkProperties, self.propertyMap) || this;\n }\n return MyClass;\n }(UpgradeNg1ComponentAdapter));\n MyClass.decorators = [\n { type: core.Directive, args: [Object.assign({ jit: true }, directive),] }\n ];\n MyClass.ctorParameters = function () { return [\n { type: undefined, decorators: [{ type: core.Inject, args: [$SCOPE,] }] },\n { type: core.Injector },\n { type: core.ElementRef }\n ]; };\n this.type = MyClass;\n }\n UpgradeNg1ComponentAdapterBuilder.prototype.extractBindings = function () {\n var _this = this;\n var btcIsObject = typeof this.directive.bindToController === 'object';\n if (btcIsObject && Object.keys(this.directive.scope).length) {\n throw new Error(\"Binding definitions on scope and controller at the same time are not supported.\");\n }\n var context = (btcIsObject) ? this.directive.bindToController : this.directive.scope;\n if (typeof context == 'object') {\n Object.keys(context).forEach(function (propName) {\n var definition = context[propName];\n var bindingType = definition.charAt(0);\n var bindingOptions = definition.charAt(1);\n var attrName = definition.substring(bindingOptions === '?' ? 2 : 1) || propName;\n // QUESTION: What about `=*`? Ignore? Throw? Support?\n var inputName = \"input_\" + attrName;\n var inputNameRename = inputName + \": \" + attrName;\n var outputName = \"output_\" + attrName;\n var outputNameRename = outputName + \": \" + attrName;\n var outputNameRenameChange = outputNameRename + \"Change\";\n switch (bindingType) {\n case '@':\n case '<':\n _this.inputs.push(inputName);\n _this.inputsRename.push(inputNameRename);\n _this.propertyMap[inputName] = propName;\n break;\n case '=':\n _this.inputs.push(inputName);\n _this.inputsRename.push(inputNameRename);\n _this.propertyMap[inputName] = propName;\n _this.outputs.push(outputName);\n _this.outputsRename.push(outputNameRenameChange);\n _this.propertyMap[outputName] = propName;\n _this.checkProperties.push(propName);\n _this.propertyOutputs.push(outputName);\n break;\n case '&':\n _this.outputs.push(outputName);\n _this.outputsRename.push(outputNameRename);\n _this.propertyMap[outputName] = propName;\n break;\n default:\n var json = JSON.stringify(context);\n throw new Error(\"Unexpected mapping '\" + bindingType + \"' in '\" + json + \"' in '\" + _this.name + \"' directive.\");\n }\n });\n }\n };\n /**\n * Upgrade ng1 components into Angular.\n */\n UpgradeNg1ComponentAdapterBuilder.resolve = function (exportedComponents, $injector) {\n var promises = Object.keys(exportedComponents).map(function (name) {\n var exportedComponent = exportedComponents[name];\n exportedComponent.directive = UpgradeHelper.getDirective($injector, name);\n exportedComponent.extractBindings();\n return Promise\n .resolve(UpgradeHelper.getTemplate($injector, exportedComponent.directive, true))\n .then(function (template) { return exportedComponent.template = template; });\n });\n return Promise.all(promises);\n };\n return UpgradeNg1ComponentAdapterBuilder;\n }());\n var UpgradeNg1ComponentAdapter = /** @class */ (function () {\n function UpgradeNg1ComponentAdapter(helper, scope, template, inputs, outputs, propOuts, checkProperties, propertyMap) {\n this.helper = helper;\n this.template = template;\n this.inputs = inputs;\n this.outputs = outputs;\n this.propOuts = propOuts;\n this.checkProperties = checkProperties;\n this.propertyMap = propertyMap;\n this.controllerInstance = null;\n this.destinationObj = null;\n this.checkLastValues = [];\n this.$element = null;\n this.directive = helper.directive;\n this.element = helper.element;\n this.$element = helper.$element;\n this.componentScope = scope.$new(!!this.directive.scope);\n var controllerType = this.directive.controller;\n if (this.directive.bindToController && controllerType) {\n this.controllerInstance = this.helper.buildController(controllerType, this.componentScope);\n this.destinationObj = this.controllerInstance;\n }\n else {\n this.destinationObj = this.componentScope;\n }\n for (var i = 0; i < inputs.length; i++) {\n this[inputs[i]] = null;\n }\n for (var j = 0; j < outputs.length; j++) {\n var emitter = this[outputs[j]] = new core.EventEmitter();\n if (this.propOuts.indexOf(outputs[j]) === -1) {\n this.setComponentProperty(outputs[j], (function (emitter) { return function (value) { return emitter.emit(value); }; })(emitter));\n }\n }\n for (var k = 0; k < propOuts.length; k++) {\n this.checkLastValues.push(INITIAL_VALUE$1);\n }\n }\n UpgradeNg1ComponentAdapter.prototype.ngOnInit = function () {\n // Collect contents, insert and compile template\n var attachChildNodes = this.helper.prepareTransclusion();\n var linkFn = this.helper.compileTemplate(this.template);\n // Instantiate controller (if not already done so)\n var controllerType = this.directive.controller;\n var bindToController = this.directive.bindToController;\n if (controllerType && !bindToController) {\n this.controllerInstance = this.helper.buildController(controllerType, this.componentScope);\n }\n // Require other controllers\n var requiredControllers = this.helper.resolveAndBindRequiredControllers(this.controllerInstance);\n // Hook: $onInit\n if (this.controllerInstance && isFunction(this.controllerInstance.$onInit)) {\n this.controllerInstance.$onInit();\n }\n // Linking\n var link = this.directive.link;\n var preLink = typeof link == 'object' && link.pre;\n var postLink = typeof link == 'object' ? link.post : link;\n var attrs = NOT_SUPPORTED;\n var transcludeFn = NOT_SUPPORTED;\n if (preLink) {\n preLink(this.componentScope, this.$element, attrs, requiredControllers, transcludeFn);\n }\n linkFn(this.componentScope, null, { parentBoundTranscludeFn: attachChildNodes });\n if (postLink) {\n postLink(this.componentScope, this.$element, attrs, requiredControllers, transcludeFn);\n }\n // Hook: $postLink\n if (this.controllerInstance && isFunction(this.controllerInstance.$postLink)) {\n this.controllerInstance.$postLink();\n }\n };\n UpgradeNg1ComponentAdapter.prototype.ngOnChanges = function (changes) {\n var _this = this;\n var ng1Changes = {};\n Object.keys(changes).forEach(function (name) {\n var change = changes[name];\n _this.setComponentProperty(name, change.currentValue);\n ng1Changes[_this.propertyMap[name]] = change;\n });\n if (isFunction(this.destinationObj.$onChanges)) {\n this.destinationObj.$onChanges(ng1Changes);\n }\n };\n UpgradeNg1ComponentAdapter.prototype.ngDoCheck = function () {\n var _this = this;\n var destinationObj = this.destinationObj;\n var lastValues = this.checkLastValues;\n var checkProperties = this.checkProperties;\n var propOuts = this.propOuts;\n checkProperties.forEach(function (propName, i) {\n var value = destinationObj[propName];\n var last = lastValues[i];\n if (!strictEquals(last, value)) {\n var eventEmitter = _this[propOuts[i]];\n eventEmitter.emit(lastValues[i] = value);\n }\n });\n if (this.controllerInstance && isFunction(this.controllerInstance.$doCheck)) {\n this.controllerInstance.$doCheck();\n }\n };\n UpgradeNg1ComponentAdapter.prototype.ngOnDestroy = function () {\n this.helper.onDestroy(this.componentScope, this.controllerInstance);\n };\n UpgradeNg1ComponentAdapter.prototype.setComponentProperty = function (name, value) {\n this.destinationObj[this.propertyMap[name]] = value;\n };\n return UpgradeNg1ComponentAdapter;\n }());\n UpgradeNg1ComponentAdapter.decorators = [\n { type: core.Directive }\n ];\n UpgradeNg1ComponentAdapter.ctorParameters = function () { return [\n { type: UpgradeHelper },\n { type: undefined },\n { type: String },\n { type: Array },\n { type: Array },\n { type: Array },\n { type: Array },\n { type: undefined }\n ]; };\n\n var upgradeCount = 0;\n /**\n * Use `UpgradeAdapter` to allow AngularJS and Angular to coexist in a single application.\n *\n * The `UpgradeAdapter` allows:\n * 1. creation of Angular component from AngularJS component directive\n * (See [UpgradeAdapter#upgradeNg1Component()])\n * 2. creation of AngularJS directive from Angular component.\n * (See [UpgradeAdapter#downgradeNg2Component()])\n * 3. Bootstrapping of a hybrid Angular application which contains both of the frameworks\n * coexisting in a single application.\n *\n * @usageNotes\n * ### Mental Model\n *\n * When reasoning about how a hybrid application works it is useful to have a mental model which\n * describes what is happening and explains what is happening at the lowest level.\n *\n * 1. There are two independent frameworks running in a single application, each framework treats\n * the other as a black box.\n * 2. Each DOM element on the page is owned exactly by one framework. Whichever framework\n * instantiated the element is the owner. Each framework only updates/interacts with its own\n * DOM elements and ignores others.\n * 3. AngularJS directives always execute inside AngularJS framework codebase regardless of\n * where they are instantiated.\n * 4. Angular components always execute inside Angular framework codebase regardless of\n * where they are instantiated.\n * 5. An AngularJS component can be upgraded to an Angular component. This creates an\n * Angular directive, which bootstraps the AngularJS component directive in that location.\n * 6. An Angular component can be downgraded to an AngularJS component directive. This creates\n * an AngularJS directive, which bootstraps the Angular component in that location.\n * 7. Whenever an adapter component is instantiated the host element is owned by the framework\n * doing the instantiation. The other framework then instantiates and owns the view for that\n * component. This implies that component bindings will always follow the semantics of the\n * instantiation framework. The syntax is always that of Angular syntax.\n * 8. AngularJS is always bootstrapped first and owns the bottom most view.\n * 9. The new application is running in Angular zone, and therefore it no longer needs calls to\n * `$apply()`.\n *\n * ### Example\n *\n * ```\n * const adapter = new UpgradeAdapter(forwardRef(() => MyNg2Module), myCompilerOptions);\n * const module = angular.module('myExample', []);\n * module.directive('ng2Comp', adapter.downgradeNg2Component(Ng2Component));\n *\n * module.directive('ng1Hello', function() {\n * return {\n * scope: { title: '=' },\n * template: 'ng1[Hello {{title}}!](<span ng-transclude></span>)'\n * };\n * });\n *\n *\n * @Component({\n * selector: 'ng2-comp',\n * inputs: ['name'],\n * template: 'ng2[<ng1-hello [title]=\"name\">transclude</ng1-hello>](<ng-content></ng-content>)',\n * directives:\n * })\n * class Ng2Component {\n * }\n *\n * @NgModule({\n * declarations: [Ng2Component, adapter.upgradeNg1Component('ng1Hello')],\n * imports: [BrowserModule]\n * })\n * class MyNg2Module {}\n *\n *\n * document.body.innerHTML = '<ng2-comp name=\"World\">project</ng2-comp>';\n *\n * adapter.bootstrap(document.body, ['myExample']).ready(function() {\n * expect(document.body.textContent).toEqual(\n * \"ng2[ng1[Hello World!](transclude)](project)\");\n * });\n *\n * ```\n *\n * @deprecated Deprecated since v5. Use `upgrade/static` instead, which also supports\n * [Ahead-of-Time compilation](guide/aot-compiler).\n * @publicApi\n */\n var UpgradeAdapter = /** @class */ (function () {\n function UpgradeAdapter(ng2AppModule, compilerOptions) {\n this.ng2AppModule = ng2AppModule;\n this.compilerOptions = compilerOptions;\n this.idPrefix = \"NG2_UPGRADE_\" + upgradeCount++ + \"_\";\n this.downgradedComponents = [];\n /**\n * An internal map of ng1 components which need to up upgraded to ng2.\n *\n * We can't upgrade until injector is instantiated and we can retrieve the component metadata.\n * For this reason we keep a list of components to upgrade until ng1 injector is bootstrapped.\n *\n * @internal\n */\n this.ng1ComponentsToBeUpgraded = {};\n this.upgradedProviders = [];\n this.moduleRef = null;\n if (!ng2AppModule) {\n throw new Error('UpgradeAdapter cannot be instantiated without an NgModule of the Angular app.');\n }\n }\n /**\n * Allows Angular Component to be used from AngularJS.\n *\n * Use `downgradeNg2Component` to create an AngularJS Directive Definition Factory from\n * Angular Component. The adapter will bootstrap Angular component from within the\n * AngularJS template.\n *\n * @usageNotes\n * ### Mental Model\n *\n * 1. The component is instantiated by being listed in AngularJS template. This means that the\n * host element is controlled by AngularJS, but the component's view will be controlled by\n * Angular.\n * 2. Even thought the component is instantiated in AngularJS, it will be using Angular\n * syntax. This has to be done, this way because we must follow Angular components do not\n * declare how the attributes should be interpreted.\n * 3. `ng-model` is controlled by AngularJS and communicates with the downgraded Angular component\n * by way of the `ControlValueAccessor` interface from @angular/forms. Only components that\n * implement this interface are eligible.\n *\n * ### Supported Features\n *\n * - Bindings:\n * - Attribute: `<comp name=\"World\">`\n * - Interpolation: `<comp greeting=\"Hello {{name}}!\">`\n * - Expression: `<comp [name]=\"username\">`\n * - Event: `<comp (close)=\"doSomething()\">`\n * - ng-model: `<comp ng-model=\"name\">`\n * - Content projection: yes\n *\n * ### Example\n *\n * ```\n * const adapter = new UpgradeAdapter(forwardRef(() => MyNg2Module));\n * const module = angular.module('myExample', []);\n * module.directive('greet', adapter.downgradeNg2Component(Greeter));\n *\n * @Component({\n * selector: 'greet',\n * template: '{{salutation}} {{name}}! - <ng-content></ng-content>'\n * })\n * class Greeter {\n * @Input() salutation: string;\n * @Input() name: string;\n * }\n *\n * @NgModule({\n * declarations: [Greeter],\n * imports: [BrowserModule]\n * })\n * class MyNg2Module {}\n *\n * document.body.innerHTML =\n * 'ng1 template: <greet salutation=\"Hello\" [name]=\"world\">text</greet>';\n *\n * adapter.bootstrap(document.body, ['myExample']).ready(function() {\n * expect(document.body.textContent).toEqual(\"ng1 template: Hello world! - text\");\n * });\n * ```\n */\n UpgradeAdapter.prototype.downgradeNg2Component = function (component) {\n this.downgradedComponents.push(component);\n return downgradeComponent({ component: component });\n };\n /**\n * Allows AngularJS Component to be used from Angular.\n *\n * Use `upgradeNg1Component` to create an Angular component from AngularJS Component\n * directive. The adapter will bootstrap AngularJS component from within the Angular\n * template.\n *\n * @usageNotes\n * ### Mental Model\n *\n * 1. The component is instantiated by being listed in Angular template. This means that the\n * host element is controlled by Angular, but the component's view will be controlled by\n * AngularJS.\n *\n * ### Supported Features\n *\n * - Bindings:\n * - Attribute: `<comp name=\"World\">`\n * - Interpolation: `<comp greeting=\"Hello {{name}}!\">`\n * - Expression: `<comp [name]=\"username\">`\n * - Event: `<comp (close)=\"doSomething()\">`\n * - Transclusion: yes\n * - Only some of the features of\n * [Directive Definition Object](https://docs.angularjs.org/api/ng/service/$compile) are\n * supported:\n * - `compile`: not supported because the host element is owned by Angular, which does\n * not allow modifying DOM structure during compilation.\n * - `controller`: supported. (NOTE: injection of `$attrs` and `$transclude` is not supported.)\n * - `controllerAs`: supported.\n * - `bindToController`: supported.\n * - `link`: supported. (NOTE: only pre-link function is supported.)\n * - `name`: supported.\n * - `priority`: ignored.\n * - `replace`: not supported.\n * - `require`: supported.\n * - `restrict`: must be set to 'E'.\n * - `scope`: supported.\n * - `template`: supported.\n * - `templateUrl`: supported.\n * - `terminal`: ignored.\n * - `transclude`: supported.\n *\n *\n * ### Example\n *\n * ```\n * const adapter = new UpgradeAdapter(forwardRef(() => MyNg2Module));\n * const module = angular.module('myExample', []);\n *\n * module.directive('greet', function() {\n * return {\n * scope: {salutation: '=', name: '=' },\n * template: '{{salutation}} {{name}}! - <span ng-transclude></span>'\n * };\n * });\n *\n * module.directive('ng2', adapter.downgradeNg2Component(Ng2Component));\n *\n * @Component({\n * selector: 'ng2',\n * template: 'ng2 template: <greet salutation=\"Hello\" [name]=\"world\">text</greet>'\n * })\n * class Ng2Component {\n * }\n *\n * @NgModule({\n * declarations: [Ng2Component, adapter.upgradeNg1Component('greet')],\n * imports: [BrowserModule]\n * })\n * class MyNg2Module {}\n *\n * document.body.innerHTML = '<ng2></ng2>';\n *\n * adapter.bootstrap(document.body, ['myExample']).ready(function() {\n * expect(document.body.textContent).toEqual(\"ng2 template: Hello world! - text\");\n * });\n * ```\n */\n UpgradeAdapter.prototype.upgradeNg1Component = function (name) {\n if (this.ng1ComponentsToBeUpgraded.hasOwnProperty(name)) {\n return this.ng1ComponentsToBeUpgraded[name].type;\n }\n else {\n return (this.ng1ComponentsToBeUpgraded[name] = new UpgradeNg1ComponentAdapterBuilder(name))\n .type;\n }\n };\n /**\n * Registers the adapter's AngularJS upgrade module for unit testing in AngularJS.\n * Use this instead of `angular.mock.module()` to load the upgrade module into\n * the AngularJS testing injector.\n *\n * @usageNotes\n * ### Example\n *\n * ```\n * const upgradeAdapter = new UpgradeAdapter(MyNg2Module);\n *\n * // configure the adapter with upgrade/downgrade components and services\n * upgradeAdapter.downgradeNg2Component(MyComponent);\n *\n * let upgradeAdapterRef: UpgradeAdapterRef;\n * let $compile, $rootScope;\n *\n * // We must register the adapter before any calls to `inject()`\n * beforeEach(() => {\n * upgradeAdapterRef = upgradeAdapter.registerForNg1Tests(['heroApp']);\n * });\n *\n * beforeEach(inject((_$compile_, _$rootScope_) => {\n * $compile = _$compile_;\n * $rootScope = _$rootScope_;\n * }));\n *\n * it(\"says hello\", (done) => {\n * upgradeAdapterRef.ready(() => {\n * const element = $compile(\"<my-component></my-component>\")($rootScope);\n * $rootScope.$apply();\n * expect(element.html()).toContain(\"Hello World\");\n * done();\n * })\n * });\n *\n * ```\n *\n * @param modules any AngularJS modules that the upgrade module should depend upon\n * @returns an `UpgradeAdapterRef`, which lets you register a `ready()` callback to\n * run assertions once the Angular components are ready to test through AngularJS.\n */\n UpgradeAdapter.prototype.registerForNg1Tests = function (modules) {\n var _this = this;\n var windowNgMock = window['angular'].mock;\n if (!windowNgMock || !windowNgMock.module) {\n throw new Error('Failed to find \\'angular.mock.module\\'.');\n }\n this.declareNg1Module(modules);\n windowNgMock.module(this.ng1Module.name);\n var upgrade = new UpgradeAdapterRef();\n this.ng2BootstrapDeferred.promise.then(function (ng1Injector) {\n upgrade._bootstrapDone(_this.moduleRef, ng1Injector);\n }, onError);\n return upgrade;\n };\n /**\n * Bootstrap a hybrid AngularJS / Angular application.\n *\n * This `bootstrap` method is a direct replacement (takes same arguments) for AngularJS\n * [`bootstrap`](https://docs.angularjs.org/api/ng/function/angular.bootstrap) method. Unlike\n * AngularJS, this bootstrap is asynchronous.\n *\n * @usageNotes\n * ### Example\n *\n * ```\n * const adapter = new UpgradeAdapter(MyNg2Module);\n * const module = angular.module('myExample', []);\n * module.directive('ng2', adapter.downgradeNg2Component(Ng2));\n *\n * module.directive('ng1', function() {\n * return {\n * scope: { title: '=' },\n * template: 'ng1[Hello {{title}}!](<span ng-transclude></span>)'\n * };\n * });\n *\n *\n * @Component({\n * selector: 'ng2',\n * inputs: ['name'],\n * template: 'ng2[<ng1 [title]=\"name\">transclude</ng1>](<ng-content></ng-content>)'\n * })\n * class Ng2 {\n * }\n *\n * @NgModule({\n * declarations: [Ng2, adapter.upgradeNg1Component('ng1')],\n * imports: [BrowserModule]\n * })\n * class MyNg2Module {}\n *\n * document.body.innerHTML = '<ng2 name=\"World\">project</ng2>';\n *\n * adapter.bootstrap(document.body, ['myExample']).ready(function() {\n * expect(document.body.textContent).toEqual(\n * \"ng2[ng1[Hello World!](transclude)](project)\");\n * });\n * ```\n */\n UpgradeAdapter.prototype.bootstrap = function (element$1, modules, config) {\n var _this = this;\n this.declareNg1Module(modules);\n var upgrade = new UpgradeAdapterRef();\n // Make sure resumeBootstrap() only exists if the current bootstrap is deferred\n var windowAngular = window /** TODO #???? */['angular'];\n windowAngular.resumeBootstrap = undefined;\n this.ngZone.run(function () {\n bootstrap(element$1, [_this.ng1Module.name], config);\n });\n var ng1BootstrapPromise = new Promise(function (resolve) {\n if (windowAngular.resumeBootstrap) {\n var originalResumeBootstrap_1 = windowAngular.resumeBootstrap;\n windowAngular.resumeBootstrap = function () {\n windowAngular.resumeBootstrap = originalResumeBootstrap_1;\n var r = windowAngular.resumeBootstrap.apply(this, arguments);\n resolve();\n return r;\n };\n }\n else {\n resolve();\n }\n });\n Promise.all([this.ng2BootstrapDeferred.promise, ng1BootstrapPromise]).then(function (_a) {\n var _b = __read(_a, 1), ng1Injector = _b[0];\n element(element$1).data(controllerKey(INJECTOR_KEY), _this.moduleRef.injector);\n _this.moduleRef.injector.get(core.NgZone).run(function () {\n upgrade._bootstrapDone(_this.moduleRef, ng1Injector);\n });\n }, onError);\n return upgrade;\n };\n /**\n * Allows AngularJS service to be accessible from Angular.\n *\n * @usageNotes\n * ### Example\n *\n * ```\n * class Login { ... }\n * class Server { ... }\n *\n * @Injectable()\n * class Example {\n * constructor(@Inject('server') server, login: Login) {\n * ...\n * }\n * }\n *\n * const module = angular.module('myExample', []);\n * module.service('server', Server);\n * module.service('login', Login);\n *\n * const adapter = new UpgradeAdapter(MyNg2Module);\n * adapter.upgradeNg1Provider('server');\n * adapter.upgradeNg1Provider('login', {asToken: Login});\n *\n * adapter.bootstrap(document.body, ['myExample']).ready((ref) => {\n * const example: Example = ref.ng2Injector.get(Example);\n * });\n *\n * ```\n */\n UpgradeAdapter.prototype.upgradeNg1Provider = function (name, options) {\n var token = options && options.asToken || name;\n this.upgradedProviders.push({\n provide: token,\n useFactory: function ($injector) { return $injector.get(name); },\n deps: [$INJECTOR]\n });\n };\n /**\n * Allows Angular service to be accessible from AngularJS.\n *\n * @usageNotes\n * ### Example\n *\n * ```\n * class Example {\n * }\n *\n * const adapter = new UpgradeAdapter(MyNg2Module);\n *\n * const module = angular.module('myExample', []);\n * module.factory('example', adapter.downgradeNg2Provider(Example));\n *\n * adapter.bootstrap(document.body, ['myExample']).ready((ref) => {\n * const example: Example = ref.ng1Injector.get('example');\n * });\n *\n * ```\n */\n UpgradeAdapter.prototype.downgradeNg2Provider = function (token) {\n return downgradeInjectable(token);\n };\n /**\n * Declare the AngularJS upgrade module for this adapter without bootstrapping the whole\n * hybrid application.\n *\n * This method is automatically called by `bootstrap()` and `registerForNg1Tests()`.\n *\n * @param modules The AngularJS modules that this upgrade module should depend upon.\n * @returns The AngularJS upgrade module that is declared by this method\n *\n * @usageNotes\n * ### Example\n *\n * ```\n * const upgradeAdapter = new UpgradeAdapter(MyNg2Module);\n * upgradeAdapter.declareNg1Module(['heroApp']);\n * ```\n */\n UpgradeAdapter.prototype.declareNg1Module = function (modules) {\n var _this = this;\n if (modules === void 0) { modules = []; }\n var delayApplyExps = [];\n var original$applyFn;\n var rootScopePrototype;\n var rootScope;\n var upgradeAdapter = this;\n var ng1Module = this.ng1Module = module_(this.idPrefix, modules);\n var platformRef = platformBrowserDynamic.platformBrowserDynamic();\n this.ngZone = new core.NgZone({ enableLongStackTrace: Zone.hasOwnProperty('longStackTraceZoneSpec') });\n this.ng2BootstrapDeferred = new Deferred();\n ng1Module.constant(UPGRADE_APP_TYPE_KEY, 1 /* Dynamic */)\n .factory(INJECTOR_KEY, function () { return _this.moduleRef.injector.get(core.Injector); })\n .factory(LAZY_MODULE_REF, [INJECTOR_KEY, function (injector) { return ({ injector: injector }); }])\n .constant(NG_ZONE_KEY, this.ngZone)\n .factory(COMPILER_KEY, function () { return _this.moduleRef.injector.get(core.Compiler); })\n .config([\n '$provide', '$injector',\n function (provide, ng1Injector) {\n provide.decorator($ROOT_SCOPE, [\n '$delegate',\n function (rootScopeDelegate) {\n // Capture the root apply so that we can delay first call to $apply until we\n // bootstrap Angular and then we replay and restore the $apply.\n rootScopePrototype = rootScopeDelegate.constructor.prototype;\n if (rootScopePrototype.hasOwnProperty('$apply')) {\n original$applyFn = rootScopePrototype.$apply;\n rootScopePrototype.$apply = function (exp) { return delayApplyExps.push(exp); };\n }\n else {\n throw new Error('Failed to find \\'$apply\\' on \\'$rootScope\\'!');\n }\n return rootScope = rootScopeDelegate;\n }\n ]);\n if (ng1Injector.has($$TESTABILITY)) {\n provide.decorator($$TESTABILITY, [\n '$delegate',\n function (testabilityDelegate) {\n var originalWhenStable = testabilityDelegate.whenStable;\n // Cannot use arrow function below because we need the context\n var newWhenStable = function (callback) {\n originalWhenStable.call(this, function () {\n var ng2Testability = upgradeAdapter.moduleRef.injector.get(core.Testability);\n if (ng2Testability.isStable()) {\n callback.apply(this, arguments);\n }\n else {\n ng2Testability.whenStable(newWhenStable.bind(this, callback));\n }\n });\n };\n testabilityDelegate.whenStable = newWhenStable;\n return testabilityDelegate;\n }\n ]);\n }\n }\n ]);\n ng1Module.run([\n '$injector', '$rootScope',\n function (ng1Injector, rootScope) {\n UpgradeNg1ComponentAdapterBuilder.resolve(_this.ng1ComponentsToBeUpgraded, ng1Injector)\n .then(function () {\n // Note: There is a bug in TS 2.4 that prevents us from\n // inlining this into @NgModule\n // TODO(tbosch): find or file a bug against TypeScript for this.\n var ngModule = {\n providers: [\n { provide: $INJECTOR, useFactory: function () { return ng1Injector; } },\n { provide: $COMPILE, useFactory: function () { return ng1Injector.get($COMPILE); } },\n _this.upgradedProviders\n ],\n imports: [core.resolveForwardRef(_this.ng2AppModule)],\n entryComponents: _this.downgradedComponents\n };\n // At this point we have ng1 injector and we have prepared\n // ng1 components to be upgraded, we now can bootstrap ng2.\n var DynamicNgUpgradeModule = /** @class */ (function () {\n function DynamicNgUpgradeModule() {\n }\n DynamicNgUpgradeModule.prototype.ngDoBootstrap = function () { };\n return DynamicNgUpgradeModule;\n }());\n DynamicNgUpgradeModule.decorators = [\n { type: core.NgModule, args: [Object.assign({ jit: true }, ngModule),] }\n ];\n DynamicNgUpgradeModule.ctorParameters = function () { return []; };\n platformRef\n .bootstrapModule(DynamicNgUpgradeModule, [_this.compilerOptions, { ngZone: _this.ngZone }])\n .then(function (ref) {\n _this.moduleRef = ref;\n _this.ngZone.run(function () {\n if (rootScopePrototype) {\n rootScopePrototype.$apply = original$applyFn; // restore original $apply\n while (delayApplyExps.length) {\n rootScope.$apply(delayApplyExps.shift());\n }\n rootScopePrototype = null;\n }\n });\n })\n .then(function () { return _this.ng2BootstrapDeferred.resolve(ng1Injector); }, onError)\n .then(function () {\n var subscription = _this.ngZone.onMicrotaskEmpty.subscribe({\n next: function () {\n if (rootScope.$$phase) {\n if (core.isDevMode()) {\n console.warn('A digest was triggered while one was already in progress. This may mean that something is triggering digests outside the Angular zone.');\n }\n return rootScope.$evalAsync(function () { });\n }\n return rootScope.$digest();\n }\n });\n rootScope.$on('$destroy', function () {\n subscription.unsubscribe();\n });\n });\n })\n .catch(function (e) { return _this.ng2BootstrapDeferred.reject(e); });\n }\n ]);\n return ng1Module;\n };\n return UpgradeAdapter;\n }());\n /**\n * Synchronous promise-like object to wrap parent injectors,\n * to preserve the synchronous nature of AngularJS's $compile.\n */\n var ParentInjectorPromise$1 = /** @class */ (function () {\n function ParentInjectorPromise(element) {\n this.element = element;\n this.callbacks = [];\n // store the promise on the element\n element.data(controllerKey(INJECTOR_KEY), this);\n }\n ParentInjectorPromise.prototype.then = function (callback) {\n if (this.injector) {\n callback(this.injector);\n }\n else {\n this.callbacks.push(callback);\n }\n };\n ParentInjectorPromise.prototype.resolve = function (injector) {\n this.injector = injector;\n // reset the element data to point to the real injector\n this.element.data(controllerKey(INJECTOR_KEY), injector);\n // clean out the element to prevent memory leaks\n this.element = null;\n // run all the queued callbacks\n this.callbacks.forEach(function (callback) { return callback(injector); });\n this.callbacks.length = 0;\n };\n return ParentInjectorPromise;\n }());\n /**\n * Use `UpgradeAdapterRef` to control a hybrid AngularJS / Angular application.\n *\n * @deprecated Deprecated since v5. Use `upgrade/static` instead, which also supports\n * [Ahead-of-Time compilation](guide/aot-compiler).\n * @publicApi\n */\n var UpgradeAdapterRef = /** @class */ (function () {\n function UpgradeAdapterRef() {\n /* @internal */\n this._readyFn = null;\n this.ng1RootScope = null;\n this.ng1Injector = null;\n this.ng2ModuleRef = null;\n this.ng2Injector = null;\n }\n /* @internal */\n UpgradeAdapterRef.prototype._bootstrapDone = function (ngModuleRef, ng1Injector) {\n this.ng2ModuleRef = ngModuleRef;\n this.ng2Injector = ngModuleRef.injector;\n this.ng1Injector = ng1Injector;\n this.ng1RootScope = ng1Injector.get($ROOT_SCOPE);\n this._readyFn && this._readyFn(this);\n };\n /**\n * Register a callback function which is notified upon successful hybrid AngularJS / Angular\n * application has been bootstrapped.\n *\n * The `ready` callback function is invoked inside the Angular zone, therefore it does not\n * require a call to `$apply()`.\n */\n UpgradeAdapterRef.prototype.ready = function (fn) {\n this._readyFn = fn;\n };\n /**\n * Dispose of running hybrid AngularJS / Angular application.\n */\n UpgradeAdapterRef.prototype.dispose = function () {\n this.ng1Injector.get($ROOT_SCOPE).$destroy();\n this.ng2ModuleRef.destroy();\n };\n return UpgradeAdapterRef;\n }());\n\n /**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n // This file only re-exports content of the `src` folder. Keep it that way.\n\n /**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n /**\n * Generated bundle index. Do not edit.\n */\n\n exports.UpgradeAdapter = UpgradeAdapter;\n exports.UpgradeAdapterRef = UpgradeAdapterRef;\n exports.VERSION = VERSION;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n})));\n//# sourceMappingURL=upgrade.umd.js.map\n"]}
\No newline at end of file