@primno/core
Version:
Front-end framework for Model-Driven Apps of Power Apps and Dynamics 365.
15 lines (13 loc) • 84.8 kB
JavaScript
/*! *****************************************************************************
Copyright (C) Microsoft. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
var t;!function(t){!function(e){var n="object"==typeof global?global:"object"==typeof self?self:"object"==typeof this?this:Function("return this;")(),r=i(t);function i(t,e){return function(n,r){"function"!=typeof t[n]&&Object.defineProperty(t,n,{configurable:!0,writable:!0,value:r}),e&&e(n,r)}}void 0===n.Reflect?n.Reflect=t:r=i(n.Reflect,r),function(t){var e=Object.prototype.hasOwnProperty,n="function"==typeof Symbol,r=n&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",i=n&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",o="function"==typeof Object.create,a={__proto__:[]}instanceof Array,s=!o&&!a,c={create:o?function(){return rt(Object.create(null))}:a?function(){return rt({__proto__:null})}:function(){return rt({})},has:s?function(t,n){return e.call(t,n)}:function(t,e){return e in t},get:s?function(t,n){return e.call(t,n)?t[n]:void 0}:function(t,e){return t[e]}},u=Object.getPrototypeOf(Function),h="object"==typeof process&&process.env&&"true"===process.env.REFLECT_METADATA_USE_MAP_POLYFILL,l=h||"function"!=typeof Map||"function"!=typeof Map.prototype.entries?tt():Map,p=h||"function"!=typeof Set||"function"!=typeof Set.prototype.entries?et():Set,d=new(h||"function"!=typeof WeakMap?nt():WeakMap);function f(t,e,n,r){if(O(n)){if(!W(t))throw new TypeError;if(!K(e))throw new TypeError;return E(t,e)}if(!W(t))throw new TypeError;if(!$(e))throw new TypeError;if(!$(r)&&!O(r)&&!j(r))throw new TypeError;return j(r)&&(r=void 0),T(t,e,n=H(n),r)}function y(t,e){function n(n,r){if(!$(n))throw new TypeError;if(!O(r)&&!U(r))throw new TypeError;M(t,e,n,r)}return n}function g(t,e,n,r){if(!$(n))throw new TypeError;return O(r)||(r=H(r)),M(t,e,n,r)}function v(t,e,n){if(!$(e))throw new TypeError;return O(n)||(n=H(n)),I(t,e,n)}function m(t,e,n){if(!$(e))throw new TypeError;return O(n)||(n=H(n)),x(t,e,n)}function b(t,e,n){if(!$(e))throw new TypeError;return O(n)||(n=H(n)),k(t,e,n)}function w(t,e,n){if(!$(e))throw new TypeError;return O(n)||(n=H(n)),N(t,e,n)}function _(t,e){if(!$(t))throw new TypeError;return O(e)||(e=H(e)),R(t,e)}function C(t,e){if(!$(t))throw new TypeError;return O(e)||(e=H(e)),D(t,e)}function A(t,e,n){if(!$(e))throw new TypeError;O(n)||(n=H(n));var r=S(e,n,!1);if(O(r))return!1;if(!r.delete(t))return!1;if(r.size>0)return!0;var i=d.get(e);return i.delete(n),i.size>0||d.delete(e),!0}function E(t,e){for(var n=t.length-1;n>=0;--n){var r=(0,t[n])(e);if(!O(r)&&!j(r)){if(!K(r))throw new TypeError;e=r}}return e}function T(t,e,n,r){for(var i=t.length-1;i>=0;--i){var o=(0,t[i])(e,n,r);if(!O(o)&&!j(o)){if(!$(o))throw new TypeError;r=o}}return r}function S(t,e,n){var r=d.get(t);if(O(r)){if(!n)return;r=new l,d.set(t,r)}var i=r.get(e);if(O(i)){if(!n)return;i=new l,r.set(e,i)}return i}function I(t,e,n){if(x(t,e,n))return!0;var r=Z(e);return!j(r)&&I(t,r,n)}function x(t,e,n){var r=S(e,n,!1);return!O(r)&&V(r.has(t))}function k(t,e,n){if(x(t,e,n))return N(t,e,n);var r=Z(e);return j(r)?void 0:k(t,r,n)}function N(t,e,n){var r=S(e,n,!1);if(!O(r))return r.get(t)}function M(t,e,n,r){S(n,r,!0).set(t,e)}function R(t,e){var n=D(t,e),r=Z(t);if(null===r)return n;var i=R(r,e);if(i.length<=0)return n;if(n.length<=0)return i;for(var o=new p,a=[],s=0,c=n;s<c.length;s++){var u=c[s];o.has(u)||(o.add(u),a.push(u))}for(var h=0,l=i;h<l.length;h++){u=l[h];o.has(u)||(o.add(u),a.push(u))}return a}function D(t,e){var n=[],r=S(t,e,!1);if(O(r))return n;for(var i=Q(r.keys()),o=0;;){var a=Y(i);if(!a)return n.length=o,n;var s=X(a);try{n[o]=s}catch(t){try{J(i)}finally{throw t}}o++}}function P(t){if(null===t)return 1;switch(typeof t){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===t?1:6;default:return 6}}function O(t){return void 0===t}function j(t){return null===t}function q(t){return"symbol"==typeof t}function $(t){return"object"==typeof t?null!==t:"function"==typeof t}function F(t,e){switch(P(t)){case 0:case 1:case 2:case 3:case 4:case 5:return t}var n=3===e?"string":5===e?"number":"default",i=z(t,r);if(void 0!==i){var o=i.call(t,n);if($(o))throw new TypeError;return o}return B(t,"default"===n?"number":n)}function B(t,e){if("string"===e){var n=t.toString;if(G(n))if(!$(i=n.call(t)))return i;if(G(r=t.valueOf))if(!$(i=r.call(t)))return i}else{var r;if(G(r=t.valueOf))if(!$(i=r.call(t)))return i;var i,o=t.toString;if(G(o))if(!$(i=o.call(t)))return i}throw new TypeError}function V(t){return!!t}function L(t){return""+t}function H(t){var e=F(t,3);return q(e)?e:L(e)}function W(t){return Array.isArray?Array.isArray(t):t instanceof Object?t instanceof Array:"[object Array]"===Object.prototype.toString.call(t)}function G(t){return"function"==typeof t}function K(t){return"function"==typeof t}function U(t){switch(P(t)){case 3:case 4:return!0;default:return!1}}function z(t,e){var n=t[e];if(null!=n){if(!G(n))throw new TypeError;return n}}function Q(t){var e=z(t,i);if(!G(e))throw new TypeError;var n=e.call(t);if(!$(n))throw new TypeError;return n}function X(t){return t.value}function Y(t){var e=t.next();return!e.done&&e}function J(t){var e=t.return;e&&e.call(t)}function Z(t){var e=Object.getPrototypeOf(t);if("function"!=typeof t||t===u)return e;if(e!==u)return e;var n=t.prototype,r=n&&Object.getPrototypeOf(n);if(null==r||r===Object.prototype)return e;var i=r.constructor;return"function"!=typeof i||i===t?e:i}function tt(){var t={},e=[],n=function(){function t(t,e,n){this._index=0,this._keys=t,this._values=e,this._selector=n}return t.prototype["@@iterator"]=function(){return this},t.prototype[i]=function(){return this},t.prototype.next=function(){var t=this._index;if(t>=0&&t<this._keys.length){var n=this._selector(this._keys[t],this._values[t]);return t+1>=this._keys.length?(this._index=-1,this._keys=e,this._values=e):this._index++,{value:n,done:!1}}return{value:void 0,done:!0}},t.prototype.throw=function(t){throw this._index>=0&&(this._index=-1,this._keys=e,this._values=e),t},t.prototype.return=function(t){return this._index>=0&&(this._index=-1,this._keys=e,this._values=e),{value:t,done:!0}},t}();return function(){function e(){this._keys=[],this._values=[],this._cacheKey=t,this._cacheIndex=-2}return Object.defineProperty(e.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),e.prototype.has=function(t){return this._find(t,!1)>=0},e.prototype.get=function(t){var e=this._find(t,!1);return e>=0?this._values[e]:void 0},e.prototype.set=function(t,e){var n=this._find(t,!0);return this._values[n]=e,this},e.prototype.delete=function(e){var n=this._find(e,!1);if(n>=0){for(var r=this._keys.length,i=n+1;i<r;i++)this._keys[i-1]=this._keys[i],this._values[i-1]=this._values[i];return this._keys.length--,this._values.length--,e===this._cacheKey&&(this._cacheKey=t,this._cacheIndex=-2),!0}return!1},e.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=t,this._cacheIndex=-2},e.prototype.keys=function(){return new n(this._keys,this._values,r)},e.prototype.values=function(){return new n(this._keys,this._values,o)},e.prototype.entries=function(){return new n(this._keys,this._values,a)},e.prototype["@@iterator"]=function(){return this.entries()},e.prototype[i]=function(){return this.entries()},e.prototype._find=function(t,e){return this._cacheKey!==t&&(this._cacheIndex=this._keys.indexOf(this._cacheKey=t)),this._cacheIndex<0&&e&&(this._cacheIndex=this._keys.length,this._keys.push(t),this._values.push(void 0)),this._cacheIndex},e}();function r(t,e){return t}function o(t,e){return e}function a(t,e){return[t,e]}}function et(){return function(){function t(){this._map=new l}return Object.defineProperty(t.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),t.prototype.has=function(t){return this._map.has(t)},t.prototype.add=function(t){return this._map.set(t,t),this},t.prototype.delete=function(t){return this._map.delete(t)},t.prototype.clear=function(){this._map.clear()},t.prototype.keys=function(){return this._map.keys()},t.prototype.values=function(){return this._map.values()},t.prototype.entries=function(){return this._map.entries()},t.prototype["@@iterator"]=function(){return this.keys()},t.prototype[i]=function(){return this.keys()},t}()}function nt(){var t=16,n=c.create(),r=i();return function(){function t(){this._key=i()}return t.prototype.has=function(t){var e=o(t,!1);return void 0!==e&&c.has(e,this._key)},t.prototype.get=function(t){var e=o(t,!1);return void 0!==e?c.get(e,this._key):void 0},t.prototype.set=function(t,e){return o(t,!0)[this._key]=e,this},t.prototype.delete=function(t){var e=o(t,!1);return void 0!==e&&delete e[this._key]},t.prototype.clear=function(){this._key=i()},t}();function i(){var t;do{t="@@WeakMap@@"+u()}while(c.has(n,t));return n[t]=!0,t}function o(t,n){if(!e.call(t,r)){if(!n)return;Object.defineProperty(t,r,{value:c.create()})}return t[r]}function a(t,e){for(var n=0;n<e;++n)t[n]=255*Math.random()|0;return t}function s(t){return"function"==typeof Uint8Array?"undefined"!=typeof crypto?crypto.getRandomValues(new Uint8Array(t)):"undefined"!=typeof msCrypto?msCrypto.getRandomValues(new Uint8Array(t)):a(new Uint8Array(t),t):a(new Array(t),t)}function u(){var e=s(t);e[6]=79&e[6]|64,e[8]=191&e[8]|128;for(var n="",r=0;r<t;++r){var i=e[r];4!==r&&6!==r&&8!==r||(n+="-"),i<16&&(n+="0"),n+=i.toString(16).toLowerCase()}return n}}function rt(t){return t.__=void 0,delete t.__,t}t("decorate",f),t("metadata",y),t("defineMetadata",g),t("hasMetadata",v),t("hasOwnMetadata",m),t("getMetadata",b),t("getOwnMetadata",w),t("getMetadataKeys",_),t("getOwnMetadataKeys",C),t("deleteMetadata",A)}(r)}()}(t||(t={}));const e="";function n(t){return null==t||t===e}function r(t){return null!=t?.then&&null!=!t?.catch}function i(t){return t.replace(/{|}/g,"")}function o(t,e){return e in t&&"function"==typeof t[e]}var a,s,c,u;function h(t){return null!=t?.getGrid?s.grid:null!=t?.getFormContext||null!=t?.getAttribute?s.form:void 0}async function l(){const t=Xrm.Utility.getGlobalContext(),e=await t.getCurrentAppProperties();if(null==e.appId)throw new Error("AppId not found");return e.appId}function p(){switch(Xrm.Utility.getPageContext().input.pageType){case"entitylist":return"list";case"entityrecord":return"record";default:throw new Error("Unknown page type")}}function d(t){return null==t?null:o(t,"getFormContext")?t.getFormContext():o(t,"getAttribute")&&o(t,"getControl")?t:null}function f(t){console.debug(t)}function y(t){console.warn(t)}function g(t){console.log(`[VERBOSE] ${t}`)}function v(t){console.error(t)}function m(t,e){v(`Critical error: ${t}. Details: ${e}`),Xrm.Navigation.openErrorDialog({message:t,details:e})}function b(t){throw console.error(t),new Error(t)}!function(t){t.FormLoad="FormLoad",t.DataLoad="DataLoad",t.Save="Save",t.PostSave="PostSave",t.ColumnChange="ColumnChange",t.LookupTagClick="LookupTagClick",t.TabStateChange="TabStateChange",t.PreSearch="PreSearch",t.CommandInvoke="CommandInvoke",t.StageChange="StageChange",t.PreStageChange="PreStageChange",t.ProcessStatusChange="ProcessStatusChange",t.PreProcessStatusChange="PreProcessStatusChange",t.StageSelected="StageSelected",t.IframeLoaded="IframeLoaded",t.EnableRule="EnableRule",t.GridLoad="GridLoad",t.GridSave="GridSave",t.GridChange="GridChange",t.OutputChange="OutputChange",t.GridRecordSelect="GridRecordSelect",t.PopulateQuery="PopulateQuery"}(a||(a={})),function(t){t.form="form",t.grid="grid"}(s||(s={}));class w{get isPromise(){return r(this.returnValue)}static new(t){return new w(t)}constructor(t,e){try{null!=e&&null!=e.syncException||(this.returnValue=t()),null!=e?.syncException&&(this.syncException=e?.syncException)}catch(t){this.syncException=t}}then(t){return this.isPromise?new w((()=>this.returnValue.then(t)),this):new w((()=>t(this.returnValue)),this)}catch(t){if(r(this.returnValue)){const e=this.returnValue;return new w((()=>e.catch(t)),this)}return null!=this.syncException?(t(this.syncException),this):this}done(){return this.returnValue}}function _(t){switch(typeof t){case"object":return t.constructor;case"function":return t;default:throw new Error("Metadata storage can't be resolved. Unsupported target")}}class C{constructor(t,e="default"){this.storage=t,this.metadataKey=`primno:metadata-${e}`}getData(){return Reflect.getMetadata(this.metadataKey,this.storage)??{}}setData(t){Reflect.defineMetadata(this.metadataKey,t,this.storage)}getMetadata(t){return this.getData()[t]}setMetadata(t,e){const n=this.getData();n[t]=e,this.setData(n)}hasMetadata(t){return void 0!==this.getMetadata(t)}}class A{constructor(t){this.storage=new C(_(t),"class")}getMetadata(t){return this.storage.getMetadata(t)}setMetadata(t,e){this.storage.setMetadata(t,e)}hasMetadata(t){return void 0!==this.getMetadata(t)}}function E(t){return"function"==typeof t||"object"==typeof t}function T(t){const e=S(t);if(null==e)return[];if(null==e.imports)return[e];return[e,...(Array.isArray(e.imports)?e.imports:[e?.imports]).flatMap((t=>T(t)))]}function S(t){if(!E(t))return;return new A(t).getMetadata(c.module)}function I(t){if(!E(t))return;return new A(t).getMetadata(c.component)}function x(t){if(!E(t))return!1;return new A(t).hasMetadata(c.component)}function k(t){if(!E(t))return!1;return new A(t).hasMetadata(c.module)}function N(t){const e=T(t).flatMap((t=>t.bootstrap)).filter((t=>null!=t));if(0===e.length)throw new Error("Bootstap component(s) not found in module");return e}function M(t){if("provide"in t){if("useFactory"in t)return{type:"factory",token:t.provide,use:t.useFactory};if("useClass"in t)return{type:"class",token:t.provide,use:t.useClass};if("useValue"in t)return{type:"value",token:t.provide,use:t.useValue};throw new Error("Invalid provider")}return{type:"class",token:t,use:t}}!function(t){t.module="module",t.component="component",t.events="events",t.config="config",t.subComponent="sub-components"}(c||(c={})),function(t){t.providers="providers"}(u||(u={}));var R="named",D="name",P="unmanaged",O="optional",j="inject",q="multi_inject",$="post_construct",F="pre_destroy";var B=[j,q,D,P,R,O],V={Request:"Request",Singleton:"Singleton",Transient:"Transient"},L={ConstantValue:"ConstantValue",Constructor:"Constructor",DynamicValue:"DynamicValue",Factory:"Factory",Function:"Function",Instance:"Instance",Invalid:"Invalid",Provider:"Provider"},H={ClassProperty:"ClassProperty",ConstructorArgument:"ConstructorArgument",Variable:"Variable"},W=0;function G(){return W++}var K=function(){function t(t,e){this.id=G(),this.activated=!1,this.serviceIdentifier=t,this.scope=e,this.type=L.Invalid,this.constraint=function(t){return!0},this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.onActivation=null,this.onDeactivation=null,this.dynamicValue=null}return t.prototype.clone=function(){var e=new t(this.serviceIdentifier,this.scope);return e.activated=e.scope===V.Singleton&&this.activated,e.implementationType=this.implementationType,e.dynamicValue=this.dynamicValue,e.scope=this.scope,e.type=this.type,e.factory=this.factory,e.provider=this.provider,e.constraint=this.constraint,e.onActivation=this.onActivation,e.onDeactivation=this.onDeactivation,e.cache=this.cache,e},t}(),U="NULL argument",z="Key Not Found",Q="Ambiguous match found for serviceIdentifier:",X="No matching bindings found for serviceIdentifier:",Y="Missing required @injectable annotation in:",J="Missing required @inject or @multiInject annotation in:",Z="Circular dependency found:",tt=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return"The number of constructor arguments in the derived class "+t[0]+" must be >= than the number of constructor arguments of its base class."},et=function(t,e){return"@postConstruct error in class "+t+": "+e},nt=function(t,e){return"@preDestroy error in class "+t+": "+e},rt=function(t,e){return"onDeactivation() error in class "+t+": "+e},it="Maximum call stack size exceeded",ot=function(){function t(){}return t.prototype.getConstructorMetadata=function(t){return{compilerGeneratedMetadata:Reflect.getMetadata("inversify:paramtypes",t),userGeneratedMetadata:Reflect.getMetadata("inversify:tagged",t)||{}}},t.prototype.getPropertiesMetadata=function(t){return Reflect.getMetadata("inversify:tagged_props",t)||[]},t}(),at={MultipleBindingsAvailable:2,NoBindingsAvailable:0,OnlyOneBindingAvailable:1};function st(t){return t instanceof RangeError||t.message===it}function ct(t){return"function"==typeof t?t.name:"symbol"==typeof t?t.toString():t}function ut(t,e,n){var r="",i=n(t,e);return 0!==i.length&&(r="\nRegistered bindings:",i.forEach((function(t){var e="Object";null!==t.implementationType&&(e=pt(t.implementationType)),r=r+"\n "+e,t.constraint.metaData&&(r=r+" - "+t.constraint.metaData)}))),r}function ht(t,e){return null!==t.parentRequest&&(t.parentRequest.serviceIdentifier===e||ht(t.parentRequest,e))}function lt(t){t.childRequests.forEach((function(t){if(ht(t,t.serviceIdentifier)){var e=function(t){var e=function t(e,n){void 0===n&&(n=[]);var r=ct(e.serviceIdentifier);return n.push(r),null!==e.parentRequest?t(e.parentRequest,n):n}(t);return e.reverse().join(" --\x3e ")}(t);throw new Error(Z+" "+e)}lt(t)}))}function pt(t){if(t.name)return t.name;var e=t.toString(),n=e.match(/^function\s*([^\s(]+)/);return n?n[1]:"Anonymous function: "+e}var dt=function(){function t(t){this.id=G(),this.container=t}return t.prototype.addPlan=function(t){this.plan=t},t.prototype.setCurrentRequest=function(t){this.currentRequest=t},t}(),ft=function(){function t(t,e){this.key=t,this.value=e}return t.prototype.toString=function(){return this.key===R?"named: "+String(this.value).toString()+" ":"tagged: { key:"+this.key.toString()+", value: "+String(this.value)+" }"},t}(),yt=function(t,e){this.parentContext=t,this.rootRequest=e},gt=function(){function t(t){this._cb=t}return t.prototype.unwrap=function(){return this._cb()},t}(),vt=function(){function t(t){this.str=t}return t.prototype.startsWith=function(t){return 0===this.str.indexOf(t)},t.prototype.endsWith=function(t){var e,n=t.split("").reverse().join("");return e=this.str.split("").reverse().join(""),this.startsWith.call({str:e},n)},t.prototype.contains=function(t){return-1!==this.str.indexOf(t)},t.prototype.equals=function(t){return this.str===t},t.prototype.value=function(){return this.str},t}(),mt=function(){function t(t,e,n,r){this.id=G(),this.type=t,this.serviceIdentifier=n;var i="symbol"==typeof e?e.toString().slice(7,-1):e;this.name=new vt(i||""),this.identifier=e,this.metadata=new Array;var o=null;"string"==typeof r?o=new ft(R,r):r instanceof ft&&(o=r),null!==o&&this.metadata.push(o)}return t.prototype.hasTag=function(t){for(var e=0,n=this.metadata;e<n.length;e++){if(n[e].key===t)return!0}return!1},t.prototype.isArray=function(){return this.hasTag(q)},t.prototype.matchesArray=function(t){return this.matchesTag(q)(t)},t.prototype.isNamed=function(){return this.hasTag(R)},t.prototype.isTagged=function(){return this.metadata.some((function(t){return B.every((function(e){return t.key!==e}))}))},t.prototype.isOptional=function(){return this.matchesTag(O)(!0)},t.prototype.getNamedTag=function(){return this.isNamed()?this.metadata.filter((function(t){return t.key===R}))[0]:null},t.prototype.getCustomTags=function(){return this.isTagged()?this.metadata.filter((function(t){return B.every((function(e){return t.key!==e}))})):null},t.prototype.matchesNamedTag=function(t){return this.matchesTag(R)(t)},t.prototype.matchesTag=function(t){var e=this;return function(n){for(var r=0,i=e.metadata;r<i.length;r++){var o=i[r];if(o.key===t&&o.value===n)return!0}return!1}},t}(),bt=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function wt(t,e,n,r){var i=t.getConstructorMetadata(n),o=i.compilerGeneratedMetadata;if(void 0===o)throw new Error(Y+" "+e+".");var a=i.userGeneratedMetadata,s=Object.keys(a),c=0===n.length&&s.length>0,u=s.length>n.length,h=function(t,e,n,r,i){for(var o=[],a=0;a<i;a++){var s=_t(a,t,e,n,r);null!==s&&o.push(s)}return o}(r,e,o,a,c||u?s.length:n.length),l=At(t,n,e);return bt(bt([],h,!0),l,!0)}function _t(t,e,n,r,i){var o=i[t.toString()]||[],a=Tt(o),s=!0!==a.unmanaged,c=r[t],u=a.inject||a.multiInject;if((c=u||c)instanceof gt&&(c=c.unwrap()),s){if(!e&&(c===Object||c===Function||void 0===c))throw new Error(J+" argument "+t+" in class "+n+".");var h=new mt(H.ConstructorArgument,a.targetName,c);return h.metadata=o,h}return null}function Ct(t,e,n,r){var i=t||e;if(void 0===i){var o=Y+" for property "+String(n)+" in class "+r+".";throw new Error(o)}return i}function At(t,e,n){for(var r=t.getPropertiesMetadata(e),i=[],o=Object.getOwnPropertySymbols(r),a=0,s=Object.keys(r).concat(o);a<s.length;a++){var c=s[a],u=r[c],h=Tt(u),l=h.targetName||c,p=Ct(h.inject,h.multiInject,c,n),d=new mt(H.ClassProperty,l,p);d.metadata=u,i.push(d)}var f=Object.getPrototypeOf(e.prototype).constructor;if(f!==Object){var y=At(t,f,n);i=bt(bt([],i,!0),y,!0)}return i}function Et(t,e){var n=Object.getPrototypeOf(e.prototype).constructor;if(n!==Object){var r=wt(t,pt(n),n,!0),i=r.map((function(t){return t.metadata.filter((function(t){return t.key===P}))})),o=[].concat.apply([],i).length,a=r.length-o;return a>0?a:Et(t,n)}return 0}function Tt(t){var e={};return t.forEach((function(t){e[t.key.toString()]=t.value})),{inject:e[j],multiInject:e[q],targetName:e[D],unmanaged:e[P]}}var St=function(){function t(t,e,n,r,i){this.id=G(),this.serviceIdentifier=t,this.parentContext=e,this.parentRequest=n,this.target=i,this.childRequests=[],this.bindings=Array.isArray(r)?r:[r],this.requestScope=null===n?new Map:null}return t.prototype.addChildRequest=function(e,n,r){var i=new t(e,this.parentContext,this,n,r);return this.childRequests.push(i),i},t}();function It(t){return t._bindingDictionary}function xt(t,e,n,r,i){var o=Nt(n.container,i.serviceIdentifier),a=[];return o.length===at.NoBindingsAvailable&&n.container.options.autoBindInjectable&&"function"==typeof i.serviceIdentifier&&t.getConstructorMetadata(i.serviceIdentifier).compilerGeneratedMetadata&&(n.container.bind(i.serviceIdentifier).toSelf(),o=Nt(n.container,i.serviceIdentifier)),a=e?o:o.filter((function(t){var e=new St(t.serviceIdentifier,n,r,t,i);return t.constraint(e)})),function(t,e,n,r){switch(e.length){case at.NoBindingsAvailable:if(n.isOptional())return e;var i=ct(t),o=X;throw o+=function(t,e){if(e.isTagged()||e.isNamed()){var n="",r=e.getNamedTag(),i=e.getCustomTags();return null!==r&&(n+=r.toString()+"\n"),null!==i&&i.forEach((function(t){n+=t.toString()+"\n"}))," "+t+"\n "+t+" - "+n}return" "+t}(i,n),o+=ut(r,i,Nt),new Error(o);case at.OnlyOneBindingAvailable:return e;case at.MultipleBindingsAvailable:default:if(n.isArray())return e;i=ct(t),o=Q+" "+i;throw o+=ut(r,i,Nt),new Error(o)}}(i.serviceIdentifier,a,i,n.container),a}function kt(t,e,n,r,i,o){var a,s;if(null===i){a=xt(t,e,r,null,o),s=new St(n,r,null,a,o);var c=new yt(r,s);r.addPlan(c)}else a=xt(t,e,r,i,o),s=i.addChildRequest(o.serviceIdentifier,a,o);a.forEach((function(e){var n=null;if(o.isArray())n=s.addChildRequest(e.serviceIdentifier,e,o);else{if(e.cache)return;n=s}if(e.type===L.Instance&&null!==e.implementationType){var i=function(t,e){return wt(t,pt(e),e,!1)}(t,e.implementationType);if(!r.container.options.skipBaseClassChecks){var a=Et(t,e.implementationType);if(i.length<a){var c=tt(pt(e.implementationType));throw new Error(c)}}i.forEach((function(e){kt(t,!1,e.serviceIdentifier,r,n,e)}))}}))}function Nt(t,e){var n=[],r=It(t);return r.hasKey(e)?n=r.get(e):null!==t.parent&&(n=Nt(t.parent,e)),n}function Mt(t,e,n,r,i,o,a,s){void 0===s&&(s=!1);var c=new dt(e),u=function(t,e,n,r,i,o){var a=new ft(t?q:j,n),s=new mt(e,r,n,a);if(void 0!==i){var c=new ft(i,o);s.metadata.push(c)}return s}(n,r,i,"",o,a);try{return kt(t,s,i,c,null,u),c}catch(t){throw st(t)&<(c.plan.rootRequest),t}}function Rt(t){return("object"==typeof t&&null!==t||"function"==typeof t)&&"function"==typeof t.then}function Dt(t){return!!Rt(t)||Array.isArray(t)&&t.some(Rt)}var Pt,Ot=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{c(r.next(t))}catch(t){o(t)}}function s(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}c((r=r.apply(t,e||[])).next())}))},jt=function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},qt=function(t,e,n){t.has(e.id)||t.set(e.id,n)},$t=function(t,e){t.cache=e,t.activated=!0,Rt(e)&&Ft(t,e)},Ft=function(t,e){return Ot(void 0,void 0,void 0,(function(){var n,r;return jt(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,e];case 1:return n=i.sent(),t.cache=n,[3,3];case 2:throw r=i.sent(),t.cache=null,t.activated=!1,r;case 3:return[2]}}))}))};!function(t){t.DynamicValue="toDynamicValue",t.Factory="toFactory",t.Provider="toProvider"}(Pt||(Pt={}));var Bt=function(){return Bt=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},Bt.apply(this,arguments)},Vt=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{c(r.next(t))}catch(t){o(t)}}function s(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}c((r=r.apply(t,e||[])).next())}))},Lt=function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},Ht=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function Wt(t,e,n){var r;if(e.length>0){var i=function(t,e){return t.reduce((function(t,n){var r=e(n);return n.target.type===H.ConstructorArgument?t.constructorInjections.push(r):(t.propertyRequests.push(n),t.propertyInjections.push(r)),t.isAsync||(t.isAsync=Dt(r)),t}),{constructorInjections:[],propertyInjections:[],propertyRequests:[],isAsync:!1})}(e,n),o=Bt(Bt({},i),{constr:t});r=i.isAsync?function(t){return Vt(this,void 0,void 0,(function(){var e,n;return Lt(this,(function(r){switch(r.label){case 0:return[4,Kt(t.constructorInjections)];case 1:return e=r.sent(),[4,Kt(t.propertyInjections)];case 2:return n=r.sent(),[2,Gt(Bt(Bt({},t),{constructorInjections:e,propertyInjections:n}))]}}))}))}(o):Gt(o)}else r=new t;return r}function Gt(t){var e,n=new((e=t.constr).bind.apply(e,Ht([void 0],t.constructorInjections,!1)));return t.propertyRequests.forEach((function(e,r){var i=e.target.identifier,o=t.propertyInjections[r];n[i]=o})),n}function Kt(t){return Vt(this,void 0,void 0,(function(){var e,n,r,i;return Lt(this,(function(o){for(e=[],n=0,r=t;n<r.length;n++)i=r[n],Array.isArray(i)?e.push(Promise.all(i)):e.push(i);return[2,Promise.all(e)]}))}))}function Ut(t,e){var n=function(t,e){var n,r;if(Reflect.hasMetadata($,t)){var i=Reflect.getMetadata($,t);try{return null===(r=(n=e)[i.value])||void 0===r?void 0:r.call(n)}catch(e){throw new Error(et(t.name,e.message))}}}(t,e);return Rt(n)?n.then((function(){return e})):e}function zt(t,e){t.scope!==V.Singleton&&function(t,e){var n="Class cannot be instantiated in "+(t.scope===V.Request?"request":"transient")+" scope.";if("function"==typeof t.onDeactivation)throw new Error(rt(e.name,n));if(Reflect.hasMetadata(F,e))throw new Error(nt(e.name,n))}(t,e)}var Qt=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{c(r.next(t))}catch(t){o(t)}}function s(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}c((r=r.apply(t,e||[])).next())}))},Xt=function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},Yt=function(t){return function(e){e.parentContext.setCurrentRequest(e);var n=e.bindings,r=e.childRequests,i=e.target&&e.target.isArray(),o=!(e.parentRequest&&e.parentRequest.target&&e.target&&e.parentRequest.target.matchesArray(e.target.serviceIdentifier));if(i&&o)return r.map((function(e){return Yt(t)(e)}));if(!e.target.isOptional()||0!==n.length){var a=n[0];return ee(t,e,a)}}},Jt=function(t,e){var n=function(t){switch(t.type){case L.Factory:return{factory:t.factory,factoryType:Pt.Factory};case L.Provider:return{factory:t.provider,factoryType:Pt.Provider};case L.DynamicValue:return{factory:t.dynamicValue,factoryType:Pt.DynamicValue};default:throw new Error("Unexpected factory type "+t.type)}}(t);return function(t,e){try{return t()}catch(t){throw st(t)&&(t=e()),t}}((function(){return n.factory.bind(t)(e)}),(function(){return new Error((t=n.factoryType,r=e.currentRequest.serviceIdentifier.toString(),"It looks like there is a circular dependency in one of the '"+t+"' bindings. Please investigate bindings withservice identifier '"+r+"'."));var t,r}))},Zt=function(t,e,n){var r,i=e.childRequests;switch(function(t){var e=null;switch(t.type){case L.ConstantValue:case L.Function:e=t.cache;break;case L.Constructor:case L.Instance:e=t.implementationType;break;case L.DynamicValue:e=t.dynamicValue;break;case L.Provider:e=t.provider;break;case L.Factory:e=t.factory}if(null===e){var n=ct(t.serviceIdentifier);throw new Error("Invalid binding type: "+n)}}(n),n.type){case L.ConstantValue:case L.Function:r=n.cache;break;case L.Constructor:r=n.implementationType;break;case L.Instance:r=function(t,e,n,r){zt(t,e);var i=Wt(e,n,r);return Rt(i)?i.then((function(t){return Ut(e,t)})):Ut(e,i)}(n,n.implementationType,i,Yt(t));break;default:r=Jt(n,e.parentContext)}return r},te=function(t,e,n){var r=function(t,e){return e.scope===V.Singleton&&e.activated?e.cache:e.scope===V.Request&&t.has(e.id)?t.get(e.id):null}(t,e);return null!==r||function(t,e,n){e.scope===V.Singleton&&$t(e,n),e.scope===V.Request&&qt(t,e,n)}(t,e,r=n()),r},ee=function(t,e,n){return te(t,n,(function(){var r=Zt(t,e,n);return r=Rt(r)?r.then((function(t){return ne(e,n,t)})):ne(e,n,r)}))};function ne(t,e,n){var r,i=re(t.parentContext,e,n),o=se(t.parentContext.container),a=o.next();do{r=a.value;var s=t.parentContext,c=t.serviceIdentifier,u=ae(r,c);i=Rt(i)?oe(u,s,i):ie(u,s,i),a=o.next()}while(!0!==a.done&&!It(r).hasKey(t.serviceIdentifier));return i}var re=function(t,e,n){return"function"==typeof e.onActivation?e.onActivation(t,n):n},ie=function(t,e,n){for(var r=t.next();!r.done;){if(Rt(n=r.value(e,n)))return oe(t,e,n);r=t.next()}return n},oe=function(t,e,n){return Qt(void 0,void 0,void 0,(function(){var r,i;return Xt(this,(function(o){switch(o.label){case 0:return[4,n];case 1:r=o.sent(),i=t.next(),o.label=2;case 2:return i.done?[3,4]:[4,i.value(e,r)];case 3:return r=o.sent(),i=t.next(),[3,2];case 4:return[2,r]}}))}))},ae=function(t,e){var n=t._activations;return n.hasKey(e)?n.get(e).values():[].values()},se=function(t){for(var e=[t],n=t.parent;null!==n;)e.push(n),n=n.parent;return{next:function(){var t=e.pop();return void 0!==t?{done:!1,value:t}:{done:!0,value:void 0}}}};var ce=function(t,e){var n=t.parentRequest;return null!==n&&(!!e(n)||ce(n,e))},ue=function(t){return function(e){var n=function(n){return null!==n&&null!==n.target&&n.target.matchesTag(t)(e)};return n.metaData=new ft(t,e),n}},he=ue(R),le=function(t){return function(e){var n=null;if(null!==e){if(n=e.bindings[0],"string"==typeof t)return n.serviceIdentifier===t;var r=e.bindings[0].implementationType;return t===r}return!1}},pe=function(){function t(t){this._binding=t}return t.prototype.when=function(t){return this._binding.constraint=t,new de(this._binding)},t.prototype.whenTargetNamed=function(t){return this._binding.constraint=he(t),new de(this._binding)},t.prototype.whenTargetIsDefault=function(){return this._binding.constraint=function(t){return null!==t&&(null!==t.target&&!t.target.isNamed()&&!t.target.isTagged())},new de(this._binding)},t.prototype.whenTargetTagged=function(t,e){return this._binding.constraint=ue(t)(e),new de(this._binding)},t.prototype.whenInjectedInto=function(t){return this._binding.constraint=function(e){return null!==e&&le(t)(e.parentRequest)},new de(this._binding)},t.prototype.whenParentNamed=function(t){return this._binding.constraint=function(e){return null!==e&&he(t)(e.parentRequest)},new de(this._binding)},t.prototype.whenParentTagged=function(t,e){return this._binding.constraint=function(n){return null!==n&&ue(t)(e)(n.parentRequest)},new de(this._binding)},t.prototype.whenAnyAncestorIs=function(t){return this._binding.constraint=function(e){return null!==e&&ce(e,le(t))},new de(this._binding)},t.prototype.whenNoAncestorIs=function(t){return this._binding.constraint=function(e){return null!==e&&!ce(e,le(t))},new de(this._binding)},t.prototype.whenAnyAncestorNamed=function(t){return this._binding.constraint=function(e){return null!==e&&ce(e,he(t))},new de(this._binding)},t.prototype.whenNoAncestorNamed=function(t){return this._binding.constraint=function(e){return null!==e&&!ce(e,he(t))},new de(this._binding)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._binding.constraint=function(n){return null!==n&&ce(n,ue(t)(e))},new de(this._binding)},t.prototype.whenNoAncestorTagged=function(t,e){return this._binding.constraint=function(n){return null!==n&&!ce(n,ue(t)(e))},new de(this._binding)},t.prototype.whenAnyAncestorMatches=function(t){return this._binding.constraint=function(e){return null!==e&&ce(e,t)},new de(this._binding)},t.prototype.whenNoAncestorMatches=function(t){return this._binding.constraint=function(e){return null!==e&&!ce(e,t)},new de(this._binding)},t}(),de=function(){function t(t){this._binding=t}return t.prototype.onActivation=function(t){return this._binding.onActivation=t,new pe(this._binding)},t.prototype.onDeactivation=function(t){return this._binding.onDeactivation=t,new pe(this._binding)},t}(),fe=function(){function t(t){this._binding=t,this._bindingWhenSyntax=new pe(this._binding),this._bindingOnSyntax=new de(this._binding)}return t.prototype.when=function(t){return this._bindingWhenSyntax.when(t)},t.prototype.whenTargetNamed=function(t){return this._bindingWhenSyntax.whenTargetNamed(t)},t.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},t.prototype.whenTargetTagged=function(t,e){return this._bindingWhenSyntax.whenTargetTagged(t,e)},t.prototype.whenInjectedInto=function(t){return this._bindingWhenSyntax.whenInjectedInto(t)},t.prototype.whenParentNamed=function(t){return this._bindingWhenSyntax.whenParentNamed(t)},t.prototype.whenParentTagged=function(t,e){return this._bindingWhenSyntax.whenParentTagged(t,e)},t.prototype.whenAnyAncestorIs=function(t){return this._bindingWhenSyntax.whenAnyAncestorIs(t)},t.prototype.whenNoAncestorIs=function(t){return this._bindingWhenSyntax.whenNoAncestorIs(t)},t.prototype.whenAnyAncestorNamed=function(t){return this._bindingWhenSyntax.whenAnyAncestorNamed(t)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenAnyAncestorTagged(t,e)},t.prototype.whenNoAncestorNamed=function(t){return this._bindingWhenSyntax.whenNoAncestorNamed(t)},t.prototype.whenNoAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenNoAncestorTagged(t,e)},t.prototype.whenAnyAncestorMatches=function(t){return this._bindingWhenSyntax.whenAnyAncestorMatches(t)},t.prototype.whenNoAncestorMatches=function(t){return this._bindingWhenSyntax.whenNoAncestorMatches(t)},t.prototype.onActivation=function(t){return this._bindingOnSyntax.onActivation(t)},t.prototype.onDeactivation=function(t){return this._bindingOnSyntax.onDeactivation(t)},t}(),ye=function(){function t(t){this._binding=t}return t.prototype.inRequestScope=function(){return this._binding.scope=V.Request,new fe(this._binding)},t.prototype.inSingletonScope=function(){return this._binding.scope=V.Singleton,new fe(this._binding)},t.prototype.inTransientScope=function(){return this._binding.scope=V.Transient,new fe(this._binding)},t}(),ge=function(){function t(t){this._binding=t,this._bindingWhenSyntax=new pe(this._binding),this._bindingOnSyntax=new de(this._binding),this._bindingInSyntax=new ye(t)}return t.prototype.inRequestScope=function(){return this._bindingInSyntax.inRequestScope()},t.prototype.inSingletonScope=function(){return this._bindingInSyntax.inSingletonScope()},t.prototype.inTransientScope=function(){return this._bindingInSyntax.inTransientScope()},t.prototype.when=function(t){return this._bindingWhenSyntax.when(t)},t.prototype.whenTargetNamed=function(t){return this._bindingWhenSyntax.whenTargetNamed(t)},t.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},t.prototype.whenTargetTagged=function(t,e){return this._bindingWhenSyntax.whenTargetTagged(t,e)},t.prototype.whenInjectedInto=function(t){return this._bindingWhenSyntax.whenInjectedInto(t)},t.prototype.whenParentNamed=function(t){return this._bindingWhenSyntax.whenParentNamed(t)},t.prototype.whenParentTagged=function(t,e){return this._bindingWhenSyntax.whenParentTagged(t,e)},t.prototype.whenAnyAncestorIs=function(t){return this._bindingWhenSyntax.whenAnyAncestorIs(t)},t.prototype.whenNoAncestorIs=function(t){return this._bindingWhenSyntax.whenNoAncestorIs(t)},t.prototype.whenAnyAncestorNamed=function(t){return this._bindingWhenSyntax.whenAnyAncestorNamed(t)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenAnyAncestorTagged(t,e)},t.prototype.whenNoAncestorNamed=function(t){return this._bindingWhenSyntax.whenNoAncestorNamed(t)},t.prototype.whenNoAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenNoAncestorTagged(t,e)},t.prototype.whenAnyAncestorMatches=function(t){return this._bindingWhenSyntax.whenAnyAncestorMatches(t)},t.prototype.whenNoAncestorMatches=function(t){return this._bindingWhenSyntax.whenNoAncestorMatches(t)},t.prototype.onActivation=function(t){return this._bindingOnSyntax.onActivation(t)},t.prototype.onDeactivation=function(t){return this._bindingOnSyntax.onDeactivation(t)},t}(),ve=function(){function t(t){this._binding=t}return t.prototype.to=function(t){return this._binding.type=L.Instance,this._binding.implementationType=t,new ge(this._binding)},t.prototype.toSelf=function(){if("function"!=typeof this._binding.serviceIdentifier)throw new Error("The toSelf function can only be applied when a constructor is used as service identifier");var t=this._binding.serviceIdentifier;return this.to(t)},t.prototype.toConstantValue=function(t){return this._binding.type=L.ConstantValue,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=V.Singleton,new fe(this._binding)},t.prototype.toDynamicValue=function(t){return this._binding.type=L.DynamicValue,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new ge(this._binding)},t.prototype.toConstructor=function(t){return this._binding.type=L.Constructor,this._binding.implementationType=t,this._binding.scope=V.Singleton,new fe(this._binding)},t.prototype.toFactory=function(t){return this._binding.type=L.Factory,this._binding.factory=t,this._binding.scope=V.Singleton,new fe(this._binding)},t.prototype.toFunction=function(t){if("function"!=typeof t)throw new Error("Value provided to function binding must be a function!");var e=this.toConstantValue(t);return this._binding.type=L.Function,this._binding.scope=V.Singleton,e},t.prototype.toAutoFactory=function(t){return this._binding.type=L.Factory,this._binding.factory=function(e){return function(){return e.container.get(t)}},this._binding.scope=V.Singleton,new fe(this._binding)},t.prototype.toAutoNamedFactory=function(t){return this._binding.type=L.Factory,this._binding.factory=function(e){return function(n){return e.container.getNamed(t,n)}},new fe(this._binding)},t.prototype.toProvider=function(t){return this._binding.type=L.Provider,this._binding.provider=t,this._binding.scope=V.Singleton,new fe(this._binding)},t.prototype.toService=function(t){this.toDynamicValue((function(e){return e.container.get(t)}))},t}(),me=function(){function t(){}return t.of=function(e,n,r,i,o){var a=new t;return a.bindings=e,a.middleware=n,a.deactivations=i,a.activations=r,a.moduleActivationStore=o,a},t}();var be=function(){function t(){this._map=new Map}return t.prototype.getMap=function(){return this._map},t.prototype.add=function(t,e){if(null==t)throw new Error(U);if(null==e)throw new Error(U);var n=this._map.get(t);void 0!==n?n.push(e):this._map.set(t,[e])},t.prototype.get=function(t){if(null==t)throw new Error(U);var e=this._map.get(t);if(void 0!==e)return e;throw new Error(z)},t.prototype.remove=function(t){if(null==t)throw new Error(U);if(!this._map.delete(t))throw new Error(z)},t.prototype.removeIntersection=function(t){var e=this;this.traverse((function(n,r){var i=t.hasKey(n)?t.get(n):void 0;if(void 0!==i){var o=r.filter((function(t){return!i.some((function(e){return t===e}))}));e._setValue(n,o)}}))},t.prototype.removeByCondition=function(t){var e=this,n=[];return this._map.forEach((function(r,i){for(var o=[],a=0,s=r;a<s.length;a++){var c=s[a];t(c)?n.push(c):o.push(c)}e._setValue(i,o)})),n},t.prototype.hasKey=function(t){if(null==t)throw new Error(U);return this._map.has(t)},t.prototype.clone=function(){var e=new t;return this._map.forEach((function(t,n){t.forEach((function(t){return e.add(n,"object"==typeof(r=t)&&null!==r&&"clone"in r&&"function"==typeof r.clone?t.clone():t);var r}))})),e},t.prototype.traverse=function(t){this._map.forEach((function(e,n){t(n,e)}))},t.prototype._setValue=function(t,e){e.length>0?this._map.set(t,e):this._map.delete(t)},t}(),we=function(){function t(){this._map=new Map}return t.prototype.remove=function(t){if(this._map.has(t)){var e=this._map.get(t);return this._map.delete(t),e}return this._getEmptyHandlersStore()},t.prototype.addDeactivation=function(t,e,n){this._getModuleActivationHandlers(t).onDeactivations.add(e,n)},t.prototype.addActivation=function(t,e,n){this._getModuleActivationHandlers(t).onActivations.add(e,n)},t.prototype.clone=function(){var e=new t;return this._map.forEach((function(t,n){e._map.set(n,{onActivations:t.onActivations.clone(),onDeactivations:t.onDeactivations.clone()})})),e},t.prototype._getModuleActivationHandlers=function(t){var e=this._map.get(t);return void 0===e&&(e=this._getEmptyHandlersStore(),this._map.set(t,e)),e},t.prototype._getEmptyHandlersStore=function(){return{onActivations:new be,onDeactivations:new be}},t}(),_e=function(){return _e=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},_e.apply(this,arguments)},Ce=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{c(r.next(t))}catch(t){o(t)}}function s(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}c((r=r.apply(t,e||[])).next())}))},Ae=function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},Ee=function(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))},Te=function(){function t(t){var e=t||{};if("object"!=typeof e)throw new Error("Invalid Container constructor argument. Container options must be an object.");if(void 0===e.defaultScope)e.defaultScope=V.Transient;else if(e.defaultScope!==V.Singleton&&e.defaultScope!==V.Transient&&e.defaultScope!==V.Request)throw new Error("Invalid Container option. Default scope must be a string ('singleton' or 'transient').");if(void 0===e.autoBindInjectable)e.autoBindInjectable=!1;else if("boolean"!=typeof e.autoBindInjectable)throw new Error("Invalid Container option. Auto bind injectable must be a boolean");if(void 0===e.skipBaseClassChecks)e.skipBaseClassChecks=!1;else if("boolean"!=typeof e.skipBaseClassChecks)throw new Error("Invalid Container option. Skip base check must be a boolean");this.options={autoBindInjectable:e.autoBindInjectable,defaultScope:e.defaultScope,skipBaseClassChecks:e.skipBaseClassChecks},this.id=G(),this._bindingDictionary=new be,this._snapshots=[],this._middleware=null,this._activations=new be,this._deactivations=new be,this.parent=null,this._metadataReader=new ot,this._moduleActivationStore=new we}return t.merge=function(e,n){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];var o=new t,a=Ee([e,n],r,!0).map((function(t){return It(t)})),s=It(o);return a.forEach((function(t){var e;e=s,t.traverse((function(t,n){n.forEach((function(t){e.add(t.serviceIdentifier,t.clone())}))}))})),o},t.prototype.load=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var n=this._getContainerModuleHelpersFactory(),r=0,i=t;r<i.length;r++){var o=i[r],a=n(o.id);o.registry(a.bindFunction,a.unbindFunction,a.isboundFunction,a.rebindFunction,a.unbindAsyncFunction,a.onActivationFunction,a.onDeactivationFunction)}},t.prototype.loadAsync=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Ce(this,void 0,void 0,(function(){var e,n,r,i,o;return Ae(this,(function(a){switch(a.label){case 0:e=this._getContainerModuleHelpersFactory(),n=0,r=t,a.label=1;case 1:return n<r.length?(i=r[n],o=e(i.id),[4,i.registry(o.bindFunction,o.unbindFunction,o.isboundFunction,o.rebindFunction,