@antv/g 5.1.8-alpha.1 → 5.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Canvas.d.ts.map +1 -1
- package/dist/canvas-module.d.ts.map +1 -1
- package/dist/css/StyleValueRegistry.d.ts.map +1 -1
- package/dist/css/cssom/CSSGradientValue.d.ts +10 -23
- package/dist/css/cssom/CSSGradientValue.d.ts.map +1 -1
- package/dist/css/cssom/CSSNumericValue.d.ts +1 -1
- package/dist/css/parser/color.d.ts +12 -3
- package/dist/css/parser/color.d.ts.map +1 -1
- package/dist/css/parser/dimension.d.ts.map +1 -1
- package/dist/css/parser/gradient.d.ts +4 -0
- package/dist/css/parser/gradient.d.ts.map +1 -0
- package/dist/css/properties/CSSPropertyColor.d.ts +5 -4
- package/dist/css/properties/CSSPropertyColor.d.ts.map +1 -1
- package/dist/dom/EventTarget.d.ts.map +1 -1
- package/dist/dom/KeyframeList.d.ts.map +1 -1
- package/dist/index.esm.js +13429 -11816
- package/dist/index.js +13671 -12057
- package/dist/index.umd.js +18950 -16528
- package/dist/index.umd.min.js +2 -2
- package/dist/plugins/CullingPlugin.d.ts.map +1 -1
- package/dist/plugins/FrustumCullingStrategy.d.ts +0 -4
- package/dist/plugins/FrustumCullingStrategy.d.ts.map +1 -1
- package/dist/plugins/PrepareRendererPlugin.d.ts.map +1 -1
- package/dist/services/RenderingContext.d.ts +1 -0
- package/dist/services/RenderingContext.d.ts.map +1 -1
- package/dist/services/RenderingService.d.ts +3 -1
- package/dist/services/RenderingService.d.ts.map +1 -1
- package/dist/services/aabb/RectUpdater.d.ts +1 -1
- package/dist/services/aabb/RectUpdater.d.ts.map +1 -1
- package/dist/types.d.ts +5 -5
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/gradient.d.ts +106 -0
- package/dist/utils/gradient.d.ts.map +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/path.d.ts +1 -1
- package/dist/utils/path.d.ts.map +1 -1
- package/package.json +8 -5
package/dist/index.umd.min.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).G={})}(this,(function(t){"use strict";var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(t,e,n){return t(n={path:e,exports:{},require:function(t,e){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}()}},n.exports),n.exports}var i,r,o=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.NON_CUSTOM_TAG_KEYS=e.POST_CONSTRUCT=e.DESIGN_PARAM_TYPES=e.PARAM_TYPES=e.TAGGED_PROP=e.TAGGED=e.MULTI_INJECT_TAG=e.INJECT_TAG=e.OPTIONAL_TAG=e.UNMANAGED_TAG=e.NAME_TAG=e.NAMED_TAG=void 0,e.NAMED_TAG="named",e.NAME_TAG="name",e.UNMANAGED_TAG="unmanaged",e.OPTIONAL_TAG="optional",e.INJECT_TAG="inject",e.MULTI_INJECT_TAG="multi_inject",e.TAGGED="inversify:tagged",e.TAGGED_PROP="inversify:tagged_props",e.PARAM_TYPES="inversify:paramtypes",e.DESIGN_PARAM_TYPES="design:paramtypes",e.POST_CONSTRUCT="post_construct",e.NON_CUSTOM_TAG_KEYS=[e.INJECT_TAG,e.MULTI_INJECT_TAG,e.NAME_TAG,e.UNMANAGED_TAG,e.NAMED_TAG,e.OPTIONAL_TAG]})),a=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.TargetTypeEnum=e.BindingTypeEnum=e.BindingScopeEnum=void 0;e.BindingScopeEnum={Request:"Request",Singleton:"Singleton",Transient:"Transient"};e.BindingTypeEnum={ConstantValue:"ConstantValue",Constructor:"Constructor",DynamicValue:"DynamicValue",Factory:"Factory",Function:"Function",Instance:"Instance",Invalid:"Invalid",Provider:"Provider"};e.TargetTypeEnum={ClassProperty:"ClassProperty",ConstructorArgument:"ConstructorArgument",Variable:"Variable"}})),s=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.id=void 0;var n=0;e.id=function(){return n++}})),u=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Binding=void 0;var n=function(){function t(t,e){this.id=s.id(),this.activated=!1,this.serviceIdentifier=t,this.scope=e,this.type=a.BindingTypeEnum.Invalid,this.constraint=function(t){return!0},this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.onActivation=null,this.dynamicValue=null}return t.prototype.clone=function(){var e=new t(this.serviceIdentifier,this.scope);return e.activated=e.scope===a.BindingScopeEnum.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.cache=this.cache,e},t}();e.Binding=n})),c=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.STACK_OVERFLOW=e.CIRCULAR_DEPENDENCY_IN_FACTORY=e.POST_CONSTRUCT_ERROR=e.MULTIPLE_POST_CONSTRUCT_METHODS=e.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK=e.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE=e.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE=e.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT=e.ARGUMENTS_LENGTH_MISMATCH=e.INVALID_DECORATOR_OPERATION=e.INVALID_TO_SELF_VALUE=e.INVALID_FUNCTION_BINDING=e.INVALID_MIDDLEWARE_RETURN=e.NO_MORE_SNAPSHOTS_AVAILABLE=e.INVALID_BINDING_TYPE=e.NOT_IMPLEMENTED=e.CIRCULAR_DEPENDENCY=e.UNDEFINED_INJECT_ANNOTATION=e.MISSING_INJECT_ANNOTATION=e.MISSING_INJECTABLE_ANNOTATION=e.NOT_REGISTERED=e.CANNOT_UNBIND=e.AMBIGUOUS_MATCH=e.KEY_NOT_FOUND=e.NULL_ARGUMENT=e.DUPLICATED_METADATA=e.DUPLICATED_INJECTABLE_DECORATOR=void 0,e.DUPLICATED_INJECTABLE_DECORATOR="Cannot apply @injectable decorator multiple times.",e.DUPLICATED_METADATA="Metadata key was used more than once in a parameter:",e.NULL_ARGUMENT="NULL argument",e.KEY_NOT_FOUND="Key Not Found",e.AMBIGUOUS_MATCH="Ambiguous match found for serviceIdentifier:",e.CANNOT_UNBIND="Could not unbind serviceIdentifier:",e.NOT_REGISTERED="No matching bindings found for serviceIdentifier:",e.MISSING_INJECTABLE_ANNOTATION="Missing required @injectable annotation in:",e.MISSING_INJECT_ANNOTATION="Missing required @inject or @multiInject annotation in:";e.UNDEFINED_INJECT_ANNOTATION=function(t){return"@inject called with undefined this could mean that the class "+t+" has a circular dependency problem. You can use a LazyServiceIdentifer to overcome this limitation."},e.CIRCULAR_DEPENDENCY="Circular dependency found:",e.NOT_IMPLEMENTED="Sorry, this feature is not fully implemented yet.",e.INVALID_BINDING_TYPE="Invalid binding type:",e.NO_MORE_SNAPSHOTS_AVAILABLE="No snapshot available to restore.",e.INVALID_MIDDLEWARE_RETURN="Invalid return type in middleware. Middleware must return!",e.INVALID_FUNCTION_BINDING="Value provided to function binding must be a function!",e.INVALID_TO_SELF_VALUE="The toSelf function can only be applied when a constructor is used as service identifier",e.INVALID_DECORATOR_OPERATION="The @inject @multiInject @tagged and @named decorators must be applied to the parameters of a class constructor or a class property.";e.ARGUMENTS_LENGTH_MISMATCH=function(){for(var t=[],e=0;arguments.length>e;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."},e.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT="Invalid Container constructor argument. Container options must be an object.",e.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE="Invalid Container option. Default scope must be a string ('singleton' or 'transient').",e.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE="Invalid Container option. Auto bind injectable must be a boolean",e.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK="Invalid Container option. Skip base check must be a boolean",e.MULTIPLE_POST_CONSTRUCT_METHODS="Cannot apply @postConstruct decorator multiple times in the same class";e.POST_CONSTRUCT_ERROR=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return"@postConstruct error in class "+t[0]+": "+t[1]};e.CIRCULAR_DEPENDENCY_IN_FACTORY=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return"It looks like there is a circular dependency in one of the '"+t[0]+"' bindings. Please investigate bindings withservice identifier '"+t[1]+"'."},e.STACK_OVERFLOW="Maximum call stack size exceeded"})),l=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.MetadataReader=void 0;var n=function(){function t(){}return t.prototype.getConstructorMetadata=function(t){return{compilerGeneratedMetadata:Reflect.getMetadata(o.PARAM_TYPES,t),userGeneratedMetadata:Reflect.getMetadata(o.TAGGED,t)||{}}},t.prototype.getPropertiesMetadata=function(t){return Reflect.getMetadata(o.TAGGED_PROP,t)||[]},t}();e.MetadataReader=n})),h=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.BindingCount=void 0;e.BindingCount={MultipleBindingsAvailable:2,NoBindingsAvailable:0,OnlyOneBindingAvailable:1}})),p=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.isStackOverflowExeption=void 0,e.isStackOverflowExeption=function(t){return t instanceof RangeError||t.message===c.STACK_OVERFLOW}})),f=n((function(t,e){function n(t){return"function"==typeof t?t.name:"symbol"==typeof t?t.toString():t}function i(t,e){return null!==t.parentRequest&&(t.parentRequest.serviceIdentifier===e||i(t.parentRequest,e))}function r(t){if(t.name)return t.name;var e=t.toString(),n=e.match(/^function\s*([^\s(]+)/);return n?n[1]:"Anonymous function: "+e}Object.defineProperty(e,"__esModule",{value:!0}),e.circularDependencyToException=e.listMetadataForTarget=e.listRegisteredBindingsForServiceIdentifier=e.getServiceIdentifierAsString=e.getFunctionName=void 0,e.getServiceIdentifierAsString=n,e.listRegisteredBindingsForServiceIdentifier=function(t,e,n){var i="",o=n(t,e);return 0!==o.length&&(i="\nRegistered bindings:",o.forEach((function(t){var e="Object";null!==t.implementationType&&(e=r(t.implementationType)),i=i+"\n "+e,t.constraint.metaData&&(i=i+" - "+t.constraint.metaData)}))),i},e.circularDependencyToException=function t(e){e.childRequests.forEach((function(e){if(i(e,e.serviceIdentifier)){var r=function(t){return function t(e,i){void 0===i&&(i=[]);var r=n(e.serviceIdentifier);return i.push(r),null!==e.parentRequest?t(e.parentRequest,i):i}(t).reverse().join(" --\x3e ")}(e);throw new Error(c.CIRCULAR_DEPENDENCY+" "+r)}t(e)}))},e.listMetadataForTarget=function(t,e){if(e.isTagged()||e.isNamed()){var n="",i=e.getNamedTag(),r=e.getCustomTags();return null!==i&&(n+=i.toString()+"\n"),null!==r&&r.forEach((function(t){n+=t.toString()+"\n"}))," "+t+"\n "+t+" - "+n}return" "+t},e.getFunctionName=r})),d=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Context=void 0;var n=function(){function t(t){this.id=s.id(),this.container=t}return t.prototype.addPlan=function(t){this.plan=t},t.prototype.setCurrentRequest=function(t){this.currentRequest=t},t}();e.Context=n})),y=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Metadata=void 0;var n=function(){function t(t,e){this.key=t,this.value=e}return t.prototype.toString=function(){return this.key===o.NAMED_TAG?"named: "+this.value.toString()+" ":"tagged: { key:"+this.key.toString()+", value: "+this.value+" }"},t}();e.Metadata=n})),v=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Plan=void 0,e.Plan=function(t,e){this.parentContext=t,this.rootRequest=e}})),g=n((function(t,e){function n(t,e,n,i,r){var o={},a="number"==typeof r,s=void 0!==r&&a?r.toString():n;if(a&&void 0!==n)throw new Error(c.INVALID_DECORATOR_OPERATION);Reflect.hasOwnMetadata(t,e)&&(o=Reflect.getMetadata(t,e));var u=o[s];if(Array.isArray(u))for(var l=0,h=u;h.length>l;l++){var p=h[l];if(p.key===i.key)throw new Error(c.DUPLICATED_METADATA+" "+p.key.toString())}else u=[];u.push(i),o[s]=u,Reflect.defineMetadata(t,o,e)}function i(t,e){Reflect.decorate(t,e)}function r(t,e){return function(n,i){e(n,i,t)}}Object.defineProperty(e,"__esModule",{value:!0}),e.tagProperty=e.tagParameter=e.decorate=void 0,e.tagParameter=function(t,e,i,r){n(o.TAGGED,t,e,r,i)},e.tagProperty=function(t,e,i){n(o.TAGGED_PROP,t.constructor,e,i)},e.decorate=function(t,e,n){"number"==typeof n?i([r(n,t)],e):"string"==typeof n?Reflect.decorate([t],e,n):i([t],e)}})),m=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.inject=e.LazyServiceIdentifer=void 0;var n=function(){function t(t){this._cb=t}return t.prototype.unwrap=function(){return this._cb()},t}();e.LazyServiceIdentifer=n,e.inject=function(t){return function(e,n,i){if(void 0===t)throw new Error(c.UNDEFINED_INJECT_ANNOTATION(e.name));var r=new y.Metadata(o.INJECT_TAG,t);"number"==typeof i?g.tagParameter(e,n,i,r):g.tagProperty(e,n,r)}}})),T=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.QueryableString=void 0;var n=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}();e.QueryableString=n})),S=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Target=void 0;var n=function(){function t(t,e,n,i){this.id=s.id(),this.type=t,this.serviceIdentifier=n,this.name=new T.QueryableString(e||""),this.metadata=new Array;var r=null;"string"==typeof i?r=new y.Metadata(o.NAMED_TAG,i):i instanceof y.Metadata&&(r=i),null!==r&&this.metadata.push(r)}return t.prototype.hasTag=function(t){for(var e=0,n=this.metadata;n.length>e;e++){if(n[e].key===t)return!0}return!1},t.prototype.isArray=function(){return this.hasTag(o.MULTI_INJECT_TAG)},t.prototype.matchesArray=function(t){return this.matchesTag(o.MULTI_INJECT_TAG)(t)},t.prototype.isNamed=function(){return this.hasTag(o.NAMED_TAG)},t.prototype.isTagged=function(){return this.metadata.some((function(t){return o.NON_CUSTOM_TAG_KEYS.every((function(e){return t.key!==e}))}))},t.prototype.isOptional=function(){return this.matchesTag(o.OPTIONAL_TAG)(!0)},t.prototype.getNamedTag=function(){return this.isNamed()?this.metadata.filter((function(t){return t.key===o.NAMED_TAG}))[0]:null},t.prototype.getCustomTags=function(){return this.isTagged()?this.metadata.filter((function(t){return o.NON_CUSTOM_TAG_KEYS.every((function(e){return t.key!==e}))})):null},t.prototype.matchesNamedTag=function(t){return this.matchesTag(o.NAMED_TAG)(t)},t.prototype.matchesTag=function(t){var e=this;return function(n){for(var i=0,r=e.metadata;r.length>i;i++){var o=r[i];if(o.key===t&&o.value===n)return!0}return!1}},t}();e.Target=n})),b=n((function(t,n){var i=e&&e.__spreadArray||function(t,e){for(var n=0,i=e.length,r=t.length;i>n;n++,r++)t[r]=e[n];return t};function r(t,e,n,r){var o=t.getConstructorMetadata(n),a=o.compilerGeneratedMetadata;if(void 0===a)throw new Error(c.MISSING_INJECTABLE_ANNOTATION+" "+e+".");var l=o.userGeneratedMetadata,h=Object.keys(l),p=function(t,e,n,i,r){for(var o=[],a=0;r>a;a++){var u=s(a,t,e,n,i);null!==u&&o.push(u)}return o}(r,e,a,l,0===n.length&&h.length>0||h.length>n.length?h.length:n.length),f=u(t,n);return i(i([],p),f)}function s(t,e,n,i,r){var o=r[t.toString()]||[],s=l(o),u=!0!==s.unmanaged,h=i[t],p=s.inject||s.multiInject;if((h=p||h)instanceof m.LazyServiceIdentifer&&(h=h.unwrap()),u){if(!e&&(h===Object||h===Function||void 0===h))throw new Error(c.MISSING_INJECT_ANNOTATION+" argument "+t+" in class "+n+".");var f=new S.Target(a.TargetTypeEnum.ConstructorArgument,s.targetName,h);return f.metadata=o,f}return null}function u(t,e){for(var n=t.getPropertiesMetadata(e),r=[],o=0,s=Object.keys(n);s.length>o;o++){var c=s[o],h=n[c],p=l(n[c]),f=new S.Target(a.TargetTypeEnum.ClassProperty,p.targetName||c,p.inject||p.multiInject);f.metadata=h,r.push(f)}var d=Object.getPrototypeOf(e.prototype).constructor;if(d!==Object){var y=u(t,d);r=i(i([],r),y)}return r}function l(t){var e={};return t.forEach((function(t){e[t.key.toString()]=t.value})),{inject:e[o.INJECT_TAG],multiInject:e[o.MULTI_INJECT_TAG],targetName:e[o.NAME_TAG],unmanaged:e[o.UNMANAGED_TAG]}}Object.defineProperty(n,"__esModule",{value:!0}),n.getFunctionName=n.getBaseClassDependencyCount=n.getDependencies=void 0,Object.defineProperty(n,"getFunctionName",{enumerable:!0,get:function(){return f.getFunctionName}}),n.getDependencies=function(t,e){return r(t,f.getFunctionName(e),e,!1)},n.getBaseClassDependencyCount=function t(e,n){var i=Object.getPrototypeOf(n.prototype).constructor;if(i!==Object){var a=r(e,f.getFunctionName(i),i,!0),s=a.map((function(t){return t.metadata.filter((function(t){return t.key===o.UNMANAGED_TAG}))})),u=[].concat.apply([],s).length,c=a.length-u;return c>0?c:t(e,i)}return 0}})),E=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Request=void 0;var n=function(){function t(t,e,n,i,r){this.id=s.id(),this.serviceIdentifier=t,this.parentContext=e,this.parentRequest=n,this.target=r,this.childRequests=[],this.bindings=Array.isArray(i)?i:[i],this.requestScope=null===n?new Map:null}return t.prototype.addChildRequest=function(e,n,i){var r=new t(e,this.parentContext,this,n,i);return this.childRequests.push(r),r},t}();e.Request=n})),w=n((function(t,e){function n(t){return t._bindingDictionary}function i(t,e,n,i,r,a){var s=new y.Metadata(t?o.MULTI_INJECT_TAG:o.INJECT_TAG,n),u=new S.Target(e,i,n,s);if(void 0!==r){var c=new y.Metadata(r,a);u.metadata.push(c)}return u}function r(t,e,n,i,r){var o=u(n.container,r.serviceIdentifier),a=[];return o.length===h.BindingCount.NoBindingsAvailable&&n.container.options.autoBindInjectable&&"function"==typeof r.serviceIdentifier&&t.getConstructorMetadata(r.serviceIdentifier).compilerGeneratedMetadata&&(n.container.bind(r.serviceIdentifier).toSelf(),o=u(n.container,r.serviceIdentifier)),a=e?o:o.filter((function(t){var e=new E.Request(t.serviceIdentifier,n,i,t,r);return t.constraint(e)})),function(t,e,n,i){switch(e.length){case h.BindingCount.NoBindingsAvailable:if(n.isOptional())return e;var r=f.getServiceIdentifierAsString(t),o=c.NOT_REGISTERED;throw o+=f.listMetadataForTarget(r,n),o+=f.listRegisteredBindingsForServiceIdentifier(i,r,u),new Error(o);case h.BindingCount.OnlyOneBindingAvailable:if(!n.isArray())return e;default:if(n.isArray())return e;r=f.getServiceIdentifierAsString(t),o=c.AMBIGUOUS_MATCH+" "+r;throw o+=f.listRegisteredBindingsForServiceIdentifier(i,r,u),new Error(o)}}(r.serviceIdentifier,a,r,n.container),a}function s(t,e,n,i,o,u){var l,h;if(null===o){l=r(t,e,i,null,u),h=new E.Request(n,i,null,l,u);var p=new v.Plan(i,h);i.addPlan(p)}else l=r(t,e,i,o,u),h=o.addChildRequest(u.serviceIdentifier,l,u);l.forEach((function(e){var n=null;if(u.isArray())n=h.addChildRequest(e.serviceIdentifier,e,u);else{if(e.cache)return;n=h}if(e.type===a.BindingTypeEnum.Instance&&null!==e.implementationType){var r=b.getDependencies(t,e.implementationType);if(!i.container.options.skipBaseClassChecks)if(b.getBaseClassDependencyCount(t,e.implementationType)>r.length){var o=c.ARGUMENTS_LENGTH_MISMATCH(b.getFunctionName(e.implementationType));throw new Error(o)}r.forEach((function(e){s(t,!1,e.serviceIdentifier,i,n,e)}))}}))}function u(t,e){var i=[],r=n(t);return r.hasKey(e)?i=r.get(e):null!==t.parent&&(i=u(t.parent,e)),i}Object.defineProperty(e,"__esModule",{value:!0}),e.getBindingDictionary=e.createMockRequest=e.plan=void 0,e.getBindingDictionary=n,e.plan=function(t,e,n,r,o,a,u,c){void 0===c&&(c=!1);var l=new d.Context(e),h=i(n,r,o,"",a,u);try{return s(t,c,o,l,null,h),l}catch(t){throw p.isStackOverflowExeption(t)&&l.plan&&f.circularDependencyToException(l.plan.rootRequest),t}},e.createMockRequest=function(t,e,n,i){var r=new S.Target(a.TargetTypeEnum.Variable,"",e,new y.Metadata(n,i)),o=new d.Context(t);return new E.Request(e,o,null,[],r)}})),x=n((function(t,n){var i=e&&e.__spreadArray||function(t,e){for(var n=0,i=e.length,r=t.length;i>n;n++,r++)t[r]=e[n];return t};Object.defineProperty(n,"__esModule",{value:!0}),n.resolveInstance=void 0,n.resolveInstance=function(t,e,n){var r,s=null;if(e.length>0){var u=e.filter((function(t){return null!==t.target&&t.target.type===a.TargetTypeEnum.ConstructorArgument})).map(n);s=function(t,e,n){var i=e.filter((function(t){return null!==t.target&&t.target.type===a.TargetTypeEnum.ClassProperty})),r=i.map(n);return i.forEach((function(e,n){var i;i=e.target.name.value(),t[i]=r[n]})),t}(s=new((r=t).bind.apply(r,i([void 0],u))),e,n)}else s=new t;return function(t,e){if(Reflect.hasMetadata(o.POST_CONSTRUCT,t)){var n=Reflect.getMetadata(o.POST_CONSTRUCT,t);try{e[n.value]()}catch(e){throw new Error(c.POST_CONSTRUCT_ERROR(t.name,e.message))}}}(t,s),s}})),P=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.resolve=void 0;var n=function(t,e,n){try{return n()}catch(n){throw p.isStackOverflowExeption(n)?new Error(c.CIRCULAR_DEPENDENCY_IN_FACTORY(t,e.toString())):n}},i=function(t){return function(e){e.parentContext.setCurrentRequest(e);var r=e.bindings,o=e.childRequests,s=e.target&&e.target.isArray(),u=!(e.parentRequest&&e.parentRequest.target&&e.target&&e.parentRequest.target.matchesArray(e.target.serviceIdentifier));if(s&&u)return o.map((function(e){return i(t)(e)}));var l=null;if(!e.target.isOptional()||0!==r.length){var h=r[0],p=h.scope===a.BindingScopeEnum.Singleton,d=h.scope===a.BindingScopeEnum.Request;if(p&&h.activated)return h.cache;if(d&&null!==t&&t.has(h.id))return t.get(h.id);if(h.type===a.BindingTypeEnum.ConstantValue)l=h.cache,h.activated=!0;else if(h.type===a.BindingTypeEnum.Function)l=h.cache,h.activated=!0;else if(h.type===a.BindingTypeEnum.Constructor)l=h.implementationType;else if(h.type===a.BindingTypeEnum.DynamicValue&&null!==h.dynamicValue)l=n("toDynamicValue",h.serviceIdentifier,(function(){return h.dynamicValue(e.parentContext)}));else if(h.type===a.BindingTypeEnum.Factory&&null!==h.factory)l=n("toFactory",h.serviceIdentifier,(function(){return h.factory(e.parentContext)}));else if(h.type===a.BindingTypeEnum.Provider&&null!==h.provider)l=n("toProvider",h.serviceIdentifier,(function(){return h.provider(e.parentContext)}));else{if(h.type!==a.BindingTypeEnum.Instance||null===h.implementationType){var y=f.getServiceIdentifierAsString(e.serviceIdentifier);throw new Error(c.INVALID_BINDING_TYPE+" "+y)}l=x.resolveInstance(h.implementationType,o,i(t))}return"function"==typeof h.onActivation&&(l=h.onActivation(e.parentContext,l)),p&&(h.cache=l,h.activated=!0),d&&null!==t&&!t.has(h.id)&&t.set(h.id,l),l}}};e.resolve=function(t){return i(t.plan.rootRequest.requestScope)(t.plan.rootRequest)}})),k=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.typeConstraint=e.namedConstraint=e.taggedConstraint=e.traverseAncerstors=void 0;var n=function(t,e){var i=t.parentRequest;return null!==i&&(!!e(i)||n(i,e))};e.traverseAncerstors=n;var i=function(t){return function(e){var n=function(n){return null!==n&&null!==n.target&&n.target.matchesTag(t)(e)};return n.metaData=new y.Metadata(t,e),n}};e.taggedConstraint=i;var r=i(o.NAMED_TAG);e.namedConstraint=r;e.typeConstraint=function(t){return function(e){return null!==e&&("string"==typeof t?e.bindings[0].serviceIdentifier===t:t===e.bindings[0].implementationType)}}})),C=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.BindingWhenSyntax=void 0;var n=function(){function t(t){this._binding=t}return t.prototype.when=function(t){return this._binding.constraint=t,new N.BindingOnSyntax(this._binding)},t.prototype.whenTargetNamed=function(t){return this._binding.constraint=k.namedConstraint(t),new N.BindingOnSyntax(this._binding)},t.prototype.whenTargetIsDefault=function(){return this._binding.constraint=function(t){return null!==t.target&&!t.target.isNamed()&&!t.target.isTagged()},new N.BindingOnSyntax(this._binding)},t.prototype.whenTargetTagged=function(t,e){return this._binding.constraint=k.taggedConstraint(t)(e),new N.BindingOnSyntax(this._binding)},t.prototype.whenInjectedInto=function(t){return this._binding.constraint=function(e){return k.typeConstraint(t)(e.parentRequest)},new N.BindingOnSyntax(this._binding)},t.prototype.whenParentNamed=function(t){return this._binding.constraint=function(e){return k.namedConstraint(t)(e.parentRequest)},new N.BindingOnSyntax(this._binding)},t.prototype.whenParentTagged=function(t,e){return this._binding.constraint=function(n){return k.taggedConstraint(t)(e)(n.parentRequest)},new N.BindingOnSyntax(this._binding)},t.prototype.whenAnyAncestorIs=function(t){return this._binding.constraint=function(e){return k.traverseAncerstors(e,k.typeConstraint(t))},new N.BindingOnSyntax(this._binding)},t.prototype.whenNoAncestorIs=function(t){return this._binding.constraint=function(e){return!k.traverseAncerstors(e,k.typeConstraint(t))},new N.BindingOnSyntax(this._binding)},t.prototype.whenAnyAncestorNamed=function(t){return this._binding.constraint=function(e){return k.traverseAncerstors(e,k.namedConstraint(t))},new N.BindingOnSyntax(this._binding)},t.prototype.whenNoAncestorNamed=function(t){return this._binding.constraint=function(e){return!k.traverseAncerstors(e,k.namedConstraint(t))},new N.BindingOnSyntax(this._binding)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._binding.constraint=function(n){return k.traverseAncerstors(n,k.taggedConstraint(t)(e))},new N.BindingOnSyntax(this._binding)},t.prototype.whenNoAncestorTagged=function(t,e){return this._binding.constraint=function(n){return!k.traverseAncerstors(n,k.taggedConstraint(t)(e))},new N.BindingOnSyntax(this._binding)},t.prototype.whenAnyAncestorMatches=function(t){return this._binding.constraint=function(e){return k.traverseAncerstors(e,t)},new N.BindingOnSyntax(this._binding)},t.prototype.whenNoAncestorMatches=function(t){return this._binding.constraint=function(e){return!k.traverseAncerstors(e,t)},new N.BindingOnSyntax(this._binding)},t}();e.BindingWhenSyntax=n})),N=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.BindingOnSyntax=void 0;var n=function(){function t(t){this._binding=t}return t.prototype.onActivation=function(t){return this._binding.onActivation=t,new C.BindingWhenSyntax(this._binding)},t}();e.BindingOnSyntax=n})),_=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.BindingWhenOnSyntax=void 0;var n=function(){function t(t){this._binding=t,this._bindingWhenSyntax=new C.BindingWhenSyntax(this._binding),this._bindingOnSyntax=new N.BindingOnSyntax(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}();e.BindingWhenOnSyntax=n})),M=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.BindingInSyntax=void 0;var n=function(){function t(t){this._binding=t}return t.prototype.inRequestScope=function(){return this._binding.scope=a.BindingScopeEnum.Request,new _.BindingWhenOnSyntax(this._binding)},t.prototype.inSingletonScope=function(){return this._binding.scope=a.BindingScopeEnum.Singleton,new _.BindingWhenOnSyntax(this._binding)},t.prototype.inTransientScope=function(){return this._binding.scope=a.BindingScopeEnum.Transient,new _.BindingWhenOnSyntax(this._binding)},t}();e.BindingInSyntax=n})),A=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.BindingInWhenOnSyntax=void 0;var n=function(){function t(t){this._binding=t,this._bindingWhenSyntax=new C.BindingWhenSyntax(this._binding),this._bindingOnSyntax=new N.BindingOnSyntax(this._binding),this._bindingInSyntax=new M.BindingInSyntax(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}();e.BindingInWhenOnSyntax=n})),O=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.BindingToSyntax=void 0;var n=function(){function t(t){this._binding=t}return t.prototype.to=function(t){return this._binding.type=a.BindingTypeEnum.Instance,this._binding.implementationType=t,new A.BindingInWhenOnSyntax(this._binding)},t.prototype.toSelf=function(){if("function"!=typeof this._binding.serviceIdentifier)throw new Error(""+c.INVALID_TO_SELF_VALUE);return this.to(this._binding.serviceIdentifier)},t.prototype.toConstantValue=function(t){return this._binding.type=a.BindingTypeEnum.ConstantValue,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=a.BindingScopeEnum.Singleton,new _.BindingWhenOnSyntax(this._binding)},t.prototype.toDynamicValue=function(t){return this._binding.type=a.BindingTypeEnum.DynamicValue,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new A.BindingInWhenOnSyntax(this._binding)},t.prototype.toConstructor=function(t){return this._binding.type=a.BindingTypeEnum.Constructor,this._binding.implementationType=t,this._binding.scope=a.BindingScopeEnum.Singleton,new _.BindingWhenOnSyntax(this._binding)},t.prototype.toFactory=function(t){return this._binding.type=a.BindingTypeEnum.Factory,this._binding.factory=t,this._binding.scope=a.BindingScopeEnum.Singleton,new _.BindingWhenOnSyntax(this._binding)},t.prototype.toFunction=function(t){if("function"!=typeof t)throw new Error(c.INVALID_FUNCTION_BINDING);var e=this.toConstantValue(t);return this._binding.type=a.BindingTypeEnum.Function,this._binding.scope=a.BindingScopeEnum.Singleton,e},t.prototype.toAutoFactory=function(t){return this._binding.type=a.BindingTypeEnum.Factory,this._binding.factory=function(e){return function(){return e.container.get(t)}},this._binding.scope=a.BindingScopeEnum.Singleton,new _.BindingWhenOnSyntax(this._binding)},t.prototype.toProvider=function(t){return this._binding.type=a.BindingTypeEnum.Provider,this._binding.provider=t,this._binding.scope=a.BindingScopeEnum.Singleton,new _.BindingWhenOnSyntax(this._binding)},t.prototype.toService=function(t){this.toDynamicValue((function(e){return e.container.get(t)}))},t}();e.BindingToSyntax=n})),I=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.ContainerSnapshot=void 0;var n=function(){function t(){}return t.of=function(e,n){var i=new t;return i.bindings=e,i.middleware=n,i},t}();e.ContainerSnapshot=n})),R=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Lookup=void 0;var n=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(c.NULL_ARGUMENT);if(null==e)throw new Error(c.NULL_ARGUMENT);var n=this._map.get(t);void 0!==n?(n.push(e),this._map.set(t,n)):this._map.set(t,[e])},t.prototype.get=function(t){if(null==t)throw new Error(c.NULL_ARGUMENT);var e=this._map.get(t);if(void 0!==e)return e;throw new Error(c.KEY_NOT_FOUND)},t.prototype.remove=function(t){if(null==t)throw new Error(c.NULL_ARGUMENT);if(!this._map.delete(t))throw new Error(c.KEY_NOT_FOUND)},t.prototype.removeByCondition=function(t){var e=this;this._map.forEach((function(n,i){var r=n.filter((function(e){return!t(e)}));r.length>0?e._map.set(i,r):e._map.delete(i)}))},t.prototype.hasKey=function(t){if(null==t)throw new Error(c.NULL_ARGUMENT);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,t.clone())}))})),e},t.prototype.traverse=function(t){this._map.forEach((function(e,n){t(n,e)}))},t}();e.Lookup=n})),L=n((function(t,n){var i=e&&e.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function a(t){try{u(i.next(t))}catch(t){o(t)}}function s(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((i=i.apply(t,e||[])).next())}))},r=e&&e.__generator||function(t,e){var n,i,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[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,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&r[3]>o[1])){a.label=o[1];break}if(6===o[0]&&r[1]>a.label){a.label=r[1],r=o;break}if(r&&r[2]>a.label){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},h=e&&e.__spreadArray||function(t,e){for(var n=0,i=e.length,r=t.length;i>n;n++,r++)t[r]=e[n];return t};Object.defineProperty(n,"__esModule",{value:!0}),n.Container=void 0;var p=function(){function t(t){this._appliedMiddleware=[];var e=t||{};if("object"!=typeof e)throw new Error(""+c.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT);if(void 0===e.defaultScope)e.defaultScope=a.BindingScopeEnum.Transient;else if(e.defaultScope!==a.BindingScopeEnum.Singleton&&e.defaultScope!==a.BindingScopeEnum.Transient&&e.defaultScope!==a.BindingScopeEnum.Request)throw new Error(""+c.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE);if(void 0===e.autoBindInjectable)e.autoBindInjectable=!1;else if("boolean"!=typeof e.autoBindInjectable)throw new Error(""+c.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE);if(void 0===e.skipBaseClassChecks)e.skipBaseClassChecks=!1;else if("boolean"!=typeof e.skipBaseClassChecks)throw new Error(""+c.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK);this.options={autoBindInjectable:e.autoBindInjectable,defaultScope:e.defaultScope,skipBaseClassChecks:e.skipBaseClassChecks},this.id=s.id(),this._bindingDictionary=new R.Lookup,this._snapshots=[],this._middleware=null,this.parent=null,this._metadataReader=new l.MetadataReader}return t.merge=function(e,n){for(var i=[],r=2;arguments.length>r;r++)i[r-2]=arguments[r];var o=new t,a=h([e,n],i).map((function(t){return w.getBindingDictionary(t)})),s=w.getBindingDictionary(o);function u(t,e){t.traverse((function(t,n){n.forEach((function(t){e.add(t.serviceIdentifier,t.clone())}))}))}return a.forEach((function(t){u(t,s)})),o},t.prototype.load=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];for(var n=this._getContainerModuleHelpersFactory(),i=0,r=t;r.length>i;i++){var o=r[i],a=n(o.id);o.registry(a.bindFunction,a.unbindFunction,a.isboundFunction,a.rebindFunction)}},t.prototype.loadAsync=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return i(this,void 0,void 0,(function(){var e,n,i,o,a;return r(this,(function(r){switch(r.label){case 0:e=this._getContainerModuleHelpersFactory(),n=0,i=t,r.label=1;case 1:return i.length>n?(a=e((o=i[n]).id),[4,o.registry(a.bindFunction,a.unbindFunction,a.isboundFunction,a.rebindFunction)]):[3,4];case 2:r.sent(),r.label=3;case 3:return n++,[3,1];case 4:return[2]}}))}))},t.prototype.unload=function(){for(var t=this,e=[],n=0;arguments.length>n;n++)e[n]=arguments[n];var i=function(t){return function(e){return e.moduleId===t}};e.forEach((function(e){var n=i(e.id);t._bindingDictionary.removeByCondition(n)}))},t.prototype.bind=function(t){var e=new u.Binding(t,this.options.defaultScope||a.BindingScopeEnum.Transient);return this._bindingDictionary.add(t,e),new O.BindingToSyntax(e)},t.prototype.rebind=function(t){return this.unbind(t),this.bind(t)},t.prototype.unbind=function(t){try{this._bindingDictionary.remove(t)}catch(e){throw new Error(c.CANNOT_UNBIND+" "+f.getServiceIdentifierAsString(t))}},t.prototype.unbindAll=function(){this._bindingDictionary=new R.Lookup},t.prototype.isBound=function(t){var e=this._bindingDictionary.hasKey(t);return!e&&this.parent&&(e=this.parent.isBound(t)),e},t.prototype.isBoundNamed=function(t,e){return this.isBoundTagged(t,o.NAMED_TAG,e)},t.prototype.isBoundTagged=function(t,e,n){var i=!1;if(this._bindingDictionary.hasKey(t)){var r=this._bindingDictionary.get(t),o=w.createMockRequest(this,t,e,n);i=r.some((function(t){return t.constraint(o)}))}return!i&&this.parent&&(i=this.parent.isBoundTagged(t,e,n)),i},t.prototype.snapshot=function(){this._snapshots.push(I.ContainerSnapshot.of(this._bindingDictionary.clone(),this._middleware))},t.prototype.restore=function(){var t=this._snapshots.pop();if(void 0===t)throw new Error(c.NO_MORE_SNAPSHOTS_AVAILABLE);this._bindingDictionary=t.bindings,this._middleware=t.middleware},t.prototype.createChild=function(e){var n=new t(e||this.options);return n.parent=this,n},t.prototype.applyMiddleware=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];this._appliedMiddleware=this._appliedMiddleware.concat(t);var n=this._middleware?this._middleware:this._planAndResolve();this._middleware=t.reduce((function(t,e){return e(t)}),n)},t.prototype.applyCustomMetadataReader=function(t){this._metadataReader=t},t.prototype.get=function(t){return this._get(!1,!1,a.TargetTypeEnum.Variable,t)},t.prototype.getTagged=function(t,e,n){return this._get(!1,!1,a.TargetTypeEnum.Variable,t,e,n)},t.prototype.getNamed=function(t,e){return this.getTagged(t,o.NAMED_TAG,e)},t.prototype.getAll=function(t){return this._get(!0,!0,a.TargetTypeEnum.Variable,t)},t.prototype.getAllTagged=function(t,e,n){return this._get(!1,!0,a.TargetTypeEnum.Variable,t,e,n)},t.prototype.getAllNamed=function(t,e){return this.getAllTagged(t,o.NAMED_TAG,e)},t.prototype.resolve=function(t){var e=this.createChild();return e.bind(t).toSelf(),this._appliedMiddleware.forEach((function(t){e.applyMiddleware(t)})),e.get(t)},t.prototype._getContainerModuleHelpersFactory=function(){var t=this,e=function(t,e){t._binding.moduleId=e},n=function(n){return function(i){var r=t.rebind.bind(t)(i);return e(r,n),r}};return function(i){return{bindFunction:(r=i,function(n){var i=t.bind.bind(t)(n);return e(i,r),i}),isboundFunction:function(e){return t.isBound.bind(t)(e)},rebindFunction:n(i),unbindFunction:function(e){t.unbind.bind(t)(e)}};var r}},t.prototype._get=function(t,e,n,i,r,o){var a=null,s={avoidConstraints:t,contextInterceptor:function(t){return t},isMultiInject:e,key:r,serviceIdentifier:i,targetType:n,value:o};if(this._middleware){if(null==(a=this._middleware(s)))throw new Error(c.INVALID_MIDDLEWARE_RETURN)}else a=this._planAndResolve()(s);return a},t.prototype._planAndResolve=function(){var t=this;return function(e){var n=w.plan(t._metadataReader,t,e.isMultiInject,e.targetType,e.serviceIdentifier,e.key,e.value,e.avoidConstraints);return n=e.contextInterceptor(n),P.resolve(n)}},t}();n.Container=p})),D=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.AsyncContainerModule=e.ContainerModule=void 0,e.ContainerModule=function(t){this.id=s.id(),this.registry=t},e.AsyncContainerModule=function(t){this.id=s.id(),this.registry=t}})),U=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.injectable=void 0,e.injectable=function(){return function(t){if(Reflect.hasOwnMetadata(o.PARAM_TYPES,t))throw new Error(c.DUPLICATED_INJECTABLE_DECORATOR);var e=Reflect.getMetadata(o.DESIGN_PARAM_TYPES,t)||[];return Reflect.defineMetadata(o.PARAM_TYPES,e,t),t}}})),F=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.tagged=void 0,e.tagged=function(t,e){return function(n,i,r){var o=new y.Metadata(t,e);"number"==typeof r?g.tagParameter(n,i,r,o):g.tagProperty(n,i,o)}}})),B=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.named=void 0,e.named=function(t){return function(e,n,i){var r=new y.Metadata(o.NAMED_TAG,t);"number"==typeof i?g.tagParameter(e,n,i,r):g.tagProperty(e,n,r)}}})),V=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.optional=void 0,e.optional=function(){return function(t,e,n){var i=new y.Metadata(o.OPTIONAL_TAG,!0);"number"==typeof n?g.tagParameter(t,e,n,i):g.tagProperty(t,e,i)}}})),G=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.unmanaged=void 0,e.unmanaged=function(){return function(t,e,n){var i=new y.Metadata(o.UNMANAGED_TAG,!0);g.tagParameter(t,e,n,i)}}})),j=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.multiInject=void 0,e.multiInject=function(t){return function(e,n,i){var r=new y.Metadata(o.MULTI_INJECT_TAG,t);"number"==typeof i?g.tagParameter(e,n,i,r):g.tagProperty(e,n,r)}}})),H=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.targetName=void 0,e.targetName=function(t){return function(e,n,i){var r=new y.Metadata(o.NAME_TAG,t);g.tagParameter(e,n,i,r)}}})),z=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.postConstruct=void 0,e.postConstruct=function(){return function(t,e,n){var i=new y.Metadata(o.POST_CONSTRUCT,e);if(Reflect.hasOwnMetadata(o.POST_CONSTRUCT,t.constructor))throw new Error(c.MULTIPLE_POST_CONSTRUCT_METHODS);Reflect.defineMetadata(o.POST_CONSTRUCT,i,t.constructor)}}})),W=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.multiBindToService=void 0;e.multiBindToService=function(t){return function(e){return function(){for(var n=[],i=0;arguments.length>i;i++)n[i]=arguments[i];return n.forEach((function(n){return t.bind(n).toService(e)}))}}}})),Y=n((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.multiBindToService=e.getServiceIdentifierAsString=e.typeConstraint=e.namedConstraint=e.taggedConstraint=e.traverseAncerstors=e.decorate=e.id=e.MetadataReader=e.postConstruct=e.targetName=e.multiInject=e.unmanaged=e.optional=e.LazyServiceIdentifer=e.inject=e.named=e.tagged=e.injectable=e.ContainerModule=e.AsyncContainerModule=e.TargetTypeEnum=e.BindingTypeEnum=e.BindingScopeEnum=e.Container=e.METADATA_KEY=void 0,e.METADATA_KEY=o,Object.defineProperty(e,"Container",{enumerable:!0,get:function(){return L.Container}}),Object.defineProperty(e,"BindingScopeEnum",{enumerable:!0,get:function(){return a.BindingScopeEnum}}),Object.defineProperty(e,"BindingTypeEnum",{enumerable:!0,get:function(){return a.BindingTypeEnum}}),Object.defineProperty(e,"TargetTypeEnum",{enumerable:!0,get:function(){return a.TargetTypeEnum}}),Object.defineProperty(e,"AsyncContainerModule",{enumerable:!0,get:function(){return D.AsyncContainerModule}}),Object.defineProperty(e,"ContainerModule",{enumerable:!0,get:function(){return D.ContainerModule}}),Object.defineProperty(e,"injectable",{enumerable:!0,get:function(){return U.injectable}}),Object.defineProperty(e,"tagged",{enumerable:!0,get:function(){return F.tagged}}),Object.defineProperty(e,"named",{enumerable:!0,get:function(){return B.named}}),Object.defineProperty(e,"inject",{enumerable:!0,get:function(){return m.inject}}),Object.defineProperty(e,"LazyServiceIdentifer",{enumerable:!0,get:function(){return m.LazyServiceIdentifer}}),Object.defineProperty(e,"optional",{enumerable:!0,get:function(){return V.optional}}),Object.defineProperty(e,"unmanaged",{enumerable:!0,get:function(){return G.unmanaged}}),Object.defineProperty(e,"multiInject",{enumerable:!0,get:function(){return j.multiInject}}),Object.defineProperty(e,"targetName",{enumerable:!0,get:function(){return H.targetName}}),Object.defineProperty(e,"postConstruct",{enumerable:!0,get:function(){return z.postConstruct}}),Object.defineProperty(e,"MetadataReader",{enumerable:!0,get:function(){return l.MetadataReader}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return s.id}}),Object.defineProperty(e,"decorate",{enumerable:!0,get:function(){return g.decorate}}),Object.defineProperty(e,"traverseAncerstors",{enumerable:!0,get:function(){return k.traverseAncerstors}}),Object.defineProperty(e,"taggedConstraint",{enumerable:!0,get:function(){return k.taggedConstraint}}),Object.defineProperty(e,"namedConstraint",{enumerable:!0,get:function(){return k.namedConstraint}}),Object.defineProperty(e,"typeConstraint",{enumerable:!0,get:function(){return k.typeConstraint}}),Object.defineProperty(e,"getServiceIdentifierAsString",{enumerable:!0,get:function(){return f.getServiceIdentifierAsString}}),Object.defineProperty(e,"multiBindToService",{enumerable:!0,get:function(){return W.multiBindToService}})}));function q(t){return q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},q(t)}function X(t,e){for(var n=0;e.length>n;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function K(t,e,n){return e&&X(t.prototype,e),n&&X(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Z(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function J(t){return J="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},J(t)}function Q(e,n){return n.lifecycle===t.Syringe.Lifecycle.singleton?function(t){return t.inSingletonScope()}(e):function(t){return t.inTransientScope()}(e)}function $(t,e){t.whenTargetNamed(nt(e))}function tt(t,e){return e.bind(it(t))}function et(t,e){if(e.isBound(it(t)))try{return e.rebind(it(t))}catch(n){return e.bind(it(t))}return e.bind(it(t))}function nt(e){return t.Utils.isDefinedToken(e)?e.symbol:e}function it(e){return t.Utils.isDefinedToken(e)?e.symbol:e}!function(t){!function(n){var i="object"==typeof e?e:"object"==typeof self?self:"object"==typeof this?this:Function("return this;")(),r=o(t);function o(t,e){return function(n,i){"function"!=typeof t[n]&&Object.defineProperty(t,n,{configurable:!0,writable:!0,value:i}),e&&e(n,i)}}void 0===i.Reflect?i.Reflect=t:r=o(i.Reflect,r),function(t){var e=Object.prototype.hasOwnProperty,n="function"==typeof Symbol,i=n&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",r=n&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",o="function"==typeof Object.create,a={__proto__:[]}instanceof Array,s=!o&&!a,u={create:o?function(){return it(Object.create(null))}:a?function(){return it({__proto__:null})}:function(){return it({})},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]}},c=Object.getPrototypeOf(Function),l="object"==typeof process&&process.env&&"true"===process.env.REFLECT_METADATA_USE_MAP_POLYFILL,h=l||"function"!=typeof Map||"function"!=typeof Map.prototype.entries?tt():Map,p=l||"function"!=typeof Set||"function"!=typeof Set.prototype.entries?et():Set,f=new(l||"function"!=typeof WeakMap?nt():WeakMap);function d(t,e,n,i){if(L(n)){if(!z(t))throw new TypeError;if(!Y(e))throw new TypeError;return x(t,e)}if(!z(t))throw new TypeError;if(!F(e))throw new TypeError;if(!F(i)&&!L(i)&&!D(i))throw new TypeError;return D(i)&&(i=void 0),P(t,e,n=H(n),i)}function y(t,e){function n(n,i){if(!F(n))throw new TypeError;if(!L(i)&&!q(i))throw new TypeError;A(t,e,n,i)}return n}function v(t,e,n,i){if(!F(n))throw new TypeError;return L(i)||(i=H(i)),A(t,e,n,i)}function g(t,e,n){if(!F(e))throw new TypeError;return L(n)||(n=H(n)),C(t,e,n)}function m(t,e,n){if(!F(e))throw new TypeError;return L(n)||(n=H(n)),N(t,e,n)}function T(t,e,n){if(!F(e))throw new TypeError;return L(n)||(n=H(n)),_(t,e,n)}function S(t,e,n){if(!F(e))throw new TypeError;return L(n)||(n=H(n)),M(t,e,n)}function b(t,e){if(!F(t))throw new TypeError;return L(e)||(e=H(e)),O(t,e)}function E(t,e){if(!F(t))throw new TypeError;return L(e)||(e=H(e)),I(t,e)}function w(t,e,n){if(!F(e))throw new TypeError;L(n)||(n=H(n));var i=k(e,n,!1);if(L(i))return!1;if(!i.delete(t))return!1;if(i.size>0)return!0;var r=f.get(e);return r.delete(n),r.size>0||f.delete(e),!0}function x(t,e){for(var n=t.length-1;n>=0;--n){var i=(0,t[n])(e);if(!L(i)&&!D(i)){if(!Y(i))throw new TypeError;e=i}}return e}function P(t,e,n,i){for(var r=t.length-1;r>=0;--r){var o=(0,t[r])(e,n,i);if(!L(o)&&!D(o)){if(!F(o))throw new TypeError;i=o}}return i}function k(t,e,n){var i=f.get(t);if(L(i)){if(!n)return;i=new h,f.set(t,i)}var r=i.get(e);if(L(r)){if(!n)return;r=new h,i.set(e,r)}return r}function C(t,e,n){if(N(t,e,n))return!0;var i=$(e);return!D(i)&&C(t,i,n)}function N(t,e,n){var i=k(e,n,!1);return!L(i)&&G(i.has(t))}function _(t,e,n){if(N(t,e,n))return M(t,e,n);var i=$(e);return D(i)?void 0:_(t,i,n)}function M(t,e,n){var i=k(e,n,!1);if(!L(i))return i.get(t)}function A(t,e,n,i){k(n,i,!0).set(t,e)}function O(t,e){var n=I(t,e),i=$(t);if(null===i)return n;var r=O(i,e);if(0>=r.length)return n;if(0>=n.length)return r;for(var o=new p,a=[],s=0,u=n;u.length>s;s++){o.has(h=u[s])||(o.add(h),a.push(h))}for(var c=0,l=r;l.length>c;c++){var h;o.has(h=l[c])||(o.add(h),a.push(h))}return a}function I(t,e){var n=[],i=k(t,e,!1);if(L(i))return n;for(var r=K(i.keys()),o=0;;){var a=J(r);if(!a)return n.length=o,n;var s=Z(a);try{n[o]=s}catch(t){try{Q(r)}finally{throw t}}o++}}function R(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 L(t){return void 0===t}function D(t){return null===t}function U(t){return"symbol"==typeof t}function F(t){return"object"==typeof t?null!==t:"function"==typeof t}function B(t,e){switch(R(t)){case 0:case 1:case 2:case 3:case 4:case 5:return t}var n=3===e?"string":5===e?"number":"default",r=X(t,i);if(void 0!==r){var o=r.call(t,n);if(F(o))throw new TypeError;return o}return V(t,"default"===n?"number":n)}function V(t,e){if("string"===e){var n=t.toString;if(W(n))if(!F(r=n.call(t)))return r;if(W(i=t.valueOf))if(!F(r=i.call(t)))return r}else{var i;if(W(i=t.valueOf))if(!F(r=i.call(t)))return r;var r,o=t.toString;if(W(o))if(!F(r=o.call(t)))return r}throw new TypeError}function G(t){return!!t}function j(t){return""+t}function H(t){var e=B(t,3);return U(e)?e:j(e)}function z(t){return Array.isArray?Array.isArray(t):t instanceof Object?t instanceof Array:"[object Array]"===Object.prototype.toString.call(t)}function W(t){return"function"==typeof t}function Y(t){return"function"==typeof t}function q(t){switch(R(t)){case 3:case 4:return!0;default:return!1}}function X(t,e){var n=t[e];if(null!=n){if(!W(n))throw new TypeError;return n}}function K(t){var e=X(t,r);if(!W(e))throw new TypeError;var n=e.call(t);if(!F(n))throw new TypeError;return n}function Z(t){return t.value}function J(t){var e=t.next();return!e.done&&e}function Q(t){var e=t.return;e&&e.call(t)}function $(t){var e=Object.getPrototypeOf(t);if("function"!=typeof t||t===c)return e;if(e!==c)return e;var n=t.prototype,i=n&&Object.getPrototypeOf(n);if(null==i||i===Object.prototype)return e;var r=i.constructor;return"function"!=typeof r||r===t?e:r}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[r]=function(){return this},t.prototype.next=function(){var t=this._index;if(t>=0&&this._keys.length>t){var n=this._selector(this._keys[t],this._values[t]);return this._keys.length>t+1?this._index++:(this._index=-1,this._keys=e,this._values=e),{value:n,done:!1}}return{value:void 0,done:!0}},t.prototype.throw=function(t){throw 0>this._index||(this._index=-1,this._keys=e,this._values=e),t},t.prototype.return=function(t){return 0>this._index||(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 0>e?void 0:this._values[e]},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 i=this._keys.length,r=n+1;i>r;r++)this._keys[r-1]=this._keys[r],this._values[r-1]=this._values[r];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,i)},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[r]=function(){return this.entries()},e.prototype._find=function(t,e){return this._cacheKey!==t&&(this._cacheIndex=this._keys.indexOf(this._cacheKey=t)),0>this._cacheIndex&&e&&(this._cacheIndex=this._keys.length,this._keys.push(t),this._values.push(void 0)),this._cacheIndex},e}();function i(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 h}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[r]=function(){return this.keys()},t}()}function nt(){var t=16,n=u.create(),i=r();return function(){function t(){this._key=r()}return t.prototype.has=function(t){var e=o(t,!1);return void 0!==e&&u.has(e,this._key)},t.prototype.get=function(t){var e=o(t,!1);return void 0!==e?u.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=r()},t}();function r(){var t;do{t="@@WeakMap@@"+c()}while(u.has(n,t));return n[t]=!0,t}function o(t,n){if(!e.call(t,i)){if(!n)return;Object.defineProperty(t,i,{value:u.create()})}return t[i]}function a(t,e){for(var n=0;e>n;++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 c(){var e=s(t);e[6]=79&e[6]|64,e[8]=191&e[8]|128;for(var n="",i=0;t>i;++i){var r=e[i];4!==i&&6!==i&&8!==i||(n+="-"),16>r&&(n+="0"),n+=r.toString(16).toLowerCase()}return n}}function it(t){return t.__=void 0,delete t.__,t}t("decorate",d),t("metadata",y),t("defineMetadata",v),t("hasMetadata",g),t("hasOwnMetadata",m),t("getMetadata",T),t("getOwnMetadata",S),t("getMetadataKeys",b),t("getOwnMetadataKeys",E),t("deleteMetadata",w)}(r)}()}(i||(i={})),function(t){t.defineToken=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{multiple:!0};return new t.DefinedToken(e,n)};var e,n=K((function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Z(this,t),this.prototype={},this.name=void 0,this.multiple=void 0,this.symbol=void 0;var i=n.multiple,r=void 0!==i&&i;this.name=e,this.symbol=Symbol(this.name),this.multiple=r}));t.DefinedToken=n,t.isModule=function(t){return!!t&&"object"===q(t)&&"id"in t},function(t){t.singleton="singleton",t.transient="transient"}(e=t.Lifecycle||(t.Lifecycle={})),t.ClassOptionSymbol=Symbol("SyringeClassOptionSymbol"),t.DefaultOption={lifecycle:e.transient}}(t.Syringe||(t.Syringe={})),(r=t.Utils||(t.Utils={})).toArray=function(t){return Array.isArray(t)?t:void 0===t?[]:[t]},r.isClass=function(t){return!(!t||"function"!=typeof t||!("prototype"in t))},r.isDefinedToken=function(t){return!!(t&&"object"===q(t)&&"symbol"in t&&"multiple"in t)},r.isInjectOption=function(t){return!(!t||"object"!==q(t)||!("token"in t))},r.isNamedToken=function(t){return!!(t&&"object"===q(t)&&"token"in t&&"named"in t)},r.isMultipleEnabled=function(t){return r.isDefinedToken(t)&&t.multiple};var rt=new Y.Container;function ot(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function at(t){for(var e=1;arguments.length>e;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ot(Object(n),!0).forEach((function(e){st(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ot(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function st(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ut(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=Y.injectable();return function(i){Reflect.defineMetadata(t.Syringe.ClassOptionSymbol,at(at({},e),{},{target:i}),i),n(i)}}function ct(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ut(at(at({},e),{},{lifecycle:t.Syringe.Lifecycle.singleton}))}function lt(t){return Y.inject(it(t))}function ht(t){return Y.named(nt(t))}var pt=Symbol("SyringeOptionSymbol");function ft(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function dt(t){for(var e=1;arguments.length>e;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ft(Object(n),!0).forEach((function(e){yt(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ft(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function yt(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function vt(t,e){for(var n=0;e.length>n;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var gt=function(){function e(n,i,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),this.token=void 0,this.rawToken=void 0,this.named=void 0,this.generalToken=void 0,this.option=void 0,this.register=void 0,this.mutiple=void 0,this.register=n,this.token=i,this.option=r,this.rawToken=t.Utils.isNamedToken(i)?i.token:i,this.named=t.Utils.isNamedToken(i)?i.named:void 0,this.mutiple=!!this.named||t.Utils.isMultipleEnabled(this.rawToken),this.generalToken=this.rawToken}var n,i,r;return n=e,i=[{key:"resolve",value:function(){var e=this,n=this.register;(function(t){return t&&"object"===J(t)&&"bind"in t&&"unbind"in t&&"rebind"in t&&"isBound"in t})(n)&&(this.mutiple?this.resolveMutilple(n):(this.resolveMono(n),!this.named&&this.option.contrib.length>0&&this.option.contrib.forEach((function(i){t.Utils.isMultipleEnabled(i)?tt(i,n).toService(e.generalToken):et(i,n).toService(e.generalToken)}))))}},{key:"resolveMono",value:function(t){if("useValue"in this.option)return et(this.generalToken,t).toConstantValue(this.option.useValue);if(this.option.useDynamic.length>0){var e=this.option.useDynamic[this.option.useDynamic.length-1];return Q(et(this.generalToken,t).toDynamicValue((function(t){var n=Bt.getContainer(t.container);return e({container:n})})),this.option)}if(this.option.useFactory.length>0){var n=this.option.useFactory[this.option.useFactory.length-1];return et(this.generalToken,t).toFactory((function(t){var e=Bt.getContainer(t.container);return n({container:e})}))}if(this.option.useClass.length>0){var i=this.option.useClass[this.option.useClass.length-1];return Q(et(this.generalToken,t).to(i),this.option)}}},{key:"resolveMutilple",value:function(t){var e=this,n=this.option.useClass.map((function(n){return Q(tt(e.generalToken,t).to(n),e.option)})),i=this.option.useDynamic.map((function(n){return Q(tt(e.generalToken,t).toDynamicValue((function(t){var e=Bt.getContainer(t.container);return n({container:e})})),e.option)})),r=this.option.useFactory.map((function(n){return tt(e.generalToken,t).toFactory((function(t){var e=Bt.getContainer(t.container);return n({container:e})}))})),o="useValue"in this.option?tt(this.generalToken,t).toConstantValue(this.option.useValue):void 0;this.named&&(n.forEach((function(t){return e.named&&$(t,e.named)})),i.forEach((function(t){return e.named&&$(t,e.named)})),r.forEach((function(t){return e.named&&$(t,e.named)})),o&&$(o,this.named))}}],r=[{key:"resolveTarget",value:function(n,i){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};try{try{var o=Reflect.getMetadata(pt,i);o&&e.resolveOption(n,o)}catch(t){}if(t.Utils.isClass(i))if(r.useClass){var a=t.Utils.toArray(r.useClass);a.unshift(i),r.useClass=a}else r.useClass=[i];var s;try{s=Reflect.getMetadata(t.Syringe.ClassOptionSymbol,i)}catch(t){}if((s=dt(dt({},s||{}),r)).token){var u=t.Utils.toArray(s.token);u.unshift(i),s.token=u}else s.token=[i];e.resolveOption(n,s)}catch(t){}}},{key:"resolveOption",value:function(n,i){var r=function(e){var n=t.Utils.toArray(e.token),i=t.Utils.toArray(e.useClass),r=t.Utils.toArray(e.useDynamic),o=t.Utils.toArray(e.useFactory),a=t.Utils.toArray(e.contrib),s={token:n,useClass:i,lifecycle:a.length>0?t.Syringe.Lifecycle.singleton:e.lifecycle||t.Syringe.Lifecycle.transient,contrib:a,useDynamic:r,useFactory:o};return"useValue"in e&&(s.useValue=e.useValue),s}(dt(dt({},e.globalConfig),i));(0!==r.useClass.length||0!==r.useDynamic.length||0!==r.useFactory.length||"useValue"in r)&&r.token.forEach((function(t){new e(n,t,dt({},r)).resolve()}))}}],i&&vt(n.prototype,i),r&&vt(n,r),Object.defineProperty(n,"prototype",{writable:!1}),e}();gt.globalConfig=t.Syringe.DefaultOption;var mt=t.Syringe.defineToken("ContributionProvider");function Tt(t){return function(t){if(Array.isArray(t))return St(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return St(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return St(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function St(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);e>n;n++)i[n]=t[n];return i}function bt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function Et(t){for(var e=1;arguments.length>e;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?bt(Object(n),!0).forEach((function(e){wt(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):bt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function wt(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function xt(t,e){for(var n=0;e.length>n;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var Pt=function(){function t(e,n,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.option={recursive:!1,cache:!0},this.services=void 0,this.serviceIdentifier=void 0,this.container=void 0,this.container=n,this.serviceIdentifier=e,i&&(this.option=Et(Et({},this.option),i))}var e,n,i;return e=t,n=[{key:"setServices",value:function(t){for(var e=[],n=this.container;n;){if(n.isBound(this.serviceIdentifier)){var i=n.getAll(this.serviceIdentifier);e.push.apply(e,Tt(i))}n=t?n.parent:void 0}return e}},{key:"getContributions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=Et(Et({},this.option),t),n=e.cache,i=e.recursive;return n&&void 0!==this.services||(this.services=this.setServices(!!i)),this.services}}],n&&xt(e.prototype,n),i&&xt(e,i),Object.defineProperty(e,"prototype",{writable:!1}),t}();function kt(e,n){return{token:{token:mt,named:e},useDynamic:function(t){return new Pt(e,t.container,n)},lifecycle:t.Syringe.Lifecycle.singleton}}function Ct(e,n,i){e({token:{token:mt,named:n},useDynamic:function(t){return new Pt(n,t.container,i)},lifecycle:t.Syringe.Lifecycle.singleton})}function Nt(t,e){for(var n=0;e.length>n;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var _t=function(){function e(n){var i=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=void 0,this.inversifyModule=void 0,this.baseRegistry=void 0,this.optionCollection=void 0,this.inversifyRegister=function(e,n,r,o){var a={bind:e,unbind:n,isBound:r,rebind:o},s=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.Utils.isInjectOption(e)?gt.resolveOption(a,e):gt.resolveTarget(a,e,n)};i.baseRegistry&&i.baseRegistry(s),i.optionCollection&&i.optionCollection.forEach((function(t){return s(t)}))},this.baseRegistry=n,this.inversifyModule=new Y.ContainerModule(this.inversifyRegister),this.id=this.inversifyModule.id}var n,i,r;return n=e,i=[{key:"options",get:function(){return this.optionCollection||(this.optionCollection=[]),this.optionCollection}},{key:"register",value:function(){for(var t=this,e=arguments.length,n=new Array(e),i=0;e>i;i++)n[i]=arguments[i];return n.forEach((function(e){return t.options.push(e)})),this}},{key:"contribution",value:function(){for(var t=this,e=arguments.length,n=new Array(e),i=0;e>i;i++)n[i]=arguments[i];return n.forEach((function(e){return t.options.push(kt(e))})),this}}],i&&Nt(n.prototype,i),r&&Nt(n,r),Object.defineProperty(n,"prototype",{writable:!1}),e}();function Mt(t){return t&&"inversifyModule"in t}function At(t){return new _t(t)}function Ot(t,e){for(var n=0;e.length>n;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var It,Rt,Lt,Dt,Ut,Ft=new Map,Bt=function(){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),this.loadedModules=[],this.container=void 0,this.inversify=!0,this.parent=void 0,this.container=t||new Y.Container,e.setContainer(this.container,this)}var n,i,r;return n=e,i=[{key:"load",value:function(t,e){var n=this;return e||!this.loadedModules.includes(t.id)?(Mt(t)&&this.container.load(t.inversifyModule),this.loadedModules.push(t.id),{dispose:function(){n.unload(t)}}):(console.warn("Unsupported module."),{dispose:function(){}})}},{key:"unload",value:function(t){Mt(t)&&(this.container.unload(t.inversifyModule),this.loadedModules=this.loadedModules.filter((function(e){return e!==t.id})))}},{key:"remove",value:function(t){return this.container.unbind(it(t))}},{key:"get",value:function(t){return this.container.get(it(t))}},{key:"getNamed",value:function(t,e){return this.container.getNamed(it(t),nt(e))}},{key:"getAll",value:function(t){return this.container.getAll(it(t))}},{key:"getAllNamed",value:function(t,e){return this.container.getAllNamed(it(t),nt(e))}},{key:"isBound",value:function(t){return this.container.isBound(it(t))}},{key:"isBoundNamed",value:function(t,e){return this.container.isBoundNamed(it(t),nt(e))}},{key:"createChild",value:function(){var t=new e(this.container.createChild());return t.parent=this,t}},{key:"register",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.Utils.isInjectOption(e)?gt.resolveOption(this.container,e):gt.resolveTarget(this.container,e,n)}}],r=[{key:"setContainer",value:function(t,e){return Ft.set(t.id,e)}},{key:"getContainer",value:function(t){var n=Ft.get(t.id);if(!n){var i=new e(t);return e.setContainer(t,i),i}return n}},{key:"config",value:function(t){gt.globalConfig=t}}],i&&Ot(n.prototype,i),r&&Ot(n,r),Object.defineProperty(n,"prototype",{writable:!1}),e}(),Vt=new Bt(rt),Gt=Vt.register.bind(Vt),jt=function(t){return function(e,n,i){ht(t)(e,n,i),lt(mt)(e,n,i)}};function Ht(t,e,n,i,r){zt(t,e,n||0,i||t.length-1,r||Yt)}function zt(t,e,n,i,r){for(;i>n;){if(i-n>600){var o=i-n+1,a=e-n+1,s=Math.log(o),u=.5*Math.exp(2*s/3),c=.5*Math.sqrt(s*u*(o-u)/o)*(0>a-o/2?-1:1);zt(t,e,Math.max(n,Math.floor(e-a*u/o+c)),Math.min(i,Math.floor(e+(o-a)*u/o+c)),r)}var l=t[e],h=n,p=i;for(Wt(t,n,e),r(t[i],l)>0&&Wt(t,n,i);p>h;){for(Wt(t,h,p),h++,p--;0>r(t[h],l);)h++;for(;r(t[p],l)>0;)p--}0===r(t[n],l)?Wt(t,n,p):Wt(t,++p,i),p>e||(n=p+1),e>p||(i=p-1)}}function Wt(t,e,n){var i=t[e];t[e]=t[n],t[n]=i}function Yt(t,e){return e>t?-1:t>e?1:0}(It=t.Contribution||(t.Contribution={})).Provider=mt,It.register=Ct;class qt{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}all(){return this._all(this.data,[])}search(t){let e=this.data;const n=[];if(!re(t,e))return n;const i=this.toBBox,r=[];for(;e;){for(let o=0;e.children.length>o;o++){const a=e.children[o],s=e.leaf?i(a):a;re(t,s)&&(e.leaf?n.push(a):ie(t,s)?this._all(a,n):r.push(a))}e=r.pop()}return n}collides(t){let e=this.data;if(!re(t,e))return!1;const n=[];for(;e;){for(let i=0;e.children.length>i;i++){const r=e.children[i],o=e.leaf?this.toBBox(r):r;if(re(t,o)){if(e.leaf||ie(t,o))return!0;n.push(r)}}e=n.pop()}return!1}load(t){if(!t||!t.length)return this;if(this._minEntries>t.length){for(let e=0;t.length>e;e++)this.insert(t[e]);return this}let e=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===e.height)this._splitRoot(this.data,e);else{if(e.height>this.data.height){const t=this.data;this.data=e,e=t}this._insert(e,this.data.height-e.height-1,!0)}else this.data=e;return this}insert(t){return t&&this._insert(t,this.data.height-1),this}clear(){return this.data=oe([]),this}remove(t,e){if(!t)return this;let n=this.data;const i=this.toBBox(t),r=[],o=[];let a,s,u;for(;n||r.length;){if(n||(n=r.pop(),s=r[r.length-1],a=o.pop(),u=!0),n.leaf){const i=Xt(t,n.children,e);if(-1!==i)return n.children.splice(i,1),r.push(n),this._condense(r),this}u||n.leaf||!ie(n,i)?s?(a++,n=s.children[a],u=!1):n=null:(r.push(n),o.push(a),a=0,s=n,n=n.children[0])}return this}toBBox(t){return t}compareMinX(t,e){return t.minX-e.minX}compareMinY(t,e){return t.minY-e.minY}toJSON(){return this.data}fromJSON(t){return this.data=t,this}_all(t,e){const n=[];for(;t;)t.leaf?e.push(...t.children):n.push(...t.children),t=n.pop();return e}_build(t,e,n,i){const r=n-e+1;let o,a=this._maxEntries;if(a>=r)return o=oe(t.slice(e,n+1)),Kt(o,this.toBBox),o;i||(i=Math.ceil(Math.log(r)/Math.log(a)),a=Math.ceil(r/Math.pow(a,i-1))),o=oe([]),o.leaf=!1,o.height=i;const s=Math.ceil(r/a),u=s*Math.ceil(Math.sqrt(a));ae(t,e,n,u,this.compareMinX);for(let r=e;n>=r;r+=u){const e=Math.min(r+u-1,n);ae(t,r,e,s,this.compareMinY);for(let n=r;e>=n;n+=s){const r=Math.min(n+s-1,e);o.children.push(this._build(t,n,r,i-1))}}return Kt(o,this.toBBox),o}_chooseSubtree(t,e,n,i){for(;i.push(e),!e.leaf&&i.length-1!==n;){let n,i=1/0,a=1/0;for(let s=0;e.children.length>s;s++){const u=e.children[s],c=te(u),l=(r=t,o=u,(Math.max(o.maxX,r.maxX)-Math.min(o.minX,r.minX))*(Math.max(o.maxY,r.maxY)-Math.min(o.minY,r.minY))-c);a>l?(a=l,i=i>c?c:i,n=u):l===a&&i>c&&(i=c,n=u)}e=n||e.children[0]}var r,o;return e}_insert(t,e,n){const i=n?t:this.toBBox(t),r=[],o=this._chooseSubtree(i,this.data,e,r);for(o.children.push(t),Jt(o,i);e>=0&&r[e].children.length>this._maxEntries;)this._split(r,e),e--;this._adjustParentBBoxes(i,r,e)}_split(t,e){const n=t[e],i=n.children.length,r=this._minEntries;this._chooseSplitAxis(n,r,i);const o=this._chooseSplitIndex(n,r,i),a=oe(n.children.splice(o,n.children.length-o));a.height=n.height,a.leaf=n.leaf,Kt(n,this.toBBox),Kt(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(n,a)}_splitRoot(t,e){this.data=oe([t,e]),this.data.height=t.height+1,this.data.leaf=!1,Kt(this.data,this.toBBox)}_chooseSplitIndex(t,e,n){let i,r=1/0,o=1/0;for(let a=e;n-e>=a;a++){const e=Zt(t,0,a,this.toBBox),s=Zt(t,a,n,this.toBBox),u=ne(e,s),c=te(e)+te(s);r>u?(r=u,i=a,o=o>c?c:o):u===r&&o>c&&(o=c,i=a)}return i||n-e}_chooseSplitAxis(t,e,n){const i=t.leaf?this.compareMinX:Qt,r=t.leaf?this.compareMinY:$t,o=this._allDistMargin(t,e,n,i);this._allDistMargin(t,e,n,r)>o&&t.children.sort(i)}_allDistMargin(t,e,n,i){t.children.sort(i);const r=this.toBBox,o=Zt(t,0,e,r),a=Zt(t,n-e,n,r);let s=ee(o)+ee(a);for(let i=e;n-e>i;i++){const e=t.children[i];Jt(o,t.leaf?r(e):e),s+=ee(o)}for(let i=n-e-1;i>=e;i--){const e=t.children[i];Jt(a,t.leaf?r(e):e),s+=ee(a)}return s}_adjustParentBBoxes(t,e,n){for(let i=n;i>=0;i--)Jt(e[i],t)}_condense(t){for(let e,n=t.length-1;n>=0;n--)0===t[n].children.length?n>0?(e=t[n-1].children,e.splice(e.indexOf(t[n]),1)):this.clear():Kt(t[n],this.toBBox)}}function Xt(t,e,n){if(!n)return e.indexOf(t);for(let i=0;e.length>i;i++)if(n(t,e[i]))return i;return-1}function Kt(t,e){Zt(t,0,t.children.length,e,t)}function Zt(t,e,n,i,r){r||(r=oe(null)),r.minX=1/0,r.minY=1/0,r.maxX=-1/0,r.maxY=-1/0;for(let o=e;n>o;o++){const e=t.children[o];Jt(r,t.leaf?i(e):e)}return r}function Jt(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function Qt(t,e){return t.minX-e.minX}function $t(t,e){return t.minY-e.minY}function te(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function ee(t){return t.maxX-t.minX+(t.maxY-t.minY)}function ne(t,e){const n=Math.max(t.minX,e.minX),i=Math.max(t.minY,e.minY),r=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return Math.max(0,r-n)*Math.max(0,o-i)}function ie(t,e){return!(t.minX>e.minX||t.minY>e.minY||e.maxX>t.maxX||e.maxY>t.maxY)}function re(t,e){return!(e.minX>t.maxX||e.minY>t.maxY||t.minX>e.maxX||t.minY>e.maxY)}function oe(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function ae(t,e,n,i,r){const o=[e,n];for(;o.length;){if(i>=(n=o.pop())-(e=o.pop()))continue;const a=e+Math.ceil((n-e)/i/2)*i;Ht(t,a,e,n,r),o.push(e,a,a,n)}}function se(t,e,n,i){var r,o=arguments.length,a=3>o?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(3>o?r(a):o>3?r(e,n,a):r(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a}function ue(t,e){return function(n,i){e(n,i,t)}}function ce(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function le(){
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).G={})}(this,(function(e){"use strict";var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(e,t,n){return e(n={path:t,exports:{},require:function(e,t){return function(){throw Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}()}},n.exports),n.exports}var r,i,o=n((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.NON_CUSTOM_TAG_KEYS=t.POST_CONSTRUCT=t.DESIGN_PARAM_TYPES=t.PARAM_TYPES=t.TAGGED_PROP=t.TAGGED=t.MULTI_INJECT_TAG=t.INJECT_TAG=t.OPTIONAL_TAG=t.UNMANAGED_TAG=t.NAME_TAG=t.NAMED_TAG=void 0,t.NAMED_TAG="named",t.NAME_TAG="name",t.UNMANAGED_TAG="unmanaged",t.OPTIONAL_TAG="optional",t.INJECT_TAG="inject",t.MULTI_INJECT_TAG="multi_inject",t.TAGGED="inversify:tagged",t.TAGGED_PROP="inversify:tagged_props",t.PARAM_TYPES="inversify:paramtypes",t.DESIGN_PARAM_TYPES="design:paramtypes",t.POST_CONSTRUCT="post_construct",t.NON_CUSTOM_TAG_KEYS=[t.INJECT_TAG,t.MULTI_INJECT_TAG,t.NAME_TAG,t.UNMANAGED_TAG,t.NAMED_TAG,t.OPTIONAL_TAG]})),a=n((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.TargetTypeEnum=t.BindingTypeEnum=t.BindingScopeEnum=void 0;t.BindingScopeEnum={Request:"Request",Singleton:"Singleton",Transient:"Transient"};t.BindingTypeEnum={ConstantValue:"ConstantValue",Constructor:"Constructor",DynamicValue:"DynamicValue",Factory:"Factory",Function:"Function",Instance:"Instance",Invalid:"Invalid",Provider:"Provider"};t.TargetTypeEnum={ClassProperty:"ClassProperty",ConstructorArgument:"ConstructorArgument",Variable:"Variable"}})),s=n((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.id=void 0;var n=0;t.id=function(){return n++}})),u=n((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Binding=void 0;var n=function(){function e(e,t){this.id=s.id(),this.activated=!1,this.serviceIdentifier=e,this.scope=t,this.type=a.BindingTypeEnum.Invalid,this.constraint=function(e){return!0},this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.onActivation=null,this.dynamicValue=null}return e.prototype.clone=function(){var t=new e(this.serviceIdentifier,this.scope);return t.activated=t.scope===a.BindingScopeEnum.Singleton&&this.activated,t.implementationType=this.implementationType,t.dynamicValue=this.dynamicValue,t.scope=this.scope,t.type=this.type,t.factory=this.factory,t.provider=this.provider,t.constraint=this.constraint,t.onActivation=this.onActivation,t.cache=this.cache,t},e}();t.Binding=n})),c=n((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.STACK_OVERFLOW=t.CIRCULAR_DEPENDENCY_IN_FACTORY=t.POST_CONSTRUCT_ERROR=t.MULTIPLE_POST_CONSTRUCT_METHODS=t.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK=t.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE=t.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE=t.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT=t.ARGUMENTS_LENGTH_MISMATCH=t.INVALID_DECORATOR_OPERATION=t.INVALID_TO_SELF_VALUE=t.INVALID_FUNCTION_BINDING=t.INVALID_MIDDLEWARE_RETURN=t.NO_MORE_SNAPSHOTS_AVAILABLE=t.INVALID_BINDING_TYPE=t.NOT_IMPLEMENTED=t.CIRCULAR_DEPENDENCY=t.UNDEFINED_INJECT_ANNOTATION=t.MISSING_INJECT_ANNOTATION=t.MISSING_INJECTABLE_ANNOTATION=t.NOT_REGISTERED=t.CANNOT_UNBIND=t.AMBIGUOUS_MATCH=t.KEY_NOT_FOUND=t.NULL_ARGUMENT=t.DUPLICATED_METADATA=t.DUPLICATED_INJECTABLE_DECORATOR=void 0,t.DUPLICATED_INJECTABLE_DECORATOR="Cannot apply @injectable decorator multiple times.",t.DUPLICATED_METADATA="Metadata key was used more than once in a parameter:",t.NULL_ARGUMENT="NULL argument",t.KEY_NOT_FOUND="Key Not Found",t.AMBIGUOUS_MATCH="Ambiguous match found for serviceIdentifier:",t.CANNOT_UNBIND="Could not unbind serviceIdentifier:",t.NOT_REGISTERED="No matching bindings found for serviceIdentifier:",t.MISSING_INJECTABLE_ANNOTATION="Missing required @injectable annotation in:",t.MISSING_INJECT_ANNOTATION="Missing required @inject or @multiInject annotation in:";t.UNDEFINED_INJECT_ANNOTATION=function(e){return"@inject called with undefined this could mean that the class "+e+" has a circular dependency problem. You can use a LazyServiceIdentifer to overcome this limitation."},t.CIRCULAR_DEPENDENCY="Circular dependency found:",t.NOT_IMPLEMENTED="Sorry, this feature is not fully implemented yet.",t.INVALID_BINDING_TYPE="Invalid binding type:",t.NO_MORE_SNAPSHOTS_AVAILABLE="No snapshot available to restore.",t.INVALID_MIDDLEWARE_RETURN="Invalid return type in middleware. Middleware must return!",t.INVALID_FUNCTION_BINDING="Value provided to function binding must be a function!",t.INVALID_TO_SELF_VALUE="The toSelf function can only be applied when a constructor is used as service identifier",t.INVALID_DECORATOR_OPERATION="The @inject @multiInject @tagged and @named decorators must be applied to the parameters of a class constructor or a class property.";t.ARGUMENTS_LENGTH_MISMATCH=function(){for(var e=[],t=0;arguments.length>t;t++)e[t]=arguments[t];return"The number of constructor arguments in the derived class "+e[0]+" must be >= than the number of constructor arguments of its base class."},t.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT="Invalid Container constructor argument. Container options must be an object.",t.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE="Invalid Container option. Default scope must be a string ('singleton' or 'transient').",t.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE="Invalid Container option. Auto bind injectable must be a boolean",t.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK="Invalid Container option. Skip base check must be a boolean",t.MULTIPLE_POST_CONSTRUCT_METHODS="Cannot apply @postConstruct decorator multiple times in the same class";t.POST_CONSTRUCT_ERROR=function(){for(var e=[],t=0;arguments.length>t;t++)e[t]=arguments[t];return"@postConstruct error in class "+e[0]+": "+e[1]};t.CIRCULAR_DEPENDENCY_IN_FACTORY=function(){for(var e=[],t=0;arguments.length>t;t++)e[t]=arguments[t];return"It looks like there is a circular dependency in one of the '"+e[0]+"' bindings. Please investigate bindings withservice identifier '"+e[1]+"'."},t.STACK_OVERFLOW="Maximum call stack size exceeded"})),l=n((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MetadataReader=void 0;var n=function(){function e(){}return e.prototype.getConstructorMetadata=function(e){return{compilerGeneratedMetadata:Reflect.getMetadata(o.PARAM_TYPES,e),userGeneratedMetadata:Reflect.getMetadata(o.TAGGED,e)||{}}},e.prototype.getPropertiesMetadata=function(e){return Reflect.getMetadata(o.TAGGED_PROP,e)||[]},e}();t.MetadataReader=n})),h=n((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.BindingCount=void 0;t.BindingCount={MultipleBindingsAvailable:2,NoBindingsAvailable:0,OnlyOneBindingAvailable:1}})),f=n((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.isStackOverflowExeption=void 0,t.isStackOverflowExeption=function(e){return e instanceof RangeError||e.message===c.STACK_OVERFLOW}})),d=n((function(e,t){function n(e){return"function"==typeof e?e.name:"symbol"==typeof e?""+e:e}function r(e,t){return null!==e.parentRequest&&(e.parentRequest.serviceIdentifier===t||r(e.parentRequest,t))}function i(e){if(e.name)return e.name;var t=""+e,n=t.match(/^function\s*([^\s(]+)/);return n?n[1]:"Anonymous function: "+t}Object.defineProperty(t,"__esModule",{value:!0}),t.circularDependencyToException=t.listMetadataForTarget=t.listRegisteredBindingsForServiceIdentifier=t.getServiceIdentifierAsString=t.getFunctionName=void 0,t.getServiceIdentifierAsString=n,t.listRegisteredBindingsForServiceIdentifier=function(e,t,n){var r="",o=n(e,t);return 0!==o.length&&(r="\nRegistered bindings:",o.forEach((function(e){var t="Object";null!==e.implementationType&&(t=i(e.implementationType)),r=r+"\n "+t,e.constraint.metaData&&(r=r+" - "+e.constraint.metaData)}))),r},t.circularDependencyToException=function e(t){t.childRequests.forEach((function(t){if(r(t,t.serviceIdentifier)){var i=function(e){return function e(t,r){void 0===r&&(r=[]);var i=n(t.serviceIdentifier);return r.push(i),null!==t.parentRequest?e(t.parentRequest,r):r}(e).reverse().join(" --\x3e ")}(t);throw Error(c.CIRCULAR_DEPENDENCY+" "+i)}e(t)}))},t.listMetadataForTarget=function(e,t){if(t.isTagged()||t.isNamed()){var n="",r=t.getNamedTag(),i=t.getCustomTags();return null!==r&&(n+=r+"\n"),null!==i&&i.forEach((function(e){n+=e+"\n"}))," "+e+"\n "+e+" - "+n}return" "+e},t.getFunctionName=i})),p=n((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Context=void 0;var n=function(){function e(e){this.id=s.id(),this.container=e}return e.prototype.addPlan=function(e){this.plan=e},e.prototype.setCurrentRequest=function(e){this.currentRequest=e},e}();t.Context=n})),y=n((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Metadata=void 0;var n=function(){function e(e,t){this.key=e,this.value=t}return e.prototype.toString=function(){return this.key===o.NAMED_TAG?"named: "+this.value+" ":"tagged: { key:"+this.key+", value: "+this.value+" }"},e}();t.Metadata=n})),v=n((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Plan=void 0,t.Plan=function(e,t){this.parentContext=e,this.rootRequest=t}})),g=n((function(e,t){function n(e,t,n,r,i){var o={},a="number"==typeof i,s=void 0!==i&&a?""+i:n;if(a&&void 0!==n)throw Error(c.INVALID_DECORATOR_OPERATION);Reflect.hasOwnMetadata(e,t)&&(o=Reflect.getMetadata(e,t));var u=o[s];if(Array.isArray(u))for(var l=0,h=u;h.length>l;l++){var f=h[l];if(f.key===r.key)throw Error(c.DUPLICATED_METADATA+" "+f.key)}else u=[];u.push(r),o[s]=u,Reflect.defineMetadata(e,o,t)}function r(e,t){Reflect.decorate(e,t)}function i(e,t){return function(n,r){t(n,r,e)}}Object.defineProperty(t,"__esModule",{value:!0}),t.tagProperty=t.tagParameter=t.decorate=void 0,t.tagParameter=function(e,t,r,i){n(o.TAGGED,e,t,i,r)},t.tagProperty=function(e,t,r){n(o.TAGGED_PROP,e.constructor,t,r)},t.decorate=function(e,t,n){"number"==typeof n?r([i(n,e)],t):"string"==typeof n?Reflect.decorate([e],t,n):r([e],t)}})),m=n((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.inject=t.LazyServiceIdentifer=void 0;var n=function(){function e(e){this._cb=e}return e.prototype.unwrap=function(){return this._cb()},e}();t.LazyServiceIdentifer=n,t.inject=function(e){return function(t,n,r){if(void 0===e)throw Error(c.UNDEFINED_INJECT_ANNOTATION(t.name));var i=new y.Metadata(o.INJECT_TAG,e);"number"==typeof r?g.tagParameter(t,n,r,i):g.tagProperty(t,n,i)}}})),k=n((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.QueryableString=void 0;var n=function(){function e(e){this.str=e}return e.prototype.startsWith=function(e){return 0===this.str.indexOf(e)},e.prototype.endsWith=function(e){var t,n=e.split("").reverse().join("");return t=this.str.split("").reverse().join(""),this.startsWith.call({str:t},n)},e.prototype.contains=function(e){return-1!==this.str.indexOf(e)},e.prototype.equals=function(e){return this.str===e},e.prototype.value=function(){return this.str},e}();t.QueryableString=n})),T=n((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Target=void 0;var n=function(){function e(e,t,n,r){this.id=s.id(),this.type=e,this.serviceIdentifier=n,this.name=new k.QueryableString(t||""),this.metadata=[];var i=null;"string"==typeof r?i=new y.Metadata(o.NAMED_TAG,r):r instanceof y.Metadata&&(i=r),null!==i&&this.metadata.push(i)}return e.prototype.hasTag=function(e){for(var t=0,n=this.metadata;n.length>t;t++){if(n[t].key===e)return!0}return!1},e.prototype.isArray=function(){return this.hasTag(o.MULTI_INJECT_TAG)},e.prototype.matchesArray=function(e){return this.matchesTag(o.MULTI_INJECT_TAG)(e)},e.prototype.isNamed=function(){return this.hasTag(o.NAMED_TAG)},e.prototype.isTagged=function(){return this.metadata.some((function(e){return o.NON_CUSTOM_TAG_KEYS.every((function(t){return e.key!==t}))}))},e.prototype.isOptional=function(){return this.matchesTag(o.OPTIONAL_TAG)(!0)},e.prototype.getNamedTag=function(){return this.isNamed()?this.metadata.filter((function(e){return e.key===o.NAMED_TAG}))[0]:null},e.prototype.getCustomTags=function(){return this.isTagged()?this.metadata.filter((function(e){return o.NON_CUSTOM_TAG_KEYS.every((function(t){return e.key!==t}))})):null},e.prototype.matchesNamedTag=function(e){return this.matchesTag(o.NAMED_TAG)(e)},e.prototype.matchesTag=function(e){var t=this;return function(n){for(var r=0,i=t.metadata;i.length>r;r++){var o=i[r];if(o.key===e&&o.value===n)return!0}return!1}},e}();t.Target=n})),b=n((function(e,n){var r=t&&t.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;r>n;n++,i++)e[i]=t[n];return e};function i(e,t,n,i){var o=e.getConstructorMetadata(n),a=o.compilerGeneratedMetadata;if(void 0===a)throw Error(c.MISSING_INJECTABLE_ANNOTATION+" "+t+".");var l=o.userGeneratedMetadata,h=Object.keys(l),f=function(e,t,n,r,i){for(var o=[],a=0;i>a;a++){var u=s(a,e,t,n,r);null!==u&&o.push(u)}return o}(i,t,a,l,0===n.length&&h.length>0||h.length>n.length?h.length:n.length),d=u(e,n);return r(r([],f),d)}function s(e,t,n,r,i){var o=i[""+e]||[],s=l(o),u=!0!==s.unmanaged,h=r[e],f=s.inject||s.multiInject;if((h=f||h)instanceof m.LazyServiceIdentifer&&(h=h.unwrap()),u){if(!t&&(h===Object||h===Function||void 0===h))throw Error(c.MISSING_INJECT_ANNOTATION+" argument "+e+" in class "+n+".");var d=new T.Target(a.TargetTypeEnum.ConstructorArgument,s.targetName,h);return d.metadata=o,d}return null}function u(e,t){for(var n=e.getPropertiesMetadata(t),i=[],o=0,s=Object.keys(n);s.length>o;o++){var c=s[o],h=n[c],f=l(n[c]),d=new T.Target(a.TargetTypeEnum.ClassProperty,f.targetName||c,f.inject||f.multiInject);d.metadata=h,i.push(d)}var p=Object.getPrototypeOf(t.prototype).constructor;if(p!==Object){var y=u(e,p);i=r(r([],i),y)}return i}function l(e){var t={};return e.forEach((function(e){t[""+e.key]=e.value})),{inject:t[o.INJECT_TAG],multiInject:t[o.MULTI_INJECT_TAG],targetName:t[o.NAME_TAG],unmanaged:t[o.UNMANAGED_TAG]}}Object.defineProperty(n,"__esModule",{value:!0}),n.getFunctionName=n.getBaseClassDependencyCount=n.getDependencies=void 0,Object.defineProperty(n,"getFunctionName",{enumerable:!0,get:function(){return d.getFunctionName}}),n.getDependencies=function(e,t){return i(e,d.getFunctionName(t),t,!1)},n.getBaseClassDependencyCount=function e(t,n){var r=Object.getPrototypeOf(n.prototype).constructor;if(r!==Object){var a=i(t,d.getFunctionName(r),r,!0),s=a.map((function(e){return e.metadata.filter((function(e){return e.key===o.UNMANAGED_TAG}))})),u=[].concat.apply([],s).length,c=a.length-u;return c>0?c:e(t,r)}return 0}})),S=n((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Request=void 0;var n=function(){function e(e,t,n,r,i){this.id=s.id(),this.serviceIdentifier=e,this.parentContext=t,this.parentRequest=n,this.target=i,this.childRequests=[],this.bindings=Array.isArray(r)?r:[r],this.requestScope=null===n?new Map:null}return e.prototype.addChildRequest=function(t,n,r){var i=new e(t,this.parentContext,this,n,r);return this.childRequests.push(i),i},e}();t.Request=n})),E=n((function(e,t){function n(e){return e._bindingDictionary}function r(e,t,n,r,i,a){var s=new y.Metadata(e?o.MULTI_INJECT_TAG:o.INJECT_TAG,n),u=new T.Target(t,r,n,s);if(void 0!==i){var c=new y.Metadata(i,a);u.metadata.push(c)}return u}function i(e,t,n,r,i){var o=u(n.container,i.serviceIdentifier),a=[];return o.length===h.BindingCount.NoBindingsAvailable&&n.container.options.autoBindInjectable&&"function"==typeof i.serviceIdentifier&&e.getConstructorMetadata(i.serviceIdentifier).compilerGeneratedMetadata&&(n.container.bind(i.serviceIdentifier).toSelf(),o=u(n.container,i.serviceIdentifier)),a=t?o:o.filter((function(e){var t=new S.Request(e.serviceIdentifier,n,r,e,i);return e.constraint(t)})),function(e,t,n,r){switch(t.length){case h.BindingCount.NoBindingsAvailable:if(n.isOptional())return t;var i=d.getServiceIdentifierAsString(e),o=c.NOT_REGISTERED;throw o+=d.listMetadataForTarget(i,n),o+=d.listRegisteredBindingsForServiceIdentifier(r,i,u),Error(o);case h.BindingCount.OnlyOneBindingAvailable:if(!n.isArray())return t;default:if(n.isArray())return t;i=d.getServiceIdentifierAsString(e),o=c.AMBIGUOUS_MATCH+" "+i;throw o+=d.listRegisteredBindingsForServiceIdentifier(r,i,u),Error(o)}}(i.serviceIdentifier,a,i,n.container),a}function s(e,t,n,r,o,u){var l,h;if(null===o){l=i(e,t,r,null,u),h=new S.Request(n,r,null,l,u);var f=new v.Plan(r,h);r.addPlan(f)}else l=i(e,t,r,o,u),h=o.addChildRequest(u.serviceIdentifier,l,u);l.forEach((function(t){var n=null;if(u.isArray())n=h.addChildRequest(t.serviceIdentifier,t,u);else{if(t.cache)return;n=h}if(t.type===a.BindingTypeEnum.Instance&&null!==t.implementationType){var i=b.getDependencies(e,t.implementationType);if(!r.container.options.skipBaseClassChecks)if(b.getBaseClassDependencyCount(e,t.implementationType)>i.length){var o=c.ARGUMENTS_LENGTH_MISMATCH(b.getFunctionName(t.implementationType));throw Error(o)}i.forEach((function(t){s(e,!1,t.serviceIdentifier,r,n,t)}))}}))}function u(e,t){var r=[],i=n(e);return i.hasKey(t)?r=i.get(t):null!==e.parent&&(r=u(e.parent,t)),r}Object.defineProperty(t,"__esModule",{value:!0}),t.getBindingDictionary=t.createMockRequest=t.plan=void 0,t.getBindingDictionary=n,t.plan=function(e,t,n,i,o,a,u,c){void 0===c&&(c=!1);var l=new p.Context(t),h=r(n,i,o,"",a,u);try{return s(e,c,o,l,null,h),l}catch(e){throw f.isStackOverflowExeption(e)&&l.plan&&d.circularDependencyToException(l.plan.rootRequest),e}},t.createMockRequest=function(e,t,n,r){var i=new T.Target(a.TargetTypeEnum.Variable,"",t,new y.Metadata(n,r)),o=new p.Context(e);return new S.Request(t,o,null,[],i)}})),P=n((function(e,n){var r=t&&t.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;r>n;n++,i++)e[i]=t[n];return e};Object.defineProperty(n,"__esModule",{value:!0}),n.resolveInstance=void 0,n.resolveInstance=function(e,t,n){var i,s=null;if(t.length>0){var u=t.filter((function(e){return null!==e.target&&e.target.type===a.TargetTypeEnum.ConstructorArgument})).map(n);s=function(e,t,n){var r=t.filter((function(e){return null!==e.target&&e.target.type===a.TargetTypeEnum.ClassProperty})),i=r.map(n);return r.forEach((function(t,n){var r;r=t.target.name.value(),e[r]=i[n]})),e}(s=new((i=e).bind.apply(i,r([void 0],u))),t,n)}else s=new e;return function(e,t){if(Reflect.hasMetadata(o.POST_CONSTRUCT,e)){var n=Reflect.getMetadata(o.POST_CONSTRUCT,e);try{t[n.value]()}catch(t){throw Error(c.POST_CONSTRUCT_ERROR(e.name,t.message))}}}(e,s),s}})),x=n((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.resolve=void 0;var n=function(e,t,n){try{return n()}catch(n){throw f.isStackOverflowExeption(n)?Error(c.CIRCULAR_DEPENDENCY_IN_FACTORY(e,""+t)):n}},r=function(e){return function(t){t.parentContext.setCurrentRequest(t);var i=t.bindings,o=t.childRequests,s=t.target&&t.target.isArray(),u=!(t.parentRequest&&t.parentRequest.target&&t.target&&t.parentRequest.target.matchesArray(t.target.serviceIdentifier));if(s&&u)return o.map((function(t){return r(e)(t)}));var l=null;if(!t.target.isOptional()||0!==i.length){var h=i[0],f=h.scope===a.BindingScopeEnum.Singleton,p=h.scope===a.BindingScopeEnum.Request;if(f&&h.activated)return h.cache;if(p&&null!==e&&e.has(h.id))return e.get(h.id);if(h.type===a.BindingTypeEnum.ConstantValue)l=h.cache,h.activated=!0;else if(h.type===a.BindingTypeEnum.Function)l=h.cache,h.activated=!0;else if(h.type===a.BindingTypeEnum.Constructor)l=h.implementationType;else if(h.type===a.BindingTypeEnum.DynamicValue&&null!==h.dynamicValue)l=n("toDynamicValue",h.serviceIdentifier,(function(){return h.dynamicValue(t.parentContext)}));else if(h.type===a.BindingTypeEnum.Factory&&null!==h.factory)l=n("toFactory",h.serviceIdentifier,(function(){return h.factory(t.parentContext)}));else if(h.type===a.BindingTypeEnum.Provider&&null!==h.provider)l=n("toProvider",h.serviceIdentifier,(function(){return h.provider(t.parentContext)}));else{if(h.type!==a.BindingTypeEnum.Instance||null===h.implementationType){var y=d.getServiceIdentifierAsString(t.serviceIdentifier);throw Error(c.INVALID_BINDING_TYPE+" "+y)}l=P.resolveInstance(h.implementationType,o,r(e))}return"function"==typeof h.onActivation&&(l=h.onActivation(t.parentContext,l)),f&&(h.cache=l,h.activated=!0),p&&null!==e&&!e.has(h.id)&&e.set(h.id,l),l}}};t.resolve=function(e){return r(e.plan.rootRequest.requestScope)(e.plan.rootRequest)}})),w=n((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.typeConstraint=t.namedConstraint=t.taggedConstraint=t.traverseAncerstors=void 0;var n=function(e,t){var r=e.parentRequest;return null!==r&&(!!t(r)||n(r,t))};t.traverseAncerstors=n;var r=function(e){return function(t){var n=function(n){return null!==n&&null!==n.target&&n.target.matchesTag(e)(t)};return n.metaData=new y.Metadata(e,t),n}};t.taggedConstraint=r;var i=r(o.NAMED_TAG);t.namedConstraint=i;t.typeConstraint=function(e){return function(t){return null!==t&&("string"==typeof e?t.bindings[0].serviceIdentifier===e:e===t.bindings[0].implementationType)}}})),_=n((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.BindingWhenSyntax=void 0;var n=function(){function e(e){this._binding=e}return e.prototype.when=function(e){return this._binding.constraint=e,new C.BindingOnSyntax(this._binding)},e.prototype.whenTargetNamed=function(e){return this._binding.constraint=w.namedConstraint(e),new C.BindingOnSyntax(this._binding)},e.prototype.whenTargetIsDefault=function(){return this._binding.constraint=function(e){return null!==e.target&&!e.target.isNamed()&&!e.target.isTagged()},new C.BindingOnSyntax(this._binding)},e.prototype.whenTargetTagged=function(e,t){return this._binding.constraint=w.taggedConstraint(e)(t),new C.BindingOnSyntax(this._binding)},e.prototype.whenInjectedInto=function(e){return this._binding.constraint=function(t){return w.typeConstraint(e)(t.parentRequest)},new C.BindingOnSyntax(this._binding)},e.prototype.whenParentNamed=function(e){return this._binding.constraint=function(t){return w.namedConstraint(e)(t.parentRequest)},new C.BindingOnSyntax(this._binding)},e.prototype.whenParentTagged=function(e,t){return this._binding.constraint=function(n){return w.taggedConstraint(e)(t)(n.parentRequest)},new C.BindingOnSyntax(this._binding)},e.prototype.whenAnyAncestorIs=function(e){return this._binding.constraint=function(t){return w.traverseAncerstors(t,w.typeConstraint(e))},new C.BindingOnSyntax(this._binding)},e.prototype.whenNoAncestorIs=function(e){return this._binding.constraint=function(t){return!w.traverseAncerstors(t,w.typeConstraint(e))},new C.BindingOnSyntax(this._binding)},e.prototype.whenAnyAncestorNamed=function(e){return this._binding.constraint=function(t){return w.traverseAncerstors(t,w.namedConstraint(e))},new C.BindingOnSyntax(this._binding)},e.prototype.whenNoAncestorNamed=function(e){return this._binding.constraint=function(t){return!w.traverseAncerstors(t,w.namedConstraint(e))},new C.BindingOnSyntax(this._binding)},e.prototype.whenAnyAncestorTagged=function(e,t){return this._binding.constraint=function(n){return w.traverseAncerstors(n,w.taggedConstraint(e)(t))},new C.BindingOnSyntax(this._binding)},e.prototype.whenNoAncestorTagged=function(e,t){return this._binding.constraint=function(n){return!w.traverseAncerstors(n,w.taggedConstraint(e)(t))},new C.BindingOnSyntax(this._binding)},e.prototype.whenAnyAncestorMatches=function(e){return this._binding.constraint=function(t){return w.traverseAncerstors(t,e)},new C.BindingOnSyntax(this._binding)},e.prototype.whenNoAncestorMatches=function(e){return this._binding.constraint=function(t){return!w.traverseAncerstors(t,e)},new C.BindingOnSyntax(this._binding)},e}();t.BindingWhenSyntax=n})),C=n((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.BindingOnSyntax=void 0;var n=function(){function e(e){this._binding=e}return e.prototype.onActivation=function(e){return this._binding.onActivation=e,new _.BindingWhenSyntax(this._binding)},e}();t.BindingOnSyntax=n})),N=n((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.BindingWhenOnSyntax=void 0;var n=function(){function e(e){this._binding=e,this._bindingWhenSyntax=new _.BindingWhenSyntax(this._binding),this._bindingOnSyntax=new C.BindingOnSyntax(this._binding)}return e.prototype.when=function(e){return this._bindingWhenSyntax.when(e)},e.prototype.whenTargetNamed=function(e){return this._bindingWhenSyntax.whenTargetNamed(e)},e.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},e.prototype.whenTargetTagged=function(e,t){return this._bindingWhenSyntax.whenTargetTagged(e,t)},e.prototype.whenInjectedInto=function(e){return this._bindingWhenSyntax.whenInjectedInto(e)},e.prototype.whenParentNamed=function(e){return this._bindingWhenSyntax.whenParentNamed(e)},e.prototype.whenParentTagged=function(e,t){return this._bindingWhenSyntax.whenParentTagged(e,t)},e.prototype.whenAnyAncestorIs=function(e){return this._bindingWhenSyntax.whenAnyAncestorIs(e)},e.prototype.whenNoAncestorIs=function(e){return this._bindingWhenSyntax.whenNoAncestorIs(e)},e.prototype.whenAnyAncestorNamed=function(e){return this._bindingWhenSyntax.whenAnyAncestorNamed(e)},e.prototype.whenAnyAncestorTagged=function(e,t){return this._bindingWhenSyntax.whenAnyAncestorTagged(e,t)},e.prototype.whenNoAncestorNamed=function(e){return this._bindingWhenSyntax.whenNoAncestorNamed(e)},e.prototype.whenNoAncestorTagged=function(e,t){return this._bindingWhenSyntax.whenNoAncestorTagged(e,t)},e.prototype.whenAnyAncestorMatches=function(e){return this._bindingWhenSyntax.whenAnyAncestorMatches(e)},e.prototype.whenNoAncestorMatches=function(e){return this._bindingWhenSyntax.whenNoAncestorMatches(e)},e.prototype.onActivation=function(e){return this._bindingOnSyntax.onActivation(e)},e}();t.BindingWhenOnSyntax=n})),M=n((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.BindingInSyntax=void 0;var n=function(){function e(e){this._binding=e}return e.prototype.inRequestScope=function(){return this._binding.scope=a.BindingScopeEnum.Request,new N.BindingWhenOnSyntax(this._binding)},e.prototype.inSingletonScope=function(){return this._binding.scope=a.BindingScopeEnum.Singleton,new N.BindingWhenOnSyntax(this._binding)},e.prototype.inTransientScope=function(){return this._binding.scope=a.BindingScopeEnum.Transient,new N.BindingWhenOnSyntax(this._binding)},e}();t.BindingInSyntax=n})),A=n((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.BindingInWhenOnSyntax=void 0;var n=function(){function e(e){this._binding=e,this._bindingWhenSyntax=new _.BindingWhenSyntax(this._binding),this._bindingOnSyntax=new C.BindingOnSyntax(this._binding),this._bindingInSyntax=new M.BindingInSyntax(e)}return e.prototype.inRequestScope=function(){return this._bindingInSyntax.inRequestScope()},e.prototype.inSingletonScope=function(){return this._bindingInSyntax.inSingletonScope()},e.prototype.inTransientScope=function(){return this._bindingInSyntax.inTransientScope()},e.prototype.when=function(e){return this._bindingWhenSyntax.when(e)},e.prototype.whenTargetNamed=function(e){return this._bindingWhenSyntax.whenTargetNamed(e)},e.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},e.prototype.whenTargetTagged=function(e,t){return this._bindingWhenSyntax.whenTargetTagged(e,t)},e.prototype.whenInjectedInto=function(e){return this._bindingWhenSyntax.whenInjectedInto(e)},e.prototype.whenParentNamed=function(e){return this._bindingWhenSyntax.whenParentNamed(e)},e.prototype.whenParentTagged=function(e,t){return this._bindingWhenSyntax.whenParentTagged(e,t)},e.prototype.whenAnyAncestorIs=function(e){return this._bindingWhenSyntax.whenAnyAncestorIs(e)},e.prototype.whenNoAncestorIs=function(e){return this._bindingWhenSyntax.whenNoAncestorIs(e)},e.prototype.whenAnyAncestorNamed=function(e){return this._bindingWhenSyntax.whenAnyAncestorNamed(e)},e.prototype.whenAnyAncestorTagged=function(e,t){return this._bindingWhenSyntax.whenAnyAncestorTagged(e,t)},e.prototype.whenNoAncestorNamed=function(e){return this._bindingWhenSyntax.whenNoAncestorNamed(e)},e.prototype.whenNoAncestorTagged=function(e,t){return this._bindingWhenSyntax.whenNoAncestorTagged(e,t)},e.prototype.whenAnyAncestorMatches=function(e){return this._bindingWhenSyntax.whenAnyAncestorMatches(e)},e.prototype.whenNoAncestorMatches=function(e){return this._bindingWhenSyntax.whenNoAncestorMatches(e)},e.prototype.onActivation=function(e){return this._bindingOnSyntax.onActivation(e)},e}();t.BindingInWhenOnSyntax=n})),O=n((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.BindingToSyntax=void 0;var n=function(){function e(e){this._binding=e}return e.prototype.to=function(e){return this._binding.type=a.BindingTypeEnum.Instance,this._binding.implementationType=e,new A.BindingInWhenOnSyntax(this._binding)},e.prototype.toSelf=function(){if("function"!=typeof this._binding.serviceIdentifier)throw Error(""+c.INVALID_TO_SELF_VALUE);return this.to(this._binding.serviceIdentifier)},e.prototype.toConstantValue=function(e){return this._binding.type=a.BindingTypeEnum.ConstantValue,this._binding.cache=e,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=a.BindingScopeEnum.Singleton,new N.BindingWhenOnSyntax(this._binding)},e.prototype.toDynamicValue=function(e){return this._binding.type=a.BindingTypeEnum.DynamicValue,this._binding.cache=null,this._binding.dynamicValue=e,this._binding.implementationType=null,new A.BindingInWhenOnSyntax(this._binding)},e.prototype.toConstructor=function(e){return this._binding.type=a.BindingTypeEnum.Constructor,this._binding.implementationType=e,this._binding.scope=a.BindingScopeEnum.Singleton,new N.BindingWhenOnSyntax(this._binding)},e.prototype.toFactory=function(e){return this._binding.type=a.BindingTypeEnum.Factory,this._binding.factory=e,this._binding.scope=a.BindingScopeEnum.Singleton,new N.BindingWhenOnSyntax(this._binding)},e.prototype.toFunction=function(e){if("function"!=typeof e)throw Error(c.INVALID_FUNCTION_BINDING);var t=this.toConstantValue(e);return this._binding.type=a.BindingTypeEnum.Function,this._binding.scope=a.BindingScopeEnum.Singleton,t},e.prototype.toAutoFactory=function(e){return this._binding.type=a.BindingTypeEnum.Factory,this._binding.factory=function(t){return function(){return t.container.get(e)}},this._binding.scope=a.BindingScopeEnum.Singleton,new N.BindingWhenOnSyntax(this._binding)},e.prototype.toProvider=function(e){return this._binding.type=a.BindingTypeEnum.Provider,this._binding.provider=e,this._binding.scope=a.BindingScopeEnum.Singleton,new N.BindingWhenOnSyntax(this._binding)},e.prototype.toService=function(e){this.toDynamicValue((function(t){return t.container.get(e)}))},e}();t.BindingToSyntax=n})),I=n((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.ContainerSnapshot=void 0;var n=function(){function e(){}return e.of=function(t,n){var r=new e;return r.bindings=t,r.middleware=n,r},e}();t.ContainerSnapshot=n})),R=n((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Lookup=void 0;var n=function(){function e(){this._map=new Map}return e.prototype.getMap=function(){return this._map},e.prototype.add=function(e,t){if(null==e)throw Error(c.NULL_ARGUMENT);if(null==t)throw Error(c.NULL_ARGUMENT);var n=this._map.get(e);void 0!==n?(n.push(t),this._map.set(e,n)):this._map.set(e,[t])},e.prototype.get=function(e){if(null==e)throw Error(c.NULL_ARGUMENT);var t=this._map.get(e);if(void 0!==t)return t;throw Error(c.KEY_NOT_FOUND)},e.prototype.remove=function(e){if(null==e)throw Error(c.NULL_ARGUMENT);if(!this._map.delete(e))throw Error(c.KEY_NOT_FOUND)},e.prototype.removeByCondition=function(e){var t=this;this._map.forEach((function(n,r){var i=n.filter((function(t){return!e(t)}));i.length>0?t._map.set(r,i):t._map.delete(r)}))},e.prototype.hasKey=function(e){if(null==e)throw Error(c.NULL_ARGUMENT);return this._map.has(e)},e.prototype.clone=function(){var t=new e;return this._map.forEach((function(e,n){e.forEach((function(e){return t.add(n,e.clone())}))})),t},e.prototype.traverse=function(e){this._map.forEach((function(t,n){e(n,t)}))},e}();t.Lookup=n})),L=n((function(e,n){var r=t&&t.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))},i=t&&t.__generator||function(e,t){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]&&i[3]>o[1])){a.label=o[1];break}if(6===o[0]&&i[1]>a.label){a.label=i[1],i=o;break}if(i&&i[2]>a.label){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],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])}}},h=t&&t.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;r>n;n++,i++)e[i]=t[n];return e};Object.defineProperty(n,"__esModule",{value:!0}),n.Container=void 0;var f=function(){function e(e){this._appliedMiddleware=[];var t=e||{};if("object"!=typeof t)throw Error(""+c.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT);if(void 0===t.defaultScope)t.defaultScope=a.BindingScopeEnum.Transient;else if(t.defaultScope!==a.BindingScopeEnum.Singleton&&t.defaultScope!==a.BindingScopeEnum.Transient&&t.defaultScope!==a.BindingScopeEnum.Request)throw Error(""+c.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE);if(void 0===t.autoBindInjectable)t.autoBindInjectable=!1;else if("boolean"!=typeof t.autoBindInjectable)throw Error(""+c.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE);if(void 0===t.skipBaseClassChecks)t.skipBaseClassChecks=!1;else if("boolean"!=typeof t.skipBaseClassChecks)throw Error(""+c.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK);this.options={autoBindInjectable:t.autoBindInjectable,defaultScope:t.defaultScope,skipBaseClassChecks:t.skipBaseClassChecks},this.id=s.id(),this._bindingDictionary=new R.Lookup,this._snapshots=[],this._middleware=null,this.parent=null,this._metadataReader=new l.MetadataReader}return e.merge=function(t,n){for(var r=[],i=2;arguments.length>i;i++)r[i-2]=arguments[i];var o=new e,a=h([t,n],r).map((function(e){return E.getBindingDictionary(e)})),s=E.getBindingDictionary(o);function u(e,t){e.traverse((function(e,n){n.forEach((function(e){t.add(e.serviceIdentifier,e.clone())}))}))}return a.forEach((function(e){u(e,s)})),o},e.prototype.load=function(){for(var e=[],t=0;arguments.length>t;t++)e[t]=arguments[t];for(var n=this._getContainerModuleHelpersFactory(),r=0,i=e;i.length>r;r++){var o=i[r],a=n(o.id);o.registry(a.bindFunction,a.unbindFunction,a.isboundFunction,a.rebindFunction)}},e.prototype.loadAsync=function(){for(var e=[],t=0;arguments.length>t;t++)e[t]=arguments[t];return r(this,void 0,void 0,(function(){var t,n,r,o,a;return i(this,(function(i){switch(i.label){case 0:t=this._getContainerModuleHelpersFactory(),n=0,r=e,i.label=1;case 1:return r.length>n?(a=t((o=r[n]).id),[4,o.registry(a.bindFunction,a.unbindFunction,a.isboundFunction,a.rebindFunction)]):[3,4];case 2:i.sent(),i.label=3;case 3:return n++,[3,1];case 4:return[2]}}))}))},e.prototype.unload=function(){for(var e=this,t=[],n=0;arguments.length>n;n++)t[n]=arguments[n];var r=function(e){return function(t){return t.moduleId===e}};t.forEach((function(t){var n=r(t.id);e._bindingDictionary.removeByCondition(n)}))},e.prototype.bind=function(e){var t=new u.Binding(e,this.options.defaultScope||a.BindingScopeEnum.Transient);return this._bindingDictionary.add(e,t),new O.BindingToSyntax(t)},e.prototype.rebind=function(e){return this.unbind(e),this.bind(e)},e.prototype.unbind=function(e){try{this._bindingDictionary.remove(e)}catch(t){throw Error(c.CANNOT_UNBIND+" "+d.getServiceIdentifierAsString(e))}},e.prototype.unbindAll=function(){this._bindingDictionary=new R.Lookup},e.prototype.isBound=function(e){var t=this._bindingDictionary.hasKey(e);return!t&&this.parent&&(t=this.parent.isBound(e)),t},e.prototype.isBoundNamed=function(e,t){return this.isBoundTagged(e,o.NAMED_TAG,t)},e.prototype.isBoundTagged=function(e,t,n){var r=!1;if(this._bindingDictionary.hasKey(e)){var i=this._bindingDictionary.get(e),o=E.createMockRequest(this,e,t,n);r=i.some((function(e){return e.constraint(o)}))}return!r&&this.parent&&(r=this.parent.isBoundTagged(e,t,n)),r},e.prototype.snapshot=function(){this._snapshots.push(I.ContainerSnapshot.of(this._bindingDictionary.clone(),this._middleware))},e.prototype.restore=function(){var e=this._snapshots.pop();if(void 0===e)throw Error(c.NO_MORE_SNAPSHOTS_AVAILABLE);this._bindingDictionary=e.bindings,this._middleware=e.middleware},e.prototype.createChild=function(t){var n=new e(t||this.options);return n.parent=this,n},e.prototype.applyMiddleware=function(){for(var e=[],t=0;arguments.length>t;t++)e[t]=arguments[t];this._appliedMiddleware=this._appliedMiddleware.concat(e);var n=this._middleware?this._middleware:this._planAndResolve();this._middleware=e.reduce((function(e,t){return t(e)}),n)},e.prototype.applyCustomMetadataReader=function(e){this._metadataReader=e},e.prototype.get=function(e){return this._get(!1,!1,a.TargetTypeEnum.Variable,e)},e.prototype.getTagged=function(e,t,n){return this._get(!1,!1,a.TargetTypeEnum.Variable,e,t,n)},e.prototype.getNamed=function(e,t){return this.getTagged(e,o.NAMED_TAG,t)},e.prototype.getAll=function(e){return this._get(!0,!0,a.TargetTypeEnum.Variable,e)},e.prototype.getAllTagged=function(e,t,n){return this._get(!1,!0,a.TargetTypeEnum.Variable,e,t,n)},e.prototype.getAllNamed=function(e,t){return this.getAllTagged(e,o.NAMED_TAG,t)},e.prototype.resolve=function(e){var t=this.createChild();return t.bind(e).toSelf(),this._appliedMiddleware.forEach((function(e){t.applyMiddleware(e)})),t.get(e)},e.prototype._getContainerModuleHelpersFactory=function(){var e=this,t=function(e,t){e._binding.moduleId=t},n=function(n){return function(r){var i=e.rebind.bind(e)(r);return t(i,n),i}};return function(r){return{bindFunction:(i=r,function(n){var r=e.bind.bind(e)(n);return t(r,i),r}),isboundFunction:function(t){return e.isBound.bind(e)(t)},rebindFunction:n(r),unbindFunction:function(t){e.unbind.bind(e)(t)}};var i}},e.prototype._get=function(e,t,n,r,i,o){var a=null,s={avoidConstraints:e,contextInterceptor:function(e){return e},isMultiInject:t,key:i,serviceIdentifier:r,targetType:n,value:o};if(this._middleware){if(null==(a=this._middleware(s)))throw Error(c.INVALID_MIDDLEWARE_RETURN)}else a=this._planAndResolve()(s);return a},e.prototype._planAndResolve=function(){var e=this;return function(t){var n=E.plan(e._metadataReader,e,t.isMultiInject,t.targetType,t.serviceIdentifier,t.key,t.value,t.avoidConstraints);return n=t.contextInterceptor(n),x.resolve(n)}},e}();n.Container=f})),D=n((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.AsyncContainerModule=t.ContainerModule=void 0,t.ContainerModule=function(e){this.id=s.id(),this.registry=e},t.AsyncContainerModule=function(e){this.id=s.id(),this.registry=e}})),U=n((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.injectable=void 0,t.injectable=function(){return function(e){if(Reflect.hasOwnMetadata(o.PARAM_TYPES,e))throw Error(c.DUPLICATED_INJECTABLE_DECORATOR);var t=Reflect.getMetadata(o.DESIGN_PARAM_TYPES,e)||[];return Reflect.defineMetadata(o.PARAM_TYPES,t,e),e}}})),F=n((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.tagged=void 0,t.tagged=function(e,t){return function(n,r,i){var o=new y.Metadata(e,t);"number"==typeof i?g.tagParameter(n,r,i,o):g.tagProperty(n,r,o)}}})),B=n((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.named=void 0,t.named=function(e){return function(t,n,r){var i=new y.Metadata(o.NAMED_TAG,e);"number"==typeof r?g.tagParameter(t,n,r,i):g.tagProperty(t,n,i)}}})),V=n((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.optional=void 0,t.optional=function(){return function(e,t,n){var r=new y.Metadata(o.OPTIONAL_TAG,!0);"number"==typeof n?g.tagParameter(e,t,n,r):g.tagProperty(e,t,r)}}})),j=n((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.unmanaged=void 0,t.unmanaged=function(){return function(e,t,n){var r=new y.Metadata(o.UNMANAGED_TAG,!0);g.tagParameter(e,t,n,r)}}})),G=n((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.multiInject=void 0,t.multiInject=function(e){return function(t,n,r){var i=new y.Metadata(o.MULTI_INJECT_TAG,e);"number"==typeof r?g.tagParameter(t,n,r,i):g.tagProperty(t,n,i)}}})),z=n((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.targetName=void 0,t.targetName=function(e){return function(t,n,r){var i=new y.Metadata(o.NAME_TAG,e);g.tagParameter(t,n,r,i)}}})),H=n((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.postConstruct=void 0,t.postConstruct=function(){return function(e,t,n){var r=new y.Metadata(o.POST_CONSTRUCT,t);if(Reflect.hasOwnMetadata(o.POST_CONSTRUCT,e.constructor))throw Error(c.MULTIPLE_POST_CONSTRUCT_METHODS);Reflect.defineMetadata(o.POST_CONSTRUCT,r,e.constructor)}}})),W=n((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.multiBindToService=void 0;t.multiBindToService=function(e){return function(t){return function(){for(var n=[],r=0;arguments.length>r;r++)n[r]=arguments[r];return n.forEach((function(n){return e.bind(n).toService(t)}))}}}})),Y=n((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.multiBindToService=t.getServiceIdentifierAsString=t.typeConstraint=t.namedConstraint=t.taggedConstraint=t.traverseAncerstors=t.decorate=t.id=t.MetadataReader=t.postConstruct=t.targetName=t.multiInject=t.unmanaged=t.optional=t.LazyServiceIdentifer=t.inject=t.named=t.tagged=t.injectable=t.ContainerModule=t.AsyncContainerModule=t.TargetTypeEnum=t.BindingTypeEnum=t.BindingScopeEnum=t.Container=t.METADATA_KEY=void 0,t.METADATA_KEY=o,Object.defineProperty(t,"Container",{enumerable:!0,get:function(){return L.Container}}),Object.defineProperty(t,"BindingScopeEnum",{enumerable:!0,get:function(){return a.BindingScopeEnum}}),Object.defineProperty(t,"BindingTypeEnum",{enumerable:!0,get:function(){return a.BindingTypeEnum}}),Object.defineProperty(t,"TargetTypeEnum",{enumerable:!0,get:function(){return a.TargetTypeEnum}}),Object.defineProperty(t,"AsyncContainerModule",{enumerable:!0,get:function(){return D.AsyncContainerModule}}),Object.defineProperty(t,"ContainerModule",{enumerable:!0,get:function(){return D.ContainerModule}}),Object.defineProperty(t,"injectable",{enumerable:!0,get:function(){return U.injectable}}),Object.defineProperty(t,"tagged",{enumerable:!0,get:function(){return F.tagged}}),Object.defineProperty(t,"named",{enumerable:!0,get:function(){return B.named}}),Object.defineProperty(t,"inject",{enumerable:!0,get:function(){return m.inject}}),Object.defineProperty(t,"LazyServiceIdentifer",{enumerable:!0,get:function(){return m.LazyServiceIdentifer}}),Object.defineProperty(t,"optional",{enumerable:!0,get:function(){return V.optional}}),Object.defineProperty(t,"unmanaged",{enumerable:!0,get:function(){return j.unmanaged}}),Object.defineProperty(t,"multiInject",{enumerable:!0,get:function(){return G.multiInject}}),Object.defineProperty(t,"targetName",{enumerable:!0,get:function(){return z.targetName}}),Object.defineProperty(t,"postConstruct",{enumerable:!0,get:function(){return H.postConstruct}}),Object.defineProperty(t,"MetadataReader",{enumerable:!0,get:function(){return l.MetadataReader}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return s.id}}),Object.defineProperty(t,"decorate",{enumerable:!0,get:function(){return g.decorate}}),Object.defineProperty(t,"traverseAncerstors",{enumerable:!0,get:function(){return w.traverseAncerstors}}),Object.defineProperty(t,"taggedConstraint",{enumerable:!0,get:function(){return w.taggedConstraint}}),Object.defineProperty(t,"namedConstraint",{enumerable:!0,get:function(){return w.namedConstraint}}),Object.defineProperty(t,"typeConstraint",{enumerable:!0,get:function(){return w.typeConstraint}}),Object.defineProperty(t,"getServiceIdentifierAsString",{enumerable:!0,get:function(){return d.getServiceIdentifierAsString}}),Object.defineProperty(t,"multiBindToService",{enumerable:!0,get:function(){return W.multiBindToService}})}));function q(e){return q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},q(e)}function X(e,t){for(var n=0;t.length>n;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function K(e,t,n){return t&&X(e.prototype,t),n&&X(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Z(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function J(e){return J="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},J(e)}function Q(t,n){return n.lifecycle===e.Syringe.Lifecycle.singleton?function(e){return e.inSingletonScope()}(t):function(e){return e.inTransientScope()}(t)}function $(e,t){e.whenTargetNamed(ne(t))}function ee(e,t){return t.bind(re(e))}function te(e,t){if(t.isBound(re(e)))try{return t.rebind(re(e))}catch(n){return t.bind(re(e))}return t.bind(re(e))}function ne(t){return e.Utils.isDefinedToken(t)?t.symbol:t}function re(t){return e.Utils.isDefinedToken(t)?t.symbol:t}!function(e){!function(n){var r="object"==typeof t?t:"object"==typeof self?self:"object"==typeof this?this:Function("return this;")(),i=o(e);function o(e,t){return function(n,r){"function"!=typeof e[n]&&Object.defineProperty(e,n,{configurable:!0,writable:!0,value:r}),t&&t(n,r)}}void 0===r.Reflect?r.Reflect=e:i=o(r.Reflect,i),function(e){var t=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,u={create:o?function(){return re(Object.create(null))}:a?function(){return re({__proto__:null})}:function(){return re({})},has:s?function(e,n){return t.call(e,n)}:function(e,t){return t in e},get:s?function(e,n){return t.call(e,n)?e[n]:void 0}:function(e,t){return e[t]}},c=Object.getPrototypeOf(Function),l="object"==typeof process&&process.env&&"true"===process.env.REFLECT_METADATA_USE_MAP_POLYFILL,h=l||"function"!=typeof Map||"function"!=typeof Map.prototype.entries?ee():Map,f=l||"function"!=typeof Set||"function"!=typeof Set.prototype.entries?te():Set,d=new(l||"function"!=typeof WeakMap?ne():WeakMap);function p(e,t,n,r){if(L(n)){if(!H(e))throw new TypeError;if(!Y(t))throw new TypeError;return P(e,t)}if(!H(e))throw new TypeError;if(!F(t))throw new TypeError;if(!F(r)&&!L(r)&&!D(r))throw new TypeError;return D(r)&&(r=void 0),x(e,t,n=z(n),r)}function y(e,t){function n(n,r){if(!F(n))throw new TypeError;if(!L(r)&&!q(r))throw new TypeError;A(e,t,n,r)}return n}function v(e,t,n,r){if(!F(n))throw new TypeError;return L(r)||(r=z(r)),A(e,t,n,r)}function g(e,t,n){if(!F(t))throw new TypeError;return L(n)||(n=z(n)),_(e,t,n)}function m(e,t,n){if(!F(t))throw new TypeError;return L(n)||(n=z(n)),C(e,t,n)}function k(e,t,n){if(!F(t))throw new TypeError;return L(n)||(n=z(n)),N(e,t,n)}function T(e,t,n){if(!F(t))throw new TypeError;return L(n)||(n=z(n)),M(e,t,n)}function b(e,t){if(!F(e))throw new TypeError;return L(t)||(t=z(t)),O(e,t)}function S(e,t){if(!F(e))throw new TypeError;return L(t)||(t=z(t)),I(e,t)}function E(e,t,n){if(!F(t))throw new TypeError;L(n)||(n=z(n));var r=w(t,n,!1);if(L(r))return!1;if(!r.delete(e))return!1;if(r.size>0)return!0;var i=d.get(t);return i.delete(n),i.size>0||d.delete(t),!0}function P(e,t){for(var n=e.length-1;n>=0;--n){var r=(0,e[n])(t);if(!L(r)&&!D(r)){if(!Y(r))throw new TypeError;t=r}}return t}function x(e,t,n,r){for(var i=e.length-1;i>=0;--i){var o=(0,e[i])(t,n,r);if(!L(o)&&!D(o)){if(!F(o))throw new TypeError;r=o}}return r}function w(e,t,n){var r=d.get(e);if(L(r)){if(!n)return;r=new h,d.set(e,r)}var i=r.get(t);if(L(i)){if(!n)return;i=new h,r.set(t,i)}return i}function _(e,t,n){if(C(e,t,n))return!0;var r=$(t);return!D(r)&&_(e,r,n)}function C(e,t,n){var r=w(t,n,!1);return!L(r)&&j(r.has(e))}function N(e,t,n){if(C(e,t,n))return M(e,t,n);var r=$(t);return D(r)?void 0:N(e,r,n)}function M(e,t,n){var r=w(t,n,!1);if(!L(r))return r.get(e)}function A(e,t,n,r){w(n,r,!0).set(e,t)}function O(e,t){var n=I(e,t),r=$(e);if(null===r)return n;var i=O(r,t);if(0>=i.length)return n;if(0>=n.length)return i;for(var o=new f,a=[],s=0,u=n;u.length>s;s++){o.has(h=u[s])||(o.add(h),a.push(h))}for(var c=0,l=i;l.length>c;c++){var h;o.has(h=l[c])||(o.add(h),a.push(h))}return a}function I(e,t){var n=[],r=w(e,t,!1);if(L(r))return n;for(var i=K(r.keys()),o=0;;){var a=J(i);if(!a)return n.length=o,n;var s=Z(a);try{n[o]=s}catch(e){try{Q(i)}finally{throw e}}o++}}function R(e){if(null===e)return 1;switch(typeof e){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===e?1:6;default:return 6}}function L(e){return void 0===e}function D(e){return null===e}function U(e){return"symbol"==typeof e}function F(e){return"object"==typeof e?null!==e:"function"==typeof e}function B(e,t){switch(R(e)){case 0:case 1:case 2:case 3:case 4:case 5:return e}var n=3===t?"string":5===t?"number":"default",i=X(e,r);if(void 0!==i){var o=i.call(e,n);if(F(o))throw new TypeError;return o}return V(e,"default"===n?"number":n)}function V(e,t){if("string"===t){var n=e.toString;if(W(n))if(!F(i=n.call(e)))return i;if(W(r=e.valueOf))if(!F(i=r.call(e)))return i}else{var r;if(W(r=e.valueOf))if(!F(i=r.call(e)))return i;var i,o=e.toString;if(W(o))if(!F(i=o.call(e)))return i}throw new TypeError}function j(e){return!!e}function G(e){return""+e}function z(e){var t=B(e,3);return U(t)?t:G(t)}function H(e){return Array.isArray?Array.isArray(e):e instanceof Object?e instanceof Array:"[object Array]"===Object.prototype.toString.call(e)}function W(e){return"function"==typeof e}function Y(e){return"function"==typeof e}function q(e){switch(R(e)){case 3:case 4:return!0;default:return!1}}function X(e,t){var n=e[t];if(null!=n){if(!W(n))throw new TypeError;return n}}function K(e){var t=X(e,i);if(!W(t))throw new TypeError;var n=t.call(e);if(!F(n))throw new TypeError;return n}function Z(e){return e.value}function J(e){var t=e.next();return!t.done&&t}function Q(e){var t=e.return;t&&t.call(e)}function $(e){var t=Object.getPrototypeOf(e);if("function"!=typeof e||e===c)return t;if(t!==c)return t;var n=e.prototype,r=n&&Object.getPrototypeOf(n);if(null==r||r===Object.prototype)return t;var i=r.constructor;return"function"!=typeof i||i===e?t:i}function ee(){var e={},t=[],n=function(){function e(e,t,n){this._index=0,this._keys=e,this._values=t,this._selector=n}return e.prototype["@@iterator"]=function(){return this},e.prototype[i]=function(){return this},e.prototype.next=function(){var e=this._index;if(e>=0&&this._keys.length>e){var n=this._selector(this._keys[e],this._values[e]);return this._keys.length>e+1?this._index++:(this._index=-1,this._keys=t,this._values=t),{value:n,done:!1}}return{value:void 0,done:!0}},e.prototype.throw=function(e){throw 0>this._index||(this._index=-1,this._keys=t,this._values=t),e},e.prototype.return=function(e){return 0>this._index||(this._index=-1,this._keys=t,this._values=t),{value:e,done:!0}},e}();return function(){function t(){this._keys=[],this._values=[],this._cacheKey=e,this._cacheIndex=-2}return Object.defineProperty(t.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),t.prototype.has=function(e){return this._find(e,!1)>=0},t.prototype.get=function(e){var t=this._find(e,!1);return 0>t?void 0:this._values[t]},t.prototype.set=function(e,t){var n=this._find(e,!0);return this._values[n]=t,this},t.prototype.delete=function(t){var n=this._find(t,!1);if(n>=0){for(var r=this._keys.length,i=n+1;r>i;i++)this._keys[i-1]=this._keys[i],this._values[i-1]=this._values[i];return this._keys.length--,this._values.length--,t===this._cacheKey&&(this._cacheKey=e,this._cacheIndex=-2),!0}return!1},t.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=e,this._cacheIndex=-2},t.prototype.keys=function(){return new n(this._keys,this._values,r)},t.prototype.values=function(){return new n(this._keys,this._values,o)},t.prototype.entries=function(){return new n(this._keys,this._values,a)},t.prototype["@@iterator"]=function(){return this.entries()},t.prototype[i]=function(){return this.entries()},t.prototype._find=function(e,t){return this._cacheKey!==e&&(this._cacheIndex=this._keys.indexOf(this._cacheKey=e)),0>this._cacheIndex&&t&&(this._cacheIndex=this._keys.length,this._keys.push(e),this._values.push(void 0)),this._cacheIndex},t}();function r(e,t){return e}function o(e,t){return t}function a(e,t){return[e,t]}}function te(){return function(){function e(){this._map=new h}return Object.defineProperty(e.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),e.prototype.has=function(e){return this._map.has(e)},e.prototype.add=function(e){return this._map.set(e,e),this},e.prototype.delete=function(e){return this._map.delete(e)},e.prototype.clear=function(){this._map.clear()},e.prototype.keys=function(){return this._map.keys()},e.prototype.values=function(){return this._map.values()},e.prototype.entries=function(){return this._map.entries()},e.prototype["@@iterator"]=function(){return this.keys()},e.prototype[i]=function(){return this.keys()},e}()}function ne(){var e=16,n=u.create(),r=i();return function(){function e(){this._key=i()}return e.prototype.has=function(e){var t=o(e,!1);return void 0!==t&&u.has(t,this._key)},e.prototype.get=function(e){var t=o(e,!1);return void 0!==t?u.get(t,this._key):void 0},e.prototype.set=function(e,t){return o(e,!0)[this._key]=t,this},e.prototype.delete=function(e){var t=o(e,!1);return void 0!==t&&delete t[this._key]},e.prototype.clear=function(){this._key=i()},e}();function i(){var e;do{e="@@WeakMap@@"+c()}while(u.has(n,e));return n[e]=!0,e}function o(e,n){if(!t.call(e,r)){if(!n)return;Object.defineProperty(e,r,{value:u.create()})}return e[r]}function a(e,t){for(var n=0;t>n;++n)e[n]=255*Math.random()|0;return e}function s(e){return"function"==typeof Uint8Array?"undefined"!=typeof crypto?crypto.getRandomValues(new Uint8Array(e)):"undefined"!=typeof msCrypto?msCrypto.getRandomValues(new Uint8Array(e)):a(new Uint8Array(e),e):a(Array(e),e)}function c(){var t=s(e);t[6]=79&t[6]|64,t[8]=191&t[8]|128;for(var n="",r=0;e>r;++r){var i=t[r];4!==r&&6!==r&&8!==r||(n+="-"),16>i&&(n+="0"),n+=i.toString(16).toLowerCase()}return n}}function re(e){return e.__=void 0,delete e.__,e}e("decorate",p),e("metadata",y),e("defineMetadata",v),e("hasMetadata",g),e("hasOwnMetadata",m),e("getMetadata",k),e("getOwnMetadata",T),e("getMetadataKeys",b),e("getOwnMetadataKeys",S),e("deleteMetadata",E)}(i)}()}(r||(r={})),function(e){e.defineToken=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{multiple:!0};return new e.DefinedToken(t,n)};var t,n=K((function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Z(this,e),this.prototype={},this.name=void 0,this.multiple=void 0,this.symbol=void 0;var r=n.multiple,i=void 0!==r&&r;this.name=t,this.symbol=Symbol(this.name),this.multiple=i}));e.DefinedToken=n,e.isModule=function(e){return!!e&&"object"===q(e)&&"id"in e},function(e){e.singleton="singleton",e.transient="transient"}(t=e.Lifecycle||(e.Lifecycle={})),e.ClassOptionSymbol=Symbol("SyringeClassOptionSymbol"),e.DefaultOption={lifecycle:t.transient}}(e.Syringe||(e.Syringe={})),(i=e.Utils||(e.Utils={})).toArray=function(e){return Array.isArray(e)?e:void 0===e?[]:[e]},i.isClass=function(e){return!(!e||"function"!=typeof e||!("prototype"in e))},i.isDefinedToken=function(e){return!!(e&&"object"===q(e)&&"symbol"in e&&"multiple"in e)},i.isInjectOption=function(e){return!(!e||"object"!==q(e)||!("token"in e))},i.isNamedToken=function(e){return!!(e&&"object"===q(e)&&"token"in e&&"named"in e)},i.isMultipleEnabled=function(e){return i.isDefinedToken(e)&&e.multiple};var ie=new Y.Container;function oe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ae(e){for(var t=1;arguments.length>t;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?oe(Object(n),!0).forEach((function(t){se(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oe(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function se(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ue(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=Y.injectable();return function(r){Reflect.defineMetadata(e.Syringe.ClassOptionSymbol,ae(ae({},t),{},{target:r}),r),n(r)}}function ce(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ue(ae(ae({},t),{},{lifecycle:e.Syringe.Lifecycle.singleton}))}function le(e){return Y.inject(re(e))}function he(e){return Y.named(ne(e))}var fe=Symbol("SyringeOptionSymbol");function de(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function pe(e){for(var t=1;arguments.length>t;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?de(Object(n),!0).forEach((function(t){ye(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):de(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ye(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ve(e,t){for(var n=0;t.length>n;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var ge=function(){function t(n,r,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),this.token=void 0,this.rawToken=void 0,this.named=void 0,this.generalToken=void 0,this.option=void 0,this.register=void 0,this.mutiple=void 0,this.register=n,this.token=r,this.option=i,this.rawToken=e.Utils.isNamedToken(r)?r.token:r,this.named=e.Utils.isNamedToken(r)?r.named:void 0,this.mutiple=!!this.named||e.Utils.isMultipleEnabled(this.rawToken),this.generalToken=this.rawToken}var n,r,i;return n=t,r=[{key:"resolve",value:function(){var t=this,n=this.register;(function(e){return e&&"object"===J(e)&&"bind"in e&&"unbind"in e&&"rebind"in e&&"isBound"in e})(n)&&(this.mutiple?this.resolveMutilple(n):(this.resolveMono(n),!this.named&&this.option.contrib.length>0&&this.option.contrib.forEach((function(r){e.Utils.isMultipleEnabled(r)?ee(r,n).toService(t.generalToken):te(r,n).toService(t.generalToken)}))))}},{key:"resolveMono",value:function(e){if("useValue"in this.option)return te(this.generalToken,e).toConstantValue(this.option.useValue);if(this.option.useDynamic.length>0){var t=this.option.useDynamic[this.option.useDynamic.length-1];return Q(te(this.generalToken,e).toDynamicValue((function(e){var n=Be.getContainer(e.container);return t({container:n})})),this.option)}if(this.option.useFactory.length>0){var n=this.option.useFactory[this.option.useFactory.length-1];return te(this.generalToken,e).toFactory((function(e){var t=Be.getContainer(e.container);return n({container:t})}))}if(this.option.useClass.length>0){var r=this.option.useClass[this.option.useClass.length-1];return Q(te(this.generalToken,e).to(r),this.option)}}},{key:"resolveMutilple",value:function(e){var t=this,n=this.option.useClass.map((function(n){return Q(ee(t.generalToken,e).to(n),t.option)})),r=this.option.useDynamic.map((function(n){return Q(ee(t.generalToken,e).toDynamicValue((function(e){var t=Be.getContainer(e.container);return n({container:t})})),t.option)})),i=this.option.useFactory.map((function(n){return ee(t.generalToken,e).toFactory((function(e){var t=Be.getContainer(e.container);return n({container:t})}))})),o="useValue"in this.option?ee(this.generalToken,e).toConstantValue(this.option.useValue):void 0;this.named&&(n.forEach((function(e){return t.named&&$(e,t.named)})),r.forEach((function(e){return t.named&&$(e,t.named)})),i.forEach((function(e){return t.named&&$(e,t.named)})),o&&$(o,this.named))}}],i=[{key:"resolveTarget",value:function(n,r){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};try{try{var o=Reflect.getMetadata(fe,r);o&&t.resolveOption(n,o)}catch(e){}if(e.Utils.isClass(r))if(i.useClass){var a=e.Utils.toArray(i.useClass);a.unshift(r),i.useClass=a}else i.useClass=[r];var s;try{s=Reflect.getMetadata(e.Syringe.ClassOptionSymbol,r)}catch(e){}if((s=pe(pe({},s||{}),i)).token){var u=e.Utils.toArray(s.token);u.unshift(r),s.token=u}else s.token=[r];t.resolveOption(n,s)}catch(e){}}},{key:"resolveOption",value:function(n,r){var i=function(t){var n=e.Utils.toArray(t.token),r=e.Utils.toArray(t.useClass),i=e.Utils.toArray(t.useDynamic),o=e.Utils.toArray(t.useFactory),a=e.Utils.toArray(t.contrib),s={token:n,useClass:r,lifecycle:a.length>0?e.Syringe.Lifecycle.singleton:t.lifecycle||e.Syringe.Lifecycle.transient,contrib:a,useDynamic:i,useFactory:o};return"useValue"in t&&(s.useValue=t.useValue),s}(pe(pe({},t.globalConfig),r));(0!==i.useClass.length||0!==i.useDynamic.length||0!==i.useFactory.length||"useValue"in i)&&i.token.forEach((function(e){new t(n,e,pe({},i)).resolve()}))}}],r&&ve(n.prototype,r),i&&ve(n,i),Object.defineProperty(n,"prototype",{writable:!1}),t}();ge.globalConfig=e.Syringe.DefaultOption;var me=e.Syringe.defineToken("ContributionProvider");function ke(e){return function(e){if(Array.isArray(e))return Te(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Te(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Te(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Te(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);t>n;n++)r[n]=e[n];return r}function be(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Se(e){for(var t=1;arguments.length>t;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?be(Object(n),!0).forEach((function(t){Ee(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):be(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ee(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Pe(e,t){for(var n=0;t.length>n;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var xe=function(){function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.option={recursive:!1,cache:!0},this.services=void 0,this.serviceIdentifier=void 0,this.container=void 0,this.container=n,this.serviceIdentifier=t,r&&(this.option=Se(Se({},this.option),r))}var t,n,r;return t=e,n=[{key:"setServices",value:function(e){for(var t=[],n=this.container;n;){if(n.isBound(this.serviceIdentifier)){var r=n.getAll(this.serviceIdentifier);t.push.apply(t,ke(r))}n=e?n.parent:void 0}return t}},{key:"getContributions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Se(Se({},this.option),e),n=t.cache,r=t.recursive;return n&&void 0!==this.services||(this.services=this.setServices(!!r)),this.services}}],n&&Pe(t.prototype,n),r&&Pe(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function we(t,n){return{token:{token:me,named:t},useDynamic:function(e){return new xe(t,e.container,n)},lifecycle:e.Syringe.Lifecycle.singleton}}function _e(t,n,r){t({token:{token:me,named:n},useDynamic:function(e){return new xe(n,e.container,r)},lifecycle:e.Syringe.Lifecycle.singleton})}function Ce(e,t){for(var n=0;t.length>n;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var Ne=function(){function t(n){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),this.id=void 0,this.inversifyModule=void 0,this.baseRegistry=void 0,this.optionCollection=void 0,this.inversifyRegister=function(t,n,i,o){var a={bind:t,unbind:n,isBound:i,rebind:o},s=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.Utils.isInjectOption(t)?ge.resolveOption(a,t):ge.resolveTarget(a,t,n)};r.baseRegistry&&r.baseRegistry(s),r.optionCollection&&r.optionCollection.forEach((function(e){return s(e)}))},this.baseRegistry=n,this.inversifyModule=new Y.ContainerModule(this.inversifyRegister),this.id=this.inversifyModule.id}var n,r,i;return n=t,r=[{key:"options",get:function(){return this.optionCollection||(this.optionCollection=[]),this.optionCollection}},{key:"register",value:function(){for(var e=this,t=arguments.length,n=Array(t),r=0;t>r;r++)n[r]=arguments[r];return n.forEach((function(t){return e.options.push(t)})),this}},{key:"contribution",value:function(){for(var e=this,t=arguments.length,n=Array(t),r=0;t>r;r++)n[r]=arguments[r];return n.forEach((function(t){return e.options.push(we(t))})),this}}],r&&Ce(n.prototype,r),i&&Ce(n,i),Object.defineProperty(n,"prototype",{writable:!1}),t}();function Me(e){return e&&"inversifyModule"in e}function Ae(e){return new Ne(e)}function Oe(e,t){for(var n=0;t.length>n;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var Ie,Re,Le,De,Ue,Fe=new Map,Be=function(){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),this.loadedModules=[],this.container=void 0,this.inversify=!0,this.parent=void 0,this.container=e||new Y.Container,t.setContainer(this.container,this)}var n,r,i;return n=t,r=[{key:"load",value:function(e,t){var n=this;return t||!this.loadedModules.includes(e.id)?(Me(e)&&this.container.load(e.inversifyModule),this.loadedModules.push(e.id),{dispose:function(){n.unload(e)}}):(console.warn("Unsupported module."),{dispose:function(){}})}},{key:"unload",value:function(e){Me(e)&&(this.container.unload(e.inversifyModule),this.loadedModules=this.loadedModules.filter((function(t){return t!==e.id})))}},{key:"remove",value:function(e){return this.container.unbind(re(e))}},{key:"get",value:function(e){return this.container.get(re(e))}},{key:"getNamed",value:function(e,t){return this.container.getNamed(re(e),ne(t))}},{key:"getAll",value:function(e){return this.container.getAll(re(e))}},{key:"getAllNamed",value:function(e,t){return this.container.getAllNamed(re(e),ne(t))}},{key:"isBound",value:function(e){return this.container.isBound(re(e))}},{key:"isBoundNamed",value:function(e,t){return this.container.isBoundNamed(re(e),ne(t))}},{key:"createChild",value:function(){var e=new t(this.container.createChild());return e.parent=this,e}},{key:"register",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.Utils.isInjectOption(t)?ge.resolveOption(this.container,t):ge.resolveTarget(this.container,t,n)}}],i=[{key:"setContainer",value:function(e,t){return Fe.set(e.id,t)}},{key:"getContainer",value:function(e){var n=Fe.get(e.id);if(!n){var r=new t(e);return t.setContainer(e,r),r}return n}},{key:"config",value:function(e){ge.globalConfig=e}}],r&&Oe(n.prototype,r),i&&Oe(n,i),Object.defineProperty(n,"prototype",{writable:!1}),t}(),Ve=new Be(ie),je=Ve.register.bind(Ve),Ge=function(e){return function(t,n,r){he(e)(t,n,r),le(me)(t,n,r)}};function ze(e,t,n,r,i){He(e,t,n||0,r||e.length-1,i||Ye)}function He(e,t,n,r,i){for(;r>n;){if(r-n>600){var o=r-n+1,a=t-n+1,s=Math.log(o),u=.5*Math.exp(2*s/3),c=.5*Math.sqrt(s*u*(o-u)/o)*(0>a-o/2?-1:1);He(e,t,Math.max(n,Math.floor(t-a*u/o+c)),Math.min(r,Math.floor(t+(o-a)*u/o+c)),i)}var l=e[t],h=n,f=r;for(We(e,n,t),i(e[r],l)>0&&We(e,n,r);f>h;){for(We(e,h,f),h++,f--;0>i(e[h],l);)h++;for(;i(e[f],l)>0;)f--}0===i(e[n],l)?We(e,n,f):We(e,++f,r),f>t||(n=f+1),t>f||(r=f-1)}}function We(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function Ye(e,t){return t>e?-1:e>t?1:0}(Ie=e.Contribution||(e.Contribution={})).Provider=me,Ie.register=_e;class qe{constructor(e=9){this._maxEntries=Math.max(4,e),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}all(){return this._all(this.data,[])}search(e){let t=this.data;const n=[];if(!it(e,t))return n;const r=this.toBBox,i=[];for(;t;){for(let o=0;t.children.length>o;o++){const a=t.children[o],s=t.leaf?r(a):a;it(e,s)&&(t.leaf?n.push(a):rt(e,s)?this._all(a,n):i.push(a))}t=i.pop()}return n}collides(e){let t=this.data;if(!it(e,t))return!1;const n=[];for(;t;){for(let r=0;t.children.length>r;r++){const i=t.children[r],o=t.leaf?this.toBBox(i):i;if(it(e,o)){if(t.leaf||rt(e,o))return!0;n.push(i)}}t=n.pop()}return!1}load(e){if(!e||!e.length)return this;if(this._minEntries>e.length){for(let t=0;e.length>t;t++)this.insert(e[t]);return this}let t=this._build(e.slice(),0,e.length-1,0);if(this.data.children.length)if(this.data.height===t.height)this._splitRoot(this.data,t);else{if(t.height>this.data.height){const e=this.data;this.data=t,t=e}this._insert(t,this.data.height-t.height-1,!0)}else this.data=t;return this}insert(e){return e&&this._insert(e,this.data.height-1),this}clear(){return this.data=ot([]),this}remove(e,t){if(!e)return this;let n=this.data;const r=this.toBBox(e),i=[],o=[];let a,s,u;for(;n||i.length;){if(n||(n=i.pop(),s=i[i.length-1],a=o.pop(),u=!0),n.leaf){const r=Xe(e,n.children,t);if(-1!==r)return n.children.splice(r,1),i.push(n),this._condense(i),this}u||n.leaf||!rt(n,r)?s?(a++,n=s.children[a],u=!1):n=null:(i.push(n),o.push(a),a=0,s=n,n=n.children[0])}return this}toBBox(e){return e}compareMinX(e,t){return e.minX-t.minX}compareMinY(e,t){return e.minY-t.minY}toJSON(){return this.data}fromJSON(e){return this.data=e,this}_all(e,t){const n=[];for(;e;)e.leaf?t.push(...e.children):n.push(...e.children),e=n.pop();return t}_build(e,t,n,r){const i=n-t+1;let o,a=this._maxEntries;if(a>=i)return o=ot(e.slice(t,n+1)),Ke(o,this.toBBox),o;r||(a=Math.ceil(i/Math.pow(a,(r=Math.ceil(Math.log(i)/Math.log(a)))-1))),o=ot([]),o.leaf=!1,o.height=r;const s=Math.ceil(i/a),u=s*Math.ceil(Math.sqrt(a));at(e,t,n,u,this.compareMinX);for(let i=t;n>=i;i+=u){const t=Math.min(i+u-1,n);at(e,i,t,s,this.compareMinY);for(let n=i;t>=n;n+=s){o.children.push(this._build(e,n,Math.min(n+s-1,t),r-1))}}return Ke(o,this.toBBox),o}_chooseSubtree(e,t,n,r){for(;r.push(t),!t.leaf&&r.length-1!==n;){let n,r=1/0,a=1/0;for(let s=0;t.children.length>s;s++){const u=t.children[s],c=et(u),l=(Math.max((o=u).maxX,(i=e).maxX)-Math.min(o.minX,i.minX))*(Math.max(o.maxY,i.maxY)-Math.min(o.minY,i.minY))-c;a>l?(a=l,r=r>c?c:r,n=u):l===a&&r>c&&(r=c,n=u)}t=n||t.children[0]}var i,o;return t}_insert(e,t,n){const r=n?e:this.toBBox(e),i=[],o=this._chooseSubtree(r,this.data,t,i);for(o.children.push(e),Je(o,r);t>=0&&i[t].children.length>this._maxEntries;)this._split(i,t),t--;this._adjustParentBBoxes(r,i,t)}_split(e,t){const n=e[t],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);const o=this._chooseSplitIndex(n,i,r),a=ot(n.children.splice(o,n.children.length-o));a.height=n.height,a.leaf=n.leaf,Ke(n,this.toBBox),Ke(a,this.toBBox),t?e[t-1].children.push(a):this._splitRoot(n,a)}_splitRoot(e,t){this.data=ot([e,t]),this.data.height=e.height+1,this.data.leaf=!1,Ke(this.data,this.toBBox)}_chooseSplitIndex(e,t,n){let r,i=1/0,o=1/0;for(let a=t;n-t>=a;a++){const t=Ze(e,0,a,this.toBBox),s=Ze(e,a,n,this.toBBox),u=nt(t,s),c=et(t)+et(s);i>u?(i=u,r=a,o=o>c?c:o):u===i&&o>c&&(o=c,r=a)}return r||n-t}_chooseSplitAxis(e,t,n){const r=e.leaf?this.compareMinX:Qe,i=e.leaf?this.compareMinY:$e,o=this._allDistMargin(e,t,n,r);this._allDistMargin(e,t,n,i)>o&&e.children.sort(r)}_allDistMargin(e,t,n,r){e.children.sort(r);const i=this.toBBox,o=Ze(e,0,t,i),a=Ze(e,n-t,n,i);let s=tt(o)+tt(a);for(let r=t;n-t>r;r++){const t=e.children[r];Je(o,e.leaf?i(t):t),s+=tt(o)}for(let r=n-t-1;r>=t;r--){const t=e.children[r];Je(a,e.leaf?i(t):t),s+=tt(a)}return s}_adjustParentBBoxes(e,t,n){for(let r=n;r>=0;r--)Je(t[r],e)}_condense(e){for(let t,n=e.length-1;n>=0;n--)0===e[n].children.length?n>0?(t=e[n-1].children,t.splice(t.indexOf(e[n]),1)):this.clear():Ke(e[n],this.toBBox)}}function Xe(e,t,n){if(!n)return t.indexOf(e);for(let r=0;t.length>r;r++)if(n(e,t[r]))return r;return-1}function Ke(e,t){Ze(e,0,e.children.length,t,e)}function Ze(e,t,n,r,i){i||(i=ot(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(let o=t;n>o;o++){const t=e.children[o];Je(i,e.leaf?r(t):t)}return i}function Je(e,t){return e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),e}function Qe(e,t){return e.minX-t.minX}function $e(e,t){return e.minY-t.minY}function et(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function tt(e){return e.maxX-e.minX+(e.maxY-e.minY)}function nt(e,t){const n=Math.max(e.minX,t.minX),r=Math.max(e.minY,t.minY),i=Math.min(e.maxX,t.maxX),o=Math.min(e.maxY,t.maxY);return Math.max(0,i-n)*Math.max(0,o-r)}function rt(e,t){return!(e.minX>t.minX||e.minY>t.minY||t.maxX>e.maxX||t.maxY>e.maxY)}function it(e,t){return!(t.minX>e.maxX||t.minY>e.maxY||e.minX>t.maxX||e.minY>t.maxY)}function ot(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function at(e,t,n,r,i){const o=[t,n];for(;o.length;){if(r>=(n=o.pop())-(t=o.pop()))continue;const a=t+Math.ceil((n-t)/r/2)*r;ze(e,a,t,n,i),o.push(t,a,a,n)}}function st(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ut(e){for(var t=1;arguments.length>t;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?st(Object(n),!0).forEach((function(t){vt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):st(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ct(){
|
|
2
2
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
3
|
-
le=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},r=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",a=i.toStringTag||"@@toStringTag";function s(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,n){return t[e]=n}}function u(t,e,n,i){var r=Object.create((e&&e.prototype instanceof h?e:h).prototype),o=new w(i||[]);return r._invoke=function(t,e,n){var i="suspendedStart";return function(r,o){if("executing"===i)throw new Error("Generator is already running");if("completed"===i){if("throw"===r)throw o;return P()}for(n.method=r,n.arg=o;;){var a=n.delegate;if(a){var s=S(a,n);if(s){if(s===l)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===i)throw i="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i="executing";var u=c(t,e,n);if("normal"===u.type){if(i=n.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(i="completed",n.method="throw",n.arg=u.arg)}}}(t,n,o),r}function c(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var l={};function h(){}function p(){}function f(){}var d={};s(d,r,(function(){return this}));var y=Object.getPrototypeOf,v=y&&y(y(x([])));v&&v!==e&&n.call(v,r)&&(d=v);var g=f.prototype=h.prototype=Object.create(d);function m(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function T(t,e){function i(r,o,a,s){var u=c(t[r],t,o);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==typeof h&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){i("next",t,a,s)}),(function(t){i("throw",t,a,s)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return i("throw",t,a,s)}))}s(u.arg)}var r;this._invoke=function(t,n){function o(){return new e((function(e,r){i(t,n,e,r)}))}return r=r?r.then(o,o):o()}}function S(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,S(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var i=c(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,l;var r=i.arg;return r?r.done?(e[t.resultName]=r.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):r:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function b(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function w(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(b,this),this.reset(!0)}function x(t){if(t){var e=t[r];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function e(){for(;++i<t.length;)if(n.call(t,i))return e.value=t[i],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:P}}function P(){return{value:void 0,done:!0}}return p.prototype=f,s(g,"constructor",f),s(f,"constructor",p),p.displayName=s(f,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,f):(t.__proto__=f,s(t,a,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},m(T.prototype),s(T.prototype,o,(function(){return this})),t.AsyncIterator=T,t.async=function(e,n,i,r,o){void 0===o&&(o=Promise);var a=new T(u(e,n,i,r),o);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},m(g),s(g,a,"Generator"),s(g,r,(function(){return this})),s(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var i=e.pop();if(i in t)return n.value=i,n.done=!1,n}return n.done=!0,n}},t.values=x,w.prototype={constructor:w,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function i(n,i){return a.type="throw",a.arg=t,e.next=n,i&&(e.method="next",e.arg=void 0),!!i}for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r],a=o.completion;if("root"===o.tryLoc)return i("end");if(this.prev>=o.tryLoc){var s=n.call(o,"catchLoc"),u=n.call(o,"finallyLoc");if(s&&u){if(o.catchLoc>this.prev)return i(o.catchLoc,!0);if(o.finallyLoc>this.prev)return i(o.finallyLoc)}else if(s){if(o.catchLoc>this.prev)return i(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(o.finallyLoc>this.prev)return i(o.finallyLoc)}}}},abrupt:function(t,e){for(var i=this.tryEntries.length-1;i>=0;--i){var r=this.tryEntries[i];if(this.prev>=r.tryLoc&&n.call(r,"finallyLoc")&&r.finallyLoc>this.prev){var o=r;break}}o&&("break"===t||"continue"===t)&&e>=o.tryLoc&&o.finallyLoc>=e&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,l):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),l},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),E(n),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var i=n.completion;if("throw"===i.type){var r=i.arg;E(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:x(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),l}},t}function he(t,e,n,i,r,o,a){try{var s=t[o](a),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(i,r)}function pe(t){return function(){var e=this,n=arguments;return new Promise((function(i,r){var o=t.apply(e,n);function a(t){he(o,i,r,a,s,"next",t)}function s(t){he(o,i,r,a,s,"throw",t)}a(void 0)}))}}function fe(t,e){for(var n=0;e.length>n;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function de(t,e,n){return e&&fe(t.prototype,e),n&&fe(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function ye(){return ye=Object.assign||function(t){for(var e=1;arguments.length>e;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},ye.apply(this,arguments)}function ve(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,ge(t,e)}function ge(t,e){return ge=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},ge(t,e)}function me(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function Te(t,e,n){return Te=me()?Reflect.construct:function(t,e,n){var i=[null];i.push.apply(i,e);var r=new(Function.bind.apply(t,i));return n&&ge(r,n.prototype),r},Te.apply(null,arguments)}function Se(t,e){if(null==t)return{};var n,i,r={},o=Object.keys(t);for(i=0;o.length>i;i++)0>e.indexOf(n=o[i])&&(r[n]=t[n]);return r}function be(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ee(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);e>n;n++)i[n]=t[n];return i}function we(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Ee(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ee(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0;return function(){return t.length>i?{done:!1,value:t[i++]}:{done:!0}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(Rt=t.LayoutTaskType||(t.LayoutTaskType={})).Layout="layout",Rt.IntrinsicSizes="intrinsic-sizes",function(t){t[t.block=0]="block",t[t.normal=1]="normal"}(Lt||(Lt={})),function(t){t[t["block-like"]=0]="block-like",t[t.manual=1]="manual"}(Dt||(Dt={})),(Ut=t.PropertyName||(t.PropertyName={})).LAYOUT="display",Ut.LEFT="left",Ut.TOP="top",Ut.BOTTOM="bottom",Ut.RIGHT="right",Ut.WIDTH="width",Ut.HEIGHT="height",Ut.MIN_WIDTH="minWidth",Ut.MAX_WIDTH="maxWidth",Ut.MIN_HEIGHT="minHeight",Ut.MAX_HEIGHT="maxHeight",Ut.BOX_SIZING="boxSizing",Ut.PADDING="padding",Ut.PADDING_TOP="paddingTop",Ut.PADDING_BOTTOM="paddingBottom",Ut.PADDING_START="paddingLeft",Ut.PADDING_END="paddingRight",Ut.MARGIN="margin",Ut.MARGIN_TOP="marginTop",Ut.MARGIN_BOTTOM="marginBottom",Ut.MARGIN_START="marginLeft",Ut.MARGIN_END="marginRight",Ut.BORDER="border",Ut.BORDER_TOP="borderTop",Ut.BORDER_BOTTOM="borderBottom",Ut.BORDER_START="borderLeft",Ut.BORDER_END="borderRight",Ut.FLEX_DIRECTION="flexDirection",Ut.FLEX_WRAP="flexWrap",Ut.FLEX_FLOW="flexFlow",Ut.ALIGN_ITEMS="alignItems",Ut.ALIGN_CONTENT="alignContent",Ut.JUSTIFY_CONTENT="justifyContent",Ut.FLEX="flex",Ut.ALIGN_SELF="alignSelf",Ut.FLEX_SHRINK="flexShrink",Ut.FLEX_BASIS="flexBasis",Ut.FLEX_GROW="flexGrow",Ut.OFFSET_WIDTH="offsetWidth",Ut.OFFSET_HEIGHT="offsetHeight",Ut.ORDER="order";var xe=1,Pe=function(){function e(t){void 0===t&&(t=new Map),this.id=void 0,this.style=void 0,this.dirty=void 0,this.parent=void 0,this.children=void 0,this.internalIntrisicSizes=void 0,this.computedLayout=void 0,this.measureFn=void 0,this.id=xe++,this.style=t,this.parent=void 0,this.children=[],this.dirty=!1}var n=e.prototype;return n.setMeasure=function(t){this.measureFn=t},n.setIntrisicSizes=function(t){this.internalIntrisicSizes=t},n.addChild=function(t){var e;null===(e=this.children)||void 0===e||e.push(t)},n.insertChild=function(t,e){this.children.splice(t,0,e)},n.removeChild=function(t){var e,n=null===(e=this.children)||void 0===e?void 0:e.findIndex((function(e){return e.id===t.id}));this.removeChildAtIndex(n)},n.removeChildAtIndex=function(t){this.children.splice(t,1)},n.replaceChildAtIndex=function(t,e){this.children.splice(t,1,e)},n.setStyle=function(t,e){this.style.set(t,e)},n.getStyle=function(){for(var t=this,e=new Map,n=arguments.length,i=new Array(n),r=0;n>r;r++)i[r]=arguments[r];return i.forEach((function(n){var i=t.style.get(n);i&&e.set(n,i)})),e},n.getAllStyle=function(){return this.style},n.markDirty=function(){this.dirty=!0},n.idDirty=function(){return this.dirty},n.getSize=function(){var e,n,i,r;return{width:null!==(e=null===(n=this.style.get(t.PropertyName.WIDTH))||void 0===n?void 0:n.value)&&void 0!==e?e:0,height:null!==(i=null===(r=this.style.get(t.PropertyName.HEIGHT))||void 0===r?void 0:r.value)&&void 0!==i?i:0}},n.computeLayout=function(){var t=pe(le().mark((function t(){var e;return le().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.getSize(),t.next=3,ml.computeLayout(this,{availableInlineSize:e.width,availableBlockSize:e.height,fixedInlineSize:e.width,fixedBlockSize:e.height,percentageInlineSize:e.width,percentageBlockSize:e.height,data:void 0});case 3:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}(),n.setComputedLayout=function(t){this.computedLayout=t},n.getComputedLayout=function(){return this.computedLayout},n.getAllComputedLayout=function(){},n.toString=function(){return"LayoutObject "+this.id},de(e,[{key:"intrisicSizes",get:function(){return this.internalIntrisicSizes}},{key:"childCount",get:function(){return this.children.length}}]),e}(),ke=t.Syringe.defineToken("LayoutContextFactory"),Ce=t.Syringe.defineToken("LayoutContextOptions"),Ne=0;t.LayoutContext=function(){function t(t){this.options=void 0,this.contextId=void 0,this.workQueue=[],this.mode=void 0,this.layoutChildrenFactory=void 0,this.fragmentResultFactory=void 0,this.layoutFragmentFactory=void 0,this.options=t,this.contextId=""+Ne++,this.mode=t.mode,this.layoutChildrenFactory=t.layoutChildrenFactory,this.fragmentResultFactory=t.fragmentResultFactory,this.layoutFragmentFactory=t.layoutFragmentFactory}var e=t.prototype;return e.appendWorkTask=function(t){this.workQueue.push(t)},e.clearWorkQueue=function(){this.workQueue=[]},t}(),t.LayoutContext=se([ct(),ue(0,lt(Ce)),ce("design:paramtypes",[Object])],t.LayoutContext);var _e=t.Syringe.defineToken("FragmentResultFactory"),Me=t.Syringe.defineToken("FragmentResultOptions"),Ae=t.Syringe.defineToken("contextNode");function Oe(t){if(!t)throw new Error}function Ie(t,e){if(t!==e)throw new Error}function Re(t,e){if(t===e)throw new Error}function Le(t){return void 0===t}function De(t){return null==t}function Ue(t){return"number"==typeof t}function Fe(t){return"function"==typeof t}function Be(t){return"boolean"==typeof t}function Ve(t){return"[object Object]"===Object.prototype.toString.call(t)}t.FragmentResult=function(t,e,n){this._layoutContext=void 0,this._node=void 0,this.options=void 0,this.layoutContext=void 0,this.inlineSize=void 0,this.blockSize=void 0,this.node=void 0,this.childFragments=void 0,this.data=void 0,this._layoutContext=t,this._node=e,this.options=n,this.layoutContext=t,this.inlineSize=null==n?void 0:n.inlineSize,this.blockSize=null==n?void 0:n.blockSize,this.childFragments=null==n?void 0:n.childFragments,this.data=n.data,this.node=e},t.FragmentResult=se([ut(),ue(0,lt(t.LayoutContext)),ue(1,lt(Ae)),ue(2,lt(Me)),ce("design:paramtypes",[t.LayoutContext,Pe,Object])],t.FragmentResult);var Ge={},je=0;function He(t,e){if(t){var n="string"==typeof t?t:t.id||je++;Ge[n]&&Ge[n].destroy(),Ge[n]=e}}var ze="undefined"!=typeof window&&void 0!==window.document,We=.1,Ye="function"==typeof Float32Array,qe=function(t,e){return 1-3*e+3*t},Xe=function(t,e){return 3*e-6*t},Ke=function(t){return 3*t},Ze=function(t,e,n){return((qe(e,n)*t+Xe(e,n))*t+Ke(e))*t},Je=function(t,e,n){return 3*qe(e,n)*t*t+2*Xe(e,n)*t+Ke(e)},Qe=function(t,e,n,i){if(0>t||t>1||0>n||n>1)throw new Error("bezier x values must be in [0, 1] range");if(t===e&&n===i)return function(t){return t};for(var r=Ye?new Float32Array(11):new Array(11),o=0;11>o;++o)r[o]=Ze(o*We,t,n);var a=function(e){for(var i=0,o=1;10!==o&&e>=r[o];++o)i+=We;--o;var a=i+(e-r[o])/(r[o+1]-r[o])*We,s=Je(a,t,n);return.001>s?0===s?a:function(t,e,n,i,r){var o,a,s=0;do{(o=Ze(a=e+(n-e)/2,i,r)-t)>0?n=a:e=a}while(Math.abs(o)>1e-7&&10>++s);return a}(e,i,i+We,t,n):function(t,e,n,i){for(var r=0;4>r;++r){var o=Je(e,n,i);if(0===o)return e;e-=(Ze(e,n,i)-t)/o}return e}(e,a,t,n)};return function(t){return 0===t||1===t?t:Ze(a(t),e,i)}},$e=1e-6,tn="undefined"!=typeof Float32Array?Float32Array:Array;function en(){var t=new tn(9);return tn!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function nn(){var t=new tn(16);return tn!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function rn(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function on(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function an(t,e){var n=e[0],i=e[1],r=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],l=e[8],h=e[9],p=e[10],f=e[11],d=e[12],y=e[13],v=e[14],g=e[15],m=n*s-i*a,T=n*u-r*a,S=n*c-o*a,b=i*u-r*s,E=i*c-o*s,w=r*c-o*u,x=l*y-h*d,P=l*v-p*d,k=l*g-f*d,C=h*v-p*y,N=h*g-f*y,_=p*g-f*v,M=m*_-T*N+S*C+b*k-E*P+w*x;return M?(t[0]=(s*_-u*N+c*C)*(M=1/M),t[1]=(r*N-i*_-o*C)*M,t[2]=(y*w-v*E+g*b)*M,t[3]=(p*E-h*w-f*b)*M,t[4]=(u*k-a*_-c*P)*M,t[5]=(n*_-r*k+o*P)*M,t[6]=(v*S-d*w-g*T)*M,t[7]=(l*w-p*S+f*T)*M,t[8]=(a*N-s*k+c*x)*M,t[9]=(i*k-n*N-o*x)*M,t[10]=(d*E-y*S+g*m)*M,t[11]=(h*S-l*E-f*m)*M,t[12]=(s*P-a*C-u*x)*M,t[13]=(n*C-i*P+r*x)*M,t[14]=(y*T-d*b-v*m)*M,t[15]=(l*b-h*T+p*m)*M,t):null}function sn(t,e,n){var i=e[0],r=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],h=e[8],p=e[9],f=e[10],d=e[11],y=e[12],v=e[13],g=e[14],m=e[15],T=n[0],S=n[1],b=n[2],E=n[3];return t[0]=T*i+S*s+b*h+E*y,t[1]=T*r+S*u+b*p+E*v,t[2]=T*o+S*c+b*f+E*g,t[3]=T*a+S*l+b*d+E*m,t[4]=(T=n[4])*i+(S=n[5])*s+(b=n[6])*h+(E=n[7])*y,t[5]=T*r+S*u+b*p+E*v,t[6]=T*o+S*c+b*f+E*g,t[7]=T*a+S*l+b*d+E*m,t[8]=(T=n[8])*i+(S=n[9])*s+(b=n[10])*h+(E=n[11])*y,t[9]=T*r+S*u+b*p+E*v,t[10]=T*o+S*c+b*f+E*g,t[11]=T*a+S*l+b*d+E*m,t[12]=(T=n[12])*i+(S=n[13])*s+(b=n[14])*h+(E=n[15])*y,t[13]=T*r+S*u+b*p+E*v,t[14]=T*o+S*c+b*f+E*g,t[15]=T*a+S*l+b*d+E*m,t}function un(t,e,n){var i,r,o,a,s,u,c,l,h,p,f,d,y=n[0],v=n[1],g=n[2];return e===t?(t[12]=e[0]*y+e[4]*v+e[8]*g+e[12],t[13]=e[1]*y+e[5]*v+e[9]*g+e[13],t[14]=e[2]*y+e[6]*v+e[10]*g+e[14],t[15]=e[3]*y+e[7]*v+e[11]*g+e[15]):(r=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],h=e[8],p=e[9],f=e[10],d=e[11],t[0]=i=e[0],t[1]=r,t[2]=o,t[3]=a,t[4]=s,t[5]=u,t[6]=c,t[7]=l,t[8]=h,t[9]=p,t[10]=f,t[11]=d,t[12]=i*y+s*v+h*g+e[12],t[13]=r*y+u*v+p*g+e[13],t[14]=o*y+c*v+f*g+e[14],t[15]=a*y+l*v+d*g+e[15]),t}function cn(t,e,n){var i=n[0],r=n[1],o=n[2];return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function ln(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function hn(t,e){var n=e[4],i=e[5],r=e[6],o=e[8],a=e[9],s=e[10];return t[0]=Math.hypot(e[0],e[1],e[2]),t[1]=Math.hypot(n,i,r),t[2]=Math.hypot(o,a,s),t}function pn(t,e){var n=new tn(3);hn(n,e);var i=1/n[0],r=1/n[1],o=1/n[2],a=e[0]*i,s=e[1]*r,u=e[2]*o,c=e[4]*i,l=e[5]*r,h=e[6]*o,p=e[8]*i,f=e[9]*r,d=e[10]*o,y=a+l+d,v=0;return y>0?(v=2*Math.sqrt(y+1),t[3]=.25*v,t[0]=(h-f)/v,t[1]=(p-u)/v,t[2]=(s-c)/v):a>l&&a>d?(v=2*Math.sqrt(1+a-l-d),t[3]=(h-f)/v,t[0]=.25*v,t[1]=(s+c)/v,t[2]=(p+u)/v):l>d?(v=2*Math.sqrt(1+l-a-d),t[3]=(p-u)/v,t[0]=(s+c)/v,t[1]=.25*v,t[2]=(h+f)/v):(v=2*Math.sqrt(1+d-a-l),t[3]=(s-c)/v,t[0]=(p+u)/v,t[1]=(h+f)/v,t[2]=.25*v),t}function fn(t,e,n,i,r){var o=e[0],a=e[1],s=e[2],u=e[3],c=o+o,l=a+a,h=s+s,p=o*c,f=o*l,d=o*h,y=a*l,v=a*h,g=s*h,m=u*c,T=u*l,S=u*h,b=i[0],E=i[1],w=i[2],x=r[0],P=r[1],k=r[2],C=(1-(y+g))*b,N=(f+S)*b,_=(d-T)*b,M=(f-S)*E,A=(1-(p+g))*E,O=(v+m)*E,I=(d+T)*w,R=(v-m)*w,L=(1-(p+y))*w;return t[0]=C,t[1]=N,t[2]=_,t[3]=0,t[4]=M,t[5]=A,t[6]=O,t[7]=0,t[8]=I,t[9]=R,t[10]=L,t[11]=0,t[12]=n[0]+x-(C*x+M*P+I*k),t[13]=n[1]+P-(N*x+A*P+R*k),t[14]=n[2]+k-(_*x+O*P+L*k),t[15]=1,t}function dn(t,e){var n=e[0],i=e[1],r=e[2],o=e[3],a=n+n,s=i+i,u=r+r,c=n*a,l=i*a,h=i*s,p=r*a,f=r*s,d=r*u,y=o*a,v=o*s,g=o*u;return t[0]=1-h-d,t[1]=l+g,t[2]=p-v,t[3]=0,t[4]=l-g,t[5]=1-c-d,t[6]=f+y,t[7]=0,t[8]=p+v,t[9]=f-y,t[10]=1-c-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var yn=function(t,e,n,i,r,o,a){var s=1/(e-n),u=1/(i-r),c=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+n)*s,t[13]=(r+i)*u,t[14]=(a+o)*c,t[15]=1,t};function vn(){var t=new tn(3);return tn!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function gn(t){var e=new tn(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function mn(t){return Math.hypot(t[0],t[1],t[2])}function Tn(t,e,n){var i=new tn(3);return i[0]=t,i[1]=e,i[2]=n,i}function Sn(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function bn(t,e,n,i){return t[0]=e,t[1]=n,t[2]=i,t}function En(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function wn(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function xn(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t}function Pn(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function kn(t,e,n,i){return t[0]=e[0]+n[0]*i,t[1]=e[1]+n[1]*i,t[2]=e[2]+n[2]*i,t}function Cn(t,e){var n=e[0],i=e[1],r=e[2],o=n*n+i*i+r*r;return o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t}function Nn(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function _n(t,e,n){var i=e[0],r=e[1],o=e[2],a=n[0],s=n[1],u=n[2];return t[0]=r*u-o*s,t[1]=o*a-i*u,t[2]=i*s-r*a,t}function Mn(t,e,n,i){var r=e[0],o=e[1],a=e[2];return t[0]=r+i*(n[0]-r),t[1]=o+i*(n[1]-o),t[2]=a+i*(n[2]-a),t}function An(t,e,n){var i=e[0],r=e[1],o=e[2],a=n[3]*i+n[7]*r+n[11]*o+n[15];return t[0]=(n[0]*i+n[4]*r+n[8]*o+n[12])/(a=a||1),t[1]=(n[1]*i+n[5]*r+n[9]*o+n[13])/a,t[2]=(n[2]*i+n[6]*r+n[10]*o+n[14])/a,t}function On(t,e){var n=t[0],i=t[1],r=t[2],o=e[0],a=e[1],s=e[2];return Math.abs(n-o)<=$e*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(i-a)<=$e*Math.max(1,Math.abs(i),Math.abs(a))&&Math.abs(r-s)<=$e*Math.max(1,Math.abs(r),Math.abs(s))}var In,Rn=wn,Ln=xn,Dn=function(t,e){return Math.hypot(e[0]-t[0],e[1]-t[1],e[2]-t[2])},Un=mn;In=vn();function Fn(){var t=new tn(4);return tn!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function Bn(t,e,n){var i=e[0],r=e[1],o=e[2],a=e[3];return t[0]=n[0]*i+n[4]*r+n[8]*o+n[12]*a,t[1]=n[1]*i+n[5]*r+n[9]*o+n[13]*a,t[2]=n[2]*i+n[6]*r+n[10]*o+n[14]*a,t[3]=n[3]*i+n[7]*r+n[11]*o+n[15]*a,t}!function(){var t=Fn()}();function Vn(){var t=new tn(4);return tn!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function Gn(t,e,n){n*=.5;var i=Math.sin(n);return t[0]=i*e[0],t[1]=i*e[1],t[2]=i*e[2],t[3]=Math.cos(n),t}function jn(t,e,n){var i=e[0],r=e[1],o=e[2],a=e[3],s=n[0],u=n[1],c=n[2],l=n[3];return t[0]=i*l+a*s+r*c-o*u,t[1]=r*l+a*u+o*s-i*c,t[2]=o*l+a*c+i*u-r*s,t[3]=a*l-i*s-r*u-o*c,t}function Hn(t,e,n,i){var r,o,a,s,u,c=e[0],l=e[1],h=e[2],p=e[3],f=n[0],d=n[1],y=n[2],v=n[3];return 0>(o=c*f+l*d+h*y+p*v)&&(o=-o,f=-f,d=-d,y=-y,v=-v),1-o>$e?(r=Math.acos(o),a=Math.sin(r),s=Math.sin((1-i)*r)/a,u=Math.sin(i*r)/a):(s=1-i,u=i),t[0]=s*c+u*f,t[1]=s*l+u*d,t[2]=s*h+u*y,t[3]=s*p+u*v,t}function zn(t,e){var n=e[0],i=e[1],r=e[2],o=e[3],a=n*n+i*i+r*r+o*o,s=a?1/a:0;return t[0]=-n*s,t[1]=-i*s,t[2]=-r*s,t[3]=o*s,t}function Wn(t,e,n,i){var r=.5*Math.PI/180;e*=r,n*=r,i*=r;var o=Math.sin(e),a=Math.cos(e),s=Math.sin(n),u=Math.cos(n),c=Math.sin(i),l=Math.cos(i);return t[0]=o*u*l-a*s*c,t[1]=a*s*l+o*u*c,t[2]=a*u*c-o*s*l,t[3]=a*u*l+o*s*c,t}var Yn,qn,Xn,Kn,Zn,Jn,Qn=function(t,e,n,i){var r=new tn(4);return r[0]=t,r[1]=e,r[2]=n,r[3]=i,r},$n=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},ti=jn,ei=function(t,e){var n=e[0],i=e[1],r=e[2],o=e[3],a=n*n+i*i+r*r+o*o;return a>0&&(a=1/Math.sqrt(a)),t[0]=n*a,t[1]=i*a,t[2]=r*a,t[3]=o*a,t};Yn=vn(),qn=Tn(1,0,0),Xn=Tn(0,1,0),Kn=Vn(),Zn=Vn(),Jn=en();!function(){var t,e=(t=new tn(2),tn!=Float32Array&&(t[0]=0,t[1]=0),t)}();function ni(t,e,n){return n?Math.min(t,e)===t?e:Math.max(t,n)===t?n:t:Math.max(t,e)===e?t:e}function ii(t){return void 0===t?0:t>360||-360>t?t%360:t}function ri(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Ue(t)?Tn(t,e,n):Array.isArray(t)&&3===t.length?gn(t):Tn(t[0],t[1]||e,t[2]||n)}function oi(t){return t*(180/Math.PI)}function ai(t){return 360*t}function si(t,e){return 16===e.length?function(t,e){var n,i,r=.5*Math.PI,o=hn(vn(),e),a=o[0],s=o[1],u=o[2],c=Math.asin(-e[2]/a);return r>c?c>-r?(n=Math.atan2(e[6]/s,e[10]/u),i=Math.atan2(e[1]/a,e[0]/a)):(i=0,n=-Math.atan2(e[4]/s,e[5]/s)):(i=0,n=Math.atan2(e[4]/s,e[5]/s)),t[0]=n,t[1]=c,t[2]=i,t}(t,e):function(t,e){var n=e[0],i=e[1],r=e[2],o=e[3],a=i*i,s=r*r,u=o*o,c=n*n+a+s+u,l=n*o-i*r;return l>.499995*c?(t[0]=Math.PI/2,t[1]=2*Math.atan2(i,n),t[2]=0):-.499995*c>l?(t[0]=-Math.PI/2,t[1]=2*Math.atan2(i,n),t[2]=0):(t[0]=Math.asin(2*(n*r-o*i)),t[1]=Math.atan2(2*(n*o+i*r),1-2*(s+u)),t[2]=Math.atan2(2*(n*i+r*o),1-2*(a+s))),t}(t,e)}function ui(t,e,n,i,r){var o,a,s,u,c,l,h,p,f,d,y=Math.cos(t),v=Math.sin(t);return o=i*y,a=r*v,s=0,u=-i*v,c=r*y,l=0,h=e,p=n,f=1,(d=new tn(9))[0]=o,d[1]=a,d[2]=s,d[3]=u,d[4]=c,d[5]=l,d[6]=h,d[7]=p,d[8]=f,d}function ci(t,e,n,i,r,o,a){var s=2*o/(i-r),u=(n+e)/(n-e),c=(i+r)/(i-r),l=-(a+o)/(a-o),h=-2*a*o/(a-o);return t[0]=2*o/(n-e),t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=s,t[6]=0,t[7]=0,t[8]=u,t[9]=c,t[10]=l,t[11]=-1,t[12]=0,t[13]=0,t[14]=h,t[15]=0,t}function li(t){var e=t[0],n=t[1],i=t[3],r=t[4],o=Math.sqrt(e*e+n*n),a=Math.sqrt(i*i+r*r);0>e*r-n*i&&(r>e?o=-o:a=-a),o&&(e*=1/o,n*=1/o),a&&(i*=1/a,r*=1/a);var s=oi(Math.atan2(n,e));return[t[6],t[7],o,a,s]}var hi=function(t){return"-"===(t=t.replace(/([A-Z])/g,(function(t){return"-"+t.toLowerCase()}))).charAt(0)?t.substr(1):t},pi=function(t){return Math.pow(t,2)},fi=function(t){return Math.pow(t,3)},di=function(t){return Math.pow(t,4)},yi=function(t){return Math.pow(t,5)},vi=function(t){return Math.pow(t,6)},gi=function(t){return 1-Math.cos(t*Math.PI/2)},mi=function(t){return 1-Math.sqrt(1-t*t)},Ti=function(t){return t*t*(3*t-2)},Si=function(t){for(var e,n=4;t<((e=Math.pow(2,--n))-1)/11;);return 1/Math.pow(4,3-n)-7.5625*Math.pow((3*e-2)/22-t,2)},bi=function(t,e){void 0===e&&(e=[]);var n=e[0],i=e[1],r=void 0===i?.5:i,o=ni(Number(void 0===n?1:n),1,10),a=ni(Number(r),.1,2);return 0===t||1===t?t:-o*Math.pow(2,10*(t-1))*Math.sin((t-1-a/(2*Math.PI)*Math.asin(1/o))*(2*Math.PI)/a)},Ei=function(t,e,n){void 0===e&&(e=[]);var i=e[0],r=void 0===i?1:i,o=e[1],a=void 0===o?100:o,s=e[2],u=void 0===s?10:s,c=e[3],l=void 0===c?0:c;r=ni(r,.1,1e3),a=ni(a,.1,1e3),u=ni(u,.1,1e3),l=ni(l,.1,1e3);var h=Math.sqrt(a/r),p=u/(2*Math.sqrt(a*r)),f=1>p?h*Math.sqrt(1-p*p):0,d=1>p?(p*h-l)/f:-l+h,y=n?n*t/1e3:t;return y=1>p?Math.exp(-y*p*h)*(1*Math.cos(f*y)+d*Math.sin(f*y)):(1+d*y)*Math.exp(-y*h),0===t||1===t?t:1-y},wi=function(t,e){void 0===e&&(e=[]);var n=e[0],i=void 0===n?10:n;return("start"==e[1]?Math.ceil:Math.floor)(ni(t,0,1)*i)/i},xi=function(t,e){void 0===e&&(e=[]);return Qe(e[0],e[1],e[2],e[3])(t)},Pi=Qe(.42,0,1,1),ki=function(t){return function(e,n,i){return void 0===n&&(n=[]),1-t(1-e,n,i)}},Ci=function(t){return function(e,n,i){return void 0===n&&(n=[]),.5>e?t(2*e,n,i)/2:1-t(-2*e+2,n,i)/2}},Ni=function(t){return function(e,n,i){return void 0===n&&(n=[]),.5>e?(1-t(1-2*e,n,i))/2:(t(2*e-1,n,i)+1)/2}},_i={steps:wi,"step-start":function(t){return wi(t,[1,"start"])},"step-end":function(t){return wi(t,[1,"end"])},linear:function(t){return t},"cubic-bezier":xi,ease:function(t){return xi(t,[.25,.1,.25,1])},in:Pi,out:ki(Pi),"in-out":Ci(Pi),"out-in":Ni(Pi),"in-quad":pi,"out-quad":ki(pi),"in-out-quad":Ci(pi),"out-in-quad":Ni(pi),"in-cubic":fi,"out-cubic":ki(fi),"in-out-cubic":Ci(fi),"out-in-cubic":Ni(fi),"in-quart":di,"out-quart":ki(di),"in-out-quart":Ci(di),"out-in-quart":Ni(di),"in-quint":yi,"out-quint":ki(yi),"in-out-quint":Ci(yi),"out-in-quint":Ni(yi),"in-expo":vi,"out-expo":ki(vi),"in-out-expo":Ci(vi),"out-in-expo":Ni(vi),"in-sine":gi,"out-sine":ki(gi),"in-out-sine":Ci(gi),"out-in-sine":Ni(gi),"in-circ":mi,"out-circ":ki(mi),"in-out-circ":Ci(mi),"out-in-circ":Ni(mi),"in-back":Ti,"out-back":ki(Ti),"in-out-back":Ci(Ti),"out-in-back":Ni(Ti),"in-bounce":Si,"out-bounce":ki(Si),"in-out-bounce":Ci(Si),"out-in-bounce":Ni(Si),"in-elastic":bi,"out-elastic":ki(bi),"in-out-elastic":Ci(bi),"out-in-elastic":Ni(bi),spring:Ei,"spring-in":Ei,"spring-out":ki(Ei),"spring-in-out":Ci(Ei),"spring-out-in":Ni(Ei)},Mi=function(t){return _i[function(t){return hi(t).replace(/^ease-/,"").replace(/(\(|\s).+/,"").toLowerCase().trim()}(t)]||_i.linear},Ai=function(t){if(t.isRejected||t.isFulfilled)return t;var e,n=!0,i=!1,r=!1,o=t.then((function(t){return r=!0,n=!1,e=t,t}),(function(t){throw i=!0,n=!1,t}));return o.isFulfilled=function(){return r},o.isPending=function(){return n},o.isRejected=function(){return i},o.getFullFilledValue=function(){return e},o},Oi=function(){var t=this;this.resolve=void 0,this.reject=void 0,this.promise=new Promise((function(e,n){t.resolve=e,t.reject=n}))},Ii={keys:Object.keys,values:Object.values,entries:Object.entries};function Ri(t,e){if(ze)return document.defaultView.getComputedStyle(t,null).getPropertyValue(e)}function Li(t){var e=Ri(t,"width");return"auto"===e?t.offsetWidth:parseFloat(e)}function Di(t){var e=Ri(t,"height");return"auto"===e?t.offsetHeight:parseFloat(e)}var Ui,Fi={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"};(Ui=t.PropertySyntax||(t.PropertySyntax={})).COORDINATE="<coordinate>",Ui.COLOR="<color>",Ui.PAINT="<paint>",Ui.NUMBER="<number>",Ui.ANGLE="<angle>",Ui.OPACITY_VALUE="<opacity-value>",Ui.SHADOW_BLUR="<shadow-blur>",Ui.LENGTH="<length>",Ui.PERCENTAGE="<percentage>",Ui.LENGTH_PERCENTAGE="<length> | <percentage>",Ui.LENGTH_PERCENTAGE_12="[<length> | <percentage>]{1,2}",Ui.LENGTH_PERCENTAGE_14="[<length> | <percentage>]{1,4}",Ui.LIST_OF_POINTS="<list-of-points>",Ui.PATH="<path>",Ui.FILTER="<filter>",Ui.Z_INDEX="<z-index>",Ui.OFFSET_PATH="<offset-path>",Ui.OFFSET_DISTANCE="<offset-distance>",Ui.CLIP_PATH="<clip-path>",Ui.TRANSFORM="<transform>",Ui.TRANSFORM_ORIGIN="<transform-origin>",Ui.TEXT="<text>",Ui.TEXT_TRANSFORM="<text-transform>";var Bi=t.Syringe.defineToken("StyleValueRegistry"),Vi=function(t){return t};function Gi(t,e){return function(n){if(n>=1)return 1;var i=1/t;return(n+=e*i)-n%i}}var ji="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",Hi=new RegExp("cubic-bezier\\("+ji+","+ji+","+ji+","+ji+"\\)"),zi=/steps\(\s*(\d+)\s*\)/,Wi=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/;function Yi(t){var e=Hi.exec(t);if(e)return Qe.apply(void 0,e.slice(1).map(Number));var n=zi.exec(t);if(n)return Gi(Number(n[1]),0);var i=Wi.exec(t);return i?Gi(Number(i[1]),{start:1,middle:.5,end:0}[i[2]]):Mi(t)}function qi(t){return Math.abs(function(t){var e;if(0===t.duration||0===t.iterations)return 0;return("auto"===t.duration?0:Number(t.duration))*(null!==(e=t.iterations)&&void 0!==e?e:1)}(t)/(t.playbackRate||1))}function Xi(t,e,n){var i=function(t,e,n){if(null===e)return 0;var i=n.endTime;return e<Math.min(n.delay,i)?1:e<Math.min(n.delay+t+n.endDelay,i)?3:2}(t,e,n),r=function(t,e,n,i,r){switch(i){case 1:return"backwards"===e||"both"===e?0:null;case 3:return n-r;case 2:return"forwards"===e||"both"===e?t:null;case 0:return null}}(t,n.fill,e,i,n.delay);if(null===r)return null;var o="auto"===n.duration?0:n.duration,a=function(t,e,n,i,r){var o=r;return 0===t?1!==e&&(o+=n):o+=i/t,o}(o,i,n.iterations,r,n.iterationStart),s=function(t,e,n,i,r,o){var a=t===1/0?e%1:t%1;return 0!==a||2!==n||0===i||0===r&&0!==o||(a=1),a}(a,n.iterationStart,i,n.iterations,r,o),u=function(t,e,n,i){return 2===t&&e===1/0?1/0:1===n?Math.floor(i)-1:Math.floor(i)}(i,n.iterations,s,a),c=function(t,e,n){var i=t;if("normal"!==t&&"reverse"!==t){var r=e;"alternate-reverse"===t&&(r+=1),i="normal",r!==1/0&&r%2!=0&&(i="reverse")}return"normal"===i?n:1-n}(n.direction,u,s);return n.currentIteration=u,n.progress=c,n.easingFunction(c)}var Ki={};function Zi(t){return void 0===t&&(t=""),Ki[t]||(Ki[t]=t.replace(/-([a-z])/g,(function(t){return t[1].toUpperCase()}))),Ki[t]}function Ji(t){return!De(t)&&"string"==typeof t}function Qi(t,e,n){var i=function(t,e){for(var n={},i=0;t.length>i;i++)for(var r in t[i])if($i(r)){var o={offset:t[i].offset,computedOffset:t[i].computedOffset,easing:t[i].easing,easingFunction:Yi(t[i].easing)||e.easingFunction,value:t[i][r]};n[r]=n[r]||[],n[r].push(o)}return n}(t,e),r=function(t,e){var n=[];for(var i in t)for(var r=t[i],o=0;r.length-1>o;o++){var a=o,s=o+1,u=r[a].computedOffset,c=r[s].computedOffset,l=u,h=c;0===o&&(l=-1/0,0===c&&(s=a)),o===r.length-2&&(h=1/0,1===u&&(a=s)),n.push({applyFrom:l,applyTo:h,startOffset:r[a].computedOffset,endOffset:r[s].computedOffset,easingFunction:r[a].easingFunction,property:i,interpolation:er(i,r[a].value,r[s].value,e)})}return n.sort((function(t,e){return t.startOffset-e.startOffset})),n}(i,n);return function(t,e){if(null!==e)r.filter((function(t){return e>=t.applyFrom&&t.applyTo>e})).forEach((function(n){var i=n.endOffset-n.startOffset,r=0===i?0:n.easingFunction((e-n.startOffset)/i);t.style[n.property]=n.interpolation(r)}));else for(var n in i)$i(n)&&(t.style[n]=null)}}function $i(t){return"offset"!==t&&"easing"!==t&&"composite"!==t&&"computedOffset"!==t}var tr=function(t,e,n){return function(i){return n(nr(t,e,i))}};function er(t,e,n,i){var r=e,o=n,a=Vt.get(Bi),s=a.getMetadata(t);if(s&&s.syntax&&s.interpolable){var u=a.getPropertySyntax(s.syntax);if(u){u.parser&&(r=u.parser(e,i),o=u.parser(n,i));var c=u.mixer(r,o,i);if(c){var l=tr.apply(void 0,c);return function(t){return 0===t?e:1===t?n:l(t)}}}}return tr(!1,!0,(function(t){return t?n:e}))}function nr(t,e,n){if("number"==typeof t&&"number"==typeof e)return t*(1-n)+e*n;if("boolean"==typeof t&&"boolean"==typeof e||"string"==typeof t&&"string"==typeof e)return.5>n?t:e;if(Array.isArray(t)&&Array.isArray(e)&&t.length===e.length){for(var i=[],r=0;t.length>r;r++)i.push(nr(t[r],e[r],n));return i}throw new Error("Mismatched interpolation arguments "+t+":"+e)}var ir={d:{alias:"path"},strokeDasharray:{alias:"lineDash"},strokeWidth:{alias:"lineWidth"},textAnchor:{alias:"textAlign",values:{middle:"center"}},src:{alias:"img"}};function rr(t,e){var n,i=Zi(t),r=ir[i];return[i=(null==r?void 0:r.alias)||i,(null==r||null===(n=r.values)||void 0===n?void 0:n[e])||e]}function or(t,e,n,i){var r=t-n,o=e-i;return Math.sqrt(r*r+o*o)}function ar(t,e){return.001>Math.abs(t-e)}function sr(t,e){var n=Math.min.apply(Math,t),i=Math.min.apply(Math,e);return{x:n,y:i,width:Math.max.apply(Math,t)-n,height:Math.max.apply(Math,e)-i}}var ur={box:function(t,e,n,i){return sr([t,n],[e,i])},length:function(t,e,n,i){return or(t,e,n,i)},pointAt:function(t,e,n,i,r){return{x:(1-r)*t+r*n,y:(1-r)*e+r*i}},pointDistance:function(t,e,n,i,r,o){var a=(n-t)*(r-t)+(i-e)*(o-e);return 0>a?or(t,e,r,o):a>(n-t)*(n-t)+(i-e)*(i-e)?or(n,i,r,o):this.pointToLine(t,e,n,i,r,o)},pointToLine:function(t,e,n,i,r,o){var a=[n-t,i-e];if(function(t,e){return t[0]===e[0]&&t[1]===e[1]}(a,[0,0]))return Math.sqrt((r-t)*(r-t)+(o-e)*(o-e));var s=[-a[1],a[0]];return function(t,e){var n=e[0],i=e[1],r=n*n+i*i;r>0&&(r=1/Math.sqrt(r)),t[0]=e[0]*r,t[1]=e[1]*r}(s,s),Math.abs(function(t,e){return t[0]*e[0]+t[1]*e[1]}([r-t,o-e],s))},tangentAngle:function(t,e,n,i){return Math.atan2(i-e,n-t)}};function cr(t,e,n,i,r){var o=1-r;return o*o*o*t+3*e*r*o*o+3*n*r*r*o+i*r*r*r}function lr(t,e,n,i,r){var o=1-r;return 3*(o*o*(e-t)+2*o*r*(n-e)+r*r*(i-n))}function hr(t,e,n,i){var r,o,a,s=-3*t+9*e-9*n+3*i,u=6*t-12*e+6*n,c=3*e-3*t,l=[];if(ar(s,0))ar(u,0)||0>(r=-c/u)||r>1||l.push(r);else{var h=u*u-4*s*c;ar(h,0)?l.push(-u/(2*s)):h>0&&(o=(-u-(a=Math.sqrt(h)))/(2*s),0>(r=(-u+a)/(2*s))||r>1||l.push(r),0>o||o>1||l.push(o))}return l}function pr(t,e,n,i,r,o,a,s,u){var c=cr(t,n,r,a,u),l=cr(e,i,o,s,u),h=ur.pointAt(t,e,n,i,u),p=ur.pointAt(n,i,r,o,u),f=ur.pointAt(r,o,a,s,u),d=ur.pointAt(h.x,h.y,p.x,p.y,u),y=ur.pointAt(p.x,p.y,f.x,f.y,u);return[[t,e,h.x,h.y,d.x,d.y,c,l],[c,l,y.x,y.y,f.x,f.y,a,s]]}function fr(t,e,n,i,r,o,a,s,u){if(0===u)return function(t,e){for(var n=0,i=t.length,r=0;i>r;r++)n+=or(t[r],e[r],t[(r+1)%i],e[(r+1)%i]);return n/2}([t,n,r,a],[e,i,o,s]);var c=pr(t,e,n,i,r,o,a,s,.5),l=[].concat(c[0],[u-1]),h=[].concat(c[1],[u-1]);return fr.apply(void 0,l)+fr.apply(void 0,h)}var dr={extrema:hr,box:function(t,e,n,i,r,o,a,s){for(var u=[t,a],c=[e,s],l=hr(t,n,r,a),h=hr(e,i,o,s),p=0;l.length>p;p++)u.push(cr(t,n,r,a,l[p]));for(var f=0;h.length>f;f++)c.push(cr(e,i,o,s,h[f]));return sr(u,c)},length:function(t,e,n,i,r,o,a,s){return fr(t,e,n,i,r,o,a,s,3)},nearestPoint:function(t,e,n,i,r,o,a,s,u,c,l){return function(t,e,n,i,r,o){var a=-1,s=1/0,u=[n,i],c=20;o&&o>200&&(c=o/10);for(var l=1/c,h=l/10,p=0;c>=p;p++){var f=p*l,d=[r.apply(void 0,t.concat([f])),r.apply(void 0,e.concat([f]))],y=or(u[0],u[1],d[0],d[1]);s>y&&(a=f,s=y)}if(0===a)return{x:t[0],y:e[0]};if(1===a){var v=t.length;return{x:t[v-1],y:e[v-1]}}s=1/0;for(var g=0;32>g&&h>=1e-4;g++){var m=a-h,T=a+h,S=[r.apply(void 0,t.concat([m])),r.apply(void 0,e.concat([m]))],b=or(u[0],u[1],S[0],S[1]);if(m>=0&&s>b)a=m,s=b;else{var E=[r.apply(void 0,t.concat([T])),r.apply(void 0,e.concat([T]))],w=or(u[0],u[1],E[0],E[1]);1>=T&&s>w?(a=T,s=w):h*=.5}}return{x:r.apply(void 0,t.concat([a])),y:r.apply(void 0,e.concat([a]))}}([t,n,r,a],[e,i,o,s],u,c,cr,l)},pointDistance:function(t,e,n,i,r,o,a,s,u,c,l){var h=this.nearestPoint(t,e,n,i,r,o,a,s,u,c,l);return or(h.x,h.y,u,c)},interpolationAt:cr,pointAt:function(t,e,n,i,r,o,a,s,u){return{x:cr(t,n,r,a,u),y:cr(e,i,o,s,u)}},divide:function(t,e,n,i,r,o,a,s,u){return pr(t,e,n,i,r,o,a,s,u)},tangentAngle:function(t,e,n,i,r,o,a,s,u){var c=lr(t,n,r,a,u),l=lr(e,i,o,s,u);return(Math.atan2(l,c)+2*Math.PI)%(2*Math.PI)}};var yr,vr=function(t){return function(t){if(2>t.length)return 0;for(var e=0,n=0;t.length-1>n;n++){var i=t[n],r=t[n+1];e+=or(i[0],i[1],r[0],r[1])}return e}(t)};(yr=t.Shape||(t.Shape={})).GROUP="g",yr.CIRCLE="circle",yr.ELLIPSE="ellipse",yr.IMAGE="image",yr.RECT="rect",yr.LINE="line",yr.POLYLINE="polyline",yr.POLYGON="polygon",yr.TEXT="text",yr.PATH="path",yr.HTML="html",yr.MESH="mesh";var gr=t.Syringe.defineToken("CanvasConfig");function mr(t,e,n){var i=t[0],r=t[1];return[i+(e[0]-i)*n,r+(e[1]-r)*n]}function Tr(t){return t.map((function(t,e,n){var i=e&&n[e-1].slice(-2).concat(t.slice(1)),r=e?dr.length.apply(dr,i):0;return{s:t,ss:e?r?function(t,e){void 0===e&&(e=.5);var n=t.slice(0,2),i=t.slice(2,4),r=t.slice(4,6),o=t.slice(6,8),a=mr(n,i,e),s=mr(i,r,e),u=mr(r,o,e),c=mr(a,s,e),l=mr(s,u,e),h=mr(c,l,e);return[["C"].concat(a,c,h),["C"].concat(l,u,o)]}(i):[t,t]:[t],l:r}}))}function Sr(t,e,n){var i=Tr(t),r=Tr(e),o=i.length,a=r.length,s=i.filter((function(t){return t.l})).length,u=r.filter((function(t){return t.l})).length,c=i.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/s||0,l=r.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/u||0,h=n||Math.max(o,a),p=[c,l],f=[h-o,h-a],d=0,y=[i,r].map((function(t,e){return t.l===h?t.map((function(t){return t.s})):t.map((function(t,n){return f[e]-=(d=n&&f[e]&&t.l>=p[e])?1:0,d?t.ss:[t.s]})).flat()}));return y[0].length===y[1].length?y:Sr(y[0],y[1],h)}function br(t){return wr(t)>=0}function Er(t,e,n,i,r,o,a,s){return 3*((s-e)*(n+r)-(a-t)*(i+o)+i*(t-r)-n*(e-o)+s*(r+t/3)-a*(o+e/3))/20}function wr(t){var e=0,n=0,i=0,r=0,o=0;return t.map((function(t){switch(t[0]){case"M":case"Z":return e=i="M"===t[0]?t[1]:i,n=r="M"===t[0]?t[2]:r,0;default:o=Er.apply(0,[e,n].concat(t.slice(1)));var a=t.slice(-2);return e=a[0],n=a[1],o}})).reduce((function(t,e){return t+e}),0)}function xr(t){var e=t.slice(1).map((function(e,n,i){return n?i[n-1].slice(-2).concat(e.slice(1)):t[0].slice(1).concat(e.slice(1))})).map((function(t){return t.map((function(e,n){return t[t.length-n-2*(1-n%2)]}))})).reverse();return[["M"].concat(e[0].slice(0,2))].concat(e.map((function(t){return["C"].concat(t.slice(2))})))}function Pr(t){return t.map((function(t){return Array.isArray(t)?Pr(t):Number.isNaN(+t)?t:+t}))}function kr(t,e){var n=t.length-1,i=[],r=0,o=function(t){var e=t.length,n=e-1;return t.map((function(i,r){return t.map((function(i,o){var a=r+o;return 0===o||t[a]&&"M"===t[a][0]?["M"].concat(t[a].slice(-2)):(e>a||(a-=n),t[a])}))}))}(t);return o.forEach((function(o,a){t.slice(1).forEach((function(i,o){r+=function(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}(t[(a+o)%n].slice(-2),e[o%n].slice(-2))})),i[a]=r,r=0})),o[i.indexOf(Math.min.apply(null,i))]}function Cr(t,e,n,i){var r=(-1+Math.sqrt(2))/3*4,o=t*r,a=e*r,s=n-t,u=n+t,c=i-e,l=i+e;return[["M",s,i],["C",s,i-a,n-o,c,n,c],["C",n+o,c,u,i-a,u,i],["C",u,i+a,n+o,l,n,l],["C",n-o,l,s,i+a,s,i],["Z"]]}var Nr=function(){return this.call=this._createCall("sync"),this.call.apply(this,arguments)},_r=function(){return this.callAsync=this._createCall("async"),this.callAsync.apply(this,arguments)},Mr=function(){return this.promise=this._createCall("promise"),this.promise.apply(this,arguments)},Ar=function(){function t(t,e){void 0===t&&(t=[]),void 0===e&&(e=void 0),this.name=void 0,this.taps=void 0,this.promise=void 0,this._promise=void 0,this._args=t,this.name=e,this.taps=[],this.interceptors=[],this._call=Nr,this.call=Nr,this._callAsync=_r,this.callAsync=_r,this._promise=Mr,this.promise=Mr,this._x=void 0}var e=t.prototype;return e.compile=function(t){throw new Error("Abstract: should be overridden")},e._createCall=function(t){return this.compile({taps:this.taps,interceptors:this.interceptors,args:this._args,type:t})},e._tap=function(t,e,n){if("string"==typeof e)e={name:e.trim()};else if("object"!=typeof e||null===e)throw new Error("Invalid tap options");if("string"!=typeof e.name||""===e.name)throw new Error("Missing name for tap");e=Object.assign({type:t,fn:n},e),e=this._runRegisterInterceptors(e),this._insert(e)},e.tap=function(t,e){this._tap("sync",t,e)},e.tapAsync=function(t,e){this._tap("async",t,e)},e.tapPromise=function(t,e){this._tap("promise",t,e)},e._runRegisterInterceptors=function(t){for(var e,n=we(this.interceptors);!(e=n()).done;){var i=e.value;if(i.register){var r=i.register(t);void 0!==r&&(t=r)}}return t},e.withOptions=function(t){var e=this,n=function(e){return Object.assign({},t,"string"==typeof e?{name:e}:e)};return{name:this.name,tap:function(t,i){return e.tap(n(t),i)},tapAsync:function(t,i){return e.tapAsync(n(t),i)},tapPromise:function(t,i){return e.tapPromise(n(t),i)},isUsed:function(){return e.isUsed()},withOptions:function(t){return e.withOptions(n(t))}}},e.isUsed=function(){return this.taps.length>0||this.interceptors.length>0},e._resetCompilation=function(){this.call=this._call,this.callAsync=this._callAsync,this.promise=this._promise},e._insert=function(t){var e;this._resetCompilation(),"string"==typeof t.before?e=new Set([t.before]):Array.isArray(t.before)&&(e=new Set(t.before));var n=0;"number"==typeof t.stage&&(n=t.stage);for(var i=this.taps.length;i>0;){i--;var r=this.taps[i];this.taps[i+1]=r;var o=r.stage||0;if(e){if(e.has(r.name)){e.delete(r.name);continue}if(e.size>0)continue}if(n>=o){i++;break}}this.taps[i]=t},t}(),Or=function(){function t(t){this.config=t,this.options=void 0,this._args=void 0}var e=t.prototype;return e.create=function(t){var e;switch(this.init(t),this.options.type){case"sync":e=new Function(this.args(),'"use strict";\n'+this.header()+this.contentWithInterceptors({onError:function(t){return"throw "+t+";\n"},onResult:function(t){return"return "+t+";\n"},resultReturns:!0,onDone:function(){return""},rethrowIfPossible:!0}));break;case"async":e=new Function(this.args({after:"_callback"}),'"use strict";\n'+this.header()+this.contentWithInterceptors({onError:function(t){return"_callback("+t+");\n"},onResult:function(t){return"_callback(null, "+t+");\n"},onDone:function(){return"_callback();\n"}}));break;case"promise":var n=!1,i=this.contentWithInterceptors({onError:function(t){return n=!0,"_error("+t+");\n"},onResult:function(t){return"_resolve("+t+");\n"},onDone:function(){return"_resolve();\n"}}),r="";r+='"use strict";\n',r+=this.header(),r+="return new Promise((function(_resolve, _reject) {\n",n&&(r+="var _sync = true;\n",r+="function _error(_err) {\n",r+="if(_sync)\n",r+="_resolve(Promise.resolve().then((function() { throw _err; })));\n",r+="else\n",r+="_reject(_err);\n",r+="};\n"),r+=i,n&&(r+="_sync = false;\n"),r+="}));\n",e=new Function(this.args(),r)}return this.deinit(),e},e.setup=function(t,e){t._x=e.taps.map((function(t){return t.fn}))},e.init=function(t){this.options=t,this._args=t.args.slice()},e.deinit=function(){this.options=void 0,this._args=void 0},e.contentWithInterceptors=function(t){var e=this;if(this.options.interceptors.length>0){for(var n=t.onError,i=t.onResult,r=t.onDone,o="",a=0;this.options.interceptors.length>a;a++){var s=this.options.interceptors[a];s.call&&(o+=this.getInterceptor(a)+".call("+this.args({before:s.context?"_context":void 0})+");\n")}return o+=this.content(Object.assign(t,{onError:n&&function(t){for(var i="",r=0;e.options.interceptors.length>r;r++){e.options.interceptors[r].error&&(i+=e.getInterceptor(r)+".error("+t+");\n")}return i+=n(t)},onResult:i&&function(t){for(var n="",r=0;e.options.interceptors.length>r;r++){e.options.interceptors[r].result&&(n+=e.getInterceptor(r)+".result("+t+");\n")}return n+=i(t)},onDone:r&&function(){for(var t="",n=0;e.options.interceptors.length>n;n++){e.options.interceptors[n].done&&(t+=e.getInterceptor(n)+".done();\n")}return t+=r()}}))}return this.content(t)},e.header=function(){var t="";return this.needContext()?t+="var _context = {};\n":t+="var _context;\n",t+="var _x = this._x;\n",this.options.interceptors.length>0&&(t+="var _taps = this.taps;\n",t+="var _interceptors = this.interceptors;\n"),t},e.needContext=function(){for(var t,e=we(this.options.taps);!(t=e()).done;){if(t.value.context)return!0}return!1},e.callTap=function(t,e){for(var n=e.onError,i=e.onResult,r=e.onDone,o=e.rethrowIfPossible,a="",s=!1,u=0;this.options.interceptors.length>u;u++){var c=this.options.interceptors[u];c.tap&&(s||(a+="var _tap"+t+" = "+this.getTap(t)+";\n",s=!0),a+=this.getInterceptor(u)+".tap("+(c.context?"_context, ":"")+"_tap"+t+");\n")}a+="var _fn"+t+" = "+this.getTapFn(t)+";\n";var l=this.options.taps[t];switch(l.type){case"sync":o||(a+="var _hasError"+t+" = false;\n",a+="try {\n"),a+=i?"var _result"+t+" = _fn"+t+"("+this.args({before:l.context?"_context":void 0})+");\n":"_fn"+t+"("+this.args({before:l.context?"_context":void 0})+");\n",o||(a+="} catch(_err) {\n",a+="_hasError"+t+" = true;\n",a+=n("_err"),a+="}\n",a+="if(!_hasError"+t+") {\n"),i&&(a+=i("_result"+t)),r&&(a+=r()),o||(a+="}\n");break;case"async":var h="";h+=i?"(function(_err"+t+", _result"+t+") {\n":"(function(_err"+t+") {\n",h+="if(_err"+t+") {\n",h+=n("_err"+t),h+="} else {\n",i&&(h+=i("_result"+t)),r&&(h+=r()),h+="}\n",a+="_fn"+t+"("+this.args({before:l.context?"_context":void 0,after:h+="})"})+");\n";break;case"promise":a+="var _hasResult"+t+" = false;\n",a+="var _promise"+t+" = _fn"+t+"("+this.args({before:l.context?"_context":void 0})+");\n",a+="if (!_promise"+t+" || !_promise"+t+".then)\n",a+=" throw new Error('Tap function (tapPromise) did not return promise (returned ' + _promise"+t+" + ')');\n",a+="_promise"+t+".then((function(_result"+t+") {\n",a+="_hasResult"+t+" = true;\n",i&&(a+=i("_result"+t)),r&&(a+=r()),a+="}), function(_err"+t+") {\n",a+="if(_hasResult"+t+") throw _err"+t+";\n",a+=n("_err"+t),a+="});\n"}return a},e.callTapsSeries=function(t){var e=this,n=t.onError,i=t.onResult,r=t.resultReturns,o=t.onDone,a=t.doneReturns,s=t.rethrowIfPossible;if(0===this.options.taps.length)return o();for(var u=this.options.taps.findIndex((function(t){return"sync"!==t.type})),c=r||a,l="",h=o,p=0,f=function(t){var r=t;h!==o&&("sync"!==e.options.taps[r].type||p++>20)&&(p=0,l+="function _next"+r+"() {\n",l+=h(),l+="}\n",h=function(){return(c?"return ":"")+"_next"+r+"();\n"});var a=h,f=function(t){return t?"":o()},d=e.callTap(r,{onError:function(t){return n(r,t,a,f)},onResult:i&&function(t){return i(r,t,a,f)},onDone:!i&&a,rethrowIfPossible:s&&(0>u||u>r)});h=function(){return d}},d=this.options.taps.length-1;d>=0;d--)f(d);return l+=h()},e.callTapsLooping=function(t){var e=t.onError,n=t.onDone,i=t.rethrowIfPossible;if(0===this.options.taps.length)return n();var r=this.options.taps.every((function(t){return"sync"===t.type})),o="";r||(o+="var _looper = (function() {\n",o+="var _loopAsync = false;\n"),o+="var _loop;\n",o+="do {\n",o+="_loop = false;\n";for(var a=0;this.options.interceptors.length>a;a++){var s=this.options.interceptors[a];s.loop&&(o+=this.getInterceptor(a)+".loop("+this.args({before:s.context?"_context":void 0})+");\n")}return o+=this.callTapsSeries({onError:e,onResult:function(t,e,n,i){var o="";return o+="if("+e+" !== undefined) {\n",o+="_loop = true;\n",r||(o+="if(_loopAsync) _looper();\n"),o+=i(!0),o+="} else {\n",o+=n(),o+="}\n"},onDone:n&&function(){var t="";return t+="if(!_loop) {\n",t+=n(),t+="}\n"},rethrowIfPossible:i&&r}),o+="} while(_loop);\n",r||(o+="_loopAsync = true;\n",o+="});\n",o+="_looper();\n"),o},e.callTapsParallel=function(t){var e=this,n=t.onError,i=t.onResult,r=t.onDone,o=t.rethrowIfPossible,a=t.onTap,s=void 0===a?function(t,e){return e()}:a;if(1>=this.options.taps.length)return this.callTapsSeries({onError:n,onResult:i,onDone:r,rethrowIfPossible:o});var u="";u+="do {\n",u+="var _counter = "+this.options.taps.length+";\n",r&&(u+="var _done = (function() {\n",u+=r(),u+="});\n");for(var c=function(t){var a=function(){return r?"if(--_counter === 0) _done();\n":"--_counter;"},c=function(t){return t||!r?"_counter = 0;\n":"_counter = 0;\n_done();\n"};u+="if(_counter <= 0) break;\n",u+=s(t,(function(){return e.callTap(t,{onError:function(e){var i="";return i+="if(_counter > 0) {\n",i+=n(t,e,a,c),i+="}\n"},onResult:i&&function(e){var n="";return n+="if(_counter > 0) {\n",n+=i(t,e,a,c),n+="}\n"},onDone:!i&&function(){return a()},rethrowIfPossible:o})}),a,c)},l=0;this.options.taps.length>l;l++)c(l);return u+="} while(false);\n"},e.args=function(t){var e=void 0===t?{}:t,n=e.before,i=e.after,r=this._args;return n&&(r=[n].concat(r)),i&&(r=r.concat(i)),0===r.length?"":r.join(", ")},e.getTapFn=function(t){return"_x["+t+"]"},e.getTap=function(t){return"_taps["+t+"]"},e.getInterceptor=function(t){return"_interceptors["+t+"]"},t}(),Ir=function(t){function e(){return t.apply(this,arguments)||this}return ve(e,t),e.prototype.content=function(t){var e=t.onError;return this.callTapsParallel({onError:function(t,n,i,r){return e(n)+r(!0)},onDone:t.onDone})},e}(Or),Rr=new Ir,Lr=function(t){return Rr.setup(this,t),Rr.create(t)},Dr=function(t){function e(e,n){var i;return void 0===e&&(e=[]),void 0===n&&(n=void 0),(i=t.call(this,e,n)||this).compile=Lr,i._call=void 0,i.call=void 0,i}return ve(e,t),e}(Ar),Ur=function(t){function e(){return t.apply(this,arguments)||this}return ve(e,t),e.prototype.content=function(t){var e=this,n=t.onError,i=t.onResult;return this.callTapsSeries({onError:function(t,e,i,r){return n(e)+r(!0)},onResult:function(t,n,i){var r="";return r+="if("+n+" !== undefined) {\n",r+=e._args[0]+" = "+n+";\n",r+="}\n",r+=i()},onDone:function(){return i(e._args[0])}})},e}(Or),Fr=new Ur,Br=function(t){return Fr.setup(this,t),Fr.create(t)},Vr=function(t){function e(e,n){var i;return void 0===e&&(e=[]),void 0===n&&(n=void 0),(i=t.call(this,e,n)||this).compile=Br,i._call=void 0,i.call=void 0,i}return ve(e,t),e}(Ar),Gr=function(t){function e(){return t.apply(this,arguments)||this}return ve(e,t),e.prototype.content=function(t){var e=t.onError;return this.callTapsSeries({onError:function(t,n){return e(n)},onDone:t.onDone,rethrowIfPossible:t.rethrowIfPossible})},e}(Or),jr=new Gr,Hr=function(){throw new Error("tapAsync is not supported on a SyncHook")},zr=function(){throw new Error("tapPromise is not supported on a SyncHook")},Wr=function(t){return jr.setup(this,t),jr.create(t)},Yr=function(t){function e(e,n){var i;return void 0===e&&(e=[]),void 0===n&&(n=void 0),(i=t.call(this,e,n)||this).tapAsync=Hr,i.tapPromise=zr,i.compile=Wr,i}return ve(e,t),e}(Ar),qr=function(t){function e(){return t.apply(this,arguments)||this}return ve(e,t),e.prototype.content=function(t){var e=this,n=t.onError,i=t.onResult;return this.callTapsSeries({onError:function(t,e){return n(e)},onResult:function(t,n,i){var r="";return r+="if("+n+" !== undefined) {\n",r+=e._args[0]+" = "+n+";\n",r+="}\n",r+=i()},onDone:function(){return i(e._args[0])},doneReturns:t.resultReturns,rethrowIfPossible:t.rethrowIfPossible})},e}(Or),Xr=new qr,Kr=function(){throw new Error("tapAsync is not supported on a SyncWaterfallHook")},Zr=function(){throw new Error("tapPromise is not supported on a SyncWaterfallHook")},Jr=function(t){return Xr.setup(this,t),Xr.create(t)},Qr=function(t){function e(e,n){var i;return void 0===e&&(e=[]),void 0===n&&(n=void 0),(i=t.call(this,e,n)||this).tapAsync=Kr,i.tapPromise=Zr,i.compile=Jr,i}return ve(e,t),e}(Yr),$r=["serif","sans-serif","monospace","cursive","fantasy","system-ui"];function to(t){for(var e=t.fontSize,n=t.fontFamily,i=t.fontStyle,r=t.fontVariant,o=t.fontWeight,a=Ue(e)?e+"px":e.toString(),s=Ji(n)?n.split(","):[n.value],u=s.length-1;u>=0;u--){var c=s[u].trim();!/([\"\'])[^\'\"]+\1/.test(c)&&0>$r.indexOf(c)&&(c='"'+c+'"'),s[u]=c}return i+" "+r+" "+o+" "+a+" "+s.join(",")}var eo=t.Syringe.defineToken("LayoutChildrenFactory"),no=t.Syringe.defineToken("LayoutChildrenOptions");t.LayoutChildren=function(){function e(t,e){this._layoutContext=void 0,this.options=void 0,this.node=void 0,this.styleMap=void 0,this.layoutContext=void 0,this._layoutContext=t,this.options=e,this.layoutContext=t,this.node=e.node,this.styleMap=e.node.getAllStyle()}var n=e.prototype;return n.intrinsicSizes=function(){var e=new Oi;return this.layoutContext.appendWorkTask({layoutChild:this,taskType:t.LayoutTaskType.IntrinsicSizes,deferred:e}),e.promise},n.layoutNextFragment=function(e){if(this.layoutContext.mode===t.LayoutTaskType.IntrinsicSizes)throw new Error("Not Supported: cant call layoutNextFragment in intrinsicSizes");var n=new Oi;return this.layoutContext.appendWorkTask({layoutConstraints:e,layoutChild:this,taskType:t.LayoutTaskType.Layout,deferred:n}),n.promise},e}(),t.LayoutChildren=se([ut(),ue(0,lt(t.LayoutContext)),ue(1,lt(no)),ce("design:paramtypes",[t.LayoutContext,Object])],t.LayoutChildren);var io=function(){};io.inputProperties=void 0,io.childrenInputProperties=void 0,io.layoutOptions=void 0;var ro,oo,ao=t.Syringe.defineToken("LayoutEdgesFactory"),so=t.Syringe.defineToken("LayoutEdgesOptions"),uo=[0,0,0,0];t.LayoutEdges=function(e){var n,i,r,o,a,s,u,c,l,h,p,f,d,y,v,g;this.options=void 0,this.inlineStart=void 0,this.inlineEnd=void 0,this.blockStart=void 0,this.blockEnd=void 0,this.inline=void 0,this.block=void 0,this.options=e;var m=e.node.getAllStyle(),T=null!==(n=null===(i=m.get(t.PropertyName.PADDING_TOP))||void 0===i?void 0:i.value)&&void 0!==n?n:0,S=null!==(r=null===(o=m.get(t.PropertyName.PADDING_END))||void 0===o?void 0:o.value)&&void 0!==r?r:0,b=null!==(a=null===(s=m.get(t.PropertyName.PADDING_BOTTOM))||void 0===s?void 0:s.value)&&void 0!==a?a:0,E=null!==(u=null===(c=m.get(t.PropertyName.PADDING_START))||void 0===c?void 0:c.value)&&void 0!==u?u:0,w=null!==(l=null===(h=m.get(t.PropertyName.PADDING_TOP))||void 0===h?void 0:h.value)&&void 0!==l?l:0,x=null!==(p=null===(f=m.get(t.PropertyName.PADDING_END))||void 0===f?void 0:f.value)&&void 0!==p?p:0,P=null!==(d=null===(y=m.get(t.PropertyName.PADDING_BOTTOM))||void 0===y?void 0:y.value)&&void 0!==d?d:0,k=null!==(v=null===(g=m.get(t.PropertyName.PADDING_START))||void 0===g?void 0:g.value)&&void 0!==v?v:0;this.blockStart=T+uo[0]+w,this.inlineStart=S+uo[1]+x,this.blockEnd=b+uo[2]+P,this.inlineEnd=E+uo[3]+k,this.block=this.blockStart+this.blockEnd,this.inline=this.inlineStart+this.inlineEnd},t.LayoutEdges=se([ut(),ue(0,lt(so)),ce("design:paramtypes",[Object])],t.LayoutEdges),t.LayoutRegistry=((ro=function(){function t(){this.registry=new Map}var e=t.prototype;return e.hasLayout=function(t){return this.registry.has(t)},e.getLayout=function(t){if(void 0===t&&(t="absolute"),!this.hasLayout(t))throw new Error("invalid layout property: "+t);return this.registry.get(t)},e.updateLayout=function(t,e){this.registry.set(t,e)},e.registerLayout=function(t,e){if(""===t)throw new TypeError("layout name cant't be empty");if(oo.reservedLayout.includes(t))throw new Error("layout name '"+t+"' is a system reserved layout name, please use another name");if(this.hasLayout(t))throw new Error("layout '"+t+"' already exist.");this.registry.set(t,e)},e.deleteLayout=function(t){this.registry.delete(t)},de(t,[{key:"size",get:function(){return this.registry.size}}]),t}()).reservedLayout=[],oo=ro),t.LayoutRegistry=oo=se([ct()],t.LayoutRegistry);var co=function(t){return void 0===t&&(t=0),new Promise((function(e){setTimeout((function(){e()}),t)}))};t.LayoutEngine=function(){function e(t,e,n){this._layoutRegistry=void 0,this._layoutContextFactory=void 0,this._layoutEdgesFactory=void 0,this.layoutRegistry=void 0,this.layoutContextFactory=void 0,this.layoutEdgesFactory=void 0,this._layoutRegistry=t,this._layoutContextFactory=e,this._layoutEdgesFactory=n,this.layoutRegistry=t,this.layoutContextFactory=e,this.layoutEdgesFactory=n}var n=e.prototype;return n.computeLayout=function(){var t=pe(le().mark((function t(e,n){return le().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.determineIntrinsicSizes(e,e.children);case 2:return t.next=4,this.calculateLayout(e,e.children,n);case 4:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}(),n.determineAllIntrinsicSizes=function(){var t=pe(le().mark((function t(e){return le().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),n.getLayoutDefinitionName=function(e){var n=e.getAllStyle().get(t.PropertyName.LAYOUT);if(!n)throw new Error("layout property not found");return n.value},n.determineIntrinsicSizes=function(){var t=pe(le().mark((function t(e,n){var i;return le().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=this.getLayoutDefinitionName(e),t.next=3,this.invokeIntrinsicSizesCallback(i,e,n);case 3:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}(),n.invokeIntrinsicSizesCallback=function(){var e=pe(le().mark((function e(n,i,r){var o,a,s,u,c,l,h,p,f,d,y;return le().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=this.layoutRegistry.getLayout(n),a=new o,s=this.layoutContextFactory({mode:t.LayoutTaskType.IntrinsicSizes}),c=void 0===(u=o.inputProperties)?[]:u,l=[],r.forEach((function(t){var e=s.layoutChildrenFactory({node:t});l.push(e)})),h=this.layoutEdgesFactory({node:i}),p=i.getStyle.apply(i,c),f=a.intrinsicSizes(l,h,p),(d=this.runWorkQueue(f,s.workQueue)).next(),e.next=13,co();case 13:y=d.next().value,s.clearWorkQueue(),i.setIntrisicSizes(y);case 16:case"end":return e.stop()}}),e,this)})));return function(t,n,i){return e.apply(this,arguments)}}(),n.calculateLayout=function(){var t=pe(le().mark((function t(e,n,i){var r;return le().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=this.getLayoutDefinitionName(e),t.next=3,this.invokeLayoutCallback(r,e,n,i);case 3:case"end":return t.stop()}}),t,this)})));return function(e,n,i){return t.apply(this,arguments)}}(),n.invokeLayoutCallback=function(){var e=pe(le().mark((function e(n,i,r,o){var a,s,u,c,l,h,p,f,d,y,v,g,m;return le().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=this.layoutRegistry.getLayout(n),s=new a,u=this.layoutContextFactory({mode:t.LayoutTaskType.Layout}),l=void 0===(c=a.inputProperties)?[]:c,h=[],r.forEach((function(t){var e=u.layoutChildrenFactory({node:t});h.push(e)})),p=this.layoutEdgesFactory({node:i}),f=i.getStyle.apply(i,l),d=s.layout(h,p,o,f),(y=this.runWorkQueue(d,u.workQueue)).next(),e.next=13,co();case 13:v=y.next().value,u.clearWorkQueue(),g=v instanceof t.FragmentResult?v:u.fragmentResultFactory(v),m=u.layoutFragmentFactory({inlineSize:g.inlineSize,blockSize:g.blockSize,data:g.data}),i.setComputedLayout(m),r.forEach((function(t,e){t.setComputedLayout(g.childFragments[e])}));case 19:case"end":return e.stop()}}),e,this)})));return function(t,n,i,r){return e.apply(this,arguments)}}(),n.runWorkQueue=le().mark((function e(n,i){var r,o=this;return le().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Ai(n),i.length>0&&r.isPending()&&i.forEach((function(e){e.taskType===t.LayoutTaskType.IntrinsicSizes&&e.deferred.resolve(o.getNodeIntrisicSizes(e.layoutChild.node));if(e.taskType===t.LayoutTaskType.Layout){var n=e.layoutChild,i=e.deferred,r=n.layoutContext,a=o.getNodeFragment(n.node,e.layoutConstraints);i.resolve(r.layoutFragmentFactory(a))}})),void(e.next=4);case 4:if(r.isFulfilled()){e.next=6;break}throw new Error("promise not fullfilled!");case 6:return e.abrupt("return",r.getFullFilledValue());case 7:case"end":return e.stop()}}),e)})),n.getNodeIntrisicSizes=function(e){var n,i,r,o,a,s,u,c,l,h,p,f,d=e.getAllStyle();return{minContentInlineSize:(null===(n=d.get(t.PropertyName.MIN_WIDTH))||void 0===n?void 0:n.value)||(null===(i=e.intrisicSizes)||void 0===i?void 0:i.minContentInlineSize)||(null===(r=d.get(t.PropertyName.WIDTH))||void 0===r?void 0:r.value)||0,maxContentInlineSize:(null===(o=d.get(t.PropertyName.MAX_WIDTH))||void 0===o?void 0:o.value)||(null===(a=e.intrisicSizes)||void 0===a?void 0:a.maxContentInlineSize)||(null===(s=d.get(t.PropertyName.WIDTH))||void 0===s?void 0:s.value)||0,minContentBlockSize:(null===(u=d.get(t.PropertyName.MIN_HEIGHT))||void 0===u?void 0:u.value)||(null===(c=e.intrisicSizes)||void 0===c?void 0:c.minContentBlockSize)||(null===(l=d.get(t.PropertyName.HEIGHT))||void 0===l?void 0:l.value)||0,maxContentBlockSize:(null===(h=d.get(t.PropertyName.MAX_HEIGHT))||void 0===h?void 0:h.value)||(null===(p=e.intrisicSizes)||void 0===p?void 0:p.maxContentBlockSize)||(null===(f=d.get(t.PropertyName.HEIGHT))||void 0===f?void 0:f.value)||0}},n.getNodeFragment=function(e,n){var i,r,o,a,s,u;return{inlineSize:(null===(i=e.getComputedLayout())||void 0===i?void 0:i.inlineSize)||(null===(r=e.getAllStyle().get(t.PropertyName.MIN_WIDTH))||void 0===r?void 0:r.value)||(null===(o=e.getAllStyle().get(t.PropertyName.WIDTH))||void 0===o?void 0:o.value)||0,blockSize:(null===(a=e.getComputedLayout())||void 0===a?void 0:a.blockSize)||(null===(s=e.getAllStyle().get(t.PropertyName.MIN_HEIGHT))||void 0===s?void 0:s.value)||(null===(u=e.getAllStyle().get(t.PropertyName.HEIGHT))||void 0===u?void 0:u.value)||0,data:n.data}},e}(),t.LayoutEngine=se([ct(),ue(0,lt(t.LayoutRegistry)),ue(1,lt(ke)),ue(2,lt(ao)),ce("design:paramtypes",[t.LayoutRegistry,Function,Function])],t.LayoutEngine);var lo=t.Syringe.defineToken("LayoutFragmentFactory"),ho=t.Syringe.defineToken("LayoutFragmentOptions");t.LayoutFragment=function(t,e){this._layoutContext=void 0,this.options=void 0,this.layoutContext=void 0,this.inlineSize=void 0,this.blockSize=void 0,this.inlineOffset=void 0,this.blockOffset=void 0,this.data=void 0,this._layoutContext=t,this.options=e,this.layoutContext=t,this.inlineSize=e.inlineSize,this.blockSize=e.blockSize,this.inlineOffset=0,this.blockOffset=0,this.data=e.data},t.LayoutFragment=se([ut(),ue(0,lt(t.LayoutContext)),ue(1,lt(ho)),ce("design:paramtypes",[t.LayoutContext,Object])],t.LayoutFragment);var po,fo,yo,vo,go,mo=n((function(t){var e=Object.prototype.hasOwnProperty,n="~";function i(){}function r(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function o(t,e,i,o,a){if("function"!=typeof i)throw new TypeError("The listener must be a function");var s=new r(i,o||t,a),u=n?n+e:e;return t._events[u]?t._events[u].fn?t._events[u]=[t._events[u],s]:t._events[u].push(s):(t._events[u]=s,t._eventsCount++),t}function a(t,e){0==--t._eventsCount?t._events=new i:delete t._events[e]}function s(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(n=!1)),s.prototype.eventNames=function(){var t,i,r=[];if(0===this._eventsCount)return r;for(i in t=this._events)e.call(t,i)&&r.push(n?i.slice(1):i);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(t)):r},s.prototype.listeners=function(t){var e=this._events[n?n+t:t];if(!e)return[];if(e.fn)return[e.fn];for(var i=0,r=e.length,o=new Array(r);r>i;i++)o[i]=e[i].fn;return o},s.prototype.listenerCount=function(t){var e=this._events[n?n+t:t];return e?e.fn?1:e.length:0},s.prototype.emit=function(t,e,i,r,o,a){var s=n?n+t:t;if(!this._events[s])return!1;var u,c,l=this._events[s],h=arguments.length;if(l.fn){switch(l.once&&this.removeListener(t,l.fn,void 0,!0),h){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,e),!0;case 3:return l.fn.call(l.context,e,i),!0;case 4:return l.fn.call(l.context,e,i,r),!0;case 5:return l.fn.call(l.context,e,i,r,o),!0;case 6:return l.fn.call(l.context,e,i,r,o,a),!0}for(c=1,u=new Array(h-1);h>c;c++)u[c-1]=arguments[c];l.fn.apply(l.context,u)}else{var p,f=l.length;for(c=0;f>c;c++)switch(l[c].once&&this.removeListener(t,l[c].fn,void 0,!0),h){case 1:l[c].fn.call(l[c].context);break;case 2:l[c].fn.call(l[c].context,e);break;case 3:l[c].fn.call(l[c].context,e,i);break;case 4:l[c].fn.call(l[c].context,e,i,r);break;default:if(!u)for(p=1,u=new Array(h-1);h>p;p++)u[p-1]=arguments[p];l[c].fn.apply(l[c].context,u)}}return!0},s.prototype.on=function(t,e,n){return o(this,t,e,n,!1)},s.prototype.once=function(t,e,n){return o(this,t,e,n,!0)},s.prototype.removeListener=function(t,e,i,r){var o=n?n+t:t;if(!this._events[o])return this;if(!e)return a(this,o),this;var s=this._events[o];if(s.fn)s.fn!==e||r&&!s.once||i&&s.context!==i||a(this,o);else{for(var u=0,c=[],l=s.length;l>u;u++)(s[u].fn!==e||r&&!s[u].once||i&&s[u].context!==i)&&c.push(s[u]);c.length?this._events[o]=1===c.length?c[0]:c:a(this,o)}return this},s.prototype.removeAllListeners=function(t){var e;return t?this._events[e=n?n+t:t]&&a(this,e):(this._events=new i,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,t.exports=s}));(po=t.UnitType||(t.UnitType={}))[po.kUnknown=0]="kUnknown",po[po.kNumber=1]="kNumber",po[po.kPercentage=2]="kPercentage",po[po.kEms=3]="kEms",po[po.kExs=4]="kExs",po[po.kPixels=5]="kPixels",po[po.kCentimeters=6]="kCentimeters",po[po.kMillimeters=7]="kMillimeters",po[po.kInches=8]="kInches",po[po.kPoints=9]="kPoints",po[po.kPicas=10]="kPicas",po[po.kQuarterMillimeters=11]="kQuarterMillimeters",po[po.kViewportWidth=12]="kViewportWidth",po[po.kViewportHeight=13]="kViewportHeight",po[po.kViewportInlineSize=14]="kViewportInlineSize",po[po.kViewportBlockSize=15]="kViewportBlockSize",po[po.kViewportMin=16]="kViewportMin",po[po.kViewportMax=17]="kViewportMax",po[po.kSmallViewportWidth=18]="kSmallViewportWidth",po[po.kSmallViewportHeight=19]="kSmallViewportHeight",po[po.kSmallViewportInlineSize=20]="kSmallViewportInlineSize",po[po.kSmallViewportBlockSize=21]="kSmallViewportBlockSize",po[po.kSmallViewportMin=22]="kSmallViewportMin",po[po.kSmallViewportMax=23]="kSmallViewportMax",po[po.kLargeViewportWidth=24]="kLargeViewportWidth",po[po.kLargeViewportHeight=25]="kLargeViewportHeight",po[po.kLargeViewportInlineSize=26]="kLargeViewportInlineSize",po[po.kLargeViewportBlockSize=27]="kLargeViewportBlockSize",po[po.kLargeViewportMin=28]="kLargeViewportMin",po[po.kLargeViewportMax=29]="kLargeViewportMax",po[po.kDynamicViewportWidth=30]="kDynamicViewportWidth",po[po.kDynamicViewportHeight=31]="kDynamicViewportHeight",po[po.kDynamicViewportInlineSize=32]="kDynamicViewportInlineSize",po[po.kDynamicViewportBlockSize=33]="kDynamicViewportBlockSize",po[po.kDynamicViewportMin=34]="kDynamicViewportMin",po[po.kDynamicViewportMax=35]="kDynamicViewportMax",po[po.kContainerWidth=36]="kContainerWidth",po[po.kContainerHeight=37]="kContainerHeight",po[po.kContainerInlineSize=38]="kContainerInlineSize",po[po.kContainerBlockSize=39]="kContainerBlockSize",po[po.kContainerMin=40]="kContainerMin",po[po.kContainerMax=41]="kContainerMax",po[po.kRems=42]="kRems",po[po.kChs=43]="kChs",po[po.kUserUnits=44]="kUserUnits",po[po.kDegrees=45]="kDegrees",po[po.kRadians=46]="kRadians",po[po.kGradians=47]="kGradians",po[po.kTurns=48]="kTurns",po[po.kMilliseconds=49]="kMilliseconds",po[po.kSeconds=50]="kSeconds",po[po.kHertz=51]="kHertz",po[po.kKilohertz=52]="kKilohertz",po[po.kDotsPerPixel=53]="kDotsPerPixel",po[po.kDotsPerInch=54]="kDotsPerInch",po[po.kDotsPerCentimeter=55]="kDotsPerCentimeter",po[po.kFraction=56]="kFraction",po[po.kInteger=57]="kInteger",po[po.kQuirkyEms=58]="kQuirkyEms",(fo=t.UnitCategory||(t.UnitCategory={}))[fo.kUNumber=0]="kUNumber",fo[fo.kUPercent=1]="kUPercent",fo[fo.kULength=2]="kULength",fo[fo.kUAngle=3]="kUAngle",fo[fo.kUTime=4]="kUTime",fo[fo.kUFrequency=5]="kUFrequency",fo[fo.kUResolution=6]="kUResolution",fo[fo.kUOther=7]="kUOther",(yo=t.ValueRange||(t.ValueRange={}))[yo.kAll=0]="kAll",yo[yo.kNonNegative=1]="kNonNegative",yo[yo.kInteger=2]="kInteger",yo[yo.kNonNegativeInteger=3]="kNonNegativeInteger",yo[yo.kPositiveInteger=4]="kPositiveInteger",(vo=t.Nested||(t.Nested={}))[vo.kYes=0]="kYes",vo[vo.kNo=1]="kNo",(go=t.ParenLess||(t.ParenLess={}))[go.kYes=0]="kYes",go[go.kNo=1]="kNo";var To,So=[{name:"em",unit_type:t.UnitType.kEms},{name:"px",unit_type:t.UnitType.kPixels},{name:"deg",unit_type:t.UnitType.kDegrees},{name:"rad",unit_type:t.UnitType.kRadians},{name:"grad",unit_type:t.UnitType.kGradians},{name:"ms",unit_type:t.UnitType.kMilliseconds},{name:"s",unit_type:t.UnitType.kSeconds},{name:"rem",unit_type:t.UnitType.kRems},{name:"turn",unit_type:t.UnitType.kTurns}];(To=t.CSSStyleValueType||(t.CSSStyleValueType={}))[To.kUnknownType=0]="kUnknownType",To[To.kUnparsedType=1]="kUnparsedType",To[To.kKeywordType=2]="kKeywordType",To[To.kUnitType=3]="kUnitType",To[To.kSumType=4]="kSumType",To[To.kProductType=5]="kProductType",To[To.kNegateType=6]="kNegateType",To[To.kInvertType=7]="kInvertType",To[To.kMinType=8]="kMinType",To[To.kMaxType=9]="kMaxType",To[To.kClampType=10]="kClampType",To[To.kTransformType=11]="kTransformType",To[To.kPositionType=12]="kPositionType",To[To.kURLImageType=13]="kURLImageType",To[To.kColorType=14]="kColorType",To[To.kUnsupportedColorType=15]="kUnsupportedColorType";var bo,Eo,wo=function(){function e(){}e.parse=function(t,e){return[][0]},e.parseAll=function(t,e){return[]},e.unitFromName=function(e){return e?"number"===e?t.UnitType.kNumber:"percent"===e||"%"===e?t.UnitType.kPercentage:this.stringToUnitType(e):t.UnitType.kUnknown},e.unitTypeToUnitCategory=function(e){switch(e){case t.UnitType.kNumber:case t.UnitType.kInteger:return t.UnitCategory.kUNumber;case t.UnitType.kPercentage:return t.UnitCategory.kUPercent;case t.UnitType.kPixels:case t.UnitType.kCentimeters:case t.UnitType.kMillimeters:case t.UnitType.kQuarterMillimeters:case t.UnitType.kInches:case t.UnitType.kPoints:case t.UnitType.kPicas:case t.UnitType.kUserUnits:return t.UnitCategory.kULength;case t.UnitType.kMilliseconds:case t.UnitType.kSeconds:return t.UnitCategory.kUTime;case t.UnitType.kDegrees:case t.UnitType.kRadians:case t.UnitType.kGradians:case t.UnitType.kTurns:return t.UnitCategory.kUAngle;case t.UnitType.kHertz:case t.UnitType.kKilohertz:return t.UnitCategory.kUFrequency;case t.UnitType.kDotsPerPixel:case t.UnitType.kDotsPerInch:case t.UnitType.kDotsPerCentimeter:return t.UnitCategory.kUResolution;default:return t.UnitCategory.kUOther}},e.unitTypeToString=function(e){switch(e){case t.UnitType.kNumber:case t.UnitType.kInteger:case t.UnitType.kUserUnits:return"";case t.UnitType.kPercentage:return"%";case t.UnitType.kEms:case t.UnitType.kQuirkyEms:return"em";case t.UnitType.kRems:return"rem";case t.UnitType.kPixels:return"px";case t.UnitType.kDegrees:return"deg";case t.UnitType.kRadians:return"rad";case t.UnitType.kGradians:return"grad";case t.UnitType.kMilliseconds:return"ms";case t.UnitType.kSeconds:return"s";case t.UnitType.kTurns:return"turn"}return""},e.stringToUnitType=function(t){return So.find((function(e){return e.name===t})).unit_type},e.canonicalUnitTypeForCategory=function(e){switch(e){case t.UnitCategory.kUNumber:return t.UnitType.kNumber;case t.UnitCategory.kULength:return t.UnitType.kPixels;case t.UnitCategory.kUPercent:return t.UnitType.kUnknown;case t.UnitCategory.kUTime:return t.UnitType.kSeconds;case t.UnitCategory.kUAngle:return t.UnitType.kDegrees;case t.UnitCategory.kUFrequency:return t.UnitType.kHertz;case t.UnitCategory.kUResolution:return t.UnitType.kDotsPerPixel;default:return t.UnitType.kUnknown}},e.conversionToCanonicalUnitsScaleFactor=function(e){var n=1;switch(e){case t.UnitType.kPixels:case t.UnitType.kUserUnits:case t.UnitType.kDegrees:case t.UnitType.kSeconds:case t.UnitType.kHertz:break;case t.UnitType.kMilliseconds:n=.001;break;case t.UnitType.kCentimeters:case t.UnitType.kDotsPerCentimeter:case t.UnitType.kMillimeters:case t.UnitType.kQuarterMillimeters:case t.UnitType.kInches:case t.UnitType.kDotsPerInch:case t.UnitType.kPoints:case t.UnitType.kPicas:break;case t.UnitType.kRadians:n=180/Math.PI;break;case t.UnitType.kGradians:n=.9;break;case t.UnitType.kTurns:n=360;break;case t.UnitType.kKilohertz:n=1e3}return n},e.isAngle=function(e){return e===t.UnitType.kDegrees||e===t.UnitType.kRadians||e===t.UnitType.kGradians||e===t.UnitType.kTurns},e.isViewportPercentageLength=function(e){return e>=t.UnitType.kViewportWidth&&t.UnitType.kDynamicViewportMax>=e},e.isContainerPercentageLength=function(e){return e>=t.UnitType.kContainerWidth&&t.UnitType.kContainerMax>=e},e.isLength=function(e){return e>=t.UnitType.kEms&&t.UnitType.kUserUnits>=e||e==t.UnitType.kQuirkyEms},e.isRelativeUnit=function(e){return e===t.UnitType.kPercentage||e===t.UnitType.kEms||e===t.UnitType.kExs||e===t.UnitType.kRems||e===t.UnitType.kChs||this.isViewportPercentageLength(e)||this.isContainerPercentageLength(e)},e.isTime=function(e){return e===t.UnitType.kSeconds||e===t.UnitType.kMilliseconds},e.isFrequency=function(e){return e==t.UnitType.kHertz||e==t.UnitType.kKilohertz},e.isResolution=function(e){return e>=t.UnitType.kDotsPerPixel&&t.UnitType.kDotsPerCentimeter>=e},e.isFlex=function(e){return e===t.UnitType.kFraction};var n=e.prototype;return n.toString=function(){return this.buildCSSText(t.Nested.kNo,t.ParenLess.kNo,"")},n.isNumericValue=function(){return this.getType()>=t.CSSStyleValueType.kUnitType&&this.getType()<=t.CSSStyleValueType.kClampType},e}(),xo=function(e){function n(t){var n;return(n=e.call(this)||this).colorSpace=void 0,n.colorSpace=t,n}ve(n,e);var i=n.prototype;return i.getType=function(){return t.CSSStyleValueType.kColorType},i.to=function(t){return this},n}(wo),Po=function(e){function n(t){var n;return(n=e.call(this)||this).value=void 0,n.value=t,n}ve(n,e);var i=n.prototype;return i.clone=function(){return new n(this.value)},i.getType=function(){return t.CSSStyleValueType.kKeywordType},i.buildCSSText=function(t,e,n){return n+this.value},n}(wo);function ko(e){switch(Re(e,t.UnitType.kNumber),e){case t.UnitType.kEms:case t.UnitType.kExs:case t.UnitType.kPixels:case t.UnitType.kCentimeters:case t.UnitType.kMillimeters:case t.UnitType.kQuarterMillimeters:case t.UnitType.kInches:case t.UnitType.kPoints:case t.UnitType.kPicas:case t.UnitType.kUserUnits:case t.UnitType.kViewportWidth:case t.UnitType.kViewportHeight:case t.UnitType.kViewportInlineSize:case t.UnitType.kViewportBlockSize:case t.UnitType.kViewportMin:case t.UnitType.kViewportMax:case t.UnitType.kSmallViewportWidth:case t.UnitType.kSmallViewportHeight:case t.UnitType.kSmallViewportInlineSize:case t.UnitType.kSmallViewportBlockSize:case t.UnitType.kSmallViewportMin:case t.UnitType.kSmallViewportMax:case t.UnitType.kLargeViewportWidth:case t.UnitType.kLargeViewportHeight:case t.UnitType.kLargeViewportInlineSize:case t.UnitType.kLargeViewportBlockSize:case t.UnitType.kLargeViewportMin:case t.UnitType.kLargeViewportMax:case t.UnitType.kDynamicViewportWidth:case t.UnitType.kDynamicViewportHeight:case t.UnitType.kDynamicViewportInlineSize:case t.UnitType.kDynamicViewportBlockSize:case t.UnitType.kDynamicViewportMin:case t.UnitType.kDynamicViewportMax:case t.UnitType.kContainerWidth:case t.UnitType.kContainerHeight:case t.UnitType.kContainerInlineSize:case t.UnitType.kContainerBlockSize:case t.UnitType.kContainerMin:case t.UnitType.kContainerMax:case t.UnitType.kRems:case t.UnitType.kChs:return t.BaseType.kLength;case t.UnitType.kMilliseconds:case t.UnitType.kSeconds:return t.BaseType.kTime;case t.UnitType.kDegrees:case t.UnitType.kRadians:case t.UnitType.kGradians:case t.UnitType.kTurns:return t.BaseType.kAngle;case t.UnitType.kHertz:case t.UnitType.kKilohertz:return t.BaseType.kFrequency;case t.UnitType.kDotsPerPixel:case t.UnitType.kDotsPerInch:case t.UnitType.kDotsPerCentimeter:return t.BaseType.kResolution;case t.UnitType.kFraction:return t.BaseType.kFlex;case t.UnitType.kPercentage:return t.BaseType.kPercent;default:return t.BaseType.kLength}}function Co(e){switch(e){case t.BaseType.kLength:return"length";case t.BaseType.kAngle:return"angle";case t.BaseType.kTime:return"time";case t.BaseType.kFrequency:return"frequency";case t.BaseType.kResolution:return"resolution";case t.BaseType.kFlex:return"flex";case t.BaseType.kPercent:return"percent"}return""}(bo=t.CSSMathOperator||(t.CSSMathOperator={})).kAdd="+",bo.kSubtract="-",bo.kMultiply="*",bo.kDivide="/",bo.kMin="min",bo.kMax="max",bo.kClamp="clamp",bo.kInvalid="",(Eo=t.BaseType||(t.BaseType={}))[Eo.kLength=0]="kLength",Eo[Eo.kAngle=1]="kAngle",Eo[Eo.kTime=2]="kTime",Eo[Eo.kFrequency=3]="kFrequency",Eo[Eo.kResolution=4]="kResolution",Eo[Eo.kFlex=5]="kFlex",Eo[Eo.kPercent=6]="kPercent",Eo[Eo.kNumBaseTypes=7]="kNumBaseTypes";var No=function(){function e(e,n){void 0===e&&(e=t.UnitType.kNumber),void 0===n&&(n=1),this.exponents=[],this.numNonZeroEntries=0,this.percentHint=t.BaseType.kPercent,this.hasPercentHint=!1,this.exponents=new Array(t.BaseType.kNumBaseTypes).fill(0),e!==t.UnitType.kNumber&&this.setExponent(ko(e),n)}var n=e.prototype;return n.applyPercentHint=function(e){Re(e,t.BaseType.kPercent),this.setExponent(e,this.exponent(e)+this.exponent(t.BaseType.kPercent)),this.setExponent(t.BaseType.kPercent,0),this.percentHint=e,this.hasPercentHint=!0},n.hasNonZeroEntries=function(){return this.numNonZeroEntries>0},n.isOnlyNonZeroEntry=function(t,e){return Re(e,0),1===this.numNonZeroEntries&&this.exponent(t)===e},n.exponent=function(t){return this.exponents[t]},n.setExponent=function(t,e){var n=this.exponents[t];0==n&&0!==e?this.numNonZeroEntries++:0!==n&&0==e&&this.numNonZeroEntries--,this.exponents[t]=e},e.negateExponents=function(t){return t.exponents.forEach((function(t){return-1*t})),t},n.matchesBaseType=function(e){return Re(e,t.BaseType.kPercent),this.isOnlyNonZeroEntry(e,1)&&!this.hasPercentHint},n.matchesPercentage=function(){return this.isOnlyNonZeroEntry(t.BaseType.kPercent,1)},n.matchesBaseTypePercentage=function(e){return Re(e,t.BaseType.kPercent),this.isOnlyNonZeroEntry(e,1)||this.isOnlyNonZeroEntry(t.BaseType.kPercent,1)},n.matchesNumber=function(){return!this.hasNonZeroEntries()&&!this.hasPercentHint},n.matchesNumberPercentage=function(){return!this.hasNonZeroEntries()||this.isOnlyNonZeroEntry(t.BaseType.kPercent,1)},e.add=function(e,n,i){if(e.hasPercentHint&&n.hasPercentHint&&e.percentHint!=n.percentHint)return e;e.hasPercentHint?n.applyPercentHint(e.percentHint):n.hasPercentHint&&e.applyPercentHint(n.percentHint),Ie(e.percentHint,n.percentHint);for(var r=0;t.BaseType.kNumBaseTypes>r;++r){var o=r;if(e.exponents[r]!==n.exponents[r]&&(o!==t.BaseType.kPercent&&(e.applyPercentHint(o),n.applyPercentHint(o)),e.exponents[r]!==n.exponents[r]))return e}return e},e.multiply=function(e,n,i){if(e.hasPercentHint&&n.hasPercentHint&&e.percentHint!=n.percentHint)return e;e.hasPercentHint?n.applyPercentHint(e.percentHint):n.hasPercentHint&&e.applyPercentHint(n.percentHint);for(var r=0;t.BaseType.kNumBaseTypes>r;++r){var o=r;e.setExponent(o,e.exponent(o)+n.exponent(o))}return e},e}(),_o=function(e){function n(t){var n;return(n=e.call(this)||this).type_=void 0,n.type_=t,n}ve(n,e),n.fromNumberish=function(e){return"number"==typeof e?new Lo(e,t.UnitType.kNumber):e},n.fromPercentish=function(e){return"number"==typeof e?new Lo(100*e,t.UnitType.kPercentage):e};var i=n.prototype;return i.getType=function(){return t.CSSStyleValueType.kUnknownType},i.equals=function(){for(var t=this,e=arguments.length,n=new Array(e),i=0;e>i;i++)n[i]=arguments[i];var r=Mo(n);return r.every((function(e){return t.equals(e)}))},i.add=function(){for(var e=arguments.length,n=new Array(e),i=0;e>i;i++)n[i]=arguments[i];var r=Mo(n);Ao(t.CSSStyleValueType.kSumType,r,this);var o=Io(r,t.CSSMathOperator.kAdd);return o||zo.create(r)},i.sub=function(){for(var e=arguments.length,n=new Array(e),i=0;e>i;i++)n[i]=arguments[i];var r=Mo(n);r=r.map((function(t){return t.negate()})),Ao(t.CSSStyleValueType.kSumType,r,this);var o=Io(r,t.CSSMathOperator.kAdd);return o||zo.create(r)},i.mul=function(){for(var e=arguments.length,n=new Array(e),i=0;e>i;i++)n[i]=arguments[i];var r=Mo(n);Ao(t.CSSStyleValueType.kProductType,r,this);var o=Ro(r);return o||Wo.create(r)},i.div=function(){for(var e=arguments.length,n=new Array(e),i=0;e>i;i++)n[i]=arguments[i];var r=Mo(n);r=r.map((function(t){return t.invert()})),Ao(t.CSSStyleValueType.kProductType,r,this);var o=Ro(r);return o||Wo.create(r)},i.min=function(){for(var e=arguments.length,n=new Array(e),i=0;e>i;i++)n[i]=arguments[i];var r=Mo(n);Ao(t.CSSStyleValueType.kMinType,r,this);var o=Io(r,t.CSSMathOperator.kMin);return o||jo.create(r)},i.max=function(){for(var e=arguments.length,n=new Array(e),i=0;e>i;i++)n[i]=arguments[i];var r=Mo(n);Ao(t.CSSStyleValueType.kMaxType,r,this);var o=Io(r,t.CSSMathOperator.kMax);return o||Ho.create(r)},i.to=function(t){var e=this.sumValue();if(0===e.length||1!==e.length)return null;var n,i=Oo(e[0]);return i?(n="string"==typeof t?Lo.unitFromName(t):t,i.convertTo(n)):null},i.toSum=function(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];for(var r=0,o=e;o.length>r;r++){var a=o[r];if(!n.isValidUnit(n.unitFromName(a)))return null}var s=this.sumValue();if(!s.length)return null;for(var u,c=[],l=we(s);!(u=l()).done;){var h=u.value,p=Oo(h);if(!p)return null;c.push(p)}if(0===e.length){c.sort((function(t,e){return t.unit-e.unit}));var f=zo.create(c);return Oe(!!f),f}for(var d=[],y=function(){var t=n.unitFromName(g[v]);Oe(n.isValidUnit(t));var e=c.reduce((function(e,n,i){if(n){var r=n.convertTo(t);r&&(e+=r.value,c[i]=null)}return e}),0);d.push(new Lo(e,t))},v=0,g=e;g.length>v;v++)y();if(c.some((function(t){return!!t})))throw new Error("There were leftover terms that were not converted");return zo.create(d)},i.type=function(){var e={length:0,angle:0,time:0,frequency:0,resolution:0,flex:0,percent:0,percentHint:"length"},n=this.type_.exponent(t.BaseType.kLength);return n&&(e.length=n),(n=this.type_.exponent(t.BaseType.kAngle))&&(e.angle=n),(n=this.type_.exponent(t.BaseType.kTime))&&(e.time=n),(n=this.type_.exponent(t.BaseType.kFrequency))&&(e.frequency=n),(n=this.type_.exponent(t.BaseType.kResolution))&&(e.resolution=n),(n=this.type_.exponent(t.BaseType.kFlex))&&(e.flex=n),(n=this.type_.exponent(t.BaseType.kPercent))&&(e.percent=n),this.type_.hasPercentHint&&(e.percentHint=Co(this.type_.percentHint)),e},n.isValidUnit=function(e){return e!==t.UnitType.kUserUnits&&!!(e===t.UnitType.kNumber||e==t.UnitType.kPercentage||this.isLength(e)||this.isAngle(e)||this.isTime(e)||this.isFrequency(e)||this.isResolution(e)||this.isFlex(e))},i.negate=function(){return Fo.create(this)},i.invert=function(){return Uo.create(this)},n}(wo);function Mo(t){return t.map(_o.fromNumberish)}function Ao(t,e,n){Oe(!!n),n.getType()===t?e.unshift.apply(e,n.numericValues()):e.unshift(n)}function Oo(t){return 0===Object.keys(t.units).length?new Lo(t.value):1===Object.keys(t.units).length&&1===t.units[Object.keys(t.units)[0]]?new Lo(t.value,Number(Object.keys(t.units)[0])):null}function Io(e,n){Oe(!!e.length);var i=e[0]instanceof Lo?e[0]:null;if(!i)return null;for(var r=i.value,o=1;e.length>o;o++){var a=e[o]instanceof Lo?e[o]:null;if(!a||a.unit!==i.unit)return null;n===t.CSSMathOperator.kAdd?r+=a.value:n===t.CSSMathOperator.kMax?r=Math.max(r,a.value):n===t.CSSMathOperator.kMin&&(r=Math.min(r,a.value))}return new Lo(r,i.unit)}function Ro(e){Oe(!!e.length);for(var n=t.UnitType.kNumber,i=1,r=0;e.length>r;r++){var o=e[r]instanceof Lo?e[r]:null;if(!o)return null;if(o.unit!==t.UnitType.kNumber){if(n!==t.UnitType.kNumber)return null;n=o.unit}i*=o.value}return new Lo(i,n)}var Lo=function(e){function n(i,r){var o,a;return void 0===r&&(r=t.UnitType.kNumber),a="string"==typeof r?n.unitFromName(r):r,Oe(n.isValidUnit(a)),(o=e.call(this,new No(a))||this).unit=void 0,o.value=void 0,o.unit=a,o.value=i,o}ve(n,e),n.toCanonicalUnit=function(t){return this.canonicalUnitTypeForCategory(this.unitTypeToUnitCategory(t))},n.toCanonicalUnitIfPossible=function(e){var n=this.toCanonicalUnit(e);return n===t.UnitType.kUnknown?e:n},n.formatInfinityOrNaN=function(t,e){void 0===e&&(e="");var n="";return Number.isFinite(t)?(Oe(Number.isNaN(t)),n="NaN"):n=t>0?"infinity":"-infinity",n+e},n.formatNumber=function(t,e){return void 0===e&&(e=""),t+e};var i=n.prototype;return i.clone=function(){return new n(this.value,this.unit)},i.convertTo=function(e){if(this.unit===e)return new n(this.value,this.unit);var i=n.toCanonicalUnit(this.unit);if(i!==n.toCanonicalUnit(e)||i===t.UnitType.kUnknown)return null;var r=wo.conversionToCanonicalUnitsScaleFactor(this.unit)/wo.conversionToCanonicalUnitsScaleFactor(e);return new n(this.value*r,e)},i.equals=function(t){return this.value===t.value&&this.unit===t.unit},i.getType=function(){return t.CSSStyleValueType.kUnitType},i.sumValue=function(){var e=[],i={};return this.unit!==t.UnitType.kNumber&&(i[n.toCanonicalUnitIfPossible(this.unit)]=1),e.push({value:this.value*wo.conversionToCanonicalUnitsScaleFactor(this.unit),units:i}),e},i.negate=function(){return new n(-this.value,this.unit)},i.invert=function(){return this.unit===t.UnitType.kNumber?0===this.value?null:new n(1/this.value,this.unit):Uo.create(this)},i.buildCSSText=function(e,i,r){var o;switch(this.unit){case t.UnitType.kUnknown:break;case t.UnitType.kInteger:o=Number(this.value).toFixed(0);break;case t.UnitType.kNumber:case t.UnitType.kPercentage:case t.UnitType.kEms:case t.UnitType.kQuirkyEms:case t.UnitType.kExs:case t.UnitType.kRems:case t.UnitType.kChs:case t.UnitType.kPixels:case t.UnitType.kCentimeters:case t.UnitType.kDotsPerPixel:case t.UnitType.kDotsPerInch:case t.UnitType.kDotsPerCentimeter:case t.UnitType.kMillimeters:case t.UnitType.kQuarterMillimeters:case t.UnitType.kInches:case t.UnitType.kPoints:case t.UnitType.kPicas:case t.UnitType.kUserUnits:case t.UnitType.kDegrees:case t.UnitType.kRadians:case t.UnitType.kGradians:case t.UnitType.kMilliseconds:case t.UnitType.kSeconds:case t.UnitType.kHertz:case t.UnitType.kKilohertz:case t.UnitType.kTurns:case t.UnitType.kFraction:case t.UnitType.kViewportWidth:case t.UnitType.kViewportHeight:case t.UnitType.kViewportInlineSize:case t.UnitType.kViewportBlockSize:case t.UnitType.kViewportMin:case t.UnitType.kViewportMax:case t.UnitType.kSmallViewportWidth:case t.UnitType.kSmallViewportHeight:case t.UnitType.kSmallViewportInlineSize:case t.UnitType.kSmallViewportBlockSize:case t.UnitType.kSmallViewportMin:case t.UnitType.kSmallViewportMax:case t.UnitType.kLargeViewportWidth:case t.UnitType.kLargeViewportHeight:case t.UnitType.kLargeViewportInlineSize:case t.UnitType.kLargeViewportBlockSize:case t.UnitType.kLargeViewportMin:case t.UnitType.kLargeViewportMax:case t.UnitType.kDynamicViewportWidth:case t.UnitType.kDynamicViewportHeight:case t.UnitType.kDynamicViewportInlineSize:case t.UnitType.kDynamicViewportBlockSize:case t.UnitType.kDynamicViewportMin:case t.UnitType.kDynamicViewportMax:case t.UnitType.kContainerWidth:case t.UnitType.kContainerHeight:case t.UnitType.kContainerInlineSize:case t.UnitType.kContainerBlockSize:case t.UnitType.kContainerMin:case t.UnitType.kContainerMax:var a=this.value,s=n.unitTypeToString(this.unit);if(-999999>a||a>999999){var u=n.unitTypeToString(this.unit);o=!Number.isFinite(a)||Number.isNaN(a)?n.formatInfinityOrNaN(a,u):n.formatNumber(a,u)}else o=""+a+s}return r+=o},n}(_o),Do=function(t){function e(){return t.apply(this,arguments)||this}return ve(e,t),e.prototype.isUnitValue=function(){return!1},e}(_o),Uo=function(e){function n(t,n){var i;return(i=e.call(this,n)||this).value=void 0,i.operator="invert",i.value=t,i}ve(n,e),n.create=function(t){return new n(t,No.negateExponents(t.type_))};var i=n.prototype;return i.clone=function(){return new n(this.value,this.type_)},i.getType=function(){return t.CSSStyleValueType.kInvertType},i.equals=function(e){return e.getType()===t.CSSStyleValueType.kInvertType&&this.value.equals(e.value)},i.sumValue=function(){var t=this.value.sumValue();return 0===t.length||1!==t.length||0===t[0].value?null:(Object.keys(t[0].units).forEach((function(e){t[0].units[e]*=-1})),t[0].value=1/t[0].value,t)},i.buildCSSText=function(e,n,i){return n==t.ParenLess.kNo&&(i+=e===t.Nested.kYes?"(":"calc("),i=this.value.buildCSSText(t.Nested.kYes,t.ParenLess.kNo,i+="1 / "),n===t.ParenLess.kNo&&(i+=")"),i},n}(Do),Fo=function(e){function n(t,n){var i;return(i=e.call(this,n)||this).value=void 0,i.operator="negate",i.value=t,i}ve(n,e),n.create=function(t){return new n(t,t.type_)};var i=n.prototype;return i.clone=function(){return new n(this.value,this.type_)},i.getType=function(){return t.CSSStyleValueType.kNegateType},i.equals=function(e){return e.getType()===t.CSSStyleValueType.kNegateType&&this.value.equals(e.value)},i.sumValue=function(){var t=this.value.sumValue();return 0===t.length?null:(t.forEach((function(t){t.value*=-1})),t)},i.buildCSSText=function(e,n,i){return n==t.ParenLess.kNo&&(i+=e===t.Nested.kYes?"(":"calc("),i=this.value.buildCSSText(t.Nested.kYes,t.ParenLess.kNo,i+="-"),n===t.ParenLess.kNo&&(i+=")"),i},n}(Do);function Bo(t,e,n){for(var i=t[0].type_,r=1;t.length>r;r++)i=e(i,t[r].type_,false);return i}var Vo,Go=function(t){function e(e,n){var i;return(i=t.call(this,n)||this).values=void 0,i.values=e,i}ve(e,t);var n=e.prototype;return n.numericValues=function(){return this.values},n.equals=function(t){return this.getType()===t.getType()&&this.values.every((function(e,n){return e.equals(t.values[n])}))},e}(Do),jo=function(e){function n(){for(var t,n=arguments.length,i=new Array(n),r=0;n>r;r++)i[r]=arguments[r];return(t=e.call.apply(e,[this].concat(i))||this).operator="min",t}ve(n,e),n.create=function(t){return new n(t,Bo(t,No.add))};var i=n.prototype;return i.clone=function(){return new n(this.values,this.type_)},i.getType=function(){return t.CSSStyleValueType.kMinType},i.sumValue=function(){var t=this.numericValues()[0].sumValue();if(!t.length)return null;for(var e,n=we(this.numericValues());!(e=n()).done;){var i=e.value.sumValue();if(!i.length||JSON.stringify(i[0].units)!==JSON.stringify(t[0].units))return null;t[0].value>i[0].value&&(t=i)}return t},i.buildCSSText=function(e,n,i){i+="min(";for(var r,o=!0,a=we(this.numericValues());!(r=a()).done;){o||(i+=", "),o=!1,i=r.value.buildCSSText(t.Nested.kYes,t.ParenLess.kYes,i)}return i+=")"},n}(Go),Ho=function(e){function n(){for(var t,n=arguments.length,i=new Array(n),r=0;n>r;r++)i[r]=arguments[r];return(t=e.call.apply(e,[this].concat(i))||this).operator="max",t}ve(n,e),n.create=function(t){return new n(t,Bo(t,No.add))};var i=n.prototype;return i.clone=function(){return new n(this.values,this.type_)},i.getType=function(){return t.CSSStyleValueType.kMaxType},i.sumValue=function(){var t=this.numericValues()[0].sumValue();if(!t.length)return null;for(var e,n=we(this.numericValues());!(e=n()).done;){var i=e.value.sumValue();if(!i.length||JSON.stringify(i[0].units)!==JSON.stringify(t[0].units))return null;t[0].value>i[0].value&&(t=i)}return t},i.buildCSSText=function(e,n,i){i+="max(";for(var r,o=!0,a=we(this.numericValues());!(r=a()).done;){o||(i+=", "),o=!1,i=r.value.buildCSSText(t.Nested.kYes,t.ParenLess.kYes,i)}return i+=")"},n}(Go),zo=function(e){function n(){for(var t,n=arguments.length,i=new Array(n),r=0;n>r;r++)i[r]=arguments[r];return(t=e.call.apply(e,[this].concat(i))||this).operator="sum",t}ve(n,e),n.create=function(t){return new n(t,Bo(t,No.add))},n.numericTypeFromUnitMap=function(t){var e=new No;return Object.keys(t).forEach((function(n){var i=t[n];e=No.multiply(e,new No(Number(n),i),false),Oe(!0)})),e},n.canCreateNumericTypeFromSumValue=function(t){var e=this;Oe(!!t.length);var n=this.numericTypeFromUnitMap(t[0].units);return t.every((function(t){return No.add(n,e.numericTypeFromUnitMap(t.units),false),!0}))};var i=n.prototype;return i.clone=function(){return new n(this.values,this.type_)},i.getType=function(){return t.CSSStyleValueType.kSumType},i.sumValue=function(){var t=[];return this.numericValues().forEach((function(e){var n=e.sumValue();if(!n.length)return null;n.forEach((function(e){var n=t.findIndex((function(t){return JSON.stringify(t.units)===JSON.stringify(e.units)}));-1===n?t.push(ye({},e)):t[n].value+=e.value}))})),n.canCreateNumericTypeFromSumValue(t)?t:null},i.buildCSSText=function(e,n,i){n==t.ParenLess.kNo&&(i+=e===t.Nested.kYes?"(":"calc(");var r=this.numericValues();i=r[0].buildCSSText(t.Nested.kYes,t.ParenLess.kNo,i);for(var o=1;r.length>o;o++){var a=r[o];i=a.getType()===t.CSSStyleValueType.kNegateType?a.value.buildCSSText(t.Nested.kYes,t.ParenLess.kNo,i+=" - "):a.buildCSSText(t.Nested.kYes,t.ParenLess.kNo,i+=" + ")}return n===t.ParenLess.kNo&&(i+=")"),i},n}(Go),Wo=function(e){function n(){for(var t,n=arguments.length,i=new Array(n),r=0;n>r;r++)i[r]=arguments[r];return(t=e.call.apply(e,[this].concat(i))||this).operator="product",t}ve(n,e),n.create=function(t){return new n(t,Bo(t,No.multiply))},n.multiplyUnitMaps=function(t,e){return Object.keys(e).forEach((function(n){Re(e[n].value,0);var i=n in t?t[n].value:0;i+e[n].value===0?delete t[n]:t[n]=i+e[n].value})),t};var i=n.prototype;return i.clone=function(){return new n(this.values,this.type_)},i.getType=function(){return t.CSSStyleValueType.kProductType},i.sumValue=function(){var t=[{value:1,units:{}}];return this.numericValues().forEach((function(e){var i=e.sumValue();if(!i.length)return null;var r=[];t.forEach((function(t){i.forEach((function(e){r.push({value:t.value*e.value,units:n.multiplyUnitMaps(t.units,e.units)})}))})),t=r})),t},i.buildCSSText=function(e,n,i){n==t.ParenLess.kNo&&(i+=e===t.Nested.kYes?"(":"calc(");var r=this.numericValues();i=r[0].buildCSSText(t.Nested.kYes,t.ParenLess.kNo,i);for(var o=1;r.length>o;o++){var a=r[o];i=a.getType()===t.CSSStyleValueType.kInvertType?a.value.buildCSSText(t.Nested.kYes,t.ParenLess.kNo,i+=" / "):a.buildCSSText(t.Nested.kYes,t.ParenLess.kNo,i+=" * ")}return n===t.ParenLess.kNo&&(i+=")"),i},n}(Go),Yo=new Lo(0,"px"),qo=new Lo(0,"deg"),Xo=function(t){function e(e,n,i,r,o){var a;return void 0===r&&(r=1),void 0===o&&(o=!1),(a=t.call(this,"rgb")||this).r=void 0,a.g=void 0,a.b=void 0,a.alpha=void 0,a.isNone=void 0,a.r=e,a.g=n,a.b=i,a.alpha=r,a.isNone=o,a}ve(e,t);var n=e.prototype;return n.clone=function(){return new e(this.r,this.g,this.b,this.alpha)},n.buildCSSText=function(t,e,n){return n+"rgba("+this.r+","+this.g+","+this.b+","+this.alpha+")"},e}(xo);(Vo=t.GradientPatternType||(t.GradientPatternType={}))[Vo.Constant=0]="Constant",Vo[Vo.LinearGradient=1]="LinearGradient",Vo[Vo.RadialGradient=2]="RadialGradient",Vo[Vo.Pattern=3]="Pattern";var Ko=function(e){function n(t,n){var i;return(i=e.call(this)||this).type=void 0,i.value=void 0,i.type=t,i.value=n,i}ve(n,e);var i=n.prototype;return i.clone=function(){return new n(this.type,this.value)},i.buildCSSText=function(e,n,i){var r="";return this.type===t.GradientPatternType.LinearGradient?r="linear-gradient("+this.value.steps.map((function(t){return t.join(",")})).join(",")+")":this.type===t.GradientPatternType.RadialGradient?r="radial-gradient("+this.value.steps.map((function(t){return t.join(",")})).join(",")+")":this.type===t.GradientPatternType.Pattern&&(r="url("+this.value.src+")"),i+r},i.getType=function(){return t.CSSStyleValueType.kColorType},n}(wo);function Zo(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Jo(t,e){var n=Object.create(t.prototype);for(var i in e)n[i]=e[i];return n}function Qo(){}var $o=.7,ta=1/$o,ea="\\s*([+-]?\\d+)\\s*",na="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",ia="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",ra=/^#([0-9a-f]{3,8})$/,oa=new RegExp("^rgb\\("+[ea,ea,ea]+"\\)$"),aa=new RegExp("^rgb\\("+[ia,ia,ia]+"\\)$"),sa=new RegExp("^rgba\\("+[ea,ea,ea,na]+"\\)$"),ua=new RegExp("^rgba\\("+[ia,ia,ia,na]+"\\)$"),ca=new RegExp("^hsl\\("+[na,ia,ia]+"\\)$"),la=new RegExp("^hsla\\("+[na,ia,ia,na]+"\\)$"),ha={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function pa(){return this.rgb().formatHex()}function fa(){return this.rgb().formatRgb()}function da(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=ra.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?ya(e):3===n?new ma(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?va(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?va(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=oa.exec(t))?new ma(e[1],e[2],e[3],1):(e=aa.exec(t))?new ma(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=sa.exec(t))?va(e[1],e[2],e[3],e[4]):(e=ua.exec(t))?va(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=ca.exec(t))?Ea(e[1],e[2]/100,e[3]/100,1):(e=la.exec(t))?Ea(e[1],e[2]/100,e[3]/100,e[4]):ha.hasOwnProperty(t)?ya(ha[t]):"transparent"===t?new ma(NaN,NaN,NaN,0):null}function ya(t){return new ma(t>>16&255,t>>8&255,255&t,1)}function va(t,e,n,i){return i>0||(t=e=n=NaN),new ma(t,e,n,i)}function ga(t){return t instanceof Qo||(t=da(t)),t?new ma((t=t.rgb()).r,t.g,t.b,t.opacity):new ma}function ma(t,e,n,i){this.r=+t,this.g=+e,this.b=+n,this.opacity=+i}function Ta(){return"#"+ba(this.r)+ba(this.g)+ba(this.b)}function Sa(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function ba(t){return(16>(t=Math.max(0,Math.min(255,Math.round(t)||0)))?"0":"")+t.toString(16)}function Ea(t,e,n,i){return i>0?n>0&&1>n?e>0||(t=NaN):t=e=NaN:t=e=n=NaN,new xa(t,e,n,i)}function wa(t){if(t instanceof xa)return new xa(t.h,t.s,t.l,t.opacity);if(t instanceof Qo||(t=da(t)),!t)return new xa;if(t instanceof xa)return t;var e=(t=t.rgb()).r/255,n=t.g/255,i=t.b/255,r=Math.min(e,n,i),o=Math.max(e,n,i),a=NaN,s=o-r,u=(o+r)/2;return s?(a=e===o?(n-i)/s+6*(i>n):n===o?(i-e)/s+2:(e-n)/s+4,s/=.5>u?o+r:2-o-r,a*=60):s=u>0&&1>u?0:a,new xa(a,s,u,t.opacity)}function xa(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}function Pa(t,e,n){return 255*(60>t?e+(n-e)*t/60:180>t?n:240>t?e+(n-e)*(240-t)/60:e)}Zo(Qo,da,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:pa,formatHex:pa,formatHsl:function(){return wa(this).formatHsl()},formatRgb:fa,toString:fa}),Zo(ma,(function(t,e,n,i){return 1===arguments.length?ga(t):new ma(t,e,n,null==i?1:i)}),Jo(Qo,{brighter:function(t){return t=null==t?ta:Math.pow(ta,t),new ma(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?$o:Math.pow($o,t),new ma(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return this.r>=-.5&&255.5>this.r&&this.g>=-.5&&255.5>this.g&&this.b>=-.5&&255.5>this.b&&this.opacity>=0&&1>=this.opacity},hex:Ta,formatHex:Ta,formatRgb:Sa,toString:Sa})),Zo(xa,(function(t,e,n,i){return 1===arguments.length?wa(t):new xa(t,e,n,null==i?1:i)}),Jo(Qo,{brighter:function(t){return t=null==t?ta:Math.pow(ta,t),new xa(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?$o:Math.pow($o,t),new xa(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(0>this.h),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,i=n+(.5>n?n:1-n)*e,r=2*n-i;return new ma(Pa(240>t?t+120:t-240,r,i),Pa(t,r,i),Pa(120>t?t+240:t-120,r,i),this.opacity)},displayable:function(){return(this.s>=0&&1>=this.s||isNaN(this.s))&&this.l>=0&&1>=this.l&&this.opacity>=0&&1>=this.opacity},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var ka=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,Ca=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,Na=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,_a=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;function Ma(e){if(De(e)&&(e=""),"transparent"===e)return new Xo(0,0,0,0);"currentColor"===e&&(e="black");var n=e[0];if("("===e[1]||"("===e[2])if("l"===n){var i=function(t){var e=ka.exec(t);if(e){var n,i,r,o=parseFloat(e[1])%360*(Math.PI/180),a=(null===(n=e[2].match(_a))||void 0===n?void 0:n.map((function(t){return t.split(":")})))||[],s=1,u=1,c=0,l=0;o>=0&&o<.5*Math.PI?(i={x:c,y:l},r={x:s,y:u}):.5*Math.PI<=o&&o<Math.PI?(i={x:s,y:l},r={x:c,y:u}):Math.PI<=o&&o<1.5*Math.PI?(i={x:s,y:u},r={x:c,y:l}):(i={x:c,y:u},r={x:s,y:l});var h=Math.tan(o),p=h*h;return{x0:i.x,y0:i.y,x1:(r.x-i.x+h*(r.y-i.y))/(p+1)+i.x,y1:h*(r.x-i.x+h*(r.y-i.y))/(p+1)+i.y,steps:a,hash:t}}return null}(e);if(i)return new Ko(t.GradientPatternType.LinearGradient,i)}else if("r"===n){var r=function(t){var e=Ca.exec(t);if(e){var n,i=parseFloat(e[1]),r=parseFloat(e[2]),o=parseFloat(e[3]),a=(null===(n=e[4].match(_a))||void 0===n?void 0:n.map((function(t){return t.split(":")})))||[];if(0===o){var s=e[4].match(_a);return s[s.length-1].split(":")[1]}return{x0:i,y0:r,r0:0,x1:.5,y1:.5,r1:o,steps:a,hash:t}}return null}(e);if(r){if(!Ji(r))return new Ko(t.GradientPatternType.RadialGradient,r);e=r}}else if("p"===n){var o=function(t){var e=Na.exec(t);if(e){var n=e[1],i=e[2];switch(n){case"a":n="repeat";break;case"x":n="repeat-x";break;case"y":n="repeat-y";break;default:n="no-repeat"}return{src:i,repetition:n,hash:t}}return null}(e);if(o)return new Ko(t.GradientPatternType.Pattern,o)}var a=da(e),s=[0,0,0,0];return null!==a&&(s[0]=a.r||0,s[1]=a.g||0,s[2]=a.b||0,s[3]=a.opacity),Te(Xo,s)}function Aa(t,e){if(t instanceof Xo&&e instanceof Xo)return[[Number(t.r),Number(t.g),Number(t.b),Number(t.alpha)],[Number(e.r),Number(e.g),Number(e.b),Number(e.alpha)],function(t){var e=t.slice();if(e[3])for(var n=0;3>n;n++)e[n]=Math.round(ni(e[n],0,255));return e[3]=ni(e[3],0,1),"rgba("+e.join(",")+")"}]}var Oa,Ia=function(){function t(t,e){this.center=void 0,this.halfExtents=void 0,this.min=vn(),this.max=vn(),this.update(t,e)}t.isEmpty=function(t){return!t||0===t.halfExtents[0]&&0===t.halfExtents[1]&&0===t.halfExtents[2]};var e=t.prototype;return e.update=function(t,e){this.center=Sn(vn(),t||vn()),this.halfExtents=Sn(vn(),e||Tn(0,0,0)),this.min=Rn(this.min,this.center,this.halfExtents),this.max=En(this.max,this.center,this.halfExtents)},e.setMinMax=function(t,e){En(this.center,e,t),Pn(this.center,this.center,.5),Rn(this.halfExtents,e,t),Pn(this.halfExtents,this.halfExtents,.5),Sn(this.min,t),Sn(this.max,e)},e.getMin=function(){return this.min},e.getMax=function(){return this.max},e.add=function(e){if(!t.isEmpty(e))if(t.isEmpty(this))this.setMinMax(e.getMin(),e.getMax());else{var n=this.center,i=n[0],r=n[1],o=n[2],a=this.halfExtents,s=a[0],u=a[1],c=a[2],l=i-s,h=i+s,p=r-u,f=r+u,d=o-c,y=o+c,v=e.center,g=v[0],m=v[1],T=v[2],S=e.halfExtents,b=S[0],E=S[1],w=S[2],x=g-b,P=g+b,k=m-E,C=m+E,N=T-w,_=T+w;l>x&&(l=x),P>h&&(h=P),p>k&&(p=k),C>f&&(f=C),d>N&&(d=N),_>y&&(y=_),n[0]=.5*(l+h),n[1]=.5*(p+f),n[2]=.5*(d+y),a[0]=.5*(h-l),a[1]=.5*(f-p),a[2]=.5*(y-d),this.min[0]=l,this.min[1]=p,this.min[2]=d,this.max[0]=h,this.max[1]=f,this.max[2]=y}},e.setFromTransformedAABB=function(t,e){var n=this.center,i=this.halfExtents,r=t.center,o=t.halfExtents,a=e[0],s=e[4],u=e[8],c=e[1],l=e[5],h=e[9],p=e[2],f=e[6],d=e[10],y=Math.abs(a),v=Math.abs(s),g=Math.abs(u),m=Math.abs(c),T=Math.abs(l),S=Math.abs(h),b=Math.abs(p),E=Math.abs(f),w=Math.abs(d);bn(n,e[12]+a*r[0]+s*r[1]+u*r[2],e[13]+c*r[0]+l*r[1]+h*r[2],e[14]+p*r[0]+f*r[1]+d*r[2]),bn(i,y*o[0]+v*o[1]+g*o[2],m*o[0]+T*o[1]+S*o[2],b*o[0]+E*o[1]+w*o[2]),this.min=Rn(this.min,n,i),this.max=En(this.max,n,i)},e.intersects=function(t){var e=this.getMax(),n=this.getMin(),i=t.getMax(),r=t.getMin();return!(n[0]>i[0]||r[0]>e[0]||n[1]>i[1]||r[1]>e[1]||n[2]>i[2]||r[2]>e[2])},e.intersection=function(e){if(!this.intersects(e))return null;var n,i,r,o=new t,a=(n=vn(),i=this.getMin(),r=e.getMin(),n[0]=Math.max(i[0],r[0]),n[1]=Math.max(i[1],r[1]),n[2]=Math.max(i[2],r[2]),n),s=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t}(vn(),this.getMax(),e.getMax());return o.setMinMax(a,s),o},e.containsPoint=function(t){var e=this.getMin(),n=this.getMax();return!(e[0]>t[0]||t[0]>n[0]||e[1]>t[1]||t[1]>n[1]||e[2]>t[2]||t[2]>n[2])},e.getNegativeFarPoint=function(t){return 273===t.pnVertexFlag?Sn(vn(),this.min):272===t.pnVertexFlag?Tn(this.min[0],this.min[1],this.max[2]):257===t.pnVertexFlag?Tn(this.min[0],this.max[1],this.min[2]):256===t.pnVertexFlag?Tn(this.min[0],this.max[1],this.max[2]):17===t.pnVertexFlag?Tn(this.max[0],this.min[1],this.min[2]):16===t.pnVertexFlag?Tn(this.max[0],this.min[1],this.max[2]):Tn(this.max[0],this.max[1],1===t.pnVertexFlag?this.min[2]:this.max[2])},e.getPositiveFarPoint=function(t){return 273===t.pnVertexFlag?Sn(vn(),this.max):272===t.pnVertexFlag?Tn(this.max[0],this.max[1],this.min[2]):257===t.pnVertexFlag?Tn(this.max[0],this.min[1],this.max[2]):256===t.pnVertexFlag?Tn(this.max[0],this.min[1],this.min[2]):17===t.pnVertexFlag?Tn(this.min[0],this.max[1],this.max[2]):16===t.pnVertexFlag?Tn(this.min[0],this.max[1],this.min[2]):Tn(this.min[0],this.min[1],1===t.pnVertexFlag?this.max[2]:this.min[2])},t}(),Ra=vn(),La=function(){function t(t,e){this.center=void 0,this.radius=void 0,this.center=t||vn(),this.radius=e||.5}var e=t.prototype;return e.containsPoint=function(t){return Rn(Ra,t,this.center),mn(Ra)<this.radius*this.radius},e.intersects=function(t){Rn(Ra,t.center,this.center);var e=t.radius+this.radius;return mn(Ra)<=e*e},t}(),Da=function(){function t(t,e){this.distance=void 0,this.normal=void 0,this.pnVertexFlag=void 0,this.distance=t||0,this.normal=e||Tn(0,1,0),this.updatePNVertexFlag()}var e=t.prototype;return e.updatePNVertexFlag=function(){this.pnVertexFlag=(Number(this.normal[0]>=0)<<8)+(Number(this.normal[1]>=0)<<4)+Number(this.normal[2]>=0)},e.distanceToPoint=function(t){return Nn(t,this.normal)-this.distance},e.normalize=function(){var t=1/Un(this.normal);Pn(this.normal,this.normal,t),this.distance*=t},e.intersectsLine=function(t,e,n){var i=this.distanceToPoint(t),r=i/(i-this.distanceToPoint(e)),o=r>=0&&1>=r;return o&&n&&Mn(n,t,e,r),o},t}();(Oa=t.Mask||(t.Mask={}))[Oa.OUTSIDE=4294967295]="OUTSIDE",Oa[Oa.INSIDE=0]="INSIDE",Oa[Oa.INDETERMINATE=2147483647]="INDETERMINATE";var Ua=function(){function t(t){if(this.planes=[],t)this.planes=t;else for(var e=0;6>e;e++)this.planes.push(new Da)}return t.prototype.extractFromVPMatrix=function(t){var e=t[0],n=t[1],i=t[2],r=t[3],o=t[4],a=t[5],s=t[6],u=t[7],c=t[8],l=t[9],h=t[10],p=t[11],f=t[12],d=t[13],y=t[14],v=t[15];bn(this.planes[0].normal,r-e,u-o,p-c),this.planes[0].distance=v-f,bn(this.planes[1].normal,r+e,u+o,p+c),this.planes[1].distance=v+f,bn(this.planes[2].normal,r+n,u+a,p+l),this.planes[2].distance=v+d,bn(this.planes[3].normal,r-n,u-a,p-l),this.planes[3].distance=v-d,bn(this.planes[4].normal,r-i,u-s,p-h),this.planes[4].distance=v-y,bn(this.planes[5].normal,r+i,u+s,p+h),this.planes[5].distance=v+y,this.planes.forEach((function(t){t.normalize(),t.updatePNVertexFlag()}))},t}(),Fa=vn(),Ba=vn(),Va=vn(),Ga=vn(),ja=vn(),Ha=function(){function t(t,e){this.origin=void 0,this.direction=void 0,this.origin=t||vn(),this.direction=e||Tn(0,0,-1)}var e=t.prototype;return e.intersectsAABB=function(t,e){return e?this.intersectAABBWithIntersection(t,e):this.intersectsAABBWithoutIntersection(t)},e.intersectsSphere=function(t,e){var n=Rn(Fa,this.origin,t.center);Cn(Ba,Sn(Ba,this.direction));var i=Nn(n,Ba),r=Nn(n,n)-t.radius*t.radius;if(r>0&&i>0)return null;var o=i*i-r;if(0>o)return!1;var a=Math.abs(-i-Math.sqrt(o));return e&&(Sn(e,this.direction),kn(e,this.origin,e,a)),!0},e.intersectsPlane=function(t,e){var n=(t.distance-Nn(t.normal,this.origin))/Nn(t.normal,this.direction),i=n>=0;return i&&e&&kn(e,this.origin,this.direction,n),i},e.intersectsAABBWithoutIntersection=function(t){var e=Fa,n=Ba,i=Va,r=Ga,o=ja,a=this.direction;return Rn(e,this.origin,t.center),bn(r,Math.abs(e[0]),Math.abs(e[1]),Math.abs(e[2])),Ln(i,e,a),!(r[0]>t.halfExtents[0]&&i[0]>=0||r[1]>t.halfExtents[1]&&i[1]>=0||r[2]>t.halfExtents[2]&&i[2]>=0)&&(bn(o,Math.abs(a[0]),Math.abs(a[1]),Math.abs(a[2])),_n(n,a,e),bn(n,Math.abs(n[0]),Math.abs(n[1]),Math.abs(n[2])),!(n[0]>t.halfExtents[1]*o[2]+t.halfExtents[2]*o[1]||n[1]>t.halfExtents[0]*o[2]+t.halfExtents[2]*o[0]||n[2]>t.halfExtents[0]*o[1]+t.halfExtents[1]*o[0]))},e.intersectAABBWithIntersection=function(t,e){var n=Sn(vn(),t.getMin());Rn(n,n,this.origin);var i=Sn(vn(),t.getMax());Rn(i,i,this.origin);var r=this.direction;0===r[0]?(n[0]=0>n[0]?-Number.MAX_VALUE:Number.MAX_VALUE,i[0]=0>i[0]?-Number.MAX_VALUE:Number.MAX_VALUE):(n[0]/=r[0],i[0]/=r[0]),0===r[1]?(n[1]=0>n[1]?-Number.MAX_VALUE:Number.MAX_VALUE,i[1]=0>i[1]?-Number.MAX_VALUE:Number.MAX_VALUE):(n[1]/=r[1],i[1]/=r[1]),0===r[2]?(n[2]=0>n[2]?-Number.MAX_VALUE:Number.MAX_VALUE,i[2]=0>i[2]?-Number.MAX_VALUE:Number.MAX_VALUE):(n[2]/=r[2],i[2]/=r[2]);var o=bn(Va,Math.min(n[0],i[0]),Math.min(n[1],i[1]),Math.min(n[2],i[2])),a=bn(Ga,Math.max(n[0],i[0]),Math.max(n[1],i[1]),Math.max(n[2],i[2])),s=Math.min(Math.min(a[0],a[1]),a[2]),u=Math.max(Math.max(o[0],o[1]),o[2]),c=s>=u&&u>=0;return c&&(Sn(e,this.direction),kn(e,this.origin,e,u)),c},t}(),za=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=0,this.y=0,this.x=t,this.y=e}var e=t.prototype;return e.clone=function(){return new t(this.x,this.y)},e.copyFrom=function(t){this.x=t.x,this.y=t.y},t}(),Wa=function(){function t(t,e,n,i){this.x=void 0,this.y=void 0,this.width=void 0,this.height=void 0,this.left=void 0,this.right=void 0,this.top=void 0,this.bottom=void 0,this.x=t,this.y=e,this.width=n,this.height=i,this.left=t,this.right=t+n,this.top=e,this.bottom=e+i}return t.prototype.toJSON=function(){},t}();function Ya(t,e){if(De(e))return new Lo(0,"px");if(e=(""+e).trim().toLowerCase(),isFinite(Number(e))){if("px".search(t)>=0)return new Lo(Number(e),"px");if("deg".search(t)>=0)return new Lo(Number(e),"deg")}var n=[];e=e.replace(t,(function(t){return n.push(t),"U"+t}));var i="U("+t.source+")";return n.map((function(t){return new Lo(Number(e.replace(new RegExp("U"+t,"g"),"").replace(new RegExp(i,"g"),"*0")),t)}))[0]}function qa(t){return Ya(new RegExp("px","g"),t)}function Xa(t){return Ya(new RegExp("px|%|em|rem","g"),t)}function Ka(t){return Ya(new RegExp("deg|rad|grad|turn","g"),t)}function Za(t,e,n,i,r){void 0===r&&(r=0);var o="",a=t.value||0,s=e.value||0;return(Lo.isLength(t.unit)||Lo.isLength(e.unit))&&(a=ts(t,r,n),s=ts(e,r,n),o="px"),(Lo.isAngle(t.unit)||Lo.isAngle(e.unit))&&(a=Ja(t),s=Ja(e),o="deg"),[a,s,function(t){return i&&(t=Math.max(t,0)),t+o}]}function Ja(e){var n=0;return e.unit===t.UnitType.kDegrees?n=e.value:e.unit===t.UnitType.kRadians?n=oi(Number(e.value)):e.unit===t.UnitType.kTurns&&(n=ai(Number(e.value))),n}function Qa(t){return Ji(t)?t.split(" ").map((function(t){return Xa(t)})):t.map((function(t){return Xa(t.toString())}))}function $a(t,e,n){if(t.length===e.length){var i=t[0].unit;return[t.map((function(t){return t.value})),e.map((function(t){return t.value})),function(t){return t.map((function(t){return new Lo(t,i)})).join(" ")}]}}function ts(e,n,i){if(e.unit===t.UnitType.kPixels)return Number(e.value);if(e.unit===t.UnitType.kPercentage&&i){var r=i.getGeometryBounds(),o=0;return Ia.isEmpty(r)||(o=2*r.halfExtents[n]),Number(e.value)/100*o}return 0}function es(t){return t.toString()}function ns(t){return"number"==typeof t?new Lo(t):/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t)?new Lo(Number(t)):new Lo(0)}function is(t,e){return[t.value,e.value,es]}function rs(t,e){return function(n,i){return[n.value,i.value,function(n){return es(ni(n,t,e))}]}}var os=/[MLHVQTCSAZ]([^MLHVQTCSAZ]*)/gi,as=/[^\s,]+/gi;var ss=new RegExp("([a-z])[\\s,]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?[\\s]*,?[\\s]*)+)","ig"),us=new RegExp("(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)[\\s]*,?[\\s]*","ig");var cs=/[a-z]/;function ls(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}function hs(t){var e=function(t){if("string"==typeof t){if(t){var e={a:7,c:6,o:2,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,u:3,z:0},n=[];return t.replace(ss,(function(t,i,r){var o=[],a=i.toLowerCase();if(r.replace(us,(function(t,e){e&&o.push(+e)})),"m"===a&&o.length>2&&(n.push([i].concat(o.splice(0,2))),a="l",i="m"===i?"l":"L"),"o"===a&&1===o.length&&n.push([i,o[0]]),"r"===a)n.push([i].concat(o));else for(;o.length>=e[a]&&(n.push([i].concat(o.splice(0,e[a]))),e[a]););return""})),n}return null}if(Array.isArray(t))return t}(t);if(!e||!e.length)return[["M",0,0]];for(var n=!1,i=0;e.length>i;i++){if(cs.test(p=e[i][0])||["V","H","T","S"].indexOf(p)>=0){n=!0;break}}if(!n)return e;var r=[],o=0,a=0,s=0,u=0,c=0,l=e[0];"M"!==l[0]&&"m"!==l[0]||(s=o=+l[1],u=a=+l[2],c++,r[0]=["M",o,a]);i=c;for(var h=e.length;h>i;i++){var p,f=e[i],d=r[i-1],y=[],v=(p=f[0]).toUpperCase();if(p!==v)switch(y[0]=v,v){case"A":y[1]=f[1],y[2]=f[2],y[3]=f[3],y[4]=f[4],y[5]=f[5],y[6]=+f[6]+o,y[7]=+f[7]+a;break;case"V":y[1]=+f[1]+a;break;case"H":y[1]=+f[1]+o;break;case"M":u=+f[2]+a,y[1]=s=+f[1]+o,y[2]=u;break;default:for(var g=1,m=f.length;m>g;g++)y[g]=+f[g]+(g%2?o:a)}else y=e[i];switch(v){case"Z":o=+s,a=+u;break;case"H":y=["L",o=y[1],a];break;case"V":y=["L",o,a=y[1]];break;case"T":o=y[1],a=y[2];var T=ls([d[1],d[2]],[d[3],d[4]]);y=["Q",T[0],T[1],o,a];break;case"S":o=y[y.length-2],a=y[y.length-1];var S=d.length,b=ls([d[S-4],d[S-3]],[d[S-2],d[S-1]]);y=["C",b[0],b[1],y[1],y[2],o,a];break;case"M":s=y[y.length-2],u=y[y.length-1];break;default:o=y[y.length-2],a=y[y.length-1]}r.push(y)}return r}var ps=2*Math.PI,fs=function(t,e,n,i,r,o,a){var s=t.x,u=t.y;return{x:i*(s*=e)-r*(u*=n)+o,y:r*s+i*u+a}},ds=function(t,e){var n=1.5707963267948966===e?.551915024494:-1.5707963267948966===e?-.551915024494:4/3*Math.tan(e/4),i=Math.cos(t),r=Math.sin(t),o=Math.cos(t+e),a=Math.sin(t+e);return[{x:i-r*n,y:r+i*n},{x:o+a*n,y:a-o*n},{x:o,y:a}]},ys=function(t,e,n,i){var r=t*n+e*i;return r>1&&(r=1),-1>r&&(r=-1),(0>t*i-e*n?-1:1)*Math.acos(r)},vs=function(t){var e=t.px,n=t.py,i=t.cx,r=t.cy,o=t.rx,a=t.ry,s=t.xAxisRotation,u=void 0===s?0:s,c=t.largeArcFlag,l=void 0===c?0:c,h=t.sweepFlag,p=void 0===h?0:h,f=[];if(0===o||0===a)return[{x1:0,y1:0,x2:0,y2:0,x:i,y:r}];var d=Math.sin(u*ps/360),y=Math.cos(u*ps/360),v=y*(e-i)/2+d*(n-r)/2,g=-d*(e-i)/2+y*(n-r)/2;if(0===v&&0===g)return[{x1:0,y1:0,x2:0,y2:0,x:i,y:r}];o=Math.abs(o),a=Math.abs(a);var m=Math.pow(v,2)/Math.pow(o,2)+Math.pow(g,2)/Math.pow(a,2);m>1&&(o*=Math.sqrt(m),a*=Math.sqrt(m));var T=function(t,e,n,i,r,o,a,s,u,c,l,h){var p=Math.pow(r,2),f=Math.pow(o,2),d=Math.pow(l,2),y=Math.pow(h,2),v=p*f-p*y-f*d;0>v&&(v=0),v/=p*y+f*d;var g=(v=Math.sqrt(v)*(a===s?-1:1))*r/o*h,m=v*-o/r*l,T=c*g-u*m+(t+n)/2,S=u*g+c*m+(e+i)/2,b=(l-g)/r,E=(h-m)/o,w=(-l-g)/r,x=(-h-m)/o,P=ys(1,0,b,E),k=ys(b,E,w,x);return 0===s&&k>0&&(k-=ps),1===s&&0>k&&(k+=ps),[T,S,P,k]}(e,n,i,r,o,a,l,p,d,y,v,g),S=T[0],b=T[1],E=T[2],w=T[3],x=Math.abs(w)/(ps/4);1e-7>Math.abs(1-x)&&(x=1);var P=Math.max(Math.ceil(x),1);w/=P;for(var k=0;P>k;k++)f.push(ds(E,w)),E+=w;return f.map((function(t){var e=fs(t[0],o,a,y,d,S,b),n=e.x,i=e.y,r=fs(t[1],o,a,y,d,S,b),s=r.x,u=r.y,c=fs(t[2],o,a,y,d,S,b);return{x1:n,y1:i,x2:s,y2:u,x:c.x,y:c.y}}))};function gs(t,e,n,i,r,o,a,s,u){return vs({px:t,py:e,cx:s,cy:u,rx:n,ry:i,xAxisRotation:r,largeArcFlag:o,sweepFlag:a}).reduce((function(t,e){return t.push(e.x1,e.y1,e.x2,e.y2,e.x,e.y),t}),[])}function ms(t,e,n,i,r,o){var a=1/3,s=2/3;return[a*t+s*n,a*e+s*i,a*r+s*n,a*o+s*i,r,o]}function Ts(t,e,n,i){return[t,e,n,i,n,i]}function Ss(t,e){0>"TQ".indexOf(t[0])&&(e.qx=null,e.qy=null);var n=t.slice(1),i=n[0],r=n[1];switch(t[0]){case"M":return e.x=i,e.y=r,t;case"A":return["C"].concat(gs.apply(0,[e.x1,e.y1].concat(t.slice(1))));case"Q":return e.qx=i,e.qy=r,["C"].concat(ms.apply(0,[e.x1,e.y1].concat(t.slice(1))));case"L":return["C"].concat(Ts(e.x1,e.y1,t[1],t[2]));case"H":return["C"].concat(Ts(e.x1,e.y1,t[1],e.y1));case"V":return["C"].concat(Ts(e.x1,e.y1,e.x1,t[1]));case"Z":return["C"].concat(Ts(e.x1,e.y1,e.x,e.y))}return t}function bs(t,e,n){if(t[n].length>7){t[n].shift();for(var i=t[n],r=n;i.length;)e[n]="A",t.splice(r+=1,0,["C"].concat(i.splice(0,6)));t.splice(n,1)}}var Es=Math.PI/180;function ws(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function xs(t,e){return ws(t)*ws(e)?(t[0]*e[0]+t[1]*e[1])/(ws(t)*ws(e)):1}function Ps(t,e){return(t[1]*e[0]>t[0]*e[1]?-1:1)*Math.acos(xs(t,e))}function ks(t,e){return t[0]===e[0]&&t[1]===e[1]}function Cs(t,e){var n,i=e[1],r=e[2],o=(n=2*Math.PI,(Es*e[3]%n+n)%n),a=e[4],s=e[5],u=t[0],c=t[1],l=e[6],h=e[7],p=Math.cos(o)*(u-l)/2+Math.sin(o)*(c-h)/2,f=-1*Math.sin(o)*(u-l)/2+Math.cos(o)*(c-h)/2,d=p*p/(i*i)+f*f/(r*r);d>1&&(i*=Math.sqrt(d),r*=Math.sqrt(d));var y=i*i*(f*f)+r*r*(p*p),v=y?Math.sqrt((i*i*(r*r)-y)/y):1;a===s&&(v*=-1),isNaN(v)&&(v=0);var g=r?v*i*f/r:0,m=i?v*-r*p/i:0,T=(u+l)/2+Math.cos(o)*g-Math.sin(o)*m,S=(c+h)/2+Math.sin(o)*g+Math.cos(o)*m,b=[(p-g)/i,(f-m)/r],E=[(-1*p-g)/i,(-1*f-m)/r],w=Ps([1,0],b),x=Ps(b,E);return xs(b,E)>-1||(x=Math.PI),1>xs(b,E)||(x=0),0===s&&x>0&&(x-=2*Math.PI),1===s&&0>x&&(x+=2*Math.PI),{cx:T,cy:S,rx:ks(t,[l,h])?0:i,ry:ks(t,[l,h])?0:r,startAngle:w,endAngle:w+x,xRotation:o,arcFlag:a,sweepFlag:s}}function Ns(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}function _s(t){t=function(t){var e=t||[];return Array.isArray(e)?e:"string"==typeof e?((e=e.match(os)).forEach((function(t,n){if((t=t.match(as))[0].length>1){var i=t[0].charAt(0);t.splice(1,0,t[0].substr(1)),t[0]=i}t.forEach((function(e,n){isNaN(e)||(t[n]=+e)})),e[n]=t})),e):void 0}(t);for(var e=[],n=null,i=null,r=null,o=0,a=t.length,s=0;a>s;s++){var u=t[s];i=t[s+1];var c=u[0],l={command:c,prePoint:n,params:u,startTangent:null,endTangent:null};switch(c){case"M":r=[u[1],u[2]],o=s;break;case"A":var h=Cs(n,u);l.arcParams=h}if("Z"===c)n=r,i=t[o+1];else{var p=u.length;n=[u[p-2],u[p-1]]}i&&"Z"===i[0]&&(i=t[o],e[o]&&(e[o].prePoint=n)),l.currentPoint=n,e[o]&&ks(n,e[o].currentPoint)&&(e[o].prePoint=l.prePoint),l.nextPoint=i?[i[i.length-2],i[i.length-1]]:null;var f=l.prePoint;if(["L","H","V"].includes(c))l.startTangent=[f[0]-n[0],f[1]-n[1]],l.endTangent=[n[0]-f[0],n[1]-f[1]];else if("Q"===c){l.startTangent=[f[0]-(d=[u[1],u[2]])[0],f[1]-d[1]],l.endTangent=[n[0]-d[0],n[1]-d[1]]}else if("T"===c){var d=Ns((v=e[s-1]).currentPoint,f);"Q"===v.command?(l.command="Q",l.startTangent=[f[0]-d[0],f[1]-d[1]],l.endTangent=[n[0]-d[0],n[1]-d[1]]):(l.command="TL",l.startTangent=[f[0]-n[0],f[1]-n[1]],l.endTangent=[n[0]-f[0],n[1]-f[1]])}else if("C"===c){var y=[u[3],u[4]];l.startTangent=[f[0]-(g=[u[1],u[2]])[0],f[1]-g[1]],l.endTangent=[n[0]-y[0],n[1]-y[1]],0===l.startTangent[0]&&0===l.startTangent[1]&&(l.startTangent=[g[0]-y[0],g[1]-y[1]]),0===l.endTangent[0]&&0===l.endTangent[1]&&(l.endTangent=[y[0]-g[0],y[1]-g[1]])}else if("S"===c){var v,g=Ns((v=e[s-1]).currentPoint,f);y=[u[1],u[2]];"C"===v.command?(l.command="C",l.startTangent=[f[0]-g[0],f[1]-g[1]],l.endTangent=[n[0]-y[0],n[1]-y[1]]):(l.command="SQ",l.startTangent=[f[0]-y[0],f[1]-y[1]],l.endTangent=[n[0]-y[0],n[1]-y[1]])}else if("A"===c){var m=.001,T=l.arcParams||{},S=T.cx,b=void 0===S?0:S,E=T.cy,w=void 0===E?0:E,x=T.rx,P=void 0===x?0:x,k=T.ry,C=void 0===k?0:k,N=T.sweepFlag,_=T.startAngle,M=void 0===_?0:_,A=T.endAngle,O=void 0===A?0:A;0===(void 0===N?0:N)&&(m*=-1);var I=P*Math.cos(M-m)+b,R=C*Math.sin(M-m)+w;l.startTangent=[I-r[0],R-r[1]];var L=P*Math.cos(M+O+m)+b,D=C*Math.sin(M+O-m)+w;l.endTangent=[f[0]-L,f[1]-D]}e.push(l)}return e}function Ms(t,e){var n=hs(t),i=function(t){for(var e=!1,n=t.length,i=0;n>i;i++){var r=t[i][0];if("C"===r||"A"===r||"Q"===r){e=!0;break}}return e}(n),r=n.slice(),o=function(t){for(var e=[],n=[],i=[],r=0;t.length>r;r++){var o=t[r],a=o[0];"M"===a?(i.length&&(n.push(i),i=[]),i.push([o[1],o[2]])):"Z"===a?i.length&&(e.push(i),i=[]):i.push([o[1],o[2]])}i.length>0&&n.push(i);return{polygons:e,polylines:n}}(r),a=o.polygons,s=o.polylines,u=function(t,e){void 0===e&&(e=!1);for(var n,i,r=hs(t),o={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null},a=[],s="",u=r.length,c=[],l=0;u>l;l+=1)r[l]&&(s=r[l][0]),a[l]=s,r[l]=Ss(r[l],o),bs(r,a,l),u=r.length,"Z"===s&&c.push(l),o.x1=+(n=r[l])[(i=n.length)-2],o.y1=+n[i-1],o.x2=+n[i-4]||o.x1,o.y2=+n[i-3]||o.y1;return e?[r,c]:r}(r,!0),c=u[0],l=u[1],h=_s(r),p=function(t){var e,n,i,r,o=0,a=0,s=[];if(!t)return{curveSegments:[],totalLength:o};if(t.forEach((function(e,n){r=e.length,(i=t[n+1])&&(o+=dr.length(e[r-2],e[r-1],i[1],i[2],i[3],i[4],i[5],i[6])||0)})),0===o)return{curveSegments:[],totalLength:o};return t.forEach((function(u,c){r=u.length,(i=t[c+1])&&((e=[])[0]=a/o,n=dr.length(u[r-2],u[r-1],i[1],i[2],i[3],i[4],i[5],i[6]),e[1]=(a+=n||0)/o,s.push(e))})),{curveSegments:s,totalLength:o}}(c),f=p.totalLength,d=p.curveSegments,y=function(t){var e=0,n=0,i=[],r=[];t.forEach((function(t){var o=t.slice(-2),a=o[0],s=o[1];if("M"===t[0])e=a,n=s,i.push(a),r.push(s);else if("C"===t[0]){var u=dr.box.apply(dr,[e,n].concat(t.slice(1)));i=i.concat(u.x,u.x+u.width),r=r.concat(u.y,u.y+u.height),e=a,n=s}}));var o=Math.min.apply(0,i),a=Math.min.apply(0,r),s=Math.max.apply(0,i),u=Math.max.apply(0,r);return new Wa(o,a,s-o,u-a)}(c);return e&&(e.parsedStyle.defX=y.x,e.parsedStyle.defY=y.y),{absolutePath:n,hasArc:i,segments:h,polygons:a,polylines:s,curve:c,totalLength:f,curveSegments:d,zCommandIndexes:l,rect:y}}function As(t,e,n){var i=t.curve,r=e.curve,o=[i,r];i.length!==r.length&&(o=Sr(i,r));var a=br(o[0])!==br(o[1])?xr(o[0]):Pr(o[0]);return[a,kr(o[1],a),function(t){return t}]}function Os(t,e){var n;n=Ji(t)?t.split(" ").map((function(t){var e=t.split(","),n=e[1];return[Number(e[0]),Number(n)]})):t;var i,r,o=[],a=0,s=vr(n);n.forEach((function(t,e){n[e+1]&&((i=[0,0])[0]=a/s,r=ur.length(t[0],t[1],n[e+1][0],n[e+1][1]),i[1]=(a+=r)/s,o.push(i))}));var u=Math.min.apply(Math,n.map((function(t){return t[0]}))),c=Math.min.apply(Math,n.map((function(t){return t[1]})));return e&&(e.parsedStyle.defX=u,e.parsedStyle.defY=c),{points:n,totalLength:s,segments:o}}var Is=function(t){return Ya(/deg|rad|grad|turn|px|%/g,t)},Rs=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function Ls(t){if(void 0===t&&(t=""),"none"===(t=t.toLowerCase().trim()))return[];for(var e,n=/\s*([\w-]+)\(([^)]*)\)/g,i=[],r=0;e=n.exec(t);){if(e.index!==r)return[];if(r=e.index+e[0].length,Rs.indexOf(e[1])>-1&&i.push({name:e[1],params:e[2].split(" ").map((function(t){return Is(t)||Ma(t)}))}),n.lastIndex===t.length)return i}return[]}var Ds={number:function(t){return new Lo(t)},percent:function(t){return new Lo(t,"%")},px:function(t){return new Lo(t,"px")},em:function(t){return new Lo(t,"em")},rem:function(t){return new Lo(t,"rem")},deg:function(t){return new Lo(t,"deg")},grad:function(t){return new Lo(t,"grad")},rad:function(t){return new Lo(t,"rad")},turn:function(t){return new Lo(t,"turn")},s:function(t){return new Lo(t,"s")},ms:function(t){return new Lo(t,"ms")},registerProperty:function(t){var e=t.name,n=t.inherits,i=t.interpolable,r=t.initialValue,o=t.syntax;Vt.get(Bi).registerMetadata({name:e,inherited:n,interpolable:i,defaultValue:r,syntax:o})},registerLayout:function(e,n){Vt.get(t.LayoutRegistry).registerLayout(e,n)}},Us=null;function Fs(t){return function(e){var n=0;return t.map((function(t){return t===Us?e[n++]:t}))}}function Bs(t){return t}var Vs={rotate:["A"],rotatex:["A"],rotatey:["A"],rotatez:["A"],rotate3d:["NNNA"],scale:["Nn",Fs([Us,Us,Ds.number(1)]),Bs],scalex:["N",Fs([Us,Ds.number(1),Ds.number(1)]),Fs([Us,Ds.number(1)])],scaley:["N",Fs([Ds.number(1),Us,Ds.number(1)]),Fs([Ds.number(1),Us])],scalez:["N",Fs([Ds.number(1),Ds.number(1),Us])],scale3d:["NNN",Bs],translate:["Tt",Fs([Us,Us,Yo]),Bs],translatex:["T",Fs([Us,Yo,Yo]),Fs([Us,Yo])],translatey:["T",Fs([Yo,Us,Yo]),Fs([Yo,Us])],translatez:["L",Fs([Yo,Yo,Us])],translate3d:["TTL",Bs]};function Gs(t){if("none"===(t=(t||"none").toLowerCase().trim()))return[];for(var e,n=/\s*(\w+)\(([^)]*)\)/g,i=[],r=0;e=n.exec(t);){if(e.index!==r)return[];r=e.index+e[0].length;var o=e[1],a=Vs[o];if(!a)return[];var s=e[2].split(","),u=a[0];if(s.length>u.length)return[];for(var c=[],l=0;u.length>l;l++){var h=s[l],p=u[l],f=void 0;if(void 0===(f=h?{A:function(t){return"0"===t.trim()?qo:Ka(t)},N:ns,T:Xa,L:qa}[p.toUpperCase()](h):{a:qo,n:c[0],t:Yo}[p]))return[];c.push(f)}if(i.push({t:o,d:c}),n.lastIndex===t.length)return i}return[]}function js(t){return t.replace(/[xy]/,"")}function Hs(t){return t.replace(/(x|y|z|3d)?$/,"3d")}function zs(e,n,i){var r=!1;if(!e.length||!n.length){e.length||(r=!0,e=n,n=[]);for(var o=function(t){var i=e[t],r=i.t,o=i.d,a="scale"===r.substr(0,5)?1:0;n.push({t:r,d:o.map((function(t){return"number"==typeof t?new Lo(a):new Lo(a,t.unit)}))})},a=0;e.length>a;a++)o(a)}var s,u,c=[],l=[],h=[];if(e.length!==n.length);else for(var p=0;e.length>p;p++){var f=e[p].t,d=n[p].t,y=e[p].d,v=n[p].d,g=Vs[f],m=Vs[d],T=void 0;if(u=d,("perspective"!==(s=f)||"perspective"!==u)&&("matrix"!==s&&"matrix3d"!==s||"matrix"!==u&&"matrix3d"!==u)){if(f===d)T=f;else if(g[2]&&m[2]&&js(f)===js(d))T=js(f),y=g[2](y),v=m[2](v);else{if(!g[1]||!m[1]||Hs(f)!==Hs(d))break;T=Hs(f),y=g[1](y),v=m[1](v)}for(var S=[],b=[],E=[],w=0;y.length>w;w++){var x=(y[w].unit===t.UnitType.kNumber?is:Za)(y[w],v[w],i,!1,w);S[w]=x[0],b[w]=x[1],E.push(x[2])}c.push(S),l.push(b),h.push([T,E])}}if(r){var P=c;c=l,l=P}return[c,l,function(t){return t.map((function(t,e){var n=t.map((function(t,n){return h[e][1][n](t)})).join(",");return"matrix"===h[e][0]&&16===n.split(",").length&&(h[e][0]="matrix3d"),h[e][0]+"("+n+")"})).join(" ")}]}function Ws(t){if(Ji(t)){var e=t.split(" ");return 1===e.length&&("top"===e[0]||"bottom"===e[0]?(e[1]=e[0],e[0]="center"):e[1]="center"),2!==e.length?null:[Xa(Ys(e[0])),Xa(Ys(e[1]))]}return[new Lo(t[0]||0,"px"),new Lo(t[1]||0,"px")]}function Ys(t){return"center"===t?"50%":"left"===t||"top"===t?"0":"right"===t||"bottom"===t?"100%":t}var qs,Xs=t.Syringe.defineToken("CSSPropertySyntaxFactory"),Ks=t.Syringe.defineToken("CSSProperty");t.CSSPropertyAngle=function(){function t(){this.parser=Ka,this.mixer=Za}return t.prototype.calculator=function(t,e,n,i){return new Lo(Ja(n),"deg")},t}(),t.CSSPropertyAngle=se([ct({token:{token:Ks,named:t.PropertySyntax.ANGLE}})],t.CSSPropertyAngle),(qs=t.ElementEvent||(t.ElementEvent={})).DESTROY="destroy",qs.ATTR_MODIFIED="DOMAttrModified",qs.INSERTED="DOMNodeInserted",qs.CHILD_INSERTED="child-inserted",qs.REMOVED="removed",qs.CHILD_REMOVED="child-removed",qs.MOUNTED="DOMNodeInsertedIntoDocument",qs.UNMOUNTED="DOMNodeRemovedFromDocument",qs.BOUNDS_CHANGED="bounds-changed",qs.GEOMETRY_BOUNDS_CHANGED="geometry-bounds-changed",qs.RENDER_ORDER_CHANGED="render-order-changed",qs.CULLED="culled";var Zs,Js=function(){function t(e){this.type=void 0,this.eventPhase=t.prototype.NONE,this.target=void 0,this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.currentTarget=void 0,this.defaultPrevented=!1,this.timeStamp=void 0,this.nativeEvent=void 0,this.originalEvent=void 0,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.manager=void 0,this.detail=void 0,this.layer=new za,this.page=new za,this.canvas=new za,this.viewport=new za,this.path=void 0,this.view=void 0,this.which=void 0,this.returnValue=void 0,this.srcElement=void 0,this.composed=!1,this.isTrusted=void 0,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e}var e=t.prototype;return e.composedPath=function(){return!this.manager||this.path&&this.path[0]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path},e.preventDefault=function(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0},e.stopImmediatePropagation=function(){this.propagationImmediatelyStopped=!0},e.stopPropagation=function(){this.propagationStopped=!0},e.initEvent=function(){},e.initUIEvent=function(){},de(t,[{key:"name",get:function(){return this.type}},{key:"layerX",get:function(){return this.layer.x}},{key:"layerY",get:function(){return this.layer.y}},{key:"pageX",get:function(){return this.page.x}},{key:"pageY",get:function(){return this.page.y}},{key:"x",get:function(){return this.canvas.x}},{key:"y",get:function(){return this.canvas.y}},{key:"canvasX",get:function(){return this.canvas.x}},{key:"canvasY",get:function(){return this.canvas.y}},{key:"viewportX",get:function(){return this.viewport.x}},{key:"viewportY",get:function(){return this.viewport.y}},{key:"propagationPath",get:function(){return this.composedPath()}}]),t}(),Qs=function(t){function e(e,n){var i;return(i=t.call(this,null)||this).type=e,i.detail=n,Object.assign(be(i),n),i}return ve(e,t),e}(Js),$s=function(){function t(){this.emitter=new mo.EventEmitter}var e=t.prototype;return e.on=function(t,e,n){return this.addEventListener(t,e,n),this},e.addEventListener=function(t,e,n){var i=Be(n)&&n||Ve(n)&&n.capture,r=Ve(n)&&n.once,o=Fe(e)?void 0:e,a=!1,s="";if(t.indexOf(":")>-1){var u=t.split(":");t=u[1],s=u[0],a=!0}if(t=i?t+"capture":t,e=Fe(e)?e:e.handleEvent,a){var c=e;e=function(){for(var t,e=arguments.length,n=new Array(e),i=0;e>i;i++)n[i]=arguments[i];(null===(t=n[0].target)||void 0===t?void 0:t.name)===s&&c.apply(void 0,n)}}return r?this.emitter.once(t,e,o):this.emitter.on(t,e,o),this},e.off=function(t,e,n){return t?this.removeEventListener(t,e,n):this.removeAllEventListeners(),this},e.removeAllEventListeners=function(){this.emitter.removeAllListeners()},e.removeEventListener=function(t,e,n){var i,r=Be(n)&&n||Ve(n)&&n.capture,o=Fe(e)?void 0:e;return t=r?t+"capture":t,e=Fe(e)?e:null===(i=e)||void 0===i?void 0:i.handleEvent,this.emitter.off(t,e,o),this},e.emit=function(t,e){this.dispatchEvent(new Qs(t,e))},e.dispatchEvent=function(t){if(!(t instanceof Js))throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");var e,n,i=this.ownerDocument||this.document;i&&(t.manager=(null===(e=i.defaultView)||void 0===e?void 0:e.getEventService())||null,t.defaultPrevented=!1,t.path=[],t.target=this,null===(n=t.manager)||void 0===n||n.dispatchEvent(t));return!t.defaultPrevented},t}(),tu=function(e){function n(){for(var t,n=arguments.length,i=new Array(n),r=0;n>r;r++)i[r]=arguments[r];return(t=e.call.apply(e,[this].concat(i))||this).shadow=!1,t.ownerDocument=null,t.isConnected=!1,t.baseURI="",t.childNodes=[],t.nodeType=0,t.nodeName="",t.nodeValue=null,t.parentNode=null,t}ve(n,e),n.isNode=function(t){return!!t.childNodes};var i=n.prototype;return i.getRootNode=function(t){return void 0===t&&(t={}),this.parentNode?this.parentNode.getRootNode(t):t.composed&&this.host?this.host.getRootNode(t):this},i.hasChildNodes=function(){return this.childNodes.length>0},i.isDefaultNamespace=function(t){throw new Error("Method not implemented.")},i.lookupNamespaceURI=function(t){throw new Error("Method not implemented.")},i.lookupPrefix=function(t){throw new Error("Method not implemented.")},i.normalize=function(){throw new Error("Method not implemented.")},i.isEqualNode=function(t){return this===t},i.isSameNode=function(t){return this.isEqualNode(t)},i.compareDocumentPosition=function(t){if(t===this)return 0;if(!(t instanceof n))throw new TypeError("Node.compareDocumentPosition: Argument 1 does not implement interface Node.");for(var e=t,i=this,r=[e],o=[i];null!==(a=e.parentNode)&&void 0!==a?a:i.parentNode;){var a;e=e.parentNode?(r.push(e.parentNode),e.parentNode):e,i=i.parentNode?(o.push(i.parentNode),i.parentNode):i}if(e!==i)return n.DOCUMENT_POSITION_DISCONNECTED|n.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|n.DOCUMENT_POSITION_PRECEDING;var s=r.length>o.length?r:o,u=s===r?o:r;if(s[s.length-u.length]===u[0])return s===r?n.DOCUMENT_POSITION_CONTAINED_BY|n.DOCUMENT_POSITION_FOLLOWING:n.DOCUMENT_POSITION_CONTAINS|n.DOCUMENT_POSITION_PRECEDING;for(var c=s.length-u.length,l=u.length-1;l>=0;l--){var h=u[l],p=s[c+l];if(p!==h){var f=h.parentNode.childNodes;return f.indexOf(h)<f.indexOf(p)?u===r?n.DOCUMENT_POSITION_PRECEDING:n.DOCUMENT_POSITION_FOLLOWING:s===r?n.DOCUMENT_POSITION_PRECEDING:n.DOCUMENT_POSITION_FOLLOWING}}return n.DOCUMENT_POSITION_FOLLOWING},i.contain=function(t){return this.contains(t)},i.contains=function(t){for(var e=t;e&&this!==e;)e=e.parentNode;return!!e},i.getAncestor=function(t){for(var e=this;t>0&&e;)e=e.parentNode,t--;return e},i.forEach=function(t){t(this)||this.childNodes.forEach((function(e){e.forEach(t)}))},de(n,[{key:"textContent",get:function(){var e="";this.nodeName===t.Shape.TEXT&&(e+=this.style.text);for(var n,i=we(this.childNodes);!(n=i()).done;){var r=n.value;e+=r.nodeName===t.Shape.TEXT?r.nodeValue:r.textContent}return e},set:function(e){var n=this;this.childNodes.slice().forEach((function(t){n.removeChild(t,!0)})),this.nodeName===t.Shape.TEXT&&(this.style.text=""+e)}},{key:"parent",get:function(){return this.parentNode}},{key:"parentElement",get:function(){return null}},{key:"nextSibling",get:function(){return null}},{key:"previousSibling",get:function(){return null}},{key:"firstChild",get:function(){return this.childNodes.length>0?this.childNodes[0]:null}},{key:"lastChild",get:function(){return this.childNodes.length>0?this.childNodes[this.childNodes.length-1]:null}}]),n}($s);tu.DOCUMENT_POSITION_DISCONNECTED=1,tu.DOCUMENT_POSITION_PRECEDING=2,tu.DOCUMENT_POSITION_FOLLOWING=4,tu.DOCUMENT_POSITION_CONTAINS=8,tu.DOCUMENT_POSITION_CONTAINED_BY=16,tu.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32,(Zs=t.Strategy||(t.Strategy={}))[Zs.Standard=0]="Standard";var eu=function(){function e(){this.strategy=t.Strategy.Standard,this.visibilityPlaneMask=-1,this.visible=!0,this.enable=!0}return e.prototype.isCulled=function(){return this.enable&&!this.visible},e}();eu.tag="c-cullable";var nu=function(){this.contentBounds=void 0,this.renderBounds=void 0};nu.tag="c-geometry";var iu=function(){this.aabb=void 0};iu.tag="c-rbush-node";var ru=t.Syringe.defineToken("RBushRoot"),ou=function(){this.bounds=void 0,this.boundsDirty=!0,this.renderBounds=void 0,this.renderBoundsDirty=!0,this.dirtyRenderBounds=void 0,this.dirty=!1};ou.tag="c-renderable";var au=function(){this.dirty=!1,this.sorted=void 0,this.lastSortedIndex=void 0,this.renderOrder=0};au.tag="c-sortable";var su=function(){this.dirtyFlag=!1,this.localDirtyFlag=!1,this.frozen=!1,this.localPosition=Tn(0,0,0),this.localRotation=Qn(0,0,0,1),this.localScale=Tn(1,1,1),this.localTransform=nn(),this.position=Tn(0,0,0),this.rotation=Qn(0,0,0,1),this.scaling=Tn(1,1,1),this.worldTransform=nn(),this.origin=Tn(0,0,0)};su.tag="c-transform";var uu=function(t){function e(e,n,i,r,o,a,s,u){var c;return(c=t.call(this,null)||this).relatedNode=void 0,c.prevValue=void 0,c.newValue=void 0,c.attrName=void 0,c.attrChange=void 0,c.prevParsedValue=void 0,c.newParsedValue=void 0,c.relatedNode=n,c.prevValue=i,c.newValue=r,c.attrName=o,c.attrChange=a,c.prevParsedValue=s,c.newParsedValue=u,c.type=e,c}return ve(e,t),e}(Js);uu.ADDITION=2,uu.MODIFICATION=1,uu.REMOVAL=3;var cu=0,lu=function(e){function n(){for(var t,n=arguments.length,i=new Array(n),r=0;n>r;r++)i[r]=arguments[r];return(t=e.call.apply(e,[this].concat(i))||this).sceneGraphService=Vt.get(mc),t.entity=cu++,t.renderable=new ou,t.cullable=new eu,t.transformable=new su,t.sortable=new au,t.geometry=new nu,t.rBushNode=new iu,t.id=void 0,t.name=void 0,t.namespaceURI="g",t.scrollLeft=0,t.scrollTop=0,t.clientTop=0,t.clientLeft=0,t.destroyed=!1,t.style={},t.computedStyle={},t.parsedStyle={},t.attributes={},t}ve(n,e),n.isElement=function(t){return!!t.getAttribute};var i=n.prototype;return i.cloneNode=function(t){throw new Error("Method not implemented.")},i.appendChild=function(e,n){return this.sceneGraphService.attach(e,this,n),this.dispatchEvent(new Qs(t.ElementEvent.CHILD_INSERTED,{child:e})),e.dispatchEvent(new uu(t.ElementEvent.INSERTED,this,"","","",0,"","")),e},i.insertBefore=function(t,e){if(e){var n=this.childNodes.indexOf(e);this.appendChild(t,n-1)}else this.appendChild(t);return t},i.replaceChild=function(t,e,n){var i=this.childNodes.indexOf(e);return this.removeChild(e,n),this.appendChild(t,i),e},i.removeChild=function(e,n){return void 0===n&&(n=!0),e.dispatchEvent(new uu(t.ElementEvent.REMOVED,this,"","","",0,"","")),n&&(e.dispatchEvent(new Qs(t.ElementEvent.DESTROY)),e.destroyed=!0),this.dispatchEvent(new Qs(t.ElementEvent.CHILD_REMOVED,{child:e})),this.sceneGraphService.detach(e),n&&e.emitter.removeAllListeners(),e},i.removeChildren=function(t){var e=this;void 0===t&&(t=!0),this.childNodes.slice().forEach((function(n){e.removeChild(n,t)}))},i.matches=function(t){return this.sceneGraphService.matches(t,this)},i.getElementById=function(t){return this.sceneGraphService.querySelector("#"+t,this)},i.getElementsByName=function(t){return this.sceneGraphService.querySelectorAll('[name="'+t+'"]',this)},i.getElementsByClassName=function(t){return this.sceneGraphService.querySelectorAll("."+t,this)},i.getElementsByTagName=function(t){return this.sceneGraphService.querySelectorAll(t,this)},i.querySelector=function(t){return this.sceneGraphService.querySelector(t,this)},i.querySelectorAll=function(t){return this.sceneGraphService.querySelectorAll(t,this)},i.closest=function(t){var e=this;do{if(this.sceneGraphService.matches(t,e))return e;e=e.parentElement}while(null!==e);return null},i.find=function(t){var e=this,n=null;return this.forEach((function(i){return!(i===e||!t(i))&&(n=i,!0)})),n},i.findAll=function(t){var e=this,n=[];return this.forEach((function(i){i!==e&&t(i)&&n.push(i)})),n},i.after=function(){var t=this;if(this.parentNode){for(var e=this.parentNode.childNodes.indexOf(this),n=arguments.length,i=new Array(n),r=0;n>r;r++)i[r]=arguments[r];i.forEach((function(n,i){var r;return null===(r=t.parentNode)||void 0===r?void 0:r.appendChild(n,e+i+1)}))}},i.before=function(){if(this.parentNode){for(var t=this.parentNode.childNodes.indexOf(this),e=arguments.length,n=new Array(e),i=0;e>i;i++)n[i]=arguments[i];var r=n[0],o=n.slice(1);this.parentNode.appendChild(r,t),r.after.apply(r,o)}},i.replaceWith=function(){this.after.apply(this,arguments),this.remove()},i.append=function(){for(var t=this,e=arguments.length,n=new Array(e),i=0;e>i;i++)n[i]=arguments[i];n.forEach((function(e){return t.appendChild(e)}))},i.prepend=function(){for(var t=this,e=arguments.length,n=new Array(e),i=0;e>i;i++)n[i]=arguments[i];n.forEach((function(e,n){return t.appendChild(e,n)}))},i.replaceChildren=function(){for(;this.childNodes.length&&this.firstChild;)this.removeChild(this.firstChild);this.append.apply(this,arguments)},i.remove=function(t){return void 0===t&&(t=!0),this.parentNode?this.parentNode.removeChild(this,t):this},i.destroy=function(){this.dispatchEvent(new Qs(t.ElementEvent.DESTROY)),this.remove(!1),this.emitter.removeAllListeners(),this.destroyed=!0},i.getGeometryBounds=function(){return this.sceneGraphService.getGeometryBounds(this)},i.getRenderBounds=function(){return this.sceneGraphService.getBounds(this,!0)},i.getBounds=function(){return this.sceneGraphService.getBounds(this)},i.getLocalBounds=function(){return this.sceneGraphService.getLocalBounds(this)},i.getBoundingClientRect=function(){return this.sceneGraphService.getBoundingClientRect(this)},i.getClientRects=function(){return[this.getBoundingClientRect()]},i.computedStyleMap=function(){return new Map(Object.entries(this.computedStyle))},i.getAttributeNames=function(){return Object.keys(this.attributes)},i.getAttribute=function(t){var e=this.attributes[t];if(void 0===e){var n=rr(t.toString(),"");e=this.attributes[n[0]]}return De(e)?null:e},i.hasAttribute=function(t){return this.getAttributeNames().includes(t)},i.hasAttributes=function(){return!!this.getAttributeNames().length},i.removeAttribute=function(t){this.setAttribute(t,null),delete this.attributes[t]},i.setAttribute=function(t,e,n){this.attributes[t]=e},i.getAttributeNS=function(t,e){throw new Error("Method not implemented.")},i.getAttributeNode=function(t){throw new Error("Method not implemented.")},i.getAttributeNodeNS=function(t,e){throw new Error("Method not implemented.")},i.hasAttributeNS=function(t,e){throw new Error("Method not implemented.")},i.removeAttributeNS=function(t,e){throw new Error("Method not implemented.")},i.removeAttributeNode=function(t){throw new Error("Method not implemented.")},i.setAttributeNS=function(t,e,n){throw new Error("Method not implemented.")},i.setAttributeNode=function(t){throw new Error("Method not implemented.")},i.setAttributeNodeNS=function(t){throw new Error("Method not implemented.")},i.toggleAttribute=function(t,e){throw new Error("Method not implemented.")},de(n,[{key:"className",get:function(){return this.getAttribute("class")||""},set:function(t){this.setAttribute("class",t)}},{key:"classList",get:function(){return this.className.split(" ").filter((function(t){return""!==t}))}},{key:"tagName",get:function(){return this.nodeName}},{key:"children",get:function(){return this.childNodes}},{key:"childElementCount",get:function(){return this.childNodes.length}},{key:"firstElementChild",get:function(){return this.firstChild}},{key:"lastElementChild",get:function(){return this.lastChild}},{key:"parentElement",get:function(){return this.parentNode}},{key:"nextSibling",get:function(){if(this.parentNode){var t=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[t+1]||null}return null}},{key:"previousSibling",get:function(){if(this.parentNode){var t=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[t-1]||null}return null}}]),n}(tu),hu=function(t){function e(e,n,i,r){var o;return(o=t.call(this,e)||this).currentTime=void 0,o.timelineTime=void 0,o.currentTime=i,o.timelineTime=r,o.target=n,o.type="finish",o.bubbles=!1,o.currentTarget=n,o.defaultPrevented=!1,o.eventPhase=o.AT_TARGET,o.timeStamp=Date.now(),o.currentTime=i,o.timelineTime=r,o}return ve(e,t),e}(Js),pu=0,fu=function(){function t(t,e){this.effect=void 0,this.timeline=void 0,this.id=void 0,this.currentTimePending=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this.oldPlayState=void 0,this._holdTime=void 0,this.readyPromise=void 0,this.finishedPromise=void 0,this.resolveReadyPromise=void 0,this.rejectReadyPromise=void 0,this.resolveFinishedPromise=void 0,this.rejectFinishedPromise=void 0,this.onfinish=void 0,this.oncancel=void 0,this.onframe=void 0,this._currentTime=0,this._startTime=void 0,this._playbackRate=1,this._inEffect=void 0,this._inTimeline=!0,this.onremove=void 0,this.effect=t,t.animation=this,this.timeline=e,this.id=""+pu++,this._inEffect=!!this.effect.update(0),this._holdTime=0,this._paused=!1,this.oldPlayState="idle",this.updatePromises()}var e=t.prototype;return e.updatePromises=function(){var t=this.oldPlayState,e=this.pending?"pending":this.playState;return this.readyPromise&&e!==t&&("idle"===e?(this.rejectReadyPromise(),this.readyPromise=void 0):"pending"===t?this.resolveReadyPromise():"pending"===e&&(this.readyPromise=void 0)),this.finishedPromise&&e!==t&&("idle"===e?(this.rejectFinishedPromise(),this.finishedPromise=void 0):"finished"===e?this.resolveFinishedPromise():"finished"===t&&(this.finishedPromise=void 0)),this.oldPlayState=e,this.readyPromise||this.finishedPromise},e.play=function(){this.updatePromises(),this._paused=!1,(this._isFinished||this._idle)&&(this.rewind(),this._startTime=null),this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this),-1===this.timeline.animations.indexOf(this)&&this.timeline.animations.push(this),this.updatePromises()},e.pause=function(){this.updatePromises(),this.currentTime&&(this._holdTime=this.currentTime),this._isFinished||this._paused||this._idle?this._idle&&(this.rewind(),this._idle=!1):this.currentTimePending=!0,this._startTime=null,this._paused=!0,this.updatePromises()},e.finish=function(){this.updatePromises(),this._idle||(this.currentTime=this._playbackRate>0?this.totalDuration:0,this._startTime=this.totalDuration-this.currentTime,this.currentTimePending=!1,this.timeline.applyDirtiedAnimation(this),this.updatePromises())},e.cancel=function(){this.updatePromises(),this._inEffect&&(this._inEffect=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._startTime=null,this.effect.update(null),this.timeline.applyDirtiedAnimation(this),this.updatePromises())},e.reverse=function(){this.updatePromises();var t=this.currentTime;this.playbackRate*=-1,this.play(),null!==t&&(this.currentTime=t),this.updatePromises()},e.updatePlaybackRate=function(t){this.playbackRate=t},e.targetAnimations=function(){var t;return(null===(t=this.effect)||void 0===t?void 0:t.target).getAnimations()},e.markTarget=function(){var t=this.targetAnimations();-1===t.indexOf(this)&&t.push(this)},e.unmarkTarget=function(){var t=this.targetAnimations(),e=t.indexOf(this);-1!==e&&t.splice(e,1)},e.tick=function(t,e){this._idle||this._paused||(null===this._startTime?e&&(this.startTime=t-this._currentTime/this.playbackRate):this._isFinished||this.tickCurrentTime((t-this._startTime)*this.playbackRate)),e&&(this.currentTimePending=!1,this.fireEvents(t))},e.rewind=function(){if(this.playbackRate<0){if(this.totalDuration>=1/0)throw new Error("Unable to rewind negative playback rate animation with infinite duration");this.currentTime=this.totalDuration}else this.currentTime=0},e.persist=function(){throw new Error("Method not implemented.")},e.addEventListener=function(t,e,n){throw new Error("Method not implemented.")},e.removeEventListener=function(t,e,n){throw new Error("Method not implemented.")},e.dispatchEvent=function(t){throw new Error("Method not implemented.")},e.commitStyles=function(){throw new Error("Method not implemented.")},e.ensureAlive=function(){var t,e;0>this.playbackRate&&0===this.currentTime?this._inEffect=!!(null===(t=this.effect)||void 0===t?void 0:t.update(-1)):this._inEffect=!!(null===(e=this.effect)||void 0===e?void 0:e.update(this.currentTime));this._inTimeline||!this._inEffect&&this._finishedFlag||(this._inTimeline=!0,this.timeline.animations.push(this))},e.tickCurrentTime=function(t,e){t!==this._currentTime&&(this._currentTime=t,this._isFinished&&!e&&(this._currentTime=this._playbackRate>0?this.totalDuration:0),this.ensureAlive())},e.fireEvents=function(t){var e=this;if(this._isFinished){if(!this._finishedFlag){if(this.onfinish){var n=new hu(null,this,this.currentTime,t);setTimeout((function(){e.onfinish&&e.onfinish(n)}))}this._finishedFlag=!0}}else{if(this.onframe&&"running"===this.playState){var i=new hu(null,this,this.currentTime,t);this.onframe(i)}this._finishedFlag=!1}},de(t,[{key:"pending",get:function(){return null===this._startTime&&!this._paused&&0!==this.playbackRate||this.currentTimePending}},{key:"playState",get:function(){return this._idle?"idle":this._isFinished?"finished":this._paused?"paused":"running"}},{key:"ready",get:function(){var t=this;return this.readyPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.readyPromise=new Promise((function(e,n){t.resolveReadyPromise=function(){e(t)},t.rejectReadyPromise=function(){n(new Error)}})),this.pending||this.resolveReadyPromise()),this.readyPromise}},{key:"finished",get:function(){var t=this;return this.finishedPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.finishedPromise=new Promise((function(e,n){t.resolveFinishedPromise=function(){e(t)},t.rejectFinishedPromise=function(){n(new Error)}})),"finished"===this.playState&&this.resolveFinishedPromise()),this.finishedPromise}},{key:"currentTime",get:function(){return this.updatePromises(),this._idle||this.currentTimePending?null:this._currentTime},set:function(t){if(t=Number(t),!isNaN(t)){var e;if(this.timeline.restart(),!this._paused&&null!==this._startTime)this._startTime=Number(null===(e=this.timeline)||void 0===e?void 0:e.currentTime)-t/this.playbackRate;this.currentTimePending=!1,this._currentTime!==t&&(this._idle&&(this._idle=!1,this._paused=!0),this.tickCurrentTime(t,!0),this.timeline.applyDirtiedAnimation(this))}}},{key:"startTime",get:function(){return this._startTime},set:function(t){if(null!==t){if(this.updatePromises(),t=Number(t),isNaN(t))return;if(this._paused||this._idle)return;this._startTime=t,this.tickCurrentTime((Number(this.timeline.currentTime)-this._startTime)*this.playbackRate),this.timeline.applyDirtiedAnimation(this),this.updatePromises()}}},{key:"playbackRate",get:function(){return this._playbackRate},set:function(t){if(t!==this._playbackRate){this.updatePromises();var e=this.currentTime;this._playbackRate=t,this.startTime=null,"paused"!==this.playState&&"idle"!==this.playState&&(this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this)),null!==e&&(this.currentTime=e),this.updatePromises()}}},{key:"_isFinished",get:function(){return!this._idle&&(this._playbackRate>0&&Number(this._currentTime)>=this.totalDuration||0>this._playbackRate&&0>=Number(this._currentTime))}},{key:"totalDuration",get:function(){var t;return Number(null===(t=this.effect)||void 0===t?void 0:t.getComputedTiming().endTime)}},{key:"_needsTick",get:function(){return this.pending||"running"===this.playState||!this._finishedFlag}}]),t}();function du(t,e){return Number(t.id)-Number(e.id)}var yu=function(){function t(t){var e=this;this.document=void 0,this.animations=[],this.ticking=!1,this.timelineTicking=!1,this.hasRestartedThisFrame=!1,this.animationsWithPromises=[],this.inTick=!1,this.pendingEffects=[],this.currentTime=null,this.rafId=0,this.rafCallbacks=[],this.frameId=void 0,this.webAnimationsNextTick=function(t){e.currentTime=t,e.discardAnimations(),0===e.animations.length?e.timelineTicking=!1:e.requestAnimationFrame(e.webAnimationsNextTick)},this.processRafCallbacks=function(t){var n=e.rafCallbacks;e.rafCallbacks=[],t<Number(e.currentTime)&&(t=Number(e.currentTime)),e.animations.sort(du),e.animations=e.tick(t,!0,e.animations)[0],n.forEach((function(e){e[1](t)})),e.applyPendingEffects()},this.document=t}var e=t.prototype;return e.getAnimations=function(){return this.discardAnimations(),this.animations.slice()},e.isTicking=function(){return this.inTick},e.play=function(t){var e=new fu(t,this);return this.animations.push(e),this.restartWebAnimationsNextTick(),e.updatePromises(),e.play(),e.updatePromises(),e},e.applyDirtiedAnimation=function(t){var e=this;if(!this.inTick){t.markTarget();var n=t.targetAnimations();n.sort(du),this.tick(Number(this.currentTime),!1,n.slice())[1].forEach((function(t){var n=e.animations.indexOf(t);-1!==n&&e.animations.splice(n,1)})),this.applyPendingEffects()}},e.restart=function(){return this.ticking||(this.ticking=!0,this.requestAnimationFrame((function(){})),this.hasRestartedThisFrame=!0),this.hasRestartedThisFrame},e.destroy=function(){this.document.defaultView.cancelAnimationFrame(this.frameId)},e.applyPendingEffects=function(){this.pendingEffects.forEach((function(t){null==t||t.applyInterpolations()})),this.pendingEffects=[]},e.updateAnimationsPromises=function(){this.animationsWithPromises=this.animationsWithPromises.filter((function(t){return t.updatePromises()}))},e.discardAnimations=function(){this.updateAnimationsPromises(),this.animations=this.animations.filter((function(t){return"finished"!==t.playState&&"idle"!==t.playState}))},e.restartWebAnimationsNextTick=function(){this.timelineTicking||(this.timelineTicking=!0,this.requestAnimationFrame(this.webAnimationsNextTick))},e.rAF=function(t){var e=this.rafId++;return 0===this.rafCallbacks.length&&(this.frameId=this.document.defaultView.requestAnimationFrame(this.processRafCallbacks)),this.rafCallbacks.push([e,t]),e},e.requestAnimationFrame=function(t){var e=this;return this.rAF((function(n){e.updateAnimationsPromises(),t(n),e.updateAnimationsPromises()}))},e.tick=function(t,e,n){var i,r,o=this;this.inTick=!0,this.hasRestartedThisFrame=!1,this.currentTime=t,this.ticking=!1;var a=[],s=[],u=[],c=[];return n.forEach((function(n){n.tick(t,e),n._inEffect?(s.push(n.effect),n.markTarget()):(a.push(n.effect),n.unmarkTarget()),n._needsTick&&(o.ticking=!0);var i=n._inEffect||n._needsTick;n._inTimeline=i,i?u.push(n):c.push(n)})),(i=this.pendingEffects).push.apply(i,a),(r=this.pendingEffects).push.apply(r,s),this.ticking&&this.requestAnimationFrame((function(){})),this.inTick=!1,[u,c]},t}();t.DisplayObjectPool=function(){function e(){this.pool={},this.htmlPool=[]}var n=e.prototype;return n.getByEntity=function(t){return this.pool[t]},n.add=function(e,n){this.pool[e]=n,n.nodeName===t.Shape.HTML&&this.htmlPool.push(n)},n.remove=function(e){var n=this.pool[e];if(delete this.pool[e],n.nodeName===t.Shape.HTML){var i=this.htmlPool.indexOf(n);this.htmlPool.splice(i,1)}},n.getHTMLs=function(){return this.htmlPool},e}(),t.DisplayObjectPool=se([ct()],t.DisplayObjectPool);var vu,gu,mu={anchor:"",opacity:"",fillOpacity:"",strokeOpacity:"",fill:"",stroke:"",transform:"",transformOrigin:"",visibility:"",pointerEvents:"",lineWidth:"",lineCap:"",lineJoin:"",increasedLineWidthForHitTesting:"",fontSize:"",fontFamily:"",fontStyle:"",fontWeight:"",fontVariant:"",textAlign:"",textBaseline:"",textTransform:""},Tu=function(e){function n(n){var i,r,o,a;return(a=e.call(this)||this).config=void 0,a.styleValueRegistry=Vt.get(Bi),a.isCustomElement=!1,a.activeAnimations=[],a.config=n,a.config.interactive=null!==(i=a.config.capture)&&void 0!==i?i:a.config.interactive,a.id=a.config.id||"",a.name=a.config.name||"",(a.config.className||a.config.class)&&(a.className=a.config.className||a.config.class),a.nodeName=a.config.type||t.Shape.GROUP,a.config.style=ye({},mu,{zIndex:null!==(r=a.config.zIndex)&&void 0!==r?r:0,interactive:null===(o=a.config.interactive)||void 0===o||o},a.config.style,a.config.attrs),null!=a.config.visible&&(a.config.style.visibility=!1===a.config.visible?"hidden":"visible"),null!=a.config.interactive&&(a.config.style.pointerEvents=!1===a.config.interactive?"none":"auto"),a.style=new Proxy(ye({},a.attributes,{setProperty:function(t,e){a.setAttribute(t,e)},getPropertyValue:function(t){return a.getAttribute(t)},removeProperty:function(t){a.removeAttribute(t)},item:function(){return""}}),{get:function(t,e){return void 0!==t[e]?t[e]:a.getAttribute(e)},set:function(t,e,n){return a.setAttribute(e,n),!0}}),a.initAttributes(a.config.style),Vt.get(t.DisplayObjectPool).add(a.entity,be(a)),a}ve(n,e);var i=n.prototype;return i.destroy=function(){e.prototype.destroy.call(this),Vt.get(t.DisplayObjectPool).remove(this.entity),this.getAnimations().forEach((function(t){t.cancel()}))},i.cloneNode=function(t){var e=new this.constructor({id:this.id,name:this.name,className:this.name,interactive:this.interactive,style:ye({},this.attributes)});return e.setLocalTransform(this.getLocalTransform()),t&&this.children.forEach((function(n){var i=n.cloneNode(t);e.appendChild(i)})),e},i.initAttributes=function(t){void 0===t&&(t={});var e=this.renderable;this.styleValueRegistry.processProperties(this,t),e.dirty=!0},i.setAttribute=function(t,n,i){void 0===i&&(i=!1);var r=rr(t,n),o=r[0],a=r[1];Le(n)||(i||a!==this.attributes[o])&&(this.internalSetAttribute(o,a),e.prototype.setAttribute.call(this,o,a))},i.internalSetAttribute=function(e,n,i){var r,o=this;void 0===i&&(i={});var a=this.renderable,s=this.attributes[e],u=this.parsedStyle[e];this.styleValueRegistry.processProperties(this,((r={})[e]=n,r),i),this.attributes.clipPathTargets&&this.attributes.clipPathTargets.length&&this.attributes.clipPathTargets.forEach((function(e){gc(e),e.dispatchEvent(new uu(t.ElementEvent.ATTR_MODIFIED,e,o,o,"clipPath",uu.MODIFICATION,o,o)),e.isCustomElement&&e.isConnected&&e.attributeChangedCallback&&e.attributeChangedCallback("clipPath",o,o)})),a.dirty=!0,this.dispatchEvent(new uu(t.ElementEvent.ATTR_MODIFIED,this,s,n,e,uu.MODIFICATION,u,this.parsedStyle[e])),this.isCustomElement&&this.isConnected&&this.attributeChangedCallback&&this.attributeChangedCallback(e,s,n)},i.getBBox=function(){var t=this.getBounds(),e=t.getMin(),n=e[0],i=e[1],r=t.getMax();return new Wa(n,i,r[0]-n,r[1]-i)},i.setOrigin=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.sceneGraphService.setOrigin(this,ri(t,e,n)),this},i.getOrigin=function(){return this.sceneGraphService.getOrigin(this)},i.setPosition=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.sceneGraphService.setPosition(this,ri(t,e,n)),this},i.setLocalPosition=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.sceneGraphService.setLocalPosition(this,ri(t,e,n)),this},i.translate=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.sceneGraphService.translate(this,ri(t,e,n)),this},i.translateLocal=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.sceneGraphService.translateLocal(this,ri(t,e,n)),this},i.getPosition=function(){return this.sceneGraphService.getPosition(this)},i.getLocalPosition=function(){return this.sceneGraphService.getLocalPosition(this)},i.scale=function(t,e,n){return this.scaleLocal(t,e,n)},i.scaleLocal=function(t,e,n){return"number"==typeof t&&(t=ri(t,e=e||t,n=n||t)),this.sceneGraphService.scaleLocal(this,t),this},i.setLocalScale=function(t,e,n){return"number"==typeof t&&(t=ri(t,e=e||t,n=n||t)),this.sceneGraphService.setLocalScale(this,t),this},i.getLocalScale=function(){return this.sceneGraphService.getLocalScale(this)},i.getScale=function(){return this.sceneGraphService.getScale(this)},i.getEulerAngles=function(){var t=si(vn(),this.sceneGraphService.getWorldTransform(this));return oi(t[2])},i.getLocalEulerAngles=function(){var t=si(vn(),this.sceneGraphService.getLocalRotation(this));return oi(t[2])},i.setEulerAngles=function(t){return this.sceneGraphService.setEulerAngles(this,0,0,t),this},i.setLocalEulerAngles=function(t){return this.sceneGraphService.setLocalEulerAngles(this,0,0,t),this},i.rotateLocal=function(t,e,n){return De(e)&&De(n)?this.sceneGraphService.rotateLocal(this,0,0,t):this.sceneGraphService.rotateLocal(this,t,e,n),this},i.rotate=function(t,e,n){return De(e)&&De(n)?this.sceneGraphService.rotate(this,0,0,t):this.sceneGraphService.rotate(this,t,e,n),this},i.setRotation=function(t,e,n,i){return this.sceneGraphService.setRotation(this,t,e,n,i),this},i.setLocalRotation=function(t,e,n,i){return this.sceneGraphService.setLocalRotation(this,t,e,n,i),this},i.getRotation=function(){return this.sceneGraphService.getRotation(this)},i.getLocalRotation=function(){return this.sceneGraphService.getLocalRotation(this)},i.getLocalTransform=function(){return this.sceneGraphService.getLocalTransform(this)},i.getWorldTransform=function(){return this.sceneGraphService.getWorldTransform(this)},i.setLocalTransform=function(t){return this.sceneGraphService.setLocalTransform(this,t),this},i.resetLocalTransform=function(){this.sceneGraphService.resetLocalTransform(this)},i.getAnimations=function(){return this.activeAnimations},i.animate=function(t,e){var n,i,r=null===(n=this.ownerDocument)||void 0===n?void 0:n.timeline;this.attributes.clipPathTargets&&this.attributes.clipPathTargets.length&&(r=null===(i=this.attributes.clipPathTargets[0].ownerDocument)||void 0===i?void 0:i.timeline);return delete this.parsedStyle.transform,r?r.play(new hc(this,t,e)):null},i.show=function(){this.style.visibility="visible"},i.hide=function(){this.style.visibility="hidden"},i.isVisible=function(){var t,e;return"visible"===(null===(t=this.parsedStyle)||void 0===t||null===(e=t.visibility)||void 0===e?void 0:e.value)},i.isInteractive=function(){var t,e;return"none"!==(null===(t=this.parsedStyle)||void 0===t||null===(e=t.pointerEvents)||void 0===e?void 0:e.value)},i.isCulled=function(){return!(!this.cullable||!this.cullable.isCulled())},i.toFront=function(){return this.parentNode&&(this.style.zIndex=Math.max.apply(Math,this.parentNode.children.map((function(t){return Number(t.style.zIndex)})))+1),this},i.toBack=function(){return this.parentNode&&(this.style.zIndex=Math.min.apply(Math,this.parentNode.children.map((function(t){return Number(t.style.zIndex)})))-1),this},i.getCount=function(){return this.childElementCount},i.getParent=function(){return this.parentElement},i.getChildren=function(){return this.children},i.getFirst=function(){return this.firstElementChild},i.getLast=function(){return this.lastElementChild},i.getChildByIndex=function(t){return this.children[t]||null},i.add=function(t,e){return this.appendChild(t,e)},i.setClip=function(t){this.style.clipPath=t},i.getClip=function(){return this.style.clipPath||null},i.set=function(t,e){this.config[t]=e},i.get=function(t){return this.config[t]},i.getConfig=function(){return this.config},i.attr=function(){for(var t=this,e=arguments.length,n=new Array(e),i=0;e>i;i++)n[i]=arguments[i];var r=n[0],o=n[1];return r?Ve(r)?(Object.keys(r).forEach((function(e){t.setAttribute(e,r[e])})),this):2===n.length?(this.setAttribute(r,o),this):this.attributes[r]:this.attributes},i.moveTo=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.setPosition(t,e,n),this},i.move=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.setPosition(t,e,n),this},i.setZIndex=function(t){return this.style.zIndex=t,this},i.getMatrix=function(t){var e=t||this.getWorldTransform(),n=ln(vn(),e),i=n[0],r=n[1],o=hn(vn(),e),a=o[0],s=o[1],u=pn(Vn(),e),c=si(vn(),u);return ui(c[0]||c[2],i,r,a,s)},i.getLocalMatrix=function(){return this.getMatrix(this.getLocalTransform())},i.setMatrix=function(t){var e=li(t),n=e[0],i=e[1],r=e[2],o=e[3];this.setEulerAngles(e[4]).setPosition(n,i).setLocalScale(r,o)},i.setLocalMatrix=function(t){var e=li(t),n=e[0],i=e[1],r=e[2],o=e[3];this.setLocalEulerAngles(e[4]).setLocalPosition(n,i).setLocalScale(r,o)},de(n,[{key:"interactive",get:function(){return this.isInteractive()},set:function(t){this.style.pointerEvents=t?"auto":"none"}}]),n}(lu),Su=["style"],bu=function(t){function e(e){var n,i=void 0===e?{}:e,r=i.style,o=Se(i,Su);return(n=t.call(this,ye({style:ye({x:"",y:""},r)},o))||this).isCustomElement=!0,n}return ve(e,t),e}(Tu),Eu=["style"],wu=function(e){function n(n){var i=void 0===n?{}:n,r=i.style,o=Se(i,Eu);return e.call(this,ye({type:t.Shape.CIRCLE,style:ye({cx:"",cy:"",r:"",anchor:"0.5 0.5",transformOrigin:"center"},r)},o))||this}return ve(n,e),n}(Tu),xu=["style"],Pu=function(e){function n(n){var i=void 0===n?{}:n,r=i.style,o=Se(i,xu);return e.call(this,ye({type:t.Shape.ELLIPSE,style:ye({cx:"",cy:"",rx:"",ry:"",anchor:"0.5 0.5",transformOrigin:"center"},r)},o))||this}return ve(n,e),n}(Tu),ku=["style"],Cu=function(e){function n(n){var i=void 0===n?{}:n,r=i.style,o=Se(i,ku);return e.call(this,ye({type:t.Shape.GROUP,style:ye({x:"",y:"",width:"",height:""},r)},o))||this}return ve(n,e),n}(Tu),Nu=["style"],_u=function(e){function n(n){var i=void 0===n?{}:n,r=i.style,o=Se(i,Nu);return e.call(this,ye({type:t.Shape.IMAGE,style:ye({x:"",y:"",img:"",width:"",height:""},r)},o))||this}return ve(n,e),n}(Tu),Mu=["style"],Au=function(e){function n(n){var i=void 0===n?{}:n,r=i.style,o=Se(i,Mu);return e.call(this,ye({type:t.Shape.LINE,style:ye({x1:0,y1:0,x2:0,y2:0,z1:0,z2:0,isBillboard:!1},r)},o))||this}ve(n,e);var i=n.prototype;return i.getPoint=function(t){var e=this.parsedStyle,n=ur.pointAt(e.x1.value,e.y1.value,e.x2.value,e.y2.value,t);return new za(n.x,n.y)},i.getTotalLength=function(){var t=this.parsedStyle;return ur.length(t.x1.value,t.y1.value,t.x2.value,t.y2.value)},n}(Tu),Ou=["style"],Iu=function(e){function n(n){var i=void 0===n?{}:n,r=i.style,o=Se(i,Ou);return e.call(this,ye({type:t.Shape.PATH,style:ye({path:"",miterLimit:4},r)},o))||this}ve(n,e);var i=n.prototype;return i.getTotalLength=function(){return this.parsedStyle.path.totalLength},i.getPoint=function(t){var e=0,n=0,i=this.parsedStyle.path.curve;if(!this.parsedStyle.path.curveSegments.length)return i?new za(i[0][1],i[0][2]):null;this.parsedStyle.path.curveSegments.forEach((function(i,r){i[0]>t||t>i[1]||(e=(t-i[0])/(i[1]-i[0]),n=r)}));var r=i[n];if(De(r)||De(n))return null;var o=r.length,a=i[n+1],s=dr.pointAt(r[o-2],r[o-1],a[1],a[2],a[3],a[4],a[5],a[6],e);return new za(s.x,s.y)},i.getStartTangent=function(){var t=this.parsedStyle.path.segments,e=[];if(t.length>1){var n=t[0].currentPoint,i=t[1].currentPoint,r=t[1].startTangent;e=[],r?(e.push([n[0]-r[0],n[1]-r[1]]),e.push([n[0],n[1]])):(e.push([i[0],i[1]]),e.push([n[0],n[1]]))}return e},i.getEndTangent=function(){var t=this.parsedStyle.path.segments,e=t.length,n=[];if(e>1){var i=t[e-2].currentPoint,r=t[e-1].currentPoint,o=t[e-1].endTangent;n=[],o?(n.push([r[0]-o[0],r[1]-o[1]]),n.push([r[0],r[1]])):(n.push([i[0],i[1]]),n.push([r[0],r[1]]))}return n},n}(Tu),Ru=["style"],Lu=function(e){function n(n){var i=void 0===n?{}:n,r=i.style,o=Se(i,Ru);return e.call(this,ye({type:t.Shape.POLYGON,style:ye({points:"",miterLimit:4},r)},o))||this}return ve(n,e),n}(Tu),Du=["style"],Uu=function(e){function n(n){var i=void 0===n?{}:n,r=i.style,o=Se(i,Du);return e.call(this,ye({type:t.Shape.POLYLINE,style:ye({points:"",miterLimit:4},r)},o))||this}ve(n,e);var i=n.prototype;return i.getTotalLength=function(){return this.parsedStyle.points.totalLength},i.getPoint=function(t){var e=this.parsedStyle.points,n=e.points,i=0,r=0;e.segments.forEach((function(e,n){e[0]>t||t>e[1]||(i=(t-e[0])/(e[1]-e[0]),r=n)}));var o=ur.pointAt(n[r][0],n[r][1],n[r+1][0],n[r+1][1],i);return new za(o.x,o.y)},i.getStartTangent=function(){var t=this.parsedStyle.points.points,e=[];return e.push([t[1][0],t[1][1]]),e.push([t[0][0],t[0][1]]),e},i.getEndTangent=function(){var t=this.parsedStyle.points.points,e=t.length-1,n=[];return n.push([t[e-1][0],t[e-1][1]]),n.push([t[e][0],t[e][1]]),n},n}(Tu),Fu=["style"],Bu=function(e){function n(n){var i=void 0===n?{}:n,r=i.style,o=Se(i,Fu);return e.call(this,ye({type:t.Shape.RECT,style:ye({x:"",y:"",width:"",height:"",radius:""},r)},o))||this}return ve(n,e),n}(Tu),Vu=["style"],Gu=function(e){function n(n){var i,r=void 0===n?{}:n,o=r.style,a=Se(r,Vu);return(i=e.call(this,ye({type:t.Shape.TEXT,style:ye({x:"",y:"",text:"",fontSize:"",fontFamily:"",fontStyle:"",fontWeight:"",fontVariant:"",textAlign:"",textBaseline:"",textTransform:"",fill:"black",letterSpacing:0,lineHeight:0,miterLimit:10,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:0,leading:0,dx:"",dy:""},o)},a))||this).LENGTHADJUST_SPACING=1,i.LENGTHADJUST_SPACINGANDGLYPHS=2,i.LENGTHADJUST_UNKNOWN=0,i.lengthAdjust=void 0,i.textLength=void 0,i}ve(n,e);var i=n.prototype;return i.getCharNumAtPosition=function(t){throw new Error("Method not implemented.")},i.getComputedTextLength=function(){var t;return(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.maxLineWidth)||0},i.getEndPositionOfChar=function(t){throw new Error("Method not implemented.")},i.getExtentOfChar=function(t){throw new Error("Method not implemented.")},i.getNumberOfChars=function(){throw new Error("Method not implemented.")},i.getRotationOfChar=function(t){throw new Error("Method not implemented.")},i.getStartPositionOfChar=function(t){throw new Error("Method not implemented.")},i.getSubStringLength=function(t,e){throw new Error("Method not implemented.")},i.selectSubString=function(t,e){throw new Error("Method not implemented.")},i.getLineBoundingRects=function(){var t;return(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.lineMetrics)||[]},n}(Tu),ju=["style"],Hu=function(e){function n(n){var i,r=void 0===n?{}:n,o=r.style,a=Se(r,ju);return(i=e.call(this,ye({type:t.Shape.HTML,style:ye({x:"",y:"",width:"auto",height:"auto",innerHTML:""},o)},a))||this).cullable.enable=!1,i}ve(n,e);var i=n.prototype;return i.getDomElement=function(){return this.parsedStyle.$el},i.getBoundingClientRect=function(){return this.parsedStyle.$el.getBoundingClientRect()},i.getClientRects=function(){return[this.getBoundingClientRect()]},i.getBounds=function(){var t,e,n=this.getBoundingClientRect(),i=null===(t=this.ownerDocument)||void 0===t||null===(e=t.defaultView)||void 0===e?void 0:e.getContextService().getBoundingClientRect();if(i){var r=n.left-i.left,o=n.top-i.top,a=new Ia;return a.setMinMax(Tn(r,o,0),Tn(r+n.width,o+n.height,0)),a}return null},i.getLocalBounds=function(){if(this.parentNode){var t=an(nn(),this.parentNode.getWorldTransform()),e=this.getBounds();if(!Ia.isEmpty(e)){var n=new Ia;return n.setFromTransformedAABB(e,t),n}}return this.getBounds()},n}(Tu),zu=function(t){function e(){var e;(e=t.call(this)||this).defaultView=null,e.documentElement=void 0,e.timeline=void 0,e.ownerDocument=null,e.nodeName="document",e.timeline=new yu(be(e));var n={};return Mc.forEach((function(t){var e=t.defaultValue;t.inherited&&e&&(n[t.name]=e)})),e.documentElement=new Cu({id:"g-root",style:n}),e.documentElement.ownerDocument=be(e),e.documentElement.parentNode=be(e),e.childNodes=[e.documentElement],e}ve(e,t);var n=e.prototype;return n.createElement=function(t,e){var n=this.defaultView.customElements.get(t);return n||(console.warn("Unsupported tagName: ",t),n="tspan"===t?Gu:Cu),new n(e)},n.createElementNS=function(t,e,n){return this.createElement(e,n)},n.cloneNode=function(t){throw new Error("Method not implemented.")},n.destroy=function(){try{this.documentElement.destroy()}catch(t){}this.timeline.destroy()},n.elementFromPoint=function(){var t=pe(le().mark((function t(e,n){var i,r,o,a,s,u,c,l,h,p;return le().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=this.defaultView.canvas2Viewport({x:e,y:n}),r=i.x,o=i.y,a=this.defaultView.getConfig(),s=a.width,u=a.height,!(0>r||0>o||r>s||o>u)){t.next=4;break}return t.abrupt("return",null);case 4:return c=this.defaultView.viewport2Client({x:r,y:o}),l=c.x,h=c.y,t.next=7,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!0,position:{x:e,y:n,viewportX:r,viewportY:o,clientX:l,clientY:h},picked:[]});case 7:return t.abrupt("return",(p=t.sent.picked)&&p[0]||this.documentElement);case 10:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}(),n.elementsFromPoint=function(){var t=pe(le().mark((function t(e,n){var i,r,o,a,s,u,c,l,h,p;return le().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=this.defaultView.canvas2Viewport({x:e,y:n}),r=i.x,o=i.y,a=this.defaultView.getConfig(),s=a.width,u=a.height,!(0>r||0>o||r>s||o>u)){t.next=4;break}return t.abrupt("return",[]);case 4:return c=this.defaultView.viewport2Client({x:r,y:o}),l=c.x,h=c.y,t.next=7,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!1,position:{x:e,y:n,viewportX:r,viewportY:o,clientX:l,clientY:h},picked:[]});case 7:return(p=t.sent.picked)[p.length-1]!==this.documentElement&&p.push(this.documentElement),t.abrupt("return",p);case 11:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}(),n.appendChild=function(t,e){throw new Error("Use document.documentElement instead.")},n.insertBefore=function(t,e){throw new Error("Use document.documentElement instead.")},n.removeChild=function(t,e){throw new Error("Use document.documentElement instead.")},n.replaceChild=function(t,e,n){throw new Error("Use document.documentElement instead.")},n.append=function(){throw new Error("Use document.documentElement instead.")},n.prepend=function(){throw new Error("Use document.documentElement instead.")},n.getElementById=function(t){return this.documentElement.getElementById(t)},n.getElementsByName=function(t){return this.documentElement.getElementsByName(t)},n.getElementsByTagName=function(t){return this.documentElement.getElementsByTagName(t)},n.getElementsByClassName=function(t){return this.documentElement.getElementsByClassName(t)},n.querySelector=function(t){return this.documentElement.querySelector(t)},n.querySelectorAll=function(t){return this.documentElement.querySelectorAll(t)},n.find=function(t){return this.documentElement.find(t)},n.findAll=function(t){return this.documentElement.findAll(t)},de(e,[{key:"children",get:function(){return this.childNodes}},{key:"childElementCount",get:function(){return this.childNodes.length}},{key:"firstElementChild",get:function(){return this.firstChild}},{key:"lastElementChild",get:function(){return this.lastChild}}]),e}(tu),Wu=function(t){function e(){for(var e,n=arguments.length,i=new Array(n),r=0;n>r;r++)i[r]=arguments[r];return(e=t.call.apply(t,[this].concat(i))||this).altKey=void 0,e.button=void 0,e.buttons=void 0,e.ctrlKey=void 0,e.metaKey=void 0,e.relatedTarget=void 0,e.shiftKey=void 0,e.client=new za,e.movement=new za,e.offset=new za,e.global=new za,e.screen=new za,e}ve(e,t);var n=e.prototype;return n.getModifierState=function(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)},n.initMouseEvent=function(){throw new Error("Method not implemented.")},de(e,[{key:"clientX",get:function(){return this.client.x}},{key:"clientY",get:function(){return this.client.y}},{key:"movementX",get:function(){return this.movement.x}},{key:"movementY",get:function(){return this.movement.y}},{key:"offsetX",get:function(){return this.offset.x}},{key:"offsetY",get:function(){return this.offset.y}},{key:"globalX",get:function(){return this.global.x}},{key:"globalY",get:function(){return this.global.y}},{key:"screenX",get:function(){return this.screen.x}},{key:"screenY",get:function(){return this.screen.y}}]),e}(Js),Yu=function(t){function e(){for(var e,n=arguments.length,i=new Array(n),r=0;n>r;r++)i[r]=arguments[r];return(e=t.call.apply(t,[this].concat(i))||this).pointerId=void 0,e.width=0,e.height=0,e.isPrimary=!1,e.pointerType=void 0,e.pressure=void 0,e.tangentialPressure=void 0,e.tiltX=void 0,e.tiltY=void 0,e.twist=void 0,e}ve(e,t);var n=e.prototype;return n.getCoalescedEvents=function(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]},n.getPredictedEvents=function(){throw new Error("getPredictedEvents is not supported!")},e}(Wu),qu=function(t){function e(){for(var e,n=arguments.length,i=new Array(n),r=0;n>r;r++)i[r]=arguments[r];return(e=t.call.apply(t,[this].concat(i))||this).deltaMode=void 0,e.deltaX=void 0,e.deltaY=void 0,e.deltaZ=void 0,e.DOM_DELTA_LINE=0,e.DOM_DELTA_PAGE=1,e.DOM_DELTA_PIXEL=2,e}return ve(e,t),e}(Wu),Xu=function(){function t(){this.delay=0,this.direction="normal",this.duration="auto",this._easing="linear",this.easingFunction=Vi,this.endDelay=0,this.fill="auto",this.iterationStart=0,this.iterations=1,this.playbackRate=void 0,this.effect=void 0,this.composite=void 0,this.activeDuration=void 0,this.endTime=void 0,this.currentIteration=null,this.progress=null}return de(t,[{key:"easing",get:function(){return this._easing},set:function(t){this.easingFunction=Yi(t),this._easing=t}}]),t}(),Ku=function(){function t(t,e){this.type=void 0,this.target=void 0,this.addedNodes=[],this.attributeName=null,this.attributeNamespace=null,this.nextSibling=null,this.oldValue=null,this.previousSibling=null,this.removedNodes=[],this.type=t,this.target=e}return t.copy=function(e){var n=new t(e.type,e.target);return n.addedNodes=e.addedNodes.slice(),n.removedNodes=e.removedNodes.slice(),n.previousSibling=e.previousSibling,n.nextSibling=e.nextSibling,n.attributeName=e.attributeName,n.attributeNamespace=e.attributeNamespace,n.oldValue=e.oldValue,n},t}(),Zu=0,Ju=new WeakMap,Qu=function(){function e(t,e,n){this.observer=void 0,this.target=void 0,this.options=void 0,this.transientObservedNodes=[],this.observer=t,this.target=e,this.options=n}var n=e.prototype;return n.enqueue=function(t){var e=this.observer.records,n=e.length;if(e.length>0){var i=function(t,e){return t===e?t:gu&&function(t){return t===gu||t===vu}(t)?gu:null}(e[n-1],t);if(i)return void(e[n-1]=i)}else ic.push(this.observer),nc||(nc=!0,"undefined"!=typeof globalThis?globalThis.setTimeout(rc):rc());e[n]=t},n.addListeners=function(){this.addListeners_(this.target)},n.addListeners_=function(e){var n=this.options;n.attributes&&e.addEventListener(t.ElementEvent.ATTR_MODIFIED,this,!0),n.childList&&e.addEventListener(t.ElementEvent.INSERTED,this,!0),(n.childList||n.subtree)&&e.addEventListener(t.ElementEvent.REMOVED,this,!0)},n.removeListeners=function(){this.removeListeners_(this.target)},n.removeListeners_=function(e){var n=this.options;n.attributes&&e.removeEventListener(t.ElementEvent.ATTR_MODIFIED,this,!0),n.childList&&e.removeEventListener(t.ElementEvent.INSERTED,this,!0),(n.childList||n.subtree)&&e.removeEventListener(t.ElementEvent.REMOVED,this,!0)},n.removeTransientObservers=function(){var t=this.transientObservedNodes;this.transientObservedNodes=[],t.forEach((function(t){this.removeListeners_(t);for(var e=Ju.get(t),n=0;e.length>n;n++)if(e[n]===this){e.splice(n,1);break}}),this)},n.handleEvent=function(e){var n,i;switch(e.stopImmediatePropagation(),e.type){case t.ElementEvent.ATTR_MODIFIED:var r=e.attrName,o=e.relatedNode.namespaceURI;(n=tc("attributes",i=e.target)).attributeName=r,n.attributeNamespace=o;var a=e.attrChange===uu.ADDITION?null:e.prevValue;ec(i,(function(t){if(t.attributes&&(!t.attributeFilter||!t.attributeFilter.length||-1!==t.attributeFilter.indexOf(r)||-1!==t.attributeFilter.indexOf(o)))return t.attributeOldValue?function(t){return gu||((gu=Ku.copy(vu)).oldValue=t,gu)}(a):n}));break;case t.ElementEvent.REMOVED:case t.ElementEvent.INSERTED:var s,u,c=e.target;e.type===t.ElementEvent.INSERTED?(s=[c],u=[]):(s=[],u=[c]);var l=c.previousSibling,h=c.nextSibling;(n=tc("childList",i=e.relatedNode)).addedNodes=s,n.removedNodes=u,n.previousSibling=l,n.nextSibling=h,ec(i,(function(t){if(t.childList)return n}))}vu=gu=void 0},e}(),$u=function(){function t(t){this.callback=void 0,this.nodes=[],this.records=[],this.uid=Zu++,this.callback=t}var e=t.prototype;return e.observe=function(t,e){if(!e.childList&&!e.attributes&&!e.characterData||e.attributeOldValue&&!e.attributes||e.attributeFilter&&e.attributeFilter.length&&!e.attributes||e.characterDataOldValue&&!e.characterData)throw new SyntaxError;var n,i=Ju.get(t);i||Ju.set(t,i=[]);for(var r=0;i.length>r;r++)if(i[r].observer===this){(n=i[r]).removeListeners(),n.options=e;break}n||(n=new Qu(this,t,e),i.push(n),this.nodes.push(t)),n.addListeners()},e.disconnect=function(){var t=this;this.nodes.forEach((function(e){for(var n=Ju.get(e),i=0;n.length>i;i++){var r=n[i];if(r.observer===t){r.removeListeners(),n.splice(i,1);break}}}),this),this.records=[]},e.takeRecords=function(){var t=this.records;return this.records=[],t},t}();function tc(t,e){return vu=new Ku(t,e)}function ec(t,e){for(var n=t;n;n=n.parentNode){var i=Ju.get(n);if(i)for(var r=0;i.length>r;r++){var o=i[r],a=o.options;if(n===t||a.subtree){var s=e(a);s&&o.enqueue(s)}}}}var nc=!1,ic=[];function rc(){nc=!1;var t=ic;ic=[],t.sort((function(t,e){return t.uid-e.uid}));var e=!1;t.forEach((function(t){var n=t.takeRecords();!function(t){t.nodes.forEach((function(e){var n=Ju.get(e);n&&n.forEach((function(e){e.observer===t&&e.removeTransientObservers()}))}))}(t),n.length&&(t.callback(n,t),e=!0)})),e&&rc()}function oc(t,e){if(null===t)return[];Array.isArray(t)||(t=function(t){var e=[];for(var n in t)if(!(n in["easing","offset","composite"])){var i=t[n];Array.isArray(i)||(i=[i]);for(var r=i.length,o=0;r>o;o++){if(!e[o]){var a={};"offset"in t&&(a.offset=Number(t.offset)),"easing"in t&&(a.easing=t.easing),"composite"in t&&(a.composite=t.composite),e[o]=a}null!=i[o]&&(e[o][n]=i[o])}}return e.sort((function(t,e){return(t.computedOffset||0)-(e.computedOffset||0)})),e}(t));for(var n=t.map((function(t){var n={};for(var i in(null==e?void 0:e.composite)&&(n.composite="auto"),t){var r=t[i];if("offset"===i){if(null!==r){if(r=Number(r),!isFinite(r))throw new Error("Keyframe offsets must be numbers.");if(0>r||r>1)throw new Error("Keyframe offsets must be between 0 and 1.");n.computedOffset=r}}else if("composite"===i&&-1===["replace","add","accumulate","auto"].indexOf(r))throw new Error(r+" compositing is not supported");n[i]=r}return void 0===n.offset&&(n.offset=null),void 0===n.easing&&(n.easing=(null==e?void 0:e.easing)||"linear"),void 0===n.composite&&(n.composite="auto"),n})),i=!0,r=-1/0,o=0;n.length>o;o++){var a=n[o].offset;if(null!=a){if(r>a)throw new TypeError("Keyframes are not loosely sorted by offset. Sort or specify offsets.");r=a}else i=!1}return n=n.filter((function(t){return Number(t.offset)>=0&&1>=Number(t.offset)})),i||function(){var t,e,i=n.length;n[i-1].computedOffset=Number(null!==(t=n[i-1].offset)&&void 0!==t?t:1),i>1&&(n[0].computedOffset=Number(null!==(e=n[0].offset)&&void 0!==e?e:0));for(var r=0,o=Number(n[0].computedOffset),a=1;i>a;a++){var s=Number(n[a].computedOffset);if(null!=s&&null!=o){for(var u=1;a-r>u;u++)n[r+u].computedOffset=o+(s-o)*u/(a-r);r=a,o=s}}}(),n}var ac="backwards|forwards|both|none".split("|"),sc="reverse|alternate|alternate-reverse".split("|");function uc(t,e){var n=new Xu;return e&&(n.fill="both",n.duration="auto"),"number"!=typeof t||isNaN(t)?void 0!==t&&Object.keys(t).forEach((function(e){if(null!=t[e]&&"auto"!==t[e]){if(("number"==typeof n[e]||"duration"===e)&&("number"!=typeof t[e]||isNaN(t[e])))return;if("fill"===e&&-1===ac.indexOf(t[e]))return;if("direction"===e&&-1===sc.indexOf(t[e]))return;n[e]=t[e]}})):n.duration=t,n}function cc(t,e){var n;return uc(t=lc(null!==(n=t)&&void 0!==n?n:{duration:"auto"}),e)}function lc(t){return"number"==typeof t&&(t=isNaN(t)?{duration:"auto"}:{duration:t}),t}var hc=function(){function t(t,e,n){var i=this;this.composite="replace",this.iterationComposite="replace",this.target=void 0,this.animation=void 0,this.timing=void 0,this.computedTiming=void 0,this.normalizedKeyframes=void 0,this.timeFraction=void 0,this.interpolations=void 0,this.target=t,this.timing=cc(n,!1),this.timing.effect=this,this.timing.activeDuration=qi(this.timing),this.timing.endTime=Math.max(0,this.timing.delay+this.timing.activeDuration+this.timing.endDelay),this.normalizedKeyframes=oc(e,this.timing),this.interpolations=Qi(this.normalizedKeyframes,this.timing,this.target),this.computedTiming=new Proxy(this.timing,{get:function(t,e){return"duration"===e?"auto"===t.duration?0:t.duration:"fill"===e?"auto"===t.fill?"none":t.fill:"localTime"===e?i.animation&&i.animation.currentTime||null:"currentIteration"===e?i.animation&&"running"===i.animation.playState?t.currentIteration||0:null:"progress"===e?i.animation&&"running"===i.animation.playState?t.progress||0:null:t[e]},set:function(){return!0}})}var e=t.prototype;return e.applyInterpolations=function(){this.interpolations(this.target,Number(this.timeFraction))},e.update=function(t){return null!==t&&(this.timeFraction=Xi(this.timing.activeDuration,t,this.timing),null!==this.timeFraction)},e.getKeyframes=function(){return this.normalizedKeyframes},e.setKeyframes=function(t){this.normalizedKeyframes=oc(t)},e.getComputedTiming=function(){return this.computedTiming},e.getTiming=function(){return this.timing},e.updateTiming=function(t){var e=this;Object.keys(t||{}).forEach((function(n){e.timing=t[n]}))},t}(),pc=function(){function e(){this.registry={},this.define(t.Shape.CIRCLE,wu),this.define(t.Shape.ELLIPSE,Pu),this.define(t.Shape.RECT,Bu),this.define(t.Shape.IMAGE,_u),this.define(t.Shape.LINE,Au),this.define(t.Shape.GROUP,Cu),this.define(t.Shape.PATH,Iu),this.define(t.Shape.POLYGON,Lu),this.define(t.Shape.POLYLINE,Uu),this.define(t.Shape.TEXT,Gu),this.define(t.Shape.HTML,Hu)}var n=e.prototype;return n.define=function(t,e){this.registry[t]=e},n.get=function(t){return this.registry[t]},e}(),fc=t.Syringe.defineToken("SceneGraphSelectorFactory"),dc=t.Syringe.defineToken("SceneGraphSelector",{multiple:!1}),yc=/\[\s*(.*)=(.*)\s*\]/;function vc(t,e){var n=Number(t.style.zIndex),i=Number(e.style.zIndex);if(n===i){var r=t.parentNode;if(r){var o=r.childNodes||[];return o.indexOf(t)-o.indexOf(e)}}return n-i}function gc(e,n){void 0===n&&(n=!1);for(var i=e;i;){var r=i.renderable;r&&(r.renderBoundsDirty=!0,r.boundsDirty=!0,r.dirty=!0),i=i.parentNode}e.dispatchEvent(new Qs(t.ElementEvent.BOUNDS_CHANGED,{affectChildren:n}))}t.DefaultSceneGraphSelector=function(){function t(){}var e=t.prototype;return e.selectOne=function(t,e){var n=this;if(t.startsWith("."))return e.find((function(e){return e.className===n.getIdOrClassname(t)}));if(t.startsWith("#"))return e.find((function(e){return e.id===n.getIdOrClassname(t)}));if(t.startsWith("[")){var i=this.getAttribute(t),r=i.name,o=i.value;return r?e.find((function(t){return e!==t&&("name"===r?t.name===o:n.attributeToString(t,r)===o)})):null}return e.find((function(n){return e!==n&&n.nodeName===t}))},e.selectAll=function(t,e){var n=this;if(t.startsWith("."))return e.findAll((function(i){return e!==i&&i.className===n.getIdOrClassname(t)}));if(t.startsWith("#"))return e.findAll((function(i){return e!==i&&i.id===n.getIdOrClassname(t)}));if(t.startsWith("[")){var i=this.getAttribute(t),r=i.name,o=i.value;return r?e.findAll((function(t){return e!==t&&("name"===r?t.name===o:n.attributeToString(t,r)===o)})):[]}return e.findAll((function(n){return e!==n&&n.nodeName===t}))},e.is=function(t,e){if(t.startsWith("."))return e.className===this.getIdOrClassname(t);if(t.startsWith("#"))return e.id===this.getIdOrClassname(t);if(t.startsWith("[")){var n=this.getAttribute(t),i=n.name,r=n.value;return"name"===i?e.name===r:this.attributeToString(e,i)===r}return e.nodeName===t},e.getIdOrClassname=function(t){return t.substring(1)},e.getAttribute=function(t){var e=t.match(yc),n="",i="";return e&&e.length>2&&(n=e[1].replace(/"/g,""),i=e[2].replace(/"/g,"")),{name:n,value:i}},e.attributeToString=function(t,e){if(!t.getAttribute)return"";var n=t.getAttribute(e);return De(n)?"":n.toString?n.toString():""},t}(),t.DefaultSceneGraphSelector=se([ct({token:dc})],t.DefaultSceneGraphSelector);var mc=t.Syringe.defineToken("SceneGraphService");t.DefaultSceneGraphService=function(){function e(){var t,e,n,i,r,o=this;this.sceneGraphSelectorFactory=void 0,this.rotate=(t=Vn(),function(e,n,i,r){void 0===i&&(i=0),void 0===r&&(r=0),"number"==typeof n&&(n=Tn(n,i,r));var a=e.transformable;if(null!==e.parentNode&&e.parentNode.transformable){var s=Vn();Wn(s,n[0],n[1],n[2]);var u=o.getRotation(e),c=o.getRotation(e.parentNode);$n(t,c),zn(t,t),jn(s,t,s),jn(a.localRotation,s,u),ei(a.localRotation,a.localRotation),o.dirtifyLocal(e,a)}else o.rotateLocal(e,n)}),this.rotateLocal=(e=Vn(),function(t,n,i,r){void 0===i&&(i=0),void 0===r&&(r=0),"number"==typeof n&&(n=Tn(n,i,r));var a=t.transformable;Wn(e,n[0],n[1],n[2]),ti(a.localRotation,a.localRotation,e),o.dirtifyLocal(t,a)}),this.setEulerAngles=(n=Vn(),function(t,e,i,r){void 0===i&&(i=0),void 0===r&&(r=0),"number"==typeof e&&(e=Tn(e,i,r));var a=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){Wn(a.localRotation,e[0],e[1],e[2]);var s=o.getRotation(t.parentNode);$n(n,zn(Vn(),s)),ti(a.localRotation,a.localRotation,n),o.dirtifyLocal(t,a)}else o.setLocalEulerAngles(t,e)}),this.translateLocal=function(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=0),"number"==typeof e&&(e=Tn(e,n,i));var r=t.transformable;On(e,vn())||(function(t,e,n){var i=n[0],r=n[1],o=n[2],a=e[0],s=e[1],u=e[2],c=r*u-o*s,l=o*a-i*u,h=i*s-r*a,p=r*h-o*l,f=o*c-i*h,d=i*l-r*c,y=2*n[3];l*=y,h*=y,f*=2,d*=2,t[0]=a+(c*=y)+(p*=2),t[1]=s+l+f,t[2]=u+h+d}(e,e,r.localRotation),En(r.localPosition,r.localPosition,e),o.dirtifyLocal(t,r))},this.setPosition=(i=nn(),function(t,e){var n=t.transformable;e=Tn(e[0],e[1],e[2]||0),On(o.getPosition(t),e)||(n.position=e,null!==t.parentNode&&t.parentNode.transformable?(rn(i,t.parentNode.transformable.worldTransform),an(i,i),An(n.localPosition,e,i)):Sn(n.localPosition,e),o.dirtifyLocal(t,n))}),this.translate=(r=vn(),function(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=0),"number"==typeof e&&(e=Tn(e,n,i)),On(e,vn())||(En(r,o.getPosition(t),e),o.setPosition(t,r))}),this.setRotation=function(){var t=Vn();return function(e,n,i,r,a){var s=e.transformable;if("number"==typeof n&&(n=Qn(n,i,r,a)),null!==e.parentNode&&e.parentNode.transformable){var u=o.getRotation(e.parentNode);$n(t,u),zn(t,t),jn(s.localRotation,t,n),ei(s.localRotation,s.localRotation),o.dirtifyLocal(e,s)}else o.setLocalRotation(e,n)}}}var n=e.prototype;return n.matches=function(t,e){return this.sceneGraphSelectorFactory().is(t,e)},n.querySelector=function(t,e){return this.sceneGraphSelectorFactory().selectOne(t,e)},n.querySelectorAll=function(t,e){return this.sceneGraphSelectorFactory().selectAll(t,e)},n.attach=function(t,e,n){t.parentNode&&this.detach(t),t.parentNode=e,De(n)?t.parentNode.childNodes.push(t):t.parentNode.childNodes.splice(n,0,t);var i=e.sortable;i&&(i.dirty=!0);var r=t.transformable;r&&this.dirtifyWorld(t,r),r.frozen&&this.unfreezeParentToRoot(t)},n.detach=function(t){if(t.parentNode){var e=t.transformable,n=t.parentNode.sortable;n&&(n.dirty=!0);var i=t.parentNode.childNodes.indexOf(t);i>-1&&t.parentNode.childNodes.splice(i,1),e&&this.dirtifyWorld(t,e),t.parentNode=null}},n.getOrigin=function(t){return t.transformable.origin},n.setOrigin=function(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=0),"number"==typeof e&&(e=Tn(e,n,i));var r=t.transformable;if(!On(e,r.origin)){var o=r.origin;o[0]=e[0],o[1]=e[1],o[2]=e[2]||0,this.dirtifyLocal(t,r)}},n.setLocalEulerAngles=function(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=0),"number"==typeof e&&(e=Tn(e,n,i));var r=t.transformable;Wn(r.localRotation,e[0],e[1],e[2]),this.dirtifyLocal(t,r)},n.setLocalPosition=function(t,e){var n=t.transformable;e=Tn(e[0],e[1],e[2]||0),On(n.localPosition,e)||(Sn(n.localPosition,e),this.dirtifyLocal(t,n))},n.scaleLocal=function(t,e){var n=t.transformable;xn(n.localScale,n.localScale,Tn(e[0],e[1],e[2]||1)),this.dirtifyLocal(t,n)},n.setLocalScale=function(t,e){var n=t.transformable,i=Tn(e[0],e[1],e[2]||n.localScale[2]);On(i,n.localScale)||(Sn(n.localScale,i),this.dirtifyLocal(t,n))},n.setLocalRotation=function(t,e,n,i,r){"number"==typeof e&&(e=Qn(e,n,i,r));var o=t.transformable;$n(o.localRotation,e),this.dirtifyLocal(t,o)},n.dirtifyLocal=function(t,e){e.localDirtyFlag||(e.localDirtyFlag=!0,e.dirtyFlag||this.dirtifyWorld(t,e))},n.dirtifyWorld=function(t,e){e.dirtyFlag||this.unfreezeParentToRoot(t),this.dirtifyWorldInternal(t,e),gc(t,!0)},n.getPosition=function(t){var e=t.transformable;return ln(e.position,this.getWorldTransform(t,e))},n.getRotation=function(t){var e=t.transformable;return pn(e.rotation,this.getWorldTransform(t,e))},n.getScale=function(t){var e=t.transformable;return hn(e.scaling,this.getWorldTransform(t,e))},n.getWorldTransform=function(t,e){return void 0===e&&(e=t.transformable),e.localDirtyFlag||e.dirtyFlag?(t.parentNode&&t.parentNode.transformable&&this.getWorldTransform(t.parentNode),this.sync(t,e),e.worldTransform):e.worldTransform},n.getLocalPosition=function(t){return t.transformable.localPosition},n.getLocalRotation=function(t){return t.transformable.localRotation},n.getLocalScale=function(t){return t.transformable.localScale},n.getLocalTransform=function(t){var e=t.transformable;return e.localDirtyFlag&&(fn(e.localTransform,e.localRotation,e.localPosition,e.localScale,e.origin),e.localDirtyFlag=!1),e.localTransform},n.setLocalTransform=function(t,e){var n=ln(vn(),e),i=pn(Vn(),e),r=hn(vn(),e);this.setLocalScale(t,r),this.setLocalPosition(t,n),this.setLocalRotation(t,i)},n.resetLocalTransform=function(t){this.setLocalScale(t,[1,1,1]),this.setLocalPosition(t,[0,0,0]),this.setLocalEulerAngles(t,[0,0,0])},n.getTransformedGeometryBounds=function(t,e){void 0===e&&(e=!1);var n=this.getGeometryBounds(t,e);if(Ia.isEmpty(n))return null;var i=new Ia;return i.setFromTransformedAABB(n,this.getWorldTransform(t)),i},n.getGeometryBounds=function(t,e){void 0===e&&(e=!1);var n=t.geometry,i=e?n.renderBounds:n.contentBounds||null;return i&&new Ia(i.center,i.halfExtents)||new Ia},n.getBounds=function(t,e){var n=this;void 0===e&&(e=!1);var i=t.renderable;if(!i.boundsDirty&&!e&&i.bounds)return i.bounds;if(!i.renderBoundsDirty&&e&&i.renderBounds)return i.renderBounds;var r=this.getTransformedGeometryBounds(t,e);t.childNodes.forEach((function(t){var i=n.getBounds(t,e);i&&(r?r.add(i):(r=new Ia).update(i.center,i.halfExtents))}));var o=t.style.clipPath;if(o){var a,s=this.getTransformedGeometryBounds(o,!0);s&&(a=new Ia).setFromTransformedAABB(s,this.getWorldTransform(t)),r?a&&(r=a.intersection(r)):r=a}return r&&(e?i.renderBounds=r:i.bounds=r),e?i.renderBoundsDirty=!1:i.boundsDirty=!1,r||new Ia},n.getLocalBounds=function(t){if(t.parentNode){var e=nn();t.parentNode.transformable&&(e=an(nn(),this.getWorldTransform(t.parentNode)));var n=this.getBounds(t);if(!Ia.isEmpty(n)){var i=new Ia;return i.setFromTransformedAABB(n,e),i}}return this.getBounds(t)},n.getBoundingClientRect=function(t){var e,n,i,r=this.getGeometryBounds(t);Ia.isEmpty(r)||(i=new Ia).setFromTransformedAABB(r,this.getWorldTransform(t));var o=null===(e=t.ownerDocument)||void 0===e||null===(n=e.defaultView)||void 0===n?void 0:n.getContextService().getBoundingClientRect();if(i){var a=i.getMin(),s=a[0],u=a[1],c=i.getMax();return new Wa(s+((null==o?void 0:o.left)||0),u+((null==o?void 0:o.top)||0),c[0]-s,c[1]-u)}return new Wa((null==o?void 0:o.left)||0,(null==o?void 0:o.top)||0,0,0)},n.dirtifyWorldInternal=function(e,n){var i=this;if(!n.dirtyFlag){n.dirtyFlag=!0,n.frozen=!1,e.childNodes.forEach((function(t){var e=t.transformable;e.dirtyFlag||i.dirtifyWorldInternal(t,e)}));var r=e.renderable;r&&(r.renderBoundsDirty=!0,r.boundsDirty=!0,r.dirty=!0),e.dispatchEvent(new uu(t.ElementEvent.ATTR_MODIFIED,e,null,null,"modelMatrix",uu.MODIFICATION,null,null))}},n.syncHierarchy=function(t){var e=t.transformable;if(!e.frozen){e.frozen=!0,(e.localDirtyFlag||e.dirtyFlag)&&this.sync(t,e);for(var n=t.childNodes,i=0;n.length>i;i++)this.syncHierarchy(n[i])}},n.sync=function(t,e){if(e.localDirtyFlag&&(fn(e.localTransform,e.localRotation,e.localPosition,e.localScale,e.origin),e.localDirtyFlag=!1),e.dirtyFlag){var n=t.parentNode,i=n&&n.transformable;null!==n&&i?sn(e.worldTransform,i.worldTransform,e.localTransform):rn(e.worldTransform,e.localTransform),e.dirtyFlag=!1}},n.unfreezeParentToRoot=function(t){for(var e=t.parentNode;e;){var n=e.transformable;n&&(n.frozen=!1),e=e.parentNode}},e}(),se([lt(fc),ce("design:type",Function)],t.DefaultSceneGraphService.prototype,"sceneGraphSelectorFactory",void 0),t.DefaultSceneGraphService=se([ct({token:mc})],t.DefaultSceneGraphService);var Tc,Sc=t.Syringe.defineToken("ContextService",{multiple:!1});(Tc=t.RenderReason||(t.RenderReason={}))[Tc.CAMERA_CHANGED=0]="CAMERA_CHANGED",Tc[Tc.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",Tc[Tc.NONE=2]="NONE";var bc=t.Syringe.defineToken("RenderingContext"),Ec=t.Syringe.defineToken("RenderingPluginContribution");t.RenderingService=function(){function e(){this.renderingPluginProvider=void 0,this.renderingContext=void 0,this.sceneGraphService=void 0,this.styleValueRegistry=void 0,this.inited=!1,this.stats={total:0,rendered:0},this.zIndexCounter=0,this.hooks={init:new Dr,dirtycheck:new Qr(["object"]),cull:new Qr(["object"]),beginFrame:new Yr([]),beforeRender:new Yr(["objectToRender"]),render:new Yr(["objectToRender"]),afterRender:new Yr(["objectToRender"]),endFrame:new Yr([]),destroy:new Yr([]),pick:new Vr(["result"]),pointerDown:new Yr(["event"]),pointerUp:new Yr(["event"]),pointerMove:new Yr(["event"]),pointerOut:new Yr(["event"]),pointerOver:new Yr(["event"]),pointerWheel:new Yr(["event"]),pointerCancel:new Yr(["event"])}}var n=e.prototype;return n.init=function(){var t=pe(le().mark((function t(){var e=this;return le().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.renderingPluginProvider.getContributions({cache:!1}).forEach((function(t){t.apply(e)})),t.next=3,this.hooks.init.promise();case 3:this.inited=!0;case 4:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}(),n.getStats=function(){return this.stats},n.render=function(t){var e=this;this.stats.total=0,this.stats.rendered=0,this.zIndexCounter=0,this.sceneGraphService.syncHierarchy(this.renderingContext.root),this.renderingContext.renderReasons.size&&this.inited&&(this.renderDisplayObject(this.renderingContext.root,t),(this.renderingContext.renderListCurrentFrame.length||this.renderingContext.renderListLastFrame.length!==this.renderingContext.renderListCurrentFrame.length)&&(this.hooks.beginFrame.call(),this.renderingContext.renderListCurrentFrame.forEach((function(t){e.hooks.beforeRender.call(t),e.hooks.render.call(t),e.hooks.afterRender.call(t)})),this.hooks.endFrame.call()),this.renderingContext.renderListLastFrame=[].concat(this.renderingContext.renderListCurrentFrame),this.renderingContext.renderListCurrentFrame=[],this.renderingContext.renderReasons.clear())},n.renderDisplayObject=function(e,n){var i=this,r=n.renderer.getConfig(),o=r.enableDirtyCheck,a=r.enableCulling;this.styleValueRegistry.recalc(e);var s=o?this.hooks.dirtycheck.call(e):e;if(s){var u=a?this.hooks.cull.call(s):s;u&&(this.stats.rendered++,this.renderingContext.renderListCurrentFrame.push(u))}e.renderable.dirty=!1,e.sortable.renderOrder=this.zIndexCounter++,this.stats.total++;var c=e.sortable,l=!1;c.dirty&&(c.sorted=e.childNodes.slice().sort(vc),l=!0,c.dirty=!1),(c.sorted||e.childNodes).forEach((function(t){i.renderDisplayObject(t,n)})),l&&e.forEach((function(e){e.dispatchEvent(new Qs(t.ElementEvent.RENDER_ORDER_CHANGED,{renderOrder:e.sortable.renderOrder}))}))},n.destroy=function(){this.inited=!1,this.hooks.destroy.call()},n.dirtify=function(){this.renderingContext.renderReasons.add(t.RenderReason.DISPLAY_OBJECT_CHANGED)},e}(),se([jt(Ec),ce("design:type",Object)],t.RenderingService.prototype,"renderingPluginProvider",void 0),se([lt(bc),ce("design:type",Object)],t.RenderingService.prototype,"renderingContext",void 0),se([lt(mc),ce("design:type",Object)],t.RenderingService.prototype,"sceneGraphService",void 0),se([lt(Bi),ce("design:type",Object)],t.RenderingService.prototype,"styleValueRegistry",void 0),t.RenderingService=se([ct()],t.RenderingService);t.EventService=function(t){function e(){for(var e,n=arguments.length,i=new Array(n),r=0;n>r;r++)i[r]=arguments[r];return(e=t.call.apply(t,[this].concat(i))||this).renderingContext=void 0,e.contextService=void 0,e.canvasConfig=void 0,e.displayObjectPool=void 0,e.rootTarget=void 0,e.cursor="default",e.mappingTable={},e.mappingState={trackingData:{}},e.eventPool=new Map,e.pickHandler=void 0,e.onPointerDown=function(){var t=pe(le().mark((function t(n){var i;return le().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n instanceof Yu){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,e.createPointerEvent(n);case 4:e.dispatchEvent(i=t.sent,"pointerdown"),"touch"===i.pointerType?e.dispatchEvent(i,"touchstart"):"mouse"!==i.pointerType&&"pen"!==i.pointerType||e.dispatchEvent(i,2===i.button?"rightdown":"mousedown"),e.trackingData(n.pointerId).pressTargetsByButton[n.button]=i.composedPath(),e.freeEvent(i);case 10:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),e.onPointerUp=function(){var t=pe(le().mark((function t(n){var i,r,o,a,s,u,c,l;return le().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n instanceof Yu){t.next=2;break}return t.abrupt("return");case 2:return i=performance.now(),t.next=5,e.createPointerEvent(n);case 5:if(e.dispatchEvent(r=t.sent,"pointerup"),"touch"===r.pointerType?e.dispatchEvent(r,"touchend"):"mouse"!==r.pointerType&&"pen"!==r.pointerType||e.dispatchEvent(r,2===r.button?"rightup":"mouseup"),o=e.trackingData(n.pointerId),a=e.findMountedTarget(o.pressTargetsByButton[n.button]),s=a,a&&!r.composedPath().includes(a)){for(u=a;u&&!r.composedPath().includes(u);)r.currentTarget=u,e.notifyTarget(r,"pointerupoutside"),"touch"===r.pointerType?e.notifyTarget(r,"touchendoutside"):"mouse"!==r.pointerType&&"pen"!==r.pointerType||e.notifyTarget(r,2===r.button?"rightupoutside":"mouseupoutside"),tu.isNode(u)&&(u=u.parentNode);delete o.pressTargetsByButton[n.button],s=u}s&&((c=e.clonePointerEvent(r,"click")).target=s,c.path=[],o.clicksByButton[n.button]||(o.clicksByButton[n.button]={clickCount:0,target:c.target,timeStamp:i}),(l=o.clicksByButton[n.button]).target===c.target&&200>i-l.timeStamp?++l.clickCount:l.clickCount=1,l.target=c.target,l.timeStamp=i,c.detail=l.clickCount,e.dispatchEvent(c,"mouse"===c.pointerType||"touch"===c.pointerType?"click":"pointertap"),e.freeEvent(c)),e.freeEvent(r);case 14:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),e.onPointerMove=function(){var t=pe(le().mark((function t(n){var i,r,o,a,s,u,c,l,h,p;return le().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n instanceof Yu){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,e.createPointerEvent(n);case 4:if(r="mouse"===(i=t.sent).pointerType||"pen"===i.pointerType,o=e.trackingData(n.pointerId),a=e.findMountedTarget(o.overTargets),!o.overTargets||a===i.target){t.next=23;break}return s="mousemove"===n.type?"mouseout":"pointerout",t.next=12,e.createPointerEvent(n,s,a||void 0);case 12:if(e.dispatchEvent(u=t.sent,"pointerout"),r&&e.dispatchEvent(u,"mouseout"),i.composedPath().includes(a)){t.next=22;break}return t.next=18,e.createPointerEvent(n,"pointerleave",a||void 0);case 18:for((c=t.sent).eventPhase=c.AT_TARGET;c.target&&!i.composedPath().includes(c.target);)c.currentTarget=c.target,e.notifyTarget(c),r&&e.notifyTarget(c,"mouseleave"),tu.isNode(c.target)&&(c.target=c.target.parentNode);e.freeEvent(c);case 22:e.freeEvent(u);case 23:if(a===i.target){t.next=38;break}l=e.clonePointerEvent(i,"mousemove"===n.type?"mouseover":"pointerover"),e.dispatchEvent(l,"pointerover"),r&&e.dispatchEvent(l,"mouseover"),h=a&&tu.isNode(a)&&a.parentNode;case 29:if(!h||h===(tu.isNode(e.rootTarget)&&e.rootTarget.parentNode)){t.next=35;break}if(h!==i.target){t.next=32;break}return t.abrupt("break",35);case 32:h=h.parentNode,t.next=29;break;case 35:if(!h||h===(tu.isNode(e.rootTarget)&&e.rootTarget.parentNode)){for((p=e.clonePointerEvent(i,"pointerenter")).eventPhase=p.AT_TARGET;p.target&&p.target!==a&&p.target!==(tu.isNode(e.rootTarget)&&e.rootTarget.parentNode);)p.currentTarget=p.target,e.notifyTarget(p),r&&e.notifyTarget(p,"mouseenter"),tu.isNode(p.target)&&(p.target=p.target.parentNode);e.freeEvent(p)}e.freeEvent(l);case 38:e.dispatchEvent(i,"pointermove"),"touch"===i.pointerType&&e.dispatchEvent(i,"touchmove"),r&&(e.dispatchEvent(i,"mousemove"),e.cursor=e.getCursor(i.target)),o.overTargets=i.composedPath(),e.freeEvent(i);case 43:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),e.onPointerOut=function(){var t=pe(le().mark((function t(n){var i,r,o,a,s;return le().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n instanceof Yu){t.next=2;break}return t.abrupt("return");case 2:if(!(i=e.trackingData(n.pointerId)).overTargets){t.next=19;break}return r="mouse"===n.pointerType||"pen"===n.pointerType,o=e.findMountedTarget(i.overTargets),t.next=8,e.createPointerEvent(n,"pointerout",o||void 0);case 8:return e.dispatchEvent(a=t.sent),r&&e.dispatchEvent(a,"mouseout"),t.next=13,e.createPointerEvent(n,"pointerleave",o||void 0);case 13:for((s=t.sent).eventPhase=s.AT_TARGET;s.target&&s.target!==(tu.isNode(e.rootTarget)&&e.rootTarget.parentNode);)s.currentTarget=s.target,e.notifyTarget(s),r&&e.notifyTarget(s,"mouseleave"),tu.isNode(s.target)&&(s.target=s.target.parentNode);i.overTargets=null,e.freeEvent(a),e.freeEvent(s);case 19:e.cursor=null;case 20:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),e.onPointerOver=function(){var t=pe(le().mark((function t(n){var i,r,o,a;return le().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n instanceof Yu){t.next=2;break}return t.abrupt("return");case 2:return i=e.trackingData(n.pointerId),t.next=5,e.createPointerEvent(n);case 5:for(o="mouse"===(r=t.sent).pointerType||"pen"===r.pointerType,e.dispatchEvent(r,"pointerover"),o&&e.dispatchEvent(r,"mouseover"),"mouse"===r.pointerType&&(e.cursor=e.getCursor(r.target)),(a=e.clonePointerEvent(r,"pointerenter")).eventPhase=a.AT_TARGET;a.target&&a.target!==(tu.isNode(e.rootTarget)&&e.rootTarget.parentNode);)a.currentTarget=a.target,e.notifyTarget(a),o&&e.notifyTarget(a,"mouseenter"),tu.isNode(a.target)&&(a.target=a.target.parentNode);i.overTargets=r.composedPath(),e.freeEvent(r),e.freeEvent(a);case 16:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),e.onPointerUpOutside=function(){var t=pe(le().mark((function t(n){var i,r,o,a;return le().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n instanceof Yu){t.next=2;break}return t.abrupt("return");case 2:return i=e.trackingData(n.pointerId),r=e.findMountedTarget(i.pressTargetsByButton[n.button]),t.next=6,e.createPointerEvent(n);case 6:if(o=t.sent,r){for(a=r;a;)o.currentTarget=a,e.notifyTarget(o,"pointerupoutside"),"touch"===o.pointerType||"mouse"!==o.pointerType&&"pen"!==o.pointerType||e.notifyTarget(o,2===o.button?"rightupoutside":"mouseupoutside"),tu.isNode(a)&&(a=a.parentNode);delete i.pressTargetsByButton[n.button]}e.freeEvent(o);case 9:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),e.onWheel=function(){var t=pe(le().mark((function t(n){var i;return le().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n instanceof qu){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,e.createWheelEvent(n);case 4:e.dispatchEvent(i=t.sent),e.freeEvent(i);case 7:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),e}ve(e,t);var n=e.prototype;return n.init=function(){this.rootTarget=this.renderingContext.root.parentNode,this.addEventMapping("pointerdown",this.onPointerDown),this.addEventMapping("pointerup",this.onPointerUp),this.addEventMapping("pointermove",this.onPointerMove),this.addEventMapping("pointerout",this.onPointerOut),this.addEventMapping("pointerleave",this.onPointerOut),this.addEventMapping("pointerover",this.onPointerOver),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel)},n.client2Viewport=function(t){var e=this.contextService.getBoundingClientRect();return new za(t.x-((null==e?void 0:e.left)||0),t.y-((null==e?void 0:e.top)||0))},n.viewport2Client=function(t){var e=this.contextService.getBoundingClientRect();return new za(t.x+((null==e?void 0:e.left)||0),t.y+((null==e?void 0:e.top)||0))},n.viewport2Canvas=function(t){var e=t.x,n=t.y,i=this.rootTarget.defaultView.getCamera(),r=this.canvasConfig,o=r.width,a=r.height,s=i.getPerspectiveInverse(),u=i.getWorldTransform(),c=sn(nn(),u,s),l=Tn(e/o*2-1,2*(1-n/a)-1,0);return An(l,l,c),new za(l[0],l[1])},n.canvas2Viewport=function(t){var e=this.rootTarget.defaultView.getCamera(),n=e.getPerspective(),i=e.getViewTransform(),r=sn(nn(),n,i),o=Tn(t.x,t.y,0);An(o,o,r);var a=this.canvasConfig;return new za((o[0]+1)/2*a.width,(1-(o[1]+1)/2)*a.height)},n.setPickHandler=function(t){this.pickHandler=t},n.addEventMapping=function(t,e){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:e,priority:0}),this.mappingTable[t].sort((function(t,e){return t.priority-e.priority}))},n.mapEvent=function(t){if(this.rootTarget){var e=this.mappingTable[t.type];if(e)for(var n=0,i=e.length;i>n;n++)e[n].fn(t);else console.warn("[EventService]: Event mapping not defined for "+t.type)}},n.dispatchEvent=function(t,e){t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e),this.emit(e||t.type,t)},n.propagate=function(t,e){if(t.target){var n=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(var i=n.length-1;i>=1;i--)if(t.currentTarget=n[i],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,e),!t.propagationStopped&&!t.propagationImmediatelyStopped){var r=n.indexOf(t.currentTarget);t.eventPhase=t.BUBBLING_PHASE;for(var o=r+1;n.length>o;o++)if(t.currentTarget=n[o],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}},n.propagationPath=function(t){var e=[t],n=this.rootTarget.defaultView||null;if(n&&n===t)return e.unshift(n.document),e;for(var i=0;2048>i&&t!==this.rootTarget;i++)tu.isNode(t)&&t.parentNode&&(e.push(t.parentNode),t=t.parentNode);return n&&e.push(n),e},n.hitTest=function(){var t=pe(le().mark((function t(e){var n,i,r,o,a;return le().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=e.viewportY,o=(r=this.canvasConfig).width,a=r.height,!(0>(n=e.viewportX)||0>i||n>o||i>a)){t.next=4;break}return t.abrupt("return",null);case 4:return t.next=6,this.pickHandler(e);case 6:if(t.t1=t.sent,t.t1){t.next=9;break}t.t1=this.rootTarget;case 9:if(t.t0=t.t1,t.t0){t.next=12;break}t.t0=null;case 12:return t.abrupt("return",t.t0);case 13:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),n.isNativeEventFromCanvas=function(t){var e,n=this.contextService.getDomElement(),i=null===(e=t.nativeEvent)||void 0===e?void 0:e.target;if(i){if(i===n)return!0;if(n&&n.contains)return n.contains(i)}return!!t.nativeEvent.composedPath&&t.nativeEvent.composedPath().indexOf(n)>-1},n.getExistedHTML=function(t){if(t.nativeEvent.composedPath)for(var e,n=we(this.displayObjectPool.getHTMLs());!(e=n()).done;){var i=e.value;if(t.nativeEvent.composedPath().indexOf(i)>-1)return i}return null},n.pickTarget=function(){var t=pe(le().mark((function t(e){return le().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.hitTest({clientX:e.clientX,clientY:e.clientY,viewportX:e.viewportX,viewportY:e.viewportY,x:e.canvasX,y:e.canvasY}));case 1:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),n.createPointerEvent=function(){var t=pe(le().mark((function t(e,n,i){var r,o;return le().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.allocateEvent(Yu),this.copyPointerData(e,r),this.copyMouseData(e,r),this.copyData(e,r),r.nativeEvent=e.nativeEvent,r.originalEvent=e,o=this.getExistedHTML(r),null==i){t.next=11;break}t.t0=i,t.next=20;break;case 11:if(t.t1=o,t.t1){t.next=19;break}if(t.t2=this.isNativeEventFromCanvas(r),!t.t2){t.next=18;break}return t.next=17,this.pickTarget(r);case 17:t.t2=t.sent;case 18:t.t1=t.t2;case 19:t.t0=t.t1;case 20:return r.target=t.t0,"string"==typeof n&&(r.type=n),t.abrupt("return",r);case 23:case"end":return t.stop()}}),t,this)})));return function(e,n,i){return t.apply(this,arguments)}}(),n.createWheelEvent=function(){var t=pe(le().mark((function t(e){var n,i;return le().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=this.allocateEvent(qu),this.copyWheelData(e,n),this.copyMouseData(e,n),this.copyData(e,n),n.nativeEvent=e.nativeEvent,n.originalEvent=e,i=this.getExistedHTML(n),t.t0=i,t.t0){t.next=15;break}if(t.t1=this.isNativeEventFromCanvas(n),!t.t1){t.next=14;break}return t.next=13,this.pickTarget(n);case 13:t.t1=t.sent;case 14:t.t0=t.t1;case 15:return n.target=t.t0,t.abrupt("return",n);case 17:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),n.trackingData=function(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]},n.clonePointerEvent=function(t,e){var n=this.allocateEvent(Yu);return n.nativeEvent=t.nativeEvent,n.originalEvent=t.originalEvent,this.copyPointerData(t,n),this.copyMouseData(t,n),this.copyData(t,n),n.target=t.target,n.path=t.composedPath().slice(),n.type=null!=e?e:n.type,n},n.copyPointerData=function(t,e){t instanceof Yu&&e instanceof Yu&&(e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist)},n.copyMouseData=function(t,e){t instanceof Wu&&e instanceof Wu&&(e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.shiftKey=t.shiftKey,e.client.copyFrom(t.client),e.movement.copyFrom(t.movement),e.canvas.copyFrom(t.canvas),e.screen.copyFrom(t.screen),e.global.copyFrom(t.global),e.offset.copyFrom(t.offset))},n.copyWheelData=function(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ},n.copyData=function(t,e){e.isTrusted=t.isTrusted,e.timeStamp=performance.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.page.copyFrom(t.page),e.viewport.copyFrom(t.viewport)},n.allocateEvent=function(t){this.eventPool.has(t)||this.eventPool.set(t,[]);var e=this.eventPool.get(t).pop()||new t(this);return e.eventPhase=e.NONE,e.currentTarget=null,e.path=[],e.target=null,e},n.freeEvent=function(t){if(t.manager!==this)throw new Error("It is illegal to free an event not managed by this EventBoundary!");var e=t.constructor;this.eventPool.has(e)||this.eventPool.set(e,[]),this.eventPool.get(e).push(t)},n.notifyTarget=function(t,e){var n;e=null!==(n=e)&&void 0!==n?n:t.type,this.notifyListeners(t,t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?e+"capture":e),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,e)},n.notifyListeners=function(t,e){var n=t.currentTarget.emitter,i=n._events[e];if(i)if("fn"in i)i.once&&n.removeListener(e,i.fn,void 0,!0),i.fn.call(t.currentTarget||i.context,t);else for(var r=0;i.length>r&&!t.propagationImmediatelyStopped;r++)i[r].once&&n.removeListener(e,i[r].fn,void 0,!0),i[r].fn.call(t.currentTarget||i[r].context,t)},n.findMountedTarget=function(t){if(!t)return null;for(var e=t[t.length-1],n=t.length-2;n>=0;n--){var i=t[n];if(!(i===this.rootTarget||tu.isNode(i)&&i.parentNode===e))break;e=t[n]}return e},n.getCursor=function(t){for(var e=t;e;){var n=lu.isElement(e)&&e.getAttribute("cursor");if(n)return n;e=tu.isNode(e)&&e.parentNode}},e}(mo.EventEmitter),se([lt(bc),ce("design:type",Object)],t.EventService.prototype,"renderingContext",void 0),se([lt(Sc),ce("design:type",Object)],t.EventService.prototype,"contextService",void 0),se([lt(gr),ce("design:type",Object)],t.EventService.prototype,"canvasConfig",void 0),se([lt(t.DisplayObjectPool),ce("design:type",t.DisplayObjectPool)],t.EventService.prototype,"displayObjectPool",void 0),se([Y.postConstruct(),ce("design:type",Function),ce("design:paramtypes",[]),ce("design:returntype",void 0)],t.EventService.prototype,"init",null),t.EventService=se([ct()],t.EventService),t.OffscreenCanvasCreator=function(){function t(){this.canvas=void 0,this.context=void 0}var e=t.prototype;return e.getOrCreateCanvas=function(t){if(this.canvas)return this.canvas;if(t)this.canvas=t,this.context=this.canvas.getContext("2d");else try{this.canvas=new window.OffscreenCanvas(0,0),this.context=this.canvas.getContext("2d"),this.context&&this.context.measureText||(this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"))}catch(t){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d")}return this.canvas.width=10,this.canvas.height=10,this.canvas},e.getOrCreateContext=function(t){return this.context||this.getOrCreateCanvas(t),this.context},t}(),t.OffscreenCanvasCreator=se([ct()],t.OffscreenCanvasCreator);var wc={MetricsString:"|ÉqÅ",BaselineSymbol:"M",BaselineMultiplier:1.4,HeightMultiplier:2,Newlines:[10,13],BreakingSpaces:[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288]},xc=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,Pc=new RegExp(/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/.source+"|"+/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/.source+"|"+/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/.source+"|"+/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/.source),kc=new RegExp(/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/.source+"|"+/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/.source+"|"+/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/.source+"|"+/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/.source);t.TextService=function(){function t(){var t=this;this.cache={},this.offscreenCanvas=void 0,this.shouldBreakByKinsokuShorui=function(e,n){return!t.isBreakingSpace(n)&&!(!e||!kc.exec(n)&&!Pc.exec(e))},this.trimByKinsokuShorui=function(t){var e=[].concat(t),n=e[e.length-2];if(!n)return t;var i=n[n.length-1];return e[e.length-2]=n.slice(0,-1),e[e.length-1]=i+e[e.length-1],e}}var e=t.prototype;return e.measureFont=function(t,e){if(this.cache[t])return this.cache[t];var n={ascent:0,descent:0,fontSize:0},i=this.offscreenCanvas.getOrCreateCanvas(e),r=this.offscreenCanvas.getOrCreateContext(e);r.font=t;var o=wc.MetricsString+wc.BaselineSymbol,a=Math.ceil(r.measureText(o).width),s=Math.ceil(r.measureText(wc.BaselineSymbol).width),u=wc.HeightMultiplier*s;s=s*wc.BaselineMultiplier|0,i.width=a,i.height=u,r.fillStyle="#f00",r.fillRect(0,0,a,u),r.font=t,r.textBaseline="alphabetic",r.fillStyle="#000",r.fillText(o,0,s);var c=r.getImageData(0,0,a||1,u||1).data,l=c.length,h=4*a,p=0,f=0,d=!1;for(p=0;s>p;++p){for(var y=0;h>y;y+=4)if(255!==c[f+y]){d=!0;break}if(d)break;f+=h}for(n.ascent=s-p,f=l-h,d=!1,p=u;p>s;--p){for(var v=0;h>v;v+=4)if(255!==c[f+v]){d=!0;break}if(d)break;f-=h}return n.descent=p-s,n.fontSize=n.ascent+n.descent,this.cache[t]=n,n},e.measureText=function(t,e,n){var i=e.fontSize,r=e.wordWrap,o=e.lineHeight,a=void 0===o?0:o,s=e.lineWidth,u=e.textBaseline,c=e.textAlign,l=e.letterSpacing,h=void 0===l?0:l,p=e.leading,f=void 0===p?0:p,d=to(e),y=this.measureFont(d,n);0===y.fontSize&&(y.fontSize=i.value,y.ascent=i.value);var v=this.offscreenCanvas.getOrCreateContext(n);v.font=d;for(var g=(r?this.wordWrap(t,e,n):t).split(/(?:\r\n|\r|\n)/),m=new Array(g.length),T=0,S=0;g.length>S;S++){var b=v.measureText(g[S]).width+(g[S].length-1)*h;m[S]=b,T=Math.max(T,b)}var E=T+s.value,w=a||y.fontSize+s.value,x=Math.max(w,y.fontSize+s.value)+(g.length-1)*(w+f),P=0;return"middle"===u.value?P=-x/2:"bottom"===u.value||"alphabetic"===u.value||"ideographic"===u.value?P=-x:"top"!==u.value&&"hanging"!==u.value||(P=0),{font:d,width:E,height:x,lines:g,lineWidths:m,lineHeight:w+=f,maxLineWidth:T,fontProperties:y,lineMetrics:m.map((function(t,e){var n=0;return"center"===c.value?n-=t/2:"right"!==c.value&&"end"!==c.value||(n-=t),new Wa(n-s.value/2,P+e*w,t+s.value,w)}))}},e.wordWrap=function(t,e,n){var i=this,r=e.wordWrapWidth,o=void 0===r?0:r,a=e.letterSpacing,s=void 0===a?0:a,u=this.offscreenCanvas.getOrCreateContext(n),c=o+s,l=[],h=0,p=0,f={},d=function(t){return i.getFromCache(t,s,f,u)};return Array.from(t).forEach((function(e,n){var r=t[n-1],o=t[n+1],a=d(e);if(i.isNewline(e))return h++,p=0,void(l[h]="");if(p>0&&p+a>c){if(h++,p=0,l[h]="",i.isBreakingSpace(e))return;i.canBreakInLastChar(e)||(l=i.trimToBreakable(l),p=i.sumTextWidthByCache(l[h]||"",f)),i.shouldBreakByKinsokuShorui(e,o)&&(l=i.trimByKinsokuShorui(l),p+=d(r||""))}p+=a,l[h]=(l[h]||"")+e})),l.join("\n")},e.isBreakingSpace=function(t){return"string"==typeof t&&wc.BreakingSpaces.indexOf(t.charCodeAt(0))>=0},e.isNewline=function(t){return"string"==typeof t&&wc.Newlines.indexOf(t.charCodeAt(0))>=0},e.trimToBreakable=function(t){var e=[].concat(t),n=e[e.length-2],i=this.findBreakableIndex(n);if(-1===i||!n)return e;var r=n.slice(i,i+1),o=i+(this.isBreakingSpace(r)?0:1);return e[e.length-1]+=n.slice(i+1,n.length),e[e.length-2]=n.slice(0,o),e},e.canBreakInLastChar=function(t){return!t||!xc.test(t)},e.sumTextWidthByCache=function(t,e){return t.split("").reduce((function(t,n){if(!e[n])throw Error("cannot count the word without cache");return t+e[n]}),0)},e.findBreakableIndex=function(t){for(var e=t.length-1;e>=0;e--)if(!xc.test(t[e]))return e;return-1},e.getFromCache=function(t,e,n,i){var r=n[t];if("number"!=typeof r){var o=t.length*e;r=i.measureText(t).width+o,n[t]=r}return r},t}(),se([lt(t.OffscreenCanvasCreator),ce("design:type",t.OffscreenCanvasCreator)],t.TextService.prototype,"offscreenCanvas",void 0),t.TextService=se([ct()],t.TextService);var Cc=t.Syringe.defineToken("GeometryUpdaterFactory"),Nc=t.Syringe.defineToken("GeometryAABBUpdater");function _c(t){var e=t.parsedStyle.fontSize;return e&&!Lo.isRelativeUnit(e.unit)?e.clone():new Lo(0,"px")}t.CircleUpdater=function(){function t(){}return t.prototype.update=function(t,e){var n=t.r;return{width:2*n.value,height:2*n.value}},t}(),t.CircleUpdater=se([ct({token:{token:Nc,named:t.Shape.CIRCLE}})],t.CircleUpdater),t.EllipseUpdater=function(){function t(){}return t.prototype.update=function(t,e){return{width:2*t.rx.value,height:2*t.ry.value}},t}(),t.EllipseUpdater=se([ct({token:{token:Nc,named:t.Shape.ELLIPSE}})],t.EllipseUpdater),t.RectUpdater=function(){function e(){}return e.prototype.update=function(e,n){var i=e.img,r=e.width,o=e.height,a=0,s=0;return r instanceof Lo&&r.unit===t.UnitType.kPixels&&(a=r.value),o instanceof Lo&&o.unit===t.UnitType.kPixels&&(s=o.value),i&&!Ji(i)&&(a||(a=i.width),s||(s=i.height)),r instanceof Lo&&(r.value=a),o instanceof Lo&&(o.value=s),{width:a,height:s}},e}(),t.RectUpdater=se([ct({token:[{token:Nc,named:t.Shape.RECT},{token:Nc,named:t.Shape.IMAGE},{token:Nc,named:t.Shape.GROUP}]})],t.RectUpdater),t.TextUpdater=function(){function t(){this.textService=void 0}var e=t.prototype;return e.isReadyToMeasure=function(t,e){return t.text&&t.fontSize&&t.fontStyle&&t.fontWeight&&t.fontVariant&&t.textAlign&&t.textBaseline&&t.lineWidth},e.update=function(t,e){var n,i,r=t.text,o=t.textAlign,a=t.lineWidth,s=t.textBaseline,u=t.dx,c=t.dy,l=((null==e||null===(n=e.ownerDocument)||void 0===n||null===(i=n.defaultView)||void 0===i?void 0:i.getConfig())||{}).offscreenCanvas;if(!this.isReadyToMeasure(t,e))return t.metrics={font:"",width:0,height:0,lines:[],lineWidths:[],lineHeight:0,maxLineWidth:0,fontProperties:{ascent:0,descent:0,fontSize:0},lineMetrics:[]},{width:0,height:0,x:0,y:0,offsetX:0,offsetY:0};var h=this.textService.measureText(r,t,l);t.metrics=h;var p=h.lineHeight,f=h.fontProperties,d=Tn(h.width/2,h.height/2,0),y=[0,1],v=0;"center"===o.value?(v=a.value/2,y=[.5,1]):"right"!==o.value&&"end"!==o.value||(v=a.value,y=[1,1]);var g=0;return"middle"===s.value?g=d[1]:"top"===s.value||"hanging"===s.value?g=2*d[1]:"alphabetic"===s.value?g=p-f.ascent:"bottom"!==s.value&&"ideographic"!==s.value||(g=0),u&&(v+=u.value),c&&(g+=c.value),t.anchor=[new Lo(y[0]),new Lo(y[1]),new Lo(0)],{width:2*d[0],height:2*d[1],offsetX:v,offsetY:g}},t}(),se([lt(t.TextService),ce("design:type",t.TextService)],t.TextUpdater.prototype,"textService",void 0),t.TextUpdater=se([ct({token:{token:Nc,named:t.Shape.TEXT}})],t.TextUpdater),t.LineUpdater=function(){function t(){}return t.prototype.update=function(t){var e=t.x1,n=t.y1,i=t.x2,r=t.y2,o=Math.min(e.value,i.value),a=Math.max(e.value,i.value),s=Math.min(n.value,r.value);return{width:a-o,height:Math.max(n.value,r.value)-s}},t}(),t.LineUpdater=se([ct({token:{token:Nc,named:t.Shape.LINE}})],t.LineUpdater),t.PolylineUpdater=function(){function t(){}return t.prototype.update=function(t){var e=t.points.points,n=Math.min.apply(Math,e.map((function(t){return t[0]}))),i=Math.max.apply(Math,e.map((function(t){return t[0]}))),r=Math.min.apply(Math,e.map((function(t){return t[1]})));return{width:i-n,height:Math.max.apply(Math,e.map((function(t){return t[1]})))-r}},t}(),t.PolylineUpdater=se([ct({token:[{token:Nc,named:t.Shape.POLYLINE},{token:Nc,named:t.Shape.POLYGON}]})],t.PolylineUpdater),t.PathUpdater=function(){function t(){}return t.prototype.update=function(t){var e=t.path.rect;return{width:e.width,height:e.height}},t}(),t.PathUpdater=se([ct({token:{token:Nc,named:t.Shape.PATH}})],t.PathUpdater),t.CSSPropertyClipPath=function(){function t(){}return t.prototype.calculator=function(t,e,n,i){if(n instanceof Po&&(n=null),e&&e!==n&&e.style.clipPathTargets){var r=e.style.clipPathTargets.indexOf(i);e.style.clipPathTargets.splice(r,1)}return n&&(n.style.clipPathTargets||(n.style.clipPathTargets=[]),n.style.clipPathTargets.push(i)),gc(i),n},t}(),t.CSSPropertyClipPath=se([ct({token:{token:Ks,named:t.PropertySyntax.CLIP_PATH}})],t.CSSPropertyClipPath),t.CSSPropertyColor=function(){function t(){this.parser=Ma,this.mixer=Aa}return t.prototype.calculator=function(t,e,n,i){return n instanceof Po?new Xo(0,0,0,0,"none"===n.value):n},t}(),t.CSSPropertyColor=se([ct({token:[{token:Ks,named:t.PropertySyntax.PAINT},{token:Ks,named:t.PropertySyntax.COLOR}]})],t.CSSPropertyColor),t.CSSPropertyFilter=function(){this.parser=Ls},t.CSSPropertyFilter=se([ct({token:{token:Ks,named:t.PropertySyntax.FILTER}})],t.CSSPropertyFilter),t.CSSPropertyLengthOrPercentage=function(){function e(){this.parser=Xa,this.mixer=Za}return e.prototype.calculator=function(e,n,i,r,o){if(!Lo.isRelativeUnit(i.unit))return i.clone();if(i.unit===t.UnitType.kPercentage)return new Lo(0,"px");if(i.unit===t.UnitType.kEms){if(r.parentNode){var a=_c(r.parentNode);return a.value*=i.value,a}return new Lo(0,"px")}if(i.unit===t.UnitType.kRems){var s;if(null==r||null===(s=r.ownerDocument)||void 0===s?void 0:s.documentElement){var u=_c(r.ownerDocument.documentElement);return u.value*=i.value,u}return new Lo(0,"px")}},e}(),t.CSSPropertyLengthOrPercentage=se([ct({token:{token:Ks,named:t.PropertySyntax.LENGTH_PERCENTAGE}})],t.CSSPropertyLengthOrPercentage),t.CSSPropertyLengthOrPercentage12=function(){function t(){this.mixer=$a}return t.prototype.parser=function(t){var e=Qa(Ue(t)?[t]:t);return 1===e.length?[e[0],e[0]]:[e[0],e[1]]},t}(),t.CSSPropertyLengthOrPercentage12=se([ct({token:{token:Ks,named:t.PropertySyntax.LENGTH_PERCENTAGE_12}})],t.CSSPropertyLengthOrPercentage12),t.CSSPropertyLengthOrPercentage14=function(){function t(){this.mixer=$a}return t.prototype.parser=function(t){var e=Qa(Ue(t)?[t]:t);return 1===e.length?[e[0],e[0],e[0],e[0]]:2===e.length?[e[0],e[1],e[0],e[1]]:3===e.length?[e[0],e[1],e[2],e[1]]:[e[0],e[1],e[2],e[3]]},t}(),t.CSSPropertyLengthOrPercentage14=se([ct({token:{token:Ks,named:t.PropertySyntax.LENGTH_PERCENTAGE_14}})],t.CSSPropertyLengthOrPercentage14),t.CSSPropertyLocalPosition=function(e){function n(){return e.apply(this,arguments)||this}return ve(n,e),n.prototype.postProcessor=function(e){var n,i,r;switch(e.nodeName){case t.Shape.CIRCLE:case t.Shape.ELLIPSE:var o=e.parsedStyle,a=o.cx,s=o.cy;De(a)||(n=a.value),De(s)||(i=s.value);break;case t.Shape.LINE:var u=e.parsedStyle,c=u.y1,l=u.y2;n=Math.min(u.x1.value,u.x2.value),i=Math.min(c.value,l.value),r=0;break;default:De(e.parsedStyle.x)||(n=e.parsedStyle.x.value),De(e.parsedStyle.y)||(i=e.parsedStyle.y.value)}e.parsedStyle.defX=n||0,e.parsedStyle.defY=i||0;var h=e.getLocalPosition(),p=h[0],f=h[1],d=h[2];e.setLocalPosition(De(n)?p:n,De(i)?f:i,De(r)?d:r)},n}(t.CSSPropertyLengthOrPercentage),t.CSSPropertyLocalPosition=se([ct({token:{token:Ks,named:t.PropertySyntax.COORDINATE}})],t.CSSPropertyLocalPosition),t.CSSPropertyOffsetDistance=function(){function e(){this.parser=ns,this.mixer=rs(0,1)}return e.prototype.postProcessor=function(e){if(e.attributes.offsetPath){var n=e.attributes.offsetPath.nodeName;if(n===t.Shape.LINE||n===t.Shape.PATH||n===t.Shape.POLYLINE){var i=e.attributes.offsetPath.getPoint(e.parsedStyle.offsetDistance.value);i&&e.setLocalPosition(i.x,i.y)}}},e}(),t.CSSPropertyOffsetDistance=se([ct({token:{token:Ks,named:t.PropertySyntax.OFFSET_DISTANCE}})],t.CSSPropertyOffsetDistance),t.CSSPropertyOffsetPath=function(){function t(){}return t.prototype.calculator=function(t,e,n,i){if(e&&e!==n&&e.style.offsetPathTargets){var r=e.style.offsetPathTargets.indexOf(i);e.style.offsetPathTargets.splice(r,1)}return n&&(n.style.offsetPathTargets||(n.style.offsetPathTargets=[]),n.style.offsetPathTargets.push(i)),n},t}(),t.CSSPropertyOffsetPath=se([ct({token:{token:Ks,named:t.PropertySyntax.OFFSET_PATH}})],t.CSSPropertyOffsetPath),t.CSSPropertyOpacity=function(){this.parser=ns,this.mixer=rs(0,1)},t.CSSPropertyOpacity=se([ct({token:{token:Ks,named:t.PropertySyntax.OPACITY_VALUE}})],t.CSSPropertyOpacity),t.CSSPropertyPath=function(){function e(){this.parser=Ms,this.mixer=As}var n=e.prototype;return n.calculator=function(t,e,n){return n instanceof Po&&"unset"===n.value?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:[],totalLength:0,curveSegments:[],zCommandIndexes:[],rect:new Wa(0,0,0,0)}:n},n.postProcessor=function(e){if(e.nodeName===t.Shape.PATH){var n=e.parsedStyle,i=n.defX,r=n.defY;e.setLocalPosition(void 0===i?0:i,void 0===r?0:r)}},e}(),t.CSSPropertyPath=se([ct({token:{token:Ks,named:t.PropertySyntax.PATH}})],t.CSSPropertyPath),t.CSSPropertyPoints=function(){function e(){this.parser=Os}return e.prototype.postProcessor=function(e){if(e.nodeName===t.Shape.POLYGON||e.nodeName===t.Shape.POLYLINE){var n=e.parsedStyle;e.setLocalPosition(n.defX,n.defY)}},e}(),t.CSSPropertyPoints=se([ct({token:{token:Ks,named:t.PropertySyntax.LIST_OF_POINTS}})],t.CSSPropertyPoints),t.CSSPropertyShadowBlur=function(t){function e(){for(var e,n=arguments.length,i=new Array(n),r=0;n>r;r++)i[r]=arguments[r];return(e=t.call.apply(t,[this].concat(i))||this).mixer=rs(0,1/0),e}return ve(e,t),e}(t.CSSPropertyLengthOrPercentage),t.CSSPropertyShadowBlur=se([ct({token:{token:Ks,named:t.PropertySyntax.SHADOW_BLUR}})],t.CSSPropertyShadowBlur),t.CSSPropertyText=function(){function t(){}var e=t.prototype;return e.calculator=function(t,e,n,i){return n instanceof Po?"unset"===n.value?"":n.value:n},e.postProcessor=function(t){t.nodeValue=""+t.parsedStyle.text||""},t}(),t.CSSPropertyText=se([ct({token:{token:Ks,named:t.PropertySyntax.TEXT}})],t.CSSPropertyText),t.CSSPropertyTextTransform=function(){function t(){}return t.prototype.calculator=function(t,e,n,i){var r=i.getAttribute("text");if(r){var o=r;"capitalize"===n.value?o=r.charAt(0).toUpperCase()+r.slice(1):"lowercase"===n.value?o=r.toLowerCase():"uppercase"===n.value&&(o=r.toUpperCase()),i.parsedStyle.text=o}return n},t}(),t.CSSPropertyTextTransform=se([ct({token:{token:Ks,named:t.PropertySyntax.TEXT_TRANSFORM}})],t.CSSPropertyTextTransform),t.CSSPropertyTransform=function(){function t(){this.parser=Gs,this.mixer=zs}return t.prototype.postProcessor=function(t){var e=t.parsedStyle,n=e.transform,i=e.defX,r=e.defY;n&&n.length&&(t.resetLocalTransform(),t.setLocalPosition(i,r),n.forEach((function(e){var n=e.t,i=e.d;if("scale"===n){var r=i.map((function(t){return t.value}))||[1,1];t.scaleLocal(r[0],r[1],1)}else if("scalex"===n){var o=i.map((function(t){return t.value}))||[1];t.scaleLocal(o[0],1,1)}else if("scaley"===n){var a=i.map((function(t){return t.value}))||[1];t.scaleLocal(1,a[0],1)}else if("scalez"===n){var s=i.map((function(t){return t.value}))||[1];t.scaleLocal(1,1,s[0])}else if("scale3d"===n){var u=i.map((function(t){return t.value}))||[1,1,1];t.scaleLocal(u[0],u[1],u[2])}else if("translate"===n){var c=i||[Yo,Yo];t.translateLocal(c[0].value,c[1].value,0)}else if("translatex"===n){t.translateLocal((i||[Yo])[0].value,0,0)}else if("translatey"===n){t.translateLocal(0,(i||[Yo])[0].value,0)}else if("translatez"===n){t.translateLocal(0,0,(i||[Yo])[0].value)}else if("translate3d"===n){var l=i||[Yo,Yo,Yo];t.translateLocal(l[0].value,l[1].value,l[2].value)}else if("rotate"===n){t.rotateLocal(0,0,(i||[qo])[0].value)}else if("rotatex"===n){t.rotateLocal((i||[qo])[0].value,0,0)}else if("rotatey"===n){t.rotateLocal(0,(i||[qo])[0].value,0)}else if("rotatez"===n){t.rotateLocal(0,0,(i||[qo])[0].value)}})))},t}(),t.CSSPropertyTransform=se([ct({token:{token:Ks,named:t.PropertySyntax.TRANSFORM}})],t.CSSPropertyTransform),t.CSSPropertyTransformOrigin=function(){this.parser=Ws},t.CSSPropertyTransformOrigin=se([ct({token:{token:Ks,named:t.PropertySyntax.TRANSFORM_ORIGIN}})],t.CSSPropertyTransformOrigin),t.CSSPropertyZIndex=function(){function t(){this.parser=ns}return t.prototype.postProcessor=function(t){if(t.parentNode){var e=t.parentNode,n=e.renderable,i=e.sortable;n&&(n.dirty=!0),i&&(i.dirty=!0)}},t}(),t.CSSPropertyZIndex=se([ct({token:{token:Ks,named:t.PropertySyntax.Z_INDEX}})],t.CSSPropertyZIndex);var Mc=[{name:"display",keywords:["none"]},{name:"opacity",interpolable:!0,defaultValue:"1",syntax:t.PropertySyntax.OPACITY_VALUE},{name:"fillOpacity",interpolable:!0,inherited:!0,defaultValue:"1",syntax:t.PropertySyntax.OPACITY_VALUE},{name:"strokeOpacity",interpolable:!0,inherited:!0,defaultValue:"1",syntax:t.PropertySyntax.OPACITY_VALUE},{name:"fill",interpolable:!0,keywords:["none"],defaultValue:"none",syntax:t.PropertySyntax.PAINT},{name:"stroke",interpolable:!0,keywords:["none"],defaultValue:"none",syntax:t.PropertySyntax.PAINT},{name:"shadowColor",interpolable:!0,syntax:t.PropertySyntax.COLOR},{name:"shadowOffsetX",interpolable:!0,layoutDependent:!0,syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{name:"shadowOffsetY",interpolable:!0,layoutDependent:!0,syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{name:"shadowBlur",interpolable:!0,layoutDependent:!0,syntax:t.PropertySyntax.SHADOW_BLUR},{name:"lineWidth",interpolable:!0,inherited:!0,defaultValue:"1",layoutDependent:!0,alias:["strokeWidth"],syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{name:"increasedLineWidthForHitTesting",inherited:!0,defaultValue:"0",layoutDependent:!0,syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{name:"lineJoin",inherited:!0,layoutDependent:!0,alias:["strokeLinejoin"],keywords:["miter","bevel","round"],defaultValue:"miter"},{name:"lineCap",inherited:!0,layoutDependent:!0,alias:["strokeLinecap"],keywords:["butt","round","square"],defaultValue:"butt"},{name:"lineDash",interpolable:!0,inherited:!0,keywords:["none"],alias:["strokeDasharray"],syntax:t.PropertySyntax.LENGTH_PERCENTAGE_12},{name:"lineDashOffset",interpolable:!0,inherited:!0,defaultValue:"0",alias:["strokeDashoffset"],syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{name:"offsetPath",syntax:t.PropertySyntax.OFFSET_PATH},{name:"offsetDistance",interpolable:!0,syntax:t.PropertySyntax.OFFSET_DISTANCE},{name:"dx",interpolable:!0,layoutDependent:!0,defaultValue:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{name:"dy",interpolable:!0,layoutDependent:!0,defaultValue:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{name:"zIndex",independent:!0,interpolable:!0,defaultValue:"0",keywords:["auto"],syntax:t.PropertySyntax.Z_INDEX},{name:"visibility",keywords:["visible","hidden"],independent:!0,inherited:!0,defaultValue:"visible"},{name:"pointerEvents",inherited:!0,keywords:["none","auto","stroke","fill","painted","visible","visiblestroke","visiblefill","visiblepainted","bounding-box","all"],defaultValue:"auto"},{name:"filter",independent:!0,layoutDependent:!0,syntax:t.PropertySyntax.FILTER},{name:"clipPath",syntax:t.PropertySyntax.CLIP_PATH},{name:"transform",parsePriority:100,interpolable:!0,keywords:["none"],defaultValue:"none",syntax:t.PropertySyntax.TRANSFORM},{name:"transformOrigin",parsePriority:100,defaultValue:"left top",layoutDependent:!0,syntax:t.PropertySyntax.TRANSFORM_ORIGIN},{name:"anchor",parsePriority:99,defaultValue:"0 0",layoutDependent:!0,syntax:t.PropertySyntax.LENGTH_PERCENTAGE_12},{name:"cx",interpolable:!0,defaultValue:"0",syntax:t.PropertySyntax.COORDINATE},{name:"cy",interpolable:!0,defaultValue:"0",syntax:t.PropertySyntax.COORDINATE},{name:"r",interpolable:!0,layoutDependent:!0,defaultValue:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{name:"rx",interpolable:!0,layoutDependent:!0,defaultValue:"auto",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{name:"ry",interpolable:!0,layoutDependent:!0,defaultValue:"auto",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{name:"x",interpolable:!0,defaultValue:"0",syntax:t.PropertySyntax.COORDINATE},{name:"y",interpolable:!0,defaultValue:"0",syntax:t.PropertySyntax.COORDINATE},{name:"z",interpolable:!0,defaultValue:"0",syntax:t.PropertySyntax.COORDINATE},{name:"width",interpolable:!0,layoutDependent:!0,keywords:["auto","fit-content","min-content","max-content"],defaultValue:"auto",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{name:"height",interpolable:!0,layoutDependent:!0,keywords:["auto","fit-content","min-content","max-content"],defaultValue:"auto",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{name:"radius",interpolable:!0,layoutDependent:!0,defaultValue:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE_14},{name:"x1",interpolable:!0,layoutDependent:!0,syntax:t.PropertySyntax.COORDINATE},{name:"y1",interpolable:!0,layoutDependent:!0,syntax:t.PropertySyntax.COORDINATE},{name:"z1",interpolable:!0,layoutDependent:!0,syntax:t.PropertySyntax.COORDINATE},{name:"x2",interpolable:!0,layoutDependent:!0,syntax:t.PropertySyntax.COORDINATE},{name:"y2",interpolable:!0,layoutDependent:!0,syntax:t.PropertySyntax.COORDINATE},{name:"z2",interpolable:!0,layoutDependent:!0,syntax:t.PropertySyntax.COORDINATE},{name:"path",interpolable:!0,layoutDependent:!0,defaultValue:"",alias:["d"],syntax:t.PropertySyntax.PATH},{name:"points",layoutDependent:!0,syntax:t.PropertySyntax.LIST_OF_POINTS},{name:"text",layoutDependent:!0,defaultValue:"",syntax:t.PropertySyntax.TEXT,parsePriority:50},{name:"textTransform",layoutDependent:!0,inherited:!0,keywords:["capitalize","uppercase","lowercase","none"],defaultValue:"none",syntax:t.PropertySyntax.TEXT_TRANSFORM,parsePriority:51},{name:"font",layoutDependent:!0},{name:"fontSize",interpolable:!0,inherited:!0,defaultValue:"16px",layoutDependent:!0,syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{name:"fontFamily",layoutDependent:!0,inherited:!0,defaultValue:"sans-serif"},{name:"fontStyle",layoutDependent:!0,inherited:!0,keywords:["normal","italic","oblique"],defaultValue:"normal"},{name:"fontWeight",layoutDependent:!0,inherited:!0,keywords:["normal","bold","bolder","lighter"],defaultValue:"normal"},{name:"fontVariant",layoutDependent:!0,inherited:!0,keywords:["normal","small-caps"],defaultValue:"normal"},{name:"lineHeight",layoutDependent:!0},{name:"letterSpacing",layoutDependent:!0},{name:"wordWrap",layoutDependent:!0},{name:"wordWrapWidth",layoutDependent:!0},{name:"leading",layoutDependent:!0},{name:"textBaseline",layoutDependent:!0,inherited:!0,keywords:["top","hanging","middle","alphabetic","ideographic","bottom"],defaultValue:"alphabetic"},{name:"textAlign",layoutDependent:!0,inherited:!0,keywords:["start","center","end","left","right"],defaultValue:"start"},{name:"whiteSpace",layoutDependent:!0}];t.DefaultStyleValueRegistry=function(){function e(){this.dirty=!1,this.cache={},this.unresolvedProperties={},this.propertySyntaxFactory=void 0,this.cascadeProperties={}}var n=e.prototype;return n.init=function(){var t=this;Mc.forEach((function(e){t.registerMetadata(e)}))},n.registerMetadata=function(t){var e=this;[t.name].concat(t.alias||[]).forEach((function(n){e.cache[n]=t}))},n.unregisterMetadata=function(t){delete this.cache[t]},n.getMetadata=function(t){return this.cache[t]},n.getPropertySyntax=function(t){return this.propertySyntaxFactory(t)},n.processProperties=function(t,e,n){var i=this;void 0===n&&(n={skipUpdateAttribute:!1,skipParse:!1});var r=n.skipUpdateAttribute,o=n.skipParse,a=!1;Object.keys(e).forEach((function(n){var o,s=rr(n,e[n]),u=s[0];r||(t.attributes[u]=s[1]),!a&&(null===(o=i.getMetadata(u))||void 0===o?void 0:o.layoutDependent)&&(a=!0)}));var s=Object.keys(e).sort((function(t,e){var n,r;return((null===(n=i.getMetadata(t))||void 0===n?void 0:n.parsePriority)||0)-((null===(r=i.getMetadata(e))||void 0===r?void 0:r.parsePriority)||0)}));o||s.forEach((function(e){t.computedStyle[e]=i.parseProperty(e,t.attributes[e],t)}));var u=!1;s.forEach((function(e){e in t.computedStyle&&(u=i.computeProperty(e,t.computedStyle[e],t))})),u?this.dirty=!0:(a&&this.updateGeometry(t),s.forEach((function(e){e in t.parsedStyle&&i.postProcessProperty(e,t)})),s.forEach((function(e){e in t.parsedStyle&&i.isPropertyInheritable(e)&&t.children.forEach((function(t){t.internalSetAttribute(e,null,{skipUpdateAttribute:!0,skipParse:!0})}))})))},n.parseProperty=function(t,e,n){var i=this.getMetadata(t),r=e;if((""===e||De(e))&&(e="unset"),"unset"===e||"initial"===e||"inherit"===e)r=new Po(e);else if(i){var o=i.keywords,a=i.syntax,s=a&&this.getPropertySyntax(a);if(o&&o.indexOf(e)>-1)r=new Po(e);else if(s){s&&s.parser&&(r=s.parser(e,n))}}return r},n.computeProperty=function(t,e,n){var i=this.getMetadata(t),r="g-root"===n.id,o=e instanceof wo?e.clone():e;if(i){var a=i.syntax,s=i.defaultValue;if(e instanceof Po){var u=e.value;if("unset"===u&&(u=i.inherited&&!r?"inherit":"initial"),"initial"===u)De(s)||(e=this.parseProperty(t,s,n));else if("inherit"===u){var c=this.tryToResolveProperty(n,t,{inherited:!0});return c?(n.parsedStyle[t]=c,!1):(this.addUnresolveProperty(n,t),!0)}}var l=a&&this.getPropertySyntax(a);if(l)if(l.calculator)o=l.calculator(t,n.parsedStyle[t],e,n,this);else o=e;else o=e}return n.parsedStyle[t]=o,!1},n.postProcessProperty=function(t,e){var n=this.getMetadata(t);if(n&&n.syntax){var i=n.syntax&&this.getPropertySyntax(n.syntax);i&&i.postProcessor&&i.postProcessor(e)}},n.isPropertyResolved=function(t,e){return!this.unresolvedProperties[t.entity]||0===this.unresolvedProperties[t.entity].length||this.unresolvedProperties[t.entity].includes(e)},n.addUnresolveProperty=function(t,e){this.unresolvedProperties[t.entity]||(this.unresolvedProperties[t.entity]=[]),-1===this.unresolvedProperties[t.entity].indexOf(e)&&this.unresolvedProperties[t.entity].push(e)},n.tryToResolveProperty=function(t,e,n){if(void 0===n&&(n={}),n.inherited&&t.parentElement&&this.isPropertyResolved(t.parentElement,e)){var i=t.parentElement.parsedStyle[e];return(!(i instanceof Po)||"unset"!==i.value&&"initial"!==i.value&&"inherit"!==i.value)&&(!(i instanceof Lo&&Lo.isRelativeUnit(i.unit))&&i)}return!1},n.recalc=function(t){var e=this.unresolvedProperties[t.entity];if(e&&e.length){var n={};e.forEach((function(e){n[e]=t.attributes[e]})),this.processProperties(t,n),delete this.unresolvedProperties[t.entity]}},n.updateGeometry=function(e){var n=Vt.get(Cc)(e.nodeName);if(n){var i,r=e.geometry;r.contentBounds||(r.contentBounds=new Ia),r.renderBounds||(r.renderBounds=new Ia);var o=e.parsedStyle,a=n.update(o,e),s=a.depth,u=a.offsetX,c=void 0===u?0:u,l=a.offsetY,h=void 0===l?0:l,p=a.offsetZ,f=void 0===p?0:p,d=Tn(a.width/2,a.height/2,(void 0===s?0:s)/2),y=o.lineWidth,v=o.increasedLineWidthForHitTesting,g=o.shadowColor,m=o.filter,T=void 0===m?[]:m,S=o.transformOrigin,b=o.anchor;e.nodeName===t.Shape.TEXT&&delete o.anchor;var E=Tn((1-2*(b&&b[0].value||0))*d[0]+c,(1-2*(b&&b[1].value||0))*d[1]+h,(1-2*(b&&(null===(i=b[2])||void 0===i?void 0:i.value)||0))*d[2]+f);r.contentBounds.update(E,d);var w=(((null==y?void 0:y.value)||0)+((null==v?void 0:v.value)||0))/2;if(En(d,d,Tn(w,w,0)),r.renderBounds.update(E,d),g){var x=r.renderBounds,P=x.min,k=x.max,C=o.shadowBlur,N=o.shadowOffsetX,_=o.shadowOffsetY,M=C&&C.value||0,A=N&&N.value||0,O=_&&_.value||0,I=k[0]+M+A,R=P[1]-M+O,L=k[1]+M+O;P[0]=Math.min(P[0],P[0]-M+A),k[0]=Math.max(k[0],I),P[1]=Math.min(P[1],R),k[1]=Math.max(k[1],L),r.renderBounds.setMinMax(P,k)}T.forEach((function(t){var e=t.name,n=t.params;if("blur"===e){var i=n[0].value;r.renderBounds.update(r.renderBounds.center,En(r.renderBounds.halfExtents,r.renderBounds.halfExtents,Tn(i,i,0)))}else if("drop-shadow"===e){var o=n[0].value,a=n[1].value,s=n[2].value,u=r.renderBounds,c=u.min,l=u.max,h=l[0]+s+o,p=c[1]-s+a,f=l[1]+s+a;c[0]=Math.min(c[0],c[0]-s+o),l[0]=Math.max(l[0],h),c[1]=Math.min(c[1],p),l[1]=Math.max(l[1],f),r.renderBounds.setMinMax(c,l)}})),b=o.anchor;var D=ts(S[0],0,e),U=ts(S[1],1,e);e.setOrigin(D-=(b&&b[0].value||0)*r.contentBounds.halfExtents[0]*2,U-=(b&&b[1].value||0)*r.contentBounds.halfExtents[1]*2),e.dispatchEvent(new Qs(t.ElementEvent.GEOMETRY_BOUNDS_CHANGED)),gc(e)}},n.isPropertyInheritable=function(t){var e=this.getMetadata(t);return!!e&&e.inherited},e}(),se([lt(Xs),ce("design:type",Function)],t.DefaultStyleValueRegistry.prototype,"propertySyntaxFactory",void 0),se([Y.postConstruct(),ce("design:type",Function),ce("design:paramtypes",[]),ce("design:returntype",void 0)],t.DefaultStyleValueRegistry.prototype,"init",null),t.DefaultStyleValueRegistry=se([ct({token:Bi})],t.DefaultStyleValueRegistry);var Ac,Oc,Ic,Rc=At((function(e){Y.decorate(ut(),mo.EventEmitter),e(t.DisplayObjectPool),e(t.DefaultSceneGraphSelector),e({token:fc,useFactory:function(t){return function(){return t.container.get(dc)}}}),e(t.DefaultSceneGraphService),e(t.OffscreenCanvasCreator),e(t.TextService),e(t.CircleUpdater),e(t.EllipseUpdater),e(t.RectUpdater),e(t.TextUpdater),e(t.LineUpdater),e(t.PolylineUpdater),e(t.PathUpdater),e({token:Cc,useFactory:function(t){var e={};return function(n){return e[n]||t.container.isBoundNamed(Nc,n)&&(e[n]=t.container.getNamed(Nc,n)),e[n]}}}),e(t.CSSPropertyAngle),e(t.CSSPropertyClipPath),e(t.CSSPropertyColor),e(t.CSSPropertyFilter),e(t.CSSPropertyLengthOrPercentage),e(t.CSSPropertyLengthOrPercentage12),e(t.CSSPropertyLengthOrPercentage14),e(t.CSSPropertyLocalPosition),e(t.CSSPropertyOffsetDistance),e(t.CSSPropertyOffsetPath),e(t.CSSPropertyOpacity),e(t.CSSPropertyPath),e(t.CSSPropertyPoints),e(t.CSSPropertyShadowBlur),e(t.CSSPropertyText),e(t.CSSPropertyTextTransform),e(t.CSSPropertyTransform),e(t.CSSPropertyTransformOrigin),e(t.CSSPropertyZIndex),e({token:Xs,useFactory:function(t){var e={};return function(n){return e[n]||t.container.isBoundNamed(Ks,n)&&(e[n]=t.container.getNamed(Ks,n)),e[n]}}}),e(t.DefaultStyleValueRegistry),e(t.LayoutRegistry),e(t.LayoutEngine),e(t.LayoutEdges),e({token:ao,useFactory:function(e){return function(n){var i=e.container.createChild();return i.register({token:so,useValue:n}),i.get(t.LayoutEdges)}}}),e({token:ke,useFactory:function(e){return function(n){var i=e.container.createChild();i.register(t.LayoutContext),i.register(t.LayoutChildren),i.register({token:eo,useFactory:function(e){return function(n){var i=e.container.createChild();return i.register({token:no,useValue:n}),i.get(t.LayoutChildren)}}}),i.register(t.FragmentResult),i.register({token:_e,useFactory:function(e){return function(n,i){var r=e.container.createChild();return r.register({token:Me,useValue:n}),r.register({token:Ae,useValue:i}),r.get(t.FragmentResult)}}}),i.register(t.LayoutFragment),i.register({token:lo,useFactory:function(e){return function(n){var i=e.container.createChild();return i.register({token:ho,useValue:n}),i.get(t.LayoutFragment)}}});var r=i.get(eo),o=i.get(lo),a=i.get(_e);return i.register({token:Ce,useValue:ye({},n,{layoutChildrenFactory:r,layoutFragmentFactory:o,fragmentResultFactory:a})}),i.get(t.LayoutContext)}}})})),Lc=function(){function t(t){this.plugins=[],this.config=void 0,this.config=ye({enableDirtyCheck:!0,enableCulling:!0,enableAutoRendering:!0,enableDirtyRectangleRendering:!0},t)}var e=t.prototype;return e.registerPlugin=function(t){this.plugins.push(t)},e.unregisterPlugin=function(t){var e=this.plugins.findIndex((function(e){return e===t}));e>-1&&this.plugins.splice(e,1)},e.getPlugins=function(){return this.plugins},e.getPlugin=function(t){return this.plugins.find((function(e){return e.name===t}))},e.getConfig=function(){return this.config},e.setConfig=function(t){Object.assign(this.config,t)},t}(),Dc=t.Syringe.defineToken("DefaultCamera");(Ac=t.CameraType||(t.CameraType={}))[Ac.ORBITING=0]="ORBITING",Ac[Ac.EXPLORING=1]="EXPLORING",Ac[Ac.TRACKING=2]="TRACKING",(Oc=t.CameraTrackingMode||(t.CameraTrackingMode={}))[Oc.DEFAULT=0]="DEFAULT",Oc[Oc.ROTATIONAL=1]="ROTATIONAL",Oc[Oc.TRANSLATIONAL=2]="TRANSLATIONAL",Oc[Oc.CINEMATIC=3]="CINEMATIC",(Ic=t.CameraProjectionMode||(t.CameraProjectionMode={}))[Ic.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",Ic[Ic.PERSPECTIVE=1]="PERSPECTIVE";var Uc={UPDATED:"updated"},Fc=Math.PI/180,Bc=180/Math.PI,Vc=2e-4,Gc=function(e){function n(n,i){var r;return void 0===n&&(n=t.CameraType.EXPLORING),void 0===i&&(i=t.CameraTrackingMode.DEFAULT),(r=e.call(this)||this).canvas=void 0,r.matrix=nn(),r.right=Tn(1,0,0),r.up=Tn(0,1,0),r.forward=Tn(0,0,1),r.position=Tn(0,0,1),r.focalPoint=Tn(0,0,0),r.distanceVector=Tn(0,0,-1),r.distance=1,r.azimuth=0,r.elevation=0,r.roll=0,r.relAzimuth=0,r.relElevation=0,r.relRoll=0,r.dollyingStep=0,r.maxDistance=1/0,r.minDistance=-1/0,r.zoom=1,r.rotateWorld=!1,r.fov=30,r.near=.1,r.far=1e3,r.aspect=1,r.left=void 0,r.rright=void 0,r.top=void 0,r.bottom=void 0,r.projectionMatrix=nn(),r.projectionMatrixInverse=nn(),r.jitteredProjectionMatrix=void 0,r.view=void 0,r.enableUpdate=!0,r.type=t.CameraType.EXPLORING,r.trackingMode=t.CameraTrackingMode.DEFAULT,r.projectionMode=t.CameraProjectionMode.PERSPECTIVE,r.frustum=new Ua,r.landmarks=[],r.landmarkAnimationID=void 0,r.orthoMatrix=nn(),r.setType(n,i),r}ve(n,e);var i=n.prototype;return i.isOrtho=function(){return this.projectionMode===t.CameraProjectionMode.ORTHOGRAPHIC},i.getProjectionMode=function(){return this.projectionMode},i.getPerspective=function(){return this.jitteredProjectionMatrix||this.projectionMatrix},i.getPerspectiveInverse=function(){return this.projectionMatrixInverse},i.getFrustum=function(){return this.frustum},i.getPosition=function(){return this.position},i.getFocalPoint=function(){return this.focalPoint},i.getDollyingStep=function(){return this.dollyingStep},i.getNear=function(){return this.near},i.getFar=function(){return this.far},i.getZoom=function(){return this.zoom},i.getOrthoMatrix=function(){return this.orthoMatrix},i.getView=function(){return this.view},i.setEnableUpdate=function(t){this.enableUpdate=t},i.setType=function(e,n){return this.type=e,this.setWorldRotation(this.type===t.CameraType.EXPLORING),this._getAngles(),this.type===t.CameraType.TRACKING&&void 0!==n&&this.setTrackingMode(n),this},i.setProjectionMode=function(t){return this.projectionMode=t,this},i.setTrackingMode=function(e){if(this.type!==t.CameraType.TRACKING)throw new Error("Impossible to set a tracking mode if the camera is not of tracking type");return this.trackingMode=e,this},i.setWorldRotation=function(t){return this.rotateWorld=t,this._getAngles(),this},i.getViewTransform=function(){return an(nn(),this.matrix)},i.getWorldTransform=function(){return this.matrix},i.jitterProjectionMatrix=function(t,e){var n,i,r=(n=nn(),i=[t,e,0],n[0]=1,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=1,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=1,n[11]=0,n[12]=i[0],n[13]=i[1],n[14]=i[2],n[15]=1,n);this.jitteredProjectionMatrix=sn(nn(),r,this.projectionMatrix)},i.clearJitterProjectionMatrix=function(){this.jitteredProjectionMatrix=void 0},i.setMatrix=function(t){return this.matrix=t,this._update(),this},i.setFov=function(t){return this.setPerspective(this.near,this.far,t,this.aspect),this},i.setAspect=function(t){return this.setPerspective(this.near,this.far,this.fov,t),this},i.setNear=function(e){return this.projectionMode===t.CameraProjectionMode.PERSPECTIVE?this.setPerspective(e,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,e,this.far),this},i.setFar=function(e){return this.projectionMode===t.CameraProjectionMode.PERSPECTIVE?this.setPerspective(this.near,e,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,e),this},i.setViewOffset=function(e,n,i,r,o,a){return this.aspect=e/n,void 0===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=n,this.view.offsetX=i,this.view.offsetY=r,this.view.width=o,this.view.height=a,this.projectionMode===t.CameraProjectionMode.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this},i.clearViewOffset=function(){return void 0!==this.view&&(this.view.enabled=!1),this.projectionMode===t.CameraProjectionMode.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this},i.setZoom=function(e){return this.zoom=e,this.projectionMode===t.CameraProjectionMode.ORTHOGRAPHIC?this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far):this.projectionMode===t.CameraProjectionMode.PERSPECTIVE&&this.setPerspective(this.near,this.far,this.fov,this.aspect),this},i.setPerspective=function(e,n,i,r){var o;this.projectionMode=t.CameraProjectionMode.PERSPECTIVE,this.fov=i,this.near=e,this.far=n,this.aspect=r;var a=this.near*Math.tan(.5*Fc*this.fov)/this.zoom,s=2*a,u=this.aspect*s,c=-.5*u;if(null===(o=this.view)||void 0===o?void 0:o.enabled){var l=this.view.fullWidth,h=this.view.fullHeight;c+=this.view.offsetX*u/l,a-=this.view.offsetY*s/h,u*=this.view.width/l,s*=this.view.height/h}return ci(this.projectionMatrix,c,c+u,a,a-s,e,this.far),cn(this.projectionMatrix,this.projectionMatrix,Tn(1,-1,1)),an(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this},i.setOrthographic=function(e,n,i,r,o,a){var s;this.projectionMode=t.CameraProjectionMode.ORTHOGRAPHIC,this.rright=n,this.left=e,this.top=i,this.bottom=r,this.near=o,this.far=a;var u=(this.rright-this.left)/(2*this.zoom),c=(this.top-this.bottom)/(2*this.zoom),l=(this.rright+this.left)/2,h=(this.top+this.bottom)/2,p=l-u,f=l+u,d=h+c,y=h-c;if(null===(s=this.view)||void 0===s?void 0:s.enabled){var v=(this.rright-this.left)/this.view.fullWidth/this.zoom,g=(this.top-this.bottom)/this.view.fullHeight/this.zoom;f=(p+=v*this.view.offsetX)+v*this.view.width,y=(d-=g*this.view.offsetY)-g*this.view.height}return yn(this.projectionMatrix,p,f,y,d,o,a),cn(this.projectionMatrix,this.projectionMatrix,Tn(1,-1,1)),an(this.projectionMatrixInverse,this.projectionMatrix),this._getOrthoMatrix(),this.triggerUpdate(),this},i.setPosition=function(t,e,n){void 0===e&&(e=this.position[1]),void 0===n&&(n=this.position[2]);var i=ri(t,e,n);return this._setPosition(i),this.setFocalPoint(this.focalPoint),this.triggerUpdate(),this},i.setFocalPoint=function(e,n,i){void 0===n&&(n=this.focalPoint[1]),void 0===i&&(i=this.focalPoint[2]);var r,o,a,s,u,c,l,h,p,f,d,y,v,g=Tn(0,1,0);if(this.focalPoint=ri(e,n,i),this.trackingMode===t.CameraTrackingMode.CINEMATIC){var m=wn(vn(),this.focalPoint,this.position);e=m[0],n=m[1],i=m[2];var T=mn(m),S=Math.asin(n/T)*Bc,b=90+Math.atan2(i,e)*Bc,E=nn();r=E,o=E,a=b*Fc,s=Math.sin(a),u=Math.cos(a),c=o[0],l=o[1],h=o[2],p=o[3],f=o[8],d=o[9],y=o[10],v=o[11],o!==r&&(r[4]=o[4],r[5]=o[5],r[6]=o[6],r[7]=o[7],r[12]=o[12],r[13]=o[13],r[14]=o[14],r[15]=o[15]),r[0]=c*u-f*s,r[1]=l*u-d*s,r[2]=h*u-y*s,r[3]=p*u-v*s,r[8]=c*s+f*u,r[9]=l*s+d*u,r[10]=h*s+y*u,r[11]=p*s+v*u,function(t,e,n){var i=Math.sin(n),r=Math.cos(n),o=e[4],a=e[5],s=e[6],u=e[7],c=e[8],l=e[9],h=e[10],p=e[11];e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*r+c*i,t[5]=a*r+l*i,t[6]=s*r+h*i,t[7]=u*r+p*i,t[8]=c*r-o*i,t[9]=l*r-a*i,t[10]=h*r-s*i,t[11]=p*r-u*i}(E,E,S*Fc),g=An(vn(),[0,1,0],E)}return an(this.matrix,function(t,e,n,i){var r,o,a,s,u,c,l,h,p,f,d=e[0],y=e[1],v=e[2],g=i[0],m=i[1],T=i[2],S=n[0],b=n[1],E=n[2];return Math.abs(d-S)<$e&&Math.abs(y-b)<$e&&Math.abs(v-E)<$e?on(t):(l=d-S,h=y-b,p=v-E,r=m*(p*=f=1/Math.hypot(l,h,p))-T*(h*=f),o=T*(l*=f)-g*p,a=g*h-m*l,(f=Math.hypot(r,o,a))?(r*=f=1/f,o*=f,a*=f):(r=0,o=0,a=0),s=h*a-p*o,u=p*r-l*a,c=l*o-h*r,(f=Math.hypot(s,u,c))?(s*=f=1/f,u*=f,c*=f):(s=0,u=0,c=0),t[0]=r,t[1]=s,t[2]=l,t[3]=0,t[4]=o,t[5]=u,t[6]=h,t[7]=0,t[8]=a,t[9]=c,t[10]=p,t[11]=0,t[12]=-(r*d+o*y+a*v),t[13]=-(s*d+u*y+c*v),t[14]=-(l*d+h*y+p*v),t[15]=1,t)}(nn(),this.position,this.focalPoint,g)),this._getAxes(),this._getDistance(),this._getAngles(),this.triggerUpdate(),this},i.getDistance=function(){return this.distance},i.setDistance=function(t){if(this.distance===t||0>t)return this;this.distance=t,Vc>this.distance&&(this.distance=Vc),this.dollyingStep=this.distance/100;var e=vn(),n=this.forward,i=this.focalPoint;return e[0]=(t=this.distance)*n[0]+i[0],e[1]=t*n[1]+i[1],e[2]=t*n[2]+i[2],this._setPosition(e),this.triggerUpdate(),this},i.setMaxDistance=function(t){return this.maxDistance=t,this},i.setMinDistance=function(t){return this.minDistance=t,this},i.setAzimuth=function(e){return this.azimuth=ii(e),this.computeMatrix(),this._getAxes(),this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?this._getPosition():this.type===t.CameraType.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},i.getAzimuth=function(){return this.azimuth},i.setElevation=function(e){return this.elevation=ii(e),this.computeMatrix(),this._getAxes(),this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?this._getPosition():this.type===t.CameraType.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},i.getElevation=function(){return this.elevation},i.setRoll=function(e){return this.roll=ii(e),this.computeMatrix(),this._getAxes(),this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?this._getPosition():this.type===t.CameraType.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},i.getRoll=function(){return this.roll},i.rotate=function(e,n,i){if(this.relElevation=ii(n),this.relAzimuth=ii(e),this.relRoll=ii(i),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.type===t.CameraType.EXPLORING){var r=Gn(Vn(),[1,0,0],(this.rotateWorld?1:-1)*this.relElevation*Fc),o=Gn(Vn(),[0,1,0],(this.rotateWorld?1:-1)*this.relAzimuth*Fc),a=Gn(Vn(),[0,0,1],this.relRoll*Fc),s=jn(Vn(),o,r);s=jn(Vn(),s,a);var u=dn(nn(),s);un(this.matrix,this.matrix,[0,0,-this.distance]),sn(this.matrix,this.matrix,u),un(this.matrix,this.matrix,[0,0,this.distance])}else{if(Math.abs(this.elevation)>90)return this;this.computeMatrix()}return this._getAxes(),this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?this._getPosition():this.type===t.CameraType.TRACKING&&this._getFocalPoint(),this._update(),this},i.pan=function(t,e){var n=ri(t,e,0),i=gn(this.position);return En(i,i,Pn(vn(),this.right,n[0])),En(i,i,Pn(vn(),this.up,n[1])),this._setPosition(i),this.triggerUpdate(),this},i.dolly=function(e){var n,i=this.forward,r=gn(this.position);return n=Math.max(Math.min(this.distance+e*this.dollyingStep,this.maxDistance),this.minDistance)-this.distance,r[0]+=n*i[0],r[1]+=n*i[1],r[2]+=n*i[2],this._setPosition(r),this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?this._getDistance():this.type===t.CameraType.TRACKING&&En(this.focalPoint,r,this.distanceVector),this.triggerUpdate(),this},i.createLandmark=function(t,e){void 0===e&&(e={});var i=e.position,r=void 0===i?this.position:i,o=e.focalPoint,a=void 0===o?this.focalPoint:o,s=e.roll,u=e.zoom,c=new n;c.setType(this.type,void 0),c.setPosition(r[0],r[1]||this.position[1],r[2]||this.position[2]),c.setFocalPoint(a[0],a[1]||this.focalPoint[1],a[2]||this.focalPoint[2]),c.setRoll(s||this.roll),c.setZoom(u||this.zoom);var l,h,p={name:t,matrix:(l=c.matrix,h=new tn(16),h[0]=l[0],h[1]=l[1],h[2]=l[2],h[3]=l[3],h[4]=l[4],h[5]=l[5],h[6]=l[6],h[7]=l[7],h[8]=l[8],h[9]=l[9],h[10]=l[10],h[11]=l[11],h[12]=l[12],h[13]=l[13],h[14]=l[14],h[15]=l[15],h),right:gn(c.right),up:gn(c.up),forward:gn(c.forward),position:gn(c.position),focalPoint:gn(c.focalPoint),distanceVector:gn(c.distanceVector),distance:c.distance,dollyingStep:c.dollyingStep,azimuth:c.azimuth,elevation:c.elevation,roll:c.roll,relAzimuth:c.relAzimuth,relElevation:c.relElevation,relRoll:c.relRoll,zoom:c.zoom};return this.landmarks.push(p),p},i.gotoLandmark=function(t,e){var n=this;void 0===e&&(e={});var i=Ji(t)?this.landmarks.find((function(e){return e.name===t})):t;if(i){var r=Ue(e)?{duration:e}:e,o=r.easing,a=void 0===o?"linear":o,s=r.duration,u=void 0===s?100:s,c=r.easingFunction,l=void 0===c?void 0:c,h=r.onfinish,p=void 0===h?void 0:h;if(0===u)return this.syncFromLandmark(i),void(p&&p());void 0!==this.landmarkAnimationID&&this.canvas.cancelAnimationFrame(this.landmarkAnimationID);var f,d=i.position,y=i.focalPoint,v=i.zoom,g=i.roll,m=l||Yi(a),T=function(){n.setFocalPoint(y),n.setPosition(d),n.setRoll(g),n.setZoom(v),n.computeMatrix(),n.triggerUpdate(),p&&p()};this.canvas.requestAnimationFrame((function t(e){void 0===f&&(f=e);var i=e-f;if(u<i)T();else{var r,o,a=m(i/u),s=vn(),c=vn();Mn(s,n.focalPoint,y,a),Mn(c,n.position,d,a),o=n.roll*(1-a)+g*a,r=n.zoom*(1-a)+v*a,n.setFocalPoint(s),n.setPosition(c),n.setRoll(o),n.setZoom(r),Dn(s,y)+Dn(c,d)>.01?(n.computeMatrix(),n.triggerUpdate(),u>i&&(n.landmarkAnimationID=n.canvas.requestAnimationFrame(t))):T()}}))}},i._update=function(){this._getAxes(),this._getPosition(),this._getDistance(),this._getAngles(),this._getOrthoMatrix(),this.triggerUpdate()},i.computeMatrix=function(){var e=Gn(Vn(),[0,0,1],this.roll*Fc);on(this.matrix);var n=Gn(Vn(),[1,0,0],(this.rotateWorld&&this.type!==t.CameraType.TRACKING||this.type===t.CameraType.TRACKING?1:-1)*this.elevation*Fc),i=Gn(Vn(),[0,1,0],(this.rotateWorld&&this.type!==t.CameraType.TRACKING||this.type===t.CameraType.TRACKING?1:-1)*this.azimuth*Fc),r=jn(Vn(),i,n);r=jn(Vn(),r,e);var o=dn(nn(),r);this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?(un(this.matrix,this.matrix,this.focalPoint),sn(this.matrix,this.matrix,o),un(this.matrix,this.matrix,[0,0,this.distance])):this.type===t.CameraType.TRACKING&&(un(this.matrix,this.matrix,this.position),sn(this.matrix,this.matrix,o))},i._setPosition=function(t,e,n){this.position=ri(t,e,n);var i=this.matrix;i[12]=this.position[0],i[13]=this.position[1],i[14]=this.position[2],i[15]=1,this._getOrthoMatrix()},i._getAxes=function(){Sn(this.right,ri(Bn(Fn(),[1,0,0,0],this.matrix))),Sn(this.up,ri(Bn(Fn(),[0,1,0,0],this.matrix))),Sn(this.forward,ri(Bn(Fn(),[0,0,1,0],this.matrix))),Cn(this.right,this.right),Cn(this.up,this.up),Cn(this.forward,this.forward)},i._getAngles=function(){var e=this.distanceVector[0],n=this.distanceVector[1],i=this.distanceVector[2],r=mn(this.distanceVector);if(0===r)return this.elevation=0,void(this.azimuth=0);this.type===t.CameraType.TRACKING||this.rotateWorld?(this.elevation=Math.asin(n/r)*Bc,this.azimuth=Math.atan2(-e,-i)*Bc):(this.elevation=-Math.asin(n/r)*Bc,this.azimuth=-Math.atan2(-e,-i)*Bc)},i._getPosition=function(){Sn(this.position,ri(Bn(Fn(),[0,0,0,1],this.matrix))),this._getDistance()},i._getFocalPoint=function(){var t,e;!function(t,e,n){var i=e[0],r=e[1],o=e[2];t[0]=i*n[0]+r*n[3]+o*n[6],t[1]=i*n[1]+r*n[4]+o*n[7],t[2]=i*n[2]+r*n[5]+o*n[8]}(this.distanceVector,[0,0,-this.distance],(t=en(),e=this.matrix,t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t)),En(this.focalPoint,this.position,this.distanceVector),this._getDistance()},i._getDistance=function(){this.distanceVector=wn(vn(),this.focalPoint,this.position),this.distance=mn(this.distanceVector),this.dollyingStep=this.distance/100},i._getOrthoMatrix=function(){if(this.projectionMode===t.CameraProjectionMode.ORTHOGRAPHIC){var e=this.position,n=Gn(Vn(),[0,0,1],-this.roll*Math.PI/180);fn(this.orthoMatrix,n,Tn((this.rright-this.left)/2-e[0],(this.top-this.bottom)/2-e[1],0),Tn(this.zoom,this.zoom,1),e)}},i.triggerUpdate=function(){if(this.enableUpdate){var t=this.getViewTransform(),e=sn(nn(),this.getPerspective(),t);this.getFrustum().extractFromVPMatrix(e),this.emit(Uc.UPDATED)}},i.syncFromLandmark=function(t){this.matrix=rn(this.matrix,t.matrix),this.right=Sn(this.right,t.right),this.up=Sn(this.up,t.up),this.forward=Sn(this.forward,t.forward),this.position=Sn(this.position,t.position),this.focalPoint=Sn(this.focalPoint,t.focalPoint),this.distanceVector=Sn(this.distanceVector,t.distanceVector),this.azimuth=t.azimuth,this.elevation=t.elevation,this.roll=t.roll,this.relAzimuth=t.relAzimuth,this.relElevation=t.relElevation,this.relRoll=t.relRoll,this.dollyingStep=t.dollyingStep,this.distance=t.distance,this.zoom=t.zoom},n}(mo.EventEmitter);let jc=1;const Hc="object"==typeof self&&self.self==self?self:"object"==typeof global&&global.global==global?global:{},zc=Date.now();let Wc={},Yc=Date.now();const qc=t=>{if("function"!=typeof t)throw new TypeError(t+" is not a function");const e=Date.now(),n=e-Yc,i=n>16?0:16-n,r=jc++;return Wc[r]=t,Object.keys(Wc).length>1||setTimeout((()=>{Yc=e;const t=Wc;Wc={},Object.keys(t).forEach((e=>t[e](Hc.performance&&"function"==typeof Hc.performance.now?Hc.performance.now():Date.now()-zc)))}),i),r},Xc=t=>{delete Wc[t]},Kc=t=>"string"!=typeof t?qc:""===t?Hc.requestAnimationFrame:Hc[t+"RequestAnimationFrame"],Zc=((t,e)=>{let n=0;for(;void 0!==t[n];){if(e(t[n]))return t[n];n+=1}})(["","webkit","moz","ms","o"],(t=>!!Kc(t))),Jc=Kc(Zc),Qc="string"!=typeof($c=Zc)?Xc:""===$c?Hc.cancelAnimationFrame:Hc[$c+"CancelAnimationFrame"]||Hc[$c+"CancelRequestAnimationFrame"];var $c,tl,el;Hc.requestAnimationFrame=Jc,Hc.cancelAnimationFrame=Qc,"undefined"!=typeof module&&module.exports&&(module.exports={requestAnimationFrame:Jc,cancelAnimationFrame:Qc});var nl,il,rl=t.Syringe.defineToken("CullingStrategyContribution"),ol=(tl=function(){function e(){this.strategyProvider=void 0,this.renderingContext=void 0}return e.prototype.apply=function(e){var n=this;this.strategyProvider.getContributions();e.hooks.cull.tap(el.tag,(function(e){if(e){var i=e.cullable;return i.visible=!0,!i.isCulled()&&e.isVisible()?e:(n.renderingContext.renderListLastFrame.indexOf(e)>-1&&e.dispatchEvent(new Qs(t.ElementEvent.CULLED)),null)}return e})),e.hooks.afterRender.tap(el.tag,(function(t){t.cullable.visibilityPlaneMask=-1}))},e}(),tl.tag="Culling",el=tl);se([jt(rl),ce("design:type",Object)],ol.prototype,"strategyProvider",void 0),se([lt(bc),ce("design:type",Object)],ol.prototype,"renderingContext",void 0),ol=el=se([ct({contrib:Ec})],ol);var al,sl,ul=(nl=function(){function e(){this.renderingContext=void 0}return e.prototype.apply=function(e){var n=this;e.hooks.dirtycheck.tap(il.tag,(function(e){if(e){var i=e.renderable,r=n.renderingContext.renderReasons.has(t.RenderReason.CAMERA_CHANGED);return i.dirty||r?e:null}return e}))},e}(),nl.tag="DirtyCheck",il=nl);se([lt(bc),ce("design:type",Object)],ul.prototype,"renderingContext",void 0),ul=il=se([ct({contrib:Ec})],ul);var cl=(al=function(){function t(){var t=this;this.canvasConfig=void 0,this.contextService=void 0,this.renderingService=void 0,this.renderingContext=void 0,this.eventService=void 0,this.autoPreventDefault=!0,this.rootPointerEvent=new Yu(null),this.rootWheelEvent=new qu(null),this.onPointerMove=function(e){var n,i,r=null===(n=t.renderingContext.root)||void 0===n||null===(i=n.ownerDocument)||void 0===i?void 0:i.defaultView;if(!r.supportsTouchEvents||"touch"!==e.pointerType){for(var o,a=we(t.normalizeToPointerEvent(e,r));!(o=a()).done;){var s=t.bootstrapEvent(t.rootPointerEvent,o.value,r);t.eventService.mapEvent(s)}t.setCursor(t.eventService.cursor)}}}var e=t.prototype;return e.apply=function(t){var e=this,n=this.renderingContext.root.ownerDocument.defaultView;this.eventService.setPickHandler(function(){var t=pe(le().mark((function t(n){return le().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.renderingService.hooks.pick.promise({position:n,picked:[],topmost:!0});case 2:return t.abrupt("return",t.sent.picked[0]||null);case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),t.hooks.pointerWheel.tap(sl.tag,(function(t){var n=e.normalizeWheelEvent(t);e.eventService.mapEvent(n)})),t.hooks.pointerDown.tap(sl.tag,(function(t){if(!n.supportsTouchEvents||"touch"!==t.pointerType){var i=e.normalizeToPointerEvent(t,n);if(e.autoPreventDefault&&i[0].isNormalized)(t.cancelable||!("cancelable"in t))&&t.preventDefault();for(var r,o=we(i);!(r=o()).done;){var a=e.bootstrapEvent(e.rootPointerEvent,r.value,n);e.eventService.mapEvent(a)}e.setCursor(e.eventService.cursor)}})),t.hooks.pointerUp.tap(sl.tag,(function(t){if(!n.supportsTouchEvents||"touch"!==t.pointerType){for(var i,r=e.contextService.getDomElement(),o=r&&t.target&&t.target!==r&&r.contains&&!r.contains(t.target)?"outside":"",a=we(e.normalizeToPointerEvent(t,n));!(i=a()).done;){var s=e.bootstrapEvent(e.rootPointerEvent,i.value,n);s.type+=o,e.eventService.mapEvent(s)}e.setCursor(e.eventService.cursor)}})),t.hooks.pointerMove.tap(sl.tag,this.onPointerMove),t.hooks.pointerOver.tap(sl.tag,this.onPointerMove),t.hooks.pointerOut.tap(sl.tag,this.onPointerMove)},e.bootstrapEvent=function(t,e,n){t.pointerType=e.pointerType;var i=t;i.view=n,i.originalEvent=null,i.nativeEvent=e,i.pointerId=e.pointerId,i.width=e.width,i.height=e.height,i.isPrimary=e.isPrimary,i.pressure=e.pressure,i.tangentialPressure=e.tangentialPressure,i.tiltX=e.tiltX,i.tiltY=e.tiltY,i.twist=e.twist,this.transferMouseData(i,e);var r=this.eventService.client2Viewport(new za(e.clientX,e.clientY)),o=r.y;i.viewport.x=r.x,i.viewport.y=o;var a=this.eventService.viewport2Canvas(i.viewport),s=a.y;return i.canvas.x=a.x,i.canvas.y=s,i.global.copyFrom(i.canvas),i.offset.copyFrom(i.canvas),i.isTrusted=e.isTrusted,"pointerleave"===i.type&&(i.type="pointerout"),i.type.startsWith("mouse")&&(i.type=i.type.replace("mouse","pointer")),i.type.startsWith("touch")&&(i.type=Fi[i.type]||i.type),i},e.normalizeWheelEvent=function(t){var e=this.rootWheelEvent;this.transferMouseData(e,t),e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ;var n=this.eventService.client2Viewport(new za(t.clientX,t.clientY)),i=n.y;e.viewport.x=n.x,e.viewport.y=i;var r=this.eventService.viewport2Canvas(e.viewport),o=r.y;return e.canvas.x=r.x,e.canvas.y=o,e.global.copyFrom(e.canvas),e.offset.copyFrom(e.canvas),e.nativeEvent=t,e.type=t.type,e},e.transferMouseData=function(t,e){t.isTrusted=e.isTrusted,t.timeStamp=performance.now(),t.type=e.type,t.altKey=e.altKey,t.metaKey=e.metaKey,t.shiftKey=e.shiftKey,t.ctrlKey=e.ctrlKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.screen.x=e.screenX,t.screen.y=e.screenY,t.relatedTarget=null},e.setCursor=function(t){this.contextService.applyCursorStyle(t||this.canvasConfig.cursor||"default")},e.normalizeToPointerEvent=function(t,e){var n=[];if(e.isTouchEvent(t))for(var i=0;t.changedTouches.length>i;i++){var r=t.changedTouches[i];Le(r.button)&&(r.button=t.touches.length?1:0),Le(r.buttons)&&(r.buttons=t.touches.length?1:0),Le(r.isPrimary)&&(r.isPrimary=1===t.touches.length&&"touchstart"===t.type),Le(r.width)&&(r.width=r.radiusX||1),Le(r.height)&&(r.height=r.radiusY||1),Le(r.tiltX)&&(r.tiltX=0),Le(r.tiltY)&&(r.tiltY=0),Le(r.pointerType)&&(r.pointerType="touch"),Le(r.pointerId)&&(r.pointerId=r.identifier||0),Le(r.pressure)&&(r.pressure=r.force||.5),Le(r.twist)&&(r.twist=0),Le(r.tangentialPressure)&&(r.tangentialPressure=0),r.isNormalized=!0,r.type=t.type,n.push(r)}else if(e.isMouseEvent(t)){var o=t;Le(o.isPrimary)&&(o.isPrimary=!0),Le(o.width)&&(o.width=1),Le(o.height)&&(o.height=1),Le(o.tiltX)&&(o.tiltX=0),Le(o.tiltY)&&(o.tiltY=0),Le(o.pointerType)&&(o.pointerType="mouse"),Le(o.pointerId)&&(o.pointerId=1),Le(o.pressure)&&(o.pressure=.5),Le(o.twist)&&(o.twist=0),Le(o.tangentialPressure)&&(o.tangentialPressure=0),o.isNormalized=!0,n.push(o)}else n.push(t);return n},t}(),al.tag="Event",sl=al);se([lt(gr),ce("design:type",Object)],cl.prototype,"canvasConfig",void 0),se([lt(Sc),ce("design:type",Object)],cl.prototype,"contextService",void 0),se([lt(t.RenderingService),ce("design:type",t.RenderingService)],cl.prototype,"renderingService",void 0),se([lt(bc),ce("design:type",Object)],cl.prototype,"renderingContext",void 0),se([lt(t.EventService),ce("design:type",t.EventService)],cl.prototype,"eventService",void 0),cl=sl=se([ct({contrib:Ec})],cl);var ll,hl,pl=[t.Shape.CIRCLE,t.Shape.ELLIPSE,t.Shape.IMAGE,t.Shape.RECT,t.Shape.LINE,t.Shape.POLYLINE,t.Shape.POLYGON,t.Shape.TEXT,t.Shape.PATH,t.Shape.HTML],fl=function(){function e(){this.camera=void 0,this.rBush=void 0}var n=e.prototype;return n.isVisible=function(t){var e=t.cullable;if(!e.enable)return!0;return e.visible=!0,e.visible},n.computeVisibilityWithPlaneMask=function(e,n,i,r){if(i===t.Mask.OUTSIDE||i===t.Mask.INSIDE)return i;for(var o=t.Mask.INSIDE,a=pl.indexOf(e.nodeName)>-1,s=0,u=r.length;u>s;++s){var c=1<<s;if(0!=(i&c)&&(!a||4!==s&&5!==s)){var l=r[s],h=l.normal,p=l.distance;if(0>Nn(h,n.getPositiveFarPoint(r[s]))+p)return t.Mask.OUTSIDE;0>Nn(h,n.getNegativeFarPoint(r[s]))+p&&(o|=c)}}return o},e}();se([lt(Dc),ce("design:type",Gc)],fl.prototype,"camera",void 0),se([lt(ru),ce("design:type",qt)],fl.prototype,"rBush",void 0),fl=se([ct({contrib:rl})],fl);var dl=(ll=function(){function e(){this.renderingContext=void 0,this.styleValueRegistry=void 0,this.rBush=void 0,this.toSync=new Set}var n=e.prototype;return n.pushToSync=function(t){var e=this;t.forEach((function(t){e.toSync.add(t)}))},n.apply=function(e){var n=this,i=function(t){t.target.renderable.dirty=!0,e.dirtify()},r=function(t){t.detail.affectChildren&&t.target.forEach((function(t){n.pushToSync([t])})),n.pushToSync(t.composedPath().slice(0,-2)),e.dirtify()},o=function(t){var i=t.target;n.pushToSync(t.composedPath().slice(0,-2)),n.styleValueRegistry.recalc(i),gc(i),e.dirtify()},a=function(t){var i=t.target,r=i.rBushNode;r.aabb&&(n.rBush.remove(r.aabb),n.toSync.delete(i)),gc(t.target),e.dirtify()};e.hooks.init.tapPromise(hl.tag,pe(le().mark((function e(){return le().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n.renderingContext.root.addEventListener(t.ElementEvent.MOUNTED,o),n.renderingContext.root.addEventListener(t.ElementEvent.UNMOUNTED,a),n.renderingContext.root.addEventListener(t.ElementEvent.ATTR_MODIFIED,i),n.renderingContext.root.addEventListener(t.ElementEvent.BOUNDS_CHANGED,r);case 4:case"end":return e.stop()}}),e)})))),e.hooks.destroy.tap(hl.tag,(function(){n.renderingContext.root.removeEventListener(t.ElementEvent.MOUNTED,o),n.renderingContext.root.removeEventListener(t.ElementEvent.UNMOUNTED,a),n.renderingContext.root.removeEventListener(t.ElementEvent.ATTR_MODIFIED,i),n.renderingContext.root.removeEventListener(t.ElementEvent.BOUNDS_CHANGED,r)})),e.hooks.endFrame.tap(hl.tag,(function(){n.syncRTree()}))},n.syncRTree=function(){var t=this,e=[];Array.from(this.toSync).filter((function(t){return t.isConnected})).forEach((function(n){var i=n.rBushNode;i&&t.rBush.remove(i.aabb);var r=n.getRenderBounds();if(r){var o=r.getMin(),a=o[0],s=o[1],u=r.getMax();i.aabb={id:n.entity,minX:a,minY:s,maxX:u[0],maxY:u[1]}}i.aabb&&e.push(i.aabb)})),this.rBush.load(e),this.toSync.clear()},e}(),ll.tag="Prepare",hl=ll);se([lt(bc),ce("design:type",Object)],dl.prototype,"renderingContext",void 0),se([lt(Bi),ce("design:type",Object)],dl.prototype,"styleValueRegistry",void 0),se([lt(ru),ce("design:type",qt)],dl.prototype,"rBush",void 0),dl=hl=se([ct({contrib:Ec})],dl);var yl,vl=At((function(e){t.Contribution.register(e,Ec,{cache:!1}),t.Contribution.register(e,rl,{cache:!1}),e({token:ru,useValue:new qt}),e(t.RenderingService),e(t.EventService),e(cl),e(dl),e(ul),e(ol),e(fl)}));(yl=t.CanvasEvent||(t.CanvasEvent={})).READY="ready",yl.BEFORE_RENDER="beforerender",yl.AFTER_RENDER="afterrender",yl.BEFORE_DESTROY="beforedestroy",yl.AFTER_DESTROY="afterdestroy",yl.RESIZE="resize";var gl=function(e){function n(n){var i;(i=e.call(this)||this).container=Vt.createChild(),i.document=void 0,i.customElements=void 0,i.requestAnimationFrame=void 0,i.cancelAnimationFrame=void 0,i.devicePixelRatio=void 0,i.supportsPointerEvents=void 0,i.supportsTouchEvents=void 0,i.isTouchEvent=void 0,i.isMouseEvent=void 0,i.Element=Tu,i.frameId=void 0,i.eventService=void 0,i.renderingService=void 0,i.inited=!1,i.readyPromise=void 0,i.resolveReadyPromise=void 0,i.document=new zu,i.document.defaultView=be(i),i.customElements=new pc;var r=n.container,o=n.canvas,a=n.offscreenCanvas,s=n.width,u=n.height,c=n.devicePixelRatio,l=n.renderer,h=n.background,p=n.document,f=n.requestAnimationFrame,d=n.cancelAnimationFrame,y=n.createImage,v=n.supportsPointerEvents,g=n.supportsTouchEvents,m=n.isTouchEvent,T=n.isMouseEvent;He(r,be(i));var S=s,b=u,E=c;return o&&(E=1>(E=c||ze&&window.devicePixelRatio||1)?1:Math.ceil(E),S=s||Li(o)||o.width/E,b=u||Di(o)||o.height/E),i.devicePixelRatio=E,i.requestAnimationFrame=null!=f?f:Jc.bind(globalThis),i.cancelAnimationFrame=null!=d?d:Qc.bind(globalThis),i.supportsTouchEvents=null!=g?g:"ontouchstart"in globalThis,i.supportsPointerEvents=null!=v?v:!!globalThis.PointerEvent,i.isTouchEvent=null!=m?m:function(t){return i.supportsTouchEvents&&t instanceof globalThis.TouchEvent},i.isMouseEvent=null!=T?T:function(t){return!globalThis.MouseEvent||t instanceof globalThis.MouseEvent&&(!i.supportsPointerEvents||!(t instanceof globalThis.PointerEvent))},i.initRenderingContext({container:r,canvas:o,width:S,height:b,renderer:l,offscreenCanvas:a,devicePixelRatio:E,cursor:"default",background:h,createImage:y,document:p}),i.initDefaultCamera(S,b),pe(le().mark((function e(){return le().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i.initRenderer(l);case 2:i.dispatchEvent(new Qs(t.CanvasEvent.READY)),i.readyPromise&&i.resolveReadyPromise();case 4:case"end":return e.stop()}}),e)})))(),i}ve(n,e);var i=n.prototype;return i.initRenderingContext=function(e){var n=this;this.container.register({token:gr,useValue:e}),this.container.register({token:bc,useValue:{root:this.document.documentElement,renderListLastFrame:[],renderListCurrentFrame:[],renderReasons:new Set,force:!1,dirty:!1}}),this.document.documentElement.addEventListener(t.ElementEvent.CHILD_INSERTED,(function(t){n.mountChildren(t.detail.child)})),this.document.documentElement.addEventListener(t.ElementEvent.CHILD_REMOVED,(function(t){n.unmountChildren(t.detail.child)}))},i.initDefaultCamera=function(e,n){var i=(new Gc).setPosition(e/2,n/2,500).setFocalPoint(e/2,n/2,0).setOrthographic(e/-2,e/2,n/2,n/-2,.1,1e3);i.canvas=this;var r=this.container.get(bc);i.on(Uc.UPDATED,(function(){r.renderReasons.add(t.RenderReason.CAMERA_CHANGED)})),this.container.register({token:Dc,useValue:i})},i.getConfig=function(){return this.container.get(gr)},i.getContainer=function(){return this.container},i.getRoot=function(){return this.document.documentElement},i.getCamera=function(){return this.container.get(Dc)},i.getContextService=function(){return this.container.get(Sc)},i.getEventService=function(){return this.eventService},i.getRenderingService=function(){return this.renderingService},i.getRenderingContext=function(){return this.container.get(bc)},i.getStats=function(){return this.getRenderingService().getStats()},i.destroy=function(e,n){(void 0===e&&(e=!0),void 0===n&&(n=!1),n||this.dispatchEvent(new Qs(t.CanvasEvent.BEFORE_DESTROY)),this.frameId)&&(this.getConfig().cancelAnimationFrame||cancelAnimationFrame)(this.frameId);var i=this.getRoot();this.unmountChildren(i),e&&this.document.destroy(),this.getContextService().destroy(),this.getRenderingService().destroy(),n||this.dispatchEvent(new Qs(t.CanvasEvent.AFTER_DESTROY))},i.changeSize=function(t,e){this.resize(t,e)},i.resize=function(e,n){var i=this.container.get(gr);i.width=e,i.height=n,this.getContextService().resize(e,n);var r=this.container.get(Dc),o=r.getProjectionMode();r.setPosition(e/2,n/2,500).setFocalPoint(e/2,n/2,0),o===t.CameraProjectionMode.ORTHOGRAPHIC?r.setOrthographic(e/-2,e/2,n/2,n/-2,r.getNear(),r.getFar()):r.setAspect(e/n),this.dispatchEvent(new Qs(t.CanvasEvent.RESIZE,{width:e,height:n}))},i.appendChild=function(t,e){return this.document.documentElement.appendChild(t,e)},i.insertBefore=function(t,e){return this.document.documentElement.insertBefore(t,e)},i.removeChild=function(t,e){return void 0===e&&(e=!0),this.document.documentElement.removeChild(t,e)},i.removeChildren=function(t){void 0===t&&(t=!0),this.document.documentElement.removeChildren(t)},i.render=function(){(this.dispatchEvent(new Qs(t.CanvasEvent.BEFORE_RENDER)),this.container.isBound(t.RenderingService))&&this.container.get(t.RenderingService).render(this.getConfig());this.dispatchEvent(new Qs(t.CanvasEvent.AFTER_RENDER))},i.run=function(){var t=this;!function e(){t.render(),t.frameId=requestAnimationFrame(e)}()},i.initRenderer=function(){var e=pe(le().mark((function e(n){var i;return le().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n){e.next=2;break}throw new Error("Renderer is required.");case 2:return this.inited=!1,this.readyPromise=void 0,this.loadCommonContainerModule(),this.loadRendererContainerModule(n),i=this.container.get(Sc),this.renderingService=this.container.get(t.RenderingService),this.eventService=this.container.get(t.EventService),e.next=11,i.init();case 11:return e.next=13,this.renderingService.init();case 13:this.inited=!0,this.getRoot().forEach((function(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0,e.dirty=!0)})),this.mountChildren(this.getRoot()),n.getConfig().enableAutoRendering&&this.run();case 17:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),i.loadCommonContainerModule=function(){this.container.unload(vl),this.container.load(vl,!0)},i.loadRendererContainerModule=function(t){var e=this;t.getPlugins().forEach((function(t){t.init(e.container)}))},i.setRenderer=function(){var t=pe(le().mark((function t(e){var n,i,r=this;return le().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((n=this.getConfig()).renderer!==e){t.next=3;break}return t.abrupt("return");case 3:return i=n.renderer,n.renderer=e,this.destroy(!1,!0),[].concat(null==i?void 0:i.getPlugins()).reverse().forEach((function(t){t.destroy(r.container)})),t.next=9,this.initRenderer(e);case 9:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),i.setCursor=function(t){this.getContextService().applyCursorStyle(t)},i.unmountChildren=function(e){var n=this;if(this.inited){var i=[];e.forEach((function(t){t.isConnected&&i.push(t)})),i.reverse().forEach((function(e){e instanceof bu&&e.disconnectedCallback&&e.disconnectedCallback(),e.dispatchEvent(new Qs(t.ElementEvent.UNMOUNTED)),e!==n.document.documentElement&&(e.ownerDocument=null),e.isConnected=!1}))}},i.mountChildren=function(e){var n=this;this.inited?e.forEach((function(e){e.isConnected||(e.ownerDocument=n.document,e.isConnected=!0,e.dispatchEvent(new Qs(t.ElementEvent.MOUNTED)),e instanceof bu&&e.connectedCallback&&e.connectedCallback())})):console.error("[g]: You are trying to call `canvas.appendChild` before canvas' initialization finished. You can either await `canvas.ready` or listen to `CanvasEvent.READY` manually.","appended child: ",e)},i.client2Viewport=function(t){return this.getEventService().client2Viewport(t)},i.viewport2Client=function(t){return this.getEventService().viewport2Client(t)},i.viewport2Canvas=function(t){return this.getEventService().viewport2Canvas(t)},i.canvas2Viewport=function(t){return this.getEventService().canvas2Viewport(t)},i.getPointByClient=function(t,e){return this.client2Viewport({x:t,y:e})},i.getClientByPoint=function(t,e){return this.viewport2Client({x:t,y:e})},de(n,[{key:"ready",get:function(){var t=this;return this.readyPromise||(this.readyPromise=new Promise((function(e){t.resolveReadyPromise=function(){e(t)}})),this.inited&&this.resolveReadyPromise()),this.readyPromise}}]),n}($s);Vt.load(Rc);var ml=Vt.get(t.LayoutEngine);t.AABB=Ia,t.AbstractLayoutDefinition=io,t.AbstractRenderer=Lc,t.Animation=fu,t.AnimationEffectTiming=Xu,t.AnimationEvent=hu,t.AnimationTimeline=yu,t.AsyncParallelHook=Dr,t.AsyncSeriesWaterfallHook=Vr,t.BUILT_IN_PROPERTIES=Mc,t.BoundingSphere=La,t.CSS=Ds,t.CSSColorValue=xo,t.CSSGradientValue=Ko,t.CSSKeywordValue=Po,t.CSSMathInvert=Uo,t.CSSMathMax=Ho,t.CSSMathMin=jo,t.CSSMathNegate=Fo,t.CSSMathProduct=Wo,t.CSSMathSum=zo,t.CSSMathValue=Do,t.CSSMathVariadic=Go,t.CSSNumericValue=_o,t.CSSNumericValueType=No,t.CSSProperty=Ks,t.CSSPropertySyntaxFactory=Xs,t.CSSRGB=Xo,t.CSSStyleValue=wo,t.CSSUnitValue=Lo,t.Camera=Gc,t.CameraEvent=Uc,t.Canvas=gl,t.CanvasConfig=gr,t.Circle=wu,t.Container=Bt,t.ContextNode=Ae,t.ContextService=Sc,t.Cullable=eu,t.CustomElement=bu,t.CustomElementRegistry=pc,t.CustomEvent=Qs,t.DCHECK=Oe,t.DCHECK_EQ=Ie,t.DCHECK_NE=Re,t.DELEGATION_SPLITTER=":",t.DefaultCamera=Dc,t.DefaultContributionProvider=Pt,t.Deferred=Oi,t.DisplayObject=Tu,t.Document=zu,t.EasingFunctions=_i,t.Element=lu,t.Ellipse=Pu,t.EventTarget=$s,t.FederatedEvent=Js,t.FederatedMouseEvent=Wu,t.FederatedPointerEvent=Yu,t.FederatedWheelEvent=qu,t.FragmentResultFactory=_e,t.FragmentResultOptions=Me,t.Frustum=Ua,t.Geometry=nu,t.GeometryAABBUpdater=Nc,t.GeometryUpdaterFactory=Cc,t.GlobalContainer=Vt,t.Group=Cu,t.HTML=Hu,t.Image=_u,t.KeyframeEffect=hc,t.LayoutChildrenFactory=eo,t.LayoutChildrenOptions=no,t.LayoutContextFactory=ke,t.LayoutContextOptions=Ce,t.LayoutEdgesFactory=ao,t.LayoutEdgesOptions=so,t.LayoutFragmentFactory=lo,t.LayoutFragmentOptions=ho,t.LayoutObject=Pe,t.Line=Au,t.MOUSE_POINTER_ID=1,t.Module=At,t.MutationEvent=uu,t.MutationObserver=$u,t.MutationRecord=Ku,t.Node=tu,t.ObjectTyped=Ii,t.Odeg=qo,t.OptionSymbol=pt,t.Opx=Yo,t.Path=Iu,t.Plane=Da,t.Point=za,t.Polygon=Lu,t.Polyline=Uu,t.Provider=mt,t.RBush=qt,t.RBushNode=iu,t.RBushRoot=ru,t.Ray=Ha,t.Rect=Bu,t.Rectangle=Wa,t.Registration=Qu,t.Renderable=ou,t.RenderingContext=bc,t.RenderingPluginContribution=Ec,t.SceneGraphSelector=dc,t.SceneGraphSelectorFactory=fc,t.SceneGraphService=mc,t.Sortable=au,t.StyleValueRegistry=Bi,t.SyncHook=Yr,t.SyncWaterfallHook=Qr,t.SyringeModule=_t,t.TOUCH_TO_POINTER=Fi,t.Text=Gu,t.Transform=su,t.baseTypeToString=Co,t.camelCase=Zi,t.clamp=ni,t.clampedMergeNumbers=rs,t.cleanExistedCanvas=He,t.clonePath=Pr,t.compareAnimations=du,t.contrib=jt,t.convertAngleUnit=Ja,t.convertEffectInput=Qi,t.convertPercentUnit=ts,t.convertToDash=hi,t.convertToPath=function(e,n){void 0===n&&(n=!0);var i=[];switch(e.nodeName){case t.Shape.LINE:var r=e.parsedStyle;i=function(t,e,n,i){return[["M",t,e],["L",n,i]]}(r.x1.value,r.y1.value,r.x2.value,r.y2.value);break;case t.Shape.CIRCLE:var o=e.parsedStyle,a=o.r;i=Cr(a.value,a.value,o.cx.value,o.cy.value);break;case t.Shape.ELLIPSE:var s=e.parsedStyle;i=Cr(s.rx.value,s.ry.value,s.cx.value,s.cy.value);break;case t.Shape.POLYLINE:case t.Shape.POLYGON:i=function(t,e){var n=t.map((function(t,e){return[0===e?"M":"L",t[0],t[1]]}));return e&&n.push(["Z"]),n}(e.parsedStyle.points.points,e.nodeName===t.Shape.POLYGON);break;case t.Shape.RECT:var u=e.parsedStyle,c=u.width,l=u.height,h=u.x,p=u.y,f=u.radius,d=f&&f.some((function(t){return 0!==t.value}));i=function(t,e,n,i,r){if(r){var o=r[0],a=r[1],s=r[2],u=r[3];return[["M",n,o+i],o?["A",o,o,0,0,1,o+n,i]:null,["L",t-a+n,i],a?["A",a,a,0,0,1,t+n,a+i]:null,["L",t+n,e-s+i],s?["A",s,s,0,0,1,t-s+n,e+i]:null,["L",u+n,e+i],u?["A",u,u,0,0,1,n,e-u+i]:null,["Z"]].filter((function(t){return t}))}return[["M",n,i],["L",n+t,i],["L",n+t,i+e],["L",n,i+e],["Z"]]}(c.value,l.value,h.value,p.value,d&&f.map((function(t){return t.value})));break;case t.Shape.PATH:var y=e.parsedStyle.path,v=y.zCommandIndexes;i=[].concat(y.curve),v.forEach((function(t,e){i.splice(t+e,1,["Z"])}))}if(i.length)return function(t,e,n){var i;void 0===n&&(n=!0),n&&(i=e.getLocalTransform());var r=e.parsedStyle,o=r.defX,a=void 0===o?0:o,s=r.defY,u=void 0===s?0:s;return t.reduce((function(t,e){var r="";if("M"===e[0]||"L"===e[0]){var o=Tn(e[1]-a,e[2]-u,0);n&&An(o,o,i),r=""+e[0]+o[0]+","+o[1]}else if("Z"===e[0])r=e[0];else if("C"===e[0]){var s=Tn(e[1]-a,e[2]-u,0),c=Tn(e[3]-a,e[4]-u,0),l=Tn(e[5]-a,e[6]-u,0);n&&(An(s,s,i),An(c,c,i),An(l,l,i)),r=""+e[0]+s[0]+","+s[1]+","+c[0]+","+c[1]+","+l[0]+","+l[1]}else if("A"===e[0]){var h=Tn(e[6]-a,e[7]-u,0);n&&An(h,h,i),r=""+e[0]+e[1]+","+e[2]+","+e[3]+","+e[4]+","+e[5]+","+h[0]+","+h[1]}return t+r}),"")}(i,e,n)},t.createVec3=ri,t.decompose=li,t.decorate=Y.decorate,t.deg2rad=function(t){return t*(Math.PI/180)},t.deg2turn=function(t){return t/360},t.dirtifyToRoot=gc,t.equalSet=function(t,e){if(t.size!==e.size)return!1;for(var n,i=we(t);!(n=i()).done;){if(!e.has(n.value))return!1}return!0},t.equalizeSegments=Sr,t.formatAttribute=rr,t.fromRotationTranslationScale=ui,t.getAngle=ii,t.getDrawDirection=br,t.getEasingFunction=Mi,t.getEuler=si,t.getHeight=Di,t.getPathArea=wr,t.getRotatedCurve=kr,t.getRotationInRadians=function(t){return Math.atan2(t[1],t[4])},t.getScaling=function(t,e){var n=e[3],i=e[4];return t[0]=Math.hypot(e[0],e[1]),t[1]=Math.hypot(n,i),t},t.getStyle=Ri,t.getTranslation=function(t,e){return t[0]=e[6],t[1]=e[7],t},t.getWidth=Li,t.grad2deg=function(t){return 0>(t%=400)&&(t+=400),t/400*360},t.inject=lt,t.injectable=ut,t.isBoolean=Be,t.isBrowser=ze,t.isComparison=function(e){return e===t.CSSMathOperator.kMin||e===t.CSSMathOperator.kMax||e===t.CSSMathOperator.kClamp},t.isFunction=Fe,t.isNil=De,t.isNumber=Ue,t.isObject=Ve,t.isString=Ji,t.isSyringeModule=Mt,t.isUndefined=Le,t.layoutEngine=ml,t.makePerspective=ci,t.makeQuerablePromise=Ai,t.makeTiming=uc,t.mergeColors=Aa,t.mergeDimensionList=$a,t.mergeDimensions=Za,t.mergeNumberLists=function(t,e){if(t.length===e.length)return[t.map((function(t){return t.value})),e.map((function(t){return t.value})),function(t){return t}]},t.mergeNumbers=is,t.mergePaths=As,t.mergeTransforms=zs,t.named=ht,t.normalizeKeyframes=oc,t.normalizeTimingInput=cc,t.numberToString=es,t.numericTimingToObject=lc,t.optional=Y.optional,t.parseAngle=Ka,t.parseColor=Ma,t.parseDimension=Ya,t.parseDimensionArray=Qa,t.parseFilter=Ls,t.parseLength=qa,t.parseLengthOrPercentage=Xa,t.parseNumber=ns,t.parseNumberList=function(t){return Ji(t)?t.split(" ").map(ns):t.map(ns)},t.parseParam=Is,t.parsePath=Ms,t.parsePoints=Os,t.parseTransform=Gs,t.parseTransformOrigin=Ws,t.parserPercentage=function(t){return Ya(new RegExp("%","g"),t)},t.postConstruct=Y.postConstruct,t.rad2deg=oi,t.register=Gt,t.registerSideOption=function(t,e){Reflect.defineMetadata(pt,t,e)},t.reverseCurve=xr,t.setDOMSize=function(t,e,n){ze&&t.style&&(t.style.width=e+"px",t.style.height=n+"px")},t.singleton=ct,t.sortByZIndex=vc,t.toFontString=to,t.transient=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ut(at(at({},e),{},{lifecycle:t.Syringe.Lifecycle.transient}))},t.turn2deg=ai,t.typeCheck=Bo,t.unitTypeToBaseType=ko,t.unmanaged=Y.unmanaged,Object.defineProperty(t,"__esModule",{value:!0})}));
|
|
3
|
+
ct=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",o=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function s(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var i=Object.create((t&&t.prototype instanceof h?t:h).prototype),o=new E(r||[]);return i._invoke=function(e,t,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return x()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=T(a,n);if(s){if(s===l)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=c(e,t,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(e,n,o),i}function c(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var l={};function h(){}function f(){}function d(){}var p={};s(p,i,(function(){return this}));var y=Object.getPrototypeOf,v=y&&y(y(P([])));v&&v!==t&&n.call(v,i)&&(p=v);var g=d.prototype=h.prototype=Object.create(p);function m(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function k(e,t){function r(i,o,a,s){var u=c(e[i],e,o);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==typeof h&&n.call(h,"__await")?t.resolve(h.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(h).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,s)}))}s(u.arg)}var i;this._invoke=function(e,n){function o(){return new t((function(t,i){r(e,n,t,i)}))}return i=i?i.then(o,o):o()}}function T(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,T(e,t),"throw"===t.method))return l;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var r=c(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,l;var i=r.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,l):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,l)}function b(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function S(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function E(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(b,this),this.reset(!0)}function P(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,o=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return o.next=o}}return{next:x}}function x(){return{value:void 0,done:!0}}return f.prototype=d,s(g,"constructor",d),s(d,"constructor",f),f.displayName=s(d,a,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,s(e,a,"GeneratorFunction")),e.prototype=Object.create(g),e},e.awrap=function(e){return{__await:e}},m(k.prototype),s(k.prototype,o,(function(){return this})),e.AsyncIterator=k,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new k(u(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},m(g),s(g,a,"Generator"),s(g,i,(function(){return this})),s(g,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=P,E.prototype={constructor:E,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return a.type="throw",a.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(this.prev>=o.tryLoc){var s=n.call(o,"catchLoc"),u=n.call(o,"finallyLoc");if(s&&u){if(o.catchLoc>this.prev)return r(o.catchLoc,!0);if(o.finallyLoc>this.prev)return r(o.finallyLoc)}else if(s){if(o.catchLoc>this.prev)return r(o.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(o.finallyLoc>this.prev)return r(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(this.prev>=i.tryLoc&&n.call(i,"finallyLoc")&&i.finallyLoc>this.prev){var o=i;break}}o&&("break"===e||"continue"===e)&&t>=o.tryLoc&&o.finallyLoc>=t&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,l):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),l},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),S(n),l}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;S(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:P(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),l}},e}function lt(e){return lt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},lt(e)}function ht(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function ft(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){ht(o,r,i,a,s,"next",e)}function s(e){ht(o,r,i,a,s,"throw",e)}a(void 0)}))}}function dt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pt(e,t){for(var n=0;t.length>n;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function yt(e,t,n){return t&&pt(e.prototype,t),n&&pt(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function vt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gt(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&kt(e,t)}function mt(e){return mt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},mt(e)}function kt(e,t){return kt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},kt(e,t)}function Tt(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function bt(e,t,n){return bt=Tt()?Reflect.construct.bind():function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&kt(i,n.prototype),i},bt.apply(null,arguments)}function St(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;o.length>r;r++)0>t.indexOf(n=o[r])&&(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;o.length>r;r++)0>t.indexOf(n=o[r])&&Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Et(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Pt(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Et(e)}function xt(e){var t=Tt();return function(){var n,r=mt(e);if(t){var i=mt(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Pt(this,n)}}function wt(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=mt(e)););return e}function _t(){return _t="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=wt(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(3>arguments.length?e:n):i.value}},_t.apply(this,arguments)}function Ct(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}(e,t)||Mt(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Nt(e){return function(e){if(Array.isArray(e))return At(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Mt(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Mt(e,t){if(e){if("string"==typeof e)return At(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?At(e,t):void 0}}function At(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);t>n;n++)r[n]=e[n];return r}function Ot(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Mt(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return e.length>r?{done:!1,value:e[r++]}:{done:!0}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function It(e,t,n,r){var i,o=arguments.length,a=3>o?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(3>o?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a}function Rt(e,t){return function(n,r){t(n,r,e)}}function Lt(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}(Re=e.LayoutTaskType||(e.LayoutTaskType={})).Layout="layout",Re.IntrinsicSizes="intrinsic-sizes",function(e){e[e.block=0]="block",e[e.normal=1]="normal"}(Le||(Le={})),function(e){e[e["block-like"]=0]="block-like",e[e.manual=1]="manual"}(De||(De={})),(Ue=e.PropertyName||(e.PropertyName={})).LAYOUT="display",Ue.LEFT="left",Ue.TOP="top",Ue.BOTTOM="bottom",Ue.RIGHT="right",Ue.WIDTH="width",Ue.HEIGHT="height",Ue.MIN_WIDTH="minWidth",Ue.MAX_WIDTH="maxWidth",Ue.MIN_HEIGHT="minHeight",Ue.MAX_HEIGHT="maxHeight",Ue.BOX_SIZING="boxSizing",Ue.PADDING="padding",Ue.PADDING_TOP="paddingTop",Ue.PADDING_BOTTOM="paddingBottom",Ue.PADDING_START="paddingLeft",Ue.PADDING_END="paddingRight",Ue.MARGIN="margin",Ue.MARGIN_TOP="marginTop",Ue.MARGIN_BOTTOM="marginBottom",Ue.MARGIN_START="marginLeft",Ue.MARGIN_END="marginRight",Ue.BORDER="border",Ue.BORDER_TOP="borderTop",Ue.BORDER_BOTTOM="borderBottom",Ue.BORDER_START="borderLeft",Ue.BORDER_END="borderRight",Ue.FLEX_DIRECTION="flexDirection",Ue.FLEX_WRAP="flexWrap",Ue.FLEX_FLOW="flexFlow",Ue.ALIGN_ITEMS="alignItems",Ue.ALIGN_CONTENT="alignContent",Ue.JUSTIFY_CONTENT="justifyContent",Ue.FLEX="flex",Ue.ALIGN_SELF="alignSelf",Ue.FLEX_SHRINK="flexShrink",Ue.FLEX_BASIS="flexBasis",Ue.FLEX_GROW="flexGrow",Ue.OFFSET_WIDTH="offsetWidth",Ue.OFFSET_HEIGHT="offsetHeight",Ue.ORDER="order";var Dt=1,Ut=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Map;dt(this,t),this.id=void 0,this.style=void 0,this.dirty=void 0,this.parent=void 0,this.children=void 0,this.internalIntrisicSizes=void 0,this.computedLayout=void 0,this.measureFn=void 0,this.id=Dt++,this.style=e,this.parent=void 0,this.children=[],this.dirty=!1}var n;return yt(t,[{key:"intrisicSizes",get:function(){return this.internalIntrisicSizes}},{key:"childCount",get:function(){return this.children.length}},{key:"setMeasure",value:function(e){this.measureFn=e}},{key:"setIntrisicSizes",value:function(e){this.internalIntrisicSizes=e}},{key:"addChild",value:function(e){var t;null===(t=this.children)||void 0===t||t.push(e)}},{key:"insertChild",value:function(e,t){this.children.splice(e,0,t)}},{key:"removeChild",value:function(e){var t,n=null===(t=this.children)||void 0===t?void 0:t.findIndex((function(t){return t.id===e.id}));this.removeChildAtIndex(n)}},{key:"removeChildAtIndex",value:function(e){this.children.splice(e,1)}},{key:"replaceChildAtIndex",value:function(e,t){this.children.splice(e,1,t)}},{key:"setStyle",value:function(e,t){this.style.set(e,t)}},{key:"getStyle",value:function(){for(var e=this,t=new Map,n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];return r.forEach((function(n){var r=e.style.get(n);r&&t.set(n,r)})),t}},{key:"getAllStyle",value:function(){return this.style}},{key:"markDirty",value:function(){this.dirty=!0}},{key:"idDirty",value:function(){return this.dirty}},{key:"getSize",value:function(){var t,n,r,i;return{width:null!==(t=null===(n=this.style.get(e.PropertyName.WIDTH))||void 0===n?void 0:n.value)&&void 0!==t?t:0,height:null!==(r=null===(i=this.style.get(e.PropertyName.HEIGHT))||void 0===i?void 0:i.value)&&void 0!==r?r:0}}},{key:"computeLayout",value:(n=ft(ct().mark((function e(){var t;return ct().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.getSize(),e.next=3,kh.computeLayout(this,{availableInlineSize:t.width,availableBlockSize:t.height,fixedInlineSize:t.width,fixedBlockSize:t.height,percentageInlineSize:t.width,percentageBlockSize:t.height,data:void 0});case 3:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"setComputedLayout",value:function(e){this.computedLayout=e}},{key:"getComputedLayout",value:function(){return this.computedLayout}},{key:"getAllComputedLayout",value:function(){}},{key:"toString",value:function(){return"LayoutObject ".concat(this.id)}}]),t}(),Ft=e.Syringe.defineToken("LayoutContextFactory"),Bt=e.Syringe.defineToken("LayoutContextOptions"),Vt=0;e.LayoutContext=function(){function e(t){dt(this,e),this.options=void 0,this.contextId=void 0,this.workQueue=[],this.mode=void 0,this.layoutChildrenFactory=void 0,this.fragmentResultFactory=void 0,this.layoutFragmentFactory=void 0,this.options=t,this.contextId="".concat(Vt++),this.mode=t.mode,this.layoutChildrenFactory=t.layoutChildrenFactory,this.fragmentResultFactory=t.fragmentResultFactory,this.layoutFragmentFactory=t.layoutFragmentFactory}return yt(e,[{key:"appendWorkTask",value:function(e){this.workQueue.push(e)}},{key:"clearWorkQueue",value:function(){this.workQueue=[]}}]),e}(),e.LayoutContext=It([ce(),Rt(0,le(Bt)),Lt("design:paramtypes",[Object])],e.LayoutContext);var jt=e.Syringe.defineToken("FragmentResultFactory"),Gt=e.Syringe.defineToken("FragmentResultOptions"),zt=e.Syringe.defineToken("contextNode");function Ht(e){if(!e)throw Error()}function Wt(e,t){if(e!==t)throw Error()}function Yt(e,t){if(e===t)throw Error()}function qt(e){return void 0===e}function Xt(e){return null==e}function Kt(e){return"number"==typeof e}function Zt(e){return"function"==typeof e}function Jt(e){return"boolean"==typeof e}function Qt(e){return"[object Object]"===Object.prototype.toString.call(e)}e.FragmentResult=yt((function e(t,n,r){dt(this,e),this._layoutContext=void 0,this._node=void 0,this.options=void 0,this.layoutContext=void 0,this.inlineSize=void 0,this.blockSize=void 0,this.node=void 0,this.childFragments=void 0,this.data=void 0,this._layoutContext=t,this._node=n,this.options=r,this.layoutContext=t,this.inlineSize=null==r?void 0:r.inlineSize,this.blockSize=null==r?void 0:r.blockSize,this.childFragments=null==r?void 0:r.childFragments,this.data=r.data,this.node=n})),e.FragmentResult=It([ue(),Rt(0,le(e.LayoutContext)),Rt(1,le(zt)),Rt(2,le(Gt)),Lt("design:paramtypes",[e.LayoutContext,Ut,Object])],e.FragmentResult);var $t={},en=0;function tn(e,t){if(e){var n="string"==typeof e?e:e.id||en++;$t[n]&&$t[n].destroy(),$t[n]=t}}var nn="undefined"!=typeof window&&void 0!==window.document,rn=.1,on="function"==typeof Float32Array,an=function(e,t){return 1-3*t+3*e},sn=function(e,t){return 3*t-6*e},un=function(e){return 3*e},cn=function(e,t,n){return((an(t,n)*e+sn(t,n))*e+un(t))*e},ln=function(e,t,n){return 3*an(t,n)*e*e+2*sn(t,n)*e+un(t)},hn=function(e,t,n,r){if(0>e||e>1||0>n||n>1)throw Error("bezier x values must be in [0, 1] range");if(e===t&&n===r)return function(e){return e};for(var i=on?new Float32Array(11):[,,,,,,,,,,,],o=0;11>o;++o)i[o]=cn(o*rn,e,n);var a=function(t){for(var r=0,o=1;10!==o&&t>=i[o];++o)r+=rn;--o;var a=r+(t-i[o])/(i[o+1]-i[o])*rn,s=ln(a,e,n);return.001>s?0===s?a:function(e,t,n,r,i){var o,a,s=0;do{(o=cn(a=t+(n-t)/2,r,i)-e)>0?n=a:t=a}while(Math.abs(o)>1e-7&&10>++s);return a}(t,r,r+rn,e,n):function(e,t,n,r){for(var i=0;4>i;++i){var o=ln(t,n,r);if(0===o)return t;t-=(cn(t,n,r)-e)/o}return t}(t,a,e,n)};return function(e){return 0===e||1===e?e:cn(a(e),t,r)}},fn=1e-6,dn="undefined"!=typeof Float32Array?Float32Array:Array;function pn(){var e=new dn(9);return dn!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function yn(){var e=new dn(16);return dn!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function vn(e){var t=new dn(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function gn(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function mn(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function kn(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],u=t[6],c=t[7],l=t[8],h=t[9],f=t[10],d=t[11],p=t[12],y=t[13],v=t[14],g=t[15],m=n*s-r*a,k=n*u-i*a,T=n*c-o*a,b=r*u-i*s,S=r*c-o*s,E=i*c-o*u,P=l*y-h*p,x=l*v-f*p,w=l*g-d*p,_=h*v-f*y,C=h*g-d*y,N=f*g-d*v,M=m*N-k*C+T*_+b*w-S*x+E*P;return M?(e[0]=(s*N-u*C+c*_)*(M=1/M),e[1]=(i*C-r*N-o*_)*M,e[2]=(y*E-v*S+g*b)*M,e[3]=(f*S-h*E-d*b)*M,e[4]=(u*w-a*N-c*x)*M,e[5]=(n*N-i*w+o*x)*M,e[6]=(v*T-p*E-g*k)*M,e[7]=(l*E-f*T+d*k)*M,e[8]=(a*C-s*w+c*P)*M,e[9]=(r*w-n*C-o*P)*M,e[10]=(p*S-y*T+g*m)*M,e[11]=(h*T-l*S-d*m)*M,e[12]=(s*x-a*_-u*P)*M,e[13]=(n*_-r*x+i*P)*M,e[14]=(y*k-p*b-v*m)*M,e[15]=(l*b-h*k+f*m)*M,e):null}function Tn(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=t[4],u=t[5],c=t[6],l=t[7],h=t[8],f=t[9],d=t[10],p=t[11],y=t[12],v=t[13],g=t[14],m=t[15],k=n[0],T=n[1],b=n[2],S=n[3];return e[0]=k*r+T*s+b*h+S*y,e[1]=k*i+T*u+b*f+S*v,e[2]=k*o+T*c+b*d+S*g,e[3]=k*a+T*l+b*p+S*m,e[4]=(k=n[4])*r+(T=n[5])*s+(b=n[6])*h+(S=n[7])*y,e[5]=k*i+T*u+b*f+S*v,e[6]=k*o+T*c+b*d+S*g,e[7]=k*a+T*l+b*p+S*m,e[8]=(k=n[8])*r+(T=n[9])*s+(b=n[10])*h+(S=n[11])*y,e[9]=k*i+T*u+b*f+S*v,e[10]=k*o+T*c+b*d+S*g,e[11]=k*a+T*l+b*p+S*m,e[12]=(k=n[12])*r+(T=n[13])*s+(b=n[14])*h+(S=n[15])*y,e[13]=k*i+T*u+b*f+S*v,e[14]=k*o+T*c+b*d+S*g,e[15]=k*a+T*l+b*p+S*m,e}function bn(e,t,n){var r,i,o,a,s,u,c,l,h,f,d,p,y=n[0],v=n[1],g=n[2];return t===e?(e[12]=t[0]*y+t[4]*v+t[8]*g+t[12],e[13]=t[1]*y+t[5]*v+t[9]*g+t[13],e[14]=t[2]*y+t[6]*v+t[10]*g+t[14],e[15]=t[3]*y+t[7]*v+t[11]*g+t[15]):(i=t[1],o=t[2],a=t[3],s=t[4],u=t[5],c=t[6],l=t[7],h=t[8],f=t[9],d=t[10],p=t[11],e[0]=r=t[0],e[1]=i,e[2]=o,e[3]=a,e[4]=s,e[5]=u,e[6]=c,e[7]=l,e[8]=h,e[9]=f,e[10]=d,e[11]=p,e[12]=r*y+s*v+h*g+t[12],e[13]=i*y+u*v+f*g+t[13],e[14]=o*y+c*v+d*g+t[14],e[15]=a*y+l*v+p*g+t[15]),e}function Sn(e,t,n){var r=n[0],i=n[1],o=n[2];return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*o,e[9]=t[9]*o,e[10]=t[10]*o,e[11]=t[11]*o,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function En(e,t,n){var r=Math.sin(n),i=Math.cos(n),o=t[4],a=t[5],s=t[6],u=t[7],c=t[8],l=t[9],h=t[10],f=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=o*i+c*r,e[5]=a*i+l*r,e[6]=s*i+h*r,e[7]=u*i+f*r,e[8]=c*i-o*r,e[9]=l*i-a*r,e[10]=h*i-s*r,e[11]=f*i-u*r,e}function Pn(e,t,n){var r=Math.sin(n),i=Math.cos(n),o=t[0],a=t[1],s=t[2],u=t[3],c=t[8],l=t[9],h=t[10],f=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*i-c*r,e[1]=a*i-l*r,e[2]=s*i-h*r,e[3]=u*i-f*r,e[8]=o*r+c*i,e[9]=a*r+l*i,e[10]=s*r+h*i,e[11]=u*r+f*i,e}function xn(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}function wn(e,t){var n=t[4],r=t[5],i=t[6],o=t[8],a=t[9],s=t[10];return e[0]=Math.hypot(t[0],t[1],t[2]),e[1]=Math.hypot(n,r,i),e[2]=Math.hypot(o,a,s),e}function _n(e,t){var n=new dn(3);wn(n,t);var r=1/n[0],i=1/n[1],o=1/n[2],a=t[0]*r,s=t[1]*i,u=t[2]*o,c=t[4]*r,l=t[5]*i,h=t[6]*o,f=t[8]*r,d=t[9]*i,p=t[10]*o,y=a+l+p,v=0;return y>0?(e[3]=.25*(v=2*Math.sqrt(y+1)),e[0]=(h-d)/v,e[1]=(f-u)/v,e[2]=(s-c)/v):a>l&&a>p?(e[3]=(h-d)/(v=2*Math.sqrt(1+a-l-p)),e[0]=.25*v,e[1]=(s+c)/v,e[2]=(f+u)/v):l>p?(e[3]=(f-u)/(v=2*Math.sqrt(1+l-a-p)),e[0]=(s+c)/v,e[1]=.25*v,e[2]=(h+d)/v):(e[3]=(s-c)/(v=2*Math.sqrt(1+p-a-l)),e[0]=(f+u)/v,e[1]=(h+d)/v,e[2]=.25*v),e}function Cn(e,t,n,r,i){var o=t[0],a=t[1],s=t[2],u=t[3],c=o+o,l=a+a,h=s+s,f=o*c,d=o*l,p=o*h,y=a*l,v=a*h,g=s*h,m=u*c,k=u*l,T=u*h,b=r[0],S=r[1],E=r[2],P=i[0],x=i[1],w=i[2],_=(1-(y+g))*b,C=(d+T)*b,N=(p-k)*b,M=(d-T)*S,A=(1-(f+g))*S,O=(v+m)*S,I=(p+k)*E,R=(v-m)*E,L=(1-(f+y))*E;return e[0]=_,e[1]=C,e[2]=N,e[3]=0,e[4]=M,e[5]=A,e[6]=O,e[7]=0,e[8]=I,e[9]=R,e[10]=L,e[11]=0,e[12]=n[0]+P-(_*P+M*x+I*w),e[13]=n[1]+x-(C*P+A*x+R*w),e[14]=n[2]+w-(N*P+O*x+L*w),e[15]=1,e}function Nn(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=n+n,s=r+r,u=i+i,c=n*a,l=r*a,h=r*s,f=i*a,d=i*s,p=i*u,y=o*a,v=o*s,g=o*u;return e[0]=1-h-p,e[1]=l+g,e[2]=f-v,e[3]=0,e[4]=l-g,e[5]=1-c-p,e[6]=d+y,e[7]=0,e[8]=f+v,e[9]=d-y,e[10]=1-c-h,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});var Mn=function(e,t,n,r,i,o,a){var s=1/(t-n),u=1/(r-i),c=1/(o-a);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*u,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*c,e[11]=0,e[12]=(t+n)*s,e[13]=(i+r)*u,e[14]=(a+o)*c,e[15]=1,e};function An(e,t,n,r){var i,o,a,s,u,c,l,h,f,d,p=t[0],y=t[1],v=t[2],g=r[0],m=r[1],k=r[2],T=n[0],b=n[1],S=n[2];return fn>Math.abs(p-T)&&fn>Math.abs(y-b)&&fn>Math.abs(v-S)?mn(e):(d=1/Math.hypot(l=p-T,h=y-b,f=v-S),(d=Math.hypot(i=m*(f*=d)-k*(h*=d),o=k*(l*=d)-g*f,a=g*h-m*l))?(i*=d=1/d,o*=d,a*=d):(i=0,o=0,a=0),(d=Math.hypot(s=h*a-f*o,u=f*i-l*a,c=l*o-h*i))?(s*=d=1/d,u*=d,c*=d):(s=0,u=0,c=0),e[0]=i,e[1]=s,e[2]=l,e[3]=0,e[4]=o,e[5]=u,e[6]=h,e[7]=0,e[8]=a,e[9]=c,e[10]=f,e[11]=0,e[12]=-(i*p+o*y+a*v),e[13]=-(s*p+u*y+c*v),e[14]=-(l*p+h*y+f*v),e[15]=1,e)}function On(){var e=new dn(3);return dn!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function In(e){var t=new dn(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function Rn(e){return Math.hypot(e[0],e[1],e[2])}function Ln(e,t,n){var r=new dn(3);return r[0]=e,r[1]=t,r[2]=n,r}function Dn(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function Un(e,t,n,r){return e[0]=t,e[1]=n,e[2]=r,e}function Fn(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}function Bn(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e}function Vn(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e}function jn(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e}function Gn(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e[2]=t[2]+n[2]*r,e}function zn(e,t){var n=t[0],r=t[1],i=t[2],o=n*n+r*r+i*i;return o>0&&(o=1/Math.sqrt(o)),e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o,e}function Hn(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Wn(e,t,n){var r=t[0],i=t[1],o=t[2],a=n[0],s=n[1],u=n[2];return e[0]=i*u-o*s,e[1]=o*a-r*u,e[2]=r*s-i*a,e}function Yn(e,t,n,r){var i=t[0],o=t[1],a=t[2];return e[0]=i+r*(n[0]-i),e[1]=o+r*(n[1]-o),e[2]=a+r*(n[2]-a),e}function qn(e,t,n){var r=t[0],i=t[1],o=t[2],a=n[3]*r+n[7]*i+n[11]*o+n[15];return e[0]=(n[0]*r+n[4]*i+n[8]*o+n[12])/(a=a||1),e[1]=(n[1]*r+n[5]*i+n[9]*o+n[13])/a,e[2]=(n[2]*r+n[6]*i+n[10]*o+n[14])/a,e}function Xn(e,t,n){var r=n[0],i=n[1],o=n[2],a=t[0],s=t[1],u=t[2],c=i*u-o*s,l=o*a-r*u,h=r*s-i*a,f=i*h-o*l,d=o*c-r*h,p=r*l-i*c,y=2*n[3];return l*=y,h*=y,d*=2,p*=2,e[0]=a+(c*=y)+(f*=2),e[1]=s+l+d,e[2]=u+h+p,e}function Kn(e,t){var n=e[0],r=e[1],i=e[2],o=t[0],a=t[1],s=t[2];return fn*Math.max(1,Math.abs(n),Math.abs(o))>=Math.abs(n-o)&&fn*Math.max(1,Math.abs(r),Math.abs(a))>=Math.abs(r-a)&&fn*Math.max(1,Math.abs(i),Math.abs(s))>=Math.abs(i-s)}var Zn,Jn=Bn,Qn=Vn,$n=function(e,t){return Math.hypot(t[0]-e[0],t[1]-e[1],t[2]-e[2])},er=Rn;Zn=On();function tr(){var e=new dn(4);return dn!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function nr(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3];return e[0]=n[0]*r+n[4]*i+n[8]*o+n[12]*a,e[1]=n[1]*r+n[5]*i+n[9]*o+n[13]*a,e[2]=n[2]*r+n[6]*i+n[10]*o+n[14]*a,e[3]=n[3]*r+n[7]*i+n[11]*o+n[15]*a,e}!function(){var e=tr()}();function rr(){var e=new dn(4);return dn!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function ir(e,t,n){var r=Math.sin(n*=.5);return e[0]=r*t[0],e[1]=r*t[1],e[2]=r*t[2],e[3]=Math.cos(n),e}function or(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=n[0],u=n[1],c=n[2],l=n[3];return e[0]=r*l+a*s+i*c-o*u,e[1]=i*l+a*u+o*s-r*c,e[2]=o*l+a*c+r*u-i*s,e[3]=a*l-r*s-i*u-o*c,e}function ar(e,t,n,r){var i,o,a,s,u,c=t[0],l=t[1],h=t[2],f=t[3],d=n[0],p=n[1],y=n[2],v=n[3];return 0>(o=c*d+l*p+h*y+f*v)&&(o=-o,d=-d,p=-p,y=-y,v=-v),1-o>fn?(a=Math.sin(i=Math.acos(o)),s=Math.sin((1-r)*i)/a,u=Math.sin(r*i)/a):(s=1-r,u=r),e[0]=s*c+u*d,e[1]=s*l+u*p,e[2]=s*h+u*y,e[3]=s*f+u*v,e}function sr(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=n*n+r*r+i*i+o*o,s=a?1/a:0;return e[0]=-n*s,e[1]=-r*s,e[2]=-i*s,e[3]=o*s,e}function ur(e,t,n,r){var i=.5*Math.PI/180;n*=i,r*=i;var o=Math.sin(t*=i),a=Math.cos(t),s=Math.sin(n),u=Math.cos(n),c=Math.sin(r),l=Math.cos(r);return e[0]=o*u*l-a*s*c,e[1]=a*s*l+o*u*c,e[2]=a*u*c-o*s*l,e[3]=a*u*l+o*s*c,e}var cr,lr,hr,fr,dr,pr,yr=function(e,t,n,r){var i=new dn(4);return i[0]=e,i[1]=t,i[2]=n,i[3]=r,i},vr=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},gr=or,mr=function(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=n*n+r*r+i*i+o*o;return a>0&&(a=1/Math.sqrt(a)),e[0]=n*a,e[1]=r*a,e[2]=i*a,e[3]=o*a,e};cr=On(),lr=Ln(1,0,0),hr=Ln(0,1,0),fr=rr(),dr=rr(),pr=pn();!function(){var e,t=(e=new dn(2),dn!=Float32Array&&(e[0]=0,e[1]=0),e)}();function kr(e,t,n){return n?Math.min(e,t)===e?t:Math.max(e,n)===e?n:e:Math.max(e,t)===t?e:t}function Tr(e){return void 0===e?0:e>360||-360>e?e%360:e}function br(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return Kt(e)?Ln(e,t,n):Array.isArray(e)&&3===e.length?In(e):Ln(e[0],e[1]||t,e[2]||n)}function Sr(e){return e*(180/Math.PI)}function Er(e){return 360*e}function Pr(e,t){return 16===t.length?function(e,t){var n,r,i=.5*Math.PI,o=Ct(wn(On(),t),3),a=o[0],s=o[1],u=o[2],c=Math.asin(-t[2]/a);return i>c?c>-i?(n=Math.atan2(t[6]/s,t[10]/u),r=Math.atan2(t[1]/a,t[0]/a)):(r=0,n=-Math.atan2(t[4]/s,t[5]/s)):(r=0,n=Math.atan2(t[4]/s,t[5]/s)),e[0]=n,e[1]=c,e[2]=r,e}(e,t):function(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=r*r,s=i*i,u=o*o,c=n*n+a+s+u,l=n*o-r*i;return l>.499995*c?(e[0]=Math.PI/2,e[1]=2*Math.atan2(r,n),e[2]=0):-.499995*c>l?(e[0]=-Math.PI/2,e[1]=2*Math.atan2(r,n),e[2]=0):(e[0]=Math.asin(2*(n*i-o*r)),e[1]=Math.atan2(2*(n*o+r*i),1-2*(s+u)),e[2]=Math.atan2(2*(n*r+i*o),1-2*(a+s))),e}(e,t)}function xr(e,t,n,r,i){var o,a,s,u,c,l,h,f,d,p,y=Math.cos(e),v=Math.sin(e);return o=r*y,a=i*v,s=0,u=-r*v,c=i*y,l=0,h=t,f=n,d=1,(p=new dn(9))[0]=o,p[1]=a,p[2]=s,p[3]=u,p[4]=c,p[5]=l,p[6]=h,p[7]=f,p[8]=d,p}function wr(e,t,n,r,i,o,a){var s=2*o/(r-i),u=(n+t)/(n-t),c=(r+i)/(r-i),l=-(a+o)/(a-o),h=-2*a*o/(a-o);return e[0]=2*o/(n-t),e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=0,e[7]=0,e[8]=u,e[9]=c,e[10]=l,e[11]=-1,e[12]=0,e[13]=0,e[14]=h,e[15]=0,e}function _r(e){var t=e[0],n=e[1],r=e[3],i=e[4],o=Math.sqrt(t*t+n*n),a=Math.sqrt(r*r+i*i);0>t*i-n*r&&(i>t?o=-o:a=-a),o&&(t*=1/o,n*=1/o),a&&(r*=1/a,i*=1/a);var s=Sr(Math.atan2(n,t));return[e[6],e[7],o,a,s]}var Cr=function(e){return"-"===(e=e.replace(/([A-Z])/g,(function(e){return"-".concat(e.toLowerCase())}))).charAt(0)?e.substr(1):e},Nr=function(e){return Math.pow(e,2)},Mr=function(e){return Math.pow(e,3)},Ar=function(e){return Math.pow(e,4)},Or=function(e){return Math.pow(e,5)},Ir=function(e){return Math.pow(e,6)},Rr=function(e){return 1-Math.cos(e*Math.PI/2)},Lr=function(e){return 1-Math.sqrt(1-e*e)},Dr=function(e){return e*e*(3*e-2)},Ur=function(e){for(var t,n=4;e<((t=Math.pow(2,--n))-1)/11;);return 1/Math.pow(4,3-n)-7.5625*Math.pow((3*t-2)/22-e,2)},Fr=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=Ct(t,2),r=n[0],i=void 0===r?1:r,o=n[1],a=void 0===o?.5:o,s=kr(Number(i),1,10),u=kr(Number(a),.1,2);return 0===e||1===e?e:-s*Math.pow(2,10*(e-1))*Math.sin(2*Math.PI*(e-1-u/(2*Math.PI)*Math.asin(1/s))/u)},Br=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0,r=Ct(t,4),i=r[0],o=void 0===i?1:i,a=r[1],s=void 0===a?100:a,u=r[2],c=void 0===u?10:u,l=r[3],h=void 0===l?0:l;o=kr(o,.1,1e3),s=kr(s,.1,1e3),c=kr(c,.1,1e3),h=kr(h,.1,1e3);var f=Math.sqrt(s/o),d=c/(2*Math.sqrt(s*o)),p=1>d?f*Math.sqrt(1-d*d):0,y=1,v=1>d?(d*f-h)/p:-h+f,g=n?n*e/1e3:e;return g=1>d?Math.exp(-g*d*f)*(y*Math.cos(p*g)+v*Math.sin(p*g)):(y+v*g)*Math.exp(-g*f),0===e||1===e?e:1-g},Vr=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=Ct(t,2),r=n[0],i=void 0===r?10:r,o=n[1],a="start"==o?Math.ceil:Math.floor;return a(kr(e,0,1)*i)/i},jr=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=Ct(t,4),r=n[0],i=n[1],o=n[2],a=n[3];return hn(r,i,o,a)(e)},Gr=hn(.42,0,1,1),zr=function(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0;return 1-e(1-t,n,r)}},Hr=function(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0;return.5>t?e(2*t,n,r)/2:1-e(-2*t+2,n,r)/2}},Wr=function(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0;return.5>t?(1-e(1-2*t,n,r))/2:(e(2*t-1,n,r)+1)/2}},Yr={steps:Vr,"step-start":function(e){return Vr(e,[1,"start"])},"step-end":function(e){return Vr(e,[1,"end"])},linear:function(e){return e},"cubic-bezier":jr,ease:function(e){return jr(e,[.25,.1,.25,1])},in:Gr,out:zr(Gr),"in-out":Hr(Gr),"out-in":Wr(Gr),"in-quad":Nr,"out-quad":zr(Nr),"in-out-quad":Hr(Nr),"out-in-quad":Wr(Nr),"in-cubic":Mr,"out-cubic":zr(Mr),"in-out-cubic":Hr(Mr),"out-in-cubic":Wr(Mr),"in-quart":Ar,"out-quart":zr(Ar),"in-out-quart":Hr(Ar),"out-in-quart":Wr(Ar),"in-quint":Or,"out-quint":zr(Or),"in-out-quint":Hr(Or),"out-in-quint":Wr(Or),"in-expo":Ir,"out-expo":zr(Ir),"in-out-expo":Hr(Ir),"out-in-expo":Wr(Ir),"in-sine":Rr,"out-sine":zr(Rr),"in-out-sine":Hr(Rr),"out-in-sine":Wr(Rr),"in-circ":Lr,"out-circ":zr(Lr),"in-out-circ":Hr(Lr),"out-in-circ":Wr(Lr),"in-back":Dr,"out-back":zr(Dr),"in-out-back":Hr(Dr),"out-in-back":Wr(Dr),"in-bounce":Ur,"out-bounce":zr(Ur),"in-out-bounce":Hr(Ur),"out-in-bounce":Wr(Ur),"in-elastic":Fr,"out-elastic":zr(Fr),"in-out-elastic":Hr(Fr),"out-in-elastic":Wr(Fr),spring:Br,"spring-in":Br,"spring-out":zr(Br),"spring-in-out":Hr(Br),"spring-out-in":Wr(Br)},qr=function(e){return Yr[function(e){return Cr(e).replace(/^ease-/,"").replace(/(\(|\s).+/,"").toLowerCase().trim()}(e)]||Yr.linear},Xr=function(e){if(e.isRejected||e.isFulfilled)return e;var t,n=!0,r=!1,i=!1,o=e.then((function(e){return i=!0,n=!1,t=e,e}),(function(e){throw r=!0,n=!1,e}));return o.isFulfilled=function(){return i},o.isPending=function(){return n},o.isRejected=function(){return r},o.getFullFilledValue=function(){return t},o},Kr=yt((function e(){var t=this;dt(this,e),this.resolve=void 0,this.reject=void 0,this.promise=new Promise((function(e,n){t.resolve=e,t.reject=n}))})),Zr={keys:Object.keys,values:Object.values,entries:Object.entries};function Jr(e,t){if(nn)return document.defaultView.getComputedStyle(e,null).getPropertyValue(t)}function Qr(e){var t=Jr(e,"width");return"auto"===t?e.offsetWidth:parseFloat(t)}function $r(e){var t=Jr(e,"height");return"auto"===t?e.offsetHeight:parseFloat(t)}var ei={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"};function ti(e){var t=e.type,n=e.value;return"hex"===t?"#".concat(n):"literal"===t?n:"rgb"===t?"rgb(".concat(n.join(","),")"):"rgba(".concat(n.join(","),")")}var ni,ri=function(){var e=/^(linear\-gradient)/i,t=/^(repeating\-linear\-gradient)/i,n=/^(radial\-gradient)/i,r=/^(repeating\-radial\-gradient)/i,i=/^(conic\-gradient)/i,o=/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,a=/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,s=/^(left|center|right|top|bottom)/i,u=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,c=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,l=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,h=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,f=/^\(/,d=/^\)/,p=/^,/,y=/^\#([0-9a-fA-F]+)/,v=/^([a-zA-Z]+)/,g=/^rgb/i,m=/^rgba/i,k=/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/,T="";function b(e){throw Error(T+": "+e)}function S(){var e=O(E);return T.length>0&&b("Invalid input not EOF"),e}function E(){return P("linear-gradient",e,w)||P("repeating-linear-gradient",t,w)||P("radial-gradient",n,_)||P("repeating-radial-gradient",r,_)||P("conic-gradient",i,_)}function P(e,t,n){return x(t,(function(t){var r=n();return r&&(F(p)||b("Missing comma before color stops")),{type:e,orientation:r,colorStops:O(I)}}))}function x(e,t){var n=F(e);if(n){F(f)||b("Missing (");var r=t(n);return F(d)||b("Missing )"),r}}function w(){return U("directional",o,1)||U("angular",h,1)}function _(){var e,t,n=C();return n&&((e=[]).push(n),t=T,F(p)&&((n=C())?e.push(n):T=t)),e}function C(){var e=function(){var e=U("shape",/^(circle)/i,0);e&&(e.style=D()||N());return e}()||function(){var e=U("shape",/^(ellipse)/i,0);e&&(e.style=L()||N());return e}();if(e)e.at=M();else{var t=N();if(t){e=t;var n=M();n&&(e.at=n)}else{var r=A();r&&(e={type:"default-radial",at:r})}}return e}function N(){return U("extent-keyword",a,1)}function M(){if(U("position",/^at/,0)){var e=A();return e||b("Missing positioning value"),e}}function A(){var e={x:L(),y:L()};if(e.x||e.y)return{type:"position",value:e}}function O(e){var t=e(),n=[];if(t)for(n.push(t);F(p);)(t=e())?n.push(t):b("One extra comma");return n}function I(){var e=U("hex",y,1)||x(m,(function(){return{type:"rgba",value:O(R)}}))||x(g,(function(){return{type:"rgb",value:O(R)}}))||U("literal",v,0);return e||b("Expected color definition"),e.length=L(),e}function R(){return F(k)[1]}function L(){return U("%",c,1)||U("position-keyword",s,1)||D()}function D(){return U("px",u,1)||U("em",l,1)}function U(e,t,n){var r=F(t);if(r)return{type:e,value:r[n]}}function F(e){var t=/^[\n\r\t\s]+/.exec(T);t&&B(t[0].length);var n=e.exec(T);return n&&B(n[0].length),n}function B(e){T=T.substring(e)}return function(e){return T=e,S()}}();(ni=e.PropertySyntax||(e.PropertySyntax={})).COORDINATE="<coordinate>",ni.COLOR="<color>",ni.PAINT="<paint>",ni.NUMBER="<number>",ni.ANGLE="<angle>",ni.OPACITY_VALUE="<opacity-value>",ni.SHADOW_BLUR="<shadow-blur>",ni.LENGTH="<length>",ni.PERCENTAGE="<percentage>",ni.LENGTH_PERCENTAGE="<length> | <percentage>",ni.LENGTH_PERCENTAGE_12="[<length> | <percentage>]{1,2}",ni.LENGTH_PERCENTAGE_14="[<length> | <percentage>]{1,4}",ni.LIST_OF_POINTS="<list-of-points>",ni.PATH="<path>",ni.FILTER="<filter>",ni.Z_INDEX="<z-index>",ni.OFFSET_PATH="<offset-path>",ni.OFFSET_DISTANCE="<offset-distance>",ni.CLIP_PATH="<clip-path>",ni.TRANSFORM="<transform>",ni.TRANSFORM_ORIGIN="<transform-origin>",ni.TEXT="<text>",ni.TEXT_TRANSFORM="<text-transform>";var ii=e.Syringe.defineToken("StyleValueRegistry"),oi=function(e){return e};function ai(e,t){return function(n){if(n>=1)return 1;var r=1/e;return(n+=t*r)-n%r}}var si=/cubic-bezier\(\s*(-?\d+\.?\d*|-?\.\d+)\s*,\s*(-?\d+\.?\d*|-?\.\d+)\s*,\s*(-?\d+\.?\d*|-?\.\d+)\s*,\s*(-?\d+\.?\d*|-?\.\d+)\s*\)/,ui=/steps\(\s*(\d+)\s*\)/,ci=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/;function li(e){var t=si.exec(e);if(t)return hn.apply(void 0,Nt(t.slice(1).map(Number)));var n=ui.exec(e);if(n)return ai(Number(n[1]),0);var r=ci.exec(e);return r?ai(Number(r[1]),{start:1,middle:.5,end:0}[r[2]]):qr(e)}function hi(e){return Math.abs(function(e){var t;if(0===e.duration||0===e.iterations)return 0;return("auto"===e.duration?0:Number(e.duration))*(null!==(t=e.iterations)&&void 0!==t?t:1)}(e)/(e.playbackRate||1))}function fi(e,t,n){var r=function(e,t,n){if(null===t)return 0;var r=n.endTime;return Math.min(n.delay,r)>t?1:Math.min(n.delay+e+n.endDelay,r)>t?3:2}(e,t,n),i=function(e,t,n,r,i){switch(r){case 1:return"backwards"===t||"both"===t?0:null;case 3:return n-i;case 2:return"forwards"===t||"both"===t?e:null;case 0:return null}}(e,n.fill,t,r,n.delay);if(null===i)return null;var o="auto"===n.duration?0:n.duration,a=function(e,t,n,r,i){var o=i;return 0===e?1!==t&&(o+=n):o+=r/e,o}(o,r,n.iterations,i,n.iterationStart),s=function(e,t,n,r,i,o){var a=e===1/0?t%1:e%1;return 0!==a||2!==n||0===r||0===i&&0!==o||(a=1),a}(a,n.iterationStart,r,n.iterations,i,o),u=function(e,t,n,r){return 2===e&&t===1/0?1/0:1===n?Math.floor(r)-1:Math.floor(r)}(r,n.iterations,s,a),c=function(e,t,n){var r=e;if("normal"!==e&&"reverse"!==e){var i=t;"alternate-reverse"===e&&(i+=1),r="normal",i!==1/0&&i%2!=0&&(r="reverse")}return"normal"===r?n:1-n}(n.direction,u,s);return n.currentIteration=u,n.progress=c,n.easingFunction(c)}var di={};function pi(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return di[e]||(di[e]=e.replace(/-([a-z])/g,(function(e){return e[1].toUpperCase()}))),di[e]}function yi(e){return!Xt(e)&&"string"==typeof e}function vi(e,t,n){var r=function(e,t){for(var n={},r=0;e.length>r;r++)for(var i in e[r])if(gi(i)){var o={offset:e[r].offset,computedOffset:e[r].computedOffset,easing:e[r].easing,easingFunction:li(e[r].easing)||t.easingFunction,value:e[r][i]};n[i]=n[i]||[],n[i].push(o)}return n}(e,t),i=function(e,t){var n=[];for(var r in e)for(var i=e[r],o=0;i.length-1>o;o++){var a=o,s=o+1,u=i[a].computedOffset,c=i[s].computedOffset,l=u,h=c;0===o&&(l=-1/0,0===c&&(s=a)),o===i.length-2&&(h=1/0,1===u&&(a=s)),n.push({applyFrom:l,applyTo:h,startOffset:i[a].computedOffset,endOffset:i[s].computedOffset,easingFunction:i[a].easingFunction,property:r,interpolation:ki(r,i[a].value,i[s].value,t)})}return n.sort((function(e,t){return e.startOffset-t.startOffset})),n}(r,n);return function(e,t){if(null!==t)i.filter((function(e){return t>=e.applyFrom&&e.applyTo>t})).forEach((function(n){var r=n.endOffset-n.startOffset,i=0===r?0:n.easingFunction((t-n.startOffset)/r);e.style[n.property]=n.interpolation(i)}));else for(var n in r)gi(n)&&(e.style[n]=null)}}function gi(e){return"offset"!==e&&"easing"!==e&&"composite"!==e&&"computedOffset"!==e}var mi=function(e,t,n){return function(r){return n(Ti(e,t,r))}};function ki(e,t,n,r){var i=t,o=n,a=Ve.get(ii),s=a.getMetadata(e);if(s&&s.syntax&&s.interpolable){var u=a.getPropertySyntax(s.syntax);if(u){u.parser&&(i=u.parser(t,r),o=u.parser(n,r));var c=u.mixer(i,o,r);if(c){var l=mi.apply(void 0,Nt(c));return function(e){return 0===e?t:1===e?n:l(e)}}}}return mi(!1,!0,(function(e){return e?n:t}))}function Ti(e,t,n){if("number"==typeof e&&"number"==typeof t)return e*(1-n)+t*n;if("boolean"==typeof e&&"boolean"==typeof t||"string"==typeof e&&"string"==typeof t)return.5>n?e:t;if(Array.isArray(e)&&Array.isArray(t)&&e.length===t.length){for(var r=[],i=0;e.length>i;i++)r.push(Ti(e[i],t[i],n));return r}throw Error("Mismatched interpolation arguments "+e+":"+t)}var bi={d:{alias:"path"},strokeDasharray:{alias:"lineDash"},strokeWidth:{alias:"lineWidth"},textAnchor:{alias:"textAlign",values:{middle:"center"}},src:{alias:"img"}};function Si(e,t){var n,r=pi(e),i=bi[r];return[r=(null==i?void 0:i.alias)||r,(null==i||null===(n=i.values)||void 0===n?void 0:n[t])||t]}function Ei(e){return function(e){if(Array.isArray(e))return Pi(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Pi(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Pi(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Pi(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);t>n;n++)r[n]=e[n];return r}function xi(e,t,n,r){var i=e-n,o=t-r;return Math.sqrt(i*i+o*o)}function wi(e,t){return.001>Math.abs(e-t)}function _i(e,t){var n=Math.min.apply(Math,Ei(e)),r=Math.min.apply(Math,Ei(t));return{x:n,y:r,width:Math.max.apply(Math,Ei(e))-n,height:Math.max.apply(Math,Ei(t))-r}}var Ci={box:function(e,t,n,r){return _i([e,n],[t,r])},length:function(e,t,n,r){return xi(e,t,n,r)},pointAt:function(e,t,n,r,i){return{x:(1-i)*e+i*n,y:(1-i)*t+i*r}},pointDistance:function(e,t,n,r,i,o){var a=(n-e)*(i-e)+(r-t)*(o-t);return 0>a?xi(e,t,i,o):a>(n-e)*(n-e)+(r-t)*(r-t)?xi(n,r,i,o):this.pointToLine(e,t,n,r,i,o)},pointToLine:function(e,t,n,r,i,o){var a=[n-e,r-t];if(function(e,t){return e[0]===t[0]&&e[1]===t[1]}(a,[0,0]))return Math.sqrt((i-e)*(i-e)+(o-t)*(o-t));var s=[-a[1],a[0]];return function(e,t){var n=t[0],r=t[1],i=n*n+r*r;i>0&&(i=1/Math.sqrt(i)),e[0]=t[0]*i,e[1]=t[1]*i}(s,s),Math.abs(function(e,t){return e[0]*t[0]+e[1]*t[1]}([i-e,o-t],s))},tangentAngle:function(e,t,n,r){return Math.atan2(r-t,n-e)}};function Ni(e,t,n,r,i){var o=1-i;return o*o*o*e+3*t*i*o*o+3*n*i*i*o+r*i*i*i}function Mi(e,t,n,r,i){var o=1-i;return 3*(o*o*(t-e)+2*o*i*(n-t)+i*i*(r-n))}function Ai(e,t,n,r){var i,o,a,s=-3*e+9*t-9*n+3*r,u=6*e-12*t+6*n,c=3*t-3*e,l=[];if(wi(s,0))wi(u,0)||0>(i=-c/u)||i>1||l.push(i);else{var h=u*u-4*s*c;wi(h,0)?l.push(-u/(2*s)):h>0&&(o=(-u-(a=Math.sqrt(h)))/(2*s),0>(i=(-u+a)/(2*s))||i>1||l.push(i),0>o||o>1||l.push(o))}return l}function Oi(e,t,n,r,i,o,a,s,u){var c=Ni(e,n,i,a,u),l=Ni(t,r,o,s,u),h=Ci.pointAt(e,t,n,r,u),f=Ci.pointAt(n,r,i,o,u),d=Ci.pointAt(i,o,a,s,u),p=Ci.pointAt(h.x,h.y,f.x,f.y,u),y=Ci.pointAt(f.x,f.y,d.x,d.y,u);return[[e,t,h.x,h.y,p.x,p.y,c,l],[c,l,y.x,y.y,d.x,d.y,a,s]]}function Ii(e,t,n,r,i,o,a,s,u){if(0===u)return function(e,t){for(var n=0,r=e.length,i=0;r>i;i++)n+=xi(e[i],t[i],e[(i+1)%r],t[(i+1)%r]);return n/2}([e,n,i,a],[t,r,o,s]);var c=Oi(e,t,n,r,i,o,a,s,.5),l=[].concat(Ei(c[0]),[u-1]),h=[].concat(Ei(c[1]),[u-1]);return Ii.apply(void 0,Ei(l))+Ii.apply(void 0,Ei(h))}var Ri={extrema:Ai,box:function(e,t,n,r,i,o,a,s){for(var u=[e,a],c=[t,s],l=Ai(e,n,i,a),h=Ai(t,r,o,s),f=0;l.length>f;f++)u.push(Ni(e,n,i,a,l[f]));for(var d=0;h.length>d;d++)c.push(Ni(t,r,o,s,h[d]));return _i(u,c)},length:function(e,t,n,r,i,o,a,s){return Ii(e,t,n,r,i,o,a,s,3)},nearestPoint:function(e,t,n,r,i,o,a,s,u,c,l){return function(e,t,n,r,i,o){var a=-1,s=1/0,u=[n,r],c=20;o&&o>200&&(c=o/10);for(var l=1/c,h=l/10,f=0;c>=f;f++){var d=f*l,p=[i.apply(void 0,Ei(e.concat([d]))),i.apply(void 0,Ei(t.concat([d])))],y=xi(u[0],u[1],p[0],p[1]);s>y&&(a=d,s=y)}if(0===a)return{x:e[0],y:t[0]};if(1===a){var v=e.length;return{x:e[v-1],y:t[v-1]}}s=1/0;for(var g=0;32>g&&h>=1e-4;g++){var m=a-h,k=a+h,T=[i.apply(void 0,Ei(e.concat([m]))),i.apply(void 0,Ei(t.concat([m])))],b=xi(u[0],u[1],T[0],T[1]);if(m>=0&&s>b)a=m,s=b;else{var S=[i.apply(void 0,Ei(e.concat([k]))),i.apply(void 0,Ei(t.concat([k])))],E=xi(u[0],u[1],S[0],S[1]);1>=k&&s>E?(a=k,s=E):h*=.5}}return{x:i.apply(void 0,Ei(e.concat([a]))),y:i.apply(void 0,Ei(t.concat([a])))}}([e,n,i,a],[t,r,o,s],u,c,Ni,l)},pointDistance:function(e,t,n,r,i,o,a,s,u,c,l){var h=this.nearestPoint(e,t,n,r,i,o,a,s,u,c,l);return xi(h.x,h.y,u,c)},interpolationAt:Ni,pointAt:function(e,t,n,r,i,o,a,s,u){return{x:Ni(e,n,i,a,u),y:Ni(t,r,o,s,u)}},divide:function(e,t,n,r,i,o,a,s,u){return Oi(e,t,n,r,i,o,a,s,u)},tangentAngle:function(e,t,n,r,i,o,a,s,u){var c=Mi(e,n,i,a,u),l=Mi(t,r,o,s,u);return(Math.atan2(l,c)+2*Math.PI)%(2*Math.PI)}};var Li,Di=function(e){return function(e){if(2>e.length)return 0;for(var t=0,n=0;e.length-1>n;n++){var r=e[n],i=e[n+1];t+=xi(r[0],r[1],i[0],i[1])}return t}(e)};(Li=e.Shape||(e.Shape={})).GROUP="g",Li.CIRCLE="circle",Li.ELLIPSE="ellipse",Li.IMAGE="image",Li.RECT="rect",Li.LINE="line",Li.POLYLINE="polyline",Li.POLYGON="polygon",Li.TEXT="text",Li.PATH="path",Li.HTML="html",Li.MESH="mesh";var Ui=e.Syringe.defineToken("CanvasConfig");function Fi(e,t,n){var r=e[0],i=e[1];return[r+(t[0]-r)*n,i+(t[1]-i)*n]}function Bi(e){return e.map((function(e,t,n){var r,i=t&&n[t-1].slice(-2).concat(e.slice(1)),o=t?Ri.length.apply(Ri,Nt(i)):0;return r=t?o?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,n=e.slice(0,2),r=e.slice(2,4),i=e.slice(4,6),o=e.slice(6,8),a=Fi(n,r,t),s=Fi(r,i,t),u=Fi(i,o,t),c=Fi(a,s,t),l=Fi(s,u,t),h=Fi(c,l,t);return[["C"].concat(a,c,h),["C"].concat(l,u,o)]}(i):[e,e]:[e],{s:e,ss:r,l:o}}))}function Vi(e,t,n){var r=Bi(e),i=Bi(t),o=r.length,a=i.length,s=r.filter((function(e){return e.l})).length,u=i.filter((function(e){return e.l})).length,c=r.filter((function(e){return e.l})).reduce((function(e,t){return e+t.l}),0)/s||0,l=i.filter((function(e){return e.l})).reduce((function(e,t){return e+t.l}),0)/u||0,h=n||Math.max(o,a),f=[c,l],d=[h-o,h-a],p=0,y=[r,i].map((function(e,t){return e.l===h?e.map((function(e){return e.s})):e.map((function(e,n){return d[t]-=(p=n&&d[t]&&e.l>=f[t])?1:0,p?e.ss:[e.s]})).flat()}));return y[0].length===y[1].length?y:Vi(y[0],y[1],h)}function ji(e){return zi(e)>=0}function Gi(e,t,n,r,i,o,a,s){return 3*((s-t)*(n+i)-(a-e)*(r+o)+r*(e-i)-n*(t-o)+s*(i+e/3)-a*(o+t/3))/20}function zi(e){var t=0,n=0,r=0,i=0,o=0;return e.map((function(e){switch(e[0]){case"M":case"Z":return t=r="M"===e[0]?e[1]:r,n=i="M"===e[0]?e[2]:i,0;default:o=Gi.apply(0,[t,n].concat(e.slice(1)));var a=Ct(e.slice(-2),2);return t=a[0],n=a[1],o}})).reduce((function(e,t){return e+t}),0)}function Hi(e){var t=e.slice(1).map((function(t,n,r){return n?r[n-1].slice(-2).concat(t.slice(1)):e[0].slice(1).concat(t.slice(1))})).map((function(e){return e.map((function(t,n){return e[e.length-n-2*(1-n%2)]}))})).reverse();return[["M"].concat(t[0].slice(0,2))].concat(t.map((function(e){return["C"].concat(e.slice(2))})))}function Wi(e){return e.map((function(e){return Array.isArray(e)?Wi(e):Number.isNaN(+e)?e:+e}))}function Yi(e,t){var n=e.length-1,r=[],i=0,o=function(e){var t=e.length,n=t-1;return e.map((function(r,i){return e.map((function(r,o){var a=i+o;return 0===o||e[a]&&"M"===e[a][0]?["M"].concat(e[a].slice(-2)):(t>a||(a-=n),e[a])}))}))}(e);return o.forEach((function(o,a){e.slice(1).forEach((function(r,o){i+=function(e,t){return Math.sqrt((e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1]))}(e[(a+o)%n].slice(-2),t[o%n].slice(-2))})),r[a]=i,i=0})),o[r.indexOf(Math.min.apply(null,r))]}function qi(e,t){var n,r=2>=arguments.length||void 0===arguments[2]||arguments[2];r&&(n=t.getLocalTransform());var i=t.parsedStyle,o=i.defX,a=void 0===o?0:o,s=i.defY,u=void 0===s?0:s;return e.reduce((function(e,t){var i="";if("M"===t[0]||"L"===t[0]){var o=Ln(t[1]-a,t[2]-u,0);r&&qn(o,o,n),i="".concat(t[0]).concat(o[0],",").concat(o[1])}else if("Z"===t[0])i=t[0];else if("C"===t[0]){var s=Ln(t[1]-a,t[2]-u,0),c=Ln(t[3]-a,t[4]-u,0),l=Ln(t[5]-a,t[6]-u,0);r&&(qn(s,s,n),qn(c,c,n),qn(l,l,n)),i="".concat(t[0]).concat(s[0],",").concat(s[1],",").concat(c[0],",").concat(c[1],",").concat(l[0],",").concat(l[1])}else if("A"===t[0]){var h=Ln(t[6]-a,t[7]-u,0);r&&qn(h,h,n),i="".concat(t[0]).concat(t[1],",").concat(t[2],",").concat(t[3],",").concat(t[4],",").concat(t[5],",").concat(h[0],",").concat(h[1])}return e+i}),"")}function Xi(e,t,n,r){return[["M",e,t],["L",n,r]]}function Ki(e,t,n,r){var i=.5522847498307936,o=e*i,a=t*i,s=n-e,u=n+e,c=r-t,l=r+t;return[["M",s,r],["C",s,r-a,n-o,c,n,c],["C",n+o,c,u,r-a,u,r],["C",u,r+a,n+o,l,n,l],["C",n-o,l,s,r+a,s,r],["Z"]]}function Zi(e,t){var n=e.map((function(e,t){return[0===t?"M":"L",e[0],e[1]]}));return t&&n.push(["Z"]),n}function Ji(e,t,n,r,i){if(i){var o=Ct(i,4),a=o[0],s=o[1],u=o[2],c=o[3],l=e>0?1:-1,h=t>0?1:-1,f=l+h!==0?1:0;return[["M",l*a+n,r],["L",e-l*s+n,r],s?["A",s,s,0,0,f,e+n,h*s+r]:null,["L",e+n,t-h*u+r],u?["A",u,u,0,0,f,e+n-l*u,t+r]:null,["L",n+l*c,t+r],c?["A",c,c,0,0,f,n,t+r-h*c]:null,["L",n,h*a+r],a?["A",a,a,0,0,f,l*a+n,r]:null,["Z"]].filter((function(e){return e}))}return[["M",n,r],["L",n+e,r],["L",n+e,r+t],["L",n,r+t],["Z"]]}var Qi=function(){return this.call=this._createCall("sync"),this.call.apply(this,arguments)},$i=function(){return this.callAsync=this._createCall("async"),this.callAsync.apply(this,arguments)},eo=function(){return this.promise=this._createCall("promise"),this.promise.apply(this,arguments)},to=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;dt(this,e),this.name=void 0,this.taps=void 0,this.promise=void 0,this._promise=void 0,this._args=t,this.name=n,this.taps=[],this.interceptors=[],this._call=Qi,this.call=Qi,this._callAsync=$i,this.callAsync=$i,this._promise=eo,this.promise=eo,this._x=void 0}return yt(e,[{key:"compile",value:function(e){throw Error("Abstract: should be overridden")}},{key:"_createCall",value:function(e){return this.compile({taps:this.taps,interceptors:this.interceptors,args:this._args,type:e})}},{key:"_tap",value:function(e,t,n){if("string"==typeof t)t={name:t.trim()};else if("object"!==lt(t)||null===t)throw Error("Invalid tap options");if("string"!=typeof t.name||""===t.name)throw Error("Missing name for tap");t=Object.assign({type:e,fn:n},t),t=this._runRegisterInterceptors(t),this._insert(t)}},{key:"tap",value:function(e,t){this._tap("sync",e,t)}},{key:"tapAsync",value:function(e,t){this._tap("async",e,t)}},{key:"tapPromise",value:function(e,t){this._tap("promise",e,t)}},{key:"_runRegisterInterceptors",value:function(e){var t,n=Ot(this.interceptors);try{for(n.s();!(t=n.n()).done;){var r=t.value;if(r.register){var i=r.register(e);void 0!==i&&(e=i)}}}catch(e){n.e(e)}finally{n.f()}return e}},{key:"withOptions",value:function(e){var t=this,n=function(t){return Object.assign({},e,"string"==typeof t?{name:t}:t)};return{name:this.name,tap:function(e,r){return t.tap(n(e),r)},tapAsync:function(e,r){return t.tapAsync(n(e),r)},tapPromise:function(e,r){return t.tapPromise(n(e),r)},isUsed:function(){return t.isUsed()},withOptions:function(e){return t.withOptions(n(e))}}}},{key:"isUsed",value:function(){return this.taps.length>0||this.interceptors.length>0}},{key:"_resetCompilation",value:function(){this.call=this._call,this.callAsync=this._callAsync,this.promise=this._promise}},{key:"_insert",value:function(e){var t;this._resetCompilation(),"string"==typeof e.before?t=new Set([e.before]):Array.isArray(e.before)&&(t=new Set(e.before));var n=0;"number"==typeof e.stage&&(n=e.stage);for(var r=this.taps.length;r>0;){r--;var i=this.taps[r];this.taps[r+1]=i;var o=i.stage||0;if(t){if(t.has(i.name)){t.delete(i.name);continue}if(t.size>0)continue}if(n>=o){r++;break}}this.taps[r]=e}}]),e}(),no=function(){function e(t){dt(this,e),this.config=t,this.options=void 0,this._args=void 0}return yt(e,[{key:"create",value:function(e){var t;switch(this.init(e),this.options.type){case"sync":t=Function(this.args(),'"use strict";\n'+this.header()+this.contentWithInterceptors({onError:function(e){return"throw ".concat(e,";\n")},onResult:function(e){return"return ".concat(e,";\n")},resultReturns:!0,onDone:function(){return""},rethrowIfPossible:!0}));break;case"async":t=Function(this.args({after:"_callback"}),'"use strict";\n'+this.header()+this.contentWithInterceptors({onError:function(e){return"_callback(".concat(e,");\n")},onResult:function(e){return"_callback(null, ".concat(e,");\n")},onDone:function(){return"_callback();\n"}}));break;case"promise":var n=!1,r=this.contentWithInterceptors({onError:function(e){return n=!0,"_error(".concat(e,");\n")},onResult:function(e){return"_resolve(".concat(e,");\n")},onDone:function(){return"_resolve();\n"}}),i="";i+='"use strict";\n',i+=this.header(),i+="return new Promise((function(_resolve, _reject) {\n",n&&(i+="var _sync = true;\n",i+="function _error(_err) {\n",i+="if(_sync)\n",i+="_resolve(Promise.resolve().then((function() { throw _err; })));\n",i+="else\n",i+="_reject(_err);\n",i+="};\n"),i+=r,n&&(i+="_sync = false;\n"),i+="}));\n",t=Function(this.args(),i)}return this.deinit(),t}},{key:"setup",value:function(e,t){e._x=t.taps.map((function(e){return e.fn}))}},{key:"init",value:function(e){this.options=e,this._args=e.args.slice()}},{key:"deinit",value:function(){this.options=void 0,this._args=void 0}},{key:"contentWithInterceptors",value:function(e){var t=this;if(this.options.interceptors.length>0){for(var n=e.onError,r=e.onResult,i=e.onDone,o="",a=0;this.options.interceptors.length>a;a++){var s=this.options.interceptors[a];s.call&&(o+="".concat(this.getInterceptor(a),".call(").concat(this.args({before:s.context?"_context":void 0}),");\n"))}return o+=this.content(Object.assign(e,{onError:n&&function(e){for(var r="",i=0;t.options.interceptors.length>i;i++){t.options.interceptors[i].error&&(r+="".concat(t.getInterceptor(i),".error(").concat(e,");\n"))}return r+=n(e)},onResult:r&&function(e){for(var n="",i=0;t.options.interceptors.length>i;i++){t.options.interceptors[i].result&&(n+="".concat(t.getInterceptor(i),".result(").concat(e,");\n"))}return n+=r(e)},onDone:i&&function(){for(var e="",n=0;t.options.interceptors.length>n;n++){t.options.interceptors[n].done&&(e+="".concat(t.getInterceptor(n),".done();\n"))}return e+=i()}}))}return this.content(e)}},{key:"header",value:function(){var e="";return this.needContext()?e+="var _context = {};\n":e+="var _context;\n",e+="var _x = this._x;\n",this.options.interceptors.length>0&&(e+="var _taps = this.taps;\n",e+="var _interceptors = this.interceptors;\n"),e}},{key:"needContext",value:function(){var e,t=Ot(this.options.taps);try{for(t.s();!(e=t.n()).done;){if(e.value.context)return!0}}catch(e){t.e(e)}finally{t.f()}return!1}},{key:"callTap",value:function(e,t){for(var n=t.onError,r=t.onResult,i=t.onDone,o=t.rethrowIfPossible,a="",s=!1,u=0;this.options.interceptors.length>u;u++){var c=this.options.interceptors[u];c.tap&&(s||(a+="var _tap".concat(e," = ").concat(this.getTap(e),";\n"),s=!0),a+="".concat(this.getInterceptor(u),".tap(").concat(c.context?"_context, ":"","_tap").concat(e,");\n"))}a+="var _fn".concat(e," = ").concat(this.getTapFn(e),";\n");var l=this.options.taps[e];switch(l.type){case"sync":o||(a+="var _hasError".concat(e," = false;\n"),a+="try {\n"),a+=r?"var _result".concat(e," = _fn").concat(e,"(").concat(this.args({before:l.context?"_context":void 0}),");\n"):"_fn".concat(e,"(").concat(this.args({before:l.context?"_context":void 0}),");\n"),o||(a+="} catch(_err) {\n",a+="_hasError".concat(e," = true;\n"),a+=n("_err"),a+="}\n",a+="if(!_hasError".concat(e,") {\n")),r&&(a+=r("_result".concat(e))),i&&(a+=i()),o||(a+="}\n");break;case"async":var h="";h+=r?"(function(_err".concat(e,", _result").concat(e,") {\n"):"(function(_err".concat(e,") {\n"),h+="if(_err".concat(e,") {\n"),h+=n("_err".concat(e)),h+="} else {\n",r&&(h+=r("_result".concat(e))),i&&(h+=i()),h+="}\n",h+="})",a+="_fn".concat(e,"(").concat(this.args({before:l.context?"_context":void 0,after:h}),");\n");break;case"promise":a+="var _hasResult".concat(e," = false;\n"),a+="var _promise".concat(e," = _fn").concat(e,"(").concat(this.args({before:l.context?"_context":void 0}),");\n"),a+="if (!_promise".concat(e," || !_promise").concat(e,".then)\n"),a+=" throw new Error('Tap function (tapPromise) did not return promise (returned ' + _promise".concat(e," + ')');\n"),a+="_promise".concat(e,".then((function(_result").concat(e,") {\n"),a+="_hasResult".concat(e," = true;\n"),r&&(a+=r("_result".concat(e))),i&&(a+=i()),a+="}), function(_err".concat(e,") {\n"),a+="if(_hasResult".concat(e,") throw _err").concat(e,";\n"),a+=n("_err".concat(e)),a+="});\n"}return a}},{key:"callTapsSeries",value:function(e){var t=this,n=e.onError,r=e.onResult,i=e.resultReturns,o=e.onDone,a=e.doneReturns,s=e.rethrowIfPossible;if(0===this.options.taps.length)return o();for(var u=this.options.taps.findIndex((function(e){return"sync"!==e.type})),c=i||a,l="",h=o,f=0,d=function(e){var i=e;h!==o&&("sync"!==t.options.taps[i].type||f++>20)&&(f=0,l+="function _next".concat(i,"() {\n"),l+=h(),l+="}\n",h=function(){return"".concat(c?"return ":"","_next").concat(i,"();\n")});var a=h,d=function(e){return e?"":o()},p=t.callTap(i,{onError:function(e){return n(i,e,a,d)},onResult:r&&function(e){return r(i,e,a,d)},onDone:!r&&a,rethrowIfPossible:s&&(0>u||u>i)});h=function(){return p}},p=this.options.taps.length-1;p>=0;p--)d(p);return l+=h()}},{key:"callTapsLooping",value:function(e){var t=e.onError,n=e.onDone,r=e.rethrowIfPossible;if(0===this.options.taps.length)return n();var i=this.options.taps.every((function(e){return"sync"===e.type})),o="";i||(o+="var _looper = (function() {\n",o+="var _loopAsync = false;\n"),o+="var _loop;\n",o+="do {\n",o+="_loop = false;\n";for(var a=0;this.options.interceptors.length>a;a++){var s=this.options.interceptors[a];s.loop&&(o+="".concat(this.getInterceptor(a),".loop(").concat(this.args({before:s.context?"_context":void 0}),");\n"))}return o+=this.callTapsSeries({onError:t,onResult:function(e,t,n,r){var o="";return o+="if(".concat(t," !== undefined) {\n"),o+="_loop = true;\n",i||(o+="if(_loopAsync) _looper();\n"),o+=r(!0),o+="} else {\n",o+=n(),o+="}\n"},onDone:n&&function(){var e="";return e+="if(!_loop) {\n",e+=n(),e+="}\n"},rethrowIfPossible:r&&i}),o+="} while(_loop);\n",i||(o+="_loopAsync = true;\n",o+="});\n",o+="_looper();\n"),o}},{key:"callTapsParallel",value:function(e){var t=this,n=e.onError,r=e.onResult,i=e.onDone,o=e.rethrowIfPossible,a=e.onTap,s=void 0===a?function(e,t){return t()}:a;if(1>=this.options.taps.length)return this.callTapsSeries({onError:n,onResult:r,onDone:i,rethrowIfPossible:o});var u="";u+="do {\n",u+="var _counter = ".concat(this.options.taps.length,";\n"),i&&(u+="var _done = (function() {\n",u+=i(),u+="});\n");for(var c=function(e){var a=function(){return i?"if(--_counter === 0) _done();\n":"--_counter;"},c=function(e){return e||!i?"_counter = 0;\n":"_counter = 0;\n_done();\n"};u+="if(_counter <= 0) break;\n",u+=s(e,(function(){return t.callTap(e,{onError:function(t){var r="";return r+="if(_counter > 0) {\n",r+=n(e,t,a,c),r+="}\n"},onResult:r&&function(t){var n="";return n+="if(_counter > 0) {\n",n+=r(e,t,a,c),n+="}\n"},onDone:!r&&function(){return a()},rethrowIfPossible:o})}),a,c)},l=0;this.options.taps.length>l;l++)c(l);return u+="} while(false);\n"}},{key:"args",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.before,n=e.after,r=this._args;return t&&(r=[t].concat(r)),n&&(r=r.concat(n)),0===r.length?"":r.join(", ")}},{key:"getTapFn",value:function(e){return"_x[".concat(e,"]")}},{key:"getTap",value:function(e){return"_taps[".concat(e,"]")}},{key:"getInterceptor",value:function(e){return"_interceptors[".concat(e,"]")}}]),e}(),ro=function(e){gt(n,e);var t=xt(n);function n(){return dt(this,n),t.apply(this,arguments)}return yt(n,[{key:"content",value:function(e){var t=e.onError;return this.callTapsParallel({onError:function(e,n,r,i){return t(n)+i(!0)},onDone:e.onDone})}}]),n}(no),io=new ro,oo=function(e){return io.setup(this,e),io.create(e)},ao=function(e){gt(n,e);var t=xt(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return dt(this,n),(e=t.call(this,r,i)).compile=oo,e._call=void 0,e.call=void 0,e}return yt(n)}(to),so=function(e){gt(n,e);var t=xt(n);function n(){return dt(this,n),t.apply(this,arguments)}return yt(n,[{key:"content",value:function(e){var t=this,n=e.onError,r=e.onResult;return this.callTapsSeries({onError:function(e,t,r,i){return n(t)+i(!0)},onResult:function(e,n,r){var i="";return i+="if(".concat(n," !== undefined) {\n"),i+="".concat(t._args[0]," = ").concat(n,";\n"),i+="}\n",i+=r()},onDone:function(){return r(t._args[0])}})}}]),n}(no),uo=new so,co=function(e){return uo.setup(this,e),uo.create(e)},lo=function(e){gt(n,e);var t=xt(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return dt(this,n),(e=t.call(this,r,i)).compile=co,e._call=void 0,e.call=void 0,e}return yt(n)}(to),ho=function(e){gt(n,e);var t=xt(n);function n(){return dt(this,n),t.apply(this,arguments)}return yt(n,[{key:"content",value:function(e){var t=e.onError;return this.callTapsSeries({onError:function(e,n){return t(n)},onDone:e.onDone,rethrowIfPossible:e.rethrowIfPossible})}}]),n}(no),fo=new ho,po=function(){throw Error("tapAsync is not supported on a SyncHook")},yo=function(){throw Error("tapPromise is not supported on a SyncHook")},vo=function(e){return fo.setup(this,e),fo.create(e)},go=function(e){gt(n,e);var t=xt(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return dt(this,n),(e=t.call(this,r,i)).tapAsync=po,e.tapPromise=yo,e.compile=vo,e}return yt(n)}(to),mo=function(e){gt(n,e);var t=xt(n);function n(){return dt(this,n),t.apply(this,arguments)}return yt(n,[{key:"content",value:function(e){var t=this,n=e.onError,r=e.onResult;return this.callTapsSeries({onError:function(e,t){return n(t)},onResult:function(e,n,r){var i="";return i+="if(".concat(n," !== undefined) {\n"),i+="".concat(t._args[0]," = ").concat(n,";\n"),i+="}\n",i+=r()},onDone:function(){return r(t._args[0])},doneReturns:e.resultReturns,rethrowIfPossible:e.rethrowIfPossible})}}]),n}(no),ko=new mo,To=function(){throw Error("tapAsync is not supported on a SyncWaterfallHook")},bo=function(){throw Error("tapPromise is not supported on a SyncWaterfallHook")},So=function(e){return ko.setup(this,e),ko.create(e)},Eo=function(e){gt(n,e);var t=xt(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return dt(this,n),(e=t.call(this,r,i)).tapAsync=To,e.tapPromise=bo,e.compile=So,e}return yt(n)}(go),Po=["serif","sans-serif","monospace","cursive","fantasy","system-ui"];function xo(e){for(var t=e.fontSize,n=e.fontFamily,r=e.fontStyle,i=e.fontVariant,o=e.fontWeight,a=Kt(t)?"".concat(t,"px"):""+t,s=yi(n)?n.split(","):[n.value],u=s.length-1;u>=0;u--){var c=s[u].trim();!/([\"\'])[^\'\"]+\1/.test(c)&&0>Po.indexOf(c)&&(c='"'.concat(c,'"')),s[u]=c}return"".concat(r," ").concat(i," ").concat(o," ").concat(a," ").concat(s.join(","))}var wo=e.Syringe.defineToken("LayoutChildrenFactory"),_o=e.Syringe.defineToken("LayoutChildrenOptions");e.LayoutChildren=function(){function t(e,n){dt(this,t),this._layoutContext=void 0,this.options=void 0,this.node=void 0,this.styleMap=void 0,this.layoutContext=void 0,this._layoutContext=e,this.options=n,this.layoutContext=e,this.node=n.node,this.styleMap=n.node.getAllStyle()}return yt(t,[{key:"intrinsicSizes",value:function(){var t=new Kr;return this.layoutContext.appendWorkTask({layoutChild:this,taskType:e.LayoutTaskType.IntrinsicSizes,deferred:t}),t.promise}},{key:"layoutNextFragment",value:function(t){if(this.layoutContext.mode===e.LayoutTaskType.IntrinsicSizes)throw Error("Not Supported: cant call layoutNextFragment in intrinsicSizes");var n=new Kr;return this.layoutContext.appendWorkTask({layoutConstraints:t,layoutChild:this,taskType:e.LayoutTaskType.Layout,deferred:n}),n.promise}}]),t}(),e.LayoutChildren=It([ue(),Rt(0,le(e.LayoutContext)),Rt(1,le(_o)),Lt("design:paramtypes",[e.LayoutContext,Object])],e.LayoutChildren);var Co=yt((function e(){dt(this,e)}));Co.inputProperties=void 0,Co.childrenInputProperties=void 0,Co.layoutOptions=void 0;var No,Mo,Ao=e.Syringe.defineToken("LayoutEdgesFactory"),Oo=e.Syringe.defineToken("LayoutEdgesOptions");e.LayoutEdges=yt((function t(n){var r,i,o,a,s,u,c,l,h,f,d,p,y,v,g,m;dt(this,t),this.options=void 0,this.inlineStart=void 0,this.inlineEnd=void 0,this.blockStart=void 0,this.blockEnd=void 0,this.inline=void 0,this.block=void 0,this.options=n;var k=n.node.getAllStyle(),T=null!==(r=null===(i=k.get(e.PropertyName.PADDING_TOP))||void 0===i?void 0:i.value)&&void 0!==r?r:0,b=null!==(o=null===(a=k.get(e.PropertyName.PADDING_END))||void 0===a?void 0:a.value)&&void 0!==o?o:0,S=null!==(s=null===(u=k.get(e.PropertyName.PADDING_BOTTOM))||void 0===u?void 0:u.value)&&void 0!==s?s:0,E=null!==(c=null===(l=k.get(e.PropertyName.PADDING_START))||void 0===l?void 0:l.value)&&void 0!==c?c:0,P=null!==(h=null===(f=k.get(e.PropertyName.PADDING_TOP))||void 0===f?void 0:f.value)&&void 0!==h?h:0,x=null!==(d=null===(p=k.get(e.PropertyName.PADDING_END))||void 0===p?void 0:p.value)&&void 0!==d?d:0,w=null!==(y=null===(v=k.get(e.PropertyName.PADDING_BOTTOM))||void 0===v?void 0:v.value)&&void 0!==y?y:0,_=null!==(g=null===(m=k.get(e.PropertyName.PADDING_START))||void 0===m?void 0:m.value)&&void 0!==g?g:0;this.blockStart=T+0+P,this.inlineStart=b+0+x,this.blockEnd=S+0+w,this.inlineEnd=E+0+_,this.block=this.blockStart+this.blockEnd,this.inline=this.inlineStart+this.inlineEnd})),e.LayoutEdges=It([ue(),Rt(0,le(Oo)),Lt("design:paramtypes",[Object])],e.LayoutEdges),e.LayoutRegistry=(No=function(){function e(){dt(this,e),this.registry=new Map}return yt(e,[{key:"size",get:function(){return this.registry.size}},{key:"hasLayout",value:function(e){return this.registry.has(e)}},{key:"getLayout",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"absolute";if(!this.hasLayout(e))throw Error("invalid layout property: ".concat(e));return this.registry.get(e)}},{key:"updateLayout",value:function(e,t){this.registry.set(e,t)}},{key:"registerLayout",value:function(e,t){if(""===e)throw new TypeError("layout name cant't be empty");if(Mo.reservedLayout.includes(e))throw Error("layout name '".concat(e,"' is a system reserved layout name, please use another name"));if(this.hasLayout(e))throw Error("layout '".concat(e,"' already exist."));this.registry.set(e,t)}},{key:"deleteLayout",value:function(e){this.registry.delete(e)}}]),e}(),No.reservedLayout=[],Mo=No),e.LayoutRegistry=Mo=It([ce()],e.LayoutRegistry);var Io=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return new Promise((function(t){setTimeout((function(){t()}),e)}))};e.LayoutEngine=function(){function t(e,n,r){dt(this,t),this._layoutRegistry=void 0,this._layoutContextFactory=void 0,this._layoutEdgesFactory=void 0,this.layoutRegistry=void 0,this.layoutContextFactory=void 0,this.layoutEdgesFactory=void 0,this._layoutRegistry=e,this._layoutContextFactory=n,this._layoutEdgesFactory=r,this.layoutRegistry=e,this.layoutContextFactory=n,this.layoutEdgesFactory=r}var n,r,i,o,a,s;return yt(t,[{key:"computeLayout",value:(s=ft(ct().mark((function e(t,n){return ct().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.determineIntrinsicSizes(t,t.children);case 2:return e.next=4,this.calculateLayout(t,t.children,n);case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return s.apply(this,arguments)})},{key:"determineAllIntrinsicSizes",value:(a=ft(ct().mark((function e(t){return ct().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)}))),function(e){return a.apply(this,arguments)})},{key:"getLayoutDefinitionName",value:function(t){var n=t.getAllStyle().get(e.PropertyName.LAYOUT);if(!n)throw Error("layout property not found");return n.value}},{key:"determineIntrinsicSizes",value:(o=ft(ct().mark((function e(t,n){var r;return ct().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this.getLayoutDefinitionName(t),e.next=3,this.invokeIntrinsicSizesCallback(r,t,n);case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return o.apply(this,arguments)})},{key:"invokeIntrinsicSizesCallback",value:(i=ft(ct().mark((function t(n,r,i){var o,a,s,u,c,l,h,f,d,p,y;return ct().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=this.layoutRegistry.getLayout(n),a=new o,s=this.layoutContextFactory({mode:e.LayoutTaskType.IntrinsicSizes}),c=void 0===(u=o.inputProperties)?[]:u,l=[],i.forEach((function(e){var t=s.layoutChildrenFactory({node:e});l.push(t)})),h=this.layoutEdgesFactory({node:r}),f=r.getStyle.apply(r,Nt(c)),d=a.intrinsicSizes(l,h,f),(p=this.runWorkQueue(d,s.workQueue)).next(),t.next=13,Io();case 13:y=p.next().value,s.clearWorkQueue(),r.setIntrisicSizes(y);case 16:case"end":return t.stop()}}),t,this)}))),function(e,t,n){return i.apply(this,arguments)})},{key:"calculateLayout",value:(r=ft(ct().mark((function e(t,n,r){var i;return ct().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=this.getLayoutDefinitionName(t),e.next=3,this.invokeLayoutCallback(i,t,n,r);case 3:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return r.apply(this,arguments)})},{key:"invokeLayoutCallback",value:(n=ft(ct().mark((function t(n,r,i,o){var a,s,u,c,l,h,f,d,p,y,v,g,m;return ct().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=this.layoutRegistry.getLayout(n),s=new a,u=this.layoutContextFactory({mode:e.LayoutTaskType.Layout}),l=void 0===(c=a.inputProperties)?[]:c,h=[],i.forEach((function(e){var t=u.layoutChildrenFactory({node:e});h.push(t)})),f=this.layoutEdgesFactory({node:r}),d=r.getStyle.apply(r,Nt(l)),p=s.layout(h,f,o,d),(y=this.runWorkQueue(p,u.workQueue)).next(),t.next=13,Io();case 13:v=y.next().value,u.clearWorkQueue(),g=v instanceof e.FragmentResult?v:u.fragmentResultFactory(v),m=u.layoutFragmentFactory({inlineSize:g.inlineSize,blockSize:g.blockSize,data:g.data}),r.setComputedLayout(m),i.forEach((function(e,t){e.setComputedLayout(g.childFragments[t])}));case 19:case"end":return t.stop()}}),t,this)}))),function(e,t,r,i){return n.apply(this,arguments)})},{key:"runWorkQueue",value:ct().mark((function t(n,r){var i,o=this;return ct().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=Xr(n),r.length>0&&i.isPending()&&r.forEach((function(t){t.taskType===e.LayoutTaskType.IntrinsicSizes&&t.deferred.resolve(o.getNodeIntrisicSizes(t.layoutChild.node));if(t.taskType===e.LayoutTaskType.Layout){var n=t.layoutChild,r=t.deferred,i=n.layoutContext,a=o.getNodeFragment(n.node,t.layoutConstraints);r.resolve(i.layoutFragmentFactory(a))}})),void(t.next=4);case 4:if(i.isFulfilled()){t.next=6;break}throw Error("promise not fullfilled!");case 6:return t.abrupt("return",i.getFullFilledValue());case 7:case"end":return t.stop()}}),t)}))},{key:"getNodeIntrisicSizes",value:function(t){var n,r,i,o,a,s,u,c,l,h,f,d,p=t.getAllStyle();return{minContentInlineSize:(null===(n=p.get(e.PropertyName.MIN_WIDTH))||void 0===n?void 0:n.value)||(null===(r=t.intrisicSizes)||void 0===r?void 0:r.minContentInlineSize)||(null===(i=p.get(e.PropertyName.WIDTH))||void 0===i?void 0:i.value)||0,maxContentInlineSize:(null===(o=p.get(e.PropertyName.MAX_WIDTH))||void 0===o?void 0:o.value)||(null===(a=t.intrisicSizes)||void 0===a?void 0:a.maxContentInlineSize)||(null===(s=p.get(e.PropertyName.WIDTH))||void 0===s?void 0:s.value)||0,minContentBlockSize:(null===(u=p.get(e.PropertyName.MIN_HEIGHT))||void 0===u?void 0:u.value)||(null===(c=t.intrisicSizes)||void 0===c?void 0:c.minContentBlockSize)||(null===(l=p.get(e.PropertyName.HEIGHT))||void 0===l?void 0:l.value)||0,maxContentBlockSize:(null===(h=p.get(e.PropertyName.MAX_HEIGHT))||void 0===h?void 0:h.value)||(null===(f=t.intrisicSizes)||void 0===f?void 0:f.maxContentBlockSize)||(null===(d=p.get(e.PropertyName.HEIGHT))||void 0===d?void 0:d.value)||0}}},{key:"getNodeFragment",value:function(t,n){var r,i,o,a,s,u;return{inlineSize:(null===(r=t.getComputedLayout())||void 0===r?void 0:r.inlineSize)||(null===(i=t.getAllStyle().get(e.PropertyName.MIN_WIDTH))||void 0===i?void 0:i.value)||(null===(o=t.getAllStyle().get(e.PropertyName.WIDTH))||void 0===o?void 0:o.value)||0,blockSize:(null===(a=t.getComputedLayout())||void 0===a?void 0:a.blockSize)||(null===(s=t.getAllStyle().get(e.PropertyName.MIN_HEIGHT))||void 0===s?void 0:s.value)||(null===(u=t.getAllStyle().get(e.PropertyName.HEIGHT))||void 0===u?void 0:u.value)||0,data:n.data}}}]),t}(),e.LayoutEngine=It([ce(),Rt(0,le(e.LayoutRegistry)),Rt(1,le(Ft)),Rt(2,le(Ao)),Lt("design:paramtypes",[e.LayoutRegistry,Function,Function])],e.LayoutEngine);var Ro=e.Syringe.defineToken("LayoutFragmentFactory"),Lo=e.Syringe.defineToken("LayoutFragmentOptions");e.LayoutFragment=yt((function e(t,n){dt(this,e),this._layoutContext=void 0,this.options=void 0,this.layoutContext=void 0,this.inlineSize=void 0,this.blockSize=void 0,this.inlineOffset=void 0,this.blockOffset=void 0,this.data=void 0,this._layoutContext=t,this.options=n,this.layoutContext=t,this.inlineSize=n.inlineSize,this.blockSize=n.blockSize,this.inlineOffset=0,this.blockOffset=0,this.data=n.data})),e.LayoutFragment=It([ue(),Rt(0,le(e.LayoutContext)),Rt(1,le(Lo)),Lt("design:paramtypes",[e.LayoutContext,Object])],e.LayoutFragment);var Do,Uo,Fo,Bo,Vo,jo=n((function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}function i(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,r,o,a){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new i(r,o||e,a),u=n?n+t:t;return e._events[u]?e._events[u].fn?e._events[u]=[e._events[u],s]:e._events[u].push(s):(e._events[u]=s,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),s.prototype.eventNames=function(){var e,r,i=[];if(0===this._eventsCount)return i;for(r in e=this._events)t.call(e,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},s.prototype.listeners=function(e){var t=this._events[n?n+e:e];if(!t)return[];if(t.fn)return[t.fn];for(var r=0,i=t.length,o=Array(i);i>r;r++)o[r]=t[r].fn;return o},s.prototype.listenerCount=function(e){var t=this._events[n?n+e:e];return t?t.fn?1:t.length:0},s.prototype.emit=function(e,t,r,i,o,a){var s=n?n+e:e;if(!this._events[s])return!1;var u,c,l=this._events[s],h=arguments.length;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),h){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,t),!0;case 3:return l.fn.call(l.context,t,r),!0;case 4:return l.fn.call(l.context,t,r,i),!0;case 5:return l.fn.call(l.context,t,r,i,o),!0;case 6:return l.fn.call(l.context,t,r,i,o,a),!0}for(c=1,u=Array(h-1);h>c;c++)u[c-1]=arguments[c];l.fn.apply(l.context,u)}else{var f,d=l.length;for(c=0;d>c;c++)switch(l[c].once&&this.removeListener(e,l[c].fn,void 0,!0),h){case 1:l[c].fn.call(l[c].context);break;case 2:l[c].fn.call(l[c].context,t);break;case 3:l[c].fn.call(l[c].context,t,r);break;case 4:l[c].fn.call(l[c].context,t,r,i);break;default:if(!u)for(f=1,u=Array(h-1);h>f;f++)u[f-1]=arguments[f];l[c].fn.apply(l[c].context,u)}}return!0},s.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},s.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},s.prototype.removeListener=function(e,t,r,i){var o=n?n+e:e;if(!this._events[o])return this;if(!t)return a(this,o),this;var s=this._events[o];if(s.fn)s.fn!==t||i&&!s.once||r&&s.context!==r||a(this,o);else{for(var u=0,c=[],l=s.length;l>u;u++)(s[u].fn!==t||i&&!s[u].once||r&&s[u].context!==r)&&c.push(s[u]);c.length?this._events[o]=1===c.length?c[0]:c:a(this,o)}return this},s.prototype.removeAllListeners=function(e){var t;return e?this._events[t=n?n+e:e]&&a(this,t):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,e.exports=s}));(Do=e.UnitType||(e.UnitType={}))[Do.kUnknown=0]="kUnknown",Do[Do.kNumber=1]="kNumber",Do[Do.kPercentage=2]="kPercentage",Do[Do.kEms=3]="kEms",Do[Do.kExs=4]="kExs",Do[Do.kPixels=5]="kPixels",Do[Do.kCentimeters=6]="kCentimeters",Do[Do.kMillimeters=7]="kMillimeters",Do[Do.kInches=8]="kInches",Do[Do.kPoints=9]="kPoints",Do[Do.kPicas=10]="kPicas",Do[Do.kQuarterMillimeters=11]="kQuarterMillimeters",Do[Do.kViewportWidth=12]="kViewportWidth",Do[Do.kViewportHeight=13]="kViewportHeight",Do[Do.kViewportInlineSize=14]="kViewportInlineSize",Do[Do.kViewportBlockSize=15]="kViewportBlockSize",Do[Do.kViewportMin=16]="kViewportMin",Do[Do.kViewportMax=17]="kViewportMax",Do[Do.kSmallViewportWidth=18]="kSmallViewportWidth",Do[Do.kSmallViewportHeight=19]="kSmallViewportHeight",Do[Do.kSmallViewportInlineSize=20]="kSmallViewportInlineSize",Do[Do.kSmallViewportBlockSize=21]="kSmallViewportBlockSize",Do[Do.kSmallViewportMin=22]="kSmallViewportMin",Do[Do.kSmallViewportMax=23]="kSmallViewportMax",Do[Do.kLargeViewportWidth=24]="kLargeViewportWidth",Do[Do.kLargeViewportHeight=25]="kLargeViewportHeight",Do[Do.kLargeViewportInlineSize=26]="kLargeViewportInlineSize",Do[Do.kLargeViewportBlockSize=27]="kLargeViewportBlockSize",Do[Do.kLargeViewportMin=28]="kLargeViewportMin",Do[Do.kLargeViewportMax=29]="kLargeViewportMax",Do[Do.kDynamicViewportWidth=30]="kDynamicViewportWidth",Do[Do.kDynamicViewportHeight=31]="kDynamicViewportHeight",Do[Do.kDynamicViewportInlineSize=32]="kDynamicViewportInlineSize",Do[Do.kDynamicViewportBlockSize=33]="kDynamicViewportBlockSize",Do[Do.kDynamicViewportMin=34]="kDynamicViewportMin",Do[Do.kDynamicViewportMax=35]="kDynamicViewportMax",Do[Do.kContainerWidth=36]="kContainerWidth",Do[Do.kContainerHeight=37]="kContainerHeight",Do[Do.kContainerInlineSize=38]="kContainerInlineSize",Do[Do.kContainerBlockSize=39]="kContainerBlockSize",Do[Do.kContainerMin=40]="kContainerMin",Do[Do.kContainerMax=41]="kContainerMax",Do[Do.kRems=42]="kRems",Do[Do.kChs=43]="kChs",Do[Do.kUserUnits=44]="kUserUnits",Do[Do.kDegrees=45]="kDegrees",Do[Do.kRadians=46]="kRadians",Do[Do.kGradians=47]="kGradians",Do[Do.kTurns=48]="kTurns",Do[Do.kMilliseconds=49]="kMilliseconds",Do[Do.kSeconds=50]="kSeconds",Do[Do.kHertz=51]="kHertz",Do[Do.kKilohertz=52]="kKilohertz",Do[Do.kDotsPerPixel=53]="kDotsPerPixel",Do[Do.kDotsPerInch=54]="kDotsPerInch",Do[Do.kDotsPerCentimeter=55]="kDotsPerCentimeter",Do[Do.kFraction=56]="kFraction",Do[Do.kInteger=57]="kInteger",Do[Do.kQuirkyEms=58]="kQuirkyEms",(Uo=e.UnitCategory||(e.UnitCategory={}))[Uo.kUNumber=0]="kUNumber",Uo[Uo.kUPercent=1]="kUPercent",Uo[Uo.kULength=2]="kULength",Uo[Uo.kUAngle=3]="kUAngle",Uo[Uo.kUTime=4]="kUTime",Uo[Uo.kUFrequency=5]="kUFrequency",Uo[Uo.kUResolution=6]="kUResolution",Uo[Uo.kUOther=7]="kUOther",(Fo=e.ValueRange||(e.ValueRange={}))[Fo.kAll=0]="kAll",Fo[Fo.kNonNegative=1]="kNonNegative",Fo[Fo.kInteger=2]="kInteger",Fo[Fo.kNonNegativeInteger=3]="kNonNegativeInteger",Fo[Fo.kPositiveInteger=4]="kPositiveInteger",(Bo=e.Nested||(e.Nested={}))[Bo.kYes=0]="kYes",Bo[Bo.kNo=1]="kNo",(Vo=e.ParenLess||(e.ParenLess={}))[Vo.kYes=0]="kYes",Vo[Vo.kNo=1]="kNo";var Go,zo=[{name:"em",unit_type:e.UnitType.kEms},{name:"px",unit_type:e.UnitType.kPixels},{name:"deg",unit_type:e.UnitType.kDegrees},{name:"rad",unit_type:e.UnitType.kRadians},{name:"grad",unit_type:e.UnitType.kGradians},{name:"ms",unit_type:e.UnitType.kMilliseconds},{name:"s",unit_type:e.UnitType.kSeconds},{name:"rem",unit_type:e.UnitType.kRems},{name:"turn",unit_type:e.UnitType.kTurns}];(Go=e.CSSStyleValueType||(e.CSSStyleValueType={}))[Go.kUnknownType=0]="kUnknownType",Go[Go.kUnparsedType=1]="kUnparsedType",Go[Go.kKeywordType=2]="kKeywordType",Go[Go.kUnitType=3]="kUnitType",Go[Go.kSumType=4]="kSumType",Go[Go.kProductType=5]="kProductType",Go[Go.kNegateType=6]="kNegateType",Go[Go.kInvertType=7]="kInvertType",Go[Go.kMinType=8]="kMinType",Go[Go.kMaxType=9]="kMaxType",Go[Go.kClampType=10]="kClampType",Go[Go.kTransformType=11]="kTransformType",Go[Go.kPositionType=12]="kPositionType",Go[Go.kURLImageType=13]="kURLImageType",Go[Go.kColorType=14]="kColorType",Go[Go.kUnsupportedColorType=15]="kUnsupportedColorType";var Ho,Wo,Yo=function(){function t(){dt(this,t)}return yt(t,[{key:"toString",value:function(){return this.buildCSSText(e.Nested.kNo,e.ParenLess.kNo,"")}},{key:"isNumericValue",value:function(){return this.getType()>=e.CSSStyleValueType.kUnitType&&this.getType()<=e.CSSStyleValueType.kClampType}}],[{key:"parse",value:function(e,t){return[][0]}},{key:"parseAll",value:function(e,t){return[]}},{key:"unitFromName",value:function(t){return t?"number"===t?e.UnitType.kNumber:"percent"===t||"%"===t?e.UnitType.kPercentage:this.stringToUnitType(t):e.UnitType.kUnknown}},{key:"unitTypeToUnitCategory",value:function(t){switch(t){case e.UnitType.kNumber:case e.UnitType.kInteger:return e.UnitCategory.kUNumber;case e.UnitType.kPercentage:return e.UnitCategory.kUPercent;case e.UnitType.kPixels:case e.UnitType.kCentimeters:case e.UnitType.kMillimeters:case e.UnitType.kQuarterMillimeters:case e.UnitType.kInches:case e.UnitType.kPoints:case e.UnitType.kPicas:case e.UnitType.kUserUnits:return e.UnitCategory.kULength;case e.UnitType.kMilliseconds:case e.UnitType.kSeconds:return e.UnitCategory.kUTime;case e.UnitType.kDegrees:case e.UnitType.kRadians:case e.UnitType.kGradians:case e.UnitType.kTurns:return e.UnitCategory.kUAngle;case e.UnitType.kHertz:case e.UnitType.kKilohertz:return e.UnitCategory.kUFrequency;case e.UnitType.kDotsPerPixel:case e.UnitType.kDotsPerInch:case e.UnitType.kDotsPerCentimeter:return e.UnitCategory.kUResolution;default:return e.UnitCategory.kUOther}}},{key:"unitTypeToString",value:function(t){switch(t){case e.UnitType.kNumber:case e.UnitType.kInteger:case e.UnitType.kUserUnits:return"";case e.UnitType.kPercentage:return"%";case e.UnitType.kEms:case e.UnitType.kQuirkyEms:return"em";case e.UnitType.kRems:return"rem";case e.UnitType.kPixels:return"px";case e.UnitType.kDegrees:return"deg";case e.UnitType.kRadians:return"rad";case e.UnitType.kGradians:return"grad";case e.UnitType.kMilliseconds:return"ms";case e.UnitType.kSeconds:return"s";case e.UnitType.kTurns:return"turn"}return""}},{key:"stringToUnitType",value:function(e){return zo.find((function(t){return t.name===e})).unit_type}},{key:"canonicalUnitTypeForCategory",value:function(t){switch(t){case e.UnitCategory.kUNumber:return e.UnitType.kNumber;case e.UnitCategory.kULength:return e.UnitType.kPixels;case e.UnitCategory.kUPercent:return e.UnitType.kUnknown;case e.UnitCategory.kUTime:return e.UnitType.kSeconds;case e.UnitCategory.kUAngle:return e.UnitType.kDegrees;case e.UnitCategory.kUFrequency:return e.UnitType.kHertz;case e.UnitCategory.kUResolution:return e.UnitType.kDotsPerPixel;default:return e.UnitType.kUnknown}}},{key:"conversionToCanonicalUnitsScaleFactor",value:function(t){var n=1;switch(t){case e.UnitType.kPixels:case e.UnitType.kUserUnits:case e.UnitType.kDegrees:case e.UnitType.kSeconds:case e.UnitType.kHertz:break;case e.UnitType.kMilliseconds:n=.001;break;case e.UnitType.kCentimeters:case e.UnitType.kDotsPerCentimeter:case e.UnitType.kMillimeters:case e.UnitType.kQuarterMillimeters:case e.UnitType.kInches:case e.UnitType.kDotsPerInch:case e.UnitType.kPoints:case e.UnitType.kPicas:break;case e.UnitType.kRadians:n=180/Math.PI;break;case e.UnitType.kGradians:n=.9;break;case e.UnitType.kTurns:n=360;break;case e.UnitType.kKilohertz:n=1e3}return n}},{key:"isAngle",value:function(t){return t===e.UnitType.kDegrees||t===e.UnitType.kRadians||t===e.UnitType.kGradians||t===e.UnitType.kTurns}},{key:"isViewportPercentageLength",value:function(t){return t>=e.UnitType.kViewportWidth&&e.UnitType.kDynamicViewportMax>=t}},{key:"isContainerPercentageLength",value:function(t){return t>=e.UnitType.kContainerWidth&&e.UnitType.kContainerMax>=t}},{key:"isLength",value:function(t){return t>=e.UnitType.kEms&&e.UnitType.kUserUnits>=t||t==e.UnitType.kQuirkyEms}},{key:"isRelativeUnit",value:function(t){return t===e.UnitType.kPercentage||t===e.UnitType.kEms||t===e.UnitType.kExs||t===e.UnitType.kRems||t===e.UnitType.kChs||this.isViewportPercentageLength(t)||this.isContainerPercentageLength(t)}},{key:"isTime",value:function(t){return t===e.UnitType.kSeconds||t===e.UnitType.kMilliseconds}},{key:"isFrequency",value:function(t){return t==e.UnitType.kHertz||t==e.UnitType.kKilohertz}},{key:"isResolution",value:function(t){return t>=e.UnitType.kDotsPerPixel&&e.UnitType.kDotsPerCentimeter>=t}},{key:"isFlex",value:function(t){return t===e.UnitType.kFraction}}]),t}(),qo=function(t){gt(r,t);var n=xt(r);function r(e){var t;return dt(this,r),(t=n.call(this)).colorSpace=void 0,t.colorSpace=e,t}return yt(r,[{key:"getType",value:function(){return e.CSSStyleValueType.kColorType}},{key:"to",value:function(e){return this}}]),r}(Yo),Xo=function(t){gt(r,t);var n=xt(r);function r(e){var t;return dt(this,r),(t=n.call(this)).value=void 0,t.value=e,t}return yt(r,[{key:"clone",value:function(){return new r(this.value)}},{key:"getType",value:function(){return e.CSSStyleValueType.kKeywordType}},{key:"buildCSSText",value:function(e,t,n){return n+this.value}}]),r}(Yo);function Ko(t){switch(Yt(t,e.UnitType.kNumber),t){case e.UnitType.kEms:case e.UnitType.kExs:case e.UnitType.kPixels:case e.UnitType.kCentimeters:case e.UnitType.kMillimeters:case e.UnitType.kQuarterMillimeters:case e.UnitType.kInches:case e.UnitType.kPoints:case e.UnitType.kPicas:case e.UnitType.kUserUnits:case e.UnitType.kViewportWidth:case e.UnitType.kViewportHeight:case e.UnitType.kViewportInlineSize:case e.UnitType.kViewportBlockSize:case e.UnitType.kViewportMin:case e.UnitType.kViewportMax:case e.UnitType.kSmallViewportWidth:case e.UnitType.kSmallViewportHeight:case e.UnitType.kSmallViewportInlineSize:case e.UnitType.kSmallViewportBlockSize:case e.UnitType.kSmallViewportMin:case e.UnitType.kSmallViewportMax:case e.UnitType.kLargeViewportWidth:case e.UnitType.kLargeViewportHeight:case e.UnitType.kLargeViewportInlineSize:case e.UnitType.kLargeViewportBlockSize:case e.UnitType.kLargeViewportMin:case e.UnitType.kLargeViewportMax:case e.UnitType.kDynamicViewportWidth:case e.UnitType.kDynamicViewportHeight:case e.UnitType.kDynamicViewportInlineSize:case e.UnitType.kDynamicViewportBlockSize:case e.UnitType.kDynamicViewportMin:case e.UnitType.kDynamicViewportMax:case e.UnitType.kContainerWidth:case e.UnitType.kContainerHeight:case e.UnitType.kContainerInlineSize:case e.UnitType.kContainerBlockSize:case e.UnitType.kContainerMin:case e.UnitType.kContainerMax:case e.UnitType.kRems:case e.UnitType.kChs:return e.BaseType.kLength;case e.UnitType.kMilliseconds:case e.UnitType.kSeconds:return e.BaseType.kTime;case e.UnitType.kDegrees:case e.UnitType.kRadians:case e.UnitType.kGradians:case e.UnitType.kTurns:return e.BaseType.kAngle;case e.UnitType.kHertz:case e.UnitType.kKilohertz:return e.BaseType.kFrequency;case e.UnitType.kDotsPerPixel:case e.UnitType.kDotsPerInch:case e.UnitType.kDotsPerCentimeter:return e.BaseType.kResolution;case e.UnitType.kFraction:return e.BaseType.kFlex;case e.UnitType.kPercentage:return e.BaseType.kPercent;default:return e.BaseType.kLength}}function Zo(t){switch(t){case e.BaseType.kLength:return"length";case e.BaseType.kAngle:return"angle";case e.BaseType.kTime:return"time";case e.BaseType.kFrequency:return"frequency";case e.BaseType.kResolution:return"resolution";case e.BaseType.kFlex:return"flex";case e.BaseType.kPercent:return"percent"}return""}(Ho=e.CSSMathOperator||(e.CSSMathOperator={})).kAdd="+",Ho.kSubtract="-",Ho.kMultiply="*",Ho.kDivide="/",Ho.kMin="min",Ho.kMax="max",Ho.kClamp="clamp",Ho.kInvalid="",(Wo=e.BaseType||(e.BaseType={}))[Wo.kLength=0]="kLength",Wo[Wo.kAngle=1]="kAngle",Wo[Wo.kTime=2]="kTime",Wo[Wo.kFrequency=3]="kFrequency",Wo[Wo.kResolution=4]="kResolution",Wo[Wo.kFlex=5]="kFlex",Wo[Wo.kPercent=6]="kPercent",Wo[Wo.kNumBaseTypes=7]="kNumBaseTypes";var Jo=function(){function t(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e.UnitType.kNumber,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;dt(this,t),this.exponents=[],this.numNonZeroEntries=0,this.percentHint=e.BaseType.kPercent,this.hasPercentHint=!1,this.exponents=Array(e.BaseType.kNumBaseTypes).fill(0),n!==e.UnitType.kNumber&&this.setExponent(Ko(n),r)}return yt(t,[{key:"applyPercentHint",value:function(t){Yt(t,e.BaseType.kPercent),this.setExponent(t,this.exponent(t)+this.exponent(e.BaseType.kPercent)),this.setExponent(e.BaseType.kPercent,0),this.percentHint=t,this.hasPercentHint=!0}},{key:"hasNonZeroEntries",value:function(){return this.numNonZeroEntries>0}},{key:"isOnlyNonZeroEntry",value:function(e,t){return Yt(t,0),1===this.numNonZeroEntries&&this.exponent(e)===t}},{key:"exponent",value:function(e){return this.exponents[e]}},{key:"setExponent",value:function(e,t){var n=this.exponents[e];0==n&&0!==t?this.numNonZeroEntries++:0!==n&&0==t&&this.numNonZeroEntries--,this.exponents[e]=t}},{key:"matchesBaseType",value:function(t){return Yt(t,e.BaseType.kPercent),this.isOnlyNonZeroEntry(t,1)&&!this.hasPercentHint}},{key:"matchesPercentage",value:function(){return this.isOnlyNonZeroEntry(e.BaseType.kPercent,1)}},{key:"matchesBaseTypePercentage",value:function(t){return Yt(t,e.BaseType.kPercent),this.isOnlyNonZeroEntry(t,1)||this.isOnlyNonZeroEntry(e.BaseType.kPercent,1)}},{key:"matchesNumber",value:function(){return!this.hasNonZeroEntries()&&!this.hasPercentHint}},{key:"matchesNumberPercentage",value:function(){return!this.hasNonZeroEntries()||this.isOnlyNonZeroEntry(e.BaseType.kPercent,1)}}],[{key:"negateExponents",value:function(e){return e.exponents.forEach((function(e){return-1*e})),e}},{key:"add",value:function(t,n,r){if(t.hasPercentHint&&n.hasPercentHint&&t.percentHint!=n.percentHint)return t;t.hasPercentHint?n.applyPercentHint(t.percentHint):n.hasPercentHint&&t.applyPercentHint(n.percentHint),Wt(t.percentHint,n.percentHint);for(var i=0;e.BaseType.kNumBaseTypes>i;++i){var o=i;if(t.exponents[i]!==n.exponents[i]&&(o!==e.BaseType.kPercent&&(t.applyPercentHint(o),n.applyPercentHint(o)),t.exponents[i]!==n.exponents[i]))return t}return t}},{key:"multiply",value:function(t,n,r){if(t.hasPercentHint&&n.hasPercentHint&&t.percentHint!=n.percentHint)return t;t.hasPercentHint?n.applyPercentHint(t.percentHint):n.hasPercentHint&&t.applyPercentHint(n.percentHint);for(var i=0;e.BaseType.kNumBaseTypes>i;++i){var o=i;t.setExponent(o,t.exponent(o)+n.exponent(o))}return t}}]),t}(),Qo=function(t){gt(r,t);var n=xt(r);function r(e){var t;return dt(this,r),(t=n.call(this)).type_=void 0,t.type_=e,t}return yt(r,[{key:"getType",value:function(){return e.CSSStyleValueType.kUnknownType}},{key:"equals",value:function(){for(var e=this,t=arguments.length,n=Array(t),r=0;t>r;r++)n[r]=arguments[r];var i=$o(n);return i.every((function(t){return e.equals(t)}))}},{key:"add",value:function(){for(var t=arguments.length,n=Array(t),r=0;t>r;r++)n[r]=arguments[r];var i=$o(n);ea(e.CSSStyleValueType.kSumType,i,this);var o=na(i,e.CSSMathOperator.kAdd);return o||da.create(i)}},{key:"sub",value:function(){for(var t=arguments.length,n=Array(t),r=0;t>r;r++)n[r]=arguments[r];var i=$o(n);i=i.map((function(e){return e.negate()})),ea(e.CSSStyleValueType.kSumType,i,this);var o=na(i,e.CSSMathOperator.kAdd);return o||da.create(i)}},{key:"mul",value:function(){for(var t=arguments.length,n=Array(t),r=0;t>r;r++)n[r]=arguments[r];var i=$o(n);ea(e.CSSStyleValueType.kProductType,i,this);var o=ra(i);return o||pa.create(i)}},{key:"div",value:function(){for(var t=arguments.length,n=Array(t),r=0;t>r;r++)n[r]=arguments[r];var i=$o(n);i=i.map((function(e){return e.invert()})),ea(e.CSSStyleValueType.kProductType,i,this);var o=ra(i);return o||pa.create(i)}},{key:"min",value:function(){for(var t=arguments.length,n=Array(t),r=0;t>r;r++)n[r]=arguments[r];var i=$o(n);ea(e.CSSStyleValueType.kMinType,i,this);var o=na(i,e.CSSMathOperator.kMin);return o||ha.create(i)}},{key:"max",value:function(){for(var t=arguments.length,n=Array(t),r=0;t>r;r++)n[r]=arguments[r];var i=$o(n);ea(e.CSSStyleValueType.kMaxType,i,this);var o=na(i,e.CSSMathOperator.kMax);return o||fa.create(i)}},{key:"to",value:function(e){var t=this.sumValue();if(0===t.length||1!==t.length)return null;var n,r=ta(t[0]);return r?(n="string"==typeof e?ia.unitFromName(e):e,r.convertTo(n)):null}},{key:"toSum",value:function(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];for(var i=0,o=t;o.length>i;i++){var a=o[i];if(!r.isValidUnit(r.unitFromName(a)))return null}var s=this.sumValue();if(!s.length)return null;var u,c=[],l=Ot(s);try{for(l.s();!(u=l.n()).done;){var h=u.value,f=ta(h);if(!f)return null;c.push(f)}}catch(e){l.e(e)}finally{l.f()}if(0===t.length){c.sort((function(e,t){return e.unit-t.unit}));var d=da.create(c);return Ht(!!d),d}for(var p=[],y=function(){var e=r.unitFromName(g[v]);Ht(r.isValidUnit(e));var t=c.reduce((function(t,n,r){if(n){var i=n.convertTo(e);i&&(t+=i.value,c[r]=null)}return t}),0);p.push(new ia(t,e))},v=0,g=t;g.length>v;v++)y();if(c.some((function(e){return!!e})))throw Error("There were leftover terms that were not converted");return da.create(p)}},{key:"type",value:function(){var t={length:0,angle:0,time:0,frequency:0,resolution:0,flex:0,percent:0,percentHint:"length"},n=this.type_.exponent(e.BaseType.kLength);return n&&(t.length=n),(n=this.type_.exponent(e.BaseType.kAngle))&&(t.angle=n),(n=this.type_.exponent(e.BaseType.kTime))&&(t.time=n),(n=this.type_.exponent(e.BaseType.kFrequency))&&(t.frequency=n),(n=this.type_.exponent(e.BaseType.kResolution))&&(t.resolution=n),(n=this.type_.exponent(e.BaseType.kFlex))&&(t.flex=n),(n=this.type_.exponent(e.BaseType.kPercent))&&(t.percent=n),this.type_.hasPercentHint&&(t.percentHint=Zo(this.type_.percentHint)),t}},{key:"negate",value:function(){return sa.create(this)}},{key:"invert",value:function(){return aa.create(this)}}],[{key:"fromNumberish",value:function(t){return"number"==typeof t?new ia(t,e.UnitType.kNumber):t}},{key:"fromPercentish",value:function(t){return"number"==typeof t?new ia(100*t,e.UnitType.kPercentage):t}},{key:"isValidUnit",value:function(t){return t!==e.UnitType.kUserUnits&&!!(t===e.UnitType.kNumber||t==e.UnitType.kPercentage||this.isLength(t)||this.isAngle(t)||this.isTime(t)||this.isFrequency(t)||this.isResolution(t)||this.isFlex(t))}}]),r}(Yo);function $o(e){return e.map(Qo.fromNumberish)}function ea(e,t,n){Ht(!!n),n.getType()===e?t.unshift.apply(t,Nt(n.numericValues())):t.unshift(n)}function ta(e){return 0===Object.keys(e.units).length?new ia(e.value):1===Object.keys(e.units).length&&1===e.units[Object.keys(e.units)[0]]?new ia(e.value,Number(Object.keys(e.units)[0])):null}function na(t,n){Ht(!!t.length);var r=t[0]instanceof ia?t[0]:null;if(!r)return null;for(var i=r.value,o=1;t.length>o;o++){var a=t[o]instanceof ia?t[o]:null;if(!a||a.unit!==r.unit)return null;n===e.CSSMathOperator.kAdd?i+=a.value:n===e.CSSMathOperator.kMax?i=Math.max(i,a.value):n===e.CSSMathOperator.kMin&&(i=Math.min(i,a.value))}return new ia(i,r.unit)}function ra(t){Ht(!!t.length);for(var n=e.UnitType.kNumber,r=1,i=0;t.length>i;i++){var o=t[i]instanceof ia?t[i]:null;if(!o)return null;if(o.unit!==e.UnitType.kNumber){if(n!==e.UnitType.kNumber)return null;n=o.unit}r*=o.value}return new ia(r,n)}var ia=function(t){gt(r,t);var n=xt(r);function r(t){var i,o,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.UnitType.kNumber;return dt(this,r),o="string"==typeof a?r.unitFromName(a):a,Ht(r.isValidUnit(o)),(i=n.call(this,new Jo(o))).unit=void 0,i.value=void 0,i.unit=o,i.value=t,i}return yt(r,[{key:"clone",value:function(){return new r(this.value,this.unit)}},{key:"convertTo",value:function(t){if(this.unit===t)return new r(this.value,this.unit);var n=r.toCanonicalUnit(this.unit);if(n!==r.toCanonicalUnit(t)||n===e.UnitType.kUnknown)return null;var i=Yo.conversionToCanonicalUnitsScaleFactor(this.unit)/Yo.conversionToCanonicalUnitsScaleFactor(t);return new r(this.value*i,t)}},{key:"equals",value:function(e){return this.value===e.value&&this.unit===e.unit}},{key:"getType",value:function(){return e.CSSStyleValueType.kUnitType}},{key:"sumValue",value:function(){var t=[],n={};return this.unit!==e.UnitType.kNumber&&(n[r.toCanonicalUnitIfPossible(this.unit)]=1),t.push({value:this.value*Yo.conversionToCanonicalUnitsScaleFactor(this.unit),units:n}),t}},{key:"negate",value:function(){return new r(-this.value,this.unit)}},{key:"invert",value:function(){return this.unit===e.UnitType.kNumber?0===this.value?null:new r(1/this.value,this.unit):aa.create(this)}},{key:"buildCSSText",value:function(t,n,i){var o;switch(this.unit){case e.UnitType.kUnknown:break;case e.UnitType.kInteger:o=Number(this.value).toFixed(0);break;case e.UnitType.kNumber:case e.UnitType.kPercentage:case e.UnitType.kEms:case e.UnitType.kQuirkyEms:case e.UnitType.kExs:case e.UnitType.kRems:case e.UnitType.kChs:case e.UnitType.kPixels:case e.UnitType.kCentimeters:case e.UnitType.kDotsPerPixel:case e.UnitType.kDotsPerInch:case e.UnitType.kDotsPerCentimeter:case e.UnitType.kMillimeters:case e.UnitType.kQuarterMillimeters:case e.UnitType.kInches:case e.UnitType.kPoints:case e.UnitType.kPicas:case e.UnitType.kUserUnits:case e.UnitType.kDegrees:case e.UnitType.kRadians:case e.UnitType.kGradians:case e.UnitType.kMilliseconds:case e.UnitType.kSeconds:case e.UnitType.kHertz:case e.UnitType.kKilohertz:case e.UnitType.kTurns:case e.UnitType.kFraction:case e.UnitType.kViewportWidth:case e.UnitType.kViewportHeight:case e.UnitType.kViewportInlineSize:case e.UnitType.kViewportBlockSize:case e.UnitType.kViewportMin:case e.UnitType.kViewportMax:case e.UnitType.kSmallViewportWidth:case e.UnitType.kSmallViewportHeight:case e.UnitType.kSmallViewportInlineSize:case e.UnitType.kSmallViewportBlockSize:case e.UnitType.kSmallViewportMin:case e.UnitType.kSmallViewportMax:case e.UnitType.kLargeViewportWidth:case e.UnitType.kLargeViewportHeight:case e.UnitType.kLargeViewportInlineSize:case e.UnitType.kLargeViewportBlockSize:case e.UnitType.kLargeViewportMin:case e.UnitType.kLargeViewportMax:case e.UnitType.kDynamicViewportWidth:case e.UnitType.kDynamicViewportHeight:case e.UnitType.kDynamicViewportInlineSize:case e.UnitType.kDynamicViewportBlockSize:case e.UnitType.kDynamicViewportMin:case e.UnitType.kDynamicViewportMax:case e.UnitType.kContainerWidth:case e.UnitType.kContainerHeight:case e.UnitType.kContainerInlineSize:case e.UnitType.kContainerBlockSize:case e.UnitType.kContainerMin:case e.UnitType.kContainerMax:var a=this.value,s=r.unitTypeToString(this.unit);if(-999999>a||a>999999){var u=r.unitTypeToString(this.unit);o=!Number.isFinite(a)||Number.isNaN(a)?r.formatInfinityOrNaN(a,u):r.formatNumber(a,u)}else o="".concat(a).concat(s)}return i+=o}}],[{key:"toCanonicalUnit",value:function(e){return this.canonicalUnitTypeForCategory(this.unitTypeToUnitCategory(e))}},{key:"toCanonicalUnitIfPossible",value:function(t){var n=this.toCanonicalUnit(t);return n===e.UnitType.kUnknown?t:n}},{key:"formatInfinityOrNaN",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n="";return Number.isFinite(e)?(Ht(Number.isNaN(e)),n="NaN"):n=e>0?"infinity":"-infinity",n+t}},{key:"formatNumber",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e+t}}]),r}(Qo),oa=function(e){gt(n,e);var t=xt(n);function n(){return dt(this,n),t.apply(this,arguments)}return yt(n,[{key:"isUnitValue",value:function(){return!1}}]),n}(Qo),aa=function(t){gt(r,t);var n=xt(r);function r(e,t){var i;return dt(this,r),(i=n.call(this,t)).value=void 0,i.operator="invert",i.value=e,i}return yt(r,[{key:"clone",value:function(){return new r(this.value,this.type_)}},{key:"getType",value:function(){return e.CSSStyleValueType.kInvertType}},{key:"equals",value:function(t){return t.getType()===e.CSSStyleValueType.kInvertType&&this.value.equals(t.value)}},{key:"sumValue",value:function(){var e=this.value.sumValue();return 0===e.length||1!==e.length||0===e[0].value?null:(Object.keys(e[0].units).forEach((function(t){e[0].units[t]*=-1})),e[0].value=1/e[0].value,e)}},{key:"buildCSSText",value:function(t,n,r){return n==e.ParenLess.kNo&&(r+=t===e.Nested.kYes?"(":"calc("),r=this.value.buildCSSText(e.Nested.kYes,e.ParenLess.kNo,r+="1 / "),n===e.ParenLess.kNo&&(r+=")"),r}}],[{key:"create",value:function(e){return new r(e,Jo.negateExponents(e.type_))}}]),r}(oa),sa=function(t){gt(r,t);var n=xt(r);function r(e,t){var i;return dt(this,r),(i=n.call(this,t)).value=void 0,i.operator="negate",i.value=e,i}return yt(r,[{key:"clone",value:function(){return new r(this.value,this.type_)}},{key:"getType",value:function(){return e.CSSStyleValueType.kNegateType}},{key:"equals",value:function(t){return t.getType()===e.CSSStyleValueType.kNegateType&&this.value.equals(t.value)}},{key:"sumValue",value:function(){var e=this.value.sumValue();return 0===e.length?null:(e.forEach((function(e){e.value*=-1})),e)}},{key:"buildCSSText",value:function(t,n,r){return n==e.ParenLess.kNo&&(r+=t===e.Nested.kYes?"(":"calc("),r=this.value.buildCSSText(e.Nested.kYes,e.ParenLess.kNo,r+="-"),n===e.ParenLess.kNo&&(r+=")"),r}}],[{key:"create",value:function(e){return new r(e,e.type_)}}]),r}(oa);function ua(e,t,n){for(var r=e[0].type_,i=1;e.length>i;i++)r=t(r,e[i].type_,false);return r}var ca,la=function(e){gt(n,e);var t=xt(n);function n(e,r){var i;return dt(this,n),(i=t.call(this,r)).values=void 0,i.values=e,i}return yt(n,[{key:"numericValues",value:function(){return this.values}},{key:"equals",value:function(e){return this.getType()===e.getType()&&this.values.every((function(t,n){return t.equals(e.values[n])}))}}]),n}(oa),ha=function(t){gt(r,t);var n=xt(r);function r(){var e;dt(this,r);for(var t=arguments.length,i=Array(t),o=0;t>o;o++)i[o]=arguments[o];return(e=n.call.apply(n,[this].concat(i))).operator="min",e}return yt(r,[{key:"clone",value:function(){return new r(this.values,this.type_)}},{key:"getType",value:function(){return e.CSSStyleValueType.kMinType}},{key:"sumValue",value:function(){var e=this.numericValues()[0].sumValue();if(!e.length)return null;var t,n=Ot(this.numericValues());try{for(n.s();!(t=n.n()).done;){var r=t.value.sumValue();if(!r.length||JSON.stringify(r[0].units)!==JSON.stringify(e[0].units))return null;e[0].value>r[0].value&&(e=r)}}catch(e){n.e(e)}finally{n.f()}return e}},{key:"buildCSSText",value:function(t,n,r){r+="min(";var i,o=!0,a=Ot(this.numericValues());try{for(a.s();!(i=a.n()).done;){o||(r+=", "),o=!1,r=i.value.buildCSSText(e.Nested.kYes,e.ParenLess.kYes,r)}}catch(e){a.e(e)}finally{a.f()}return r+=")"}}],[{key:"create",value:function(e){return new r(e,ua(e,Jo.add))}}]),r}(la),fa=function(t){gt(r,t);var n=xt(r);function r(){var e;dt(this,r);for(var t=arguments.length,i=Array(t),o=0;t>o;o++)i[o]=arguments[o];return(e=n.call.apply(n,[this].concat(i))).operator="max",e}return yt(r,[{key:"clone",value:function(){return new r(this.values,this.type_)}},{key:"getType",value:function(){return e.CSSStyleValueType.kMaxType}},{key:"sumValue",value:function(){var e=this.numericValues()[0].sumValue();if(!e.length)return null;var t,n=Ot(this.numericValues());try{for(n.s();!(t=n.n()).done;){var r=t.value.sumValue();if(!r.length||JSON.stringify(r[0].units)!==JSON.stringify(e[0].units))return null;e[0].value>r[0].value&&(e=r)}}catch(e){n.e(e)}finally{n.f()}return e}},{key:"buildCSSText",value:function(t,n,r){r+="max(";var i,o=!0,a=Ot(this.numericValues());try{for(a.s();!(i=a.n()).done;){o||(r+=", "),o=!1,r=i.value.buildCSSText(e.Nested.kYes,e.ParenLess.kYes,r)}}catch(e){a.e(e)}finally{a.f()}return r+=")"}}],[{key:"create",value:function(e){return new r(e,ua(e,Jo.add))}}]),r}(la),da=function(t){gt(r,t);var n=xt(r);function r(){var e;dt(this,r);for(var t=arguments.length,i=Array(t),o=0;t>o;o++)i[o]=arguments[o];return(e=n.call.apply(n,[this].concat(i))).operator="sum",e}return yt(r,[{key:"clone",value:function(){return new r(this.values,this.type_)}},{key:"getType",value:function(){return e.CSSStyleValueType.kSumType}},{key:"sumValue",value:function(){var e=[];return this.numericValues().forEach((function(t){var n=t.sumValue();if(!n.length)return null;n.forEach((function(t){var n=e.findIndex((function(e){return JSON.stringify(e.units)===JSON.stringify(t.units)}));-1===n?e.push(ut({},t)):e[n].value+=t.value}))})),r.canCreateNumericTypeFromSumValue(e)?e:null}},{key:"buildCSSText",value:function(t,n,r){n==e.ParenLess.kNo&&(r+=t===e.Nested.kYes?"(":"calc(");var i=this.numericValues();r=i[0].buildCSSText(e.Nested.kYes,e.ParenLess.kNo,r);for(var o=1;i.length>o;o++){var a=i[o];r=a.getType()===e.CSSStyleValueType.kNegateType?a.value.buildCSSText(e.Nested.kYes,e.ParenLess.kNo,r+=" - "):a.buildCSSText(e.Nested.kYes,e.ParenLess.kNo,r+=" + ")}return n===e.ParenLess.kNo&&(r+=")"),r}}],[{key:"create",value:function(e){return new r(e,ua(e,Jo.add))}},{key:"numericTypeFromUnitMap",value:function(e){var t=new Jo;return Object.keys(e).forEach((function(n){var r=e[n];t=Jo.multiply(t,new Jo(Number(n),r),false),Ht(!0)})),t}},{key:"canCreateNumericTypeFromSumValue",value:function(e){var t=this;Ht(!!e.length);var n=this.numericTypeFromUnitMap(e[0].units);return e.every((function(e){return Jo.add(n,t.numericTypeFromUnitMap(e.units),false),!0}))}}]),r}(la),pa=function(t){gt(r,t);var n=xt(r);function r(){var e;dt(this,r);for(var t=arguments.length,i=Array(t),o=0;t>o;o++)i[o]=arguments[o];return(e=n.call.apply(n,[this].concat(i))).operator="product",e}return yt(r,[{key:"clone",value:function(){return new r(this.values,this.type_)}},{key:"getType",value:function(){return e.CSSStyleValueType.kProductType}},{key:"sumValue",value:function(){var e=[{value:1,units:{}}];return this.numericValues().forEach((function(t){var n=t.sumValue();if(!n.length)return null;var i=[];e.forEach((function(e){n.forEach((function(t){i.push({value:e.value*t.value,units:r.multiplyUnitMaps(e.units,t.units)})}))})),e=i})),e}},{key:"buildCSSText",value:function(t,n,r){n==e.ParenLess.kNo&&(r+=t===e.Nested.kYes?"(":"calc(");var i=this.numericValues();r=i[0].buildCSSText(e.Nested.kYes,e.ParenLess.kNo,r);for(var o=1;i.length>o;o++){var a=i[o];r=a.getType()===e.CSSStyleValueType.kInvertType?a.value.buildCSSText(e.Nested.kYes,e.ParenLess.kNo,r+=" / "):a.buildCSSText(e.Nested.kYes,e.ParenLess.kNo,r+=" * ")}return n===e.ParenLess.kNo&&(r+=")"),r}}],[{key:"create",value:function(e){return new r(e,ua(e,Jo.multiply))}},{key:"multiplyUnitMaps",value:function(e,t){return Object.keys(t).forEach((function(n){Yt(t[n].value,0);var r=n in e?e[n].value:0;r+t[n].value===0?delete e[n]:e[n]=r+t[n].value})),e}}]),r}(la),ya=new ia(0,"px"),va=new ia(0,"deg"),ga=function(e){gt(n,e);var t=xt(n);function n(e,r,i){var o,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,s=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return dt(this,n),(o=t.call(this,"rgb")).r=void 0,o.g=void 0,o.b=void 0,o.alpha=void 0,o.isNone=void 0,o.r=e,o.g=r,o.b=i,o.alpha=a,o.isNone=s,o}return yt(n,[{key:"clone",value:function(){return new n(this.r,this.g,this.b,this.alpha)}},{key:"buildCSSText",value:function(e,t,n){return n+"rgba(".concat(this.r,",").concat(this.g,",").concat(this.b,",").concat(this.alpha,")")}}]),n}(qo);(ca=e.GradientType||(e.GradientType={}))[ca.Constant=0]="Constant",ca[ca.LinearGradient=1]="LinearGradient",ca[ca.RadialGradient=2]="RadialGradient";var ma=function(t){gt(r,t);var n=xt(r);function r(e,t){var i;return dt(this,r),(i=n.call(this)).type=void 0,i.value=void 0,i.type=e,i.value=t,i}return yt(r,[{key:"clone",value:function(){return new r(this.type,this.value)}},{key:"buildCSSText",value:function(e,t,n){return n}},{key:"getType",value:function(){return e.CSSStyleValueType.kColorType}}]),r}(Yo);function ka(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Ta(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function ba(){}var Sa=.7,Ea=1/Sa,Pa=/^#([0-9a-f]{3,8})$/,xa=/^rgb\(\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*\)$/,wa=/^rgb\(\s*([+-]?\d*\.?\d+(?:[eE][+-]?\d+)?)%\s*,\s*([+-]?\d*\.?\d+(?:[eE][+-]?\d+)?)%\s*,\s*([+-]?\d*\.?\d+(?:[eE][+-]?\d+)?)%\s*\)$/,_a=/^rgba\(\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*,\s*([+-]?\d*\.?\d+(?:[eE][+-]?\d+)?)\s*\)$/,Ca=/^rgba\(\s*([+-]?\d*\.?\d+(?:[eE][+-]?\d+)?)%\s*,\s*([+-]?\d*\.?\d+(?:[eE][+-]?\d+)?)%\s*,\s*([+-]?\d*\.?\d+(?:[eE][+-]?\d+)?)%\s*,\s*([+-]?\d*\.?\d+(?:[eE][+-]?\d+)?)\s*\)$/,Na=/^hsl\(\s*([+-]?\d*\.?\d+(?:[eE][+-]?\d+)?)\s*,\s*([+-]?\d*\.?\d+(?:[eE][+-]?\d+)?)%\s*,\s*([+-]?\d*\.?\d+(?:[eE][+-]?\d+)?)%\s*\)$/,Ma=/^hsla\(\s*([+-]?\d*\.?\d+(?:[eE][+-]?\d+)?)\s*,\s*([+-]?\d*\.?\d+(?:[eE][+-]?\d+)?)%\s*,\s*([+-]?\d*\.?\d+(?:[eE][+-]?\d+)?)%\s*,\s*([+-]?\d*\.?\d+(?:[eE][+-]?\d+)?)\s*\)$/,Aa={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function Oa(){return this.rgb().formatHex()}function Ia(){return this.rgb().formatRgb()}function Ra(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Pa.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?La(t):3===n?new Fa(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?Da(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?Da(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=xa.exec(e))?new Fa(t[1],t[2],t[3],1):(t=wa.exec(e))?new Fa(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=_a.exec(e))?Da(t[1],t[2],t[3],t[4]):(t=Ca.exec(e))?Da(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Na.exec(e))?Ga(t[1],t[2]/100,t[3]/100,1):(t=Ma.exec(e))?Ga(t[1],t[2]/100,t[3]/100,t[4]):Aa.hasOwnProperty(e)?La(Aa[e]):"transparent"===e?new Fa(NaN,NaN,NaN,0):null}function La(e){return new Fa(e>>16&255,e>>8&255,255&e,1)}function Da(e,t,n,r){return r>0||(e=t=n=NaN),new Fa(e,t,n,r)}function Ua(e){return e instanceof ba||(e=Ra(e)),e?new Fa((e=e.rgb()).r,e.g,e.b,e.opacity):new Fa}function Fa(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function Ba(){return"#"+ja(this.r)+ja(this.g)+ja(this.b)}function Va(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===e?")":", "+e+")")}function ja(e){return(16>(e=Math.max(0,Math.min(255,Math.round(e)||0)))?"0":"")+e.toString(16)}function Ga(e,t,n,r){return r>0?n>0&&1>n?t>0||(e=NaN):e=t=NaN:e=t=n=NaN,new Ha(e,t,n,r)}function za(e){if(e instanceof Ha)return new Ha(e.h,e.s,e.l,e.opacity);if(e instanceof ba||(e=Ra(e)),!e)return new Ha;if(e instanceof Ha)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,s=o-i,u=(o+i)/2;return s?(a=t===o?(n-r)/s+6*(r>n):n===o?(r-t)/s+2:(t-n)/s+4,s/=.5>u?o+i:2-o-i,a*=60):s=u>0&&1>u?0:a,new Ha(a,s,u,e.opacity)}function Ha(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function Wa(e,t,n){return 255*(60>e?t+(n-t)*e/60:180>e?n:240>e?t+(n-t)*(240-e)/60:t)}ka(ba,Ra,{copy:function(e){return Object.assign(new this.constructor,this,e)},displayable:function(){return this.rgb().displayable()},hex:Oa,formatHex:Oa,formatHsl:function(){return za(this).formatHsl()},formatRgb:Ia,toString:Ia}),ka(Fa,(function(e,t,n,r){return 1===arguments.length?Ua(e):new Fa(e,t,n,null==r?1:r)}),Ta(ba,{brighter:function(e){return new Fa(this.r*(e=null==e?Ea:Math.pow(Ea,e)),this.g*e,this.b*e,this.opacity)},darker:function(e){return new Fa(this.r*(e=null==e?Sa:Math.pow(Sa,e)),this.g*e,this.b*e,this.opacity)},rgb:function(){return this},displayable:function(){return this.r>=-.5&&255.5>this.r&&this.g>=-.5&&255.5>this.g&&this.b>=-.5&&255.5>this.b&&this.opacity>=0&&1>=this.opacity},hex:Ba,formatHex:Ba,formatRgb:Va,toString:Va})),ka(Ha,(function(e,t,n,r){return 1===arguments.length?za(e):new Ha(e,t,n,null==r?1:r)}),Ta(ba,{brighter:function(e){return new Ha(this.h,this.s,this.l*(e=null==e?Ea:Math.pow(Ea,e)),this.opacity)},darker:function(e){return new Ha(this.h,this.s,this.l*(e=null==e?Sa:Math.pow(Sa,e)),this.opacity)},rgb:function(){var e=this.h%360+360*(0>this.h),t=this.l,n=t+(.5>t?t:1-t)*(isNaN(e)||isNaN(this.s)?0:this.s),r=2*t-n;return new Fa(Wa(240>e?e+120:e-240,r,n),Wa(e,r,n),Wa(120>e?e+240:e-120,r,n),this.opacity)},displayable:function(){return(this.s>=0&&1>=this.s||isNaN(this.s))&&this.l>=0&&1>=this.l&&this.opacity>=0&&1>=this.opacity},formatHsl:function(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===e?")":", "+e+")")}}));var Ya="object"==typeof global&&global&&global.Object===Object&&global,qa="object"==typeof self&&self&&self.Object===Object&&self,Xa=Ya||qa||Function("return this")(),Ka=Xa.Symbol,Za=Object.prototype,Ja=Za.hasOwnProperty,Qa=Za.toString,$a=Ka?Ka.toStringTag:void 0;var es=Object.prototype.toString;var ts=Ka?Ka.toStringTag:void 0;function ns(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":ts&&ts in Object(e)?function(e){var t=Ja.call(e,$a),n=e[$a];try{e[$a]=void 0;var r=!0}catch(e){}var i=Qa.call(e);return r&&(t?e[$a]=n:delete e[$a]),i}(e):function(e){return es.call(e)}(e)}function rs(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var is,os=Xa["__core-js_shared__"],as=(is=/[^.]+$/.exec(os&&os.keys&&os.keys.IE_PROTO||""))?"Symbol(src)_1."+is:"";var ss=Function.prototype.toString;var us=/^\[object .+?Constructor\]$/,cs=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function ls(e){if(!rs(e)||(t=e,as&&as in t))return!1;var t,n=function(e){if(!rs(e))return!1;var t=ns(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}(e)?cs:us;return n.test(function(e){if(null!=e){try{return ss.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function hs(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return ls(n)?n:void 0}var fs=hs(Object,"create");var ds=Object.prototype.hasOwnProperty;var ps=Object.prototype.hasOwnProperty;function ys(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function vs(e,t){for(var n,r,i=e.length;i--;)if((n=e[i][0])===(r=t)||n!=n&&r!=r)return i;return-1}ys.prototype.clear=function(){this.__data__=fs?fs(null):{},this.size=0},ys.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},ys.prototype.get=function(e){var t=this.__data__;if(fs){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return ds.call(t,e)?t[e]:void 0},ys.prototype.has=function(e){var t=this.__data__;return fs?void 0!==t[e]:ps.call(t,e)},ys.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=fs&&void 0===t?"__lodash_hash_undefined__":t,this};var gs=Array.prototype.splice;function ms(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}ms.prototype.clear=function(){this.__data__=[],this.size=0},ms.prototype.delete=function(e){var t=this.__data__,n=vs(t,e);return n>=0&&(n==t.length-1?t.pop():gs.call(t,n,1),--this.size,!0)},ms.prototype.get=function(e){var t=this.__data__,n=vs(t,e);return 0>n?void 0:t[n][1]},ms.prototype.has=function(e){return vs(this.__data__,e)>-1},ms.prototype.set=function(e,t){var n=this.__data__,r=vs(n,e);return 0>r?(++this.size,n.push([e,t])):n[r][1]=t,this};var ks=hs(Xa,"Map");function Ts(e,t){var n,r,i=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map}function bs(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}bs.prototype.clear=function(){this.size=0,this.__data__={hash:new ys,map:new(ks||ms),string:new ys}},bs.prototype.delete=function(e){var t=Ts(this,e).delete(e);return this.size-=t?1:0,t},bs.prototype.get=function(e){return Ts(this,e).get(e)},bs.prototype.has=function(e){return Ts(this,e).has(e)},bs.prototype.set=function(e,t){var n=Ts(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};function Ss(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(Ss.Cache||bs),n}Ss.Cache=bs;var Es=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,Ps=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,xs=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,ws=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;var _s={left:180,top:-90,bottom:90,right:0,"left top":225,"top left":225,"left bottom":135,"bottom left":135,"right top":-45,"top right":-45,"right bottom":45,"bottom right":45},Cs=Ss((function(e){return"angular"===e.type?Number(e.value):_s[e.value]||0})),Ns=Ss((function(e){var t=.5,n=.5;if("position"===(null==e?void 0:e.type)){var r=e.value,i=r.x,o=r.y;"position-keyword"===(null==i?void 0:i.type)&&("left"===i.value?t=0:"center"===i.value?t=.5:"right"===i.value?t=1:"top"===i.value?n=0:"bottom"===i.value&&(n=1)),"position-keyword"===(null==o?void 0:o.type)&&("left"===o.value?t=0:"center"===o.value?n=.5:"right"===o.value?t=1:"top"===o.value?n=0:"bottom"===o.value&&(n=1)),"%"===(null==i?void 0:i.type)&&(t=Number(i.value)/100),"%"===(null==o?void 0:o.type)&&(n=Number(i.value)/100)}return{cx:t,cy:n}})),Ms=Ss((function(t){if(t.indexOf("linear")>-1||t.indexOf("radial")>-1)return ri(t).map((function(n){var r=n.type,i=n.orientation,o=n.colorStops;!function(e){var t,n,r=e.length;e[r-1].length=null!==(t=e[r-1].length)&&void 0!==t?t:{type:"%",value:"100"},r>1&&(e[0].length=null!==(n=e[0].length)&&void 0!==n?n:{type:"%",value:"0"});for(var i=0,o=Number(e[0].length.value),a=1;r>a;a++){var s,u=null===(s=e[a].length)||void 0===s?void 0:s.value;if(!Xt(u)&&!Xt(o)){for(var c=1;a-i>c;c++)e[i+c].length={type:"%",value:"".concat(o+(Number(u)-o)*c/(a-i))};i=a,o=Number(u)}}}(o);var a=o.map((function(e){return[Number(e.length.value)/100,ti(e)]}));if("linear-gradient"===r)return new ma(e.GradientType.LinearGradient,{angle:i?Cs(i):0,steps:a,hash:t});if("radial-gradient"===r&&(i||(i=[{type:"shape",value:"circle"}]),"shape"===i[0].type&&"circle"===i[0].value)){var s=Ns(i[0].at);return new ma(e.GradientType.RadialGradient,{cx:s.cx,cy:s.cy,steps:a,hash:t})}}));var n=t[0];if("("===t[1]||"("===t[2])if("l"===n){var r=Es.exec(t);if(r){var i,o=(null===(i=r[2].match(ws))||void 0===i?void 0:i.map((function(e){return e.split(":")})))||[];return[new ma(e.GradientType.LinearGradient,{angle:parseFloat(r[1]),steps:o.map((function(e){var t=Ct(e,2),n=t[1];return[Number(t[0]),n]})),hash:t})]}}else if("r"===n){var a=function(e){var t=Ps.exec(e);if(t){var n;return{cx:.5,cy:.5,steps:((null===(n=t[4].match(ws))||void 0===n?void 0:n.map((function(e){return e.split(":")})))||[]).map((function(e){var t=Ct(e,2),n=t[1];return[Number(t[0]),n]})),hash:e}}return null}(t);if(a){if(!yi(a))return[new ma(e.GradientType.RadialGradient,a)];t=a}}else if("p"===n)return function(e){var t=xs.exec(e);if(t){var n=t[1],r=t[2];switch(n){case"a":n="repeat";break;case"x":n="repeat-x";break;case"y":n="repeat-y";break;default:n="no-repeat"}return{image:r,repetition:n}}return null}(t)}));function As(e){return Qt(e)&&!!e.image}var Os=Ss((function(e){if(As(e))return ut({repetition:"repeat"},e);if(Xt(e)&&(e=""),"transparent"===e)return new ga(0,0,0,0);"currentColor"===e&&(e="black");var t=Ms(e);if(t)return t;var n=Ra(e),r=[0,0,0,0];return null!==n&&(r[0]=n.r||0,r[1]=n.g||0,r[2]=n.b||0,r[3]=n.opacity),bt(ga,r)}));function Is(e,t){if(e instanceof ga&&t instanceof ga)return[[Number(e.r),Number(e.g),Number(e.b),Number(e.alpha)],[Number(t.r),Number(t.g),Number(t.b),Number(t.alpha)],function(e){var t=e.slice();if(t[3])for(var n=0;3>n;n++)t[n]=Math.round(kr(t[n],0,255));return t[3]=kr(t[3],0,1),"rgba(".concat(t.join(","),")")}]}var Rs,Ls=function(){function e(t,n){dt(this,e),this.center=void 0,this.halfExtents=void 0,this.min=On(),this.max=On(),this.update(t,n)}return yt(e,[{key:"update",value:function(e,t){this.center=Dn(On(),e||On()),this.halfExtents=Dn(On(),t||Ln(0,0,0)),this.min=Jn(this.min,this.center,this.halfExtents),this.max=Fn(this.max,this.center,this.halfExtents)}},{key:"setMinMax",value:function(e,t){Fn(this.center,t,e),jn(this.center,this.center,.5),Jn(this.halfExtents,t,e),jn(this.halfExtents,this.halfExtents,.5),Dn(this.min,e),Dn(this.max,t)}},{key:"getMin",value:function(){return this.min}},{key:"getMax",value:function(){return this.max}},{key:"add",value:function(t){if(!e.isEmpty(t))if(e.isEmpty(this))this.setMinMax(t.getMin(),t.getMax());else{var n=this.center,r=n[0],i=n[1],o=n[2],a=this.halfExtents,s=a[0],u=a[1],c=a[2],l=r-s,h=r+s,f=i-u,d=i+u,p=o-c,y=o+c,v=t.center,g=v[0],m=v[1],k=v[2],T=t.halfExtents,b=T[0],S=T[1],E=T[2],P=g-b,x=g+b,w=m-S,_=m+S,C=k-E,N=k+E;l>P&&(l=P),x>h&&(h=x),f>w&&(f=w),_>d&&(d=_),p>C&&(p=C),N>y&&(y=N),n[0]=.5*(l+h),n[1]=.5*(f+d),n[2]=.5*(p+y),a[0]=.5*(h-l),a[1]=.5*(d-f),a[2]=.5*(y-p),this.min[0]=l,this.min[1]=f,this.min[2]=p,this.max[0]=h,this.max[1]=d,this.max[2]=y}}},{key:"setFromTransformedAABB",value:function(e,t){var n=this.center,r=this.halfExtents,i=e.center,o=e.halfExtents,a=t[0],s=t[4],u=t[8],c=t[1],l=t[5],h=t[9],f=t[2],d=t[6],p=t[10],y=Math.abs(a),v=Math.abs(s),g=Math.abs(u),m=Math.abs(c),k=Math.abs(l),T=Math.abs(h),b=Math.abs(f),S=Math.abs(d),E=Math.abs(p);Un(n,t[12]+a*i[0]+s*i[1]+u*i[2],t[13]+c*i[0]+l*i[1]+h*i[2],t[14]+f*i[0]+d*i[1]+p*i[2]),Un(r,y*o[0]+v*o[1]+g*o[2],m*o[0]+k*o[1]+T*o[2],b*o[0]+S*o[1]+E*o[2]),this.min=Jn(this.min,n,r),this.max=Fn(this.max,n,r)}},{key:"intersects",value:function(e){var t=this.getMax(),n=this.getMin(),r=e.getMax(),i=e.getMin();return!(n[0]>r[0]||i[0]>t[0]||n[1]>r[1]||i[1]>t[1]||n[2]>r[2]||i[2]>t[2])}},{key:"intersection",value:function(t){if(!this.intersects(t))return null;var n,r,i,o=new e,a=(n=On(),r=this.getMin(),i=t.getMin(),n[0]=Math.max(r[0],i[0]),n[1]=Math.max(r[1],i[1]),n[2]=Math.max(r[2],i[2]),n),s=function(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e}(On(),this.getMax(),t.getMax());return o.setMinMax(a,s),o}},{key:"containsPoint",value:function(e){var t=this.getMin(),n=this.getMax();return!(t[0]>e[0]||e[0]>n[0]||t[1]>e[1]||e[1]>n[1]||t[2]>e[2]||e[2]>n[2])}},{key:"getNegativeFarPoint",value:function(e){return 273===e.pnVertexFlag?Dn(On(),this.min):272===e.pnVertexFlag?Ln(this.min[0],this.min[1],this.max[2]):257===e.pnVertexFlag?Ln(this.min[0],this.max[1],this.min[2]):256===e.pnVertexFlag?Ln(this.min[0],this.max[1],this.max[2]):17===e.pnVertexFlag?Ln(this.max[0],this.min[1],this.min[2]):16===e.pnVertexFlag?Ln(this.max[0],this.min[1],this.max[2]):Ln(this.max[0],this.max[1],1===e.pnVertexFlag?this.min[2]:this.max[2])}},{key:"getPositiveFarPoint",value:function(e){return 273===e.pnVertexFlag?Dn(On(),this.max):272===e.pnVertexFlag?Ln(this.max[0],this.max[1],this.min[2]):257===e.pnVertexFlag?Ln(this.max[0],this.min[1],this.max[2]):256===e.pnVertexFlag?Ln(this.max[0],this.min[1],this.min[2]):17===e.pnVertexFlag?Ln(this.min[0],this.max[1],this.max[2]):16===e.pnVertexFlag?Ln(this.min[0],this.max[1],this.min[2]):Ln(this.min[0],this.min[1],1===e.pnVertexFlag?this.max[2]:this.min[2])}}],[{key:"isEmpty",value:function(e){return!e||0===e.halfExtents[0]&&0===e.halfExtents[1]&&0===e.halfExtents[2]}}]),e}(),Ds=On(),Us=function(){function e(t,n){dt(this,e),this.center=void 0,this.radius=void 0,this.center=t||On(),this.radius=n||.5}return yt(e,[{key:"containsPoint",value:function(e){return Jn(Ds,e,this.center),Rn(Ds)<this.radius*this.radius}},{key:"intersects",value:function(e){Jn(Ds,e.center,this.center);var t=e.radius+this.radius;return Rn(Ds)<=t*t}}]),e}(),Fs=function(){function e(t,n){dt(this,e),this.distance=void 0,this.normal=void 0,this.pnVertexFlag=void 0,this.distance=t||0,this.normal=n||Ln(0,1,0),this.updatePNVertexFlag()}return yt(e,[{key:"updatePNVertexFlag",value:function(){this.pnVertexFlag=(Number(this.normal[0]>=0)<<8)+(Number(this.normal[1]>=0)<<4)+Number(this.normal[2]>=0)}},{key:"distanceToPoint",value:function(e){return Hn(e,this.normal)-this.distance}},{key:"normalize",value:function(){var e=1/er(this.normal);jn(this.normal,this.normal,e),this.distance*=e}},{key:"intersectsLine",value:function(e,t,n){var r=this.distanceToPoint(e),i=r/(r-this.distanceToPoint(t)),o=i>=0&&1>=i;return o&&n&&Yn(n,e,t,i),o}}]),e}();(Rs=e.Mask||(e.Mask={}))[Rs.OUTSIDE=4294967295]="OUTSIDE",Rs[Rs.INSIDE=0]="INSIDE",Rs[Rs.INDETERMINATE=2147483647]="INDETERMINATE";var Bs=function(){function e(t){if(dt(this,e),this.planes=[],t)this.planes=t;else for(var n=0;6>n;n++)this.planes.push(new Fs)}return yt(e,[{key:"extractFromVPMatrix",value:function(e){var t=Ct(e,16),n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],u=t[6],c=t[7],l=t[8],h=t[9],f=t[10],d=t[11],p=t[12],y=t[13],v=t[14],g=t[15];Un(this.planes[0].normal,o-n,c-a,d-l),this.planes[0].distance=g-p,Un(this.planes[1].normal,o+n,c+a,d+l),this.planes[1].distance=g+p,Un(this.planes[2].normal,o+r,c+s,d+h),this.planes[2].distance=g+y,Un(this.planes[3].normal,o-r,c-s,d-h),this.planes[3].distance=g-y,Un(this.planes[4].normal,o-i,c-u,d-f),this.planes[4].distance=g-v,Un(this.planes[5].normal,o+i,c+u,d+f),this.planes[5].distance=g+v,this.planes.forEach((function(e){e.normalize(),e.updatePNVertexFlag()}))}}]),e}(),Vs=On(),js=On(),Gs=On(),zs=On(),Hs=On(),Ws=function(){function e(t,n){dt(this,e),this.origin=void 0,this.direction=void 0,this.origin=t||On(),this.direction=n||Ln(0,0,-1)}return yt(e,[{key:"intersectsAABB",value:function(e,t){return t?this.intersectAABBWithIntersection(e,t):this.intersectsAABBWithoutIntersection(e)}},{key:"intersectsSphere",value:function(e,t){var n=Jn(Vs,this.origin,e.center);zn(js,Dn(js,this.direction));var r=Hn(n,js),i=Hn(n,n)-e.radius*e.radius;if(i>0&&r>0)return null;var o=r*r-i;if(0>o)return!1;var a=Math.abs(-r-Math.sqrt(o));return t&&(Dn(t,this.direction),Gn(t,this.origin,t,a)),!0}},{key:"intersectsPlane",value:function(e,t){var n=(e.distance-Hn(e.normal,this.origin))/Hn(e.normal,this.direction),r=n>=0;return r&&t&&Gn(t,this.origin,this.direction,n),r}},{key:"intersectsAABBWithoutIntersection",value:function(e){var t=Vs,n=js,r=Gs,i=zs,o=Hs,a=this.direction;return Jn(t,this.origin,e.center),Un(i,Math.abs(t[0]),Math.abs(t[1]),Math.abs(t[2])),Qn(r,t,a),!(i[0]>e.halfExtents[0]&&r[0]>=0||i[1]>e.halfExtents[1]&&r[1]>=0||i[2]>e.halfExtents[2]&&r[2]>=0)&&(Un(o,Math.abs(a[0]),Math.abs(a[1]),Math.abs(a[2])),Wn(n,a,t),Un(n,Math.abs(n[0]),Math.abs(n[1]),Math.abs(n[2])),!(n[0]>e.halfExtents[1]*o[2]+e.halfExtents[2]*o[1]||n[1]>e.halfExtents[0]*o[2]+e.halfExtents[2]*o[0]||n[2]>e.halfExtents[0]*o[1]+e.halfExtents[1]*o[0]))}},{key:"intersectAABBWithIntersection",value:function(e,t){var n=Dn(On(),e.getMin());Jn(n,n,this.origin);var r=Dn(On(),e.getMax());Jn(r,r,this.origin);var i=this.direction;0===i[0]?(n[0]=0>n[0]?-Number.MAX_VALUE:Number.MAX_VALUE,r[0]=0>r[0]?-Number.MAX_VALUE:Number.MAX_VALUE):(n[0]/=i[0],r[0]/=i[0]),0===i[1]?(n[1]=0>n[1]?-Number.MAX_VALUE:Number.MAX_VALUE,r[1]=0>r[1]?-Number.MAX_VALUE:Number.MAX_VALUE):(n[1]/=i[1],r[1]/=i[1]),0===i[2]?(n[2]=0>n[2]?-Number.MAX_VALUE:Number.MAX_VALUE,r[2]=0>r[2]?-Number.MAX_VALUE:Number.MAX_VALUE):(n[2]/=i[2],r[2]/=i[2]);var o=Un(Gs,Math.min(n[0],r[0]),Math.min(n[1],r[1]),Math.min(n[2],r[2])),a=Un(zs,Math.max(n[0],r[0]),Math.max(n[1],r[1]),Math.max(n[2],r[2])),s=Math.min(Math.min(a[0],a[1]),a[2]),u=Math.max(Math.max(o[0],o[1]),o[2]),c=s>=u&&u>=0;return c&&(Dn(t,this.direction),Gn(t,this.origin,t,u)),c}}]),e}(),Ys=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;dt(this,e),this.x=0,this.y=0,this.x=t,this.y=n}return yt(e,[{key:"clone",value:function(){return new e(this.x,this.y)}},{key:"copyFrom",value:function(e){this.x=e.x,this.y=e.y}}]),e}(),qs=function(){function e(t,n,r,i){dt(this,e),this.x=void 0,this.y=void 0,this.width=void 0,this.height=void 0,this.left=void 0,this.right=void 0,this.top=void 0,this.bottom=void 0,this.x=t,this.y=n,this.width=r,this.height=i,this.left=t,this.right=t+r,this.top=n,this.bottom=n+i}return yt(e,[{key:"toJSON",value:function(){}}]),e}();function Xs(e,t){if(Xt(t))return new ia(0,"px");if(t="".concat(t).trim().toLowerCase(),isFinite(Number(t))){if("px".search(e)>=0)return new ia(Number(t),"px");if("deg".search(e)>=0)return new ia(Number(t),"deg")}var n=[];t=t.replace(e,(function(e){return n.push(e),"U"+e}));var r="U("+e.source+")";return n.map((function(e){return new ia(Number(t.replace(RegExp("U"+e,"g"),"").replace(RegExp(r,"g"),"*0")),e)}))[0]}function Ks(e){return Xs(/px/g,e)}function Zs(e){return Xs(/px|%|em|rem/g,e)}function Js(e){return Xs(/deg|rad|grad|turn/g,e)}function Qs(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,o="",a=e.value||0,s=t.value||0;return(ia.isLength(e.unit)||ia.isLength(t.unit))&&(a=nu(e,i,n),s=nu(t,i,n),o="px"),(ia.isAngle(e.unit)||ia.isAngle(t.unit))&&(a=$s(e),s=$s(t),o="deg"),[a,s,function(e){return r&&(e=Math.max(e,0)),e+o}]}function $s(t){var n=0;return t.unit===e.UnitType.kDegrees?n=t.value:t.unit===e.UnitType.kRadians?n=Sr(Number(t.value)):t.unit===e.UnitType.kTurns&&(n=Er(Number(t.value))),n}function eu(e){return yi(e)?e.split(" ").map((function(e){return Zs(e)})):e.map((function(e){return Zs(""+e)}))}function tu(e,t,n){if(e.length===t.length){var r=e[0].unit;return[e.map((function(e){return e.value})),t.map((function(e){return e.value})),function(e){return e.map((function(e){return new ia(e,r)})).join(" ")}]}}function nu(t,n,r){if(t.unit===e.UnitType.kPixels)return Number(t.value);if(t.unit===e.UnitType.kPercentage&&r){var i=r.nodeName===e.Shape.GROUP?r.getLocalBounds():r.getGeometryBounds(),o=0;return Ls.isEmpty(i)||(o=2*i.halfExtents[n]),Number(t.value)/100*o}return 0}function ru(e){return""+e}function iu(e){return new ia("number"==typeof e?e:/^\s*[-+]?(\d*\.)?\d+\s*$/.test(e)?Number(e):0)}function ou(e,t){return[e.value,t.value,ru]}function au(e,t){return function(n,r){return[n.value,r.value,function(n){return ru(kr(n,e,t))}]}}var su=/[MLHVQTCSAZ]([^MLHVQTCSAZ]*)/gi,uu=/[^\s,]+/gi;var cu=/([a-z])[\s,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\s]*,?[\s]*)+)/gi,lu=/(-?\d*\.?\d*(?:e[\-+]?\d+)?)[\s]*,?[\s]*/gi;var hu=/[a-z]/;function fu(e,t){return[t[0]+(t[0]-e[0]),t[1]+(t[1]-e[1])]}function du(e){var t=function(e){if("string"==typeof e){if(e){var t={a:7,c:6,o:2,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,u:3,z:0},n=[];return e.replace(cu,(function(e,r,i){var o=[],a=r.toLowerCase();if(i.replace(lu,(function(e,t){t&&o.push(+t)})),"m"===a&&o.length>2&&(n.push([r].concat(o.splice(0,2))),a="l",r="m"===r?"l":"L"),"o"===a&&1===o.length&&n.push([r,o[0]]),"r"===a)n.push([r].concat(o));else for(;o.length>=t[a]&&(n.push([r].concat(o.splice(0,t[a]))),t[a]););return""})),n}return null}if(Array.isArray(e))return e}(e);if(!t||!t.length)return[["M",0,0]];for(var n=!1,r=0;t.length>r;r++){if(hu.test(f=t[r][0])||["V","H","T","S"].indexOf(f)>=0){n=!0;break}}if(!n)return t;var i=[],o=0,a=0,s=0,u=0,c=0,l=t[0];"M"!==l[0]&&"m"!==l[0]||(s=o=+l[1],u=a=+l[2],c++,i[0]=["M",o,a]);r=c;for(var h=t.length;h>r;r++){var f,d=t[r],p=i[r-1],y=[],v=(f=d[0]).toUpperCase();if(f!==v)switch(y[0]=v,v){case"A":y[1]=d[1],y[2]=d[2],y[3]=d[3],y[4]=d[4],y[5]=d[5],y[6]=+d[6]+o,y[7]=+d[7]+a;break;case"V":y[1]=+d[1]+a;break;case"H":y[1]=+d[1]+o;break;case"M":u=+d[2]+a,y[1]=s=+d[1]+o,y[2]=u;break;default:for(var g=1,m=d.length;m>g;g++)y[g]=+d[g]+(g%2?o:a)}else y=t[r];switch(v){case"Z":o=+s,a=+u;break;case"H":y=["L",o=y[1],a];break;case"V":y=["L",o,a=y[1]];break;case"T":o=y[1],a=y[2];var k=fu([p[1],p[2]],[p[3],p[4]]);y=["Q",k[0],k[1],o,a];break;case"S":o=y[y.length-2],a=y[y.length-1];var T=p.length,b=fu([p[T-4],p[T-3]],[p[T-2],p[T-1]]);y=["C",b[0],b[1],y[1],y[2],o,a];break;case"M":s=y[y.length-2],u=y[y.length-1];break;default:o=y[y.length-2],a=y[y.length-1]}i.push(y)}return i}var pu=2*Math.PI,yu=function(e,t,n,r,i,o,a){var s=e.x,u=e.y;return{x:r*(s*=t)-i*(u*=n)+o,y:i*s+r*u+a}},vu=function(e,t){var n=1.5707963267948966===t?.551915024494:-1.5707963267948966===t?-.551915024494:4/3*Math.tan(t/4),r=Math.cos(e),i=Math.sin(e),o=Math.cos(e+t),a=Math.sin(e+t);return[{x:r-i*n,y:i+r*n},{x:o+a*n,y:a-o*n},{x:o,y:a}]},gu=function(e,t,n,r){var i=e*n+t*r;return i>1&&(i=1),-1>i&&(i=-1),(0>e*r-t*n?-1:1)*Math.acos(i)},mu=function(e){var t=e.px,n=e.py,r=e.cx,i=e.cy,o=e.rx,a=e.ry,s=e.xAxisRotation,u=void 0===s?0:s,c=e.largeArcFlag,l=void 0===c?0:c,h=e.sweepFlag,f=void 0===h?0:h,d=[];if(0===o||0===a)return[{x1:0,y1:0,x2:0,y2:0,x:r,y:i}];var p=Math.sin(u*pu/360),y=Math.cos(u*pu/360),v=y*(t-r)/2+p*(n-i)/2,g=-p*(t-r)/2+y*(n-i)/2;if(0===v&&0===g)return[{x1:0,y1:0,x2:0,y2:0,x:r,y:i}];o=Math.abs(o),a=Math.abs(a);var m=Math.pow(v,2)/Math.pow(o,2)+Math.pow(g,2)/Math.pow(a,2);m>1&&(o*=Math.sqrt(m),a*=Math.sqrt(m));var k=function(e,t,n,r,i,o,a,s,u,c,l,h){var f=Math.pow(i,2),d=Math.pow(o,2),p=Math.pow(l,2),y=Math.pow(h,2),v=f*d-f*y-d*p;0>v&&(v=0);var g=(v=Math.sqrt(v/=f*y+d*p)*(a===s?-1:1))*i/o*h,m=v*-o/i*l,k=c*g-u*m+(e+n)/2,T=u*g+c*m+(t+r)/2,b=(l-g)/i,S=(h-m)/o,E=(-l-g)/i,P=(-h-m)/o,x=gu(1,0,b,S),w=gu(b,S,E,P);return 0===s&&w>0&&(w-=pu),1===s&&0>w&&(w+=pu),[k,T,x,w]}(t,n,r,i,o,a,l,f,p,y,v,g),T=k[0],b=k[1],S=k[2],E=k[3],P=Math.abs(E)/(pu/4);1e-7>Math.abs(1-P)&&(P=1);var x=Math.max(Math.ceil(P),1);E/=x;for(var w=0;x>w;w++)d.push(vu(S,E)),S+=E;return d.map((function(e){var t=yu(e[0],o,a,y,p,T,b),n=t.x,r=t.y,i=yu(e[1],o,a,y,p,T,b),s=i.x,u=i.y,c=yu(e[2],o,a,y,p,T,b);return{x1:n,y1:r,x2:s,y2:u,x:c.x,y:c.y}}))};function ku(e,t,n,r,i,o,a,s,u){return mu({px:e,py:t,cx:s,cy:u,rx:n,ry:r,xAxisRotation:i,largeArcFlag:o,sweepFlag:a}).reduce((function(e,t){return e.push(t.x1,t.y1,t.x2,t.y2,t.x,t.y),e}),[])}function Tu(e,t,n,r,i,o){var a=1/3,s=2/3;return[a*e+s*n,a*t+s*r,a*i+s*n,a*o+s*r,i,o]}function bu(e,t,n,r){return[e,t,n,r,n,r]}function Su(e,t){0>"TQ".indexOf(e[0])&&(t.qx=null,t.qy=null);var n=e.slice(1),r=n[0],i=n[1];switch(e[0]){case"M":return t.x=r,t.y=i,e;case"A":return["C"].concat(ku.apply(0,[t.x1,t.y1].concat(e.slice(1))));case"Q":return t.qx=r,t.qy=i,["C"].concat(Tu.apply(0,[t.x1,t.y1].concat(e.slice(1))));case"L":return["C"].concat(bu(t.x1,t.y1,e[1],e[2]));case"H":return["C"].concat(bu(t.x1,t.y1,e[1],t.y1));case"V":return["C"].concat(bu(t.x1,t.y1,t.x1,e[1]));case"Z":return["C"].concat(bu(t.x1,t.y1,t.x,t.y))}return e}function Eu(e,t,n){if(e[n].length>7){e[n].shift();for(var r=e[n],i=n;r.length;)t[n]="A",e.splice(i+=1,0,["C"].concat(r.splice(0,6)));e.splice(n,1)}}function Pu(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function xu(e,t){return Pu(e)*Pu(t)?(e[0]*t[0]+e[1]*t[1])/(Pu(e)*Pu(t)):1}function wu(e,t){return(e[1]*t[0]>e[0]*t[1]?-1:1)*Math.acos(xu(e,t))}function _u(e,t){return e[0]===t[0]&&e[1]===t[1]}function Cu(e,t){var n,r=t[1],i=t[2],o=(.017453292519943295*t[3]%(n=2*Math.PI)+n)%n,a=t[4],s=t[5],u=e[0],c=e[1],l=t[6],h=t[7],f=Math.cos(o)*(u-l)/2+Math.sin(o)*(c-h)/2,d=-1*Math.sin(o)*(u-l)/2+Math.cos(o)*(c-h)/2,p=f*f/(r*r)+d*d/(i*i);p>1&&(r*=Math.sqrt(p),i*=Math.sqrt(p));var y=r*r*(d*d)+i*i*(f*f),v=y?Math.sqrt((r*r*(i*i)-y)/y):1;a===s&&(v*=-1),isNaN(v)&&(v=0);var g=i?v*r*d/i:0,m=r?v*-i*f/r:0,k=(u+l)/2+Math.cos(o)*g-Math.sin(o)*m,T=(c+h)/2+Math.sin(o)*g+Math.cos(o)*m,b=[(f-g)/r,(d-m)/i],S=[(-1*f-g)/r,(-1*d-m)/i],E=wu([1,0],b),P=wu(b,S);return xu(b,S)>-1||(P=Math.PI),1>xu(b,S)||(P=0),0===s&&P>0&&(P-=2*Math.PI),1===s&&0>P&&(P+=2*Math.PI),{cx:k,cy:T,rx:_u(e,[l,h])?0:r,ry:_u(e,[l,h])?0:i,startAngle:E,endAngle:E+P,xRotation:o,arcFlag:a,sweepFlag:s}}function Nu(e,t){return[t[0]+(t[0]-e[0]),t[1]+(t[1]-e[1])]}function Mu(e){e=function(e){var t=e||[];return Array.isArray(t)?t:"string"==typeof t?((t=t.match(su)).forEach((function(e,n){if((e=e.match(uu))[0].length>1){var r=e[0].charAt(0);e.splice(1,0,e[0].substr(1)),e[0]=r}e.forEach((function(t,n){isNaN(t)||(e[n]=+t)})),t[n]=e})),t):void 0}(e);for(var t=[],n=null,r=null,i=null,o=0,a=e.length,s=0;a>s;s++){var u=e[s];r=e[s+1];var c=u[0],l={command:c,prePoint:n,params:u,startTangent:null,endTangent:null};switch(c){case"M":i=[u[1],u[2]],o=s;break;case"A":var h=Cu(n,u);l.arcParams=h}if("Z"===c)n=i,r=e[o+1];else{var f=u.length;n=[u[f-2],u[f-1]]}r&&"Z"===r[0]&&(r=e[o],t[o]&&(t[o].prePoint=n)),l.currentPoint=n,t[o]&&_u(n,t[o].currentPoint)&&(t[o].prePoint=l.prePoint),l.nextPoint=r?[r[r.length-2],r[r.length-1]]:null;var d=l.prePoint;if(["L","H","V"].includes(c))l.startTangent=[d[0]-n[0],d[1]-n[1]],l.endTangent=[n[0]-d[0],n[1]-d[1]];else if("Q"===c){l.startTangent=[d[0]-(p=[u[1],u[2]])[0],d[1]-p[1]],l.endTangent=[n[0]-p[0],n[1]-p[1]]}else if("T"===c){var p=Nu((v=t[s-1]).currentPoint,d);"Q"===v.command?(l.command="Q",l.startTangent=[d[0]-p[0],d[1]-p[1]],l.endTangent=[n[0]-p[0],n[1]-p[1]]):(l.command="TL",l.startTangent=[d[0]-n[0],d[1]-n[1]],l.endTangent=[n[0]-d[0],n[1]-d[1]])}else if("C"===c){var y=[u[3],u[4]];l.startTangent=[d[0]-(g=[u[1],u[2]])[0],d[1]-g[1]],l.endTangent=[n[0]-y[0],n[1]-y[1]],0===l.startTangent[0]&&0===l.startTangent[1]&&(l.startTangent=[g[0]-y[0],g[1]-y[1]]),0===l.endTangent[0]&&0===l.endTangent[1]&&(l.endTangent=[y[0]-g[0],y[1]-g[1]])}else if("S"===c){var v,g=Nu((v=t[s-1]).currentPoint,d);y=[u[1],u[2]];"C"===v.command?(l.command="C",l.startTangent=[d[0]-g[0],d[1]-g[1]],l.endTangent=[n[0]-y[0],n[1]-y[1]]):(l.command="SQ",l.startTangent=[d[0]-y[0],d[1]-y[1]],l.endTangent=[n[0]-y[0],n[1]-y[1]])}else if("A"===c){var m=.001,k=l.arcParams||{},T=k.cx,b=void 0===T?0:T,S=k.cy,E=void 0===S?0:S,P=k.rx,x=void 0===P?0:P,w=k.ry,_=void 0===w?0:w,C=k.sweepFlag,N=k.startAngle,M=void 0===N?0:N,A=k.endAngle,O=void 0===A?0:A;0===(void 0===C?0:C)&&(m*=-1),l.startTangent=[x*Math.cos(M-m)+b-i[0],_*Math.sin(M-m)+E-i[1]],l.endTangent=[d[0]-(x*Math.cos(M+O+m)+b),d[1]-(_*Math.sin(M+O-m)+E)]}t.push(l)}return t}function Au(e,t){var n=du(e),r=function(e){for(var t=!1,n=e.length,r=0;n>r;r++){var i=e[r][0];if("C"===i||"A"===i||"Q"===i){t=!0;break}}return t}(n),i=n.slice(),o=function(e){for(var t=[],n=[],r=[],i=0;e.length>i;i++){var o=e[i],a=o[0];"M"===a?(r.length&&(n.push(r),r=[]),r.push([o[1],o[2]])):"Z"===a?r.length&&(t.push(r),r=[]):r.push([o[1],o[2]])}r.length>0&&n.push(r);return{polygons:t,polylines:n}}(i),a=o.polygons,s=o.polylines,u=function(e,t){void 0===t&&(t=!1);for(var n,r,i=du(e),o={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null},a=[],s="",u=i.length,c=[],l=0;u>l;l+=1)i[l]&&(s=i[l][0]),a[l]=s,i[l]=Su(i[l],o),Eu(i,a,l),u=i.length,"Z"===s&&c.push(l),o.x1=+(n=i[l])[(r=n.length)-2],o.y1=+n[r-1],o.x2=+n[r-4]||o.x1,o.y2=+n[r-3]||o.y1;return t?[i,c]:i}(i,!0),c=Ct(u,2),l=c[0],h=c[1],f=Mu(i),d=function(e){var t,n,r,i,o=0,a=0,s=[];if(!e)return{curveSegments:[],totalLength:o};if(e.forEach((function(t,n){i=t.length,(r=e[n+1])&&(o+=Ri.length(t[i-2],t[i-1],r[1],r[2],r[3],r[4],r[5],r[6])||0)})),0===o)return{curveSegments:[],totalLength:o};return e.forEach((function(u,c){i=u.length,(r=e[c+1])&&((t=[])[0]=a/o,n=Ri.length(u[i-2],u[i-1],r[1],r[2],r[3],r[4],r[5],r[6]),t[1]=(a+=n||0)/o,s.push(t))})),{curveSegments:s,totalLength:o}}(l),p=d.totalLength,y=d.curveSegments,v=function(e){var t=0,n=0,r=[],i=[];e.forEach((function(e){var o=Ct(e.slice(-2),2),a=o[0],s=o[1];if("M"===e[0])t=a,n=s,r.push(a),i.push(s);else if("C"===e[0]){var u=Ri.box.apply(Ri,Nt([t,n].concat(e.slice(1))));r=r.concat(u.x,u.x+u.width),i=i.concat(u.y,u.y+u.height),t=a,n=s}}));var o=Math.min.apply(0,r),a=Math.min.apply(0,i),s=Math.max.apply(0,r),u=Math.max.apply(0,i);return new qs(o,a,s-o,u-a)}(l);return t&&(t.parsedStyle.defX=v.x,t.parsedStyle.defY=v.y),{absolutePath:n,hasArc:r,segments:f,polygons:a,polylines:s,curve:l,totalLength:p,curveSegments:y,zCommandIndexes:h,rect:v}}function Ou(e,t,n){var r=e.curve,i=t.curve,o=[r,i];r.length!==i.length&&(o=Vi(r,i));var a=ji(o[0])!==ji(o[1])?Hi(o[0]):Wi(o[0]);return[a,Yi(o[1],a),function(e){return e}]}function Iu(e,t){var n;n=yi(e)?e.split(" ").map((function(e){var t=Ct(e.split(","),2),n=t[1];return[Number(t[0]),Number(n)]})):e;var r,i,o=[],a=0,s=Di(n);n.forEach((function(e,t){n[t+1]&&((r=[0,0])[0]=a/s,i=Ci.length(e[0],e[1],n[t+1][0],n[t+1][1]),r[1]=(a+=i)/s,o.push(r))}));var u=Math.min.apply(Math,Nt(n.map((function(e){return e[0]})))),c=Math.min.apply(Math,Nt(n.map((function(e){return e[1]}))));return t&&(t.parsedStyle.defX=u,t.parsedStyle.defY=c),{points:n,totalLength:s,segments:o}}var Ru=function(e){return Xs(/deg|rad|grad|turn|px|%/g,e)},Lu=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function Du(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if("none"===(e=e.toLowerCase().trim()))return[];for(var t,n=/\s*([\w-]+)\(([^)]*)\)/g,r=[],i=0;t=n.exec(e);){if(t.index!==i)return[];if(i=t.index+t[0].length,Lu.indexOf(t[1])>-1&&r.push({name:t[1],params:t[2].split(" ").map((function(e){return Ru(e)||Os(e)}))}),n.lastIndex===e.length)return r}return[]}var Uu={number:function(e){return new ia(e)},percent:function(e){return new ia(e,"%")},px:function(e){return new ia(e,"px")},em:function(e){return new ia(e,"em")},rem:function(e){return new ia(e,"rem")},deg:function(e){return new ia(e,"deg")},grad:function(e){return new ia(e,"grad")},rad:function(e){return new ia(e,"rad")},turn:function(e){return new ia(e,"turn")},s:function(e){return new ia(e,"s")},ms:function(e){return new ia(e,"ms")},registerProperty:function(e){var t=e.name,n=e.inherits,r=e.interpolable,i=e.initialValue,o=e.syntax;Ve.get(ii).registerMetadata({name:t,inherited:n,interpolable:r,defaultValue:i,syntax:o})},registerLayout:function(t,n){Ve.get(e.LayoutRegistry).registerLayout(t,n)}},Fu=null;function Bu(e){return function(t){var n=0;return e.map((function(e){return e===Fu?t[n++]:e}))}}function Vu(e){return e}var ju={rotate:["A"],rotatex:["A"],rotatey:["A"],rotatez:["A"],rotate3d:["NNNA"],scale:["Nn",Bu([Fu,Fu,Uu.number(1)]),Vu],scalex:["N",Bu([Fu,Uu.number(1),Uu.number(1)]),Bu([Fu,Uu.number(1)])],scaley:["N",Bu([Uu.number(1),Fu,Uu.number(1)]),Bu([Uu.number(1),Fu])],scalez:["N",Bu([Uu.number(1),Uu.number(1),Fu])],scale3d:["NNN",Vu],translate:["Tt",Bu([Fu,Fu,ya]),Vu],translatex:["T",Bu([Fu,ya,ya]),Bu([Fu,ya])],translatey:["T",Bu([ya,Fu,ya]),Bu([ya,Fu])],translatez:["L",Bu([ya,ya,Fu])],translate3d:["TTL",Vu]};function Gu(e){if("none"===(e=(e||"none").toLowerCase().trim()))return[];for(var t,n=/\s*(\w+)\(([^)]*)\)/g,r=[],i=0;t=n.exec(e);){if(t.index!==i)return[];i=t.index+t[0].length;var o=t[1],a=ju[o];if(!a)return[];var s=t[2].split(","),u=a[0];if(s.length>u.length)return[];for(var c=[],l=0;u.length>l;l++){var h=s[l],f=u[l],d=void 0;if(void 0===(d=h?{A:function(e){return"0"===e.trim()?va:Js(e)},N:iu,T:Zs,L:Ks}[f.toUpperCase()](h):{a:va,n:c[0],t:ya}[f]))return[];c.push(d)}if(r.push({t:o,d:c}),n.lastIndex===e.length)return r}return[]}function zu(e){return e.replace(/[xy]/,"")}function Hu(e){return e.replace(/(x|y|z|3d)?$/,"3d")}function Wu(t,n,r){var i=!1;if(!t.length||!n.length){t.length||(i=!0,t=n,n=[]);for(var o=function(e){var r=t[e],i=r.t,o=r.d,a="scale"===i.substr(0,5)?1:0;n.push({t:i,d:o.map((function(e){return"number"==typeof e?new ia(a):new ia(a,e.unit)}))})},a=0;t.length>a;a++)o(a)}var s,u,c=[],l=[],h=[];if(t.length!==n.length);else for(var f=0;t.length>f;f++){var d=t[f].t,p=n[f].t,y=t[f].d,v=n[f].d,g=ju[d],m=ju[p],k=void 0;if(u=p,("perspective"!==(s=d)||"perspective"!==u)&&("matrix"!==s&&"matrix3d"!==s||"matrix"!==u&&"matrix3d"!==u)){if(d===p)k=d;else if(g[2]&&m[2]&&zu(d)===zu(p))k=zu(d),y=g[2](y),v=m[2](v);else{if(!g[1]||!m[1]||Hu(d)!==Hu(p))break;k=Hu(d),y=g[1](y),v=m[1](v)}for(var T=[],b=[],S=[],E=0;y.length>E;E++){var P=(y[E].unit===e.UnitType.kNumber?ou:Qs)(y[E],v[E],r,!1,E);T[E]=P[0],b[E]=P[1],S.push(P[2])}c.push(T),l.push(b),h.push([k,S])}}if(i){var x=c;c=l,l=x}return[c,l,function(e){return e.map((function(e,t){var n=e.map((function(e,n){return h[t][1][n](e)})).join(",");return"matrix"===h[t][0]&&16===n.split(",").length&&(h[t][0]="matrix3d"),h[t][0]+"("+n+")"})).join(" ")}]}function Yu(e){if(yi(e)){var t=e.split(" ");return 1===t.length&&("top"===t[0]||"bottom"===t[0]?(t[1]=t[0],t[0]="center"):t[1]="center"),2!==t.length?null:[Zs(qu(t[0])),Zs(qu(t[1]))]}return[new ia(e[0]||0,"px"),new ia(e[1]||0,"px")]}function qu(e){return"center"===e?"50%":"left"===e||"top"===e?"0":"right"===e||"bottom"===e?"100%":e}var Xu,Ku=e.Syringe.defineToken("CSSPropertySyntaxFactory"),Zu=e.Syringe.defineToken("CSSProperty");e.CSSPropertyAngle=function(){function e(){dt(this,e),this.parser=Js,this.mixer=Qs}return yt(e,[{key:"calculator",value:function(e,t,n,r){return new ia($s(n),"deg")}}]),e}(),e.CSSPropertyAngle=It([ce({token:{token:Zu,named:e.PropertySyntax.ANGLE}})],e.CSSPropertyAngle),(Xu=e.ElementEvent||(e.ElementEvent={})).DESTROY="destroy",Xu.ATTR_MODIFIED="DOMAttrModified",Xu.INSERTED="DOMNodeInserted",Xu.CHILD_INSERTED="child-inserted",Xu.REMOVED="removed",Xu.CHILD_REMOVED="child-removed",Xu.MOUNTED="DOMNodeInsertedIntoDocument",Xu.UNMOUNTED="DOMNodeRemovedFromDocument",Xu.BOUNDS_CHANGED="bounds-changed",Xu.GEOMETRY_BOUNDS_CHANGED="geometry-bounds-changed",Xu.RENDER_ORDER_CHANGED="render-order-changed",Xu.CULLED="culled";var Ju,Qu=function(){function e(t){dt(this,e),this.type=void 0,this.eventPhase=e.prototype.NONE,this.target=void 0,this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.currentTarget=void 0,this.defaultPrevented=!1,this.timeStamp=void 0,this.nativeEvent=void 0,this.originalEvent=void 0,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.manager=void 0,this.detail=void 0,this.layer=new Ys,this.page=new Ys,this.canvas=new Ys,this.viewport=new Ys,this.path=void 0,this.view=void 0,this.which=void 0,this.returnValue=void 0,this.srcElement=void 0,this.composed=!1,this.isTrusted=void 0,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=t}return yt(e,[{key:"name",get:function(){return this.type}},{key:"layerX",get:function(){return this.layer.x}},{key:"layerY",get:function(){return this.layer.y}},{key:"pageX",get:function(){return this.page.x}},{key:"pageY",get:function(){return this.page.y}},{key:"x",get:function(){return this.canvas.x}},{key:"y",get:function(){return this.canvas.y}},{key:"canvasX",get:function(){return this.canvas.x}},{key:"canvasY",get:function(){return this.canvas.y}},{key:"viewportX",get:function(){return this.viewport.x}},{key:"viewportY",get:function(){return this.viewport.y}},{key:"composedPath",value:function(){return!this.manager||this.path&&this.path[0]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}},{key:"propagationPath",get:function(){return this.composedPath()}},{key:"preventDefault",value:function(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}},{key:"stopImmediatePropagation",value:function(){this.propagationImmediatelyStopped=!0}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}},{key:"initEvent",value:function(){}},{key:"initUIEvent",value:function(){}}]),e}(),$u=function(e){gt(n,e);var t=xt(n);function n(e,r){var i;return dt(this,n),(i=t.call(this,null)).type=e,i.detail=r,Object.assign(Et(i),r),i}return yt(n)}(Qu),ec=function(){function e(){dt(this,e),this.emitter=new jo.EventEmitter}return yt(e,[{key:"on",value:function(e,t,n){return this.addEventListener(e,t,n),this}},{key:"addEventListener",value:function(e,t,n){var r=Jt(n)&&n||Qt(n)&&n.capture,i=Qt(n)&&n.once,o=Zt(t)?void 0:t,a=!1,s="";if(e.indexOf(":")>-1){var u=Ct(e.split(":"),2);e=u[1],s=u[0],a=!0}if(e=r?"".concat(e,"capture"):e,t=Zt(t)?t:t.handleEvent,a){var c=t;t=function(){for(var e,t=arguments.length,n=Array(t),r=0;t>r;r++)n[r]=arguments[r];(null===(e=n[0].target)||void 0===e?void 0:e.name)===s&&c.apply(void 0,n)}}return i?this.emitter.once(e,t,o):this.emitter.on(e,t,o),this}},{key:"off",value:function(e,t,n){return e?this.removeEventListener(e,t,n):this.removeAllEventListeners(),this}},{key:"removeAllEventListeners",value:function(){this.emitter.removeAllListeners()}},{key:"removeEventListener",value:function(e,t,n){var r,i=Jt(n)&&n||Qt(n)&&n.capture,o=Zt(t)?void 0:t;return e=i?"".concat(e,"capture"):e,t=Zt(t)?t:null===(r=t)||void 0===r?void 0:r.handleEvent,this.emitter.off(e,t,o),this}},{key:"emit",value:function(e,t){this.dispatchEvent(new $u(e,t))}},{key:"dispatchEvent",value:function(e){if(!(e instanceof Qu))throw Error("DisplayObject cannot propagate events outside of the Federated Events API");var t,n;if(this.document)t=this;else if(this.defaultView)t=this.defaultView;else{var r;t=null===(r=this.ownerDocument)||void 0===r?void 0:r.defaultView}t&&(e.manager=t.getEventService()||null,e.defaultPrevented=!1,e.path=[],e.target=this,null===(n=e.manager)||void 0===n||n.dispatchEvent(e));return!e.defaultPrevented}}]),e}(),tc=function(t){gt(r,t);var n=xt(r);function r(){var e;dt(this,r);for(var t=arguments.length,i=Array(t),o=0;t>o;o++)i[o]=arguments[o];return(e=n.call.apply(n,[this].concat(i))).shadow=!1,e.ownerDocument=null,e.isConnected=!1,e.baseURI="",e.childNodes=[],e.nodeType=0,e.nodeName="",e.nodeValue=null,e.parentNode=null,e}return yt(r,[{key:"textContent",get:function(){var t="";this.nodeName===e.Shape.TEXT&&(t+=this.style.text);var n,r=Ot(this.childNodes);try{for(r.s();!(n=r.n()).done;){var i=n.value;t+=i.nodeName===e.Shape.TEXT?i.nodeValue:i.textContent}}catch(e){r.e(e)}finally{r.f()}return t},set:function(t){var n=this;this.childNodes.slice().forEach((function(e){n.removeChild(e,!0)})),this.nodeName===e.Shape.TEXT&&(this.style.text="".concat(t))}},{key:"getRootNode",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.parentNode?this.parentNode.getRootNode(e):e.composed&&this.host?this.host.getRootNode(e):this}},{key:"hasChildNodes",value:function(){return this.childNodes.length>0}},{key:"isDefaultNamespace",value:function(e){throw Error("Method not implemented.")}},{key:"lookupNamespaceURI",value:function(e){throw Error("Method not implemented.")}},{key:"lookupPrefix",value:function(e){throw Error("Method not implemented.")}},{key:"normalize",value:function(){throw Error("Method not implemented.")}},{key:"isEqualNode",value:function(e){return this===e}},{key:"isSameNode",value:function(e){return this.isEqualNode(e)}},{key:"parent",get:function(){return this.parentNode}},{key:"parentElement",get:function(){return null}},{key:"nextSibling",get:function(){return null}},{key:"previousSibling",get:function(){return null}},{key:"firstChild",get:function(){return this.childNodes.length>0?this.childNodes[0]:null}},{key:"lastChild",get:function(){return this.childNodes.length>0?this.childNodes[this.childNodes.length-1]:null}},{key:"compareDocumentPosition",value:function(e){if(e===this)return 0;if(!(e instanceof r))throw new TypeError("Node.compareDocumentPosition: Argument 1 does not implement interface Node.");for(var t=e,n=this,i=[t],o=[n];null!==(a=t.parentNode)&&void 0!==a?a:n.parentNode;){var a;t=t.parentNode?(i.push(t.parentNode),t.parentNode):t,n=n.parentNode?(o.push(n.parentNode),n.parentNode):n}if(t!==n)return r.DOCUMENT_POSITION_DISCONNECTED|r.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|r.DOCUMENT_POSITION_PRECEDING;var s=i.length>o.length?i:o,u=s===i?o:i;if(s[s.length-u.length]===u[0])return s===i?r.DOCUMENT_POSITION_CONTAINED_BY|r.DOCUMENT_POSITION_FOLLOWING:r.DOCUMENT_POSITION_CONTAINS|r.DOCUMENT_POSITION_PRECEDING;for(var c=s.length-u.length,l=u.length-1;l>=0;l--){var h=u[l],f=s[c+l];if(f!==h){var d=h.parentNode.childNodes;return d.indexOf(h)<d.indexOf(f)?u===i?r.DOCUMENT_POSITION_PRECEDING:r.DOCUMENT_POSITION_FOLLOWING:s===i?r.DOCUMENT_POSITION_PRECEDING:r.DOCUMENT_POSITION_FOLLOWING}}return r.DOCUMENT_POSITION_FOLLOWING}},{key:"contain",value:function(e){return this.contains(e)}},{key:"contains",value:function(e){for(var t=e;t&&this!==t;)t=t.parentNode;return!!t}},{key:"getAncestor",value:function(e){for(var t=this;e>0&&t;)t=t.parentNode,e--;return t}},{key:"forEach",value:function(e){e(this)||this.childNodes.forEach((function(t){t.forEach(e)}))}}],[{key:"isNode",value:function(e){return!!e.childNodes}}]),r}(ec);tc.DOCUMENT_POSITION_DISCONNECTED=1,tc.DOCUMENT_POSITION_PRECEDING=2,tc.DOCUMENT_POSITION_FOLLOWING=4,tc.DOCUMENT_POSITION_CONTAINS=8,tc.DOCUMENT_POSITION_CONTAINED_BY=16,tc.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32,(Ju=e.Strategy||(e.Strategy={}))[Ju.Standard=0]="Standard";var nc=function(){function t(){dt(this,t),this.strategy=e.Strategy.Standard,this.visibilityPlaneMask=-1,this.visible=!0,this.enable=!0}return yt(t,[{key:"isCulled",value:function(){return this.enable&&!this.visible}}]),t}();nc.tag="c-cullable";var rc=yt((function e(){dt(this,e),this.contentBounds=void 0,this.renderBounds=void 0}));rc.tag="c-geometry";var ic=yt((function e(){dt(this,e),this.aabb=void 0}));ic.tag="c-rbush-node";var oc=e.Syringe.defineToken("RBushRoot"),ac=yt((function e(){dt(this,e),this.bounds=void 0,this.boundsDirty=!0,this.renderBounds=void 0,this.renderBoundsDirty=!0,this.dirtyRenderBounds=void 0,this.dirty=!1}));ac.tag="c-renderable";var sc=yt((function e(){dt(this,e),this.dirty=!1,this.sorted=void 0,this.lastSortedIndex=void 0,this.renderOrder=0}));sc.tag="c-sortable";var uc=yt((function e(){dt(this,e),this.dirtyFlag=!1,this.localDirtyFlag=!1,this.frozen=!1,this.localPosition=Ln(0,0,0),this.localRotation=yr(0,0,0,1),this.localScale=Ln(1,1,1),this.localTransform=yn(),this.position=Ln(0,0,0),this.rotation=yr(0,0,0,1),this.scaling=Ln(1,1,1),this.worldTransform=yn(),this.origin=Ln(0,0,0)}));uc.tag="c-transform";var cc=function(e){gt(n,e);var t=xt(n);function n(e,r,i,o,a,s,u,c){var l;return dt(this,n),(l=t.call(this,null)).relatedNode=void 0,l.prevValue=void 0,l.newValue=void 0,l.attrName=void 0,l.attrChange=void 0,l.prevParsedValue=void 0,l.newParsedValue=void 0,l.relatedNode=r,l.prevValue=i,l.newValue=o,l.attrName=a,l.attrChange=s,l.prevParsedValue=u,l.newParsedValue=c,l.type=e,l}return yt(n)}(Qu);cc.ADDITION=2,cc.MODIFICATION=1,cc.REMOVAL=3;var lc=0,hc=function(t){gt(r,t);var n=xt(r);function r(){var e;dt(this,r);for(var t=arguments.length,i=Array(t),o=0;t>o;o++)i[o]=arguments[o];return(e=n.call.apply(n,[this].concat(i))).sceneGraphService=Ve.get(kl),e.entity=lc++,e.renderable=new ac,e.cullable=new nc,e.transformable=new uc,e.sortable=new sc,e.geometry=new rc,e.rBushNode=new ic,e.id=void 0,e.name=void 0,e.namespaceURI="g",e.scrollLeft=0,e.scrollTop=0,e.clientTop=0,e.clientLeft=0,e.destroyed=!1,e.style={},e.computedStyle={},e.parsedStyle={},e.attributes={},e}return yt(r,[{key:"className",get:function(){return this.getAttribute("class")||""},set:function(e){this.setAttribute("class",e)}},{key:"classList",get:function(){return this.className.split(" ").filter((function(e){return""!==e}))}},{key:"tagName",get:function(){return this.nodeName}},{key:"children",get:function(){return this.childNodes}},{key:"childElementCount",get:function(){return this.childNodes.length}},{key:"firstElementChild",get:function(){return this.firstChild}},{key:"lastElementChild",get:function(){return this.lastChild}},{key:"parentElement",get:function(){return this.parentNode}},{key:"nextSibling",get:function(){if(this.parentNode){var e=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[e+1]||null}return null}},{key:"previousSibling",get:function(){if(this.parentNode){var e=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[e-1]||null}return null}},{key:"cloneNode",value:function(e){throw Error("Method not implemented.")}},{key:"appendChild",value:function(t,n){return this.sceneGraphService.attach(t,this,n),this.dispatchEvent(new $u(e.ElementEvent.CHILD_INSERTED,{child:t})),t.dispatchEvent(new cc(e.ElementEvent.INSERTED,this,"","","",0,"","")),t}},{key:"insertBefore",value:function(e,t){if(t){var n=this.childNodes.indexOf(t);this.appendChild(e,n-1)}else this.appendChild(e);return e}},{key:"replaceChild",value:function(e,t,n){var r=this.childNodes.indexOf(t);return this.removeChild(t,n),this.appendChild(e,r),t}},{key:"removeChild",value:function(t){var n=1>=arguments.length||void 0===arguments[1]||arguments[1];return t.dispatchEvent(new cc(e.ElementEvent.REMOVED,this,"","","",0,"","")),n&&(t.dispatchEvent(new $u(e.ElementEvent.DESTROY)),t.destroyed=!0),this.dispatchEvent(new $u(e.ElementEvent.CHILD_REMOVED,{child:t})),this.sceneGraphService.detach(t),n&&t.emitter.removeAllListeners(),t}},{key:"removeChildren",value:function(){var e=this,t=0>=arguments.length||void 0===arguments[0]||arguments[0];this.childNodes.slice().forEach((function(n){e.removeChild(n,t)}))}},{key:"matches",value:function(e){return this.sceneGraphService.matches(e,this)}},{key:"getElementById",value:function(e){return this.sceneGraphService.querySelector("#".concat(e),this)}},{key:"getElementsByName",value:function(e){return this.sceneGraphService.querySelectorAll('[name="'.concat(e,'"]'),this)}},{key:"getElementsByClassName",value:function(e){return this.sceneGraphService.querySelectorAll(".".concat(e),this)}},{key:"getElementsByTagName",value:function(e){return this.sceneGraphService.querySelectorAll(e,this)}},{key:"querySelector",value:function(e){return this.sceneGraphService.querySelector(e,this)}},{key:"querySelectorAll",value:function(e){return this.sceneGraphService.querySelectorAll(e,this)}},{key:"closest",value:function(e){var t=this;do{if(this.sceneGraphService.matches(e,t))return t;t=t.parentElement}while(null!==t);return null}},{key:"find",value:function(e){var t=this,n=null;return this.forEach((function(r){return!(r===t||!e(r))&&(n=r,!0)})),n}},{key:"findAll",value:function(e){var t=this,n=[];return this.forEach((function(r){r!==t&&e(r)&&n.push(r)})),n}},{key:"after",value:function(){var e=this;if(this.parentNode){for(var t=this.parentNode.childNodes.indexOf(this),n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];r.forEach((function(n,r){var i;return null===(i=e.parentNode)||void 0===i?void 0:i.appendChild(n,t+r+1)}))}}},{key:"before",value:function(){if(this.parentNode){for(var e=this.parentNode.childNodes.indexOf(this),t=arguments.length,n=Array(t),r=0;t>r;r++)n[r]=arguments[r];var i=n[0],o=n.slice(1);this.parentNode.appendChild(i,e),i.after.apply(i,Nt(o))}}},{key:"replaceWith",value:function(){this.after.apply(this,arguments),this.remove()}},{key:"append",value:function(){for(var e=this,t=arguments.length,n=Array(t),r=0;t>r;r++)n[r]=arguments[r];n.forEach((function(t){return e.appendChild(t)}))}},{key:"prepend",value:function(){for(var e=this,t=arguments.length,n=Array(t),r=0;t>r;r++)n[r]=arguments[r];n.forEach((function(t,n){return e.appendChild(t,n)}))}},{key:"replaceChildren",value:function(){for(;this.childNodes.length&&this.firstChild;)this.removeChild(this.firstChild);this.append.apply(this,arguments)}},{key:"remove",value:function(){var e=0>=arguments.length||void 0===arguments[0]||arguments[0];return this.parentNode?this.parentNode.removeChild(this,e):this}},{key:"destroy",value:function(){this.dispatchEvent(new $u(e.ElementEvent.DESTROY)),this.remove(!1),this.emitter.removeAllListeners(),this.destroyed=!0}},{key:"getGeometryBounds",value:function(){return this.sceneGraphService.getGeometryBounds(this)}},{key:"getRenderBounds",value:function(){return this.sceneGraphService.getBounds(this,!0)}},{key:"getBounds",value:function(){return this.sceneGraphService.getBounds(this)}},{key:"getLocalBounds",value:function(){return this.sceneGraphService.getLocalBounds(this)}},{key:"getBoundingClientRect",value:function(){return this.sceneGraphService.getBoundingClientRect(this)}},{key:"getClientRects",value:function(){return[this.getBoundingClientRect()]}},{key:"computedStyleMap",value:function(){return new Map(Object.entries(this.computedStyle))}},{key:"getAttributeNames",value:function(){return Object.keys(this.attributes)}},{key:"getAttribute",value:function(e){var t=this.attributes[e];if(void 0===t){var n=Ct(Si(""+e,""),1);t=this.attributes[n[0]]}return Xt(t)?null:t}},{key:"hasAttribute",value:function(e){return this.getAttributeNames().includes(e)}},{key:"hasAttributes",value:function(){return!!this.getAttributeNames().length}},{key:"removeAttribute",value:function(e){this.setAttribute(e,null),delete this.attributes[e]}},{key:"setAttribute",value:function(e,t){this.attributes[e]=t}},{key:"getAttributeNS",value:function(e,t){throw Error("Method not implemented.")}},{key:"getAttributeNode",value:function(e){throw Error("Method not implemented.")}},{key:"getAttributeNodeNS",value:function(e,t){throw Error("Method not implemented.")}},{key:"hasAttributeNS",value:function(e,t){throw Error("Method not implemented.")}},{key:"removeAttributeNS",value:function(e,t){throw Error("Method not implemented.")}},{key:"removeAttributeNode",value:function(e){throw Error("Method not implemented.")}},{key:"setAttributeNS",value:function(e,t,n){throw Error("Method not implemented.")}},{key:"setAttributeNode",value:function(e){throw Error("Method not implemented.")}},{key:"setAttributeNodeNS",value:function(e){throw Error("Method not implemented.")}},{key:"toggleAttribute",value:function(e,t){throw Error("Method not implemented.")}}],[{key:"isElement",value:function(e){return!!e.getAttribute}}]),r}(tc),fc=function(e){gt(n,e);var t=xt(n);function n(e,r,i,o){var a;return dt(this,n),(a=t.call(this,e)).currentTime=void 0,a.timelineTime=void 0,a.currentTime=i,a.timelineTime=o,a.target=r,a.type="finish",a.bubbles=!1,a.currentTarget=r,a.defaultPrevented=!1,a.eventPhase=a.AT_TARGET,a.timeStamp=Date.now(),a.currentTime=i,a.timelineTime=o,a}return yt(n)}(Qu),dc=0,pc=function(){function e(t,n){dt(this,e),this.effect=void 0,this.timeline=void 0,this.id=void 0,this.currentTimePending=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this.oldPlayState=void 0,this._holdTime=void 0,this.readyPromise=void 0,this.finishedPromise=void 0,this.resolveReadyPromise=void 0,this.rejectReadyPromise=void 0,this.resolveFinishedPromise=void 0,this.rejectFinishedPromise=void 0,this.onfinish=void 0,this.oncancel=void 0,this.onframe=void 0,this._currentTime=0,this._startTime=void 0,this._playbackRate=1,this._inEffect=void 0,this._inTimeline=!0,this.onremove=void 0,this.effect=t,t.animation=this,this.timeline=n,this.id="".concat(dc++),this._inEffect=!!this.effect.update(0),this._holdTime=0,this._paused=!1,this.oldPlayState="idle",this.updatePromises()}return yt(e,[{key:"pending",get:function(){return null===this._startTime&&!this._paused&&0!==this.playbackRate||this.currentTimePending}},{key:"playState",get:function(){return this._idle?"idle":this._isFinished?"finished":this._paused?"paused":"running"}},{key:"ready",get:function(){var e=this;return this.readyPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.readyPromise=new Promise((function(t,n){e.resolveReadyPromise=function(){t(e)},e.rejectReadyPromise=function(){n(Error())}})),this.pending||this.resolveReadyPromise()),this.readyPromise}},{key:"finished",get:function(){var e=this;return this.finishedPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.finishedPromise=new Promise((function(t,n){e.resolveFinishedPromise=function(){t(e)},e.rejectFinishedPromise=function(){n(Error())}})),"finished"===this.playState&&this.resolveFinishedPromise()),this.finishedPromise}},{key:"currentTime",get:function(){return this.updatePromises(),this._idle||this.currentTimePending?null:this._currentTime},set:function(e){if(!isNaN(e=Number(e))){var t;if(this.timeline.restart(),!this._paused&&null!==this._startTime)this._startTime=Number(null===(t=this.timeline)||void 0===t?void 0:t.currentTime)-e/this.playbackRate;this.currentTimePending=!1,this._currentTime!==e&&(this._idle&&(this._idle=!1,this._paused=!0),this.tickCurrentTime(e,!0),this.timeline.applyDirtiedAnimation(this))}}},{key:"startTime",get:function(){return this._startTime},set:function(e){if(null!==e){if(this.updatePromises(),isNaN(e=Number(e)))return;if(this._paused||this._idle)return;this._startTime=e,this.tickCurrentTime((Number(this.timeline.currentTime)-this._startTime)*this.playbackRate),this.timeline.applyDirtiedAnimation(this),this.updatePromises()}}},{key:"playbackRate",get:function(){return this._playbackRate},set:function(e){if(e!==this._playbackRate){this.updatePromises();var t=this.currentTime;this._playbackRate=e,this.startTime=null,"paused"!==this.playState&&"idle"!==this.playState&&(this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this)),null!==t&&(this.currentTime=t),this.updatePromises()}}},{key:"_isFinished",get:function(){return!this._idle&&(this._playbackRate>0&&Number(this._currentTime)>=this.totalDuration||0>this._playbackRate&&0>=Number(this._currentTime))}},{key:"totalDuration",get:function(){var e;return Number(null===(e=this.effect)||void 0===e?void 0:e.getComputedTiming().endTime)}},{key:"_needsTick",get:function(){return this.pending||"running"===this.playState||!this._finishedFlag}},{key:"updatePromises",value:function(){var e=this.oldPlayState,t=this.pending?"pending":this.playState;return this.readyPromise&&t!==e&&("idle"===t?(this.rejectReadyPromise(),this.readyPromise=void 0):"pending"===e?this.resolveReadyPromise():"pending"===t&&(this.readyPromise=void 0)),this.finishedPromise&&t!==e&&("idle"===t?(this.rejectFinishedPromise(),this.finishedPromise=void 0):"finished"===t?this.resolveFinishedPromise():"finished"===e&&(this.finishedPromise=void 0)),this.oldPlayState=t,this.readyPromise||this.finishedPromise}},{key:"play",value:function(){this.updatePromises(),this._paused=!1,(this._isFinished||this._idle)&&(this.rewind(),this._startTime=null),this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this),-1===this.timeline.animations.indexOf(this)&&this.timeline.animations.push(this),this.updatePromises()}},{key:"pause",value:function(){this.updatePromises(),this.currentTime&&(this._holdTime=this.currentTime),this._isFinished||this._paused||this._idle?this._idle&&(this.rewind(),this._idle=!1):this.currentTimePending=!0,this._startTime=null,this._paused=!0,this.updatePromises()}},{key:"finish",value:function(){this.updatePromises(),this._idle||(this.currentTime=this._playbackRate>0?this.totalDuration:0,this._startTime=this.totalDuration-this.currentTime,this.currentTimePending=!1,this.timeline.applyDirtiedAnimation(this),this.updatePromises())}},{key:"cancel",value:function(){this.updatePromises(),this._inEffect&&(this._inEffect=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._startTime=null,this.effect.update(null),this.timeline.applyDirtiedAnimation(this),this.updatePromises())}},{key:"reverse",value:function(){this.updatePromises();var e=this.currentTime;this.playbackRate*=-1,this.play(),null!==e&&(this.currentTime=e),this.updatePromises()}},{key:"updatePlaybackRate",value:function(e){this.playbackRate=e}},{key:"targetAnimations",value:function(){var e;return(null===(e=this.effect)||void 0===e?void 0:e.target).getAnimations()}},{key:"markTarget",value:function(){var e=this.targetAnimations();-1===e.indexOf(this)&&e.push(this)}},{key:"unmarkTarget",value:function(){var e=this.targetAnimations(),t=e.indexOf(this);-1!==t&&e.splice(t,1)}},{key:"tick",value:function(e,t){this._idle||this._paused||(null===this._startTime?t&&(this.startTime=e-this._currentTime/this.playbackRate):this._isFinished||this.tickCurrentTime((e-this._startTime)*this.playbackRate)),t&&(this.currentTimePending=!1,this.fireEvents(e))}},{key:"rewind",value:function(){if(this.playbackRate<0){if(this.totalDuration>=1/0)throw Error("Unable to rewind negative playback rate animation with infinite duration");this.currentTime=this.totalDuration}else this.currentTime=0}},{key:"persist",value:function(){throw Error("Method not implemented.")}},{key:"addEventListener",value:function(e,t,n){throw Error("Method not implemented.")}},{key:"removeEventListener",value:function(e,t,n){throw Error("Method not implemented.")}},{key:"dispatchEvent",value:function(e){throw Error("Method not implemented.")}},{key:"commitStyles",value:function(){throw Error("Method not implemented.")}},{key:"ensureAlive",value:function(){var e,t;0>this.playbackRate&&0===this.currentTime?this._inEffect=!!(null===(e=this.effect)||void 0===e?void 0:e.update(-1)):this._inEffect=!!(null===(t=this.effect)||void 0===t?void 0:t.update(this.currentTime));this._inTimeline||!this._inEffect&&this._finishedFlag||(this._inTimeline=!0,this.timeline.animations.push(this))}},{key:"tickCurrentTime",value:function(e,t){e!==this._currentTime&&(this._currentTime=e,this._isFinished&&!t&&(this._currentTime=this._playbackRate>0?this.totalDuration:0),this.ensureAlive())}},{key:"fireEvents",value:function(e){var t=this;if(this._isFinished){if(!this._finishedFlag){if(this.onfinish){var n=new fc(null,this,this.currentTime,e);setTimeout((function(){t.onfinish&&t.onfinish(n)}))}this._finishedFlag=!0}}else{if(this.onframe&&"running"===this.playState){var r=new fc(null,this,this.currentTime,e);this.onframe(r)}this._finishedFlag=!1}}}]),e}();function yc(e,t){return Number(e.id)-Number(t.id)}var vc=function(){function e(t){var n=this;dt(this,e),this.document=void 0,this.animations=[],this.ticking=!1,this.timelineTicking=!1,this.hasRestartedThisFrame=!1,this.animationsWithPromises=[],this.inTick=!1,this.pendingEffects=[],this.currentTime=null,this.rafId=0,this.rafCallbacks=[],this.frameId=void 0,this.webAnimationsNextTick=function(e){n.currentTime=e,n.discardAnimations(),0===n.animations.length?n.timelineTicking=!1:n.requestAnimationFrame(n.webAnimationsNextTick)},this.processRafCallbacks=function(e){var t=n.rafCallbacks;n.rafCallbacks=[],Number(n.currentTime)>e&&(e=Number(n.currentTime)),n.animations.sort(yc),n.animations=n.tick(e,!0,n.animations)[0],t.forEach((function(t){t[1](e)})),n.applyPendingEffects()},this.document=t}return yt(e,[{key:"getAnimations",value:function(){return this.discardAnimations(),this.animations.slice()}},{key:"isTicking",value:function(){return this.inTick}},{key:"play",value:function(e){var t=new pc(e,this);return this.animations.push(t),this.restartWebAnimationsNextTick(),t.updatePromises(),t.play(),t.updatePromises(),t}},{key:"applyDirtiedAnimation",value:function(e){var t=this;if(!this.inTick){e.markTarget();var n=e.targetAnimations();n.sort(yc),this.tick(Number(this.currentTime),!1,n.slice())[1].forEach((function(e){var n=t.animations.indexOf(e);-1!==n&&t.animations.splice(n,1)})),this.applyPendingEffects()}}},{key:"restart",value:function(){return this.ticking||(this.ticking=!0,this.requestAnimationFrame((function(){})),this.hasRestartedThisFrame=!0),this.hasRestartedThisFrame}},{key:"destroy",value:function(){this.document.defaultView.cancelAnimationFrame(this.frameId)}},{key:"applyPendingEffects",value:function(){this.pendingEffects.forEach((function(e){null==e||e.applyInterpolations()})),this.pendingEffects=[]}},{key:"updateAnimationsPromises",value:function(){this.animationsWithPromises=this.animationsWithPromises.filter((function(e){return e.updatePromises()}))}},{key:"discardAnimations",value:function(){this.updateAnimationsPromises(),this.animations=this.animations.filter((function(e){return"finished"!==e.playState&&"idle"!==e.playState}))}},{key:"restartWebAnimationsNextTick",value:function(){this.timelineTicking||(this.timelineTicking=!0,this.requestAnimationFrame(this.webAnimationsNextTick))}},{key:"rAF",value:function(e){var t=this.rafId++;return 0===this.rafCallbacks.length&&(this.frameId=this.document.defaultView.requestAnimationFrame(this.processRafCallbacks)),this.rafCallbacks.push([t,e]),t}},{key:"requestAnimationFrame",value:function(e){var t=this;return this.rAF((function(n){t.updateAnimationsPromises(),e(n),t.updateAnimationsPromises()}))}},{key:"tick",value:function(e,t,n){var r,i,o=this;this.inTick=!0,this.hasRestartedThisFrame=!1,this.currentTime=e,this.ticking=!1;var a=[],s=[],u=[],c=[];return n.forEach((function(n){n.tick(e,t),n._inEffect?(s.push(n.effect),n.markTarget()):(a.push(n.effect),n.unmarkTarget()),n._needsTick&&(o.ticking=!0);var r=n._inEffect||n._needsTick;n._inTimeline=r,r?u.push(n):c.push(n)})),(r=this.pendingEffects).push.apply(r,a),(i=this.pendingEffects).push.apply(i,s),this.ticking&&this.requestAnimationFrame((function(){})),this.inTick=!1,[u,c]}}]),e}();e.DisplayObjectPool=function(){function t(){dt(this,t),this.pool={},this.htmlPool=[]}return yt(t,[{key:"getByEntity",value:function(e){return this.pool[e]}},{key:"add",value:function(t,n){this.pool[t]=n,n.nodeName===e.Shape.HTML&&this.htmlPool.push(n)}},{key:"remove",value:function(t){var n=this.pool[t];if(delete this.pool[t],n.nodeName===e.Shape.HTML){var r=this.htmlPool.indexOf(n);this.htmlPool.splice(r,1)}}},{key:"getHTMLs",value:function(){return this.htmlPool}}]),t}(),e.DisplayObjectPool=It([ce()],e.DisplayObjectPool);var gc,mc,kc={anchor:"",opacity:"",fillOpacity:"",strokeOpacity:"",fill:"",stroke:"",transform:"",transformOrigin:"",visibility:"",pointerEvents:"",lineWidth:"",lineCap:"",lineJoin:"",increasedLineWidthForHitTesting:"",fontSize:"",fontFamily:"",fontStyle:"",fontWeight:"",fontVariant:"",textAlign:"",textBaseline:"",textTransform:""},Tc=function(t){gt(r,t);var n=xt(r);function r(t){var i,o,a,s;return dt(this,r),(s=n.call(this)).config=void 0,s.styleValueRegistry=Ve.get(ii),s.isCustomElement=!1,s.activeAnimations=[],s.config=t,s.config.interactive=null!==(i=s.config.capture)&&void 0!==i?i:s.config.interactive,s.id=s.config.id||"",s.name=s.config.name||"",(s.config.className||s.config.class)&&(s.className=s.config.className||s.config.class),s.nodeName=s.config.type||e.Shape.GROUP,s.config.style=ut(ut(ut({},kc),{},{zIndex:null!==(o=s.config.zIndex)&&void 0!==o?o:0,interactive:null===(a=s.config.interactive)||void 0===a||a},s.config.style),s.config.attrs),null!=s.config.visible&&(s.config.style.visibility=!1===s.config.visible?"hidden":"visible"),null!=s.config.interactive&&(s.config.style.pointerEvents=!1===s.config.interactive?"none":"auto"),s.style=new Proxy(ut(ut({},s.attributes),{},{setProperty:function(e,t){s.setAttribute(e,t)},getPropertyValue:function(e){return s.getAttribute(e)},removeProperty:function(e){s.removeAttribute(e)},item:function(){return""}}),{get:function(e,t){return void 0!==e[t]?e[t]:s.getAttribute(t)},set:function(e,t,n){return s.setAttribute(t,n),!0}}),s.initAttributes(s.config.style),Ve.get(e.DisplayObjectPool).add(s.entity,Et(s)),s}return yt(r,[{key:"destroy",value:function(){_t(mt(r.prototype),"destroy",this).call(this),Ve.get(e.DisplayObjectPool).remove(this.entity),this.getAnimations().forEach((function(e){e.cancel()}))}},{key:"cloneNode",value:function(e){var t=new this.constructor({id:this.id,name:this.name,className:this.name,interactive:this.interactive,style:ut({},this.attributes)});return t.setLocalTransform(this.getLocalTransform()),e&&this.children.forEach((function(n){var r=n.cloneNode(e);t.appendChild(r)})),t}},{key:"initAttributes",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.renderable;this.styleValueRegistry.processProperties(this,e),t.dirty=!0}},{key:"setAttribute",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=Si(e,t),o=Ct(i,2),a=o[0],s=o[1];qt(t)||(n||s!==this.attributes[a])&&(this.internalSetAttribute(a,s),_t(mt(r.prototype),"setAttribute",this).call(this,a,s))}},{key:"internalSetAttribute",value:function(t,n){var r=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=this.renderable,a=this.attributes[t],s=this.parsedStyle[t];this.styleValueRegistry.processProperties(this,vt({},t,n),i),this.attributes.clipPathTargets&&this.attributes.clipPathTargets.length&&this.attributes.clipPathTargets.forEach((function(t){ml(t),t.dispatchEvent(new cc(e.ElementEvent.ATTR_MODIFIED,t,r,r,"clipPath",cc.MODIFICATION,r,r)),t.isCustomElement&&t.isConnected&&t.attributeChangedCallback&&t.attributeChangedCallback("clipPath",r,r)})),o.dirty=!0,this.dispatchEvent(new cc(e.ElementEvent.ATTR_MODIFIED,this,a,n,t,cc.MODIFICATION,s,this.parsedStyle[t])),this.isCustomElement&&this.isConnected&&this.attributeChangedCallback&&this.attributeChangedCallback(t,a,n)}},{key:"getBBox",value:function(){var e=this.getBounds(),t=Ct(e.getMin(),2),n=t[0],r=t[1],i=Ct(e.getMax(),2);return new qs(n,r,i[0]-n,i[1]-r)}},{key:"setOrigin",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.sceneGraphService.setOrigin(this,br(e,t,n)),this}},{key:"getOrigin",value:function(){return this.sceneGraphService.getOrigin(this)}},{key:"setPosition",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.sceneGraphService.setPosition(this,br(e,t,n)),this}},{key:"setLocalPosition",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.sceneGraphService.setLocalPosition(this,br(e,t,n)),this}},{key:"translate",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.sceneGraphService.translate(this,br(e,t,n)),this}},{key:"translateLocal",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.sceneGraphService.translateLocal(this,br(e,t,n)),this}},{key:"getPosition",value:function(){return this.sceneGraphService.getPosition(this)}},{key:"getLocalPosition",value:function(){return this.sceneGraphService.getLocalPosition(this)}},{key:"scale",value:function(e,t,n){return this.scaleLocal(e,t,n)}},{key:"scaleLocal",value:function(e,t,n){return"number"==typeof e&&(e=br(e,t=t||e,n=n||e)),this.sceneGraphService.scaleLocal(this,e),this}},{key:"setLocalScale",value:function(e,t,n){return"number"==typeof e&&(e=br(e,t=t||e,n=n||e)),this.sceneGraphService.setLocalScale(this,e),this}},{key:"getLocalScale",value:function(){return this.sceneGraphService.getLocalScale(this)}},{key:"getScale",value:function(){return this.sceneGraphService.getScale(this)}},{key:"getEulerAngles",value:function(){var e=Ct(Pr(On(),this.sceneGraphService.getWorldTransform(this)),3);return Sr(e[2])}},{key:"getLocalEulerAngles",value:function(){var e=Ct(Pr(On(),this.sceneGraphService.getLocalRotation(this)),3);return Sr(e[2])}},{key:"setEulerAngles",value:function(e){return this.sceneGraphService.setEulerAngles(this,0,0,e),this}},{key:"setLocalEulerAngles",value:function(e){return this.sceneGraphService.setLocalEulerAngles(this,0,0,e),this}},{key:"rotateLocal",value:function(e,t,n){return Xt(t)&&Xt(n)?this.sceneGraphService.rotateLocal(this,0,0,e):this.sceneGraphService.rotateLocal(this,e,t,n),this}},{key:"rotate",value:function(e,t,n){return Xt(t)&&Xt(n)?this.sceneGraphService.rotate(this,0,0,e):this.sceneGraphService.rotate(this,e,t,n),this}},{key:"setRotation",value:function(e,t,n,r){return this.sceneGraphService.setRotation(this,e,t,n,r),this}},{key:"setLocalRotation",value:function(e,t,n,r){return this.sceneGraphService.setLocalRotation(this,e,t,n,r),this}},{key:"getRotation",value:function(){return this.sceneGraphService.getRotation(this)}},{key:"getLocalRotation",value:function(){return this.sceneGraphService.getLocalRotation(this)}},{key:"getLocalTransform",value:function(){return this.sceneGraphService.getLocalTransform(this)}},{key:"getWorldTransform",value:function(){return this.sceneGraphService.getWorldTransform(this)}},{key:"setLocalTransform",value:function(e){return this.sceneGraphService.setLocalTransform(this,e),this}},{key:"resetLocalTransform",value:function(){this.sceneGraphService.resetLocalTransform(this)}},{key:"getAnimations",value:function(){return this.activeAnimations}},{key:"animate",value:function(e,t){var n,r,i=null===(n=this.ownerDocument)||void 0===n?void 0:n.timeline;this.attributes.clipPathTargets&&this.attributes.clipPathTargets.length&&(i=null===(r=this.attributes.clipPathTargets[0].ownerDocument)||void 0===r?void 0:r.timeline);return delete this.parsedStyle.transform,i?i.play(new fl(this,e,t)):null}},{key:"show",value:function(){this.style.visibility="visible"}},{key:"hide",value:function(){this.style.visibility="hidden"}},{key:"isVisible",value:function(){var e,t;return"visible"===(null===(e=this.parsedStyle)||void 0===e||null===(t=e.visibility)||void 0===t?void 0:t.value)}},{key:"interactive",get:function(){return this.isInteractive()},set:function(e){this.style.pointerEvents=e?"auto":"none"}},{key:"isInteractive",value:function(){var e,t;return"none"!==(null===(e=this.parsedStyle)||void 0===e||null===(t=e.pointerEvents)||void 0===t?void 0:t.value)}},{key:"isCulled",value:function(){return!(!this.cullable||!this.cullable.isCulled())}},{key:"toFront",value:function(){return this.parentNode&&(this.style.zIndex=Math.max.apply(Math,Nt(this.parentNode.children.map((function(e){return Number(e.style.zIndex)}))))+1),this}},{key:"toBack",value:function(){return this.parentNode&&(this.style.zIndex=Math.min.apply(Math,Nt(this.parentNode.children.map((function(e){return Number(e.style.zIndex)}))))-1),this}},{key:"getCount",value:function(){return this.childElementCount}},{key:"getParent",value:function(){return this.parentElement}},{key:"getChildren",value:function(){return this.children}},{key:"getFirst",value:function(){return this.firstElementChild}},{key:"getLast",value:function(){return this.lastElementChild}},{key:"getChildByIndex",value:function(e){return this.children[e]||null}},{key:"add",value:function(e,t){return this.appendChild(e,t)}},{key:"setClip",value:function(e){this.style.clipPath=e}},{key:"getClip",value:function(){return this.style.clipPath||null}},{key:"set",value:function(e,t){this.config[e]=t}},{key:"get",value:function(e){return this.config[e]}},{key:"getConfig",value:function(){return this.config}},{key:"attr",value:function(){for(var e=this,t=arguments.length,n=Array(t),r=0;t>r;r++)n[r]=arguments[r];var i=n[0],o=n[1];return i?Qt(i)?(Object.keys(i).forEach((function(t){e.setAttribute(t,i[t])})),this):2===n.length?(this.setAttribute(i,o),this):this.attributes[i]:this.attributes}},{key:"moveTo",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.setPosition(e,t,n),this}},{key:"move",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.setPosition(e,t,n),this}},{key:"setZIndex",value:function(e){return this.style.zIndex=e,this}},{key:"getMatrix",value:function(e){var t=e||this.getWorldTransform(),n=Ct(xn(On(),t),2),r=n[0],i=n[1],o=Ct(wn(On(),t),2),a=o[0],s=o[1],u=_n(rr(),t),c=Ct(Pr(On(),u),3);return xr(c[0]||c[2],r,i,a,s)}},{key:"getLocalMatrix",value:function(){return this.getMatrix(this.getLocalTransform())}},{key:"setMatrix",value:function(e){var t=Ct(_r(e),5),n=t[0],r=t[1],i=t[2],o=t[3];this.setEulerAngles(t[4]).setPosition(n,r).setLocalScale(i,o)}},{key:"setLocalMatrix",value:function(e){var t=Ct(_r(e),5),n=t[0],r=t[1],i=t[2],o=t[3];this.setLocalEulerAngles(t[4]).setLocalPosition(n,r).setLocalScale(i,o)}}]),r}(hc),bc=["style"],Sc=function(e){gt(n,e);var t=xt(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=r.style,o=St(r,bc);return dt(this,n),(e=t.call(this,ut({style:ut({x:"",y:""},i)},o))).isCustomElement=!0,e}return yt(n)}(Tc),Ec=["style"],Pc=function(t){gt(r,t);var n=xt(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=t.style,o=St(t,Ec);return dt(this,r),n.call(this,ut({type:e.Shape.CIRCLE,style:ut({cx:"",cy:"",r:"",anchor:"0.5 0.5",transformOrigin:"center"},i)},o))}return yt(r)}(Tc),xc=["style"],wc=function(t){gt(r,t);var n=xt(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=t.style,o=St(t,xc);return dt(this,r),n.call(this,ut({type:e.Shape.ELLIPSE,style:ut({cx:"",cy:"",rx:"",ry:"",anchor:"0.5 0.5",transformOrigin:"center"},i)},o))}return yt(r)}(Tc),_c=["style"],Cc=function(t){gt(r,t);var n=xt(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=t.style,o=St(t,_c);return dt(this,r),n.call(this,ut({type:e.Shape.GROUP,style:ut({x:"",y:"",width:"",height:""},i)},o))}return yt(r)}(Tc),Nc=["style"],Mc=function(t){gt(r,t);var n=xt(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=t.style,o=St(t,Nc);return dt(this,r),n.call(this,ut({type:e.Shape.IMAGE,style:ut({x:"",y:"",img:"",width:"",height:""},i)},o))}return yt(r)}(Tc),Ac=["style"],Oc=function(t){gt(r,t);var n=xt(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=t.style,o=St(t,Ac);return dt(this,r),n.call(this,ut({type:e.Shape.LINE,style:ut({x1:0,y1:0,x2:0,y2:0,z1:0,z2:0,isBillboard:!1},i)},o))}return yt(r,[{key:"getPoint",value:function(e){var t=this.parsedStyle,n=Ci.pointAt(t.x1.value,t.y1.value,t.x2.value,t.y2.value,e);return new Ys(n.x,n.y)}},{key:"getTotalLength",value:function(){var e=this.parsedStyle;return Ci.length(e.x1.value,e.y1.value,e.x2.value,e.y2.value)}}]),r}(Tc),Ic=["style"],Rc=function(t){gt(r,t);var n=xt(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=t.style,o=St(t,Ic);return dt(this,r),n.call(this,ut({type:e.Shape.PATH,style:ut({path:"",miterLimit:4},i)},o))}return yt(r,[{key:"getTotalLength",value:function(){return this.parsedStyle.path.totalLength}},{key:"getPoint",value:function(e){var t=0,n=0,r=this.parsedStyle.path.curve;if(!this.parsedStyle.path.curveSegments.length)return r?new Ys(r[0][1],r[0][2]):null;this.parsedStyle.path.curveSegments.forEach((function(r,i){r[0]>e||e>r[1]||(t=(e-r[0])/(r[1]-r[0]),n=i)}));var i=r[n];if(Xt(i)||Xt(n))return null;var o=i.length,a=r[n+1],s=Ri.pointAt(i[o-2],i[o-1],a[1],a[2],a[3],a[4],a[5],a[6],t);return new Ys(s.x,s.y)}},{key:"getStartTangent",value:function(){var e=this.parsedStyle.path.segments,t=[];if(e.length>1){var n=e[0].currentPoint,r=e[1].currentPoint,i=e[1].startTangent;t=[],i?(t.push([n[0]-i[0],n[1]-i[1]]),t.push([n[0],n[1]])):(t.push([r[0],r[1]]),t.push([n[0],n[1]]))}return t}},{key:"getEndTangent",value:function(){var e=this.parsedStyle.path.segments,t=e.length,n=[];if(t>1){var r=e[t-2].currentPoint,i=e[t-1].currentPoint,o=e[t-1].endTangent;n=[],o?(n.push([i[0]-o[0],i[1]-o[1]]),n.push([i[0],i[1]])):(n.push([r[0],r[1]]),n.push([i[0],i[1]]))}return n}}]),r}(Tc),Lc=["style"],Dc=function(t){gt(r,t);var n=xt(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=t.style,o=St(t,Lc);return dt(this,r),n.call(this,ut({type:e.Shape.POLYGON,style:ut({points:"",miterLimit:4},i)},o))}return yt(r)}(Tc),Uc=["style"],Fc=function(t){gt(r,t);var n=xt(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=t.style,o=St(t,Uc);return dt(this,r),n.call(this,ut({type:e.Shape.POLYLINE,style:ut({points:"",miterLimit:4},i)},o))}return yt(r,[{key:"getTotalLength",value:function(){return this.parsedStyle.points.totalLength}},{key:"getPoint",value:function(e){var t=this.parsedStyle.points,n=t.points,r=0,i=0;t.segments.forEach((function(t,n){t[0]>e||e>t[1]||(r=(e-t[0])/(t[1]-t[0]),i=n)}));var o=Ci.pointAt(n[i][0],n[i][1],n[i+1][0],n[i+1][1],r);return new Ys(o.x,o.y)}},{key:"getStartTangent",value:function(){var e=this.parsedStyle.points.points,t=[];return t.push([e[1][0],e[1][1]]),t.push([e[0][0],e[0][1]]),t}},{key:"getEndTangent",value:function(){var e=this.parsedStyle.points.points,t=e.length-1,n=[];return n.push([e[t-1][0],e[t-1][1]]),n.push([e[t][0],e[t][1]]),n}}]),r}(Tc),Bc=["style"],Vc=function(t){gt(r,t);var n=xt(r);function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=t.style,o=St(t,Bc);return dt(this,r),n.call(this,ut({type:e.Shape.RECT,style:ut({x:"",y:"",width:"",height:"",radius:""},i)},o))}return yt(r)}(Tc),jc=["style"],Gc=function(t){gt(r,t);var n=xt(r);function r(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=i.style,a=St(i,jc);return dt(this,r),(t=n.call(this,ut({type:e.Shape.TEXT,style:ut({x:"",y:"",text:"",fontSize:"",fontFamily:"",fontStyle:"",fontWeight:"",fontVariant:"",textAlign:"",textBaseline:"",textTransform:"",fill:"black",letterSpacing:0,lineHeight:0,miterLimit:10,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:0,leading:0,dx:"",dy:""},o)},a))).LENGTHADJUST_SPACING=1,t.LENGTHADJUST_SPACINGANDGLYPHS=2,t.LENGTHADJUST_UNKNOWN=0,t.lengthAdjust=void 0,t.textLength=void 0,t}return yt(r,[{key:"getCharNumAtPosition",value:function(e){throw Error("Method not implemented.")}},{key:"getComputedTextLength",value:function(){var e;return(null===(e=this.parsedStyle.metrics)||void 0===e?void 0:e.maxLineWidth)||0}},{key:"getEndPositionOfChar",value:function(e){throw Error("Method not implemented.")}},{key:"getExtentOfChar",value:function(e){throw Error("Method not implemented.")}},{key:"getNumberOfChars",value:function(){throw Error("Method not implemented.")}},{key:"getRotationOfChar",value:function(e){throw Error("Method not implemented.")}},{key:"getStartPositionOfChar",value:function(e){throw Error("Method not implemented.")}},{key:"getSubStringLength",value:function(e,t){throw Error("Method not implemented.")}},{key:"selectSubString",value:function(e,t){throw Error("Method not implemented.")}},{key:"getLineBoundingRects",value:function(){var e;return(null===(e=this.parsedStyle.metrics)||void 0===e?void 0:e.lineMetrics)||[]}}]),r}(Tc),zc=["style"],Hc=function(t){gt(r,t);var n=xt(r);function r(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=i.style,a=St(i,zc);return dt(this,r),(t=n.call(this,ut({type:e.Shape.HTML,style:ut({x:"",y:"",width:"auto",height:"auto",innerHTML:""},o)},a))).cullable.enable=!1,t}return yt(r,[{key:"getDomElement",value:function(){return this.parsedStyle.$el}},{key:"getBoundingClientRect",value:function(){return this.parsedStyle.$el.getBoundingClientRect()}},{key:"getClientRects",value:function(){return[this.getBoundingClientRect()]}},{key:"getBounds",value:function(){var e,t,n=this.getBoundingClientRect(),r=null===(e=this.ownerDocument)||void 0===e||null===(t=e.defaultView)||void 0===t?void 0:t.getContextService().getBoundingClientRect();if(r){var i=n.left-r.left,o=n.top-r.top,a=new Ls;return a.setMinMax(Ln(i,o,0),Ln(i+n.width,o+n.height,0)),a}return null}},{key:"getLocalBounds",value:function(){if(this.parentNode){var e=kn(yn(),this.parentNode.getWorldTransform()),t=this.getBounds();if(!Ls.isEmpty(t)){var n=new Ls;return n.setFromTransformedAABB(t,e),n}}return this.getBounds()}}]),r}(Tc),Wc=function(e){gt(i,e);var t,n,r=xt(i);function i(){var e;dt(this,i),(e=r.call(this)).defaultView=null,e.documentElement=void 0,e.timeline=void 0,e.ownerDocument=null,e.nodeName="document",e.timeline=new vc(Et(e));var t={};return Vl.forEach((function(e){var n=e.defaultValue;e.inherited&&n&&(t[e.name]=n)})),e.documentElement=new Cc({id:"g-root",style:t}),e.documentElement.ownerDocument=Et(e),e.documentElement.parentNode=Et(e),e.childNodes=[e.documentElement],e}return yt(i,[{key:"children",get:function(){return this.childNodes}},{key:"childElementCount",get:function(){return this.childNodes.length}},{key:"firstElementChild",get:function(){return this.firstChild}},{key:"lastElementChild",get:function(){return this.lastChild}},{key:"createElement",value:function(e,t){var n=this.defaultView.customElements.get(e);return n||(console.warn("Unsupported tagName: ",e),n="tspan"===e?Gc:Cc),new n(t)}},{key:"createElementNS",value:function(e,t,n){return this.createElement(t,n)}},{key:"cloneNode",value:function(e){throw Error("Method not implemented.")}},{key:"destroy",value:function(){try{this.documentElement.destroy()}catch(e){}this.timeline.destroy()}},{key:"elementFromPoint",value:(n=ft(ct().mark((function e(t,n){var r,i,o,a,s,u,c,l,h,f;return ct().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=this.defaultView.canvas2Viewport({x:t,y:n}),i=r.x,o=r.y,a=this.defaultView.getConfig(),s=a.width,u=a.height,!(0>i||0>o||i>s||o>u)){e.next=4;break}return e.abrupt("return",null);case 4:return c=this.defaultView.viewport2Client({x:i,y:o}),l=c.x,h=c.y,e.next=7,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!0,position:{x:t,y:n,viewportX:i,viewportY:o,clientX:l,clientY:h},picked:[]});case 7:return e.abrupt("return",(f=e.sent.picked)&&f[0]||this.documentElement);case 10:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"elementsFromPoint",value:(t=ft(ct().mark((function e(t,n){var r,i,o,a,s,u,c,l,h,f;return ct().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=this.defaultView.canvas2Viewport({x:t,y:n}),i=r.x,o=r.y,a=this.defaultView.getConfig(),s=a.width,u=a.height,!(0>i||0>o||i>s||o>u)){e.next=4;break}return e.abrupt("return",[]);case 4:return c=this.defaultView.viewport2Client({x:i,y:o}),l=c.x,h=c.y,e.next=7,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!1,position:{x:t,y:n,viewportX:i,viewportY:o,clientX:l,clientY:h},picked:[]});case 7:return(f=e.sent.picked)[f.length-1]!==this.documentElement&&f.push(this.documentElement),e.abrupt("return",f);case 11:case"end":return e.stop()}}),e,this)}))),function(e,n){return t.apply(this,arguments)})},{key:"appendChild",value:function(e,t){throw Error("Use document.documentElement instead.")}},{key:"insertBefore",value:function(e,t){throw Error("Use document.documentElement instead.")}},{key:"removeChild",value:function(e,t){throw Error("Use document.documentElement instead.")}},{key:"replaceChild",value:function(e,t,n){throw Error("Use document.documentElement instead.")}},{key:"append",value:function(){throw Error("Use document.documentElement instead.")}},{key:"prepend",value:function(){throw Error("Use document.documentElement instead.")}},{key:"getElementById",value:function(e){return this.documentElement.getElementById(e)}},{key:"getElementsByName",value:function(e){return this.documentElement.getElementsByName(e)}},{key:"getElementsByTagName",value:function(e){return this.documentElement.getElementsByTagName(e)}},{key:"getElementsByClassName",value:function(e){return this.documentElement.getElementsByClassName(e)}},{key:"querySelector",value:function(e){return this.documentElement.querySelector(e)}},{key:"querySelectorAll",value:function(e){return this.documentElement.querySelectorAll(e)}},{key:"find",value:function(e){return this.documentElement.find(e)}},{key:"findAll",value:function(e){return this.documentElement.findAll(e)}}]),i}(tc),Yc=function(e){gt(n,e);var t=xt(n);function n(){var e;dt(this,n);for(var r=arguments.length,i=Array(r),o=0;r>o;o++)i[o]=arguments[o];return(e=t.call.apply(t,[this].concat(i))).altKey=void 0,e.button=void 0,e.buttons=void 0,e.ctrlKey=void 0,e.metaKey=void 0,e.relatedTarget=void 0,e.shiftKey=void 0,e.client=new Ys,e.movement=new Ys,e.offset=new Ys,e.global=new Ys,e.screen=new Ys,e}return yt(n,[{key:"clientX",get:function(){return this.client.x}},{key:"clientY",get:function(){return this.client.y}},{key:"movementX",get:function(){return this.movement.x}},{key:"movementY",get:function(){return this.movement.y}},{key:"offsetX",get:function(){return this.offset.x}},{key:"offsetY",get:function(){return this.offset.y}},{key:"globalX",get:function(){return this.global.x}},{key:"globalY",get:function(){return this.global.y}},{key:"screenX",get:function(){return this.screen.x}},{key:"screenY",get:function(){return this.screen.y}},{key:"getModifierState",value:function(e){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(e)}},{key:"initMouseEvent",value:function(){throw Error("Method not implemented.")}}]),n}(Qu),qc=function(e){gt(n,e);var t=xt(n);function n(){var e;dt(this,n);for(var r=arguments.length,i=Array(r),o=0;r>o;o++)i[o]=arguments[o];return(e=t.call.apply(t,[this].concat(i))).pointerId=void 0,e.width=0,e.height=0,e.isPrimary=!1,e.pointerType=void 0,e.pressure=void 0,e.tangentialPressure=void 0,e.tiltX=void 0,e.tiltY=void 0,e.twist=void 0,e}return yt(n,[{key:"getCoalescedEvents",value:function(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]}},{key:"getPredictedEvents",value:function(){throw Error("getPredictedEvents is not supported!")}}]),n}(Yc),Xc=function(e){gt(n,e);var t=xt(n);function n(){var e;dt(this,n);for(var r=arguments.length,i=Array(r),o=0;r>o;o++)i[o]=arguments[o];return(e=t.call.apply(t,[this].concat(i))).deltaMode=void 0,e.deltaX=void 0,e.deltaY=void 0,e.deltaZ=void 0,e.DOM_DELTA_LINE=0,e.DOM_DELTA_PAGE=1,e.DOM_DELTA_PIXEL=2,e}return yt(n)}(Yc),Kc=function(){function e(){dt(this,e),this.delay=0,this.direction="normal",this.duration="auto",this._easing="linear",this.easingFunction=oi,this.endDelay=0,this.fill="auto",this.iterationStart=0,this.iterations=1,this.playbackRate=void 0,this.effect=void 0,this.composite=void 0,this.activeDuration=void 0,this.endTime=void 0,this.currentIteration=null,this.progress=null}return yt(e,[{key:"easing",get:function(){return this._easing},set:function(e){this.easingFunction=li(e),this._easing=e}}]),e}(),Zc=function(){function e(t,n){dt(this,e),this.type=void 0,this.target=void 0,this.addedNodes=[],this.attributeName=null,this.attributeNamespace=null,this.nextSibling=null,this.oldValue=null,this.previousSibling=null,this.removedNodes=[],this.type=t,this.target=n}return yt(e,null,[{key:"copy",value:function(t){var n=new e(t.type,t.target);return n.addedNodes=t.addedNodes.slice(),n.removedNodes=t.removedNodes.slice(),n.previousSibling=t.previousSibling,n.nextSibling=t.nextSibling,n.attributeName=t.attributeName,n.attributeNamespace=t.attributeNamespace,n.oldValue=t.oldValue,n}}]),e}(),Jc=0,Qc=new WeakMap,$c=function(){function t(e,n,r){dt(this,t),this.observer=void 0,this.target=void 0,this.options=void 0,this.transientObservedNodes=[],this.observer=e,this.target=n,this.options=r}return yt(t,[{key:"enqueue",value:function(e){var t=this.observer.records,n=t.length;if(t.length>0){var r=function(e,t){return e===t?e:mc&&function(e){return e===mc||e===gc}(e)?mc:null}(t[n-1],e);if(r)return void(t[n-1]=r)}else il.push(this.observer),rl||(rl=!0,"undefined"!=typeof globalThis?globalThis.setTimeout(ol):ol());t[n]=e}},{key:"addListeners",value:function(){this.addListeners_(this.target)}},{key:"addListeners_",value:function(t){var n=this.options;n.attributes&&t.addEventListener(e.ElementEvent.ATTR_MODIFIED,this,!0),n.childList&&t.addEventListener(e.ElementEvent.INSERTED,this,!0),(n.childList||n.subtree)&&t.addEventListener(e.ElementEvent.REMOVED,this,!0)}},{key:"removeListeners",value:function(){this.removeListeners_(this.target)}},{key:"removeListeners_",value:function(t){var n=this.options;n.attributes&&t.removeEventListener(e.ElementEvent.ATTR_MODIFIED,this,!0),n.childList&&t.removeEventListener(e.ElementEvent.INSERTED,this,!0),(n.childList||n.subtree)&&t.removeEventListener(e.ElementEvent.REMOVED,this,!0)}},{key:"removeTransientObservers",value:function(){var e=this.transientObservedNodes;this.transientObservedNodes=[],e.forEach((function(e){this.removeListeners_(e);for(var t=Qc.get(e),n=0;t.length>n;n++)if(t[n]===this){t.splice(n,1);break}}),this)}},{key:"handleEvent",value:function(t){var n,r;switch(t.stopImmediatePropagation(),t.type){case e.ElementEvent.ATTR_MODIFIED:var i=t.attrName,o=t.relatedNode.namespaceURI;(n=tl("attributes",r=t.target)).attributeName=i,n.attributeNamespace=o;var a=t.attrChange===cc.ADDITION?null:t.prevValue;nl(r,(function(e){if(e.attributes&&(!e.attributeFilter||!e.attributeFilter.length||-1!==e.attributeFilter.indexOf(i)||-1!==e.attributeFilter.indexOf(o)))return e.attributeOldValue?function(e){return mc||((mc=Zc.copy(gc)).oldValue=e,mc)}(a):n}));break;case e.ElementEvent.REMOVED:case e.ElementEvent.INSERTED:var s,u,c=t.target;t.type===e.ElementEvent.INSERTED?(s=[c],u=[]):(s=[],u=[c]);var l=c.previousSibling,h=c.nextSibling;(n=tl("childList",r=t.relatedNode)).addedNodes=s,n.removedNodes=u,n.previousSibling=l,n.nextSibling=h,nl(r,(function(e){if(e.childList)return n}))}gc=mc=void 0}}]),t}(),el=function(){function e(t){dt(this,e),this.callback=void 0,this.nodes=[],this.records=[],this.uid=Jc++,this.callback=t}return yt(e,[{key:"observe",value:function(e,t){if(!t.childList&&!t.attributes&&!t.characterData||t.attributeOldValue&&!t.attributes||t.attributeFilter&&t.attributeFilter.length&&!t.attributes||t.characterDataOldValue&&!t.characterData)throw new SyntaxError;var n,r=Qc.get(e);r||Qc.set(e,r=[]);for(var i=0;r.length>i;i++)if(r[i].observer===this){(n=r[i]).removeListeners(),n.options=t;break}n||(n=new $c(this,e,t),r.push(n),this.nodes.push(e)),n.addListeners()}},{key:"disconnect",value:function(){var e=this;this.nodes.forEach((function(t){for(var n=Qc.get(t),r=0;n.length>r;r++){var i=n[r];if(i.observer===e){i.removeListeners(),n.splice(r,1);break}}}),this),this.records=[]}},{key:"takeRecords",value:function(){var e=this.records;return this.records=[],e}}]),e}();function tl(e,t){return gc=new Zc(e,t)}function nl(e,t){for(var n=e;n;n=n.parentNode){var r=Qc.get(n);if(r)for(var i=0;r.length>i;i++){var o=r[i],a=o.options;if(n===e||a.subtree){var s=t(a);s&&o.enqueue(s)}}}}var rl=!1,il=[];function ol(){rl=!1;var e=il;il=[],e.sort((function(e,t){return e.uid-t.uid}));var t=!1;e.forEach((function(e){var n=e.takeRecords();!function(e){e.nodes.forEach((function(t){var n=Qc.get(t);n&&n.forEach((function(t){t.observer===e&&t.removeTransientObservers()}))}))}(e),n.length&&(e.callback(n,e),t=!0)})),t&&ol()}function al(e,t){if(null===e)return[];Array.isArray(e)||(e=function(e){var t=[];for(var n in e)if(!(n in["easing","offset","composite"])){var r=e[n];Array.isArray(r)||(r=[r]);for(var i=r.length,o=0;i>o;o++){if(!t[o]){var a={};"offset"in e&&(a.offset=Number(e.offset)),"easing"in e&&(a.easing=e.easing),"composite"in e&&(a.composite=e.composite),t[o]=a}null!=r[o]&&(t[o][n]=r[o])}}return t.sort((function(e,t){return(e.computedOffset||0)-(t.computedOffset||0)})),t}(e));for(var n=e.map((function(e){var n={};for(var r in(null==t?void 0:t.composite)&&(n.composite="auto"),e){var i=e[r];if("offset"===r){if(null!==i){if(!isFinite(i=Number(i)))throw Error("Keyframe offsets must be numbers.");if(0>i||i>1)throw Error("Keyframe offsets must be between 0 and 1.");n.computedOffset=i}}else if("composite"===r&&-1===["replace","add","accumulate","auto"].indexOf(i))throw Error("".concat(i," compositing is not supported"));n[r]=i}return void 0===n.offset&&(n.offset=null),void 0===n.easing&&(n.easing=(null==t?void 0:t.easing)||"linear"),void 0===n.composite&&(n.composite="auto"),n})),r=!0,i=-1/0,o=0;n.length>o;o++){var a=n[o].offset;if(Xt(a))r=!1;else{if(i>a)throw new TypeError("Keyframes are not loosely sorted by offset. Sort or specify offsets.");i=a}}return n=n.filter((function(e){return Number(e.offset)>=0&&1>=Number(e.offset)})),r||function(){var e,t,r=n.length;n[r-1].computedOffset=Number(null!==(e=n[r-1].offset)&&void 0!==e?e:1),r>1&&(n[0].computedOffset=Number(null!==(t=n[0].offset)&&void 0!==t?t:0));for(var i=0,o=Number(n[0].computedOffset),a=1;r>a;a++){var s=n[a].computedOffset;if(!Xt(s)&&!Xt(o)){for(var u=1;a-i>u;u++)n[i+u].computedOffset=o+(Number(s)-o)*u/(a-i);i=a,o=Number(s)}}}(),n}var sl="backwards|forwards|both|none".split("|"),ul="reverse|alternate|alternate-reverse".split("|");function cl(e,t){var n=new Kc;return t&&(n.fill="both",n.duration="auto"),"number"!=typeof e||isNaN(e)?void 0!==e&&Object.keys(e).forEach((function(t){if(null!=e[t]&&"auto"!==e[t]){if(("number"==typeof n[t]||"duration"===t)&&("number"!=typeof e[t]||isNaN(e[t])))return;if("fill"===t&&-1===sl.indexOf(e[t]))return;if("direction"===t&&-1===ul.indexOf(e[t]))return;n[t]=e[t]}})):n.duration=e,n}function ll(e,t){var n;return cl(e=hl(null!==(n=e)&&void 0!==n?n:{duration:"auto"}),t)}function hl(e){return"number"==typeof e&&(e=isNaN(e)?{duration:"auto"}:{duration:e}),e}var fl=function(){function e(t,n,r){var i=this;dt(this,e),this.composite="replace",this.iterationComposite="replace",this.target=void 0,this.animation=void 0,this.timing=void 0,this.computedTiming=void 0,this.normalizedKeyframes=void 0,this.timeFraction=void 0,this.interpolations=void 0,this.target=t,this.timing=ll(r,!1),this.timing.effect=this,this.timing.activeDuration=hi(this.timing),this.timing.endTime=Math.max(0,this.timing.delay+this.timing.activeDuration+this.timing.endDelay),this.normalizedKeyframes=al(n,this.timing),this.interpolations=vi(this.normalizedKeyframes,this.timing,this.target),this.computedTiming=new Proxy(this.timing,{get:function(e,t){return"duration"===t?"auto"===e.duration?0:e.duration:"fill"===t?"auto"===e.fill?"none":e.fill:"localTime"===t?i.animation&&i.animation.currentTime||null:"currentIteration"===t?i.animation&&"running"===i.animation.playState?e.currentIteration||0:null:"progress"===t?i.animation&&"running"===i.animation.playState?e.progress||0:null:e[t]},set:function(){return!0}})}return yt(e,[{key:"applyInterpolations",value:function(){this.interpolations(this.target,Number(this.timeFraction))}},{key:"update",value:function(e){return null!==e&&(this.timeFraction=fi(this.timing.activeDuration,e,this.timing),null!==this.timeFraction)}},{key:"getKeyframes",value:function(){return this.normalizedKeyframes}},{key:"setKeyframes",value:function(e){this.normalizedKeyframes=al(e)}},{key:"getComputedTiming",value:function(){return this.computedTiming}},{key:"getTiming",value:function(){return this.timing}},{key:"updateTiming",value:function(e){var t=this;Object.keys(e||{}).forEach((function(n){t.timing=e[n]}))}}]),e}(),dl=function(){function t(){dt(this,t),this.registry={},this.define(e.Shape.CIRCLE,Pc),this.define(e.Shape.ELLIPSE,wc),this.define(e.Shape.RECT,Vc),this.define(e.Shape.IMAGE,Mc),this.define(e.Shape.LINE,Oc),this.define(e.Shape.GROUP,Cc),this.define(e.Shape.PATH,Rc),this.define(e.Shape.POLYGON,Dc),this.define(e.Shape.POLYLINE,Fc),this.define(e.Shape.TEXT,Gc),this.define(e.Shape.HTML,Hc)}return yt(t,[{key:"define",value:function(e,t){this.registry[e]=t}},{key:"get",value:function(e){return this.registry[e]}}]),t}(),pl=e.Syringe.defineToken("SceneGraphSelectorFactory"),yl=e.Syringe.defineToken("SceneGraphSelector",{multiple:!1}),vl=/\[\s*(.*)=(.*)\s*\]/;function gl(e,t){var n=Number(e.style.zIndex),r=Number(t.style.zIndex);if(n===r){var i=e.parentNode;if(i){var o=i.childNodes||[];return o.indexOf(e)-o.indexOf(t)}}return n-r}function ml(t){for(var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=t;r;){var i=r.renderable;i&&(i.renderBoundsDirty=!0,i.boundsDirty=!0,i.dirty=!0),r=r.parentNode}t.dispatchEvent(new $u(e.ElementEvent.BOUNDS_CHANGED,{affectChildren:n}))}e.DefaultSceneGraphSelector=function(){function e(){dt(this,e)}return yt(e,[{key:"selectOne",value:function(e,t){var n=this;if(e.startsWith("."))return t.find((function(t){return t.className===n.getIdOrClassname(e)}));if(e.startsWith("#"))return t.find((function(t){return t.id===n.getIdOrClassname(e)}));if(e.startsWith("[")){var r=this.getAttribute(e),i=r.name,o=r.value;return i?t.find((function(e){return t!==e&&("name"===i?e.name===o:n.attributeToString(e,i)===o)})):null}return t.find((function(n){return t!==n&&n.nodeName===e}))}},{key:"selectAll",value:function(e,t){var n=this;if(e.startsWith("."))return t.findAll((function(r){return t!==r&&r.className===n.getIdOrClassname(e)}));if(e.startsWith("#"))return t.findAll((function(r){return t!==r&&r.id===n.getIdOrClassname(e)}));if(e.startsWith("[")){var r=this.getAttribute(e),i=r.name,o=r.value;return i?t.findAll((function(e){return t!==e&&("name"===i?e.name===o:n.attributeToString(e,i)===o)})):[]}return t.findAll((function(n){return t!==n&&n.nodeName===e}))}},{key:"is",value:function(e,t){if(e.startsWith("."))return t.className===this.getIdOrClassname(e);if(e.startsWith("#"))return t.id===this.getIdOrClassname(e);if(e.startsWith("[")){var n=this.getAttribute(e),r=n.name,i=n.value;return"name"===r?t.name===i:this.attributeToString(t,r)===i}return t.nodeName===e}},{key:"getIdOrClassname",value:function(e){return e.substring(1)}},{key:"getAttribute",value:function(e){var t=e.match(vl),n="",r="";return t&&t.length>2&&(n=t[1].replace(/"/g,""),r=t[2].replace(/"/g,"")),{name:n,value:r}}},{key:"attributeToString",value:function(e,t){if(!e.getAttribute)return"";var n=e.getAttribute(t);return Xt(n)?"":n.toString?""+n:""}}]),e}(),e.DefaultSceneGraphSelector=It([ce({token:yl})],e.DefaultSceneGraphSelector);var kl=e.Syringe.defineToken("SceneGraphService");e.DefaultSceneGraphService=function(){function t(){var e,n,r,i,o,a=this;dt(this,t),this.sceneGraphSelectorFactory=void 0,this.rotate=(e=rr(),function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;"number"==typeof n&&(n=Ln(n,r,i));var o=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){var s=rr();ur(s,n[0],n[1],n[2]);var u=a.getRotation(t),c=a.getRotation(t.parentNode);vr(e,c),sr(e,e),or(s,e,s),or(o.localRotation,s,u),mr(o.localRotation,o.localRotation),a.dirtifyLocal(t,o)}else a.rotateLocal(t,n)}),this.rotateLocal=(n=rr(),function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;"number"==typeof t&&(t=Ln(t,r,i));var o=e.transformable;ur(n,t[0],t[1],t[2]),gr(o.localRotation,o.localRotation,n),a.dirtifyLocal(e,o)}),this.setEulerAngles=(r=rr(),function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;"number"==typeof t&&(t=Ln(t,n,i));var o=e.transformable;if(null!==e.parentNode&&e.parentNode.transformable){ur(o.localRotation,t[0],t[1],t[2]);var s=a.getRotation(e.parentNode);vr(r,sr(rr(),s)),gr(o.localRotation,o.localRotation,r),a.dirtifyLocal(e,o)}else a.setLocalEulerAngles(e,t)}),this.translateLocal=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;"number"==typeof t&&(t=Ln(t,n,r));var i=e.transformable;Kn(t,On())||(Xn(t,t,i.localRotation),Fn(i.localPosition,i.localPosition,t),a.dirtifyLocal(e,i))},this.setPosition=(i=yn(),function(e,t){var n=e.transformable;t=Ln(t[0],t[1],t[2]||0),Kn(a.getPosition(e),t)||(n.position=t,null!==e.parentNode&&e.parentNode.transformable?(gn(i,e.parentNode.transformable.worldTransform),kn(i,i),qn(n.localPosition,t,i)):Dn(n.localPosition,t),a.dirtifyLocal(e,n))}),this.translate=(o=On(),function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;"number"==typeof t&&(t=Ln(t,n,r)),Kn(t,On())||(Fn(o,a.getPosition(e),t),a.setPosition(e,o))}),this.setRotation=function(){var e=rr();return function(t,n,r,i,o){var s=t.transformable;if("number"==typeof n&&(n=yr(n,r,i,o)),null!==t.parentNode&&t.parentNode.transformable){var u=a.getRotation(t.parentNode);vr(e,u),sr(e,e),or(s.localRotation,e,n),mr(s.localRotation,s.localRotation),a.dirtifyLocal(t,s)}else a.setLocalRotation(t,n)}}}return yt(t,[{key:"matches",value:function(e,t){return this.sceneGraphSelectorFactory().is(e,t)}},{key:"querySelector",value:function(e,t){return this.sceneGraphSelectorFactory().selectOne(e,t)}},{key:"querySelectorAll",value:function(e,t){return this.sceneGraphSelectorFactory().selectAll(e,t)}},{key:"attach",value:function(e,t,n){e.parentNode&&this.detach(e),e.parentNode=t,Xt(n)?e.parentNode.childNodes.push(e):e.parentNode.childNodes.splice(n,0,e);var r=t.sortable;r&&(r.dirty=!0);var i=e.transformable;i&&this.dirtifyWorld(e,i),i.frozen&&this.unfreezeParentToRoot(e)}},{key:"detach",value:function(e){if(e.parentNode){var t=e.transformable,n=e.parentNode.sortable;n&&(n.dirty=!0);var r=e.parentNode.childNodes.indexOf(e);r>-1&&e.parentNode.childNodes.splice(r,1),t&&this.dirtifyWorld(e,t),e.parentNode=null}}},{key:"getOrigin",value:function(e){return e.transformable.origin}},{key:"setOrigin",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;"number"==typeof t&&(t=Ln(t,n,r));var i=e.transformable;if(!Kn(t,i.origin)){var o=i.origin;o[0]=t[0],o[1]=t[1],o[2]=t[2]||0,this.dirtifyLocal(e,i)}}},{key:"setLocalEulerAngles",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;"number"==typeof t&&(t=Ln(t,n,r));var i=e.transformable;ur(i.localRotation,t[0],t[1],t[2]),this.dirtifyLocal(e,i)}},{key:"setLocalPosition",value:function(e,t){var n=e.transformable;t=Ln(t[0],t[1],t[2]||0),Kn(n.localPosition,t)||(Dn(n.localPosition,t),this.dirtifyLocal(e,n))}},{key:"scaleLocal",value:function(e,t){var n=e.transformable;Vn(n.localScale,n.localScale,Ln(t[0],t[1],t[2]||1)),this.dirtifyLocal(e,n)}},{key:"setLocalScale",value:function(e,t){var n=e.transformable,r=Ln(t[0],t[1],t[2]||n.localScale[2]);Kn(r,n.localScale)||(Dn(n.localScale,r),this.dirtifyLocal(e,n))}},{key:"setLocalRotation",value:function(e,t,n,r,i){"number"==typeof t&&(t=yr(t,n,r,i));var o=e.transformable;vr(o.localRotation,t),this.dirtifyLocal(e,o)}},{key:"dirtifyLocal",value:function(e,t){t.localDirtyFlag||(t.localDirtyFlag=!0,t.dirtyFlag||this.dirtifyWorld(e,t))}},{key:"dirtifyWorld",value:function(e,t){t.dirtyFlag||this.unfreezeParentToRoot(e),this.dirtifyWorldInternal(e,t),ml(e,!0)}},{key:"getPosition",value:function(e){var t=e.transformable;return xn(t.position,this.getWorldTransform(e,t))}},{key:"getRotation",value:function(e){var t=e.transformable;return _n(t.rotation,this.getWorldTransform(e,t))}},{key:"getScale",value:function(e){var t=e.transformable;return wn(t.scaling,this.getWorldTransform(e,t))}},{key:"getWorldTransform",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.transformable;return t.localDirtyFlag||t.dirtyFlag?(e.parentNode&&e.parentNode.transformable&&this.getWorldTransform(e.parentNode),this.sync(e,t),t.worldTransform):t.worldTransform}},{key:"getLocalPosition",value:function(e){return e.transformable.localPosition}},{key:"getLocalRotation",value:function(e){return e.transformable.localRotation}},{key:"getLocalScale",value:function(e){return e.transformable.localScale}},{key:"getLocalTransform",value:function(e){var t=e.transformable;return t.localDirtyFlag&&(Cn(t.localTransform,t.localRotation,t.localPosition,t.localScale,t.origin),t.localDirtyFlag=!1),t.localTransform}},{key:"setLocalTransform",value:function(e,t){var n=xn(On(),t),r=_n(rr(),t),i=wn(On(),t);this.setLocalScale(e,i),this.setLocalPosition(e,n),this.setLocalRotation(e,r)}},{key:"resetLocalTransform",value:function(e){this.setLocalScale(e,[1,1,1]),this.setLocalPosition(e,[0,0,0]),this.setLocalEulerAngles(e,[0,0,0])}},{key:"getTransformedGeometryBounds",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.getGeometryBounds(e,t);if(Ls.isEmpty(n))return null;var r=new Ls;return r.setFromTransformedAABB(n,this.getWorldTransform(e)),r}},{key:"getGeometryBounds",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.geometry,r=t?n.renderBounds:n.contentBounds||null;return r&&new Ls(r.center,r.halfExtents)||new Ls}},{key:"getBounds",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=e.renderable;if(!r.boundsDirty&&!n&&r.bounds)return r.bounds;if(!r.renderBoundsDirty&&n&&r.renderBounds)return r.renderBounds;var i=this.getTransformedGeometryBounds(e,n),o=e.childNodes;o.forEach((function(e){var r=t.getBounds(e,n);r&&(i?i.add(r):(i=new Ls).update(r.center,r.halfExtents))}));var a=e.style.clipPath;if(a){var s,u=this.getTransformedGeometryBounds(a,!0);u&&(s=new Ls).setFromTransformedAABB(u,this.getWorldTransform(e)),i?s&&(i=s.intersection(i)):i=s}return i&&(n?r.renderBounds=i:r.bounds=i),n?r.renderBoundsDirty=!1:r.boundsDirty=!1,i||new Ls}},{key:"getLocalBounds",value:function(e){if(e.parentNode){var t=yn();e.parentNode.transformable&&(t=kn(yn(),this.getWorldTransform(e.parentNode)));var n=this.getBounds(e);if(!Ls.isEmpty(n)){var r=new Ls;return r.setFromTransformedAABB(n,t),r}}return this.getBounds(e)}},{key:"getBoundingClientRect",value:function(e){var t,n,r,i=this.getGeometryBounds(e);Ls.isEmpty(i)||(r=new Ls).setFromTransformedAABB(i,this.getWorldTransform(e));var o=null===(t=e.ownerDocument)||void 0===t||null===(n=t.defaultView)||void 0===n?void 0:n.getContextService().getBoundingClientRect();if(r){var a=Ct(r.getMin(),2),s=a[0],u=a[1],c=Ct(r.getMax(),2);return new qs(s+((null==o?void 0:o.left)||0),u+((null==o?void 0:o.top)||0),c[0]-s,c[1]-u)}return new qs((null==o?void 0:o.left)||0,(null==o?void 0:o.top)||0,0,0)}},{key:"dirtifyWorldInternal",value:function(t,n){var r=this;if(!n.dirtyFlag){n.dirtyFlag=!0,n.frozen=!1,t.childNodes.forEach((function(e){var t=e.transformable;t.dirtyFlag||r.dirtifyWorldInternal(e,t)}));var i=t.renderable;i&&(i.renderBoundsDirty=!0,i.boundsDirty=!0,i.dirty=!0),t.dispatchEvent(new cc(e.ElementEvent.ATTR_MODIFIED,t,null,null,"modelMatrix",cc.MODIFICATION,null,null))}}},{key:"syncHierarchy",value:function(e){var t=e.transformable;if(!t.frozen){t.frozen=!0,(t.localDirtyFlag||t.dirtyFlag)&&this.sync(e,t);for(var n=e.childNodes,r=0;n.length>r;r++)this.syncHierarchy(n[r])}}},{key:"sync",value:function(e,t){if(t.localDirtyFlag&&(Cn(t.localTransform,t.localRotation,t.localPosition,t.localScale,t.origin),t.localDirtyFlag=!1),t.dirtyFlag){var n=e.parentNode,r=n&&n.transformable;null!==n&&r?Tn(t.worldTransform,r.worldTransform,t.localTransform):gn(t.worldTransform,t.localTransform),t.dirtyFlag=!1}}},{key:"unfreezeParentToRoot",value:function(e){for(var t=e.parentNode;t;){var n=t.transformable;n&&(n.frozen=!1),t=t.parentNode}}}]),t}(),It([le(pl),Lt("design:type",Function)],e.DefaultSceneGraphService.prototype,"sceneGraphSelectorFactory",void 0),e.DefaultSceneGraphService=It([ce({token:kl})],e.DefaultSceneGraphService);var Tl,bl=e.Syringe.defineToken("ContextService",{multiple:!1});(Tl=e.RenderReason||(e.RenderReason={}))[Tl.CAMERA_CHANGED=0]="CAMERA_CHANGED",Tl[Tl.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",Tl[Tl.NONE=2]="NONE";var Sl,El,Pl,xl=e.Syringe.defineToken("RenderingContext"),wl=e.Syringe.defineToken("DefaultCamera");(Sl=e.CameraType||(e.CameraType={}))[Sl.ORBITING=0]="ORBITING",Sl[Sl.EXPLORING=1]="EXPLORING",Sl[Sl.TRACKING=2]="TRACKING",(El=e.CameraTrackingMode||(e.CameraTrackingMode={}))[El.DEFAULT=0]="DEFAULT",El[El.ROTATIONAL=1]="ROTATIONAL",El[El.TRANSLATIONAL=2]="TRANSLATIONAL",El[El.CINEMATIC=3]="CINEMATIC",(Pl=e.CameraProjectionMode||(e.CameraProjectionMode={}))[Pl.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",Pl[Pl.PERSPECTIVE=1]="PERSPECTIVE";var _l={UPDATED:"updated"},Cl=Math.PI/180,Nl=180/Math.PI,Ml=2e-4,Al=function(t){gt(r,t);var n=xt(r);function r(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e.CameraType.EXPLORING,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.CameraTrackingMode.DEFAULT;return dt(this,r),(t=n.call(this)).canvas=void 0,t.matrix=yn(),t.right=Ln(1,0,0),t.up=Ln(0,1,0),t.forward=Ln(0,0,1),t.position=Ln(0,0,1),t.focalPoint=Ln(0,0,0),t.distanceVector=Ln(0,0,-1),t.distance=1,t.azimuth=0,t.elevation=0,t.roll=0,t.relAzimuth=0,t.relElevation=0,t.relRoll=0,t.dollyingStep=0,t.maxDistance=1/0,t.minDistance=-1/0,t.zoom=1,t.rotateWorld=!1,t.fov=30,t.near=.1,t.far=1e3,t.aspect=1,t.left=void 0,t.rright=void 0,t.top=void 0,t.bottom=void 0,t.projectionMatrix=yn(),t.projectionMatrixInverse=yn(),t.jitteredProjectionMatrix=void 0,t.view=void 0,t.enableUpdate=!0,t.type=e.CameraType.EXPLORING,t.trackingMode=e.CameraTrackingMode.DEFAULT,t.projectionMode=e.CameraProjectionMode.PERSPECTIVE,t.frustum=new Bs,t.landmarks=[],t.landmarkAnimationID=void 0,t.orthoMatrix=yn(),t.setType(i,o),t}return yt(r,[{key:"isOrtho",value:function(){return this.projectionMode===e.CameraProjectionMode.ORTHOGRAPHIC}},{key:"getProjectionMode",value:function(){return this.projectionMode}},{key:"getPerspective",value:function(){return this.jitteredProjectionMatrix||this.projectionMatrix}},{key:"getPerspectiveInverse",value:function(){return this.projectionMatrixInverse}},{key:"getFrustum",value:function(){return this.frustum}},{key:"getPosition",value:function(){return this.position}},{key:"getFocalPoint",value:function(){return this.focalPoint}},{key:"getDollyingStep",value:function(){return this.dollyingStep}},{key:"getNear",value:function(){return this.near}},{key:"getFar",value:function(){return this.far}},{key:"getZoom",value:function(){return this.zoom}},{key:"getOrthoMatrix",value:function(){return this.orthoMatrix}},{key:"getView",value:function(){return this.view}},{key:"setEnableUpdate",value:function(e){this.enableUpdate=e}},{key:"setType",value:function(t,n){return this.type=t,this.setWorldRotation(this.type===e.CameraType.EXPLORING),this._getAngles(),this.type===e.CameraType.TRACKING&&void 0!==n&&this.setTrackingMode(n),this}},{key:"setProjectionMode",value:function(e){return this.projectionMode=e,this}},{key:"setTrackingMode",value:function(t){if(this.type!==e.CameraType.TRACKING)throw Error("Impossible to set a tracking mode if the camera is not of tracking type");return this.trackingMode=t,this}},{key:"setWorldRotation",value:function(e){return this.rotateWorld=e,this._getAngles(),this}},{key:"getViewTransform",value:function(){return kn(yn(),this.matrix)}},{key:"getWorldTransform",value:function(){return this.matrix}},{key:"jitterProjectionMatrix",value:function(e,t){var n,r,i=(n=yn(),r=[e,t,0],n[0]=1,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=1,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=1,n[11]=0,n[12]=r[0],n[13]=r[1],n[14]=r[2],n[15]=1,n);this.jitteredProjectionMatrix=Tn(yn(),i,this.projectionMatrix)}},{key:"clearJitterProjectionMatrix",value:function(){this.jitteredProjectionMatrix=void 0}},{key:"setMatrix",value:function(e){return this.matrix=e,this._update(),this}},{key:"setFov",value:function(e){return this.setPerspective(this.near,this.far,e,this.aspect),this}},{key:"setAspect",value:function(e){return this.setPerspective(this.near,this.far,this.fov,e),this}},{key:"setNear",value:function(t){return this.projectionMode===e.CameraProjectionMode.PERSPECTIVE?this.setPerspective(t,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,t,this.far),this}},{key:"setFar",value:function(t){return this.projectionMode===e.CameraProjectionMode.PERSPECTIVE?this.setPerspective(this.near,t,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,t),this}},{key:"setViewOffset",value:function(t,n,r,i,o,a){return this.aspect=t/n,void 0===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=n,this.view.offsetX=r,this.view.offsetY=i,this.view.width=o,this.view.height=a,this.projectionMode===e.CameraProjectionMode.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this}},{key:"clearViewOffset",value:function(){return void 0!==this.view&&(this.view.enabled=!1),this.projectionMode===e.CameraProjectionMode.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this}},{key:"setZoom",value:function(t){return this.zoom=t,this.projectionMode===e.CameraProjectionMode.ORTHOGRAPHIC?this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far):this.projectionMode===e.CameraProjectionMode.PERSPECTIVE&&this.setPerspective(this.near,this.far,this.fov,this.aspect),this}},{key:"setPerspective",value:function(t,n,r,i){var o;this.projectionMode=e.CameraProjectionMode.PERSPECTIVE,this.fov=r,this.near=t,this.far=n,this.aspect=i;var a=this.near*Math.tan(.5*Cl*this.fov)/this.zoom,s=2*a,u=this.aspect*s,c=-.5*u;if(null===(o=this.view)||void 0===o?void 0:o.enabled){var l=this.view.fullWidth,h=this.view.fullHeight;c+=this.view.offsetX*u/l,a-=this.view.offsetY*s/h,u*=this.view.width/l,s*=this.view.height/h}return wr(this.projectionMatrix,c,c+u,a,a-s,t,this.far),Sn(this.projectionMatrix,this.projectionMatrix,Ln(1,-1,1)),kn(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this}},{key:"setOrthographic",value:function(t,n,r,i,o,a){var s;this.projectionMode=e.CameraProjectionMode.ORTHOGRAPHIC,this.rright=n,this.left=t,this.top=r,this.bottom=i,this.near=o,this.far=a;var u=(this.rright-this.left)/(2*this.zoom),c=(this.top-this.bottom)/(2*this.zoom),l=(this.rright+this.left)/2,h=(this.top+this.bottom)/2,f=l-u,d=l+u,p=h+c,y=h-c;if(null===(s=this.view)||void 0===s?void 0:s.enabled){var v=(this.rright-this.left)/this.view.fullWidth/this.zoom,g=(this.top-this.bottom)/this.view.fullHeight/this.zoom;d=(f+=v*this.view.offsetX)+v*this.view.width,y=(p-=g*this.view.offsetY)-g*this.view.height}return Mn(this.projectionMatrix,f,d,y,p,o,a),Sn(this.projectionMatrix,this.projectionMatrix,Ln(1,-1,1)),kn(this.projectionMatrixInverse,this.projectionMatrix),this._getOrthoMatrix(),this.triggerUpdate(),this}},{key:"setPosition",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.position[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.position[2],r=br(e,t,n);return this._setPosition(r),this.setFocalPoint(this.focalPoint),this.triggerUpdate(),this}},{key:"setFocalPoint",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.focalPoint[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.focalPoint[2],i=Ln(0,1,0);if(this.focalPoint=br(t,n,r),this.trackingMode===e.CameraTrackingMode.CINEMATIC){var o=Bn(On(),this.focalPoint,this.position);t=o[0],n=o[1],r=o[2];var a=Rn(o),s=Math.asin(n/a)*Nl,u=90+Math.atan2(r,t)*Nl,c=yn();Pn(c,c,u*Cl),En(c,c,s*Cl),i=qn(On(),[0,1,0],c)}return kn(this.matrix,An(yn(),this.position,this.focalPoint,i)),this._getAxes(),this._getDistance(),this._getAngles(),this.triggerUpdate(),this}},{key:"getDistance",value:function(){return this.distance}},{key:"setDistance",value:function(e){if(this.distance===e||0>e)return this;this.distance=e,Ml>this.distance&&(this.distance=Ml),this.dollyingStep=this.distance/100;var t=On(),n=this.forward,r=this.focalPoint;return t[0]=(e=this.distance)*n[0]+r[0],t[1]=e*n[1]+r[1],t[2]=e*n[2]+r[2],this._setPosition(t),this.triggerUpdate(),this}},{key:"setMaxDistance",value:function(e){return this.maxDistance=e,this}},{key:"setMinDistance",value:function(e){return this.minDistance=e,this}},{key:"setAzimuth",value:function(t){return this.azimuth=Tr(t),this.computeMatrix(),this._getAxes(),this.type===e.CameraType.ORBITING||this.type===e.CameraType.EXPLORING?this._getPosition():this.type===e.CameraType.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this}},{key:"getAzimuth",value:function(){return this.azimuth}},{key:"setElevation",value:function(t){return this.elevation=Tr(t),this.computeMatrix(),this._getAxes(),this.type===e.CameraType.ORBITING||this.type===e.CameraType.EXPLORING?this._getPosition():this.type===e.CameraType.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this}},{key:"getElevation",value:function(){return this.elevation}},{key:"setRoll",value:function(t){return this.roll=Tr(t),this.computeMatrix(),this._getAxes(),this.type===e.CameraType.ORBITING||this.type===e.CameraType.EXPLORING?this._getPosition():this.type===e.CameraType.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this}},{key:"getRoll",value:function(){return this.roll}},{key:"rotate",value:function(t,n,r){if(this.relElevation=Tr(n),this.relAzimuth=Tr(t),this.relRoll=Tr(r),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.type===e.CameraType.EXPLORING){var i=ir(rr(),[1,0,0],(this.rotateWorld?1:-1)*this.relElevation*Cl),o=ir(rr(),[0,1,0],(this.rotateWorld?1:-1)*this.relAzimuth*Cl),a=ir(rr(),[0,0,1],this.relRoll*Cl),s=or(rr(),o,i);s=or(rr(),s,a);var u=Nn(yn(),s);bn(this.matrix,this.matrix,[0,0,-this.distance]),Tn(this.matrix,this.matrix,u),bn(this.matrix,this.matrix,[0,0,this.distance])}else{if(Math.abs(this.elevation)>90)return this;this.computeMatrix()}return this._getAxes(),this.type===e.CameraType.ORBITING||this.type===e.CameraType.EXPLORING?this._getPosition():this.type===e.CameraType.TRACKING&&this._getFocalPoint(),this._update(),this}},{key:"pan",value:function(e,t){var n=br(e,t,0),r=In(this.position);return Fn(r,r,jn(On(),this.right,n[0])),Fn(r,r,jn(On(),this.up,n[1])),this._setPosition(r),this.triggerUpdate(),this}},{key:"dolly",value:function(t){var n,r=this.forward,i=In(this.position);return i[0]+=(n=Math.max(Math.min(this.distance+t*this.dollyingStep,this.maxDistance),this.minDistance)-this.distance)*r[0],i[1]+=n*r[1],i[2]+=n*r[2],this._setPosition(i),this.type===e.CameraType.ORBITING||this.type===e.CameraType.EXPLORING?this._getDistance():this.type===e.CameraType.TRACKING&&Fn(this.focalPoint,i,this.distanceVector),this.triggerUpdate(),this}},{key:"createLandmark",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.position,i=void 0===n?this.position:n,o=t.focalPoint,a=void 0===o?this.focalPoint:o,s=t.roll,u=t.zoom,c=new r;c.setType(this.type,void 0),c.setPosition(i[0],i[1]||this.position[1],i[2]||this.position[2]),c.setFocalPoint(a[0],a[1]||this.focalPoint[1],a[2]||this.focalPoint[2]),c.setRoll(s||this.roll),c.setZoom(u||this.zoom);var l={name:e,matrix:vn(c.matrix),right:In(c.right),up:In(c.up),forward:In(c.forward),position:In(c.position),focalPoint:In(c.focalPoint),distanceVector:In(c.distanceVector),distance:c.distance,dollyingStep:c.dollyingStep,azimuth:c.azimuth,elevation:c.elevation,roll:c.roll,relAzimuth:c.relAzimuth,relElevation:c.relElevation,relRoll:c.relRoll,zoom:c.zoom};return this.landmarks.push(l),l}},{key:"gotoLandmark",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=yi(e)?this.landmarks.find((function(t){return t.name===e})):e;if(r){var i=Kt(n)?{duration:n}:n,o=i.easing,a=void 0===o?"linear":o,s=i.duration,u=void 0===s?100:s,c=i.easingFunction,l=void 0===c?void 0:c,h=i.onfinish,f=void 0===h?void 0:h,d=.01;if(0===u)return this.syncFromLandmark(r),void(f&&f());void 0!==this.landmarkAnimationID&&this.canvas.cancelAnimationFrame(this.landmarkAnimationID);var p,y=r.position,v=r.focalPoint,g=r.zoom,m=r.roll,k=l||li(a),T=function(){t.setFocalPoint(v),t.setPosition(y),t.setRoll(m),t.setZoom(g),t.computeMatrix(),t.triggerUpdate(),f&&f()},b=function e(n){void 0===p&&(p=n);var r=n-p;if(u<r)T();else{var i,o,a=k(r/u),s=On(),c=On();Yn(s,t.focalPoint,v,a),Yn(c,t.position,y,a),o=t.roll*(1-a)+m*a,i=t.zoom*(1-a)+g*a,t.setFocalPoint(s),t.setPosition(c),t.setRoll(o),t.setZoom(i),$n(s,v)+$n(c,y)>d?(t.computeMatrix(),t.triggerUpdate(),u>r&&(t.landmarkAnimationID=t.canvas.requestAnimationFrame(e))):T()}};this.canvas.requestAnimationFrame(b)}}},{key:"_update",value:function(){this._getAxes(),this._getPosition(),this._getDistance(),this._getAngles(),this._getOrthoMatrix(),this.triggerUpdate()}},{key:"computeMatrix",value:function(){var t=ir(rr(),[0,0,1],this.roll*Cl);mn(this.matrix);var n=ir(rr(),[1,0,0],(this.rotateWorld&&this.type!==e.CameraType.TRACKING||this.type===e.CameraType.TRACKING?1:-1)*this.elevation*Cl),r=ir(rr(),[0,1,0],(this.rotateWorld&&this.type!==e.CameraType.TRACKING||this.type===e.CameraType.TRACKING?1:-1)*this.azimuth*Cl),i=or(rr(),r,n);i=or(rr(),i,t);var o=Nn(yn(),i);this.type===e.CameraType.ORBITING||this.type===e.CameraType.EXPLORING?(bn(this.matrix,this.matrix,this.focalPoint),Tn(this.matrix,this.matrix,o),bn(this.matrix,this.matrix,[0,0,this.distance])):this.type===e.CameraType.TRACKING&&(bn(this.matrix,this.matrix,this.position),Tn(this.matrix,this.matrix,o))}},{key:"_setPosition",value:function(e,t,n){this.position=br(e,t,n);var r=this.matrix;r[12]=this.position[0],r[13]=this.position[1],r[14]=this.position[2],r[15]=1,this._getOrthoMatrix()}},{key:"_getAxes",value:function(){Dn(this.right,br(nr(tr(),[1,0,0,0],this.matrix))),Dn(this.up,br(nr(tr(),[0,1,0,0],this.matrix))),Dn(this.forward,br(nr(tr(),[0,0,1,0],this.matrix))),zn(this.right,this.right),zn(this.up,this.up),zn(this.forward,this.forward)}},{key:"_getAngles",value:function(){var t=this.distanceVector[0],n=this.distanceVector[1],r=this.distanceVector[2],i=Rn(this.distanceVector);if(0===i)return this.elevation=0,void(this.azimuth=0);this.type===e.CameraType.TRACKING||this.rotateWorld?(this.elevation=Math.asin(n/i)*Nl,this.azimuth=Math.atan2(-t,-r)*Nl):(this.elevation=-Math.asin(n/i)*Nl,this.azimuth=-Math.atan2(-t,-r)*Nl)}},{key:"_getPosition",value:function(){Dn(this.position,br(nr(tr(),[0,0,0,1],this.matrix))),this._getDistance()}},{key:"_getFocalPoint",value:function(){var e,t;!function(e,t,n){var r=t[0],i=t[1],o=t[2];e[0]=r*n[0]+i*n[3]+o*n[6],e[1]=r*n[1]+i*n[4]+o*n[7],e[2]=r*n[2]+i*n[5]+o*n[8]}(this.distanceVector,[0,0,-this.distance],(e=pn(),t=this.matrix,e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e)),Fn(this.focalPoint,this.position,this.distanceVector),this._getDistance()}},{key:"_getDistance",value:function(){this.distanceVector=Bn(On(),this.focalPoint,this.position),this.distance=Rn(this.distanceVector),this.dollyingStep=this.distance/100}},{key:"_getOrthoMatrix",value:function(){if(this.projectionMode===e.CameraProjectionMode.ORTHOGRAPHIC){var t=this.position,n=ir(rr(),[0,0,1],-this.roll*Math.PI/180);Cn(this.orthoMatrix,n,Ln((this.rright-this.left)/2-t[0],(this.top-this.bottom)/2-t[1],0),Ln(this.zoom,this.zoom,1),t)}}},{key:"triggerUpdate",value:function(){if(this.enableUpdate){var e=this.getViewTransform(),t=Tn(yn(),this.getPerspective(),e);this.getFrustum().extractFromVPMatrix(t),this.emit(_l.UPDATED)}}},{key:"syncFromLandmark",value:function(e){this.matrix=gn(this.matrix,e.matrix),this.right=Dn(this.right,e.right),this.up=Dn(this.up,e.up),this.forward=Dn(this.forward,e.forward),this.position=Dn(this.position,e.position),this.focalPoint=Dn(this.focalPoint,e.focalPoint),this.distanceVector=Dn(this.distanceVector,e.distanceVector),this.azimuth=e.azimuth,this.elevation=e.elevation,this.roll=e.roll,this.relAzimuth=e.relAzimuth,this.relElevation=e.relElevation,this.relRoll=e.relRoll,this.dollyingStep=e.dollyingStep,this.distance=e.distance,this.zoom=e.zoom}}]),r}(jo.EventEmitter),Ol=e.Syringe.defineToken("RenderingPluginContribution");e.RenderingService=function(){function t(){dt(this,t),this.renderingPluginProvider=void 0,this.renderingContext=void 0,this.sceneGraphService=void 0,this.styleValueRegistry=void 0,this.camera=void 0,this.inited=!1,this.stats={total:0,rendered:0},this.zIndexCounter=0,this.hooks={init:new ao,dirtycheck:new Eo(["object"]),cull:new Eo(["object","camera"]),beginFrame:new go([]),beforeRender:new go(["objectToRender"]),render:new go(["objectToRender"]),afterRender:new go(["objectToRender"]),endFrame:new go([]),destroy:new go([]),pick:new lo(["result"]),pointerDown:new go(["event"]),pointerUp:new go(["event"]),pointerMove:new go(["event"]),pointerOut:new go(["event"]),pointerOver:new go(["event"]),pointerWheel:new go(["event"]),pointerCancel:new go(["event"])}}var n;return yt(t,[{key:"init",value:(n=ft(ct().mark((function e(){var t=this;return ct().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.renderingPluginProvider.getContributions({cache:!1}).forEach((function(e){e.apply(t)})),e.next=3,this.hooks.init.promise();case 3:this.inited=!0;case 4:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"getStats",value:function(){return this.stats}},{key:"render",value:function(e){var t=this;this.stats.total=0,this.stats.rendered=0,this.zIndexCounter=0,this.sceneGraphService.syncHierarchy(this.renderingContext.root),this.renderingContext.renderReasons.size&&this.inited&&(this.renderDisplayObject(this.renderingContext.root,e),(this.renderingContext.renderListCurrentFrame.length||this.renderingContext.renderListLastFrame.length!==this.renderingContext.renderListCurrentFrame.length)&&(this.hooks.beginFrame.call(),this.renderingContext.renderListCurrentFrame.forEach((function(e){t.hooks.beforeRender.call(e),t.hooks.render.call(e),t.hooks.afterRender.call(e)})),this.hooks.endFrame.call()),this.renderingContext.renderListLastFrame=Nt(this.renderingContext.renderListCurrentFrame),this.renderingContext.renderListCurrentFrame=[],this.renderingContext.renderReasons.clear())}},{key:"renderDisplayObject",value:function(t,n){var r=this,i=n.renderer.getConfig(),o=i.enableDirtyCheck,a=i.enableCulling;this.styleValueRegistry.recalc(t);var s=o?this.hooks.dirtycheck.call(t):t;if(s){var u=a?this.hooks.cull.call(s,this.camera):s;u&&(this.stats.rendered++,this.renderingContext.renderListCurrentFrame.push(u))}t.renderable.dirty=!1,t.sortable.renderOrder=this.zIndexCounter++,this.stats.total++;var c=t.sortable,l=!1;c.dirty&&(c.sorted=t.childNodes.slice().sort(gl),l=!0,c.dirty=!1),(c.sorted||t.childNodes).forEach((function(e){r.renderDisplayObject(e,n)})),l&&t.forEach((function(t){t.dispatchEvent(new $u(e.ElementEvent.RENDER_ORDER_CHANGED,{renderOrder:t.sortable.renderOrder}))}))}},{key:"destroy",value:function(){this.inited=!1,this.hooks.destroy.call()}},{key:"dirtify",value:function(){this.renderingContext.renderReasons.add(e.RenderReason.DISPLAY_OBJECT_CHANGED)}}]),t}(),It([Ge(Ol),Lt("design:type",Object)],e.RenderingService.prototype,"renderingPluginProvider",void 0),It([le(xl),Lt("design:type",Object)],e.RenderingService.prototype,"renderingContext",void 0),It([le(kl),Lt("design:type",Object)],e.RenderingService.prototype,"sceneGraphService",void 0),It([le(ii),Lt("design:type",Object)],e.RenderingService.prototype,"styleValueRegistry",void 0),It([le(wl),Lt("design:type",Al)],e.RenderingService.prototype,"camera",void 0),e.RenderingService=It([ce()],e.RenderingService);e.EventService=function(e){gt(a,e);var t,n,r,i,o=xt(a);function a(){var e;dt(this,a);for(var t=arguments.length,n=Array(t),r=0;t>r;r++)n[r]=arguments[r];return(e=o.call.apply(o,[this].concat(n))).renderingContext=void 0,e.contextService=void 0,e.canvasConfig=void 0,e.displayObjectPool=void 0,e.rootTarget=void 0,e.cursor="default",e.mappingTable={},e.mappingState={trackingData:{}},e.eventPool=new Map,e.pickHandler=void 0,e.onPointerDown=function(){var t=ft(ct().mark((function t(n){var r;return ct().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n instanceof qc){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,e.createPointerEvent(n);case 4:e.dispatchEvent(r=t.sent,"pointerdown"),"touch"===r.pointerType?e.dispatchEvent(r,"touchstart"):"mouse"!==r.pointerType&&"pen"!==r.pointerType||e.dispatchEvent(r,2===r.button?"rightdown":"mousedown"),e.trackingData(n.pointerId).pressTargetsByButton[n.button]=r.composedPath(),e.freeEvent(r);case 10:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),e.onPointerUp=function(){var t=ft(ct().mark((function t(n){var r,i,o,a,s,u,c,l;return ct().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n instanceof qc){t.next=2;break}return t.abrupt("return");case 2:return r=performance.now(),t.next=5,e.createPointerEvent(n);case 5:if(e.dispatchEvent(i=t.sent,"pointerup"),"touch"===i.pointerType?e.dispatchEvent(i,"touchend"):"mouse"!==i.pointerType&&"pen"!==i.pointerType||e.dispatchEvent(i,2===i.button?"rightup":"mouseup"),o=e.trackingData(n.pointerId),a=e.findMountedTarget(o.pressTargetsByButton[n.button]),s=a,a&&!i.composedPath().includes(a)){for(u=a;u&&!i.composedPath().includes(u);)i.currentTarget=u,e.notifyTarget(i,"pointerupoutside"),"touch"===i.pointerType?e.notifyTarget(i,"touchendoutside"):"mouse"!==i.pointerType&&"pen"!==i.pointerType||e.notifyTarget(i,2===i.button?"rightupoutside":"mouseupoutside"),tc.isNode(u)&&(u=u.parentNode);delete o.pressTargetsByButton[n.button],s=u}s&&((c=e.clonePointerEvent(i,"click")).target=s,c.path=[],o.clicksByButton[n.button]||(o.clicksByButton[n.button]={clickCount:0,target:c.target,timeStamp:r}),(l=o.clicksByButton[n.button]).target===c.target&&200>r-l.timeStamp?++l.clickCount:l.clickCount=1,l.target=c.target,l.timeStamp=r,c.detail=l.clickCount,e.dispatchEvent(c,"mouse"===c.pointerType||"touch"===c.pointerType?"click":"pointertap"),e.freeEvent(c)),e.freeEvent(i);case 14:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),e.onPointerMove=function(){var t=ft(ct().mark((function t(n){var r,i,o,a,s,u,c,l,h,f;return ct().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n instanceof qc){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,e.createPointerEvent(n);case 4:if(i="mouse"===(r=t.sent).pointerType||"pen"===r.pointerType,o=e.trackingData(n.pointerId),a=e.findMountedTarget(o.overTargets),!o.overTargets||a===r.target){t.next=23;break}return s="mousemove"===n.type?"mouseout":"pointerout",t.next=12,e.createPointerEvent(n,s,a||void 0);case 12:if(e.dispatchEvent(u=t.sent,"pointerout"),i&&e.dispatchEvent(u,"mouseout"),r.composedPath().includes(a)){t.next=22;break}return t.next=18,e.createPointerEvent(n,"pointerleave",a||void 0);case 18:for((c=t.sent).eventPhase=c.AT_TARGET;c.target&&!r.composedPath().includes(c.target);)c.currentTarget=c.target,e.notifyTarget(c),i&&e.notifyTarget(c,"mouseleave"),tc.isNode(c.target)&&(c.target=c.target.parentNode);e.freeEvent(c);case 22:e.freeEvent(u);case 23:if(a===r.target){t.next=38;break}l=e.clonePointerEvent(r,"mousemove"===n.type?"mouseover":"pointerover"),e.dispatchEvent(l,"pointerover"),i&&e.dispatchEvent(l,"mouseover"),h=a&&tc.isNode(a)&&a.parentNode;case 29:if(!h||h===(tc.isNode(e.rootTarget)&&e.rootTarget.parentNode)){t.next=35;break}if(h!==r.target){t.next=32;break}return t.abrupt("break",35);case 32:h=h.parentNode,t.next=29;break;case 35:if(!h||h===(tc.isNode(e.rootTarget)&&e.rootTarget.parentNode)){for((f=e.clonePointerEvent(r,"pointerenter")).eventPhase=f.AT_TARGET;f.target&&f.target!==a&&f.target!==(tc.isNode(e.rootTarget)&&e.rootTarget.parentNode);)f.currentTarget=f.target,e.notifyTarget(f),i&&e.notifyTarget(f,"mouseenter"),tc.isNode(f.target)&&(f.target=f.target.parentNode);e.freeEvent(f)}e.freeEvent(l);case 38:e.dispatchEvent(r,"pointermove"),"touch"===r.pointerType&&e.dispatchEvent(r,"touchmove"),i&&(e.dispatchEvent(r,"mousemove"),e.cursor=e.getCursor(r.target)),o.overTargets=r.composedPath(),e.freeEvent(r);case 43:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),e.onPointerOut=function(){var t=ft(ct().mark((function t(n){var r,i,o,a,s;return ct().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n instanceof qc){t.next=2;break}return t.abrupt("return");case 2:if(!(r=e.trackingData(n.pointerId)).overTargets){t.next=19;break}return i="mouse"===n.pointerType||"pen"===n.pointerType,o=e.findMountedTarget(r.overTargets),t.next=8,e.createPointerEvent(n,"pointerout",o||void 0);case 8:return e.dispatchEvent(a=t.sent),i&&e.dispatchEvent(a,"mouseout"),t.next=13,e.createPointerEvent(n,"pointerleave",o||void 0);case 13:for((s=t.sent).eventPhase=s.AT_TARGET;s.target&&s.target!==(tc.isNode(e.rootTarget)&&e.rootTarget.parentNode);)s.currentTarget=s.target,e.notifyTarget(s),i&&e.notifyTarget(s,"mouseleave"),tc.isNode(s.target)&&(s.target=s.target.parentNode);r.overTargets=null,e.freeEvent(a),e.freeEvent(s);case 19:e.cursor=null;case 20:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),e.onPointerOver=function(){var t=ft(ct().mark((function t(n){var r,i,o,a;return ct().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n instanceof qc){t.next=2;break}return t.abrupt("return");case 2:return r=e.trackingData(n.pointerId),t.next=5,e.createPointerEvent(n);case 5:for(o="mouse"===(i=t.sent).pointerType||"pen"===i.pointerType,e.dispatchEvent(i,"pointerover"),o&&e.dispatchEvent(i,"mouseover"),"mouse"===i.pointerType&&(e.cursor=e.getCursor(i.target)),(a=e.clonePointerEvent(i,"pointerenter")).eventPhase=a.AT_TARGET;a.target&&a.target!==(tc.isNode(e.rootTarget)&&e.rootTarget.parentNode);)a.currentTarget=a.target,e.notifyTarget(a),o&&e.notifyTarget(a,"mouseenter"),tc.isNode(a.target)&&(a.target=a.target.parentNode);r.overTargets=i.composedPath(),e.freeEvent(i),e.freeEvent(a);case 16:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),e.onPointerUpOutside=function(){var t=ft(ct().mark((function t(n){var r,i,o,a;return ct().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n instanceof qc){t.next=2;break}return t.abrupt("return");case 2:return r=e.trackingData(n.pointerId),i=e.findMountedTarget(r.pressTargetsByButton[n.button]),t.next=6,e.createPointerEvent(n);case 6:if(o=t.sent,i){for(a=i;a;)o.currentTarget=a,e.notifyTarget(o,"pointerupoutside"),"touch"===o.pointerType||"mouse"!==o.pointerType&&"pen"!==o.pointerType||e.notifyTarget(o,2===o.button?"rightupoutside":"mouseupoutside"),tc.isNode(a)&&(a=a.parentNode);delete r.pressTargetsByButton[n.button]}e.freeEvent(o);case 9:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),e.onWheel=function(){var t=ft(ct().mark((function t(n){var r;return ct().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n instanceof Xc){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,e.createWheelEvent(n);case 4:e.dispatchEvent(r=t.sent),e.freeEvent(r);case 7:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),e}return yt(a,[{key:"init",value:function(){this.rootTarget=this.renderingContext.root.parentNode,this.addEventMapping("pointerdown",this.onPointerDown),this.addEventMapping("pointerup",this.onPointerUp),this.addEventMapping("pointermove",this.onPointerMove),this.addEventMapping("pointerout",this.onPointerOut),this.addEventMapping("pointerleave",this.onPointerOut),this.addEventMapping("pointerover",this.onPointerOver),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel)}},{key:"client2Viewport",value:function(e){var t=this.contextService.getBoundingClientRect();return new Ys(e.x-((null==t?void 0:t.left)||0),e.y-((null==t?void 0:t.top)||0))}},{key:"viewport2Client",value:function(e){var t=this.contextService.getBoundingClientRect();return new Ys(e.x+((null==t?void 0:t.left)||0),e.y+((null==t?void 0:t.top)||0))}},{key:"viewport2Canvas",value:function(e){var t=e.x,n=e.y,r=this.rootTarget.defaultView.getCamera(),i=this.canvasConfig,o=i.width,a=i.height,s=r.getPerspectiveInverse(),u=r.getWorldTransform(),c=Tn(yn(),u,s),l=Ln(t/o*2-1,2*(1-n/a)-1,0);return qn(l,l,c),new Ys(l[0],l[1])}},{key:"canvas2Viewport",value:function(e){var t=this.rootTarget.defaultView.getCamera(),n=t.getPerspective(),r=t.getViewTransform(),i=Tn(yn(),n,r),o=Ln(e.x,e.y,0);qn(o,o,i);var a=this.canvasConfig;return new Ys((o[0]+1)/2*a.width,(1-(o[1]+1)/2)*a.height)}},{key:"setPickHandler",value:function(e){this.pickHandler=e}},{key:"addEventMapping",value:function(e,t){this.mappingTable[e]||(this.mappingTable[e]=[]),this.mappingTable[e].push({fn:t,priority:0}),this.mappingTable[e].sort((function(e,t){return e.priority-t.priority}))}},{key:"mapEvent",value:function(e){if(this.rootTarget){var t=this.mappingTable[e.type];if(t)for(var n=0,r=t.length;r>n;n++)t[n].fn(e);else console.warn("[EventService]: Event mapping not defined for ".concat(e.type))}}},{key:"dispatchEvent",value:function(e,t){e.propagationStopped=!1,e.propagationImmediatelyStopped=!1,this.propagate(e,t),this.emit(t||e.type,e)}},{key:"propagate",value:function(e,t){if(e.target){var n=e.composedPath();e.eventPhase=e.CAPTURING_PHASE;for(var r=n.length-1;r>=1;r--)if(e.currentTarget=n[r],this.notifyTarget(e,t),e.propagationStopped||e.propagationImmediatelyStopped)return;if(e.eventPhase=e.AT_TARGET,e.currentTarget=e.target,this.notifyTarget(e,t),!e.propagationStopped&&!e.propagationImmediatelyStopped){var i=n.indexOf(e.currentTarget);e.eventPhase=e.BUBBLING_PHASE;for(var o=i+1;n.length>o;o++)if(e.currentTarget=n[o],this.notifyTarget(e,t),e.propagationStopped||e.propagationImmediatelyStopped)return}}}},{key:"propagationPath",value:function(e){var t=[e],n=this.rootTarget.defaultView||null;if(n&&n===e)return t.unshift(n.document),t;for(var r=0;2048>r&&e!==this.rootTarget;r++)tc.isNode(e)&&e.parentNode&&(t.push(e.parentNode),e=e.parentNode);return n&&t.push(n),t}},{key:"hitTest",value:(i=ft(ct().mark((function e(t){var n,r,i,o,a;return ct().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.viewportY,o=(i=this.canvasConfig).width,a=i.height,!(0>(n=t.viewportX)||0>r||n>o||r>a)){e.next=4;break}return e.abrupt("return",null);case 4:return e.next=6,this.pickHandler(t);case 6:if(e.t1=e.sent,e.t1){e.next=9;break}e.t1=this.rootTarget;case 9:if(e.t0=e.t1,e.t0){e.next=12;break}e.t0=null;case 12:return e.abrupt("return",e.t0);case 13:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"isNativeEventFromCanvas",value:function(e){var t,n=this.contextService.getDomElement(),r=null===(t=e.nativeEvent)||void 0===t?void 0:t.target;if(r){if(r===n)return!0;if(n&&n.contains)return n.contains(r)}return!!e.nativeEvent.composedPath&&e.nativeEvent.composedPath().indexOf(n)>-1}},{key:"getExistedHTML",value:function(e){if(e.nativeEvent.composedPath){var t,n=Ot(this.displayObjectPool.getHTMLs());try{for(n.s();!(t=n.n()).done;){var r=t.value;if(e.nativeEvent.composedPath().indexOf(r)>-1)return r}}catch(e){n.e(e)}finally{n.f()}}return null}},{key:"pickTarget",value:(r=ft(ct().mark((function e(t){return ct().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.hitTest({clientX:t.clientX,clientY:t.clientY,viewportX:t.viewportX,viewportY:t.viewportY,x:t.canvasX,y:t.canvasY}));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"createPointerEvent",value:(n=ft(ct().mark((function e(t,n,r){var i,o;return ct().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=this.allocateEvent(qc),this.copyPointerData(t,i),this.copyMouseData(t,i),this.copyData(t,i),i.nativeEvent=t.nativeEvent,i.originalEvent=t,o=this.getExistedHTML(i),null==r){e.next=11;break}e.t0=r,e.next=20;break;case 11:if(e.t1=o,e.t1){e.next=19;break}if(e.t2=this.isNativeEventFromCanvas(i),!e.t2){e.next=18;break}return e.next=17,this.pickTarget(i);case 17:e.t2=e.sent;case 18:e.t1=e.t2;case 19:e.t0=e.t1;case 20:return i.target=e.t0,"string"==typeof n&&(i.type=n),e.abrupt("return",i);case 23:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return n.apply(this,arguments)})},{key:"createWheelEvent",value:(t=ft(ct().mark((function e(t){var n,r;return ct().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.allocateEvent(Xc),this.copyWheelData(t,n),this.copyMouseData(t,n),this.copyData(t,n),n.nativeEvent=t.nativeEvent,n.originalEvent=t,r=this.getExistedHTML(n),e.t0=r,e.t0){e.next=15;break}if(e.t1=this.isNativeEventFromCanvas(n),!e.t1){e.next=14;break}return e.next=13,this.pickTarget(n);case 13:e.t1=e.sent;case 14:e.t0=e.t1;case 15:return n.target=e.t0,e.abrupt("return",n);case 17:case"end":return e.stop()}}),e,this)}))),function(e){return t.apply(this,arguments)})},{key:"trackingData",value:function(e){return this.mappingState.trackingData[e]||(this.mappingState.trackingData[e]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[e]}},{key:"clonePointerEvent",value:function(e,t){var n=this.allocateEvent(qc);return n.nativeEvent=e.nativeEvent,n.originalEvent=e.originalEvent,this.copyPointerData(e,n),this.copyMouseData(e,n),this.copyData(e,n),n.target=e.target,n.path=e.composedPath().slice(),n.type=null!=t?t:n.type,n}},{key:"copyPointerData",value:function(e,t){e instanceof qc&&t instanceof qc&&(t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist)}},{key:"copyMouseData",value:function(e,t){e instanceof Yc&&t instanceof Yc&&(t.altKey=e.altKey,t.button=e.button,t.buttons=e.buttons,t.ctrlKey=e.ctrlKey,t.metaKey=e.metaKey,t.shiftKey=e.shiftKey,t.client.copyFrom(e.client),t.movement.copyFrom(e.movement),t.canvas.copyFrom(e.canvas),t.screen.copyFrom(e.screen),t.global.copyFrom(e.global),t.offset.copyFrom(e.offset))}},{key:"copyWheelData",value:function(e,t){t.deltaMode=e.deltaMode,t.deltaX=e.deltaX,t.deltaY=e.deltaY,t.deltaZ=e.deltaZ}},{key:"copyData",value:function(e,t){t.isTrusted=e.isTrusted,t.timeStamp=performance.now(),t.type=e.type,t.detail=e.detail,t.view=e.view,t.page.copyFrom(e.page),t.viewport.copyFrom(e.viewport)}},{key:"allocateEvent",value:function(e){this.eventPool.has(e)||this.eventPool.set(e,[]);var t=this.eventPool.get(e).pop()||new e(this);return t.eventPhase=t.NONE,t.currentTarget=null,t.path=[],t.target=null,t}},{key:"freeEvent",value:function(e){if(e.manager!==this)throw Error("It is illegal to free an event not managed by this EventBoundary!");var t=e.constructor;this.eventPool.has(t)||this.eventPool.set(t,[]),this.eventPool.get(t).push(e)}},{key:"notifyTarget",value:function(e,t){var n;t=null!==(n=t)&&void 0!==n?n:e.type,this.notifyListeners(e,e.eventPhase===e.CAPTURING_PHASE||e.eventPhase===e.AT_TARGET?"".concat(t,"capture"):t),e.eventPhase===e.AT_TARGET&&this.notifyListeners(e,t)}},{key:"notifyListeners",value:function(e,t){var n=e.currentTarget.emitter,r=n._events[t];if(r)if("fn"in r)r.once&&n.removeListener(t,r.fn,void 0,!0),r.fn.call(e.currentTarget||r.context,e);else for(var i=0;r.length>i&&!e.propagationImmediatelyStopped;i++)r[i].once&&n.removeListener(t,r[i].fn,void 0,!0),r[i].fn.call(e.currentTarget||r[i].context,e)}},{key:"findMountedTarget",value:function(e){if(!e)return null;for(var t=e[e.length-1],n=e.length-2;n>=0;n--){var r=e[n];if(!(r===this.rootTarget||tc.isNode(r)&&r.parentNode===t))break;t=e[n]}return t}},{key:"getCursor",value:function(e){for(var t=e;t;){var n=hc.isElement(t)&&t.getAttribute("cursor");if(n)return n;t=tc.isNode(t)&&t.parentNode}}}]),a}(jo.EventEmitter),It([le(xl),Lt("design:type",Object)],e.EventService.prototype,"renderingContext",void 0),It([le(bl),Lt("design:type",Object)],e.EventService.prototype,"contextService",void 0),It([le(Ui),Lt("design:type",Object)],e.EventService.prototype,"canvasConfig",void 0),It([le(e.DisplayObjectPool),Lt("design:type",e.DisplayObjectPool)],e.EventService.prototype,"displayObjectPool",void 0),It([Y.postConstruct(),Lt("design:type",Function),Lt("design:paramtypes",[]),Lt("design:returntype",void 0)],e.EventService.prototype,"init",null),e.EventService=It([ce()],e.EventService),e.OffscreenCanvasCreator=function(){function e(){dt(this,e),this.canvas=void 0,this.context=void 0}return yt(e,[{key:"getOrCreateCanvas",value:function(e){if(this.canvas)return this.canvas;if(e)this.canvas=e,this.context=this.canvas.getContext("2d");else try{this.canvas=new window.OffscreenCanvas(0,0),this.context=this.canvas.getContext("2d"),this.context&&this.context.measureText||(this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"))}catch(e){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d")}return this.canvas.width=10,this.canvas.height=10,this.canvas}},{key:"getOrCreateContext",value:function(e){return this.context||this.getOrCreateCanvas(e),this.context}}]),e}(),e.OffscreenCanvasCreator=It([ce()],e.OffscreenCanvasCreator);var Il={MetricsString:"|ÉqÅ",BaselineSymbol:"M",BaselineMultiplier:1.4,HeightMultiplier:2,Newlines:[10,13],BreakingSpaces:[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288]},Rl=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,Ll=RegExp("".concat(/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/.source,"|").concat(/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/.source,"|").concat(/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/.source,"|").concat(/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/.source)),Dl=RegExp("".concat(/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/.source,"|").concat(/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/.source,"|").concat(/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/.source,"|").concat(/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/.source));e.TextService=function(){function e(){var t=this;dt(this,e),this.cache={},this.offscreenCanvas=void 0,this.shouldBreakByKinsokuShorui=function(e,n){return!t.isBreakingSpace(n)&&!(!e||!Dl.exec(n)&&!Ll.exec(e))},this.trimByKinsokuShorui=function(e){var t=Nt(e),n=t[t.length-2];if(!n)return e;var r=n[n.length-1];return t[t.length-2]=n.slice(0,-1),t[t.length-1]=r+t[t.length-1],t}}return yt(e,[{key:"measureFont",value:function(e,t){if(this.cache[e])return this.cache[e];var n={ascent:0,descent:0,fontSize:0},r=this.offscreenCanvas.getOrCreateCanvas(t),i=this.offscreenCanvas.getOrCreateContext(t);i.font=e;var o=Il.MetricsString+Il.BaselineSymbol,a=Math.ceil(i.measureText(o).width),s=Math.ceil(i.measureText(Il.BaselineSymbol).width),u=Il.HeightMultiplier*s;s=s*Il.BaselineMultiplier|0,r.width=a,r.height=u,i.fillStyle="#f00",i.fillRect(0,0,a,u),i.font=e,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText(o,0,s);var c=i.getImageData(0,0,a||1,u||1).data,l=c.length,h=4*a,f=0,d=0,p=!1;for(f=0;s>f;++f){for(var y=0;h>y;y+=4)if(255!==c[d+y]){p=!0;break}if(p)break;d+=h}for(n.ascent=s-f,d=l-h,p=!1,f=u;f>s;--f){for(var v=0;h>v;v+=4)if(255!==c[d+v]){p=!0;break}if(p)break;d-=h}return n.descent=f-s,n.fontSize=n.ascent+n.descent,this.cache[e]=n,n}},{key:"measureText",value:function(e,t,n){var r=t.fontSize,i=t.wordWrap,o=t.lineHeight,a=void 0===o?0:o,s=t.lineWidth,u=t.textBaseline,c=t.textAlign,l=t.letterSpacing,h=void 0===l?0:l,f=t.leading,d=void 0===f?0:f,p=xo(t),y=this.measureFont(p,n);0===y.fontSize&&(y.fontSize=r.value,y.ascent=r.value);var v=this.offscreenCanvas.getOrCreateContext(n);v.font=p;for(var g=(i?this.wordWrap(e,t,n):e).split(/(?:\r\n|\r|\n)/),m=Array(g.length),k=0,T=0;g.length>T;T++){var b=v.measureText(g[T]).width+(g[T].length-1)*h;m[T]=b,k=Math.max(k,b)}var S=k+s.value,E=a||y.fontSize+s.value,P=Math.max(E,y.fontSize+s.value)+(g.length-1)*(E+d),x=0;return"middle"===u.value?x=-P/2:"bottom"===u.value||"alphabetic"===u.value||"ideographic"===u.value?x=-P:"top"!==u.value&&"hanging"!==u.value||(x=0),{font:p,width:S,height:P,lines:g,lineWidths:m,lineHeight:E+=d,maxLineWidth:k,fontProperties:y,lineMetrics:m.map((function(e,t){var n=0;return"center"===c.value?n-=e/2:"right"!==c.value&&"end"!==c.value||(n-=e),new qs(n-s.value/2,x+t*E,e+s.value,E)}))}}},{key:"wordWrap",value:function(e,t,n){var r=this,i=t.wordWrapWidth,o=void 0===i?0:i,a=t.letterSpacing,s=void 0===a?0:a,u=this.offscreenCanvas.getOrCreateContext(n),c=o+s,l=[],h=0,f=0,d={},p=function(e){return r.getFromCache(e,s,d,u)};return Array.from(e).forEach((function(t,n){var i=e[n-1],o=e[n+1],a=p(t);if(r.isNewline(t))return h++,f=0,void(l[h]="");if(f>0&&f+a>c){if(h++,f=0,l[h]="",r.isBreakingSpace(t))return;r.canBreakInLastChar(t)||(l=r.trimToBreakable(l),f=r.sumTextWidthByCache(l[h]||"",d)),r.shouldBreakByKinsokuShorui(t,o)&&(l=r.trimByKinsokuShorui(l),f+=p(i||""))}f+=a,l[h]=(l[h]||"")+t})),l.join("\n")}},{key:"isBreakingSpace",value:function(e){return"string"==typeof e&&Il.BreakingSpaces.indexOf(e.charCodeAt(0))>=0}},{key:"isNewline",value:function(e){return"string"==typeof e&&Il.Newlines.indexOf(e.charCodeAt(0))>=0}},{key:"trimToBreakable",value:function(e){var t=Nt(e),n=t[t.length-2],r=this.findBreakableIndex(n);if(-1===r||!n)return t;var i=n.slice(r,r+1),o=r+(this.isBreakingSpace(i)?0:1);return t[t.length-1]+=n.slice(r+1,n.length),t[t.length-2]=n.slice(0,o),t}},{key:"canBreakInLastChar",value:function(e){return!e||!Rl.test(e)}},{key:"sumTextWidthByCache",value:function(e,t){return e.split("").reduce((function(e,n){if(!t[n])throw Error("cannot count the word without cache");return e+t[n]}),0)}},{key:"findBreakableIndex",value:function(e){for(var t=e.length-1;t>=0;t--)if(!Rl.test(e[t]))return t;return-1}},{key:"getFromCache",value:function(e,t,n,r){var i=n[e];if("number"!=typeof i){var o=e.length*t;i=r.measureText(e).width+o,n[e]=i}return i}}]),e}(),It([le(e.OffscreenCanvasCreator),Lt("design:type",e.OffscreenCanvasCreator)],e.TextService.prototype,"offscreenCanvas",void 0),e.TextService=It([ce()],e.TextService);var Ul=e.Syringe.defineToken("GeometryUpdaterFactory"),Fl=e.Syringe.defineToken("GeometryAABBUpdater");function Bl(e){var t=e.parsedStyle.fontSize;return t&&!ia.isRelativeUnit(t.unit)?t.clone():new ia(0,"px")}e.CircleUpdater=function(){function e(){dt(this,e)}return yt(e,[{key:"update",value:function(e,t){var n=e.r;return{width:2*n.value,height:2*n.value}}}]),e}(),e.CircleUpdater=It([ce({token:{token:Fl,named:e.Shape.CIRCLE}})],e.CircleUpdater),e.EllipseUpdater=function(){function e(){dt(this,e)}return yt(e,[{key:"update",value:function(e,t){return{width:2*e.rx.value,height:2*e.ry.value}}}]),e}(),e.EllipseUpdater=It([ce({token:{token:Fl,named:e.Shape.ELLIPSE}})],e.EllipseUpdater),e.RectUpdater=function(){function t(){dt(this,t)}return yt(t,[{key:"update",value:function(t,n){var r=t.img,i=t.width,o=t.height,a=0,s=0;return i instanceof ia&&i.unit===e.UnitType.kPixels&&(a=i.value),o instanceof ia&&o.unit===e.UnitType.kPixels&&(s=o.value),r&&!yi(r)&&(a||(a=r.width),s||(s=r.height)),i instanceof ia&&(i.value=a),o instanceof ia&&(o.value=s),{width:a,height:s}}}]),t}(),e.RectUpdater=It([ce({token:[{token:Fl,named:e.Shape.RECT},{token:Fl,named:e.Shape.IMAGE},{token:Fl,named:e.Shape.GROUP}]})],e.RectUpdater),e.TextUpdater=function(){function e(){dt(this,e),this.textService=void 0}return yt(e,[{key:"isReadyToMeasure",value:function(e,t){return e.text&&e.fontSize&&e.fontStyle&&e.fontWeight&&e.fontVariant&&e.textAlign&&e.textBaseline&&e.lineWidth}},{key:"update",value:function(e,t){var n,r,i=e.text,o=e.textAlign,a=e.lineWidth,s=e.textBaseline,u=e.dx,c=e.dy,l=((null==t||null===(n=t.ownerDocument)||void 0===n||null===(r=n.defaultView)||void 0===r?void 0:r.getConfig())||{}).offscreenCanvas;if(!this.isReadyToMeasure(e,t))return e.metrics={font:"",width:0,height:0,lines:[],lineWidths:[],lineHeight:0,maxLineWidth:0,fontProperties:{ascent:0,descent:0,fontSize:0},lineMetrics:[]},{width:0,height:0,x:0,y:0,offsetX:0,offsetY:0};var h=this.textService.measureText(i,e,l);e.metrics=h;var f=h.lineHeight,d=h.fontProperties,p=Ln(h.width/2,h.height/2,0),y=[0,1],v=0;"center"===o.value?(v=a.value/2,y=[.5,1]):"right"!==o.value&&"end"!==o.value||(v=a.value,y=[1,1]);var g=0;return"middle"===s.value?g=p[1]:"top"===s.value||"hanging"===s.value?g=2*p[1]:"alphabetic"===s.value?g=f-d.ascent:"bottom"!==s.value&&"ideographic"!==s.value||(g=0),u&&(v+=u.value),c&&(g+=c.value),e.anchor=[new ia(y[0]),new ia(y[1]),new ia(0)],{width:2*p[0],height:2*p[1],offsetX:v,offsetY:g}}}]),e}(),It([le(e.TextService),Lt("design:type",e.TextService)],e.TextUpdater.prototype,"textService",void 0),e.TextUpdater=It([ce({token:{token:Fl,named:e.Shape.TEXT}})],e.TextUpdater),e.LineUpdater=function(){function e(){dt(this,e)}return yt(e,[{key:"update",value:function(e){var t=e.x1,n=e.y1,r=e.x2,i=e.y2,o=Math.min(t.value,r.value),a=Math.max(t.value,r.value),s=Math.min(n.value,i.value);return{width:a-o,height:Math.max(n.value,i.value)-s}}}]),e}(),e.LineUpdater=It([ce({token:{token:Fl,named:e.Shape.LINE}})],e.LineUpdater),e.PolylineUpdater=function(){function e(){dt(this,e)}return yt(e,[{key:"update",value:function(e){var t=e.points.points,n=Math.min.apply(Math,Nt(t.map((function(e){return e[0]})))),r=Math.max.apply(Math,Nt(t.map((function(e){return e[0]})))),i=Math.min.apply(Math,Nt(t.map((function(e){return e[1]}))));return{width:r-n,height:Math.max.apply(Math,Nt(t.map((function(e){return e[1]}))))-i}}}]),e}(),e.PolylineUpdater=It([ce({token:[{token:Fl,named:e.Shape.POLYLINE},{token:Fl,named:e.Shape.POLYGON}]})],e.PolylineUpdater),e.PathUpdater=function(){function e(){dt(this,e)}return yt(e,[{key:"update",value:function(e){var t=e.path.rect;return{width:t.width,height:t.height}}}]),e}(),e.PathUpdater=It([ce({token:{token:Fl,named:e.Shape.PATH}})],e.PathUpdater),e.CSSPropertyClipPath=function(){function e(){dt(this,e)}return yt(e,[{key:"calculator",value:function(e,t,n,r){if(n instanceof Xo&&(n=null),t&&t!==n&&t.style.clipPathTargets){var i=t.style.clipPathTargets.indexOf(r);t.style.clipPathTargets.splice(i,1)}return n&&(n.style.clipPathTargets||(n.style.clipPathTargets=[]),n.style.clipPathTargets.push(r)),ml(r),n}}]),e}(),e.CSSPropertyClipPath=It([ce({token:{token:Zu,named:e.PropertySyntax.CLIP_PATH}})],e.CSSPropertyClipPath),e.CSSPropertyColor=function(){function e(){dt(this,e),this.parser=Os,this.mixer=Is}return yt(e,[{key:"calculator",value:function(e,t,n,r){return n instanceof Xo?new ga(0,0,0,0,"none"===n.value):n}}]),e}(),e.CSSPropertyColor=It([ce({token:[{token:Zu,named:e.PropertySyntax.PAINT},{token:Zu,named:e.PropertySyntax.COLOR}]})],e.CSSPropertyColor),e.CSSPropertyFilter=yt((function e(){dt(this,e),this.parser=Du})),e.CSSPropertyFilter=It([ce({token:{token:Zu,named:e.PropertySyntax.FILTER}})],e.CSSPropertyFilter),e.CSSPropertyLengthOrPercentage=function(){function t(){dt(this,t),this.parser=Zs,this.mixer=Qs}return yt(t,[{key:"calculator",value:function(t,n,r,i,o){if(!ia.isRelativeUnit(r.unit))return r.clone();if(r.unit===e.UnitType.kPercentage)return new ia(0,"px");if(r.unit===e.UnitType.kEms){if(i.parentNode){var a=Bl(i.parentNode);return a.value*=r.value,a}return new ia(0,"px")}if(r.unit===e.UnitType.kRems){var s;if(null==i||null===(s=i.ownerDocument)||void 0===s?void 0:s.documentElement){var u=Bl(i.ownerDocument.documentElement);return u.value*=r.value,u}return new ia(0,"px")}}}]),t}(),e.CSSPropertyLengthOrPercentage=It([ce({token:{token:Zu,named:e.PropertySyntax.LENGTH_PERCENTAGE}})],e.CSSPropertyLengthOrPercentage),e.CSSPropertyLengthOrPercentage12=function(){function e(){dt(this,e),this.mixer=tu}return yt(e,[{key:"parser",value:function(e){var t=eu(Kt(e)?[e]:e);return 1===t.length?[t[0],t[0]]:[t[0],t[1]]}}]),e}(),e.CSSPropertyLengthOrPercentage12=It([ce({token:{token:Zu,named:e.PropertySyntax.LENGTH_PERCENTAGE_12}})],e.CSSPropertyLengthOrPercentage12),e.CSSPropertyLengthOrPercentage14=function(){function e(){dt(this,e),this.mixer=tu}return yt(e,[{key:"parser",value:function(e){var t=eu(Kt(e)?[e]:e);return 1===t.length?[t[0],t[0],t[0],t[0]]:2===t.length?[t[0],t[1],t[0],t[1]]:3===t.length?[t[0],t[1],t[2],t[1]]:[t[0],t[1],t[2],t[3]]}}]),e}(),e.CSSPropertyLengthOrPercentage14=It([ce({token:{token:Zu,named:e.PropertySyntax.LENGTH_PERCENTAGE_14}})],e.CSSPropertyLengthOrPercentage14),e.CSSPropertyLocalPosition=function(t){gt(r,t);var n=xt(r);function r(){return dt(this,r),n.apply(this,arguments)}return yt(r,[{key:"postProcessor",value:function(t){var n,r,i;switch(t.nodeName){case e.Shape.CIRCLE:case e.Shape.ELLIPSE:var o=t.parsedStyle,a=o.cx,s=o.cy;Xt(a)||(n=a.value),Xt(s)||(r=s.value);break;case e.Shape.LINE:var u=t.parsedStyle,c=u.y1,l=u.y2;n=Math.min(u.x1.value,u.x2.value),r=Math.min(c.value,l.value),i=0;break;default:Xt(t.parsedStyle.x)||(n=t.parsedStyle.x.value),Xt(t.parsedStyle.y)||(r=t.parsedStyle.y.value)}t.parsedStyle.defX=n||0,t.parsedStyle.defY=r||0;var h=Ct(t.getLocalPosition(),3),f=h[0],d=h[1],p=h[2];t.setLocalPosition(Xt(n)?f:n,Xt(r)?d:r,Xt(i)?p:i)}}]),r}(e.CSSPropertyLengthOrPercentage),e.CSSPropertyLocalPosition=It([ce({token:{token:Zu,named:e.PropertySyntax.COORDINATE}})],e.CSSPropertyLocalPosition),e.CSSPropertyOffsetDistance=function(){function t(){dt(this,t),this.parser=iu,this.mixer=au(0,1)}return yt(t,[{key:"postProcessor",value:function(t){if(t.attributes.offsetPath){var n=t.attributes.offsetPath.nodeName;if(n===e.Shape.LINE||n===e.Shape.PATH||n===e.Shape.POLYLINE){var r=t.attributes.offsetPath.getPoint(t.parsedStyle.offsetDistance.value);r&&t.setLocalPosition(r.x,r.y)}}}}]),t}(),e.CSSPropertyOffsetDistance=It([ce({token:{token:Zu,named:e.PropertySyntax.OFFSET_DISTANCE}})],e.CSSPropertyOffsetDistance),e.CSSPropertyOffsetPath=function(){function e(){dt(this,e)}return yt(e,[{key:"calculator",value:function(e,t,n,r){if(t&&t!==n&&t.style.offsetPathTargets){var i=t.style.offsetPathTargets.indexOf(r);t.style.offsetPathTargets.splice(i,1)}return n&&(n.style.offsetPathTargets||(n.style.offsetPathTargets=[]),n.style.offsetPathTargets.push(r)),n}}]),e}(),e.CSSPropertyOffsetPath=It([ce({token:{token:Zu,named:e.PropertySyntax.OFFSET_PATH}})],e.CSSPropertyOffsetPath),e.CSSPropertyOpacity=yt((function e(){dt(this,e),this.parser=iu,this.mixer=au(0,1)})),e.CSSPropertyOpacity=It([ce({token:{token:Zu,named:e.PropertySyntax.OPACITY_VALUE}})],e.CSSPropertyOpacity),e.CSSPropertyPath=function(){function t(){dt(this,t),this.parser=Au,this.mixer=Ou}return yt(t,[{key:"calculator",value:function(e,t,n){return n instanceof Xo&&"unset"===n.value?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:[],totalLength:0,curveSegments:[],zCommandIndexes:[],rect:new qs(0,0,0,0)}:n}},{key:"postProcessor",value:function(t){if(t.nodeName===e.Shape.PATH){var n=t.parsedStyle,r=n.defX,i=n.defY;t.setLocalPosition(void 0===r?0:r,void 0===i?0:i)}}}]),t}(),e.CSSPropertyPath=It([ce({token:{token:Zu,named:e.PropertySyntax.PATH}})],e.CSSPropertyPath),e.CSSPropertyPoints=function(){function t(){dt(this,t),this.parser=Iu}return yt(t,[{key:"postProcessor",value:function(t){if(t.nodeName===e.Shape.POLYGON||t.nodeName===e.Shape.POLYLINE){var n=t.parsedStyle;t.setLocalPosition(n.defX,n.defY)}}}]),t}(),e.CSSPropertyPoints=It([ce({token:{token:Zu,named:e.PropertySyntax.LIST_OF_POINTS}})],e.CSSPropertyPoints),e.CSSPropertyShadowBlur=function(e){gt(n,e);var t=xt(n);function n(){var e;dt(this,n);for(var r=arguments.length,i=Array(r),o=0;r>o;o++)i[o]=arguments[o];return(e=t.call.apply(t,[this].concat(i))).mixer=au(0,1/0),e}return yt(n)}(e.CSSPropertyLengthOrPercentage),e.CSSPropertyShadowBlur=It([ce({token:{token:Zu,named:e.PropertySyntax.SHADOW_BLUR}})],e.CSSPropertyShadowBlur),e.CSSPropertyText=function(){function e(){dt(this,e)}return yt(e,[{key:"calculator",value:function(e,t,n,r){return n instanceof Xo?"unset"===n.value?"":n.value:n}},{key:"postProcessor",value:function(e){e.nodeValue="".concat(e.parsedStyle.text)||""}}]),e}(),e.CSSPropertyText=It([ce({token:{token:Zu,named:e.PropertySyntax.TEXT}})],e.CSSPropertyText),e.CSSPropertyTextTransform=function(){function e(){dt(this,e)}return yt(e,[{key:"calculator",value:function(e,t,n,r){var i=r.getAttribute("text");if(i){var o=i;"capitalize"===n.value?o=i.charAt(0).toUpperCase()+i.slice(1):"lowercase"===n.value?o=i.toLowerCase():"uppercase"===n.value&&(o=i.toUpperCase()),r.parsedStyle.text=o}return n}}]),e}(),e.CSSPropertyTextTransform=It([ce({token:{token:Zu,named:e.PropertySyntax.TEXT_TRANSFORM}})],e.CSSPropertyTextTransform),e.CSSPropertyTransform=function(){function e(){dt(this,e),this.parser=Gu,this.mixer=Wu}return yt(e,[{key:"postProcessor",value:function(e){var t=e.parsedStyle,n=t.transform,r=t.defX,i=t.defY;n&&n.length&&(e.resetLocalTransform(),e.setLocalPosition(r,i),n.forEach((function(t){var n=t.t,r=t.d;if("scale"===n){var i=r.map((function(e){return e.value}))||[1,1];e.scaleLocal(i[0],i[1],1)}else if("scalex"===n){var o=r.map((function(e){return e.value}))||[1];e.scaleLocal(o[0],1,1)}else if("scaley"===n){var a=r.map((function(e){return e.value}))||[1];e.scaleLocal(1,a[0],1)}else if("scalez"===n){var s=r.map((function(e){return e.value}))||[1];e.scaleLocal(1,1,s[0])}else if("scale3d"===n){var u=r.map((function(e){return e.value}))||[1,1,1];e.scaleLocal(u[0],u[1],u[2])}else if("translate"===n){var c=r||[ya,ya];e.translateLocal(c[0].value,c[1].value,0)}else if("translatex"===n){e.translateLocal((r||[ya])[0].value,0,0)}else if("translatey"===n){e.translateLocal(0,(r||[ya])[0].value,0)}else if("translatez"===n){e.translateLocal(0,0,(r||[ya])[0].value)}else if("translate3d"===n){var l=r||[ya,ya,ya];e.translateLocal(l[0].value,l[1].value,l[2].value)}else if("rotate"===n){e.rotateLocal(0,0,(r||[va])[0].value)}else if("rotatex"===n){e.rotateLocal((r||[va])[0].value,0,0)}else if("rotatey"===n){e.rotateLocal(0,(r||[va])[0].value,0)}else if("rotatez"===n){e.rotateLocal(0,0,(r||[va])[0].value)}})))}}]),e}(),e.CSSPropertyTransform=It([ce({token:{token:Zu,named:e.PropertySyntax.TRANSFORM}})],e.CSSPropertyTransform),e.CSSPropertyTransformOrigin=yt((function e(){dt(this,e),this.parser=Yu})),e.CSSPropertyTransformOrigin=It([ce({token:{token:Zu,named:e.PropertySyntax.TRANSFORM_ORIGIN}})],e.CSSPropertyTransformOrigin),e.CSSPropertyZIndex=function(){function e(){dt(this,e),this.parser=iu}return yt(e,[{key:"postProcessor",value:function(e){if(e.parentNode){var t=e.parentNode,n=t.renderable,r=t.sortable;n&&(n.dirty=!0),r&&(r.dirty=!0)}}}]),e}(),e.CSSPropertyZIndex=It([ce({token:{token:Zu,named:e.PropertySyntax.Z_INDEX}})],e.CSSPropertyZIndex);var Vl=[{name:"display",keywords:["none"]},{name:"opacity",interpolable:!0,defaultValue:"1",syntax:e.PropertySyntax.OPACITY_VALUE},{name:"fillOpacity",interpolable:!0,inherited:!0,defaultValue:"1",syntax:e.PropertySyntax.OPACITY_VALUE},{name:"strokeOpacity",interpolable:!0,inherited:!0,defaultValue:"1",syntax:e.PropertySyntax.OPACITY_VALUE},{name:"fill",interpolable:!0,keywords:["none"],defaultValue:"none",syntax:e.PropertySyntax.PAINT},{name:"stroke",interpolable:!0,keywords:["none"],defaultValue:"none",syntax:e.PropertySyntax.PAINT},{name:"shadowColor",interpolable:!0,syntax:e.PropertySyntax.COLOR},{name:"shadowOffsetX",interpolable:!0,layoutDependent:!0,syntax:e.PropertySyntax.LENGTH_PERCENTAGE},{name:"shadowOffsetY",interpolable:!0,layoutDependent:!0,syntax:e.PropertySyntax.LENGTH_PERCENTAGE},{name:"shadowBlur",interpolable:!0,layoutDependent:!0,syntax:e.PropertySyntax.SHADOW_BLUR},{name:"lineWidth",interpolable:!0,inherited:!0,defaultValue:"1",layoutDependent:!0,alias:["strokeWidth"],syntax:e.PropertySyntax.LENGTH_PERCENTAGE},{name:"increasedLineWidthForHitTesting",inherited:!0,defaultValue:"0",layoutDependent:!0,syntax:e.PropertySyntax.LENGTH_PERCENTAGE},{name:"lineJoin",inherited:!0,layoutDependent:!0,alias:["strokeLinejoin"],keywords:["miter","bevel","round"],defaultValue:"miter"},{name:"lineCap",inherited:!0,layoutDependent:!0,alias:["strokeLinecap"],keywords:["butt","round","square"],defaultValue:"butt"},{name:"lineDash",interpolable:!0,inherited:!0,keywords:["none"],alias:["strokeDasharray"],syntax:e.PropertySyntax.LENGTH_PERCENTAGE_12},{name:"lineDashOffset",interpolable:!0,inherited:!0,defaultValue:"0",alias:["strokeDashoffset"],syntax:e.PropertySyntax.LENGTH_PERCENTAGE},{name:"offsetPath",syntax:e.PropertySyntax.OFFSET_PATH},{name:"offsetDistance",interpolable:!0,syntax:e.PropertySyntax.OFFSET_DISTANCE},{name:"dx",interpolable:!0,layoutDependent:!0,defaultValue:"0",syntax:e.PropertySyntax.LENGTH_PERCENTAGE},{name:"dy",interpolable:!0,layoutDependent:!0,defaultValue:"0",syntax:e.PropertySyntax.LENGTH_PERCENTAGE},{name:"zIndex",independent:!0,interpolable:!0,defaultValue:"0",keywords:["auto"],syntax:e.PropertySyntax.Z_INDEX},{name:"visibility",keywords:["visible","hidden"],independent:!0,inherited:!0,defaultValue:"visible"},{name:"pointerEvents",inherited:!0,keywords:["none","auto","stroke","fill","painted","visible","visiblestroke","visiblefill","visiblepainted","bounding-box","all"],defaultValue:"auto"},{name:"filter",independent:!0,layoutDependent:!0,syntax:e.PropertySyntax.FILTER},{name:"clipPath",syntax:e.PropertySyntax.CLIP_PATH},{name:"transform",parsePriority:100,interpolable:!0,keywords:["none"],defaultValue:"none",syntax:e.PropertySyntax.TRANSFORM},{name:"transformOrigin",parsePriority:100,defaultValue:"left top",layoutDependent:!0,syntax:e.PropertySyntax.TRANSFORM_ORIGIN},{name:"anchor",parsePriority:99,defaultValue:"0 0",layoutDependent:!0,syntax:e.PropertySyntax.LENGTH_PERCENTAGE_12},{name:"cx",interpolable:!0,defaultValue:"0",syntax:e.PropertySyntax.COORDINATE},{name:"cy",interpolable:!0,defaultValue:"0",syntax:e.PropertySyntax.COORDINATE},{name:"r",interpolable:!0,layoutDependent:!0,defaultValue:"0",syntax:e.PropertySyntax.LENGTH_PERCENTAGE},{name:"rx",interpolable:!0,layoutDependent:!0,defaultValue:"auto",syntax:e.PropertySyntax.LENGTH_PERCENTAGE},{name:"ry",interpolable:!0,layoutDependent:!0,defaultValue:"auto",syntax:e.PropertySyntax.LENGTH_PERCENTAGE},{name:"x",interpolable:!0,defaultValue:"0",syntax:e.PropertySyntax.COORDINATE},{name:"y",interpolable:!0,defaultValue:"0",syntax:e.PropertySyntax.COORDINATE},{name:"z",interpolable:!0,defaultValue:"0",syntax:e.PropertySyntax.COORDINATE},{name:"width",interpolable:!0,layoutDependent:!0,keywords:["auto","fit-content","min-content","max-content"],defaultValue:"auto",syntax:e.PropertySyntax.LENGTH_PERCENTAGE},{name:"height",interpolable:!0,layoutDependent:!0,keywords:["auto","fit-content","min-content","max-content"],defaultValue:"auto",syntax:e.PropertySyntax.LENGTH_PERCENTAGE},{name:"radius",interpolable:!0,layoutDependent:!0,defaultValue:"0",syntax:e.PropertySyntax.LENGTH_PERCENTAGE_14},{name:"x1",interpolable:!0,layoutDependent:!0,syntax:e.PropertySyntax.COORDINATE},{name:"y1",interpolable:!0,layoutDependent:!0,syntax:e.PropertySyntax.COORDINATE},{name:"z1",interpolable:!0,layoutDependent:!0,syntax:e.PropertySyntax.COORDINATE},{name:"x2",interpolable:!0,layoutDependent:!0,syntax:e.PropertySyntax.COORDINATE},{name:"y2",interpolable:!0,layoutDependent:!0,syntax:e.PropertySyntax.COORDINATE},{name:"z2",interpolable:!0,layoutDependent:!0,syntax:e.PropertySyntax.COORDINATE},{name:"path",interpolable:!0,layoutDependent:!0,defaultValue:"",alias:["d"],syntax:e.PropertySyntax.PATH},{name:"points",layoutDependent:!0,syntax:e.PropertySyntax.LIST_OF_POINTS},{name:"text",layoutDependent:!0,defaultValue:"",syntax:e.PropertySyntax.TEXT,parsePriority:50},{name:"textTransform",layoutDependent:!0,inherited:!0,keywords:["capitalize","uppercase","lowercase","none"],defaultValue:"none",syntax:e.PropertySyntax.TEXT_TRANSFORM,parsePriority:51},{name:"font",layoutDependent:!0},{name:"fontSize",interpolable:!0,inherited:!0,defaultValue:"16px",layoutDependent:!0,syntax:e.PropertySyntax.LENGTH_PERCENTAGE},{name:"fontFamily",layoutDependent:!0,inherited:!0,defaultValue:"sans-serif"},{name:"fontStyle",layoutDependent:!0,inherited:!0,keywords:["normal","italic","oblique"],defaultValue:"normal"},{name:"fontWeight",layoutDependent:!0,inherited:!0,keywords:["normal","bold","bolder","lighter"],defaultValue:"normal"},{name:"fontVariant",layoutDependent:!0,inherited:!0,keywords:["normal","small-caps"],defaultValue:"normal"},{name:"lineHeight",layoutDependent:!0},{name:"letterSpacing",layoutDependent:!0},{name:"wordWrap",layoutDependent:!0},{name:"wordWrapWidth",layoutDependent:!0},{name:"leading",layoutDependent:!0},{name:"textBaseline",layoutDependent:!0,inherited:!0,keywords:["top","hanging","middle","alphabetic","ideographic","bottom"],defaultValue:"alphabetic"},{name:"textAlign",layoutDependent:!0,inherited:!0,keywords:["start","center","end","left","right"],defaultValue:"start"},{name:"whiteSpace",layoutDependent:!0}];e.DefaultStyleValueRegistry=function(){function t(){dt(this,t),this.dirty=!1,this.cache={},this.unresolvedProperties={},this.propertySyntaxFactory=void 0,this.cascadeProperties={}}return yt(t,[{key:"init",value:function(){var e=this;Vl.forEach((function(t){e.registerMetadata(t)}))}},{key:"registerMetadata",value:function(e){var t=this;[e.name].concat(Nt(e.alias||[])).forEach((function(n){t.cache[n]=e}))}},{key:"unregisterMetadata",value:function(e){delete this.cache[e]}},{key:"getMetadata",value:function(e){return this.cache[e]}},{key:"getPropertySyntax",value:function(e){return this.propertySyntaxFactory(e)}},{key:"processProperties",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{skipUpdateAttribute:!1,skipParse:!1},i=r.skipUpdateAttribute,o=r.skipParse,a=!1;Object.keys(t).forEach((function(r){var o,s=Ct(Si(r,t[r]),2),u=s[0];i||(e.attributes[u]=s[1]),!a&&(null===(o=n.getMetadata(u))||void 0===o?void 0:o.layoutDependent)&&(a=!0)}));var s=Object.keys(t).sort((function(e,t){var r,i;return((null===(r=n.getMetadata(e))||void 0===r?void 0:r.parsePriority)||0)-((null===(i=n.getMetadata(t))||void 0===i?void 0:i.parsePriority)||0)}));o||s.forEach((function(t){e.computedStyle[t]=n.parseProperty(t,e.attributes[t],e)}));var u=!1;s.forEach((function(t){t in e.computedStyle&&(u=n.computeProperty(t,e.computedStyle[t],e))})),u?this.dirty=!0:(a&&this.updateGeometry(e),s.forEach((function(t){t in e.parsedStyle&&n.postProcessProperty(t,e)})),s.forEach((function(t){t in e.parsedStyle&&n.isPropertyInheritable(t)&&e.children.forEach((function(e){e.internalSetAttribute(t,null,{skipUpdateAttribute:!0,skipParse:!0})}))})))}},{key:"parseProperty",value:function(e,t,n){var r=this.getMetadata(e),i=t;if((""===t||Xt(t))&&(t="unset"),"unset"===t||"initial"===t||"inherit"===t)i=new Xo(t);else if(r){var o=r.keywords,a=r.syntax,s=a&&this.getPropertySyntax(a);if(o&&o.indexOf(t)>-1)i=new Xo(t);else if(s){s&&s.parser&&(i=s.parser(t,n))}}return i}},{key:"computeProperty",value:function(e,t,n){var r=this.getMetadata(e),i="g-root"===n.id,o=t instanceof Yo?t.clone():t;if(r){var a=r.syntax,s=r.defaultValue;if(t instanceof Xo){var u=t.value;if("unset"===u&&(u=r.inherited&&!i?"inherit":"initial"),"initial"===u)Xt(s)||(t=this.parseProperty(e,s,n));else if("inherit"===u){var c=this.tryToResolveProperty(n,e,{inherited:!0});return c?(n.parsedStyle[e]=c,!1):(this.addUnresolveProperty(n,e),!0)}}var l=a&&this.getPropertySyntax(a);if(l)if(l.calculator)o=l.calculator(e,n.parsedStyle[e],t,n,this);else o=t;else o=t}return n.parsedStyle[e]=o,!1}},{key:"postProcessProperty",value:function(e,t){var n=this.getMetadata(e);if(n&&n.syntax){var r=n.syntax&&this.getPropertySyntax(n.syntax);r&&r.postProcessor&&r.postProcessor(t)}}},{key:"isPropertyResolved",value:function(e,t){return!this.unresolvedProperties[e.entity]||0===this.unresolvedProperties[e.entity].length||this.unresolvedProperties[e.entity].includes(t)}},{key:"addUnresolveProperty",value:function(e,t){this.unresolvedProperties[e.entity]||(this.unresolvedProperties[e.entity]=[]),-1===this.unresolvedProperties[e.entity].indexOf(t)&&this.unresolvedProperties[e.entity].push(t)}},{key:"tryToResolveProperty",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.inherited;if(r&&e.parentElement&&this.isPropertyResolved(e.parentElement,t)){var i=e.parentElement.parsedStyle[t];return(!(i instanceof Xo)||"unset"!==i.value&&"initial"!==i.value&&"inherit"!==i.value)&&(!(i instanceof ia&&ia.isRelativeUnit(i.unit))&&i)}return!1}},{key:"recalc",value:function(e){var t=this.unresolvedProperties[e.entity];if(t&&t.length){var n={};t.forEach((function(t){n[t]=e.attributes[t]})),this.processProperties(e,n),delete this.unresolvedProperties[e.entity]}}},{key:"updateGeometry",value:function(t){var n=Ve.get(Ul)(t.nodeName);if(n){var r,i=t.geometry;i.contentBounds||(i.contentBounds=new Ls),i.renderBounds||(i.renderBounds=new Ls);var o=t.parsedStyle,a=n.update(o,t),s=a.width,u=a.height,c=a.depth,l=void 0===c?0:c,h=a.offsetX,f=void 0===h?0:h,d=a.offsetY,p=void 0===d?0:d,y=a.offsetZ,v=void 0===y?0:y,g=0>s,m=0>u,k=Ln(Math.abs(s)/2,Math.abs(u)/2,l/2),T=o.lineWidth,b=o.increasedLineWidthForHitTesting,S=o.shadowColor,E=o.filter,P=void 0===E?[]:E,x=o.transformOrigin,w=o.anchor;t.nodeName===e.Shape.TEXT&&delete o.anchor;var _=Ln((1-2*(w&&w[0].value||0))*s/2+f,(1-2*(w&&w[1].value||0))*u/2+p,(1-2*(w&&(null===(r=w[2])||void 0===r?void 0:r.value)||0))*k[2]+v);i.contentBounds.update(_,k);var C=(((null==T?void 0:T.value)||0)+((null==b?void 0:b.value)||0))/2;if(Fn(k,k,Ln(C,C,0)),i.renderBounds.update(_,k),S){var N=i.renderBounds,M=N.min,A=N.max,O=o.shadowBlur,I=o.shadowOffsetX,R=o.shadowOffsetY,L=O&&O.value||0,D=I&&I.value||0,U=R&&R.value||0,F=A[0]+L+D,B=M[1]-L+U,V=A[1]+L+U;M[0]=Math.min(M[0],M[0]-L+D),A[0]=Math.max(A[0],F),M[1]=Math.min(M[1],B),A[1]=Math.max(A[1],V),i.renderBounds.setMinMax(M,A)}P.forEach((function(e){var t=e.name,n=e.params;if("blur"===t){var r=n[0].value;i.renderBounds.update(i.renderBounds.center,Fn(i.renderBounds.halfExtents,i.renderBounds.halfExtents,Ln(r,r,0)))}else if("drop-shadow"===t){var o=n[0].value,a=n[1].value,s=n[2].value,u=i.renderBounds,c=u.min,l=u.max,h=l[0]+s+o,f=c[1]-s+a,d=l[1]+s+a;c[0]=Math.min(c[0],c[0]-s+o),l[0]=Math.max(l[0],h),c[1]=Math.min(c[1],f),l[1]=Math.max(l[1],d),i.renderBounds.setMinMax(c,l)}})),w=o.anchor;var j=(g?-1:1)*nu(x[0],0,t),G=(m?-1:1)*nu(x[1],1,t);t.setOrigin(j-=(g?-1:1)*(w&&w[0].value||0)*i.contentBounds.halfExtents[0]*2,G-=(m?-1:1)*(w&&w[1].value||0)*i.contentBounds.halfExtents[1]*2),t.dispatchEvent(new $u(e.ElementEvent.GEOMETRY_BOUNDS_CHANGED)),ml(t)}}},{key:"isPropertyInheritable",value:function(e){var t=this.getMetadata(e);return!!t&&t.inherited}}]),t}(),It([le(Ku),Lt("design:type",Function)],e.DefaultStyleValueRegistry.prototype,"propertySyntaxFactory",void 0),It([Y.postConstruct(),Lt("design:type",Function),Lt("design:paramtypes",[]),Lt("design:returntype",void 0)],e.DefaultStyleValueRegistry.prototype,"init",null),e.DefaultStyleValueRegistry=It([ce({token:ii})],e.DefaultStyleValueRegistry);var jl=Ae((function(t){Y.decorate(ue(),jo.EventEmitter),t(e.DisplayObjectPool),t(e.DefaultSceneGraphSelector),t({token:pl,useFactory:function(e){return function(){return e.container.get(yl)}}}),t(e.DefaultSceneGraphService),t(e.OffscreenCanvasCreator),t(e.TextService),t(e.CircleUpdater),t(e.EllipseUpdater),t(e.RectUpdater),t(e.TextUpdater),t(e.LineUpdater),t(e.PolylineUpdater),t(e.PathUpdater),t({token:Ul,useFactory:function(e){var t={};return function(n){return t[n]||e.container.isBoundNamed(Fl,n)&&(t[n]=e.container.getNamed(Fl,n)),t[n]}}}),t(e.CSSPropertyAngle),t(e.CSSPropertyClipPath),t(e.CSSPropertyColor),t(e.CSSPropertyFilter),t(e.CSSPropertyLengthOrPercentage),t(e.CSSPropertyLengthOrPercentage12),t(e.CSSPropertyLengthOrPercentage14),t(e.CSSPropertyLocalPosition),t(e.CSSPropertyOffsetDistance),t(e.CSSPropertyOffsetPath),t(e.CSSPropertyOpacity),t(e.CSSPropertyPath),t(e.CSSPropertyPoints),t(e.CSSPropertyShadowBlur),t(e.CSSPropertyText),t(e.CSSPropertyTextTransform),t(e.CSSPropertyTransform),t(e.CSSPropertyTransformOrigin),t(e.CSSPropertyZIndex),t({token:Ku,useFactory:function(e){var t={};return function(n){return t[n]||e.container.isBoundNamed(Zu,n)&&(t[n]=e.container.getNamed(Zu,n)),t[n]}}}),t(e.DefaultStyleValueRegistry),t(e.LayoutRegistry),t(e.LayoutEngine),t(e.LayoutEdges),t({token:Ao,useFactory:function(t){return function(n){var r=t.container.createChild();return r.register({token:Oo,useValue:n}),r.get(e.LayoutEdges)}}}),t({token:Ft,useFactory:function(t){return function(n){var r=t.container.createChild();r.register(e.LayoutContext),r.register(e.LayoutChildren),r.register({token:wo,useFactory:function(t){return function(n){var r=t.container.createChild();return r.register({token:_o,useValue:n}),r.get(e.LayoutChildren)}}}),r.register(e.FragmentResult),r.register({token:jt,useFactory:function(t){return function(n,r){var i=t.container.createChild();return i.register({token:Gt,useValue:n}),i.register({token:zt,useValue:r}),i.get(e.FragmentResult)}}}),r.register(e.LayoutFragment),r.register({token:Ro,useFactory:function(t){return function(n){var r=t.container.createChild();return r.register({token:Lo,useValue:n}),r.get(e.LayoutFragment)}}});var i=r.get(wo),o=r.get(Ro),a=r.get(jt);return r.register({token:Bt,useValue:ut(ut({},n),{},{layoutChildrenFactory:i,layoutFragmentFactory:o,fragmentResultFactory:a})}),r.get(e.LayoutContext)}}})})),Gl=function(){function e(t){dt(this,e),this.plugins=[],this.config=void 0,this.config=ut({enableDirtyCheck:!0,enableCulling:!0,enableAutoRendering:!0,enableDirtyRectangleRendering:!0},t)}return yt(e,[{key:"registerPlugin",value:function(e){this.plugins.push(e)}},{key:"unregisterPlugin",value:function(e){var t=this.plugins.findIndex((function(t){return t===e}));t>-1&&this.plugins.splice(t,1)}},{key:"getPlugins",value:function(){return this.plugins}},{key:"getPlugin",value:function(e){return this.plugins.find((function(t){return t.name===e}))}},{key:"getConfig",value:function(){return this.config}},{key:"setConfig",value:function(e){Object.assign(this.config,e)}}]),e}();let zl=1;const Hl="object"==typeof self&&self.self==self?self:"object"==typeof global&&global.global==global?global:{},Wl=Date.now();let Yl={},ql=Date.now();const Xl=e=>{if("function"!=typeof e)throw new TypeError(e+" is not a function");const t=Date.now(),n=t-ql,r=n>16?0:16-n,i=zl++;return Yl[i]=e,Object.keys(Yl).length>1||setTimeout((()=>{ql=t;const e=Yl;Yl={},Object.keys(e).forEach((t=>e[t](Hl.performance&&"function"==typeof Hl.performance.now?Hl.performance.now():Date.now()-Wl)))}),r),i},Kl=e=>{delete Yl[e]},Zl=e=>"string"!=typeof e?Xl:""===e?Hl.requestAnimationFrame:Hl[e+"RequestAnimationFrame"],Jl=((e,t)=>{let n=0;for(;void 0!==e[n];){if(t(e[n]))return e[n];n+=1}})(["","webkit","moz","ms","o"],(e=>!!Zl(e))),Ql=Zl(Jl),$l="string"!=typeof(eh=Jl)?Kl:""===eh?Hl.cancelAnimationFrame:Hl[eh+"CancelAnimationFrame"]||Hl[eh+"CancelRequestAnimationFrame"];var eh,th,nh;Hl.requestAnimationFrame=Ql,Hl.cancelAnimationFrame=$l,"undefined"!=typeof module&&module.exports&&(module.exports={requestAnimationFrame:Ql,cancelAnimationFrame:$l});var rh,ih,oh=e.Syringe.defineToken("CullingStrategyContribution"),ah=(th=function(){function t(){dt(this,t),this.strategyProvider=void 0,this.renderingContext=void 0}return yt(t,[{key:"apply",value:function(t){var n=this;t.hooks.cull.tap(nh.tag,(function(t){if(t){var r=t.cullable;return r.visible=!0,!r.isCulled()&&t.isVisible()?t:(n.renderingContext.renderListLastFrame.indexOf(t)>-1&&t.dispatchEvent(new $u(e.ElementEvent.CULLED)),null)}return t})),t.hooks.afterRender.tap(nh.tag,(function(e){e.cullable.visibilityPlaneMask=-1}))}}]),t}(),th.tag="Culling",nh=th);It([Ge(oh),Lt("design:type",Object)],ah.prototype,"strategyProvider",void 0),It([le(xl),Lt("design:type",Object)],ah.prototype,"renderingContext",void 0),ah=nh=It([ce({contrib:Ol})],ah);var sh,uh,ch=(rh=function(){function t(){dt(this,t),this.renderingContext=void 0}return yt(t,[{key:"apply",value:function(t){var n=this;t.hooks.dirtycheck.tap(ih.tag,(function(t){if(t){var r=t.renderable,i=n.renderingContext.renderReasons.has(e.RenderReason.CAMERA_CHANGED);return r.dirty||i?t:null}return t}))}}]),t}(),rh.tag="DirtyCheck",ih=rh);It([le(xl),Lt("design:type",Object)],ch.prototype,"renderingContext",void 0),ch=ih=It([ce({contrib:Ol})],ch);var lh=(sh=function(){function e(){var t=this;dt(this,e),this.canvasConfig=void 0,this.contextService=void 0,this.renderingService=void 0,this.renderingContext=void 0,this.eventService=void 0,this.autoPreventDefault=!0,this.rootPointerEvent=new qc(null),this.rootWheelEvent=new Xc(null),this.onPointerMove=function(e){var n,r,i=null===(n=t.renderingContext.root)||void 0===n||null===(r=n.ownerDocument)||void 0===r?void 0:r.defaultView;if(!i.supportsTouchEvents||"touch"!==e.pointerType){var o,a=Ot(t.normalizeToPointerEvent(e,i));try{for(a.s();!(o=a.n()).done;){var s=t.bootstrapEvent(t.rootPointerEvent,o.value,i);t.eventService.mapEvent(s)}}catch(e){a.e(e)}finally{a.f()}t.setCursor(t.eventService.cursor)}}}return yt(e,[{key:"apply",value:function(e){var t=this,n=this.renderingContext.root.ownerDocument.defaultView;this.eventService.setPickHandler(function(){var e=ft(ct().mark((function e(n){return ct().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.renderingService.hooks.pick.promise({position:n,picked:[],topmost:!0});case 2:return e.abrupt("return",e.sent.picked[0]||null);case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),e.hooks.pointerWheel.tap(uh.tag,(function(e){var n=t.normalizeWheelEvent(e);t.eventService.mapEvent(n)})),e.hooks.pointerDown.tap(uh.tag,(function(e){if(!n.supportsTouchEvents||"touch"!==e.pointerType){var r=t.normalizeToPointerEvent(e,n);if(t.autoPreventDefault&&r[0].isNormalized)(e.cancelable||!("cancelable"in e))&&e.preventDefault();var i,o=Ot(r);try{for(o.s();!(i=o.n()).done;){var a=t.bootstrapEvent(t.rootPointerEvent,i.value,n);t.eventService.mapEvent(a)}}catch(e){o.e(e)}finally{o.f()}t.setCursor(t.eventService.cursor)}})),e.hooks.pointerUp.tap(uh.tag,(function(e){if(!n.supportsTouchEvents||"touch"!==e.pointerType){var r,i=t.contextService.getDomElement(),o=i&&e.target&&e.target!==i&&i.contains&&!i.contains(e.target)?"outside":"",a=Ot(t.normalizeToPointerEvent(e,n));try{for(a.s();!(r=a.n()).done;){var s=t.bootstrapEvent(t.rootPointerEvent,r.value,n);s.type+=o,t.eventService.mapEvent(s)}}catch(e){a.e(e)}finally{a.f()}t.setCursor(t.eventService.cursor)}})),e.hooks.pointerMove.tap(uh.tag,this.onPointerMove),e.hooks.pointerOver.tap(uh.tag,this.onPointerMove),e.hooks.pointerOut.tap(uh.tag,this.onPointerMove)}},{key:"bootstrapEvent",value:function(e,t,n){e.pointerType=t.pointerType;var r=e;r.view=n,r.originalEvent=null,r.nativeEvent=t,r.pointerId=t.pointerId,r.width=t.width,r.height=t.height,r.isPrimary=t.isPrimary,r.pressure=t.pressure,r.tangentialPressure=t.tangentialPressure,r.tiltX=t.tiltX,r.tiltY=t.tiltY,r.twist=t.twist,this.transferMouseData(r,t);var i=this.eventService.client2Viewport(new Ys(t.clientX,t.clientY)),o=i.y;r.viewport.x=i.x,r.viewport.y=o;var a=this.eventService.viewport2Canvas(r.viewport),s=a.y;return r.canvas.x=a.x,r.canvas.y=s,r.global.copyFrom(r.canvas),r.offset.copyFrom(r.canvas),r.isTrusted=t.isTrusted,"pointerleave"===r.type&&(r.type="pointerout"),r.type.startsWith("mouse")&&(r.type=r.type.replace("mouse","pointer")),r.type.startsWith("touch")&&(r.type=ei[r.type]||r.type),r}},{key:"normalizeWheelEvent",value:function(e){var t=this.rootWheelEvent;this.transferMouseData(t,e),t.deltaMode=e.deltaMode,t.deltaX=e.deltaX,t.deltaY=e.deltaY,t.deltaZ=e.deltaZ;var n=this.eventService.client2Viewport(new Ys(e.clientX,e.clientY)),r=n.y;t.viewport.x=n.x,t.viewport.y=r;var i=this.eventService.viewport2Canvas(t.viewport),o=i.y;return t.canvas.x=i.x,t.canvas.y=o,t.global.copyFrom(t.canvas),t.offset.copyFrom(t.canvas),t.nativeEvent=e,t.type=e.type,t}},{key:"transferMouseData",value:function(e,t){e.isTrusted=t.isTrusted,e.timeStamp=performance.now(),e.type=t.type,e.altKey=t.altKey,e.metaKey=t.metaKey,e.shiftKey=t.shiftKey,e.ctrlKey=t.ctrlKey,e.button=t.button,e.buttons=t.buttons,e.client.x=t.clientX,e.client.y=t.clientY,e.movement.x=t.movementX,e.movement.y=t.movementY,e.page.x=t.pageX,e.page.y=t.pageY,e.screen.x=t.screenX,e.screen.y=t.screenY,e.relatedTarget=null}},{key:"setCursor",value:function(e){this.contextService.applyCursorStyle(e||this.canvasConfig.cursor||"default")}},{key:"normalizeToPointerEvent",value:function(e,t){var n=[];if(t.isTouchEvent(e))for(var r=0;e.changedTouches.length>r;r++){var i=e.changedTouches[r];qt(i.button)&&(i.button=e.touches.length?1:0),qt(i.buttons)&&(i.buttons=e.touches.length?1:0),qt(i.isPrimary)&&(i.isPrimary=1===e.touches.length&&"touchstart"===e.type),qt(i.width)&&(i.width=i.radiusX||1),qt(i.height)&&(i.height=i.radiusY||1),qt(i.tiltX)&&(i.tiltX=0),qt(i.tiltY)&&(i.tiltY=0),qt(i.pointerType)&&(i.pointerType="touch"),qt(i.pointerId)&&(i.pointerId=i.identifier||0),qt(i.pressure)&&(i.pressure=i.force||.5),qt(i.twist)&&(i.twist=0),qt(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,i.type=e.type,n.push(i)}else if(t.isMouseEvent(e)){var o=e;qt(o.isPrimary)&&(o.isPrimary=!0),qt(o.width)&&(o.width=1),qt(o.height)&&(o.height=1),qt(o.tiltX)&&(o.tiltX=0),qt(o.tiltY)&&(o.tiltY=0),qt(o.pointerType)&&(o.pointerType="mouse"),qt(o.pointerId)&&(o.pointerId=1),qt(o.pressure)&&(o.pressure=.5),qt(o.twist)&&(o.twist=0),qt(o.tangentialPressure)&&(o.tangentialPressure=0),o.isNormalized=!0,n.push(o)}else n.push(e);return n}}]),e}(),sh.tag="Event",uh=sh);It([le(Ui),Lt("design:type",Object)],lh.prototype,"canvasConfig",void 0),It([le(bl),Lt("design:type",Object)],lh.prototype,"contextService",void 0),It([le(e.RenderingService),Lt("design:type",e.RenderingService)],lh.prototype,"renderingService",void 0),It([le(xl),Lt("design:type",Object)],lh.prototype,"renderingContext",void 0),It([le(e.EventService),Lt("design:type",e.EventService)],lh.prototype,"eventService",void 0),lh=uh=It([ce({contrib:Ol})],lh);var hh,fh,dh=[e.Shape.CIRCLE,e.Shape.ELLIPSE,e.Shape.IMAGE,e.Shape.RECT,e.Shape.LINE,e.Shape.POLYLINE,e.Shape.POLYGON,e.Shape.TEXT,e.Shape.PATH,e.Shape.HTML],ph=function(){function t(){dt(this,t),this.camera=void 0}return yt(t,[{key:"isVisible",value:function(t){var n,r,i=t.cullable;if(!i.enable)return!0;var o=t.getRenderBounds();if(Ls.isEmpty(o))return!1;var a=this.camera.getFrustum(),s=null===(n=t.parentNode)||void 0===n||null===(r=n.cullable)||void 0===r?void 0:r.visibilityPlaneMask;return i.visibilityPlaneMask=this.computeVisibilityWithPlaneMask(t,o,s||e.Mask.INDETERMINATE,a.planes),i.visible=i.visibilityPlaneMask!==e.Mask.OUTSIDE,i.visible}},{key:"computeVisibilityWithPlaneMask",value:function(t,n,r,i){if(r===e.Mask.OUTSIDE||r===e.Mask.INSIDE)return r;for(var o=e.Mask.INSIDE,a=dh.indexOf(t.nodeName)>-1,s=0,u=i.length;u>s;++s){var c=1<<s;if(0!=(r&c)&&(!a||4!==s&&5!==s)){var l=i[s],h=l.normal,f=l.distance;if(0>Hn(h,n.getPositiveFarPoint(i[s]))+f)return e.Mask.OUTSIDE;0>Hn(h,n.getNegativeFarPoint(i[s]))+f&&(o|=c)}}return o}}]),t}();It([le(wl),Lt("design:type",Al)],ph.prototype,"camera",void 0),ph=It([ce({contrib:oh})],ph);var yh=(hh=function(){function t(){dt(this,t),this.renderingContext=void 0,this.styleValueRegistry=void 0,this.rBush=void 0,this.toSync=new Set}return yt(t,[{key:"pushToSync",value:function(e){var t=this;e.forEach((function(e){t.toSync.add(e)}))}},{key:"apply",value:function(t){var n=this,r=function(e){e.target.renderable.dirty=!0,t.dirtify()},i=function(e){e.detail.affectChildren&&e.target.forEach((function(e){n.pushToSync([e])})),n.pushToSync(e.composedPath().slice(0,-2)),t.dirtify()},o=function(e){var r=e.target;n.pushToSync(e.composedPath().slice(0,-2)),n.styleValueRegistry.recalc(r),ml(r),t.dirtify()},a=function(e){var r=e.target,i=r.rBushNode;i.aabb&&(n.rBush.remove(i.aabb),n.toSync.delete(r)),ml(e.target),t.dirtify()};t.hooks.init.tapPromise(fh.tag,ft(ct().mark((function t(){return ct().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n.renderingContext.root.addEventListener(e.ElementEvent.MOUNTED,o),n.renderingContext.root.addEventListener(e.ElementEvent.UNMOUNTED,a),n.renderingContext.root.addEventListener(e.ElementEvent.ATTR_MODIFIED,r),n.renderingContext.root.addEventListener(e.ElementEvent.BOUNDS_CHANGED,i);case 4:case"end":return t.stop()}}),t)})))),t.hooks.destroy.tap(fh.tag,(function(){n.renderingContext.root.removeEventListener(e.ElementEvent.MOUNTED,o),n.renderingContext.root.removeEventListener(e.ElementEvent.UNMOUNTED,a),n.renderingContext.root.removeEventListener(e.ElementEvent.ATTR_MODIFIED,r),n.renderingContext.root.removeEventListener(e.ElementEvent.BOUNDS_CHANGED,i)})),t.hooks.endFrame.tap(fh.tag,(function(){n.syncRTree()}))}},{key:"syncRTree",value:function(){var e=this,t=[];Array.from(this.toSync).filter((function(e){return e.isConnected})).forEach((function(n){var r=n.rBushNode;r&&e.rBush.remove(r.aabb);var i=n.getRenderBounds();if(i){var o=Ct(i.getMin(),2),a=o[0],s=o[1],u=Ct(i.getMax(),2);r.aabb={id:n.entity,minX:a,minY:s,maxX:u[0],maxY:u[1]}}r.aabb&&t.push(r.aabb)})),this.rBush.load(t),this.toSync.clear()}}]),t}(),hh.tag="Prepare",fh=hh);It([le(xl),Lt("design:type",Object)],yh.prototype,"renderingContext",void 0),It([le(ii),Lt("design:type",Object)],yh.prototype,"styleValueRegistry",void 0),It([le(oc),Lt("design:type",qe)],yh.prototype,"rBush",void 0),yh=fh=It([ce({contrib:Ol})],yh);var vh,gh=Ae((function(t){e.Contribution.register(t,Ol,{cache:!1}),e.Contribution.register(t,oh,{cache:!1}),t({token:oc,useValue:new qe}),t(e.RenderingService),t(e.EventService),t(lh),t(yh),t(ch),t(ah),t(ph)}));(vh=e.CanvasEvent||(e.CanvasEvent={})).READY="ready",vh.BEFORE_RENDER="beforerender",vh.AFTER_RENDER="afterrender",vh.BEFORE_DESTROY="beforedestroy",vh.AFTER_DESTROY="afterdestroy",vh.RESIZE="resize";var mh=function(t){gt(o,t);var n,r,i=xt(o);function o(t){var n;dt(this,o),(n=i.call(this)).container=Ve.createChild(),n.document=void 0,n.customElements=void 0,n.requestAnimationFrame=void 0,n.cancelAnimationFrame=void 0,n.devicePixelRatio=void 0,n.supportsPointerEvents=void 0,n.supportsTouchEvents=void 0,n.isTouchEvent=void 0,n.isMouseEvent=void 0,n.Element=Tc,n.frameId=void 0,n.eventService=void 0,n.renderingService=void 0,n.inited=!1,n.readyPromise=void 0,n.resolveReadyPromise=void 0,n.document=new Wc,n.document.defaultView=Et(n),n.customElements=new dl;var r=t.container,a=t.canvas,s=t.offscreenCanvas,u=t.width,c=t.height,l=t.devicePixelRatio,h=t.renderer,f=t.background,d=t.document,p=t.requestAnimationFrame,y=t.cancelAnimationFrame,v=t.createImage,g=t.supportsPointerEvents,m=t.supportsTouchEvents,k=t.isTouchEvent,T=t.isMouseEvent;tn(r,Et(n));var b=u,S=c,E=l;return a&&(E=1>(E=l||nn&&window.devicePixelRatio||1)?1:Math.ceil(E),b=u||Qr(a)||a.width/E,S=c||$r(a)||a.height/E),n.devicePixelRatio=E,n.requestAnimationFrame=null!=p?p:Ql.bind(globalThis),n.cancelAnimationFrame=null!=y?y:$l.bind(globalThis),n.supportsTouchEvents=null!=m?m:"ontouchstart"in globalThis,n.supportsPointerEvents=null!=g?g:!!globalThis.PointerEvent,n.isTouchEvent=null!=k?k:function(e){return n.supportsTouchEvents&&e instanceof globalThis.TouchEvent},n.isMouseEvent=null!=T?T:function(e){return!globalThis.MouseEvent||e instanceof globalThis.MouseEvent&&(!n.supportsPointerEvents||!(e instanceof globalThis.PointerEvent))},n.initRenderingContext({container:r,canvas:a,width:b,height:S,renderer:h,offscreenCanvas:s,devicePixelRatio:E,cursor:"default",background:f,createImage:v,document:d}),n.initDefaultCamera(b,S),ft(ct().mark((function t(){return ct().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.initRenderer(h);case 2:n.dispatchEvent(new $u(e.CanvasEvent.READY)),n.readyPromise&&n.resolveReadyPromise();case 4:case"end":return t.stop()}}),t)})))(),n}return yt(o,[{key:"initRenderingContext",value:function(t){var n=this;this.container.register({token:Ui,useValue:t}),this.container.register({token:xl,useValue:{root:this.document.documentElement,renderListLastFrame:[],renderListCurrentFrame:[],unculledEntities:[],renderReasons:new Set,force:!1,dirty:!1}}),this.document.documentElement.addEventListener(e.ElementEvent.CHILD_INSERTED,(function(e){n.mountChildren(e.detail.child)})),this.document.documentElement.addEventListener(e.ElementEvent.CHILD_REMOVED,(function(e){n.unmountChildren(e.detail.child)}))}},{key:"initDefaultCamera",value:function(t,n){var r=(new Al).setPosition(t/2,n/2,500).setFocalPoint(t/2,n/2,0).setOrthographic(t/-2,t/2,n/2,n/-2,.1,1e3);r.canvas=this;var i=this.container.get(xl);r.on(_l.UPDATED,(function(){i.renderReasons.add(e.RenderReason.CAMERA_CHANGED)})),this.container.register({token:wl,useValue:r})}},{key:"getConfig",value:function(){return this.container.get(Ui)}},{key:"getContainer",value:function(){return this.container}},{key:"getRoot",value:function(){return this.document.documentElement}},{key:"getCamera",value:function(){return this.container.get(wl)}},{key:"getContextService",value:function(){return this.container.get(bl)}},{key:"getEventService",value:function(){return this.eventService}},{key:"getRenderingService",value:function(){return this.renderingService}},{key:"getRenderingContext",value:function(){return this.container.get(xl)}},{key:"getStats",value:function(){return this.getRenderingService().getStats()}},{key:"ready",get:function(){var e=this;return this.readyPromise||(this.readyPromise=new Promise((function(t){e.resolveReadyPromise=function(){t(e)}})),this.inited&&this.resolveReadyPromise()),this.readyPromise}},{key:"destroy",value:function(){var t=0>=arguments.length||void 0===arguments[0]||arguments[0],n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(n||this.dispatchEvent(new $u(e.CanvasEvent.BEFORE_DESTROY)),this.frameId){var r=this.getConfig().cancelAnimationFrame||cancelAnimationFrame;r(this.frameId)}var i=this.getRoot();this.unmountChildren(i),t&&this.document.destroy(),this.getContextService().destroy(),this.getRenderingService().destroy(),n||this.dispatchEvent(new $u(e.CanvasEvent.AFTER_DESTROY))}},{key:"changeSize",value:function(e,t){this.resize(e,t)}},{key:"resize",value:function(t,n){var r=this.container.get(Ui);r.width=t,r.height=n,this.getContextService().resize(t,n);var i=this.container.get(wl),o=i.getProjectionMode();i.setPosition(t/2,n/2,500).setFocalPoint(t/2,n/2,0),o===e.CameraProjectionMode.ORTHOGRAPHIC?i.setOrthographic(t/-2,t/2,n/2,n/-2,i.getNear(),i.getFar()):i.setAspect(t/n),this.dispatchEvent(new $u(e.CanvasEvent.RESIZE,{width:t,height:n}))}},{key:"appendChild",value:function(e,t){return this.document.documentElement.appendChild(e,t)}},{key:"insertBefore",value:function(e,t){return this.document.documentElement.insertBefore(e,t)}},{key:"removeChild",value:function(e){var t=1>=arguments.length||void 0===arguments[1]||arguments[1];return this.document.documentElement.removeChild(e,t)}},{key:"removeChildren",value:function(){var e=0>=arguments.length||void 0===arguments[0]||arguments[0];this.document.documentElement.removeChildren(e)}},{key:"render",value:function(){(this.dispatchEvent(new $u(e.CanvasEvent.BEFORE_RENDER)),this.container.isBound(e.RenderingService))&&this.container.get(e.RenderingService).render(this.getConfig());this.dispatchEvent(new $u(e.CanvasEvent.AFTER_RENDER))}},{key:"run",value:function(){var e=this;!function t(){e.render(),e.frameId=requestAnimationFrame(t)}()}},{key:"initRenderer",value:(r=ft(ct().mark((function t(n){var r;return ct().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n){t.next=2;break}throw Error("Renderer is required.");case 2:return this.inited=!1,this.readyPromise=void 0,this.loadCommonContainerModule(),this.loadRendererContainerModule(n),r=this.container.get(bl),this.renderingService=this.container.get(e.RenderingService),this.eventService=this.container.get(e.EventService),t.next=11,r.init();case 11:return t.next=13,this.renderingService.init();case 13:this.inited=!0,this.getRoot().forEach((function(e){var t=e.renderable;t&&(t.renderBoundsDirty=!0,t.boundsDirty=!0,t.dirty=!0)})),this.mountChildren(this.getRoot()),n.getConfig().enableAutoRendering&&this.run();case 17:case"end":return t.stop()}}),t,this)}))),function(e){return r.apply(this,arguments)})},{key:"loadCommonContainerModule",value:function(){this.container.unload(gh),this.container.load(gh,!0)}},{key:"loadRendererContainerModule",value:function(e){var t=this;e.getPlugins().forEach((function(e){e.init(t.container)}))}},{key:"setRenderer",value:(n=ft(ct().mark((function e(t){var n,r,i=this;return ct().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((n=this.getConfig()).renderer!==t){e.next=3;break}return e.abrupt("return");case 3:return r=n.renderer,n.renderer=t,this.destroy(!1,!0),Nt(null==r?void 0:r.getPlugins()).reverse().forEach((function(e){e.destroy(i.container)})),e.next=9,this.initRenderer(t);case 9:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"setCursor",value:function(e){this.getContextService().applyCursorStyle(e)}},{key:"unmountChildren",value:function(t){var n=this;if(this.inited){var r=[];t.forEach((function(e){e.isConnected&&r.push(e)})),r.reverse().forEach((function(t){t instanceof Sc&&t.disconnectedCallback&&t.disconnectedCallback(),t.dispatchEvent(new $u(e.ElementEvent.UNMOUNTED)),t!==n.document.documentElement&&(t.ownerDocument=null),t.isConnected=!1}))}}},{key:"mountChildren",value:function(t){var n=this;this.inited?t.forEach((function(t){t.isConnected||(t.ownerDocument=n.document,t.isConnected=!0,t.dispatchEvent(new $u(e.ElementEvent.MOUNTED)),t instanceof Sc&&t.connectedCallback&&t.connectedCallback())})):console.warn("[g]: You are trying to call `canvas.appendChild` before canvas' initialization finished. You can either await `canvas.ready` or listen to `CanvasEvent.READY` manually.","appended child: ",t)}},{key:"client2Viewport",value:function(e){return this.getEventService().client2Viewport(e)}},{key:"viewport2Client",value:function(e){return this.getEventService().viewport2Client(e)}},{key:"viewport2Canvas",value:function(e){return this.getEventService().viewport2Canvas(e)}},{key:"canvas2Viewport",value:function(e){return this.getEventService().canvas2Viewport(e)}},{key:"getPointByClient",value:function(e,t){return this.client2Viewport({x:e,y:t})}},{key:"getClientByPoint",value:function(e,t){return this.viewport2Client({x:e,y:t})}}]),o}(ec);Ve.load(jl);var kh=Ve.get(e.LayoutEngine);e.AABB=Ls,e.AbstractLayoutDefinition=Co,e.AbstractRenderer=Gl,e.Animation=pc,e.AnimationEffectTiming=Kc,e.AnimationEvent=fc,e.AnimationTimeline=vc,e.AsyncParallelHook=ao,e.AsyncSeriesWaterfallHook=lo,e.BUILT_IN_PROPERTIES=Vl,e.BoundingSphere=Us,e.CSS=Uu,e.CSSColorValue=qo,e.CSSGradientValue=ma,e.CSSKeywordValue=Xo,e.CSSMathInvert=aa,e.CSSMathMax=fa,e.CSSMathMin=ha,e.CSSMathNegate=sa,e.CSSMathProduct=pa,e.CSSMathSum=da,e.CSSMathValue=oa,e.CSSMathVariadic=la,e.CSSNumericValue=Qo,e.CSSNumericValueType=Jo,e.CSSProperty=Zu,e.CSSPropertySyntaxFactory=Ku,e.CSSRGB=ga,e.CSSStyleValue=Yo,e.CSSUnitValue=ia,e.Camera=Al,e.CameraEvent=_l,e.Canvas=mh,e.CanvasConfig=Ui,e.Circle=Pc,e.Container=Be,e.ContextNode=zt,e.ContextService=bl,e.Cullable=nc,e.CustomElement=Sc,e.CustomElementRegistry=dl,e.CustomEvent=$u,e.DCHECK=Ht,e.DCHECK_EQ=Wt,e.DCHECK_NE=Yt,e.DELEGATION_SPLITTER=":",e.DefaultCamera=wl,e.DefaultContributionProvider=xe,e.Deferred=Kr,e.DisplayObject=Tc,e.Document=Wc,e.EasingFunctions=Yr,e.Element=hc,e.Ellipse=wc,e.EventTarget=ec,e.FederatedEvent=Qu,e.FederatedMouseEvent=Yc,e.FederatedPointerEvent=qc,e.FederatedWheelEvent=Xc,e.FragmentResultFactory=jt,e.FragmentResultOptions=Gt,e.Frustum=Bs,e.Geometry=rc,e.GeometryAABBUpdater=Fl,e.GeometryUpdaterFactory=Ul,e.GlobalContainer=Ve,e.Group=Cc,e.HTML=Hc,e.Image=Mc,e.KeyframeEffect=fl,e.LayoutChildrenFactory=wo,e.LayoutChildrenOptions=_o,e.LayoutContextFactory=Ft,e.LayoutContextOptions=Bt,e.LayoutEdgesFactory=Ao,e.LayoutEdgesOptions=Oo,e.LayoutFragmentFactory=Ro,e.LayoutFragmentOptions=Lo,e.LayoutObject=Ut,e.Line=Oc,e.MOUSE_POINTER_ID=1,e.Module=Ae,e.MutationEvent=cc,e.MutationObserver=el,e.MutationRecord=Zc,e.Node=tc,e.ObjectTyped=Zr,e.Odeg=va,e.OptionSymbol=fe,e.Opx=ya,e.Path=Rc,e.Plane=Fs,e.Point=Ys,e.Polygon=Dc,e.Polyline=Fc,e.Provider=me,e.RBush=qe,e.RBushNode=ic,e.RBushRoot=oc,e.Ray=Ws,e.Rect=Vc,e.Rectangle=qs,e.Registration=$c,e.Renderable=ac,e.RenderingContext=xl,e.RenderingPluginContribution=Ol,e.SceneGraphSelector=yl,e.SceneGraphSelectorFactory=pl,e.SceneGraphService=kl,e.Sortable=sc,e.StyleValueRegistry=ii,e.SyncHook=go,e.SyncWaterfallHook=Eo,e.SyringeModule=Ne,e.TOUCH_TO_POINTER=ei,e.Text=Gc,e.Transform=uc,e.baseTypeToString=Zo,e.camelCase=pi,e.clamp=kr,e.clampedMergeNumbers=au,e.cleanExistedCanvas=tn,e.clonePath=Wi,e.colorStopToString=ti,e.compareAnimations=yc,e.computeLinearGradient=function(e,t,n){var r=n*Math.PI/180,i=0+e/2,o=0+t/2,a=Math.abs(e*Math.cos(r))+Math.abs(t*Math.sin(r));return{x1:i-Math.cos(r)*a/2,y1:o-Math.sin(r)*a/2,x2:i+Math.cos(r)*a/2,y2:o+Math.sin(r)*a/2}},e.computeRadialGradient=function(e,t,n,r){return{x:n*e,y:r*t,r:Math.sqrt(e*e+t*t)/2}},e.contrib=Ge,e.convertAngleUnit=$s,e.convertEffectInput=vi,e.convertPercentUnit=nu,e.convertToDash=Cr,e.convertToPath=function(t){var n=1>=arguments.length||void 0===arguments[1]||arguments[1],r=[];switch(t.nodeName){case e.Shape.LINE:var i=t.parsedStyle,o=i.x1,a=i.y1,s=i.x2,u=i.y2;r=Xi(o.value,a.value,s.value,u.value);break;case e.Shape.CIRCLE:var c=t.parsedStyle,l=c.r,h=c.cx,f=c.cy;r=Ki(l.value,l.value,h.value,f.value);break;case e.Shape.ELLIPSE:var d=t.parsedStyle,p=d.rx,y=d.ry,v=d.cx,g=d.cy;r=Ki(p.value,y.value,v.value,g.value);break;case e.Shape.POLYLINE:case e.Shape.POLYGON:var m=t.parsedStyle.points;r=Zi(m.points,t.nodeName===e.Shape.POLYGON);break;case e.Shape.RECT:var k=t.parsedStyle,T=k.width,b=k.height,S=k.x,E=k.y,P=k.radius,x=P&&P.some((function(e){return 0!==e.value}));r=Ji(T.value,b.value,S.value,E.value,x&&P.map((function(e){return kr(e.value,0,Math.min(Math.abs(T.value)/2,Math.abs(b.value)/2))})));break;case e.Shape.PATH:var w=t.parsedStyle.path,_=w.curve,C=w.zCommandIndexes;r=Nt(_),C.forEach((function(e,t){r.splice(e+t,1,["Z"])}))}if(r.length)return qi(r,t,n)},e.createVec3=br,e.decompose=_r,e.decorate=Y.decorate,e.deg2rad=function(e){return e*(Math.PI/180)},e.deg2turn=function(e){return e/360},e.dirtifyToRoot=ml,e.equalSet=function(e,t){if(e.size!==t.size)return!1;var n,r=Ot(e);try{for(r.s();!(n=r.n()).done;){if(!t.has(n.value))return!1}}catch(e){r.e(e)}finally{r.f()}return!0},e.equalizeSegments=Vi,e.formatAttribute=Si,e.fromRotationTranslationScale=xr,e.getAngle=Tr,e.getDrawDirection=ji,e.getEasingFunction=qr,e.getEuler=Pr,e.getHeight=$r,e.getPathArea=zi,e.getRotatedCurve=Yi,e.getRotationInRadians=function(e){return Math.atan2(e[1],e[4])},e.getScaling=function(e,t){var n=t[3],r=t[4];return e[0]=Math.hypot(t[0],t[1]),e[1]=Math.hypot(n,r),e},e.getStyle=Jr,e.getTranslation=function(e,t){return e[0]=t[6],e[1]=t[7],e},e.getWidth=Qr,e.grad2deg=function(e){return 0>(e%=400)&&(e+=400),e/400*360},e.inject=le,e.injectable=ue,e.isBoolean=Jt,e.isBrowser=nn,e.isComparison=function(t){return t===e.CSSMathOperator.kMin||t===e.CSSMathOperator.kMax||t===e.CSSMathOperator.kClamp},e.isFunction=Zt,e.isNil=Xt,e.isNumber=Kt,e.isObject=Qt,e.isPattern=As,e.isString=yi,e.isSyringeModule=Me,e.isUndefined=qt,e.layoutEngine=kh,e.makePerspective=wr,e.makeQuerablePromise=Xr,e.makeTiming=cl,e.mergeColors=Is,e.mergeDimensionList=tu,e.mergeDimensions=Qs,e.mergeNumberLists=function(e,t){if(e.length===t.length)return[e.map((function(e){return e.value})),t.map((function(e){return e.value})),function(e){return e}]},e.mergeNumbers=ou,e.mergePaths=Ou,e.mergeTransforms=Wu,e.named=he,e.normalizeKeyframes=al,e.normalizeTimingInput=ll,e.numberToString=ru,e.numericTimingToObject=hl,e.optional=Y.optional,e.parseAngle=Js,e.parseColor=Os,e.parseDimension=Xs,e.parseDimensionArray=eu,e.parseFilter=Du,e.parseGradient=ri,e.parseLength=Ks,e.parseLengthOrPercentage=Zs,e.parseNumber=iu,e.parseNumberList=function(e){return yi(e)?e.split(" ").map(iu):e.map(iu)},e.parseParam=Ru,e.parsePath=Au,e.parsePoints=Iu,e.parseTransform=Gu,e.parseTransformOrigin=Yu,e.parserPercentage=function(e){return Xs(/%/g,e)},e.postConstruct=Y.postConstruct,e.rad2deg=Sr,e.register=je,e.registerSideOption=function(e,t){Reflect.defineMetadata(fe,e,t)},e.reverseCurve=Hi,e.setDOMSize=function(e,t,n){nn&&e.style&&(e.style.width=t+"px",e.style.height=n+"px")},e.singleton=ce,e.sortByZIndex=gl,e.toFontString=xo,e.transient=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ue(ae(ae({},t),{},{lifecycle:e.Syringe.Lifecycle.transient}))},e.turn2deg=Er,e.typeCheck=ua,e.unitTypeToBaseType=Ko,e.unmanaged=Y.unmanaged,Object.defineProperty(e,"__esModule",{value:!0})}));
|