codecharta-visualization 0.0.0-staging-7d99094 → 0.0.0-staging-8b2534a
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.
|
@@ -1235,7 +1235,7 @@ void main() {
|
|
|
1235
1235
|
`],encapsulation:2,changeDetection:0})}return i})(),Bf=class i{_target;_ngZone;_platform;_containerElement;_triggerElement;_isPointerDown=!1;_activeRipples=new Map;_mostRecentTransientRipple;_lastTouchStartEvent;_pointerUpEventsRegistered=!1;_containerRect;static _eventManager=new fB;constructor(t,e,n,r,o){this._target=t,this._ngZone=e,this._platform=r,r.isBrowser&&(this._containerElement=ua(n)),o&&o.get(En).load(Qae)}fadeInRipple(t,e,n={}){let r=this._containerRect=this._containerRect||this._containerElement.getBoundingClientRect(),o=$e($e({},X0),n.animation);n.centered&&(t=r.left+r.width/2,e=r.top+r.height/2);let a=n.radius||zae(t,e,r),s=t-r.left,l=e-r.top,c=o.enterDuration,d=document.createElement("div");d.classList.add("mat-ripple-element"),d.style.left=`${s-a}px`,d.style.top=`${l-a}px`,d.style.height=`${a*2}px`,d.style.width=`${a*2}px`,n.color!=null&&(d.style.backgroundColor=n.color),d.style.transitionDuration=`${c}ms`,this._containerElement.appendChild(d);let h=window.getComputedStyle(d),u=h.transitionProperty,f=h.transitionDuration,_=u==="none"||f==="0s"||f==="0s, 0s"||r.width===0&&r.height===0,y=new hB(this,d,n,_);d.style.transform="scale3d(1, 1, 1)",y.state=fa.FADING_IN,n.persistent||(this._mostRecentTransientRipple=y);let b=null;return!_&&(c||o.exitDuration)&&this._ngZone.runOutsideAngular(()=>{let v=()=>{b&&(b.fallbackTimer=null),clearTimeout(x),this._finishRippleTransition(y)},M=()=>this._destroyRipple(y),x=setTimeout(M,c+100);d.addEventListener("transitionend",v),d.addEventListener("transitioncancel",M),b={onTransitionEnd:v,onTransitionCancel:M,fallbackTimer:x}}),this._activeRipples.set(y,b),(_||!c)&&this._finishRippleTransition(y),y}fadeOutRipple(t){if(t.state===fa.FADING_OUT||t.state===fa.HIDDEN)return;let e=t.element,n=$e($e({},X0),t.config.animation);e.style.transitionDuration=`${n.exitDuration}ms`,e.style.opacity="0",t.state=fa.FADING_OUT,(t._animationForciblyDisabledThroughCss||!n.exitDuration)&&this._finishRippleTransition(t)}fadeOutAll(){this._getActiveRipples().forEach(t=>t.fadeOut())}fadeOutAllNonPersistent(){this._getActiveRipples().forEach(t=>{t.config.persistent||t.fadeOut()})}setupTriggerEvents(t){let e=ua(t);!this._platform.isBrowser||!e||e===this._triggerElement||(this._removeTriggerEvents(),this._triggerElement=e,tN.forEach(n=>{i._eventManager.addHandler(this._ngZone,n,e,this)}))}handleEvent(t){t.type==="mousedown"?this._onMousedown(t):t.type==="touchstart"?this._onTouchStart(t):this._onPointerUp(),this._pointerUpEventsRegistered||(this._ngZone.runOutsideAngular(()=>{iN.forEach(e=>{this._triggerElement.addEventListener(e,this,eN)})}),this._pointerUpEventsRegistered=!0)}_finishRippleTransition(t){t.state===fa.FADING_IN?this._startFadeOutTransition(t):t.state===fa.FADING_OUT&&this._destroyRipple(t)}_startFadeOutTransition(t){let e=t===this._mostRecentTransientRipple,{persistent:n}=t.config;t.state=fa.VISIBLE,!n&&(!e||!this._isPointerDown)&&t.fadeOut()}_destroyRipple(t){let e=this._activeRipples.get(t)??null;this._activeRipples.delete(t),this._activeRipples.size||(this._containerRect=null),t===this._mostRecentTransientRipple&&(this._mostRecentTransientRipple=null),t.state=fa.HIDDEN,e!==null&&(t.element.removeEventListener("transitionend",e.onTransitionEnd),t.element.removeEventListener("transitioncancel",e.onTransitionCancel),e.fallbackTimer!==null&&clearTimeout(e.fallbackTimer)),t.element.remove()}_onMousedown(t){let e=wf(t),n=this._lastTouchStartEvent&&Date.now()<this._lastTouchStartEvent+Vae;!this._target.rippleDisabled&&!e&&!n&&(this._isPointerDown=!0,this.fadeInRipple(t.clientX,t.clientY,this._target.rippleConfig))}_onTouchStart(t){if(!this._target.rippleDisabled&&!Cf(t)){this._lastTouchStartEvent=Date.now(),this._isPointerDown=!0;let e=t.changedTouches;if(e)for(let n=0;n<e.length;n++)this.fadeInRipple(e[n].clientX,e[n].clientY,this._target.rippleConfig)}}_onPointerUp(){this._isPointerDown&&(this._isPointerDown=!1,this._getActiveRipples().forEach(t=>{let e=t.state===fa.VISIBLE||t.config.terminateOnPointerUp&&t.state===fa.FADING_IN;!t.config.persistent&&e&&t.fadeOut()}))}_getActiveRipples(){return Array.from(this._activeRipples.keys())}_removeTriggerEvents(){let t=this._triggerElement;t&&(tN.forEach(e=>i._eventManager.removeHandler(e,t,this)),this._pointerUpEventsRegistered&&(iN.forEach(e=>t.removeEventListener(e,this,eN)),this._pointerUpEventsRegistered=!1))}};function zae(i,t,e){let n=Math.max(Math.abs(i-e.left),Math.abs(i-e.right)),r=Math.max(Math.abs(t-e.top),Math.abs(t-e.bottom));return Math.sqrt(n*n+r*r)}var Ff=new Je("mat-ripple-global-options"),es=(()=>{class i{_elementRef=R(Dt);_animationsDisabled=vn();color;unbounded;centered;radius=0;animation;get disabled(){return this._disabled}set disabled(e){e&&this.fadeOutAllNonPersistent(),this._disabled=e,this._setupTriggerEventsIfEnabled()}_disabled=!1;get trigger(){return this._trigger||this._elementRef.nativeElement}set trigger(e){this._trigger=e,this._setupTriggerEventsIfEnabled()}_trigger;_rippleRenderer;_globalOptions;_isInitialized=!1;constructor(){let e=R(ti),n=R(Ki),r=R(Ff,{optional:!0}),o=R(bi);this._globalOptions=r||{},this._rippleRenderer=new Bf(this,e,this._elementRef,n,o)}ngOnInit(){this._isInitialized=!0,this._setupTriggerEventsIfEnabled()}ngOnDestroy(){this._rippleRenderer._removeTriggerEvents()}fadeOutAll(){this._rippleRenderer.fadeOutAll()}fadeOutAllNonPersistent(){this._rippleRenderer.fadeOutAllNonPersistent()}get rippleConfig(){return{centered:this.centered,radius:this.radius,color:this.color,animation:$e($e($e({},this._globalOptions.animation),this._animationsDisabled?{enterDuration:0,exitDuration:0}:{}),this.animation),terminateOnPointerUp:this._globalOptions.terminateOnPointerUp}}get rippleDisabled(){return this.disabled||!!this._globalOptions.disabled}_setupTriggerEventsIfEnabled(){!this.disabled&&this._isInitialized&&this._rippleRenderer.setupTriggerEvents(this.trigger)}launch(e,n=0,r){return typeof e=="number"?this._rippleRenderer.fadeInRipple(e,n,$e($e({},this.rippleConfig),r)):this._rippleRenderer.fadeInRipple(0,0,$e($e({},this.rippleConfig),e))}static \u0275fac=function(n){return new(n||i)};static \u0275dir=Ct({type:i,selectors:[["","mat-ripple",""],["","matRipple",""]],hostAttrs:[1,"mat-ripple"],hostVars:2,hostBindings:function(n,r){n&2&&xt("mat-ripple-unbounded",r.unbounded)},inputs:{color:[0,"matRippleColor","color"],unbounded:[0,"matRippleUnbounded","unbounded"],centered:[0,"matRippleCentered","centered"],radius:[0,"matRippleRadius","radius"],animation:[0,"matRippleAnimation","animation"],disabled:[0,"matRippleDisabled","disabled"],trigger:[0,"matRippleTrigger","trigger"]},exportAs:["matRipple"]})}return i})();var qae={capture:!0},Gae=["focus","mousedown","mouseenter","touchstart"],mB="mat-ripple-loader-uninitialized",pB="mat-ripple-loader-class-name",nN="mat-ripple-loader-centered",Zy="mat-ripple-loader-disabled",rN=(()=>{class i{_document=R(wi);_animationsDisabled=vn();_globalRippleOptions=R(Ff,{optional:!0});_platform=R(Ki);_ngZone=R(ti);_injector=R(bi);_eventCleanups;_hosts=new Map;constructor(){let e=R(lo).createRenderer(null,null);this._eventCleanups=this._ngZone.runOutsideAngular(()=>Gae.map(n=>e.listen(this._document,n,this._onInteraction,qae)))}ngOnDestroy(){let e=this._hosts.keys();for(let n of e)this.destroyRipple(n);this._eventCleanups.forEach(n=>n())}configureRipple(e,n){e.setAttribute(mB,this._globalRippleOptions?.namespace??""),(n.className||!e.hasAttribute(pB))&&e.setAttribute(pB,n.className||""),n.centered&&e.setAttribute(nN,""),n.disabled&&e.setAttribute(Zy,"")}setDisabled(e,n){let r=this._hosts.get(e);r?(r.target.rippleDisabled=n,!n&&!r.hasSetUpEvents&&(r.hasSetUpEvents=!0,r.renderer.setupTriggerEvents(e))):n?e.setAttribute(Zy,""):e.removeAttribute(Zy)}_onInteraction=e=>{let n=fo(e);if(n instanceof HTMLElement){let r=n.closest(`[${mB}="${this._globalRippleOptions?.namespace??""}"]`);r&&this._createRipple(r)}};_createRipple(e){if(!this._document||this._hosts.has(e))return;e.querySelector(".mat-ripple")?.remove();let n=this._document.createElement("span");n.classList.add("mat-ripple",e.getAttribute(pB)),e.append(n);let r=this._globalRippleOptions,o=this._animationsDisabled?0:r?.animation?.enterDuration??X0.enterDuration,a=this._animationsDisabled?0:r?.animation?.exitDuration??X0.exitDuration,s={rippleDisabled:this._animationsDisabled||r?.disabled||e.hasAttribute(Zy),rippleConfig:{centered:e.hasAttribute(nN),terminateOnPointerUp:r?.terminateOnPointerUp,animation:{enterDuration:o,exitDuration:a}}},l=new Bf(s,this._ngZone,n,this._platform,this._injector),c=!s.rippleDisabled;c&&l.setupTriggerEvents(e),this._hosts.set(e,{target:s,renderer:l,hasSetUpEvents:c}),e.removeAttribute(mB)}destroyRipple(e){let n=this._hosts.get(e);n&&(n.renderer._removeTriggerEvents(),this._hosts.delete(e))}static \u0275fac=function(n){return new(n||i)};static \u0275prov=Ve({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var Ao=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275cmp=te({type:i,selectors:[["structural-styles"]],decls:0,vars:0,template:function(n,r){},styles:[`.mat-focus-indicator{position:relative}.mat-focus-indicator::before{top:0;left:0;right:0;bottom:0;position:absolute;box-sizing:border-box;pointer-events:none;display:var(--mat-focus-indicator-display, none);border-width:var(--mat-focus-indicator-border-width, 3px);border-style:var(--mat-focus-indicator-border-style, solid);border-color:var(--mat-focus-indicator-border-color, transparent);border-radius:var(--mat-focus-indicator-border-radius, 4px)}.mat-focus-indicator:focus::before{content:""}@media(forced-colors: active){html{--mat-focus-indicator-display: block}}
|
|
1236
1236
|
`],encapsulation:2,changeDetection:0})}return i})();var Wae=new Je("MAT_BUTTON_CONFIG");function oN(i){return i==null?void 0:Yn(i)}var aN=(()=>{class i{_elementRef=R(Dt);_ngZone=R(ti);_animationsDisabled=vn();_config=R(Wae,{optional:!0});_focusMonitor=R(mo);_cleanupClick;_renderer=R(cn);_rippleLoader=R(rN);_isAnchor;_isFab=!1;color;get disableRipple(){return this._disableRipple}set disableRipple(e){this._disableRipple=e,this._updateRippleDisabled()}_disableRipple=!1;get disabled(){return this._disabled}set disabled(e){this._disabled=e,this._updateRippleDisabled()}_disabled=!1;ariaDisabled;disabledInteractive;tabIndex;set _tabindex(e){this.tabIndex=e}constructor(){R(En).load(Ao);let e=this._elementRef.nativeElement;this._isAnchor=e.tagName==="A",this.disabledInteractive=this._config?.disabledInteractive??!1,this.color=this._config?.color??null,this._rippleLoader?.configureRipple(e,{className:"mat-mdc-button-ripple"})}ngAfterViewInit(){this._focusMonitor.monitor(this._elementRef,!0),this._isAnchor&&this._setupAsAnchor()}ngOnDestroy(){this._cleanupClick?.(),this._focusMonitor.stopMonitoring(this._elementRef),this._rippleLoader?.destroyRipple(this._elementRef.nativeElement)}focus(e="program",n){e?this._focusMonitor.focusVia(this._elementRef.nativeElement,e,n):this._elementRef.nativeElement.focus(n)}_getAriaDisabled(){return this.ariaDisabled!=null?this.ariaDisabled:this._isAnchor?this.disabled||null:this.disabled&&this.disabledInteractive?!0:null}_getDisabledAttribute(){return this.disabledInteractive||!this.disabled?null:!0}_updateRippleDisabled(){this._rippleLoader?.setDisabled(this._elementRef.nativeElement,this.disableRipple||this.disabled)}_getTabIndex(){return this._isAnchor?this.disabled&&!this.disabledInteractive?-1:this.tabIndex:this.tabIndex}_setupAsAnchor(){this._cleanupClick=this._ngZone.runOutsideAngular(()=>this._renderer.listen(this._elementRef.nativeElement,"click",e=>{this.disabled&&(e.preventDefault(),e.stopImmediatePropagation())}))}static \u0275fac=function(n){return new(n||i)};static \u0275dir=Ct({type:i,hostAttrs:[1,"mat-mdc-button-base"],hostVars:13,hostBindings:function(n,r){n&2&&(ni("disabled",r._getDisabledAttribute())("aria-disabled",r._getAriaDisabled())("tabindex",r._getTabIndex()),Xi(r.color?"mat-"+r.color:""),xt("mat-mdc-button-disabled",r.disabled)("mat-mdc-button-disabled-interactive",r.disabledInteractive)("mat-unthemed",!r.color)("_mat-animation-noopable",r._animationsDisabled))},inputs:{color:"color",disableRipple:[2,"disableRipple","disableRipple",Rt],disabled:[2,"disabled","disabled",Rt],ariaDisabled:[2,"aria-disabled","ariaDisabled",Rt],disabledInteractive:[2,"disabledInteractive","disabledInteractive",Rt],tabIndex:[2,"tabIndex","tabIndex",oN],_tabindex:[2,"tabindex","_tabindex",oN]}})}return i})();var jae=["matButton",""],$ae=[[["",8,"material-icons",3,"iconPositionEnd",""],["mat-icon",3,"iconPositionEnd",""],["","matButtonIcon","",3,"iconPositionEnd",""]],"*",[["","iconPositionEnd","",8,"material-icons"],["mat-icon","iconPositionEnd",""],["","matButtonIcon","","iconPositionEnd",""]]],Xae=[".material-icons:not([iconPositionEnd]), mat-icon:not([iconPositionEnd]), [matButtonIcon]:not([iconPositionEnd])","*",".material-icons[iconPositionEnd], mat-icon[iconPositionEnd], [matButtonIcon][iconPositionEnd]"];var sN=new Map([["text",["mat-mdc-button"]],["filled",["mdc-button--unelevated","mat-mdc-unelevated-button"]],["elevated",["mdc-button--raised","mat-mdc-raised-button"]],["outlined",["mdc-button--outlined","mat-mdc-outlined-button"]],["tonal",["mat-tonal-button"]]]),an=(()=>{class i extends aN{get appearance(){return this._appearance}set appearance(e){this.setAppearance(e||this._config?.defaultAppearance||"text")}_appearance=null;constructor(){super();let e=Kae(this._elementRef.nativeElement);e&&this.setAppearance(e)}setAppearance(e){if(e===this._appearance)return;let n=this._elementRef.nativeElement.classList,r=this._appearance?sN.get(this._appearance):null,o=sN.get(e);r&&n.remove(...r),n.add(...o),this._appearance=e}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=te({type:i,selectors:[["button","matButton",""],["a","matButton",""],["button","mat-button",""],["button","mat-raised-button",""],["button","mat-flat-button",""],["button","mat-stroked-button",""],["a","mat-button",""],["a","mat-raised-button",""],["a","mat-flat-button",""],["a","mat-stroked-button",""]],hostAttrs:[1,"mdc-button"],inputs:{appearance:[0,"matButton","appearance"]},exportAs:["matButton","matAnchor"],features:[nn],attrs:jae,ngContentSelectors:Xae,decls:7,vars:4,consts:[[1,"mat-mdc-button-persistent-ripple"],[1,"mdc-button__label"],[1,"mat-focus-indicator"],[1,"mat-mdc-button-touch-target"]],template:function(n,r){n&1&&(Pi($ae),Ci(0,"span",0),Gt(1),bt(2,"span",1),Gt(3,1),Mt(),Gt(4,2),Ci(5,"span",2)(6,"span",3)),n&2&&xt("mdc-button__ripple",!r._isFab)("mdc-fab__ripple",r._isFab)},styles:[`.mat-mdc-button-base{text-decoration:none}.mat-mdc-button-base .mat-icon{min-height:fit-content;flex-shrink:0}.mdc-button{-webkit-user-select:none;user-select:none;position:relative;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;min-width:64px;border:none;outline:none;line-height:inherit;-webkit-appearance:none;overflow:visible;vertical-align:middle;background:rgba(0,0,0,0);padding:0 8px}.mdc-button::-moz-focus-inner{padding:0;border:0}.mdc-button:active{outline:none}.mdc-button:hover{cursor:pointer}.mdc-button:disabled{cursor:default;pointer-events:none}.mdc-button[hidden]{display:none}.mdc-button .mdc-button__label{position:relative}.mat-mdc-button{padding:0 var(--mat-button-text-horizontal-padding, 12px);height:var(--mat-button-text-container-height, 40px);font-family:var(--mat-button-text-label-text-font, var(--mat-sys-label-large-font));font-size:var(--mat-button-text-label-text-size, var(--mat-sys-label-large-size));letter-spacing:var(--mat-button-text-label-text-tracking, var(--mat-sys-label-large-tracking));text-transform:var(--mat-button-text-label-text-transform);font-weight:var(--mat-button-text-label-text-weight, var(--mat-sys-label-large-weight))}.mat-mdc-button,.mat-mdc-button .mdc-button__ripple{border-radius:var(--mat-button-text-container-shape, var(--mat-sys-corner-full))}.mat-mdc-button:not(:disabled){color:var(--mat-button-text-label-text-color, var(--mat-sys-primary))}.mat-mdc-button[disabled],.mat-mdc-button.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mat-button-text-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-button.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-button:has(.material-icons,mat-icon,[matButtonIcon]){padding:0 var(--mat-button-text-with-icon-horizontal-padding, 16px)}.mat-mdc-button>.mat-icon{margin-right:var(--mat-button-text-icon-spacing, 8px);margin-left:var(--mat-button-text-icon-offset, -4px)}[dir=rtl] .mat-mdc-button>.mat-icon{margin-right:var(--mat-button-text-icon-offset, -4px);margin-left:var(--mat-button-text-icon-spacing, 8px)}.mat-mdc-button .mdc-button__label+.mat-icon{margin-right:var(--mat-button-text-icon-offset, -4px);margin-left:var(--mat-button-text-icon-spacing, 8px)}[dir=rtl] .mat-mdc-button .mdc-button__label+.mat-icon{margin-right:var(--mat-button-text-icon-spacing, 8px);margin-left:var(--mat-button-text-icon-offset, -4px)}.mat-mdc-button .mat-ripple-element{background-color:var(--mat-button-text-ripple-color, color-mix(in srgb, var(--mat-sys-primary) calc(var(--mat-sys-pressed-state-layer-opacity) * 100%), transparent))}.mat-mdc-button .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-button-text-state-layer-color, var(--mat-sys-primary))}.mat-mdc-button.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-button-text-disabled-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-button:hover>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-button-text-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-button.cdk-program-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-button.cdk-keyboard-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-button.mat-mdc-button-disabled-interactive:focus>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-button-text-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-button:active>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-button-text-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity))}.mat-mdc-button .mat-mdc-button-touch-target{position:absolute;top:50%;height:var(--mat-button-text-touch-target-size, 48px);display:var(--mat-button-text-touch-target-display, block);left:0;right:0;transform:translateY(-50%)}.mat-mdc-unelevated-button{transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);height:var(--mat-button-filled-container-height, 40px);font-family:var(--mat-button-filled-label-text-font, var(--mat-sys-label-large-font));font-size:var(--mat-button-filled-label-text-size, var(--mat-sys-label-large-size));letter-spacing:var(--mat-button-filled-label-text-tracking, var(--mat-sys-label-large-tracking));text-transform:var(--mat-button-filled-label-text-transform);font-weight:var(--mat-button-filled-label-text-weight, var(--mat-sys-label-large-weight));padding:0 var(--mat-button-filled-horizontal-padding, 24px)}.mat-mdc-unelevated-button>.mat-icon{margin-right:var(--mat-button-filled-icon-spacing, 8px);margin-left:var(--mat-button-filled-icon-offset, -8px)}[dir=rtl] .mat-mdc-unelevated-button>.mat-icon{margin-right:var(--mat-button-filled-icon-offset, -8px);margin-left:var(--mat-button-filled-icon-spacing, 8px)}.mat-mdc-unelevated-button .mdc-button__label+.mat-icon{margin-right:var(--mat-button-filled-icon-offset, -8px);margin-left:var(--mat-button-filled-icon-spacing, 8px)}[dir=rtl] .mat-mdc-unelevated-button .mdc-button__label+.mat-icon{margin-right:var(--mat-button-filled-icon-spacing, 8px);margin-left:var(--mat-button-filled-icon-offset, -8px)}.mat-mdc-unelevated-button .mat-ripple-element{background-color:var(--mat-button-filled-ripple-color, color-mix(in srgb, var(--mat-sys-on-primary) calc(var(--mat-sys-pressed-state-layer-opacity) * 100%), transparent))}.mat-mdc-unelevated-button .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-button-filled-state-layer-color, var(--mat-sys-on-primary))}.mat-mdc-unelevated-button.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-button-filled-disabled-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-unelevated-button:hover>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-button-filled-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-unelevated-button.cdk-program-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-unelevated-button.cdk-keyboard-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-unelevated-button.mat-mdc-button-disabled-interactive:focus>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-button-filled-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-unelevated-button:active>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-button-filled-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity))}.mat-mdc-unelevated-button .mat-mdc-button-touch-target{position:absolute;top:50%;height:var(--mat-button-filled-touch-target-size, 48px);display:var(--mat-button-filled-touch-target-display, block);left:0;right:0;transform:translateY(-50%)}.mat-mdc-unelevated-button:not(:disabled){color:var(--mat-button-filled-label-text-color, var(--mat-sys-on-primary));background-color:var(--mat-button-filled-container-color, var(--mat-sys-primary))}.mat-mdc-unelevated-button,.mat-mdc-unelevated-button .mdc-button__ripple{border-radius:var(--mat-button-filled-container-shape, var(--mat-sys-corner-full))}.mat-mdc-unelevated-button[disabled],.mat-mdc-unelevated-button.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mat-button-filled-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));background-color:var(--mat-button-filled-disabled-container-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mat-mdc-unelevated-button.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-raised-button{transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);box-shadow:var(--mat-button-protected-container-elevation-shadow, var(--mat-sys-level1));height:var(--mat-button-protected-container-height, 40px);font-family:var(--mat-button-protected-label-text-font, var(--mat-sys-label-large-font));font-size:var(--mat-button-protected-label-text-size, var(--mat-sys-label-large-size));letter-spacing:var(--mat-button-protected-label-text-tracking, var(--mat-sys-label-large-tracking));text-transform:var(--mat-button-protected-label-text-transform);font-weight:var(--mat-button-protected-label-text-weight, var(--mat-sys-label-large-weight));padding:0 var(--mat-button-protected-horizontal-padding, 24px)}.mat-mdc-raised-button>.mat-icon{margin-right:var(--mat-button-protected-icon-spacing, 8px);margin-left:var(--mat-button-protected-icon-offset, -8px)}[dir=rtl] .mat-mdc-raised-button>.mat-icon{margin-right:var(--mat-button-protected-icon-offset, -8px);margin-left:var(--mat-button-protected-icon-spacing, 8px)}.mat-mdc-raised-button .mdc-button__label+.mat-icon{margin-right:var(--mat-button-protected-icon-offset, -8px);margin-left:var(--mat-button-protected-icon-spacing, 8px)}[dir=rtl] .mat-mdc-raised-button .mdc-button__label+.mat-icon{margin-right:var(--mat-button-protected-icon-spacing, 8px);margin-left:var(--mat-button-protected-icon-offset, -8px)}.mat-mdc-raised-button .mat-ripple-element{background-color:var(--mat-button-protected-ripple-color, color-mix(in srgb, var(--mat-sys-primary) calc(var(--mat-sys-pressed-state-layer-opacity) * 100%), transparent))}.mat-mdc-raised-button .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-button-protected-state-layer-color, var(--mat-sys-primary))}.mat-mdc-raised-button.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-button-protected-disabled-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-raised-button:hover>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-button-protected-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-raised-button.cdk-program-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-raised-button.cdk-keyboard-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-raised-button.mat-mdc-button-disabled-interactive:focus>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-button-protected-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-raised-button:active>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-button-protected-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity))}.mat-mdc-raised-button .mat-mdc-button-touch-target{position:absolute;top:50%;height:var(--mat-button-protected-touch-target-size, 48px);display:var(--mat-button-protected-touch-target-display, block);left:0;right:0;transform:translateY(-50%)}.mat-mdc-raised-button:not(:disabled){color:var(--mat-button-protected-label-text-color, var(--mat-sys-primary));background-color:var(--mat-button-protected-container-color, var(--mat-sys-surface))}.mat-mdc-raised-button,.mat-mdc-raised-button .mdc-button__ripple{border-radius:var(--mat-button-protected-container-shape, var(--mat-sys-corner-full))}.mat-mdc-raised-button:hover{box-shadow:var(--mat-button-protected-hover-container-elevation-shadow, var(--mat-sys-level2))}.mat-mdc-raised-button:focus{box-shadow:var(--mat-button-protected-focus-container-elevation-shadow, var(--mat-sys-level1))}.mat-mdc-raised-button:active,.mat-mdc-raised-button:focus:active{box-shadow:var(--mat-button-protected-pressed-container-elevation-shadow, var(--mat-sys-level1))}.mat-mdc-raised-button[disabled],.mat-mdc-raised-button.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mat-button-protected-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));background-color:var(--mat-button-protected-disabled-container-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mat-mdc-raised-button[disabled].mat-mdc-button-disabled,.mat-mdc-raised-button.mat-mdc-button-disabled.mat-mdc-button-disabled{box-shadow:var(--mat-button-protected-disabled-container-elevation-shadow, var(--mat-sys-level0))}.mat-mdc-raised-button.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-mdc-outlined-button{border-style:solid;transition:border 280ms cubic-bezier(0.4, 0, 0.2, 1);height:var(--mat-button-outlined-container-height, 40px);font-family:var(--mat-button-outlined-label-text-font, var(--mat-sys-label-large-font));font-size:var(--mat-button-outlined-label-text-size, var(--mat-sys-label-large-size));letter-spacing:var(--mat-button-outlined-label-text-tracking, var(--mat-sys-label-large-tracking));text-transform:var(--mat-button-outlined-label-text-transform);font-weight:var(--mat-button-outlined-label-text-weight, var(--mat-sys-label-large-weight));border-radius:var(--mat-button-outlined-container-shape, var(--mat-sys-corner-full));border-width:var(--mat-button-outlined-outline-width, 1px);padding:0 var(--mat-button-outlined-horizontal-padding, 24px)}.mat-mdc-outlined-button>.mat-icon{margin-right:var(--mat-button-outlined-icon-spacing, 8px);margin-left:var(--mat-button-outlined-icon-offset, -8px)}[dir=rtl] .mat-mdc-outlined-button>.mat-icon{margin-right:var(--mat-button-outlined-icon-offset, -8px);margin-left:var(--mat-button-outlined-icon-spacing, 8px)}.mat-mdc-outlined-button .mdc-button__label+.mat-icon{margin-right:var(--mat-button-outlined-icon-offset, -8px);margin-left:var(--mat-button-outlined-icon-spacing, 8px)}[dir=rtl] .mat-mdc-outlined-button .mdc-button__label+.mat-icon{margin-right:var(--mat-button-outlined-icon-spacing, 8px);margin-left:var(--mat-button-outlined-icon-offset, -8px)}.mat-mdc-outlined-button .mat-ripple-element{background-color:var(--mat-button-outlined-ripple-color, color-mix(in srgb, var(--mat-sys-primary) calc(var(--mat-sys-pressed-state-layer-opacity) * 100%), transparent))}.mat-mdc-outlined-button .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-button-outlined-state-layer-color, var(--mat-sys-primary))}.mat-mdc-outlined-button.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-button-outlined-disabled-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-mdc-outlined-button:hover>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-button-outlined-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-mdc-outlined-button.cdk-program-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-outlined-button.cdk-keyboard-focused>.mat-mdc-button-persistent-ripple::before,.mat-mdc-outlined-button.mat-mdc-button-disabled-interactive:focus>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-button-outlined-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-mdc-outlined-button:active>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-button-outlined-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity))}.mat-mdc-outlined-button .mat-mdc-button-touch-target{position:absolute;top:50%;height:var(--mat-button-outlined-touch-target-size, 48px);display:var(--mat-button-outlined-touch-target-display, block);left:0;right:0;transform:translateY(-50%)}.mat-mdc-outlined-button:not(:disabled){color:var(--mat-button-outlined-label-text-color, var(--mat-sys-primary));border-color:var(--mat-button-outlined-outline-color, var(--mat-sys-outline))}.mat-mdc-outlined-button[disabled],.mat-mdc-outlined-button.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mat-button-outlined-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));border-color:var(--mat-button-outlined-disabled-outline-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mat-mdc-outlined-button.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-tonal-button{transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);height:var(--mat-button-tonal-container-height, 40px);font-family:var(--mat-button-tonal-label-text-font, var(--mat-sys-label-large-font));font-size:var(--mat-button-tonal-label-text-size, var(--mat-sys-label-large-size));letter-spacing:var(--mat-button-tonal-label-text-tracking, var(--mat-sys-label-large-tracking));text-transform:var(--mat-button-tonal-label-text-transform);font-weight:var(--mat-button-tonal-label-text-weight, var(--mat-sys-label-large-weight));padding:0 var(--mat-button-tonal-horizontal-padding, 24px)}.mat-tonal-button:not(:disabled){color:var(--mat-button-tonal-label-text-color, var(--mat-sys-on-secondary-container));background-color:var(--mat-button-tonal-container-color, var(--mat-sys-secondary-container))}.mat-tonal-button,.mat-tonal-button .mdc-button__ripple{border-radius:var(--mat-button-tonal-container-shape, var(--mat-sys-corner-full))}.mat-tonal-button[disabled],.mat-tonal-button.mat-mdc-button-disabled{cursor:default;pointer-events:none;color:var(--mat-button-tonal-disabled-label-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent));background-color:var(--mat-button-tonal-disabled-container-color, color-mix(in srgb, var(--mat-sys-on-surface) 12%, transparent))}.mat-tonal-button.mat-mdc-button-disabled-interactive{pointer-events:auto}.mat-tonal-button>.mat-icon{margin-right:var(--mat-button-tonal-icon-spacing, 8px);margin-left:var(--mat-button-tonal-icon-offset, -8px)}[dir=rtl] .mat-tonal-button>.mat-icon{margin-right:var(--mat-button-tonal-icon-offset, -8px);margin-left:var(--mat-button-tonal-icon-spacing, 8px)}.mat-tonal-button .mdc-button__label+.mat-icon{margin-right:var(--mat-button-tonal-icon-offset, -8px);margin-left:var(--mat-button-tonal-icon-spacing, 8px)}[dir=rtl] .mat-tonal-button .mdc-button__label+.mat-icon{margin-right:var(--mat-button-tonal-icon-spacing, 8px);margin-left:var(--mat-button-tonal-icon-offset, -8px)}.mat-tonal-button .mat-ripple-element{background-color:var(--mat-button-tonal-ripple-color, color-mix(in srgb, var(--mat-sys-on-secondary-container) calc(var(--mat-sys-pressed-state-layer-opacity) * 100%), transparent))}.mat-tonal-button .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-button-tonal-state-layer-color, var(--mat-sys-on-secondary-container))}.mat-tonal-button.mat-mdc-button-disabled .mat-mdc-button-persistent-ripple::before{background-color:var(--mat-button-tonal-disabled-state-layer-color, var(--mat-sys-on-surface-variant))}.mat-tonal-button:hover>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-button-tonal-hover-state-layer-opacity, var(--mat-sys-hover-state-layer-opacity))}.mat-tonal-button.cdk-program-focused>.mat-mdc-button-persistent-ripple::before,.mat-tonal-button.cdk-keyboard-focused>.mat-mdc-button-persistent-ripple::before,.mat-tonal-button.mat-mdc-button-disabled-interactive:focus>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-button-tonal-focus-state-layer-opacity, var(--mat-sys-focus-state-layer-opacity))}.mat-tonal-button:active>.mat-mdc-button-persistent-ripple::before{opacity:var(--mat-button-tonal-pressed-state-layer-opacity, var(--mat-sys-pressed-state-layer-opacity))}.mat-tonal-button .mat-mdc-button-touch-target{position:absolute;top:50%;height:var(--mat-button-tonal-touch-target-size, 48px);display:var(--mat-button-tonal-touch-target-display, block);left:0;right:0;transform:translateY(-50%)}.mat-mdc-button,.mat-mdc-unelevated-button,.mat-mdc-raised-button,.mat-mdc-outlined-button,.mat-tonal-button{-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-button .mat-mdc-button-ripple,.mat-mdc-button .mat-mdc-button-persistent-ripple,.mat-mdc-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-unelevated-button .mat-mdc-button-ripple,.mat-mdc-unelevated-button .mat-mdc-button-persistent-ripple,.mat-mdc-unelevated-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-raised-button .mat-mdc-button-ripple,.mat-mdc-raised-button .mat-mdc-button-persistent-ripple,.mat-mdc-raised-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-outlined-button .mat-mdc-button-ripple,.mat-mdc-outlined-button .mat-mdc-button-persistent-ripple,.mat-mdc-outlined-button .mat-mdc-button-persistent-ripple::before,.mat-tonal-button .mat-mdc-button-ripple,.mat-tonal-button .mat-mdc-button-persistent-ripple,.mat-tonal-button .mat-mdc-button-persistent-ripple::before{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:inherit}.mat-mdc-button .mat-mdc-button-ripple,.mat-mdc-unelevated-button .mat-mdc-button-ripple,.mat-mdc-raised-button .mat-mdc-button-ripple,.mat-mdc-outlined-button .mat-mdc-button-ripple,.mat-tonal-button .mat-mdc-button-ripple{overflow:hidden}.mat-mdc-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-unelevated-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-raised-button .mat-mdc-button-persistent-ripple::before,.mat-mdc-outlined-button .mat-mdc-button-persistent-ripple::before,.mat-tonal-button .mat-mdc-button-persistent-ripple::before{content:"";opacity:0}.mat-mdc-button .mdc-button__label,.mat-mdc-button .mat-icon,.mat-mdc-unelevated-button .mdc-button__label,.mat-mdc-unelevated-button .mat-icon,.mat-mdc-raised-button .mdc-button__label,.mat-mdc-raised-button .mat-icon,.mat-mdc-outlined-button .mdc-button__label,.mat-mdc-outlined-button .mat-icon,.mat-tonal-button .mdc-button__label,.mat-tonal-button .mat-icon{z-index:1;position:relative}.mat-mdc-button .mat-focus-indicator,.mat-mdc-unelevated-button .mat-focus-indicator,.mat-mdc-raised-button .mat-focus-indicator,.mat-mdc-outlined-button .mat-focus-indicator,.mat-tonal-button .mat-focus-indicator{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:inherit}.mat-mdc-button:focus>.mat-focus-indicator::before,.mat-mdc-unelevated-button:focus>.mat-focus-indicator::before,.mat-mdc-raised-button:focus>.mat-focus-indicator::before,.mat-mdc-outlined-button:focus>.mat-focus-indicator::before,.mat-tonal-button:focus>.mat-focus-indicator::before{content:"";border-radius:inherit}.mat-mdc-button._mat-animation-noopable,.mat-mdc-unelevated-button._mat-animation-noopable,.mat-mdc-raised-button._mat-animation-noopable,.mat-mdc-outlined-button._mat-animation-noopable,.mat-tonal-button._mat-animation-noopable{transition:none !important;animation:none !important}.mat-mdc-button>.mat-icon,.mat-mdc-unelevated-button>.mat-icon,.mat-mdc-raised-button>.mat-icon,.mat-mdc-outlined-button>.mat-icon,.mat-tonal-button>.mat-icon{display:inline-block;position:relative;vertical-align:top;font-size:1.125rem;height:1.125rem;width:1.125rem}.mat-mdc-outlined-button .mat-mdc-button-ripple,.mat-mdc-outlined-button .mdc-button__ripple{top:-1px;left:-1px;bottom:-1px;right:-1px}.mat-mdc-unelevated-button .mat-focus-indicator::before,.mat-tonal-button .mat-focus-indicator::before,.mat-mdc-raised-button .mat-focus-indicator::before{margin:calc(calc(var(--mat-focus-indicator-border-width, 3px) + 2px)*-1)}.mat-mdc-outlined-button .mat-focus-indicator::before{margin:calc(calc(var(--mat-focus-indicator-border-width, 3px) + 3px)*-1)}
|
|
1237
1237
|
`,`@media(forced-colors: active){.mat-mdc-button:not(.mdc-button--outlined),.mat-mdc-unelevated-button:not(.mdc-button--outlined),.mat-mdc-raised-button:not(.mdc-button--outlined),.mat-mdc-outlined-button:not(.mdc-button--outlined),.mat-mdc-button-base.mat-tonal-button,.mat-mdc-icon-button.mat-mdc-icon-button,.mat-mdc-outlined-button .mdc-button__ripple{outline:solid 1px}}
|
|
1238
|
-
`],encapsulation:2,changeDetection:0})}return i})();function Kae(i){return i.hasAttribute("mat-raised-button")?"elevated":i.hasAttribute("mat-stroked-button")?"outlined":i.hasAttribute("mat-flat-button")?"filled":i.hasAttribute("mat-button")?"text":null}function Yae(i,t){if(i&1){let e=ot();T(0,"button",4),he("click",function(){Ue(e);let r=fe();return He(r.data.resolveErrorData.onResolveErrorClick())}),j(1),F()}if(i&2){let e=fe();S(),lt(" ",e.data.resolveErrorData.buttonText," ")}}var ts=(()=>{class i{constructor(e){this.data=e}static{this.\u0275fac=function(n){return new(n||i)(se(Is))}}static{this.\u0275cmp=te({type:i,selectors:[["cc-error-dialog"]],decls:7,vars:3,consts:[["mat-dialog-title",""],["mat-dialog-content","",3,"innerHTML"],["mat-dialog-actions","","align","end"],["mat-button","","mat-dialog-close",""],["mat-button","","mat-dialog-close","",3,"click"]],template:function(n,r){n&1&&(T(0,"h1",0),j(1),F(),ie(2,"div",1),T(3,"div",2),Ee(4,Yae,2,1,"button",3),T(5,"button",3),j(6,"OK"),F()()),n&2&&(S(),hi(r.data.title),S(),G("innerHTML",r.data.message,iy),S(2),Te(r.data.resolveErrorData?4:-1))},dependencies:[Tf,Cr,Ur,an,wr],encapsulation:2})}}return i})();function lN(i){return{title:"Something is wrong with the loaded file(s)",message:[...Zae(i),...Jae(i)].join("")}}function Zae(i){let t=i.filter(e=>e.errors.length>0);return t.length>0?["<h2>Errors</h2>",...t.map(e=>ese(e))]:[]}function Jae(i){let t=i.filter(e=>e.warnings.length>0);return t.length>0?["<h2>Warnings</h2>",...t.map(e=>tse(e))]:[]}function ese(i){return`<p><strong>${i.fileName}:</strong> ${Jy('<i class="fa fa-exclamation-circle"></i> ',i.errors)}</p>`}function tse(i){return`<p><strong>${i.fileName}:</strong> ${Jy('<i class="fa fa-exclamation-triangle"></i> ',i.warnings)}</p>`}function Jy(i,t){return`<p>${t.map(e=>i+e).join("<br>")}</p>`}var AB=(function(i){return i.hide="hide",i.exclude="exclude",i})(AB||{});var bB=rl(e1());function AN(i){let t=i.content;return{fileMeta:{fileName:i.fileName,fileChecksum:t.fileChecksum,projectName:t.projectName,apiVersion:t.apiVersion,exportedFileSize:i.fileSize,repoCreationDate:t.repoCreationDate||""},settings:{fileSettings:{edges:t.edges||[],attributeTypes:nse(t.attributeTypes),attributeDescriptors:rse(t.attributeDescriptors),blacklist:ose(t.blacklist||[]),markedPackages:t.markedPackages||[]}},map:Io(t.nodes[0])}}function nse(i){return!i||Array.isArray(i.nodes)||Array.isArray(i.edges)?{nodes:{},edges:{}}:{nodes:i.nodes??{},edges:i.edges??{}}}function rse(i){return i||{}}function ose(i){for(let t of i)t.type===AB.hide&&(t.type="flatten");return i}function gN(i){let t=0;for(let e of i)e.selectedAs!==xi.None&&(t+=e.file.fileMeta.exportedFileSize);return t}function K0(i){let t=null;try{let e=typeof i=="string"?JSON.parse(i):i;if("data"in e&&"checksum"in e)return t=e.data,t.fileChecksum=e.checksum||(0,bB.default)(JSON.stringify(e.data)),t;if(!e.fileChecksum){let n=typeof i=="string"?i:JSON.stringify(i);e.fileChecksum=(0,bB.default)(n)}return e}catch{}return t}var $8=rl(qB());var tc={author:"MaibornWolff GmbH <dist_intern_codecharta@maibornwolff.de>",homepage:"https://maibornwolff.github.io/codecharta/",bugs:{url:"https://github.com/MaibornWolff/codecharta/issues",email:"dist_intern_codecharta@maibornwolff.de"},repository:{type:"git",url:"https://github.com/MaibornWolff/codecharta.git"},name:"codecharta-visualization",version:"1.137.0",engines:{node:">=20"},description:"MaibornWolff CodeCharta",files:["dist/bundler/browser","conf","Dockerfile","LICENSE.md","package.json","package-lock.json","README.md","tsconfig.json","cli.js"],codecharta:{apiVersion:"1.5"},main:"main.js",browserslist:["last 2 chrome version","last 2 firefox version","last 2 safari version"],scripts:{start:"electron dist/bundler/browser",build:"ng build && cp electron/* package.json dist/bundler/browser",dev:"ng serve",test:"npm run test:ci -- --maxWorkers=25%","test:ci":"jest --config conf/jestUnit.config.json .*\\.spec\\.ts","test:auto":"npm test -- --watch","test:autoNoCoverage":"npm run test:auto -- --coverage false","test:updateSnaps":"npm test -- --updateSnapshot","test:createCoverageFile":"jest --config conf/jestUnit.config.json --coverage --coverageReporters=lcov --coverageDirectory=coverage",e2e:"jest --config conf/jestE2E.config.json .*\\.e2e\\.ts --coverage false","e2e:auto":"npm run e2e -- --watch","e2e:ci":"npm run e2e -- --runInBand",package:"node script/appMain.js","package:local":"npm run package -- --local","schema:generate":"typescript-json-schema ./app/codeCharta/codeCharta.model.ts ExportCCFile --required --topRef --out app/codeCharta/util/generatedSchema.json",sbom:"cyclonedx-npm --omit dev --gather-license-texts --spec-version 1.6 --output-format json --output-file build/reports/sbom_visualization.cdx.json"},bin:{"codecharta-visualization":"cli.js"},license:"BSD-3-Clause",dependencies:{"@angular/animations":"^20.3.4","@angular/cdk":"^20.2.8","@angular/common":"^20.3.4","@angular/core":"^20.3.4","@angular/forms":"^20.3.4","@angular/material":"^20.2.8","@angular/platform-browser":"^20.3.4","@angular/platform-browser-dynamic":"^20.3.4","@angular/router":"^20.3.4","@ngrx/effects":"^20.0.0","@ngrx/operators":"^20.0.0","@ngrx/store":"^20.0.0","@ngrx/store-devtools":"^20.0.0","@tailwindcss/postcss":"^4.1.15","@types/d3":"^7.4.3",ajv:"^6.12.6","color-convert":"2.0.1",d3:"^7.8.5","d3-hierarchy":"^2.0.0",dequal:"^2.0.3",electron:"39.1.2","fake-indexeddb":"^6.2.4",fflate:"^0.8.2","font-awesome":"^4.7.0","hotkeys-js":"^3.8.2",html2canvas:"^1.4.1",idb:"^8.0.0",ignore:"^7.0.5",klona:"^2.0.4","marked-mangle":"^1.1.11","material-icons":"^1.10.4",md5:"^2.3.0","ngx-color":"^10.0.0",pako:"^2.0.4","percent-round":"^2.2.1",qrcode:"^1.5.3",rxjs:"^7.5.1","safe-stable-stringify":"^2.4.3",shelljs:"^0.10.0",tailwindcss:"^4.1.15",three:"^0.168.0","three-orbit-controls":"^82.1.0","typescript-json-schema":"0.65.1","zone.js":"^0.15.1"},devDependencies:{"@angular/build":"^20.3.5","@angular/cli":"^20.3.5","@angular/compiler":"^20.3.4","@angular/compiler-cli":"^20.3.4","@babel/plugin-transform-class-static-block":"^7.23.3","@cyclonedx/cyclonedx-npm":"^4.0.3","@electron/get":"^4.0.2","@electron/packager":"^19.0.1","@testing-library/angular":"^18.1.0","@testing-library/user-event":"^14.5.2","@types/color-convert":"2.0.4","@types/d3-hierarchy":"^3.0.2","@types/expect-puppeteer":"^5.0.2","@types/jest":"^30.0.0","@types/jest-environment-puppeteer":"^5.0.6","@types/node":"^24.0.0","@types/three":"^0.168.0",autoprefixer:"^10.4.21",bestzip:"^2.2.0",daisyui:"^5.3.7","fast-xml-parser":"^5.0.0","html-loader":"^5.0.0",jest:"^30.2.0","jest-canvas-mock":"^2.4.0","jest-environment-jsdom":"^30.1.0","jest-preset-angular":"15.0.3","jest-puppeteer":"^11.0.0",marked:"^5.0.2",postcss:"^8.5.6",puppeteer:"^24.24.0","ts-jest":"^29.4.5",typescript:"5.8.3","webpack-glsl-loader":"^1.0.1"},optionalDependencies:{"@rollup/rollup-linux-x64-gnu":"^4.24.2"}};var _8={$ref:"#/definitions/ExportCCFile",$schema:"http://json-schema.org/draft-07/schema#",definitions:{AttributeTypes:{properties:{edges:{additionalProperties:{enum:["absolute","relative"],type:"string"},type:"object"},nodes:{additionalProperties:{enum:["absolute","relative"],type:"string"},type:"object"}},type:"object"},CodeMapNode:{properties:{attributes:{$ref:"#/definitions/KeyValuePair"},children:{items:{$ref:"#/definitions/CodeMapNode"},type:"array"},deltas:{additionalProperties:{type:"number"},type:"object"},edgeAttributes:{additionalProperties:{$ref:"#/definitions/EdgeMetricCount"},type:"object"},fixedPosition:{$ref:"#/definitions/FixedPosition"},id:{type:"number"},isExcluded:{type:"boolean"},isFlattened:{type:"boolean"},link:{type:"string"},name:{type:"string"},path:{type:"string"},type:{$ref:"#/definitions/NodeType"}},required:["name","type"],type:"object"},Edge:{properties:{attributes:{$ref:"#/definitions/KeyValuePair"},fromNodeName:{type:"string"},toNodeName:{type:"string"},visible:{$ref:"#/definitions/EdgeVisibility"}},required:["attributes","fromNodeName","toNodeName"],type:"object"},EdgeMetricCount:{properties:{incoming:{type:"number"},outgoing:{type:"number"}},required:["incoming","outgoing"],type:"object"},EdgeVisibility:{enum:["both","from","none","to"],type:"string"},ExportBlacklistItem:{properties:{path:{type:"string"},type:{$ref:"#/definitions/ExportBlacklistType"}},required:["path","type"],type:"object"},ExportBlacklistType:{enum:["exclude","hide"],type:"string"},ExportCCFile:{properties:{apiVersion:{type:"string"},attributeTypes:{anyOf:[{$ref:"#/definitions/OldAttributeTypes"},{$ref:"#/definitions/AttributeTypes"}]},blacklist:{items:{$ref:"#/definitions/ExportBlacklistItem"},type:"array"},edges:{items:{$ref:"#/definitions/Edge"},type:"array"},markedPackages:{items:{$ref:"#/definitions/MarkedPackage"},type:"array"},nodes:{items:{$ref:"#/definitions/CodeMapNode"},type:"array"},projectName:{type:"string"}},required:["apiVersion","nodes","projectName"],type:"object"},FixedPosition:{properties:{height:{type:"number"},left:{type:"number"},top:{type:"number"},width:{type:"number"}},required:["height","left","top","width"],type:"object"},KeyValuePair:{additionalProperties:{type:"number"},type:"object"},MarkedPackage:{properties:{color:{type:"string"},path:{type:"string"}},required:["color","path"],type:"object"},NodeType:{enum:["File","Folder"],type:"string"},OldAttributeTypes:{properties:{edges:{additionalItems:{anyOf:[{additionalProperties:{enum:["absolute","relative"],type:"string"},type:"object"}]},items:[{additionalProperties:{enum:["absolute","relative"],type:"string"},type:"object"}],minItems:0,type:"array"},nodes:{additionalItems:{anyOf:[{additionalProperties:{enum:["absolute","relative"],type:"string"},type:"object"}]},items:[{additionalProperties:{enum:["absolute","relative"],type:"string"},type:"object"}],minItems:0,type:"array"}},type:"object"}}};function Hle(i){var t=0,e=i.children,n=e&&e.length;if(!n)t=1;else for(;--n>=0;)t+=e[n].value;i.value=t}function b8(){return this.eachAfter(Hle)}function v8(i,t){let e=-1;for(let n of this)i.call(t,n,++e,this);return this}function y8(i,t){for(var e=this,n=[e],r,o,a=-1;e=n.pop();)if(i.call(t,e,++a,this),r=e.children)for(o=r.length-1;o>=0;--o)n.push(r[o]);return this}function x8(i,t){for(var e=this,n=[e],r=[],o,a,s,l=-1;e=n.pop();)if(r.push(e),o=e.children)for(a=0,s=o.length;a<s;++a)n.push(o[a]);for(;e=r.pop();)i.call(t,e,++l,this);return this}function w8(i,t){let e=-1;for(let n of this)if(i.call(t,n,++e,this))return n}function C8(i){return this.eachAfter(function(t){for(var e=+i(t.data)||0,n=t.children,r=n&&n.length;--r>=0;)e+=n[r].value;t.value=e})}function M8(i){return this.eachBefore(function(t){t.children&&t.children.sort(i)})}function S8(i){for(var t=this,e=Vle(t,i),n=[t];t!==e;)t=t.parent,n.push(t);for(var r=n.length;i!==e;)n.splice(r,0,i),i=i.parent;return n}function Vle(i,t){if(i===t)return i;var e=i.ancestors(),n=t.ancestors(),r=null;for(i=e.pop(),t=n.pop();i===t;)r=i,i=e.pop(),t=n.pop();return r}function E8(){for(var i=this,t=[i];i=i.parent;)t.push(i);return t}function T8(){return Array.from(this)}function B8(){var i=[];return this.eachBefore(function(t){t.children||i.push(t)}),i}function F8(){var i=this,t=[];return i.each(function(e){e!==i&&t.push({source:e.parent,target:e})}),t}function*I8(){var i=this,t,e=[i],n,r,o;do for(t=e.reverse(),e=[];i=t.pop();)if(yield i,n=i.children)for(r=0,o=n.length;r<o;++r)e.push(n[r]);while(e.length)}function Ui(i,t){i instanceof Map?(i=[void 0,i],t===void 0&&(t=qle)):t===void 0&&(t=zle);for(var e=new b1(i),n,r=[e],o,a,s,l;n=r.pop();)if((a=t(n.data))&&(l=(a=Array.from(a)).length))for(n.children=a,s=l-1;s>=0;--s)r.push(o=a[s]=new b1(a[s])),o.parent=n,o.depth=n.depth+1;return e.eachBefore(Wle)}function Qle(){return Ui(this).eachBefore(Gle)}function zle(i){return i.children}function qle(i){return Array.isArray(i)?i[1]:null}function Gle(i){i.data.value!==void 0&&(i.value=i.data.value),i.data=i.data.data}function Wle(i){var t=0;do i.height=t;while((i=i.parent)&&i.height<++t)}function b1(i){this.data=i,this.depth=this.height=0,this.parent=null}b1.prototype=Ui.prototype={constructor:b1,count:b8,each:v8,eachAfter:x8,eachBefore:y8,find:w8,sum:C8,sort:M8,path:S8,ancestors:E8,descendants:T8,leaves:B8,links:F8,copy:Qle,[Symbol.iterator]:I8};function D8(i){if(typeof i!="function")throw new Error;return i}function Cp(){return 0}function Mp(i){return function(){return i}}function k8(i){i.x0=Math.round(i.x0),i.y0=Math.round(i.y0),i.x1=Math.round(i.x1),i.y1=Math.round(i.y1)}function P8(i,t,e,n,r){for(var o=i.children,a,s=-1,l=o.length,c=i.value&&(n-t)/i.value;++s<l;)a=o[s],a.y0=e,a.y1=r,a.x0=t,a.x1=t+=a.value*c}function R8(i,t,e,n,r){for(var o=i.children,a,s=-1,l=o.length,c=i.value&&(r-e)/i.value;++s<l;)a=o[s],a.x0=t,a.x1=n,a.y0=e,a.y1=e+=a.value*c}var jle=(1+Math.sqrt(5))/2;function $le(i,t,e,n,r,o){for(var a=[],s=t.children,l,c,d=0,h=0,u=s.length,f,_,y=t.value,b,v,M,x,w,k,P;d<u;){f=r-e,_=o-n;do b=s[h++].value;while(!b&&h<u);for(v=M=b,k=Math.max(_/f,f/_)/(y*i),P=b*b*k,w=Math.max(M/P,P/v);h<u;++h){if(b+=c=s[h].value,c<v&&(v=c),c>M&&(M=c),P=b*b*k,x=Math.max(M/P,P/v),x>w){b-=c;break}w=x}a.push(l={value:b,dice:f<_,children:s.slice(d,h)}),l.dice?P8(l,e,n,r,y?n+=_*b/y:o):R8(l,e,n,y?e+=f*b/y:r,o),y-=b,d=h}return a}var O8=(function i(t){function e(n,r,o,a,s){$le(t,n,r,o,a,s)}return e.ratio=function(n){return i((n=+n)>1?n:1)},e})(jle);function GB(){var i=O8,t=!1,e=1,n=1,r=[0],o=Cp,a=Cp,s=Cp,l=Cp,c=Cp;function d(u){return u.x0=u.y0=0,u.x1=e,u.y1=n,u.eachBefore(h),r=[0],t&&u.eachBefore(k8),u}function h(u){var f=r[u.depth],_=u.x0+f,y=u.y0+f,b=u.x1-f,v=u.y1-f;b<_&&(_=b=(_+b)/2),v<y&&(y=v=(y+v)/2),u.x0=_,u.y0=y,u.x1=b,u.y1=v,u.children&&(f=r[u.depth+1]=o(u)/2,_+=c(u)-f,y+=a(u)-f,b-=s(u)-f,v-=l(u)-f,b<_&&(_=b=(_+b)/2),v<y&&(y=v=(y+v)/2),i(u,_,y,b,v))}return d.round=function(u){return arguments.length?(t=!!u,d):t},d.size=function(u){return arguments.length?(e=+u[0],n=+u[1],d):[e,n]},d.tile=function(u){return arguments.length?(i=D8(u),d):i},d.padding=function(u){return arguments.length?d.paddingInner(u).paddingOuter(u):d.paddingInner()},d.paddingInner=function(u){return arguments.length?(o=typeof u=="function"?u:Mp(+u),d):o},d.paddingOuter=function(u){return arguments.length?d.paddingTop(u).paddingRight(u).paddingBottom(u).paddingLeft(u):d.paddingTop()},d.paddingTop=function(u){return arguments.length?(a=typeof u=="function"?u:Mp(+u),d):a},d.paddingRight=function(u){return arguments.length?(s=typeof u=="function"?u:Mp(+u),d):s},d.paddingBottom=function(u){return arguments.length?(l=typeof u=="function"?u:Mp(+u),d):l},d.paddingLeft=function(u){return arguments.length?(c=typeof u=="function"?u:Mp(+u),d):c},d}var ZB=rl(G8());function kf(i){let t=2;if(i.startsWith("/"))t=1;else if(!i.startsWith("./"))return i;return i.slice(t)}function W8(i){let t=[];if(i!==void 0)for(let{data:e}of Ui(i))e.type!=="Folder"&&t.push(e);return t}function JB(i,t){let e=eF(t);return e.ignoredNodePaths.ignores(kf(i.path))===e.condition}function eF(i){i=kf(i.trimStart());let t=!0;i.startsWith("!")&&(i=i.slice(1),t=!1);let e=(0,ZB.default)();for(let n of i.split(","))n=n.trimStart(),!n.startsWith("*")&&!n.endsWith("*")&&(n=n.startsWith('"')&&n.endsWith('"')?n.slice(1,-1):`*${n}*`),n.length!==0&&e.add(kf(n));return{ignoredNodePaths:e,condition:t}}function j8(i,t){return ma(i,t,"exclude")||ma(i,t,"flatten")}function ma(i,t,e){if(t.length===0)return!1;let n=(0,ZB.default)();for(let r of t)r.type===e&&n.add(kf(r.path));return n.ignores(kf(i))}function Pf(i,t){if(!t)return;let e;for(let n of t)(!e||e.path.length<n.path.length)&&(i.path.startsWith(`${n.path}/`)||i.path===n.path)&&(e=n);if(e)return e.color}function Yi(i){return i.children===void 0||i.children.length===0}var w1=(function(i){return i[i.SMALL_MAP=1]="SMALL_MAP",i[i.MEDIUM_MAP=.5]="MEDIUM_MAP",i[i.BIG_MAP=.25]="BIG_MAP",i})(w1||{});function Rf(i){let e=gN(i);switch(!0){case e>=7*1048576:return w1.BIG_MAP;case e>=2*1048576:return w1.MEDIUM_MAP;default:return w1.SMALL_MAP}}var X8=tc.codecharta.apiVersion,ml={fileIsInvalid:"File is empty or invalid.",apiVersionIsInvalid:"API Version is empty or invalid.",majorApiVersionIsOutdated:"API Version Outdated: Update CodeCharta API Version to match cc.json.",minorApiVersionOutdated:"Minor API Version Outdated.",nodesNotUnique:"Node names in combination with node types are not unique.",nodesEmpty:"The nodes array is empty. At least one node is required.",notAllFoldersAreFixed:"If at least one direct sub-folder of root is marked as fixed, all direct sub-folders of root must be fixed.",fixedFoldersOutOfBounds:"Coordinates of fixed folders must be within a range of 0 and 100.",fixedFoldersOverlapped:"Folders may not overlap.",fixedFoldersNotAllowed:"Fixated folders may not be defined in API-Version < 1.2.",fileAlreadyExists:"File already exists.",blacklistError:"Excluding all buildings is not possible.",fileContainsAuthorsAttribute:"File contains unsupported 'authors' attribute. This attribute will be ignored. Node containing the attribute: "};function K8(i){return!i||!i.nodes?[]:J8(i.nodes)}function Y8(i){let t=[];return i&&_ce(i)&&t.push(`${ml.minorApiVersionOutdated} Found: ${i.apiVersion}`),t}function Z8(i){let t=[];switch(!0){case!i:t.push(ml.fileIsInvalid);break;case!Ace(i):t.push(ml.apiVersionIsInvalid);break;case gce(i):t.push(ml.majorApiVersionIsOutdated);break}return t.length===0&&t.push(...pce(i)),t}function pce(i){let t=[];if(t.length===0){let n=new $8.default({allErrors:!0}).compile(_8);n(i)?i.nodes.length===0?t.push(ml.nodesEmpty):t.push(...vce(i.nodes[0]),...t6(i)):t.push(...n.errors.map(o=>bce(o)))}return t}function Ace(i){let{apiVersion:t}=i,e=t!==void 0,r=/\d+\.\d+/.test(t);return e&&r}function gce(i){return e_(i.apiVersion).major>e_(X8).major}function _ce(i){return e_(i.apiVersion).minor>e_(X8).minor}function J8(i){let t=[];for(let e of i)e.attributes?.authors&&(delete e.attributes.authors,t.push(`${ml.fileContainsAuthorsAttribute}"${e.name}"`)),e.children&&t.push(...J8(e.children));return t}function e_(i){return{major:Number(i.split(".")[0]),minor:Number(i.split(".")[1])}}function bce(i){let t=i.keyword.charAt(0).toUpperCase()+i.keyword.slice(1),e=i.dataPath.slice(1);return`${t} error: ${e} ${i.message}`}function vce(i){let t=[],e=new Set;return e.add(`${i.name}|${i.type}`),e6(i,t,e,`/${i.name}`),t}function e6(i,t,e,n){if(!Yi(i))for(let r of i.children){let o=`${n}/${r.name}`;e.has(`${o}|${r.type}`)?t.push(`${ml.nodesNotUnique} Found duplicate of ${r.type} with path: ${o}`):(e.add(`${o}|${r.type}`),e6(r,t,e,o))}}function yce(i,t,e,n,r,o){for(let a of i)if(a.fixedPosition===void 0)t.push(`${a.name}`);else{let s=e_(e.apiVersion);if(s.major<1||s.major===1&&s.minor<2){n.push(`${ml.fixedFoldersNotAllowed} Found: ${e.apiVersion}`);return}wce(a)&&r.push(J0(a));for(let l of i)l.fixedPosition!==void 0&&a!==l&&xce(a.fixedPosition,l.fixedPosition)&&!o.has(`${J0(l)} and ${J0(a)}`)&&o.add(`${J0(a)} and ${J0(l)}`)}}function t6(i,t=i.nodes[0].children){let e=[],n=[],r=[],o=new Set;yce(t,n,i,e,r,o),n.length>0&&n.length!==t.length&&e.push(`${ml.notAllFoldersAreFixed} Found: ${n.join(", ")}`),r.length>0&&e.push(`${ml.fixedFoldersOutOfBounds} Found: ${r.join(", ")}`),o.size>0&&e.push(`${ml.fixedFoldersOverlapped} Found: ${[...o].join(", ")}`);for(let a of t)a.children&&e.push(...t6(i,a.children));return e}function J0(i){return`${i.name} ${JSON.stringify(i.fixedPosition)}`}function xce(i,t){return C1(i.left,i.top,t)||C1(i.left,i.top+i.height,t)||C1(i.left+i.width,i.top,t)||C1(i.left+i.width,i.top+i.height,t)}function C1(i,t,e){return i>=e.left&&i<=e.left+e.width&&t>=e.top&&t<=e.top+e.height}function wce({fixedPosition:{left:i,top:t,width:e,height:n}}){return i<0||t<0||i+e>100||t+n>100||e<0||n<0}var M1=i=>{i.sort((t,e)=>{let n=t.name.toLowerCase(),r=e.name.toLowerCase();return n>r?1:r>n?-1:0})};var Tp="unary",S1=(i,t)=>{if(i.length===0)return[];let e=new Map,n=new Map,r=new Map;for(let{file:a}of i)for(let s of Ui(a.map))if(Yi(s)&&s.data.path&&!ma(s.data.path,t,"exclude"))for(let l of Object.keys(s.data.attributes)){let c=n.get(l),d=r.get(l);e.get(l)||e.set(l,[]),e.get(l).push(s.data.attributes[l]),(d===void 0||d>=s.data.attributes[l])&&r.set(l,s.data.attributes[l]),(c===void 0||c<=s.data.attributes[l])&&n.set(l,s.data.attributes[l])}let o=[];n.set(Tp,1),r.set(Tp,1);for(let[a,s]of n)o.push({name:a,values:e.get(a),maxValue:s,minValue:r.get(a)});return M1(o),o};var t_={decorateMap(i,t,e){for(let{data:n}of Ui(i)){n.isFlattened=!1,n.isExcluded=!1;for(let r of e)r.type==="flatten"?n.isFlattened=n.isFlattened||JB(n,r.path):n.isExcluded=n.isExcluded||JB(n,r.path)&&Yi(n)}i.isExcluded=!1,this.decorateMapWithMetricData(i,t)},decorateMapWithMetricData(i,t){let{nodeMetricData:e,edgeMetricData:n}=t,r=0;for(let{data:o}of Ui(i)){o.id=r,r++,o.attributes===void 0&&(o.attributes={}),Yi(o)&&(o.attributes[Tp]=1);for(let a of e)o.attributes[a.name]===void 0&&(o.attributes[a.name]=0),o.deltas!==void 0&&o.deltas[a.name]===void 0&&(o.deltas[a.name]=0);o.edgeAttributes===void 0&&(o.edgeAttributes={});for(let a of n)o.edgeAttributes[a.name]===void 0&&(o.edgeAttributes[a.name]={incoming:0,outgoing:0});Cce(o)}},decorateMapWithPathAttribute(i){for(let t of Ui(i.map))t.data.path=t.parent?`${t.parent.data.path}/${t.data.name}`:`/${t.data.name}`;return i},decorateParentNodesWithAggregatedAttributes(i,t,e){let n=new Map,r=Object.keys(i.attributes),o=Object.keys(i.edgeAttributes);Ui(i).eachAfter(function({data:s,parent:l}){if(!(s.isExcluded||!l)){for(let c of r){let d=`${c}${s.path}`,h=`${c}${l.data.path}`;e.nodes[c]===dl.relative?(Sce(n,d,h,s,c,t),Mce(n,h,s,c,t)):(l.data.attributes[c]+=s.attributes[c],t&&l.data.deltas&&(l.data.deltas[c]=l.data.deltas[c]??0,l.data.deltas[c]+=s.deltas[c]??0))}t&&l.data.fileCount&&(l.data.fileCount.added+=s.fileCount.added,l.data.fileCount.changed+=s.fileCount.changed,l.data.fileCount.removed+=s.fileCount.removed);for(let c of o){let d=s.edgeAttributes[c];if(!d)continue;let h=`${c}${s.path}`,u=`${c}${l.data.path}`;e.edges[c]===dl.relative?(n6(n,`INCOMING${h}`,`INCOMING${u}`,s,c,"incoming"),n6(n,`OUTGOING${h}`,`OUTGOING${u}`,s,c,"outgoing"),i6(n,`INCOMING${u}`,s,c,"incoming"),i6(n,`OUTGOING${u}`,s,c,"outgoing")):(l.data.edgeAttributes[c].incoming+=d.incoming,l.data.edgeAttributes[c].outgoing+=d.outgoing)}}});for(let a of o)e.edges[a]===dl.relative&&(i.edgeAttributes[a].incoming=Of(n.get(`INCOMING${a}${i.path}`)),i.edgeAttributes[a].outgoing=Of(n.get(`OUTGOING${a}${i.path}`)));for(let a of r)e.nodes[a]===dl.relative&&(i.attributes[a]=Of(n.get(`MEDIAN${a}${i.path}`)),t&&i.deltas&&(i.deltas[a]=Of(n.get(`DELTA${a}${i.path}`))))}};function Cce(i){if(!(i.children?.length===1&&i.children[0]?.fixedPosition)&&i.children?.length===1&&i.children[0].children?.length>0){let[t]=i.children;i.children=t.children,i.name+=`/${t.name}`,i.path+=`/${t.name}`,t.link&&(i.link=t.link)}}function i6(i,t,e,n,r){e.edgeAttributes[n][r]!==0&&iF(i,t,e,e.edgeAttributes[n][r])}function Mce(i,t,e,n,r){e.attributes[n]!==0&&iF(i,`MEDIAN${t}`,e,e.attributes[n]),r&&e.deltas&&e.deltas[n]!==0&&iF(i,`DELTA${t}`,e,e.deltas[n])}function Sce(i,t,e,n,r,o){if(Yi(n))return;let a=i.get(`MEDIAN${t}`);if(a!==void 0&&(n.attributes[r]=Of(a),tF(i,`MEDIAN${e}`,a)),o&&n.deltas){let s=i.get(`DELTA${t}`);s!==void 0&&(n.deltas[r]=Of(s),tF(i,`DELTA${e}`,s))}}function n6(i,t,e,n,r,o){if(Yi(n))return;let a=i.get(t);a!==void 0&&(n.edgeAttributes[r][o]=Of(a),tF(i,e,a))}function tF(i,t,e){let n=i.get(t);n===void 0?i.set(t,e):Tce(n,e)}function iF(i,t,e,n){let r=i.get(t);r===void 0?i.set(t,[n]):Yi(e)&&Ece(r,n)}function Of(i){if(i===void 0||i.length===0)return 0;let t=(i.length-1)/2;return(i[Math.floor(t)]+i[Math.ceil(t)])/2}function Ece(i,t){let e=0,n=i.length-1,r=0;if(n<0||i[n]<=t){i.push(t);return}if(i[0]>=t){i.unshift(t);return}for(;e<=n;)if(r=Math.floor((e+n)/2),i[r]<t)e=r+1;else if(n=r-1,i[n]<=t){i.splice(r,0,t);return}}function Tce(i,t){let e=0;for(let n=0;n<i.length;n++){let r=0;for(;i[n]>t[e]&&(r++,e++,e!==t.length););if(r>0&&(i.splice(n,0,...t.slice(e-r,e)),e===t.length))return}i.push(...t.slice(e))}function nF(i){return{fileName:i.fileMeta.fileName,fileSize:i.fileMeta.exportedFileSize,content:Bce(i)}}function Bce(i){return{projectName:i.fileMeta.projectName,apiVersion:i.fileMeta.apiVersion,fileChecksum:i.fileMeta.fileChecksum,nodes:[i.map],attributeTypes:i.settings.fileSettings.attributeTypes,attributeDescriptors:i.settings.fileSettings.attributeDescriptors,edges:i.settings.fileSettings.edges,markedPackages:i.settings.fileSettings.markedPackages,blacklist:i.settings.fileSettings.blacklist.map(t=>{switch(t.type){case"flatten":return{path:t.path,type:"hide"};case"exclude":return{path:t.path,type:t.type}}})}}function r6(i,t,e,n,r,o){let a=!1;for(let s of e){let l={fileName:s?.fileName,errors:[],warnings:[]};l.warnings.push(...K8(s?.content)),l.errors.push(...Z8(s?.content)),l.errors.length===0&&(l.warnings.push(...Y8(s?.content)),Fce(i,t,s,r,o)&&(a=!0)),(l.errors.length>0||l.warnings.length>0)&&n.push(l)}return a}function Fce(i,t,e,n,r){n()&&(i.length=0,r(),localStorage.removeItem("scenarios"));let o=AN(e);t_.decorateMapWithPathAttribute(o);let a=o.fileMeta.fileChecksum,s=o.fileMeta.fileName,l=new Map(i.map(h=>[h.file.fileMeta.fileName,h.file.fileMeta.fileChecksum])),c=new Map(i.map((h,u)=>[h.file.fileMeta.fileChecksum,u])),d=c.has(a);return l.has(s)&&(s=Ice(s,l,a),o.fileMeta.fileName=s),d?(i[c.get(a)].file.fileMeta.fileName=s,t.unshift(s),!1):(i.push({file:o,selectedAs:xi.None}),t.push(s),!0)}function Ice(i,t,e){if(t.get(i)===e)return i;let n=!1,r=1,o=i;for(;!n;){let a=i.indexOf(".");o=a>=0?[i.slice(0,a),"_",r,i.slice(a)].join(""):`${i}_${r}`,(t.get(o)===e||!t.has(o))&&(n=!0),r++}return o}var pa={rootName:"root",rootPath:"/root",updateRoot(i){this.rootName=i,this.rootPath=`/${i}`}};var pd=et("CURRENT_FILES_ARE_SAMPLE_FILES",rt());var E1="File(s) could not be loaded",Dce="File(s) are already loaded",pl=(()=>{class i{static{this.CC_FILE_EXTENSION=".cc.json"}constructor(e,n,r){this.store=e,this.state=n,this.dialog=r,this.referenceFileSubscription=this.store.select(Py).pipe(Li(o=>{o&&pa.updateRoot(o.map.name)})).subscribe()}ngOnDestroy(){this.referenceFileSubscription.unsubscribe()}loadFiles(e){let n=Io(this.state.getValue().files),r=[],o=[],a=r6(n,r,e,o,()=>this.state.getValue().appStatus.currentFilesAreSampleFiles,()=>this.store.dispatch(pd({value:!1})));if(o.length>0&&this.dialog.open(ts,{data:lN(o)}),r.length===0)throw new Error(E1);this.store.dispatch(cd({value:n}));let s=r[0],l=this.state.getValue().files.find(c=>c.file.fileMeta.fileName===s).file.map.name;if(this.store.dispatch(P0({fileNames:r})),pa.updateRoot(l),!a)throw new Error(Dce)}static{this.\u0275fac=function(n){return new(n||i)(Me(Fe),Me(Ai),Me(yn))}}static{this.\u0275prov=Ve({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var kce=/_\d{4}(?:-\d{1,2}){2}_\d{1,2}-\d{1,2}\./,La=(()=>{class i{static{this.JSON_EXTENSION=".json"}static getNewFileName(e,n){return`${this.getFileNameWithoutTimestamp(e,n)}_${this.getNewTimestamp()}`}static getNewTimestamp(){let e=new Date;return i.getFormattedTimestamp(e)}static getFormattedTimestamp(e){return e.toISOString().slice(0,16).replace("T","_").replace(":","-")}static getFileNameWithoutTimestamp(e,n){if(!n){let r=kce.exec(e);if(r)return e.slice(0,r.index);if(e.endsWith(pl.CC_FILE_EXTENSION))return e.slice(0,-pl.CC_FILE_EXTENSION.length);if(e.endsWith(i.JSON_EXTENSION))return e.slice(0,-i.JSON_EXTENSION.length)}return e}static withoutCCExtension(e){return e.replace(/(\.cc)?(\.json)?(\.gz)?$/,"")}}return i})();var Su=class{static downloadCurrentMap(t,e,n,r,o){let a=this.getProjectDataAsCCJsonFormat(t,e,n,r),s=o+pl.CC_FILE_EXTENSION;this.downloadData(JSON.stringify(a),s)}static getProjectDataAsCCJsonFormat(t,e,n,r){return{projectName:e.projectName,apiVersion:e.apiVersion,fileChecksum:e.fileChecksum,nodes:[this.undecorateMap(t)],attributeTypes:r.includes("AttributeTypes")?this.getAttributeTypesForJSON(n.attributeTypes):{},attributeDescriptors:r.includes("AttributeDescriptors")?this.getAttributeDescriptorsForJSON(n.attributeDescriptors):{},edges:r.includes("Edges")?this.undecorateEdges(n.edges):[],markedPackages:r.includes("MarkedPackages")?n.markedPackages:[],blacklist:this.getBlacklistToDownload(r,n.blacklist)}}static getBlacklistToDownload(t,e){let n=[];return t.includes("Flattens")&&n.push(...this.getFilteredBlacklist(e,"flatten").map(r=>({path:r.path,type:"hide"}))),t.includes("Excludes")&&n.push(...this.getFilteredBlacklist(e,"exclude")),n}static getAttributeTypesForJSON(t){return Object.keys(t.edges).length===0&&Object.keys(t.nodes).length===0?{}:t}static getAttributeDescriptorsForJSON(t){return Object.keys(t).length===0?{}:t}static getFilteredBlacklist(t,e){return t.filter(n=>n.type===e)}static undecorateMap(t){let e=Io(t);for(let{data:n}of Ui(e))delete n.isExcluded,delete n.isFlattened,delete n.edgeAttributes,delete n.path,n.type===Zn.FOLDER?n.attributes={}:delete n.attributes[Tp];return e}static undecorateEdges(t){let e=Io(t);for(let n of e)delete n.visible;return e}static downloadData(t,e){let n=new Blob([t],{type:"text/json"}),r=document.createEvent("MouseEvents"),o=document.createElement("a");o.download=e,o.href=window.URL.createObjectURL(n),o.dataset.downloadurl=["text/json",o.download,o.href].join(":"),r.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),o.dispatchEvent(r)}};var Aa=et("SET_STATE",rt());function o6(i){return i.type===Aa.type}var oF=".cc.config.json",Pce="1.0.1",Rce="1.0.1",a6="CodeCharta::customConfigs",Tn=class i{static{this.customConfigs=i.loadCustomConfigsFromLocalStorage()}static{this.customConfigChange$=new Hl(null)}static setCustomConfigsToLocalStorage(){let t={version:Pce,customConfigs:[...i.customConfigs]};localStorage.setItem(a6,JSON.stringify(t,vf)),i.customConfigChange$.next(null)}static loadCustomConfigsFromLocalStorage(){let t=this.getCcLocalStorage();return new Map(t?.customConfigs)}static getCcLocalStorage(){return JSON.parse(localStorage.getItem(a6),OT)}static addCustomConfig(t){i.customConfigs.set(t.id,t),i.setCustomConfigsToLocalStorage()}static editCustomConfigNote(t,e){let n=i.customConfigs.get(t);n.note=e,i.customConfigs.set(t,n),i.setCustomConfigsToLocalStorage()}static getCustomConfigSettings(t){return i.customConfigs.get(t)}static hasCustomConfigByName(t,e,n){for(let r of i.customConfigs.values())if(r.name===n&&r.mapSelectionMode===t&&this.areEqual(e,r.assignedMaps))return!0;return!1}static areEqual(t,e){return t.size!==e.size?!1:[...t.entries()].every(([n,r])=>e.has(n)&&e.get(n)===r)}static getCustomConfigs(){return i.customConfigs}static importCustomConfigs(t){let e=JSON.parse(t,OT);for(let n of e.customConfigs.values()){if(i.getCustomConfigSettings(n.id))continue;i.hasCustomConfigByName(n.mapSelectionMode,n.assignedMaps,n.name)&&(n.name+=` (${La.getFormattedTimestamp(new Date(n.creationTime))})`);let o=$e({id:n.id,name:n.name,creationTime:n.creationTime,assignedMaps:n.assignedMaps,customConfigVersion:n.customConfigVersion,mapSelectionMode:n.mapSelectionMode,stateSettings:n.stateSettings,camera:n.camera},n.note&&{note:n.note});i.addCustomConfig(o)}}static downloadCustomConfigs(t){let e={downloadApiVersion:Rce,timestamp:Date.now(),customConfigs:t},n=La.getNewTimestamp()+oF;Su.downloadData(JSON.stringify(e,vf),n)}static createExportCustomConfigFromConfig(t){return $e({},t)}static getCustomConfigsAmountByMapAndMode(t,e){let n=0;for(let r of i.customConfigs.values())[...r.assignedMaps.values()].join(" ")===t&&r.mapSelectionMode===e&&n++;return n}static getConfigNameSuggestionByFileState({mapSelectionMode:t,assignedMaps:e}){let n=[...e.values()].join(" "),r=i.getCustomConfigsAmountByMapAndMode(n,t)+1;return`${n} #${r}`}static deleteCustomConfigs(t){for(let e of t)i.customConfigs.delete(e.id);i.setCustomConfigsToLocalStorage()}static deleteCustomConfig(t){i.customConfigs.delete(t),i.setCustomConfigsToLocalStorage()}static sortCustomConfigDropDownGroupList(t,e){if(!e.hasApplicableItems){if(t.hasApplicableItems||t.mapSelectionMode<e.mapSelectionMode)return-1;if(t.mapSelectionMode===e.mapSelectionMode)return 0}return 1}static applyCustomConfig(t,e,n,r,o){let a=this.getCustomConfigSettings(t);e.dispatch(Aa({value:a.stateSettings})),a.camera&&(n.setPosition(a.camera.camera),r.setControlTarget(a.camera.cameraTarget)),o.render()}};var T1=()=>{let i=document.createElement("INPUT");return i.setAttribute("type","file"),i.setAttribute("accept",".json,.gz"),i.setAttribute("multiple",""),document.body.appendChild(i),i};var c6=rl(e1());var Bp="base";function d6(i){let{gameObjectPositions:t,cycles:e=[]}=JSON.parse(i),n={checksum:"",data:{projectName:"GameObjects",fileChecksum:"",apiVersion:"1.3",nodes:[]}},r=[{name:Bp,type:Zn.FOLDER,attributes:{},children:[]}];Oce(t);let o=t.find(s=>s.name==="root"),a=zce(o.scale);t.push(a);for(let s of t){let l=s.name.split(".");l[0]!==Bp&&u6(l,r[0].children,Bp,s,t,o)}return n.data.nodes=r,n.data.edges=e.map(s=>Vce(s)),n.data.attributeTypes=Qce(),n.checksum=(0,c6.default)(JSON.stringify(n.data)),n}function Oce(i){for(let t of i)t.name.startsWith("root")||(t.name=t.name.startsWith(".")?`root${t.name}`:`root.${t.name}`)}function u6(i,t,e,n,r,o){if(i.length===0)return;let[a]=i,s={name:a,type:s6(i)?Zn.FILE:Zn.FOLDER,attributes:{}};s6(i)?s=Nce(a,s,n):s.children=[],Lce(t,a)?s=t.find(d=>d.name===a):t.push(s);let l=r.find(d=>d.name===e);s.fixedPosition=Uce(s,l,n,o.name);let c=e===Bp?s.name:`${e}.${s.name}`;u6(i.slice(1),s.children,c,n,r,o)}function s6(i){return i.length===1}function Lce(i,t){return i.some(e=>e.name===t)}function Nce(i,t,e){let n=$e({},t);return n.attributes={height:e.scale.y},{name:i,type:Zn.FOLDER,attributes:{},children:[n]}}function Uce(i,t,e,n){let r;if(i.type===Zn.FOLDER){let o=t.position.x-t.scale.x/2,a=t.position.z-t.scale.z/2,s=e.position.x-e.scale.x/2,l=e.position.z-e.scale.z/2,c=B1((s-o)/t.scale.x*100,2),d=B1((l-a)/t.scale.z*100,2),h=B1(e.scale.z/t.scale.z*100,2),u=B1(e.scale.x/t.scale.x*100,2);r={left:d,top:c,width:h,height:u}}return i.name===n&&(r=Hce(r)),r}function B1(i,t){let e=Math.pow(10,t);return Math.round(i*e)/e}function Hce(i){let t=$e({},i);return t.top=Math.floor(50-t.height/2),t.left=Math.floor(50-t.width/2),t}function l6(i){let t=i.replaceAll(".","/"),n=i.split(".").slice(-1);return`/${Bp}/${t}/${n}`}function Vce(i){return{fromNodeName:l6(i.from),toNodeName:l6(i.to),attributes:{coupling:100}}}function Qce(){return{edges:{coupling:dl.relative}}}function zce(i){let t=Math.max(i.x,i.z);return{name:Bp,position:{x:0,y:0,z:0},scale:{x:t,y:0,z:t}}}var f6=rl(qB());var h6={$id:"http://example.com/example.json",$schema:"http://json-schema.org/draft-07/schema",default:{},description:"This is the JSON Schema for the GameObjectsPositions structure",examples:[{gameObjectPositions:[{name:"root.analysis.import.SourceCodeParser.src.test.kotlin.de.maibornwolff.codecharta.analysis.importer.sourcecodeparser.oop.core.extract.HelloWorldTest",position:{x:69,y:18.5,z:228.5},scale:{x:9,y:5,z:9}},{name:"root.analysis.import.SourceCodeParser.src.test.kotlin.de.maibornwolff.codecharta.analysis.importer.sourcecodeparser.oop.core.extract.TryCatchFinallyTest",position:{x:66,y:22.5,z:177.5},scale:{x:1,y:13,z:1}}],cycles:[{from:"root.analysis.import.SCMLogParser.src.main.java.de.maibornwolff.codecharta.analysis.importer.scmlogparser.SCMLogParser",to:"root.analysis.import.SCMLogParser.src.main.java.de.maibornwolff.codecharta.analysis.importer.scmlogparser.SCMLogParserParameter"}]}],required:["gameObjectPositions"],title:"The root schema",type:"object",properties:{gameObjectPositions:{$id:"#/properties/gameObjectPositions",type:"array",title:"The gameObjectPositions schema",description:"Defines the position and scale of GameObjects",default:[],examples:[[{name:"root.analysis.import.SourceCodeParser.src.test.kotlin.de.maibornwolff.codecharta.analysis.importer.sourcecodeparser.oop.core.extract.HelloWorldTest",position:{x:69,y:18.5,z:228.5},scale:{x:9,y:5,z:9}},{name:"root.analysis.import.SourceCodeParser.src.test.kotlin.de.maibornwolff.codecharta.analysis.importer.sourcecodeparser.oop.core.extract.SwitchCaseTest",position:{x:65,y:22,z:181},scale:{x:2,y:12,z:2}}]],additionalItems:!0,items:{$id:"#/properties/gameObjectPositions/items",anyOf:[{$id:"#/properties/gameObjectPositions/items/anyOf/0",type:"object",title:"The first anyOf schema",description:"Defines the properties of a GameObject",default:{},examples:[{name:"root.analysis.import.SourceCodeParser.src.test.kotlin.de.maibornwolff.codecharta.analysis.importer.sourcecodeparser.oop.core.extract.HelloWorldTest",position:{x:69,y:18.5,z:228.5},scale:{x:9,y:5,z:9}}],required:["name","position","scale"],properties:{name:{$id:"#/properties/gameObjectPositions/items/anyOf/0/properties/name",type:"string",title:"The name schema",description:"An explanation about the purpose of this instance.",default:"",examples:["root.analysis.import.SourceCodeParser.src.test.kotlin.de.maibornwolff.codecharta.analysis.importer.sourcecodeparser.oop.core.extract.HelloWorldTest"]},position:{$id:"#/properties/gameObjectPositions/items/anyOf/0/properties/position",type:"object",title:"The position schema",description:"The position in absolute values",default:{},examples:[{x:69,y:18.5,z:228.5}],required:["x","y","z"],properties:{x:{$id:"#/properties/gameObjectPositions/items/anyOf/0/properties/position/properties/x",type:"number",title:"The x schema",description:"x position",default:0,examples:[69]},y:{$id:"#/properties/gameObjectPositions/items/anyOf/0/properties/position/properties/y",type:"number",title:"The y schema",description:"y position",default:0,examples:[18.5]},z:{$id:"#/properties/gameObjectPositions/items/anyOf/0/properties/position/properties/z",type:"number",title:"The z schema",description:"z position",default:0,examples:[228.5]}},additionalProperties:!0},scale:{$id:"#/properties/gameObjectPositions/items/anyOf/0/properties/scale",type:"object",title:"The scale schema",description:"The scale of GameObjects",default:{},examples:[{x:9,y:5,z:9}],required:["x","y","z"],properties:{x:{$id:"#/properties/gameObjectPositions/items/anyOf/0/properties/scale/properties/x",type:"number",title:"The x schema",description:"x scale",default:0,examples:[9]},y:{$id:"#/properties/gameObjectPositions/items/anyOf/0/properties/scale/properties/y",type:"number",title:"The y schema",description:"y scale",default:0,examples:[5]},z:{$id:"#/properties/gameObjectPositions/items/anyOf/0/properties/scale/properties/z",type:"number",title:"The z schema",description:"z scale",default:0,examples:[9]}},additionalProperties:!0}},additionalProperties:!0}]}},cycles:{$id:"#/properties/cycles",type:"array",title:"The cycles schema",description:"Defines the cycles between GameObjects",default:[],examples:[[{from:"root.analysis.import.SCMLogParser.src.main.java.de.maibornwolff.codecharta.analysis.importer.scmlogparser.SCMLogParser",to:"root.analysis.import.SCMLogParser.src.main.java.de.maibornwolff.codecharta.analysis.importer.scmlogparser.SCMLogParserParameter"}]],additionalItems:!0,items:{$id:"#/properties/cycles/items",anyOf:[{$id:"#/properties/cycles/items/anyOf/0",type:"object",title:"The first anyOf schema",description:"A cycle between two GameObjects",default:{},examples:[{from:"root.analysis.import.SCMLogParser.src.main.java.de.maibornwolff.codecharta.analysis.importer.scmlogparser.SCMLogParser",to:"root.analysis.import.SCMLogParser.src.main.java.de.maibornwolff.codecharta.analysis.importer.scmlogparser.SCMLogParserParameter"}],required:["from","to"],properties:{from:{$id:"#/properties/cycles/items/anyOf/0/properties/from",type:"string",title:"The from schema",description:"from GameObject",default:"",examples:["root.analysis.import.SCMLogParser.src.main.java.de.maibornwolff.codecharta.analysis.importer.scmlogparser.SCMLogParser"]},to:{$id:"#/properties/cycles/items/anyOf/0/properties/to",type:"string",title:"The to schema",description:"to GameObject",default:"",examples:["root.analysis.import.SCMLogParser.src.main.java.de.maibornwolff.codecharta.analysis.importer.scmlogparser.SCMLogParserParameter"]}},additionalProperties:!0}]}}},additionalProperties:!0};function m6(i){return new f6.default({allErrors:!0}).validate(h6,JSON.parse(i))}function Rp(i){let t=i.length;for(;--t>=0;)i[t]=0}var Gce=0,J6=1,Wce=2,jce=3,$ce=258,BF=29,A_=256,l_=A_+1+BF,Dp=30,FF=19,e7=2*l_+1,Lf=15,aF=16,Xce=7,IF=256,t7=16,i7=17,n7=18,vF=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),R1=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),Kce=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),r7=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Yce=512,gd=new Array((l_+2)*2);Rp(gd);var o_=new Array(Dp*2);Rp(o_);var c_=new Array(Yce);Rp(c_);var d_=new Array($ce-jce+1);Rp(d_);var DF=new Array(BF);Rp(DF);var O1=new Array(Dp);Rp(O1);function sF(i,t,e,n,r){this.static_tree=i,this.extra_bits=t,this.extra_base=e,this.elems=n,this.max_length=r,this.has_stree=i&&i.length}var o7,a7,s7;function lF(i,t){this.dyn_tree=i,this.max_code=0,this.stat_desc=t}var l7=i=>i<256?c_[i]:c_[256+(i>>>7)],u_=(i,t)=>{i.pending_buf[i.pending++]=t&255,i.pending_buf[i.pending++]=t>>>8&255},Na=(i,t,e)=>{i.bi_valid>aF-e?(i.bi_buf|=t<<i.bi_valid&65535,u_(i,i.bi_buf),i.bi_buf=t>>aF-i.bi_valid,i.bi_valid+=e-aF):(i.bi_buf|=t<<i.bi_valid&65535,i.bi_valid+=e)},nc=(i,t,e)=>{Na(i,e[t*2],e[t*2+1])},c7=(i,t)=>{let e=0;do e|=i&1,i>>>=1,e<<=1;while(--t>0);return e>>>1},Zce=i=>{i.bi_valid===16?(u_(i,i.bi_buf),i.bi_buf=0,i.bi_valid=0):i.bi_valid>=8&&(i.pending_buf[i.pending++]=i.bi_buf&255,i.bi_buf>>=8,i.bi_valid-=8)},Jce=(i,t)=>{let e=t.dyn_tree,n=t.max_code,r=t.stat_desc.static_tree,o=t.stat_desc.has_stree,a=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,l=t.stat_desc.max_length,c,d,h,u,f,_,y=0;for(u=0;u<=Lf;u++)i.bl_count[u]=0;for(e[i.heap[i.heap_max]*2+1]=0,c=i.heap_max+1;c<e7;c++)d=i.heap[c],u=e[e[d*2+1]*2+1]+1,u>l&&(u=l,y++),e[d*2+1]=u,!(d>n)&&(i.bl_count[u]++,f=0,d>=s&&(f=a[d-s]),_=e[d*2],i.opt_len+=_*(u+f),o&&(i.static_len+=_*(r[d*2+1]+f)));if(y!==0){do{for(u=l-1;i.bl_count[u]===0;)u--;i.bl_count[u]--,i.bl_count[u+1]+=2,i.bl_count[l]--,y-=2}while(y>0);for(u=l;u!==0;u--)for(d=i.bl_count[u];d!==0;)h=i.heap[--c],!(h>n)&&(e[h*2+1]!==u&&(i.opt_len+=(u-e[h*2+1])*e[h*2],e[h*2+1]=u),d--)}},d7=(i,t,e)=>{let n=new Array(Lf+1),r=0,o,a;for(o=1;o<=Lf;o++)r=r+e[o-1]<<1,n[o]=r;for(a=0;a<=t;a++){let s=i[a*2+1];s!==0&&(i[a*2]=c7(n[s]++,s))}},ede=()=>{let i,t,e,n,r,o=new Array(Lf+1);for(e=0,n=0;n<BF-1;n++)for(DF[n]=e,i=0;i<1<<vF[n];i++)d_[e++]=n;for(d_[e-1]=n,r=0,n=0;n<16;n++)for(O1[n]=r,i=0;i<1<<R1[n];i++)c_[r++]=n;for(r>>=7;n<Dp;n++)for(O1[n]=r<<7,i=0;i<1<<R1[n]-7;i++)c_[256+r++]=n;for(t=0;t<=Lf;t++)o[t]=0;for(i=0;i<=143;)gd[i*2+1]=8,i++,o[8]++;for(;i<=255;)gd[i*2+1]=9,i++,o[9]++;for(;i<=279;)gd[i*2+1]=7,i++,o[7]++;for(;i<=287;)gd[i*2+1]=8,i++,o[8]++;for(d7(gd,l_+1,o),i=0;i<Dp;i++)o_[i*2+1]=5,o_[i*2]=c7(i,5);o7=new sF(gd,vF,A_+1,l_,Lf),a7=new sF(o_,R1,0,Dp,Lf),s7=new sF(new Array(0),Kce,0,FF,Xce)},u7=i=>{let t;for(t=0;t<l_;t++)i.dyn_ltree[t*2]=0;for(t=0;t<Dp;t++)i.dyn_dtree[t*2]=0;for(t=0;t<FF;t++)i.bl_tree[t*2]=0;i.dyn_ltree[IF*2]=1,i.opt_len=i.static_len=0,i.sym_next=i.matches=0},h7=i=>{i.bi_valid>8?u_(i,i.bi_buf):i.bi_valid>0&&(i.pending_buf[i.pending++]=i.bi_buf),i.bi_buf=0,i.bi_valid=0},p6=(i,t,e,n)=>{let r=t*2,o=e*2;return i[r]<i[o]||i[r]===i[o]&&n[t]<=n[e]},cF=(i,t,e)=>{let n=i.heap[e],r=e<<1;for(;r<=i.heap_len&&(r<i.heap_len&&p6(t,i.heap[r+1],i.heap[r],i.depth)&&r++,!p6(t,n,i.heap[r],i.depth));)i.heap[e]=i.heap[r],e=r,r<<=1;i.heap[e]=n},A6=(i,t,e)=>{let n,r,o=0,a,s;if(i.sym_next!==0)do n=i.pending_buf[i.sym_buf+o++]&255,n+=(i.pending_buf[i.sym_buf+o++]&255)<<8,r=i.pending_buf[i.sym_buf+o++],n===0?nc(i,r,t):(a=d_[r],nc(i,a+A_+1,t),s=vF[a],s!==0&&(r-=DF[a],Na(i,r,s)),n--,a=l7(n),nc(i,a,e),s=R1[a],s!==0&&(n-=O1[a],Na(i,n,s)));while(o<i.sym_next);nc(i,IF,t)},yF=(i,t)=>{let e=t.dyn_tree,n=t.stat_desc.static_tree,r=t.stat_desc.has_stree,o=t.stat_desc.elems,a,s,l=-1,c;for(i.heap_len=0,i.heap_max=e7,a=0;a<o;a++)e[a*2]!==0?(i.heap[++i.heap_len]=l=a,i.depth[a]=0):e[a*2+1]=0;for(;i.heap_len<2;)c=i.heap[++i.heap_len]=l<2?++l:0,e[c*2]=1,i.depth[c]=0,i.opt_len--,r&&(i.static_len-=n[c*2+1]);for(t.max_code=l,a=i.heap_len>>1;a>=1;a--)cF(i,e,a);c=o;do a=i.heap[1],i.heap[1]=i.heap[i.heap_len--],cF(i,e,1),s=i.heap[1],i.heap[--i.heap_max]=a,i.heap[--i.heap_max]=s,e[c*2]=e[a*2]+e[s*2],i.depth[c]=(i.depth[a]>=i.depth[s]?i.depth[a]:i.depth[s])+1,e[a*2+1]=e[s*2+1]=c,i.heap[1]=c++,cF(i,e,1);while(i.heap_len>=2);i.heap[--i.heap_max]=i.heap[1],Jce(i,t),d7(e,l,i.bl_count)},g6=(i,t,e)=>{let n,r=-1,o,a=t[1],s=0,l=7,c=4;for(a===0&&(l=138,c=3),t[(e+1)*2+1]=65535,n=0;n<=e;n++)o=a,a=t[(n+1)*2+1],!(++s<l&&o===a)&&(s<c?i.bl_tree[o*2]+=s:o!==0?(o!==r&&i.bl_tree[o*2]++,i.bl_tree[t7*2]++):s<=10?i.bl_tree[i7*2]++:i.bl_tree[n7*2]++,s=0,r=o,a===0?(l=138,c=3):o===a?(l=6,c=3):(l=7,c=4))},_6=(i,t,e)=>{let n,r=-1,o,a=t[1],s=0,l=7,c=4;for(a===0&&(l=138,c=3),n=0;n<=e;n++)if(o=a,a=t[(n+1)*2+1],!(++s<l&&o===a)){if(s<c)do nc(i,o,i.bl_tree);while(--s!==0);else o!==0?(o!==r&&(nc(i,o,i.bl_tree),s--),nc(i,t7,i.bl_tree),Na(i,s-3,2)):s<=10?(nc(i,i7,i.bl_tree),Na(i,s-3,3)):(nc(i,n7,i.bl_tree),Na(i,s-11,7));s=0,r=o,a===0?(l=138,c=3):o===a?(l=6,c=3):(l=7,c=4)}},tde=i=>{let t;for(g6(i,i.dyn_ltree,i.l_desc.max_code),g6(i,i.dyn_dtree,i.d_desc.max_code),yF(i,i.bl_desc),t=FF-1;t>=3&&i.bl_tree[r7[t]*2+1]===0;t--);return i.opt_len+=3*(t+1)+5+5+4,t},ide=(i,t,e,n)=>{let r;for(Na(i,t-257,5),Na(i,e-1,5),Na(i,n-4,4),r=0;r<n;r++)Na(i,i.bl_tree[r7[r]*2+1],3);_6(i,i.dyn_ltree,t-1),_6(i,i.dyn_dtree,e-1)},nde=i=>{let t=4093624447,e;for(e=0;e<=31;e++,t>>>=1)if(t&1&&i.dyn_ltree[e*2]!==0)return 0;if(i.dyn_ltree[18]!==0||i.dyn_ltree[20]!==0||i.dyn_ltree[26]!==0)return 1;for(e=32;e<A_;e++)if(i.dyn_ltree[e*2]!==0)return 1;return 0},b6=!1,rde=i=>{b6||(ede(),b6=!0),i.l_desc=new lF(i.dyn_ltree,o7),i.d_desc=new lF(i.dyn_dtree,a7),i.bl_desc=new lF(i.bl_tree,s7),i.bi_buf=0,i.bi_valid=0,u7(i)},f7=(i,t,e,n)=>{Na(i,(Gce<<1)+(n?1:0),3),h7(i),u_(i,e),u_(i,~e),e&&i.pending_buf.set(i.window.subarray(t,t+e),i.pending),i.pending+=e},ode=i=>{Na(i,J6<<1,3),nc(i,IF,gd),Zce(i)},ade=(i,t,e,n)=>{let r,o,a=0;i.level>0?(i.strm.data_type===2&&(i.strm.data_type=nde(i)),yF(i,i.l_desc),yF(i,i.d_desc),a=tde(i),r=i.opt_len+3+7>>>3,o=i.static_len+3+7>>>3,o<=r&&(r=o)):r=o=e+5,e+4<=r&&t!==-1?f7(i,t,e,n):i.strategy===4||o===r?(Na(i,(J6<<1)+(n?1:0),3),A6(i,gd,o_)):(Na(i,(Wce<<1)+(n?1:0),3),ide(i,i.l_desc.max_code+1,i.d_desc.max_code+1,a+1),A6(i,i.dyn_ltree,i.dyn_dtree)),u7(i),n&&h7(i)},sde=(i,t,e)=>(i.pending_buf[i.sym_buf+i.sym_next++]=t,i.pending_buf[i.sym_buf+i.sym_next++]=t>>8,i.pending_buf[i.sym_buf+i.sym_next++]=e,t===0?i.dyn_ltree[e*2]++:(i.matches++,t--,i.dyn_ltree[(d_[e]+A_+1)*2]++,i.dyn_dtree[l7(t)*2]++),i.sym_next===i.sym_end),lde=rde,cde=f7,dde=ade,ude=sde,hde=ode,fde={_tr_init:lde,_tr_stored_block:cde,_tr_flush_block:dde,_tr_tally:ude,_tr_align:hde},mde=(i,t,e,n)=>{let r=i&65535|0,o=i>>>16&65535|0,a=0;for(;e!==0;){a=e>2e3?2e3:e,e-=a;do r=r+t[n++]|0,o=o+r|0;while(--a);r%=65521,o%=65521}return r|o<<16|0},h_=mde,pde=()=>{let i,t=[];for(var e=0;e<256;e++){i=e;for(var n=0;n<8;n++)i=i&1?3988292384^i>>>1:i>>>1;t[e]=i}return t},Ade=new Uint32Array(pde()),gde=(i,t,e,n)=>{let r=Ade,o=n+e;i^=-1;for(let a=n;a<o;a++)i=i>>>8^r[(i^t[a])&255];return i^-1},go=gde,Hf={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Op={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},{_tr_init:_de,_tr_stored_block:xF,_tr_flush_block:bde,_tr_tally:Bu,_tr_align:vde}=fde,{Z_NO_FLUSH:Fu,Z_PARTIAL_FLUSH:yde,Z_FULL_FLUSH:xde,Z_FINISH:Ds,Z_BLOCK:v6,Z_OK:Do,Z_STREAM_END:y6,Z_STREAM_ERROR:rc,Z_DATA_ERROR:wde,Z_BUF_ERROR:dF,Z_DEFAULT_COMPRESSION:Cde,Z_FILTERED:Mde,Z_HUFFMAN_ONLY:F1,Z_RLE:Sde,Z_FIXED:Ede,Z_DEFAULT_STRATEGY:Tde,Z_UNKNOWN:Bde,Z_DEFLATED:U1}=Op,Fde=9,Ide=15,Dde=8,kde=29,Pde=256,wF=Pde+1+kde,Rde=30,Ode=19,Lde=2*wF+1,Nde=15,fn=3,Tu=258,oc=Tu+fn+1,Ude=32,kp=42,kF=57,CF=69,MF=73,SF=91,EF=103,Nf=113,n_=666,ga=1,Lp=2,Vf=3,Np=4,Hde=3,Uf=(i,t)=>(i.msg=Hf[t],t),x6=i=>i*2-(i>4?9:0),Eu=i=>{let t=i.length;for(;--t>=0;)i[t]=0},Vde=i=>{let t,e,n,r=i.w_size;t=i.hash_size,n=t;do e=i.head[--n],i.head[n]=e>=r?e-r:0;while(--t);t=r,n=t;do e=i.prev[--n],i.prev[n]=e>=r?e-r:0;while(--t)},Qde=(i,t,e)=>(t<<i.hash_shift^e)&i.hash_mask,Iu=Qde,is=i=>{let t=i.state,e=t.pending;e>i.avail_out&&(e=i.avail_out),e!==0&&(i.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+e),i.next_out),i.next_out+=e,t.pending_out+=e,i.total_out+=e,i.avail_out-=e,t.pending-=e,t.pending===0&&(t.pending_out=0))},ns=(i,t)=>{bde(i,i.block_start>=0?i.block_start:-1,i.strstart-i.block_start,t),i.block_start=i.strstart,is(i.strm)},Bn=(i,t)=>{i.pending_buf[i.pending++]=t},i_=(i,t)=>{i.pending_buf[i.pending++]=t>>>8&255,i.pending_buf[i.pending++]=t&255},TF=(i,t,e,n)=>{let r=i.avail_in;return r>n&&(r=n),r===0?0:(i.avail_in-=r,t.set(i.input.subarray(i.next_in,i.next_in+r),e),i.state.wrap===1?i.adler=h_(i.adler,t,r,e):i.state.wrap===2&&(i.adler=go(i.adler,t,r,e)),i.next_in+=r,i.total_in+=r,r)},m7=(i,t)=>{let e=i.max_chain_length,n=i.strstart,r,o,a=i.prev_length,s=i.nice_match,l=i.strstart>i.w_size-oc?i.strstart-(i.w_size-oc):0,c=i.window,d=i.w_mask,h=i.prev,u=i.strstart+Tu,f=c[n+a-1],_=c[n+a];i.prev_length>=i.good_match&&(e>>=2),s>i.lookahead&&(s=i.lookahead);do if(r=t,!(c[r+a]!==_||c[r+a-1]!==f||c[r]!==c[n]||c[++r]!==c[n+1])){n+=2,r++;do;while(c[++n]===c[++r]&&c[++n]===c[++r]&&c[++n]===c[++r]&&c[++n]===c[++r]&&c[++n]===c[++r]&&c[++n]===c[++r]&&c[++n]===c[++r]&&c[++n]===c[++r]&&n<u);if(o=Tu-(u-n),n=u-Tu,o>a){if(i.match_start=t,a=o,o>=s)break;f=c[n+a-1],_=c[n+a]}}while((t=h[t&d])>l&&--e!==0);return a<=i.lookahead?a:i.lookahead},Pp=i=>{let t=i.w_size,e,n,r;do{if(n=i.window_size-i.lookahead-i.strstart,i.strstart>=t+(t-oc)&&(i.window.set(i.window.subarray(t,t+t-n),0),i.match_start-=t,i.strstart-=t,i.block_start-=t,i.insert>i.strstart&&(i.insert=i.strstart),Vde(i),n+=t),i.strm.avail_in===0)break;if(e=TF(i.strm,i.window,i.strstart+i.lookahead,n),i.lookahead+=e,i.lookahead+i.insert>=fn)for(r=i.strstart-i.insert,i.ins_h=i.window[r],i.ins_h=Iu(i,i.ins_h,i.window[r+1]);i.insert&&(i.ins_h=Iu(i,i.ins_h,i.window[r+fn-1]),i.prev[r&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=r,r++,i.insert--,!(i.lookahead+i.insert<fn)););}while(i.lookahead<oc&&i.strm.avail_in!==0)},p7=(i,t)=>{let e=i.pending_buf_size-5>i.w_size?i.w_size:i.pending_buf_size-5,n,r,o,a=0,s=i.strm.avail_in;do{if(n=65535,o=i.bi_valid+42>>3,i.strm.avail_out<o||(o=i.strm.avail_out-o,r=i.strstart-i.block_start,n>r+i.strm.avail_in&&(n=r+i.strm.avail_in),n>o&&(n=o),n<e&&(n===0&&t!==Ds||t===Fu||n!==r+i.strm.avail_in)))break;a=t===Ds&&n===r+i.strm.avail_in?1:0,xF(i,0,0,a),i.pending_buf[i.pending-4]=n,i.pending_buf[i.pending-3]=n>>8,i.pending_buf[i.pending-2]=~n,i.pending_buf[i.pending-1]=~n>>8,is(i.strm),r&&(r>n&&(r=n),i.strm.output.set(i.window.subarray(i.block_start,i.block_start+r),i.strm.next_out),i.strm.next_out+=r,i.strm.avail_out-=r,i.strm.total_out+=r,i.block_start+=r,n-=r),n&&(TF(i.strm,i.strm.output,i.strm.next_out,n),i.strm.next_out+=n,i.strm.avail_out-=n,i.strm.total_out+=n)}while(a===0);return s-=i.strm.avail_in,s&&(s>=i.w_size?(i.matches=2,i.window.set(i.strm.input.subarray(i.strm.next_in-i.w_size,i.strm.next_in),0),i.strstart=i.w_size,i.insert=i.strstart):(i.window_size-i.strstart<=s&&(i.strstart-=i.w_size,i.window.set(i.window.subarray(i.w_size,i.w_size+i.strstart),0),i.matches<2&&i.matches++,i.insert>i.strstart&&(i.insert=i.strstart)),i.window.set(i.strm.input.subarray(i.strm.next_in-s,i.strm.next_in),i.strstart),i.strstart+=s,i.insert+=s>i.w_size-i.insert?i.w_size-i.insert:s),i.block_start=i.strstart),i.high_water<i.strstart&&(i.high_water=i.strstart),a?Np:t!==Fu&&t!==Ds&&i.strm.avail_in===0&&i.strstart===i.block_start?Lp:(o=i.window_size-i.strstart,i.strm.avail_in>o&&i.block_start>=i.w_size&&(i.block_start-=i.w_size,i.strstart-=i.w_size,i.window.set(i.window.subarray(i.w_size,i.w_size+i.strstart),0),i.matches<2&&i.matches++,o+=i.w_size,i.insert>i.strstart&&(i.insert=i.strstart)),o>i.strm.avail_in&&(o=i.strm.avail_in),o&&(TF(i.strm,i.window,i.strstart,o),i.strstart+=o,i.insert+=o>i.w_size-i.insert?i.w_size-i.insert:o),i.high_water<i.strstart&&(i.high_water=i.strstart),o=i.bi_valid+42>>3,o=i.pending_buf_size-o>65535?65535:i.pending_buf_size-o,e=o>i.w_size?i.w_size:o,r=i.strstart-i.block_start,(r>=e||(r||t===Ds)&&t!==Fu&&i.strm.avail_in===0&&r<=o)&&(n=r>o?o:r,a=t===Ds&&i.strm.avail_in===0&&n===r?1:0,xF(i,i.block_start,n,a),i.block_start+=n,is(i.strm)),a?Vf:ga)},uF=(i,t)=>{let e,n;for(;;){if(i.lookahead<oc){if(Pp(i),i.lookahead<oc&&t===Fu)return ga;if(i.lookahead===0)break}if(e=0,i.lookahead>=fn&&(i.ins_h=Iu(i,i.ins_h,i.window[i.strstart+fn-1]),e=i.prev[i.strstart&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=i.strstart),e!==0&&i.strstart-e<=i.w_size-oc&&(i.match_length=m7(i,e)),i.match_length>=fn)if(n=Bu(i,i.strstart-i.match_start,i.match_length-fn),i.lookahead-=i.match_length,i.match_length<=i.max_lazy_match&&i.lookahead>=fn){i.match_length--;do i.strstart++,i.ins_h=Iu(i,i.ins_h,i.window[i.strstart+fn-1]),e=i.prev[i.strstart&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=i.strstart;while(--i.match_length!==0);i.strstart++}else i.strstart+=i.match_length,i.match_length=0,i.ins_h=i.window[i.strstart],i.ins_h=Iu(i,i.ins_h,i.window[i.strstart+1]);else n=Bu(i,0,i.window[i.strstart]),i.lookahead--,i.strstart++;if(n&&(ns(i,!1),i.strm.avail_out===0))return ga}return i.insert=i.strstart<fn-1?i.strstart:fn-1,t===Ds?(ns(i,!0),i.strm.avail_out===0?Vf:Np):i.sym_next&&(ns(i,!1),i.strm.avail_out===0)?ga:Lp},Fp=(i,t)=>{let e,n,r;for(;;){if(i.lookahead<oc){if(Pp(i),i.lookahead<oc&&t===Fu)return ga;if(i.lookahead===0)break}if(e=0,i.lookahead>=fn&&(i.ins_h=Iu(i,i.ins_h,i.window[i.strstart+fn-1]),e=i.prev[i.strstart&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=i.strstart),i.prev_length=i.match_length,i.prev_match=i.match_start,i.match_length=fn-1,e!==0&&i.prev_length<i.max_lazy_match&&i.strstart-e<=i.w_size-oc&&(i.match_length=m7(i,e),i.match_length<=5&&(i.strategy===Mde||i.match_length===fn&&i.strstart-i.match_start>4096)&&(i.match_length=fn-1)),i.prev_length>=fn&&i.match_length<=i.prev_length){r=i.strstart+i.lookahead-fn,n=Bu(i,i.strstart-1-i.prev_match,i.prev_length-fn),i.lookahead-=i.prev_length-1,i.prev_length-=2;do++i.strstart<=r&&(i.ins_h=Iu(i,i.ins_h,i.window[i.strstart+fn-1]),e=i.prev[i.strstart&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=i.strstart);while(--i.prev_length!==0);if(i.match_available=0,i.match_length=fn-1,i.strstart++,n&&(ns(i,!1),i.strm.avail_out===0))return ga}else if(i.match_available){if(n=Bu(i,0,i.window[i.strstart-1]),n&&ns(i,!1),i.strstart++,i.lookahead--,i.strm.avail_out===0)return ga}else i.match_available=1,i.strstart++,i.lookahead--}return i.match_available&&(n=Bu(i,0,i.window[i.strstart-1]),i.match_available=0),i.insert=i.strstart<fn-1?i.strstart:fn-1,t===Ds?(ns(i,!0),i.strm.avail_out===0?Vf:Np):i.sym_next&&(ns(i,!1),i.strm.avail_out===0)?ga:Lp},zde=(i,t)=>{let e,n,r,o,a=i.window;for(;;){if(i.lookahead<=Tu){if(Pp(i),i.lookahead<=Tu&&t===Fu)return ga;if(i.lookahead===0)break}if(i.match_length=0,i.lookahead>=fn&&i.strstart>0&&(r=i.strstart-1,n=a[r],n===a[++r]&&n===a[++r]&&n===a[++r])){o=i.strstart+Tu;do;while(n===a[++r]&&n===a[++r]&&n===a[++r]&&n===a[++r]&&n===a[++r]&&n===a[++r]&&n===a[++r]&&n===a[++r]&&r<o);i.match_length=Tu-(o-r),i.match_length>i.lookahead&&(i.match_length=i.lookahead)}if(i.match_length>=fn?(e=Bu(i,1,i.match_length-fn),i.lookahead-=i.match_length,i.strstart+=i.match_length,i.match_length=0):(e=Bu(i,0,i.window[i.strstart]),i.lookahead--,i.strstart++),e&&(ns(i,!1),i.strm.avail_out===0))return ga}return i.insert=0,t===Ds?(ns(i,!0),i.strm.avail_out===0?Vf:Np):i.sym_next&&(ns(i,!1),i.strm.avail_out===0)?ga:Lp},qde=(i,t)=>{let e;for(;;){if(i.lookahead===0&&(Pp(i),i.lookahead===0)){if(t===Fu)return ga;break}if(i.match_length=0,e=Bu(i,0,i.window[i.strstart]),i.lookahead--,i.strstart++,e&&(ns(i,!1),i.strm.avail_out===0))return ga}return i.insert=0,t===Ds?(ns(i,!0),i.strm.avail_out===0?Vf:Np):i.sym_next&&(ns(i,!1),i.strm.avail_out===0)?ga:Lp};function ic(i,t,e,n,r){this.good_length=i,this.max_lazy=t,this.nice_length=e,this.max_chain=n,this.func=r}var r_=[new ic(0,0,0,0,p7),new ic(4,4,8,4,uF),new ic(4,5,16,8,uF),new ic(4,6,32,32,uF),new ic(4,4,16,16,Fp),new ic(8,16,32,32,Fp),new ic(8,16,128,128,Fp),new ic(8,32,128,256,Fp),new ic(32,128,258,1024,Fp),new ic(32,258,258,4096,Fp)],Gde=i=>{i.window_size=2*i.w_size,Eu(i.head),i.max_lazy_match=r_[i.level].max_lazy,i.good_match=r_[i.level].good_length,i.nice_match=r_[i.level].nice_length,i.max_chain_length=r_[i.level].max_chain,i.strstart=0,i.block_start=0,i.lookahead=0,i.insert=0,i.match_length=i.prev_length=fn-1,i.match_available=0,i.ins_h=0};function Wde(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=U1,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(Lde*2),this.dyn_dtree=new Uint16Array((2*Rde+1)*2),this.bl_tree=new Uint16Array((2*Ode+1)*2),Eu(this.dyn_ltree),Eu(this.dyn_dtree),Eu(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(Nde+1),this.heap=new Uint16Array(2*wF+1),Eu(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*wF+1),Eu(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}var g_=i=>{if(!i)return 1;let t=i.state;return!t||t.strm!==i||t.status!==kp&&t.status!==kF&&t.status!==CF&&t.status!==MF&&t.status!==SF&&t.status!==EF&&t.status!==Nf&&t.status!==n_?1:0},A7=i=>{if(g_(i))return Uf(i,rc);i.total_in=i.total_out=0,i.data_type=Bde;let t=i.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap===2?kF:t.wrap?kp:Nf,i.adler=t.wrap===2?0:1,t.last_flush=-2,_de(t),Do},g7=i=>{let t=A7(i);return t===Do&&Gde(i.state),t},jde=(i,t)=>g_(i)||i.state.wrap!==2?rc:(i.state.gzhead=t,Do),_7=(i,t,e,n,r,o)=>{if(!i)return rc;let a=1;if(t===Cde&&(t=6),n<0?(a=0,n=-n):n>15&&(a=2,n-=16),r<1||r>Fde||e!==U1||n<8||n>15||t<0||t>9||o<0||o>Ede||n===8&&a!==1)return Uf(i,rc);n===8&&(n=9);let s=new Wde;return i.state=s,s.strm=i,s.status=kp,s.wrap=a,s.gzhead=null,s.w_bits=n,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=r+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+fn-1)/fn),s.window=new Uint8Array(s.w_size*2),s.head=new Uint16Array(s.hash_size),s.prev=new Uint16Array(s.w_size),s.lit_bufsize=1<<r+6,s.pending_buf_size=s.lit_bufsize*4,s.pending_buf=new Uint8Array(s.pending_buf_size),s.sym_buf=s.lit_bufsize,s.sym_end=(s.lit_bufsize-1)*3,s.level=t,s.strategy=o,s.method=e,g7(i)},$de=(i,t)=>_7(i,t,U1,Ide,Dde,Tde),Xde=(i,t)=>{if(g_(i)||t>v6||t<0)return i?Uf(i,rc):rc;let e=i.state;if(!i.output||i.avail_in!==0&&!i.input||e.status===n_&&t!==Ds)return Uf(i,i.avail_out===0?dF:rc);let n=e.last_flush;if(e.last_flush=t,e.pending!==0){if(is(i),i.avail_out===0)return e.last_flush=-1,Do}else if(i.avail_in===0&&x6(t)<=x6(n)&&t!==Ds)return Uf(i,dF);if(e.status===n_&&i.avail_in!==0)return Uf(i,dF);if(e.status===kp&&e.wrap===0&&(e.status=Nf),e.status===kp){let r=U1+(e.w_bits-8<<4)<<8,o=-1;if(e.strategy>=F1||e.level<2?o=0:e.level<6?o=1:e.level===6?o=2:o=3,r|=o<<6,e.strstart!==0&&(r|=Ude),r+=31-r%31,i_(e,r),e.strstart!==0&&(i_(e,i.adler>>>16),i_(e,i.adler&65535)),i.adler=1,e.status=Nf,is(i),e.pending!==0)return e.last_flush=-1,Do}if(e.status===kF){if(i.adler=0,Bn(e,31),Bn(e,139),Bn(e,8),e.gzhead)Bn(e,(e.gzhead.text?1:0)+(e.gzhead.hcrc?2:0)+(e.gzhead.extra?4:0)+(e.gzhead.name?8:0)+(e.gzhead.comment?16:0)),Bn(e,e.gzhead.time&255),Bn(e,e.gzhead.time>>8&255),Bn(e,e.gzhead.time>>16&255),Bn(e,e.gzhead.time>>24&255),Bn(e,e.level===9?2:e.strategy>=F1||e.level<2?4:0),Bn(e,e.gzhead.os&255),e.gzhead.extra&&e.gzhead.extra.length&&(Bn(e,e.gzhead.extra.length&255),Bn(e,e.gzhead.extra.length>>8&255)),e.gzhead.hcrc&&(i.adler=go(i.adler,e.pending_buf,e.pending,0)),e.gzindex=0,e.status=CF;else if(Bn(e,0),Bn(e,0),Bn(e,0),Bn(e,0),Bn(e,0),Bn(e,e.level===9?2:e.strategy>=F1||e.level<2?4:0),Bn(e,Hde),e.status=Nf,is(i),e.pending!==0)return e.last_flush=-1,Do}if(e.status===CF){if(e.gzhead.extra){let r=e.pending,o=(e.gzhead.extra.length&65535)-e.gzindex;for(;e.pending+o>e.pending_buf_size;){let s=e.pending_buf_size-e.pending;if(e.pending_buf.set(e.gzhead.extra.subarray(e.gzindex,e.gzindex+s),e.pending),e.pending=e.pending_buf_size,e.gzhead.hcrc&&e.pending>r&&(i.adler=go(i.adler,e.pending_buf,e.pending-r,r)),e.gzindex+=s,is(i),e.pending!==0)return e.last_flush=-1,Do;r=0,o-=s}let a=new Uint8Array(e.gzhead.extra);e.pending_buf.set(a.subarray(e.gzindex,e.gzindex+o),e.pending),e.pending+=o,e.gzhead.hcrc&&e.pending>r&&(i.adler=go(i.adler,e.pending_buf,e.pending-r,r)),e.gzindex=0}e.status=MF}if(e.status===MF){if(e.gzhead.name){let r=e.pending,o;do{if(e.pending===e.pending_buf_size){if(e.gzhead.hcrc&&e.pending>r&&(i.adler=go(i.adler,e.pending_buf,e.pending-r,r)),is(i),e.pending!==0)return e.last_flush=-1,Do;r=0}e.gzindex<e.gzhead.name.length?o=e.gzhead.name.charCodeAt(e.gzindex++)&255:o=0,Bn(e,o)}while(o!==0);e.gzhead.hcrc&&e.pending>r&&(i.adler=go(i.adler,e.pending_buf,e.pending-r,r)),e.gzindex=0}e.status=SF}if(e.status===SF){if(e.gzhead.comment){let r=e.pending,o;do{if(e.pending===e.pending_buf_size){if(e.gzhead.hcrc&&e.pending>r&&(i.adler=go(i.adler,e.pending_buf,e.pending-r,r)),is(i),e.pending!==0)return e.last_flush=-1,Do;r=0}e.gzindex<e.gzhead.comment.length?o=e.gzhead.comment.charCodeAt(e.gzindex++)&255:o=0,Bn(e,o)}while(o!==0);e.gzhead.hcrc&&e.pending>r&&(i.adler=go(i.adler,e.pending_buf,e.pending-r,r))}e.status=EF}if(e.status===EF){if(e.gzhead.hcrc){if(e.pending+2>e.pending_buf_size&&(is(i),e.pending!==0))return e.last_flush=-1,Do;Bn(e,i.adler&255),Bn(e,i.adler>>8&255),i.adler=0}if(e.status=Nf,is(i),e.pending!==0)return e.last_flush=-1,Do}if(i.avail_in!==0||e.lookahead!==0||t!==Fu&&e.status!==n_){let r=e.level===0?p7(e,t):e.strategy===F1?qde(e,t):e.strategy===Sde?zde(e,t):r_[e.level].func(e,t);if((r===Vf||r===Np)&&(e.status=n_),r===ga||r===Vf)return i.avail_out===0&&(e.last_flush=-1),Do;if(r===Lp&&(t===yde?vde(e):t!==v6&&(xF(e,0,0,!1),t===xde&&(Eu(e.head),e.lookahead===0&&(e.strstart=0,e.block_start=0,e.insert=0))),is(i),i.avail_out===0))return e.last_flush=-1,Do}return t!==Ds?Do:e.wrap<=0?y6:(e.wrap===2?(Bn(e,i.adler&255),Bn(e,i.adler>>8&255),Bn(e,i.adler>>16&255),Bn(e,i.adler>>24&255),Bn(e,i.total_in&255),Bn(e,i.total_in>>8&255),Bn(e,i.total_in>>16&255),Bn(e,i.total_in>>24&255)):(i_(e,i.adler>>>16),i_(e,i.adler&65535)),is(i),e.wrap>0&&(e.wrap=-e.wrap),e.pending!==0?Do:y6)},Kde=i=>{if(g_(i))return rc;let t=i.state.status;return i.state=null,t===Nf?Uf(i,wde):Do},Yde=(i,t)=>{let e=t.length;if(g_(i))return rc;let n=i.state,r=n.wrap;if(r===2||r===1&&n.status!==kp||n.lookahead)return rc;if(r===1&&(i.adler=h_(i.adler,t,e,0)),n.wrap=0,e>=n.w_size){r===0&&(Eu(n.head),n.strstart=0,n.block_start=0,n.insert=0);let l=new Uint8Array(n.w_size);l.set(t.subarray(e-n.w_size,e),0),t=l,e=n.w_size}let o=i.avail_in,a=i.next_in,s=i.input;for(i.avail_in=e,i.next_in=0,i.input=t,Pp(n);n.lookahead>=fn;){let l=n.strstart,c=n.lookahead-(fn-1);do n.ins_h=Iu(n,n.ins_h,n.window[l+fn-1]),n.prev[l&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=l,l++;while(--c);n.strstart=l,n.lookahead=fn-1,Pp(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=fn-1,n.match_available=0,i.next_in=a,i.input=s,i.avail_in=o,n.wrap=r,Do},Zde=$de,Jde=_7,eue=g7,tue=A7,iue=jde,nue=Xde,rue=Kde,oue=Yde,aue="pako deflate (from Nodeca project)",a_={deflateInit:Zde,deflateInit2:Jde,deflateReset:eue,deflateResetKeep:tue,deflateSetHeader:iue,deflate:nue,deflateEnd:rue,deflateSetDictionary:oue,deflateInfo:aue},sue=(i,t)=>Object.prototype.hasOwnProperty.call(i,t),lue=function(i){let t=Array.prototype.slice.call(arguments,1);for(;t.length;){let e=t.shift();if(e){if(typeof e!="object")throw new TypeError(e+"must be non-object");for(let n in e)sue(e,n)&&(i[n]=e[n])}}return i},cue=i=>{let t=0;for(let n=0,r=i.length;n<r;n++)t+=i[n].length;let e=new Uint8Array(t);for(let n=0,r=0,o=i.length;n<o;n++){let a=i[n];e.set(a,r),r+=a.length}return e},H1={assign:lue,flattenChunks:cue},b7=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{b7=!1}var f_=new Uint8Array(256);for(let i=0;i<256;i++)f_[i]=i>=252?6:i>=248?5:i>=240?4:i>=224?3:i>=192?2:1;f_[254]=f_[254]=1;var due=i=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(i);let t,e,n,r,o,a=i.length,s=0;for(r=0;r<a;r++)e=i.charCodeAt(r),(e&64512)===55296&&r+1<a&&(n=i.charCodeAt(r+1),(n&64512)===56320&&(e=65536+(e-55296<<10)+(n-56320),r++)),s+=e<128?1:e<2048?2:e<65536?3:4;for(t=new Uint8Array(s),o=0,r=0;o<s;r++)e=i.charCodeAt(r),(e&64512)===55296&&r+1<a&&(n=i.charCodeAt(r+1),(n&64512)===56320&&(e=65536+(e-55296<<10)+(n-56320),r++)),e<128?t[o++]=e:e<2048?(t[o++]=192|e>>>6,t[o++]=128|e&63):e<65536?(t[o++]=224|e>>>12,t[o++]=128|e>>>6&63,t[o++]=128|e&63):(t[o++]=240|e>>>18,t[o++]=128|e>>>12&63,t[o++]=128|e>>>6&63,t[o++]=128|e&63);return t},uue=(i,t)=>{if(t<65534&&i.subarray&&b7)return String.fromCharCode.apply(null,i.length===t?i:i.subarray(0,t));let e="";for(let n=0;n<t;n++)e+=String.fromCharCode(i[n]);return e},hue=(i,t)=>{let e=t||i.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(i.subarray(0,t));let n,r,o=new Array(e*2);for(r=0,n=0;n<e;){let a=i[n++];if(a<128){o[r++]=a;continue}let s=f_[a];if(s>4){o[r++]=65533,n+=s-1;continue}for(a&=s===2?31:s===3?15:7;s>1&&n<e;)a=a<<6|i[n++]&63,s--;if(s>1){o[r++]=65533;continue}a<65536?o[r++]=a:(a-=65536,o[r++]=55296|a>>10&1023,o[r++]=56320|a&1023)}return uue(o,r)},fue=(i,t)=>{t=t||i.length,t>i.length&&(t=i.length);let e=t-1;for(;e>=0&&(i[e]&192)===128;)e--;return e<0||e===0?t:e+f_[i[e]]>t?e:t},m_={string2buf:due,buf2string:hue,utf8border:fue};function mue(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var v7=mue,y7=Object.prototype.toString,{Z_NO_FLUSH:pue,Z_SYNC_FLUSH:Aue,Z_FULL_FLUSH:gue,Z_FINISH:_ue,Z_OK:L1,Z_STREAM_END:bue,Z_DEFAULT_COMPRESSION:vue,Z_DEFAULT_STRATEGY:yue,Z_DEFLATED:xue}=Op;function __(i){this.options=H1.assign({level:vue,method:xue,chunkSize:16384,windowBits:15,memLevel:8,strategy:yue},i||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new v7,this.strm.avail_out=0;let e=a_.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(e!==L1)throw new Error(Hf[e]);if(t.header&&a_.deflateSetHeader(this.strm,t.header),t.dictionary){let n;if(typeof t.dictionary=="string"?n=m_.string2buf(t.dictionary):y7.call(t.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(t.dictionary):n=t.dictionary,e=a_.deflateSetDictionary(this.strm,n),e!==L1)throw new Error(Hf[e]);this._dict_set=!0}}__.prototype.push=function(i,t){let e=this.strm,n=this.options.chunkSize,r,o;if(this.ended)return!1;for(t===~~t?o=t:o=t===!0?_ue:pue,typeof i=="string"?e.input=m_.string2buf(i):y7.call(i)==="[object ArrayBuffer]"?e.input=new Uint8Array(i):e.input=i,e.next_in=0,e.avail_in=e.input.length;;){if(e.avail_out===0&&(e.output=new Uint8Array(n),e.next_out=0,e.avail_out=n),(o===Aue||o===gue)&&e.avail_out<=6){this.onData(e.output.subarray(0,e.next_out)),e.avail_out=0;continue}if(r=a_.deflate(e,o),r===bue)return e.next_out>0&&this.onData(e.output.subarray(0,e.next_out)),r=a_.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===L1;if(e.avail_out===0){this.onData(e.output);continue}if(o>0&&e.next_out>0){this.onData(e.output.subarray(0,e.next_out)),e.avail_out=0;continue}if(e.avail_in===0)break}return!0};__.prototype.onData=function(i){this.chunks.push(i)};__.prototype.onEnd=function(i){i===L1&&(this.result=H1.flattenChunks(this.chunks)),this.chunks=[],this.err=i,this.msg=this.strm.msg};function PF(i,t){let e=new __(t);if(e.push(i,!0),e.err)throw e.msg||Hf[e.err];return e.result}function wue(i,t){return t=t||{},t.raw=!0,PF(i,t)}function Cue(i,t){return t=t||{},t.gzip=!0,PF(i,t)}var Mue=__,Sue=PF,Eue=wue,Tue=Cue,Bue=Op,Fue={Deflate:Mue,deflate:Sue,deflateRaw:Eue,gzip:Tue,constants:Bue},I1=16209,Iue=16191,Due=function(t,e){let n,r,o,a,s,l,c,d,h,u,f,_,y,b,v,M,x,w,k,P,D,O,E,B,L=t.state;n=t.next_in,E=t.input,r=n+(t.avail_in-5),o=t.next_out,B=t.output,a=o-(e-t.avail_out),s=o+(t.avail_out-257),l=L.dmax,c=L.wsize,d=L.whave,h=L.wnext,u=L.window,f=L.hold,_=L.bits,y=L.lencode,b=L.distcode,v=(1<<L.lenbits)-1,M=(1<<L.distbits)-1;e:do{_<15&&(f+=E[n++]<<_,_+=8,f+=E[n++]<<_,_+=8),x=y[f&v];t:for(;;){if(w=x>>>24,f>>>=w,_-=w,w=x>>>16&255,w===0)B[o++]=x&65535;else if(w&16){k=x&65535,w&=15,w&&(_<w&&(f+=E[n++]<<_,_+=8),k+=f&(1<<w)-1,f>>>=w,_-=w),_<15&&(f+=E[n++]<<_,_+=8,f+=E[n++]<<_,_+=8),x=b[f&M];i:for(;;){if(w=x>>>24,f>>>=w,_-=w,w=x>>>16&255,w&16){if(P=x&65535,w&=15,_<w&&(f+=E[n++]<<_,_+=8,_<w&&(f+=E[n++]<<_,_+=8)),P+=f&(1<<w)-1,P>l){t.msg="invalid distance too far back",L.mode=I1;break e}if(f>>>=w,_-=w,w=o-a,P>w){if(w=P-w,w>d&&L.sane){t.msg="invalid distance too far back",L.mode=I1;break e}if(D=0,O=u,h===0){if(D+=c-w,w<k){k-=w;do B[o++]=u[D++];while(--w);D=o-P,O=B}}else if(h<w){if(D+=c+h-w,w-=h,w<k){k-=w;do B[o++]=u[D++];while(--w);if(D=0,h<k){w=h,k-=w;do B[o++]=u[D++];while(--w);D=o-P,O=B}}}else if(D+=h-w,w<k){k-=w;do B[o++]=u[D++];while(--w);D=o-P,O=B}for(;k>2;)B[o++]=O[D++],B[o++]=O[D++],B[o++]=O[D++],k-=3;k&&(B[o++]=O[D++],k>1&&(B[o++]=O[D++]))}else{D=o-P;do B[o++]=B[D++],B[o++]=B[D++],B[o++]=B[D++],k-=3;while(k>2);k&&(B[o++]=B[D++],k>1&&(B[o++]=B[D++]))}}else if((w&64)===0){x=b[(x&65535)+(f&(1<<w)-1)];continue i}else{t.msg="invalid distance code",L.mode=I1;break e}break}}else if((w&64)===0){x=y[(x&65535)+(f&(1<<w)-1)];continue t}else if(w&32){L.mode=Iue;break e}else{t.msg="invalid literal/length code",L.mode=I1;break e}break}}while(n<r&&o<s);k=_>>3,n-=k,_-=k<<3,f&=(1<<_)-1,t.next_in=n,t.next_out=o,t.avail_in=n<r?5+(r-n):5-(n-r),t.avail_out=o<s?257+(s-o):257-(o-s),L.hold=f,L.bits=_},Ip=15,w6=852,C6=592,M6=0,hF=1,S6=2,kue=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),Pue=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),Rue=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),Oue=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),Lue=(i,t,e,n,r,o,a,s)=>{let l=s.bits,c=0,d=0,h=0,u=0,f=0,_=0,y=0,b=0,v=0,M=0,x,w,k,P,D,O=null,E,B=new Uint16Array(Ip+1),L=new Uint16Array(Ip+1),q=null,W,oe,pe;for(c=0;c<=Ip;c++)B[c]=0;for(d=0;d<n;d++)B[t[e+d]]++;for(f=l,u=Ip;u>=1&&B[u]===0;u--);if(f>u&&(f=u),u===0)return r[o++]=1<<24|64<<16|0,r[o++]=1<<24|64<<16|0,s.bits=1,0;for(h=1;h<u&&B[h]===0;h++);for(f<h&&(f=h),b=1,c=1;c<=Ip;c++)if(b<<=1,b-=B[c],b<0)return-1;if(b>0&&(i===M6||u!==1))return-1;for(L[1]=0,c=1;c<Ip;c++)L[c+1]=L[c]+B[c];for(d=0;d<n;d++)t[e+d]!==0&&(a[L[t[e+d]]++]=d);if(i===M6?(O=q=a,E=20):i===hF?(O=kue,q=Pue,E=257):(O=Rue,q=Oue,E=0),M=0,d=0,c=h,D=o,_=f,y=0,k=-1,v=1<<f,P=v-1,i===hF&&v>w6||i===S6&&v>C6)return 1;for(;;){W=c-y,a[d]+1<E?(oe=0,pe=a[d]):a[d]>=E?(oe=q[a[d]-E],pe=O[a[d]-E]):(oe=96,pe=0),x=1<<c-y,w=1<<_,h=w;do w-=x,r[D+(M>>y)+w]=W<<24|oe<<16|pe|0;while(w!==0);for(x=1<<c-1;M&x;)x>>=1;if(x!==0?(M&=x-1,M+=x):M=0,d++,--B[c]===0){if(c===u)break;c=t[e+a[d]]}if(c>f&&(M&P)!==k){for(y===0&&(y=f),D+=h,_=c-y,b=1<<_;_+y<u&&(b-=B[_+y],!(b<=0));)_++,b<<=1;if(v+=1<<_,i===hF&&v>w6||i===S6&&v>C6)return 1;k=M&P,r[k]=f<<24|_<<16|D-o|0}}return M!==0&&(r[D+M]=c-y<<24|64<<16|0),s.bits=f,0},s_=Lue,Nue=0,x7=1,w7=2,{Z_FINISH:E6,Z_BLOCK:Uue,Z_TREES:D1,Z_OK:Qf,Z_STREAM_END:Hue,Z_NEED_DICT:Vue,Z_STREAM_ERROR:ks,Z_DATA_ERROR:C7,Z_MEM_ERROR:M7,Z_BUF_ERROR:Que,Z_DEFLATED:T6}=Op,V1=16180,B6=16181,F6=16182,I6=16183,D6=16184,k6=16185,P6=16186,R6=16187,O6=16188,L6=16189,N1=16190,Ad=16191,fF=16192,N6=16193,mF=16194,U6=16195,H6=16196,V6=16197,Q6=16198,k1=16199,P1=16200,z6=16201,q6=16202,G6=16203,W6=16204,j6=16205,pF=16206,$6=16207,X6=16208,fr=16209,S7=16210,E7=16211,zue=852,que=592,Gue=15,Wue=Gue,K6=i=>(i>>>24&255)+(i>>>8&65280)+((i&65280)<<8)+((i&255)<<24);function jue(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}var zf=i=>{if(!i)return 1;let t=i.state;return!t||t.strm!==i||t.mode<V1||t.mode>E7?1:0},T7=i=>{if(zf(i))return ks;let t=i.state;return i.total_in=i.total_out=t.total=0,i.msg="",t.wrap&&(i.adler=t.wrap&1),t.mode=V1,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(zue),t.distcode=t.distdyn=new Int32Array(que),t.sane=1,t.back=-1,Qf},B7=i=>{if(zf(i))return ks;let t=i.state;return t.wsize=0,t.whave=0,t.wnext=0,T7(i)},F7=(i,t)=>{let e;if(zf(i))return ks;let n=i.state;return t<0?(e=0,t=-t):(e=(t>>4)+5,t<48&&(t&=15)),t&&(t<8||t>15)?ks:(n.window!==null&&n.wbits!==t&&(n.window=null),n.wrap=e,n.wbits=t,B7(i))},I7=(i,t)=>{if(!i)return ks;let e=new jue;i.state=e,e.strm=i,e.window=null,e.mode=V1;let n=F7(i,t);return n!==Qf&&(i.state=null),n},$ue=i=>I7(i,Wue),Y6=!0,AF,gF,Xue=i=>{if(Y6){AF=new Int32Array(512),gF=new Int32Array(32);let t=0;for(;t<144;)i.lens[t++]=8;for(;t<256;)i.lens[t++]=9;for(;t<280;)i.lens[t++]=7;for(;t<288;)i.lens[t++]=8;for(s_(x7,i.lens,0,288,AF,0,i.work,{bits:9}),t=0;t<32;)i.lens[t++]=5;s_(w7,i.lens,0,32,gF,0,i.work,{bits:5}),Y6=!1}i.lencode=AF,i.lenbits=9,i.distcode=gF,i.distbits=5},D7=(i,t,e,n)=>{let r,o=i.state;return o.window===null&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new Uint8Array(o.wsize)),n>=o.wsize?(o.window.set(t.subarray(e-o.wsize,e),0),o.wnext=0,o.whave=o.wsize):(r=o.wsize-o.wnext,r>n&&(r=n),o.window.set(t.subarray(e-n,e-n+r),o.wnext),n-=r,n?(o.window.set(t.subarray(e-n,e),0),o.wnext=n,o.whave=o.wsize):(o.wnext+=r,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=r))),0},Kue=(i,t)=>{let e,n,r,o,a,s,l,c,d,h,u,f,_,y,b=0,v,M,x,w,k,P,D,O,E=new Uint8Array(4),B,L,q=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(zf(i)||!i.output||!i.input&&i.avail_in!==0)return ks;e=i.state,e.mode===Ad&&(e.mode=fF),a=i.next_out,r=i.output,l=i.avail_out,o=i.next_in,n=i.input,s=i.avail_in,c=e.hold,d=e.bits,h=s,u=l,O=Qf;e:for(;;)switch(e.mode){case V1:if(e.wrap===0){e.mode=fF;break}for(;d<16;){if(s===0)break e;s--,c+=n[o++]<<d,d+=8}if(e.wrap&2&&c===35615){e.wbits===0&&(e.wbits=15),e.check=0,E[0]=c&255,E[1]=c>>>8&255,e.check=go(e.check,E,2,0),c=0,d=0,e.mode=B6;break}if(e.head&&(e.head.done=!1),!(e.wrap&1)||(((c&255)<<8)+(c>>8))%31){i.msg="incorrect header check",e.mode=fr;break}if((c&15)!==T6){i.msg="unknown compression method",e.mode=fr;break}if(c>>>=4,d-=4,D=(c&15)+8,e.wbits===0&&(e.wbits=D),D>15||D>e.wbits){i.msg="invalid window size",e.mode=fr;break}e.dmax=1<<e.wbits,e.flags=0,i.adler=e.check=1,e.mode=c&512?L6:Ad,c=0,d=0;break;case B6:for(;d<16;){if(s===0)break e;s--,c+=n[o++]<<d,d+=8}if(e.flags=c,(e.flags&255)!==T6){i.msg="unknown compression method",e.mode=fr;break}if(e.flags&57344){i.msg="unknown header flags set",e.mode=fr;break}e.head&&(e.head.text=c>>8&1),e.flags&512&&e.wrap&4&&(E[0]=c&255,E[1]=c>>>8&255,e.check=go(e.check,E,2,0)),c=0,d=0,e.mode=F6;case F6:for(;d<32;){if(s===0)break e;s--,c+=n[o++]<<d,d+=8}e.head&&(e.head.time=c),e.flags&512&&e.wrap&4&&(E[0]=c&255,E[1]=c>>>8&255,E[2]=c>>>16&255,E[3]=c>>>24&255,e.check=go(e.check,E,4,0)),c=0,d=0,e.mode=I6;case I6:for(;d<16;){if(s===0)break e;s--,c+=n[o++]<<d,d+=8}e.head&&(e.head.xflags=c&255,e.head.os=c>>8),e.flags&512&&e.wrap&4&&(E[0]=c&255,E[1]=c>>>8&255,e.check=go(e.check,E,2,0)),c=0,d=0,e.mode=D6;case D6:if(e.flags&1024){for(;d<16;){if(s===0)break e;s--,c+=n[o++]<<d,d+=8}e.length=c,e.head&&(e.head.extra_len=c),e.flags&512&&e.wrap&4&&(E[0]=c&255,E[1]=c>>>8&255,e.check=go(e.check,E,2,0)),c=0,d=0}else e.head&&(e.head.extra=null);e.mode=k6;case k6:if(e.flags&1024&&(f=e.length,f>s&&(f=s),f&&(e.head&&(D=e.head.extra_len-e.length,e.head.extra||(e.head.extra=new Uint8Array(e.head.extra_len)),e.head.extra.set(n.subarray(o,o+f),D)),e.flags&512&&e.wrap&4&&(e.check=go(e.check,n,f,o)),s-=f,o+=f,e.length-=f),e.length))break e;e.length=0,e.mode=P6;case P6:if(e.flags&2048){if(s===0)break e;f=0;do D=n[o+f++],e.head&&D&&e.length<65536&&(e.head.name+=String.fromCharCode(D));while(D&&f<s);if(e.flags&512&&e.wrap&4&&(e.check=go(e.check,n,f,o)),s-=f,o+=f,D)break e}else e.head&&(e.head.name=null);e.length=0,e.mode=R6;case R6:if(e.flags&4096){if(s===0)break e;f=0;do D=n[o+f++],e.head&&D&&e.length<65536&&(e.head.comment+=String.fromCharCode(D));while(D&&f<s);if(e.flags&512&&e.wrap&4&&(e.check=go(e.check,n,f,o)),s-=f,o+=f,D)break e}else e.head&&(e.head.comment=null);e.mode=O6;case O6:if(e.flags&512){for(;d<16;){if(s===0)break e;s--,c+=n[o++]<<d,d+=8}if(e.wrap&4&&c!==(e.check&65535)){i.msg="header crc mismatch",e.mode=fr;break}c=0,d=0}e.head&&(e.head.hcrc=e.flags>>9&1,e.head.done=!0),i.adler=e.check=0,e.mode=Ad;break;case L6:for(;d<32;){if(s===0)break e;s--,c+=n[o++]<<d,d+=8}i.adler=e.check=K6(c),c=0,d=0,e.mode=N1;case N1:if(e.havedict===0)return i.next_out=a,i.avail_out=l,i.next_in=o,i.avail_in=s,e.hold=c,e.bits=d,Vue;i.adler=e.check=1,e.mode=Ad;case Ad:if(t===Uue||t===D1)break e;case fF:if(e.last){c>>>=d&7,d-=d&7,e.mode=pF;break}for(;d<3;){if(s===0)break e;s--,c+=n[o++]<<d,d+=8}switch(e.last=c&1,c>>>=1,d-=1,c&3){case 0:e.mode=N6;break;case 1:if(Xue(e),e.mode=k1,t===D1){c>>>=2,d-=2;break e}break;case 2:e.mode=H6;break;case 3:i.msg="invalid block type",e.mode=fr}c>>>=2,d-=2;break;case N6:for(c>>>=d&7,d-=d&7;d<32;){if(s===0)break e;s--,c+=n[o++]<<d,d+=8}if((c&65535)!==(c>>>16^65535)){i.msg="invalid stored block lengths",e.mode=fr;break}if(e.length=c&65535,c=0,d=0,e.mode=mF,t===D1)break e;case mF:e.mode=U6;case U6:if(f=e.length,f){if(f>s&&(f=s),f>l&&(f=l),f===0)break e;r.set(n.subarray(o,o+f),a),s-=f,o+=f,l-=f,a+=f,e.length-=f;break}e.mode=Ad;break;case H6:for(;d<14;){if(s===0)break e;s--,c+=n[o++]<<d,d+=8}if(e.nlen=(c&31)+257,c>>>=5,d-=5,e.ndist=(c&31)+1,c>>>=5,d-=5,e.ncode=(c&15)+4,c>>>=4,d-=4,e.nlen>286||e.ndist>30){i.msg="too many length or distance symbols",e.mode=fr;break}e.have=0,e.mode=V6;case V6:for(;e.have<e.ncode;){for(;d<3;){if(s===0)break e;s--,c+=n[o++]<<d,d+=8}e.lens[q[e.have++]]=c&7,c>>>=3,d-=3}for(;e.have<19;)e.lens[q[e.have++]]=0;if(e.lencode=e.lendyn,e.lenbits=7,B={bits:e.lenbits},O=s_(Nue,e.lens,0,19,e.lencode,0,e.work,B),e.lenbits=B.bits,O){i.msg="invalid code lengths set",e.mode=fr;break}e.have=0,e.mode=Q6;case Q6:for(;e.have<e.nlen+e.ndist;){for(;b=e.lencode[c&(1<<e.lenbits)-1],v=b>>>24,M=b>>>16&255,x=b&65535,!(v<=d);){if(s===0)break e;s--,c+=n[o++]<<d,d+=8}if(x<16)c>>>=v,d-=v,e.lens[e.have++]=x;else{if(x===16){for(L=v+2;d<L;){if(s===0)break e;s--,c+=n[o++]<<d,d+=8}if(c>>>=v,d-=v,e.have===0){i.msg="invalid bit length repeat",e.mode=fr;break}D=e.lens[e.have-1],f=3+(c&3),c>>>=2,d-=2}else if(x===17){for(L=v+3;d<L;){if(s===0)break e;s--,c+=n[o++]<<d,d+=8}c>>>=v,d-=v,D=0,f=3+(c&7),c>>>=3,d-=3}else{for(L=v+7;d<L;){if(s===0)break e;s--,c+=n[o++]<<d,d+=8}c>>>=v,d-=v,D=0,f=11+(c&127),c>>>=7,d-=7}if(e.have+f>e.nlen+e.ndist){i.msg="invalid bit length repeat",e.mode=fr;break}for(;f--;)e.lens[e.have++]=D}}if(e.mode===fr)break;if(e.lens[256]===0){i.msg="invalid code -- missing end-of-block",e.mode=fr;break}if(e.lenbits=9,B={bits:e.lenbits},O=s_(x7,e.lens,0,e.nlen,e.lencode,0,e.work,B),e.lenbits=B.bits,O){i.msg="invalid literal/lengths set",e.mode=fr;break}if(e.distbits=6,e.distcode=e.distdyn,B={bits:e.distbits},O=s_(w7,e.lens,e.nlen,e.ndist,e.distcode,0,e.work,B),e.distbits=B.bits,O){i.msg="invalid distances set",e.mode=fr;break}if(e.mode=k1,t===D1)break e;case k1:e.mode=P1;case P1:if(s>=6&&l>=258){i.next_out=a,i.avail_out=l,i.next_in=o,i.avail_in=s,e.hold=c,e.bits=d,Due(i,u),a=i.next_out,r=i.output,l=i.avail_out,o=i.next_in,n=i.input,s=i.avail_in,c=e.hold,d=e.bits,e.mode===Ad&&(e.back=-1);break}for(e.back=0;b=e.lencode[c&(1<<e.lenbits)-1],v=b>>>24,M=b>>>16&255,x=b&65535,!(v<=d);){if(s===0)break e;s--,c+=n[o++]<<d,d+=8}if(M&&(M&240)===0){for(w=v,k=M,P=x;b=e.lencode[P+((c&(1<<w+k)-1)>>w)],v=b>>>24,M=b>>>16&255,x=b&65535,!(w+v<=d);){if(s===0)break e;s--,c+=n[o++]<<d,d+=8}c>>>=w,d-=w,e.back+=w}if(c>>>=v,d-=v,e.back+=v,e.length=x,M===0){e.mode=j6;break}if(M&32){e.back=-1,e.mode=Ad;break}if(M&64){i.msg="invalid literal/length code",e.mode=fr;break}e.extra=M&15,e.mode=z6;case z6:if(e.extra){for(L=e.extra;d<L;){if(s===0)break e;s--,c+=n[o++]<<d,d+=8}e.length+=c&(1<<e.extra)-1,c>>>=e.extra,d-=e.extra,e.back+=e.extra}e.was=e.length,e.mode=q6;case q6:for(;b=e.distcode[c&(1<<e.distbits)-1],v=b>>>24,M=b>>>16&255,x=b&65535,!(v<=d);){if(s===0)break e;s--,c+=n[o++]<<d,d+=8}if((M&240)===0){for(w=v,k=M,P=x;b=e.distcode[P+((c&(1<<w+k)-1)>>w)],v=b>>>24,M=b>>>16&255,x=b&65535,!(w+v<=d);){if(s===0)break e;s--,c+=n[o++]<<d,d+=8}c>>>=w,d-=w,e.back+=w}if(c>>>=v,d-=v,e.back+=v,M&64){i.msg="invalid distance code",e.mode=fr;break}e.offset=x,e.extra=M&15,e.mode=G6;case G6:if(e.extra){for(L=e.extra;d<L;){if(s===0)break e;s--,c+=n[o++]<<d,d+=8}e.offset+=c&(1<<e.extra)-1,c>>>=e.extra,d-=e.extra,e.back+=e.extra}if(e.offset>e.dmax){i.msg="invalid distance too far back",e.mode=fr;break}e.mode=W6;case W6:if(l===0)break e;if(f=u-l,e.offset>f){if(f=e.offset-f,f>e.whave&&e.sane){i.msg="invalid distance too far back",e.mode=fr;break}f>e.wnext?(f-=e.wnext,_=e.wsize-f):_=e.wnext-f,f>e.length&&(f=e.length),y=e.window}else y=r,_=a-e.offset,f=e.length;f>l&&(f=l),l-=f,e.length-=f;do r[a++]=y[_++];while(--f);e.length===0&&(e.mode=P1);break;case j6:if(l===0)break e;r[a++]=e.length,l--,e.mode=P1;break;case pF:if(e.wrap){for(;d<32;){if(s===0)break e;s--,c|=n[o++]<<d,d+=8}if(u-=l,i.total_out+=u,e.total+=u,e.wrap&4&&u&&(i.adler=e.check=e.flags?go(e.check,r,u,a-u):h_(e.check,r,u,a-u)),u=l,e.wrap&4&&(e.flags?c:K6(c))!==e.check){i.msg="incorrect data check",e.mode=fr;break}c=0,d=0}e.mode=$6;case $6:if(e.wrap&&e.flags){for(;d<32;){if(s===0)break e;s--,c+=n[o++]<<d,d+=8}if(e.wrap&4&&c!==(e.total&4294967295)){i.msg="incorrect length check",e.mode=fr;break}c=0,d=0}e.mode=X6;case X6:O=Hue;break e;case fr:O=C7;break e;case S7:return M7;case E7:default:return ks}return i.next_out=a,i.avail_out=l,i.next_in=o,i.avail_in=s,e.hold=c,e.bits=d,(e.wsize||u!==i.avail_out&&e.mode<fr&&(e.mode<pF||t!==E6))&&D7(i,i.output,i.next_out,u-i.avail_out),h-=i.avail_in,u-=i.avail_out,i.total_in+=h,i.total_out+=u,e.total+=u,e.wrap&4&&u&&(i.adler=e.check=e.flags?go(e.check,r,u,i.next_out-u):h_(e.check,r,u,i.next_out-u)),i.data_type=e.bits+(e.last?64:0)+(e.mode===Ad?128:0)+(e.mode===k1||e.mode===mF?256:0),(h===0&&u===0||t===E6)&&O===Qf&&(O=Que),O},Yue=i=>{if(zf(i))return ks;let t=i.state;return t.window&&(t.window=null),i.state=null,Qf},Zue=(i,t)=>{if(zf(i))return ks;let e=i.state;return(e.wrap&2)===0?ks:(e.head=t,t.done=!1,Qf)},Jue=(i,t)=>{let e=t.length,n,r,o;return zf(i)||(n=i.state,n.wrap!==0&&n.mode!==N1)?ks:n.mode===N1&&(r=1,r=h_(r,t,e,0),r!==n.check)?C7:(o=D7(i,t,e,e),o?(n.mode=S7,M7):(n.havedict=1,Qf))},ehe=B7,the=F7,ihe=T7,nhe=$ue,rhe=I7,ohe=Kue,ahe=Yue,she=Zue,lhe=Jue,che="pako inflate (from Nodeca project)",_d={inflateReset:ehe,inflateReset2:the,inflateResetKeep:ihe,inflateInit:nhe,inflateInit2:rhe,inflate:ohe,inflateEnd:ahe,inflateGetHeader:she,inflateSetDictionary:lhe,inflateInfo:che};function dhe(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var uhe=dhe,k7=Object.prototype.toString,{Z_NO_FLUSH:hhe,Z_FINISH:fhe,Z_OK:p_,Z_STREAM_END:_F,Z_NEED_DICT:bF,Z_STREAM_ERROR:mhe,Z_DATA_ERROR:Z6,Z_MEM_ERROR:phe}=Op;function b_(i){this.options=H1.assign({chunkSize:1024*64,windowBits:15,to:""},i||{});let t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(i&&i.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15)===0&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new v7,this.strm.avail_out=0;let e=_d.inflateInit2(this.strm,t.windowBits);if(e!==p_)throw new Error(Hf[e]);if(this.header=new uhe,_d.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=m_.string2buf(t.dictionary):k7.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(e=_d.inflateSetDictionary(this.strm,t.dictionary),e!==p_)))throw new Error(Hf[e])}b_.prototype.push=function(i,t){let e=this.strm,n=this.options.chunkSize,r=this.options.dictionary,o,a,s;if(this.ended)return!1;for(t===~~t?a=t:a=t===!0?fhe:hhe,k7.call(i)==="[object ArrayBuffer]"?e.input=new Uint8Array(i):e.input=i,e.next_in=0,e.avail_in=e.input.length;;){for(e.avail_out===0&&(e.output=new Uint8Array(n),e.next_out=0,e.avail_out=n),o=_d.inflate(e,a),o===bF&&r&&(o=_d.inflateSetDictionary(e,r),o===p_?o=_d.inflate(e,a):o===Z6&&(o=bF));e.avail_in>0&&o===_F&&e.state.wrap>0&&i[e.next_in]!==0;)_d.inflateReset(e),o=_d.inflate(e,a);switch(o){case mhe:case Z6:case bF:case phe:return this.onEnd(o),this.ended=!0,!1}if(s=e.avail_out,e.next_out&&(e.avail_out===0||o===_F))if(this.options.to==="string"){let l=m_.utf8border(e.output,e.next_out),c=e.next_out-l,d=m_.buf2string(e.output,l);e.next_out=c,e.avail_out=n-c,c&&e.output.set(e.output.subarray(l,l+c),0),this.onData(d)}else this.onData(e.output.length===e.next_out?e.output:e.output.subarray(0,e.next_out));if(!(o===p_&&s===0)){if(o===_F)return o=_d.inflateEnd(this.strm),this.onEnd(o),this.ended=!0,!0;if(e.avail_in===0)break}}return!0};b_.prototype.onData=function(i){this.chunks.push(i)};b_.prototype.onEnd=function(i){i===p_&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=H1.flattenChunks(this.chunks)),this.chunks=[],this.err=i,this.msg=this.strm.msg};function RF(i,t){let e=new b_(t);if(e.push(i),e.err)throw e.msg||Hf[e.err];return e.result}function Ahe(i,t){return t=t||{},t.raw=!0,RF(i,t)}var ghe=b_,_he=RF,bhe=Ahe,vhe=RF,yhe=Op,xhe={Inflate:ghe,inflate:_he,inflateRaw:bhe,ungzip:vhe,constants:yhe},{Deflate:SUe,deflate:EUe,deflateRaw:TUe,gzip:BUe}=Fue,{Inflate:FUe,inflate:IUe,inflateRaw:DUe,ungzip:whe}=xhe;var Q1=whe;var z1=i=>{let t=[];for(let e=0;e<i.length;e++)t.push(Che(i[e]));return t},Che=i=>ht(null,null,function*(){return new Promise(t=>{let e=i.name.endsWith(".gz"),n=new FileReader;e?n.readAsArrayBuffer(i):n.readAsText(i,"utf8");let r;n.onload=o=>{let a=o.target.result.toString();r=e?Q1(o.target.result,{to:"string"}):a,a.includes("gameObjectPositions")&&m6(a)&&(r=JSON.stringify(d6(a)))},n.onloadend=()=>{t(r)}})});var q1=(()=>{class i{constructor(e,n){this.store=e,this.loadFileService=n,this.isUploading=!1}uploadFiles(){let e=T1();e.addEventListener("change",()=>{this.uploadFilesOnEvent(e)}),e.click()}uploadFilesOnEvent(e){return ht(this,null,function*(){try{this.isUploading=!0,this.store.dispatch(Za({value:!0})),this.store.dispatch(cl({value:!0}));let n=yield Promise.all(z1(e.files)),{customConfigs:r,ccFiles:o}=this.splitCustomConfigsAndCCFiles(e.files,n);for(let a of r)Tn.importCustomConfigs(a);o.length>0&&this.loadFileService.loadFiles(o)}catch{this.store.dispatch(Za({value:!1})),this.store.dispatch(cl({value:!1}))}finally{this.isUploading=!1}})}splitCustomConfigsAndCCFiles(e,n){let r=[],o=[];for(let[a,s]of n.entries()){let l=e[a].name;l.includes(oF)?r.push(s):o.push({fileName:l,fileSize:e[a].size,content:K0(s)})}return{customConfigs:r,ccFiles:o}}static{this.\u0275fac=function(n){return new(n||i)(Me(Fe),Me(pl))}}static{this.\u0275prov=Ve({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var R7=(()=>{class i{constructor(e){this.uploadFilesService=e}uploadFiles(){this.uploadFilesService.uploadFiles()}static{this.\u0275fac=function(n){return new(n||i)(se(q1))}}static{this.\u0275cmp=te({type:i,selectors:[["cc-upload-files-button"]],decls:1,vars:1,consts:[["title","Load cc.json files",3,"click","icon"]],template:function(n,r){n&1&&(T(0,"cc-action-icon",0),he("click",function(){return r.uploadFiles()}),F()),n&2&&G("icon","fa fa-folder-open folder-icon")},dependencies:[Oa],encapsulation:2})}}return i})();var OF=typeof navigator<"u"?navigator.userAgent.toLowerCase().indexOf("firefox")>0:!1;function LF(i,t,e,n){i.addEventListener?i.addEventListener(t,e,n):i.attachEvent&&i.attachEvent("on".concat(t),e)}function v_(i,t,e,n){i.removeEventListener?i.removeEventListener(t,e,n):i.detachEvent&&i.detachEvent("on".concat(t),e)}function N7(i,t){let e=t.slice(0,t.length-1);for(let n=0;n<e.length;n++)e[n]=i[e[n].toLowerCase()];return e}function U7(i){typeof i!="string"&&(i=""),i=i.replace(/\s/g,"");let t=i.split(","),e=t.lastIndexOf("");for(;e>=0;)t[e-1]+=",",t.splice(e,1),e=t.lastIndexOf("");return t}function Mhe(i,t){let e=i.length>=t.length?i:t,n=i.length>=t.length?t:i,r=!0;for(let o=0;o<e.length;o++)n.indexOf(e[o])===-1&&(r=!1);return r}var w_={backspace:8,"\u232B":8,tab:9,clear:12,enter:13,"\u21A9":13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,arrowup:38,arrowdown:40,arrowleft:37,arrowright:39,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"\u21EA":20,",":188,".":190,"/":191,"`":192,"-":OF?173:189,"=":OF?61:187,";":OF?59:186,"'":222,"{":219,"}":221,"[":219,"]":221,"\\":220},gl={"\u21E7":16,shift:16,"\u2325":18,alt:18,option:18,"\u2303":17,ctrl:17,control:17,"\u2318":91,cmd:91,meta:91,command:91},y_={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},ko={16:!1,18:!1,17:!1,91:!1},Mr={};for(let i=1;i<20;i++)w_["f".concat(i)]=111+i;var mr=[],x_=null,H7="all",bd=new Map,Up=i=>w_[i.toLowerCase()]||gl[i.toLowerCase()]||i.toUpperCase().charCodeAt(0),She=i=>Object.keys(w_).find(t=>w_[t]===i),Ehe=i=>Object.keys(gl).find(t=>gl[t]===i);function V7(i){H7=i||"all"}function C_(){return H7||"all"}function The(){return mr.slice(0)}function Bhe(){return mr.map(i=>She(i)||Ehe(i)||String.fromCharCode(i))}function Fhe(){let i=[];return Object.keys(Mr).forEach(t=>{Mr[t].forEach(e=>{let{key:n,scope:r,mods:o,shortcut:a}=e;i.push({scope:r,shortcut:a,mods:o,keys:n.split("+").map(s=>Up(s))})})}),i}function Ihe(i){let t=i.target||i.srcElement,{tagName:e}=t,n=!0,r=e==="INPUT"&&!["checkbox","radio","range","button","file","reset","submit","color"].includes(t.type);return(t.isContentEditable||(r||e==="TEXTAREA"||e==="SELECT")&&!t.readOnly)&&(n=!1),n}function Dhe(i){return typeof i=="string"&&(i=Up(i)),mr.indexOf(i)!==-1}function khe(i,t){let e,n;i||(i=C_());for(let r in Mr)if(Object.prototype.hasOwnProperty.call(Mr,r))for(e=Mr[r],n=0;n<e.length;)e[n].scope===i?e.splice(n,1).forEach(a=>{let{element:s}=a;return UF(s)}):n++;C_()===i&&V7(t||"all")}function Phe(i){let t=i.keyCode||i.which||i.charCode;i.key&&i.key.toLowerCase()==="capslock"&&(t=Up(i.key));let e=mr.indexOf(t);if(e>=0&&mr.splice(e,1),i.key&&i.key.toLowerCase()==="meta"&&mr.splice(0,mr.length),(t===93||t===224)&&(t=91),t in ko){ko[t]=!1;for(let n in gl)gl[n]===t&&(Al[n]=!1)}}function Q7(i){if(typeof i>"u")Object.keys(Mr).forEach(r=>{Array.isArray(Mr[r])&&Mr[r].forEach(o=>G1(o)),delete Mr[r]}),UF(null);else if(Array.isArray(i))i.forEach(r=>{r.key&&G1(r)});else if(typeof i=="object")i.key&&G1(i);else if(typeof i=="string"){for(var t=arguments.length,e=new Array(t>1?t-1:0),n=1;n<t;n++)e[n-1]=arguments[n];let[r,o]=e;typeof r=="function"&&(o=r,r=""),G1({key:i,scope:r,method:o,splitKey:"+"})}}var G1=i=>{let{key:t,scope:e,method:n,splitKey:r="+"}=i;U7(t).forEach(a=>{let s=a.split(r),l=s.length,c=s[l-1],d=c==="*"?"*":Up(c);if(!Mr[d])return;e||(e=C_());let h=l>1?N7(gl,s):[],u=[];Mr[d]=Mr[d].filter(f=>{let y=(n?f.method===n:!0)&&f.scope===e&&Mhe(f.mods,h);return y&&u.push(f.element),!y}),u.forEach(f=>UF(f))})};function O7(i,t,e,n){if(t.element!==n)return;let r;if(t.scope===e||t.scope==="all"){r=t.mods.length>0;for(let o in ko)Object.prototype.hasOwnProperty.call(ko,o)&&(!ko[o]&&t.mods.indexOf(+o)>-1||ko[o]&&t.mods.indexOf(+o)===-1)&&(r=!1);(t.mods.length===0&&!ko[16]&&!ko[18]&&!ko[17]&&!ko[91]||r||t.shortcut==="*")&&(t.keys=[],t.keys=t.keys.concat(mr),t.method(i,t)===!1&&(i.preventDefault?i.preventDefault():i.returnValue=!1,i.stopPropagation&&i.stopPropagation(),i.cancelBubble&&(i.cancelBubble=!0)))}}function L7(i,t){let e=Mr["*"],n=i.keyCode||i.which||i.charCode;if(i.key&&i.key.toLowerCase()==="capslock"||!Al.filter.call(this,i))return;if((n===93||n===224)&&(n=91),mr.indexOf(n)===-1&&n!==229&&mr.push(n),["metaKey","ctrlKey","altKey","shiftKey"].forEach(s=>{let l=y_[s];i[s]&&mr.indexOf(l)===-1?mr.push(l):!i[s]&&mr.indexOf(l)>-1?mr.splice(mr.indexOf(l),1):s==="metaKey"&&i[s]&&(mr=mr.filter(c=>c in y_||c===n))}),n in ko){ko[n]=!0;for(let s in gl)if(Object.prototype.hasOwnProperty.call(gl,s)){let l=y_[gl[s]];Al[s]=i[l]}if(!e)return}for(let s in ko)Object.prototype.hasOwnProperty.call(ko,s)&&(ko[s]=i[y_[s]]);i.getModifierState&&!(i.altKey&&!i.ctrlKey)&&i.getModifierState("AltGraph")&&(mr.indexOf(17)===-1&&mr.push(17),mr.indexOf(18)===-1&&mr.push(18),ko[17]=!0,ko[18]=!0);let r=C_();if(e)for(let s=0;s<e.length;s++)e[s].scope===r&&(i.type==="keydown"&&e[s].keydown||i.type==="keyup"&&e[s].keyup)&&O7(i,e[s],r,t);if(!(n in Mr))return;let o=Mr[n],a=o.length;for(let s=0;s<a;s++)if((i.type==="keydown"&&o[s].keydown||i.type==="keyup"&&o[s].keyup)&&o[s].key){let l=o[s],{splitKey:c}=l,d=l.key.split(c),h=[];for(let u=0;u<d.length;u++)h.push(Up(d[u]));h.sort().join("")===mr.sort().join("")&&O7(i,l,r,t)}}function Al(i,t,e){mr=[];let n=U7(i),r=[],o="all",a=document,s=0,l=!1,c=!0,d="+",h=!1,u=!1;for(e===void 0&&typeof t=="function"&&(e=t),Object.prototype.toString.call(t)==="[object Object]"&&(t.scope&&(o=t.scope),t.element&&(a=t.element),t.keyup&&(l=t.keyup),t.keydown!==void 0&&(c=t.keydown),t.capture!==void 0&&(h=t.capture),typeof t.splitKey=="string"&&(d=t.splitKey),t.single===!0&&(u=!0)),typeof t=="string"&&(o=t),u&&Q7(i,o);s<n.length;s++)i=n[s].split(d),r=[],i.length>1&&(r=N7(gl,i)),i=i[i.length-1],i=i==="*"?"*":Up(i),i in Mr||(Mr[i]=[]),Mr[i].push({keyup:l,keydown:c,scope:o,mods:r,shortcut:n[s],method:e,key:n[s],splitKey:d,element:a});if(typeof a<"u"&&window){if(!bd.has(a)){let f=function(){let y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.event;return L7(y,a)},_=function(){let y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.event;L7(y,a),Phe(y)};bd.set(a,{keydownListener:f,keyupListenr:_,capture:h}),LF(a,"keydown",f,h),LF(a,"keyup",_,h)}if(!x_){let f=()=>{mr=[]};x_={listener:f,capture:h},LF(window,"focus",f,h)}}}function Rhe(i){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"all";Object.keys(Mr).forEach(e=>{Mr[e].filter(r=>r.scope===t&&r.shortcut===i).forEach(r=>{r&&r.method&&r.method()})})}function UF(i){let t=Object.values(Mr).flat();if(t.findIndex(n=>{let{element:r}=n;return r===i})<0){let{keydownListener:n,keyupListenr:r,capture:o}=bd.get(i)||{};n&&r&&(v_(i,"keyup",r,o),v_(i,"keydown",n,o),bd.delete(i))}if((t.length<=0||bd.size<=0)&&(Object.keys(bd).forEach(r=>{let{keydownListener:o,keyupListenr:a,capture:s}=bd.get(r)||{};o&&a&&(v_(r,"keyup",a,s),v_(r,"keydown",o,s),bd.delete(r))}),bd.clear(),Object.keys(Mr).forEach(r=>delete Mr[r]),x_)){let{listener:r,capture:o}=x_;v_(window,"focus",r,o),x_=null}}var NF={getPressedKeyString:Bhe,setScope:V7,getScope:C_,deleteScope:khe,getPressedKeyCodes:The,getAllKeyCodes:Fhe,isPressed:Dhe,filter:Ihe,trigger:Rhe,unbind:Q7,keyMap:w_,modifier:gl,modifierMap:y_};for(let i in NF)Object.prototype.hasOwnProperty.call(NF,i)&&(Al[i]=NF[i]);if(typeof window<"u"){let i=window.hotkeys;Al.noConflict=t=>(t&&window.hotkeys===Al&&(window.hotkeys=i),Al),window.hotkeys=Al}var SV=rl(z7());var ya={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},fc={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},Ohe=0,q7=1,Lhe=2;var sH=1,Nhe=2,Sd=3,Vu=0,ta=1,Ed=2,sc=0,cA=1,G7=2,W7=3,j7=4,Uhe=5,Yf=100,Hhe=101,Vhe=102,Qhe=103,zhe=104,qhe=200,Ghe=201,Whe=202,jhe=203,yI=204,xI=205,$he=206,Xhe=207,Khe=208,Yhe=209,Zhe=210,Jhe=211,efe=212,tfe=213,ife=214,nfe=0,rfe=1,ofe=2,Fx=3,afe=4,sfe=5,lfe=6,cfe=7,N3=0,dfe=1,ufe=2,Uu=0,hfe=1,ffe=2,mfe=3,pfe=4,Afe=5,gfe=6,_fe=7;var $7=300,mA=301,pA=302,wI=303,CI=304,cw=306,AA=1e3,Jf=1001,MI=1002,Os=1003,bfe=1004;var W1=1005;var as=1006,QF=1007;var em=1008;var Fd=1009,lH=1010,cH=1011,H_=1012,U3=1013,im=1014,Td=1015,sm=1016,H3=1017,V3=1018,gA=1020,dH=35902,uH=1021,hH=1022,ss=1023,fH=1024,mH=1025,dA=1026,_A=1027,pH=1028,Q3=1029,AH=1030,z3=1031;var q3=1033,Mx=33776,Sx=33777,Ex=33778,Tx=33779,SI=35840,EI=35841,TI=35842,BI=35843,FI=36196,II=37492,DI=37496,kI=37808,PI=37809,RI=37810,OI=37811,LI=37812,NI=37813,UI=37814,HI=37815,VI=37816,QI=37817,zI=37818,qI=37819,GI=37820,WI=37821,Bx=36492,jI=36494,$I=36495,gH=36283,XI=36284,KI=36285,YI=36286;var Ix=2300,ZI=2301,zF=2302,X7=2400,K7=2401,Y7=2402;var vfe=3200,yfe=3201;var G3=0,xfe=1,Nu="",Rs="srgb",Wu="srgb-linear",W3="display-p3",dw="display-p3-linear",Dx="linear",or="srgb",kx="rec709",Px="p3";var Hp=7680;var Z7=519,wfe=512,Cfe=513,Mfe=514,_H=515,Sfe=516,Efe=517,Tfe=518,Bfe=519,JI=35044;var J7="300 es",Bd=2e3,Rx=2001,Id=class{addEventListener(t,e){this._listeners===void 0&&(this._listeners={});let n=this._listeners;n[t]===void 0&&(n[t]=[]),n[t].indexOf(e)===-1&&n[t].push(e)}hasEventListener(t,e){if(this._listeners===void 0)return!1;let n=this._listeners;return n[t]!==void 0&&n[t].indexOf(e)!==-1}removeEventListener(t,e){if(this._listeners===void 0)return;let r=this._listeners[t];if(r!==void 0){let o=r.indexOf(e);o!==-1&&r.splice(o,1)}}dispatchEvent(t){if(this._listeners===void 0)return;let n=this._listeners[t.type];if(n!==void 0){t.target=this;let r=n.slice(0);for(let o=0,a=r.length;o<a;o++)r[o].call(this,t);t.target=null}}},Jo=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"],e9=1234567,R_=Math.PI/180,V_=180/Math.PI;function lc(){let i=Math.random()*4294967295|0,t=Math.random()*4294967295|0,e=Math.random()*4294967295|0,n=Math.random()*4294967295|0;return(Jo[i&255]+Jo[i>>8&255]+Jo[i>>16&255]+Jo[i>>24&255]+"-"+Jo[t&255]+Jo[t>>8&255]+"-"+Jo[t>>16&15|64]+Jo[t>>24&255]+"-"+Jo[e&63|128]+Jo[e>>8&255]+"-"+Jo[e>>16&255]+Jo[e>>24&255]+Jo[n&255]+Jo[n>>8&255]+Jo[n>>16&255]+Jo[n>>24&255]).toLowerCase()}function bo(i,t,e){return Math.max(t,Math.min(e,i))}function j3(i,t){return(i%t+t)%t}function Ffe(i,t,e,n,r){return n+(i-t)*(r-n)/(e-t)}function Ife(i,t,e){return i!==t?(e-i)/(t-i):0}function O_(i,t,e){return(1-e)*i+e*t}function Dfe(i,t,e,n){return O_(i,t,1-Math.exp(-e*n))}function kfe(i,t=1){return t-Math.abs(j3(i,t*2)-t)}function Pfe(i,t,e){return i<=t?0:i>=e?1:(i=(i-t)/(e-t),i*i*(3-2*i))}function Rfe(i,t,e){return i<=t?0:i>=e?1:(i=(i-t)/(e-t),i*i*i*(i*(i*6-15)+10))}function Ofe(i,t){return i+Math.floor(Math.random()*(t-i+1))}function Lfe(i,t){return i+Math.random()*(t-i)}function Nfe(i){return i*(.5-Math.random())}function Ufe(i){i!==void 0&&(e9=i);let t=e9+=1831565813;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}function Hfe(i){return i*R_}function Vfe(i){return i*V_}function Qfe(i){return(i&i-1)===0&&i!==0}function zfe(i){return Math.pow(2,Math.ceil(Math.log(i)/Math.LN2))}function qfe(i){return Math.pow(2,Math.floor(Math.log(i)/Math.LN2))}function Gfe(i,t,e,n,r){let o=Math.cos,a=Math.sin,s=o(e/2),l=a(e/2),c=o((t+n)/2),d=a((t+n)/2),h=o((t-n)/2),u=a((t-n)/2),f=o((n-t)/2),_=a((n-t)/2);switch(r){case"XYX":i.set(s*d,l*h,l*u,s*c);break;case"YZY":i.set(l*u,s*d,l*h,s*c);break;case"ZXZ":i.set(l*h,l*u,s*d,s*c);break;case"XZX":i.set(s*d,l*_,l*f,s*c);break;case"YXY":i.set(l*f,s*d,l*_,s*c);break;case"ZYZ":i.set(l*_,l*f,s*d,s*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}function xl(i,t){switch(t.constructor){case Float32Array:return i;case Uint32Array:return i/4294967295;case Uint16Array:return i/65535;case Uint8Array:return i/255;case Int32Array:return Math.max(i/2147483647,-1);case Int16Array:return Math.max(i/32767,-1);case Int8Array:return Math.max(i/127,-1);default:throw new Error("Invalid component type.")}}function Hn(i,t){switch(t.constructor){case Float32Array:return i;case Uint32Array:return Math.round(i*4294967295);case Uint16Array:return Math.round(i*65535);case Uint8Array:return Math.round(i*255);case Int32Array:return Math.round(i*2147483647);case Int16Array:return Math.round(i*32767);case Int8Array:return Math.round(i*127);default:throw new Error("Invalid component type.")}}var bH={DEG2RAD:R_,RAD2DEG:V_,generateUUID:lc,clamp:bo,euclideanModulo:j3,mapLinear:Ffe,inverseLerp:Ife,lerp:O_,damp:Dfe,pingpong:kfe,smoothstep:Pfe,smootherstep:Rfe,randInt:Ofe,randFloat:Lfe,randFloatSpread:Nfe,seededRandom:Ufe,degToRad:Hfe,radToDeg:Vfe,isPowerOfTwo:Qfe,ceilPowerOfTwo:zfe,floorPowerOfTwo:qfe,setQuaternionFromProperEuler:Gfe,normalize:Hn,denormalize:xl},qe=class i{constructor(t=0,e=0){i.prototype.isVector2=!0,this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){let e=this.x,n=this.y,r=t.elements;return this.x=r[0]*e+r[3]*n+r[6],this.y=r[1]*e+r[4]*n+r[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}clampLength(t,e){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(t){let e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;let n=this.dot(t)/e;return Math.acos(bo(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){let e=this.x-t.x,n=this.y-t.y;return e*e+n*n}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){let n=Math.cos(e),r=Math.sin(e),o=this.x-t.x,a=this.y-t.y;return this.x=o*n-a*r+t.x,this.y=o*r+a*n+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}},Fi=class i{constructor(t,e,n,r,o,a,s,l,c){i.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],t!==void 0&&this.set(t,e,n,r,o,a,s,l,c)}set(t,e,n,r,o,a,s,l,c){let d=this.elements;return d[0]=t,d[1]=r,d[2]=s,d[3]=e,d[4]=o,d[5]=l,d[6]=n,d[7]=a,d[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){let e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],this}extractBasis(t,e,n){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(t){let e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){let n=t.elements,r=e.elements,o=this.elements,a=n[0],s=n[3],l=n[6],c=n[1],d=n[4],h=n[7],u=n[2],f=n[5],_=n[8],y=r[0],b=r[3],v=r[6],M=r[1],x=r[4],w=r[7],k=r[2],P=r[5],D=r[8];return o[0]=a*y+s*M+l*k,o[3]=a*b+s*x+l*P,o[6]=a*v+s*w+l*D,o[1]=c*y+d*M+h*k,o[4]=c*b+d*x+h*P,o[7]=c*v+d*w+h*D,o[2]=u*y+f*M+_*k,o[5]=u*b+f*x+_*P,o[8]=u*v+f*w+_*D,this}multiplyScalar(t){let e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){let t=this.elements,e=t[0],n=t[1],r=t[2],o=t[3],a=t[4],s=t[5],l=t[6],c=t[7],d=t[8];return e*a*d-e*s*c-n*o*d+n*s*l+r*o*c-r*a*l}invert(){let t=this.elements,e=t[0],n=t[1],r=t[2],o=t[3],a=t[4],s=t[5],l=t[6],c=t[7],d=t[8],h=d*a-s*c,u=s*l-d*o,f=c*o-a*l,_=e*h+n*u+r*f;if(_===0)return this.set(0,0,0,0,0,0,0,0,0);let y=1/_;return t[0]=h*y,t[1]=(r*c-d*n)*y,t[2]=(s*n-r*a)*y,t[3]=u*y,t[4]=(d*e-r*l)*y,t[5]=(r*o-s*e)*y,t[6]=f*y,t[7]=(n*l-c*e)*y,t[8]=(a*e-n*o)*y,this}transpose(){let t,e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){let e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,n,r,o,a,s){let l=Math.cos(o),c=Math.sin(o);return this.set(n*l,n*c,-n*(l*a+c*s)+a+t,-r*c,r*l,-r*(-c*a+l*s)+s+e,0,0,1),this}scale(t,e){return this.premultiply(qF.makeScale(t,e)),this}rotate(t){return this.premultiply(qF.makeRotation(-t)),this}translate(t,e){return this.premultiply(qF.makeTranslation(t,e)),this}makeTranslation(t,e){return t.isVector2?this.set(1,0,t.x,0,1,t.y,0,0,1):this.set(1,0,t,0,1,e,0,0,1),this}makeRotation(t){let e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,n,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}equals(t){let e=this.elements,n=t.elements;for(let r=0;r<9;r++)if(e[r]!==n[r])return!1;return!0}fromArray(t,e=0){for(let n=0;n<9;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){let n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t}clone(){return new this.constructor().fromArray(this.elements)}},qF=new Fi;function vH(i){for(let t=i.length-1;t>=0;--t)if(i[t]>=65535)return!0;return!1}function Ox(i){return document.createElementNS("http://www.w3.org/1999/xhtml",i)}function Wfe(){let i=Ox("canvas");return i.style.display="block",i}var t9={};function uA(i){i in t9||(t9[i]=!0,console.warn(i))}function jfe(i,t,e){return new Promise(function(n,r){function o(){switch(i.clientWaitSync(t,i.SYNC_FLUSH_COMMANDS_BIT,0)){case i.WAIT_FAILED:r();break;case i.TIMEOUT_EXPIRED:setTimeout(o,e);break;default:n()}}setTimeout(o,e)})}var i9=new Fi().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),n9=new Fi().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),M_={[Wu]:{transfer:Dx,primaries:kx,luminanceCoefficients:[.2126,.7152,.0722],toReference:i=>i,fromReference:i=>i},[Rs]:{transfer:or,primaries:kx,luminanceCoefficients:[.2126,.7152,.0722],toReference:i=>i.convertSRGBToLinear(),fromReference:i=>i.convertLinearToSRGB()},[dw]:{transfer:Dx,primaries:Px,luminanceCoefficients:[.2289,.6917,.0793],toReference:i=>i.applyMatrix3(n9),fromReference:i=>i.applyMatrix3(i9)},[W3]:{transfer:or,primaries:Px,luminanceCoefficients:[.2289,.6917,.0793],toReference:i=>i.convertSRGBToLinear().applyMatrix3(n9),fromReference:i=>i.applyMatrix3(i9).convertLinearToSRGB()}},$fe=new Set([Wu,dw]),On={enabled:!0,_workingColorSpace:Wu,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(i){if(!$fe.has(i))throw new Error(`Unsupported working color space, "${i}".`);this._workingColorSpace=i},convert:function(i,t,e){if(this.enabled===!1||t===e||!t||!e)return i;let n=M_[t].toReference,r=M_[e].fromReference;return r(n(i))},fromWorkingColorSpace:function(i,t){return this.convert(i,this._workingColorSpace,t)},toWorkingColorSpace:function(i,t){return this.convert(i,t,this._workingColorSpace)},getPrimaries:function(i){return M_[i].primaries},getTransfer:function(i){return i===Nu?Dx:M_[i].transfer},getLuminanceCoefficients:function(i,t=this._workingColorSpace){return i.fromArray(M_[t].luminanceCoefficients)}};function hA(i){return i<.04045?i*.0773993808:Math.pow(i*.9478672986+.0521327014,2.4)}function GF(i){return i<.0031308?i*12.92:1.055*Math.pow(i,.41666)-.055}var Vp,e3=class{static getDataURL(t){if(/^data:/i.test(t.src)||typeof HTMLCanvasElement>"u")return t.src;let e;if(t instanceof HTMLCanvasElement)e=t;else{Vp===void 0&&(Vp=Ox("canvas")),Vp.width=t.width,Vp.height=t.height;let n=Vp.getContext("2d");t instanceof ImageData?n.putImageData(t,0,0):n.drawImage(t,0,0,t.width,t.height),e=Vp}return e.width>2048||e.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",t),e.toDataURL("image/jpeg",.6)):e.toDataURL("image/png")}static sRGBToLinear(t){if(typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap){let e=Ox("canvas");e.width=t.width,e.height=t.height;let n=e.getContext("2d");n.drawImage(t,0,0,t.width,t.height);let r=n.getImageData(0,0,t.width,t.height),o=r.data;for(let a=0;a<o.length;a++)o[a]=hA(o[a]/255)*255;return n.putImageData(r,0,0),e}else if(t.data){let e=t.data.slice(0);for(let n=0;n<e.length;n++)e instanceof Uint8Array||e instanceof Uint8ClampedArray?e[n]=Math.floor(hA(e[n]/255)*255):e[n]=hA(e[n]);return{data:e,width:t.width,height:t.height}}else return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),t}},Xfe=0,Lx=class{constructor(t=null){this.isSource=!0,Object.defineProperty(this,"id",{value:Xfe++}),this.uuid=lc(),this.data=t,this.dataReady=!0,this.version=0}set needsUpdate(t){t===!0&&this.version++}toJSON(t){let e=t===void 0||typeof t=="string";if(!e&&t.images[this.uuid]!==void 0)return t.images[this.uuid];let n={uuid:this.uuid,url:""},r=this.data;if(r!==null){let o;if(Array.isArray(r)){o=[];for(let a=0,s=r.length;a<s;a++)r[a].isDataTexture?o.push(WF(r[a].image)):o.push(WF(r[a]))}else o=WF(r);n.url=o}return e||(t.images[this.uuid]=n),n}};function WF(i){return typeof HTMLImageElement<"u"&&i instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&i instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&i instanceof ImageBitmap?e3.getDataURL(i):i.data?{data:Array.from(i.data),width:i.width,height:i.height,type:i.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}var Kfe=0,mc=(()=>{class i extends Id{constructor(e=i.DEFAULT_IMAGE,n=i.DEFAULT_MAPPING,r=Jf,o=Jf,a=as,s=em,l=ss,c=Fd,d=i.DEFAULT_ANISOTROPY,h=Nu){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:Kfe++}),this.uuid=lc(),this.name="",this.source=new Lx(e),this.mipmaps=[],this.mapping=n,this.channel=0,this.wrapS=r,this.wrapT=o,this.magFilter=a,this.minFilter=s,this.anisotropy=d,this.format=l,this.internalFormat=null,this.type=c,this.offset=new qe(0,0),this.repeat=new qe(1,1),this.center=new qe(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Fi,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=h,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.pmremVersion=0}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}toJSON(e){let n=e===void 0||typeof e=="string";if(!n&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];let r={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(r.userData=this.userData),n||(e.textures[this.uuid]=r),r}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==$7)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case AA:e.x=e.x-Math.floor(e.x);break;case Jf:e.x=e.x<0?0:1;break;case MI:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case AA:e.y=e.y-Math.floor(e.y);break;case Jf:e.y=e.y<0?0:1;break;case MI:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}return i.DEFAULT_IMAGE=null,i.DEFAULT_MAPPING=$7,i.DEFAULT_ANISOTROPY=1,i})(),to=class i{constructor(t=0,e=0,n=0,r=1){i.prototype.isVector4=!0,this.x=t,this.y=e,this.z=n,this.w=r}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,n,r){return this.x=t,this.y=e,this.z=n,this.w=r,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w!==void 0?t.w:1,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){let e=this.x,n=this.y,r=this.z,o=this.w,a=t.elements;return this.x=a[0]*e+a[4]*n+a[8]*r+a[12]*o,this.y=a[1]*e+a[5]*n+a[9]*r+a[13]*o,this.z=a[2]*e+a[6]*n+a[10]*r+a[14]*o,this.w=a[3]*e+a[7]*n+a[11]*r+a[15]*o,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);let e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix(t){let e,n,r,o,l=t.elements,c=l[0],d=l[4],h=l[8],u=l[1],f=l[5],_=l[9],y=l[2],b=l[6],v=l[10];if(Math.abs(d-u)<.01&&Math.abs(h-y)<.01&&Math.abs(_-b)<.01){if(Math.abs(d+u)<.1&&Math.abs(h+y)<.1&&Math.abs(_+b)<.1&&Math.abs(c+f+v-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;let x=(c+1)/2,w=(f+1)/2,k=(v+1)/2,P=(d+u)/4,D=(h+y)/4,O=(_+b)/4;return x>w&&x>k?x<.01?(n=0,r=.707106781,o=.707106781):(n=Math.sqrt(x),r=P/n,o=D/n):w>k?w<.01?(n=.707106781,r=0,o=.707106781):(r=Math.sqrt(w),n=P/r,o=O/r):k<.01?(n=.707106781,r=.707106781,o=0):(o=Math.sqrt(k),n=D/o,r=O/o),this.set(n,r,o,e),this}let M=Math.sqrt((b-_)*(b-_)+(h-y)*(h-y)+(u-d)*(u-d));return Math.abs(M)<.001&&(M=1),this.x=(b-_)/M,this.y=(h-y)/M,this.z=(u-d)/M,this.w=Math.acos((c+f+v-1)/2),this}setFromMatrixPosition(t){let e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this.w=e[15],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this.w=Math.max(t,Math.min(e,this.w)),this}clampLength(t,e){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this.w=t.w+(e.w-t.w)*n,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}},t3=class extends Id{constructor(t=1,e=1,n={}){super(),this.isRenderTarget=!0,this.width=t,this.height=e,this.depth=1,this.scissor=new to(0,0,t,e),this.scissorTest=!1,this.viewport=new to(0,0,t,e);let r={width:t,height:e,depth:1};n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:as,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},n);let o=new mc(r,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace);o.flipY=!1,o.generateMipmaps=n.generateMipmaps,o.internalFormat=n.internalFormat,this.textures=[];let a=n.count;for(let s=0;s<a;s++)this.textures[s]=o.clone(),this.textures[s].isRenderTargetTexture=!0;this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.resolveDepthBuffer=n.resolveDepthBuffer,this.resolveStencilBuffer=n.resolveStencilBuffer,this.depthTexture=n.depthTexture,this.samples=n.samples}get texture(){return this.textures[0]}set texture(t){this.textures[0]=t}setSize(t,e,n=1){if(this.width!==t||this.height!==e||this.depth!==n){this.width=t,this.height=e,this.depth=n;for(let r=0,o=this.textures.length;r<o;r++)this.textures[r].image.width=t,this.textures[r].image.height=e,this.textures[r].image.depth=n;this.dispose()}this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)}clone(){return new this.constructor().copy(this)}copy(t){this.width=t.width,this.height=t.height,this.depth=t.depth,this.scissor.copy(t.scissor),this.scissorTest=t.scissorTest,this.viewport.copy(t.viewport),this.textures.length=0;for(let n=0,r=t.textures.length;n<r;n++)this.textures[n]=t.textures[n].clone(),this.textures[n].isRenderTargetTexture=!0;let e=Object.assign({},t.texture.image);return this.texture.source=new Lx(e),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.resolveDepthBuffer=t.resolveDepthBuffer,this.resolveStencilBuffer=t.resolveStencilBuffer,t.depthTexture!==null&&(this.depthTexture=t.depthTexture.clone()),this.samples=t.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}},ls=class extends t3{constructor(t=1,e=1,n={}){super(t,e,n),this.isWebGLRenderTarget=!0}},Nx=class extends mc{constructor(t=null,e=1,n=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:t,width:e,height:n,depth:r},this.magFilter=Os,this.minFilter=Os,this.wrapR=Jf,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(t){this.layerUpdates.add(t)}clearLayerUpdates(){this.layerUpdates.clear()}};var i3=class extends mc{constructor(t=null,e=1,n=1,r=1){super(null),this.isData3DTexture=!0,this.image={data:t,width:e,height:n,depth:r},this.magFilter=Os,this.minFilter=Os,this.wrapR=Jf,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}};var wl=class{constructor(t=0,e=0,n=0,r=1){this.isQuaternion=!0,this._x=t,this._y=e,this._z=n,this._w=r}static slerpFlat(t,e,n,r,o,a,s){let l=n[r+0],c=n[r+1],d=n[r+2],h=n[r+3],u=o[a+0],f=o[a+1],_=o[a+2],y=o[a+3];if(s===0){t[e+0]=l,t[e+1]=c,t[e+2]=d,t[e+3]=h;return}if(s===1){t[e+0]=u,t[e+1]=f,t[e+2]=_,t[e+3]=y;return}if(h!==y||l!==u||c!==f||d!==_){let b=1-s,v=l*u+c*f+d*_+h*y,M=v>=0?1:-1,x=1-v*v;if(x>Number.EPSILON){let k=Math.sqrt(x),P=Math.atan2(k,v*M);b=Math.sin(b*P)/k,s=Math.sin(s*P)/k}let w=s*M;if(l=l*b+u*w,c=c*b+f*w,d=d*b+_*w,h=h*b+y*w,b===1-s){let k=1/Math.sqrt(l*l+c*c+d*d+h*h);l*=k,c*=k,d*=k,h*=k}}t[e]=l,t[e+1]=c,t[e+2]=d,t[e+3]=h}static multiplyQuaternionsFlat(t,e,n,r,o,a){let s=n[r],l=n[r+1],c=n[r+2],d=n[r+3],h=o[a],u=o[a+1],f=o[a+2],_=o[a+3];return t[e]=s*_+d*h+l*f-c*u,t[e+1]=l*_+d*u+c*h-s*f,t[e+2]=c*_+d*f+s*u-l*h,t[e+3]=d*_-s*h-l*u-c*f,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,n,r){return this._x=t,this._y=e,this._z=n,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e=!0){let n=t._x,r=t._y,o=t._z,a=t._order,s=Math.cos,l=Math.sin,c=s(n/2),d=s(r/2),h=s(o/2),u=l(n/2),f=l(r/2),_=l(o/2);switch(a){case"XYZ":this._x=u*d*h+c*f*_,this._y=c*f*h-u*d*_,this._z=c*d*_+u*f*h,this._w=c*d*h-u*f*_;break;case"YXZ":this._x=u*d*h+c*f*_,this._y=c*f*h-u*d*_,this._z=c*d*_-u*f*h,this._w=c*d*h+u*f*_;break;case"ZXY":this._x=u*d*h-c*f*_,this._y=c*f*h+u*d*_,this._z=c*d*_+u*f*h,this._w=c*d*h-u*f*_;break;case"ZYX":this._x=u*d*h-c*f*_,this._y=c*f*h+u*d*_,this._z=c*d*_-u*f*h,this._w=c*d*h+u*f*_;break;case"YZX":this._x=u*d*h+c*f*_,this._y=c*f*h+u*d*_,this._z=c*d*_-u*f*h,this._w=c*d*h-u*f*_;break;case"XZY":this._x=u*d*h-c*f*_,this._y=c*f*h-u*d*_,this._z=c*d*_+u*f*h,this._w=c*d*h+u*f*_;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return e===!0&&this._onChangeCallback(),this}setFromAxisAngle(t,e){let n=e/2,r=Math.sin(n);return this._x=t.x*r,this._y=t.y*r,this._z=t.z*r,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(t){let e=t.elements,n=e[0],r=e[4],o=e[8],a=e[1],s=e[5],l=e[9],c=e[2],d=e[6],h=e[10],u=n+s+h;if(u>0){let f=.5/Math.sqrt(u+1);this._w=.25/f,this._x=(d-l)*f,this._y=(o-c)*f,this._z=(a-r)*f}else if(n>s&&n>h){let f=2*Math.sqrt(1+n-s-h);this._w=(d-l)/f,this._x=.25*f,this._y=(r+a)/f,this._z=(o+c)/f}else if(s>h){let f=2*Math.sqrt(1+s-n-h);this._w=(o-c)/f,this._x=(r+a)/f,this._y=.25*f,this._z=(l+d)/f}else{let f=2*Math.sqrt(1+h-n-s);this._w=(a-r)/f,this._x=(o+c)/f,this._y=(l+d)/f,this._z=.25*f}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let n=t.dot(e)+1;return n<Number.EPSILON?(n=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=n):(this._x=0,this._y=-t.z,this._z=t.y,this._w=n)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=n),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(bo(this.dot(t),-1,1)))}rotateTowards(t,e){let n=this.angleTo(t);if(n===0)return this;let r=Math.min(1,e/n);return this.slerp(t,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return t===0?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){let n=t._x,r=t._y,o=t._z,a=t._w,s=e._x,l=e._y,c=e._z,d=e._w;return this._x=n*d+a*s+r*c-o*l,this._y=r*d+a*l+o*s-n*c,this._z=o*d+a*c+n*l-r*s,this._w=a*d-n*s-r*l-o*c,this._onChangeCallback(),this}slerp(t,e){if(e===0)return this;if(e===1)return this.copy(t);let n=this._x,r=this._y,o=this._z,a=this._w,s=a*t._w+n*t._x+r*t._y+o*t._z;if(s<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,s=-s):this.copy(t),s>=1)return this._w=a,this._x=n,this._y=r,this._z=o,this;let l=1-s*s;if(l<=Number.EPSILON){let f=1-e;return this._w=f*a+e*this._w,this._x=f*n+e*this._x,this._y=f*r+e*this._y,this._z=f*o+e*this._z,this.normalize(),this}let c=Math.sqrt(l),d=Math.atan2(c,s),h=Math.sin((1-e)*d)/c,u=Math.sin(e*d)/c;return this._w=a*h+this._w*u,this._x=n*h+this._x*u,this._y=r*h+this._y*u,this._z=o*h+this._z*u,this._onChangeCallback(),this}slerpQuaternions(t,e,n){return this.copy(t).slerp(e,n)}random(){let t=2*Math.PI*Math.random(),e=2*Math.PI*Math.random(),n=Math.random(),r=Math.sqrt(1-n),o=Math.sqrt(n);return this.set(r*Math.sin(t),r*Math.cos(t),o*Math.sin(e),o*Math.cos(e))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}},ce=class i{constructor(t=0,e=0,n=0){i.prototype.isVector3=!0,this.x=t,this.y=e,this.z=n}set(t,e,n){return n===void 0&&(n=this.z),this.x=t,this.y=e,this.z=n,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return this.applyQuaternion(r9.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(r9.setFromAxisAngle(t,e))}applyMatrix3(t){let e=this.x,n=this.y,r=this.z,o=t.elements;return this.x=o[0]*e+o[3]*n+o[6]*r,this.y=o[1]*e+o[4]*n+o[7]*r,this.z=o[2]*e+o[5]*n+o[8]*r,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){let e=this.x,n=this.y,r=this.z,o=t.elements,a=1/(o[3]*e+o[7]*n+o[11]*r+o[15]);return this.x=(o[0]*e+o[4]*n+o[8]*r+o[12])*a,this.y=(o[1]*e+o[5]*n+o[9]*r+o[13])*a,this.z=(o[2]*e+o[6]*n+o[10]*r+o[14])*a,this}applyQuaternion(t){let e=this.x,n=this.y,r=this.z,o=t.x,a=t.y,s=t.z,l=t.w,c=2*(a*r-s*n),d=2*(s*e-o*r),h=2*(o*n-a*e);return this.x=e+l*c+a*h-s*d,this.y=n+l*d+s*c-o*h,this.z=r+l*h+o*d-a*c,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){let e=this.x,n=this.y,r=this.z,o=t.elements;return this.x=o[0]*e+o[4]*n+o[8]*r,this.y=o[1]*e+o[5]*n+o[9]*r,this.z=o[2]*e+o[6]*n+o[10]*r,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this}clampLength(t,e){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){let n=t.x,r=t.y,o=t.z,a=e.x,s=e.y,l=e.z;return this.x=r*l-o*s,this.y=o*a-n*l,this.z=n*s-r*a,this}projectOnVector(t){let e=t.lengthSq();if(e===0)return this.set(0,0,0);let n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)}projectOnPlane(t){return jF.copy(this).projectOnVector(t),this.sub(jF)}reflect(t){return this.sub(jF.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){let e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;let n=this.dot(t)/e;return Math.acos(bo(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){let e=this.x-t.x,n=this.y-t.y,r=this.z-t.z;return e*e+n*n+r*r}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,n){let r=Math.sin(e)*t;return this.x=r*Math.sin(n),this.y=Math.cos(e)*t,this.z=r*Math.cos(n),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,n){return this.x=t*Math.sin(e),this.y=n,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){let e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){let e=this.setFromMatrixColumn(t,0).length(),n=this.setFromMatrixColumn(t,1).length(),r=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=n,this.z=r,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,e*4)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,e*3)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){let t=Math.random()*Math.PI*2,e=Math.random()*2-1,n=Math.sqrt(1-e*e);return this.x=n*Math.cos(t),this.y=e,this.z=n*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}},jF=new ce,r9=new wl,Po=class{constructor(t=new ce(1/0,1/0,1/0),e=new ce(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){this.makeEmpty();for(let e=0,n=t.length;e<n;e+=3)this.expandByPoint(_l.fromArray(t,e));return this}setFromBufferAttribute(t){this.makeEmpty();for(let e=0,n=t.count;e<n;e++)this.expandByPoint(_l.fromBufferAttribute(t,e));return this}setFromPoints(t){this.makeEmpty();for(let e=0,n=t.length;e<n;e++)this.expandByPoint(t[e]);return this}setFromCenterAndSize(t,e){let n=_l.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(n),this.max.copy(t).add(n),this}setFromObject(t,e=!1){return this.makeEmpty(),this.expandByObject(t,e)}clone(){return new this.constructor().copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(t){return this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}expandByObject(t,e=!1){t.updateWorldMatrix(!1,!1);let n=t.geometry;if(n!==void 0){let o=n.getAttribute("position");if(e===!0&&o!==void 0&&t.isInstancedMesh!==!0)for(let a=0,s=o.count;a<s;a++)t.isMesh===!0?t.getVertexPosition(a,_l):_l.fromBufferAttribute(o,a),_l.applyMatrix4(t.matrixWorld),this.expandByPoint(_l);else t.boundingBox!==void 0?(t.boundingBox===null&&t.computeBoundingBox(),j1.copy(t.boundingBox)):(n.boundingBox===null&&n.computeBoundingBox(),j1.copy(n.boundingBox)),j1.applyMatrix4(t.matrixWorld),this.union(j1)}let r=t.children;for(let o=0,a=r.length;o<a;o++)this.expandByObject(r[o],e);return this}containsPoint(t){return t.x>=this.min.x&&t.x<=this.max.x&&t.y>=this.min.y&&t.y<=this.max.y&&t.z>=this.min.z&&t.z<=this.max.z}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return t.max.x>=this.min.x&&t.min.x<=this.max.x&&t.max.y>=this.min.y&&t.min.y<=this.max.y&&t.max.z>=this.min.z&&t.min.z<=this.max.z}intersectsSphere(t){return this.clampPoint(t.center,_l),_l.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,n;return t.normal.x>0?(e=t.normal.x*this.min.x,n=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,n=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,n+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,n+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,n+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,n+=t.normal.z*this.min.z),e<=-t.constant&&n>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(S_),$1.subVectors(this.max,S_),Qp.subVectors(t.a,S_),zp.subVectors(t.b,S_),qp.subVectors(t.c,S_),Du.subVectors(zp,Qp),ku.subVectors(qp,zp),qf.subVectors(Qp,qp);let e=[0,-Du.z,Du.y,0,-ku.z,ku.y,0,-qf.z,qf.y,Du.z,0,-Du.x,ku.z,0,-ku.x,qf.z,0,-qf.x,-Du.y,Du.x,0,-ku.y,ku.x,0,-qf.y,qf.x,0];return!$F(e,Qp,zp,qp,$1)||(e=[1,0,0,0,1,0,0,0,1],!$F(e,Qp,zp,qp,$1))?!1:(X1.crossVectors(Du,ku),e=[X1.x,X1.y,X1.z],$F(e,Qp,zp,qp,$1))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,_l).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=this.getSize(_l).length()*.5),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()?this:(vd[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),vd[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),vd[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),vd[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),vd[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),vd[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),vd[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),vd[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(vd),this)}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}},vd=[new ce,new ce,new ce,new ce,new ce,new ce,new ce,new ce],_l=new ce,j1=new Po,Qp=new ce,zp=new ce,qp=new ce,Du=new ce,ku=new ce,qf=new ce,S_=new ce,$1=new ce,X1=new ce,Gf=new ce;function $F(i,t,e,n,r){for(let o=0,a=i.length-3;o<=a;o+=3){Gf.fromArray(i,o);let s=r.x*Math.abs(Gf.x)+r.y*Math.abs(Gf.y)+r.z*Math.abs(Gf.z),l=t.dot(Gf),c=e.dot(Gf),d=n.dot(Gf);if(Math.max(-Math.max(l,c,d),Math.min(l,c,d))>s)return!1}return!0}var Yfe=new Po,E_=new ce,XF=new ce,dc=class{constructor(t=new ce,e=-1){this.isSphere=!0,this.center=t,this.radius=e}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){let n=this.center;e!==void 0?n.copy(e):Yfe.setFromPoints(t).getCenter(n);let r=0;for(let o=0,a=t.length;o<a;o++)r=Math.max(r,n.distanceToSquared(t[o]));return this.radius=Math.sqrt(r),this}copy(t){return this.center.copy(t.center),this.radius=t.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(t){return t.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(t){return t.distanceTo(this.center)-this.radius}intersectsSphere(t){let e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e}intersectsBox(t){return t.intersectsSphere(this)}intersectsPlane(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius}clampPoint(t,e){let n=this.center.distanceToSquared(t);return e.copy(t),n>this.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;E_.subVectors(t,this.center);let e=E_.lengthSq();if(e>this.radius*this.radius){let n=Math.sqrt(e),r=(n-this.radius)*.5;this.center.addScaledVector(E_,r/n),this.radius+=r}return this}union(t){return t.isEmpty()?this:this.isEmpty()?(this.copy(t),this):(this.center.equals(t.center)===!0?this.radius=Math.max(this.radius,t.radius):(XF.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(E_.copy(t.center).add(XF)),this.expandByPoint(E_.copy(t.center).sub(XF))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return new this.constructor().copy(this)}},yd=new ce,KF=new ce,K1=new ce,Pu=new ce,YF=new ce,Y1=new ce,ZF=new ce,Dd=class{constructor(t=new ce,e=new ce(0,0,-1)){this.origin=t,this.direction=e}set(t,e){return this.origin.copy(t),this.direction.copy(e),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,e){return e.copy(this.origin).addScaledVector(this.direction,t)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,yd)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);let n=e.dot(this.direction);return n<0?e.copy(this.origin):e.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){let e=yd.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(yd.copy(this.origin).addScaledVector(this.direction,e),yd.distanceToSquared(t))}distanceSqToSegment(t,e,n,r){KF.copy(t).add(e).multiplyScalar(.5),K1.copy(e).sub(t).normalize(),Pu.copy(this.origin).sub(KF);let o=t.distanceTo(e)*.5,a=-this.direction.dot(K1),s=Pu.dot(this.direction),l=-Pu.dot(K1),c=Pu.lengthSq(),d=Math.abs(1-a*a),h,u,f,_;if(d>0)if(h=a*l-s,u=a*s-l,_=o*d,h>=0)if(u>=-_)if(u<=_){let y=1/d;h*=y,u*=y,f=h*(h+a*u+2*s)+u*(a*h+u+2*l)+c}else u=o,h=Math.max(0,-(a*u+s)),f=-h*h+u*(u+2*l)+c;else u=-o,h=Math.max(0,-(a*u+s)),f=-h*h+u*(u+2*l)+c;else u<=-_?(h=Math.max(0,-(-a*o+s)),u=h>0?-o:Math.min(Math.max(-o,-l),o),f=-h*h+u*(u+2*l)+c):u<=_?(h=0,u=Math.min(Math.max(-o,-l),o),f=u*(u+2*l)+c):(h=Math.max(0,-(a*o+s)),u=h>0?o:Math.min(Math.max(-o,-l),o),f=-h*h+u*(u+2*l)+c);else u=a>0?-o:o,h=Math.max(0,-(a*u+s)),f=-h*h+u*(u+2*l)+c;return n&&n.copy(this.origin).addScaledVector(this.direction,h),r&&r.copy(KF).addScaledVector(K1,u),f}intersectSphere(t,e){yd.subVectors(t.center,this.origin);let n=yd.dot(this.direction),r=yd.dot(yd)-n*n,o=t.radius*t.radius;if(r>o)return null;let a=Math.sqrt(o-r),s=n-a,l=n+a;return l<0?null:s<0?this.at(l,e):this.at(s,e)}intersectsSphere(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){let e=t.normal.dot(this.direction);if(e===0)return t.distanceToPoint(this.origin)===0?0:null;let n=-(this.origin.dot(t.normal)+t.constant)/e;return n>=0?n:null}intersectPlane(t,e){let n=this.distanceToPlane(t);return n===null?null:this.at(n,e)}intersectsPlane(t){let e=t.distanceToPoint(this.origin);return e===0||t.normal.dot(this.direction)*e<0}intersectBox(t,e){let n,r,o,a,s,l,c=1/this.direction.x,d=1/this.direction.y,h=1/this.direction.z,u=this.origin;return c>=0?(n=(t.min.x-u.x)*c,r=(t.max.x-u.x)*c):(n=(t.max.x-u.x)*c,r=(t.min.x-u.x)*c),d>=0?(o=(t.min.y-u.y)*d,a=(t.max.y-u.y)*d):(o=(t.max.y-u.y)*d,a=(t.min.y-u.y)*d),n>a||o>r||((o>n||isNaN(n))&&(n=o),(a<r||isNaN(r))&&(r=a),h>=0?(s=(t.min.z-u.z)*h,l=(t.max.z-u.z)*h):(s=(t.max.z-u.z)*h,l=(t.min.z-u.z)*h),n>l||s>r)||((s>n||n!==n)&&(n=s),(l<r||r!==r)&&(r=l),r<0)?null:this.at(n>=0?n:r,e)}intersectsBox(t){return this.intersectBox(t,yd)!==null}intersectTriangle(t,e,n,r,o){YF.subVectors(e,t),Y1.subVectors(n,t),ZF.crossVectors(YF,Y1);let a=this.direction.dot(ZF),s;if(a>0){if(r)return null;s=1}else if(a<0)s=-1,a=-a;else return null;Pu.subVectors(this.origin,t);let l=s*this.direction.dot(Y1.crossVectors(Pu,Y1));if(l<0)return null;let c=s*this.direction.dot(YF.cross(Pu));if(c<0||l+c>a)return null;let d=-s*Pu.dot(ZF);return d<0?null:this.at(d/a,o)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}},pr=class i{constructor(t,e,n,r,o,a,s,l,c,d,h,u,f,_,y,b){i.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],t!==void 0&&this.set(t,e,n,r,o,a,s,l,c,d,h,u,f,_,y,b)}set(t,e,n,r,o,a,s,l,c,d,h,u,f,_,y,b){let v=this.elements;return v[0]=t,v[4]=e,v[8]=n,v[12]=r,v[1]=o,v[5]=a,v[9]=s,v[13]=l,v[2]=c,v[6]=d,v[10]=h,v[14]=u,v[3]=f,v[7]=_,v[11]=y,v[15]=b,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new i().fromArray(this.elements)}copy(t){let e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],this}copyPosition(t){let e=this.elements,n=t.elements;return e[12]=n[12],e[13]=n[13],e[14]=n[14],this}setFromMatrix3(t){let e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,n){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(t,e,n){return this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1),this}extractRotation(t){let e=this.elements,n=t.elements,r=1/Gp.setFromMatrixColumn(t,0).length(),o=1/Gp.setFromMatrixColumn(t,1).length(),a=1/Gp.setFromMatrixColumn(t,2).length();return e[0]=n[0]*r,e[1]=n[1]*r,e[2]=n[2]*r,e[3]=0,e[4]=n[4]*o,e[5]=n[5]*o,e[6]=n[6]*o,e[7]=0,e[8]=n[8]*a,e[9]=n[9]*a,e[10]=n[10]*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){let e=this.elements,n=t.x,r=t.y,o=t.z,a=Math.cos(n),s=Math.sin(n),l=Math.cos(r),c=Math.sin(r),d=Math.cos(o),h=Math.sin(o);if(t.order==="XYZ"){let u=a*d,f=a*h,_=s*d,y=s*h;e[0]=l*d,e[4]=-l*h,e[8]=c,e[1]=f+_*c,e[5]=u-y*c,e[9]=-s*l,e[2]=y-u*c,e[6]=_+f*c,e[10]=a*l}else if(t.order==="YXZ"){let u=l*d,f=l*h,_=c*d,y=c*h;e[0]=u+y*s,e[4]=_*s-f,e[8]=a*c,e[1]=a*h,e[5]=a*d,e[9]=-s,e[2]=f*s-_,e[6]=y+u*s,e[10]=a*l}else if(t.order==="ZXY"){let u=l*d,f=l*h,_=c*d,y=c*h;e[0]=u-y*s,e[4]=-a*h,e[8]=_+f*s,e[1]=f+_*s,e[5]=a*d,e[9]=y-u*s,e[2]=-a*c,e[6]=s,e[10]=a*l}else if(t.order==="ZYX"){let u=a*d,f=a*h,_=s*d,y=s*h;e[0]=l*d,e[4]=_*c-f,e[8]=u*c+y,e[1]=l*h,e[5]=y*c+u,e[9]=f*c-_,e[2]=-c,e[6]=s*l,e[10]=a*l}else if(t.order==="YZX"){let u=a*l,f=a*c,_=s*l,y=s*c;e[0]=l*d,e[4]=y-u*h,e[8]=_*h+f,e[1]=h,e[5]=a*d,e[9]=-s*d,e[2]=-c*d,e[6]=f*h+_,e[10]=u-y*h}else if(t.order==="XZY"){let u=a*l,f=a*c,_=s*l,y=s*c;e[0]=l*d,e[4]=-h,e[8]=c*d,e[1]=u*h+y,e[5]=a*d,e[9]=f*h-_,e[2]=_*h-f,e[6]=s*d,e[10]=y*h+u}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(Zfe,t,Jfe)}lookAt(t,e,n){let r=this.elements;return rs.subVectors(t,e),rs.lengthSq()===0&&(rs.z=1),rs.normalize(),Ru.crossVectors(n,rs),Ru.lengthSq()===0&&(Math.abs(n.z)===1?rs.x+=1e-4:rs.z+=1e-4,rs.normalize(),Ru.crossVectors(n,rs)),Ru.normalize(),Z1.crossVectors(rs,Ru),r[0]=Ru.x,r[4]=Z1.x,r[8]=rs.x,r[1]=Ru.y,r[5]=Z1.y,r[9]=rs.y,r[2]=Ru.z,r[6]=Z1.z,r[10]=rs.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){let n=t.elements,r=e.elements,o=this.elements,a=n[0],s=n[4],l=n[8],c=n[12],d=n[1],h=n[5],u=n[9],f=n[13],_=n[2],y=n[6],b=n[10],v=n[14],M=n[3],x=n[7],w=n[11],k=n[15],P=r[0],D=r[4],O=r[8],E=r[12],B=r[1],L=r[5],q=r[9],W=r[13],oe=r[2],pe=r[6],ge=r[10],de=r[14],U=r[3],J=r[7],Pe=r[11],We=r[15];return o[0]=a*P+s*B+l*oe+c*U,o[4]=a*D+s*L+l*pe+c*J,o[8]=a*O+s*q+l*ge+c*Pe,o[12]=a*E+s*W+l*de+c*We,o[1]=d*P+h*B+u*oe+f*U,o[5]=d*D+h*L+u*pe+f*J,o[9]=d*O+h*q+u*ge+f*Pe,o[13]=d*E+h*W+u*de+f*We,o[2]=_*P+y*B+b*oe+v*U,o[6]=_*D+y*L+b*pe+v*J,o[10]=_*O+y*q+b*ge+v*Pe,o[14]=_*E+y*W+b*de+v*We,o[3]=M*P+x*B+w*oe+k*U,o[7]=M*D+x*L+w*pe+k*J,o[11]=M*O+x*q+w*ge+k*Pe,o[15]=M*E+x*W+w*de+k*We,this}multiplyScalar(t){let e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){let t=this.elements,e=t[0],n=t[4],r=t[8],o=t[12],a=t[1],s=t[5],l=t[9],c=t[13],d=t[2],h=t[6],u=t[10],f=t[14],_=t[3],y=t[7],b=t[11],v=t[15];return _*(+o*l*h-r*c*h-o*s*u+n*c*u+r*s*f-n*l*f)+y*(+e*l*f-e*c*u+o*a*u-r*a*f+r*c*d-o*l*d)+b*(+e*c*h-e*s*f-o*a*h+n*a*f+o*s*d-n*c*d)+v*(-r*s*d-e*l*h+e*s*u+r*a*h-n*a*u+n*l*d)}transpose(){let t=this.elements,e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,n){let r=this.elements;return t.isVector3?(r[12]=t.x,r[13]=t.y,r[14]=t.z):(r[12]=t,r[13]=e,r[14]=n),this}invert(){let t=this.elements,e=t[0],n=t[1],r=t[2],o=t[3],a=t[4],s=t[5],l=t[6],c=t[7],d=t[8],h=t[9],u=t[10],f=t[11],_=t[12],y=t[13],b=t[14],v=t[15],M=h*b*c-y*u*c+y*l*f-s*b*f-h*l*v+s*u*v,x=_*u*c-d*b*c-_*l*f+a*b*f+d*l*v-a*u*v,w=d*y*c-_*h*c+_*s*f-a*y*f-d*s*v+a*h*v,k=_*h*l-d*y*l-_*s*u+a*y*u+d*s*b-a*h*b,P=e*M+n*x+r*w+o*k;if(P===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let D=1/P;return t[0]=M*D,t[1]=(y*u*o-h*b*o-y*r*f+n*b*f+h*r*v-n*u*v)*D,t[2]=(s*b*o-y*l*o+y*r*c-n*b*c-s*r*v+n*l*v)*D,t[3]=(h*l*o-s*u*o-h*r*c+n*u*c+s*r*f-n*l*f)*D,t[4]=x*D,t[5]=(d*b*o-_*u*o+_*r*f-e*b*f-d*r*v+e*u*v)*D,t[6]=(_*l*o-a*b*o-_*r*c+e*b*c+a*r*v-e*l*v)*D,t[7]=(a*u*o-d*l*o+d*r*c-e*u*c-a*r*f+e*l*f)*D,t[8]=w*D,t[9]=(_*h*o-d*y*o-_*n*f+e*y*f+d*n*v-e*h*v)*D,t[10]=(a*y*o-_*s*o+_*n*c-e*y*c-a*n*v+e*s*v)*D,t[11]=(d*s*o-a*h*o-d*n*c+e*h*c+a*n*f-e*s*f)*D,t[12]=k*D,t[13]=(d*y*r-_*h*r+_*n*u-e*y*u-d*n*b+e*h*b)*D,t[14]=(_*s*r-a*y*r-_*n*l+e*y*l+a*n*b-e*s*b)*D,t[15]=(a*h*r-d*s*r+d*n*l-e*h*l-a*n*u+e*s*u)*D,this}scale(t){let e=this.elements,n=t.x,r=t.y,o=t.z;return e[0]*=n,e[4]*=r,e[8]*=o,e[1]*=n,e[5]*=r,e[9]*=o,e[2]*=n,e[6]*=r,e[10]*=o,e[3]*=n,e[7]*=r,e[11]*=o,this}getMaxScaleOnAxis(){let t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],r=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,r))}makeTranslation(t,e,n){return t.isVector3?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,e,0,0,1,n,0,0,0,1),this}makeRotationX(t){let e=Math.cos(t),n=Math.sin(t);return this.set(1,0,0,0,0,e,-n,0,0,n,e,0,0,0,0,1),this}makeRotationY(t){let e=Math.cos(t),n=Math.sin(t);return this.set(e,0,n,0,0,1,0,0,-n,0,e,0,0,0,0,1),this}makeRotationZ(t){let e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,0,n,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){let n=Math.cos(e),r=Math.sin(e),o=1-n,a=t.x,s=t.y,l=t.z,c=o*a,d=o*s;return this.set(c*a+n,c*s-r*l,c*l+r*s,0,c*s+r*l,d*s+n,d*l-r*a,0,c*l-r*s,d*l+r*a,o*l*l+n,0,0,0,0,1),this}makeScale(t,e,n){return this.set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1),this}makeShear(t,e,n,r,o,a){return this.set(1,n,o,0,t,1,a,0,e,r,1,0,0,0,0,1),this}compose(t,e,n){let r=this.elements,o=e._x,a=e._y,s=e._z,l=e._w,c=o+o,d=a+a,h=s+s,u=o*c,f=o*d,_=o*h,y=a*d,b=a*h,v=s*h,M=l*c,x=l*d,w=l*h,k=n.x,P=n.y,D=n.z;return r[0]=(1-(y+v))*k,r[1]=(f+w)*k,r[2]=(_-x)*k,r[3]=0,r[4]=(f-w)*P,r[5]=(1-(u+v))*P,r[6]=(b+M)*P,r[7]=0,r[8]=(_+x)*D,r[9]=(b-M)*D,r[10]=(1-(u+y))*D,r[11]=0,r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=1,this}decompose(t,e,n){let r=this.elements,o=Gp.set(r[0],r[1],r[2]).length(),a=Gp.set(r[4],r[5],r[6]).length(),s=Gp.set(r[8],r[9],r[10]).length();this.determinant()<0&&(o=-o),t.x=r[12],t.y=r[13],t.z=r[14],bl.copy(this);let c=1/o,d=1/a,h=1/s;return bl.elements[0]*=c,bl.elements[1]*=c,bl.elements[2]*=c,bl.elements[4]*=d,bl.elements[5]*=d,bl.elements[6]*=d,bl.elements[8]*=h,bl.elements[9]*=h,bl.elements[10]*=h,e.setFromRotationMatrix(bl),n.x=o,n.y=a,n.z=s,this}makePerspective(t,e,n,r,o,a,s=Bd){let l=this.elements,c=2*o/(e-t),d=2*o/(n-r),h=(e+t)/(e-t),u=(n+r)/(n-r),f,_;if(s===Bd)f=-(a+o)/(a-o),_=-2*a*o/(a-o);else if(s===Rx)f=-a/(a-o),_=-a*o/(a-o);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+s);return l[0]=c,l[4]=0,l[8]=h,l[12]=0,l[1]=0,l[5]=d,l[9]=u,l[13]=0,l[2]=0,l[6]=0,l[10]=f,l[14]=_,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(t,e,n,r,o,a,s=Bd){let l=this.elements,c=1/(e-t),d=1/(n-r),h=1/(a-o),u=(e+t)*c,f=(n+r)*d,_,y;if(s===Bd)_=(a+o)*h,y=-2*h;else if(s===Rx)_=o*h,y=-1*h;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+s);return l[0]=2*c,l[4]=0,l[8]=0,l[12]=-u,l[1]=0,l[5]=2*d,l[9]=0,l[13]=-f,l[2]=0,l[6]=0,l[10]=y,l[14]=-_,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(t){let e=this.elements,n=t.elements;for(let r=0;r<16;r++)if(e[r]!==n[r])return!1;return!0}fromArray(t,e=0){for(let n=0;n<16;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){let n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t[e+9]=n[9],t[e+10]=n[10],t[e+11]=n[11],t[e+12]=n[12],t[e+13]=n[13],t[e+14]=n[14],t[e+15]=n[15],t}},Gp=new ce,bl=new pr,Zfe=new ce(0,0,0),Jfe=new ce(1,1,1),Ru=new ce,Z1=new ce,rs=new ce,o9=new pr,a9=new wl,nm=(()=>{class i{constructor(e=0,n=0,r=0,o=i.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=n,this._z=r,this._order=o}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,n,r,o=this._order){return this._x=e,this._y=n,this._z=r,this._order=o,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,n=this._order,r=!0){let o=e.elements,a=o[0],s=o[4],l=o[8],c=o[1],d=o[5],h=o[9],u=o[2],f=o[6],_=o[10];switch(n){case"XYZ":this._y=Math.asin(bo(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-h,_),this._z=Math.atan2(-s,a)):(this._x=Math.atan2(f,d),this._z=0);break;case"YXZ":this._x=Math.asin(-bo(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(l,_),this._z=Math.atan2(c,d)):(this._y=Math.atan2(-u,a),this._z=0);break;case"ZXY":this._x=Math.asin(bo(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(-u,_),this._z=Math.atan2(-s,d)):(this._y=0,this._z=Math.atan2(c,a));break;case"ZYX":this._y=Math.asin(-bo(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(f,_),this._z=Math.atan2(c,a)):(this._x=0,this._z=Math.atan2(-s,d));break;case"YZX":this._z=Math.asin(bo(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(-h,d),this._y=Math.atan2(-u,a)):(this._x=0,this._y=Math.atan2(l,_));break;case"XZY":this._z=Math.asin(-bo(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(f,d),this._y=Math.atan2(l,a)):(this._x=Math.atan2(-h,_),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+n)}return this._order=n,r===!0&&this._onChangeCallback(),this}setFromQuaternion(e,n,r){return o9.makeRotationFromQuaternion(e),this.setFromRotationMatrix(o9,n,r)}setFromVector3(e,n=this._order){return this.set(e.x,e.y,e.z,n)}reorder(e){return a9.setFromEuler(this),this.setFromQuaternion(a9,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}return i.DEFAULT_ORDER="XYZ",i})(),Q_=class{constructor(){this.mask=1}set(t){this.mask=(1<<t|0)>>>0}enable(t){this.mask|=1<<t|0}enableAll(){this.mask=-1}toggle(t){this.mask^=1<<t|0}disable(t){this.mask&=~(1<<t|0)}disableAll(){this.mask=0}test(t){return(this.mask&t.mask)!==0}isEnabled(t){return(this.mask&(1<<t|0))!==0}},eme=0,s9=new ce,Wp=new wl,xd=new pr,J1=new ce,T_=new ce,tme=new ce,ime=new wl,l9=new ce(1,0,0),c9=new ce(0,1,0),d9=new ce(0,0,1),u9={type:"added"},nme={type:"removed"},jp={type:"childadded",child:null},JF={type:"childremoved",child:null},Ls=(()=>{class i extends Id{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:eme++}),this.uuid=lc(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=i.DEFAULT_UP.clone();let e=new ce,n=new nm,r=new wl,o=new ce(1,1,1);function a(){r.setFromEuler(n,!1)}function s(){n.setFromQuaternion(r,void 0,!1)}n._onChange(a),r._onChange(s),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:n},quaternion:{configurable:!0,enumerable:!0,value:r},scale:{configurable:!0,enumerable:!0,value:o},modelViewMatrix:{value:new pr},normalMatrix:{value:new Fi}}),this.matrix=new pr,this.matrixWorld=new pr,this.matrixAutoUpdate=i.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=i.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new Q_,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,n){this.quaternion.setFromAxisAngle(e,n)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,n){return Wp.setFromAxisAngle(e,n),this.quaternion.multiply(Wp),this}rotateOnWorldAxis(e,n){return Wp.setFromAxisAngle(e,n),this.quaternion.premultiply(Wp),this}rotateX(e){return this.rotateOnAxis(l9,e)}rotateY(e){return this.rotateOnAxis(c9,e)}rotateZ(e){return this.rotateOnAxis(d9,e)}translateOnAxis(e,n){return s9.copy(e).applyQuaternion(this.quaternion),this.position.add(s9.multiplyScalar(n)),this}translateX(e){return this.translateOnAxis(l9,e)}translateY(e){return this.translateOnAxis(c9,e)}translateZ(e){return this.translateOnAxis(d9,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(xd.copy(this.matrixWorld).invert())}lookAt(e,n,r){e.isVector3?J1.copy(e):J1.set(e,n,r);let o=this.parent;this.updateWorldMatrix(!0,!1),T_.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?xd.lookAt(T_,J1,this.up):xd.lookAt(J1,T_,this.up),this.quaternion.setFromRotationMatrix(xd),o&&(xd.extractRotation(o.matrixWorld),Wp.setFromRotationMatrix(xd),this.quaternion.premultiply(Wp.invert()))}add(e){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.add(arguments[n]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(u9),jp.child=e,this.dispatchEvent(jp),jp.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let r=0;r<arguments.length;r++)this.remove(arguments[r]);return this}let n=this.children.indexOf(e);return n!==-1&&(e.parent=null,this.children.splice(n,1),e.dispatchEvent(nme),JF.child=e,this.dispatchEvent(JF),JF.child=null),this}removeFromParent(){let e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),xd.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),xd.multiply(e.parent.matrixWorld)),e.applyMatrix4(xd),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(u9),jp.child=e,this.dispatchEvent(jp),jp.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,n){if(this[e]===n)return this;for(let r=0,o=this.children.length;r<o;r++){let s=this.children[r].getObjectByProperty(e,n);if(s!==void 0)return s}}getObjectsByProperty(e,n,r=[]){this[e]===n&&r.push(this);let o=this.children;for(let a=0,s=o.length;a<s;a++)o[a].getObjectsByProperty(e,n,r);return r}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(T_,e,tme),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(T_,ime,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);let n=this.matrixWorld.elements;return e.set(n[8],n[9],n[10]).normalize()}raycast(){}traverse(e){e(this);let n=this.children;for(let r=0,o=n.length;r<o;r++)n[r].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);let n=this.children;for(let r=0,o=n.length;r<o;r++)n[r].traverseVisible(e)}traverseAncestors(e){let n=this.parent;n!==null&&(e(n),n.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);let n=this.children;for(let r=0,o=n.length;r<o;r++)n[r].updateMatrixWorld(e)}updateWorldMatrix(e,n){let r=this.parent;if(e===!0&&r!==null&&r.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),n===!0){let o=this.children;for(let a=0,s=o.length;a<s;a++)o[a].updateWorldMatrix(!1,!0)}}toJSON(e){let n=e===void 0||typeof e=="string",r={};n&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},r.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"});let o={};o.uuid=this.uuid,o.type=this.type,this.name!==""&&(o.name=this.name),this.castShadow===!0&&(o.castShadow=!0),this.receiveShadow===!0&&(o.receiveShadow=!0),this.visible===!1&&(o.visible=!1),this.frustumCulled===!1&&(o.frustumCulled=!1),this.renderOrder!==0&&(o.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(o.userData=this.userData),o.layers=this.layers.mask,o.matrix=this.matrix.toArray(),o.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(o.matrixAutoUpdate=!1),this.isInstancedMesh&&(o.type="InstancedMesh",o.count=this.count,o.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(o.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(o.type="BatchedMesh",o.perObjectFrustumCulled=this.perObjectFrustumCulled,o.sortObjects=this.sortObjects,o.drawRanges=this._drawRanges,o.reservedRanges=this._reservedRanges,o.visibility=this._visibility,o.active=this._active,o.bounds=this._bounds.map(l=>({boxInitialized:l.boxInitialized,boxMin:l.box.min.toArray(),boxMax:l.box.max.toArray(),sphereInitialized:l.sphereInitialized,sphereRadius:l.sphere.radius,sphereCenter:l.sphere.center.toArray()})),o.maxInstanceCount=this._maxInstanceCount,o.maxVertexCount=this._maxVertexCount,o.maxIndexCount=this._maxIndexCount,o.geometryInitialized=this._geometryInitialized,o.geometryCount=this._geometryCount,o.matricesTexture=this._matricesTexture.toJSON(e),this._colorsTexture!==null&&(o.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(o.boundingSphere={center:o.boundingSphere.center.toArray(),radius:o.boundingSphere.radius}),this.boundingBox!==null&&(o.boundingBox={min:o.boundingBox.min.toArray(),max:o.boundingBox.max.toArray()}));function a(l,c){return l[c.uuid]===void 0&&(l[c.uuid]=c.toJSON(e)),c.uuid}if(this.isScene)this.background&&(this.background.isColor?o.background=this.background.toJSON():this.background.isTexture&&(o.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(o.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){o.geometry=a(e.geometries,this.geometry);let l=this.geometry.parameters;if(l!==void 0&&l.shapes!==void 0){let c=l.shapes;if(Array.isArray(c))for(let d=0,h=c.length;d<h;d++){let u=c[d];a(e.shapes,u)}else a(e.shapes,c)}}if(this.isSkinnedMesh&&(o.bindMode=this.bindMode,o.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(a(e.skeletons,this.skeleton),o.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){let l=[];for(let c=0,d=this.material.length;c<d;c++)l.push(a(e.materials,this.material[c]));o.material=l}else o.material=a(e.materials,this.material);if(this.children.length>0){o.children=[];for(let l=0;l<this.children.length;l++)o.children.push(this.children[l].toJSON(e).object)}if(this.animations.length>0){o.animations=[];for(let l=0;l<this.animations.length;l++){let c=this.animations[l];o.animations.push(a(e.animations,c))}}if(n){let l=s(e.geometries),c=s(e.materials),d=s(e.textures),h=s(e.images),u=s(e.shapes),f=s(e.skeletons),_=s(e.animations),y=s(e.nodes);l.length>0&&(r.geometries=l),c.length>0&&(r.materials=c),d.length>0&&(r.textures=d),h.length>0&&(r.images=h),u.length>0&&(r.shapes=u),f.length>0&&(r.skeletons=f),_.length>0&&(r.animations=_),y.length>0&&(r.nodes=y)}return r.object=o,r;function s(l){let c=[];for(let d in l){let h=l[d];delete h.metadata,c.push(h)}return c}}clone(e){return new this.constructor().copy(this,e)}copy(e,n=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),n===!0)for(let r=0;r<e.children.length;r++){let o=e.children[r];this.add(o.clone())}return this}}return i.DEFAULT_UP=new ce(0,1,0),i.DEFAULT_MATRIX_AUTO_UPDATE=!0,i.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0,i})(),vl=new ce,wd=new ce,eI=new ce,Cd=new ce,$p=new ce,Xp=new ce,h9=new ce,tI=new ce,iI=new ce,nI=new ce,tm=class i{constructor(t=new ce,e=new ce,n=new ce){this.a=t,this.b=e,this.c=n}static getNormal(t,e,n,r){r.subVectors(n,e),vl.subVectors(t,e),r.cross(vl);let o=r.lengthSq();return o>0?r.multiplyScalar(1/Math.sqrt(o)):r.set(0,0,0)}static getBarycoord(t,e,n,r,o){vl.subVectors(r,e),wd.subVectors(n,e),eI.subVectors(t,e);let a=vl.dot(vl),s=vl.dot(wd),l=vl.dot(eI),c=wd.dot(wd),d=wd.dot(eI),h=a*c-s*s;if(h===0)return o.set(0,0,0),null;let u=1/h,f=(c*l-s*d)*u,_=(a*d-s*l)*u;return o.set(1-f-_,_,f)}static containsPoint(t,e,n,r){return this.getBarycoord(t,e,n,r,Cd)===null?!1:Cd.x>=0&&Cd.y>=0&&Cd.x+Cd.y<=1}static getInterpolation(t,e,n,r,o,a,s,l){return this.getBarycoord(t,e,n,r,Cd)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(o,Cd.x),l.addScaledVector(a,Cd.y),l.addScaledVector(s,Cd.z),l)}static isFrontFacing(t,e,n,r){return vl.subVectors(n,e),wd.subVectors(t,e),vl.cross(wd).dot(r)<0}set(t,e,n){return this.a.copy(t),this.b.copy(e),this.c.copy(n),this}setFromPointsAndIndices(t,e,n,r){return this.a.copy(t[e]),this.b.copy(t[n]),this.c.copy(t[r]),this}setFromAttributeAndIndices(t,e,n,r){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,n),this.c.fromBufferAttribute(t,r),this}clone(){return new this.constructor().copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return vl.subVectors(this.c,this.b),wd.subVectors(this.a,this.b),vl.cross(wd).length()*.5}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return i.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return i.getBarycoord(t,this.a,this.b,this.c,e)}getInterpolation(t,e,n,r,o){return i.getInterpolation(t,this.a,this.b,this.c,e,n,r,o)}containsPoint(t){return i.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return i.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){let n=this.a,r=this.b,o=this.c,a,s;$p.subVectors(r,n),Xp.subVectors(o,n),tI.subVectors(t,n);let l=$p.dot(tI),c=Xp.dot(tI);if(l<=0&&c<=0)return e.copy(n);iI.subVectors(t,r);let d=$p.dot(iI),h=Xp.dot(iI);if(d>=0&&h<=d)return e.copy(r);let u=l*h-d*c;if(u<=0&&l>=0&&d<=0)return a=l/(l-d),e.copy(n).addScaledVector($p,a);nI.subVectors(t,o);let f=$p.dot(nI),_=Xp.dot(nI);if(_>=0&&f<=_)return e.copy(o);let y=f*c-l*_;if(y<=0&&c>=0&&_<=0)return s=c/(c-_),e.copy(n).addScaledVector(Xp,s);let b=d*_-f*h;if(b<=0&&h-d>=0&&f-_>=0)return h9.subVectors(o,r),s=(h-d)/(h-d+(f-_)),e.copy(r).addScaledVector(h9,s);let v=1/(b+y+u);return a=y*v,s=u*v,e.copy(n).addScaledVector($p,a).addScaledVector(Xp,s)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}},yH={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},Ou={h:0,s:0,l:0},ex={h:0,s:0,l:0};function rI(i,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?i+(t-i)*6*e:e<1/2?t:e<2/3?i+(t-i)*6*(2/3-e):i}var di=class{constructor(t,e,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(t,e,n)}set(t,e,n){if(e===void 0&&n===void 0){let r=t;r&&r.isColor?this.copy(r):typeof r=="number"?this.setHex(r):typeof r=="string"&&this.setStyle(r)}else this.setRGB(t,e,n);return this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=Rs){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(t&255)/255,On.toWorkingColorSpace(this,e),this}setRGB(t,e,n,r=On.workingColorSpace){return this.r=t,this.g=e,this.b=n,On.toWorkingColorSpace(this,r),this}setHSL(t,e,n,r=On.workingColorSpace){if(t=j3(t,1),e=bo(e,0,1),n=bo(n,0,1),e===0)this.r=this.g=this.b=n;else{let o=n<=.5?n*(1+e):n+e-n*e,a=2*n-o;this.r=rI(a,o,t+1/3),this.g=rI(a,o,t),this.b=rI(a,o,t-1/3)}return On.toWorkingColorSpace(this,r),this}setStyle(t,e=Rs){function n(o){o!==void 0&&parseFloat(o)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(t)){let o,a=r[1],s=r[2];switch(a){case"rgb":case"rgba":if(o=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return n(o[4]),this.setRGB(Math.min(255,parseInt(o[1],10))/255,Math.min(255,parseInt(o[2],10))/255,Math.min(255,parseInt(o[3],10))/255,e);if(o=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return n(o[4]),this.setRGB(Math.min(100,parseInt(o[1],10))/100,Math.min(100,parseInt(o[2],10))/100,Math.min(100,parseInt(o[3],10))/100,e);break;case"hsl":case"hsla":if(o=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return n(o[4]),this.setHSL(parseFloat(o[1])/360,parseFloat(o[2])/100,parseFloat(o[3])/100,e);break;default:console.warn("THREE.Color: Unknown color model "+t)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(t)){let o=r[1],a=o.length;if(a===3)return this.setRGB(parseInt(o.charAt(0),16)/15,parseInt(o.charAt(1),16)/15,parseInt(o.charAt(2),16)/15,e);if(a===6)return this.setHex(parseInt(o,16),e);console.warn("THREE.Color: Invalid hex color "+t)}else if(t&&t.length>0)return this.setColorName(t,e);return this}setColorName(t,e=Rs){let n=yH[t.toLowerCase()];return n!==void 0?this.setHex(n,e):console.warn("THREE.Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copySRGBToLinear(t){return this.r=hA(t.r),this.g=hA(t.g),this.b=hA(t.b),this}copyLinearToSRGB(t){return this.r=GF(t.r),this.g=GF(t.g),this.b=GF(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=Rs){return On.fromWorkingColorSpace(ea.copy(this),t),Math.round(bo(ea.r*255,0,255))*65536+Math.round(bo(ea.g*255,0,255))*256+Math.round(bo(ea.b*255,0,255))}getHexString(t=Rs){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=On.workingColorSpace){On.fromWorkingColorSpace(ea.copy(this),e);let n=ea.r,r=ea.g,o=ea.b,a=Math.max(n,r,o),s=Math.min(n,r,o),l,c,d=(s+a)/2;if(s===a)l=0,c=0;else{let h=a-s;switch(c=d<=.5?h/(a+s):h/(2-a-s),a){case n:l=(r-o)/h+(r<o?6:0);break;case r:l=(o-n)/h+2;break;case o:l=(n-r)/h+4;break}l/=6}return t.h=l,t.s=c,t.l=d,t}getRGB(t,e=On.workingColorSpace){return On.fromWorkingColorSpace(ea.copy(this),e),t.r=ea.r,t.g=ea.g,t.b=ea.b,t}getStyle(t=Rs){On.fromWorkingColorSpace(ea.copy(this),t);let e=ea.r,n=ea.g,r=ea.b;return t!==Rs?`color(${t} ${e.toFixed(3)} ${n.toFixed(3)} ${r.toFixed(3)})`:`rgb(${Math.round(e*255)},${Math.round(n*255)},${Math.round(r*255)})`}offsetHSL(t,e,n){return this.getHSL(Ou),this.setHSL(Ou.h+t,Ou.s+e,Ou.l+n)}add(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this}addColors(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this}addScalar(t){return this.r+=t,this.g+=t,this.b+=t,this}sub(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this}multiply(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this}multiplyScalar(t){return this.r*=t,this.g*=t,this.b*=t,this}lerp(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this}lerpColors(t,e,n){return this.r=t.r+(e.r-t.r)*n,this.g=t.g+(e.g-t.g)*n,this.b=t.b+(e.b-t.b)*n,this}lerpHSL(t,e){this.getHSL(Ou),t.getHSL(ex);let n=O_(Ou.h,ex.h,e),r=O_(Ou.s,ex.s,e),o=O_(Ou.l,ex.l,e);return this.setHSL(n,r,o),this}setFromVector3(t){return this.r=t.x,this.g=t.y,this.b=t.z,this}applyMatrix3(t){let e=this.r,n=this.g,r=this.b,o=t.elements;return this.r=o[0]*e+o[3]*n+o[6]*r,this.g=o[1]*e+o[4]*n+o[7]*r,this.b=o[2]*e+o[5]*n+o[8]*r,this}equals(t){return t.r===this.r&&t.g===this.g&&t.b===this.b}fromArray(t,e=0){return this.r=t[e],this.g=t[e+1],this.b=t[e+2],this}toArray(t=[],e=0){return t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t}fromBufferAttribute(t,e){return this.r=t.getX(e),this.g=t.getY(e),this.b=t.getZ(e),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}},ea=new di;di.NAMES=yH;var rme=0,uc=class extends Id{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:rme++}),this.uuid=lc(),this.name="",this.type="Material",this.blending=cA,this.side=Vu,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=yI,this.blendDst=xI,this.blendEquation=Yf,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new di(0,0,0),this.blendAlpha=0,this.depthFunc=Fx,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=Z7,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Hp,this.stencilZFail=Hp,this.stencilZPass=Hp,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(t){this._alphaTest>0!=t>0&&this.version++,this._alphaTest=t}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(t!==void 0)for(let e in t){let n=t[e];if(n===void 0){console.warn(`THREE.Material: parameter '${e}' has value of undefined.`);continue}let r=this[e];if(r===void 0){console.warn(`THREE.Material: '${e}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[e]=n}}toJSON(t){let e=t===void 0||typeof t=="string";e&&(t={textures:{},images:{}});let n={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen!==void 0&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.dispersion!==void 0&&(n.dispersion=this.dispersion),this.iridescence!==void 0&&(n.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(n.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),this.anisotropy!==void 0&&(n.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(t).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(t).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(t).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(t).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(t).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(t).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(t).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapRotation!==void 0&&(n.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(t).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(t).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(t).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==cA&&(n.blending=this.blending),this.side!==Vu&&(n.side=this.side),this.vertexColors===!0&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=!0),this.blendSrc!==yI&&(n.blendSrc=this.blendSrc),this.blendDst!==xI&&(n.blendDst=this.blendDst),this.blendEquation!==Yf&&(n.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(n.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(n.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(n.blendAlpha=this.blendAlpha),this.depthFunc!==Fx&&(n.depthFunc=this.depthFunc),this.depthTest===!1&&(n.depthTest=this.depthTest),this.depthWrite===!1&&(n.depthWrite=this.depthWrite),this.colorWrite===!1&&(n.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(n.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==Z7&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Hp&&(n.stencilFail=this.stencilFail),this.stencilZFail!==Hp&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==Hp&&(n.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(n.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaHash===!0&&(n.alphaHash=!0),this.alphaToCoverage===!0&&(n.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=!0),this.forceSinglePass===!0&&(n.forceSinglePass=!0),this.wireframe===!0&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=!0),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),this.fog===!1&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData);function r(o){let a=[];for(let s in o){let l=o[s];delete l.metadata,a.push(l)}return a}if(e){let o=r(t.textures),a=r(t.images);o.length>0&&(n.textures=o),a.length>0&&(n.images=a)}return n}clone(){return new this.constructor().copy(this)}copy(t){this.name=t.name,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.blendColor.copy(t.blendColor),this.blendAlpha=t.blendAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;let e=t.clippingPlanes,n=null;if(e!==null){let r=e.length;n=new Array(r);for(let o=0;o!==r;++o)n[o]=e[o].clone()}return this.clippingPlanes=n,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaHash=t.alphaHash,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.forceSinglePass=t.forceSinglePass,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){t===!0&&this.version++}onBuild(){console.warn("Material: onBuild() has been removed.")}},kd=class extends uc{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new di(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new nm,this.combine=N3,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}};var Wr=new ce,tx=new qe,Vn=class{constructor(t,e,n=!1){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=t,this.itemSize=e,this.count=t!==void 0?t.length/e:0,this.normalized=n,this.usage=JI,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=Td,this.version=0}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}get updateRange(){return uA("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this.gpuType=t.gpuType,this}copyAt(t,e,n){t*=this.itemSize,n*=e.itemSize;for(let r=0,o=this.itemSize;r<o;r++)this.array[t+r]=e.array[n+r];return this}copyArray(t){return this.array.set(t),this}applyMatrix3(t){if(this.itemSize===2)for(let e=0,n=this.count;e<n;e++)tx.fromBufferAttribute(this,e),tx.applyMatrix3(t),this.setXY(e,tx.x,tx.y);else if(this.itemSize===3)for(let e=0,n=this.count;e<n;e++)Wr.fromBufferAttribute(this,e),Wr.applyMatrix3(t),this.setXYZ(e,Wr.x,Wr.y,Wr.z);return this}applyMatrix4(t){for(let e=0,n=this.count;e<n;e++)Wr.fromBufferAttribute(this,e),Wr.applyMatrix4(t),this.setXYZ(e,Wr.x,Wr.y,Wr.z);return this}applyNormalMatrix(t){for(let e=0,n=this.count;e<n;e++)Wr.fromBufferAttribute(this,e),Wr.applyNormalMatrix(t),this.setXYZ(e,Wr.x,Wr.y,Wr.z);return this}transformDirection(t){for(let e=0,n=this.count;e<n;e++)Wr.fromBufferAttribute(this,e),Wr.transformDirection(t),this.setXYZ(e,Wr.x,Wr.y,Wr.z);return this}set(t,e=0){return this.array.set(t,e),this}getComponent(t,e){let n=this.array[t*this.itemSize+e];return this.normalized&&(n=xl(n,this.array)),n}setComponent(t,e,n){return this.normalized&&(n=Hn(n,this.array)),this.array[t*this.itemSize+e]=n,this}getX(t){let e=this.array[t*this.itemSize];return this.normalized&&(e=xl(e,this.array)),e}setX(t,e){return this.normalized&&(e=Hn(e,this.array)),this.array[t*this.itemSize]=e,this}getY(t){let e=this.array[t*this.itemSize+1];return this.normalized&&(e=xl(e,this.array)),e}setY(t,e){return this.normalized&&(e=Hn(e,this.array)),this.array[t*this.itemSize+1]=e,this}getZ(t){let e=this.array[t*this.itemSize+2];return this.normalized&&(e=xl(e,this.array)),e}setZ(t,e){return this.normalized&&(e=Hn(e,this.array)),this.array[t*this.itemSize+2]=e,this}getW(t){let e=this.array[t*this.itemSize+3];return this.normalized&&(e=xl(e,this.array)),e}setW(t,e){return this.normalized&&(e=Hn(e,this.array)),this.array[t*this.itemSize+3]=e,this}setXY(t,e,n){return t*=this.itemSize,this.normalized&&(e=Hn(e,this.array),n=Hn(n,this.array)),this.array[t+0]=e,this.array[t+1]=n,this}setXYZ(t,e,n,r){return t*=this.itemSize,this.normalized&&(e=Hn(e,this.array),n=Hn(n,this.array),r=Hn(r,this.array)),this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=r,this}setXYZW(t,e,n,r,o){return t*=this.itemSize,this.normalized&&(e=Hn(e,this.array),n=Hn(n,this.array),r=Hn(r,this.array),o=Hn(o,this.array)),this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=r,this.array[t+3]=o,this}onUpload(t){return this.onUploadCallback=t,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){let t={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(t.name=this.name),this.usage!==JI&&(t.usage=this.usage),t}};var Ux=class extends Vn{constructor(t,e,n){super(new Uint16Array(t),e,n)}};var Hx=class extends Vn{constructor(t,e,n){super(new Uint32Array(t),e,n)}};var Qn=class extends Vn{constructor(t,e,n){super(new Float32Array(t),e,n)}},ome=0,Ps=new pr,oI=new Ls,Kp=new ce,os=new Po,B_=new Po,_o=new ce,Cn=class i extends Id{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:ome++}),this.uuid=lc(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(t){return Array.isArray(t)?this.index=new(vH(t)?Hx:Ux)(t,1):this.index=t,this}getAttribute(t){return this.attributes[t]}setAttribute(t,e){return this.attributes[t]=e,this}deleteAttribute(t){return delete this.attributes[t],this}hasAttribute(t){return this.attributes[t]!==void 0}addGroup(t,e,n=0){this.groups.push({start:t,count:e,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(t,e){this.drawRange.start=t,this.drawRange.count=e}applyMatrix4(t){let e=this.attributes.position;e!==void 0&&(e.applyMatrix4(t),e.needsUpdate=!0);let n=this.attributes.normal;if(n!==void 0){let o=new Fi().getNormalMatrix(t);n.applyNormalMatrix(o),n.needsUpdate=!0}let r=this.attributes.tangent;return r!==void 0&&(r.transformDirection(t),r.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(t){return Ps.makeRotationFromQuaternion(t),this.applyMatrix4(Ps),this}rotateX(t){return Ps.makeRotationX(t),this.applyMatrix4(Ps),this}rotateY(t){return Ps.makeRotationY(t),this.applyMatrix4(Ps),this}rotateZ(t){return Ps.makeRotationZ(t),this.applyMatrix4(Ps),this}translate(t,e,n){return Ps.makeTranslation(t,e,n),this.applyMatrix4(Ps),this}scale(t,e,n){return Ps.makeScale(t,e,n),this.applyMatrix4(Ps),this}lookAt(t){return oI.lookAt(t),oI.updateMatrix(),this.applyMatrix4(oI.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Kp).negate(),this.translate(Kp.x,Kp.y,Kp.z),this}setFromPoints(t){let e=[];for(let n=0,r=t.length;n<r;n++){let o=t[n];e.push(o.x,o.y,o.z||0)}return this.setAttribute("position",new Qn(e,3)),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Po);let t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new ce(-1/0,-1/0,-1/0),new ce(1/0,1/0,1/0));return}if(t!==void 0){if(this.boundingBox.setFromBufferAttribute(t),e)for(let n=0,r=e.length;n<r;n++){let o=e[n];os.setFromBufferAttribute(o),this.morphTargetsRelative?(_o.addVectors(this.boundingBox.min,os.min),this.boundingBox.expandByPoint(_o),_o.addVectors(this.boundingBox.max,os.max),this.boundingBox.expandByPoint(_o)):(this.boundingBox.expandByPoint(os.min),this.boundingBox.expandByPoint(os.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new dc);let t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new ce,1/0);return}if(t){let n=this.boundingSphere.center;if(os.setFromBufferAttribute(t),e)for(let o=0,a=e.length;o<a;o++){let s=e[o];B_.setFromBufferAttribute(s),this.morphTargetsRelative?(_o.addVectors(os.min,B_.min),os.expandByPoint(_o),_o.addVectors(os.max,B_.max),os.expandByPoint(_o)):(os.expandByPoint(B_.min),os.expandByPoint(B_.max))}os.getCenter(n);let r=0;for(let o=0,a=t.count;o<a;o++)_o.fromBufferAttribute(t,o),r=Math.max(r,n.distanceToSquared(_o));if(e)for(let o=0,a=e.length;o<a;o++){let s=e[o],l=this.morphTargetsRelative;for(let c=0,d=s.count;c<d;c++)_o.fromBufferAttribute(s,c),l&&(Kp.fromBufferAttribute(t,c),_o.add(Kp)),r=Math.max(r,n.distanceToSquared(_o))}this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){let t=this.index,e=this.attributes;if(t===null||e.position===void 0||e.normal===void 0||e.uv===void 0){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}let n=e.position,r=e.normal,o=e.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new Vn(new Float32Array(4*n.count),4));let a=this.getAttribute("tangent"),s=[],l=[];for(let O=0;O<n.count;O++)s[O]=new ce,l[O]=new ce;let c=new ce,d=new ce,h=new ce,u=new qe,f=new qe,_=new qe,y=new ce,b=new ce;function v(O,E,B){c.fromBufferAttribute(n,O),d.fromBufferAttribute(n,E),h.fromBufferAttribute(n,B),u.fromBufferAttribute(o,O),f.fromBufferAttribute(o,E),_.fromBufferAttribute(o,B),d.sub(c),h.sub(c),f.sub(u),_.sub(u);let L=1/(f.x*_.y-_.x*f.y);isFinite(L)&&(y.copy(d).multiplyScalar(_.y).addScaledVector(h,-f.y).multiplyScalar(L),b.copy(h).multiplyScalar(f.x).addScaledVector(d,-_.x).multiplyScalar(L),s[O].add(y),s[E].add(y),s[B].add(y),l[O].add(b),l[E].add(b),l[B].add(b))}let M=this.groups;M.length===0&&(M=[{start:0,count:t.count}]);for(let O=0,E=M.length;O<E;++O){let B=M[O],L=B.start,q=B.count;for(let W=L,oe=L+q;W<oe;W+=3)v(t.getX(W+0),t.getX(W+1),t.getX(W+2))}let x=new ce,w=new ce,k=new ce,P=new ce;function D(O){k.fromBufferAttribute(r,O),P.copy(k);let E=s[O];x.copy(E),x.sub(k.multiplyScalar(k.dot(E))).normalize(),w.crossVectors(P,E);let L=w.dot(l[O])<0?-1:1;a.setXYZW(O,x.x,x.y,x.z,L)}for(let O=0,E=M.length;O<E;++O){let B=M[O],L=B.start,q=B.count;for(let W=L,oe=L+q;W<oe;W+=3)D(t.getX(W+0)),D(t.getX(W+1)),D(t.getX(W+2))}}computeVertexNormals(){let t=this.index,e=this.getAttribute("position");if(e!==void 0){let n=this.getAttribute("normal");if(n===void 0)n=new Vn(new Float32Array(e.count*3),3),this.setAttribute("normal",n);else for(let u=0,f=n.count;u<f;u++)n.setXYZ(u,0,0,0);let r=new ce,o=new ce,a=new ce,s=new ce,l=new ce,c=new ce,d=new ce,h=new ce;if(t)for(let u=0,f=t.count;u<f;u+=3){let _=t.getX(u+0),y=t.getX(u+1),b=t.getX(u+2);r.fromBufferAttribute(e,_),o.fromBufferAttribute(e,y),a.fromBufferAttribute(e,b),d.subVectors(a,o),h.subVectors(r,o),d.cross(h),s.fromBufferAttribute(n,_),l.fromBufferAttribute(n,y),c.fromBufferAttribute(n,b),s.add(d),l.add(d),c.add(d),n.setXYZ(_,s.x,s.y,s.z),n.setXYZ(y,l.x,l.y,l.z),n.setXYZ(b,c.x,c.y,c.z)}else for(let u=0,f=e.count;u<f;u+=3)r.fromBufferAttribute(e,u+0),o.fromBufferAttribute(e,u+1),a.fromBufferAttribute(e,u+2),d.subVectors(a,o),h.subVectors(r,o),d.cross(h),n.setXYZ(u+0,d.x,d.y,d.z),n.setXYZ(u+1,d.x,d.y,d.z),n.setXYZ(u+2,d.x,d.y,d.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){let t=this.attributes.normal;for(let e=0,n=t.count;e<n;e++)_o.fromBufferAttribute(t,e),_o.normalize(),t.setXYZ(e,_o.x,_o.y,_o.z)}toNonIndexed(){function t(s,l){let c=s.array,d=s.itemSize,h=s.normalized,u=new c.constructor(l.length*d),f=0,_=0;for(let y=0,b=l.length;y<b;y++){s.isInterleavedBufferAttribute?f=l[y]*s.data.stride+s.offset:f=l[y]*d;for(let v=0;v<d;v++)u[_++]=c[f++]}return new Vn(u,d,h)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;let e=new i,n=this.index.array,r=this.attributes;for(let s in r){let l=r[s],c=t(l,n);e.setAttribute(s,c)}let o=this.morphAttributes;for(let s in o){let l=[],c=o[s];for(let d=0,h=c.length;d<h;d++){let u=c[d],f=t(u,n);l.push(f)}e.morphAttributes[s]=l}e.morphTargetsRelative=this.morphTargetsRelative;let a=this.groups;for(let s=0,l=a.length;s<l;s++){let c=a[s];e.addGroup(c.start,c.count,c.materialIndex)}return e}toJSON(){let t={metadata:{version:4.6,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,this.name!==""&&(t.name=this.name),Object.keys(this.userData).length>0&&(t.userData=this.userData),this.parameters!==void 0){let l=this.parameters;for(let c in l)l[c]!==void 0&&(t[c]=l[c]);return t}t.data={attributes:{}};let e=this.index;e!==null&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});let n=this.attributes;for(let l in n){let c=n[l];t.data.attributes[l]=c.toJSON(t.data)}let r={},o=!1;for(let l in this.morphAttributes){let c=this.morphAttributes[l],d=[];for(let h=0,u=c.length;h<u;h++){let f=c[h];d.push(f.toJSON(t.data))}d.length>0&&(r[l]=d,o=!0)}o&&(t.data.morphAttributes=r,t.data.morphTargetsRelative=this.morphTargetsRelative);let a=this.groups;a.length>0&&(t.data.groups=JSON.parse(JSON.stringify(a)));let s=this.boundingSphere;return s!==null&&(t.data.boundingSphere={center:s.center.toArray(),radius:s.radius}),t}clone(){return new this.constructor().copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let e={};this.name=t.name;let n=t.index;n!==null&&this.setIndex(n.clone(e));let r=t.attributes;for(let c in r){let d=r[c];this.setAttribute(c,d.clone(e))}let o=t.morphAttributes;for(let c in o){let d=[],h=o[c];for(let u=0,f=h.length;u<f;u++)d.push(h[u].clone(e));this.morphAttributes[c]=d}this.morphTargetsRelative=t.morphTargetsRelative;let a=t.groups;for(let c=0,d=a.length;c<d;c++){let h=a[c];this.addGroup(h.start,h.count,h.materialIndex)}let s=t.boundingBox;s!==null&&(this.boundingBox=s.clone());let l=t.boundingSphere;return l!==null&&(this.boundingSphere=l.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}},f9=new pr,Wf=new Dd,ix=new dc,m9=new ce,Yp=new ce,Zp=new ce,Jp=new ce,aI=new ce,nx=new ce,rx=new qe,ox=new qe,ax=new qe,p9=new ce,A9=new ce,g9=new ce,sx=new ce,lx=new ce,Hi=class extends Ls{constructor(t=new Cn,e=new kd){super(),this.isMesh=!0,this.type="Mesh",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),t.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),t.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}updateMorphTargets(){let e=this.geometry.morphAttributes,n=Object.keys(e);if(n.length>0){let r=e[n[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,a=r.length;o<a;o++){let s=r[o].name||String(o);this.morphTargetInfluences.push(0),this.morphTargetDictionary[s]=o}}}}getVertexPosition(t,e){let n=this.geometry,r=n.attributes.position,o=n.morphAttributes.position,a=n.morphTargetsRelative;e.fromBufferAttribute(r,t);let s=this.morphTargetInfluences;if(o&&s){nx.set(0,0,0);for(let l=0,c=o.length;l<c;l++){let d=s[l],h=o[l];d!==0&&(aI.fromBufferAttribute(h,t),a?nx.addScaledVector(aI,d):nx.addScaledVector(aI.sub(e),d))}e.add(nx)}return e}raycast(t,e){let n=this.geometry,r=this.material,o=this.matrixWorld;r!==void 0&&(n.boundingSphere===null&&n.computeBoundingSphere(),ix.copy(n.boundingSphere),ix.applyMatrix4(o),Wf.copy(t.ray).recast(t.near),!(ix.containsPoint(Wf.origin)===!1&&(Wf.intersectSphere(ix,m9)===null||Wf.origin.distanceToSquared(m9)>(t.far-t.near)**2))&&(f9.copy(o).invert(),Wf.copy(t.ray).applyMatrix4(f9),!(n.boundingBox!==null&&Wf.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(t,e,Wf)))}_computeIntersections(t,e,n){let r,o=this.geometry,a=this.material,s=o.index,l=o.attributes.position,c=o.attributes.uv,d=o.attributes.uv1,h=o.attributes.normal,u=o.groups,f=o.drawRange;if(s!==null)if(Array.isArray(a))for(let _=0,y=u.length;_<y;_++){let b=u[_],v=a[b.materialIndex],M=Math.max(b.start,f.start),x=Math.min(s.count,Math.min(b.start+b.count,f.start+f.count));for(let w=M,k=x;w<k;w+=3){let P=s.getX(w),D=s.getX(w+1),O=s.getX(w+2);r=cx(this,v,t,n,c,d,h,P,D,O),r&&(r.faceIndex=Math.floor(w/3),r.face.materialIndex=b.materialIndex,e.push(r))}}else{let _=Math.max(0,f.start),y=Math.min(s.count,f.start+f.count);for(let b=_,v=y;b<v;b+=3){let M=s.getX(b),x=s.getX(b+1),w=s.getX(b+2);r=cx(this,a,t,n,c,d,h,M,x,w),r&&(r.faceIndex=Math.floor(b/3),e.push(r))}}else if(l!==void 0)if(Array.isArray(a))for(let _=0,y=u.length;_<y;_++){let b=u[_],v=a[b.materialIndex],M=Math.max(b.start,f.start),x=Math.min(l.count,Math.min(b.start+b.count,f.start+f.count));for(let w=M,k=x;w<k;w+=3){let P=w,D=w+1,O=w+2;r=cx(this,v,t,n,c,d,h,P,D,O),r&&(r.faceIndex=Math.floor(w/3),r.face.materialIndex=b.materialIndex,e.push(r))}}else{let _=Math.max(0,f.start),y=Math.min(l.count,f.start+f.count);for(let b=_,v=y;b<v;b+=3){let M=b,x=b+1,w=b+2;r=cx(this,a,t,n,c,d,h,M,x,w),r&&(r.faceIndex=Math.floor(b/3),e.push(r))}}}};function ame(i,t,e,n,r,o,a,s){let l;if(t.side===ta?l=n.intersectTriangle(a,o,r,!0,s):l=n.intersectTriangle(r,o,a,t.side===Vu,s),l===null)return null;lx.copy(s),lx.applyMatrix4(i.matrixWorld);let c=e.ray.origin.distanceTo(lx);return c<e.near||c>e.far?null:{distance:c,point:lx.clone(),object:i}}function cx(i,t,e,n,r,o,a,s,l,c){i.getVertexPosition(s,Yp),i.getVertexPosition(l,Zp),i.getVertexPosition(c,Jp);let d=ame(i,t,e,n,Yp,Zp,Jp,sx);if(d){r&&(rx.fromBufferAttribute(r,s),ox.fromBufferAttribute(r,l),ax.fromBufferAttribute(r,c),d.uv=tm.getInterpolation(sx,Yp,Zp,Jp,rx,ox,ax,new qe)),o&&(rx.fromBufferAttribute(o,s),ox.fromBufferAttribute(o,l),ax.fromBufferAttribute(o,c),d.uv1=tm.getInterpolation(sx,Yp,Zp,Jp,rx,ox,ax,new qe)),a&&(p9.fromBufferAttribute(a,s),A9.fromBufferAttribute(a,l),g9.fromBufferAttribute(a,c),d.normal=tm.getInterpolation(sx,Yp,Zp,Jp,p9,A9,g9,new ce),d.normal.dot(n.direction)>0&&d.normal.multiplyScalar(-1));let h={a:s,b:l,c,normal:new ce,materialIndex:0};tm.getNormal(Yp,Zp,Jp,h.normal),d.face=h}return d}var va=class i extends Cn{constructor(t=1,e=1,n=1,r=1,o=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:n,widthSegments:r,heightSegments:o,depthSegments:a};let s=this;r=Math.floor(r),o=Math.floor(o),a=Math.floor(a);let l=[],c=[],d=[],h=[],u=0,f=0;_("z","y","x",-1,-1,n,e,t,a,o,0),_("z","y","x",1,-1,n,e,-t,a,o,1),_("x","z","y",1,1,t,n,e,r,a,2),_("x","z","y",1,-1,t,n,-e,r,a,3),_("x","y","z",1,-1,t,e,n,r,o,4),_("x","y","z",-1,-1,t,e,-n,r,o,5),this.setIndex(l),this.setAttribute("position",new Qn(c,3)),this.setAttribute("normal",new Qn(d,3)),this.setAttribute("uv",new Qn(h,2));function _(y,b,v,M,x,w,k,P,D,O,E){let B=w/D,L=k/O,q=w/2,W=k/2,oe=P/2,pe=D+1,ge=O+1,de=0,U=0,J=new ce;for(let Pe=0;Pe<ge;Pe++){let We=Pe*L-W;for(let yt=0;yt<pe;yt++){let vt=yt*B-q;J[y]=vt*M,J[b]=We*x,J[v]=oe,c.push(J.x,J.y,J.z),J[y]=0,J[b]=0,J[v]=P>0?1:-1,d.push(J.x,J.y,J.z),h.push(yt/D),h.push(1-Pe/O),de+=1}}for(let Pe=0;Pe<O;Pe++)for(let We=0;We<D;We++){let yt=u+We+pe*Pe,vt=u+We+pe*(Pe+1),ee=u+(We+1)+pe*(Pe+1),Z=u+(We+1)+pe*Pe;l.push(yt,vt,Z),l.push(vt,ee,Z),U+=6}s.addGroup(f,U,E),f+=U,u+=de}}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new i(t.width,t.height,t.depth,t.widthSegments,t.heightSegments,t.depthSegments)}};function bA(i){let t={};for(let e in i){t[e]={};for(let n in i[e]){let r=i[e][n];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture||r.isQuaternion)?r.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),t[e][n]=null):t[e][n]=r.clone():Array.isArray(r)?t[e][n]=r.slice():t[e][n]=r}}return t}function ba(i){let t={};for(let e=0;e<i.length;e++){let n=bA(i[e]);for(let r in n)t[r]=n[r]}return t}function sme(i){let t=[];for(let e=0;e<i.length;e++)t.push(i[e].clone());return t}function xH(i){let t=i.getRenderTarget();return t===null?i.outputColorSpace:t.isXRRenderTarget===!0?t.texture.colorSpace:On.workingColorSpace}var eb={clone:bA,merge:ba},lme=`void main() {
|
|
1238
|
+
`],encapsulation:2,changeDetection:0})}return i})();function Kae(i){return i.hasAttribute("mat-raised-button")?"elevated":i.hasAttribute("mat-stroked-button")?"outlined":i.hasAttribute("mat-flat-button")?"filled":i.hasAttribute("mat-button")?"text":null}function Yae(i,t){if(i&1){let e=ot();T(0,"button",4),he("click",function(){Ue(e);let r=fe();return He(r.data.resolveErrorData.onResolveErrorClick())}),j(1),F()}if(i&2){let e=fe();S(),lt(" ",e.data.resolveErrorData.buttonText," ")}}var ts=(()=>{class i{constructor(e){this.data=e}static{this.\u0275fac=function(n){return new(n||i)(se(Is))}}static{this.\u0275cmp=te({type:i,selectors:[["cc-error-dialog"]],decls:7,vars:3,consts:[["mat-dialog-title",""],["mat-dialog-content","",3,"innerHTML"],["mat-dialog-actions","","align","end"],["mat-button","","mat-dialog-close",""],["mat-button","","mat-dialog-close","",3,"click"]],template:function(n,r){n&1&&(T(0,"h1",0),j(1),F(),ie(2,"div",1),T(3,"div",2),Ee(4,Yae,2,1,"button",3),T(5,"button",3),j(6,"OK"),F()()),n&2&&(S(),hi(r.data.title),S(),G("innerHTML",r.data.message,iy),S(2),Te(r.data.resolveErrorData?4:-1))},dependencies:[Tf,Cr,Ur,an,wr],encapsulation:2})}}return i})();function lN(i){return{title:"Something is wrong with the loaded file(s)",message:[...Zae(i),...Jae(i)].join("")}}function Zae(i){let t=i.filter(e=>e.errors.length>0);return t.length>0?["<h2>Errors</h2>",...t.map(e=>ese(e))]:[]}function Jae(i){let t=i.filter(e=>e.warnings.length>0);return t.length>0?["<h2>Warnings</h2>",...t.map(e=>tse(e))]:[]}function ese(i){return`<p><strong>${i.fileName}:</strong> ${Jy('<i class="fa fa-exclamation-circle"></i> ',i.errors)}</p>`}function tse(i){return`<p><strong>${i.fileName}:</strong> ${Jy('<i class="fa fa-exclamation-triangle"></i> ',i.warnings)}</p>`}function Jy(i,t){return`<p>${t.map(e=>i+e).join("<br>")}</p>`}var AB=(function(i){return i.hide="hide",i.exclude="exclude",i})(AB||{});var bB=rl(e1());function AN(i){let t=i.content;return{fileMeta:{fileName:i.fileName,fileChecksum:t.fileChecksum,projectName:t.projectName,apiVersion:t.apiVersion,exportedFileSize:i.fileSize,repoCreationDate:t.repoCreationDate||""},settings:{fileSettings:{edges:t.edges||[],attributeTypes:nse(t.attributeTypes),attributeDescriptors:rse(t.attributeDescriptors),blacklist:ose(t.blacklist||[]),markedPackages:t.markedPackages||[]}},map:Io(t.nodes[0])}}function nse(i){return!i||Array.isArray(i.nodes)||Array.isArray(i.edges)?{nodes:{},edges:{}}:{nodes:i.nodes??{},edges:i.edges??{}}}function rse(i){return i||{}}function ose(i){for(let t of i)t.type===AB.hide&&(t.type="flatten");return i}function gN(i){let t=0;for(let e of i)e.selectedAs!==xi.None&&(t+=e.file.fileMeta.exportedFileSize);return t}function K0(i){let t=null;try{let e=typeof i=="string"?JSON.parse(i):i;if("data"in e&&"checksum"in e)return t=e.data,t.fileChecksum=e.checksum||(0,bB.default)(JSON.stringify(e.data)),t;if(!e.fileChecksum){let n=typeof i=="string"?i:JSON.stringify(i);e.fileChecksum=(0,bB.default)(n)}return e}catch{}return t}var $8=rl(qB());var tc={author:"MaibornWolff GmbH <dist_intern_codecharta@maibornwolff.de>",homepage:"https://maibornwolff.github.io/codecharta/",bugs:{url:"https://github.com/MaibornWolff/codecharta/issues",email:"dist_intern_codecharta@maibornwolff.de"},repository:{type:"git",url:"https://github.com/MaibornWolff/codecharta.git"},name:"codecharta-visualization",version:"1.137.0",engines:{node:">=20"},description:"MaibornWolff CodeCharta",files:["dist/bundler/browser","conf","Dockerfile","LICENSE.md","package.json","package-lock.json","README.md","tsconfig.json","cli.js"],codecharta:{apiVersion:"1.5"},main:"main.js",browserslist:["last 2 chrome version","last 2 firefox version","last 2 safari version"],scripts:{start:"electron dist/bundler/browser",build:"ng build && cp electron/* package.json dist/bundler/browser",dev:"ng serve",test:"npm run test:ci -- --maxWorkers=25%","test:ci":"jest --config conf/jestUnit.config.json .*\\.spec\\.ts","test:auto":"npm test -- --watch","test:autoNoCoverage":"npm run test:auto -- --coverage false","test:updateSnaps":"npm test -- --updateSnapshot","test:createCoverageFile":"jest --config conf/jestUnit.config.json --coverage --coverageReporters=lcov --coverageDirectory=coverage",e2e:"jest --config conf/jestE2E.config.json .*\\.e2e\\.ts --coverage false","e2e:auto":"npm run e2e -- --watch","e2e:ci":"npm run e2e -- --runInBand",package:"node script/appMain.js","package:local":"npm run package -- --local","schema:generate":"typescript-json-schema ./app/codeCharta/codeCharta.model.ts ExportCCFile --required --topRef --out app/codeCharta/util/generatedSchema.json",sbom:"cyclonedx-npm --omit dev --gather-license-texts --spec-version 1.6 --output-format json --output-file build/reports/sbom_visualization.cdx.json"},bin:{"codecharta-visualization":"cli.js"},license:"BSD-3-Clause",dependencies:{"@angular/animations":"^20.3.4","@angular/cdk":"^20.2.8","@angular/common":"^20.3.4","@angular/core":"^20.3.4","@angular/forms":"^20.3.4","@angular/material":"^20.2.8","@angular/platform-browser":"^20.3.4","@angular/platform-browser-dynamic":"^20.3.4","@angular/router":"^20.3.4","@ngrx/effects":"^20.0.0","@ngrx/operators":"^20.0.0","@ngrx/store":"^20.0.0","@ngrx/store-devtools":"^20.0.0","@tailwindcss/postcss":"^4.1.15","@types/d3":"^7.4.3",ajv:"^6.12.6","color-convert":"2.0.1",d3:"^7.8.5","d3-hierarchy":"^2.0.0",dequal:"^2.0.3",electron:"39.2.0","fake-indexeddb":"^6.2.4",fflate:"^0.8.2","font-awesome":"^4.7.0","hotkeys-js":"^3.8.2",html2canvas:"^1.4.1",idb:"^8.0.0",ignore:"^7.0.5",klona:"^2.0.4","marked-mangle":"^1.1.11","material-icons":"^1.10.4",md5:"^2.3.0","ngx-color":"^10.0.0",pako:"^2.0.4","percent-round":"^2.2.1",qrcode:"^1.5.3",rxjs:"^7.5.1","safe-stable-stringify":"^2.4.3",shelljs:"^0.10.0",tailwindcss:"^4.1.15",three:"^0.168.0","three-orbit-controls":"^82.1.0","typescript-json-schema":"0.65.1","zone.js":"^0.15.1"},devDependencies:{"@angular/build":"^20.3.5","@angular/cli":"^20.3.5","@angular/compiler":"^20.3.4","@angular/compiler-cli":"^20.3.4","@babel/plugin-transform-class-static-block":"^7.23.3","@cyclonedx/cyclonedx-npm":"^4.0.3","@electron/get":"^4.0.2","@electron/packager":"^19.0.1","@testing-library/angular":"^18.1.0","@testing-library/user-event":"^14.5.2","@types/color-convert":"2.0.4","@types/d3-hierarchy":"^3.0.2","@types/expect-puppeteer":"^5.0.2","@types/jest":"^30.0.0","@types/jest-environment-puppeteer":"^5.0.6","@types/node":"^24.0.0","@types/three":"^0.168.0",autoprefixer:"^10.4.21",bestzip:"^2.2.0",daisyui:"^5.3.7","fast-xml-parser":"^5.0.0","html-loader":"^5.0.0",jest:"^30.2.0","jest-canvas-mock":"^2.4.0","jest-environment-jsdom":"^30.1.0","jest-preset-angular":"15.0.3","jest-puppeteer":"^11.0.0",marked:"^5.0.2",postcss:"^8.5.6",puppeteer:"^24.24.0","ts-jest":"^29.4.5",typescript:"5.8.3","webpack-glsl-loader":"^1.0.1"},optionalDependencies:{"@rollup/rollup-linux-x64-gnu":"^4.24.2"}};var _8={$ref:"#/definitions/ExportCCFile",$schema:"http://json-schema.org/draft-07/schema#",definitions:{AttributeTypes:{properties:{edges:{additionalProperties:{enum:["absolute","relative"],type:"string"},type:"object"},nodes:{additionalProperties:{enum:["absolute","relative"],type:"string"},type:"object"}},type:"object"},CodeMapNode:{properties:{attributes:{$ref:"#/definitions/KeyValuePair"},children:{items:{$ref:"#/definitions/CodeMapNode"},type:"array"},deltas:{additionalProperties:{type:"number"},type:"object"},edgeAttributes:{additionalProperties:{$ref:"#/definitions/EdgeMetricCount"},type:"object"},fixedPosition:{$ref:"#/definitions/FixedPosition"},id:{type:"number"},isExcluded:{type:"boolean"},isFlattened:{type:"boolean"},link:{type:"string"},name:{type:"string"},path:{type:"string"},type:{$ref:"#/definitions/NodeType"}},required:["name","type"],type:"object"},Edge:{properties:{attributes:{$ref:"#/definitions/KeyValuePair"},fromNodeName:{type:"string"},toNodeName:{type:"string"},visible:{$ref:"#/definitions/EdgeVisibility"}},required:["attributes","fromNodeName","toNodeName"],type:"object"},EdgeMetricCount:{properties:{incoming:{type:"number"},outgoing:{type:"number"}},required:["incoming","outgoing"],type:"object"},EdgeVisibility:{enum:["both","from","none","to"],type:"string"},ExportBlacklistItem:{properties:{path:{type:"string"},type:{$ref:"#/definitions/ExportBlacklistType"}},required:["path","type"],type:"object"},ExportBlacklistType:{enum:["exclude","hide"],type:"string"},ExportCCFile:{properties:{apiVersion:{type:"string"},attributeTypes:{anyOf:[{$ref:"#/definitions/OldAttributeTypes"},{$ref:"#/definitions/AttributeTypes"}]},blacklist:{items:{$ref:"#/definitions/ExportBlacklistItem"},type:"array"},edges:{items:{$ref:"#/definitions/Edge"},type:"array"},markedPackages:{items:{$ref:"#/definitions/MarkedPackage"},type:"array"},nodes:{items:{$ref:"#/definitions/CodeMapNode"},type:"array"},projectName:{type:"string"}},required:["apiVersion","nodes","projectName"],type:"object"},FixedPosition:{properties:{height:{type:"number"},left:{type:"number"},top:{type:"number"},width:{type:"number"}},required:["height","left","top","width"],type:"object"},KeyValuePair:{additionalProperties:{type:"number"},type:"object"},MarkedPackage:{properties:{color:{type:"string"},path:{type:"string"}},required:["color","path"],type:"object"},NodeType:{enum:["File","Folder"],type:"string"},OldAttributeTypes:{properties:{edges:{additionalItems:{anyOf:[{additionalProperties:{enum:["absolute","relative"],type:"string"},type:"object"}]},items:[{additionalProperties:{enum:["absolute","relative"],type:"string"},type:"object"}],minItems:0,type:"array"},nodes:{additionalItems:{anyOf:[{additionalProperties:{enum:["absolute","relative"],type:"string"},type:"object"}]},items:[{additionalProperties:{enum:["absolute","relative"],type:"string"},type:"object"}],minItems:0,type:"array"}},type:"object"}}};function Hle(i){var t=0,e=i.children,n=e&&e.length;if(!n)t=1;else for(;--n>=0;)t+=e[n].value;i.value=t}function b8(){return this.eachAfter(Hle)}function v8(i,t){let e=-1;for(let n of this)i.call(t,n,++e,this);return this}function y8(i,t){for(var e=this,n=[e],r,o,a=-1;e=n.pop();)if(i.call(t,e,++a,this),r=e.children)for(o=r.length-1;o>=0;--o)n.push(r[o]);return this}function x8(i,t){for(var e=this,n=[e],r=[],o,a,s,l=-1;e=n.pop();)if(r.push(e),o=e.children)for(a=0,s=o.length;a<s;++a)n.push(o[a]);for(;e=r.pop();)i.call(t,e,++l,this);return this}function w8(i,t){let e=-1;for(let n of this)if(i.call(t,n,++e,this))return n}function C8(i){return this.eachAfter(function(t){for(var e=+i(t.data)||0,n=t.children,r=n&&n.length;--r>=0;)e+=n[r].value;t.value=e})}function M8(i){return this.eachBefore(function(t){t.children&&t.children.sort(i)})}function S8(i){for(var t=this,e=Vle(t,i),n=[t];t!==e;)t=t.parent,n.push(t);for(var r=n.length;i!==e;)n.splice(r,0,i),i=i.parent;return n}function Vle(i,t){if(i===t)return i;var e=i.ancestors(),n=t.ancestors(),r=null;for(i=e.pop(),t=n.pop();i===t;)r=i,i=e.pop(),t=n.pop();return r}function E8(){for(var i=this,t=[i];i=i.parent;)t.push(i);return t}function T8(){return Array.from(this)}function B8(){var i=[];return this.eachBefore(function(t){t.children||i.push(t)}),i}function F8(){var i=this,t=[];return i.each(function(e){e!==i&&t.push({source:e.parent,target:e})}),t}function*I8(){var i=this,t,e=[i],n,r,o;do for(t=e.reverse(),e=[];i=t.pop();)if(yield i,n=i.children)for(r=0,o=n.length;r<o;++r)e.push(n[r]);while(e.length)}function Ui(i,t){i instanceof Map?(i=[void 0,i],t===void 0&&(t=qle)):t===void 0&&(t=zle);for(var e=new b1(i),n,r=[e],o,a,s,l;n=r.pop();)if((a=t(n.data))&&(l=(a=Array.from(a)).length))for(n.children=a,s=l-1;s>=0;--s)r.push(o=a[s]=new b1(a[s])),o.parent=n,o.depth=n.depth+1;return e.eachBefore(Wle)}function Qle(){return Ui(this).eachBefore(Gle)}function zle(i){return i.children}function qle(i){return Array.isArray(i)?i[1]:null}function Gle(i){i.data.value!==void 0&&(i.value=i.data.value),i.data=i.data.data}function Wle(i){var t=0;do i.height=t;while((i=i.parent)&&i.height<++t)}function b1(i){this.data=i,this.depth=this.height=0,this.parent=null}b1.prototype=Ui.prototype={constructor:b1,count:b8,each:v8,eachAfter:x8,eachBefore:y8,find:w8,sum:C8,sort:M8,path:S8,ancestors:E8,descendants:T8,leaves:B8,links:F8,copy:Qle,[Symbol.iterator]:I8};function D8(i){if(typeof i!="function")throw new Error;return i}function Cp(){return 0}function Mp(i){return function(){return i}}function k8(i){i.x0=Math.round(i.x0),i.y0=Math.round(i.y0),i.x1=Math.round(i.x1),i.y1=Math.round(i.y1)}function P8(i,t,e,n,r){for(var o=i.children,a,s=-1,l=o.length,c=i.value&&(n-t)/i.value;++s<l;)a=o[s],a.y0=e,a.y1=r,a.x0=t,a.x1=t+=a.value*c}function R8(i,t,e,n,r){for(var o=i.children,a,s=-1,l=o.length,c=i.value&&(r-e)/i.value;++s<l;)a=o[s],a.x0=t,a.x1=n,a.y0=e,a.y1=e+=a.value*c}var jle=(1+Math.sqrt(5))/2;function $le(i,t,e,n,r,o){for(var a=[],s=t.children,l,c,d=0,h=0,u=s.length,f,_,y=t.value,b,v,M,x,w,k,P;d<u;){f=r-e,_=o-n;do b=s[h++].value;while(!b&&h<u);for(v=M=b,k=Math.max(_/f,f/_)/(y*i),P=b*b*k,w=Math.max(M/P,P/v);h<u;++h){if(b+=c=s[h].value,c<v&&(v=c),c>M&&(M=c),P=b*b*k,x=Math.max(M/P,P/v),x>w){b-=c;break}w=x}a.push(l={value:b,dice:f<_,children:s.slice(d,h)}),l.dice?P8(l,e,n,r,y?n+=_*b/y:o):R8(l,e,n,y?e+=f*b/y:r,o),y-=b,d=h}return a}var O8=(function i(t){function e(n,r,o,a,s){$le(t,n,r,o,a,s)}return e.ratio=function(n){return i((n=+n)>1?n:1)},e})(jle);function GB(){var i=O8,t=!1,e=1,n=1,r=[0],o=Cp,a=Cp,s=Cp,l=Cp,c=Cp;function d(u){return u.x0=u.y0=0,u.x1=e,u.y1=n,u.eachBefore(h),r=[0],t&&u.eachBefore(k8),u}function h(u){var f=r[u.depth],_=u.x0+f,y=u.y0+f,b=u.x1-f,v=u.y1-f;b<_&&(_=b=(_+b)/2),v<y&&(y=v=(y+v)/2),u.x0=_,u.y0=y,u.x1=b,u.y1=v,u.children&&(f=r[u.depth+1]=o(u)/2,_+=c(u)-f,y+=a(u)-f,b-=s(u)-f,v-=l(u)-f,b<_&&(_=b=(_+b)/2),v<y&&(y=v=(y+v)/2),i(u,_,y,b,v))}return d.round=function(u){return arguments.length?(t=!!u,d):t},d.size=function(u){return arguments.length?(e=+u[0],n=+u[1],d):[e,n]},d.tile=function(u){return arguments.length?(i=D8(u),d):i},d.padding=function(u){return arguments.length?d.paddingInner(u).paddingOuter(u):d.paddingInner()},d.paddingInner=function(u){return arguments.length?(o=typeof u=="function"?u:Mp(+u),d):o},d.paddingOuter=function(u){return arguments.length?d.paddingTop(u).paddingRight(u).paddingBottom(u).paddingLeft(u):d.paddingTop()},d.paddingTop=function(u){return arguments.length?(a=typeof u=="function"?u:Mp(+u),d):a},d.paddingRight=function(u){return arguments.length?(s=typeof u=="function"?u:Mp(+u),d):s},d.paddingBottom=function(u){return arguments.length?(l=typeof u=="function"?u:Mp(+u),d):l},d.paddingLeft=function(u){return arguments.length?(c=typeof u=="function"?u:Mp(+u),d):c},d}var ZB=rl(G8());function kf(i){let t=2;if(i.startsWith("/"))t=1;else if(!i.startsWith("./"))return i;return i.slice(t)}function W8(i){let t=[];if(i!==void 0)for(let{data:e}of Ui(i))e.type!=="Folder"&&t.push(e);return t}function JB(i,t){let e=eF(t);return e.ignoredNodePaths.ignores(kf(i.path))===e.condition}function eF(i){i=kf(i.trimStart());let t=!0;i.startsWith("!")&&(i=i.slice(1),t=!1);let e=(0,ZB.default)();for(let n of i.split(","))n=n.trimStart(),!n.startsWith("*")&&!n.endsWith("*")&&(n=n.startsWith('"')&&n.endsWith('"')?n.slice(1,-1):`*${n}*`),n.length!==0&&e.add(kf(n));return{ignoredNodePaths:e,condition:t}}function j8(i,t){return ma(i,t,"exclude")||ma(i,t,"flatten")}function ma(i,t,e){if(t.length===0)return!1;let n=(0,ZB.default)();for(let r of t)r.type===e&&n.add(kf(r.path));return n.ignores(kf(i))}function Pf(i,t){if(!t)return;let e;for(let n of t)(!e||e.path.length<n.path.length)&&(i.path.startsWith(`${n.path}/`)||i.path===n.path)&&(e=n);if(e)return e.color}function Yi(i){return i.children===void 0||i.children.length===0}var w1=(function(i){return i[i.SMALL_MAP=1]="SMALL_MAP",i[i.MEDIUM_MAP=.5]="MEDIUM_MAP",i[i.BIG_MAP=.25]="BIG_MAP",i})(w1||{});function Rf(i){let e=gN(i);switch(!0){case e>=7*1048576:return w1.BIG_MAP;case e>=2*1048576:return w1.MEDIUM_MAP;default:return w1.SMALL_MAP}}var X8=tc.codecharta.apiVersion,ml={fileIsInvalid:"File is empty or invalid.",apiVersionIsInvalid:"API Version is empty or invalid.",majorApiVersionIsOutdated:"API Version Outdated: Update CodeCharta API Version to match cc.json.",minorApiVersionOutdated:"Minor API Version Outdated.",nodesNotUnique:"Node names in combination with node types are not unique.",nodesEmpty:"The nodes array is empty. At least one node is required.",notAllFoldersAreFixed:"If at least one direct sub-folder of root is marked as fixed, all direct sub-folders of root must be fixed.",fixedFoldersOutOfBounds:"Coordinates of fixed folders must be within a range of 0 and 100.",fixedFoldersOverlapped:"Folders may not overlap.",fixedFoldersNotAllowed:"Fixated folders may not be defined in API-Version < 1.2.",fileAlreadyExists:"File already exists.",blacklistError:"Excluding all buildings is not possible.",fileContainsAuthorsAttribute:"File contains unsupported 'authors' attribute. This attribute will be ignored. Node containing the attribute: "};function K8(i){return!i||!i.nodes?[]:J8(i.nodes)}function Y8(i){let t=[];return i&&_ce(i)&&t.push(`${ml.minorApiVersionOutdated} Found: ${i.apiVersion}`),t}function Z8(i){let t=[];switch(!0){case!i:t.push(ml.fileIsInvalid);break;case!Ace(i):t.push(ml.apiVersionIsInvalid);break;case gce(i):t.push(ml.majorApiVersionIsOutdated);break}return t.length===0&&t.push(...pce(i)),t}function pce(i){let t=[];if(t.length===0){let n=new $8.default({allErrors:!0}).compile(_8);n(i)?i.nodes.length===0?t.push(ml.nodesEmpty):t.push(...vce(i.nodes[0]),...t6(i)):t.push(...n.errors.map(o=>bce(o)))}return t}function Ace(i){let{apiVersion:t}=i,e=t!==void 0,r=/\d+\.\d+/.test(t);return e&&r}function gce(i){return e_(i.apiVersion).major>e_(X8).major}function _ce(i){return e_(i.apiVersion).minor>e_(X8).minor}function J8(i){let t=[];for(let e of i)e.attributes?.authors&&(delete e.attributes.authors,t.push(`${ml.fileContainsAuthorsAttribute}"${e.name}"`)),e.children&&t.push(...J8(e.children));return t}function e_(i){return{major:Number(i.split(".")[0]),minor:Number(i.split(".")[1])}}function bce(i){let t=i.keyword.charAt(0).toUpperCase()+i.keyword.slice(1),e=i.dataPath.slice(1);return`${t} error: ${e} ${i.message}`}function vce(i){let t=[],e=new Set;return e.add(`${i.name}|${i.type}`),e6(i,t,e,`/${i.name}`),t}function e6(i,t,e,n){if(!Yi(i))for(let r of i.children){let o=`${n}/${r.name}`;e.has(`${o}|${r.type}`)?t.push(`${ml.nodesNotUnique} Found duplicate of ${r.type} with path: ${o}`):(e.add(`${o}|${r.type}`),e6(r,t,e,o))}}function yce(i,t,e,n,r,o){for(let a of i)if(a.fixedPosition===void 0)t.push(`${a.name}`);else{let s=e_(e.apiVersion);if(s.major<1||s.major===1&&s.minor<2){n.push(`${ml.fixedFoldersNotAllowed} Found: ${e.apiVersion}`);return}wce(a)&&r.push(J0(a));for(let l of i)l.fixedPosition!==void 0&&a!==l&&xce(a.fixedPosition,l.fixedPosition)&&!o.has(`${J0(l)} and ${J0(a)}`)&&o.add(`${J0(a)} and ${J0(l)}`)}}function t6(i,t=i.nodes[0].children){let e=[],n=[],r=[],o=new Set;yce(t,n,i,e,r,o),n.length>0&&n.length!==t.length&&e.push(`${ml.notAllFoldersAreFixed} Found: ${n.join(", ")}`),r.length>0&&e.push(`${ml.fixedFoldersOutOfBounds} Found: ${r.join(", ")}`),o.size>0&&e.push(`${ml.fixedFoldersOverlapped} Found: ${[...o].join(", ")}`);for(let a of t)a.children&&e.push(...t6(i,a.children));return e}function J0(i){return`${i.name} ${JSON.stringify(i.fixedPosition)}`}function xce(i,t){return C1(i.left,i.top,t)||C1(i.left,i.top+i.height,t)||C1(i.left+i.width,i.top,t)||C1(i.left+i.width,i.top+i.height,t)}function C1(i,t,e){return i>=e.left&&i<=e.left+e.width&&t>=e.top&&t<=e.top+e.height}function wce({fixedPosition:{left:i,top:t,width:e,height:n}}){return i<0||t<0||i+e>100||t+n>100||e<0||n<0}var M1=i=>{i.sort((t,e)=>{let n=t.name.toLowerCase(),r=e.name.toLowerCase();return n>r?1:r>n?-1:0})};var Tp="unary",S1=(i,t)=>{if(i.length===0)return[];let e=new Map,n=new Map,r=new Map;for(let{file:a}of i)for(let s of Ui(a.map))if(Yi(s)&&s.data.path&&!ma(s.data.path,t,"exclude"))for(let l of Object.keys(s.data.attributes)){let c=n.get(l),d=r.get(l);e.get(l)||e.set(l,[]),e.get(l).push(s.data.attributes[l]),(d===void 0||d>=s.data.attributes[l])&&r.set(l,s.data.attributes[l]),(c===void 0||c<=s.data.attributes[l])&&n.set(l,s.data.attributes[l])}let o=[];n.set(Tp,1),r.set(Tp,1);for(let[a,s]of n)o.push({name:a,values:e.get(a),maxValue:s,minValue:r.get(a)});return M1(o),o};var t_={decorateMap(i,t,e){for(let{data:n}of Ui(i)){n.isFlattened=!1,n.isExcluded=!1;for(let r of e)r.type==="flatten"?n.isFlattened=n.isFlattened||JB(n,r.path):n.isExcluded=n.isExcluded||JB(n,r.path)&&Yi(n)}i.isExcluded=!1,this.decorateMapWithMetricData(i,t)},decorateMapWithMetricData(i,t){let{nodeMetricData:e,edgeMetricData:n}=t,r=0;for(let{data:o}of Ui(i)){o.id=r,r++,o.attributes===void 0&&(o.attributes={}),Yi(o)&&(o.attributes[Tp]=1);for(let a of e)o.attributes[a.name]===void 0&&(o.attributes[a.name]=0),o.deltas!==void 0&&o.deltas[a.name]===void 0&&(o.deltas[a.name]=0);o.edgeAttributes===void 0&&(o.edgeAttributes={});for(let a of n)o.edgeAttributes[a.name]===void 0&&(o.edgeAttributes[a.name]={incoming:0,outgoing:0});Cce(o)}},decorateMapWithPathAttribute(i){for(let t of Ui(i.map))t.data.path=t.parent?`${t.parent.data.path}/${t.data.name}`:`/${t.data.name}`;return i},decorateParentNodesWithAggregatedAttributes(i,t,e){let n=new Map,r=Object.keys(i.attributes),o=Object.keys(i.edgeAttributes);Ui(i).eachAfter(function({data:s,parent:l}){if(!(s.isExcluded||!l)){for(let c of r){let d=`${c}${s.path}`,h=`${c}${l.data.path}`;e.nodes[c]===dl.relative?(Sce(n,d,h,s,c,t),Mce(n,h,s,c,t)):(l.data.attributes[c]+=s.attributes[c],t&&l.data.deltas&&(l.data.deltas[c]=l.data.deltas[c]??0,l.data.deltas[c]+=s.deltas[c]??0))}t&&l.data.fileCount&&(l.data.fileCount.added+=s.fileCount.added,l.data.fileCount.changed+=s.fileCount.changed,l.data.fileCount.removed+=s.fileCount.removed);for(let c of o){let d=s.edgeAttributes[c];if(!d)continue;let h=`${c}${s.path}`,u=`${c}${l.data.path}`;e.edges[c]===dl.relative?(n6(n,`INCOMING${h}`,`INCOMING${u}`,s,c,"incoming"),n6(n,`OUTGOING${h}`,`OUTGOING${u}`,s,c,"outgoing"),i6(n,`INCOMING${u}`,s,c,"incoming"),i6(n,`OUTGOING${u}`,s,c,"outgoing")):(l.data.edgeAttributes[c].incoming+=d.incoming,l.data.edgeAttributes[c].outgoing+=d.outgoing)}}});for(let a of o)e.edges[a]===dl.relative&&(i.edgeAttributes[a].incoming=Of(n.get(`INCOMING${a}${i.path}`)),i.edgeAttributes[a].outgoing=Of(n.get(`OUTGOING${a}${i.path}`)));for(let a of r)e.nodes[a]===dl.relative&&(i.attributes[a]=Of(n.get(`MEDIAN${a}${i.path}`)),t&&i.deltas&&(i.deltas[a]=Of(n.get(`DELTA${a}${i.path}`))))}};function Cce(i){if(!(i.children?.length===1&&i.children[0]?.fixedPosition)&&i.children?.length===1&&i.children[0].children?.length>0){let[t]=i.children;i.children=t.children,i.name+=`/${t.name}`,i.path+=`/${t.name}`,t.link&&(i.link=t.link)}}function i6(i,t,e,n,r){e.edgeAttributes[n][r]!==0&&iF(i,t,e,e.edgeAttributes[n][r])}function Mce(i,t,e,n,r){e.attributes[n]!==0&&iF(i,`MEDIAN${t}`,e,e.attributes[n]),r&&e.deltas&&e.deltas[n]!==0&&iF(i,`DELTA${t}`,e,e.deltas[n])}function Sce(i,t,e,n,r,o){if(Yi(n))return;let a=i.get(`MEDIAN${t}`);if(a!==void 0&&(n.attributes[r]=Of(a),tF(i,`MEDIAN${e}`,a)),o&&n.deltas){let s=i.get(`DELTA${t}`);s!==void 0&&(n.deltas[r]=Of(s),tF(i,`DELTA${e}`,s))}}function n6(i,t,e,n,r,o){if(Yi(n))return;let a=i.get(t);a!==void 0&&(n.edgeAttributes[r][o]=Of(a),tF(i,e,a))}function tF(i,t,e){let n=i.get(t);n===void 0?i.set(t,e):Tce(n,e)}function iF(i,t,e,n){let r=i.get(t);r===void 0?i.set(t,[n]):Yi(e)&&Ece(r,n)}function Of(i){if(i===void 0||i.length===0)return 0;let t=(i.length-1)/2;return(i[Math.floor(t)]+i[Math.ceil(t)])/2}function Ece(i,t){let e=0,n=i.length-1,r=0;if(n<0||i[n]<=t){i.push(t);return}if(i[0]>=t){i.unshift(t);return}for(;e<=n;)if(r=Math.floor((e+n)/2),i[r]<t)e=r+1;else if(n=r-1,i[n]<=t){i.splice(r,0,t);return}}function Tce(i,t){let e=0;for(let n=0;n<i.length;n++){let r=0;for(;i[n]>t[e]&&(r++,e++,e!==t.length););if(r>0&&(i.splice(n,0,...t.slice(e-r,e)),e===t.length))return}i.push(...t.slice(e))}function nF(i){return{fileName:i.fileMeta.fileName,fileSize:i.fileMeta.exportedFileSize,content:Bce(i)}}function Bce(i){return{projectName:i.fileMeta.projectName,apiVersion:i.fileMeta.apiVersion,fileChecksum:i.fileMeta.fileChecksum,nodes:[i.map],attributeTypes:i.settings.fileSettings.attributeTypes,attributeDescriptors:i.settings.fileSettings.attributeDescriptors,edges:i.settings.fileSettings.edges,markedPackages:i.settings.fileSettings.markedPackages,blacklist:i.settings.fileSettings.blacklist.map(t=>{switch(t.type){case"flatten":return{path:t.path,type:"hide"};case"exclude":return{path:t.path,type:t.type}}})}}function r6(i,t,e,n,r,o){let a=!1;for(let s of e){let l={fileName:s?.fileName,errors:[],warnings:[]};l.warnings.push(...K8(s?.content)),l.errors.push(...Z8(s?.content)),l.errors.length===0&&(l.warnings.push(...Y8(s?.content)),Fce(i,t,s,r,o)&&(a=!0)),(l.errors.length>0||l.warnings.length>0)&&n.push(l)}return a}function Fce(i,t,e,n,r){n()&&(i.length=0,r(),localStorage.removeItem("scenarios"));let o=AN(e);t_.decorateMapWithPathAttribute(o);let a=o.fileMeta.fileChecksum,s=o.fileMeta.fileName,l=new Map(i.map(h=>[h.file.fileMeta.fileName,h.file.fileMeta.fileChecksum])),c=new Map(i.map((h,u)=>[h.file.fileMeta.fileChecksum,u])),d=c.has(a);return l.has(s)&&(s=Ice(s,l,a),o.fileMeta.fileName=s),d?(i[c.get(a)].file.fileMeta.fileName=s,t.unshift(s),!1):(i.push({file:o,selectedAs:xi.None}),t.push(s),!0)}function Ice(i,t,e){if(t.get(i)===e)return i;let n=!1,r=1,o=i;for(;!n;){let a=i.indexOf(".");o=a>=0?[i.slice(0,a),"_",r,i.slice(a)].join(""):`${i}_${r}`,(t.get(o)===e||!t.has(o))&&(n=!0),r++}return o}var pa={rootName:"root",rootPath:"/root",updateRoot(i){this.rootName=i,this.rootPath=`/${i}`}};var pd=et("CURRENT_FILES_ARE_SAMPLE_FILES",rt());var E1="File(s) could not be loaded",Dce="File(s) are already loaded",pl=(()=>{class i{static{this.CC_FILE_EXTENSION=".cc.json"}constructor(e,n,r){this.store=e,this.state=n,this.dialog=r,this.referenceFileSubscription=this.store.select(Py).pipe(Li(o=>{o&&pa.updateRoot(o.map.name)})).subscribe()}ngOnDestroy(){this.referenceFileSubscription.unsubscribe()}loadFiles(e){let n=Io(this.state.getValue().files),r=[],o=[],a=r6(n,r,e,o,()=>this.state.getValue().appStatus.currentFilesAreSampleFiles,()=>this.store.dispatch(pd({value:!1})));if(o.length>0&&this.dialog.open(ts,{data:lN(o)}),r.length===0)throw new Error(E1);this.store.dispatch(cd({value:n}));let s=r[0],l=this.state.getValue().files.find(c=>c.file.fileMeta.fileName===s).file.map.name;if(this.store.dispatch(P0({fileNames:r})),pa.updateRoot(l),!a)throw new Error(Dce)}static{this.\u0275fac=function(n){return new(n||i)(Me(Fe),Me(Ai),Me(yn))}}static{this.\u0275prov=Ve({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var kce=/_\d{4}(?:-\d{1,2}){2}_\d{1,2}-\d{1,2}\./,La=(()=>{class i{static{this.JSON_EXTENSION=".json"}static getNewFileName(e,n){return`${this.getFileNameWithoutTimestamp(e,n)}_${this.getNewTimestamp()}`}static getNewTimestamp(){let e=new Date;return i.getFormattedTimestamp(e)}static getFormattedTimestamp(e){return e.toISOString().slice(0,16).replace("T","_").replace(":","-")}static getFileNameWithoutTimestamp(e,n){if(!n){let r=kce.exec(e);if(r)return e.slice(0,r.index);if(e.endsWith(pl.CC_FILE_EXTENSION))return e.slice(0,-pl.CC_FILE_EXTENSION.length);if(e.endsWith(i.JSON_EXTENSION))return e.slice(0,-i.JSON_EXTENSION.length)}return e}static withoutCCExtension(e){return e.replace(/(\.cc)?(\.json)?(\.gz)?$/,"")}}return i})();var Su=class{static downloadCurrentMap(t,e,n,r,o){let a=this.getProjectDataAsCCJsonFormat(t,e,n,r),s=o+pl.CC_FILE_EXTENSION;this.downloadData(JSON.stringify(a),s)}static getProjectDataAsCCJsonFormat(t,e,n,r){return{projectName:e.projectName,apiVersion:e.apiVersion,fileChecksum:e.fileChecksum,nodes:[this.undecorateMap(t)],attributeTypes:r.includes("AttributeTypes")?this.getAttributeTypesForJSON(n.attributeTypes):{},attributeDescriptors:r.includes("AttributeDescriptors")?this.getAttributeDescriptorsForJSON(n.attributeDescriptors):{},edges:r.includes("Edges")?this.undecorateEdges(n.edges):[],markedPackages:r.includes("MarkedPackages")?n.markedPackages:[],blacklist:this.getBlacklistToDownload(r,n.blacklist)}}static getBlacklistToDownload(t,e){let n=[];return t.includes("Flattens")&&n.push(...this.getFilteredBlacklist(e,"flatten").map(r=>({path:r.path,type:"hide"}))),t.includes("Excludes")&&n.push(...this.getFilteredBlacklist(e,"exclude")),n}static getAttributeTypesForJSON(t){return Object.keys(t.edges).length===0&&Object.keys(t.nodes).length===0?{}:t}static getAttributeDescriptorsForJSON(t){return Object.keys(t).length===0?{}:t}static getFilteredBlacklist(t,e){return t.filter(n=>n.type===e)}static undecorateMap(t){let e=Io(t);for(let{data:n}of Ui(e))delete n.isExcluded,delete n.isFlattened,delete n.edgeAttributes,delete n.path,n.type===Zn.FOLDER?n.attributes={}:delete n.attributes[Tp];return e}static undecorateEdges(t){let e=Io(t);for(let n of e)delete n.visible;return e}static downloadData(t,e){let n=new Blob([t],{type:"text/json"}),r=document.createEvent("MouseEvents"),o=document.createElement("a");o.download=e,o.href=window.URL.createObjectURL(n),o.dataset.downloadurl=["text/json",o.download,o.href].join(":"),r.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),o.dispatchEvent(r)}};var Aa=et("SET_STATE",rt());function o6(i){return i.type===Aa.type}var oF=".cc.config.json",Pce="1.0.1",Rce="1.0.1",a6="CodeCharta::customConfigs",Tn=class i{static{this.customConfigs=i.loadCustomConfigsFromLocalStorage()}static{this.customConfigChange$=new Hl(null)}static setCustomConfigsToLocalStorage(){let t={version:Pce,customConfigs:[...i.customConfigs]};localStorage.setItem(a6,JSON.stringify(t,vf)),i.customConfigChange$.next(null)}static loadCustomConfigsFromLocalStorage(){let t=this.getCcLocalStorage();return new Map(t?.customConfigs)}static getCcLocalStorage(){return JSON.parse(localStorage.getItem(a6),OT)}static addCustomConfig(t){i.customConfigs.set(t.id,t),i.setCustomConfigsToLocalStorage()}static editCustomConfigNote(t,e){let n=i.customConfigs.get(t);n.note=e,i.customConfigs.set(t,n),i.setCustomConfigsToLocalStorage()}static getCustomConfigSettings(t){return i.customConfigs.get(t)}static hasCustomConfigByName(t,e,n){for(let r of i.customConfigs.values())if(r.name===n&&r.mapSelectionMode===t&&this.areEqual(e,r.assignedMaps))return!0;return!1}static areEqual(t,e){return t.size!==e.size?!1:[...t.entries()].every(([n,r])=>e.has(n)&&e.get(n)===r)}static getCustomConfigs(){return i.customConfigs}static importCustomConfigs(t){let e=JSON.parse(t,OT);for(let n of e.customConfigs.values()){if(i.getCustomConfigSettings(n.id))continue;i.hasCustomConfigByName(n.mapSelectionMode,n.assignedMaps,n.name)&&(n.name+=` (${La.getFormattedTimestamp(new Date(n.creationTime))})`);let o=$e({id:n.id,name:n.name,creationTime:n.creationTime,assignedMaps:n.assignedMaps,customConfigVersion:n.customConfigVersion,mapSelectionMode:n.mapSelectionMode,stateSettings:n.stateSettings,camera:n.camera},n.note&&{note:n.note});i.addCustomConfig(o)}}static downloadCustomConfigs(t){let e={downloadApiVersion:Rce,timestamp:Date.now(),customConfigs:t},n=La.getNewTimestamp()+oF;Su.downloadData(JSON.stringify(e,vf),n)}static createExportCustomConfigFromConfig(t){return $e({},t)}static getCustomConfigsAmountByMapAndMode(t,e){let n=0;for(let r of i.customConfigs.values())[...r.assignedMaps.values()].join(" ")===t&&r.mapSelectionMode===e&&n++;return n}static getConfigNameSuggestionByFileState({mapSelectionMode:t,assignedMaps:e}){let n=[...e.values()].join(" "),r=i.getCustomConfigsAmountByMapAndMode(n,t)+1;return`${n} #${r}`}static deleteCustomConfigs(t){for(let e of t)i.customConfigs.delete(e.id);i.setCustomConfigsToLocalStorage()}static deleteCustomConfig(t){i.customConfigs.delete(t),i.setCustomConfigsToLocalStorage()}static sortCustomConfigDropDownGroupList(t,e){if(!e.hasApplicableItems){if(t.hasApplicableItems||t.mapSelectionMode<e.mapSelectionMode)return-1;if(t.mapSelectionMode===e.mapSelectionMode)return 0}return 1}static applyCustomConfig(t,e,n,r,o){let a=this.getCustomConfigSettings(t);e.dispatch(Aa({value:a.stateSettings})),a.camera&&(n.setPosition(a.camera.camera),r.setControlTarget(a.camera.cameraTarget)),o.render()}};var T1=()=>{let i=document.createElement("INPUT");return i.setAttribute("type","file"),i.setAttribute("accept",".json,.gz"),i.setAttribute("multiple",""),document.body.appendChild(i),i};var c6=rl(e1());var Bp="base";function d6(i){let{gameObjectPositions:t,cycles:e=[]}=JSON.parse(i),n={checksum:"",data:{projectName:"GameObjects",fileChecksum:"",apiVersion:"1.3",nodes:[]}},r=[{name:Bp,type:Zn.FOLDER,attributes:{},children:[]}];Oce(t);let o=t.find(s=>s.name==="root"),a=zce(o.scale);t.push(a);for(let s of t){let l=s.name.split(".");l[0]!==Bp&&u6(l,r[0].children,Bp,s,t,o)}return n.data.nodes=r,n.data.edges=e.map(s=>Vce(s)),n.data.attributeTypes=Qce(),n.checksum=(0,c6.default)(JSON.stringify(n.data)),n}function Oce(i){for(let t of i)t.name.startsWith("root")||(t.name=t.name.startsWith(".")?`root${t.name}`:`root.${t.name}`)}function u6(i,t,e,n,r,o){if(i.length===0)return;let[a]=i,s={name:a,type:s6(i)?Zn.FILE:Zn.FOLDER,attributes:{}};s6(i)?s=Nce(a,s,n):s.children=[],Lce(t,a)?s=t.find(d=>d.name===a):t.push(s);let l=r.find(d=>d.name===e);s.fixedPosition=Uce(s,l,n,o.name);let c=e===Bp?s.name:`${e}.${s.name}`;u6(i.slice(1),s.children,c,n,r,o)}function s6(i){return i.length===1}function Lce(i,t){return i.some(e=>e.name===t)}function Nce(i,t,e){let n=$e({},t);return n.attributes={height:e.scale.y},{name:i,type:Zn.FOLDER,attributes:{},children:[n]}}function Uce(i,t,e,n){let r;if(i.type===Zn.FOLDER){let o=t.position.x-t.scale.x/2,a=t.position.z-t.scale.z/2,s=e.position.x-e.scale.x/2,l=e.position.z-e.scale.z/2,c=B1((s-o)/t.scale.x*100,2),d=B1((l-a)/t.scale.z*100,2),h=B1(e.scale.z/t.scale.z*100,2),u=B1(e.scale.x/t.scale.x*100,2);r={left:d,top:c,width:h,height:u}}return i.name===n&&(r=Hce(r)),r}function B1(i,t){let e=Math.pow(10,t);return Math.round(i*e)/e}function Hce(i){let t=$e({},i);return t.top=Math.floor(50-t.height/2),t.left=Math.floor(50-t.width/2),t}function l6(i){let t=i.replaceAll(".","/"),n=i.split(".").slice(-1);return`/${Bp}/${t}/${n}`}function Vce(i){return{fromNodeName:l6(i.from),toNodeName:l6(i.to),attributes:{coupling:100}}}function Qce(){return{edges:{coupling:dl.relative}}}function zce(i){let t=Math.max(i.x,i.z);return{name:Bp,position:{x:0,y:0,z:0},scale:{x:t,y:0,z:t}}}var f6=rl(qB());var h6={$id:"http://example.com/example.json",$schema:"http://json-schema.org/draft-07/schema",default:{},description:"This is the JSON Schema for the GameObjectsPositions structure",examples:[{gameObjectPositions:[{name:"root.analysis.import.SourceCodeParser.src.test.kotlin.de.maibornwolff.codecharta.analysis.importer.sourcecodeparser.oop.core.extract.HelloWorldTest",position:{x:69,y:18.5,z:228.5},scale:{x:9,y:5,z:9}},{name:"root.analysis.import.SourceCodeParser.src.test.kotlin.de.maibornwolff.codecharta.analysis.importer.sourcecodeparser.oop.core.extract.TryCatchFinallyTest",position:{x:66,y:22.5,z:177.5},scale:{x:1,y:13,z:1}}],cycles:[{from:"root.analysis.import.SCMLogParser.src.main.java.de.maibornwolff.codecharta.analysis.importer.scmlogparser.SCMLogParser",to:"root.analysis.import.SCMLogParser.src.main.java.de.maibornwolff.codecharta.analysis.importer.scmlogparser.SCMLogParserParameter"}]}],required:["gameObjectPositions"],title:"The root schema",type:"object",properties:{gameObjectPositions:{$id:"#/properties/gameObjectPositions",type:"array",title:"The gameObjectPositions schema",description:"Defines the position and scale of GameObjects",default:[],examples:[[{name:"root.analysis.import.SourceCodeParser.src.test.kotlin.de.maibornwolff.codecharta.analysis.importer.sourcecodeparser.oop.core.extract.HelloWorldTest",position:{x:69,y:18.5,z:228.5},scale:{x:9,y:5,z:9}},{name:"root.analysis.import.SourceCodeParser.src.test.kotlin.de.maibornwolff.codecharta.analysis.importer.sourcecodeparser.oop.core.extract.SwitchCaseTest",position:{x:65,y:22,z:181},scale:{x:2,y:12,z:2}}]],additionalItems:!0,items:{$id:"#/properties/gameObjectPositions/items",anyOf:[{$id:"#/properties/gameObjectPositions/items/anyOf/0",type:"object",title:"The first anyOf schema",description:"Defines the properties of a GameObject",default:{},examples:[{name:"root.analysis.import.SourceCodeParser.src.test.kotlin.de.maibornwolff.codecharta.analysis.importer.sourcecodeparser.oop.core.extract.HelloWorldTest",position:{x:69,y:18.5,z:228.5},scale:{x:9,y:5,z:9}}],required:["name","position","scale"],properties:{name:{$id:"#/properties/gameObjectPositions/items/anyOf/0/properties/name",type:"string",title:"The name schema",description:"An explanation about the purpose of this instance.",default:"",examples:["root.analysis.import.SourceCodeParser.src.test.kotlin.de.maibornwolff.codecharta.analysis.importer.sourcecodeparser.oop.core.extract.HelloWorldTest"]},position:{$id:"#/properties/gameObjectPositions/items/anyOf/0/properties/position",type:"object",title:"The position schema",description:"The position in absolute values",default:{},examples:[{x:69,y:18.5,z:228.5}],required:["x","y","z"],properties:{x:{$id:"#/properties/gameObjectPositions/items/anyOf/0/properties/position/properties/x",type:"number",title:"The x schema",description:"x position",default:0,examples:[69]},y:{$id:"#/properties/gameObjectPositions/items/anyOf/0/properties/position/properties/y",type:"number",title:"The y schema",description:"y position",default:0,examples:[18.5]},z:{$id:"#/properties/gameObjectPositions/items/anyOf/0/properties/position/properties/z",type:"number",title:"The z schema",description:"z position",default:0,examples:[228.5]}},additionalProperties:!0},scale:{$id:"#/properties/gameObjectPositions/items/anyOf/0/properties/scale",type:"object",title:"The scale schema",description:"The scale of GameObjects",default:{},examples:[{x:9,y:5,z:9}],required:["x","y","z"],properties:{x:{$id:"#/properties/gameObjectPositions/items/anyOf/0/properties/scale/properties/x",type:"number",title:"The x schema",description:"x scale",default:0,examples:[9]},y:{$id:"#/properties/gameObjectPositions/items/anyOf/0/properties/scale/properties/y",type:"number",title:"The y schema",description:"y scale",default:0,examples:[5]},z:{$id:"#/properties/gameObjectPositions/items/anyOf/0/properties/scale/properties/z",type:"number",title:"The z schema",description:"z scale",default:0,examples:[9]}},additionalProperties:!0}},additionalProperties:!0}]}},cycles:{$id:"#/properties/cycles",type:"array",title:"The cycles schema",description:"Defines the cycles between GameObjects",default:[],examples:[[{from:"root.analysis.import.SCMLogParser.src.main.java.de.maibornwolff.codecharta.analysis.importer.scmlogparser.SCMLogParser",to:"root.analysis.import.SCMLogParser.src.main.java.de.maibornwolff.codecharta.analysis.importer.scmlogparser.SCMLogParserParameter"}]],additionalItems:!0,items:{$id:"#/properties/cycles/items",anyOf:[{$id:"#/properties/cycles/items/anyOf/0",type:"object",title:"The first anyOf schema",description:"A cycle between two GameObjects",default:{},examples:[{from:"root.analysis.import.SCMLogParser.src.main.java.de.maibornwolff.codecharta.analysis.importer.scmlogparser.SCMLogParser",to:"root.analysis.import.SCMLogParser.src.main.java.de.maibornwolff.codecharta.analysis.importer.scmlogparser.SCMLogParserParameter"}],required:["from","to"],properties:{from:{$id:"#/properties/cycles/items/anyOf/0/properties/from",type:"string",title:"The from schema",description:"from GameObject",default:"",examples:["root.analysis.import.SCMLogParser.src.main.java.de.maibornwolff.codecharta.analysis.importer.scmlogparser.SCMLogParser"]},to:{$id:"#/properties/cycles/items/anyOf/0/properties/to",type:"string",title:"The to schema",description:"to GameObject",default:"",examples:["root.analysis.import.SCMLogParser.src.main.java.de.maibornwolff.codecharta.analysis.importer.scmlogparser.SCMLogParserParameter"]}},additionalProperties:!0}]}}},additionalProperties:!0};function m6(i){return new f6.default({allErrors:!0}).validate(h6,JSON.parse(i))}function Rp(i){let t=i.length;for(;--t>=0;)i[t]=0}var Gce=0,J6=1,Wce=2,jce=3,$ce=258,BF=29,A_=256,l_=A_+1+BF,Dp=30,FF=19,e7=2*l_+1,Lf=15,aF=16,Xce=7,IF=256,t7=16,i7=17,n7=18,vF=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),R1=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),Kce=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),r7=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Yce=512,gd=new Array((l_+2)*2);Rp(gd);var o_=new Array(Dp*2);Rp(o_);var c_=new Array(Yce);Rp(c_);var d_=new Array($ce-jce+1);Rp(d_);var DF=new Array(BF);Rp(DF);var O1=new Array(Dp);Rp(O1);function sF(i,t,e,n,r){this.static_tree=i,this.extra_bits=t,this.extra_base=e,this.elems=n,this.max_length=r,this.has_stree=i&&i.length}var o7,a7,s7;function lF(i,t){this.dyn_tree=i,this.max_code=0,this.stat_desc=t}var l7=i=>i<256?c_[i]:c_[256+(i>>>7)],u_=(i,t)=>{i.pending_buf[i.pending++]=t&255,i.pending_buf[i.pending++]=t>>>8&255},Na=(i,t,e)=>{i.bi_valid>aF-e?(i.bi_buf|=t<<i.bi_valid&65535,u_(i,i.bi_buf),i.bi_buf=t>>aF-i.bi_valid,i.bi_valid+=e-aF):(i.bi_buf|=t<<i.bi_valid&65535,i.bi_valid+=e)},nc=(i,t,e)=>{Na(i,e[t*2],e[t*2+1])},c7=(i,t)=>{let e=0;do e|=i&1,i>>>=1,e<<=1;while(--t>0);return e>>>1},Zce=i=>{i.bi_valid===16?(u_(i,i.bi_buf),i.bi_buf=0,i.bi_valid=0):i.bi_valid>=8&&(i.pending_buf[i.pending++]=i.bi_buf&255,i.bi_buf>>=8,i.bi_valid-=8)},Jce=(i,t)=>{let e=t.dyn_tree,n=t.max_code,r=t.stat_desc.static_tree,o=t.stat_desc.has_stree,a=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,l=t.stat_desc.max_length,c,d,h,u,f,_,y=0;for(u=0;u<=Lf;u++)i.bl_count[u]=0;for(e[i.heap[i.heap_max]*2+1]=0,c=i.heap_max+1;c<e7;c++)d=i.heap[c],u=e[e[d*2+1]*2+1]+1,u>l&&(u=l,y++),e[d*2+1]=u,!(d>n)&&(i.bl_count[u]++,f=0,d>=s&&(f=a[d-s]),_=e[d*2],i.opt_len+=_*(u+f),o&&(i.static_len+=_*(r[d*2+1]+f)));if(y!==0){do{for(u=l-1;i.bl_count[u]===0;)u--;i.bl_count[u]--,i.bl_count[u+1]+=2,i.bl_count[l]--,y-=2}while(y>0);for(u=l;u!==0;u--)for(d=i.bl_count[u];d!==0;)h=i.heap[--c],!(h>n)&&(e[h*2+1]!==u&&(i.opt_len+=(u-e[h*2+1])*e[h*2],e[h*2+1]=u),d--)}},d7=(i,t,e)=>{let n=new Array(Lf+1),r=0,o,a;for(o=1;o<=Lf;o++)r=r+e[o-1]<<1,n[o]=r;for(a=0;a<=t;a++){let s=i[a*2+1];s!==0&&(i[a*2]=c7(n[s]++,s))}},ede=()=>{let i,t,e,n,r,o=new Array(Lf+1);for(e=0,n=0;n<BF-1;n++)for(DF[n]=e,i=0;i<1<<vF[n];i++)d_[e++]=n;for(d_[e-1]=n,r=0,n=0;n<16;n++)for(O1[n]=r,i=0;i<1<<R1[n];i++)c_[r++]=n;for(r>>=7;n<Dp;n++)for(O1[n]=r<<7,i=0;i<1<<R1[n]-7;i++)c_[256+r++]=n;for(t=0;t<=Lf;t++)o[t]=0;for(i=0;i<=143;)gd[i*2+1]=8,i++,o[8]++;for(;i<=255;)gd[i*2+1]=9,i++,o[9]++;for(;i<=279;)gd[i*2+1]=7,i++,o[7]++;for(;i<=287;)gd[i*2+1]=8,i++,o[8]++;for(d7(gd,l_+1,o),i=0;i<Dp;i++)o_[i*2+1]=5,o_[i*2]=c7(i,5);o7=new sF(gd,vF,A_+1,l_,Lf),a7=new sF(o_,R1,0,Dp,Lf),s7=new sF(new Array(0),Kce,0,FF,Xce)},u7=i=>{let t;for(t=0;t<l_;t++)i.dyn_ltree[t*2]=0;for(t=0;t<Dp;t++)i.dyn_dtree[t*2]=0;for(t=0;t<FF;t++)i.bl_tree[t*2]=0;i.dyn_ltree[IF*2]=1,i.opt_len=i.static_len=0,i.sym_next=i.matches=0},h7=i=>{i.bi_valid>8?u_(i,i.bi_buf):i.bi_valid>0&&(i.pending_buf[i.pending++]=i.bi_buf),i.bi_buf=0,i.bi_valid=0},p6=(i,t,e,n)=>{let r=t*2,o=e*2;return i[r]<i[o]||i[r]===i[o]&&n[t]<=n[e]},cF=(i,t,e)=>{let n=i.heap[e],r=e<<1;for(;r<=i.heap_len&&(r<i.heap_len&&p6(t,i.heap[r+1],i.heap[r],i.depth)&&r++,!p6(t,n,i.heap[r],i.depth));)i.heap[e]=i.heap[r],e=r,r<<=1;i.heap[e]=n},A6=(i,t,e)=>{let n,r,o=0,a,s;if(i.sym_next!==0)do n=i.pending_buf[i.sym_buf+o++]&255,n+=(i.pending_buf[i.sym_buf+o++]&255)<<8,r=i.pending_buf[i.sym_buf+o++],n===0?nc(i,r,t):(a=d_[r],nc(i,a+A_+1,t),s=vF[a],s!==0&&(r-=DF[a],Na(i,r,s)),n--,a=l7(n),nc(i,a,e),s=R1[a],s!==0&&(n-=O1[a],Na(i,n,s)));while(o<i.sym_next);nc(i,IF,t)},yF=(i,t)=>{let e=t.dyn_tree,n=t.stat_desc.static_tree,r=t.stat_desc.has_stree,o=t.stat_desc.elems,a,s,l=-1,c;for(i.heap_len=0,i.heap_max=e7,a=0;a<o;a++)e[a*2]!==0?(i.heap[++i.heap_len]=l=a,i.depth[a]=0):e[a*2+1]=0;for(;i.heap_len<2;)c=i.heap[++i.heap_len]=l<2?++l:0,e[c*2]=1,i.depth[c]=0,i.opt_len--,r&&(i.static_len-=n[c*2+1]);for(t.max_code=l,a=i.heap_len>>1;a>=1;a--)cF(i,e,a);c=o;do a=i.heap[1],i.heap[1]=i.heap[i.heap_len--],cF(i,e,1),s=i.heap[1],i.heap[--i.heap_max]=a,i.heap[--i.heap_max]=s,e[c*2]=e[a*2]+e[s*2],i.depth[c]=(i.depth[a]>=i.depth[s]?i.depth[a]:i.depth[s])+1,e[a*2+1]=e[s*2+1]=c,i.heap[1]=c++,cF(i,e,1);while(i.heap_len>=2);i.heap[--i.heap_max]=i.heap[1],Jce(i,t),d7(e,l,i.bl_count)},g6=(i,t,e)=>{let n,r=-1,o,a=t[1],s=0,l=7,c=4;for(a===0&&(l=138,c=3),t[(e+1)*2+1]=65535,n=0;n<=e;n++)o=a,a=t[(n+1)*2+1],!(++s<l&&o===a)&&(s<c?i.bl_tree[o*2]+=s:o!==0?(o!==r&&i.bl_tree[o*2]++,i.bl_tree[t7*2]++):s<=10?i.bl_tree[i7*2]++:i.bl_tree[n7*2]++,s=0,r=o,a===0?(l=138,c=3):o===a?(l=6,c=3):(l=7,c=4))},_6=(i,t,e)=>{let n,r=-1,o,a=t[1],s=0,l=7,c=4;for(a===0&&(l=138,c=3),n=0;n<=e;n++)if(o=a,a=t[(n+1)*2+1],!(++s<l&&o===a)){if(s<c)do nc(i,o,i.bl_tree);while(--s!==0);else o!==0?(o!==r&&(nc(i,o,i.bl_tree),s--),nc(i,t7,i.bl_tree),Na(i,s-3,2)):s<=10?(nc(i,i7,i.bl_tree),Na(i,s-3,3)):(nc(i,n7,i.bl_tree),Na(i,s-11,7));s=0,r=o,a===0?(l=138,c=3):o===a?(l=6,c=3):(l=7,c=4)}},tde=i=>{let t;for(g6(i,i.dyn_ltree,i.l_desc.max_code),g6(i,i.dyn_dtree,i.d_desc.max_code),yF(i,i.bl_desc),t=FF-1;t>=3&&i.bl_tree[r7[t]*2+1]===0;t--);return i.opt_len+=3*(t+1)+5+5+4,t},ide=(i,t,e,n)=>{let r;for(Na(i,t-257,5),Na(i,e-1,5),Na(i,n-4,4),r=0;r<n;r++)Na(i,i.bl_tree[r7[r]*2+1],3);_6(i,i.dyn_ltree,t-1),_6(i,i.dyn_dtree,e-1)},nde=i=>{let t=4093624447,e;for(e=0;e<=31;e++,t>>>=1)if(t&1&&i.dyn_ltree[e*2]!==0)return 0;if(i.dyn_ltree[18]!==0||i.dyn_ltree[20]!==0||i.dyn_ltree[26]!==0)return 1;for(e=32;e<A_;e++)if(i.dyn_ltree[e*2]!==0)return 1;return 0},b6=!1,rde=i=>{b6||(ede(),b6=!0),i.l_desc=new lF(i.dyn_ltree,o7),i.d_desc=new lF(i.dyn_dtree,a7),i.bl_desc=new lF(i.bl_tree,s7),i.bi_buf=0,i.bi_valid=0,u7(i)},f7=(i,t,e,n)=>{Na(i,(Gce<<1)+(n?1:0),3),h7(i),u_(i,e),u_(i,~e),e&&i.pending_buf.set(i.window.subarray(t,t+e),i.pending),i.pending+=e},ode=i=>{Na(i,J6<<1,3),nc(i,IF,gd),Zce(i)},ade=(i,t,e,n)=>{let r,o,a=0;i.level>0?(i.strm.data_type===2&&(i.strm.data_type=nde(i)),yF(i,i.l_desc),yF(i,i.d_desc),a=tde(i),r=i.opt_len+3+7>>>3,o=i.static_len+3+7>>>3,o<=r&&(r=o)):r=o=e+5,e+4<=r&&t!==-1?f7(i,t,e,n):i.strategy===4||o===r?(Na(i,(J6<<1)+(n?1:0),3),A6(i,gd,o_)):(Na(i,(Wce<<1)+(n?1:0),3),ide(i,i.l_desc.max_code+1,i.d_desc.max_code+1,a+1),A6(i,i.dyn_ltree,i.dyn_dtree)),u7(i),n&&h7(i)},sde=(i,t,e)=>(i.pending_buf[i.sym_buf+i.sym_next++]=t,i.pending_buf[i.sym_buf+i.sym_next++]=t>>8,i.pending_buf[i.sym_buf+i.sym_next++]=e,t===0?i.dyn_ltree[e*2]++:(i.matches++,t--,i.dyn_ltree[(d_[e]+A_+1)*2]++,i.dyn_dtree[l7(t)*2]++),i.sym_next===i.sym_end),lde=rde,cde=f7,dde=ade,ude=sde,hde=ode,fde={_tr_init:lde,_tr_stored_block:cde,_tr_flush_block:dde,_tr_tally:ude,_tr_align:hde},mde=(i,t,e,n)=>{let r=i&65535|0,o=i>>>16&65535|0,a=0;for(;e!==0;){a=e>2e3?2e3:e,e-=a;do r=r+t[n++]|0,o=o+r|0;while(--a);r%=65521,o%=65521}return r|o<<16|0},h_=mde,pde=()=>{let i,t=[];for(var e=0;e<256;e++){i=e;for(var n=0;n<8;n++)i=i&1?3988292384^i>>>1:i>>>1;t[e]=i}return t},Ade=new Uint32Array(pde()),gde=(i,t,e,n)=>{let r=Ade,o=n+e;i^=-1;for(let a=n;a<o;a++)i=i>>>8^r[(i^t[a])&255];return i^-1},go=gde,Hf={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Op={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},{_tr_init:_de,_tr_stored_block:xF,_tr_flush_block:bde,_tr_tally:Bu,_tr_align:vde}=fde,{Z_NO_FLUSH:Fu,Z_PARTIAL_FLUSH:yde,Z_FULL_FLUSH:xde,Z_FINISH:Ds,Z_BLOCK:v6,Z_OK:Do,Z_STREAM_END:y6,Z_STREAM_ERROR:rc,Z_DATA_ERROR:wde,Z_BUF_ERROR:dF,Z_DEFAULT_COMPRESSION:Cde,Z_FILTERED:Mde,Z_HUFFMAN_ONLY:F1,Z_RLE:Sde,Z_FIXED:Ede,Z_DEFAULT_STRATEGY:Tde,Z_UNKNOWN:Bde,Z_DEFLATED:U1}=Op,Fde=9,Ide=15,Dde=8,kde=29,Pde=256,wF=Pde+1+kde,Rde=30,Ode=19,Lde=2*wF+1,Nde=15,fn=3,Tu=258,oc=Tu+fn+1,Ude=32,kp=42,kF=57,CF=69,MF=73,SF=91,EF=103,Nf=113,n_=666,ga=1,Lp=2,Vf=3,Np=4,Hde=3,Uf=(i,t)=>(i.msg=Hf[t],t),x6=i=>i*2-(i>4?9:0),Eu=i=>{let t=i.length;for(;--t>=0;)i[t]=0},Vde=i=>{let t,e,n,r=i.w_size;t=i.hash_size,n=t;do e=i.head[--n],i.head[n]=e>=r?e-r:0;while(--t);t=r,n=t;do e=i.prev[--n],i.prev[n]=e>=r?e-r:0;while(--t)},Qde=(i,t,e)=>(t<<i.hash_shift^e)&i.hash_mask,Iu=Qde,is=i=>{let t=i.state,e=t.pending;e>i.avail_out&&(e=i.avail_out),e!==0&&(i.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+e),i.next_out),i.next_out+=e,t.pending_out+=e,i.total_out+=e,i.avail_out-=e,t.pending-=e,t.pending===0&&(t.pending_out=0))},ns=(i,t)=>{bde(i,i.block_start>=0?i.block_start:-1,i.strstart-i.block_start,t),i.block_start=i.strstart,is(i.strm)},Bn=(i,t)=>{i.pending_buf[i.pending++]=t},i_=(i,t)=>{i.pending_buf[i.pending++]=t>>>8&255,i.pending_buf[i.pending++]=t&255},TF=(i,t,e,n)=>{let r=i.avail_in;return r>n&&(r=n),r===0?0:(i.avail_in-=r,t.set(i.input.subarray(i.next_in,i.next_in+r),e),i.state.wrap===1?i.adler=h_(i.adler,t,r,e):i.state.wrap===2&&(i.adler=go(i.adler,t,r,e)),i.next_in+=r,i.total_in+=r,r)},m7=(i,t)=>{let e=i.max_chain_length,n=i.strstart,r,o,a=i.prev_length,s=i.nice_match,l=i.strstart>i.w_size-oc?i.strstart-(i.w_size-oc):0,c=i.window,d=i.w_mask,h=i.prev,u=i.strstart+Tu,f=c[n+a-1],_=c[n+a];i.prev_length>=i.good_match&&(e>>=2),s>i.lookahead&&(s=i.lookahead);do if(r=t,!(c[r+a]!==_||c[r+a-1]!==f||c[r]!==c[n]||c[++r]!==c[n+1])){n+=2,r++;do;while(c[++n]===c[++r]&&c[++n]===c[++r]&&c[++n]===c[++r]&&c[++n]===c[++r]&&c[++n]===c[++r]&&c[++n]===c[++r]&&c[++n]===c[++r]&&c[++n]===c[++r]&&n<u);if(o=Tu-(u-n),n=u-Tu,o>a){if(i.match_start=t,a=o,o>=s)break;f=c[n+a-1],_=c[n+a]}}while((t=h[t&d])>l&&--e!==0);return a<=i.lookahead?a:i.lookahead},Pp=i=>{let t=i.w_size,e,n,r;do{if(n=i.window_size-i.lookahead-i.strstart,i.strstart>=t+(t-oc)&&(i.window.set(i.window.subarray(t,t+t-n),0),i.match_start-=t,i.strstart-=t,i.block_start-=t,i.insert>i.strstart&&(i.insert=i.strstart),Vde(i),n+=t),i.strm.avail_in===0)break;if(e=TF(i.strm,i.window,i.strstart+i.lookahead,n),i.lookahead+=e,i.lookahead+i.insert>=fn)for(r=i.strstart-i.insert,i.ins_h=i.window[r],i.ins_h=Iu(i,i.ins_h,i.window[r+1]);i.insert&&(i.ins_h=Iu(i,i.ins_h,i.window[r+fn-1]),i.prev[r&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=r,r++,i.insert--,!(i.lookahead+i.insert<fn)););}while(i.lookahead<oc&&i.strm.avail_in!==0)},p7=(i,t)=>{let e=i.pending_buf_size-5>i.w_size?i.w_size:i.pending_buf_size-5,n,r,o,a=0,s=i.strm.avail_in;do{if(n=65535,o=i.bi_valid+42>>3,i.strm.avail_out<o||(o=i.strm.avail_out-o,r=i.strstart-i.block_start,n>r+i.strm.avail_in&&(n=r+i.strm.avail_in),n>o&&(n=o),n<e&&(n===0&&t!==Ds||t===Fu||n!==r+i.strm.avail_in)))break;a=t===Ds&&n===r+i.strm.avail_in?1:0,xF(i,0,0,a),i.pending_buf[i.pending-4]=n,i.pending_buf[i.pending-3]=n>>8,i.pending_buf[i.pending-2]=~n,i.pending_buf[i.pending-1]=~n>>8,is(i.strm),r&&(r>n&&(r=n),i.strm.output.set(i.window.subarray(i.block_start,i.block_start+r),i.strm.next_out),i.strm.next_out+=r,i.strm.avail_out-=r,i.strm.total_out+=r,i.block_start+=r,n-=r),n&&(TF(i.strm,i.strm.output,i.strm.next_out,n),i.strm.next_out+=n,i.strm.avail_out-=n,i.strm.total_out+=n)}while(a===0);return s-=i.strm.avail_in,s&&(s>=i.w_size?(i.matches=2,i.window.set(i.strm.input.subarray(i.strm.next_in-i.w_size,i.strm.next_in),0),i.strstart=i.w_size,i.insert=i.strstart):(i.window_size-i.strstart<=s&&(i.strstart-=i.w_size,i.window.set(i.window.subarray(i.w_size,i.w_size+i.strstart),0),i.matches<2&&i.matches++,i.insert>i.strstart&&(i.insert=i.strstart)),i.window.set(i.strm.input.subarray(i.strm.next_in-s,i.strm.next_in),i.strstart),i.strstart+=s,i.insert+=s>i.w_size-i.insert?i.w_size-i.insert:s),i.block_start=i.strstart),i.high_water<i.strstart&&(i.high_water=i.strstart),a?Np:t!==Fu&&t!==Ds&&i.strm.avail_in===0&&i.strstart===i.block_start?Lp:(o=i.window_size-i.strstart,i.strm.avail_in>o&&i.block_start>=i.w_size&&(i.block_start-=i.w_size,i.strstart-=i.w_size,i.window.set(i.window.subarray(i.w_size,i.w_size+i.strstart),0),i.matches<2&&i.matches++,o+=i.w_size,i.insert>i.strstart&&(i.insert=i.strstart)),o>i.strm.avail_in&&(o=i.strm.avail_in),o&&(TF(i.strm,i.window,i.strstart,o),i.strstart+=o,i.insert+=o>i.w_size-i.insert?i.w_size-i.insert:o),i.high_water<i.strstart&&(i.high_water=i.strstart),o=i.bi_valid+42>>3,o=i.pending_buf_size-o>65535?65535:i.pending_buf_size-o,e=o>i.w_size?i.w_size:o,r=i.strstart-i.block_start,(r>=e||(r||t===Ds)&&t!==Fu&&i.strm.avail_in===0&&r<=o)&&(n=r>o?o:r,a=t===Ds&&i.strm.avail_in===0&&n===r?1:0,xF(i,i.block_start,n,a),i.block_start+=n,is(i.strm)),a?Vf:ga)},uF=(i,t)=>{let e,n;for(;;){if(i.lookahead<oc){if(Pp(i),i.lookahead<oc&&t===Fu)return ga;if(i.lookahead===0)break}if(e=0,i.lookahead>=fn&&(i.ins_h=Iu(i,i.ins_h,i.window[i.strstart+fn-1]),e=i.prev[i.strstart&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=i.strstart),e!==0&&i.strstart-e<=i.w_size-oc&&(i.match_length=m7(i,e)),i.match_length>=fn)if(n=Bu(i,i.strstart-i.match_start,i.match_length-fn),i.lookahead-=i.match_length,i.match_length<=i.max_lazy_match&&i.lookahead>=fn){i.match_length--;do i.strstart++,i.ins_h=Iu(i,i.ins_h,i.window[i.strstart+fn-1]),e=i.prev[i.strstart&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=i.strstart;while(--i.match_length!==0);i.strstart++}else i.strstart+=i.match_length,i.match_length=0,i.ins_h=i.window[i.strstart],i.ins_h=Iu(i,i.ins_h,i.window[i.strstart+1]);else n=Bu(i,0,i.window[i.strstart]),i.lookahead--,i.strstart++;if(n&&(ns(i,!1),i.strm.avail_out===0))return ga}return i.insert=i.strstart<fn-1?i.strstart:fn-1,t===Ds?(ns(i,!0),i.strm.avail_out===0?Vf:Np):i.sym_next&&(ns(i,!1),i.strm.avail_out===0)?ga:Lp},Fp=(i,t)=>{let e,n,r;for(;;){if(i.lookahead<oc){if(Pp(i),i.lookahead<oc&&t===Fu)return ga;if(i.lookahead===0)break}if(e=0,i.lookahead>=fn&&(i.ins_h=Iu(i,i.ins_h,i.window[i.strstart+fn-1]),e=i.prev[i.strstart&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=i.strstart),i.prev_length=i.match_length,i.prev_match=i.match_start,i.match_length=fn-1,e!==0&&i.prev_length<i.max_lazy_match&&i.strstart-e<=i.w_size-oc&&(i.match_length=m7(i,e),i.match_length<=5&&(i.strategy===Mde||i.match_length===fn&&i.strstart-i.match_start>4096)&&(i.match_length=fn-1)),i.prev_length>=fn&&i.match_length<=i.prev_length){r=i.strstart+i.lookahead-fn,n=Bu(i,i.strstart-1-i.prev_match,i.prev_length-fn),i.lookahead-=i.prev_length-1,i.prev_length-=2;do++i.strstart<=r&&(i.ins_h=Iu(i,i.ins_h,i.window[i.strstart+fn-1]),e=i.prev[i.strstart&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=i.strstart);while(--i.prev_length!==0);if(i.match_available=0,i.match_length=fn-1,i.strstart++,n&&(ns(i,!1),i.strm.avail_out===0))return ga}else if(i.match_available){if(n=Bu(i,0,i.window[i.strstart-1]),n&&ns(i,!1),i.strstart++,i.lookahead--,i.strm.avail_out===0)return ga}else i.match_available=1,i.strstart++,i.lookahead--}return i.match_available&&(n=Bu(i,0,i.window[i.strstart-1]),i.match_available=0),i.insert=i.strstart<fn-1?i.strstart:fn-1,t===Ds?(ns(i,!0),i.strm.avail_out===0?Vf:Np):i.sym_next&&(ns(i,!1),i.strm.avail_out===0)?ga:Lp},zde=(i,t)=>{let e,n,r,o,a=i.window;for(;;){if(i.lookahead<=Tu){if(Pp(i),i.lookahead<=Tu&&t===Fu)return ga;if(i.lookahead===0)break}if(i.match_length=0,i.lookahead>=fn&&i.strstart>0&&(r=i.strstart-1,n=a[r],n===a[++r]&&n===a[++r]&&n===a[++r])){o=i.strstart+Tu;do;while(n===a[++r]&&n===a[++r]&&n===a[++r]&&n===a[++r]&&n===a[++r]&&n===a[++r]&&n===a[++r]&&n===a[++r]&&r<o);i.match_length=Tu-(o-r),i.match_length>i.lookahead&&(i.match_length=i.lookahead)}if(i.match_length>=fn?(e=Bu(i,1,i.match_length-fn),i.lookahead-=i.match_length,i.strstart+=i.match_length,i.match_length=0):(e=Bu(i,0,i.window[i.strstart]),i.lookahead--,i.strstart++),e&&(ns(i,!1),i.strm.avail_out===0))return ga}return i.insert=0,t===Ds?(ns(i,!0),i.strm.avail_out===0?Vf:Np):i.sym_next&&(ns(i,!1),i.strm.avail_out===0)?ga:Lp},qde=(i,t)=>{let e;for(;;){if(i.lookahead===0&&(Pp(i),i.lookahead===0)){if(t===Fu)return ga;break}if(i.match_length=0,e=Bu(i,0,i.window[i.strstart]),i.lookahead--,i.strstart++,e&&(ns(i,!1),i.strm.avail_out===0))return ga}return i.insert=0,t===Ds?(ns(i,!0),i.strm.avail_out===0?Vf:Np):i.sym_next&&(ns(i,!1),i.strm.avail_out===0)?ga:Lp};function ic(i,t,e,n,r){this.good_length=i,this.max_lazy=t,this.nice_length=e,this.max_chain=n,this.func=r}var r_=[new ic(0,0,0,0,p7),new ic(4,4,8,4,uF),new ic(4,5,16,8,uF),new ic(4,6,32,32,uF),new ic(4,4,16,16,Fp),new ic(8,16,32,32,Fp),new ic(8,16,128,128,Fp),new ic(8,32,128,256,Fp),new ic(32,128,258,1024,Fp),new ic(32,258,258,4096,Fp)],Gde=i=>{i.window_size=2*i.w_size,Eu(i.head),i.max_lazy_match=r_[i.level].max_lazy,i.good_match=r_[i.level].good_length,i.nice_match=r_[i.level].nice_length,i.max_chain_length=r_[i.level].max_chain,i.strstart=0,i.block_start=0,i.lookahead=0,i.insert=0,i.match_length=i.prev_length=fn-1,i.match_available=0,i.ins_h=0};function Wde(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=U1,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(Lde*2),this.dyn_dtree=new Uint16Array((2*Rde+1)*2),this.bl_tree=new Uint16Array((2*Ode+1)*2),Eu(this.dyn_ltree),Eu(this.dyn_dtree),Eu(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(Nde+1),this.heap=new Uint16Array(2*wF+1),Eu(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*wF+1),Eu(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}var g_=i=>{if(!i)return 1;let t=i.state;return!t||t.strm!==i||t.status!==kp&&t.status!==kF&&t.status!==CF&&t.status!==MF&&t.status!==SF&&t.status!==EF&&t.status!==Nf&&t.status!==n_?1:0},A7=i=>{if(g_(i))return Uf(i,rc);i.total_in=i.total_out=0,i.data_type=Bde;let t=i.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap===2?kF:t.wrap?kp:Nf,i.adler=t.wrap===2?0:1,t.last_flush=-2,_de(t),Do},g7=i=>{let t=A7(i);return t===Do&&Gde(i.state),t},jde=(i,t)=>g_(i)||i.state.wrap!==2?rc:(i.state.gzhead=t,Do),_7=(i,t,e,n,r,o)=>{if(!i)return rc;let a=1;if(t===Cde&&(t=6),n<0?(a=0,n=-n):n>15&&(a=2,n-=16),r<1||r>Fde||e!==U1||n<8||n>15||t<0||t>9||o<0||o>Ede||n===8&&a!==1)return Uf(i,rc);n===8&&(n=9);let s=new Wde;return i.state=s,s.strm=i,s.status=kp,s.wrap=a,s.gzhead=null,s.w_bits=n,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=r+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+fn-1)/fn),s.window=new Uint8Array(s.w_size*2),s.head=new Uint16Array(s.hash_size),s.prev=new Uint16Array(s.w_size),s.lit_bufsize=1<<r+6,s.pending_buf_size=s.lit_bufsize*4,s.pending_buf=new Uint8Array(s.pending_buf_size),s.sym_buf=s.lit_bufsize,s.sym_end=(s.lit_bufsize-1)*3,s.level=t,s.strategy=o,s.method=e,g7(i)},$de=(i,t)=>_7(i,t,U1,Ide,Dde,Tde),Xde=(i,t)=>{if(g_(i)||t>v6||t<0)return i?Uf(i,rc):rc;let e=i.state;if(!i.output||i.avail_in!==0&&!i.input||e.status===n_&&t!==Ds)return Uf(i,i.avail_out===0?dF:rc);let n=e.last_flush;if(e.last_flush=t,e.pending!==0){if(is(i),i.avail_out===0)return e.last_flush=-1,Do}else if(i.avail_in===0&&x6(t)<=x6(n)&&t!==Ds)return Uf(i,dF);if(e.status===n_&&i.avail_in!==0)return Uf(i,dF);if(e.status===kp&&e.wrap===0&&(e.status=Nf),e.status===kp){let r=U1+(e.w_bits-8<<4)<<8,o=-1;if(e.strategy>=F1||e.level<2?o=0:e.level<6?o=1:e.level===6?o=2:o=3,r|=o<<6,e.strstart!==0&&(r|=Ude),r+=31-r%31,i_(e,r),e.strstart!==0&&(i_(e,i.adler>>>16),i_(e,i.adler&65535)),i.adler=1,e.status=Nf,is(i),e.pending!==0)return e.last_flush=-1,Do}if(e.status===kF){if(i.adler=0,Bn(e,31),Bn(e,139),Bn(e,8),e.gzhead)Bn(e,(e.gzhead.text?1:0)+(e.gzhead.hcrc?2:0)+(e.gzhead.extra?4:0)+(e.gzhead.name?8:0)+(e.gzhead.comment?16:0)),Bn(e,e.gzhead.time&255),Bn(e,e.gzhead.time>>8&255),Bn(e,e.gzhead.time>>16&255),Bn(e,e.gzhead.time>>24&255),Bn(e,e.level===9?2:e.strategy>=F1||e.level<2?4:0),Bn(e,e.gzhead.os&255),e.gzhead.extra&&e.gzhead.extra.length&&(Bn(e,e.gzhead.extra.length&255),Bn(e,e.gzhead.extra.length>>8&255)),e.gzhead.hcrc&&(i.adler=go(i.adler,e.pending_buf,e.pending,0)),e.gzindex=0,e.status=CF;else if(Bn(e,0),Bn(e,0),Bn(e,0),Bn(e,0),Bn(e,0),Bn(e,e.level===9?2:e.strategy>=F1||e.level<2?4:0),Bn(e,Hde),e.status=Nf,is(i),e.pending!==0)return e.last_flush=-1,Do}if(e.status===CF){if(e.gzhead.extra){let r=e.pending,o=(e.gzhead.extra.length&65535)-e.gzindex;for(;e.pending+o>e.pending_buf_size;){let s=e.pending_buf_size-e.pending;if(e.pending_buf.set(e.gzhead.extra.subarray(e.gzindex,e.gzindex+s),e.pending),e.pending=e.pending_buf_size,e.gzhead.hcrc&&e.pending>r&&(i.adler=go(i.adler,e.pending_buf,e.pending-r,r)),e.gzindex+=s,is(i),e.pending!==0)return e.last_flush=-1,Do;r=0,o-=s}let a=new Uint8Array(e.gzhead.extra);e.pending_buf.set(a.subarray(e.gzindex,e.gzindex+o),e.pending),e.pending+=o,e.gzhead.hcrc&&e.pending>r&&(i.adler=go(i.adler,e.pending_buf,e.pending-r,r)),e.gzindex=0}e.status=MF}if(e.status===MF){if(e.gzhead.name){let r=e.pending,o;do{if(e.pending===e.pending_buf_size){if(e.gzhead.hcrc&&e.pending>r&&(i.adler=go(i.adler,e.pending_buf,e.pending-r,r)),is(i),e.pending!==0)return e.last_flush=-1,Do;r=0}e.gzindex<e.gzhead.name.length?o=e.gzhead.name.charCodeAt(e.gzindex++)&255:o=0,Bn(e,o)}while(o!==0);e.gzhead.hcrc&&e.pending>r&&(i.adler=go(i.adler,e.pending_buf,e.pending-r,r)),e.gzindex=0}e.status=SF}if(e.status===SF){if(e.gzhead.comment){let r=e.pending,o;do{if(e.pending===e.pending_buf_size){if(e.gzhead.hcrc&&e.pending>r&&(i.adler=go(i.adler,e.pending_buf,e.pending-r,r)),is(i),e.pending!==0)return e.last_flush=-1,Do;r=0}e.gzindex<e.gzhead.comment.length?o=e.gzhead.comment.charCodeAt(e.gzindex++)&255:o=0,Bn(e,o)}while(o!==0);e.gzhead.hcrc&&e.pending>r&&(i.adler=go(i.adler,e.pending_buf,e.pending-r,r))}e.status=EF}if(e.status===EF){if(e.gzhead.hcrc){if(e.pending+2>e.pending_buf_size&&(is(i),e.pending!==0))return e.last_flush=-1,Do;Bn(e,i.adler&255),Bn(e,i.adler>>8&255),i.adler=0}if(e.status=Nf,is(i),e.pending!==0)return e.last_flush=-1,Do}if(i.avail_in!==0||e.lookahead!==0||t!==Fu&&e.status!==n_){let r=e.level===0?p7(e,t):e.strategy===F1?qde(e,t):e.strategy===Sde?zde(e,t):r_[e.level].func(e,t);if((r===Vf||r===Np)&&(e.status=n_),r===ga||r===Vf)return i.avail_out===0&&(e.last_flush=-1),Do;if(r===Lp&&(t===yde?vde(e):t!==v6&&(xF(e,0,0,!1),t===xde&&(Eu(e.head),e.lookahead===0&&(e.strstart=0,e.block_start=0,e.insert=0))),is(i),i.avail_out===0))return e.last_flush=-1,Do}return t!==Ds?Do:e.wrap<=0?y6:(e.wrap===2?(Bn(e,i.adler&255),Bn(e,i.adler>>8&255),Bn(e,i.adler>>16&255),Bn(e,i.adler>>24&255),Bn(e,i.total_in&255),Bn(e,i.total_in>>8&255),Bn(e,i.total_in>>16&255),Bn(e,i.total_in>>24&255)):(i_(e,i.adler>>>16),i_(e,i.adler&65535)),is(i),e.wrap>0&&(e.wrap=-e.wrap),e.pending!==0?Do:y6)},Kde=i=>{if(g_(i))return rc;let t=i.state.status;return i.state=null,t===Nf?Uf(i,wde):Do},Yde=(i,t)=>{let e=t.length;if(g_(i))return rc;let n=i.state,r=n.wrap;if(r===2||r===1&&n.status!==kp||n.lookahead)return rc;if(r===1&&(i.adler=h_(i.adler,t,e,0)),n.wrap=0,e>=n.w_size){r===0&&(Eu(n.head),n.strstart=0,n.block_start=0,n.insert=0);let l=new Uint8Array(n.w_size);l.set(t.subarray(e-n.w_size,e),0),t=l,e=n.w_size}let o=i.avail_in,a=i.next_in,s=i.input;for(i.avail_in=e,i.next_in=0,i.input=t,Pp(n);n.lookahead>=fn;){let l=n.strstart,c=n.lookahead-(fn-1);do n.ins_h=Iu(n,n.ins_h,n.window[l+fn-1]),n.prev[l&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=l,l++;while(--c);n.strstart=l,n.lookahead=fn-1,Pp(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=fn-1,n.match_available=0,i.next_in=a,i.input=s,i.avail_in=o,n.wrap=r,Do},Zde=$de,Jde=_7,eue=g7,tue=A7,iue=jde,nue=Xde,rue=Kde,oue=Yde,aue="pako deflate (from Nodeca project)",a_={deflateInit:Zde,deflateInit2:Jde,deflateReset:eue,deflateResetKeep:tue,deflateSetHeader:iue,deflate:nue,deflateEnd:rue,deflateSetDictionary:oue,deflateInfo:aue},sue=(i,t)=>Object.prototype.hasOwnProperty.call(i,t),lue=function(i){let t=Array.prototype.slice.call(arguments,1);for(;t.length;){let e=t.shift();if(e){if(typeof e!="object")throw new TypeError(e+"must be non-object");for(let n in e)sue(e,n)&&(i[n]=e[n])}}return i},cue=i=>{let t=0;for(let n=0,r=i.length;n<r;n++)t+=i[n].length;let e=new Uint8Array(t);for(let n=0,r=0,o=i.length;n<o;n++){let a=i[n];e.set(a,r),r+=a.length}return e},H1={assign:lue,flattenChunks:cue},b7=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{b7=!1}var f_=new Uint8Array(256);for(let i=0;i<256;i++)f_[i]=i>=252?6:i>=248?5:i>=240?4:i>=224?3:i>=192?2:1;f_[254]=f_[254]=1;var due=i=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(i);let t,e,n,r,o,a=i.length,s=0;for(r=0;r<a;r++)e=i.charCodeAt(r),(e&64512)===55296&&r+1<a&&(n=i.charCodeAt(r+1),(n&64512)===56320&&(e=65536+(e-55296<<10)+(n-56320),r++)),s+=e<128?1:e<2048?2:e<65536?3:4;for(t=new Uint8Array(s),o=0,r=0;o<s;r++)e=i.charCodeAt(r),(e&64512)===55296&&r+1<a&&(n=i.charCodeAt(r+1),(n&64512)===56320&&(e=65536+(e-55296<<10)+(n-56320),r++)),e<128?t[o++]=e:e<2048?(t[o++]=192|e>>>6,t[o++]=128|e&63):e<65536?(t[o++]=224|e>>>12,t[o++]=128|e>>>6&63,t[o++]=128|e&63):(t[o++]=240|e>>>18,t[o++]=128|e>>>12&63,t[o++]=128|e>>>6&63,t[o++]=128|e&63);return t},uue=(i,t)=>{if(t<65534&&i.subarray&&b7)return String.fromCharCode.apply(null,i.length===t?i:i.subarray(0,t));let e="";for(let n=0;n<t;n++)e+=String.fromCharCode(i[n]);return e},hue=(i,t)=>{let e=t||i.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(i.subarray(0,t));let n,r,o=new Array(e*2);for(r=0,n=0;n<e;){let a=i[n++];if(a<128){o[r++]=a;continue}let s=f_[a];if(s>4){o[r++]=65533,n+=s-1;continue}for(a&=s===2?31:s===3?15:7;s>1&&n<e;)a=a<<6|i[n++]&63,s--;if(s>1){o[r++]=65533;continue}a<65536?o[r++]=a:(a-=65536,o[r++]=55296|a>>10&1023,o[r++]=56320|a&1023)}return uue(o,r)},fue=(i,t)=>{t=t||i.length,t>i.length&&(t=i.length);let e=t-1;for(;e>=0&&(i[e]&192)===128;)e--;return e<0||e===0?t:e+f_[i[e]]>t?e:t},m_={string2buf:due,buf2string:hue,utf8border:fue};function mue(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var v7=mue,y7=Object.prototype.toString,{Z_NO_FLUSH:pue,Z_SYNC_FLUSH:Aue,Z_FULL_FLUSH:gue,Z_FINISH:_ue,Z_OK:L1,Z_STREAM_END:bue,Z_DEFAULT_COMPRESSION:vue,Z_DEFAULT_STRATEGY:yue,Z_DEFLATED:xue}=Op;function __(i){this.options=H1.assign({level:vue,method:xue,chunkSize:16384,windowBits:15,memLevel:8,strategy:yue},i||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new v7,this.strm.avail_out=0;let e=a_.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(e!==L1)throw new Error(Hf[e]);if(t.header&&a_.deflateSetHeader(this.strm,t.header),t.dictionary){let n;if(typeof t.dictionary=="string"?n=m_.string2buf(t.dictionary):y7.call(t.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(t.dictionary):n=t.dictionary,e=a_.deflateSetDictionary(this.strm,n),e!==L1)throw new Error(Hf[e]);this._dict_set=!0}}__.prototype.push=function(i,t){let e=this.strm,n=this.options.chunkSize,r,o;if(this.ended)return!1;for(t===~~t?o=t:o=t===!0?_ue:pue,typeof i=="string"?e.input=m_.string2buf(i):y7.call(i)==="[object ArrayBuffer]"?e.input=new Uint8Array(i):e.input=i,e.next_in=0,e.avail_in=e.input.length;;){if(e.avail_out===0&&(e.output=new Uint8Array(n),e.next_out=0,e.avail_out=n),(o===Aue||o===gue)&&e.avail_out<=6){this.onData(e.output.subarray(0,e.next_out)),e.avail_out=0;continue}if(r=a_.deflate(e,o),r===bue)return e.next_out>0&&this.onData(e.output.subarray(0,e.next_out)),r=a_.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===L1;if(e.avail_out===0){this.onData(e.output);continue}if(o>0&&e.next_out>0){this.onData(e.output.subarray(0,e.next_out)),e.avail_out=0;continue}if(e.avail_in===0)break}return!0};__.prototype.onData=function(i){this.chunks.push(i)};__.prototype.onEnd=function(i){i===L1&&(this.result=H1.flattenChunks(this.chunks)),this.chunks=[],this.err=i,this.msg=this.strm.msg};function PF(i,t){let e=new __(t);if(e.push(i,!0),e.err)throw e.msg||Hf[e.err];return e.result}function wue(i,t){return t=t||{},t.raw=!0,PF(i,t)}function Cue(i,t){return t=t||{},t.gzip=!0,PF(i,t)}var Mue=__,Sue=PF,Eue=wue,Tue=Cue,Bue=Op,Fue={Deflate:Mue,deflate:Sue,deflateRaw:Eue,gzip:Tue,constants:Bue},I1=16209,Iue=16191,Due=function(t,e){let n,r,o,a,s,l,c,d,h,u,f,_,y,b,v,M,x,w,k,P,D,O,E,B,L=t.state;n=t.next_in,E=t.input,r=n+(t.avail_in-5),o=t.next_out,B=t.output,a=o-(e-t.avail_out),s=o+(t.avail_out-257),l=L.dmax,c=L.wsize,d=L.whave,h=L.wnext,u=L.window,f=L.hold,_=L.bits,y=L.lencode,b=L.distcode,v=(1<<L.lenbits)-1,M=(1<<L.distbits)-1;e:do{_<15&&(f+=E[n++]<<_,_+=8,f+=E[n++]<<_,_+=8),x=y[f&v];t:for(;;){if(w=x>>>24,f>>>=w,_-=w,w=x>>>16&255,w===0)B[o++]=x&65535;else if(w&16){k=x&65535,w&=15,w&&(_<w&&(f+=E[n++]<<_,_+=8),k+=f&(1<<w)-1,f>>>=w,_-=w),_<15&&(f+=E[n++]<<_,_+=8,f+=E[n++]<<_,_+=8),x=b[f&M];i:for(;;){if(w=x>>>24,f>>>=w,_-=w,w=x>>>16&255,w&16){if(P=x&65535,w&=15,_<w&&(f+=E[n++]<<_,_+=8,_<w&&(f+=E[n++]<<_,_+=8)),P+=f&(1<<w)-1,P>l){t.msg="invalid distance too far back",L.mode=I1;break e}if(f>>>=w,_-=w,w=o-a,P>w){if(w=P-w,w>d&&L.sane){t.msg="invalid distance too far back",L.mode=I1;break e}if(D=0,O=u,h===0){if(D+=c-w,w<k){k-=w;do B[o++]=u[D++];while(--w);D=o-P,O=B}}else if(h<w){if(D+=c+h-w,w-=h,w<k){k-=w;do B[o++]=u[D++];while(--w);if(D=0,h<k){w=h,k-=w;do B[o++]=u[D++];while(--w);D=o-P,O=B}}}else if(D+=h-w,w<k){k-=w;do B[o++]=u[D++];while(--w);D=o-P,O=B}for(;k>2;)B[o++]=O[D++],B[o++]=O[D++],B[o++]=O[D++],k-=3;k&&(B[o++]=O[D++],k>1&&(B[o++]=O[D++]))}else{D=o-P;do B[o++]=B[D++],B[o++]=B[D++],B[o++]=B[D++],k-=3;while(k>2);k&&(B[o++]=B[D++],k>1&&(B[o++]=B[D++]))}}else if((w&64)===0){x=b[(x&65535)+(f&(1<<w)-1)];continue i}else{t.msg="invalid distance code",L.mode=I1;break e}break}}else if((w&64)===0){x=y[(x&65535)+(f&(1<<w)-1)];continue t}else if(w&32){L.mode=Iue;break e}else{t.msg="invalid literal/length code",L.mode=I1;break e}break}}while(n<r&&o<s);k=_>>3,n-=k,_-=k<<3,f&=(1<<_)-1,t.next_in=n,t.next_out=o,t.avail_in=n<r?5+(r-n):5-(n-r),t.avail_out=o<s?257+(s-o):257-(o-s),L.hold=f,L.bits=_},Ip=15,w6=852,C6=592,M6=0,hF=1,S6=2,kue=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),Pue=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),Rue=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),Oue=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),Lue=(i,t,e,n,r,o,a,s)=>{let l=s.bits,c=0,d=0,h=0,u=0,f=0,_=0,y=0,b=0,v=0,M=0,x,w,k,P,D,O=null,E,B=new Uint16Array(Ip+1),L=new Uint16Array(Ip+1),q=null,W,oe,pe;for(c=0;c<=Ip;c++)B[c]=0;for(d=0;d<n;d++)B[t[e+d]]++;for(f=l,u=Ip;u>=1&&B[u]===0;u--);if(f>u&&(f=u),u===0)return r[o++]=1<<24|64<<16|0,r[o++]=1<<24|64<<16|0,s.bits=1,0;for(h=1;h<u&&B[h]===0;h++);for(f<h&&(f=h),b=1,c=1;c<=Ip;c++)if(b<<=1,b-=B[c],b<0)return-1;if(b>0&&(i===M6||u!==1))return-1;for(L[1]=0,c=1;c<Ip;c++)L[c+1]=L[c]+B[c];for(d=0;d<n;d++)t[e+d]!==0&&(a[L[t[e+d]]++]=d);if(i===M6?(O=q=a,E=20):i===hF?(O=kue,q=Pue,E=257):(O=Rue,q=Oue,E=0),M=0,d=0,c=h,D=o,_=f,y=0,k=-1,v=1<<f,P=v-1,i===hF&&v>w6||i===S6&&v>C6)return 1;for(;;){W=c-y,a[d]+1<E?(oe=0,pe=a[d]):a[d]>=E?(oe=q[a[d]-E],pe=O[a[d]-E]):(oe=96,pe=0),x=1<<c-y,w=1<<_,h=w;do w-=x,r[D+(M>>y)+w]=W<<24|oe<<16|pe|0;while(w!==0);for(x=1<<c-1;M&x;)x>>=1;if(x!==0?(M&=x-1,M+=x):M=0,d++,--B[c]===0){if(c===u)break;c=t[e+a[d]]}if(c>f&&(M&P)!==k){for(y===0&&(y=f),D+=h,_=c-y,b=1<<_;_+y<u&&(b-=B[_+y],!(b<=0));)_++,b<<=1;if(v+=1<<_,i===hF&&v>w6||i===S6&&v>C6)return 1;k=M&P,r[k]=f<<24|_<<16|D-o|0}}return M!==0&&(r[D+M]=c-y<<24|64<<16|0),s.bits=f,0},s_=Lue,Nue=0,x7=1,w7=2,{Z_FINISH:E6,Z_BLOCK:Uue,Z_TREES:D1,Z_OK:Qf,Z_STREAM_END:Hue,Z_NEED_DICT:Vue,Z_STREAM_ERROR:ks,Z_DATA_ERROR:C7,Z_MEM_ERROR:M7,Z_BUF_ERROR:Que,Z_DEFLATED:T6}=Op,V1=16180,B6=16181,F6=16182,I6=16183,D6=16184,k6=16185,P6=16186,R6=16187,O6=16188,L6=16189,N1=16190,Ad=16191,fF=16192,N6=16193,mF=16194,U6=16195,H6=16196,V6=16197,Q6=16198,k1=16199,P1=16200,z6=16201,q6=16202,G6=16203,W6=16204,j6=16205,pF=16206,$6=16207,X6=16208,fr=16209,S7=16210,E7=16211,zue=852,que=592,Gue=15,Wue=Gue,K6=i=>(i>>>24&255)+(i>>>8&65280)+((i&65280)<<8)+((i&255)<<24);function jue(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}var zf=i=>{if(!i)return 1;let t=i.state;return!t||t.strm!==i||t.mode<V1||t.mode>E7?1:0},T7=i=>{if(zf(i))return ks;let t=i.state;return i.total_in=i.total_out=t.total=0,i.msg="",t.wrap&&(i.adler=t.wrap&1),t.mode=V1,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(zue),t.distcode=t.distdyn=new Int32Array(que),t.sane=1,t.back=-1,Qf},B7=i=>{if(zf(i))return ks;let t=i.state;return t.wsize=0,t.whave=0,t.wnext=0,T7(i)},F7=(i,t)=>{let e;if(zf(i))return ks;let n=i.state;return t<0?(e=0,t=-t):(e=(t>>4)+5,t<48&&(t&=15)),t&&(t<8||t>15)?ks:(n.window!==null&&n.wbits!==t&&(n.window=null),n.wrap=e,n.wbits=t,B7(i))},I7=(i,t)=>{if(!i)return ks;let e=new jue;i.state=e,e.strm=i,e.window=null,e.mode=V1;let n=F7(i,t);return n!==Qf&&(i.state=null),n},$ue=i=>I7(i,Wue),Y6=!0,AF,gF,Xue=i=>{if(Y6){AF=new Int32Array(512),gF=new Int32Array(32);let t=0;for(;t<144;)i.lens[t++]=8;for(;t<256;)i.lens[t++]=9;for(;t<280;)i.lens[t++]=7;for(;t<288;)i.lens[t++]=8;for(s_(x7,i.lens,0,288,AF,0,i.work,{bits:9}),t=0;t<32;)i.lens[t++]=5;s_(w7,i.lens,0,32,gF,0,i.work,{bits:5}),Y6=!1}i.lencode=AF,i.lenbits=9,i.distcode=gF,i.distbits=5},D7=(i,t,e,n)=>{let r,o=i.state;return o.window===null&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new Uint8Array(o.wsize)),n>=o.wsize?(o.window.set(t.subarray(e-o.wsize,e),0),o.wnext=0,o.whave=o.wsize):(r=o.wsize-o.wnext,r>n&&(r=n),o.window.set(t.subarray(e-n,e-n+r),o.wnext),n-=r,n?(o.window.set(t.subarray(e-n,e),0),o.wnext=n,o.whave=o.wsize):(o.wnext+=r,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=r))),0},Kue=(i,t)=>{let e,n,r,o,a,s,l,c,d,h,u,f,_,y,b=0,v,M,x,w,k,P,D,O,E=new Uint8Array(4),B,L,q=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(zf(i)||!i.output||!i.input&&i.avail_in!==0)return ks;e=i.state,e.mode===Ad&&(e.mode=fF),a=i.next_out,r=i.output,l=i.avail_out,o=i.next_in,n=i.input,s=i.avail_in,c=e.hold,d=e.bits,h=s,u=l,O=Qf;e:for(;;)switch(e.mode){case V1:if(e.wrap===0){e.mode=fF;break}for(;d<16;){if(s===0)break e;s--,c+=n[o++]<<d,d+=8}if(e.wrap&2&&c===35615){e.wbits===0&&(e.wbits=15),e.check=0,E[0]=c&255,E[1]=c>>>8&255,e.check=go(e.check,E,2,0),c=0,d=0,e.mode=B6;break}if(e.head&&(e.head.done=!1),!(e.wrap&1)||(((c&255)<<8)+(c>>8))%31){i.msg="incorrect header check",e.mode=fr;break}if((c&15)!==T6){i.msg="unknown compression method",e.mode=fr;break}if(c>>>=4,d-=4,D=(c&15)+8,e.wbits===0&&(e.wbits=D),D>15||D>e.wbits){i.msg="invalid window size",e.mode=fr;break}e.dmax=1<<e.wbits,e.flags=0,i.adler=e.check=1,e.mode=c&512?L6:Ad,c=0,d=0;break;case B6:for(;d<16;){if(s===0)break e;s--,c+=n[o++]<<d,d+=8}if(e.flags=c,(e.flags&255)!==T6){i.msg="unknown compression method",e.mode=fr;break}if(e.flags&57344){i.msg="unknown header flags set",e.mode=fr;break}e.head&&(e.head.text=c>>8&1),e.flags&512&&e.wrap&4&&(E[0]=c&255,E[1]=c>>>8&255,e.check=go(e.check,E,2,0)),c=0,d=0,e.mode=F6;case F6:for(;d<32;){if(s===0)break e;s--,c+=n[o++]<<d,d+=8}e.head&&(e.head.time=c),e.flags&512&&e.wrap&4&&(E[0]=c&255,E[1]=c>>>8&255,E[2]=c>>>16&255,E[3]=c>>>24&255,e.check=go(e.check,E,4,0)),c=0,d=0,e.mode=I6;case I6:for(;d<16;){if(s===0)break e;s--,c+=n[o++]<<d,d+=8}e.head&&(e.head.xflags=c&255,e.head.os=c>>8),e.flags&512&&e.wrap&4&&(E[0]=c&255,E[1]=c>>>8&255,e.check=go(e.check,E,2,0)),c=0,d=0,e.mode=D6;case D6:if(e.flags&1024){for(;d<16;){if(s===0)break e;s--,c+=n[o++]<<d,d+=8}e.length=c,e.head&&(e.head.extra_len=c),e.flags&512&&e.wrap&4&&(E[0]=c&255,E[1]=c>>>8&255,e.check=go(e.check,E,2,0)),c=0,d=0}else e.head&&(e.head.extra=null);e.mode=k6;case k6:if(e.flags&1024&&(f=e.length,f>s&&(f=s),f&&(e.head&&(D=e.head.extra_len-e.length,e.head.extra||(e.head.extra=new Uint8Array(e.head.extra_len)),e.head.extra.set(n.subarray(o,o+f),D)),e.flags&512&&e.wrap&4&&(e.check=go(e.check,n,f,o)),s-=f,o+=f,e.length-=f),e.length))break e;e.length=0,e.mode=P6;case P6:if(e.flags&2048){if(s===0)break e;f=0;do D=n[o+f++],e.head&&D&&e.length<65536&&(e.head.name+=String.fromCharCode(D));while(D&&f<s);if(e.flags&512&&e.wrap&4&&(e.check=go(e.check,n,f,o)),s-=f,o+=f,D)break e}else e.head&&(e.head.name=null);e.length=0,e.mode=R6;case R6:if(e.flags&4096){if(s===0)break e;f=0;do D=n[o+f++],e.head&&D&&e.length<65536&&(e.head.comment+=String.fromCharCode(D));while(D&&f<s);if(e.flags&512&&e.wrap&4&&(e.check=go(e.check,n,f,o)),s-=f,o+=f,D)break e}else e.head&&(e.head.comment=null);e.mode=O6;case O6:if(e.flags&512){for(;d<16;){if(s===0)break e;s--,c+=n[o++]<<d,d+=8}if(e.wrap&4&&c!==(e.check&65535)){i.msg="header crc mismatch",e.mode=fr;break}c=0,d=0}e.head&&(e.head.hcrc=e.flags>>9&1,e.head.done=!0),i.adler=e.check=0,e.mode=Ad;break;case L6:for(;d<32;){if(s===0)break e;s--,c+=n[o++]<<d,d+=8}i.adler=e.check=K6(c),c=0,d=0,e.mode=N1;case N1:if(e.havedict===0)return i.next_out=a,i.avail_out=l,i.next_in=o,i.avail_in=s,e.hold=c,e.bits=d,Vue;i.adler=e.check=1,e.mode=Ad;case Ad:if(t===Uue||t===D1)break e;case fF:if(e.last){c>>>=d&7,d-=d&7,e.mode=pF;break}for(;d<3;){if(s===0)break e;s--,c+=n[o++]<<d,d+=8}switch(e.last=c&1,c>>>=1,d-=1,c&3){case 0:e.mode=N6;break;case 1:if(Xue(e),e.mode=k1,t===D1){c>>>=2,d-=2;break e}break;case 2:e.mode=H6;break;case 3:i.msg="invalid block type",e.mode=fr}c>>>=2,d-=2;break;case N6:for(c>>>=d&7,d-=d&7;d<32;){if(s===0)break e;s--,c+=n[o++]<<d,d+=8}if((c&65535)!==(c>>>16^65535)){i.msg="invalid stored block lengths",e.mode=fr;break}if(e.length=c&65535,c=0,d=0,e.mode=mF,t===D1)break e;case mF:e.mode=U6;case U6:if(f=e.length,f){if(f>s&&(f=s),f>l&&(f=l),f===0)break e;r.set(n.subarray(o,o+f),a),s-=f,o+=f,l-=f,a+=f,e.length-=f;break}e.mode=Ad;break;case H6:for(;d<14;){if(s===0)break e;s--,c+=n[o++]<<d,d+=8}if(e.nlen=(c&31)+257,c>>>=5,d-=5,e.ndist=(c&31)+1,c>>>=5,d-=5,e.ncode=(c&15)+4,c>>>=4,d-=4,e.nlen>286||e.ndist>30){i.msg="too many length or distance symbols",e.mode=fr;break}e.have=0,e.mode=V6;case V6:for(;e.have<e.ncode;){for(;d<3;){if(s===0)break e;s--,c+=n[o++]<<d,d+=8}e.lens[q[e.have++]]=c&7,c>>>=3,d-=3}for(;e.have<19;)e.lens[q[e.have++]]=0;if(e.lencode=e.lendyn,e.lenbits=7,B={bits:e.lenbits},O=s_(Nue,e.lens,0,19,e.lencode,0,e.work,B),e.lenbits=B.bits,O){i.msg="invalid code lengths set",e.mode=fr;break}e.have=0,e.mode=Q6;case Q6:for(;e.have<e.nlen+e.ndist;){for(;b=e.lencode[c&(1<<e.lenbits)-1],v=b>>>24,M=b>>>16&255,x=b&65535,!(v<=d);){if(s===0)break e;s--,c+=n[o++]<<d,d+=8}if(x<16)c>>>=v,d-=v,e.lens[e.have++]=x;else{if(x===16){for(L=v+2;d<L;){if(s===0)break e;s--,c+=n[o++]<<d,d+=8}if(c>>>=v,d-=v,e.have===0){i.msg="invalid bit length repeat",e.mode=fr;break}D=e.lens[e.have-1],f=3+(c&3),c>>>=2,d-=2}else if(x===17){for(L=v+3;d<L;){if(s===0)break e;s--,c+=n[o++]<<d,d+=8}c>>>=v,d-=v,D=0,f=3+(c&7),c>>>=3,d-=3}else{for(L=v+7;d<L;){if(s===0)break e;s--,c+=n[o++]<<d,d+=8}c>>>=v,d-=v,D=0,f=11+(c&127),c>>>=7,d-=7}if(e.have+f>e.nlen+e.ndist){i.msg="invalid bit length repeat",e.mode=fr;break}for(;f--;)e.lens[e.have++]=D}}if(e.mode===fr)break;if(e.lens[256]===0){i.msg="invalid code -- missing end-of-block",e.mode=fr;break}if(e.lenbits=9,B={bits:e.lenbits},O=s_(x7,e.lens,0,e.nlen,e.lencode,0,e.work,B),e.lenbits=B.bits,O){i.msg="invalid literal/lengths set",e.mode=fr;break}if(e.distbits=6,e.distcode=e.distdyn,B={bits:e.distbits},O=s_(w7,e.lens,e.nlen,e.ndist,e.distcode,0,e.work,B),e.distbits=B.bits,O){i.msg="invalid distances set",e.mode=fr;break}if(e.mode=k1,t===D1)break e;case k1:e.mode=P1;case P1:if(s>=6&&l>=258){i.next_out=a,i.avail_out=l,i.next_in=o,i.avail_in=s,e.hold=c,e.bits=d,Due(i,u),a=i.next_out,r=i.output,l=i.avail_out,o=i.next_in,n=i.input,s=i.avail_in,c=e.hold,d=e.bits,e.mode===Ad&&(e.back=-1);break}for(e.back=0;b=e.lencode[c&(1<<e.lenbits)-1],v=b>>>24,M=b>>>16&255,x=b&65535,!(v<=d);){if(s===0)break e;s--,c+=n[o++]<<d,d+=8}if(M&&(M&240)===0){for(w=v,k=M,P=x;b=e.lencode[P+((c&(1<<w+k)-1)>>w)],v=b>>>24,M=b>>>16&255,x=b&65535,!(w+v<=d);){if(s===0)break e;s--,c+=n[o++]<<d,d+=8}c>>>=w,d-=w,e.back+=w}if(c>>>=v,d-=v,e.back+=v,e.length=x,M===0){e.mode=j6;break}if(M&32){e.back=-1,e.mode=Ad;break}if(M&64){i.msg="invalid literal/length code",e.mode=fr;break}e.extra=M&15,e.mode=z6;case z6:if(e.extra){for(L=e.extra;d<L;){if(s===0)break e;s--,c+=n[o++]<<d,d+=8}e.length+=c&(1<<e.extra)-1,c>>>=e.extra,d-=e.extra,e.back+=e.extra}e.was=e.length,e.mode=q6;case q6:for(;b=e.distcode[c&(1<<e.distbits)-1],v=b>>>24,M=b>>>16&255,x=b&65535,!(v<=d);){if(s===0)break e;s--,c+=n[o++]<<d,d+=8}if((M&240)===0){for(w=v,k=M,P=x;b=e.distcode[P+((c&(1<<w+k)-1)>>w)],v=b>>>24,M=b>>>16&255,x=b&65535,!(w+v<=d);){if(s===0)break e;s--,c+=n[o++]<<d,d+=8}c>>>=w,d-=w,e.back+=w}if(c>>>=v,d-=v,e.back+=v,M&64){i.msg="invalid distance code",e.mode=fr;break}e.offset=x,e.extra=M&15,e.mode=G6;case G6:if(e.extra){for(L=e.extra;d<L;){if(s===0)break e;s--,c+=n[o++]<<d,d+=8}e.offset+=c&(1<<e.extra)-1,c>>>=e.extra,d-=e.extra,e.back+=e.extra}if(e.offset>e.dmax){i.msg="invalid distance too far back",e.mode=fr;break}e.mode=W6;case W6:if(l===0)break e;if(f=u-l,e.offset>f){if(f=e.offset-f,f>e.whave&&e.sane){i.msg="invalid distance too far back",e.mode=fr;break}f>e.wnext?(f-=e.wnext,_=e.wsize-f):_=e.wnext-f,f>e.length&&(f=e.length),y=e.window}else y=r,_=a-e.offset,f=e.length;f>l&&(f=l),l-=f,e.length-=f;do r[a++]=y[_++];while(--f);e.length===0&&(e.mode=P1);break;case j6:if(l===0)break e;r[a++]=e.length,l--,e.mode=P1;break;case pF:if(e.wrap){for(;d<32;){if(s===0)break e;s--,c|=n[o++]<<d,d+=8}if(u-=l,i.total_out+=u,e.total+=u,e.wrap&4&&u&&(i.adler=e.check=e.flags?go(e.check,r,u,a-u):h_(e.check,r,u,a-u)),u=l,e.wrap&4&&(e.flags?c:K6(c))!==e.check){i.msg="incorrect data check",e.mode=fr;break}c=0,d=0}e.mode=$6;case $6:if(e.wrap&&e.flags){for(;d<32;){if(s===0)break e;s--,c+=n[o++]<<d,d+=8}if(e.wrap&4&&c!==(e.total&4294967295)){i.msg="incorrect length check",e.mode=fr;break}c=0,d=0}e.mode=X6;case X6:O=Hue;break e;case fr:O=C7;break e;case S7:return M7;case E7:default:return ks}return i.next_out=a,i.avail_out=l,i.next_in=o,i.avail_in=s,e.hold=c,e.bits=d,(e.wsize||u!==i.avail_out&&e.mode<fr&&(e.mode<pF||t!==E6))&&D7(i,i.output,i.next_out,u-i.avail_out),h-=i.avail_in,u-=i.avail_out,i.total_in+=h,i.total_out+=u,e.total+=u,e.wrap&4&&u&&(i.adler=e.check=e.flags?go(e.check,r,u,i.next_out-u):h_(e.check,r,u,i.next_out-u)),i.data_type=e.bits+(e.last?64:0)+(e.mode===Ad?128:0)+(e.mode===k1||e.mode===mF?256:0),(h===0&&u===0||t===E6)&&O===Qf&&(O=Que),O},Yue=i=>{if(zf(i))return ks;let t=i.state;return t.window&&(t.window=null),i.state=null,Qf},Zue=(i,t)=>{if(zf(i))return ks;let e=i.state;return(e.wrap&2)===0?ks:(e.head=t,t.done=!1,Qf)},Jue=(i,t)=>{let e=t.length,n,r,o;return zf(i)||(n=i.state,n.wrap!==0&&n.mode!==N1)?ks:n.mode===N1&&(r=1,r=h_(r,t,e,0),r!==n.check)?C7:(o=D7(i,t,e,e),o?(n.mode=S7,M7):(n.havedict=1,Qf))},ehe=B7,the=F7,ihe=T7,nhe=$ue,rhe=I7,ohe=Kue,ahe=Yue,she=Zue,lhe=Jue,che="pako inflate (from Nodeca project)",_d={inflateReset:ehe,inflateReset2:the,inflateResetKeep:ihe,inflateInit:nhe,inflateInit2:rhe,inflate:ohe,inflateEnd:ahe,inflateGetHeader:she,inflateSetDictionary:lhe,inflateInfo:che};function dhe(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var uhe=dhe,k7=Object.prototype.toString,{Z_NO_FLUSH:hhe,Z_FINISH:fhe,Z_OK:p_,Z_STREAM_END:_F,Z_NEED_DICT:bF,Z_STREAM_ERROR:mhe,Z_DATA_ERROR:Z6,Z_MEM_ERROR:phe}=Op;function b_(i){this.options=H1.assign({chunkSize:1024*64,windowBits:15,to:""},i||{});let t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(i&&i.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15)===0&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new v7,this.strm.avail_out=0;let e=_d.inflateInit2(this.strm,t.windowBits);if(e!==p_)throw new Error(Hf[e]);if(this.header=new uhe,_d.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=m_.string2buf(t.dictionary):k7.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(e=_d.inflateSetDictionary(this.strm,t.dictionary),e!==p_)))throw new Error(Hf[e])}b_.prototype.push=function(i,t){let e=this.strm,n=this.options.chunkSize,r=this.options.dictionary,o,a,s;if(this.ended)return!1;for(t===~~t?a=t:a=t===!0?fhe:hhe,k7.call(i)==="[object ArrayBuffer]"?e.input=new Uint8Array(i):e.input=i,e.next_in=0,e.avail_in=e.input.length;;){for(e.avail_out===0&&(e.output=new Uint8Array(n),e.next_out=0,e.avail_out=n),o=_d.inflate(e,a),o===bF&&r&&(o=_d.inflateSetDictionary(e,r),o===p_?o=_d.inflate(e,a):o===Z6&&(o=bF));e.avail_in>0&&o===_F&&e.state.wrap>0&&i[e.next_in]!==0;)_d.inflateReset(e),o=_d.inflate(e,a);switch(o){case mhe:case Z6:case bF:case phe:return this.onEnd(o),this.ended=!0,!1}if(s=e.avail_out,e.next_out&&(e.avail_out===0||o===_F))if(this.options.to==="string"){let l=m_.utf8border(e.output,e.next_out),c=e.next_out-l,d=m_.buf2string(e.output,l);e.next_out=c,e.avail_out=n-c,c&&e.output.set(e.output.subarray(l,l+c),0),this.onData(d)}else this.onData(e.output.length===e.next_out?e.output:e.output.subarray(0,e.next_out));if(!(o===p_&&s===0)){if(o===_F)return o=_d.inflateEnd(this.strm),this.onEnd(o),this.ended=!0,!0;if(e.avail_in===0)break}}return!0};b_.prototype.onData=function(i){this.chunks.push(i)};b_.prototype.onEnd=function(i){i===p_&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=H1.flattenChunks(this.chunks)),this.chunks=[],this.err=i,this.msg=this.strm.msg};function RF(i,t){let e=new b_(t);if(e.push(i),e.err)throw e.msg||Hf[e.err];return e.result}function Ahe(i,t){return t=t||{},t.raw=!0,RF(i,t)}var ghe=b_,_he=RF,bhe=Ahe,vhe=RF,yhe=Op,xhe={Inflate:ghe,inflate:_he,inflateRaw:bhe,ungzip:vhe,constants:yhe},{Deflate:SUe,deflate:EUe,deflateRaw:TUe,gzip:BUe}=Fue,{Inflate:FUe,inflate:IUe,inflateRaw:DUe,ungzip:whe}=xhe;var Q1=whe;var z1=i=>{let t=[];for(let e=0;e<i.length;e++)t.push(Che(i[e]));return t},Che=i=>ht(null,null,function*(){return new Promise(t=>{let e=i.name.endsWith(".gz"),n=new FileReader;e?n.readAsArrayBuffer(i):n.readAsText(i,"utf8");let r;n.onload=o=>{let a=o.target.result.toString();r=e?Q1(o.target.result,{to:"string"}):a,a.includes("gameObjectPositions")&&m6(a)&&(r=JSON.stringify(d6(a)))},n.onloadend=()=>{t(r)}})});var q1=(()=>{class i{constructor(e,n){this.store=e,this.loadFileService=n,this.isUploading=!1}uploadFiles(){let e=T1();e.addEventListener("change",()=>{this.uploadFilesOnEvent(e)}),e.click()}uploadFilesOnEvent(e){return ht(this,null,function*(){try{this.isUploading=!0,this.store.dispatch(Za({value:!0})),this.store.dispatch(cl({value:!0}));let n=yield Promise.all(z1(e.files)),{customConfigs:r,ccFiles:o}=this.splitCustomConfigsAndCCFiles(e.files,n);for(let a of r)Tn.importCustomConfigs(a);o.length>0&&this.loadFileService.loadFiles(o)}catch{this.store.dispatch(Za({value:!1})),this.store.dispatch(cl({value:!1}))}finally{this.isUploading=!1}})}splitCustomConfigsAndCCFiles(e,n){let r=[],o=[];for(let[a,s]of n.entries()){let l=e[a].name;l.includes(oF)?r.push(s):o.push({fileName:l,fileSize:e[a].size,content:K0(s)})}return{customConfigs:r,ccFiles:o}}static{this.\u0275fac=function(n){return new(n||i)(Me(Fe),Me(pl))}}static{this.\u0275prov=Ve({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();var R7=(()=>{class i{constructor(e){this.uploadFilesService=e}uploadFiles(){this.uploadFilesService.uploadFiles()}static{this.\u0275fac=function(n){return new(n||i)(se(q1))}}static{this.\u0275cmp=te({type:i,selectors:[["cc-upload-files-button"]],decls:1,vars:1,consts:[["title","Load cc.json files",3,"click","icon"]],template:function(n,r){n&1&&(T(0,"cc-action-icon",0),he("click",function(){return r.uploadFiles()}),F()),n&2&&G("icon","fa fa-folder-open folder-icon")},dependencies:[Oa],encapsulation:2})}}return i})();var OF=typeof navigator<"u"?navigator.userAgent.toLowerCase().indexOf("firefox")>0:!1;function LF(i,t,e,n){i.addEventListener?i.addEventListener(t,e,n):i.attachEvent&&i.attachEvent("on".concat(t),e)}function v_(i,t,e,n){i.removeEventListener?i.removeEventListener(t,e,n):i.detachEvent&&i.detachEvent("on".concat(t),e)}function N7(i,t){let e=t.slice(0,t.length-1);for(let n=0;n<e.length;n++)e[n]=i[e[n].toLowerCase()];return e}function U7(i){typeof i!="string"&&(i=""),i=i.replace(/\s/g,"");let t=i.split(","),e=t.lastIndexOf("");for(;e>=0;)t[e-1]+=",",t.splice(e,1),e=t.lastIndexOf("");return t}function Mhe(i,t){let e=i.length>=t.length?i:t,n=i.length>=t.length?t:i,r=!0;for(let o=0;o<e.length;o++)n.indexOf(e[o])===-1&&(r=!1);return r}var w_={backspace:8,"\u232B":8,tab:9,clear:12,enter:13,"\u21A9":13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,arrowup:38,arrowdown:40,arrowleft:37,arrowright:39,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"\u21EA":20,",":188,".":190,"/":191,"`":192,"-":OF?173:189,"=":OF?61:187,";":OF?59:186,"'":222,"{":219,"}":221,"[":219,"]":221,"\\":220},gl={"\u21E7":16,shift:16,"\u2325":18,alt:18,option:18,"\u2303":17,ctrl:17,control:17,"\u2318":91,cmd:91,meta:91,command:91},y_={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},ko={16:!1,18:!1,17:!1,91:!1},Mr={};for(let i=1;i<20;i++)w_["f".concat(i)]=111+i;var mr=[],x_=null,H7="all",bd=new Map,Up=i=>w_[i.toLowerCase()]||gl[i.toLowerCase()]||i.toUpperCase().charCodeAt(0),She=i=>Object.keys(w_).find(t=>w_[t]===i),Ehe=i=>Object.keys(gl).find(t=>gl[t]===i);function V7(i){H7=i||"all"}function C_(){return H7||"all"}function The(){return mr.slice(0)}function Bhe(){return mr.map(i=>She(i)||Ehe(i)||String.fromCharCode(i))}function Fhe(){let i=[];return Object.keys(Mr).forEach(t=>{Mr[t].forEach(e=>{let{key:n,scope:r,mods:o,shortcut:a}=e;i.push({scope:r,shortcut:a,mods:o,keys:n.split("+").map(s=>Up(s))})})}),i}function Ihe(i){let t=i.target||i.srcElement,{tagName:e}=t,n=!0,r=e==="INPUT"&&!["checkbox","radio","range","button","file","reset","submit","color"].includes(t.type);return(t.isContentEditable||(r||e==="TEXTAREA"||e==="SELECT")&&!t.readOnly)&&(n=!1),n}function Dhe(i){return typeof i=="string"&&(i=Up(i)),mr.indexOf(i)!==-1}function khe(i,t){let e,n;i||(i=C_());for(let r in Mr)if(Object.prototype.hasOwnProperty.call(Mr,r))for(e=Mr[r],n=0;n<e.length;)e[n].scope===i?e.splice(n,1).forEach(a=>{let{element:s}=a;return UF(s)}):n++;C_()===i&&V7(t||"all")}function Phe(i){let t=i.keyCode||i.which||i.charCode;i.key&&i.key.toLowerCase()==="capslock"&&(t=Up(i.key));let e=mr.indexOf(t);if(e>=0&&mr.splice(e,1),i.key&&i.key.toLowerCase()==="meta"&&mr.splice(0,mr.length),(t===93||t===224)&&(t=91),t in ko){ko[t]=!1;for(let n in gl)gl[n]===t&&(Al[n]=!1)}}function Q7(i){if(typeof i>"u")Object.keys(Mr).forEach(r=>{Array.isArray(Mr[r])&&Mr[r].forEach(o=>G1(o)),delete Mr[r]}),UF(null);else if(Array.isArray(i))i.forEach(r=>{r.key&&G1(r)});else if(typeof i=="object")i.key&&G1(i);else if(typeof i=="string"){for(var t=arguments.length,e=new Array(t>1?t-1:0),n=1;n<t;n++)e[n-1]=arguments[n];let[r,o]=e;typeof r=="function"&&(o=r,r=""),G1({key:i,scope:r,method:o,splitKey:"+"})}}var G1=i=>{let{key:t,scope:e,method:n,splitKey:r="+"}=i;U7(t).forEach(a=>{let s=a.split(r),l=s.length,c=s[l-1],d=c==="*"?"*":Up(c);if(!Mr[d])return;e||(e=C_());let h=l>1?N7(gl,s):[],u=[];Mr[d]=Mr[d].filter(f=>{let y=(n?f.method===n:!0)&&f.scope===e&&Mhe(f.mods,h);return y&&u.push(f.element),!y}),u.forEach(f=>UF(f))})};function O7(i,t,e,n){if(t.element!==n)return;let r;if(t.scope===e||t.scope==="all"){r=t.mods.length>0;for(let o in ko)Object.prototype.hasOwnProperty.call(ko,o)&&(!ko[o]&&t.mods.indexOf(+o)>-1||ko[o]&&t.mods.indexOf(+o)===-1)&&(r=!1);(t.mods.length===0&&!ko[16]&&!ko[18]&&!ko[17]&&!ko[91]||r||t.shortcut==="*")&&(t.keys=[],t.keys=t.keys.concat(mr),t.method(i,t)===!1&&(i.preventDefault?i.preventDefault():i.returnValue=!1,i.stopPropagation&&i.stopPropagation(),i.cancelBubble&&(i.cancelBubble=!0)))}}function L7(i,t){let e=Mr["*"],n=i.keyCode||i.which||i.charCode;if(i.key&&i.key.toLowerCase()==="capslock"||!Al.filter.call(this,i))return;if((n===93||n===224)&&(n=91),mr.indexOf(n)===-1&&n!==229&&mr.push(n),["metaKey","ctrlKey","altKey","shiftKey"].forEach(s=>{let l=y_[s];i[s]&&mr.indexOf(l)===-1?mr.push(l):!i[s]&&mr.indexOf(l)>-1?mr.splice(mr.indexOf(l),1):s==="metaKey"&&i[s]&&(mr=mr.filter(c=>c in y_||c===n))}),n in ko){ko[n]=!0;for(let s in gl)if(Object.prototype.hasOwnProperty.call(gl,s)){let l=y_[gl[s]];Al[s]=i[l]}if(!e)return}for(let s in ko)Object.prototype.hasOwnProperty.call(ko,s)&&(ko[s]=i[y_[s]]);i.getModifierState&&!(i.altKey&&!i.ctrlKey)&&i.getModifierState("AltGraph")&&(mr.indexOf(17)===-1&&mr.push(17),mr.indexOf(18)===-1&&mr.push(18),ko[17]=!0,ko[18]=!0);let r=C_();if(e)for(let s=0;s<e.length;s++)e[s].scope===r&&(i.type==="keydown"&&e[s].keydown||i.type==="keyup"&&e[s].keyup)&&O7(i,e[s],r,t);if(!(n in Mr))return;let o=Mr[n],a=o.length;for(let s=0;s<a;s++)if((i.type==="keydown"&&o[s].keydown||i.type==="keyup"&&o[s].keyup)&&o[s].key){let l=o[s],{splitKey:c}=l,d=l.key.split(c),h=[];for(let u=0;u<d.length;u++)h.push(Up(d[u]));h.sort().join("")===mr.sort().join("")&&O7(i,l,r,t)}}function Al(i,t,e){mr=[];let n=U7(i),r=[],o="all",a=document,s=0,l=!1,c=!0,d="+",h=!1,u=!1;for(e===void 0&&typeof t=="function"&&(e=t),Object.prototype.toString.call(t)==="[object Object]"&&(t.scope&&(o=t.scope),t.element&&(a=t.element),t.keyup&&(l=t.keyup),t.keydown!==void 0&&(c=t.keydown),t.capture!==void 0&&(h=t.capture),typeof t.splitKey=="string"&&(d=t.splitKey),t.single===!0&&(u=!0)),typeof t=="string"&&(o=t),u&&Q7(i,o);s<n.length;s++)i=n[s].split(d),r=[],i.length>1&&(r=N7(gl,i)),i=i[i.length-1],i=i==="*"?"*":Up(i),i in Mr||(Mr[i]=[]),Mr[i].push({keyup:l,keydown:c,scope:o,mods:r,shortcut:n[s],method:e,key:n[s],splitKey:d,element:a});if(typeof a<"u"&&window){if(!bd.has(a)){let f=function(){let y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.event;return L7(y,a)},_=function(){let y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.event;L7(y,a),Phe(y)};bd.set(a,{keydownListener:f,keyupListenr:_,capture:h}),LF(a,"keydown",f,h),LF(a,"keyup",_,h)}if(!x_){let f=()=>{mr=[]};x_={listener:f,capture:h},LF(window,"focus",f,h)}}}function Rhe(i){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"all";Object.keys(Mr).forEach(e=>{Mr[e].filter(r=>r.scope===t&&r.shortcut===i).forEach(r=>{r&&r.method&&r.method()})})}function UF(i){let t=Object.values(Mr).flat();if(t.findIndex(n=>{let{element:r}=n;return r===i})<0){let{keydownListener:n,keyupListenr:r,capture:o}=bd.get(i)||{};n&&r&&(v_(i,"keyup",r,o),v_(i,"keydown",n,o),bd.delete(i))}if((t.length<=0||bd.size<=0)&&(Object.keys(bd).forEach(r=>{let{keydownListener:o,keyupListenr:a,capture:s}=bd.get(r)||{};o&&a&&(v_(r,"keyup",a,s),v_(r,"keydown",o,s),bd.delete(r))}),bd.clear(),Object.keys(Mr).forEach(r=>delete Mr[r]),x_)){let{listener:r,capture:o}=x_;v_(window,"focus",r,o),x_=null}}var NF={getPressedKeyString:Bhe,setScope:V7,getScope:C_,deleteScope:khe,getPressedKeyCodes:The,getAllKeyCodes:Fhe,isPressed:Dhe,filter:Ihe,trigger:Rhe,unbind:Q7,keyMap:w_,modifier:gl,modifierMap:y_};for(let i in NF)Object.prototype.hasOwnProperty.call(NF,i)&&(Al[i]=NF[i]);if(typeof window<"u"){let i=window.hotkeys;Al.noConflict=t=>(t&&window.hotkeys===Al&&(window.hotkeys=i),Al),window.hotkeys=Al}var SV=rl(z7());var ya={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},fc={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},Ohe=0,q7=1,Lhe=2;var sH=1,Nhe=2,Sd=3,Vu=0,ta=1,Ed=2,sc=0,cA=1,G7=2,W7=3,j7=4,Uhe=5,Yf=100,Hhe=101,Vhe=102,Qhe=103,zhe=104,qhe=200,Ghe=201,Whe=202,jhe=203,yI=204,xI=205,$he=206,Xhe=207,Khe=208,Yhe=209,Zhe=210,Jhe=211,efe=212,tfe=213,ife=214,nfe=0,rfe=1,ofe=2,Fx=3,afe=4,sfe=5,lfe=6,cfe=7,N3=0,dfe=1,ufe=2,Uu=0,hfe=1,ffe=2,mfe=3,pfe=4,Afe=5,gfe=6,_fe=7;var $7=300,mA=301,pA=302,wI=303,CI=304,cw=306,AA=1e3,Jf=1001,MI=1002,Os=1003,bfe=1004;var W1=1005;var as=1006,QF=1007;var em=1008;var Fd=1009,lH=1010,cH=1011,H_=1012,U3=1013,im=1014,Td=1015,sm=1016,H3=1017,V3=1018,gA=1020,dH=35902,uH=1021,hH=1022,ss=1023,fH=1024,mH=1025,dA=1026,_A=1027,pH=1028,Q3=1029,AH=1030,z3=1031;var q3=1033,Mx=33776,Sx=33777,Ex=33778,Tx=33779,SI=35840,EI=35841,TI=35842,BI=35843,FI=36196,II=37492,DI=37496,kI=37808,PI=37809,RI=37810,OI=37811,LI=37812,NI=37813,UI=37814,HI=37815,VI=37816,QI=37817,zI=37818,qI=37819,GI=37820,WI=37821,Bx=36492,jI=36494,$I=36495,gH=36283,XI=36284,KI=36285,YI=36286;var Ix=2300,ZI=2301,zF=2302,X7=2400,K7=2401,Y7=2402;var vfe=3200,yfe=3201;var G3=0,xfe=1,Nu="",Rs="srgb",Wu="srgb-linear",W3="display-p3",dw="display-p3-linear",Dx="linear",or="srgb",kx="rec709",Px="p3";var Hp=7680;var Z7=519,wfe=512,Cfe=513,Mfe=514,_H=515,Sfe=516,Efe=517,Tfe=518,Bfe=519,JI=35044;var J7="300 es",Bd=2e3,Rx=2001,Id=class{addEventListener(t,e){this._listeners===void 0&&(this._listeners={});let n=this._listeners;n[t]===void 0&&(n[t]=[]),n[t].indexOf(e)===-1&&n[t].push(e)}hasEventListener(t,e){if(this._listeners===void 0)return!1;let n=this._listeners;return n[t]!==void 0&&n[t].indexOf(e)!==-1}removeEventListener(t,e){if(this._listeners===void 0)return;let r=this._listeners[t];if(r!==void 0){let o=r.indexOf(e);o!==-1&&r.splice(o,1)}}dispatchEvent(t){if(this._listeners===void 0)return;let n=this._listeners[t.type];if(n!==void 0){t.target=this;let r=n.slice(0);for(let o=0,a=r.length;o<a;o++)r[o].call(this,t);t.target=null}}},Jo=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"],e9=1234567,R_=Math.PI/180,V_=180/Math.PI;function lc(){let i=Math.random()*4294967295|0,t=Math.random()*4294967295|0,e=Math.random()*4294967295|0,n=Math.random()*4294967295|0;return(Jo[i&255]+Jo[i>>8&255]+Jo[i>>16&255]+Jo[i>>24&255]+"-"+Jo[t&255]+Jo[t>>8&255]+"-"+Jo[t>>16&15|64]+Jo[t>>24&255]+"-"+Jo[e&63|128]+Jo[e>>8&255]+"-"+Jo[e>>16&255]+Jo[e>>24&255]+Jo[n&255]+Jo[n>>8&255]+Jo[n>>16&255]+Jo[n>>24&255]).toLowerCase()}function bo(i,t,e){return Math.max(t,Math.min(e,i))}function j3(i,t){return(i%t+t)%t}function Ffe(i,t,e,n,r){return n+(i-t)*(r-n)/(e-t)}function Ife(i,t,e){return i!==t?(e-i)/(t-i):0}function O_(i,t,e){return(1-e)*i+e*t}function Dfe(i,t,e,n){return O_(i,t,1-Math.exp(-e*n))}function kfe(i,t=1){return t-Math.abs(j3(i,t*2)-t)}function Pfe(i,t,e){return i<=t?0:i>=e?1:(i=(i-t)/(e-t),i*i*(3-2*i))}function Rfe(i,t,e){return i<=t?0:i>=e?1:(i=(i-t)/(e-t),i*i*i*(i*(i*6-15)+10))}function Ofe(i,t){return i+Math.floor(Math.random()*(t-i+1))}function Lfe(i,t){return i+Math.random()*(t-i)}function Nfe(i){return i*(.5-Math.random())}function Ufe(i){i!==void 0&&(e9=i);let t=e9+=1831565813;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}function Hfe(i){return i*R_}function Vfe(i){return i*V_}function Qfe(i){return(i&i-1)===0&&i!==0}function zfe(i){return Math.pow(2,Math.ceil(Math.log(i)/Math.LN2))}function qfe(i){return Math.pow(2,Math.floor(Math.log(i)/Math.LN2))}function Gfe(i,t,e,n,r){let o=Math.cos,a=Math.sin,s=o(e/2),l=a(e/2),c=o((t+n)/2),d=a((t+n)/2),h=o((t-n)/2),u=a((t-n)/2),f=o((n-t)/2),_=a((n-t)/2);switch(r){case"XYX":i.set(s*d,l*h,l*u,s*c);break;case"YZY":i.set(l*u,s*d,l*h,s*c);break;case"ZXZ":i.set(l*h,l*u,s*d,s*c);break;case"XZX":i.set(s*d,l*_,l*f,s*c);break;case"YXY":i.set(l*f,s*d,l*_,s*c);break;case"ZYZ":i.set(l*_,l*f,s*d,s*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}function xl(i,t){switch(t.constructor){case Float32Array:return i;case Uint32Array:return i/4294967295;case Uint16Array:return i/65535;case Uint8Array:return i/255;case Int32Array:return Math.max(i/2147483647,-1);case Int16Array:return Math.max(i/32767,-1);case Int8Array:return Math.max(i/127,-1);default:throw new Error("Invalid component type.")}}function Hn(i,t){switch(t.constructor){case Float32Array:return i;case Uint32Array:return Math.round(i*4294967295);case Uint16Array:return Math.round(i*65535);case Uint8Array:return Math.round(i*255);case Int32Array:return Math.round(i*2147483647);case Int16Array:return Math.round(i*32767);case Int8Array:return Math.round(i*127);default:throw new Error("Invalid component type.")}}var bH={DEG2RAD:R_,RAD2DEG:V_,generateUUID:lc,clamp:bo,euclideanModulo:j3,mapLinear:Ffe,inverseLerp:Ife,lerp:O_,damp:Dfe,pingpong:kfe,smoothstep:Pfe,smootherstep:Rfe,randInt:Ofe,randFloat:Lfe,randFloatSpread:Nfe,seededRandom:Ufe,degToRad:Hfe,radToDeg:Vfe,isPowerOfTwo:Qfe,ceilPowerOfTwo:zfe,floorPowerOfTwo:qfe,setQuaternionFromProperEuler:Gfe,normalize:Hn,denormalize:xl},qe=class i{constructor(t=0,e=0){i.prototype.isVector2=!0,this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){let e=this.x,n=this.y,r=t.elements;return this.x=r[0]*e+r[3]*n+r[6],this.y=r[1]*e+r[4]*n+r[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}clampLength(t,e){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(t){let e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;let n=this.dot(t)/e;return Math.acos(bo(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){let e=this.x-t.x,n=this.y-t.y;return e*e+n*n}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){let n=Math.cos(e),r=Math.sin(e),o=this.x-t.x,a=this.y-t.y;return this.x=o*n-a*r+t.x,this.y=o*r+a*n+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}},Fi=class i{constructor(t,e,n,r,o,a,s,l,c){i.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],t!==void 0&&this.set(t,e,n,r,o,a,s,l,c)}set(t,e,n,r,o,a,s,l,c){let d=this.elements;return d[0]=t,d[1]=r,d[2]=s,d[3]=e,d[4]=o,d[5]=l,d[6]=n,d[7]=a,d[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){let e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],this}extractBasis(t,e,n){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(t){let e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){let n=t.elements,r=e.elements,o=this.elements,a=n[0],s=n[3],l=n[6],c=n[1],d=n[4],h=n[7],u=n[2],f=n[5],_=n[8],y=r[0],b=r[3],v=r[6],M=r[1],x=r[4],w=r[7],k=r[2],P=r[5],D=r[8];return o[0]=a*y+s*M+l*k,o[3]=a*b+s*x+l*P,o[6]=a*v+s*w+l*D,o[1]=c*y+d*M+h*k,o[4]=c*b+d*x+h*P,o[7]=c*v+d*w+h*D,o[2]=u*y+f*M+_*k,o[5]=u*b+f*x+_*P,o[8]=u*v+f*w+_*D,this}multiplyScalar(t){let e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){let t=this.elements,e=t[0],n=t[1],r=t[2],o=t[3],a=t[4],s=t[5],l=t[6],c=t[7],d=t[8];return e*a*d-e*s*c-n*o*d+n*s*l+r*o*c-r*a*l}invert(){let t=this.elements,e=t[0],n=t[1],r=t[2],o=t[3],a=t[4],s=t[5],l=t[6],c=t[7],d=t[8],h=d*a-s*c,u=s*l-d*o,f=c*o-a*l,_=e*h+n*u+r*f;if(_===0)return this.set(0,0,0,0,0,0,0,0,0);let y=1/_;return t[0]=h*y,t[1]=(r*c-d*n)*y,t[2]=(s*n-r*a)*y,t[3]=u*y,t[4]=(d*e-r*l)*y,t[5]=(r*o-s*e)*y,t[6]=f*y,t[7]=(n*l-c*e)*y,t[8]=(a*e-n*o)*y,this}transpose(){let t,e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){let e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,n,r,o,a,s){let l=Math.cos(o),c=Math.sin(o);return this.set(n*l,n*c,-n*(l*a+c*s)+a+t,-r*c,r*l,-r*(-c*a+l*s)+s+e,0,0,1),this}scale(t,e){return this.premultiply(qF.makeScale(t,e)),this}rotate(t){return this.premultiply(qF.makeRotation(-t)),this}translate(t,e){return this.premultiply(qF.makeTranslation(t,e)),this}makeTranslation(t,e){return t.isVector2?this.set(1,0,t.x,0,1,t.y,0,0,1):this.set(1,0,t,0,1,e,0,0,1),this}makeRotation(t){let e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,n,e,0,0,0,1),this}makeScale(t,e){return this.set(t,0,0,0,e,0,0,0,1),this}equals(t){let e=this.elements,n=t.elements;for(let r=0;r<9;r++)if(e[r]!==n[r])return!1;return!0}fromArray(t,e=0){for(let n=0;n<9;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){let n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t}clone(){return new this.constructor().fromArray(this.elements)}},qF=new Fi;function vH(i){for(let t=i.length-1;t>=0;--t)if(i[t]>=65535)return!0;return!1}function Ox(i){return document.createElementNS("http://www.w3.org/1999/xhtml",i)}function Wfe(){let i=Ox("canvas");return i.style.display="block",i}var t9={};function uA(i){i in t9||(t9[i]=!0,console.warn(i))}function jfe(i,t,e){return new Promise(function(n,r){function o(){switch(i.clientWaitSync(t,i.SYNC_FLUSH_COMMANDS_BIT,0)){case i.WAIT_FAILED:r();break;case i.TIMEOUT_EXPIRED:setTimeout(o,e);break;default:n()}}setTimeout(o,e)})}var i9=new Fi().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),n9=new Fi().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),M_={[Wu]:{transfer:Dx,primaries:kx,luminanceCoefficients:[.2126,.7152,.0722],toReference:i=>i,fromReference:i=>i},[Rs]:{transfer:or,primaries:kx,luminanceCoefficients:[.2126,.7152,.0722],toReference:i=>i.convertSRGBToLinear(),fromReference:i=>i.convertLinearToSRGB()},[dw]:{transfer:Dx,primaries:Px,luminanceCoefficients:[.2289,.6917,.0793],toReference:i=>i.applyMatrix3(n9),fromReference:i=>i.applyMatrix3(i9)},[W3]:{transfer:or,primaries:Px,luminanceCoefficients:[.2289,.6917,.0793],toReference:i=>i.convertSRGBToLinear().applyMatrix3(n9),fromReference:i=>i.applyMatrix3(i9).convertLinearToSRGB()}},$fe=new Set([Wu,dw]),On={enabled:!0,_workingColorSpace:Wu,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(i){if(!$fe.has(i))throw new Error(`Unsupported working color space, "${i}".`);this._workingColorSpace=i},convert:function(i,t,e){if(this.enabled===!1||t===e||!t||!e)return i;let n=M_[t].toReference,r=M_[e].fromReference;return r(n(i))},fromWorkingColorSpace:function(i,t){return this.convert(i,this._workingColorSpace,t)},toWorkingColorSpace:function(i,t){return this.convert(i,t,this._workingColorSpace)},getPrimaries:function(i){return M_[i].primaries},getTransfer:function(i){return i===Nu?Dx:M_[i].transfer},getLuminanceCoefficients:function(i,t=this._workingColorSpace){return i.fromArray(M_[t].luminanceCoefficients)}};function hA(i){return i<.04045?i*.0773993808:Math.pow(i*.9478672986+.0521327014,2.4)}function GF(i){return i<.0031308?i*12.92:1.055*Math.pow(i,.41666)-.055}var Vp,e3=class{static getDataURL(t){if(/^data:/i.test(t.src)||typeof HTMLCanvasElement>"u")return t.src;let e;if(t instanceof HTMLCanvasElement)e=t;else{Vp===void 0&&(Vp=Ox("canvas")),Vp.width=t.width,Vp.height=t.height;let n=Vp.getContext("2d");t instanceof ImageData?n.putImageData(t,0,0):n.drawImage(t,0,0,t.width,t.height),e=Vp}return e.width>2048||e.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",t),e.toDataURL("image/jpeg",.6)):e.toDataURL("image/png")}static sRGBToLinear(t){if(typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap){let e=Ox("canvas");e.width=t.width,e.height=t.height;let n=e.getContext("2d");n.drawImage(t,0,0,t.width,t.height);let r=n.getImageData(0,0,t.width,t.height),o=r.data;for(let a=0;a<o.length;a++)o[a]=hA(o[a]/255)*255;return n.putImageData(r,0,0),e}else if(t.data){let e=t.data.slice(0);for(let n=0;n<e.length;n++)e instanceof Uint8Array||e instanceof Uint8ClampedArray?e[n]=Math.floor(hA(e[n]/255)*255):e[n]=hA(e[n]);return{data:e,width:t.width,height:t.height}}else return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),t}},Xfe=0,Lx=class{constructor(t=null){this.isSource=!0,Object.defineProperty(this,"id",{value:Xfe++}),this.uuid=lc(),this.data=t,this.dataReady=!0,this.version=0}set needsUpdate(t){t===!0&&this.version++}toJSON(t){let e=t===void 0||typeof t=="string";if(!e&&t.images[this.uuid]!==void 0)return t.images[this.uuid];let n={uuid:this.uuid,url:""},r=this.data;if(r!==null){let o;if(Array.isArray(r)){o=[];for(let a=0,s=r.length;a<s;a++)r[a].isDataTexture?o.push(WF(r[a].image)):o.push(WF(r[a]))}else o=WF(r);n.url=o}return e||(t.images[this.uuid]=n),n}};function WF(i){return typeof HTMLImageElement<"u"&&i instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&i instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&i instanceof ImageBitmap?e3.getDataURL(i):i.data?{data:Array.from(i.data),width:i.width,height:i.height,type:i.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}var Kfe=0,mc=(()=>{class i extends Id{constructor(e=i.DEFAULT_IMAGE,n=i.DEFAULT_MAPPING,r=Jf,o=Jf,a=as,s=em,l=ss,c=Fd,d=i.DEFAULT_ANISOTROPY,h=Nu){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:Kfe++}),this.uuid=lc(),this.name="",this.source=new Lx(e),this.mipmaps=[],this.mapping=n,this.channel=0,this.wrapS=r,this.wrapT=o,this.magFilter=a,this.minFilter=s,this.anisotropy=d,this.format=l,this.internalFormat=null,this.type=c,this.offset=new qe(0,0),this.repeat=new qe(1,1),this.center=new qe(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Fi,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=h,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.pmremVersion=0}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}toJSON(e){let n=e===void 0||typeof e=="string";if(!n&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];let r={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(r.userData=this.userData),n||(e.textures[this.uuid]=r),r}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==$7)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case AA:e.x=e.x-Math.floor(e.x);break;case Jf:e.x=e.x<0?0:1;break;case MI:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case AA:e.y=e.y-Math.floor(e.y);break;case Jf:e.y=e.y<0?0:1;break;case MI:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}return i.DEFAULT_IMAGE=null,i.DEFAULT_MAPPING=$7,i.DEFAULT_ANISOTROPY=1,i})(),to=class i{constructor(t=0,e=0,n=0,r=1){i.prototype.isVector4=!0,this.x=t,this.y=e,this.z=n,this.w=r}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,n,r){return this.x=t,this.y=e,this.z=n,this.w=r,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w!==void 0?t.w:1,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){let e=this.x,n=this.y,r=this.z,o=this.w,a=t.elements;return this.x=a[0]*e+a[4]*n+a[8]*r+a[12]*o,this.y=a[1]*e+a[5]*n+a[9]*r+a[13]*o,this.z=a[2]*e+a[6]*n+a[10]*r+a[14]*o,this.w=a[3]*e+a[7]*n+a[11]*r+a[15]*o,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);let e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix(t){let e,n,r,o,l=t.elements,c=l[0],d=l[4],h=l[8],u=l[1],f=l[5],_=l[9],y=l[2],b=l[6],v=l[10];if(Math.abs(d-u)<.01&&Math.abs(h-y)<.01&&Math.abs(_-b)<.01){if(Math.abs(d+u)<.1&&Math.abs(h+y)<.1&&Math.abs(_+b)<.1&&Math.abs(c+f+v-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;let x=(c+1)/2,w=(f+1)/2,k=(v+1)/2,P=(d+u)/4,D=(h+y)/4,O=(_+b)/4;return x>w&&x>k?x<.01?(n=0,r=.707106781,o=.707106781):(n=Math.sqrt(x),r=P/n,o=D/n):w>k?w<.01?(n=.707106781,r=0,o=.707106781):(r=Math.sqrt(w),n=P/r,o=O/r):k<.01?(n=.707106781,r=.707106781,o=0):(o=Math.sqrt(k),n=D/o,r=O/o),this.set(n,r,o,e),this}let M=Math.sqrt((b-_)*(b-_)+(h-y)*(h-y)+(u-d)*(u-d));return Math.abs(M)<.001&&(M=1),this.x=(b-_)/M,this.y=(h-y)/M,this.z=(u-d)/M,this.w=Math.acos((c+f+v-1)/2),this}setFromMatrixPosition(t){let e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this.w=e[15],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this.w=Math.max(t,Math.min(e,this.w)),this}clampLength(t,e){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this.w=t.w+(e.w-t.w)*n,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}},t3=class extends Id{constructor(t=1,e=1,n={}){super(),this.isRenderTarget=!0,this.width=t,this.height=e,this.depth=1,this.scissor=new to(0,0,t,e),this.scissorTest=!1,this.viewport=new to(0,0,t,e);let r={width:t,height:e,depth:1};n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:as,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},n);let o=new mc(r,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace);o.flipY=!1,o.generateMipmaps=n.generateMipmaps,o.internalFormat=n.internalFormat,this.textures=[];let a=n.count;for(let s=0;s<a;s++)this.textures[s]=o.clone(),this.textures[s].isRenderTargetTexture=!0;this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.resolveDepthBuffer=n.resolveDepthBuffer,this.resolveStencilBuffer=n.resolveStencilBuffer,this.depthTexture=n.depthTexture,this.samples=n.samples}get texture(){return this.textures[0]}set texture(t){this.textures[0]=t}setSize(t,e,n=1){if(this.width!==t||this.height!==e||this.depth!==n){this.width=t,this.height=e,this.depth=n;for(let r=0,o=this.textures.length;r<o;r++)this.textures[r].image.width=t,this.textures[r].image.height=e,this.textures[r].image.depth=n;this.dispose()}this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)}clone(){return new this.constructor().copy(this)}copy(t){this.width=t.width,this.height=t.height,this.depth=t.depth,this.scissor.copy(t.scissor),this.scissorTest=t.scissorTest,this.viewport.copy(t.viewport),this.textures.length=0;for(let n=0,r=t.textures.length;n<r;n++)this.textures[n]=t.textures[n].clone(),this.textures[n].isRenderTargetTexture=!0;let e=Object.assign({},t.texture.image);return this.texture.source=new Lx(e),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.resolveDepthBuffer=t.resolveDepthBuffer,this.resolveStencilBuffer=t.resolveStencilBuffer,t.depthTexture!==null&&(this.depthTexture=t.depthTexture.clone()),this.samples=t.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}},ls=class extends t3{constructor(t=1,e=1,n={}){super(t,e,n),this.isWebGLRenderTarget=!0}},Nx=class extends mc{constructor(t=null,e=1,n=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:t,width:e,height:n,depth:r},this.magFilter=Os,this.minFilter=Os,this.wrapR=Jf,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(t){this.layerUpdates.add(t)}clearLayerUpdates(){this.layerUpdates.clear()}};var i3=class extends mc{constructor(t=null,e=1,n=1,r=1){super(null),this.isData3DTexture=!0,this.image={data:t,width:e,height:n,depth:r},this.magFilter=Os,this.minFilter=Os,this.wrapR=Jf,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}};var wl=class{constructor(t=0,e=0,n=0,r=1){this.isQuaternion=!0,this._x=t,this._y=e,this._z=n,this._w=r}static slerpFlat(t,e,n,r,o,a,s){let l=n[r+0],c=n[r+1],d=n[r+2],h=n[r+3],u=o[a+0],f=o[a+1],_=o[a+2],y=o[a+3];if(s===0){t[e+0]=l,t[e+1]=c,t[e+2]=d,t[e+3]=h;return}if(s===1){t[e+0]=u,t[e+1]=f,t[e+2]=_,t[e+3]=y;return}if(h!==y||l!==u||c!==f||d!==_){let b=1-s,v=l*u+c*f+d*_+h*y,M=v>=0?1:-1,x=1-v*v;if(x>Number.EPSILON){let k=Math.sqrt(x),P=Math.atan2(k,v*M);b=Math.sin(b*P)/k,s=Math.sin(s*P)/k}let w=s*M;if(l=l*b+u*w,c=c*b+f*w,d=d*b+_*w,h=h*b+y*w,b===1-s){let k=1/Math.sqrt(l*l+c*c+d*d+h*h);l*=k,c*=k,d*=k,h*=k}}t[e]=l,t[e+1]=c,t[e+2]=d,t[e+3]=h}static multiplyQuaternionsFlat(t,e,n,r,o,a){let s=n[r],l=n[r+1],c=n[r+2],d=n[r+3],h=o[a],u=o[a+1],f=o[a+2],_=o[a+3];return t[e]=s*_+d*h+l*f-c*u,t[e+1]=l*_+d*u+c*h-s*f,t[e+2]=c*_+d*f+s*u-l*h,t[e+3]=d*_-s*h-l*u-c*f,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,n,r){return this._x=t,this._y=e,this._z=n,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e=!0){let n=t._x,r=t._y,o=t._z,a=t._order,s=Math.cos,l=Math.sin,c=s(n/2),d=s(r/2),h=s(o/2),u=l(n/2),f=l(r/2),_=l(o/2);switch(a){case"XYZ":this._x=u*d*h+c*f*_,this._y=c*f*h-u*d*_,this._z=c*d*_+u*f*h,this._w=c*d*h-u*f*_;break;case"YXZ":this._x=u*d*h+c*f*_,this._y=c*f*h-u*d*_,this._z=c*d*_-u*f*h,this._w=c*d*h+u*f*_;break;case"ZXY":this._x=u*d*h-c*f*_,this._y=c*f*h+u*d*_,this._z=c*d*_+u*f*h,this._w=c*d*h-u*f*_;break;case"ZYX":this._x=u*d*h-c*f*_,this._y=c*f*h+u*d*_,this._z=c*d*_-u*f*h,this._w=c*d*h+u*f*_;break;case"YZX":this._x=u*d*h+c*f*_,this._y=c*f*h+u*d*_,this._z=c*d*_-u*f*h,this._w=c*d*h-u*f*_;break;case"XZY":this._x=u*d*h-c*f*_,this._y=c*f*h-u*d*_,this._z=c*d*_+u*f*h,this._w=c*d*h+u*f*_;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return e===!0&&this._onChangeCallback(),this}setFromAxisAngle(t,e){let n=e/2,r=Math.sin(n);return this._x=t.x*r,this._y=t.y*r,this._z=t.z*r,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(t){let e=t.elements,n=e[0],r=e[4],o=e[8],a=e[1],s=e[5],l=e[9],c=e[2],d=e[6],h=e[10],u=n+s+h;if(u>0){let f=.5/Math.sqrt(u+1);this._w=.25/f,this._x=(d-l)*f,this._y=(o-c)*f,this._z=(a-r)*f}else if(n>s&&n>h){let f=2*Math.sqrt(1+n-s-h);this._w=(d-l)/f,this._x=.25*f,this._y=(r+a)/f,this._z=(o+c)/f}else if(s>h){let f=2*Math.sqrt(1+s-n-h);this._w=(o-c)/f,this._x=(r+a)/f,this._y=.25*f,this._z=(l+d)/f}else{let f=2*Math.sqrt(1+h-n-s);this._w=(a-r)/f,this._x=(o+c)/f,this._y=(l+d)/f,this._z=.25*f}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let n=t.dot(e)+1;return n<Number.EPSILON?(n=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=n):(this._x=0,this._y=-t.z,this._z=t.y,this._w=n)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=n),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(bo(this.dot(t),-1,1)))}rotateTowards(t,e){let n=this.angleTo(t);if(n===0)return this;let r=Math.min(1,e/n);return this.slerp(t,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return t===0?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){let n=t._x,r=t._y,o=t._z,a=t._w,s=e._x,l=e._y,c=e._z,d=e._w;return this._x=n*d+a*s+r*c-o*l,this._y=r*d+a*l+o*s-n*c,this._z=o*d+a*c+n*l-r*s,this._w=a*d-n*s-r*l-o*c,this._onChangeCallback(),this}slerp(t,e){if(e===0)return this;if(e===1)return this.copy(t);let n=this._x,r=this._y,o=this._z,a=this._w,s=a*t._w+n*t._x+r*t._y+o*t._z;if(s<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,s=-s):this.copy(t),s>=1)return this._w=a,this._x=n,this._y=r,this._z=o,this;let l=1-s*s;if(l<=Number.EPSILON){let f=1-e;return this._w=f*a+e*this._w,this._x=f*n+e*this._x,this._y=f*r+e*this._y,this._z=f*o+e*this._z,this.normalize(),this}let c=Math.sqrt(l),d=Math.atan2(c,s),h=Math.sin((1-e)*d)/c,u=Math.sin(e*d)/c;return this._w=a*h+this._w*u,this._x=n*h+this._x*u,this._y=r*h+this._y*u,this._z=o*h+this._z*u,this._onChangeCallback(),this}slerpQuaternions(t,e,n){return this.copy(t).slerp(e,n)}random(){let t=2*Math.PI*Math.random(),e=2*Math.PI*Math.random(),n=Math.random(),r=Math.sqrt(1-n),o=Math.sqrt(n);return this.set(r*Math.sin(t),r*Math.cos(t),o*Math.sin(e),o*Math.cos(e))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}},ce=class i{constructor(t=0,e=0,n=0){i.prototype.isVector3=!0,this.x=t,this.y=e,this.z=n}set(t,e,n){return n===void 0&&(n=this.z),this.x=t,this.y=e,this.z=n,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return this.applyQuaternion(r9.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(r9.setFromAxisAngle(t,e))}applyMatrix3(t){let e=this.x,n=this.y,r=this.z,o=t.elements;return this.x=o[0]*e+o[3]*n+o[6]*r,this.y=o[1]*e+o[4]*n+o[7]*r,this.z=o[2]*e+o[5]*n+o[8]*r,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){let e=this.x,n=this.y,r=this.z,o=t.elements,a=1/(o[3]*e+o[7]*n+o[11]*r+o[15]);return this.x=(o[0]*e+o[4]*n+o[8]*r+o[12])*a,this.y=(o[1]*e+o[5]*n+o[9]*r+o[13])*a,this.z=(o[2]*e+o[6]*n+o[10]*r+o[14])*a,this}applyQuaternion(t){let e=this.x,n=this.y,r=this.z,o=t.x,a=t.y,s=t.z,l=t.w,c=2*(a*r-s*n),d=2*(s*e-o*r),h=2*(o*n-a*e);return this.x=e+l*c+a*h-s*d,this.y=n+l*d+s*c-o*h,this.z=r+l*h+o*d-a*c,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){let e=this.x,n=this.y,r=this.z,o=t.elements;return this.x=o[0]*e+o[4]*n+o[8]*r,this.y=o[1]*e+o[5]*n+o[9]*r,this.z=o[2]*e+o[6]*n+o[10]*r,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this}clampLength(t,e){let n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,e){let n=t.x,r=t.y,o=t.z,a=e.x,s=e.y,l=e.z;return this.x=r*l-o*s,this.y=o*a-n*l,this.z=n*s-r*a,this}projectOnVector(t){let e=t.lengthSq();if(e===0)return this.set(0,0,0);let n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)}projectOnPlane(t){return jF.copy(this).projectOnVector(t),this.sub(jF)}reflect(t){return this.sub(jF.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){let e=Math.sqrt(this.lengthSq()*t.lengthSq());if(e===0)return Math.PI/2;let n=this.dot(t)/e;return Math.acos(bo(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){let e=this.x-t.x,n=this.y-t.y,r=this.z-t.z;return e*e+n*n+r*r}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,n){let r=Math.sin(e)*t;return this.x=r*Math.sin(n),this.y=Math.cos(e)*t,this.z=r*Math.cos(n),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,n){return this.x=t*Math.sin(e),this.y=n,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){let e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){let e=this.setFromMatrixColumn(t,0).length(),n=this.setFromMatrixColumn(t,1).length(),r=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=n,this.z=r,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,e*4)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,e*3)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}setFromColor(t){return this.x=t.r,this.y=t.g,this.z=t.b,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){let t=Math.random()*Math.PI*2,e=Math.random()*2-1,n=Math.sqrt(1-e*e);return this.x=n*Math.cos(t),this.y=e,this.z=n*Math.sin(t),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}},jF=new ce,r9=new wl,Po=class{constructor(t=new ce(1/0,1/0,1/0),e=new ce(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){this.makeEmpty();for(let e=0,n=t.length;e<n;e+=3)this.expandByPoint(_l.fromArray(t,e));return this}setFromBufferAttribute(t){this.makeEmpty();for(let e=0,n=t.count;e<n;e++)this.expandByPoint(_l.fromBufferAttribute(t,e));return this}setFromPoints(t){this.makeEmpty();for(let e=0,n=t.length;e<n;e++)this.expandByPoint(t[e]);return this}setFromCenterAndSize(t,e){let n=_l.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(n),this.max.copy(t).add(n),this}setFromObject(t,e=!1){return this.makeEmpty(),this.expandByObject(t,e)}clone(){return new this.constructor().copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(t){return this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}expandByObject(t,e=!1){t.updateWorldMatrix(!1,!1);let n=t.geometry;if(n!==void 0){let o=n.getAttribute("position");if(e===!0&&o!==void 0&&t.isInstancedMesh!==!0)for(let a=0,s=o.count;a<s;a++)t.isMesh===!0?t.getVertexPosition(a,_l):_l.fromBufferAttribute(o,a),_l.applyMatrix4(t.matrixWorld),this.expandByPoint(_l);else t.boundingBox!==void 0?(t.boundingBox===null&&t.computeBoundingBox(),j1.copy(t.boundingBox)):(n.boundingBox===null&&n.computeBoundingBox(),j1.copy(n.boundingBox)),j1.applyMatrix4(t.matrixWorld),this.union(j1)}let r=t.children;for(let o=0,a=r.length;o<a;o++)this.expandByObject(r[o],e);return this}containsPoint(t){return t.x>=this.min.x&&t.x<=this.max.x&&t.y>=this.min.y&&t.y<=this.max.y&&t.z>=this.min.z&&t.z<=this.max.z}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return t.max.x>=this.min.x&&t.min.x<=this.max.x&&t.max.y>=this.min.y&&t.min.y<=this.max.y&&t.max.z>=this.min.z&&t.min.z<=this.max.z}intersectsSphere(t){return this.clampPoint(t.center,_l),_l.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,n;return t.normal.x>0?(e=t.normal.x*this.min.x,n=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,n=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,n+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,n+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,n+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,n+=t.normal.z*this.min.z),e<=-t.constant&&n>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(S_),$1.subVectors(this.max,S_),Qp.subVectors(t.a,S_),zp.subVectors(t.b,S_),qp.subVectors(t.c,S_),Du.subVectors(zp,Qp),ku.subVectors(qp,zp),qf.subVectors(Qp,qp);let e=[0,-Du.z,Du.y,0,-ku.z,ku.y,0,-qf.z,qf.y,Du.z,0,-Du.x,ku.z,0,-ku.x,qf.z,0,-qf.x,-Du.y,Du.x,0,-ku.y,ku.x,0,-qf.y,qf.x,0];return!$F(e,Qp,zp,qp,$1)||(e=[1,0,0,0,1,0,0,0,1],!$F(e,Qp,zp,qp,$1))?!1:(X1.crossVectors(Du,ku),e=[X1.x,X1.y,X1.z],$F(e,Qp,zp,qp,$1))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return this.clampPoint(t,_l).distanceTo(t)}getBoundingSphere(t){return this.isEmpty()?t.makeEmpty():(this.getCenter(t.center),t.radius=this.getSize(_l).length()*.5),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()?this:(vd[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),vd[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),vd[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),vd[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),vd[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),vd[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),vd[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),vd[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(vd),this)}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}},vd=[new ce,new ce,new ce,new ce,new ce,new ce,new ce,new ce],_l=new ce,j1=new Po,Qp=new ce,zp=new ce,qp=new ce,Du=new ce,ku=new ce,qf=new ce,S_=new ce,$1=new ce,X1=new ce,Gf=new ce;function $F(i,t,e,n,r){for(let o=0,a=i.length-3;o<=a;o+=3){Gf.fromArray(i,o);let s=r.x*Math.abs(Gf.x)+r.y*Math.abs(Gf.y)+r.z*Math.abs(Gf.z),l=t.dot(Gf),c=e.dot(Gf),d=n.dot(Gf);if(Math.max(-Math.max(l,c,d),Math.min(l,c,d))>s)return!1}return!0}var Yfe=new Po,E_=new ce,XF=new ce,dc=class{constructor(t=new ce,e=-1){this.isSphere=!0,this.center=t,this.radius=e}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){let n=this.center;e!==void 0?n.copy(e):Yfe.setFromPoints(t).getCenter(n);let r=0;for(let o=0,a=t.length;o<a;o++)r=Math.max(r,n.distanceToSquared(t[o]));return this.radius=Math.sqrt(r),this}copy(t){return this.center.copy(t.center),this.radius=t.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(t){return t.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(t){return t.distanceTo(this.center)-this.radius}intersectsSphere(t){let e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e}intersectsBox(t){return t.intersectsSphere(this)}intersectsPlane(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius}clampPoint(t,e){let n=this.center.distanceToSquared(t);return e.copy(t),n>this.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;E_.subVectors(t,this.center);let e=E_.lengthSq();if(e>this.radius*this.radius){let n=Math.sqrt(e),r=(n-this.radius)*.5;this.center.addScaledVector(E_,r/n),this.radius+=r}return this}union(t){return t.isEmpty()?this:this.isEmpty()?(this.copy(t),this):(this.center.equals(t.center)===!0?this.radius=Math.max(this.radius,t.radius):(XF.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(E_.copy(t.center).add(XF)),this.expandByPoint(E_.copy(t.center).sub(XF))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return new this.constructor().copy(this)}},yd=new ce,KF=new ce,K1=new ce,Pu=new ce,YF=new ce,Y1=new ce,ZF=new ce,Dd=class{constructor(t=new ce,e=new ce(0,0,-1)){this.origin=t,this.direction=e}set(t,e){return this.origin.copy(t),this.direction.copy(e),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,e){return e.copy(this.origin).addScaledVector(this.direction,t)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,yd)),this}closestPointToPoint(t,e){e.subVectors(t,this.origin);let n=e.dot(this.direction);return n<0?e.copy(this.origin):e.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){let e=yd.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(yd.copy(this.origin).addScaledVector(this.direction,e),yd.distanceToSquared(t))}distanceSqToSegment(t,e,n,r){KF.copy(t).add(e).multiplyScalar(.5),K1.copy(e).sub(t).normalize(),Pu.copy(this.origin).sub(KF);let o=t.distanceTo(e)*.5,a=-this.direction.dot(K1),s=Pu.dot(this.direction),l=-Pu.dot(K1),c=Pu.lengthSq(),d=Math.abs(1-a*a),h,u,f,_;if(d>0)if(h=a*l-s,u=a*s-l,_=o*d,h>=0)if(u>=-_)if(u<=_){let y=1/d;h*=y,u*=y,f=h*(h+a*u+2*s)+u*(a*h+u+2*l)+c}else u=o,h=Math.max(0,-(a*u+s)),f=-h*h+u*(u+2*l)+c;else u=-o,h=Math.max(0,-(a*u+s)),f=-h*h+u*(u+2*l)+c;else u<=-_?(h=Math.max(0,-(-a*o+s)),u=h>0?-o:Math.min(Math.max(-o,-l),o),f=-h*h+u*(u+2*l)+c):u<=_?(h=0,u=Math.min(Math.max(-o,-l),o),f=u*(u+2*l)+c):(h=Math.max(0,-(a*o+s)),u=h>0?o:Math.min(Math.max(-o,-l),o),f=-h*h+u*(u+2*l)+c);else u=a>0?-o:o,h=Math.max(0,-(a*u+s)),f=-h*h+u*(u+2*l)+c;return n&&n.copy(this.origin).addScaledVector(this.direction,h),r&&r.copy(KF).addScaledVector(K1,u),f}intersectSphere(t,e){yd.subVectors(t.center,this.origin);let n=yd.dot(this.direction),r=yd.dot(yd)-n*n,o=t.radius*t.radius;if(r>o)return null;let a=Math.sqrt(o-r),s=n-a,l=n+a;return l<0?null:s<0?this.at(l,e):this.at(s,e)}intersectsSphere(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){let e=t.normal.dot(this.direction);if(e===0)return t.distanceToPoint(this.origin)===0?0:null;let n=-(this.origin.dot(t.normal)+t.constant)/e;return n>=0?n:null}intersectPlane(t,e){let n=this.distanceToPlane(t);return n===null?null:this.at(n,e)}intersectsPlane(t){let e=t.distanceToPoint(this.origin);return e===0||t.normal.dot(this.direction)*e<0}intersectBox(t,e){let n,r,o,a,s,l,c=1/this.direction.x,d=1/this.direction.y,h=1/this.direction.z,u=this.origin;return c>=0?(n=(t.min.x-u.x)*c,r=(t.max.x-u.x)*c):(n=(t.max.x-u.x)*c,r=(t.min.x-u.x)*c),d>=0?(o=(t.min.y-u.y)*d,a=(t.max.y-u.y)*d):(o=(t.max.y-u.y)*d,a=(t.min.y-u.y)*d),n>a||o>r||((o>n||isNaN(n))&&(n=o),(a<r||isNaN(r))&&(r=a),h>=0?(s=(t.min.z-u.z)*h,l=(t.max.z-u.z)*h):(s=(t.max.z-u.z)*h,l=(t.min.z-u.z)*h),n>l||s>r)||((s>n||n!==n)&&(n=s),(l<r||r!==r)&&(r=l),r<0)?null:this.at(n>=0?n:r,e)}intersectsBox(t){return this.intersectBox(t,yd)!==null}intersectTriangle(t,e,n,r,o){YF.subVectors(e,t),Y1.subVectors(n,t),ZF.crossVectors(YF,Y1);let a=this.direction.dot(ZF),s;if(a>0){if(r)return null;s=1}else if(a<0)s=-1,a=-a;else return null;Pu.subVectors(this.origin,t);let l=s*this.direction.dot(Y1.crossVectors(Pu,Y1));if(l<0)return null;let c=s*this.direction.dot(YF.cross(Pu));if(c<0||l+c>a)return null;let d=-s*Pu.dot(ZF);return d<0?null:this.at(d/a,o)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}},pr=class i{constructor(t,e,n,r,o,a,s,l,c,d,h,u,f,_,y,b){i.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],t!==void 0&&this.set(t,e,n,r,o,a,s,l,c,d,h,u,f,_,y,b)}set(t,e,n,r,o,a,s,l,c,d,h,u,f,_,y,b){let v=this.elements;return v[0]=t,v[4]=e,v[8]=n,v[12]=r,v[1]=o,v[5]=a,v[9]=s,v[13]=l,v[2]=c,v[6]=d,v[10]=h,v[14]=u,v[3]=f,v[7]=_,v[11]=y,v[15]=b,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new i().fromArray(this.elements)}copy(t){let e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],this}copyPosition(t){let e=this.elements,n=t.elements;return e[12]=n[12],e[13]=n[13],e[14]=n[14],this}setFromMatrix3(t){let e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,n){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(t,e,n){return this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1),this}extractRotation(t){let e=this.elements,n=t.elements,r=1/Gp.setFromMatrixColumn(t,0).length(),o=1/Gp.setFromMatrixColumn(t,1).length(),a=1/Gp.setFromMatrixColumn(t,2).length();return e[0]=n[0]*r,e[1]=n[1]*r,e[2]=n[2]*r,e[3]=0,e[4]=n[4]*o,e[5]=n[5]*o,e[6]=n[6]*o,e[7]=0,e[8]=n[8]*a,e[9]=n[9]*a,e[10]=n[10]*a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){let e=this.elements,n=t.x,r=t.y,o=t.z,a=Math.cos(n),s=Math.sin(n),l=Math.cos(r),c=Math.sin(r),d=Math.cos(o),h=Math.sin(o);if(t.order==="XYZ"){let u=a*d,f=a*h,_=s*d,y=s*h;e[0]=l*d,e[4]=-l*h,e[8]=c,e[1]=f+_*c,e[5]=u-y*c,e[9]=-s*l,e[2]=y-u*c,e[6]=_+f*c,e[10]=a*l}else if(t.order==="YXZ"){let u=l*d,f=l*h,_=c*d,y=c*h;e[0]=u+y*s,e[4]=_*s-f,e[8]=a*c,e[1]=a*h,e[5]=a*d,e[9]=-s,e[2]=f*s-_,e[6]=y+u*s,e[10]=a*l}else if(t.order==="ZXY"){let u=l*d,f=l*h,_=c*d,y=c*h;e[0]=u-y*s,e[4]=-a*h,e[8]=_+f*s,e[1]=f+_*s,e[5]=a*d,e[9]=y-u*s,e[2]=-a*c,e[6]=s,e[10]=a*l}else if(t.order==="ZYX"){let u=a*d,f=a*h,_=s*d,y=s*h;e[0]=l*d,e[4]=_*c-f,e[8]=u*c+y,e[1]=l*h,e[5]=y*c+u,e[9]=f*c-_,e[2]=-c,e[6]=s*l,e[10]=a*l}else if(t.order==="YZX"){let u=a*l,f=a*c,_=s*l,y=s*c;e[0]=l*d,e[4]=y-u*h,e[8]=_*h+f,e[1]=h,e[5]=a*d,e[9]=-s*d,e[2]=-c*d,e[6]=f*h+_,e[10]=u-y*h}else if(t.order==="XZY"){let u=a*l,f=a*c,_=s*l,y=s*c;e[0]=l*d,e[4]=-h,e[8]=c*d,e[1]=u*h+y,e[5]=a*d,e[9]=f*h-_,e[2]=_*h-f,e[6]=s*d,e[10]=y*h+u}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(Zfe,t,Jfe)}lookAt(t,e,n){let r=this.elements;return rs.subVectors(t,e),rs.lengthSq()===0&&(rs.z=1),rs.normalize(),Ru.crossVectors(n,rs),Ru.lengthSq()===0&&(Math.abs(n.z)===1?rs.x+=1e-4:rs.z+=1e-4,rs.normalize(),Ru.crossVectors(n,rs)),Ru.normalize(),Z1.crossVectors(rs,Ru),r[0]=Ru.x,r[4]=Z1.x,r[8]=rs.x,r[1]=Ru.y,r[5]=Z1.y,r[9]=rs.y,r[2]=Ru.z,r[6]=Z1.z,r[10]=rs.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){let n=t.elements,r=e.elements,o=this.elements,a=n[0],s=n[4],l=n[8],c=n[12],d=n[1],h=n[5],u=n[9],f=n[13],_=n[2],y=n[6],b=n[10],v=n[14],M=n[3],x=n[7],w=n[11],k=n[15],P=r[0],D=r[4],O=r[8],E=r[12],B=r[1],L=r[5],q=r[9],W=r[13],oe=r[2],pe=r[6],ge=r[10],de=r[14],U=r[3],J=r[7],Pe=r[11],We=r[15];return o[0]=a*P+s*B+l*oe+c*U,o[4]=a*D+s*L+l*pe+c*J,o[8]=a*O+s*q+l*ge+c*Pe,o[12]=a*E+s*W+l*de+c*We,o[1]=d*P+h*B+u*oe+f*U,o[5]=d*D+h*L+u*pe+f*J,o[9]=d*O+h*q+u*ge+f*Pe,o[13]=d*E+h*W+u*de+f*We,o[2]=_*P+y*B+b*oe+v*U,o[6]=_*D+y*L+b*pe+v*J,o[10]=_*O+y*q+b*ge+v*Pe,o[14]=_*E+y*W+b*de+v*We,o[3]=M*P+x*B+w*oe+k*U,o[7]=M*D+x*L+w*pe+k*J,o[11]=M*O+x*q+w*ge+k*Pe,o[15]=M*E+x*W+w*de+k*We,this}multiplyScalar(t){let e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){let t=this.elements,e=t[0],n=t[4],r=t[8],o=t[12],a=t[1],s=t[5],l=t[9],c=t[13],d=t[2],h=t[6],u=t[10],f=t[14],_=t[3],y=t[7],b=t[11],v=t[15];return _*(+o*l*h-r*c*h-o*s*u+n*c*u+r*s*f-n*l*f)+y*(+e*l*f-e*c*u+o*a*u-r*a*f+r*c*d-o*l*d)+b*(+e*c*h-e*s*f-o*a*h+n*a*f+o*s*d-n*c*d)+v*(-r*s*d-e*l*h+e*s*u+r*a*h-n*a*u+n*l*d)}transpose(){let t=this.elements,e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,n){let r=this.elements;return t.isVector3?(r[12]=t.x,r[13]=t.y,r[14]=t.z):(r[12]=t,r[13]=e,r[14]=n),this}invert(){let t=this.elements,e=t[0],n=t[1],r=t[2],o=t[3],a=t[4],s=t[5],l=t[6],c=t[7],d=t[8],h=t[9],u=t[10],f=t[11],_=t[12],y=t[13],b=t[14],v=t[15],M=h*b*c-y*u*c+y*l*f-s*b*f-h*l*v+s*u*v,x=_*u*c-d*b*c-_*l*f+a*b*f+d*l*v-a*u*v,w=d*y*c-_*h*c+_*s*f-a*y*f-d*s*v+a*h*v,k=_*h*l-d*y*l-_*s*u+a*y*u+d*s*b-a*h*b,P=e*M+n*x+r*w+o*k;if(P===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let D=1/P;return t[0]=M*D,t[1]=(y*u*o-h*b*o-y*r*f+n*b*f+h*r*v-n*u*v)*D,t[2]=(s*b*o-y*l*o+y*r*c-n*b*c-s*r*v+n*l*v)*D,t[3]=(h*l*o-s*u*o-h*r*c+n*u*c+s*r*f-n*l*f)*D,t[4]=x*D,t[5]=(d*b*o-_*u*o+_*r*f-e*b*f-d*r*v+e*u*v)*D,t[6]=(_*l*o-a*b*o-_*r*c+e*b*c+a*r*v-e*l*v)*D,t[7]=(a*u*o-d*l*o+d*r*c-e*u*c-a*r*f+e*l*f)*D,t[8]=w*D,t[9]=(_*h*o-d*y*o-_*n*f+e*y*f+d*n*v-e*h*v)*D,t[10]=(a*y*o-_*s*o+_*n*c-e*y*c-a*n*v+e*s*v)*D,t[11]=(d*s*o-a*h*o-d*n*c+e*h*c+a*n*f-e*s*f)*D,t[12]=k*D,t[13]=(d*y*r-_*h*r+_*n*u-e*y*u-d*n*b+e*h*b)*D,t[14]=(_*s*r-a*y*r-_*n*l+e*y*l+a*n*b-e*s*b)*D,t[15]=(a*h*r-d*s*r+d*n*l-e*h*l-a*n*u+e*s*u)*D,this}scale(t){let e=this.elements,n=t.x,r=t.y,o=t.z;return e[0]*=n,e[4]*=r,e[8]*=o,e[1]*=n,e[5]*=r,e[9]*=o,e[2]*=n,e[6]*=r,e[10]*=o,e[3]*=n,e[7]*=r,e[11]*=o,this}getMaxScaleOnAxis(){let t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],r=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,r))}makeTranslation(t,e,n){return t.isVector3?this.set(1,0,0,t.x,0,1,0,t.y,0,0,1,t.z,0,0,0,1):this.set(1,0,0,t,0,1,0,e,0,0,1,n,0,0,0,1),this}makeRotationX(t){let e=Math.cos(t),n=Math.sin(t);return this.set(1,0,0,0,0,e,-n,0,0,n,e,0,0,0,0,1),this}makeRotationY(t){let e=Math.cos(t),n=Math.sin(t);return this.set(e,0,n,0,0,1,0,0,-n,0,e,0,0,0,0,1),this}makeRotationZ(t){let e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,0,n,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){let n=Math.cos(e),r=Math.sin(e),o=1-n,a=t.x,s=t.y,l=t.z,c=o*a,d=o*s;return this.set(c*a+n,c*s-r*l,c*l+r*s,0,c*s+r*l,d*s+n,d*l-r*a,0,c*l-r*s,d*l+r*a,o*l*l+n,0,0,0,0,1),this}makeScale(t,e,n){return this.set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1),this}makeShear(t,e,n,r,o,a){return this.set(1,n,o,0,t,1,a,0,e,r,1,0,0,0,0,1),this}compose(t,e,n){let r=this.elements,o=e._x,a=e._y,s=e._z,l=e._w,c=o+o,d=a+a,h=s+s,u=o*c,f=o*d,_=o*h,y=a*d,b=a*h,v=s*h,M=l*c,x=l*d,w=l*h,k=n.x,P=n.y,D=n.z;return r[0]=(1-(y+v))*k,r[1]=(f+w)*k,r[2]=(_-x)*k,r[3]=0,r[4]=(f-w)*P,r[5]=(1-(u+v))*P,r[6]=(b+M)*P,r[7]=0,r[8]=(_+x)*D,r[9]=(b-M)*D,r[10]=(1-(u+y))*D,r[11]=0,r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=1,this}decompose(t,e,n){let r=this.elements,o=Gp.set(r[0],r[1],r[2]).length(),a=Gp.set(r[4],r[5],r[6]).length(),s=Gp.set(r[8],r[9],r[10]).length();this.determinant()<0&&(o=-o),t.x=r[12],t.y=r[13],t.z=r[14],bl.copy(this);let c=1/o,d=1/a,h=1/s;return bl.elements[0]*=c,bl.elements[1]*=c,bl.elements[2]*=c,bl.elements[4]*=d,bl.elements[5]*=d,bl.elements[6]*=d,bl.elements[8]*=h,bl.elements[9]*=h,bl.elements[10]*=h,e.setFromRotationMatrix(bl),n.x=o,n.y=a,n.z=s,this}makePerspective(t,e,n,r,o,a,s=Bd){let l=this.elements,c=2*o/(e-t),d=2*o/(n-r),h=(e+t)/(e-t),u=(n+r)/(n-r),f,_;if(s===Bd)f=-(a+o)/(a-o),_=-2*a*o/(a-o);else if(s===Rx)f=-a/(a-o),_=-a*o/(a-o);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+s);return l[0]=c,l[4]=0,l[8]=h,l[12]=0,l[1]=0,l[5]=d,l[9]=u,l[13]=0,l[2]=0,l[6]=0,l[10]=f,l[14]=_,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(t,e,n,r,o,a,s=Bd){let l=this.elements,c=1/(e-t),d=1/(n-r),h=1/(a-o),u=(e+t)*c,f=(n+r)*d,_,y;if(s===Bd)_=(a+o)*h,y=-2*h;else if(s===Rx)_=o*h,y=-1*h;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+s);return l[0]=2*c,l[4]=0,l[8]=0,l[12]=-u,l[1]=0,l[5]=2*d,l[9]=0,l[13]=-f,l[2]=0,l[6]=0,l[10]=y,l[14]=-_,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(t){let e=this.elements,n=t.elements;for(let r=0;r<16;r++)if(e[r]!==n[r])return!1;return!0}fromArray(t,e=0){for(let n=0;n<16;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){let n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t[e+9]=n[9],t[e+10]=n[10],t[e+11]=n[11],t[e+12]=n[12],t[e+13]=n[13],t[e+14]=n[14],t[e+15]=n[15],t}},Gp=new ce,bl=new pr,Zfe=new ce(0,0,0),Jfe=new ce(1,1,1),Ru=new ce,Z1=new ce,rs=new ce,o9=new pr,a9=new wl,nm=(()=>{class i{constructor(e=0,n=0,r=0,o=i.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=n,this._z=r,this._order=o}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,n,r,o=this._order){return this._x=e,this._y=n,this._z=r,this._order=o,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,n=this._order,r=!0){let o=e.elements,a=o[0],s=o[4],l=o[8],c=o[1],d=o[5],h=o[9],u=o[2],f=o[6],_=o[10];switch(n){case"XYZ":this._y=Math.asin(bo(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-h,_),this._z=Math.atan2(-s,a)):(this._x=Math.atan2(f,d),this._z=0);break;case"YXZ":this._x=Math.asin(-bo(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(l,_),this._z=Math.atan2(c,d)):(this._y=Math.atan2(-u,a),this._z=0);break;case"ZXY":this._x=Math.asin(bo(f,-1,1)),Math.abs(f)<.9999999?(this._y=Math.atan2(-u,_),this._z=Math.atan2(-s,d)):(this._y=0,this._z=Math.atan2(c,a));break;case"ZYX":this._y=Math.asin(-bo(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(f,_),this._z=Math.atan2(c,a)):(this._x=0,this._z=Math.atan2(-s,d));break;case"YZX":this._z=Math.asin(bo(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(-h,d),this._y=Math.atan2(-u,a)):(this._x=0,this._y=Math.atan2(l,_));break;case"XZY":this._z=Math.asin(-bo(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(f,d),this._y=Math.atan2(l,a)):(this._x=Math.atan2(-h,_),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+n)}return this._order=n,r===!0&&this._onChangeCallback(),this}setFromQuaternion(e,n,r){return o9.makeRotationFromQuaternion(e),this.setFromRotationMatrix(o9,n,r)}setFromVector3(e,n=this._order){return this.set(e.x,e.y,e.z,n)}reorder(e){return a9.setFromEuler(this),this.setFromQuaternion(a9,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}return i.DEFAULT_ORDER="XYZ",i})(),Q_=class{constructor(){this.mask=1}set(t){this.mask=(1<<t|0)>>>0}enable(t){this.mask|=1<<t|0}enableAll(){this.mask=-1}toggle(t){this.mask^=1<<t|0}disable(t){this.mask&=~(1<<t|0)}disableAll(){this.mask=0}test(t){return(this.mask&t.mask)!==0}isEnabled(t){return(this.mask&(1<<t|0))!==0}},eme=0,s9=new ce,Wp=new wl,xd=new pr,J1=new ce,T_=new ce,tme=new ce,ime=new wl,l9=new ce(1,0,0),c9=new ce(0,1,0),d9=new ce(0,0,1),u9={type:"added"},nme={type:"removed"},jp={type:"childadded",child:null},JF={type:"childremoved",child:null},Ls=(()=>{class i extends Id{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:eme++}),this.uuid=lc(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=i.DEFAULT_UP.clone();let e=new ce,n=new nm,r=new wl,o=new ce(1,1,1);function a(){r.setFromEuler(n,!1)}function s(){n.setFromQuaternion(r,void 0,!1)}n._onChange(a),r._onChange(s),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:n},quaternion:{configurable:!0,enumerable:!0,value:r},scale:{configurable:!0,enumerable:!0,value:o},modelViewMatrix:{value:new pr},normalMatrix:{value:new Fi}}),this.matrix=new pr,this.matrixWorld=new pr,this.matrixAutoUpdate=i.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=i.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new Q_,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,n){this.quaternion.setFromAxisAngle(e,n)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,n){return Wp.setFromAxisAngle(e,n),this.quaternion.multiply(Wp),this}rotateOnWorldAxis(e,n){return Wp.setFromAxisAngle(e,n),this.quaternion.premultiply(Wp),this}rotateX(e){return this.rotateOnAxis(l9,e)}rotateY(e){return this.rotateOnAxis(c9,e)}rotateZ(e){return this.rotateOnAxis(d9,e)}translateOnAxis(e,n){return s9.copy(e).applyQuaternion(this.quaternion),this.position.add(s9.multiplyScalar(n)),this}translateX(e){return this.translateOnAxis(l9,e)}translateY(e){return this.translateOnAxis(c9,e)}translateZ(e){return this.translateOnAxis(d9,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(xd.copy(this.matrixWorld).invert())}lookAt(e,n,r){e.isVector3?J1.copy(e):J1.set(e,n,r);let o=this.parent;this.updateWorldMatrix(!0,!1),T_.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?xd.lookAt(T_,J1,this.up):xd.lookAt(J1,T_,this.up),this.quaternion.setFromRotationMatrix(xd),o&&(xd.extractRotation(o.matrixWorld),Wp.setFromRotationMatrix(xd),this.quaternion.premultiply(Wp.invert()))}add(e){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.add(arguments[n]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(u9),jp.child=e,this.dispatchEvent(jp),jp.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let r=0;r<arguments.length;r++)this.remove(arguments[r]);return this}let n=this.children.indexOf(e);return n!==-1&&(e.parent=null,this.children.splice(n,1),e.dispatchEvent(nme),JF.child=e,this.dispatchEvent(JF),JF.child=null),this}removeFromParent(){let e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),xd.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),xd.multiply(e.parent.matrixWorld)),e.applyMatrix4(xd),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(u9),jp.child=e,this.dispatchEvent(jp),jp.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,n){if(this[e]===n)return this;for(let r=0,o=this.children.length;r<o;r++){let s=this.children[r].getObjectByProperty(e,n);if(s!==void 0)return s}}getObjectsByProperty(e,n,r=[]){this[e]===n&&r.push(this);let o=this.children;for(let a=0,s=o.length;a<s;a++)o[a].getObjectsByProperty(e,n,r);return r}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(T_,e,tme),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(T_,ime,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);let n=this.matrixWorld.elements;return e.set(n[8],n[9],n[10]).normalize()}raycast(){}traverse(e){e(this);let n=this.children;for(let r=0,o=n.length;r<o;r++)n[r].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);let n=this.children;for(let r=0,o=n.length;r<o;r++)n[r].traverseVisible(e)}traverseAncestors(e){let n=this.parent;n!==null&&(e(n),n.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);let n=this.children;for(let r=0,o=n.length;r<o;r++)n[r].updateMatrixWorld(e)}updateWorldMatrix(e,n){let r=this.parent;if(e===!0&&r!==null&&r.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),n===!0){let o=this.children;for(let a=0,s=o.length;a<s;a++)o[a].updateWorldMatrix(!1,!0)}}toJSON(e){let n=e===void 0||typeof e=="string",r={};n&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},r.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"});let o={};o.uuid=this.uuid,o.type=this.type,this.name!==""&&(o.name=this.name),this.castShadow===!0&&(o.castShadow=!0),this.receiveShadow===!0&&(o.receiveShadow=!0),this.visible===!1&&(o.visible=!1),this.frustumCulled===!1&&(o.frustumCulled=!1),this.renderOrder!==0&&(o.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(o.userData=this.userData),o.layers=this.layers.mask,o.matrix=this.matrix.toArray(),o.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(o.matrixAutoUpdate=!1),this.isInstancedMesh&&(o.type="InstancedMesh",o.count=this.count,o.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(o.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(o.type="BatchedMesh",o.perObjectFrustumCulled=this.perObjectFrustumCulled,o.sortObjects=this.sortObjects,o.drawRanges=this._drawRanges,o.reservedRanges=this._reservedRanges,o.visibility=this._visibility,o.active=this._active,o.bounds=this._bounds.map(l=>({boxInitialized:l.boxInitialized,boxMin:l.box.min.toArray(),boxMax:l.box.max.toArray(),sphereInitialized:l.sphereInitialized,sphereRadius:l.sphere.radius,sphereCenter:l.sphere.center.toArray()})),o.maxInstanceCount=this._maxInstanceCount,o.maxVertexCount=this._maxVertexCount,o.maxIndexCount=this._maxIndexCount,o.geometryInitialized=this._geometryInitialized,o.geometryCount=this._geometryCount,o.matricesTexture=this._matricesTexture.toJSON(e),this._colorsTexture!==null&&(o.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(o.boundingSphere={center:o.boundingSphere.center.toArray(),radius:o.boundingSphere.radius}),this.boundingBox!==null&&(o.boundingBox={min:o.boundingBox.min.toArray(),max:o.boundingBox.max.toArray()}));function a(l,c){return l[c.uuid]===void 0&&(l[c.uuid]=c.toJSON(e)),c.uuid}if(this.isScene)this.background&&(this.background.isColor?o.background=this.background.toJSON():this.background.isTexture&&(o.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(o.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){o.geometry=a(e.geometries,this.geometry);let l=this.geometry.parameters;if(l!==void 0&&l.shapes!==void 0){let c=l.shapes;if(Array.isArray(c))for(let d=0,h=c.length;d<h;d++){let u=c[d];a(e.shapes,u)}else a(e.shapes,c)}}if(this.isSkinnedMesh&&(o.bindMode=this.bindMode,o.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(a(e.skeletons,this.skeleton),o.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){let l=[];for(let c=0,d=this.material.length;c<d;c++)l.push(a(e.materials,this.material[c]));o.material=l}else o.material=a(e.materials,this.material);if(this.children.length>0){o.children=[];for(let l=0;l<this.children.length;l++)o.children.push(this.children[l].toJSON(e).object)}if(this.animations.length>0){o.animations=[];for(let l=0;l<this.animations.length;l++){let c=this.animations[l];o.animations.push(a(e.animations,c))}}if(n){let l=s(e.geometries),c=s(e.materials),d=s(e.textures),h=s(e.images),u=s(e.shapes),f=s(e.skeletons),_=s(e.animations),y=s(e.nodes);l.length>0&&(r.geometries=l),c.length>0&&(r.materials=c),d.length>0&&(r.textures=d),h.length>0&&(r.images=h),u.length>0&&(r.shapes=u),f.length>0&&(r.skeletons=f),_.length>0&&(r.animations=_),y.length>0&&(r.nodes=y)}return r.object=o,r;function s(l){let c=[];for(let d in l){let h=l[d];delete h.metadata,c.push(h)}return c}}clone(e){return new this.constructor().copy(this,e)}copy(e,n=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),n===!0)for(let r=0;r<e.children.length;r++){let o=e.children[r];this.add(o.clone())}return this}}return i.DEFAULT_UP=new ce(0,1,0),i.DEFAULT_MATRIX_AUTO_UPDATE=!0,i.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0,i})(),vl=new ce,wd=new ce,eI=new ce,Cd=new ce,$p=new ce,Xp=new ce,h9=new ce,tI=new ce,iI=new ce,nI=new ce,tm=class i{constructor(t=new ce,e=new ce,n=new ce){this.a=t,this.b=e,this.c=n}static getNormal(t,e,n,r){r.subVectors(n,e),vl.subVectors(t,e),r.cross(vl);let o=r.lengthSq();return o>0?r.multiplyScalar(1/Math.sqrt(o)):r.set(0,0,0)}static getBarycoord(t,e,n,r,o){vl.subVectors(r,e),wd.subVectors(n,e),eI.subVectors(t,e);let a=vl.dot(vl),s=vl.dot(wd),l=vl.dot(eI),c=wd.dot(wd),d=wd.dot(eI),h=a*c-s*s;if(h===0)return o.set(0,0,0),null;let u=1/h,f=(c*l-s*d)*u,_=(a*d-s*l)*u;return o.set(1-f-_,_,f)}static containsPoint(t,e,n,r){return this.getBarycoord(t,e,n,r,Cd)===null?!1:Cd.x>=0&&Cd.y>=0&&Cd.x+Cd.y<=1}static getInterpolation(t,e,n,r,o,a,s,l){return this.getBarycoord(t,e,n,r,Cd)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(o,Cd.x),l.addScaledVector(a,Cd.y),l.addScaledVector(s,Cd.z),l)}static isFrontFacing(t,e,n,r){return vl.subVectors(n,e),wd.subVectors(t,e),vl.cross(wd).dot(r)<0}set(t,e,n){return this.a.copy(t),this.b.copy(e),this.c.copy(n),this}setFromPointsAndIndices(t,e,n,r){return this.a.copy(t[e]),this.b.copy(t[n]),this.c.copy(t[r]),this}setFromAttributeAndIndices(t,e,n,r){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,n),this.c.fromBufferAttribute(t,r),this}clone(){return new this.constructor().copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return vl.subVectors(this.c,this.b),wd.subVectors(this.a,this.b),vl.cross(wd).length()*.5}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return i.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return i.getBarycoord(t,this.a,this.b,this.c,e)}getInterpolation(t,e,n,r,o){return i.getInterpolation(t,this.a,this.b,this.c,e,n,r,o)}containsPoint(t){return i.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return i.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){let n=this.a,r=this.b,o=this.c,a,s;$p.subVectors(r,n),Xp.subVectors(o,n),tI.subVectors(t,n);let l=$p.dot(tI),c=Xp.dot(tI);if(l<=0&&c<=0)return e.copy(n);iI.subVectors(t,r);let d=$p.dot(iI),h=Xp.dot(iI);if(d>=0&&h<=d)return e.copy(r);let u=l*h-d*c;if(u<=0&&l>=0&&d<=0)return a=l/(l-d),e.copy(n).addScaledVector($p,a);nI.subVectors(t,o);let f=$p.dot(nI),_=Xp.dot(nI);if(_>=0&&f<=_)return e.copy(o);let y=f*c-l*_;if(y<=0&&c>=0&&_<=0)return s=c/(c-_),e.copy(n).addScaledVector(Xp,s);let b=d*_-f*h;if(b<=0&&h-d>=0&&f-_>=0)return h9.subVectors(o,r),s=(h-d)/(h-d+(f-_)),e.copy(r).addScaledVector(h9,s);let v=1/(b+y+u);return a=y*v,s=u*v,e.copy(n).addScaledVector($p,a).addScaledVector(Xp,s)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}},yH={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},Ou={h:0,s:0,l:0},ex={h:0,s:0,l:0};function rI(i,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?i+(t-i)*6*e:e<1/2?t:e<2/3?i+(t-i)*6*(2/3-e):i}var di=class{constructor(t,e,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(t,e,n)}set(t,e,n){if(e===void 0&&n===void 0){let r=t;r&&r.isColor?this.copy(r):typeof r=="number"?this.setHex(r):typeof r=="string"&&this.setStyle(r)}else this.setRGB(t,e,n);return this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,e=Rs){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(t&255)/255,On.toWorkingColorSpace(this,e),this}setRGB(t,e,n,r=On.workingColorSpace){return this.r=t,this.g=e,this.b=n,On.toWorkingColorSpace(this,r),this}setHSL(t,e,n,r=On.workingColorSpace){if(t=j3(t,1),e=bo(e,0,1),n=bo(n,0,1),e===0)this.r=this.g=this.b=n;else{let o=n<=.5?n*(1+e):n+e-n*e,a=2*n-o;this.r=rI(a,o,t+1/3),this.g=rI(a,o,t),this.b=rI(a,o,t-1/3)}return On.toWorkingColorSpace(this,r),this}setStyle(t,e=Rs){function n(o){o!==void 0&&parseFloat(o)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(t)){let o,a=r[1],s=r[2];switch(a){case"rgb":case"rgba":if(o=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return n(o[4]),this.setRGB(Math.min(255,parseInt(o[1],10))/255,Math.min(255,parseInt(o[2],10))/255,Math.min(255,parseInt(o[3],10))/255,e);if(o=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return n(o[4]),this.setRGB(Math.min(100,parseInt(o[1],10))/100,Math.min(100,parseInt(o[2],10))/100,Math.min(100,parseInt(o[3],10))/100,e);break;case"hsl":case"hsla":if(o=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return n(o[4]),this.setHSL(parseFloat(o[1])/360,parseFloat(o[2])/100,parseFloat(o[3])/100,e);break;default:console.warn("THREE.Color: Unknown color model "+t)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(t)){let o=r[1],a=o.length;if(a===3)return this.setRGB(parseInt(o.charAt(0),16)/15,parseInt(o.charAt(1),16)/15,parseInt(o.charAt(2),16)/15,e);if(a===6)return this.setHex(parseInt(o,16),e);console.warn("THREE.Color: Invalid hex color "+t)}else if(t&&t.length>0)return this.setColorName(t,e);return this}setColorName(t,e=Rs){let n=yH[t.toLowerCase()];return n!==void 0?this.setHex(n,e):console.warn("THREE.Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copySRGBToLinear(t){return this.r=hA(t.r),this.g=hA(t.g),this.b=hA(t.b),this}copyLinearToSRGB(t){return this.r=GF(t.r),this.g=GF(t.g),this.b=GF(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=Rs){return On.fromWorkingColorSpace(ea.copy(this),t),Math.round(bo(ea.r*255,0,255))*65536+Math.round(bo(ea.g*255,0,255))*256+Math.round(bo(ea.b*255,0,255))}getHexString(t=Rs){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=On.workingColorSpace){On.fromWorkingColorSpace(ea.copy(this),e);let n=ea.r,r=ea.g,o=ea.b,a=Math.max(n,r,o),s=Math.min(n,r,o),l,c,d=(s+a)/2;if(s===a)l=0,c=0;else{let h=a-s;switch(c=d<=.5?h/(a+s):h/(2-a-s),a){case n:l=(r-o)/h+(r<o?6:0);break;case r:l=(o-n)/h+2;break;case o:l=(n-r)/h+4;break}l/=6}return t.h=l,t.s=c,t.l=d,t}getRGB(t,e=On.workingColorSpace){return On.fromWorkingColorSpace(ea.copy(this),e),t.r=ea.r,t.g=ea.g,t.b=ea.b,t}getStyle(t=Rs){On.fromWorkingColorSpace(ea.copy(this),t);let e=ea.r,n=ea.g,r=ea.b;return t!==Rs?`color(${t} ${e.toFixed(3)} ${n.toFixed(3)} ${r.toFixed(3)})`:`rgb(${Math.round(e*255)},${Math.round(n*255)},${Math.round(r*255)})`}offsetHSL(t,e,n){return this.getHSL(Ou),this.setHSL(Ou.h+t,Ou.s+e,Ou.l+n)}add(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this}addColors(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this}addScalar(t){return this.r+=t,this.g+=t,this.b+=t,this}sub(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this}multiply(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this}multiplyScalar(t){return this.r*=t,this.g*=t,this.b*=t,this}lerp(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this}lerpColors(t,e,n){return this.r=t.r+(e.r-t.r)*n,this.g=t.g+(e.g-t.g)*n,this.b=t.b+(e.b-t.b)*n,this}lerpHSL(t,e){this.getHSL(Ou),t.getHSL(ex);let n=O_(Ou.h,ex.h,e),r=O_(Ou.s,ex.s,e),o=O_(Ou.l,ex.l,e);return this.setHSL(n,r,o),this}setFromVector3(t){return this.r=t.x,this.g=t.y,this.b=t.z,this}applyMatrix3(t){let e=this.r,n=this.g,r=this.b,o=t.elements;return this.r=o[0]*e+o[3]*n+o[6]*r,this.g=o[1]*e+o[4]*n+o[7]*r,this.b=o[2]*e+o[5]*n+o[8]*r,this}equals(t){return t.r===this.r&&t.g===this.g&&t.b===this.b}fromArray(t,e=0){return this.r=t[e],this.g=t[e+1],this.b=t[e+2],this}toArray(t=[],e=0){return t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t}fromBufferAttribute(t,e){return this.r=t.getX(e),this.g=t.getY(e),this.b=t.getZ(e),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}},ea=new di;di.NAMES=yH;var rme=0,uc=class extends Id{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:rme++}),this.uuid=lc(),this.name="",this.type="Material",this.blending=cA,this.side=Vu,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=yI,this.blendDst=xI,this.blendEquation=Yf,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new di(0,0,0),this.blendAlpha=0,this.depthFunc=Fx,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=Z7,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Hp,this.stencilZFail=Hp,this.stencilZPass=Hp,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(t){this._alphaTest>0!=t>0&&this.version++,this._alphaTest=t}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(t!==void 0)for(let e in t){let n=t[e];if(n===void 0){console.warn(`THREE.Material: parameter '${e}' has value of undefined.`);continue}let r=this[e];if(r===void 0){console.warn(`THREE.Material: '${e}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[e]=n}}toJSON(t){let e=t===void 0||typeof t=="string";e&&(t={textures:{},images:{}});let n={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen!==void 0&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.dispersion!==void 0&&(n.dispersion=this.dispersion),this.iridescence!==void 0&&(n.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(n.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),this.anisotropy!==void 0&&(n.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(t).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(t).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(t).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(t).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(t).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(t).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(t).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapRotation!==void 0&&(n.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(t).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(t).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(t).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==cA&&(n.blending=this.blending),this.side!==Vu&&(n.side=this.side),this.vertexColors===!0&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=!0),this.blendSrc!==yI&&(n.blendSrc=this.blendSrc),this.blendDst!==xI&&(n.blendDst=this.blendDst),this.blendEquation!==Yf&&(n.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(n.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(n.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(n.blendAlpha=this.blendAlpha),this.depthFunc!==Fx&&(n.depthFunc=this.depthFunc),this.depthTest===!1&&(n.depthTest=this.depthTest),this.depthWrite===!1&&(n.depthWrite=this.depthWrite),this.colorWrite===!1&&(n.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(n.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==Z7&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Hp&&(n.stencilFail=this.stencilFail),this.stencilZFail!==Hp&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==Hp&&(n.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(n.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaHash===!0&&(n.alphaHash=!0),this.alphaToCoverage===!0&&(n.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=!0),this.forceSinglePass===!0&&(n.forceSinglePass=!0),this.wireframe===!0&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=!0),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),this.fog===!1&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData);function r(o){let a=[];for(let s in o){let l=o[s];delete l.metadata,a.push(l)}return a}if(e){let o=r(t.textures),a=r(t.images);o.length>0&&(n.textures=o),a.length>0&&(n.images=a)}return n}clone(){return new this.constructor().copy(this)}copy(t){this.name=t.name,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.blendColor.copy(t.blendColor),this.blendAlpha=t.blendAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;let e=t.clippingPlanes,n=null;if(e!==null){let r=e.length;n=new Array(r);for(let o=0;o!==r;++o)n[o]=e[o].clone()}return this.clippingPlanes=n,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaHash=t.alphaHash,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.forceSinglePass=t.forceSinglePass,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){t===!0&&this.version++}onBuild(){console.warn("Material: onBuild() has been removed.")}},kd=class extends uc{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new di(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new nm,this.combine=N3,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapRotation.copy(t.envMapRotation),this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}};var Wr=new ce,tx=new qe,Vn=class{constructor(t,e,n=!1){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=t,this.itemSize=e,this.count=t!==void 0?t.length/e:0,this.normalized=n,this.usage=JI,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=Td,this.version=0}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}get updateRange(){return uA("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(t){return this.usage=t,this}addUpdateRange(t,e){this.updateRanges.push({start:t,count:e})}clearUpdateRanges(){this.updateRanges.length=0}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this.gpuType=t.gpuType,this}copyAt(t,e,n){t*=this.itemSize,n*=e.itemSize;for(let r=0,o=this.itemSize;r<o;r++)this.array[t+r]=e.array[n+r];return this}copyArray(t){return this.array.set(t),this}applyMatrix3(t){if(this.itemSize===2)for(let e=0,n=this.count;e<n;e++)tx.fromBufferAttribute(this,e),tx.applyMatrix3(t),this.setXY(e,tx.x,tx.y);else if(this.itemSize===3)for(let e=0,n=this.count;e<n;e++)Wr.fromBufferAttribute(this,e),Wr.applyMatrix3(t),this.setXYZ(e,Wr.x,Wr.y,Wr.z);return this}applyMatrix4(t){for(let e=0,n=this.count;e<n;e++)Wr.fromBufferAttribute(this,e),Wr.applyMatrix4(t),this.setXYZ(e,Wr.x,Wr.y,Wr.z);return this}applyNormalMatrix(t){for(let e=0,n=this.count;e<n;e++)Wr.fromBufferAttribute(this,e),Wr.applyNormalMatrix(t),this.setXYZ(e,Wr.x,Wr.y,Wr.z);return this}transformDirection(t){for(let e=0,n=this.count;e<n;e++)Wr.fromBufferAttribute(this,e),Wr.transformDirection(t),this.setXYZ(e,Wr.x,Wr.y,Wr.z);return this}set(t,e=0){return this.array.set(t,e),this}getComponent(t,e){let n=this.array[t*this.itemSize+e];return this.normalized&&(n=xl(n,this.array)),n}setComponent(t,e,n){return this.normalized&&(n=Hn(n,this.array)),this.array[t*this.itemSize+e]=n,this}getX(t){let e=this.array[t*this.itemSize];return this.normalized&&(e=xl(e,this.array)),e}setX(t,e){return this.normalized&&(e=Hn(e,this.array)),this.array[t*this.itemSize]=e,this}getY(t){let e=this.array[t*this.itemSize+1];return this.normalized&&(e=xl(e,this.array)),e}setY(t,e){return this.normalized&&(e=Hn(e,this.array)),this.array[t*this.itemSize+1]=e,this}getZ(t){let e=this.array[t*this.itemSize+2];return this.normalized&&(e=xl(e,this.array)),e}setZ(t,e){return this.normalized&&(e=Hn(e,this.array)),this.array[t*this.itemSize+2]=e,this}getW(t){let e=this.array[t*this.itemSize+3];return this.normalized&&(e=xl(e,this.array)),e}setW(t,e){return this.normalized&&(e=Hn(e,this.array)),this.array[t*this.itemSize+3]=e,this}setXY(t,e,n){return t*=this.itemSize,this.normalized&&(e=Hn(e,this.array),n=Hn(n,this.array)),this.array[t+0]=e,this.array[t+1]=n,this}setXYZ(t,e,n,r){return t*=this.itemSize,this.normalized&&(e=Hn(e,this.array),n=Hn(n,this.array),r=Hn(r,this.array)),this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=r,this}setXYZW(t,e,n,r,o){return t*=this.itemSize,this.normalized&&(e=Hn(e,this.array),n=Hn(n,this.array),r=Hn(r,this.array),o=Hn(o,this.array)),this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=r,this.array[t+3]=o,this}onUpload(t){return this.onUploadCallback=t,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){let t={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(t.name=this.name),this.usage!==JI&&(t.usage=this.usage),t}};var Ux=class extends Vn{constructor(t,e,n){super(new Uint16Array(t),e,n)}};var Hx=class extends Vn{constructor(t,e,n){super(new Uint32Array(t),e,n)}};var Qn=class extends Vn{constructor(t,e,n){super(new Float32Array(t),e,n)}},ome=0,Ps=new pr,oI=new Ls,Kp=new ce,os=new Po,B_=new Po,_o=new ce,Cn=class i extends Id{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:ome++}),this.uuid=lc(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(t){return Array.isArray(t)?this.index=new(vH(t)?Hx:Ux)(t,1):this.index=t,this}getAttribute(t){return this.attributes[t]}setAttribute(t,e){return this.attributes[t]=e,this}deleteAttribute(t){return delete this.attributes[t],this}hasAttribute(t){return this.attributes[t]!==void 0}addGroup(t,e,n=0){this.groups.push({start:t,count:e,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(t,e){this.drawRange.start=t,this.drawRange.count=e}applyMatrix4(t){let e=this.attributes.position;e!==void 0&&(e.applyMatrix4(t),e.needsUpdate=!0);let n=this.attributes.normal;if(n!==void 0){let o=new Fi().getNormalMatrix(t);n.applyNormalMatrix(o),n.needsUpdate=!0}let r=this.attributes.tangent;return r!==void 0&&(r.transformDirection(t),r.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(t){return Ps.makeRotationFromQuaternion(t),this.applyMatrix4(Ps),this}rotateX(t){return Ps.makeRotationX(t),this.applyMatrix4(Ps),this}rotateY(t){return Ps.makeRotationY(t),this.applyMatrix4(Ps),this}rotateZ(t){return Ps.makeRotationZ(t),this.applyMatrix4(Ps),this}translate(t,e,n){return Ps.makeTranslation(t,e,n),this.applyMatrix4(Ps),this}scale(t,e,n){return Ps.makeScale(t,e,n),this.applyMatrix4(Ps),this}lookAt(t){return oI.lookAt(t),oI.updateMatrix(),this.applyMatrix4(oI.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Kp).negate(),this.translate(Kp.x,Kp.y,Kp.z),this}setFromPoints(t){let e=[];for(let n=0,r=t.length;n<r;n++){let o=t[n];e.push(o.x,o.y,o.z||0)}return this.setAttribute("position",new Qn(e,3)),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Po);let t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new ce(-1/0,-1/0,-1/0),new ce(1/0,1/0,1/0));return}if(t!==void 0){if(this.boundingBox.setFromBufferAttribute(t),e)for(let n=0,r=e.length;n<r;n++){let o=e[n];os.setFromBufferAttribute(o),this.morphTargetsRelative?(_o.addVectors(this.boundingBox.min,os.min),this.boundingBox.expandByPoint(_o),_o.addVectors(this.boundingBox.max,os.max),this.boundingBox.expandByPoint(_o)):(this.boundingBox.expandByPoint(os.min),this.boundingBox.expandByPoint(os.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new dc);let t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new ce,1/0);return}if(t){let n=this.boundingSphere.center;if(os.setFromBufferAttribute(t),e)for(let o=0,a=e.length;o<a;o++){let s=e[o];B_.setFromBufferAttribute(s),this.morphTargetsRelative?(_o.addVectors(os.min,B_.min),os.expandByPoint(_o),_o.addVectors(os.max,B_.max),os.expandByPoint(_o)):(os.expandByPoint(B_.min),os.expandByPoint(B_.max))}os.getCenter(n);let r=0;for(let o=0,a=t.count;o<a;o++)_o.fromBufferAttribute(t,o),r=Math.max(r,n.distanceToSquared(_o));if(e)for(let o=0,a=e.length;o<a;o++){let s=e[o],l=this.morphTargetsRelative;for(let c=0,d=s.count;c<d;c++)_o.fromBufferAttribute(s,c),l&&(Kp.fromBufferAttribute(t,c),_o.add(Kp)),r=Math.max(r,n.distanceToSquared(_o))}this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){let t=this.index,e=this.attributes;if(t===null||e.position===void 0||e.normal===void 0||e.uv===void 0){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}let n=e.position,r=e.normal,o=e.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new Vn(new Float32Array(4*n.count),4));let a=this.getAttribute("tangent"),s=[],l=[];for(let O=0;O<n.count;O++)s[O]=new ce,l[O]=new ce;let c=new ce,d=new ce,h=new ce,u=new qe,f=new qe,_=new qe,y=new ce,b=new ce;function v(O,E,B){c.fromBufferAttribute(n,O),d.fromBufferAttribute(n,E),h.fromBufferAttribute(n,B),u.fromBufferAttribute(o,O),f.fromBufferAttribute(o,E),_.fromBufferAttribute(o,B),d.sub(c),h.sub(c),f.sub(u),_.sub(u);let L=1/(f.x*_.y-_.x*f.y);isFinite(L)&&(y.copy(d).multiplyScalar(_.y).addScaledVector(h,-f.y).multiplyScalar(L),b.copy(h).multiplyScalar(f.x).addScaledVector(d,-_.x).multiplyScalar(L),s[O].add(y),s[E].add(y),s[B].add(y),l[O].add(b),l[E].add(b),l[B].add(b))}let M=this.groups;M.length===0&&(M=[{start:0,count:t.count}]);for(let O=0,E=M.length;O<E;++O){let B=M[O],L=B.start,q=B.count;for(let W=L,oe=L+q;W<oe;W+=3)v(t.getX(W+0),t.getX(W+1),t.getX(W+2))}let x=new ce,w=new ce,k=new ce,P=new ce;function D(O){k.fromBufferAttribute(r,O),P.copy(k);let E=s[O];x.copy(E),x.sub(k.multiplyScalar(k.dot(E))).normalize(),w.crossVectors(P,E);let L=w.dot(l[O])<0?-1:1;a.setXYZW(O,x.x,x.y,x.z,L)}for(let O=0,E=M.length;O<E;++O){let B=M[O],L=B.start,q=B.count;for(let W=L,oe=L+q;W<oe;W+=3)D(t.getX(W+0)),D(t.getX(W+1)),D(t.getX(W+2))}}computeVertexNormals(){let t=this.index,e=this.getAttribute("position");if(e!==void 0){let n=this.getAttribute("normal");if(n===void 0)n=new Vn(new Float32Array(e.count*3),3),this.setAttribute("normal",n);else for(let u=0,f=n.count;u<f;u++)n.setXYZ(u,0,0,0);let r=new ce,o=new ce,a=new ce,s=new ce,l=new ce,c=new ce,d=new ce,h=new ce;if(t)for(let u=0,f=t.count;u<f;u+=3){let _=t.getX(u+0),y=t.getX(u+1),b=t.getX(u+2);r.fromBufferAttribute(e,_),o.fromBufferAttribute(e,y),a.fromBufferAttribute(e,b),d.subVectors(a,o),h.subVectors(r,o),d.cross(h),s.fromBufferAttribute(n,_),l.fromBufferAttribute(n,y),c.fromBufferAttribute(n,b),s.add(d),l.add(d),c.add(d),n.setXYZ(_,s.x,s.y,s.z),n.setXYZ(y,l.x,l.y,l.z),n.setXYZ(b,c.x,c.y,c.z)}else for(let u=0,f=e.count;u<f;u+=3)r.fromBufferAttribute(e,u+0),o.fromBufferAttribute(e,u+1),a.fromBufferAttribute(e,u+2),d.subVectors(a,o),h.subVectors(r,o),d.cross(h),n.setXYZ(u+0,d.x,d.y,d.z),n.setXYZ(u+1,d.x,d.y,d.z),n.setXYZ(u+2,d.x,d.y,d.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){let t=this.attributes.normal;for(let e=0,n=t.count;e<n;e++)_o.fromBufferAttribute(t,e),_o.normalize(),t.setXYZ(e,_o.x,_o.y,_o.z)}toNonIndexed(){function t(s,l){let c=s.array,d=s.itemSize,h=s.normalized,u=new c.constructor(l.length*d),f=0,_=0;for(let y=0,b=l.length;y<b;y++){s.isInterleavedBufferAttribute?f=l[y]*s.data.stride+s.offset:f=l[y]*d;for(let v=0;v<d;v++)u[_++]=c[f++]}return new Vn(u,d,h)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;let e=new i,n=this.index.array,r=this.attributes;for(let s in r){let l=r[s],c=t(l,n);e.setAttribute(s,c)}let o=this.morphAttributes;for(let s in o){let l=[],c=o[s];for(let d=0,h=c.length;d<h;d++){let u=c[d],f=t(u,n);l.push(f)}e.morphAttributes[s]=l}e.morphTargetsRelative=this.morphTargetsRelative;let a=this.groups;for(let s=0,l=a.length;s<l;s++){let c=a[s];e.addGroup(c.start,c.count,c.materialIndex)}return e}toJSON(){let t={metadata:{version:4.6,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,this.name!==""&&(t.name=this.name),Object.keys(this.userData).length>0&&(t.userData=this.userData),this.parameters!==void 0){let l=this.parameters;for(let c in l)l[c]!==void 0&&(t[c]=l[c]);return t}t.data={attributes:{}};let e=this.index;e!==null&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});let n=this.attributes;for(let l in n){let c=n[l];t.data.attributes[l]=c.toJSON(t.data)}let r={},o=!1;for(let l in this.morphAttributes){let c=this.morphAttributes[l],d=[];for(let h=0,u=c.length;h<u;h++){let f=c[h];d.push(f.toJSON(t.data))}d.length>0&&(r[l]=d,o=!0)}o&&(t.data.morphAttributes=r,t.data.morphTargetsRelative=this.morphTargetsRelative);let a=this.groups;a.length>0&&(t.data.groups=JSON.parse(JSON.stringify(a)));let s=this.boundingSphere;return s!==null&&(t.data.boundingSphere={center:s.center.toArray(),radius:s.radius}),t}clone(){return new this.constructor().copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let e={};this.name=t.name;let n=t.index;n!==null&&this.setIndex(n.clone(e));let r=t.attributes;for(let c in r){let d=r[c];this.setAttribute(c,d.clone(e))}let o=t.morphAttributes;for(let c in o){let d=[],h=o[c];for(let u=0,f=h.length;u<f;u++)d.push(h[u].clone(e));this.morphAttributes[c]=d}this.morphTargetsRelative=t.morphTargetsRelative;let a=t.groups;for(let c=0,d=a.length;c<d;c++){let h=a[c];this.addGroup(h.start,h.count,h.materialIndex)}let s=t.boundingBox;s!==null&&(this.boundingBox=s.clone());let l=t.boundingSphere;return l!==null&&(this.boundingSphere=l.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}},f9=new pr,Wf=new Dd,ix=new dc,m9=new ce,Yp=new ce,Zp=new ce,Jp=new ce,aI=new ce,nx=new ce,rx=new qe,ox=new qe,ax=new qe,p9=new ce,A9=new ce,g9=new ce,sx=new ce,lx=new ce,Hi=class extends Ls{constructor(t=new Cn,e=new kd){super(),this.isMesh=!0,this.type="Mesh",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t,e){return super.copy(t,e),t.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),t.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this.material=Array.isArray(t.material)?t.material.slice():t.material,this.geometry=t.geometry,this}updateMorphTargets(){let e=this.geometry.morphAttributes,n=Object.keys(e);if(n.length>0){let r=e[n[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let o=0,a=r.length;o<a;o++){let s=r[o].name||String(o);this.morphTargetInfluences.push(0),this.morphTargetDictionary[s]=o}}}}getVertexPosition(t,e){let n=this.geometry,r=n.attributes.position,o=n.morphAttributes.position,a=n.morphTargetsRelative;e.fromBufferAttribute(r,t);let s=this.morphTargetInfluences;if(o&&s){nx.set(0,0,0);for(let l=0,c=o.length;l<c;l++){let d=s[l],h=o[l];d!==0&&(aI.fromBufferAttribute(h,t),a?nx.addScaledVector(aI,d):nx.addScaledVector(aI.sub(e),d))}e.add(nx)}return e}raycast(t,e){let n=this.geometry,r=this.material,o=this.matrixWorld;r!==void 0&&(n.boundingSphere===null&&n.computeBoundingSphere(),ix.copy(n.boundingSphere),ix.applyMatrix4(o),Wf.copy(t.ray).recast(t.near),!(ix.containsPoint(Wf.origin)===!1&&(Wf.intersectSphere(ix,m9)===null||Wf.origin.distanceToSquared(m9)>(t.far-t.near)**2))&&(f9.copy(o).invert(),Wf.copy(t.ray).applyMatrix4(f9),!(n.boundingBox!==null&&Wf.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(t,e,Wf)))}_computeIntersections(t,e,n){let r,o=this.geometry,a=this.material,s=o.index,l=o.attributes.position,c=o.attributes.uv,d=o.attributes.uv1,h=o.attributes.normal,u=o.groups,f=o.drawRange;if(s!==null)if(Array.isArray(a))for(let _=0,y=u.length;_<y;_++){let b=u[_],v=a[b.materialIndex],M=Math.max(b.start,f.start),x=Math.min(s.count,Math.min(b.start+b.count,f.start+f.count));for(let w=M,k=x;w<k;w+=3){let P=s.getX(w),D=s.getX(w+1),O=s.getX(w+2);r=cx(this,v,t,n,c,d,h,P,D,O),r&&(r.faceIndex=Math.floor(w/3),r.face.materialIndex=b.materialIndex,e.push(r))}}else{let _=Math.max(0,f.start),y=Math.min(s.count,f.start+f.count);for(let b=_,v=y;b<v;b+=3){let M=s.getX(b),x=s.getX(b+1),w=s.getX(b+2);r=cx(this,a,t,n,c,d,h,M,x,w),r&&(r.faceIndex=Math.floor(b/3),e.push(r))}}else if(l!==void 0)if(Array.isArray(a))for(let _=0,y=u.length;_<y;_++){let b=u[_],v=a[b.materialIndex],M=Math.max(b.start,f.start),x=Math.min(l.count,Math.min(b.start+b.count,f.start+f.count));for(let w=M,k=x;w<k;w+=3){let P=w,D=w+1,O=w+2;r=cx(this,v,t,n,c,d,h,P,D,O),r&&(r.faceIndex=Math.floor(w/3),r.face.materialIndex=b.materialIndex,e.push(r))}}else{let _=Math.max(0,f.start),y=Math.min(l.count,f.start+f.count);for(let b=_,v=y;b<v;b+=3){let M=b,x=b+1,w=b+2;r=cx(this,a,t,n,c,d,h,M,x,w),r&&(r.faceIndex=Math.floor(b/3),e.push(r))}}}};function ame(i,t,e,n,r,o,a,s){let l;if(t.side===ta?l=n.intersectTriangle(a,o,r,!0,s):l=n.intersectTriangle(r,o,a,t.side===Vu,s),l===null)return null;lx.copy(s),lx.applyMatrix4(i.matrixWorld);let c=e.ray.origin.distanceTo(lx);return c<e.near||c>e.far?null:{distance:c,point:lx.clone(),object:i}}function cx(i,t,e,n,r,o,a,s,l,c){i.getVertexPosition(s,Yp),i.getVertexPosition(l,Zp),i.getVertexPosition(c,Jp);let d=ame(i,t,e,n,Yp,Zp,Jp,sx);if(d){r&&(rx.fromBufferAttribute(r,s),ox.fromBufferAttribute(r,l),ax.fromBufferAttribute(r,c),d.uv=tm.getInterpolation(sx,Yp,Zp,Jp,rx,ox,ax,new qe)),o&&(rx.fromBufferAttribute(o,s),ox.fromBufferAttribute(o,l),ax.fromBufferAttribute(o,c),d.uv1=tm.getInterpolation(sx,Yp,Zp,Jp,rx,ox,ax,new qe)),a&&(p9.fromBufferAttribute(a,s),A9.fromBufferAttribute(a,l),g9.fromBufferAttribute(a,c),d.normal=tm.getInterpolation(sx,Yp,Zp,Jp,p9,A9,g9,new ce),d.normal.dot(n.direction)>0&&d.normal.multiplyScalar(-1));let h={a:s,b:l,c,normal:new ce,materialIndex:0};tm.getNormal(Yp,Zp,Jp,h.normal),d.face=h}return d}var va=class i extends Cn{constructor(t=1,e=1,n=1,r=1,o=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:n,widthSegments:r,heightSegments:o,depthSegments:a};let s=this;r=Math.floor(r),o=Math.floor(o),a=Math.floor(a);let l=[],c=[],d=[],h=[],u=0,f=0;_("z","y","x",-1,-1,n,e,t,a,o,0),_("z","y","x",1,-1,n,e,-t,a,o,1),_("x","z","y",1,1,t,n,e,r,a,2),_("x","z","y",1,-1,t,n,-e,r,a,3),_("x","y","z",1,-1,t,e,n,r,o,4),_("x","y","z",-1,-1,t,e,-n,r,o,5),this.setIndex(l),this.setAttribute("position",new Qn(c,3)),this.setAttribute("normal",new Qn(d,3)),this.setAttribute("uv",new Qn(h,2));function _(y,b,v,M,x,w,k,P,D,O,E){let B=w/D,L=k/O,q=w/2,W=k/2,oe=P/2,pe=D+1,ge=O+1,de=0,U=0,J=new ce;for(let Pe=0;Pe<ge;Pe++){let We=Pe*L-W;for(let yt=0;yt<pe;yt++){let vt=yt*B-q;J[y]=vt*M,J[b]=We*x,J[v]=oe,c.push(J.x,J.y,J.z),J[y]=0,J[b]=0,J[v]=P>0?1:-1,d.push(J.x,J.y,J.z),h.push(yt/D),h.push(1-Pe/O),de+=1}}for(let Pe=0;Pe<O;Pe++)for(let We=0;We<D;We++){let yt=u+We+pe*Pe,vt=u+We+pe*(Pe+1),ee=u+(We+1)+pe*(Pe+1),Z=u+(We+1)+pe*Pe;l.push(yt,vt,Z),l.push(vt,ee,Z),U+=6}s.addGroup(f,U,E),f+=U,u+=de}}copy(t){return super.copy(t),this.parameters=Object.assign({},t.parameters),this}static fromJSON(t){return new i(t.width,t.height,t.depth,t.widthSegments,t.heightSegments,t.depthSegments)}};function bA(i){let t={};for(let e in i){t[e]={};for(let n in i[e]){let r=i[e][n];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture||r.isQuaternion)?r.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),t[e][n]=null):t[e][n]=r.clone():Array.isArray(r)?t[e][n]=r.slice():t[e][n]=r}}return t}function ba(i){let t={};for(let e=0;e<i.length;e++){let n=bA(i[e]);for(let r in n)t[r]=n[r]}return t}function sme(i){let t=[];for(let e=0;e<i.length;e++)t.push(i[e].clone());return t}function xH(i){let t=i.getRenderTarget();return t===null?i.outputColorSpace:t.isXRRenderTarget===!0?t.texture.colorSpace:On.workingColorSpace}var eb={clone:bA,merge:ba},lme=`void main() {
|
|
1239
1239
|
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
|
|
1240
1240
|
}`,cme=`void main() {
|
|
1241
1241
|
gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
|