@perceptimagery/dita-configurator-staging 1.2.2108 → 1.2.2115

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.
Files changed (2) hide show
  1. package/dist/index.js +32 -32
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /* (c) 2023, Abhishek Deb (vikz91.deb@gmail.com) */
2
2
  (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('@import"https://fonts.googleapis.com/css2?family=Work+Sans:wght@200;300;400;500;600;700;800&display=swap";#Sprie-config-html{font-size:87.5%}#Sprie-config-html,#Sprie-config-body{width:100%;height:100%;margin:0;padding:0;font-family:Work Sans,sans-serif;box-sizing:border-box}#Sprie-config-body *{box-sizing:border-box;margin:0;padding:0}.sprie-config-sr-only{border:0;clip:rect(0,0,0,0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.sprie-config-loadingBox{position:fixed;width:100%;height:100%;display:flex;align-items:center;justify-content:center;text-align:center;font-size:24px;font-weight:500;z-index:10000;background:#f2f2f2}.drawer.drawer--full.hidden-phone.lens-customizer .drawer__header{display:none!important}.drawer.drawer--full.hidden-phone.lens-customizer .drawer__content.drawer__content--padded-start{padding-top:0!important}.drawer.drawer--full.hidden-phone.lens-customizer #dita-3dconfig-element{height:100%!important}.popover.hidden-lap-and-up.popover-full .popover__header{display:none!important}#sprie-config-main-container{width:100%;height:100%}#sprie-config-main-header{border-bottom:.5px solid #aeaeae;display:flex;flex-direction:row;justify-content:center;align-items:center;gap:.5rem}.sprie-config-main-header-close{position:absolute;right:2%;width:3rem;height:3rem;background-color:transparent;border:none}#sprie-config-header-content{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:.5rem}#sprie-config-header-content .sprie-config-mainHeader-frameName{color:#373737;font-size:1.3rem;font-weight:400;line-height:1.5275rem;letter-spacing:-.05rem;text-transform:uppercase}#sprie-config-viewer-container{position:relative;width:100%;img {position: absolute; top: 2rem; left: 2rem;}}.sprie-config-loadingFrame{position:absolute;width:100%;height:100%;display:flex;align-items:center;justify-content:center;text-align:center;font-size:24px;font-weight:500;z-index:1000;background:#fafafa;opacity:.7}.sprie-config-loader{border:8px solid #222222;width:60px;padding:8px;aspect-ratio:1;border-radius:50%;background:#222222;--_m: conic-gradient(#0000 10%, #000), linear-gradient(#000 0 0) content-box;-webkit-mask:var(--_m);mask:var(--_m);-webkit-mask-composite:source-out;mask-composite:subtract;animation:spin 1s infinite linear}@keyframes spin{to{transform:rotate(1turn)}}#Sprie-config-Cust-block{display:flex;align-items:center;background-color:#f2f2f2;border-top:1px solid #91847e;position:relative;flex-grow:1}.sprie-config-price-block{position:absolute;bottom:100%;right:0;z-index:1000;display:flex;flex-direction:column;align-items:end;gap:.4rem;p {font-size: 1.5rem; font-weight: 500; color: #121212;}}.frameName{color:#4d4d4d;font-size:.875rem;font-weight:500;line-height:1.5275rem;letter-spacing:-.05rem;text-transform:uppercase}.price-tag{color:#222;font-size:1.3125rem;font-weight:400;line-height:2.275rem}@media (max-width: 576px){#Sprie-config-Viewer-Container{img {position: absolute; top: 1.2rem; left: 1.2rem;}}#Sprie-config-Cust-block{display:flex;align-items:center}.popover__content.threedConfig{height:100%;width:100%;padding:0}.popover.hidden-lap-and-up.popover-full[open]{transform:translateY(8.5%)}}.sprie-config-palette{overflow-y:hidden;height:100%;display:flex;justify-content:flex-start;overflow-x:auto}.sprie-config-palette-img-box{position:relative;display:flex;flex-direction:column;justify-content:center;align-items:center;height:50%}.sprie-config-palette-img-box .sprie-config-image{width:60px;height:60px}.sprie-config-palette-img-box .sprie-config-image.mobile-view{width:45px;height:45px}.sprie-config-palette-img-box>button{background-color:transparent}.sprie-config-palette-img-text{top:80%;width:175%;height:150%;position:absolute;text-align:center;z-index:100}.sprie-config-palette-img-text .sprie-config-palette-imgName{z-index:100}.sprie-config-palette-img-text .sprie-config-price-tag{text-align:center;font-size:small;white-space:nowrap;z-index:100}.sprie-config-engraving-block{width:100%;height:100%;display:flex;flex-direction:column;align-items:center;gap:.8rem}.sprie-config-engraving-checkbox[type=checkbox]{width:1rem;height:1rem;accent-color:#000;border:.25rem solid #000;border-radius:.5rem;background-color:transparent}.sprie-config-engraving-inputField-block{width:25rem;position:relative}.sprie-config-engraving-inputField{width:100%;font-size:.8rem;font-weight:500;background:transparent;border-width:1px}.sprie-config-engraving-inputInfo{position:absolute;white-space:nowrap;font-size:.6rem;bottom:.2rem;right:.4rem;color:#686868}.sprie-config-engraving-link{position:absolute;background-color:transparent;border:none;white-space:nowrap;font-size:.7rem;bottom:-1.7rem;right:0;color:#686868;text-decoration:underline;cursor:pointer}@media (max-width: 576px){.sprie-config-engraving-inputField-block{width:70%}}.carousel{position:relative;overflow:hidden;width:100%;height:100%;display:flex;flex-direction:column;align-items:center}.carousel-container{width:90%;height:100%;display:flex;position:relative;overflow:hidden}.carousel-item{display:flex;align-items:start;justify-content:center;min-width:100%;height:100%;transition-property:transform;transition-timing-function:cubic-bezier(0,0,.2,1);transition-duration:.5s}.carousel-header{display:flex;align-items:center;justify-content:center;gap:2rem}.carousel-header .step-syntax{font-size:1rem;font-weight:400;line-height:1.5rem;color:#4d4d4d}.carousel-header .select-syntax{font-size:1rem;font-weight:600;line-height:1.5rem;color:#91847e}.carousel-btn{border:none;display:flex;align-items:center;justify-content:center;cursor:pointer;background-color:transparent}.arrow{border:solid #91847e;border-width:0 3px 3px 0;display:inline-block}.right-arrow{transform:rotate(-45deg);-webkit-transform:rotate(-45deg)}.left-arrow{transform:rotate(135deg);-webkit-transform:rotate(135deg)}.step-tracker-block{padding:1%!important;display:flex;flex-direction:column;justify-content:center;align-items:center;border-bottom:1px solid #aeaeae;width:26.25rem}.step-tracker{display:flex;gap:1rem}.step-circle{width:10px;height:10px;border-radius:50%;border:1px solid #7d7d7d;background-color:transparent;display:flex;justify-content:center;align-items:center;margin-right:10px;font-size:14px}.step-circle.active{background-color:#000;border-color:#000}@media (max-width: 576px){.carousel-container{align-items:start;height:70%;width:100%}.step-tracker-block{width:100%}}.sprie-config-add-to-cart-block{width:14.5rem;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:.5rem}.sprie-config-add-to-cart-btn{width:100%;height:2.75rem;background-color:#000;display:flex;align-items:center;justify-content:center;cursor:pointer;border:0;font-size:.875rem;letter-spacing:.1rem;font-weight:500;color:#fff}#Sprie-Config-return-policy-label{display:flex;justify-content:center;width:16rem;p {font-size: .8rem; margin: .05rem .08rem .05rem .5rem;}}#Sprie-Config-return-policy-checkbox[type=checkbox]{align-self:center;width:1rem;height:1rem;accent-color:#000;border:.25rem solid #000;border-radius:.5rem;background-color:#efefef}.sprie-config-add-to-cart-btn:disabled,.sprie-config-add-to-cart-btn [disabled]{background-color:#504f4f;cursor:default}@media (max-width: 576px){.sprie-config-add-to-cart-block{width:100%}.sprie-config-add-to-cart-btn{width:100%;height:4rem}#Sprie-Config-return-policy-label{width:100%;margin-bottom:.5rem}}.sprie-3d-snap-button-block{position:absolute;top:1.5rem;right:2rem;display:flex;flex-direction:column}.sprie-3d-snap-button{cursor:pointer!important;border:none;font-size:.9rem;padding:.5rem 1.5rem!important;margin:.5rem 0rem!important;text-align:center}@media (max-width: 576px){.sprie-3d-snap-button-block{top:1rem;right:1.3rem;gap:0}.sprie-3d-snap-button{font-size:.7rem;padding:.3rem 1rem!important;margin:.2rem 0!important}}')),document.head.appendChild(e)}}catch(i){console.error("vite-plugin-css-injected-by-js",i)}})();
3
- var KQ=Object.defineProperty;var JQ=(Wa,us,hs)=>us in Wa?KQ(Wa,us,{enumerable:!0,configurable:!0,writable:!0,value:hs}):Wa[us]=hs;var Rt=(Wa,us,hs)=>(JQ(Wa,typeof us!="symbol"?us+"":us,hs),hs);(function(){var mC,vC;"use strict";class Wa{constructor(e){Rt(this,"config");this.config=e}IsTokenExpired(){if(!this.config.EXPIRES)return!1;const e=this.config.EXPIRES;if(!e)return!0;const t=new Date().getTime(),i=new Date(e).getTime()-t;return e===""||i<=0}IsConfigExpired(){return this.LoadConfig(),!this.config.JWT||!this.config.ORGID}RequestOptions(e,t){return{method:e,headers:{...{Accept:"application/json","Content-Type":"application/json"},...this.config.JWT&&{Authorization:this.config.JWT}},...e==="POST"&&{body:JSON.stringify(t)}}}async Get(e){return await(await fetch(this.config.HOST+e,this.RequestOptions("GET"))).json()}async Post(e,t){return await(await fetch(this.config.HOST+e,this.RequestOptions("POST",t||{}))).json()}StoreConfig(e){e.JWT&&(localStorage.setItem(`${this.config.STORE_PREFIX}jwtToken`,e.JWT),this.config.JWT=e.JWT),e.EXPIRES&&(localStorage.setItem(`${this.config.STORE_PREFIX}expires`,e.EXPIRES),this.config.EXPIRES=e.EXPIRES),e.ORGID&&(localStorage.setItem(`${this.config.STORE_PREFIX}orgId`,e.ORGID),this.config.ORGID=e.ORGID)}LoadConfig(){const e=localStorage.getItem(`${this.config.STORE_PREFIX}jwtToken`);e&&(this.config.JWT=e);const t=localStorage.getItem(`${this.config.STORE_PREFIX}orgId`);t&&(this.config.ORGID=t);const n=localStorage.getItem(`${this.config.STORE_PREFIX}expires`);return n&&(this.config.EXPIRES=n),this.config}}const us={storePrefix:{NODE_ENV:"production"}.STORE_PREFIX||"sprie-embed-",host:"https://api.sprie.io"},hs=Object.freeze(us),H3="1.2.2108";function G3(r,e){const t=r.findIndex(n=>n.sku===e.sku);return t!==-1?[e,...r.slice(0,t),...r.slice(t+1)]:r}class V3{constructor(e,t){Rt(this,"isAuthenticated");Rt(this,"fetcher");Rt(this,"shopifyAPI");Rt(this,"org");Rt(this,"apiKey");Rt(this,"dataVariants");this.isAuthenticated=!1,this.fetcher=e,this.shopifyAPI=t,this.dataVariants=[]}async Authenticate(e){if(this.fetcher.LoadConfig(),(this.fetcher.IsTokenExpired()||this.fetcher.IsConfigExpired())&&await this.AuthServiceApi(e),this.isAuthenticated=!(this.fetcher.IsTokenExpired()&&this.fetcher.IsConfigExpired()),this.org=this.fetcher.config.ORGID,this.apiKey=e,!this.isAuthenticated)throw new Error("Sprie Authentication failed!")}async AuthServiceApi(e){const t=`/v1/widget/auth?api=${e}`,n=await this.fetcher.Get(t);if(!n.access||!n.orgId)throw new Error("SPRIE key Not Authorised");this.fetcher.StoreConfig({...this.fetcher.config,JWT:n.access,ORGID:n.orgId,EXPIRES:n.expires})}async FetchAssetBySKUOrBarcode(e){let t="/v1/widget/variants/";if(e.barcode)t+=`${e.barcode}`;else if(e.sku)t+=`${e.sku}`;else throw new Error("Need either sku or barcode.");return t+="?populate-customisation=true",await this.fetcher.Get(t)}async FetchCustomisationList(e,t){const n=`/v1/widget/list-customisation?search=type:${e},org:${this.fetcher.config.ORGID},usage:customizer&limit=50`,i=await this.fetcher.Get(n),s=i.data.findIndex(h=>h.sku===`${e.toLowerCase()}-default`),o=i.data[s];return!t&&s>-1&&i.data.splice(s,1),{...i,data:t&&o?G3(i.data,o):i.data}}async DownloadMA(e){try{const t=`/v1/widget/org/${e.orgId}/asset/${e.assetsId}/universal-full-encrypted`,n=await this.fetcher.Get(t),i=`org/${e.orgId}/asset/${e.assetsId}`;if(!n)throw new Error("Failed to download model asset.");return{asset:n,decryptionKey:i}}catch{throw new Error("Failed to download model asset.")}}async HandleAssetUsage(e){if(!this.fetcher.IsConfigExpired()&&e){const t={org:this.fetcher.config.ORGID,asset:e,timestamp:new Date().toISOString()},n="/v1/analytics/trigger";await this.fetcher.Post(n,t)}}async PopulateDataList(e){var n;const t=(n=document.querySelector(`#${e}`))==null?void 0:n.textContent;if(t){const i=await JSON.parse(t);return Object.values(i)[0]}return null}async HandleShopifyAddToCart(e,t){e.forEach(s=>{var l;const o=(l=s.properties)==null?void 0:l.customText;o&&(delete s.properties.customText,Object.assign(s.properties,{"custom-laser-etching":"Add Laser Engraving"}),Object.assign(s.properties,{"custom-text":o}),Object.assign(s.properties,{"This customized item cannot be returned or exchanged":"I agree"}),Object.assign(s.properties,{_uniqueTimestamp:t}))});let n={items:e,sections:"mini-cart"};const i=await this.shopifyAPI.Post(n);if(i){const s=await this.shopifyAPI.Get();document.querySelector("#shopify-section-mini-cart").outerHTML=i.sections["mini-cart"],document.querySelector(".header__cart-count").textContent=s.item_count;const o=document.querySelector(".drawer.drawer--full");o&&o.hasAttribute("open")&&o.removeAttribute("open");const l=document.querySelector(".popover.hidden-lap-and-up.popover-full");l&&l.hasAttribute("open")&&l.removeAttribute("open"),document.querySelector(".mini-cart.drawer.drawer--large").setAttribute("open","")}}}var Lp=(r=>(r.Init="init",r.Preparing="preparing",r.Authenticating="authenticating",r.Fetching="fetching",r.Loading="loading",r.Done="done",r))(Lp||{});class j3{constructor({log:e,logErr:t,apiService:n,metaData:i,config:s}){Rt(this,"log");Rt(this,"logErr");Rt(this,"metaData");Rt(this,"loaderName");Rt(this,"apiKey");Rt(this,"scriptStreamEncoderId");Rt(this,"rawNodeList");Rt(this,"targetNodeList");Rt(this,"status");Rt(this,"isLoaded");Rt(this,"loadCount");Rt(this,"mutationObserver");Rt(this,"config");Rt(this,"apiService");this.config=s,this.apiService=n,this.metaData=i,this.apiKey=null,this.scriptStreamEncoderId=`sprie-embed🔴${Date.now().toString()}`,this.rawNodeList=document.getElementsByClassName(this.metaData.targetClassName),this.targetNodeList=[],this.status=Lp.Init,this.isLoaded=!1,this.loadCount=0,this.loaderName="sprie-embed-loader",this.log=e.bind(this),this.logErr=t.bind(this),this.mutationObserver=null}scanApiKeyFromCurrentScriptTag(){const e=document.currentScript;if(!e)return;const t=e==null?void 0:e.getAttribute("src");if(!t)return;const n=new URLSearchParams(t.substring(t.indexOf("?")));this.apiKey=(n==null?void 0:n.get("apikey"))||(n==null?void 0:n.get("apiKey")),this.apiKey&&(e==null||e.setAttribute("data-enc-stream-id",this.scriptStreamEncoderId))}async authenticate(){if(this.status=Lp.Authenticating,!this.apiService.isAuthenticated){if(!this.apiKey)throw new Error("Sprie: Unable to authenticate. Need APIKey.");await this.apiService.Authenticate(this.apiKey),this.apiService.isAuthenticated||this.logErr("Authentication failed! Check apikey and/or expiration.")}}async Init(){try{return this.scanApiKeyFromCurrentScriptTag(),await this.authenticate(),!0}catch(e){return this.log("SprieEmbed Loading failed."),this.logErr(e),this.isLoaded=!1,!1}}}function W3(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Y1={exports:{}},Uc={},q1={exports:{}},Et={};/**
3
+ var KQ=Object.defineProperty;var JQ=(Wa,us,hs)=>us in Wa?KQ(Wa,us,{enumerable:!0,configurable:!0,writable:!0,value:hs}):Wa[us]=hs;var Rt=(Wa,us,hs)=>(JQ(Wa,typeof us!="symbol"?us+"":us,hs),hs);(function(){var mC,vC;"use strict";class Wa{constructor(e){Rt(this,"config");this.config=e}IsTokenExpired(){if(!this.config.EXPIRES)return!1;const e=this.config.EXPIRES;if(!e)return!0;const t=new Date().getTime(),i=new Date(e).getTime()-t;return e===""||i<=0}IsConfigExpired(){return this.LoadConfig(),!this.config.JWT||!this.config.ORGID}RequestOptions(e,t){return{method:e,headers:{...{Accept:"application/json","Content-Type":"application/json"},...this.config.JWT&&{Authorization:this.config.JWT}},...e==="POST"&&{body:JSON.stringify(t)}}}async Get(e){return await(await fetch(this.config.HOST+e,this.RequestOptions("GET"))).json()}async Post(e,t){return await(await fetch(this.config.HOST+e,this.RequestOptions("POST",t||{}))).json()}StoreConfig(e){e.JWT&&(localStorage.setItem(`${this.config.STORE_PREFIX}jwtToken`,e.JWT),this.config.JWT=e.JWT),e.EXPIRES&&(localStorage.setItem(`${this.config.STORE_PREFIX}expires`,e.EXPIRES),this.config.EXPIRES=e.EXPIRES),e.ORGID&&(localStorage.setItem(`${this.config.STORE_PREFIX}orgId`,e.ORGID),this.config.ORGID=e.ORGID)}LoadConfig(){const e=localStorage.getItem(`${this.config.STORE_PREFIX}jwtToken`);e&&(this.config.JWT=e);const t=localStorage.getItem(`${this.config.STORE_PREFIX}orgId`);t&&(this.config.ORGID=t);const n=localStorage.getItem(`${this.config.STORE_PREFIX}expires`);return n&&(this.config.EXPIRES=n),this.config}}const us={storePrefix:{NODE_ENV:"production"}.STORE_PREFIX||"sprie-embed-",host:"https://api.sprie.io"},hs=Object.freeze(us),H3="1.2.2115";function G3(r,e){const t=r.findIndex(n=>n.sku===e.sku);return t!==-1?[e,...r.slice(0,t),...r.slice(t+1)]:r}class V3{constructor(e,t){Rt(this,"isAuthenticated");Rt(this,"fetcher");Rt(this,"shopifyAPI");Rt(this,"org");Rt(this,"apiKey");Rt(this,"dataVariants");this.isAuthenticated=!1,this.fetcher=e,this.shopifyAPI=t,this.dataVariants=[]}async Authenticate(e){if(this.fetcher.LoadConfig(),(this.fetcher.IsTokenExpired()||this.fetcher.IsConfigExpired())&&await this.AuthServiceApi(e),this.isAuthenticated=!(this.fetcher.IsTokenExpired()&&this.fetcher.IsConfigExpired()),this.org=this.fetcher.config.ORGID,this.apiKey=e,!this.isAuthenticated)throw new Error("Sprie Authentication failed!")}async AuthServiceApi(e){const t=`/v1/widget/auth?api=${e}`,n=await this.fetcher.Get(t);if(!n.access||!n.orgId)throw new Error("SPRIE key Not Authorised");this.fetcher.StoreConfig({...this.fetcher.config,JWT:n.access,ORGID:n.orgId,EXPIRES:n.expires})}async FetchAssetBySKUOrBarcode(e){let t="/v1/widget/variants/";if(e.barcode)t+=`${e.barcode}`;else if(e.sku)t+=`${e.sku}`;else throw new Error("Need either sku or barcode.");return t+="?populate-customisation=true",await this.fetcher.Get(t)}async FetchCustomisationList(e,t){const n=`/v1/widget/list-customisation?search=type:${e},org:${this.fetcher.config.ORGID},usage:customizer&limit=50`,i=await this.fetcher.Get(n),s=i.data.findIndex(h=>h.sku===`${e.toLowerCase()}-default`),o=i.data[s];return!t&&s>-1&&i.data.splice(s,1),{...i,data:t&&o?G3(i.data,o):i.data}}async DownloadMA(e){try{const t=`/v1/widget/org/${e.orgId}/asset/${e.assetsId}/universal-full-encrypted`,n=await this.fetcher.Get(t),i=`org/${e.orgId}/asset/${e.assetsId}`;if(!n)throw new Error("Failed to download model asset.");return{asset:n,decryptionKey:i}}catch{throw new Error("Failed to download model asset.")}}async HandleAssetUsage(e){if(!this.fetcher.IsConfigExpired()&&e){const t={org:this.fetcher.config.ORGID,asset:e,timestamp:new Date().toISOString()},n="/v1/analytics/trigger";await this.fetcher.Post(n,t)}}async PopulateDataList(e){var n;const t=(n=document.querySelector(`#${e}`))==null?void 0:n.textContent;if(t){const i=await JSON.parse(t);return Object.values(i)[0]}return null}async HandleShopifyAddToCart(e,t){e.forEach(s=>{var l;const o=(l=s.properties)==null?void 0:l.customText;o&&(delete s.properties.customText,Object.assign(s.properties,{"custom-laser-etching":"Add Laser Engraving"}),Object.assign(s.properties,{"custom-text":o}),Object.assign(s.properties,{"This customized item cannot be returned or exchanged":"I agree"}),Object.assign(s.properties,{_uniqueTimestamp:t}))});let n={items:e,sections:"mini-cart"};const i=await this.shopifyAPI.Post(n);if(i){const s=await this.shopifyAPI.Get();document.querySelector("#shopify-section-mini-cart").outerHTML=i.sections["mini-cart"],document.querySelector(".header__cart-count").textContent=s.item_count;const o=document.querySelector(".drawer.drawer--full");o&&o.hasAttribute("open")&&o.removeAttribute("open");const l=document.querySelector(".popover.hidden-lap-and-up.popover-full");l&&l.hasAttribute("open")&&l.removeAttribute("open"),document.querySelector(".mini-cart.drawer.drawer--large").setAttribute("open","")}}}var Dp=(r=>(r.Init="init",r.Preparing="preparing",r.Authenticating="authenticating",r.Fetching="fetching",r.Loading="loading",r.Done="done",r))(Dp||{});class j3{constructor({log:e,logErr:t,apiService:n,metaData:i,config:s}){Rt(this,"log");Rt(this,"logErr");Rt(this,"metaData");Rt(this,"loaderName");Rt(this,"apiKey");Rt(this,"scriptStreamEncoderId");Rt(this,"rawNodeList");Rt(this,"targetNodeList");Rt(this,"status");Rt(this,"isLoaded");Rt(this,"loadCount");Rt(this,"mutationObserver");Rt(this,"config");Rt(this,"apiService");this.config=s,this.apiService=n,this.metaData=i,this.apiKey=null,this.scriptStreamEncoderId=`sprie-embed🔴${Date.now().toString()}`,this.rawNodeList=document.getElementsByClassName(this.metaData.targetClassName),this.targetNodeList=[],this.status=Dp.Init,this.isLoaded=!1,this.loadCount=0,this.loaderName="sprie-embed-loader",this.log=e.bind(this),this.logErr=t.bind(this),this.mutationObserver=null}scanApiKeyFromCurrentScriptTag(){const e=document.currentScript;if(!e)return;const t=e==null?void 0:e.getAttribute("src");if(!t)return;const n=new URLSearchParams(t.substring(t.indexOf("?")));this.apiKey=(n==null?void 0:n.get("apikey"))||(n==null?void 0:n.get("apiKey")),this.apiKey&&(e==null||e.setAttribute("data-enc-stream-id",this.scriptStreamEncoderId))}async authenticate(){if(this.status=Dp.Authenticating,!this.apiService.isAuthenticated){if(!this.apiKey)throw new Error("Sprie: Unable to authenticate. Need APIKey.");await this.apiService.Authenticate(this.apiKey),this.apiService.isAuthenticated||this.logErr("Authentication failed! Check apikey and/or expiration.")}}async Init(){try{return this.scanApiKeyFromCurrentScriptTag(),await this.authenticate(),!0}catch(e){return this.log("SprieEmbed Loading failed."),this.logErr(e),this.isLoaded=!1,!1}}}function W3(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Y1={exports:{}},Uc={},q1={exports:{}},Et={};/**
4
4
  * @license React
5
5
  * react.production.min.js
6
6
  *
@@ -16,7 +16,7 @@ var KQ=Object.defineProperty;var JQ=(Wa,us,hs)=>us in Wa?KQ(Wa,us,{enumerable:!0
16
16
  *
17
17
  * This source code is licensed under the MIT license found in the
18
18
  * LICENSE file in the root directory of this source tree.
19
- */var K1;function q3(){if(K1)return Uc;K1=1;var r=Ye,e=Symbol.for("react.element"),t=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,i=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function o(l,h,u){var d,A={},p=null,g=null;u!==void 0&&(p=""+u),h.key!==void 0&&(p=""+h.key),h.ref!==void 0&&(g=h.ref);for(d in h)n.call(h,d)&&!s.hasOwnProperty(d)&&(A[d]=h[d]);if(l&&l.defaultProps)for(d in h=l.defaultProps,h)A[d]===void 0&&(A[d]=h[d]);return{$$typeof:e,type:l,key:p,ref:g,props:A,_owner:i.current}}return Uc.Fragment=t,Uc.jsx=o,Uc.jsxs=o,Uc}Y1.exports=q3();var Se=Y1.exports;const ZQ="";var X3=Object.defineProperty,K3=(r,e,t)=>e in r?X3(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,xt=(r,e,t)=>(K3(r,typeof e!="symbol"?e+"":e,t),t);const J3={storePrefix:{NODE_ENV:"production"}.STORE_PREFIX||"3d-configurator-",host:"https://api.sprie.io"},J1=Object.freeze(J3);class Z3{constructor(e){xt(this,"baseURL"),xt(this,"JWT"),this.baseURL=e.baseURL}setJWT(e){this.JWT=e}RequestOptions(e,t){return{method:e,headers:{Accept:"application/json","Content-Type":"application/json",...this.JWT&&{Authorization:this.JWT}},...e==="POST"&&{body:JSON.stringify(t)}}}async Get(e){return await(await fetch(this.baseURL+e,this.RequestOptions("GET"))).json()}async Post(e,t){return await(await fetch(this.baseURL+e,this.RequestOptions("POST",t||{}))).json()}}const Pc=new Z3({baseURL:J1.host});function $3(r,e){const t=r.findIndex(n=>n.sku===e.sku);return t!==-1?[e,...r.slice(0,t),...r.slice(t+1)]:r}class eS{constructor(){}async AuthServiceApi(e){const t=`/v1/widget/auth?api=${e}`,n=await Pc.Get(t);if(!n.access||!n.orgId)throw new Error("SPRIE key Not Authorised");return n}async FetchAssetBySKUOrBarcode(e){let t="/v1/widget/variants/";if(e.barcode)t+=`${e.barcode}`;else if(e.sku)t+=`${e.sku}`;else throw new Error("Need either sku or barcode.");return t+="?populate-customisation=true",await Pc.Get(t)}async FetchCustomisationList(){const e="/v1/widget/list-customisation?search=type:Lens,usage:customizer&limit=50",t=await Pc.Get(e),n=t.data.find(i=>i.sku==="lens-default");return{...t,data:$3(t.data,n)}}async DownloadMA(e){try{const t=`/v1/widget/org/${e.orgId}/asset/${e.assetsId}/universal-full-encrypted`,n=await Pc.Get(t),i=`org/${e.orgId}/asset/${e.assetsId}`;if(!n)throw new Error("Failed to download model asset.");return{asset:n,decryptionKey:i}}catch{throw new Error("Failed to download model asset.")}}}const Np=new eS;class tS{constructor(e){xt(this,"prefix"),this.prefix=e}makeKey(e){return`${this.prefix}${e}`}getItem(e){return localStorage.getItem(this.makeKey(e))}setItem(e,t){return localStorage.setItem(this.makeKey(e),t)}}const kc=new tS(J1.storePrefix);class rS{constructor(){xt(this,"authPayload"),xt(this,"apiKey"),xt(this,"isAuthenticated"),this.isAuthenticated=!1,this.authPayload={}}async Init(e){try{return this.apiKey=e,await this.authenticate(),this.isAuthenticated=!0,!0}catch(t){return console.log(t),this.isAuthenticated=!1,!1}}scanApiKeyFromCurrentScriptTag(){const e=document.currentScript;if(!e)return;const t=e==null?void 0:e.getAttribute("src");if(!t)return;const n=new URLSearchParams(t.substring(t.indexOf("?")));this.apiKey=(n==null?void 0:n.get("apikey"))||(n==null?void 0:n.get("apiKey")),this.apiKey}async authenticate(){if(this.isAuthenticated)return;if(!this.apiKey)throw new Error("Spire: Unable to authenticate . Need APIKey.");const e=await Np.AuthServiceApi(this.apiKey);this.setAuthConfig({EXPIRES:e.expires,JWT:e.access,ORGID:e.orgId})}setAuthConfig(e){e.JWT&&(kc.setItem("jwtToken",e.JWT),this.authPayload.JWT=e.JWT),e.EXPIRES&&(kc.setItem("expires",e.EXPIRES),this.authPayload.EXPIRES=e.EXPIRES),e.ORGID&&(kc.setItem("orgId",e.ORGID),this.authPayload.ORGID=e.ORGID)}LoadConfig(){const e=kc.getItem("jwtToken");e&&(this.authPayload.JWT=e);const t=kc.getItem("orgId");t&&(this.authPayload.ORGID=t);const n=localStorage.getItem("expires");return n&&(this.authPayload.EXPIRES=n),this.authPayload}}var yt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function nS(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function iS(r){if(r.__esModule)return r;var e=r.default;if(typeof e=="function"){var t=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(r).forEach(function(n){var i=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return r[n]}})}),t}var Up={exports:{}},qo=typeof Reflect=="object"?Reflect:null,Z1=qo&&typeof qo.apply=="function"?qo.apply:function(r,e,t){return Function.prototype.apply.call(r,e,t)},Uh;qo&&typeof qo.ownKeys=="function"?Uh=qo.ownKeys:Object.getOwnPropertySymbols?Uh=function(r){return Object.getOwnPropertyNames(r).concat(Object.getOwnPropertySymbols(r))}:Uh=function(r){return Object.getOwnPropertyNames(r)};function sS(r){console&&console.warn&&console.warn(r)}var $1=Number.isNaN||function(r){return r!==r};function Qt(){Qt.init.call(this)}Up.exports=Qt,Up.exports.once=cS,Qt.EventEmitter=Qt,Qt.prototype._events=void 0,Qt.prototype._eventsCount=0,Qt.prototype._maxListeners=void 0;var ev=10;function Ph(r){if(typeof r!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r)}Object.defineProperty(Qt,"defaultMaxListeners",{enumerable:!0,get:function(){return ev},set:function(r){if(typeof r!="number"||r<0||$1(r))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+r+".");ev=r}}),Qt.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},Qt.prototype.setMaxListeners=function(r){if(typeof r!="number"||r<0||$1(r))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+r+".");return this._maxListeners=r,this};function tv(r){return r._maxListeners===void 0?Qt.defaultMaxListeners:r._maxListeners}Qt.prototype.getMaxListeners=function(){return tv(this)},Qt.prototype.emit=function(r){for(var e=[],t=1;t<arguments.length;t++)e.push(arguments[t]);var n=r==="error",i=this._events;if(i!==void 0)n=n&&i.error===void 0;else if(!n)return!1;if(n){var s;if(e.length>0&&(s=e[0]),s instanceof Error)throw s;var o=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw o.context=s,o}var l=i[r];if(l===void 0)return!1;if(typeof l=="function")Z1(l,this,e);else for(var h=l.length,u=av(l,h),t=0;t<h;++t)Z1(u[t],this,e);return!0};function rv(r,e,t,n){var i,s,o;if(Ph(t),s=r._events,s===void 0?(s=r._events=Object.create(null),r._eventsCount=0):(s.newListener!==void 0&&(r.emit("newListener",e,t.listener?t.listener:t),s=r._events),o=s[e]),o===void 0)o=s[e]=t,++r._eventsCount;else if(typeof o=="function"?o=s[e]=n?[t,o]:[o,t]:n?o.unshift(t):o.push(t),i=tv(r),i>0&&o.length>i&&!o.warned){o.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=r,l.type=e,l.count=o.length,sS(l)}return r}Qt.prototype.addListener=function(r,e){return rv(this,r,e,!1)},Qt.prototype.on=Qt.prototype.addListener,Qt.prototype.prependListener=function(r,e){return rv(this,r,e,!0)};function aS(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function nv(r,e,t){var n={fired:!1,wrapFn:void 0,target:r,type:e,listener:t},i=aS.bind(n);return i.listener=t,n.wrapFn=i,i}Qt.prototype.once=function(r,e){return Ph(e),this.on(r,nv(this,r,e)),this},Qt.prototype.prependOnceListener=function(r,e){return Ph(e),this.prependListener(r,nv(this,r,e)),this},Qt.prototype.removeListener=function(r,e){var t,n,i,s,o;if(Ph(e),n=this._events,n===void 0)return this;if(t=n[r],t===void 0)return this;if(t===e||t.listener===e)--this._eventsCount===0?this._events=Object.create(null):(delete n[r],n.removeListener&&this.emit("removeListener",r,t.listener||e));else if(typeof t!="function"){for(i=-1,s=t.length-1;s>=0;s--)if(t[s]===e||t[s].listener===e){o=t[s].listener,i=s;break}if(i<0)return this;i===0?t.shift():oS(t,i),t.length===1&&(n[r]=t[0]),n.removeListener!==void 0&&this.emit("removeListener",r,o||e)}return this},Qt.prototype.off=Qt.prototype.removeListener,Qt.prototype.removeAllListeners=function(r){var e,t,n;if(t=this._events,t===void 0)return this;if(t.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):t[r]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete t[r]),this;if(arguments.length===0){var i=Object.keys(t),s;for(n=0;n<i.length;++n)s=i[n],s!=="removeListener"&&this.removeAllListeners(s);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(e=t[r],typeof e=="function")this.removeListener(r,e);else if(e!==void 0)for(n=e.length-1;n>=0;n--)this.removeListener(r,e[n]);return this};function iv(r,e,t){var n=r._events;if(n===void 0)return[];var i=n[e];return i===void 0?[]:typeof i=="function"?t?[i.listener||i]:[i]:t?lS(i):av(i,i.length)}Qt.prototype.listeners=function(r){return iv(this,r,!0)},Qt.prototype.rawListeners=function(r){return iv(this,r,!1)},Qt.listenerCount=function(r,e){return typeof r.listenerCount=="function"?r.listenerCount(e):sv.call(r,e)},Qt.prototype.listenerCount=sv;function sv(r){var e=this._events;if(e!==void 0){var t=e[r];if(typeof t=="function")return 1;if(t!==void 0)return t.length}return 0}Qt.prototype.eventNames=function(){return this._eventsCount>0?Uh(this._events):[]};function av(r,e){for(var t=new Array(e),n=0;n<e;++n)t[n]=r[n];return t}function oS(r,e){for(;e+1<r.length;e++)r[e]=r[e+1];r.pop()}function lS(r){for(var e=new Array(r.length),t=0;t<e.length;++t)e[t]=r[t].listener||r[t];return e}function cS(r,e){return new Promise(function(t,n){function i(o){r.removeListener(e,s),n(o)}function s(){typeof r.removeListener=="function"&&r.removeListener("error",i),t([].slice.call(arguments))}ov(r,e,s,{once:!0}),e!=="error"&&uS(r,i,{once:!0})})}function uS(r,e,t){typeof r.on=="function"&&ov(r,"error",e,t)}function ov(r,e,t,n){if(typeof r.on=="function")n.once?r.once(e,t):r.on(e,t);else if(typeof r.addEventListener=="function")r.addEventListener(e,function i(s){n.once&&r.removeEventListener(e,i),t(s)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof r)}var hS=Up.exports;const lv=class W1 extends hS.EventEmitter{emitEvent(e,t){Object.keys(W1.EVENTS).includes(e)&&this.emit(W1.EVENTS[e],t)}};xt(lv,"EVENTS",{onAddToCart:"add-to-cart"});let dS=lv;var cv={exports:{}};function fS(r){throw new Error('Could not dynamically require "'+r+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var uv={exports:{}};const pS={},AS=Object.freeze(Object.defineProperty({__proto__:null,default:pS},Symbol.toStringTag,{value:"Module"})),gS=iS(AS);var hv;function It(){return hv||(hv=1,function(r,e){(function(t,n){r.exports=n()})(yt,function(){var t=t||function(n,i){var s;if(typeof window<"u"&&window.crypto&&(s=window.crypto),typeof self<"u"&&self.crypto&&(s=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(s=globalThis.crypto),!s&&typeof window<"u"&&window.msCrypto&&(s=window.msCrypto),!s&&typeof yt<"u"&&yt.crypto&&(s=yt.crypto),!s&&typeof fS=="function")try{s=gS}catch{}var o=function(){if(s){if(typeof s.getRandomValues=="function")try{return s.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof s.randomBytes=="function")try{return s.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},l=Object.create||function(){function w(){}return function(x){var I;return w.prototype=x,I=new w,w.prototype=null,I}}(),h={},u=h.lib={},d=u.Base=function(){return{extend:function(w){var x=l(this);return w&&x.mixIn(w),(!x.hasOwnProperty("init")||this.init===x.init)&&(x.init=function(){x.$super.init.apply(this,arguments)}),x.init.prototype=x,x.$super=this,x},create:function(){var w=this.extend();return w.init.apply(w,arguments),w},init:function(){},mixIn:function(w){for(var x in w)w.hasOwnProperty(x)&&(this[x]=w[x]);w.hasOwnProperty("toString")&&(this.toString=w.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),A=u.WordArray=d.extend({init:function(w,x){w=this.words=w||[],x!=i?this.sigBytes=x:this.sigBytes=w.length*4},toString:function(w){return(w||g).stringify(this)},concat:function(w){var x=this.words,I=w.words,R=this.sigBytes,S=w.sigBytes;if(this.clamp(),R%4)for(var T=0;T<S;T++){var D=I[T>>>2]>>>24-T%4*8&255;x[R+T>>>2]|=D<<24-(R+T)%4*8}else for(var b=0;b<S;b+=4)x[R+b>>>2]=I[b>>>2];return this.sigBytes+=S,this},clamp:function(){var w=this.words,x=this.sigBytes;w[x>>>2]&=4294967295<<32-x%4*8,w.length=n.ceil(x/4)},clone:function(){var w=d.clone.call(this);return w.words=this.words.slice(0),w},random:function(w){for(var x=[],I=0;I<w;I+=4)x.push(o());return new A.init(x,w)}}),p=h.enc={},g=p.Hex={stringify:function(w){for(var x=w.words,I=w.sigBytes,R=[],S=0;S<I;S++){var T=x[S>>>2]>>>24-S%4*8&255;R.push((T>>>4).toString(16)),R.push((T&15).toString(16))}return R.join("")},parse:function(w){for(var x=w.length,I=[],R=0;R<x;R+=2)I[R>>>3]|=parseInt(w.substr(R,2),16)<<24-R%8*4;return new A.init(I,x/2)}},_=p.Latin1={stringify:function(w){for(var x=w.words,I=w.sigBytes,R=[],S=0;S<I;S++){var T=x[S>>>2]>>>24-S%4*8&255;R.push(String.fromCharCode(T))}return R.join("")},parse:function(w){for(var x=w.length,I=[],R=0;R<x;R++)I[R>>>2]|=(w.charCodeAt(R)&255)<<24-R%4*8;return new A.init(I,x)}},E=p.Utf8={stringify:function(w){try{return decodeURIComponent(escape(_.stringify(w)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(w){return _.parse(unescape(encodeURIComponent(w)))}},m=u.BufferedBlockAlgorithm=d.extend({reset:function(){this._data=new A.init,this._nDataBytes=0},_append:function(w){typeof w=="string"&&(w=E.parse(w)),this._data.concat(w),this._nDataBytes+=w.sigBytes},_process:function(w){var x,I=this._data,R=I.words,S=I.sigBytes,T=this.blockSize,D=T*4,b=S/D;w?b=n.ceil(b):b=n.max((b|0)-this._minBufferSize,0);var M=b*T,L=n.min(M*4,S);if(M){for(var P=0;P<M;P+=T)this._doProcessBlock(R,P);x=R.splice(0,M),I.sigBytes-=L}return new A.init(x,L)},clone:function(){var w=d.clone.call(this);return w._data=this._data.clone(),w},_minBufferSize:0});u.Hasher=m.extend({cfg:d.extend(),init:function(w){this.cfg=this.cfg.extend(w),this.reset()},reset:function(){m.reset.call(this),this._doReset()},update:function(w){return this._append(w),this._process(),this},finalize:function(w){w&&this._append(w);var x=this._doFinalize();return x},blockSize:16,_createHelper:function(w){return function(x,I){return new w.init(I).finalize(x)}},_createHmacHelper:function(w){return function(x,I){return new v.HMAC.init(w,I).finalize(x)}}});var v=h.algo={};return h}(Math);return t})}(uv)),uv.exports}var dv={exports:{}},fv;function kh(){return fv||(fv=1,function(r,e){(function(t,n){r.exports=n(It())})(yt,function(t){return function(n){var i=t,s=i.lib,o=s.Base,l=s.WordArray,h=i.x64={};h.Word=o.extend({init:function(u,d){this.high=u,this.low=d}}),h.WordArray=o.extend({init:function(u,d){u=this.words=u||[],d!=n?this.sigBytes=d:this.sigBytes=u.length*8},toX32:function(){for(var u=this.words,d=u.length,A=[],p=0;p<d;p++){var g=u[p];A.push(g.high),A.push(g.low)}return l.create(A,this.sigBytes)},clone:function(){for(var u=o.clone.call(this),d=u.words=this.words.slice(0),A=d.length,p=0;p<A;p++)d[p]=d[p].clone();return u}})}(),t})}(dv)),dv.exports}var pv={exports:{}},Av;function mS(){return Av||(Av=1,function(r,e){(function(t,n){r.exports=n(It())})(yt,function(t){return function(){if(typeof ArrayBuffer=="function"){var n=t,i=n.lib,s=i.WordArray,o=s.init,l=s.init=function(h){if(h instanceof ArrayBuffer&&(h=new Uint8Array(h)),(h instanceof Int8Array||typeof Uint8ClampedArray<"u"&&h instanceof Uint8ClampedArray||h instanceof Int16Array||h instanceof Uint16Array||h instanceof Int32Array||h instanceof Uint32Array||h instanceof Float32Array||h instanceof Float64Array)&&(h=new Uint8Array(h.buffer,h.byteOffset,h.byteLength)),h instanceof Uint8Array){for(var u=h.byteLength,d=[],A=0;A<u;A++)d[A>>>2]|=h[A]<<24-A%4*8;o.call(this,d,u)}else o.apply(this,arguments)};l.prototype=s}}(),t.lib.WordArray})}(pv)),pv.exports}var gv={exports:{}},mv;function vS(){return mv||(mv=1,function(r,e){(function(t,n){r.exports=n(It())})(yt,function(t){return function(){var n=t,i=n.lib,s=i.WordArray,o=n.enc;o.Utf16=o.Utf16BE={stringify:function(h){for(var u=h.words,d=h.sigBytes,A=[],p=0;p<d;p+=2){var g=u[p>>>2]>>>16-p%4*8&65535;A.push(String.fromCharCode(g))}return A.join("")},parse:function(h){for(var u=h.length,d=[],A=0;A<u;A++)d[A>>>1]|=h.charCodeAt(A)<<16-A%2*16;return s.create(d,u*2)}},o.Utf16LE={stringify:function(h){for(var u=h.words,d=h.sigBytes,A=[],p=0;p<d;p+=2){var g=l(u[p>>>2]>>>16-p%4*8&65535);A.push(String.fromCharCode(g))}return A.join("")},parse:function(h){for(var u=h.length,d=[],A=0;A<u;A++)d[A>>>1]|=l(h.charCodeAt(A)<<16-A%2*16);return s.create(d,u*2)}};function l(h){return h<<8&4278255360|h>>>8&16711935}}(),t.enc.Utf16})}(gv)),gv.exports}var vv={exports:{}},_v;function Ya(){return _v||(_v=1,function(r,e){(function(t,n){r.exports=n(It())})(yt,function(t){return function(){var n=t,i=n.lib,s=i.WordArray,o=n.enc;o.Base64={stringify:function(h){var u=h.words,d=h.sigBytes,A=this._map;h.clamp();for(var p=[],g=0;g<d;g+=3)for(var _=u[g>>>2]>>>24-g%4*8&255,E=u[g+1>>>2]>>>24-(g+1)%4*8&255,m=u[g+2>>>2]>>>24-(g+2)%4*8&255,v=_<<16|E<<8|m,w=0;w<4&&g+w*.75<d;w++)p.push(A.charAt(v>>>6*(3-w)&63));var x=A.charAt(64);if(x)for(;p.length%4;)p.push(x);return p.join("")},parse:function(h){var u=h.length,d=this._map,A=this._reverseMap;if(!A){A=this._reverseMap=[];for(var p=0;p<d.length;p++)A[d.charCodeAt(p)]=p}var g=d.charAt(64);if(g){var _=h.indexOf(g);_!==-1&&(u=_)}return l(h,u,A)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function l(h,u,d){for(var A=[],p=0,g=0;g<u;g++)if(g%4){var _=d[h.charCodeAt(g-1)]<<g%4*2,E=d[h.charCodeAt(g)]>>>6-g%4*2,m=_|E;A[p>>>2]|=m<<24-p%4*8,p++}return s.create(A,p)}}(),t.enc.Base64})}(vv)),vv.exports}var yv={exports:{}},Ev;function _S(){return Ev||(Ev=1,function(r,e){(function(t,n){r.exports=n(It())})(yt,function(t){return function(){var n=t,i=n.lib,s=i.WordArray,o=n.enc;o.Base64url={stringify:function(h,u){u===void 0&&(u=!0);var d=h.words,A=h.sigBytes,p=u?this._safe_map:this._map;h.clamp();for(var g=[],_=0;_<A;_+=3)for(var E=d[_>>>2]>>>24-_%4*8&255,m=d[_+1>>>2]>>>24-(_+1)%4*8&255,v=d[_+2>>>2]>>>24-(_+2)%4*8&255,w=E<<16|m<<8|v,x=0;x<4&&_+x*.75<A;x++)g.push(p.charAt(w>>>6*(3-x)&63));var I=p.charAt(64);if(I)for(;g.length%4;)g.push(I);return g.join("")},parse:function(h,u){u===void 0&&(u=!0);var d=h.length,A=u?this._safe_map:this._map,p=this._reverseMap;if(!p){p=this._reverseMap=[];for(var g=0;g<A.length;g++)p[A.charCodeAt(g)]=g}var _=A.charAt(64);if(_){var E=h.indexOf(_);E!==-1&&(d=E)}return l(h,d,p)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"};function l(h,u,d){for(var A=[],p=0,g=0;g<u;g++)if(g%4){var _=d[h.charCodeAt(g-1)]<<g%4*2,E=d[h.charCodeAt(g)]>>>6-g%4*2,m=_|E;A[p>>>2]|=m<<24-p%4*8,p++}return s.create(A,p)}}(),t.enc.Base64url})}(yv)),yv.exports}var xv={exports:{}},wv;function qa(){return wv||(wv=1,function(r,e){(function(t,n){r.exports=n(It())})(yt,function(t){return function(n){var i=t,s=i.lib,o=s.WordArray,l=s.Hasher,h=i.algo,u=[];(function(){for(var E=0;E<64;E++)u[E]=n.abs(n.sin(E+1))*4294967296|0})();var d=h.MD5=l.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(E,m){for(var v=0;v<16;v++){var w=m+v,x=E[w];E[w]=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360}var I=this._hash.words,R=E[m+0],S=E[m+1],T=E[m+2],D=E[m+3],b=E[m+4],M=E[m+5],L=E[m+6],P=E[m+7],N=E[m+8],W=E[m+9],X=E[m+10],K=E[m+11],te=E[m+12],V=E[m+13],ee=E[m+14],Q=E[m+15],z=I[0],Z=I[1],re=I[2],j=I[3];z=A(z,Z,re,j,R,7,u[0]),j=A(j,z,Z,re,S,12,u[1]),re=A(re,j,z,Z,T,17,u[2]),Z=A(Z,re,j,z,D,22,u[3]),z=A(z,Z,re,j,b,7,u[4]),j=A(j,z,Z,re,M,12,u[5]),re=A(re,j,z,Z,L,17,u[6]),Z=A(Z,re,j,z,P,22,u[7]),z=A(z,Z,re,j,N,7,u[8]),j=A(j,z,Z,re,W,12,u[9]),re=A(re,j,z,Z,X,17,u[10]),Z=A(Z,re,j,z,K,22,u[11]),z=A(z,Z,re,j,te,7,u[12]),j=A(j,z,Z,re,V,12,u[13]),re=A(re,j,z,Z,ee,17,u[14]),Z=A(Z,re,j,z,Q,22,u[15]),z=p(z,Z,re,j,S,5,u[16]),j=p(j,z,Z,re,L,9,u[17]),re=p(re,j,z,Z,K,14,u[18]),Z=p(Z,re,j,z,R,20,u[19]),z=p(z,Z,re,j,M,5,u[20]),j=p(j,z,Z,re,X,9,u[21]),re=p(re,j,z,Z,Q,14,u[22]),Z=p(Z,re,j,z,b,20,u[23]),z=p(z,Z,re,j,W,5,u[24]),j=p(j,z,Z,re,ee,9,u[25]),re=p(re,j,z,Z,D,14,u[26]),Z=p(Z,re,j,z,N,20,u[27]),z=p(z,Z,re,j,V,5,u[28]),j=p(j,z,Z,re,T,9,u[29]),re=p(re,j,z,Z,P,14,u[30]),Z=p(Z,re,j,z,te,20,u[31]),z=g(z,Z,re,j,M,4,u[32]),j=g(j,z,Z,re,N,11,u[33]),re=g(re,j,z,Z,K,16,u[34]),Z=g(Z,re,j,z,ee,23,u[35]),z=g(z,Z,re,j,S,4,u[36]),j=g(j,z,Z,re,b,11,u[37]),re=g(re,j,z,Z,P,16,u[38]),Z=g(Z,re,j,z,X,23,u[39]),z=g(z,Z,re,j,V,4,u[40]),j=g(j,z,Z,re,R,11,u[41]),re=g(re,j,z,Z,D,16,u[42]),Z=g(Z,re,j,z,L,23,u[43]),z=g(z,Z,re,j,W,4,u[44]),j=g(j,z,Z,re,te,11,u[45]),re=g(re,j,z,Z,Q,16,u[46]),Z=g(Z,re,j,z,T,23,u[47]),z=_(z,Z,re,j,R,6,u[48]),j=_(j,z,Z,re,P,10,u[49]),re=_(re,j,z,Z,ee,15,u[50]),Z=_(Z,re,j,z,M,21,u[51]),z=_(z,Z,re,j,te,6,u[52]),j=_(j,z,Z,re,D,10,u[53]),re=_(re,j,z,Z,X,15,u[54]),Z=_(Z,re,j,z,S,21,u[55]),z=_(z,Z,re,j,N,6,u[56]),j=_(j,z,Z,re,Q,10,u[57]),re=_(re,j,z,Z,L,15,u[58]),Z=_(Z,re,j,z,V,21,u[59]),z=_(z,Z,re,j,b,6,u[60]),j=_(j,z,Z,re,K,10,u[61]),re=_(re,j,z,Z,T,15,u[62]),Z=_(Z,re,j,z,W,21,u[63]),I[0]=I[0]+z|0,I[1]=I[1]+Z|0,I[2]=I[2]+re|0,I[3]=I[3]+j|0},_doFinalize:function(){var E=this._data,m=E.words,v=this._nDataBytes*8,w=E.sigBytes*8;m[w>>>5]|=128<<24-w%32;var x=n.floor(v/4294967296),I=v;m[(w+64>>>9<<4)+15]=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360,m[(w+64>>>9<<4)+14]=(I<<8|I>>>24)&16711935|(I<<24|I>>>8)&4278255360,E.sigBytes=(m.length+1)*4,this._process();for(var R=this._hash,S=R.words,T=0;T<4;T++){var D=S[T];S[T]=(D<<8|D>>>24)&16711935|(D<<24|D>>>8)&4278255360}return R},clone:function(){var E=l.clone.call(this);return E._hash=this._hash.clone(),E}});function A(E,m,v,w,x,I,R){var S=E+(m&v|~m&w)+x+R;return(S<<I|S>>>32-I)+m}function p(E,m,v,w,x,I,R){var S=E+(m&w|v&~w)+x+R;return(S<<I|S>>>32-I)+m}function g(E,m,v,w,x,I,R){var S=E+(m^v^w)+x+R;return(S<<I|S>>>32-I)+m}function _(E,m,v,w,x,I,R){var S=E+(v^(m|~w))+x+R;return(S<<I|S>>>32-I)+m}i.MD5=l._createHelper(d),i.HmacMD5=l._createHmacHelper(d)}(Math),t.MD5})}(xv)),xv.exports}var Iv={exports:{}},Cv;function Mv(){return Cv||(Cv=1,function(r,e){(function(t,n){r.exports=n(It())})(yt,function(t){return function(){var n=t,i=n.lib,s=i.WordArray,o=i.Hasher,l=n.algo,h=[],u=l.SHA1=o.extend({_doReset:function(){this._hash=new s.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(d,A){for(var p=this._hash.words,g=p[0],_=p[1],E=p[2],m=p[3],v=p[4],w=0;w<80;w++){if(w<16)h[w]=d[A+w]|0;else{var x=h[w-3]^h[w-8]^h[w-14]^h[w-16];h[w]=x<<1|x>>>31}var I=(g<<5|g>>>27)+v+h[w];w<20?I+=(_&E|~_&m)+1518500249:w<40?I+=(_^E^m)+1859775393:w<60?I+=(_&E|_&m|E&m)-1894007588:I+=(_^E^m)-899497514,v=m,m=E,E=_<<30|_>>>2,_=g,g=I}p[0]=p[0]+g|0,p[1]=p[1]+_|0,p[2]=p[2]+E|0,p[3]=p[3]+m|0,p[4]=p[4]+v|0},_doFinalize:function(){var d=this._data,A=d.words,p=this._nDataBytes*8,g=d.sigBytes*8;return A[g>>>5]|=128<<24-g%32,A[(g+64>>>9<<4)+14]=Math.floor(p/4294967296),A[(g+64>>>9<<4)+15]=p,d.sigBytes=A.length*4,this._process(),this._hash},clone:function(){var d=o.clone.call(this);return d._hash=this._hash.clone(),d}});n.SHA1=o._createHelper(u),n.HmacSHA1=o._createHmacHelper(u)}(),t.SHA1})}(Iv)),Iv.exports}var Sv={exports:{}},Tv;function Pp(){return Tv||(Tv=1,function(r,e){(function(t,n){r.exports=n(It())})(yt,function(t){return function(n){var i=t,s=i.lib,o=s.WordArray,l=s.Hasher,h=i.algo,u=[],d=[];(function(){function g(v){for(var w=n.sqrt(v),x=2;x<=w;x++)if(!(v%x))return!1;return!0}function _(v){return(v-(v|0))*4294967296|0}for(var E=2,m=0;m<64;)g(E)&&(m<8&&(u[m]=_(n.pow(E,1/2))),d[m]=_(n.pow(E,1/3)),m++),E++})();var A=[],p=h.SHA256=l.extend({_doReset:function(){this._hash=new o.init(u.slice(0))},_doProcessBlock:function(g,_){for(var E=this._hash.words,m=E[0],v=E[1],w=E[2],x=E[3],I=E[4],R=E[5],S=E[6],T=E[7],D=0;D<64;D++){if(D<16)A[D]=g[_+D]|0;else{var b=A[D-15],M=(b<<25|b>>>7)^(b<<14|b>>>18)^b>>>3,L=A[D-2],P=(L<<15|L>>>17)^(L<<13|L>>>19)^L>>>10;A[D]=M+A[D-7]+P+A[D-16]}var N=I&R^~I&S,W=m&v^m&w^v&w,X=(m<<30|m>>>2)^(m<<19|m>>>13)^(m<<10|m>>>22),K=(I<<26|I>>>6)^(I<<21|I>>>11)^(I<<7|I>>>25),te=T+K+N+d[D]+A[D],V=X+W;T=S,S=R,R=I,I=x+te|0,x=w,w=v,v=m,m=te+V|0}E[0]=E[0]+m|0,E[1]=E[1]+v|0,E[2]=E[2]+w|0,E[3]=E[3]+x|0,E[4]=E[4]+I|0,E[5]=E[5]+R|0,E[6]=E[6]+S|0,E[7]=E[7]+T|0},_doFinalize:function(){var g=this._data,_=g.words,E=this._nDataBytes*8,m=g.sigBytes*8;return _[m>>>5]|=128<<24-m%32,_[(m+64>>>9<<4)+14]=n.floor(E/4294967296),_[(m+64>>>9<<4)+15]=E,g.sigBytes=_.length*4,this._process(),this._hash},clone:function(){var g=l.clone.call(this);return g._hash=this._hash.clone(),g}});i.SHA256=l._createHelper(p),i.HmacSHA256=l._createHmacHelper(p)}(Math),t.SHA256})}(Sv)),Sv.exports}var Bv={exports:{}},bv;function yS(){return bv||(bv=1,function(r,e){(function(t,n,i){r.exports=n(It(),Pp())})(yt,function(t){return function(){var n=t,i=n.lib,s=i.WordArray,o=n.algo,l=o.SHA256,h=o.SHA224=l.extend({_doReset:function(){this._hash=new s.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var u=l._doFinalize.call(this);return u.sigBytes-=4,u}});n.SHA224=l._createHelper(h),n.HmacSHA224=l._createHmacHelper(h)}(),t.SHA224})}(Bv)),Bv.exports}var Rv={exports:{}},Dv;function Lv(){return Dv||(Dv=1,function(r,e){(function(t,n,i){r.exports=n(It(),kh())})(yt,function(t){return function(){var n=t,i=n.lib,s=i.Hasher,o=n.x64,l=o.Word,h=o.WordArray,u=n.algo;function d(){return l.create.apply(l,arguments)}var A=[d(1116352408,3609767458),d(1899447441,602891725),d(3049323471,3964484399),d(3921009573,2173295548),d(961987163,4081628472),d(1508970993,3053834265),d(2453635748,2937671579),d(2870763221,3664609560),d(3624381080,2734883394),d(310598401,1164996542),d(607225278,1323610764),d(1426881987,3590304994),d(1925078388,4068182383),d(2162078206,991336113),d(2614888103,633803317),d(3248222580,3479774868),d(3835390401,2666613458),d(4022224774,944711139),d(264347078,2341262773),d(604807628,2007800933),d(770255983,1495990901),d(1249150122,1856431235),d(1555081692,3175218132),d(1996064986,2198950837),d(2554220882,3999719339),d(2821834349,766784016),d(2952996808,2566594879),d(3210313671,3203337956),d(3336571891,1034457026),d(3584528711,2466948901),d(113926993,3758326383),d(338241895,168717936),d(666307205,1188179964),d(773529912,1546045734),d(1294757372,1522805485),d(1396182291,2643833823),d(1695183700,2343527390),d(1986661051,1014477480),d(2177026350,1206759142),d(2456956037,344077627),d(2730485921,1290863460),d(2820302411,3158454273),d(3259730800,3505952657),d(3345764771,106217008),d(3516065817,3606008344),d(3600352804,1432725776),d(4094571909,1467031594),d(275423344,851169720),d(430227734,3100823752),d(506948616,1363258195),d(659060556,3750685593),d(883997877,3785050280),d(958139571,3318307427),d(1322822218,3812723403),d(1537002063,2003034995),d(1747873779,3602036899),d(1955562222,1575990012),d(2024104815,1125592928),d(2227730452,2716904306),d(2361852424,442776044),d(2428436474,593698344),d(2756734187,3733110249),d(3204031479,2999351573),d(3329325298,3815920427),d(3391569614,3928383900),d(3515267271,566280711),d(3940187606,3454069534),d(4118630271,4000239992),d(116418474,1914138554),d(174292421,2731055270),d(289380356,3203993006),d(460393269,320620315),d(685471733,587496836),d(852142971,1086792851),d(1017036298,365543100),d(1126000580,2618297676),d(1288033470,3409855158),d(1501505948,4234509866),d(1607167915,987167468),d(1816402316,1246189591)],p=[];(function(){for(var _=0;_<80;_++)p[_]=d()})();var g=u.SHA512=s.extend({_doReset:function(){this._hash=new h.init([new l.init(1779033703,4089235720),new l.init(3144134277,2227873595),new l.init(1013904242,4271175723),new l.init(2773480762,1595750129),new l.init(1359893119,2917565137),new l.init(2600822924,725511199),new l.init(528734635,4215389547),new l.init(1541459225,327033209)])},_doProcessBlock:function(_,E){for(var m=this._hash.words,v=m[0],w=m[1],x=m[2],I=m[3],R=m[4],S=m[5],T=m[6],D=m[7],b=v.high,M=v.low,L=w.high,P=w.low,N=x.high,W=x.low,X=I.high,K=I.low,te=R.high,V=R.low,ee=S.high,Q=S.low,z=T.high,Z=T.low,re=D.high,j=D.low,de=b,Ae=M,_e=L,Ee=P,Le=N,st=W,se=X,et=K,Qe=te,ct=V,Ke=ee,pt=Q,Y=z,k=Z,le=re,pe=j,me=0;me<80;me++){var ye,He,Ie=p[me];if(me<16)He=Ie.high=_[E+me*2]|0,ye=Ie.low=_[E+me*2+1]|0;else{var je=p[me-15],Ge=je.high,Me=je.low,fe=(Ge>>>1|Me<<31)^(Ge>>>8|Me<<24)^Ge>>>7,De=(Me>>>1|Ge<<31)^(Me>>>8|Ge<<24)^(Me>>>7|Ge<<25),Be=p[me-2],be=Be.high,nt=Be.low,lt=(be>>>19|nt<<13)^(be<<3|nt>>>29)^be>>>6,dt=(nt>>>19|be<<13)^(nt<<3|be>>>29)^(nt>>>6|be<<26),ut=p[me-7],ht=ut.high,H=ut.low,O=p[me-16],ge=O.high,ve=O.low;ye=De+H,He=fe+ht+(ye>>>0<De>>>0?1:0),ye=ye+dt,He=He+lt+(ye>>>0<dt>>>0?1:0),ye=ye+ve,He=He+ge+(ye>>>0<ve>>>0?1:0),Ie.high=He,Ie.low=ye}var Fe=Qe&Ke^~Qe&Y,Pe=ct&pt^~ct&k,vt=de&_e^de&Le^_e&Le,Lt=Ae&Ee^Ae&st^Ee&st,Nt=(de>>>28|Ae<<4)^(de<<30|Ae>>>2)^(de<<25|Ae>>>7),Bt=(Ae>>>28|de<<4)^(Ae<<30|de>>>2)^(Ae<<25|de>>>7),_t=(Qe>>>14|ct<<18)^(Qe>>>18|ct<<14)^(Qe<<23|ct>>>9),fr=(ct>>>14|Qe<<18)^(ct>>>18|Qe<<14)^(ct<<23|Qe>>>9),Vt=A[me],Er=Vt.high,Rn=Vt.low,qt=pe+fr,fi=le+_t+(qt>>>0<pe>>>0?1:0),qt=qt+Pe,fi=fi+Fe+(qt>>>0<Pe>>>0?1:0),qt=qt+Rn,fi=fi+Er+(qt>>>0<Rn>>>0?1:0),qt=qt+ye,fi=fi+He+(qt>>>0<ye>>>0?1:0),Zn=Bt+Lt,Ns=Nt+vt+(Zn>>>0<Bt>>>0?1:0);le=Y,pe=k,Y=Ke,k=pt,Ke=Qe,pt=ct,ct=et+qt|0,Qe=se+fi+(ct>>>0<et>>>0?1:0)|0,se=Le,et=st,Le=_e,st=Ee,_e=de,Ee=Ae,Ae=qt+Zn|0,de=fi+Ns+(Ae>>>0<qt>>>0?1:0)|0}M=v.low=M+Ae,v.high=b+de+(M>>>0<Ae>>>0?1:0),P=w.low=P+Ee,w.high=L+_e+(P>>>0<Ee>>>0?1:0),W=x.low=W+st,x.high=N+Le+(W>>>0<st>>>0?1:0),K=I.low=K+et,I.high=X+se+(K>>>0<et>>>0?1:0),V=R.low=V+ct,R.high=te+Qe+(V>>>0<ct>>>0?1:0),Q=S.low=Q+pt,S.high=ee+Ke+(Q>>>0<pt>>>0?1:0),Z=T.low=Z+k,T.high=z+Y+(Z>>>0<k>>>0?1:0),j=D.low=j+pe,D.high=re+le+(j>>>0<pe>>>0?1:0)},_doFinalize:function(){var _=this._data,E=_.words,m=this._nDataBytes*8,v=_.sigBytes*8;E[v>>>5]|=128<<24-v%32,E[(v+128>>>10<<5)+30]=Math.floor(m/4294967296),E[(v+128>>>10<<5)+31]=m,_.sigBytes=E.length*4,this._process();var w=this._hash.toX32();return w},clone:function(){var _=s.clone.call(this);return _._hash=this._hash.clone(),_},blockSize:1024/32});n.SHA512=s._createHelper(g),n.HmacSHA512=s._createHmacHelper(g)}(),t.SHA512})}(Rv)),Rv.exports}var Nv={exports:{}},Uv;function ES(){return Uv||(Uv=1,function(r,e){(function(t,n,i){r.exports=n(It(),kh(),Lv())})(yt,function(t){return function(){var n=t,i=n.x64,s=i.Word,o=i.WordArray,l=n.algo,h=l.SHA512,u=l.SHA384=h.extend({_doReset:function(){this._hash=new o.init([new s.init(3418070365,3238371032),new s.init(1654270250,914150663),new s.init(2438529370,812702999),new s.init(355462360,4144912697),new s.init(1731405415,4290775857),new s.init(2394180231,1750603025),new s.init(3675008525,1694076839),new s.init(1203062813,3204075428)])},_doFinalize:function(){var d=h._doFinalize.call(this);return d.sigBytes-=16,d}});n.SHA384=h._createHelper(u),n.HmacSHA384=h._createHmacHelper(u)}(),t.SHA384})}(Nv)),Nv.exports}var Pv={exports:{}},kv;function xS(){return kv||(kv=1,function(r,e){(function(t,n,i){r.exports=n(It(),kh())})(yt,function(t){return function(n){var i=t,s=i.lib,o=s.WordArray,l=s.Hasher,h=i.x64,u=h.Word,d=i.algo,A=[],p=[],g=[];(function(){for(var m=1,v=0,w=0;w<24;w++){A[m+5*v]=(w+1)*(w+2)/2%64;var x=v%5,I=(2*m+3*v)%5;m=x,v=I}for(var m=0;m<5;m++)for(var v=0;v<5;v++)p[m+5*v]=v+(2*m+3*v)%5*5;for(var R=1,S=0;S<24;S++){for(var T=0,D=0,b=0;b<7;b++){if(R&1){var M=(1<<b)-1;M<32?D^=1<<M:T^=1<<M-32}R&128?R=R<<1^113:R<<=1}g[S]=u.create(T,D)}})();var _=[];(function(){for(var m=0;m<25;m++)_[m]=u.create()})();var E=d.SHA3=l.extend({cfg:l.cfg.extend({outputLength:512}),_doReset:function(){for(var m=this._state=[],v=0;v<25;v++)m[v]=new u.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(m,v){for(var w=this._state,x=this.blockSize/2,I=0;I<x;I++){var R=m[v+2*I],S=m[v+2*I+1];R=(R<<8|R>>>24)&16711935|(R<<24|R>>>8)&4278255360,S=(S<<8|S>>>24)&16711935|(S<<24|S>>>8)&4278255360;var T=w[I];T.high^=S,T.low^=R}for(var D=0;D<24;D++){for(var b=0;b<5;b++){for(var M=0,L=0,P=0;P<5;P++){var T=w[b+5*P];M^=T.high,L^=T.low}var N=_[b];N.high=M,N.low=L}for(var b=0;b<5;b++)for(var W=_[(b+4)%5],X=_[(b+1)%5],K=X.high,te=X.low,M=W.high^(K<<1|te>>>31),L=W.low^(te<<1|K>>>31),P=0;P<5;P++){var T=w[b+5*P];T.high^=M,T.low^=L}for(var V=1;V<25;V++){var M,L,T=w[V],ee=T.high,Q=T.low,z=A[V];z<32?(M=ee<<z|Q>>>32-z,L=Q<<z|ee>>>32-z):(M=Q<<z-32|ee>>>64-z,L=ee<<z-32|Q>>>64-z);var Z=_[p[V]];Z.high=M,Z.low=L}var re=_[0],j=w[0];re.high=j.high,re.low=j.low;for(var b=0;b<5;b++)for(var P=0;P<5;P++){var V=b+5*P,T=w[V],de=_[V],Ae=_[(b+1)%5+5*P],_e=_[(b+2)%5+5*P];T.high=de.high^~Ae.high&_e.high,T.low=de.low^~Ae.low&_e.low}var T=w[0],Ee=g[D];T.high^=Ee.high,T.low^=Ee.low}},_doFinalize:function(){var m=this._data,v=m.words;this._nDataBytes*8;var w=m.sigBytes*8,x=this.blockSize*32;v[w>>>5]|=1<<24-w%32,v[(n.ceil((w+1)/x)*x>>>5)-1]|=128,m.sigBytes=v.length*4,this._process();for(var I=this._state,R=this.cfg.outputLength/8,S=R/8,T=[],D=0;D<S;D++){var b=I[D],M=b.high,L=b.low;M=(M<<8|M>>>24)&16711935|(M<<24|M>>>8)&4278255360,L=(L<<8|L>>>24)&16711935|(L<<24|L>>>8)&4278255360,T.push(L),T.push(M)}return new o.init(T,R)},clone:function(){for(var m=l.clone.call(this),v=m._state=this._state.slice(0),w=0;w<25;w++)v[w]=v[w].clone();return m}});i.SHA3=l._createHelper(E),i.HmacSHA3=l._createHmacHelper(E)}(Math),t.SHA3})}(Pv)),Pv.exports}var Qv={exports:{}},Ov;function wS(){return Ov||(Ov=1,function(r,e){(function(t,n){r.exports=n(It())})(yt,function(t){/** @preserve
19
+ */var K1;function q3(){if(K1)return Uc;K1=1;var r=Ye,e=Symbol.for("react.element"),t=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,i=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function o(l,h,u){var d,A={},p=null,g=null;u!==void 0&&(p=""+u),h.key!==void 0&&(p=""+h.key),h.ref!==void 0&&(g=h.ref);for(d in h)n.call(h,d)&&!s.hasOwnProperty(d)&&(A[d]=h[d]);if(l&&l.defaultProps)for(d in h=l.defaultProps,h)A[d]===void 0&&(A[d]=h[d]);return{$$typeof:e,type:l,key:p,ref:g,props:A,_owner:i.current}}return Uc.Fragment=t,Uc.jsx=o,Uc.jsxs=o,Uc}Y1.exports=q3();var Se=Y1.exports;const ZQ="";var X3=Object.defineProperty,K3=(r,e,t)=>e in r?X3(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,xt=(r,e,t)=>(K3(r,typeof e!="symbol"?e+"":e,t),t);const J3={storePrefix:{NODE_ENV:"production"}.STORE_PREFIX||"3d-configurator-",host:"https://api.sprie.io"},J1=Object.freeze(J3);class Z3{constructor(e){xt(this,"baseURL"),xt(this,"JWT"),this.baseURL=e.baseURL}setJWT(e){this.JWT=e}RequestOptions(e,t){return{method:e,headers:{Accept:"application/json","Content-Type":"application/json",...this.JWT&&{Authorization:this.JWT}},...e==="POST"&&{body:JSON.stringify(t)}}}async Get(e){return await(await fetch(this.baseURL+e,this.RequestOptions("GET"))).json()}async Post(e,t){return await(await fetch(this.baseURL+e,this.RequestOptions("POST",t||{}))).json()}}const Pc=new Z3({baseURL:J1.host});function $3(r,e){const t=r.findIndex(n=>n.sku===e.sku);return t!==-1?[e,...r.slice(0,t),...r.slice(t+1)]:r}class eS{constructor(){}async AuthServiceApi(e){const t=`/v1/widget/auth?api=${e}`,n=await Pc.Get(t);if(!n.access||!n.orgId)throw new Error("SPRIE key Not Authorised");return n}async FetchAssetBySKUOrBarcode(e){let t="/v1/widget/variants/";if(e.barcode)t+=`${e.barcode}`;else if(e.sku)t+=`${e.sku}`;else throw new Error("Need either sku or barcode.");return t+="?populate-customisation=true",await Pc.Get(t)}async FetchCustomisationList(){const e="/v1/widget/list-customisation?search=type:Lens,usage:customizer&limit=50",t=await Pc.Get(e),n=t.data.find(i=>i.sku==="lens-default");return{...t,data:$3(t.data,n)}}async DownloadMA(e){try{const t=`/v1/widget/org/${e.orgId}/asset/${e.assetsId}/universal-full-encrypted`,n=await Pc.Get(t),i=`org/${e.orgId}/asset/${e.assetsId}`;if(!n)throw new Error("Failed to download model asset.");return{asset:n,decryptionKey:i}}catch{throw new Error("Failed to download model asset.")}}}const Lp=new eS;class tS{constructor(e){xt(this,"prefix"),this.prefix=e}makeKey(e){return`${this.prefix}${e}`}getItem(e){return localStorage.getItem(this.makeKey(e))}setItem(e,t){return localStorage.setItem(this.makeKey(e),t)}}const kc=new tS(J1.storePrefix);class rS{constructor(){xt(this,"authPayload"),xt(this,"apiKey"),xt(this,"isAuthenticated"),this.isAuthenticated=!1,this.authPayload={}}async Init(e){try{return this.apiKey=e,await this.authenticate(),this.isAuthenticated=!0,!0}catch(t){return console.log(t),this.isAuthenticated=!1,!1}}scanApiKeyFromCurrentScriptTag(){const e=document.currentScript;if(!e)return;const t=e==null?void 0:e.getAttribute("src");if(!t)return;const n=new URLSearchParams(t.substring(t.indexOf("?")));this.apiKey=(n==null?void 0:n.get("apikey"))||(n==null?void 0:n.get("apiKey")),this.apiKey}async authenticate(){if(this.isAuthenticated)return;if(!this.apiKey)throw new Error("Spire: Unable to authenticate . Need APIKey.");const e=await Lp.AuthServiceApi(this.apiKey);this.setAuthConfig({EXPIRES:e.expires,JWT:e.access,ORGID:e.orgId})}setAuthConfig(e){e.JWT&&(kc.setItem("jwtToken",e.JWT),this.authPayload.JWT=e.JWT),e.EXPIRES&&(kc.setItem("expires",e.EXPIRES),this.authPayload.EXPIRES=e.EXPIRES),e.ORGID&&(kc.setItem("orgId",e.ORGID),this.authPayload.ORGID=e.ORGID)}LoadConfig(){const e=kc.getItem("jwtToken");e&&(this.authPayload.JWT=e);const t=kc.getItem("orgId");t&&(this.authPayload.ORGID=t);const n=localStorage.getItem("expires");return n&&(this.authPayload.EXPIRES=n),this.authPayload}}var yt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function nS(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function iS(r){if(r.__esModule)return r;var e=r.default;if(typeof e=="function"){var t=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(r).forEach(function(n){var i=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return r[n]}})}),t}var Np={exports:{}},qo=typeof Reflect=="object"?Reflect:null,Z1=qo&&typeof qo.apply=="function"?qo.apply:function(r,e,t){return Function.prototype.apply.call(r,e,t)},Uh;qo&&typeof qo.ownKeys=="function"?Uh=qo.ownKeys:Object.getOwnPropertySymbols?Uh=function(r){return Object.getOwnPropertyNames(r).concat(Object.getOwnPropertySymbols(r))}:Uh=function(r){return Object.getOwnPropertyNames(r)};function sS(r){console&&console.warn&&console.warn(r)}var $1=Number.isNaN||function(r){return r!==r};function Qt(){Qt.init.call(this)}Np.exports=Qt,Np.exports.once=cS,Qt.EventEmitter=Qt,Qt.prototype._events=void 0,Qt.prototype._eventsCount=0,Qt.prototype._maxListeners=void 0;var ev=10;function Ph(r){if(typeof r!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r)}Object.defineProperty(Qt,"defaultMaxListeners",{enumerable:!0,get:function(){return ev},set:function(r){if(typeof r!="number"||r<0||$1(r))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+r+".");ev=r}}),Qt.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},Qt.prototype.setMaxListeners=function(r){if(typeof r!="number"||r<0||$1(r))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+r+".");return this._maxListeners=r,this};function tv(r){return r._maxListeners===void 0?Qt.defaultMaxListeners:r._maxListeners}Qt.prototype.getMaxListeners=function(){return tv(this)},Qt.prototype.emit=function(r){for(var e=[],t=1;t<arguments.length;t++)e.push(arguments[t]);var n=r==="error",i=this._events;if(i!==void 0)n=n&&i.error===void 0;else if(!n)return!1;if(n){var s;if(e.length>0&&(s=e[0]),s instanceof Error)throw s;var o=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw o.context=s,o}var l=i[r];if(l===void 0)return!1;if(typeof l=="function")Z1(l,this,e);else for(var h=l.length,u=av(l,h),t=0;t<h;++t)Z1(u[t],this,e);return!0};function rv(r,e,t,n){var i,s,o;if(Ph(t),s=r._events,s===void 0?(s=r._events=Object.create(null),r._eventsCount=0):(s.newListener!==void 0&&(r.emit("newListener",e,t.listener?t.listener:t),s=r._events),o=s[e]),o===void 0)o=s[e]=t,++r._eventsCount;else if(typeof o=="function"?o=s[e]=n?[t,o]:[o,t]:n?o.unshift(t):o.push(t),i=tv(r),i>0&&o.length>i&&!o.warned){o.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=r,l.type=e,l.count=o.length,sS(l)}return r}Qt.prototype.addListener=function(r,e){return rv(this,r,e,!1)},Qt.prototype.on=Qt.prototype.addListener,Qt.prototype.prependListener=function(r,e){return rv(this,r,e,!0)};function aS(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function nv(r,e,t){var n={fired:!1,wrapFn:void 0,target:r,type:e,listener:t},i=aS.bind(n);return i.listener=t,n.wrapFn=i,i}Qt.prototype.once=function(r,e){return Ph(e),this.on(r,nv(this,r,e)),this},Qt.prototype.prependOnceListener=function(r,e){return Ph(e),this.prependListener(r,nv(this,r,e)),this},Qt.prototype.removeListener=function(r,e){var t,n,i,s,o;if(Ph(e),n=this._events,n===void 0)return this;if(t=n[r],t===void 0)return this;if(t===e||t.listener===e)--this._eventsCount===0?this._events=Object.create(null):(delete n[r],n.removeListener&&this.emit("removeListener",r,t.listener||e));else if(typeof t!="function"){for(i=-1,s=t.length-1;s>=0;s--)if(t[s]===e||t[s].listener===e){o=t[s].listener,i=s;break}if(i<0)return this;i===0?t.shift():oS(t,i),t.length===1&&(n[r]=t[0]),n.removeListener!==void 0&&this.emit("removeListener",r,o||e)}return this},Qt.prototype.off=Qt.prototype.removeListener,Qt.prototype.removeAllListeners=function(r){var e,t,n;if(t=this._events,t===void 0)return this;if(t.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):t[r]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete t[r]),this;if(arguments.length===0){var i=Object.keys(t),s;for(n=0;n<i.length;++n)s=i[n],s!=="removeListener"&&this.removeAllListeners(s);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(e=t[r],typeof e=="function")this.removeListener(r,e);else if(e!==void 0)for(n=e.length-1;n>=0;n--)this.removeListener(r,e[n]);return this};function iv(r,e,t){var n=r._events;if(n===void 0)return[];var i=n[e];return i===void 0?[]:typeof i=="function"?t?[i.listener||i]:[i]:t?lS(i):av(i,i.length)}Qt.prototype.listeners=function(r){return iv(this,r,!0)},Qt.prototype.rawListeners=function(r){return iv(this,r,!1)},Qt.listenerCount=function(r,e){return typeof r.listenerCount=="function"?r.listenerCount(e):sv.call(r,e)},Qt.prototype.listenerCount=sv;function sv(r){var e=this._events;if(e!==void 0){var t=e[r];if(typeof t=="function")return 1;if(t!==void 0)return t.length}return 0}Qt.prototype.eventNames=function(){return this._eventsCount>0?Uh(this._events):[]};function av(r,e){for(var t=new Array(e),n=0;n<e;++n)t[n]=r[n];return t}function oS(r,e){for(;e+1<r.length;e++)r[e]=r[e+1];r.pop()}function lS(r){for(var e=new Array(r.length),t=0;t<e.length;++t)e[t]=r[t].listener||r[t];return e}function cS(r,e){return new Promise(function(t,n){function i(o){r.removeListener(e,s),n(o)}function s(){typeof r.removeListener=="function"&&r.removeListener("error",i),t([].slice.call(arguments))}ov(r,e,s,{once:!0}),e!=="error"&&uS(r,i,{once:!0})})}function uS(r,e,t){typeof r.on=="function"&&ov(r,"error",e,t)}function ov(r,e,t,n){if(typeof r.on=="function")n.once?r.once(e,t):r.on(e,t);else if(typeof r.addEventListener=="function")r.addEventListener(e,function i(s){n.once&&r.removeEventListener(e,i),t(s)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof r)}var hS=Np.exports;const lv=class W1 extends hS.EventEmitter{emitEvent(e,t){Object.keys(W1.EVENTS).includes(e)&&this.emit(W1.EVENTS[e],t)}};xt(lv,"EVENTS",{onAddToCart:"add-to-cart"});let dS=lv;var cv={exports:{}};function fS(r){throw new Error('Could not dynamically require "'+r+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var uv={exports:{}};const pS={},AS=Object.freeze(Object.defineProperty({__proto__:null,default:pS},Symbol.toStringTag,{value:"Module"})),gS=iS(AS);var hv;function It(){return hv||(hv=1,function(r,e){(function(t,n){r.exports=n()})(yt,function(){var t=t||function(n,i){var s;if(typeof window<"u"&&window.crypto&&(s=window.crypto),typeof self<"u"&&self.crypto&&(s=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(s=globalThis.crypto),!s&&typeof window<"u"&&window.msCrypto&&(s=window.msCrypto),!s&&typeof yt<"u"&&yt.crypto&&(s=yt.crypto),!s&&typeof fS=="function")try{s=gS}catch{}var o=function(){if(s){if(typeof s.getRandomValues=="function")try{return s.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof s.randomBytes=="function")try{return s.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},l=Object.create||function(){function w(){}return function(x){var I;return w.prototype=x,I=new w,w.prototype=null,I}}(),h={},u=h.lib={},d=u.Base=function(){return{extend:function(w){var x=l(this);return w&&x.mixIn(w),(!x.hasOwnProperty("init")||this.init===x.init)&&(x.init=function(){x.$super.init.apply(this,arguments)}),x.init.prototype=x,x.$super=this,x},create:function(){var w=this.extend();return w.init.apply(w,arguments),w},init:function(){},mixIn:function(w){for(var x in w)w.hasOwnProperty(x)&&(this[x]=w[x]);w.hasOwnProperty("toString")&&(this.toString=w.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),A=u.WordArray=d.extend({init:function(w,x){w=this.words=w||[],x!=i?this.sigBytes=x:this.sigBytes=w.length*4},toString:function(w){return(w||g).stringify(this)},concat:function(w){var x=this.words,I=w.words,R=this.sigBytes,S=w.sigBytes;if(this.clamp(),R%4)for(var T=0;T<S;T++){var D=I[T>>>2]>>>24-T%4*8&255;x[R+T>>>2]|=D<<24-(R+T)%4*8}else for(var b=0;b<S;b+=4)x[R+b>>>2]=I[b>>>2];return this.sigBytes+=S,this},clamp:function(){var w=this.words,x=this.sigBytes;w[x>>>2]&=4294967295<<32-x%4*8,w.length=n.ceil(x/4)},clone:function(){var w=d.clone.call(this);return w.words=this.words.slice(0),w},random:function(w){for(var x=[],I=0;I<w;I+=4)x.push(o());return new A.init(x,w)}}),p=h.enc={},g=p.Hex={stringify:function(w){for(var x=w.words,I=w.sigBytes,R=[],S=0;S<I;S++){var T=x[S>>>2]>>>24-S%4*8&255;R.push((T>>>4).toString(16)),R.push((T&15).toString(16))}return R.join("")},parse:function(w){for(var x=w.length,I=[],R=0;R<x;R+=2)I[R>>>3]|=parseInt(w.substr(R,2),16)<<24-R%8*4;return new A.init(I,x/2)}},_=p.Latin1={stringify:function(w){for(var x=w.words,I=w.sigBytes,R=[],S=0;S<I;S++){var T=x[S>>>2]>>>24-S%4*8&255;R.push(String.fromCharCode(T))}return R.join("")},parse:function(w){for(var x=w.length,I=[],R=0;R<x;R++)I[R>>>2]|=(w.charCodeAt(R)&255)<<24-R%4*8;return new A.init(I,x)}},E=p.Utf8={stringify:function(w){try{return decodeURIComponent(escape(_.stringify(w)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(w){return _.parse(unescape(encodeURIComponent(w)))}},m=u.BufferedBlockAlgorithm=d.extend({reset:function(){this._data=new A.init,this._nDataBytes=0},_append:function(w){typeof w=="string"&&(w=E.parse(w)),this._data.concat(w),this._nDataBytes+=w.sigBytes},_process:function(w){var x,I=this._data,R=I.words,S=I.sigBytes,T=this.blockSize,D=T*4,b=S/D;w?b=n.ceil(b):b=n.max((b|0)-this._minBufferSize,0);var M=b*T,L=n.min(M*4,S);if(M){for(var P=0;P<M;P+=T)this._doProcessBlock(R,P);x=R.splice(0,M),I.sigBytes-=L}return new A.init(x,L)},clone:function(){var w=d.clone.call(this);return w._data=this._data.clone(),w},_minBufferSize:0});u.Hasher=m.extend({cfg:d.extend(),init:function(w){this.cfg=this.cfg.extend(w),this.reset()},reset:function(){m.reset.call(this),this._doReset()},update:function(w){return this._append(w),this._process(),this},finalize:function(w){w&&this._append(w);var x=this._doFinalize();return x},blockSize:16,_createHelper:function(w){return function(x,I){return new w.init(I).finalize(x)}},_createHmacHelper:function(w){return function(x,I){return new v.HMAC.init(w,I).finalize(x)}}});var v=h.algo={};return h}(Math);return t})}(uv)),uv.exports}var dv={exports:{}},fv;function kh(){return fv||(fv=1,function(r,e){(function(t,n){r.exports=n(It())})(yt,function(t){return function(n){var i=t,s=i.lib,o=s.Base,l=s.WordArray,h=i.x64={};h.Word=o.extend({init:function(u,d){this.high=u,this.low=d}}),h.WordArray=o.extend({init:function(u,d){u=this.words=u||[],d!=n?this.sigBytes=d:this.sigBytes=u.length*8},toX32:function(){for(var u=this.words,d=u.length,A=[],p=0;p<d;p++){var g=u[p];A.push(g.high),A.push(g.low)}return l.create(A,this.sigBytes)},clone:function(){for(var u=o.clone.call(this),d=u.words=this.words.slice(0),A=d.length,p=0;p<A;p++)d[p]=d[p].clone();return u}})}(),t})}(dv)),dv.exports}var pv={exports:{}},Av;function mS(){return Av||(Av=1,function(r,e){(function(t,n){r.exports=n(It())})(yt,function(t){return function(){if(typeof ArrayBuffer=="function"){var n=t,i=n.lib,s=i.WordArray,o=s.init,l=s.init=function(h){if(h instanceof ArrayBuffer&&(h=new Uint8Array(h)),(h instanceof Int8Array||typeof Uint8ClampedArray<"u"&&h instanceof Uint8ClampedArray||h instanceof Int16Array||h instanceof Uint16Array||h instanceof Int32Array||h instanceof Uint32Array||h instanceof Float32Array||h instanceof Float64Array)&&(h=new Uint8Array(h.buffer,h.byteOffset,h.byteLength)),h instanceof Uint8Array){for(var u=h.byteLength,d=[],A=0;A<u;A++)d[A>>>2]|=h[A]<<24-A%4*8;o.call(this,d,u)}else o.apply(this,arguments)};l.prototype=s}}(),t.lib.WordArray})}(pv)),pv.exports}var gv={exports:{}},mv;function vS(){return mv||(mv=1,function(r,e){(function(t,n){r.exports=n(It())})(yt,function(t){return function(){var n=t,i=n.lib,s=i.WordArray,o=n.enc;o.Utf16=o.Utf16BE={stringify:function(h){for(var u=h.words,d=h.sigBytes,A=[],p=0;p<d;p+=2){var g=u[p>>>2]>>>16-p%4*8&65535;A.push(String.fromCharCode(g))}return A.join("")},parse:function(h){for(var u=h.length,d=[],A=0;A<u;A++)d[A>>>1]|=h.charCodeAt(A)<<16-A%2*16;return s.create(d,u*2)}},o.Utf16LE={stringify:function(h){for(var u=h.words,d=h.sigBytes,A=[],p=0;p<d;p+=2){var g=l(u[p>>>2]>>>16-p%4*8&65535);A.push(String.fromCharCode(g))}return A.join("")},parse:function(h){for(var u=h.length,d=[],A=0;A<u;A++)d[A>>>1]|=l(h.charCodeAt(A)<<16-A%2*16);return s.create(d,u*2)}};function l(h){return h<<8&4278255360|h>>>8&16711935}}(),t.enc.Utf16})}(gv)),gv.exports}var vv={exports:{}},_v;function Ya(){return _v||(_v=1,function(r,e){(function(t,n){r.exports=n(It())})(yt,function(t){return function(){var n=t,i=n.lib,s=i.WordArray,o=n.enc;o.Base64={stringify:function(h){var u=h.words,d=h.sigBytes,A=this._map;h.clamp();for(var p=[],g=0;g<d;g+=3)for(var _=u[g>>>2]>>>24-g%4*8&255,E=u[g+1>>>2]>>>24-(g+1)%4*8&255,m=u[g+2>>>2]>>>24-(g+2)%4*8&255,v=_<<16|E<<8|m,w=0;w<4&&g+w*.75<d;w++)p.push(A.charAt(v>>>6*(3-w)&63));var x=A.charAt(64);if(x)for(;p.length%4;)p.push(x);return p.join("")},parse:function(h){var u=h.length,d=this._map,A=this._reverseMap;if(!A){A=this._reverseMap=[];for(var p=0;p<d.length;p++)A[d.charCodeAt(p)]=p}var g=d.charAt(64);if(g){var _=h.indexOf(g);_!==-1&&(u=_)}return l(h,u,A)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function l(h,u,d){for(var A=[],p=0,g=0;g<u;g++)if(g%4){var _=d[h.charCodeAt(g-1)]<<g%4*2,E=d[h.charCodeAt(g)]>>>6-g%4*2,m=_|E;A[p>>>2]|=m<<24-p%4*8,p++}return s.create(A,p)}}(),t.enc.Base64})}(vv)),vv.exports}var yv={exports:{}},Ev;function _S(){return Ev||(Ev=1,function(r,e){(function(t,n){r.exports=n(It())})(yt,function(t){return function(){var n=t,i=n.lib,s=i.WordArray,o=n.enc;o.Base64url={stringify:function(h,u){u===void 0&&(u=!0);var d=h.words,A=h.sigBytes,p=u?this._safe_map:this._map;h.clamp();for(var g=[],_=0;_<A;_+=3)for(var E=d[_>>>2]>>>24-_%4*8&255,m=d[_+1>>>2]>>>24-(_+1)%4*8&255,v=d[_+2>>>2]>>>24-(_+2)%4*8&255,w=E<<16|m<<8|v,x=0;x<4&&_+x*.75<A;x++)g.push(p.charAt(w>>>6*(3-x)&63));var I=p.charAt(64);if(I)for(;g.length%4;)g.push(I);return g.join("")},parse:function(h,u){u===void 0&&(u=!0);var d=h.length,A=u?this._safe_map:this._map,p=this._reverseMap;if(!p){p=this._reverseMap=[];for(var g=0;g<A.length;g++)p[A.charCodeAt(g)]=g}var _=A.charAt(64);if(_){var E=h.indexOf(_);E!==-1&&(d=E)}return l(h,d,p)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"};function l(h,u,d){for(var A=[],p=0,g=0;g<u;g++)if(g%4){var _=d[h.charCodeAt(g-1)]<<g%4*2,E=d[h.charCodeAt(g)]>>>6-g%4*2,m=_|E;A[p>>>2]|=m<<24-p%4*8,p++}return s.create(A,p)}}(),t.enc.Base64url})}(yv)),yv.exports}var xv={exports:{}},wv;function qa(){return wv||(wv=1,function(r,e){(function(t,n){r.exports=n(It())})(yt,function(t){return function(n){var i=t,s=i.lib,o=s.WordArray,l=s.Hasher,h=i.algo,u=[];(function(){for(var E=0;E<64;E++)u[E]=n.abs(n.sin(E+1))*4294967296|0})();var d=h.MD5=l.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(E,m){for(var v=0;v<16;v++){var w=m+v,x=E[w];E[w]=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360}var I=this._hash.words,R=E[m+0],S=E[m+1],T=E[m+2],D=E[m+3],b=E[m+4],M=E[m+5],L=E[m+6],P=E[m+7],N=E[m+8],W=E[m+9],X=E[m+10],K=E[m+11],te=E[m+12],V=E[m+13],ee=E[m+14],Q=E[m+15],z=I[0],Z=I[1],re=I[2],j=I[3];z=A(z,Z,re,j,R,7,u[0]),j=A(j,z,Z,re,S,12,u[1]),re=A(re,j,z,Z,T,17,u[2]),Z=A(Z,re,j,z,D,22,u[3]),z=A(z,Z,re,j,b,7,u[4]),j=A(j,z,Z,re,M,12,u[5]),re=A(re,j,z,Z,L,17,u[6]),Z=A(Z,re,j,z,P,22,u[7]),z=A(z,Z,re,j,N,7,u[8]),j=A(j,z,Z,re,W,12,u[9]),re=A(re,j,z,Z,X,17,u[10]),Z=A(Z,re,j,z,K,22,u[11]),z=A(z,Z,re,j,te,7,u[12]),j=A(j,z,Z,re,V,12,u[13]),re=A(re,j,z,Z,ee,17,u[14]),Z=A(Z,re,j,z,Q,22,u[15]),z=p(z,Z,re,j,S,5,u[16]),j=p(j,z,Z,re,L,9,u[17]),re=p(re,j,z,Z,K,14,u[18]),Z=p(Z,re,j,z,R,20,u[19]),z=p(z,Z,re,j,M,5,u[20]),j=p(j,z,Z,re,X,9,u[21]),re=p(re,j,z,Z,Q,14,u[22]),Z=p(Z,re,j,z,b,20,u[23]),z=p(z,Z,re,j,W,5,u[24]),j=p(j,z,Z,re,ee,9,u[25]),re=p(re,j,z,Z,D,14,u[26]),Z=p(Z,re,j,z,N,20,u[27]),z=p(z,Z,re,j,V,5,u[28]),j=p(j,z,Z,re,T,9,u[29]),re=p(re,j,z,Z,P,14,u[30]),Z=p(Z,re,j,z,te,20,u[31]),z=g(z,Z,re,j,M,4,u[32]),j=g(j,z,Z,re,N,11,u[33]),re=g(re,j,z,Z,K,16,u[34]),Z=g(Z,re,j,z,ee,23,u[35]),z=g(z,Z,re,j,S,4,u[36]),j=g(j,z,Z,re,b,11,u[37]),re=g(re,j,z,Z,P,16,u[38]),Z=g(Z,re,j,z,X,23,u[39]),z=g(z,Z,re,j,V,4,u[40]),j=g(j,z,Z,re,R,11,u[41]),re=g(re,j,z,Z,D,16,u[42]),Z=g(Z,re,j,z,L,23,u[43]),z=g(z,Z,re,j,W,4,u[44]),j=g(j,z,Z,re,te,11,u[45]),re=g(re,j,z,Z,Q,16,u[46]),Z=g(Z,re,j,z,T,23,u[47]),z=_(z,Z,re,j,R,6,u[48]),j=_(j,z,Z,re,P,10,u[49]),re=_(re,j,z,Z,ee,15,u[50]),Z=_(Z,re,j,z,M,21,u[51]),z=_(z,Z,re,j,te,6,u[52]),j=_(j,z,Z,re,D,10,u[53]),re=_(re,j,z,Z,X,15,u[54]),Z=_(Z,re,j,z,S,21,u[55]),z=_(z,Z,re,j,N,6,u[56]),j=_(j,z,Z,re,Q,10,u[57]),re=_(re,j,z,Z,L,15,u[58]),Z=_(Z,re,j,z,V,21,u[59]),z=_(z,Z,re,j,b,6,u[60]),j=_(j,z,Z,re,K,10,u[61]),re=_(re,j,z,Z,T,15,u[62]),Z=_(Z,re,j,z,W,21,u[63]),I[0]=I[0]+z|0,I[1]=I[1]+Z|0,I[2]=I[2]+re|0,I[3]=I[3]+j|0},_doFinalize:function(){var E=this._data,m=E.words,v=this._nDataBytes*8,w=E.sigBytes*8;m[w>>>5]|=128<<24-w%32;var x=n.floor(v/4294967296),I=v;m[(w+64>>>9<<4)+15]=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360,m[(w+64>>>9<<4)+14]=(I<<8|I>>>24)&16711935|(I<<24|I>>>8)&4278255360,E.sigBytes=(m.length+1)*4,this._process();for(var R=this._hash,S=R.words,T=0;T<4;T++){var D=S[T];S[T]=(D<<8|D>>>24)&16711935|(D<<24|D>>>8)&4278255360}return R},clone:function(){var E=l.clone.call(this);return E._hash=this._hash.clone(),E}});function A(E,m,v,w,x,I,R){var S=E+(m&v|~m&w)+x+R;return(S<<I|S>>>32-I)+m}function p(E,m,v,w,x,I,R){var S=E+(m&w|v&~w)+x+R;return(S<<I|S>>>32-I)+m}function g(E,m,v,w,x,I,R){var S=E+(m^v^w)+x+R;return(S<<I|S>>>32-I)+m}function _(E,m,v,w,x,I,R){var S=E+(v^(m|~w))+x+R;return(S<<I|S>>>32-I)+m}i.MD5=l._createHelper(d),i.HmacMD5=l._createHmacHelper(d)}(Math),t.MD5})}(xv)),xv.exports}var Iv={exports:{}},Cv;function Mv(){return Cv||(Cv=1,function(r,e){(function(t,n){r.exports=n(It())})(yt,function(t){return function(){var n=t,i=n.lib,s=i.WordArray,o=i.Hasher,l=n.algo,h=[],u=l.SHA1=o.extend({_doReset:function(){this._hash=new s.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(d,A){for(var p=this._hash.words,g=p[0],_=p[1],E=p[2],m=p[3],v=p[4],w=0;w<80;w++){if(w<16)h[w]=d[A+w]|0;else{var x=h[w-3]^h[w-8]^h[w-14]^h[w-16];h[w]=x<<1|x>>>31}var I=(g<<5|g>>>27)+v+h[w];w<20?I+=(_&E|~_&m)+1518500249:w<40?I+=(_^E^m)+1859775393:w<60?I+=(_&E|_&m|E&m)-1894007588:I+=(_^E^m)-899497514,v=m,m=E,E=_<<30|_>>>2,_=g,g=I}p[0]=p[0]+g|0,p[1]=p[1]+_|0,p[2]=p[2]+E|0,p[3]=p[3]+m|0,p[4]=p[4]+v|0},_doFinalize:function(){var d=this._data,A=d.words,p=this._nDataBytes*8,g=d.sigBytes*8;return A[g>>>5]|=128<<24-g%32,A[(g+64>>>9<<4)+14]=Math.floor(p/4294967296),A[(g+64>>>9<<4)+15]=p,d.sigBytes=A.length*4,this._process(),this._hash},clone:function(){var d=o.clone.call(this);return d._hash=this._hash.clone(),d}});n.SHA1=o._createHelper(u),n.HmacSHA1=o._createHmacHelper(u)}(),t.SHA1})}(Iv)),Iv.exports}var Sv={exports:{}},Tv;function Up(){return Tv||(Tv=1,function(r,e){(function(t,n){r.exports=n(It())})(yt,function(t){return function(n){var i=t,s=i.lib,o=s.WordArray,l=s.Hasher,h=i.algo,u=[],d=[];(function(){function g(v){for(var w=n.sqrt(v),x=2;x<=w;x++)if(!(v%x))return!1;return!0}function _(v){return(v-(v|0))*4294967296|0}for(var E=2,m=0;m<64;)g(E)&&(m<8&&(u[m]=_(n.pow(E,1/2))),d[m]=_(n.pow(E,1/3)),m++),E++})();var A=[],p=h.SHA256=l.extend({_doReset:function(){this._hash=new o.init(u.slice(0))},_doProcessBlock:function(g,_){for(var E=this._hash.words,m=E[0],v=E[1],w=E[2],x=E[3],I=E[4],R=E[5],S=E[6],T=E[7],D=0;D<64;D++){if(D<16)A[D]=g[_+D]|0;else{var b=A[D-15],M=(b<<25|b>>>7)^(b<<14|b>>>18)^b>>>3,L=A[D-2],P=(L<<15|L>>>17)^(L<<13|L>>>19)^L>>>10;A[D]=M+A[D-7]+P+A[D-16]}var N=I&R^~I&S,W=m&v^m&w^v&w,X=(m<<30|m>>>2)^(m<<19|m>>>13)^(m<<10|m>>>22),K=(I<<26|I>>>6)^(I<<21|I>>>11)^(I<<7|I>>>25),te=T+K+N+d[D]+A[D],V=X+W;T=S,S=R,R=I,I=x+te|0,x=w,w=v,v=m,m=te+V|0}E[0]=E[0]+m|0,E[1]=E[1]+v|0,E[2]=E[2]+w|0,E[3]=E[3]+x|0,E[4]=E[4]+I|0,E[5]=E[5]+R|0,E[6]=E[6]+S|0,E[7]=E[7]+T|0},_doFinalize:function(){var g=this._data,_=g.words,E=this._nDataBytes*8,m=g.sigBytes*8;return _[m>>>5]|=128<<24-m%32,_[(m+64>>>9<<4)+14]=n.floor(E/4294967296),_[(m+64>>>9<<4)+15]=E,g.sigBytes=_.length*4,this._process(),this._hash},clone:function(){var g=l.clone.call(this);return g._hash=this._hash.clone(),g}});i.SHA256=l._createHelper(p),i.HmacSHA256=l._createHmacHelper(p)}(Math),t.SHA256})}(Sv)),Sv.exports}var Bv={exports:{}},bv;function yS(){return bv||(bv=1,function(r,e){(function(t,n,i){r.exports=n(It(),Up())})(yt,function(t){return function(){var n=t,i=n.lib,s=i.WordArray,o=n.algo,l=o.SHA256,h=o.SHA224=l.extend({_doReset:function(){this._hash=new s.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var u=l._doFinalize.call(this);return u.sigBytes-=4,u}});n.SHA224=l._createHelper(h),n.HmacSHA224=l._createHmacHelper(h)}(),t.SHA224})}(Bv)),Bv.exports}var Rv={exports:{}},Dv;function Lv(){return Dv||(Dv=1,function(r,e){(function(t,n,i){r.exports=n(It(),kh())})(yt,function(t){return function(){var n=t,i=n.lib,s=i.Hasher,o=n.x64,l=o.Word,h=o.WordArray,u=n.algo;function d(){return l.create.apply(l,arguments)}var A=[d(1116352408,3609767458),d(1899447441,602891725),d(3049323471,3964484399),d(3921009573,2173295548),d(961987163,4081628472),d(1508970993,3053834265),d(2453635748,2937671579),d(2870763221,3664609560),d(3624381080,2734883394),d(310598401,1164996542),d(607225278,1323610764),d(1426881987,3590304994),d(1925078388,4068182383),d(2162078206,991336113),d(2614888103,633803317),d(3248222580,3479774868),d(3835390401,2666613458),d(4022224774,944711139),d(264347078,2341262773),d(604807628,2007800933),d(770255983,1495990901),d(1249150122,1856431235),d(1555081692,3175218132),d(1996064986,2198950837),d(2554220882,3999719339),d(2821834349,766784016),d(2952996808,2566594879),d(3210313671,3203337956),d(3336571891,1034457026),d(3584528711,2466948901),d(113926993,3758326383),d(338241895,168717936),d(666307205,1188179964),d(773529912,1546045734),d(1294757372,1522805485),d(1396182291,2643833823),d(1695183700,2343527390),d(1986661051,1014477480),d(2177026350,1206759142),d(2456956037,344077627),d(2730485921,1290863460),d(2820302411,3158454273),d(3259730800,3505952657),d(3345764771,106217008),d(3516065817,3606008344),d(3600352804,1432725776),d(4094571909,1467031594),d(275423344,851169720),d(430227734,3100823752),d(506948616,1363258195),d(659060556,3750685593),d(883997877,3785050280),d(958139571,3318307427),d(1322822218,3812723403),d(1537002063,2003034995),d(1747873779,3602036899),d(1955562222,1575990012),d(2024104815,1125592928),d(2227730452,2716904306),d(2361852424,442776044),d(2428436474,593698344),d(2756734187,3733110249),d(3204031479,2999351573),d(3329325298,3815920427),d(3391569614,3928383900),d(3515267271,566280711),d(3940187606,3454069534),d(4118630271,4000239992),d(116418474,1914138554),d(174292421,2731055270),d(289380356,3203993006),d(460393269,320620315),d(685471733,587496836),d(852142971,1086792851),d(1017036298,365543100),d(1126000580,2618297676),d(1288033470,3409855158),d(1501505948,4234509866),d(1607167915,987167468),d(1816402316,1246189591)],p=[];(function(){for(var _=0;_<80;_++)p[_]=d()})();var g=u.SHA512=s.extend({_doReset:function(){this._hash=new h.init([new l.init(1779033703,4089235720),new l.init(3144134277,2227873595),new l.init(1013904242,4271175723),new l.init(2773480762,1595750129),new l.init(1359893119,2917565137),new l.init(2600822924,725511199),new l.init(528734635,4215389547),new l.init(1541459225,327033209)])},_doProcessBlock:function(_,E){for(var m=this._hash.words,v=m[0],w=m[1],x=m[2],I=m[3],R=m[4],S=m[5],T=m[6],D=m[7],b=v.high,M=v.low,L=w.high,P=w.low,N=x.high,W=x.low,X=I.high,K=I.low,te=R.high,V=R.low,ee=S.high,Q=S.low,z=T.high,Z=T.low,re=D.high,j=D.low,de=b,Ae=M,_e=L,Ee=P,Le=N,st=W,se=X,et=K,Qe=te,ct=V,Ke=ee,pt=Q,Y=z,k=Z,le=re,pe=j,me=0;me<80;me++){var ye,He,Ie=p[me];if(me<16)He=Ie.high=_[E+me*2]|0,ye=Ie.low=_[E+me*2+1]|0;else{var je=p[me-15],Ge=je.high,Me=je.low,fe=(Ge>>>1|Me<<31)^(Ge>>>8|Me<<24)^Ge>>>7,De=(Me>>>1|Ge<<31)^(Me>>>8|Ge<<24)^(Me>>>7|Ge<<25),Be=p[me-2],be=Be.high,nt=Be.low,lt=(be>>>19|nt<<13)^(be<<3|nt>>>29)^be>>>6,dt=(nt>>>19|be<<13)^(nt<<3|be>>>29)^(nt>>>6|be<<26),ut=p[me-7],ht=ut.high,H=ut.low,O=p[me-16],ge=O.high,ve=O.low;ye=De+H,He=fe+ht+(ye>>>0<De>>>0?1:0),ye=ye+dt,He=He+lt+(ye>>>0<dt>>>0?1:0),ye=ye+ve,He=He+ge+(ye>>>0<ve>>>0?1:0),Ie.high=He,Ie.low=ye}var Fe=Qe&Ke^~Qe&Y,Pe=ct&pt^~ct&k,vt=de&_e^de&Le^_e&Le,Lt=Ae&Ee^Ae&st^Ee&st,Nt=(de>>>28|Ae<<4)^(de<<30|Ae>>>2)^(de<<25|Ae>>>7),Bt=(Ae>>>28|de<<4)^(Ae<<30|de>>>2)^(Ae<<25|de>>>7),_t=(Qe>>>14|ct<<18)^(Qe>>>18|ct<<14)^(Qe<<23|ct>>>9),fr=(ct>>>14|Qe<<18)^(ct>>>18|Qe<<14)^(ct<<23|Qe>>>9),Vt=A[me],Er=Vt.high,Rn=Vt.low,qt=pe+fr,fi=le+_t+(qt>>>0<pe>>>0?1:0),qt=qt+Pe,fi=fi+Fe+(qt>>>0<Pe>>>0?1:0),qt=qt+Rn,fi=fi+Er+(qt>>>0<Rn>>>0?1:0),qt=qt+ye,fi=fi+He+(qt>>>0<ye>>>0?1:0),Zn=Bt+Lt,Ns=Nt+vt+(Zn>>>0<Bt>>>0?1:0);le=Y,pe=k,Y=Ke,k=pt,Ke=Qe,pt=ct,ct=et+qt|0,Qe=se+fi+(ct>>>0<et>>>0?1:0)|0,se=Le,et=st,Le=_e,st=Ee,_e=de,Ee=Ae,Ae=qt+Zn|0,de=fi+Ns+(Ae>>>0<qt>>>0?1:0)|0}M=v.low=M+Ae,v.high=b+de+(M>>>0<Ae>>>0?1:0),P=w.low=P+Ee,w.high=L+_e+(P>>>0<Ee>>>0?1:0),W=x.low=W+st,x.high=N+Le+(W>>>0<st>>>0?1:0),K=I.low=K+et,I.high=X+se+(K>>>0<et>>>0?1:0),V=R.low=V+ct,R.high=te+Qe+(V>>>0<ct>>>0?1:0),Q=S.low=Q+pt,S.high=ee+Ke+(Q>>>0<pt>>>0?1:0),Z=T.low=Z+k,T.high=z+Y+(Z>>>0<k>>>0?1:0),j=D.low=j+pe,D.high=re+le+(j>>>0<pe>>>0?1:0)},_doFinalize:function(){var _=this._data,E=_.words,m=this._nDataBytes*8,v=_.sigBytes*8;E[v>>>5]|=128<<24-v%32,E[(v+128>>>10<<5)+30]=Math.floor(m/4294967296),E[(v+128>>>10<<5)+31]=m,_.sigBytes=E.length*4,this._process();var w=this._hash.toX32();return w},clone:function(){var _=s.clone.call(this);return _._hash=this._hash.clone(),_},blockSize:1024/32});n.SHA512=s._createHelper(g),n.HmacSHA512=s._createHmacHelper(g)}(),t.SHA512})}(Rv)),Rv.exports}var Nv={exports:{}},Uv;function ES(){return Uv||(Uv=1,function(r,e){(function(t,n,i){r.exports=n(It(),kh(),Lv())})(yt,function(t){return function(){var n=t,i=n.x64,s=i.Word,o=i.WordArray,l=n.algo,h=l.SHA512,u=l.SHA384=h.extend({_doReset:function(){this._hash=new o.init([new s.init(3418070365,3238371032),new s.init(1654270250,914150663),new s.init(2438529370,812702999),new s.init(355462360,4144912697),new s.init(1731405415,4290775857),new s.init(2394180231,1750603025),new s.init(3675008525,1694076839),new s.init(1203062813,3204075428)])},_doFinalize:function(){var d=h._doFinalize.call(this);return d.sigBytes-=16,d}});n.SHA384=h._createHelper(u),n.HmacSHA384=h._createHmacHelper(u)}(),t.SHA384})}(Nv)),Nv.exports}var Pv={exports:{}},kv;function xS(){return kv||(kv=1,function(r,e){(function(t,n,i){r.exports=n(It(),kh())})(yt,function(t){return function(n){var i=t,s=i.lib,o=s.WordArray,l=s.Hasher,h=i.x64,u=h.Word,d=i.algo,A=[],p=[],g=[];(function(){for(var m=1,v=0,w=0;w<24;w++){A[m+5*v]=(w+1)*(w+2)/2%64;var x=v%5,I=(2*m+3*v)%5;m=x,v=I}for(var m=0;m<5;m++)for(var v=0;v<5;v++)p[m+5*v]=v+(2*m+3*v)%5*5;for(var R=1,S=0;S<24;S++){for(var T=0,D=0,b=0;b<7;b++){if(R&1){var M=(1<<b)-1;M<32?D^=1<<M:T^=1<<M-32}R&128?R=R<<1^113:R<<=1}g[S]=u.create(T,D)}})();var _=[];(function(){for(var m=0;m<25;m++)_[m]=u.create()})();var E=d.SHA3=l.extend({cfg:l.cfg.extend({outputLength:512}),_doReset:function(){for(var m=this._state=[],v=0;v<25;v++)m[v]=new u.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(m,v){for(var w=this._state,x=this.blockSize/2,I=0;I<x;I++){var R=m[v+2*I],S=m[v+2*I+1];R=(R<<8|R>>>24)&16711935|(R<<24|R>>>8)&4278255360,S=(S<<8|S>>>24)&16711935|(S<<24|S>>>8)&4278255360;var T=w[I];T.high^=S,T.low^=R}for(var D=0;D<24;D++){for(var b=0;b<5;b++){for(var M=0,L=0,P=0;P<5;P++){var T=w[b+5*P];M^=T.high,L^=T.low}var N=_[b];N.high=M,N.low=L}for(var b=0;b<5;b++)for(var W=_[(b+4)%5],X=_[(b+1)%5],K=X.high,te=X.low,M=W.high^(K<<1|te>>>31),L=W.low^(te<<1|K>>>31),P=0;P<5;P++){var T=w[b+5*P];T.high^=M,T.low^=L}for(var V=1;V<25;V++){var M,L,T=w[V],ee=T.high,Q=T.low,z=A[V];z<32?(M=ee<<z|Q>>>32-z,L=Q<<z|ee>>>32-z):(M=Q<<z-32|ee>>>64-z,L=ee<<z-32|Q>>>64-z);var Z=_[p[V]];Z.high=M,Z.low=L}var re=_[0],j=w[0];re.high=j.high,re.low=j.low;for(var b=0;b<5;b++)for(var P=0;P<5;P++){var V=b+5*P,T=w[V],de=_[V],Ae=_[(b+1)%5+5*P],_e=_[(b+2)%5+5*P];T.high=de.high^~Ae.high&_e.high,T.low=de.low^~Ae.low&_e.low}var T=w[0],Ee=g[D];T.high^=Ee.high,T.low^=Ee.low}},_doFinalize:function(){var m=this._data,v=m.words;this._nDataBytes*8;var w=m.sigBytes*8,x=this.blockSize*32;v[w>>>5]|=1<<24-w%32,v[(n.ceil((w+1)/x)*x>>>5)-1]|=128,m.sigBytes=v.length*4,this._process();for(var I=this._state,R=this.cfg.outputLength/8,S=R/8,T=[],D=0;D<S;D++){var b=I[D],M=b.high,L=b.low;M=(M<<8|M>>>24)&16711935|(M<<24|M>>>8)&4278255360,L=(L<<8|L>>>24)&16711935|(L<<24|L>>>8)&4278255360,T.push(L),T.push(M)}return new o.init(T,R)},clone:function(){for(var m=l.clone.call(this),v=m._state=this._state.slice(0),w=0;w<25;w++)v[w]=v[w].clone();return m}});i.SHA3=l._createHelper(E),i.HmacSHA3=l._createHmacHelper(E)}(Math),t.SHA3})}(Pv)),Pv.exports}var Qv={exports:{}},Ov;function wS(){return Ov||(Ov=1,function(r,e){(function(t,n){r.exports=n(It())})(yt,function(t){/** @preserve
20
20
  (c) 2012 by Cédric Mesnil. All rights reserved.
21
21
 
22
22
  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
@@ -25,15 +25,15 @@ var KQ=Object.defineProperty;var JQ=(Wa,us,hs)=>us in Wa?KQ(Wa,us,{enumerable:!0
25
25
  - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
26
26
 
27
27
  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
- */return function(n){var i=t,s=i.lib,o=s.WordArray,l=s.Hasher,h=i.algo,u=o.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),d=o.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),A=o.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),p=o.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),g=o.create([0,1518500249,1859775393,2400959708,2840853838]),_=o.create([1352829926,1548603684,1836072691,2053994217,0]),E=h.RIPEMD160=l.extend({_doReset:function(){this._hash=o.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(S,T){for(var D=0;D<16;D++){var b=T+D,M=S[b];S[b]=(M<<8|M>>>24)&16711935|(M<<24|M>>>8)&4278255360}var L=this._hash.words,P=g.words,N=_.words,W=u.words,X=d.words,K=A.words,te=p.words,V,ee,Q,z,Z,re,j,de,Ae,_e;re=V=L[0],j=ee=L[1],de=Q=L[2],Ae=z=L[3],_e=Z=L[4];for(var Ee,D=0;D<80;D+=1)Ee=V+S[T+W[D]]|0,D<16?Ee+=m(ee,Q,z)+P[0]:D<32?Ee+=v(ee,Q,z)+P[1]:D<48?Ee+=w(ee,Q,z)+P[2]:D<64?Ee+=x(ee,Q,z)+P[3]:Ee+=I(ee,Q,z)+P[4],Ee=Ee|0,Ee=R(Ee,K[D]),Ee=Ee+Z|0,V=Z,Z=z,z=R(Q,10),Q=ee,ee=Ee,Ee=re+S[T+X[D]]|0,D<16?Ee+=I(j,de,Ae)+N[0]:D<32?Ee+=x(j,de,Ae)+N[1]:D<48?Ee+=w(j,de,Ae)+N[2]:D<64?Ee+=v(j,de,Ae)+N[3]:Ee+=m(j,de,Ae)+N[4],Ee=Ee|0,Ee=R(Ee,te[D]),Ee=Ee+_e|0,re=_e,_e=Ae,Ae=R(de,10),de=j,j=Ee;Ee=L[1]+Q+Ae|0,L[1]=L[2]+z+_e|0,L[2]=L[3]+Z+re|0,L[3]=L[4]+V+j|0,L[4]=L[0]+ee+de|0,L[0]=Ee},_doFinalize:function(){var S=this._data,T=S.words,D=this._nDataBytes*8,b=S.sigBytes*8;T[b>>>5]|=128<<24-b%32,T[(b+64>>>9<<4)+14]=(D<<8|D>>>24)&16711935|(D<<24|D>>>8)&4278255360,S.sigBytes=(T.length+1)*4,this._process();for(var M=this._hash,L=M.words,P=0;P<5;P++){var N=L[P];L[P]=(N<<8|N>>>24)&16711935|(N<<24|N>>>8)&4278255360}return M},clone:function(){var S=l.clone.call(this);return S._hash=this._hash.clone(),S}});function m(S,T,D){return S^T^D}function v(S,T,D){return S&T|~S&D}function w(S,T,D){return(S|~T)^D}function x(S,T,D){return S&D|T&~D}function I(S,T,D){return S^(T|~D)}function R(S,T){return S<<T|S>>>32-T}i.RIPEMD160=l._createHelper(E),i.HmacRIPEMD160=l._createHmacHelper(E)}(),t.RIPEMD160})}(Qv)),Qv.exports}var Fv={exports:{}},zv;function kp(){return zv||(zv=1,function(r,e){(function(t,n){r.exports=n(It())})(yt,function(t){(function(){var n=t,i=n.lib,s=i.Base,o=n.enc,l=o.Utf8,h=n.algo;h.HMAC=s.extend({init:function(u,d){u=this._hasher=new u.init,typeof d=="string"&&(d=l.parse(d));var A=u.blockSize,p=A*4;d.sigBytes>p&&(d=u.finalize(d)),d.clamp();for(var g=this._oKey=d.clone(),_=this._iKey=d.clone(),E=g.words,m=_.words,v=0;v<A;v++)E[v]^=1549556828,m[v]^=909522486;g.sigBytes=_.sigBytes=p,this.reset()},reset:function(){var u=this._hasher;u.reset(),u.update(this._iKey)},update:function(u){return this._hasher.update(u),this},finalize:function(u){var d=this._hasher,A=d.finalize(u);d.reset();var p=d.finalize(this._oKey.clone().concat(A));return p}})})()})}(Fv)),Fv.exports}var Hv={exports:{}},Gv;function IS(){return Gv||(Gv=1,function(r,e){(function(t,n,i){r.exports=n(It(),Pp(),kp())})(yt,function(t){return function(){var n=t,i=n.lib,s=i.Base,o=i.WordArray,l=n.algo,h=l.SHA256,u=l.HMAC,d=l.PBKDF2=s.extend({cfg:s.extend({keySize:128/32,hasher:h,iterations:25e4}),init:function(A){this.cfg=this.cfg.extend(A)},compute:function(A,p){for(var g=this.cfg,_=u.create(g.hasher,A),E=o.create(),m=o.create([1]),v=E.words,w=m.words,x=g.keySize,I=g.iterations;v.length<x;){var R=_.update(p).finalize(m);_.reset();for(var S=R.words,T=S.length,D=R,b=1;b<I;b++){D=_.finalize(D),_.reset();for(var M=D.words,L=0;L<T;L++)S[L]^=M[L]}E.concat(R),w[0]++}return E.sigBytes=x*4,E}});n.PBKDF2=function(A,p,g){return d.create(g).compute(A,p)}}(),t.PBKDF2})}(Hv)),Hv.exports}var Vv={exports:{}},jv;function Ws(){return jv||(jv=1,function(r,e){(function(t,n,i){r.exports=n(It(),Mv(),kp())})(yt,function(t){return function(){var n=t,i=n.lib,s=i.Base,o=i.WordArray,l=n.algo,h=l.MD5,u=l.EvpKDF=s.extend({cfg:s.extend({keySize:128/32,hasher:h,iterations:1}),init:function(d){this.cfg=this.cfg.extend(d)},compute:function(d,A){for(var p,g=this.cfg,_=g.hasher.create(),E=o.create(),m=E.words,v=g.keySize,w=g.iterations;m.length<v;){p&&_.update(p),p=_.update(d).finalize(A),_.reset();for(var x=1;x<w;x++)p=_.finalize(p),_.reset();E.concat(p)}return E.sigBytes=v*4,E}});n.EvpKDF=function(d,A,p){return u.create(p).compute(d,A)}}(),t.EvpKDF})}(Vv)),Vv.exports}var Wv={exports:{}},Yv;function Pr(){return Yv||(Yv=1,function(r,e){(function(t,n,i){r.exports=n(It(),Ws())})(yt,function(t){t.lib.Cipher||function(n){var i=t,s=i.lib,o=s.Base,l=s.WordArray,h=s.BufferedBlockAlgorithm,u=i.enc;u.Utf8;var d=u.Base64,A=i.algo,p=A.EvpKDF,g=s.Cipher=h.extend({cfg:o.extend(),createEncryptor:function(M,L){return this.create(this._ENC_XFORM_MODE,M,L)},createDecryptor:function(M,L){return this.create(this._DEC_XFORM_MODE,M,L)},init:function(M,L,P){this.cfg=this.cfg.extend(P),this._xformMode=M,this._key=L,this.reset()},reset:function(){h.reset.call(this),this._doReset()},process:function(M){return this._append(M),this._process()},finalize:function(M){M&&this._append(M);var L=this._doFinalize();return L},keySize:128/32,ivSize:128/32,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function M(L){return typeof L=="string"?b:S}return function(L){return{encrypt:function(P,N,W){return M(N).encrypt(L,P,N,W)},decrypt:function(P,N,W){return M(N).decrypt(L,P,N,W)}}}}()});s.StreamCipher=g.extend({_doFinalize:function(){var M=this._process(!0);return M},blockSize:1});var _=i.mode={},E=s.BlockCipherMode=o.extend({createEncryptor:function(M,L){return this.Encryptor.create(M,L)},createDecryptor:function(M,L){return this.Decryptor.create(M,L)},init:function(M,L){this._cipher=M,this._iv=L}}),m=_.CBC=function(){var M=E.extend();M.Encryptor=M.extend({processBlock:function(P,N){var W=this._cipher,X=W.blockSize;L.call(this,P,N,X),W.encryptBlock(P,N),this._prevBlock=P.slice(N,N+X)}}),M.Decryptor=M.extend({processBlock:function(P,N){var W=this._cipher,X=W.blockSize,K=P.slice(N,N+X);W.decryptBlock(P,N),L.call(this,P,N,X),this._prevBlock=K}});function L(P,N,W){var X,K=this._iv;K?(X=K,this._iv=n):X=this._prevBlock;for(var te=0;te<W;te++)P[N+te]^=X[te]}return M}(),v=i.pad={},w=v.Pkcs7={pad:function(M,L){for(var P=L*4,N=P-M.sigBytes%P,W=N<<24|N<<16|N<<8|N,X=[],K=0;K<N;K+=4)X.push(W);var te=l.create(X,N);M.concat(te)},unpad:function(M){var L=M.words[M.sigBytes-1>>>2]&255;M.sigBytes-=L}};s.BlockCipher=g.extend({cfg:g.cfg.extend({mode:m,padding:w}),reset:function(){var M;g.reset.call(this);var L=this.cfg,P=L.iv,N=L.mode;this._xformMode==this._ENC_XFORM_MODE?M=N.createEncryptor:(M=N.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==M?this._mode.init(this,P&&P.words):(this._mode=M.call(N,this,P&&P.words),this._mode.__creator=M)},_doProcessBlock:function(M,L){this._mode.processBlock(M,L)},_doFinalize:function(){var M,L=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(L.pad(this._data,this.blockSize),M=this._process(!0)):(M=this._process(!0),L.unpad(M)),M},blockSize:128/32});var x=s.CipherParams=o.extend({init:function(M){this.mixIn(M)},toString:function(M){return(M||this.formatter).stringify(this)}}),I=i.format={},R=I.OpenSSL={stringify:function(M){var L,P=M.ciphertext,N=M.salt;return N?L=l.create([1398893684,1701076831]).concat(N).concat(P):L=P,L.toString(d)},parse:function(M){var L,P=d.parse(M),N=P.words;return N[0]==1398893684&&N[1]==1701076831&&(L=l.create(N.slice(2,4)),N.splice(0,4),P.sigBytes-=16),x.create({ciphertext:P,salt:L})}},S=s.SerializableCipher=o.extend({cfg:o.extend({format:R}),encrypt:function(M,L,P,N){N=this.cfg.extend(N);var W=M.createEncryptor(P,N),X=W.finalize(L),K=W.cfg;return x.create({ciphertext:X,key:P,iv:K.iv,algorithm:M,mode:K.mode,padding:K.padding,blockSize:M.blockSize,formatter:N.format})},decrypt:function(M,L,P,N){N=this.cfg.extend(N),L=this._parse(L,N.format);var W=M.createDecryptor(P,N).finalize(L.ciphertext);return W},_parse:function(M,L){return typeof M=="string"?L.parse(M,this):M}}),T=i.kdf={},D=T.OpenSSL={execute:function(M,L,P,N,W){if(N||(N=l.random(64/8)),W)var X=p.create({keySize:L+P,hasher:W}).compute(M,N);else var X=p.create({keySize:L+P}).compute(M,N);var K=l.create(X.words.slice(L),P*4);return X.sigBytes=L*4,x.create({key:X,iv:K,salt:N})}},b=s.PasswordBasedCipher=S.extend({cfg:S.cfg.extend({kdf:D}),encrypt:function(M,L,P,N){N=this.cfg.extend(N);var W=N.kdf.execute(P,M.keySize,M.ivSize,N.salt,N.hasher);N.iv=W.iv;var X=S.encrypt.call(this,M,L,W.key,N);return X.mixIn(W),X},decrypt:function(M,L,P,N){N=this.cfg.extend(N),L=this._parse(L,N.format);var W=N.kdf.execute(P,M.keySize,M.ivSize,L.salt,N.hasher);N.iv=W.iv;var X=S.decrypt.call(this,M,L,W.key,N);return X}})}()})}(Wv)),Wv.exports}var qv={exports:{}},Xv;function CS(){return Xv||(Xv=1,function(r,e){(function(t,n,i){r.exports=n(It(),Pr())})(yt,function(t){return t.mode.CFB=function(){var n=t.lib.BlockCipherMode.extend();n.Encryptor=n.extend({processBlock:function(s,o){var l=this._cipher,h=l.blockSize;i.call(this,s,o,h,l),this._prevBlock=s.slice(o,o+h)}}),n.Decryptor=n.extend({processBlock:function(s,o){var l=this._cipher,h=l.blockSize,u=s.slice(o,o+h);i.call(this,s,o,h,l),this._prevBlock=u}});function i(s,o,l,h){var u,d=this._iv;d?(u=d.slice(0),this._iv=void 0):u=this._prevBlock,h.encryptBlock(u,0);for(var A=0;A<l;A++)s[o+A]^=u[A]}return n}(),t.mode.CFB})}(qv)),qv.exports}var Kv={exports:{}},Jv;function MS(){return Jv||(Jv=1,function(r,e){(function(t,n,i){r.exports=n(It(),Pr())})(yt,function(t){return t.mode.CTR=function(){var n=t.lib.BlockCipherMode.extend(),i=n.Encryptor=n.extend({processBlock:function(s,o){var l=this._cipher,h=l.blockSize,u=this._iv,d=this._counter;u&&(d=this._counter=u.slice(0),this._iv=void 0);var A=d.slice(0);l.encryptBlock(A,0),d[h-1]=d[h-1]+1|0;for(var p=0;p<h;p++)s[o+p]^=A[p]}});return n.Decryptor=i,n}(),t.mode.CTR})}(Kv)),Kv.exports}var Zv={exports:{}},$v;function SS(){return $v||($v=1,function(r,e){(function(t,n,i){r.exports=n(It(),Pr())})(yt,function(t){/** @preserve
28
+ */return function(n){var i=t,s=i.lib,o=s.WordArray,l=s.Hasher,h=i.algo,u=o.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),d=o.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),A=o.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),p=o.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),g=o.create([0,1518500249,1859775393,2400959708,2840853838]),_=o.create([1352829926,1548603684,1836072691,2053994217,0]),E=h.RIPEMD160=l.extend({_doReset:function(){this._hash=o.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(S,T){for(var D=0;D<16;D++){var b=T+D,M=S[b];S[b]=(M<<8|M>>>24)&16711935|(M<<24|M>>>8)&4278255360}var L=this._hash.words,P=g.words,N=_.words,W=u.words,X=d.words,K=A.words,te=p.words,V,ee,Q,z,Z,re,j,de,Ae,_e;re=V=L[0],j=ee=L[1],de=Q=L[2],Ae=z=L[3],_e=Z=L[4];for(var Ee,D=0;D<80;D+=1)Ee=V+S[T+W[D]]|0,D<16?Ee+=m(ee,Q,z)+P[0]:D<32?Ee+=v(ee,Q,z)+P[1]:D<48?Ee+=w(ee,Q,z)+P[2]:D<64?Ee+=x(ee,Q,z)+P[3]:Ee+=I(ee,Q,z)+P[4],Ee=Ee|0,Ee=R(Ee,K[D]),Ee=Ee+Z|0,V=Z,Z=z,z=R(Q,10),Q=ee,ee=Ee,Ee=re+S[T+X[D]]|0,D<16?Ee+=I(j,de,Ae)+N[0]:D<32?Ee+=x(j,de,Ae)+N[1]:D<48?Ee+=w(j,de,Ae)+N[2]:D<64?Ee+=v(j,de,Ae)+N[3]:Ee+=m(j,de,Ae)+N[4],Ee=Ee|0,Ee=R(Ee,te[D]),Ee=Ee+_e|0,re=_e,_e=Ae,Ae=R(de,10),de=j,j=Ee;Ee=L[1]+Q+Ae|0,L[1]=L[2]+z+_e|0,L[2]=L[3]+Z+re|0,L[3]=L[4]+V+j|0,L[4]=L[0]+ee+de|0,L[0]=Ee},_doFinalize:function(){var S=this._data,T=S.words,D=this._nDataBytes*8,b=S.sigBytes*8;T[b>>>5]|=128<<24-b%32,T[(b+64>>>9<<4)+14]=(D<<8|D>>>24)&16711935|(D<<24|D>>>8)&4278255360,S.sigBytes=(T.length+1)*4,this._process();for(var M=this._hash,L=M.words,P=0;P<5;P++){var N=L[P];L[P]=(N<<8|N>>>24)&16711935|(N<<24|N>>>8)&4278255360}return M},clone:function(){var S=l.clone.call(this);return S._hash=this._hash.clone(),S}});function m(S,T,D){return S^T^D}function v(S,T,D){return S&T|~S&D}function w(S,T,D){return(S|~T)^D}function x(S,T,D){return S&D|T&~D}function I(S,T,D){return S^(T|~D)}function R(S,T){return S<<T|S>>>32-T}i.RIPEMD160=l._createHelper(E),i.HmacRIPEMD160=l._createHmacHelper(E)}(),t.RIPEMD160})}(Qv)),Qv.exports}var Fv={exports:{}},zv;function Pp(){return zv||(zv=1,function(r,e){(function(t,n){r.exports=n(It())})(yt,function(t){(function(){var n=t,i=n.lib,s=i.Base,o=n.enc,l=o.Utf8,h=n.algo;h.HMAC=s.extend({init:function(u,d){u=this._hasher=new u.init,typeof d=="string"&&(d=l.parse(d));var A=u.blockSize,p=A*4;d.sigBytes>p&&(d=u.finalize(d)),d.clamp();for(var g=this._oKey=d.clone(),_=this._iKey=d.clone(),E=g.words,m=_.words,v=0;v<A;v++)E[v]^=1549556828,m[v]^=909522486;g.sigBytes=_.sigBytes=p,this.reset()},reset:function(){var u=this._hasher;u.reset(),u.update(this._iKey)},update:function(u){return this._hasher.update(u),this},finalize:function(u){var d=this._hasher,A=d.finalize(u);d.reset();var p=d.finalize(this._oKey.clone().concat(A));return p}})})()})}(Fv)),Fv.exports}var Hv={exports:{}},Gv;function IS(){return Gv||(Gv=1,function(r,e){(function(t,n,i){r.exports=n(It(),Up(),Pp())})(yt,function(t){return function(){var n=t,i=n.lib,s=i.Base,o=i.WordArray,l=n.algo,h=l.SHA256,u=l.HMAC,d=l.PBKDF2=s.extend({cfg:s.extend({keySize:128/32,hasher:h,iterations:25e4}),init:function(A){this.cfg=this.cfg.extend(A)},compute:function(A,p){for(var g=this.cfg,_=u.create(g.hasher,A),E=o.create(),m=o.create([1]),v=E.words,w=m.words,x=g.keySize,I=g.iterations;v.length<x;){var R=_.update(p).finalize(m);_.reset();for(var S=R.words,T=S.length,D=R,b=1;b<I;b++){D=_.finalize(D),_.reset();for(var M=D.words,L=0;L<T;L++)S[L]^=M[L]}E.concat(R),w[0]++}return E.sigBytes=x*4,E}});n.PBKDF2=function(A,p,g){return d.create(g).compute(A,p)}}(),t.PBKDF2})}(Hv)),Hv.exports}var Vv={exports:{}},jv;function Ws(){return jv||(jv=1,function(r,e){(function(t,n,i){r.exports=n(It(),Mv(),Pp())})(yt,function(t){return function(){var n=t,i=n.lib,s=i.Base,o=i.WordArray,l=n.algo,h=l.MD5,u=l.EvpKDF=s.extend({cfg:s.extend({keySize:128/32,hasher:h,iterations:1}),init:function(d){this.cfg=this.cfg.extend(d)},compute:function(d,A){for(var p,g=this.cfg,_=g.hasher.create(),E=o.create(),m=E.words,v=g.keySize,w=g.iterations;m.length<v;){p&&_.update(p),p=_.update(d).finalize(A),_.reset();for(var x=1;x<w;x++)p=_.finalize(p),_.reset();E.concat(p)}return E.sigBytes=v*4,E}});n.EvpKDF=function(d,A,p){return u.create(p).compute(d,A)}}(),t.EvpKDF})}(Vv)),Vv.exports}var Wv={exports:{}},Yv;function Pr(){return Yv||(Yv=1,function(r,e){(function(t,n,i){r.exports=n(It(),Ws())})(yt,function(t){t.lib.Cipher||function(n){var i=t,s=i.lib,o=s.Base,l=s.WordArray,h=s.BufferedBlockAlgorithm,u=i.enc;u.Utf8;var d=u.Base64,A=i.algo,p=A.EvpKDF,g=s.Cipher=h.extend({cfg:o.extend(),createEncryptor:function(M,L){return this.create(this._ENC_XFORM_MODE,M,L)},createDecryptor:function(M,L){return this.create(this._DEC_XFORM_MODE,M,L)},init:function(M,L,P){this.cfg=this.cfg.extend(P),this._xformMode=M,this._key=L,this.reset()},reset:function(){h.reset.call(this),this._doReset()},process:function(M){return this._append(M),this._process()},finalize:function(M){M&&this._append(M);var L=this._doFinalize();return L},keySize:128/32,ivSize:128/32,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function M(L){return typeof L=="string"?b:S}return function(L){return{encrypt:function(P,N,W){return M(N).encrypt(L,P,N,W)},decrypt:function(P,N,W){return M(N).decrypt(L,P,N,W)}}}}()});s.StreamCipher=g.extend({_doFinalize:function(){var M=this._process(!0);return M},blockSize:1});var _=i.mode={},E=s.BlockCipherMode=o.extend({createEncryptor:function(M,L){return this.Encryptor.create(M,L)},createDecryptor:function(M,L){return this.Decryptor.create(M,L)},init:function(M,L){this._cipher=M,this._iv=L}}),m=_.CBC=function(){var M=E.extend();M.Encryptor=M.extend({processBlock:function(P,N){var W=this._cipher,X=W.blockSize;L.call(this,P,N,X),W.encryptBlock(P,N),this._prevBlock=P.slice(N,N+X)}}),M.Decryptor=M.extend({processBlock:function(P,N){var W=this._cipher,X=W.blockSize,K=P.slice(N,N+X);W.decryptBlock(P,N),L.call(this,P,N,X),this._prevBlock=K}});function L(P,N,W){var X,K=this._iv;K?(X=K,this._iv=n):X=this._prevBlock;for(var te=0;te<W;te++)P[N+te]^=X[te]}return M}(),v=i.pad={},w=v.Pkcs7={pad:function(M,L){for(var P=L*4,N=P-M.sigBytes%P,W=N<<24|N<<16|N<<8|N,X=[],K=0;K<N;K+=4)X.push(W);var te=l.create(X,N);M.concat(te)},unpad:function(M){var L=M.words[M.sigBytes-1>>>2]&255;M.sigBytes-=L}};s.BlockCipher=g.extend({cfg:g.cfg.extend({mode:m,padding:w}),reset:function(){var M;g.reset.call(this);var L=this.cfg,P=L.iv,N=L.mode;this._xformMode==this._ENC_XFORM_MODE?M=N.createEncryptor:(M=N.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==M?this._mode.init(this,P&&P.words):(this._mode=M.call(N,this,P&&P.words),this._mode.__creator=M)},_doProcessBlock:function(M,L){this._mode.processBlock(M,L)},_doFinalize:function(){var M,L=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(L.pad(this._data,this.blockSize),M=this._process(!0)):(M=this._process(!0),L.unpad(M)),M},blockSize:128/32});var x=s.CipherParams=o.extend({init:function(M){this.mixIn(M)},toString:function(M){return(M||this.formatter).stringify(this)}}),I=i.format={},R=I.OpenSSL={stringify:function(M){var L,P=M.ciphertext,N=M.salt;return N?L=l.create([1398893684,1701076831]).concat(N).concat(P):L=P,L.toString(d)},parse:function(M){var L,P=d.parse(M),N=P.words;return N[0]==1398893684&&N[1]==1701076831&&(L=l.create(N.slice(2,4)),N.splice(0,4),P.sigBytes-=16),x.create({ciphertext:P,salt:L})}},S=s.SerializableCipher=o.extend({cfg:o.extend({format:R}),encrypt:function(M,L,P,N){N=this.cfg.extend(N);var W=M.createEncryptor(P,N),X=W.finalize(L),K=W.cfg;return x.create({ciphertext:X,key:P,iv:K.iv,algorithm:M,mode:K.mode,padding:K.padding,blockSize:M.blockSize,formatter:N.format})},decrypt:function(M,L,P,N){N=this.cfg.extend(N),L=this._parse(L,N.format);var W=M.createDecryptor(P,N).finalize(L.ciphertext);return W},_parse:function(M,L){return typeof M=="string"?L.parse(M,this):M}}),T=i.kdf={},D=T.OpenSSL={execute:function(M,L,P,N,W){if(N||(N=l.random(64/8)),W)var X=p.create({keySize:L+P,hasher:W}).compute(M,N);else var X=p.create({keySize:L+P}).compute(M,N);var K=l.create(X.words.slice(L),P*4);return X.sigBytes=L*4,x.create({key:X,iv:K,salt:N})}},b=s.PasswordBasedCipher=S.extend({cfg:S.cfg.extend({kdf:D}),encrypt:function(M,L,P,N){N=this.cfg.extend(N);var W=N.kdf.execute(P,M.keySize,M.ivSize,N.salt,N.hasher);N.iv=W.iv;var X=S.encrypt.call(this,M,L,W.key,N);return X.mixIn(W),X},decrypt:function(M,L,P,N){N=this.cfg.extend(N),L=this._parse(L,N.format);var W=N.kdf.execute(P,M.keySize,M.ivSize,L.salt,N.hasher);N.iv=W.iv;var X=S.decrypt.call(this,M,L,W.key,N);return X}})}()})}(Wv)),Wv.exports}var qv={exports:{}},Xv;function CS(){return Xv||(Xv=1,function(r,e){(function(t,n,i){r.exports=n(It(),Pr())})(yt,function(t){return t.mode.CFB=function(){var n=t.lib.BlockCipherMode.extend();n.Encryptor=n.extend({processBlock:function(s,o){var l=this._cipher,h=l.blockSize;i.call(this,s,o,h,l),this._prevBlock=s.slice(o,o+h)}}),n.Decryptor=n.extend({processBlock:function(s,o){var l=this._cipher,h=l.blockSize,u=s.slice(o,o+h);i.call(this,s,o,h,l),this._prevBlock=u}});function i(s,o,l,h){var u,d=this._iv;d?(u=d.slice(0),this._iv=void 0):u=this._prevBlock,h.encryptBlock(u,0);for(var A=0;A<l;A++)s[o+A]^=u[A]}return n}(),t.mode.CFB})}(qv)),qv.exports}var Kv={exports:{}},Jv;function MS(){return Jv||(Jv=1,function(r,e){(function(t,n,i){r.exports=n(It(),Pr())})(yt,function(t){return t.mode.CTR=function(){var n=t.lib.BlockCipherMode.extend(),i=n.Encryptor=n.extend({processBlock:function(s,o){var l=this._cipher,h=l.blockSize,u=this._iv,d=this._counter;u&&(d=this._counter=u.slice(0),this._iv=void 0);var A=d.slice(0);l.encryptBlock(A,0),d[h-1]=d[h-1]+1|0;for(var p=0;p<h;p++)s[o+p]^=A[p]}});return n.Decryptor=i,n}(),t.mode.CTR})}(Kv)),Kv.exports}var Zv={exports:{}},$v;function SS(){return $v||($v=1,function(r,e){(function(t,n,i){r.exports=n(It(),Pr())})(yt,function(t){/** @preserve
29
29
  * Counter block mode compatible with Dr Brian Gladman fileenc.c
30
30
  * derived from CryptoJS.mode.CTR
31
31
  * Jan Hruby jhruby.web@gmail.com
32
- */return t.mode.CTRGladman=function(){var n=t.lib.BlockCipherMode.extend();function i(l){if((l>>24&255)===255){var h=l>>16&255,u=l>>8&255,d=l&255;h===255?(h=0,u===255?(u=0,d===255?d=0:++d):++u):++h,l=0,l+=h<<16,l+=u<<8,l+=d}else l+=1<<24;return l}function s(l){return(l[0]=i(l[0]))===0&&(l[1]=i(l[1])),l}var o=n.Encryptor=n.extend({processBlock:function(l,h){var u=this._cipher,d=u.blockSize,A=this._iv,p=this._counter;A&&(p=this._counter=A.slice(0),this._iv=void 0),s(p);var g=p.slice(0);u.encryptBlock(g,0);for(var _=0;_<d;_++)l[h+_]^=g[_]}});return n.Decryptor=o,n}(),t.mode.CTRGladman})}(Zv)),Zv.exports}var e_={exports:{}},t_;function TS(){return t_||(t_=1,function(r,e){(function(t,n,i){r.exports=n(It(),Pr())})(yt,function(t){return t.mode.OFB=function(){var n=t.lib.BlockCipherMode.extend(),i=n.Encryptor=n.extend({processBlock:function(s,o){var l=this._cipher,h=l.blockSize,u=this._iv,d=this._keystream;u&&(d=this._keystream=u.slice(0),this._iv=void 0),l.encryptBlock(d,0);for(var A=0;A<h;A++)s[o+A]^=d[A]}});return n.Decryptor=i,n}(),t.mode.OFB})}(e_)),e_.exports}var r_={exports:{}},n_;function BS(){return n_||(n_=1,function(r,e){(function(t,n,i){r.exports=n(It(),Pr())})(yt,function(t){return t.mode.ECB=function(){var n=t.lib.BlockCipherMode.extend();return n.Encryptor=n.extend({processBlock:function(i,s){this._cipher.encryptBlock(i,s)}}),n.Decryptor=n.extend({processBlock:function(i,s){this._cipher.decryptBlock(i,s)}}),n}(),t.mode.ECB})}(r_)),r_.exports}var i_={exports:{}},s_;function bS(){return s_||(s_=1,function(r,e){(function(t,n,i){r.exports=n(It(),Pr())})(yt,function(t){return t.pad.AnsiX923={pad:function(n,i){var s=n.sigBytes,o=i*4,l=o-s%o,h=s+l-1;n.clamp(),n.words[h>>>2]|=l<<24-h%4*8,n.sigBytes+=l},unpad:function(n){var i=n.words[n.sigBytes-1>>>2]&255;n.sigBytes-=i}},t.pad.Ansix923})}(i_)),i_.exports}var a_={exports:{}},o_;function RS(){return o_||(o_=1,function(r,e){(function(t,n,i){r.exports=n(It(),Pr())})(yt,function(t){return t.pad.Iso10126={pad:function(n,i){var s=i*4,o=s-n.sigBytes%s;n.concat(t.lib.WordArray.random(o-1)).concat(t.lib.WordArray.create([o<<24],1))},unpad:function(n){var i=n.words[n.sigBytes-1>>>2]&255;n.sigBytes-=i}},t.pad.Iso10126})}(a_)),a_.exports}var l_={exports:{}},c_;function DS(){return c_||(c_=1,function(r,e){(function(t,n,i){r.exports=n(It(),Pr())})(yt,function(t){return t.pad.Iso97971={pad:function(n,i){n.concat(t.lib.WordArray.create([2147483648],1)),t.pad.ZeroPadding.pad(n,i)},unpad:function(n){t.pad.ZeroPadding.unpad(n),n.sigBytes--}},t.pad.Iso97971})}(l_)),l_.exports}var u_={exports:{}},h_;function LS(){return h_||(h_=1,function(r,e){(function(t,n,i){r.exports=n(It(),Pr())})(yt,function(t){return t.pad.ZeroPadding={pad:function(n,i){var s=i*4;n.clamp(),n.sigBytes+=s-(n.sigBytes%s||s)},unpad:function(n){for(var i=n.words,s=n.sigBytes-1,s=n.sigBytes-1;s>=0;s--)if(i[s>>>2]>>>24-s%4*8&255){n.sigBytes=s+1;break}}},t.pad.ZeroPadding})}(u_)),u_.exports}var d_={exports:{}},f_;function NS(){return f_||(f_=1,function(r,e){(function(t,n,i){r.exports=n(It(),Pr())})(yt,function(t){return t.pad.NoPadding={pad:function(){},unpad:function(){}},t.pad.NoPadding})}(d_)),d_.exports}var p_={exports:{}},A_;function US(){return A_||(A_=1,function(r,e){(function(t,n,i){r.exports=n(It(),Pr())})(yt,function(t){return function(n){var i=t,s=i.lib,o=s.CipherParams,l=i.enc,h=l.Hex,u=i.format;u.Hex={stringify:function(d){return d.ciphertext.toString(h)},parse:function(d){var A=h.parse(d);return o.create({ciphertext:A})}}}(),t.format.Hex})}(p_)),p_.exports}var g_={exports:{}},m_;function PS(){return m_||(m_=1,function(r,e){(function(t,n,i){r.exports=n(It(),Ya(),qa(),Ws(),Pr())})(yt,function(t){return function(){var n=t,i=n.lib,s=i.BlockCipher,o=n.algo,l=[],h=[],u=[],d=[],A=[],p=[],g=[],_=[],E=[],m=[];(function(){for(var x=[],I=0;I<256;I++)I<128?x[I]=I<<1:x[I]=I<<1^283;for(var R=0,S=0,I=0;I<256;I++){var T=S^S<<1^S<<2^S<<3^S<<4;T=T>>>8^T&255^99,l[R]=T,h[T]=R;var D=x[R],b=x[D],M=x[b],L=x[T]*257^T*16843008;u[R]=L<<24|L>>>8,d[R]=L<<16|L>>>16,A[R]=L<<8|L>>>24,p[R]=L;var L=M*16843009^b*65537^D*257^R*16843008;g[T]=L<<24|L>>>8,_[T]=L<<16|L>>>16,E[T]=L<<8|L>>>24,m[T]=L,R?(R=D^x[x[x[M^D]]],S^=x[x[S]]):R=S=1}})();var v=[0,1,2,4,8,16,32,64,128,27,54],w=o.AES=s.extend({_doReset:function(){var x;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var I=this._keyPriorReset=this._key,R=I.words,S=I.sigBytes/4,T=this._nRounds=S+6,D=(T+1)*4,b=this._keySchedule=[],M=0;M<D;M++)M<S?b[M]=R[M]:(x=b[M-1],M%S?S>6&&M%S==4&&(x=l[x>>>24]<<24|l[x>>>16&255]<<16|l[x>>>8&255]<<8|l[x&255]):(x=x<<8|x>>>24,x=l[x>>>24]<<24|l[x>>>16&255]<<16|l[x>>>8&255]<<8|l[x&255],x^=v[M/S|0]<<24),b[M]=b[M-S]^x);for(var L=this._invKeySchedule=[],P=0;P<D;P++){var M=D-P;if(P%4)var x=b[M];else var x=b[M-4];P<4||M<=4?L[P]=x:L[P]=g[l[x>>>24]]^_[l[x>>>16&255]]^E[l[x>>>8&255]]^m[l[x&255]]}}},encryptBlock:function(x,I){this._doCryptBlock(x,I,this._keySchedule,u,d,A,p,l)},decryptBlock:function(x,I){var R=x[I+1];x[I+1]=x[I+3],x[I+3]=R,this._doCryptBlock(x,I,this._invKeySchedule,g,_,E,m,h);var R=x[I+1];x[I+1]=x[I+3],x[I+3]=R},_doCryptBlock:function(x,I,R,S,T,D,b,M){for(var L=this._nRounds,P=x[I]^R[0],N=x[I+1]^R[1],W=x[I+2]^R[2],X=x[I+3]^R[3],K=4,te=1;te<L;te++){var V=S[P>>>24]^T[N>>>16&255]^D[W>>>8&255]^b[X&255]^R[K++],ee=S[N>>>24]^T[W>>>16&255]^D[X>>>8&255]^b[P&255]^R[K++],Q=S[W>>>24]^T[X>>>16&255]^D[P>>>8&255]^b[N&255]^R[K++],z=S[X>>>24]^T[P>>>16&255]^D[N>>>8&255]^b[W&255]^R[K++];P=V,N=ee,W=Q,X=z}var V=(M[P>>>24]<<24|M[N>>>16&255]<<16|M[W>>>8&255]<<8|M[X&255])^R[K++],ee=(M[N>>>24]<<24|M[W>>>16&255]<<16|M[X>>>8&255]<<8|M[P&255])^R[K++],Q=(M[W>>>24]<<24|M[X>>>16&255]<<16|M[P>>>8&255]<<8|M[N&255])^R[K++],z=(M[X>>>24]<<24|M[P>>>16&255]<<16|M[N>>>8&255]<<8|M[W&255])^R[K++];x[I]=V,x[I+1]=ee,x[I+2]=Q,x[I+3]=z},keySize:256/32});n.AES=s._createHelper(w)}(),t.AES})}(g_)),g_.exports}var v_={exports:{}},__;function kS(){return __||(__=1,function(r,e){(function(t,n,i){r.exports=n(It(),Ya(),qa(),Ws(),Pr())})(yt,function(t){return function(){var n=t,i=n.lib,s=i.WordArray,o=i.BlockCipher,l=n.algo,h=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],u=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],d=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],A=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],p=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],g=l.DES=o.extend({_doReset:function(){for(var v=this._key,w=v.words,x=[],I=0;I<56;I++){var R=h[I]-1;x[I]=w[R>>>5]>>>31-R%32&1}for(var S=this._subKeys=[],T=0;T<16;T++){for(var D=S[T]=[],b=d[T],I=0;I<24;I++)D[I/6|0]|=x[(u[I]-1+b)%28]<<31-I%6,D[4+(I/6|0)]|=x[28+(u[I+24]-1+b)%28]<<31-I%6;D[0]=D[0]<<1|D[0]>>>31;for(var I=1;I<7;I++)D[I]=D[I]>>>(I-1)*4+3;D[7]=D[7]<<5|D[7]>>>27}for(var M=this._invSubKeys=[],I=0;I<16;I++)M[I]=S[15-I]},encryptBlock:function(v,w){this._doCryptBlock(v,w,this._subKeys)},decryptBlock:function(v,w){this._doCryptBlock(v,w,this._invSubKeys)},_doCryptBlock:function(v,w,x){this._lBlock=v[w],this._rBlock=v[w+1],_.call(this,4,252645135),_.call(this,16,65535),E.call(this,2,858993459),E.call(this,8,16711935),_.call(this,1,1431655765);for(var I=0;I<16;I++){for(var R=x[I],S=this._lBlock,T=this._rBlock,D=0,b=0;b<8;b++)D|=A[b][((T^R[b])&p[b])>>>0];this._lBlock=T,this._rBlock=S^D}var M=this._lBlock;this._lBlock=this._rBlock,this._rBlock=M,_.call(this,1,1431655765),E.call(this,8,16711935),E.call(this,2,858993459),_.call(this,16,65535),_.call(this,4,252645135),v[w]=this._lBlock,v[w+1]=this._rBlock},keySize:64/32,ivSize:64/32,blockSize:64/32});function _(v,w){var x=(this._lBlock>>>v^this._rBlock)&w;this._rBlock^=x,this._lBlock^=x<<v}function E(v,w){var x=(this._rBlock>>>v^this._lBlock)&w;this._lBlock^=x,this._rBlock^=x<<v}n.DES=o._createHelper(g);var m=l.TripleDES=o.extend({_doReset:function(){var v=this._key,w=v.words;if(w.length!==2&&w.length!==4&&w.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");var x=w.slice(0,2),I=w.length<4?w.slice(0,2):w.slice(2,4),R=w.length<6?w.slice(0,2):w.slice(4,6);this._des1=g.createEncryptor(s.create(x)),this._des2=g.createEncryptor(s.create(I)),this._des3=g.createEncryptor(s.create(R))},encryptBlock:function(v,w){this._des1.encryptBlock(v,w),this._des2.decryptBlock(v,w),this._des3.encryptBlock(v,w)},decryptBlock:function(v,w){this._des3.decryptBlock(v,w),this._des2.encryptBlock(v,w),this._des1.decryptBlock(v,w)},keySize:192/32,ivSize:64/32,blockSize:64/32});n.TripleDES=o._createHelper(m)}(),t.TripleDES})}(v_)),v_.exports}var y_={exports:{}},E_;function QS(){return E_||(E_=1,function(r,e){(function(t,n,i){r.exports=n(It(),Ya(),qa(),Ws(),Pr())})(yt,function(t){return function(){var n=t,i=n.lib,s=i.StreamCipher,o=n.algo,l=o.RC4=s.extend({_doReset:function(){for(var d=this._key,A=d.words,p=d.sigBytes,g=this._S=[],_=0;_<256;_++)g[_]=_;for(var _=0,E=0;_<256;_++){var m=_%p,v=A[m>>>2]>>>24-m%4*8&255;E=(E+g[_]+v)%256;var w=g[_];g[_]=g[E],g[E]=w}this._i=this._j=0},_doProcessBlock:function(d,A){d[A]^=h.call(this)},keySize:256/32,ivSize:0});function h(){for(var d=this._S,A=this._i,p=this._j,g=0,_=0;_<4;_++){A=(A+1)%256,p=(p+d[A])%256;var E=d[A];d[A]=d[p],d[p]=E,g|=d[(d[A]+d[p])%256]<<24-_*8}return this._i=A,this._j=p,g}n.RC4=s._createHelper(l);var u=o.RC4Drop=l.extend({cfg:l.cfg.extend({drop:192}),_doReset:function(){l._doReset.call(this);for(var d=this.cfg.drop;d>0;d--)h.call(this)}});n.RC4Drop=s._createHelper(u)}(),t.RC4})}(y_)),y_.exports}var x_={exports:{}},w_;function OS(){return w_||(w_=1,function(r,e){(function(t,n,i){r.exports=n(It(),Ya(),qa(),Ws(),Pr())})(yt,function(t){return function(){var n=t,i=n.lib,s=i.StreamCipher,o=n.algo,l=[],h=[],u=[],d=o.Rabbit=s.extend({_doReset:function(){for(var p=this._key.words,g=this.cfg.iv,_=0;_<4;_++)p[_]=(p[_]<<8|p[_]>>>24)&16711935|(p[_]<<24|p[_]>>>8)&4278255360;var E=this._X=[p[0],p[3]<<16|p[2]>>>16,p[1],p[0]<<16|p[3]>>>16,p[2],p[1]<<16|p[0]>>>16,p[3],p[2]<<16|p[1]>>>16],m=this._C=[p[2]<<16|p[2]>>>16,p[0]&4294901760|p[1]&65535,p[3]<<16|p[3]>>>16,p[1]&4294901760|p[2]&65535,p[0]<<16|p[0]>>>16,p[2]&4294901760|p[3]&65535,p[1]<<16|p[1]>>>16,p[3]&4294901760|p[0]&65535];this._b=0;for(var _=0;_<4;_++)A.call(this);for(var _=0;_<8;_++)m[_]^=E[_+4&7];if(g){var v=g.words,w=v[0],x=v[1],I=(w<<8|w>>>24)&16711935|(w<<24|w>>>8)&4278255360,R=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360,S=I>>>16|R&4294901760,T=R<<16|I&65535;m[0]^=I,m[1]^=S,m[2]^=R,m[3]^=T,m[4]^=I,m[5]^=S,m[6]^=R,m[7]^=T;for(var _=0;_<4;_++)A.call(this)}},_doProcessBlock:function(p,g){var _=this._X;A.call(this),l[0]=_[0]^_[5]>>>16^_[3]<<16,l[1]=_[2]^_[7]>>>16^_[5]<<16,l[2]=_[4]^_[1]>>>16^_[7]<<16,l[3]=_[6]^_[3]>>>16^_[1]<<16;for(var E=0;E<4;E++)l[E]=(l[E]<<8|l[E]>>>24)&16711935|(l[E]<<24|l[E]>>>8)&4278255360,p[g+E]^=l[E]},blockSize:128/32,ivSize:64/32});function A(){for(var p=this._X,g=this._C,_=0;_<8;_++)h[_]=g[_];g[0]=g[0]+1295307597+this._b|0,g[1]=g[1]+3545052371+(g[0]>>>0<h[0]>>>0?1:0)|0,g[2]=g[2]+886263092+(g[1]>>>0<h[1]>>>0?1:0)|0,g[3]=g[3]+1295307597+(g[2]>>>0<h[2]>>>0?1:0)|0,g[4]=g[4]+3545052371+(g[3]>>>0<h[3]>>>0?1:0)|0,g[5]=g[5]+886263092+(g[4]>>>0<h[4]>>>0?1:0)|0,g[6]=g[6]+1295307597+(g[5]>>>0<h[5]>>>0?1:0)|0,g[7]=g[7]+3545052371+(g[6]>>>0<h[6]>>>0?1:0)|0,this._b=g[7]>>>0<h[7]>>>0?1:0;for(var _=0;_<8;_++){var E=p[_]+g[_],m=E&65535,v=E>>>16,w=((m*m>>>17)+m*v>>>15)+v*v,x=((E&4294901760)*E|0)+((E&65535)*E|0);u[_]=w^x}p[0]=u[0]+(u[7]<<16|u[7]>>>16)+(u[6]<<16|u[6]>>>16)|0,p[1]=u[1]+(u[0]<<8|u[0]>>>24)+u[7]|0,p[2]=u[2]+(u[1]<<16|u[1]>>>16)+(u[0]<<16|u[0]>>>16)|0,p[3]=u[3]+(u[2]<<8|u[2]>>>24)+u[1]|0,p[4]=u[4]+(u[3]<<16|u[3]>>>16)+(u[2]<<16|u[2]>>>16)|0,p[5]=u[5]+(u[4]<<8|u[4]>>>24)+u[3]|0,p[6]=u[6]+(u[5]<<16|u[5]>>>16)+(u[4]<<16|u[4]>>>16)|0,p[7]=u[7]+(u[6]<<8|u[6]>>>24)+u[5]|0}n.Rabbit=s._createHelper(d)}(),t.Rabbit})}(x_)),x_.exports}var I_={exports:{}},C_;function FS(){return C_||(C_=1,function(r,e){(function(t,n,i){r.exports=n(It(),Ya(),qa(),Ws(),Pr())})(yt,function(t){return function(){var n=t,i=n.lib,s=i.StreamCipher,o=n.algo,l=[],h=[],u=[],d=o.RabbitLegacy=s.extend({_doReset:function(){var p=this._key.words,g=this.cfg.iv,_=this._X=[p[0],p[3]<<16|p[2]>>>16,p[1],p[0]<<16|p[3]>>>16,p[2],p[1]<<16|p[0]>>>16,p[3],p[2]<<16|p[1]>>>16],E=this._C=[p[2]<<16|p[2]>>>16,p[0]&4294901760|p[1]&65535,p[3]<<16|p[3]>>>16,p[1]&4294901760|p[2]&65535,p[0]<<16|p[0]>>>16,p[2]&4294901760|p[3]&65535,p[1]<<16|p[1]>>>16,p[3]&4294901760|p[0]&65535];this._b=0;for(var m=0;m<4;m++)A.call(this);for(var m=0;m<8;m++)E[m]^=_[m+4&7];if(g){var v=g.words,w=v[0],x=v[1],I=(w<<8|w>>>24)&16711935|(w<<24|w>>>8)&4278255360,R=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360,S=I>>>16|R&4294901760,T=R<<16|I&65535;E[0]^=I,E[1]^=S,E[2]^=R,E[3]^=T,E[4]^=I,E[5]^=S,E[6]^=R,E[7]^=T;for(var m=0;m<4;m++)A.call(this)}},_doProcessBlock:function(p,g){var _=this._X;A.call(this),l[0]=_[0]^_[5]>>>16^_[3]<<16,l[1]=_[2]^_[7]>>>16^_[5]<<16,l[2]=_[4]^_[1]>>>16^_[7]<<16,l[3]=_[6]^_[3]>>>16^_[1]<<16;for(var E=0;E<4;E++)l[E]=(l[E]<<8|l[E]>>>24)&16711935|(l[E]<<24|l[E]>>>8)&4278255360,p[g+E]^=l[E]},blockSize:128/32,ivSize:64/32});function A(){for(var p=this._X,g=this._C,_=0;_<8;_++)h[_]=g[_];g[0]=g[0]+1295307597+this._b|0,g[1]=g[1]+3545052371+(g[0]>>>0<h[0]>>>0?1:0)|0,g[2]=g[2]+886263092+(g[1]>>>0<h[1]>>>0?1:0)|0,g[3]=g[3]+1295307597+(g[2]>>>0<h[2]>>>0?1:0)|0,g[4]=g[4]+3545052371+(g[3]>>>0<h[3]>>>0?1:0)|0,g[5]=g[5]+886263092+(g[4]>>>0<h[4]>>>0?1:0)|0,g[6]=g[6]+1295307597+(g[5]>>>0<h[5]>>>0?1:0)|0,g[7]=g[7]+3545052371+(g[6]>>>0<h[6]>>>0?1:0)|0,this._b=g[7]>>>0<h[7]>>>0?1:0;for(var _=0;_<8;_++){var E=p[_]+g[_],m=E&65535,v=E>>>16,w=((m*m>>>17)+m*v>>>15)+v*v,x=((E&4294901760)*E|0)+((E&65535)*E|0);u[_]=w^x}p[0]=u[0]+(u[7]<<16|u[7]>>>16)+(u[6]<<16|u[6]>>>16)|0,p[1]=u[1]+(u[0]<<8|u[0]>>>24)+u[7]|0,p[2]=u[2]+(u[1]<<16|u[1]>>>16)+(u[0]<<16|u[0]>>>16)|0,p[3]=u[3]+(u[2]<<8|u[2]>>>24)+u[1]|0,p[4]=u[4]+(u[3]<<16|u[3]>>>16)+(u[2]<<16|u[2]>>>16)|0,p[5]=u[5]+(u[4]<<8|u[4]>>>24)+u[3]|0,p[6]=u[6]+(u[5]<<16|u[5]>>>16)+(u[4]<<16|u[4]>>>16)|0,p[7]=u[7]+(u[6]<<8|u[6]>>>24)+u[5]|0}n.RabbitLegacy=s._createHelper(d)}(),t.RabbitLegacy})}(I_)),I_.exports}var M_={exports:{}},S_;function zS(){return S_||(S_=1,function(r,e){(function(t,n,i){r.exports=n(It(),Ya(),qa(),Ws(),Pr())})(yt,function(t){return function(){var n=t,i=n.lib,s=i.BlockCipher,o=n.algo;const l=16,h=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],u=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]];var d={pbox:[],sbox:[]};function A(m,v){let w=v>>24&255,x=v>>16&255,I=v>>8&255,R=v&255,S=m.sbox[0][w]+m.sbox[1][x];return S=S^m.sbox[2][I],S=S+m.sbox[3][R],S}function p(m,v,w){let x=v,I=w,R;for(let S=0;S<l;++S)x=x^m.pbox[S],I=A(m,x)^I,R=x,x=I,I=R;return R=x,x=I,I=R,I=I^m.pbox[l],x=x^m.pbox[l+1],{left:x,right:I}}function g(m,v,w){let x=v,I=w,R;for(let S=l+1;S>1;--S)x=x^m.pbox[S],I=A(m,x)^I,R=x,x=I,I=R;return R=x,x=I,I=R,I=I^m.pbox[1],x=x^m.pbox[0],{left:x,right:I}}function _(m,v,w){for(let T=0;T<4;T++){m.sbox[T]=[];for(let D=0;D<256;D++)m.sbox[T][D]=u[T][D]}let x=0;for(let T=0;T<l+2;T++)m.pbox[T]=h[T]^v[x],x++,x>=w&&(x=0);let I=0,R=0,S=0;for(let T=0;T<l+2;T+=2)S=p(m,I,R),I=S.left,R=S.right,m.pbox[T]=I,m.pbox[T+1]=R;for(let T=0;T<4;T++)for(let D=0;D<256;D+=2)S=p(m,I,R),I=S.left,R=S.right,m.sbox[T][D]=I,m.sbox[T][D+1]=R;return!0}var E=o.Blowfish=s.extend({_doReset:function(){if(this._keyPriorReset!==this._key){var m=this._keyPriorReset=this._key,v=m.words,w=m.sigBytes/4;_(d,v,w)}},encryptBlock:function(m,v){var w=p(d,m[v],m[v+1]);m[v]=w.left,m[v+1]=w.right},decryptBlock:function(m,v){var w=g(d,m[v],m[v+1]);m[v]=w.left,m[v+1]=w.right},blockSize:64/32,keySize:128/32,ivSize:64/32});n.Blowfish=s._createHelper(E)}(),t.Blowfish})}(M_)),M_.exports}(function(r,e){(function(t,n,i){r.exports=n(It(),kh(),mS(),vS(),Ya(),_S(),qa(),Mv(),Pp(),yS(),Lv(),ES(),xS(),wS(),kp(),IS(),Ws(),Pr(),CS(),MS(),SS(),TS(),BS(),bS(),RS(),DS(),LS(),NS(),US(),PS(),kS(),QS(),OS(),FS(),zS())})(yt,function(t){return t})})(cv);var HS=cv.exports;const Qp=nS(HS);/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */const GS=4,T_=0,B_=1,VS=2;function Xo(r){let e=r.length;for(;--e>=0;)r[e]=0}const jS=0,b_=1,WS=2,YS=3,qS=258,Op=29,Qc=256,Oc=Qc+1+Op,Ko=30,Fp=19,R_=2*Oc+1,Xa=15,zp=16,XS=7,Hp=256,D_=16,L_=17,N_=18,Gp=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]),Qh=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]),KS=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),U_=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),JS=512,ds=new Array((Oc+2)*2);Xo(ds);const Fc=new Array(Ko*2);Xo(Fc);const zc=new Array(JS);Xo(zc);const Hc=new Array(qS-YS+1);Xo(Hc);const Vp=new Array(Op);Xo(Vp);const Oh=new Array(Ko);Xo(Oh);function jp(r,e,t,n,i){this.static_tree=r,this.extra_bits=e,this.extra_base=t,this.elems=n,this.max_length=i,this.has_stree=r&&r.length}let P_,k_,Q_;function Wp(r,e){this.dyn_tree=r,this.max_code=0,this.stat_desc=e}const O_=r=>r<256?zc[r]:zc[256+(r>>>7)],Gc=(r,e)=>{r.pending_buf[r.pending++]=e&255,r.pending_buf[r.pending++]=e>>>8&255},En=(r,e,t)=>{r.bi_valid>zp-t?(r.bi_buf|=e<<r.bi_valid&65535,Gc(r,r.bi_buf),r.bi_buf=e>>zp-r.bi_valid,r.bi_valid+=t-zp):(r.bi_buf|=e<<r.bi_valid&65535,r.bi_valid+=t)},Gi=(r,e,t)=>{En(r,t[e*2],t[e*2+1])},F_=(r,e)=>{let t=0;do t|=r&1,r>>>=1,t<<=1;while(--e>0);return t>>>1},ZS=r=>{r.bi_valid===16?(Gc(r,r.bi_buf),r.bi_buf=0,r.bi_valid=0):r.bi_valid>=8&&(r.pending_buf[r.pending++]=r.bi_buf&255,r.bi_buf>>=8,r.bi_valid-=8)},$S=(r,e)=>{const t=e.dyn_tree,n=e.max_code,i=e.stat_desc.static_tree,s=e.stat_desc.has_stree,o=e.stat_desc.extra_bits,l=e.stat_desc.extra_base,h=e.stat_desc.max_length;let u,d,A,p,g,_,E=0;for(p=0;p<=Xa;p++)r.bl_count[p]=0;for(t[r.heap[r.heap_max]*2+1]=0,u=r.heap_max+1;u<R_;u++)d=r.heap[u],p=t[t[d*2+1]*2+1]+1,p>h&&(p=h,E++),t[d*2+1]=p,!(d>n)&&(r.bl_count[p]++,g=0,d>=l&&(g=o[d-l]),_=t[d*2],r.opt_len+=_*(p+g),s&&(r.static_len+=_*(i[d*2+1]+g)));if(E!==0){do{for(p=h-1;r.bl_count[p]===0;)p--;r.bl_count[p]--,r.bl_count[p+1]+=2,r.bl_count[h]--,E-=2}while(E>0);for(p=h;p!==0;p--)for(d=r.bl_count[p];d!==0;)A=r.heap[--u],!(A>n)&&(t[A*2+1]!==p&&(r.opt_len+=(p-t[A*2+1])*t[A*2],t[A*2+1]=p),d--)}},z_=(r,e,t)=>{const n=new Array(Xa+1);let i=0,s,o;for(s=1;s<=Xa;s++)i=i+t[s-1]<<1,n[s]=i;for(o=0;o<=e;o++){let l=r[o*2+1];l!==0&&(r[o*2]=F_(n[l]++,l))}},eT=()=>{let r,e,t,n,i;const s=new Array(Xa+1);for(t=0,n=0;n<Op-1;n++)for(Vp[n]=t,r=0;r<1<<Gp[n];r++)Hc[t++]=n;for(Hc[t-1]=n,i=0,n=0;n<16;n++)for(Oh[n]=i,r=0;r<1<<Qh[n];r++)zc[i++]=n;for(i>>=7;n<Ko;n++)for(Oh[n]=i<<7,r=0;r<1<<Qh[n]-7;r++)zc[256+i++]=n;for(e=0;e<=Xa;e++)s[e]=0;for(r=0;r<=143;)ds[r*2+1]=8,r++,s[8]++;for(;r<=255;)ds[r*2+1]=9,r++,s[9]++;for(;r<=279;)ds[r*2+1]=7,r++,s[7]++;for(;r<=287;)ds[r*2+1]=8,r++,s[8]++;for(z_(ds,Oc+1,s),r=0;r<Ko;r++)Fc[r*2+1]=5,Fc[r*2]=F_(r,5);P_=new jp(ds,Gp,Qc+1,Oc,Xa),k_=new jp(Fc,Qh,0,Ko,Xa),Q_=new jp(new Array(0),KS,0,Fp,XS)},H_=r=>{let e;for(e=0;e<Oc;e++)r.dyn_ltree[e*2]=0;for(e=0;e<Ko;e++)r.dyn_dtree[e*2]=0;for(e=0;e<Fp;e++)r.bl_tree[e*2]=0;r.dyn_ltree[Hp*2]=1,r.opt_len=r.static_len=0,r.sym_next=r.matches=0},G_=r=>{r.bi_valid>8?Gc(r,r.bi_buf):r.bi_valid>0&&(r.pending_buf[r.pending++]=r.bi_buf),r.bi_buf=0,r.bi_valid=0},V_=(r,e,t,n)=>{const i=e*2,s=t*2;return r[i]<r[s]||r[i]===r[s]&&n[e]<=n[t]},Yp=(r,e,t)=>{const n=r.heap[t];let i=t<<1;for(;i<=r.heap_len&&(i<r.heap_len&&V_(e,r.heap[i+1],r.heap[i],r.depth)&&i++,!V_(e,n,r.heap[i],r.depth));)r.heap[t]=r.heap[i],t=i,i<<=1;r.heap[t]=n},j_=(r,e,t)=>{let n,i,s=0,o,l;if(r.sym_next!==0)do n=r.pending_buf[r.sym_buf+s++]&255,n+=(r.pending_buf[r.sym_buf+s++]&255)<<8,i=r.pending_buf[r.sym_buf+s++],n===0?Gi(r,i,e):(o=Hc[i],Gi(r,o+Qc+1,e),l=Gp[o],l!==0&&(i-=Vp[o],En(r,i,l)),n--,o=O_(n),Gi(r,o,t),l=Qh[o],l!==0&&(n-=Oh[o],En(r,n,l)));while(s<r.sym_next);Gi(r,Hp,e)},qp=(r,e)=>{const t=e.dyn_tree,n=e.stat_desc.static_tree,i=e.stat_desc.has_stree,s=e.stat_desc.elems;let o,l,h=-1,u;for(r.heap_len=0,r.heap_max=R_,o=0;o<s;o++)t[o*2]!==0?(r.heap[++r.heap_len]=h=o,r.depth[o]=0):t[o*2+1]=0;for(;r.heap_len<2;)u=r.heap[++r.heap_len]=h<2?++h:0,t[u*2]=1,r.depth[u]=0,r.opt_len--,i&&(r.static_len-=n[u*2+1]);for(e.max_code=h,o=r.heap_len>>1;o>=1;o--)Yp(r,t,o);u=s;do o=r.heap[1],r.heap[1]=r.heap[r.heap_len--],Yp(r,t,1),l=r.heap[1],r.heap[--r.heap_max]=o,r.heap[--r.heap_max]=l,t[u*2]=t[o*2]+t[l*2],r.depth[u]=(r.depth[o]>=r.depth[l]?r.depth[o]:r.depth[l])+1,t[o*2+1]=t[l*2+1]=u,r.heap[1]=u++,Yp(r,t,1);while(r.heap_len>=2);r.heap[--r.heap_max]=r.heap[1],$S(r,e),z_(t,h,r.bl_count)},W_=(r,e,t)=>{let n,i=-1,s,o=e[0*2+1],l=0,h=7,u=4;for(o===0&&(h=138,u=3),e[(t+1)*2+1]=65535,n=0;n<=t;n++)s=o,o=e[(n+1)*2+1],!(++l<h&&s===o)&&(l<u?r.bl_tree[s*2]+=l:s!==0?(s!==i&&r.bl_tree[s*2]++,r.bl_tree[D_*2]++):l<=10?r.bl_tree[L_*2]++:r.bl_tree[N_*2]++,l=0,i=s,o===0?(h=138,u=3):s===o?(h=6,u=3):(h=7,u=4))},Y_=(r,e,t)=>{let n,i=-1,s,o=e[0*2+1],l=0,h=7,u=4;for(o===0&&(h=138,u=3),n=0;n<=t;n++)if(s=o,o=e[(n+1)*2+1],!(++l<h&&s===o)){if(l<u)do Gi(r,s,r.bl_tree);while(--l!==0);else s!==0?(s!==i&&(Gi(r,s,r.bl_tree),l--),Gi(r,D_,r.bl_tree),En(r,l-3,2)):l<=10?(Gi(r,L_,r.bl_tree),En(r,l-3,3)):(Gi(r,N_,r.bl_tree),En(r,l-11,7));l=0,i=s,o===0?(h=138,u=3):s===o?(h=6,u=3):(h=7,u=4)}},tT=r=>{let e;for(W_(r,r.dyn_ltree,r.l_desc.max_code),W_(r,r.dyn_dtree,r.d_desc.max_code),qp(r,r.bl_desc),e=Fp-1;e>=3&&r.bl_tree[U_[e]*2+1]===0;e--);return r.opt_len+=3*(e+1)+5+5+4,e},rT=(r,e,t,n)=>{let i;for(En(r,e-257,5),En(r,t-1,5),En(r,n-4,4),i=0;i<n;i++)En(r,r.bl_tree[U_[i]*2+1],3);Y_(r,r.dyn_ltree,e-1),Y_(r,r.dyn_dtree,t-1)},nT=r=>{let e=4093624447,t;for(t=0;t<=31;t++,e>>>=1)if(e&1&&r.dyn_ltree[t*2]!==0)return T_;if(r.dyn_ltree[9*2]!==0||r.dyn_ltree[10*2]!==0||r.dyn_ltree[13*2]!==0)return B_;for(t=32;t<Qc;t++)if(r.dyn_ltree[t*2]!==0)return B_;return T_};let q_=!1;const iT=r=>{q_||(eT(),q_=!0),r.l_desc=new Wp(r.dyn_ltree,P_),r.d_desc=new Wp(r.dyn_dtree,k_),r.bl_desc=new Wp(r.bl_tree,Q_),r.bi_buf=0,r.bi_valid=0,H_(r)},X_=(r,e,t,n)=>{En(r,(jS<<1)+(n?1:0),3),G_(r),Gc(r,t),Gc(r,~t),t&&r.pending_buf.set(r.window.subarray(e,e+t),r.pending),r.pending+=t},sT=r=>{En(r,b_<<1,3),Gi(r,Hp,ds),ZS(r)},aT=(r,e,t,n)=>{let i,s,o=0;r.level>0?(r.strm.data_type===VS&&(r.strm.data_type=nT(r)),qp(r,r.l_desc),qp(r,r.d_desc),o=tT(r),i=r.opt_len+3+7>>>3,s=r.static_len+3+7>>>3,s<=i&&(i=s)):i=s=t+5,t+4<=i&&e!==-1?X_(r,e,t,n):r.strategy===GS||s===i?(En(r,(b_<<1)+(n?1:0),3),j_(r,ds,Fc)):(En(r,(WS<<1)+(n?1:0),3),rT(r,r.l_desc.max_code+1,r.d_desc.max_code+1,o+1),j_(r,r.dyn_ltree,r.dyn_dtree)),H_(r),n&&G_(r)},oT=(r,e,t)=>(r.pending_buf[r.sym_buf+r.sym_next++]=e,r.pending_buf[r.sym_buf+r.sym_next++]=e>>8,r.pending_buf[r.sym_buf+r.sym_next++]=t,e===0?r.dyn_ltree[t*2]++:(r.matches++,e--,r.dyn_ltree[(Hc[t]+Qc+1)*2]++,r.dyn_dtree[O_(e)*2]++),r.sym_next===r.sym_end);var lT=iT,cT=X_,uT=aT,hT=oT,dT=sT,fT={_tr_init:lT,_tr_stored_block:cT,_tr_flush_block:uT,_tr_tally:hT,_tr_align:dT},Vc=(r,e,t,n)=>{let i=r&65535|0,s=r>>>16&65535|0,o=0;for(;t!==0;){o=t>2e3?2e3:t,t-=o;do i=i+e[n++]|0,s=s+i|0;while(--o);i%=65521,s%=65521}return i|s<<16|0};const pT=()=>{let r,e=[];for(var t=0;t<256;t++){r=t;for(var n=0;n<8;n++)r=r&1?3988292384^r>>>1:r>>>1;e[t]=r}return e},AT=new Uint32Array(pT());var kr=(r,e,t,n)=>{const i=AT,s=n+t;r^=-1;for(let o=n;o<s;o++)r=r>>>8^i[(r^e[o])&255];return r^-1},Ka={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"},Ja={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};const{_tr_init:gT,_tr_stored_block:Xp,_tr_flush_block:mT,_tr_tally:Ys,_tr_align:vT}=fT,{Z_NO_FLUSH:qs,Z_PARTIAL_FLUSH:_T,Z_FULL_FLUSH:yT,Z_FINISH:ni,Z_BLOCK:K_,Z_OK:qr,Z_STREAM_END:J_,Z_STREAM_ERROR:Vi,Z_DATA_ERROR:ET,Z_BUF_ERROR:Kp,Z_DEFAULT_COMPRESSION:xT,Z_FILTERED:wT,Z_HUFFMAN_ONLY:Fh,Z_RLE:IT,Z_FIXED:CT,Z_DEFAULT_STRATEGY:MT,Z_UNKNOWN:ST,Z_DEFLATED:zh}=Ja,TT=9,BT=15,bT=8,RT=29,DT=256,Jp=DT+1+RT,LT=30,NT=19,UT=2*Jp+1,PT=15,Ct=3,Xs=258,ji=Xs+Ct+1,kT=32,Jo=42,Zp=57,$p=69,eA=73,tA=91,rA=103,Za=113,jc=666,ln=1,Zo=2,$a=3,$o=4,QT=3,eo=(r,e)=>(r.msg=Ka[e],e),Z_=r=>r*2-(r>4?9:0),Ks=r=>{let e=r.length;for(;--e>=0;)r[e]=0},OT=r=>{let e,t,n,i=r.w_size;e=r.hash_size,n=e;do t=r.head[--n],r.head[n]=t>=i?t-i:0;while(--e);e=i,n=e;do t=r.prev[--n],r.prev[n]=t>=i?t-i:0;while(--e)};let FT=(r,e,t)=>(e<<r.hash_shift^t)&r.hash_mask,Js=FT;const Fn=r=>{const e=r.state;let t=e.pending;t>r.avail_out&&(t=r.avail_out),t!==0&&(r.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+t),r.next_out),r.next_out+=t,e.pending_out+=t,r.total_out+=t,r.avail_out-=t,e.pending-=t,e.pending===0&&(e.pending_out=0))},zn=(r,e)=>{mT(r,r.block_start>=0?r.block_start:-1,r.strstart-r.block_start,e),r.block_start=r.strstart,Fn(r.strm)},Dt=(r,e)=>{r.pending_buf[r.pending++]=e},Wc=(r,e)=>{r.pending_buf[r.pending++]=e>>>8&255,r.pending_buf[r.pending++]=e&255},nA=(r,e,t,n)=>{let i=r.avail_in;return i>n&&(i=n),i===0?0:(r.avail_in-=i,e.set(r.input.subarray(r.next_in,r.next_in+i),t),r.state.wrap===1?r.adler=Vc(r.adler,e,i,t):r.state.wrap===2&&(r.adler=kr(r.adler,e,i,t)),r.next_in+=i,r.total_in+=i,i)},$_=(r,e)=>{let t=r.max_chain_length,n=r.strstart,i,s,o=r.prev_length,l=r.nice_match;const h=r.strstart>r.w_size-ji?r.strstart-(r.w_size-ji):0,u=r.window,d=r.w_mask,A=r.prev,p=r.strstart+Xs;let g=u[n+o-1],_=u[n+o];r.prev_length>=r.good_match&&(t>>=2),l>r.lookahead&&(l=r.lookahead);do if(i=e,!(u[i+o]!==_||u[i+o-1]!==g||u[i]!==u[n]||u[++i]!==u[n+1])){n+=2,i++;do;while(u[++n]===u[++i]&&u[++n]===u[++i]&&u[++n]===u[++i]&&u[++n]===u[++i]&&u[++n]===u[++i]&&u[++n]===u[++i]&&u[++n]===u[++i]&&u[++n]===u[++i]&&n<p);if(s=Xs-(p-n),n=p-Xs,s>o){if(r.match_start=e,o=s,s>=l)break;g=u[n+o-1],_=u[n+o]}}while((e=A[e&d])>h&&--t!==0);return o<=r.lookahead?o:r.lookahead},el=r=>{const e=r.w_size;let t,n,i;do{if(n=r.window_size-r.lookahead-r.strstart,r.strstart>=e+(e-ji)&&(r.window.set(r.window.subarray(e,e+e-n),0),r.match_start-=e,r.strstart-=e,r.block_start-=e,r.insert>r.strstart&&(r.insert=r.strstart),OT(r),n+=e),r.strm.avail_in===0)break;if(t=nA(r.strm,r.window,r.strstart+r.lookahead,n),r.lookahead+=t,r.lookahead+r.insert>=Ct)for(i=r.strstart-r.insert,r.ins_h=r.window[i],r.ins_h=Js(r,r.ins_h,r.window[i+1]);r.insert&&(r.ins_h=Js(r,r.ins_h,r.window[i+Ct-1]),r.prev[i&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=i,i++,r.insert--,!(r.lookahead+r.insert<Ct)););}while(r.lookahead<ji&&r.strm.avail_in!==0)},ey=(r,e)=>{let t=r.pending_buf_size-5>r.w_size?r.w_size:r.pending_buf_size-5,n,i,s,o=0,l=r.strm.avail_in;do{if(n=65535,s=r.bi_valid+42>>3,r.strm.avail_out<s||(s=r.strm.avail_out-s,i=r.strstart-r.block_start,n>i+r.strm.avail_in&&(n=i+r.strm.avail_in),n>s&&(n=s),n<t&&(n===0&&e!==ni||e===qs||n!==i+r.strm.avail_in)))break;o=e===ni&&n===i+r.strm.avail_in?1:0,Xp(r,0,0,o),r.pending_buf[r.pending-4]=n,r.pending_buf[r.pending-3]=n>>8,r.pending_buf[r.pending-2]=~n,r.pending_buf[r.pending-1]=~n>>8,Fn(r.strm),i&&(i>n&&(i=n),r.strm.output.set(r.window.subarray(r.block_start,r.block_start+i),r.strm.next_out),r.strm.next_out+=i,r.strm.avail_out-=i,r.strm.total_out+=i,r.block_start+=i,n-=i),n&&(nA(r.strm,r.strm.output,r.strm.next_out,n),r.strm.next_out+=n,r.strm.avail_out-=n,r.strm.total_out+=n)}while(o===0);return l-=r.strm.avail_in,l&&(l>=r.w_size?(r.matches=2,r.window.set(r.strm.input.subarray(r.strm.next_in-r.w_size,r.strm.next_in),0),r.strstart=r.w_size,r.insert=r.strstart):(r.window_size-r.strstart<=l&&(r.strstart-=r.w_size,r.window.set(r.window.subarray(r.w_size,r.w_size+r.strstart),0),r.matches<2&&r.matches++,r.insert>r.strstart&&(r.insert=r.strstart)),r.window.set(r.strm.input.subarray(r.strm.next_in-l,r.strm.next_in),r.strstart),r.strstart+=l,r.insert+=l>r.w_size-r.insert?r.w_size-r.insert:l),r.block_start=r.strstart),r.high_water<r.strstart&&(r.high_water=r.strstart),o?$o:e!==qs&&e!==ni&&r.strm.avail_in===0&&r.strstart===r.block_start?Zo:(s=r.window_size-r.strstart,r.strm.avail_in>s&&r.block_start>=r.w_size&&(r.block_start-=r.w_size,r.strstart-=r.w_size,r.window.set(r.window.subarray(r.w_size,r.w_size+r.strstart),0),r.matches<2&&r.matches++,s+=r.w_size,r.insert>r.strstart&&(r.insert=r.strstart)),s>r.strm.avail_in&&(s=r.strm.avail_in),s&&(nA(r.strm,r.window,r.strstart,s),r.strstart+=s,r.insert+=s>r.w_size-r.insert?r.w_size-r.insert:s),r.high_water<r.strstart&&(r.high_water=r.strstart),s=r.bi_valid+42>>3,s=r.pending_buf_size-s>65535?65535:r.pending_buf_size-s,t=s>r.w_size?r.w_size:s,i=r.strstart-r.block_start,(i>=t||(i||e===ni)&&e!==qs&&r.strm.avail_in===0&&i<=s)&&(n=i>s?s:i,o=e===ni&&r.strm.avail_in===0&&n===i?1:0,Xp(r,r.block_start,n,o),r.block_start+=n,Fn(r.strm)),o?$a:ln)},iA=(r,e)=>{let t,n;for(;;){if(r.lookahead<ji){if(el(r),r.lookahead<ji&&e===qs)return ln;if(r.lookahead===0)break}if(t=0,r.lookahead>=Ct&&(r.ins_h=Js(r,r.ins_h,r.window[r.strstart+Ct-1]),t=r.prev[r.strstart&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=r.strstart),t!==0&&r.strstart-t<=r.w_size-ji&&(r.match_length=$_(r,t)),r.match_length>=Ct)if(n=Ys(r,r.strstart-r.match_start,r.match_length-Ct),r.lookahead-=r.match_length,r.match_length<=r.max_lazy_match&&r.lookahead>=Ct){r.match_length--;do r.strstart++,r.ins_h=Js(r,r.ins_h,r.window[r.strstart+Ct-1]),t=r.prev[r.strstart&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=r.strstart;while(--r.match_length!==0);r.strstart++}else r.strstart+=r.match_length,r.match_length=0,r.ins_h=r.window[r.strstart],r.ins_h=Js(r,r.ins_h,r.window[r.strstart+1]);else n=Ys(r,0,r.window[r.strstart]),r.lookahead--,r.strstart++;if(n&&(zn(r,!1),r.strm.avail_out===0))return ln}return r.insert=r.strstart<Ct-1?r.strstart:Ct-1,e===ni?(zn(r,!0),r.strm.avail_out===0?$a:$o):r.sym_next&&(zn(r,!1),r.strm.avail_out===0)?ln:Zo},tl=(r,e)=>{let t,n,i;for(;;){if(r.lookahead<ji){if(el(r),r.lookahead<ji&&e===qs)return ln;if(r.lookahead===0)break}if(t=0,r.lookahead>=Ct&&(r.ins_h=Js(r,r.ins_h,r.window[r.strstart+Ct-1]),t=r.prev[r.strstart&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=r.strstart),r.prev_length=r.match_length,r.prev_match=r.match_start,r.match_length=Ct-1,t!==0&&r.prev_length<r.max_lazy_match&&r.strstart-t<=r.w_size-ji&&(r.match_length=$_(r,t),r.match_length<=5&&(r.strategy===wT||r.match_length===Ct&&r.strstart-r.match_start>4096)&&(r.match_length=Ct-1)),r.prev_length>=Ct&&r.match_length<=r.prev_length){i=r.strstart+r.lookahead-Ct,n=Ys(r,r.strstart-1-r.prev_match,r.prev_length-Ct),r.lookahead-=r.prev_length-1,r.prev_length-=2;do++r.strstart<=i&&(r.ins_h=Js(r,r.ins_h,r.window[r.strstart+Ct-1]),t=r.prev[r.strstart&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=r.strstart);while(--r.prev_length!==0);if(r.match_available=0,r.match_length=Ct-1,r.strstart++,n&&(zn(r,!1),r.strm.avail_out===0))return ln}else if(r.match_available){if(n=Ys(r,0,r.window[r.strstart-1]),n&&zn(r,!1),r.strstart++,r.lookahead--,r.strm.avail_out===0)return ln}else r.match_available=1,r.strstart++,r.lookahead--}return r.match_available&&(n=Ys(r,0,r.window[r.strstart-1]),r.match_available=0),r.insert=r.strstart<Ct-1?r.strstart:Ct-1,e===ni?(zn(r,!0),r.strm.avail_out===0?$a:$o):r.sym_next&&(zn(r,!1),r.strm.avail_out===0)?ln:Zo},zT=(r,e)=>{let t,n,i,s;const o=r.window;for(;;){if(r.lookahead<=Xs){if(el(r),r.lookahead<=Xs&&e===qs)return ln;if(r.lookahead===0)break}if(r.match_length=0,r.lookahead>=Ct&&r.strstart>0&&(i=r.strstart-1,n=o[i],n===o[++i]&&n===o[++i]&&n===o[++i])){s=r.strstart+Xs;do;while(n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&i<s);r.match_length=Xs-(s-i),r.match_length>r.lookahead&&(r.match_length=r.lookahead)}if(r.match_length>=Ct?(t=Ys(r,1,r.match_length-Ct),r.lookahead-=r.match_length,r.strstart+=r.match_length,r.match_length=0):(t=Ys(r,0,r.window[r.strstart]),r.lookahead--,r.strstart++),t&&(zn(r,!1),r.strm.avail_out===0))return ln}return r.insert=0,e===ni?(zn(r,!0),r.strm.avail_out===0?$a:$o):r.sym_next&&(zn(r,!1),r.strm.avail_out===0)?ln:Zo},HT=(r,e)=>{let t;for(;;){if(r.lookahead===0&&(el(r),r.lookahead===0)){if(e===qs)return ln;break}if(r.match_length=0,t=Ys(r,0,r.window[r.strstart]),r.lookahead--,r.strstart++,t&&(zn(r,!1),r.strm.avail_out===0))return ln}return r.insert=0,e===ni?(zn(r,!0),r.strm.avail_out===0?$a:$o):r.sym_next&&(zn(r,!1),r.strm.avail_out===0)?ln:Zo};function Wi(r,e,t,n,i){this.good_length=r,this.max_lazy=e,this.nice_length=t,this.max_chain=n,this.func=i}const Yc=[new Wi(0,0,0,0,ey),new Wi(4,4,8,4,iA),new Wi(4,5,16,8,iA),new Wi(4,6,32,32,iA),new Wi(4,4,16,16,tl),new Wi(8,16,32,32,tl),new Wi(8,16,128,128,tl),new Wi(8,32,128,256,tl),new Wi(32,128,258,1024,tl),new Wi(32,258,258,4096,tl)],GT=r=>{r.window_size=2*r.w_size,Ks(r.head),r.max_lazy_match=Yc[r.level].max_lazy,r.good_match=Yc[r.level].good_length,r.nice_match=Yc[r.level].nice_length,r.max_chain_length=Yc[r.level].max_chain,r.strstart=0,r.block_start=0,r.lookahead=0,r.insert=0,r.match_length=r.prev_length=Ct-1,r.match_available=0,r.ins_h=0};function VT(){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=zh,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(UT*2),this.dyn_dtree=new Uint16Array((2*LT+1)*2),this.bl_tree=new Uint16Array((2*NT+1)*2),Ks(this.dyn_ltree),Ks(this.dyn_dtree),Ks(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(PT+1),this.heap=new Uint16Array(2*Jp+1),Ks(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*Jp+1),Ks(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}const qc=r=>{if(!r)return 1;const e=r.state;return!e||e.strm!==r||e.status!==Jo&&e.status!==Zp&&e.status!==$p&&e.status!==eA&&e.status!==tA&&e.status!==rA&&e.status!==Za&&e.status!==jc?1:0},ty=r=>{if(qc(r))return eo(r,Vi);r.total_in=r.total_out=0,r.data_type=ST;const e=r.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap===2?Zp:e.wrap?Jo:Za,r.adler=e.wrap===2?0:1,e.last_flush=-2,gT(e),qr},ry=r=>{const e=ty(r);return e===qr&&GT(r.state),e},jT=(r,e)=>qc(r)||r.state.wrap!==2?Vi:(r.state.gzhead=e,qr),ny=(r,e,t,n,i,s)=>{if(!r)return Vi;let o=1;if(e===xT&&(e=6),n<0?(o=0,n=-n):n>15&&(o=2,n-=16),i<1||i>TT||t!==zh||n<8||n>15||e<0||e>9||s<0||s>CT||n===8&&o!==1)return eo(r,Vi);n===8&&(n=9);const l=new VT;return r.state=l,l.strm=r,l.status=Jo,l.wrap=o,l.gzhead=null,l.w_bits=n,l.w_size=1<<l.w_bits,l.w_mask=l.w_size-1,l.hash_bits=i+7,l.hash_size=1<<l.hash_bits,l.hash_mask=l.hash_size-1,l.hash_shift=~~((l.hash_bits+Ct-1)/Ct),l.window=new Uint8Array(l.w_size*2),l.head=new Uint16Array(l.hash_size),l.prev=new Uint16Array(l.w_size),l.lit_bufsize=1<<i+6,l.pending_buf_size=l.lit_bufsize*4,l.pending_buf=new Uint8Array(l.pending_buf_size),l.sym_buf=l.lit_bufsize,l.sym_end=(l.lit_bufsize-1)*3,l.level=e,l.strategy=s,l.method=t,ry(r)},WT=(r,e)=>ny(r,e,zh,BT,bT,MT),YT=(r,e)=>{if(qc(r)||e>K_||e<0)return r?eo(r,Vi):Vi;const t=r.state;if(!r.output||r.avail_in!==0&&!r.input||t.status===jc&&e!==ni)return eo(r,r.avail_out===0?Kp:Vi);const n=t.last_flush;if(t.last_flush=e,t.pending!==0){if(Fn(r),r.avail_out===0)return t.last_flush=-1,qr}else if(r.avail_in===0&&Z_(e)<=Z_(n)&&e!==ni)return eo(r,Kp);if(t.status===jc&&r.avail_in!==0)return eo(r,Kp);if(t.status===Jo&&t.wrap===0&&(t.status=Za),t.status===Jo){let i=zh+(t.w_bits-8<<4)<<8,s=-1;if(t.strategy>=Fh||t.level<2?s=0:t.level<6?s=1:t.level===6?s=2:s=3,i|=s<<6,t.strstart!==0&&(i|=kT),i+=31-i%31,Wc(t,i),t.strstart!==0&&(Wc(t,r.adler>>>16),Wc(t,r.adler&65535)),r.adler=1,t.status=Za,Fn(r),t.pending!==0)return t.last_flush=-1,qr}if(t.status===Zp){if(r.adler=0,Dt(t,31),Dt(t,139),Dt(t,8),t.gzhead)Dt(t,(t.gzhead.text?1:0)+(t.gzhead.hcrc?2:0)+(t.gzhead.extra?4:0)+(t.gzhead.name?8:0)+(t.gzhead.comment?16:0)),Dt(t,t.gzhead.time&255),Dt(t,t.gzhead.time>>8&255),Dt(t,t.gzhead.time>>16&255),Dt(t,t.gzhead.time>>24&255),Dt(t,t.level===9?2:t.strategy>=Fh||t.level<2?4:0),Dt(t,t.gzhead.os&255),t.gzhead.extra&&t.gzhead.extra.length&&(Dt(t,t.gzhead.extra.length&255),Dt(t,t.gzhead.extra.length>>8&255)),t.gzhead.hcrc&&(r.adler=kr(r.adler,t.pending_buf,t.pending,0)),t.gzindex=0,t.status=$p;else if(Dt(t,0),Dt(t,0),Dt(t,0),Dt(t,0),Dt(t,0),Dt(t,t.level===9?2:t.strategy>=Fh||t.level<2?4:0),Dt(t,QT),t.status=Za,Fn(r),t.pending!==0)return t.last_flush=-1,qr}if(t.status===$p){if(t.gzhead.extra){let i=t.pending,s=(t.gzhead.extra.length&65535)-t.gzindex;for(;t.pending+s>t.pending_buf_size;){let l=t.pending_buf_size-t.pending;if(t.pending_buf.set(t.gzhead.extra.subarray(t.gzindex,t.gzindex+l),t.pending),t.pending=t.pending_buf_size,t.gzhead.hcrc&&t.pending>i&&(r.adler=kr(r.adler,t.pending_buf,t.pending-i,i)),t.gzindex+=l,Fn(r),t.pending!==0)return t.last_flush=-1,qr;i=0,s-=l}let o=new Uint8Array(t.gzhead.extra);t.pending_buf.set(o.subarray(t.gzindex,t.gzindex+s),t.pending),t.pending+=s,t.gzhead.hcrc&&t.pending>i&&(r.adler=kr(r.adler,t.pending_buf,t.pending-i,i)),t.gzindex=0}t.status=eA}if(t.status===eA){if(t.gzhead.name){let i=t.pending,s;do{if(t.pending===t.pending_buf_size){if(t.gzhead.hcrc&&t.pending>i&&(r.adler=kr(r.adler,t.pending_buf,t.pending-i,i)),Fn(r),t.pending!==0)return t.last_flush=-1,qr;i=0}t.gzindex<t.gzhead.name.length?s=t.gzhead.name.charCodeAt(t.gzindex++)&255:s=0,Dt(t,s)}while(s!==0);t.gzhead.hcrc&&t.pending>i&&(r.adler=kr(r.adler,t.pending_buf,t.pending-i,i)),t.gzindex=0}t.status=tA}if(t.status===tA){if(t.gzhead.comment){let i=t.pending,s;do{if(t.pending===t.pending_buf_size){if(t.gzhead.hcrc&&t.pending>i&&(r.adler=kr(r.adler,t.pending_buf,t.pending-i,i)),Fn(r),t.pending!==0)return t.last_flush=-1,qr;i=0}t.gzindex<t.gzhead.comment.length?s=t.gzhead.comment.charCodeAt(t.gzindex++)&255:s=0,Dt(t,s)}while(s!==0);t.gzhead.hcrc&&t.pending>i&&(r.adler=kr(r.adler,t.pending_buf,t.pending-i,i))}t.status=rA}if(t.status===rA){if(t.gzhead.hcrc){if(t.pending+2>t.pending_buf_size&&(Fn(r),t.pending!==0))return t.last_flush=-1,qr;Dt(t,r.adler&255),Dt(t,r.adler>>8&255),r.adler=0}if(t.status=Za,Fn(r),t.pending!==0)return t.last_flush=-1,qr}if(r.avail_in!==0||t.lookahead!==0||e!==qs&&t.status!==jc){let i=t.level===0?ey(t,e):t.strategy===Fh?HT(t,e):t.strategy===IT?zT(t,e):Yc[t.level].func(t,e);if((i===$a||i===$o)&&(t.status=jc),i===ln||i===$a)return r.avail_out===0&&(t.last_flush=-1),qr;if(i===Zo&&(e===_T?vT(t):e!==K_&&(Xp(t,0,0,!1),e===yT&&(Ks(t.head),t.lookahead===0&&(t.strstart=0,t.block_start=0,t.insert=0))),Fn(r),r.avail_out===0))return t.last_flush=-1,qr}return e!==ni?qr:t.wrap<=0?J_:(t.wrap===2?(Dt(t,r.adler&255),Dt(t,r.adler>>8&255),Dt(t,r.adler>>16&255),Dt(t,r.adler>>24&255),Dt(t,r.total_in&255),Dt(t,r.total_in>>8&255),Dt(t,r.total_in>>16&255),Dt(t,r.total_in>>24&255)):(Wc(t,r.adler>>>16),Wc(t,r.adler&65535)),Fn(r),t.wrap>0&&(t.wrap=-t.wrap),t.pending!==0?qr:J_)},qT=r=>{if(qc(r))return Vi;const e=r.state.status;return r.state=null,e===Za?eo(r,ET):qr},XT=(r,e)=>{let t=e.length;if(qc(r))return Vi;const n=r.state,i=n.wrap;if(i===2||i===1&&n.status!==Jo||n.lookahead)return Vi;if(i===1&&(r.adler=Vc(r.adler,e,t,0)),n.wrap=0,t>=n.w_size){i===0&&(Ks(n.head),n.strstart=0,n.block_start=0,n.insert=0);let h=new Uint8Array(n.w_size);h.set(e.subarray(t-n.w_size,t),0),e=h,t=n.w_size}const s=r.avail_in,o=r.next_in,l=r.input;for(r.avail_in=t,r.next_in=0,r.input=e,el(n);n.lookahead>=Ct;){let h=n.strstart,u=n.lookahead-(Ct-1);do n.ins_h=Js(n,n.ins_h,n.window[h+Ct-1]),n.prev[h&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=h,h++;while(--u);n.strstart=h,n.lookahead=Ct-1,el(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=Ct-1,n.match_available=0,r.next_in=o,r.input=l,r.avail_in=s,n.wrap=i,qr};var KT=WT,JT=ny,ZT=ry,$T=ty,e4=jT,t4=YT,r4=qT,n4=XT,i4="pako deflate (from Nodeca project)",Xc={deflateInit:KT,deflateInit2:JT,deflateReset:ZT,deflateResetKeep:$T,deflateSetHeader:e4,deflate:t4,deflateEnd:r4,deflateSetDictionary:n4,deflateInfo:i4};const s4=(r,e)=>Object.prototype.hasOwnProperty.call(r,e);var a4=function(r){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const t=e.shift();if(t){if(typeof t!="object")throw new TypeError(t+"must be non-object");for(const n in t)s4(t,n)&&(r[n]=t[n])}}return r},o4=r=>{let e=0;for(let n=0,i=r.length;n<i;n++)e+=r[n].length;const t=new Uint8Array(e);for(let n=0,i=0,s=r.length;n<s;n++){let o=r[n];t.set(o,i),i+=o.length}return t},Hh={assign:a4,flattenChunks:o4};let iy=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{iy=!1}const Kc=new Uint8Array(256);for(let r=0;r<256;r++)Kc[r]=r>=252?6:r>=248?5:r>=240?4:r>=224?3:r>=192?2:1;Kc[254]=Kc[254]=1;var l4=r=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(r);let e,t,n,i,s,o=r.length,l=0;for(i=0;i<o;i++)t=r.charCodeAt(i),(t&64512)===55296&&i+1<o&&(n=r.charCodeAt(i+1),(n&64512)===56320&&(t=65536+(t-55296<<10)+(n-56320),i++)),l+=t<128?1:t<2048?2:t<65536?3:4;for(e=new Uint8Array(l),s=0,i=0;s<l;i++)t=r.charCodeAt(i),(t&64512)===55296&&i+1<o&&(n=r.charCodeAt(i+1),(n&64512)===56320&&(t=65536+(t-55296<<10)+(n-56320),i++)),t<128?e[s++]=t:t<2048?(e[s++]=192|t>>>6,e[s++]=128|t&63):t<65536?(e[s++]=224|t>>>12,e[s++]=128|t>>>6&63,e[s++]=128|t&63):(e[s++]=240|t>>>18,e[s++]=128|t>>>12&63,e[s++]=128|t>>>6&63,e[s++]=128|t&63);return e};const c4=(r,e)=>{if(e<65534&&r.subarray&&iy)return String.fromCharCode.apply(null,r.length===e?r:r.subarray(0,e));let t="";for(let n=0;n<e;n++)t+=String.fromCharCode(r[n]);return t};var u4=(r,e)=>{const t=e||r.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(r.subarray(0,e));let n,i;const s=new Array(t*2);for(i=0,n=0;n<t;){let o=r[n++];if(o<128){s[i++]=o;continue}let l=Kc[o];if(l>4){s[i++]=65533,n+=l-1;continue}for(o&=l===2?31:l===3?15:7;l>1&&n<t;)o=o<<6|r[n++]&63,l--;if(l>1){s[i++]=65533;continue}o<65536?s[i++]=o:(o-=65536,s[i++]=55296|o>>10&1023,s[i++]=56320|o&1023)}return c4(s,i)},h4=(r,e)=>{e=e||r.length,e>r.length&&(e=r.length);let t=e-1;for(;t>=0&&(r[t]&192)===128;)t--;return t<0||t===0?e:t+Kc[r[t]]>e?t:e},Jc={string2buf:l4,buf2string:u4,utf8border:h4};function d4(){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 sy=d4;const ay=Object.prototype.toString,{Z_NO_FLUSH:f4,Z_SYNC_FLUSH:p4,Z_FULL_FLUSH:A4,Z_FINISH:g4,Z_OK:Gh,Z_STREAM_END:m4,Z_DEFAULT_COMPRESSION:v4,Z_DEFAULT_STRATEGY:_4,Z_DEFLATED:y4}=Ja;function Zc(r){this.options=Hh.assign({level:v4,method:y4,chunkSize:16384,windowBits:15,memLevel:8,strategy:_4},r||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new sy,this.strm.avail_out=0;let t=Xc.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(t!==Gh)throw new Error(Ka[t]);if(e.header&&Xc.deflateSetHeader(this.strm,e.header),e.dictionary){let n;if(typeof e.dictionary=="string"?n=Jc.string2buf(e.dictionary):ay.call(e.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(e.dictionary):n=e.dictionary,t=Xc.deflateSetDictionary(this.strm,n),t!==Gh)throw new Error(Ka[t]);this._dict_set=!0}}Zc.prototype.push=function(r,e){const t=this.strm,n=this.options.chunkSize;let i,s;if(this.ended)return!1;for(e===~~e?s=e:s=e===!0?g4:f4,typeof r=="string"?t.input=Jc.string2buf(r):ay.call(r)==="[object ArrayBuffer]"?t.input=new Uint8Array(r):t.input=r,t.next_in=0,t.avail_in=t.input.length;;){if(t.avail_out===0&&(t.output=new Uint8Array(n),t.next_out=0,t.avail_out=n),(s===p4||s===A4)&&t.avail_out<=6){this.onData(t.output.subarray(0,t.next_out)),t.avail_out=0;continue}if(i=Xc.deflate(t,s),i===m4)return t.next_out>0&&this.onData(t.output.subarray(0,t.next_out)),i=Xc.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===Gh;if(t.avail_out===0){this.onData(t.output);continue}if(s>0&&t.next_out>0){this.onData(t.output.subarray(0,t.next_out)),t.avail_out=0;continue}if(t.avail_in===0)break}return!0},Zc.prototype.onData=function(r){this.chunks.push(r)},Zc.prototype.onEnd=function(r){r===Gh&&(this.result=Hh.flattenChunks(this.chunks)),this.chunks=[],this.err=r,this.msg=this.strm.msg};function sA(r,e){const t=new Zc(e);if(t.push(r,!0),t.err)throw t.msg||Ka[t.err];return t.result}function E4(r,e){return e=e||{},e.raw=!0,sA(r,e)}function x4(r,e){return e=e||{},e.gzip=!0,sA(r,e)}var w4=Zc,I4=sA,C4=E4,M4=x4,S4=Ja,T4={Deflate:w4,deflate:I4,deflateRaw:C4,gzip:M4,constants:S4};const Vh=16209,B4=16191;var b4=function(r,e){let t,n,i,s,o,l,h,u,d,A,p,g,_,E,m,v,w,x,I,R,S,T,D,b;const M=r.state;t=r.next_in,D=r.input,n=t+(r.avail_in-5),i=r.next_out,b=r.output,s=i-(e-r.avail_out),o=i+(r.avail_out-257),l=M.dmax,h=M.wsize,u=M.whave,d=M.wnext,A=M.window,p=M.hold,g=M.bits,_=M.lencode,E=M.distcode,m=(1<<M.lenbits)-1,v=(1<<M.distbits)-1;e:do{g<15&&(p+=D[t++]<<g,g+=8,p+=D[t++]<<g,g+=8),w=_[p&m];t:for(;;){if(x=w>>>24,p>>>=x,g-=x,x=w>>>16&255,x===0)b[i++]=w&65535;else if(x&16){I=w&65535,x&=15,x&&(g<x&&(p+=D[t++]<<g,g+=8),I+=p&(1<<x)-1,p>>>=x,g-=x),g<15&&(p+=D[t++]<<g,g+=8,p+=D[t++]<<g,g+=8),w=E[p&v];r:for(;;){if(x=w>>>24,p>>>=x,g-=x,x=w>>>16&255,x&16){if(R=w&65535,x&=15,g<x&&(p+=D[t++]<<g,g+=8,g<x&&(p+=D[t++]<<g,g+=8)),R+=p&(1<<x)-1,R>l){r.msg="invalid distance too far back",M.mode=Vh;break e}if(p>>>=x,g-=x,x=i-s,R>x){if(x=R-x,x>u&&M.sane){r.msg="invalid distance too far back",M.mode=Vh;break e}if(S=0,T=A,d===0){if(S+=h-x,x<I){I-=x;do b[i++]=A[S++];while(--x);S=i-R,T=b}}else if(d<x){if(S+=h+d-x,x-=d,x<I){I-=x;do b[i++]=A[S++];while(--x);if(S=0,d<I){x=d,I-=x;do b[i++]=A[S++];while(--x);S=i-R,T=b}}}else if(S+=d-x,x<I){I-=x;do b[i++]=A[S++];while(--x);S=i-R,T=b}for(;I>2;)b[i++]=T[S++],b[i++]=T[S++],b[i++]=T[S++],I-=3;I&&(b[i++]=T[S++],I>1&&(b[i++]=T[S++]))}else{S=i-R;do b[i++]=b[S++],b[i++]=b[S++],b[i++]=b[S++],I-=3;while(I>2);I&&(b[i++]=b[S++],I>1&&(b[i++]=b[S++]))}}else if(x&64){r.msg="invalid distance code",M.mode=Vh;break e}else{w=E[(w&65535)+(p&(1<<x)-1)];continue r}break}}else if(x&64)if(x&32){M.mode=B4;break e}else{r.msg="invalid literal/length code",M.mode=Vh;break e}else{w=_[(w&65535)+(p&(1<<x)-1)];continue t}break}}while(t<n&&i<o);I=g>>3,t-=I,g-=I<<3,p&=(1<<g)-1,r.next_in=t,r.next_out=i,r.avail_in=t<n?5+(n-t):5-(t-n),r.avail_out=i<o?257+(o-i):257-(i-o),M.hold=p,M.bits=g};const rl=15,oy=852,ly=592,cy=0,aA=1,uy=2,R4=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]),D4=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]),L4=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]),N4=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]);var $c=(r,e,t,n,i,s,o,l)=>{const h=l.bits;let u=0,d=0,A=0,p=0,g=0,_=0,E=0,m=0,v=0,w=0,x,I,R,S,T,D=null,b;const M=new Uint16Array(rl+1),L=new Uint16Array(rl+1);let P=null,N,W,X;for(u=0;u<=rl;u++)M[u]=0;for(d=0;d<n;d++)M[e[t+d]]++;for(g=h,p=rl;p>=1&&M[p]===0;p--);if(g>p&&(g=p),p===0)return i[s++]=1<<24|64<<16|0,i[s++]=1<<24|64<<16|0,l.bits=1,0;for(A=1;A<p&&M[A]===0;A++);for(g<A&&(g=A),m=1,u=1;u<=rl;u++)if(m<<=1,m-=M[u],m<0)return-1;if(m>0&&(r===cy||p!==1))return-1;for(L[1]=0,u=1;u<rl;u++)L[u+1]=L[u]+M[u];for(d=0;d<n;d++)e[t+d]!==0&&(o[L[e[t+d]]++]=d);if(r===cy?(D=P=o,b=20):r===aA?(D=R4,P=D4,b=257):(D=L4,P=N4,b=0),w=0,d=0,u=A,T=s,_=g,E=0,R=-1,v=1<<g,S=v-1,r===aA&&v>oy||r===uy&&v>ly)return 1;for(;;){N=u-E,o[d]+1<b?(W=0,X=o[d]):o[d]>=b?(W=P[o[d]-b],X=D[o[d]-b]):(W=32+64,X=0),x=1<<u-E,I=1<<_,A=I;do I-=x,i[T+(w>>E)+I]=N<<24|W<<16|X|0;while(I!==0);for(x=1<<u-1;w&x;)x>>=1;if(x!==0?(w&=x-1,w+=x):w=0,d++,--M[u]===0){if(u===p)break;u=e[t+o[d]]}if(u>g&&(w&S)!==R){for(E===0&&(E=g),T+=A,_=u-E,m=1<<_;_+E<p&&(m-=M[_+E],!(m<=0));)_++,m<<=1;if(v+=1<<_,r===aA&&v>oy||r===uy&&v>ly)return 1;R=w&S,i[R]=g<<24|_<<16|T-s|0}}return w!==0&&(i[T+w]=u-E<<24|64<<16|0),l.bits=g,0};const U4=0,hy=1,dy=2,{Z_FINISH:fy,Z_BLOCK:P4,Z_TREES:jh,Z_OK:to,Z_STREAM_END:k4,Z_NEED_DICT:Q4,Z_STREAM_ERROR:Ei,Z_DATA_ERROR:py,Z_MEM_ERROR:Ay,Z_BUF_ERROR:O4,Z_DEFLATED:gy}=Ja,Wh=16180,my=16181,vy=16182,_y=16183,yy=16184,Ey=16185,xy=16186,wy=16187,Iy=16188,Cy=16189,Yh=16190,fs=16191,oA=16192,My=16193,lA=16194,Sy=16195,Ty=16196,By=16197,by=16198,qh=16199,Xh=16200,Ry=16201,Dy=16202,Ly=16203,Ny=16204,Uy=16205,cA=16206,Py=16207,ky=16208,Jt=16209,Qy=16210,Oy=16211,F4=852,z4=592,H4=15,G4=H4,Fy=r=>(r>>>24&255)+(r>>>8&65280)+((r&65280)<<8)+((r&255)<<24);function V4(){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}const ro=r=>{if(!r)return 1;const e=r.state;return!e||e.strm!==r||e.mode<Wh||e.mode>Oy?1:0},zy=r=>{if(ro(r))return Ei;const e=r.state;return r.total_in=r.total_out=e.total=0,r.msg="",e.wrap&&(r.adler=e.wrap&1),e.mode=Wh,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(F4),e.distcode=e.distdyn=new Int32Array(z4),e.sane=1,e.back=-1,to},Hy=r=>{if(ro(r))return Ei;const e=r.state;return e.wsize=0,e.whave=0,e.wnext=0,zy(r)},Gy=(r,e)=>{let t;if(ro(r))return Ei;const n=r.state;return e<0?(t=0,e=-e):(t=(e>>4)+5,e<48&&(e&=15)),e&&(e<8||e>15)?Ei:(n.window!==null&&n.wbits!==e&&(n.window=null),n.wrap=t,n.wbits=e,Hy(r))},Vy=(r,e)=>{if(!r)return Ei;const t=new V4;r.state=t,t.strm=r,t.window=null,t.mode=Wh;const n=Gy(r,e);return n!==to&&(r.state=null),n},j4=r=>Vy(r,G4);let jy=!0,uA,hA;const W4=r=>{if(jy){uA=new Int32Array(512),hA=new Int32Array(32);let e=0;for(;e<144;)r.lens[e++]=8;for(;e<256;)r.lens[e++]=9;for(;e<280;)r.lens[e++]=7;for(;e<288;)r.lens[e++]=8;for($c(hy,r.lens,0,288,uA,0,r.work,{bits:9}),e=0;e<32;)r.lens[e++]=5;$c(dy,r.lens,0,32,hA,0,r.work,{bits:5}),jy=!1}r.lencode=uA,r.lenbits=9,r.distcode=hA,r.distbits=5},Wy=(r,e,t,n)=>{let i;const s=r.state;return s.window===null&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new Uint8Array(s.wsize)),n>=s.wsize?(s.window.set(e.subarray(t-s.wsize,t),0),s.wnext=0,s.whave=s.wsize):(i=s.wsize-s.wnext,i>n&&(i=n),s.window.set(e.subarray(t-n,t-n+i),s.wnext),n-=i,n?(s.window.set(e.subarray(t-n,t),0),s.wnext=n,s.whave=s.wsize):(s.wnext+=i,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=i))),0},Y4=(r,e)=>{let t,n,i,s,o,l,h,u,d,A,p,g,_,E,m=0,v,w,x,I,R,S,T,D;const b=new Uint8Array(4);let M,L;const P=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(ro(r)||!r.output||!r.input&&r.avail_in!==0)return Ei;t=r.state,t.mode===fs&&(t.mode=oA),o=r.next_out,i=r.output,h=r.avail_out,s=r.next_in,n=r.input,l=r.avail_in,u=t.hold,d=t.bits,A=l,p=h,D=to;e:for(;;)switch(t.mode){case Wh:if(t.wrap===0){t.mode=oA;break}for(;d<16;){if(l===0)break e;l--,u+=n[s++]<<d,d+=8}if(t.wrap&2&&u===35615){t.wbits===0&&(t.wbits=15),t.check=0,b[0]=u&255,b[1]=u>>>8&255,t.check=kr(t.check,b,2,0),u=0,d=0,t.mode=my;break}if(t.head&&(t.head.done=!1),!(t.wrap&1)||(((u&255)<<8)+(u>>8))%31){r.msg="incorrect header check",t.mode=Jt;break}if((u&15)!==gy){r.msg="unknown compression method",t.mode=Jt;break}if(u>>>=4,d-=4,T=(u&15)+8,t.wbits===0&&(t.wbits=T),T>15||T>t.wbits){r.msg="invalid window size",t.mode=Jt;break}t.dmax=1<<t.wbits,t.flags=0,r.adler=t.check=1,t.mode=u&512?Cy:fs,u=0,d=0;break;case my:for(;d<16;){if(l===0)break e;l--,u+=n[s++]<<d,d+=8}if(t.flags=u,(t.flags&255)!==gy){r.msg="unknown compression method",t.mode=Jt;break}if(t.flags&57344){r.msg="unknown header flags set",t.mode=Jt;break}t.head&&(t.head.text=u>>8&1),t.flags&512&&t.wrap&4&&(b[0]=u&255,b[1]=u>>>8&255,t.check=kr(t.check,b,2,0)),u=0,d=0,t.mode=vy;case vy:for(;d<32;){if(l===0)break e;l--,u+=n[s++]<<d,d+=8}t.head&&(t.head.time=u),t.flags&512&&t.wrap&4&&(b[0]=u&255,b[1]=u>>>8&255,b[2]=u>>>16&255,b[3]=u>>>24&255,t.check=kr(t.check,b,4,0)),u=0,d=0,t.mode=_y;case _y:for(;d<16;){if(l===0)break e;l--,u+=n[s++]<<d,d+=8}t.head&&(t.head.xflags=u&255,t.head.os=u>>8),t.flags&512&&t.wrap&4&&(b[0]=u&255,b[1]=u>>>8&255,t.check=kr(t.check,b,2,0)),u=0,d=0,t.mode=yy;case yy:if(t.flags&1024){for(;d<16;){if(l===0)break e;l--,u+=n[s++]<<d,d+=8}t.length=u,t.head&&(t.head.extra_len=u),t.flags&512&&t.wrap&4&&(b[0]=u&255,b[1]=u>>>8&255,t.check=kr(t.check,b,2,0)),u=0,d=0}else t.head&&(t.head.extra=null);t.mode=Ey;case Ey:if(t.flags&1024&&(g=t.length,g>l&&(g=l),g&&(t.head&&(T=t.head.extra_len-t.length,t.head.extra||(t.head.extra=new Uint8Array(t.head.extra_len)),t.head.extra.set(n.subarray(s,s+g),T)),t.flags&512&&t.wrap&4&&(t.check=kr(t.check,n,g,s)),l-=g,s+=g,t.length-=g),t.length))break e;t.length=0,t.mode=xy;case xy:if(t.flags&2048){if(l===0)break e;g=0;do T=n[s+g++],t.head&&T&&t.length<65536&&(t.head.name+=String.fromCharCode(T));while(T&&g<l);if(t.flags&512&&t.wrap&4&&(t.check=kr(t.check,n,g,s)),l-=g,s+=g,T)break e}else t.head&&(t.head.name=null);t.length=0,t.mode=wy;case wy:if(t.flags&4096){if(l===0)break e;g=0;do T=n[s+g++],t.head&&T&&t.length<65536&&(t.head.comment+=String.fromCharCode(T));while(T&&g<l);if(t.flags&512&&t.wrap&4&&(t.check=kr(t.check,n,g,s)),l-=g,s+=g,T)break e}else t.head&&(t.head.comment=null);t.mode=Iy;case Iy:if(t.flags&512){for(;d<16;){if(l===0)break e;l--,u+=n[s++]<<d,d+=8}if(t.wrap&4&&u!==(t.check&65535)){r.msg="header crc mismatch",t.mode=Jt;break}u=0,d=0}t.head&&(t.head.hcrc=t.flags>>9&1,t.head.done=!0),r.adler=t.check=0,t.mode=fs;break;case Cy:for(;d<32;){if(l===0)break e;l--,u+=n[s++]<<d,d+=8}r.adler=t.check=Fy(u),u=0,d=0,t.mode=Yh;case Yh:if(t.havedict===0)return r.next_out=o,r.avail_out=h,r.next_in=s,r.avail_in=l,t.hold=u,t.bits=d,Q4;r.adler=t.check=1,t.mode=fs;case fs:if(e===P4||e===jh)break e;case oA:if(t.last){u>>>=d&7,d-=d&7,t.mode=cA;break}for(;d<3;){if(l===0)break e;l--,u+=n[s++]<<d,d+=8}switch(t.last=u&1,u>>>=1,d-=1,u&3){case 0:t.mode=My;break;case 1:if(W4(t),t.mode=qh,e===jh){u>>>=2,d-=2;break e}break;case 2:t.mode=Ty;break;case 3:r.msg="invalid block type",t.mode=Jt}u>>>=2,d-=2;break;case My:for(u>>>=d&7,d-=d&7;d<32;){if(l===0)break e;l--,u+=n[s++]<<d,d+=8}if((u&65535)!==(u>>>16^65535)){r.msg="invalid stored block lengths",t.mode=Jt;break}if(t.length=u&65535,u=0,d=0,t.mode=lA,e===jh)break e;case lA:t.mode=Sy;case Sy:if(g=t.length,g){if(g>l&&(g=l),g>h&&(g=h),g===0)break e;i.set(n.subarray(s,s+g),o),l-=g,s+=g,h-=g,o+=g,t.length-=g;break}t.mode=fs;break;case Ty:for(;d<14;){if(l===0)break e;l--,u+=n[s++]<<d,d+=8}if(t.nlen=(u&31)+257,u>>>=5,d-=5,t.ndist=(u&31)+1,u>>>=5,d-=5,t.ncode=(u&15)+4,u>>>=4,d-=4,t.nlen>286||t.ndist>30){r.msg="too many length or distance symbols",t.mode=Jt;break}t.have=0,t.mode=By;case By:for(;t.have<t.ncode;){for(;d<3;){if(l===0)break e;l--,u+=n[s++]<<d,d+=8}t.lens[P[t.have++]]=u&7,u>>>=3,d-=3}for(;t.have<19;)t.lens[P[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,M={bits:t.lenbits},D=$c(U4,t.lens,0,19,t.lencode,0,t.work,M),t.lenbits=M.bits,D){r.msg="invalid code lengths set",t.mode=Jt;break}t.have=0,t.mode=by;case by:for(;t.have<t.nlen+t.ndist;){for(;m=t.lencode[u&(1<<t.lenbits)-1],v=m>>>24,w=m>>>16&255,x=m&65535,!(v<=d);){if(l===0)break e;l--,u+=n[s++]<<d,d+=8}if(x<16)u>>>=v,d-=v,t.lens[t.have++]=x;else{if(x===16){for(L=v+2;d<L;){if(l===0)break e;l--,u+=n[s++]<<d,d+=8}if(u>>>=v,d-=v,t.have===0){r.msg="invalid bit length repeat",t.mode=Jt;break}T=t.lens[t.have-1],g=3+(u&3),u>>>=2,d-=2}else if(x===17){for(L=v+3;d<L;){if(l===0)break e;l--,u+=n[s++]<<d,d+=8}u>>>=v,d-=v,T=0,g=3+(u&7),u>>>=3,d-=3}else{for(L=v+7;d<L;){if(l===0)break e;l--,u+=n[s++]<<d,d+=8}u>>>=v,d-=v,T=0,g=11+(u&127),u>>>=7,d-=7}if(t.have+g>t.nlen+t.ndist){r.msg="invalid bit length repeat",t.mode=Jt;break}for(;g--;)t.lens[t.have++]=T}}if(t.mode===Jt)break;if(t.lens[256]===0){r.msg="invalid code -- missing end-of-block",t.mode=Jt;break}if(t.lenbits=9,M={bits:t.lenbits},D=$c(hy,t.lens,0,t.nlen,t.lencode,0,t.work,M),t.lenbits=M.bits,D){r.msg="invalid literal/lengths set",t.mode=Jt;break}if(t.distbits=6,t.distcode=t.distdyn,M={bits:t.distbits},D=$c(dy,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,M),t.distbits=M.bits,D){r.msg="invalid distances set",t.mode=Jt;break}if(t.mode=qh,e===jh)break e;case qh:t.mode=Xh;case Xh:if(l>=6&&h>=258){r.next_out=o,r.avail_out=h,r.next_in=s,r.avail_in=l,t.hold=u,t.bits=d,b4(r,p),o=r.next_out,i=r.output,h=r.avail_out,s=r.next_in,n=r.input,l=r.avail_in,u=t.hold,d=t.bits,t.mode===fs&&(t.back=-1);break}for(t.back=0;m=t.lencode[u&(1<<t.lenbits)-1],v=m>>>24,w=m>>>16&255,x=m&65535,!(v<=d);){if(l===0)break e;l--,u+=n[s++]<<d,d+=8}if(w&&!(w&240)){for(I=v,R=w,S=x;m=t.lencode[S+((u&(1<<I+R)-1)>>I)],v=m>>>24,w=m>>>16&255,x=m&65535,!(I+v<=d);){if(l===0)break e;l--,u+=n[s++]<<d,d+=8}u>>>=I,d-=I,t.back+=I}if(u>>>=v,d-=v,t.back+=v,t.length=x,w===0){t.mode=Uy;break}if(w&32){t.back=-1,t.mode=fs;break}if(w&64){r.msg="invalid literal/length code",t.mode=Jt;break}t.extra=w&15,t.mode=Ry;case Ry:if(t.extra){for(L=t.extra;d<L;){if(l===0)break e;l--,u+=n[s++]<<d,d+=8}t.length+=u&(1<<t.extra)-1,u>>>=t.extra,d-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=Dy;case Dy:for(;m=t.distcode[u&(1<<t.distbits)-1],v=m>>>24,w=m>>>16&255,x=m&65535,!(v<=d);){if(l===0)break e;l--,u+=n[s++]<<d,d+=8}if(!(w&240)){for(I=v,R=w,S=x;m=t.distcode[S+((u&(1<<I+R)-1)>>I)],v=m>>>24,w=m>>>16&255,x=m&65535,!(I+v<=d);){if(l===0)break e;l--,u+=n[s++]<<d,d+=8}u>>>=I,d-=I,t.back+=I}if(u>>>=v,d-=v,t.back+=v,w&64){r.msg="invalid distance code",t.mode=Jt;break}t.offset=x,t.extra=w&15,t.mode=Ly;case Ly:if(t.extra){for(L=t.extra;d<L;){if(l===0)break e;l--,u+=n[s++]<<d,d+=8}t.offset+=u&(1<<t.extra)-1,u>>>=t.extra,d-=t.extra,t.back+=t.extra}if(t.offset>t.dmax){r.msg="invalid distance too far back",t.mode=Jt;break}t.mode=Ny;case Ny:if(h===0)break e;if(g=p-h,t.offset>g){if(g=t.offset-g,g>t.whave&&t.sane){r.msg="invalid distance too far back",t.mode=Jt;break}g>t.wnext?(g-=t.wnext,_=t.wsize-g):_=t.wnext-g,g>t.length&&(g=t.length),E=t.window}else E=i,_=o-t.offset,g=t.length;g>h&&(g=h),h-=g,t.length-=g;do i[o++]=E[_++];while(--g);t.length===0&&(t.mode=Xh);break;case Uy:if(h===0)break e;i[o++]=t.length,h--,t.mode=Xh;break;case cA:if(t.wrap){for(;d<32;){if(l===0)break e;l--,u|=n[s++]<<d,d+=8}if(p-=h,r.total_out+=p,t.total+=p,t.wrap&4&&p&&(r.adler=t.check=t.flags?kr(t.check,i,p,o-p):Vc(t.check,i,p,o-p)),p=h,t.wrap&4&&(t.flags?u:Fy(u))!==t.check){r.msg="incorrect data check",t.mode=Jt;break}u=0,d=0}t.mode=Py;case Py:if(t.wrap&&t.flags){for(;d<32;){if(l===0)break e;l--,u+=n[s++]<<d,d+=8}if(t.wrap&4&&u!==(t.total&4294967295)){r.msg="incorrect length check",t.mode=Jt;break}u=0,d=0}t.mode=ky;case ky:D=k4;break e;case Jt:D=py;break e;case Qy:return Ay;case Oy:default:return Ei}return r.next_out=o,r.avail_out=h,r.next_in=s,r.avail_in=l,t.hold=u,t.bits=d,(t.wsize||p!==r.avail_out&&t.mode<Jt&&(t.mode<cA||e!==fy))&&Wy(r,r.output,r.next_out,p-r.avail_out),A-=r.avail_in,p-=r.avail_out,r.total_in+=A,r.total_out+=p,t.total+=p,t.wrap&4&&p&&(r.adler=t.check=t.flags?kr(t.check,i,p,r.next_out-p):Vc(t.check,i,p,r.next_out-p)),r.data_type=t.bits+(t.last?64:0)+(t.mode===fs?128:0)+(t.mode===qh||t.mode===lA?256:0),(A===0&&p===0||e===fy)&&D===to&&(D=O4),D},q4=r=>{if(ro(r))return Ei;let e=r.state;return e.window&&(e.window=null),r.state=null,to},X4=(r,e)=>{if(ro(r))return Ei;const t=r.state;return t.wrap&2?(t.head=e,e.done=!1,to):Ei},K4=(r,e)=>{const t=e.length;let n,i,s;return ro(r)||(n=r.state,n.wrap!==0&&n.mode!==Yh)?Ei:n.mode===Yh&&(i=1,i=Vc(i,e,t,0),i!==n.check)?py:(s=Wy(r,e,t,t),s?(n.mode=Qy,Ay):(n.havedict=1,to))};var J4=Hy,Z4=Gy,$4=zy,eB=j4,tB=Vy,rB=Y4,nB=q4,iB=X4,sB=K4,aB="pako inflate (from Nodeca project)",ps={inflateReset:J4,inflateReset2:Z4,inflateResetKeep:$4,inflateInit:eB,inflateInit2:tB,inflate:rB,inflateEnd:nB,inflateGetHeader:iB,inflateSetDictionary:sB,inflateInfo:aB};function oB(){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 lB=oB;const Yy=Object.prototype.toString,{Z_NO_FLUSH:cB,Z_FINISH:uB,Z_OK:eu,Z_STREAM_END:dA,Z_NEED_DICT:fA,Z_STREAM_ERROR:hB,Z_DATA_ERROR:qy,Z_MEM_ERROR:dB}=Ja;function tu(r){this.options=Hh.assign({chunkSize:1024*64,windowBits:15,to:""},r||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,e.windowBits===0&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(r&&r.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(e.windowBits&15||(e.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new sy,this.strm.avail_out=0;let t=ps.inflateInit2(this.strm,e.windowBits);if(t!==eu)throw new Error(Ka[t]);if(this.header=new lB,ps.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=Jc.string2buf(e.dictionary):Yy.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(t=ps.inflateSetDictionary(this.strm,e.dictionary),t!==eu)))throw new Error(Ka[t])}tu.prototype.push=function(r,e){const t=this.strm,n=this.options.chunkSize,i=this.options.dictionary;let s,o,l;if(this.ended)return!1;for(e===~~e?o=e:o=e===!0?uB:cB,Yy.call(r)==="[object ArrayBuffer]"?t.input=new Uint8Array(r):t.input=r,t.next_in=0,t.avail_in=t.input.length;;){for(t.avail_out===0&&(t.output=new Uint8Array(n),t.next_out=0,t.avail_out=n),s=ps.inflate(t,o),s===fA&&i&&(s=ps.inflateSetDictionary(t,i),s===eu?s=ps.inflate(t,o):s===qy&&(s=fA));t.avail_in>0&&s===dA&&t.state.wrap>0&&r[t.next_in]!==0;)ps.inflateReset(t),s=ps.inflate(t,o);switch(s){case hB:case qy:case fA:case dB:return this.onEnd(s),this.ended=!0,!1}if(l=t.avail_out,t.next_out&&(t.avail_out===0||s===dA))if(this.options.to==="string"){let h=Jc.utf8border(t.output,t.next_out),u=t.next_out-h,d=Jc.buf2string(t.output,h);t.next_out=u,t.avail_out=n-u,u&&t.output.set(t.output.subarray(h,h+u),0),this.onData(d)}else this.onData(t.output.length===t.next_out?t.output:t.output.subarray(0,t.next_out));if(!(s===eu&&l===0)){if(s===dA)return s=ps.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,!0;if(t.avail_in===0)break}}return!0},tu.prototype.onData=function(r){this.chunks.push(r)},tu.prototype.onEnd=function(r){r===eu&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Hh.flattenChunks(this.chunks)),this.chunks=[],this.err=r,this.msg=this.strm.msg};function pA(r,e){const t=new tu(e);if(t.push(r),t.err)throw t.msg||Ka[t.err];return t.result}function fB(r,e){return e=e||{},e.raw=!0,pA(r,e)}var pB=tu,AB=pA,gB=fB,mB=pA,vB=Ja,_B={Inflate:pB,inflate:AB,inflateRaw:gB,ungzip:mB,constants:vB};const{Deflate:yB,deflate:EB,deflateRaw:xB,gzip:wB}=T4,{Inflate:IB,inflate:CB,inflateRaw:MB,ungzip:SB}=_B;var TB=yB,BB=EB,bB=xB,RB=wB,DB=IB,LB=CB,NB=MB,UB=SB,PB=Ja,kB={Deflate:TB,deflate:BB,deflateRaw:bB,gzip:RB,Inflate:DB,inflate:LB,inflateRaw:NB,ungzip:UB,constants:PB},QB=r=>{if(r===""||!r)return"";let e=r.split("/"),t=`$$${e[1].slice(-10)}${e[3].slice(-9)}`;return String(Qp.MD5(t))};async function OB(r){return await(await fetch(r,{method:"GET"})).arrayBuffer()}function FB(r){return kB.ungzip(r,{to:"string"})}var zB=r=>{let e=window.atob(r),t=e.length,n=new Uint8Array(t);for(let i=0;i<t;i+=1)n[i]=e.charCodeAt(i);return n.buffer};async function HB(r,e){let t=QB(e),n=Qp.AES.decrypt(r,t).toString(Qp.enc.Latin1);return zB(n)}async function GB(r,e){let t=e||`org/${r.split("org/")[1].split("/universal")[0]}`,n=Date.now(),i=await OB(r),s=Date.now()-n;n=Date.now();let o=FB(i),l=Date.now()-n;n=Date.now();let h=await HB(o,t),u=Date.now()-n;return{decodedData:h,events:{fileDownloadTime:s,fileUnzipTime:l,fileDecryptionTime:u}}}var VB=GB;/**
32
+ */return t.mode.CTRGladman=function(){var n=t.lib.BlockCipherMode.extend();function i(l){if((l>>24&255)===255){var h=l>>16&255,u=l>>8&255,d=l&255;h===255?(h=0,u===255?(u=0,d===255?d=0:++d):++u):++h,l=0,l+=h<<16,l+=u<<8,l+=d}else l+=1<<24;return l}function s(l){return(l[0]=i(l[0]))===0&&(l[1]=i(l[1])),l}var o=n.Encryptor=n.extend({processBlock:function(l,h){var u=this._cipher,d=u.blockSize,A=this._iv,p=this._counter;A&&(p=this._counter=A.slice(0),this._iv=void 0),s(p);var g=p.slice(0);u.encryptBlock(g,0);for(var _=0;_<d;_++)l[h+_]^=g[_]}});return n.Decryptor=o,n}(),t.mode.CTRGladman})}(Zv)),Zv.exports}var e_={exports:{}},t_;function TS(){return t_||(t_=1,function(r,e){(function(t,n,i){r.exports=n(It(),Pr())})(yt,function(t){return t.mode.OFB=function(){var n=t.lib.BlockCipherMode.extend(),i=n.Encryptor=n.extend({processBlock:function(s,o){var l=this._cipher,h=l.blockSize,u=this._iv,d=this._keystream;u&&(d=this._keystream=u.slice(0),this._iv=void 0),l.encryptBlock(d,0);for(var A=0;A<h;A++)s[o+A]^=d[A]}});return n.Decryptor=i,n}(),t.mode.OFB})}(e_)),e_.exports}var r_={exports:{}},n_;function BS(){return n_||(n_=1,function(r,e){(function(t,n,i){r.exports=n(It(),Pr())})(yt,function(t){return t.mode.ECB=function(){var n=t.lib.BlockCipherMode.extend();return n.Encryptor=n.extend({processBlock:function(i,s){this._cipher.encryptBlock(i,s)}}),n.Decryptor=n.extend({processBlock:function(i,s){this._cipher.decryptBlock(i,s)}}),n}(),t.mode.ECB})}(r_)),r_.exports}var i_={exports:{}},s_;function bS(){return s_||(s_=1,function(r,e){(function(t,n,i){r.exports=n(It(),Pr())})(yt,function(t){return t.pad.AnsiX923={pad:function(n,i){var s=n.sigBytes,o=i*4,l=o-s%o,h=s+l-1;n.clamp(),n.words[h>>>2]|=l<<24-h%4*8,n.sigBytes+=l},unpad:function(n){var i=n.words[n.sigBytes-1>>>2]&255;n.sigBytes-=i}},t.pad.Ansix923})}(i_)),i_.exports}var a_={exports:{}},o_;function RS(){return o_||(o_=1,function(r,e){(function(t,n,i){r.exports=n(It(),Pr())})(yt,function(t){return t.pad.Iso10126={pad:function(n,i){var s=i*4,o=s-n.sigBytes%s;n.concat(t.lib.WordArray.random(o-1)).concat(t.lib.WordArray.create([o<<24],1))},unpad:function(n){var i=n.words[n.sigBytes-1>>>2]&255;n.sigBytes-=i}},t.pad.Iso10126})}(a_)),a_.exports}var l_={exports:{}},c_;function DS(){return c_||(c_=1,function(r,e){(function(t,n,i){r.exports=n(It(),Pr())})(yt,function(t){return t.pad.Iso97971={pad:function(n,i){n.concat(t.lib.WordArray.create([2147483648],1)),t.pad.ZeroPadding.pad(n,i)},unpad:function(n){t.pad.ZeroPadding.unpad(n),n.sigBytes--}},t.pad.Iso97971})}(l_)),l_.exports}var u_={exports:{}},h_;function LS(){return h_||(h_=1,function(r,e){(function(t,n,i){r.exports=n(It(),Pr())})(yt,function(t){return t.pad.ZeroPadding={pad:function(n,i){var s=i*4;n.clamp(),n.sigBytes+=s-(n.sigBytes%s||s)},unpad:function(n){for(var i=n.words,s=n.sigBytes-1,s=n.sigBytes-1;s>=0;s--)if(i[s>>>2]>>>24-s%4*8&255){n.sigBytes=s+1;break}}},t.pad.ZeroPadding})}(u_)),u_.exports}var d_={exports:{}},f_;function NS(){return f_||(f_=1,function(r,e){(function(t,n,i){r.exports=n(It(),Pr())})(yt,function(t){return t.pad.NoPadding={pad:function(){},unpad:function(){}},t.pad.NoPadding})}(d_)),d_.exports}var p_={exports:{}},A_;function US(){return A_||(A_=1,function(r,e){(function(t,n,i){r.exports=n(It(),Pr())})(yt,function(t){return function(n){var i=t,s=i.lib,o=s.CipherParams,l=i.enc,h=l.Hex,u=i.format;u.Hex={stringify:function(d){return d.ciphertext.toString(h)},parse:function(d){var A=h.parse(d);return o.create({ciphertext:A})}}}(),t.format.Hex})}(p_)),p_.exports}var g_={exports:{}},m_;function PS(){return m_||(m_=1,function(r,e){(function(t,n,i){r.exports=n(It(),Ya(),qa(),Ws(),Pr())})(yt,function(t){return function(){var n=t,i=n.lib,s=i.BlockCipher,o=n.algo,l=[],h=[],u=[],d=[],A=[],p=[],g=[],_=[],E=[],m=[];(function(){for(var x=[],I=0;I<256;I++)I<128?x[I]=I<<1:x[I]=I<<1^283;for(var R=0,S=0,I=0;I<256;I++){var T=S^S<<1^S<<2^S<<3^S<<4;T=T>>>8^T&255^99,l[R]=T,h[T]=R;var D=x[R],b=x[D],M=x[b],L=x[T]*257^T*16843008;u[R]=L<<24|L>>>8,d[R]=L<<16|L>>>16,A[R]=L<<8|L>>>24,p[R]=L;var L=M*16843009^b*65537^D*257^R*16843008;g[T]=L<<24|L>>>8,_[T]=L<<16|L>>>16,E[T]=L<<8|L>>>24,m[T]=L,R?(R=D^x[x[x[M^D]]],S^=x[x[S]]):R=S=1}})();var v=[0,1,2,4,8,16,32,64,128,27,54],w=o.AES=s.extend({_doReset:function(){var x;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var I=this._keyPriorReset=this._key,R=I.words,S=I.sigBytes/4,T=this._nRounds=S+6,D=(T+1)*4,b=this._keySchedule=[],M=0;M<D;M++)M<S?b[M]=R[M]:(x=b[M-1],M%S?S>6&&M%S==4&&(x=l[x>>>24]<<24|l[x>>>16&255]<<16|l[x>>>8&255]<<8|l[x&255]):(x=x<<8|x>>>24,x=l[x>>>24]<<24|l[x>>>16&255]<<16|l[x>>>8&255]<<8|l[x&255],x^=v[M/S|0]<<24),b[M]=b[M-S]^x);for(var L=this._invKeySchedule=[],P=0;P<D;P++){var M=D-P;if(P%4)var x=b[M];else var x=b[M-4];P<4||M<=4?L[P]=x:L[P]=g[l[x>>>24]]^_[l[x>>>16&255]]^E[l[x>>>8&255]]^m[l[x&255]]}}},encryptBlock:function(x,I){this._doCryptBlock(x,I,this._keySchedule,u,d,A,p,l)},decryptBlock:function(x,I){var R=x[I+1];x[I+1]=x[I+3],x[I+3]=R,this._doCryptBlock(x,I,this._invKeySchedule,g,_,E,m,h);var R=x[I+1];x[I+1]=x[I+3],x[I+3]=R},_doCryptBlock:function(x,I,R,S,T,D,b,M){for(var L=this._nRounds,P=x[I]^R[0],N=x[I+1]^R[1],W=x[I+2]^R[2],X=x[I+3]^R[3],K=4,te=1;te<L;te++){var V=S[P>>>24]^T[N>>>16&255]^D[W>>>8&255]^b[X&255]^R[K++],ee=S[N>>>24]^T[W>>>16&255]^D[X>>>8&255]^b[P&255]^R[K++],Q=S[W>>>24]^T[X>>>16&255]^D[P>>>8&255]^b[N&255]^R[K++],z=S[X>>>24]^T[P>>>16&255]^D[N>>>8&255]^b[W&255]^R[K++];P=V,N=ee,W=Q,X=z}var V=(M[P>>>24]<<24|M[N>>>16&255]<<16|M[W>>>8&255]<<8|M[X&255])^R[K++],ee=(M[N>>>24]<<24|M[W>>>16&255]<<16|M[X>>>8&255]<<8|M[P&255])^R[K++],Q=(M[W>>>24]<<24|M[X>>>16&255]<<16|M[P>>>8&255]<<8|M[N&255])^R[K++],z=(M[X>>>24]<<24|M[P>>>16&255]<<16|M[N>>>8&255]<<8|M[W&255])^R[K++];x[I]=V,x[I+1]=ee,x[I+2]=Q,x[I+3]=z},keySize:256/32});n.AES=s._createHelper(w)}(),t.AES})}(g_)),g_.exports}var v_={exports:{}},__;function kS(){return __||(__=1,function(r,e){(function(t,n,i){r.exports=n(It(),Ya(),qa(),Ws(),Pr())})(yt,function(t){return function(){var n=t,i=n.lib,s=i.WordArray,o=i.BlockCipher,l=n.algo,h=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],u=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],d=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],A=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],p=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],g=l.DES=o.extend({_doReset:function(){for(var v=this._key,w=v.words,x=[],I=0;I<56;I++){var R=h[I]-1;x[I]=w[R>>>5]>>>31-R%32&1}for(var S=this._subKeys=[],T=0;T<16;T++){for(var D=S[T]=[],b=d[T],I=0;I<24;I++)D[I/6|0]|=x[(u[I]-1+b)%28]<<31-I%6,D[4+(I/6|0)]|=x[28+(u[I+24]-1+b)%28]<<31-I%6;D[0]=D[0]<<1|D[0]>>>31;for(var I=1;I<7;I++)D[I]=D[I]>>>(I-1)*4+3;D[7]=D[7]<<5|D[7]>>>27}for(var M=this._invSubKeys=[],I=0;I<16;I++)M[I]=S[15-I]},encryptBlock:function(v,w){this._doCryptBlock(v,w,this._subKeys)},decryptBlock:function(v,w){this._doCryptBlock(v,w,this._invSubKeys)},_doCryptBlock:function(v,w,x){this._lBlock=v[w],this._rBlock=v[w+1],_.call(this,4,252645135),_.call(this,16,65535),E.call(this,2,858993459),E.call(this,8,16711935),_.call(this,1,1431655765);for(var I=0;I<16;I++){for(var R=x[I],S=this._lBlock,T=this._rBlock,D=0,b=0;b<8;b++)D|=A[b][((T^R[b])&p[b])>>>0];this._lBlock=T,this._rBlock=S^D}var M=this._lBlock;this._lBlock=this._rBlock,this._rBlock=M,_.call(this,1,1431655765),E.call(this,8,16711935),E.call(this,2,858993459),_.call(this,16,65535),_.call(this,4,252645135),v[w]=this._lBlock,v[w+1]=this._rBlock},keySize:64/32,ivSize:64/32,blockSize:64/32});function _(v,w){var x=(this._lBlock>>>v^this._rBlock)&w;this._rBlock^=x,this._lBlock^=x<<v}function E(v,w){var x=(this._rBlock>>>v^this._lBlock)&w;this._lBlock^=x,this._rBlock^=x<<v}n.DES=o._createHelper(g);var m=l.TripleDES=o.extend({_doReset:function(){var v=this._key,w=v.words;if(w.length!==2&&w.length!==4&&w.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");var x=w.slice(0,2),I=w.length<4?w.slice(0,2):w.slice(2,4),R=w.length<6?w.slice(0,2):w.slice(4,6);this._des1=g.createEncryptor(s.create(x)),this._des2=g.createEncryptor(s.create(I)),this._des3=g.createEncryptor(s.create(R))},encryptBlock:function(v,w){this._des1.encryptBlock(v,w),this._des2.decryptBlock(v,w),this._des3.encryptBlock(v,w)},decryptBlock:function(v,w){this._des3.decryptBlock(v,w),this._des2.encryptBlock(v,w),this._des1.decryptBlock(v,w)},keySize:192/32,ivSize:64/32,blockSize:64/32});n.TripleDES=o._createHelper(m)}(),t.TripleDES})}(v_)),v_.exports}var y_={exports:{}},E_;function QS(){return E_||(E_=1,function(r,e){(function(t,n,i){r.exports=n(It(),Ya(),qa(),Ws(),Pr())})(yt,function(t){return function(){var n=t,i=n.lib,s=i.StreamCipher,o=n.algo,l=o.RC4=s.extend({_doReset:function(){for(var d=this._key,A=d.words,p=d.sigBytes,g=this._S=[],_=0;_<256;_++)g[_]=_;for(var _=0,E=0;_<256;_++){var m=_%p,v=A[m>>>2]>>>24-m%4*8&255;E=(E+g[_]+v)%256;var w=g[_];g[_]=g[E],g[E]=w}this._i=this._j=0},_doProcessBlock:function(d,A){d[A]^=h.call(this)},keySize:256/32,ivSize:0});function h(){for(var d=this._S,A=this._i,p=this._j,g=0,_=0;_<4;_++){A=(A+1)%256,p=(p+d[A])%256;var E=d[A];d[A]=d[p],d[p]=E,g|=d[(d[A]+d[p])%256]<<24-_*8}return this._i=A,this._j=p,g}n.RC4=s._createHelper(l);var u=o.RC4Drop=l.extend({cfg:l.cfg.extend({drop:192}),_doReset:function(){l._doReset.call(this);for(var d=this.cfg.drop;d>0;d--)h.call(this)}});n.RC4Drop=s._createHelper(u)}(),t.RC4})}(y_)),y_.exports}var x_={exports:{}},w_;function OS(){return w_||(w_=1,function(r,e){(function(t,n,i){r.exports=n(It(),Ya(),qa(),Ws(),Pr())})(yt,function(t){return function(){var n=t,i=n.lib,s=i.StreamCipher,o=n.algo,l=[],h=[],u=[],d=o.Rabbit=s.extend({_doReset:function(){for(var p=this._key.words,g=this.cfg.iv,_=0;_<4;_++)p[_]=(p[_]<<8|p[_]>>>24)&16711935|(p[_]<<24|p[_]>>>8)&4278255360;var E=this._X=[p[0],p[3]<<16|p[2]>>>16,p[1],p[0]<<16|p[3]>>>16,p[2],p[1]<<16|p[0]>>>16,p[3],p[2]<<16|p[1]>>>16],m=this._C=[p[2]<<16|p[2]>>>16,p[0]&4294901760|p[1]&65535,p[3]<<16|p[3]>>>16,p[1]&4294901760|p[2]&65535,p[0]<<16|p[0]>>>16,p[2]&4294901760|p[3]&65535,p[1]<<16|p[1]>>>16,p[3]&4294901760|p[0]&65535];this._b=0;for(var _=0;_<4;_++)A.call(this);for(var _=0;_<8;_++)m[_]^=E[_+4&7];if(g){var v=g.words,w=v[0],x=v[1],I=(w<<8|w>>>24)&16711935|(w<<24|w>>>8)&4278255360,R=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360,S=I>>>16|R&4294901760,T=R<<16|I&65535;m[0]^=I,m[1]^=S,m[2]^=R,m[3]^=T,m[4]^=I,m[5]^=S,m[6]^=R,m[7]^=T;for(var _=0;_<4;_++)A.call(this)}},_doProcessBlock:function(p,g){var _=this._X;A.call(this),l[0]=_[0]^_[5]>>>16^_[3]<<16,l[1]=_[2]^_[7]>>>16^_[5]<<16,l[2]=_[4]^_[1]>>>16^_[7]<<16,l[3]=_[6]^_[3]>>>16^_[1]<<16;for(var E=0;E<4;E++)l[E]=(l[E]<<8|l[E]>>>24)&16711935|(l[E]<<24|l[E]>>>8)&4278255360,p[g+E]^=l[E]},blockSize:128/32,ivSize:64/32});function A(){for(var p=this._X,g=this._C,_=0;_<8;_++)h[_]=g[_];g[0]=g[0]+1295307597+this._b|0,g[1]=g[1]+3545052371+(g[0]>>>0<h[0]>>>0?1:0)|0,g[2]=g[2]+886263092+(g[1]>>>0<h[1]>>>0?1:0)|0,g[3]=g[3]+1295307597+(g[2]>>>0<h[2]>>>0?1:0)|0,g[4]=g[4]+3545052371+(g[3]>>>0<h[3]>>>0?1:0)|0,g[5]=g[5]+886263092+(g[4]>>>0<h[4]>>>0?1:0)|0,g[6]=g[6]+1295307597+(g[5]>>>0<h[5]>>>0?1:0)|0,g[7]=g[7]+3545052371+(g[6]>>>0<h[6]>>>0?1:0)|0,this._b=g[7]>>>0<h[7]>>>0?1:0;for(var _=0;_<8;_++){var E=p[_]+g[_],m=E&65535,v=E>>>16,w=((m*m>>>17)+m*v>>>15)+v*v,x=((E&4294901760)*E|0)+((E&65535)*E|0);u[_]=w^x}p[0]=u[0]+(u[7]<<16|u[7]>>>16)+(u[6]<<16|u[6]>>>16)|0,p[1]=u[1]+(u[0]<<8|u[0]>>>24)+u[7]|0,p[2]=u[2]+(u[1]<<16|u[1]>>>16)+(u[0]<<16|u[0]>>>16)|0,p[3]=u[3]+(u[2]<<8|u[2]>>>24)+u[1]|0,p[4]=u[4]+(u[3]<<16|u[3]>>>16)+(u[2]<<16|u[2]>>>16)|0,p[5]=u[5]+(u[4]<<8|u[4]>>>24)+u[3]|0,p[6]=u[6]+(u[5]<<16|u[5]>>>16)+(u[4]<<16|u[4]>>>16)|0,p[7]=u[7]+(u[6]<<8|u[6]>>>24)+u[5]|0}n.Rabbit=s._createHelper(d)}(),t.Rabbit})}(x_)),x_.exports}var I_={exports:{}},C_;function FS(){return C_||(C_=1,function(r,e){(function(t,n,i){r.exports=n(It(),Ya(),qa(),Ws(),Pr())})(yt,function(t){return function(){var n=t,i=n.lib,s=i.StreamCipher,o=n.algo,l=[],h=[],u=[],d=o.RabbitLegacy=s.extend({_doReset:function(){var p=this._key.words,g=this.cfg.iv,_=this._X=[p[0],p[3]<<16|p[2]>>>16,p[1],p[0]<<16|p[3]>>>16,p[2],p[1]<<16|p[0]>>>16,p[3],p[2]<<16|p[1]>>>16],E=this._C=[p[2]<<16|p[2]>>>16,p[0]&4294901760|p[1]&65535,p[3]<<16|p[3]>>>16,p[1]&4294901760|p[2]&65535,p[0]<<16|p[0]>>>16,p[2]&4294901760|p[3]&65535,p[1]<<16|p[1]>>>16,p[3]&4294901760|p[0]&65535];this._b=0;for(var m=0;m<4;m++)A.call(this);for(var m=0;m<8;m++)E[m]^=_[m+4&7];if(g){var v=g.words,w=v[0],x=v[1],I=(w<<8|w>>>24)&16711935|(w<<24|w>>>8)&4278255360,R=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360,S=I>>>16|R&4294901760,T=R<<16|I&65535;E[0]^=I,E[1]^=S,E[2]^=R,E[3]^=T,E[4]^=I,E[5]^=S,E[6]^=R,E[7]^=T;for(var m=0;m<4;m++)A.call(this)}},_doProcessBlock:function(p,g){var _=this._X;A.call(this),l[0]=_[0]^_[5]>>>16^_[3]<<16,l[1]=_[2]^_[7]>>>16^_[5]<<16,l[2]=_[4]^_[1]>>>16^_[7]<<16,l[3]=_[6]^_[3]>>>16^_[1]<<16;for(var E=0;E<4;E++)l[E]=(l[E]<<8|l[E]>>>24)&16711935|(l[E]<<24|l[E]>>>8)&4278255360,p[g+E]^=l[E]},blockSize:128/32,ivSize:64/32});function A(){for(var p=this._X,g=this._C,_=0;_<8;_++)h[_]=g[_];g[0]=g[0]+1295307597+this._b|0,g[1]=g[1]+3545052371+(g[0]>>>0<h[0]>>>0?1:0)|0,g[2]=g[2]+886263092+(g[1]>>>0<h[1]>>>0?1:0)|0,g[3]=g[3]+1295307597+(g[2]>>>0<h[2]>>>0?1:0)|0,g[4]=g[4]+3545052371+(g[3]>>>0<h[3]>>>0?1:0)|0,g[5]=g[5]+886263092+(g[4]>>>0<h[4]>>>0?1:0)|0,g[6]=g[6]+1295307597+(g[5]>>>0<h[5]>>>0?1:0)|0,g[7]=g[7]+3545052371+(g[6]>>>0<h[6]>>>0?1:0)|0,this._b=g[7]>>>0<h[7]>>>0?1:0;for(var _=0;_<8;_++){var E=p[_]+g[_],m=E&65535,v=E>>>16,w=((m*m>>>17)+m*v>>>15)+v*v,x=((E&4294901760)*E|0)+((E&65535)*E|0);u[_]=w^x}p[0]=u[0]+(u[7]<<16|u[7]>>>16)+(u[6]<<16|u[6]>>>16)|0,p[1]=u[1]+(u[0]<<8|u[0]>>>24)+u[7]|0,p[2]=u[2]+(u[1]<<16|u[1]>>>16)+(u[0]<<16|u[0]>>>16)|0,p[3]=u[3]+(u[2]<<8|u[2]>>>24)+u[1]|0,p[4]=u[4]+(u[3]<<16|u[3]>>>16)+(u[2]<<16|u[2]>>>16)|0,p[5]=u[5]+(u[4]<<8|u[4]>>>24)+u[3]|0,p[6]=u[6]+(u[5]<<16|u[5]>>>16)+(u[4]<<16|u[4]>>>16)|0,p[7]=u[7]+(u[6]<<8|u[6]>>>24)+u[5]|0}n.RabbitLegacy=s._createHelper(d)}(),t.RabbitLegacy})}(I_)),I_.exports}var M_={exports:{}},S_;function zS(){return S_||(S_=1,function(r,e){(function(t,n,i){r.exports=n(It(),Ya(),qa(),Ws(),Pr())})(yt,function(t){return function(){var n=t,i=n.lib,s=i.BlockCipher,o=n.algo;const l=16,h=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],u=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]];var d={pbox:[],sbox:[]};function A(m,v){let w=v>>24&255,x=v>>16&255,I=v>>8&255,R=v&255,S=m.sbox[0][w]+m.sbox[1][x];return S=S^m.sbox[2][I],S=S+m.sbox[3][R],S}function p(m,v,w){let x=v,I=w,R;for(let S=0;S<l;++S)x=x^m.pbox[S],I=A(m,x)^I,R=x,x=I,I=R;return R=x,x=I,I=R,I=I^m.pbox[l],x=x^m.pbox[l+1],{left:x,right:I}}function g(m,v,w){let x=v,I=w,R;for(let S=l+1;S>1;--S)x=x^m.pbox[S],I=A(m,x)^I,R=x,x=I,I=R;return R=x,x=I,I=R,I=I^m.pbox[1],x=x^m.pbox[0],{left:x,right:I}}function _(m,v,w){for(let T=0;T<4;T++){m.sbox[T]=[];for(let D=0;D<256;D++)m.sbox[T][D]=u[T][D]}let x=0;for(let T=0;T<l+2;T++)m.pbox[T]=h[T]^v[x],x++,x>=w&&(x=0);let I=0,R=0,S=0;for(let T=0;T<l+2;T+=2)S=p(m,I,R),I=S.left,R=S.right,m.pbox[T]=I,m.pbox[T+1]=R;for(let T=0;T<4;T++)for(let D=0;D<256;D+=2)S=p(m,I,R),I=S.left,R=S.right,m.sbox[T][D]=I,m.sbox[T][D+1]=R;return!0}var E=o.Blowfish=s.extend({_doReset:function(){if(this._keyPriorReset!==this._key){var m=this._keyPriorReset=this._key,v=m.words,w=m.sigBytes/4;_(d,v,w)}},encryptBlock:function(m,v){var w=p(d,m[v],m[v+1]);m[v]=w.left,m[v+1]=w.right},decryptBlock:function(m,v){var w=g(d,m[v],m[v+1]);m[v]=w.left,m[v+1]=w.right},blockSize:64/32,keySize:128/32,ivSize:64/32});n.Blowfish=s._createHelper(E)}(),t.Blowfish})}(M_)),M_.exports}(function(r,e){(function(t,n,i){r.exports=n(It(),kh(),mS(),vS(),Ya(),_S(),qa(),Mv(),Up(),yS(),Lv(),ES(),xS(),wS(),Pp(),IS(),Ws(),Pr(),CS(),MS(),SS(),TS(),BS(),bS(),RS(),DS(),LS(),NS(),US(),PS(),kS(),QS(),OS(),FS(),zS())})(yt,function(t){return t})})(cv);var HS=cv.exports;const kp=nS(HS);/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */const GS=4,T_=0,B_=1,VS=2;function Xo(r){let e=r.length;for(;--e>=0;)r[e]=0}const jS=0,b_=1,WS=2,YS=3,qS=258,Qp=29,Qc=256,Oc=Qc+1+Qp,Ko=30,Op=19,R_=2*Oc+1,Xa=15,Fp=16,XS=7,zp=256,D_=16,L_=17,N_=18,Hp=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]),Qh=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]),KS=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),U_=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),JS=512,ds=new Array((Oc+2)*2);Xo(ds);const Fc=new Array(Ko*2);Xo(Fc);const zc=new Array(JS);Xo(zc);const Hc=new Array(qS-YS+1);Xo(Hc);const Gp=new Array(Qp);Xo(Gp);const Oh=new Array(Ko);Xo(Oh);function Vp(r,e,t,n,i){this.static_tree=r,this.extra_bits=e,this.extra_base=t,this.elems=n,this.max_length=i,this.has_stree=r&&r.length}let P_,k_,Q_;function jp(r,e){this.dyn_tree=r,this.max_code=0,this.stat_desc=e}const O_=r=>r<256?zc[r]:zc[256+(r>>>7)],Gc=(r,e)=>{r.pending_buf[r.pending++]=e&255,r.pending_buf[r.pending++]=e>>>8&255},En=(r,e,t)=>{r.bi_valid>Fp-t?(r.bi_buf|=e<<r.bi_valid&65535,Gc(r,r.bi_buf),r.bi_buf=e>>Fp-r.bi_valid,r.bi_valid+=t-Fp):(r.bi_buf|=e<<r.bi_valid&65535,r.bi_valid+=t)},Gi=(r,e,t)=>{En(r,t[e*2],t[e*2+1])},F_=(r,e)=>{let t=0;do t|=r&1,r>>>=1,t<<=1;while(--e>0);return t>>>1},ZS=r=>{r.bi_valid===16?(Gc(r,r.bi_buf),r.bi_buf=0,r.bi_valid=0):r.bi_valid>=8&&(r.pending_buf[r.pending++]=r.bi_buf&255,r.bi_buf>>=8,r.bi_valid-=8)},$S=(r,e)=>{const t=e.dyn_tree,n=e.max_code,i=e.stat_desc.static_tree,s=e.stat_desc.has_stree,o=e.stat_desc.extra_bits,l=e.stat_desc.extra_base,h=e.stat_desc.max_length;let u,d,A,p,g,_,E=0;for(p=0;p<=Xa;p++)r.bl_count[p]=0;for(t[r.heap[r.heap_max]*2+1]=0,u=r.heap_max+1;u<R_;u++)d=r.heap[u],p=t[t[d*2+1]*2+1]+1,p>h&&(p=h,E++),t[d*2+1]=p,!(d>n)&&(r.bl_count[p]++,g=0,d>=l&&(g=o[d-l]),_=t[d*2],r.opt_len+=_*(p+g),s&&(r.static_len+=_*(i[d*2+1]+g)));if(E!==0){do{for(p=h-1;r.bl_count[p]===0;)p--;r.bl_count[p]--,r.bl_count[p+1]+=2,r.bl_count[h]--,E-=2}while(E>0);for(p=h;p!==0;p--)for(d=r.bl_count[p];d!==0;)A=r.heap[--u],!(A>n)&&(t[A*2+1]!==p&&(r.opt_len+=(p-t[A*2+1])*t[A*2],t[A*2+1]=p),d--)}},z_=(r,e,t)=>{const n=new Array(Xa+1);let i=0,s,o;for(s=1;s<=Xa;s++)i=i+t[s-1]<<1,n[s]=i;for(o=0;o<=e;o++){let l=r[o*2+1];l!==0&&(r[o*2]=F_(n[l]++,l))}},eT=()=>{let r,e,t,n,i;const s=new Array(Xa+1);for(t=0,n=0;n<Qp-1;n++)for(Gp[n]=t,r=0;r<1<<Hp[n];r++)Hc[t++]=n;for(Hc[t-1]=n,i=0,n=0;n<16;n++)for(Oh[n]=i,r=0;r<1<<Qh[n];r++)zc[i++]=n;for(i>>=7;n<Ko;n++)for(Oh[n]=i<<7,r=0;r<1<<Qh[n]-7;r++)zc[256+i++]=n;for(e=0;e<=Xa;e++)s[e]=0;for(r=0;r<=143;)ds[r*2+1]=8,r++,s[8]++;for(;r<=255;)ds[r*2+1]=9,r++,s[9]++;for(;r<=279;)ds[r*2+1]=7,r++,s[7]++;for(;r<=287;)ds[r*2+1]=8,r++,s[8]++;for(z_(ds,Oc+1,s),r=0;r<Ko;r++)Fc[r*2+1]=5,Fc[r*2]=F_(r,5);P_=new Vp(ds,Hp,Qc+1,Oc,Xa),k_=new Vp(Fc,Qh,0,Ko,Xa),Q_=new Vp(new Array(0),KS,0,Op,XS)},H_=r=>{let e;for(e=0;e<Oc;e++)r.dyn_ltree[e*2]=0;for(e=0;e<Ko;e++)r.dyn_dtree[e*2]=0;for(e=0;e<Op;e++)r.bl_tree[e*2]=0;r.dyn_ltree[zp*2]=1,r.opt_len=r.static_len=0,r.sym_next=r.matches=0},G_=r=>{r.bi_valid>8?Gc(r,r.bi_buf):r.bi_valid>0&&(r.pending_buf[r.pending++]=r.bi_buf),r.bi_buf=0,r.bi_valid=0},V_=(r,e,t,n)=>{const i=e*2,s=t*2;return r[i]<r[s]||r[i]===r[s]&&n[e]<=n[t]},Wp=(r,e,t)=>{const n=r.heap[t];let i=t<<1;for(;i<=r.heap_len&&(i<r.heap_len&&V_(e,r.heap[i+1],r.heap[i],r.depth)&&i++,!V_(e,n,r.heap[i],r.depth));)r.heap[t]=r.heap[i],t=i,i<<=1;r.heap[t]=n},j_=(r,e,t)=>{let n,i,s=0,o,l;if(r.sym_next!==0)do n=r.pending_buf[r.sym_buf+s++]&255,n+=(r.pending_buf[r.sym_buf+s++]&255)<<8,i=r.pending_buf[r.sym_buf+s++],n===0?Gi(r,i,e):(o=Hc[i],Gi(r,o+Qc+1,e),l=Hp[o],l!==0&&(i-=Gp[o],En(r,i,l)),n--,o=O_(n),Gi(r,o,t),l=Qh[o],l!==0&&(n-=Oh[o],En(r,n,l)));while(s<r.sym_next);Gi(r,zp,e)},Yp=(r,e)=>{const t=e.dyn_tree,n=e.stat_desc.static_tree,i=e.stat_desc.has_stree,s=e.stat_desc.elems;let o,l,h=-1,u;for(r.heap_len=0,r.heap_max=R_,o=0;o<s;o++)t[o*2]!==0?(r.heap[++r.heap_len]=h=o,r.depth[o]=0):t[o*2+1]=0;for(;r.heap_len<2;)u=r.heap[++r.heap_len]=h<2?++h:0,t[u*2]=1,r.depth[u]=0,r.opt_len--,i&&(r.static_len-=n[u*2+1]);for(e.max_code=h,o=r.heap_len>>1;o>=1;o--)Wp(r,t,o);u=s;do o=r.heap[1],r.heap[1]=r.heap[r.heap_len--],Wp(r,t,1),l=r.heap[1],r.heap[--r.heap_max]=o,r.heap[--r.heap_max]=l,t[u*2]=t[o*2]+t[l*2],r.depth[u]=(r.depth[o]>=r.depth[l]?r.depth[o]:r.depth[l])+1,t[o*2+1]=t[l*2+1]=u,r.heap[1]=u++,Wp(r,t,1);while(r.heap_len>=2);r.heap[--r.heap_max]=r.heap[1],$S(r,e),z_(t,h,r.bl_count)},W_=(r,e,t)=>{let n,i=-1,s,o=e[0*2+1],l=0,h=7,u=4;for(o===0&&(h=138,u=3),e[(t+1)*2+1]=65535,n=0;n<=t;n++)s=o,o=e[(n+1)*2+1],!(++l<h&&s===o)&&(l<u?r.bl_tree[s*2]+=l:s!==0?(s!==i&&r.bl_tree[s*2]++,r.bl_tree[D_*2]++):l<=10?r.bl_tree[L_*2]++:r.bl_tree[N_*2]++,l=0,i=s,o===0?(h=138,u=3):s===o?(h=6,u=3):(h=7,u=4))},Y_=(r,e,t)=>{let n,i=-1,s,o=e[0*2+1],l=0,h=7,u=4;for(o===0&&(h=138,u=3),n=0;n<=t;n++)if(s=o,o=e[(n+1)*2+1],!(++l<h&&s===o)){if(l<u)do Gi(r,s,r.bl_tree);while(--l!==0);else s!==0?(s!==i&&(Gi(r,s,r.bl_tree),l--),Gi(r,D_,r.bl_tree),En(r,l-3,2)):l<=10?(Gi(r,L_,r.bl_tree),En(r,l-3,3)):(Gi(r,N_,r.bl_tree),En(r,l-11,7));l=0,i=s,o===0?(h=138,u=3):s===o?(h=6,u=3):(h=7,u=4)}},tT=r=>{let e;for(W_(r,r.dyn_ltree,r.l_desc.max_code),W_(r,r.dyn_dtree,r.d_desc.max_code),Yp(r,r.bl_desc),e=Op-1;e>=3&&r.bl_tree[U_[e]*2+1]===0;e--);return r.opt_len+=3*(e+1)+5+5+4,e},rT=(r,e,t,n)=>{let i;for(En(r,e-257,5),En(r,t-1,5),En(r,n-4,4),i=0;i<n;i++)En(r,r.bl_tree[U_[i]*2+1],3);Y_(r,r.dyn_ltree,e-1),Y_(r,r.dyn_dtree,t-1)},nT=r=>{let e=4093624447,t;for(t=0;t<=31;t++,e>>>=1)if(e&1&&r.dyn_ltree[t*2]!==0)return T_;if(r.dyn_ltree[9*2]!==0||r.dyn_ltree[10*2]!==0||r.dyn_ltree[13*2]!==0)return B_;for(t=32;t<Qc;t++)if(r.dyn_ltree[t*2]!==0)return B_;return T_};let q_=!1;const iT=r=>{q_||(eT(),q_=!0),r.l_desc=new jp(r.dyn_ltree,P_),r.d_desc=new jp(r.dyn_dtree,k_),r.bl_desc=new jp(r.bl_tree,Q_),r.bi_buf=0,r.bi_valid=0,H_(r)},X_=(r,e,t,n)=>{En(r,(jS<<1)+(n?1:0),3),G_(r),Gc(r,t),Gc(r,~t),t&&r.pending_buf.set(r.window.subarray(e,e+t),r.pending),r.pending+=t},sT=r=>{En(r,b_<<1,3),Gi(r,zp,ds),ZS(r)},aT=(r,e,t,n)=>{let i,s,o=0;r.level>0?(r.strm.data_type===VS&&(r.strm.data_type=nT(r)),Yp(r,r.l_desc),Yp(r,r.d_desc),o=tT(r),i=r.opt_len+3+7>>>3,s=r.static_len+3+7>>>3,s<=i&&(i=s)):i=s=t+5,t+4<=i&&e!==-1?X_(r,e,t,n):r.strategy===GS||s===i?(En(r,(b_<<1)+(n?1:0),3),j_(r,ds,Fc)):(En(r,(WS<<1)+(n?1:0),3),rT(r,r.l_desc.max_code+1,r.d_desc.max_code+1,o+1),j_(r,r.dyn_ltree,r.dyn_dtree)),H_(r),n&&G_(r)},oT=(r,e,t)=>(r.pending_buf[r.sym_buf+r.sym_next++]=e,r.pending_buf[r.sym_buf+r.sym_next++]=e>>8,r.pending_buf[r.sym_buf+r.sym_next++]=t,e===0?r.dyn_ltree[t*2]++:(r.matches++,e--,r.dyn_ltree[(Hc[t]+Qc+1)*2]++,r.dyn_dtree[O_(e)*2]++),r.sym_next===r.sym_end);var lT=iT,cT=X_,uT=aT,hT=oT,dT=sT,fT={_tr_init:lT,_tr_stored_block:cT,_tr_flush_block:uT,_tr_tally:hT,_tr_align:dT},Vc=(r,e,t,n)=>{let i=r&65535|0,s=r>>>16&65535|0,o=0;for(;t!==0;){o=t>2e3?2e3:t,t-=o;do i=i+e[n++]|0,s=s+i|0;while(--o);i%=65521,s%=65521}return i|s<<16|0};const pT=()=>{let r,e=[];for(var t=0;t<256;t++){r=t;for(var n=0;n<8;n++)r=r&1?3988292384^r>>>1:r>>>1;e[t]=r}return e},AT=new Uint32Array(pT());var kr=(r,e,t,n)=>{const i=AT,s=n+t;r^=-1;for(let o=n;o<s;o++)r=r>>>8^i[(r^e[o])&255];return r^-1},Ka={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"},Ja={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};const{_tr_init:gT,_tr_stored_block:qp,_tr_flush_block:mT,_tr_tally:Ys,_tr_align:vT}=fT,{Z_NO_FLUSH:qs,Z_PARTIAL_FLUSH:_T,Z_FULL_FLUSH:yT,Z_FINISH:ni,Z_BLOCK:K_,Z_OK:qr,Z_STREAM_END:J_,Z_STREAM_ERROR:Vi,Z_DATA_ERROR:ET,Z_BUF_ERROR:Xp,Z_DEFAULT_COMPRESSION:xT,Z_FILTERED:wT,Z_HUFFMAN_ONLY:Fh,Z_RLE:IT,Z_FIXED:CT,Z_DEFAULT_STRATEGY:MT,Z_UNKNOWN:ST,Z_DEFLATED:zh}=Ja,TT=9,BT=15,bT=8,RT=29,DT=256,Kp=DT+1+RT,LT=30,NT=19,UT=2*Kp+1,PT=15,Ct=3,Xs=258,ji=Xs+Ct+1,kT=32,Jo=42,Jp=57,Zp=69,$p=73,eA=91,tA=103,Za=113,jc=666,ln=1,Zo=2,$a=3,$o=4,QT=3,eo=(r,e)=>(r.msg=Ka[e],e),Z_=r=>r*2-(r>4?9:0),Ks=r=>{let e=r.length;for(;--e>=0;)r[e]=0},OT=r=>{let e,t,n,i=r.w_size;e=r.hash_size,n=e;do t=r.head[--n],r.head[n]=t>=i?t-i:0;while(--e);e=i,n=e;do t=r.prev[--n],r.prev[n]=t>=i?t-i:0;while(--e)};let FT=(r,e,t)=>(e<<r.hash_shift^t)&r.hash_mask,Js=FT;const Fn=r=>{const e=r.state;let t=e.pending;t>r.avail_out&&(t=r.avail_out),t!==0&&(r.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+t),r.next_out),r.next_out+=t,e.pending_out+=t,r.total_out+=t,r.avail_out-=t,e.pending-=t,e.pending===0&&(e.pending_out=0))},zn=(r,e)=>{mT(r,r.block_start>=0?r.block_start:-1,r.strstart-r.block_start,e),r.block_start=r.strstart,Fn(r.strm)},Dt=(r,e)=>{r.pending_buf[r.pending++]=e},Wc=(r,e)=>{r.pending_buf[r.pending++]=e>>>8&255,r.pending_buf[r.pending++]=e&255},rA=(r,e,t,n)=>{let i=r.avail_in;return i>n&&(i=n),i===0?0:(r.avail_in-=i,e.set(r.input.subarray(r.next_in,r.next_in+i),t),r.state.wrap===1?r.adler=Vc(r.adler,e,i,t):r.state.wrap===2&&(r.adler=kr(r.adler,e,i,t)),r.next_in+=i,r.total_in+=i,i)},$_=(r,e)=>{let t=r.max_chain_length,n=r.strstart,i,s,o=r.prev_length,l=r.nice_match;const h=r.strstart>r.w_size-ji?r.strstart-(r.w_size-ji):0,u=r.window,d=r.w_mask,A=r.prev,p=r.strstart+Xs;let g=u[n+o-1],_=u[n+o];r.prev_length>=r.good_match&&(t>>=2),l>r.lookahead&&(l=r.lookahead);do if(i=e,!(u[i+o]!==_||u[i+o-1]!==g||u[i]!==u[n]||u[++i]!==u[n+1])){n+=2,i++;do;while(u[++n]===u[++i]&&u[++n]===u[++i]&&u[++n]===u[++i]&&u[++n]===u[++i]&&u[++n]===u[++i]&&u[++n]===u[++i]&&u[++n]===u[++i]&&u[++n]===u[++i]&&n<p);if(s=Xs-(p-n),n=p-Xs,s>o){if(r.match_start=e,o=s,s>=l)break;g=u[n+o-1],_=u[n+o]}}while((e=A[e&d])>h&&--t!==0);return o<=r.lookahead?o:r.lookahead},el=r=>{const e=r.w_size;let t,n,i;do{if(n=r.window_size-r.lookahead-r.strstart,r.strstart>=e+(e-ji)&&(r.window.set(r.window.subarray(e,e+e-n),0),r.match_start-=e,r.strstart-=e,r.block_start-=e,r.insert>r.strstart&&(r.insert=r.strstart),OT(r),n+=e),r.strm.avail_in===0)break;if(t=rA(r.strm,r.window,r.strstart+r.lookahead,n),r.lookahead+=t,r.lookahead+r.insert>=Ct)for(i=r.strstart-r.insert,r.ins_h=r.window[i],r.ins_h=Js(r,r.ins_h,r.window[i+1]);r.insert&&(r.ins_h=Js(r,r.ins_h,r.window[i+Ct-1]),r.prev[i&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=i,i++,r.insert--,!(r.lookahead+r.insert<Ct)););}while(r.lookahead<ji&&r.strm.avail_in!==0)},ey=(r,e)=>{let t=r.pending_buf_size-5>r.w_size?r.w_size:r.pending_buf_size-5,n,i,s,o=0,l=r.strm.avail_in;do{if(n=65535,s=r.bi_valid+42>>3,r.strm.avail_out<s||(s=r.strm.avail_out-s,i=r.strstart-r.block_start,n>i+r.strm.avail_in&&(n=i+r.strm.avail_in),n>s&&(n=s),n<t&&(n===0&&e!==ni||e===qs||n!==i+r.strm.avail_in)))break;o=e===ni&&n===i+r.strm.avail_in?1:0,qp(r,0,0,o),r.pending_buf[r.pending-4]=n,r.pending_buf[r.pending-3]=n>>8,r.pending_buf[r.pending-2]=~n,r.pending_buf[r.pending-1]=~n>>8,Fn(r.strm),i&&(i>n&&(i=n),r.strm.output.set(r.window.subarray(r.block_start,r.block_start+i),r.strm.next_out),r.strm.next_out+=i,r.strm.avail_out-=i,r.strm.total_out+=i,r.block_start+=i,n-=i),n&&(rA(r.strm,r.strm.output,r.strm.next_out,n),r.strm.next_out+=n,r.strm.avail_out-=n,r.strm.total_out+=n)}while(o===0);return l-=r.strm.avail_in,l&&(l>=r.w_size?(r.matches=2,r.window.set(r.strm.input.subarray(r.strm.next_in-r.w_size,r.strm.next_in),0),r.strstart=r.w_size,r.insert=r.strstart):(r.window_size-r.strstart<=l&&(r.strstart-=r.w_size,r.window.set(r.window.subarray(r.w_size,r.w_size+r.strstart),0),r.matches<2&&r.matches++,r.insert>r.strstart&&(r.insert=r.strstart)),r.window.set(r.strm.input.subarray(r.strm.next_in-l,r.strm.next_in),r.strstart),r.strstart+=l,r.insert+=l>r.w_size-r.insert?r.w_size-r.insert:l),r.block_start=r.strstart),r.high_water<r.strstart&&(r.high_water=r.strstart),o?$o:e!==qs&&e!==ni&&r.strm.avail_in===0&&r.strstart===r.block_start?Zo:(s=r.window_size-r.strstart,r.strm.avail_in>s&&r.block_start>=r.w_size&&(r.block_start-=r.w_size,r.strstart-=r.w_size,r.window.set(r.window.subarray(r.w_size,r.w_size+r.strstart),0),r.matches<2&&r.matches++,s+=r.w_size,r.insert>r.strstart&&(r.insert=r.strstart)),s>r.strm.avail_in&&(s=r.strm.avail_in),s&&(rA(r.strm,r.window,r.strstart,s),r.strstart+=s,r.insert+=s>r.w_size-r.insert?r.w_size-r.insert:s),r.high_water<r.strstart&&(r.high_water=r.strstart),s=r.bi_valid+42>>3,s=r.pending_buf_size-s>65535?65535:r.pending_buf_size-s,t=s>r.w_size?r.w_size:s,i=r.strstart-r.block_start,(i>=t||(i||e===ni)&&e!==qs&&r.strm.avail_in===0&&i<=s)&&(n=i>s?s:i,o=e===ni&&r.strm.avail_in===0&&n===i?1:0,qp(r,r.block_start,n,o),r.block_start+=n,Fn(r.strm)),o?$a:ln)},nA=(r,e)=>{let t,n;for(;;){if(r.lookahead<ji){if(el(r),r.lookahead<ji&&e===qs)return ln;if(r.lookahead===0)break}if(t=0,r.lookahead>=Ct&&(r.ins_h=Js(r,r.ins_h,r.window[r.strstart+Ct-1]),t=r.prev[r.strstart&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=r.strstart),t!==0&&r.strstart-t<=r.w_size-ji&&(r.match_length=$_(r,t)),r.match_length>=Ct)if(n=Ys(r,r.strstart-r.match_start,r.match_length-Ct),r.lookahead-=r.match_length,r.match_length<=r.max_lazy_match&&r.lookahead>=Ct){r.match_length--;do r.strstart++,r.ins_h=Js(r,r.ins_h,r.window[r.strstart+Ct-1]),t=r.prev[r.strstart&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=r.strstart;while(--r.match_length!==0);r.strstart++}else r.strstart+=r.match_length,r.match_length=0,r.ins_h=r.window[r.strstart],r.ins_h=Js(r,r.ins_h,r.window[r.strstart+1]);else n=Ys(r,0,r.window[r.strstart]),r.lookahead--,r.strstart++;if(n&&(zn(r,!1),r.strm.avail_out===0))return ln}return r.insert=r.strstart<Ct-1?r.strstart:Ct-1,e===ni?(zn(r,!0),r.strm.avail_out===0?$a:$o):r.sym_next&&(zn(r,!1),r.strm.avail_out===0)?ln:Zo},tl=(r,e)=>{let t,n,i;for(;;){if(r.lookahead<ji){if(el(r),r.lookahead<ji&&e===qs)return ln;if(r.lookahead===0)break}if(t=0,r.lookahead>=Ct&&(r.ins_h=Js(r,r.ins_h,r.window[r.strstart+Ct-1]),t=r.prev[r.strstart&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=r.strstart),r.prev_length=r.match_length,r.prev_match=r.match_start,r.match_length=Ct-1,t!==0&&r.prev_length<r.max_lazy_match&&r.strstart-t<=r.w_size-ji&&(r.match_length=$_(r,t),r.match_length<=5&&(r.strategy===wT||r.match_length===Ct&&r.strstart-r.match_start>4096)&&(r.match_length=Ct-1)),r.prev_length>=Ct&&r.match_length<=r.prev_length){i=r.strstart+r.lookahead-Ct,n=Ys(r,r.strstart-1-r.prev_match,r.prev_length-Ct),r.lookahead-=r.prev_length-1,r.prev_length-=2;do++r.strstart<=i&&(r.ins_h=Js(r,r.ins_h,r.window[r.strstart+Ct-1]),t=r.prev[r.strstart&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=r.strstart);while(--r.prev_length!==0);if(r.match_available=0,r.match_length=Ct-1,r.strstart++,n&&(zn(r,!1),r.strm.avail_out===0))return ln}else if(r.match_available){if(n=Ys(r,0,r.window[r.strstart-1]),n&&zn(r,!1),r.strstart++,r.lookahead--,r.strm.avail_out===0)return ln}else r.match_available=1,r.strstart++,r.lookahead--}return r.match_available&&(n=Ys(r,0,r.window[r.strstart-1]),r.match_available=0),r.insert=r.strstart<Ct-1?r.strstart:Ct-1,e===ni?(zn(r,!0),r.strm.avail_out===0?$a:$o):r.sym_next&&(zn(r,!1),r.strm.avail_out===0)?ln:Zo},zT=(r,e)=>{let t,n,i,s;const o=r.window;for(;;){if(r.lookahead<=Xs){if(el(r),r.lookahead<=Xs&&e===qs)return ln;if(r.lookahead===0)break}if(r.match_length=0,r.lookahead>=Ct&&r.strstart>0&&(i=r.strstart-1,n=o[i],n===o[++i]&&n===o[++i]&&n===o[++i])){s=r.strstart+Xs;do;while(n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&n===o[++i]&&i<s);r.match_length=Xs-(s-i),r.match_length>r.lookahead&&(r.match_length=r.lookahead)}if(r.match_length>=Ct?(t=Ys(r,1,r.match_length-Ct),r.lookahead-=r.match_length,r.strstart+=r.match_length,r.match_length=0):(t=Ys(r,0,r.window[r.strstart]),r.lookahead--,r.strstart++),t&&(zn(r,!1),r.strm.avail_out===0))return ln}return r.insert=0,e===ni?(zn(r,!0),r.strm.avail_out===0?$a:$o):r.sym_next&&(zn(r,!1),r.strm.avail_out===0)?ln:Zo},HT=(r,e)=>{let t;for(;;){if(r.lookahead===0&&(el(r),r.lookahead===0)){if(e===qs)return ln;break}if(r.match_length=0,t=Ys(r,0,r.window[r.strstart]),r.lookahead--,r.strstart++,t&&(zn(r,!1),r.strm.avail_out===0))return ln}return r.insert=0,e===ni?(zn(r,!0),r.strm.avail_out===0?$a:$o):r.sym_next&&(zn(r,!1),r.strm.avail_out===0)?ln:Zo};function Wi(r,e,t,n,i){this.good_length=r,this.max_lazy=e,this.nice_length=t,this.max_chain=n,this.func=i}const Yc=[new Wi(0,0,0,0,ey),new Wi(4,4,8,4,nA),new Wi(4,5,16,8,nA),new Wi(4,6,32,32,nA),new Wi(4,4,16,16,tl),new Wi(8,16,32,32,tl),new Wi(8,16,128,128,tl),new Wi(8,32,128,256,tl),new Wi(32,128,258,1024,tl),new Wi(32,258,258,4096,tl)],GT=r=>{r.window_size=2*r.w_size,Ks(r.head),r.max_lazy_match=Yc[r.level].max_lazy,r.good_match=Yc[r.level].good_length,r.nice_match=Yc[r.level].nice_length,r.max_chain_length=Yc[r.level].max_chain,r.strstart=0,r.block_start=0,r.lookahead=0,r.insert=0,r.match_length=r.prev_length=Ct-1,r.match_available=0,r.ins_h=0};function VT(){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=zh,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(UT*2),this.dyn_dtree=new Uint16Array((2*LT+1)*2),this.bl_tree=new Uint16Array((2*NT+1)*2),Ks(this.dyn_ltree),Ks(this.dyn_dtree),Ks(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(PT+1),this.heap=new Uint16Array(2*Kp+1),Ks(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*Kp+1),Ks(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}const qc=r=>{if(!r)return 1;const e=r.state;return!e||e.strm!==r||e.status!==Jo&&e.status!==Jp&&e.status!==Zp&&e.status!==$p&&e.status!==eA&&e.status!==tA&&e.status!==Za&&e.status!==jc?1:0},ty=r=>{if(qc(r))return eo(r,Vi);r.total_in=r.total_out=0,r.data_type=ST;const e=r.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap===2?Jp:e.wrap?Jo:Za,r.adler=e.wrap===2?0:1,e.last_flush=-2,gT(e),qr},ry=r=>{const e=ty(r);return e===qr&&GT(r.state),e},jT=(r,e)=>qc(r)||r.state.wrap!==2?Vi:(r.state.gzhead=e,qr),ny=(r,e,t,n,i,s)=>{if(!r)return Vi;let o=1;if(e===xT&&(e=6),n<0?(o=0,n=-n):n>15&&(o=2,n-=16),i<1||i>TT||t!==zh||n<8||n>15||e<0||e>9||s<0||s>CT||n===8&&o!==1)return eo(r,Vi);n===8&&(n=9);const l=new VT;return r.state=l,l.strm=r,l.status=Jo,l.wrap=o,l.gzhead=null,l.w_bits=n,l.w_size=1<<l.w_bits,l.w_mask=l.w_size-1,l.hash_bits=i+7,l.hash_size=1<<l.hash_bits,l.hash_mask=l.hash_size-1,l.hash_shift=~~((l.hash_bits+Ct-1)/Ct),l.window=new Uint8Array(l.w_size*2),l.head=new Uint16Array(l.hash_size),l.prev=new Uint16Array(l.w_size),l.lit_bufsize=1<<i+6,l.pending_buf_size=l.lit_bufsize*4,l.pending_buf=new Uint8Array(l.pending_buf_size),l.sym_buf=l.lit_bufsize,l.sym_end=(l.lit_bufsize-1)*3,l.level=e,l.strategy=s,l.method=t,ry(r)},WT=(r,e)=>ny(r,e,zh,BT,bT,MT),YT=(r,e)=>{if(qc(r)||e>K_||e<0)return r?eo(r,Vi):Vi;const t=r.state;if(!r.output||r.avail_in!==0&&!r.input||t.status===jc&&e!==ni)return eo(r,r.avail_out===0?Xp:Vi);const n=t.last_flush;if(t.last_flush=e,t.pending!==0){if(Fn(r),r.avail_out===0)return t.last_flush=-1,qr}else if(r.avail_in===0&&Z_(e)<=Z_(n)&&e!==ni)return eo(r,Xp);if(t.status===jc&&r.avail_in!==0)return eo(r,Xp);if(t.status===Jo&&t.wrap===0&&(t.status=Za),t.status===Jo){let i=zh+(t.w_bits-8<<4)<<8,s=-1;if(t.strategy>=Fh||t.level<2?s=0:t.level<6?s=1:t.level===6?s=2:s=3,i|=s<<6,t.strstart!==0&&(i|=kT),i+=31-i%31,Wc(t,i),t.strstart!==0&&(Wc(t,r.adler>>>16),Wc(t,r.adler&65535)),r.adler=1,t.status=Za,Fn(r),t.pending!==0)return t.last_flush=-1,qr}if(t.status===Jp){if(r.adler=0,Dt(t,31),Dt(t,139),Dt(t,8),t.gzhead)Dt(t,(t.gzhead.text?1:0)+(t.gzhead.hcrc?2:0)+(t.gzhead.extra?4:0)+(t.gzhead.name?8:0)+(t.gzhead.comment?16:0)),Dt(t,t.gzhead.time&255),Dt(t,t.gzhead.time>>8&255),Dt(t,t.gzhead.time>>16&255),Dt(t,t.gzhead.time>>24&255),Dt(t,t.level===9?2:t.strategy>=Fh||t.level<2?4:0),Dt(t,t.gzhead.os&255),t.gzhead.extra&&t.gzhead.extra.length&&(Dt(t,t.gzhead.extra.length&255),Dt(t,t.gzhead.extra.length>>8&255)),t.gzhead.hcrc&&(r.adler=kr(r.adler,t.pending_buf,t.pending,0)),t.gzindex=0,t.status=Zp;else if(Dt(t,0),Dt(t,0),Dt(t,0),Dt(t,0),Dt(t,0),Dt(t,t.level===9?2:t.strategy>=Fh||t.level<2?4:0),Dt(t,QT),t.status=Za,Fn(r),t.pending!==0)return t.last_flush=-1,qr}if(t.status===Zp){if(t.gzhead.extra){let i=t.pending,s=(t.gzhead.extra.length&65535)-t.gzindex;for(;t.pending+s>t.pending_buf_size;){let l=t.pending_buf_size-t.pending;if(t.pending_buf.set(t.gzhead.extra.subarray(t.gzindex,t.gzindex+l),t.pending),t.pending=t.pending_buf_size,t.gzhead.hcrc&&t.pending>i&&(r.adler=kr(r.adler,t.pending_buf,t.pending-i,i)),t.gzindex+=l,Fn(r),t.pending!==0)return t.last_flush=-1,qr;i=0,s-=l}let o=new Uint8Array(t.gzhead.extra);t.pending_buf.set(o.subarray(t.gzindex,t.gzindex+s),t.pending),t.pending+=s,t.gzhead.hcrc&&t.pending>i&&(r.adler=kr(r.adler,t.pending_buf,t.pending-i,i)),t.gzindex=0}t.status=$p}if(t.status===$p){if(t.gzhead.name){let i=t.pending,s;do{if(t.pending===t.pending_buf_size){if(t.gzhead.hcrc&&t.pending>i&&(r.adler=kr(r.adler,t.pending_buf,t.pending-i,i)),Fn(r),t.pending!==0)return t.last_flush=-1,qr;i=0}t.gzindex<t.gzhead.name.length?s=t.gzhead.name.charCodeAt(t.gzindex++)&255:s=0,Dt(t,s)}while(s!==0);t.gzhead.hcrc&&t.pending>i&&(r.adler=kr(r.adler,t.pending_buf,t.pending-i,i)),t.gzindex=0}t.status=eA}if(t.status===eA){if(t.gzhead.comment){let i=t.pending,s;do{if(t.pending===t.pending_buf_size){if(t.gzhead.hcrc&&t.pending>i&&(r.adler=kr(r.adler,t.pending_buf,t.pending-i,i)),Fn(r),t.pending!==0)return t.last_flush=-1,qr;i=0}t.gzindex<t.gzhead.comment.length?s=t.gzhead.comment.charCodeAt(t.gzindex++)&255:s=0,Dt(t,s)}while(s!==0);t.gzhead.hcrc&&t.pending>i&&(r.adler=kr(r.adler,t.pending_buf,t.pending-i,i))}t.status=tA}if(t.status===tA){if(t.gzhead.hcrc){if(t.pending+2>t.pending_buf_size&&(Fn(r),t.pending!==0))return t.last_flush=-1,qr;Dt(t,r.adler&255),Dt(t,r.adler>>8&255),r.adler=0}if(t.status=Za,Fn(r),t.pending!==0)return t.last_flush=-1,qr}if(r.avail_in!==0||t.lookahead!==0||e!==qs&&t.status!==jc){let i=t.level===0?ey(t,e):t.strategy===Fh?HT(t,e):t.strategy===IT?zT(t,e):Yc[t.level].func(t,e);if((i===$a||i===$o)&&(t.status=jc),i===ln||i===$a)return r.avail_out===0&&(t.last_flush=-1),qr;if(i===Zo&&(e===_T?vT(t):e!==K_&&(qp(t,0,0,!1),e===yT&&(Ks(t.head),t.lookahead===0&&(t.strstart=0,t.block_start=0,t.insert=0))),Fn(r),r.avail_out===0))return t.last_flush=-1,qr}return e!==ni?qr:t.wrap<=0?J_:(t.wrap===2?(Dt(t,r.adler&255),Dt(t,r.adler>>8&255),Dt(t,r.adler>>16&255),Dt(t,r.adler>>24&255),Dt(t,r.total_in&255),Dt(t,r.total_in>>8&255),Dt(t,r.total_in>>16&255),Dt(t,r.total_in>>24&255)):(Wc(t,r.adler>>>16),Wc(t,r.adler&65535)),Fn(r),t.wrap>0&&(t.wrap=-t.wrap),t.pending!==0?qr:J_)},qT=r=>{if(qc(r))return Vi;const e=r.state.status;return r.state=null,e===Za?eo(r,ET):qr},XT=(r,e)=>{let t=e.length;if(qc(r))return Vi;const n=r.state,i=n.wrap;if(i===2||i===1&&n.status!==Jo||n.lookahead)return Vi;if(i===1&&(r.adler=Vc(r.adler,e,t,0)),n.wrap=0,t>=n.w_size){i===0&&(Ks(n.head),n.strstart=0,n.block_start=0,n.insert=0);let h=new Uint8Array(n.w_size);h.set(e.subarray(t-n.w_size,t),0),e=h,t=n.w_size}const s=r.avail_in,o=r.next_in,l=r.input;for(r.avail_in=t,r.next_in=0,r.input=e,el(n);n.lookahead>=Ct;){let h=n.strstart,u=n.lookahead-(Ct-1);do n.ins_h=Js(n,n.ins_h,n.window[h+Ct-1]),n.prev[h&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=h,h++;while(--u);n.strstart=h,n.lookahead=Ct-1,el(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=Ct-1,n.match_available=0,r.next_in=o,r.input=l,r.avail_in=s,n.wrap=i,qr};var KT=WT,JT=ny,ZT=ry,$T=ty,e4=jT,t4=YT,r4=qT,n4=XT,i4="pako deflate (from Nodeca project)",Xc={deflateInit:KT,deflateInit2:JT,deflateReset:ZT,deflateResetKeep:$T,deflateSetHeader:e4,deflate:t4,deflateEnd:r4,deflateSetDictionary:n4,deflateInfo:i4};const s4=(r,e)=>Object.prototype.hasOwnProperty.call(r,e);var a4=function(r){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const t=e.shift();if(t){if(typeof t!="object")throw new TypeError(t+"must be non-object");for(const n in t)s4(t,n)&&(r[n]=t[n])}}return r},o4=r=>{let e=0;for(let n=0,i=r.length;n<i;n++)e+=r[n].length;const t=new Uint8Array(e);for(let n=0,i=0,s=r.length;n<s;n++){let o=r[n];t.set(o,i),i+=o.length}return t},Hh={assign:a4,flattenChunks:o4};let iy=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{iy=!1}const Kc=new Uint8Array(256);for(let r=0;r<256;r++)Kc[r]=r>=252?6:r>=248?5:r>=240?4:r>=224?3:r>=192?2:1;Kc[254]=Kc[254]=1;var l4=r=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(r);let e,t,n,i,s,o=r.length,l=0;for(i=0;i<o;i++)t=r.charCodeAt(i),(t&64512)===55296&&i+1<o&&(n=r.charCodeAt(i+1),(n&64512)===56320&&(t=65536+(t-55296<<10)+(n-56320),i++)),l+=t<128?1:t<2048?2:t<65536?3:4;for(e=new Uint8Array(l),s=0,i=0;s<l;i++)t=r.charCodeAt(i),(t&64512)===55296&&i+1<o&&(n=r.charCodeAt(i+1),(n&64512)===56320&&(t=65536+(t-55296<<10)+(n-56320),i++)),t<128?e[s++]=t:t<2048?(e[s++]=192|t>>>6,e[s++]=128|t&63):t<65536?(e[s++]=224|t>>>12,e[s++]=128|t>>>6&63,e[s++]=128|t&63):(e[s++]=240|t>>>18,e[s++]=128|t>>>12&63,e[s++]=128|t>>>6&63,e[s++]=128|t&63);return e};const c4=(r,e)=>{if(e<65534&&r.subarray&&iy)return String.fromCharCode.apply(null,r.length===e?r:r.subarray(0,e));let t="";for(let n=0;n<e;n++)t+=String.fromCharCode(r[n]);return t};var u4=(r,e)=>{const t=e||r.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(r.subarray(0,e));let n,i;const s=new Array(t*2);for(i=0,n=0;n<t;){let o=r[n++];if(o<128){s[i++]=o;continue}let l=Kc[o];if(l>4){s[i++]=65533,n+=l-1;continue}for(o&=l===2?31:l===3?15:7;l>1&&n<t;)o=o<<6|r[n++]&63,l--;if(l>1){s[i++]=65533;continue}o<65536?s[i++]=o:(o-=65536,s[i++]=55296|o>>10&1023,s[i++]=56320|o&1023)}return c4(s,i)},h4=(r,e)=>{e=e||r.length,e>r.length&&(e=r.length);let t=e-1;for(;t>=0&&(r[t]&192)===128;)t--;return t<0||t===0?e:t+Kc[r[t]]>e?t:e},Jc={string2buf:l4,buf2string:u4,utf8border:h4};function d4(){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 sy=d4;const ay=Object.prototype.toString,{Z_NO_FLUSH:f4,Z_SYNC_FLUSH:p4,Z_FULL_FLUSH:A4,Z_FINISH:g4,Z_OK:Gh,Z_STREAM_END:m4,Z_DEFAULT_COMPRESSION:v4,Z_DEFAULT_STRATEGY:_4,Z_DEFLATED:y4}=Ja;function Zc(r){this.options=Hh.assign({level:v4,method:y4,chunkSize:16384,windowBits:15,memLevel:8,strategy:_4},r||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new sy,this.strm.avail_out=0;let t=Xc.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(t!==Gh)throw new Error(Ka[t]);if(e.header&&Xc.deflateSetHeader(this.strm,e.header),e.dictionary){let n;if(typeof e.dictionary=="string"?n=Jc.string2buf(e.dictionary):ay.call(e.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(e.dictionary):n=e.dictionary,t=Xc.deflateSetDictionary(this.strm,n),t!==Gh)throw new Error(Ka[t]);this._dict_set=!0}}Zc.prototype.push=function(r,e){const t=this.strm,n=this.options.chunkSize;let i,s;if(this.ended)return!1;for(e===~~e?s=e:s=e===!0?g4:f4,typeof r=="string"?t.input=Jc.string2buf(r):ay.call(r)==="[object ArrayBuffer]"?t.input=new Uint8Array(r):t.input=r,t.next_in=0,t.avail_in=t.input.length;;){if(t.avail_out===0&&(t.output=new Uint8Array(n),t.next_out=0,t.avail_out=n),(s===p4||s===A4)&&t.avail_out<=6){this.onData(t.output.subarray(0,t.next_out)),t.avail_out=0;continue}if(i=Xc.deflate(t,s),i===m4)return t.next_out>0&&this.onData(t.output.subarray(0,t.next_out)),i=Xc.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===Gh;if(t.avail_out===0){this.onData(t.output);continue}if(s>0&&t.next_out>0){this.onData(t.output.subarray(0,t.next_out)),t.avail_out=0;continue}if(t.avail_in===0)break}return!0},Zc.prototype.onData=function(r){this.chunks.push(r)},Zc.prototype.onEnd=function(r){r===Gh&&(this.result=Hh.flattenChunks(this.chunks)),this.chunks=[],this.err=r,this.msg=this.strm.msg};function iA(r,e){const t=new Zc(e);if(t.push(r,!0),t.err)throw t.msg||Ka[t.err];return t.result}function E4(r,e){return e=e||{},e.raw=!0,iA(r,e)}function x4(r,e){return e=e||{},e.gzip=!0,iA(r,e)}var w4=Zc,I4=iA,C4=E4,M4=x4,S4=Ja,T4={Deflate:w4,deflate:I4,deflateRaw:C4,gzip:M4,constants:S4};const Vh=16209,B4=16191;var b4=function(r,e){let t,n,i,s,o,l,h,u,d,A,p,g,_,E,m,v,w,x,I,R,S,T,D,b;const M=r.state;t=r.next_in,D=r.input,n=t+(r.avail_in-5),i=r.next_out,b=r.output,s=i-(e-r.avail_out),o=i+(r.avail_out-257),l=M.dmax,h=M.wsize,u=M.whave,d=M.wnext,A=M.window,p=M.hold,g=M.bits,_=M.lencode,E=M.distcode,m=(1<<M.lenbits)-1,v=(1<<M.distbits)-1;e:do{g<15&&(p+=D[t++]<<g,g+=8,p+=D[t++]<<g,g+=8),w=_[p&m];t:for(;;){if(x=w>>>24,p>>>=x,g-=x,x=w>>>16&255,x===0)b[i++]=w&65535;else if(x&16){I=w&65535,x&=15,x&&(g<x&&(p+=D[t++]<<g,g+=8),I+=p&(1<<x)-1,p>>>=x,g-=x),g<15&&(p+=D[t++]<<g,g+=8,p+=D[t++]<<g,g+=8),w=E[p&v];r:for(;;){if(x=w>>>24,p>>>=x,g-=x,x=w>>>16&255,x&16){if(R=w&65535,x&=15,g<x&&(p+=D[t++]<<g,g+=8,g<x&&(p+=D[t++]<<g,g+=8)),R+=p&(1<<x)-1,R>l){r.msg="invalid distance too far back",M.mode=Vh;break e}if(p>>>=x,g-=x,x=i-s,R>x){if(x=R-x,x>u&&M.sane){r.msg="invalid distance too far back",M.mode=Vh;break e}if(S=0,T=A,d===0){if(S+=h-x,x<I){I-=x;do b[i++]=A[S++];while(--x);S=i-R,T=b}}else if(d<x){if(S+=h+d-x,x-=d,x<I){I-=x;do b[i++]=A[S++];while(--x);if(S=0,d<I){x=d,I-=x;do b[i++]=A[S++];while(--x);S=i-R,T=b}}}else if(S+=d-x,x<I){I-=x;do b[i++]=A[S++];while(--x);S=i-R,T=b}for(;I>2;)b[i++]=T[S++],b[i++]=T[S++],b[i++]=T[S++],I-=3;I&&(b[i++]=T[S++],I>1&&(b[i++]=T[S++]))}else{S=i-R;do b[i++]=b[S++],b[i++]=b[S++],b[i++]=b[S++],I-=3;while(I>2);I&&(b[i++]=b[S++],I>1&&(b[i++]=b[S++]))}}else if(x&64){r.msg="invalid distance code",M.mode=Vh;break e}else{w=E[(w&65535)+(p&(1<<x)-1)];continue r}break}}else if(x&64)if(x&32){M.mode=B4;break e}else{r.msg="invalid literal/length code",M.mode=Vh;break e}else{w=_[(w&65535)+(p&(1<<x)-1)];continue t}break}}while(t<n&&i<o);I=g>>3,t-=I,g-=I<<3,p&=(1<<g)-1,r.next_in=t,r.next_out=i,r.avail_in=t<n?5+(n-t):5-(t-n),r.avail_out=i<o?257+(o-i):257-(i-o),M.hold=p,M.bits=g};const rl=15,oy=852,ly=592,cy=0,sA=1,uy=2,R4=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]),D4=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]),L4=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]),N4=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]);var $c=(r,e,t,n,i,s,o,l)=>{const h=l.bits;let u=0,d=0,A=0,p=0,g=0,_=0,E=0,m=0,v=0,w=0,x,I,R,S,T,D=null,b;const M=new Uint16Array(rl+1),L=new Uint16Array(rl+1);let P=null,N,W,X;for(u=0;u<=rl;u++)M[u]=0;for(d=0;d<n;d++)M[e[t+d]]++;for(g=h,p=rl;p>=1&&M[p]===0;p--);if(g>p&&(g=p),p===0)return i[s++]=1<<24|64<<16|0,i[s++]=1<<24|64<<16|0,l.bits=1,0;for(A=1;A<p&&M[A]===0;A++);for(g<A&&(g=A),m=1,u=1;u<=rl;u++)if(m<<=1,m-=M[u],m<0)return-1;if(m>0&&(r===cy||p!==1))return-1;for(L[1]=0,u=1;u<rl;u++)L[u+1]=L[u]+M[u];for(d=0;d<n;d++)e[t+d]!==0&&(o[L[e[t+d]]++]=d);if(r===cy?(D=P=o,b=20):r===sA?(D=R4,P=D4,b=257):(D=L4,P=N4,b=0),w=0,d=0,u=A,T=s,_=g,E=0,R=-1,v=1<<g,S=v-1,r===sA&&v>oy||r===uy&&v>ly)return 1;for(;;){N=u-E,o[d]+1<b?(W=0,X=o[d]):o[d]>=b?(W=P[o[d]-b],X=D[o[d]-b]):(W=32+64,X=0),x=1<<u-E,I=1<<_,A=I;do I-=x,i[T+(w>>E)+I]=N<<24|W<<16|X|0;while(I!==0);for(x=1<<u-1;w&x;)x>>=1;if(x!==0?(w&=x-1,w+=x):w=0,d++,--M[u]===0){if(u===p)break;u=e[t+o[d]]}if(u>g&&(w&S)!==R){for(E===0&&(E=g),T+=A,_=u-E,m=1<<_;_+E<p&&(m-=M[_+E],!(m<=0));)_++,m<<=1;if(v+=1<<_,r===sA&&v>oy||r===uy&&v>ly)return 1;R=w&S,i[R]=g<<24|_<<16|T-s|0}}return w!==0&&(i[T+w]=u-E<<24|64<<16|0),l.bits=g,0};const U4=0,hy=1,dy=2,{Z_FINISH:fy,Z_BLOCK:P4,Z_TREES:jh,Z_OK:to,Z_STREAM_END:k4,Z_NEED_DICT:Q4,Z_STREAM_ERROR:Ei,Z_DATA_ERROR:py,Z_MEM_ERROR:Ay,Z_BUF_ERROR:O4,Z_DEFLATED:gy}=Ja,Wh=16180,my=16181,vy=16182,_y=16183,yy=16184,Ey=16185,xy=16186,wy=16187,Iy=16188,Cy=16189,Yh=16190,fs=16191,aA=16192,My=16193,oA=16194,Sy=16195,Ty=16196,By=16197,by=16198,qh=16199,Xh=16200,Ry=16201,Dy=16202,Ly=16203,Ny=16204,Uy=16205,lA=16206,Py=16207,ky=16208,Jt=16209,Qy=16210,Oy=16211,F4=852,z4=592,H4=15,G4=H4,Fy=r=>(r>>>24&255)+(r>>>8&65280)+((r&65280)<<8)+((r&255)<<24);function V4(){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}const ro=r=>{if(!r)return 1;const e=r.state;return!e||e.strm!==r||e.mode<Wh||e.mode>Oy?1:0},zy=r=>{if(ro(r))return Ei;const e=r.state;return r.total_in=r.total_out=e.total=0,r.msg="",e.wrap&&(r.adler=e.wrap&1),e.mode=Wh,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(F4),e.distcode=e.distdyn=new Int32Array(z4),e.sane=1,e.back=-1,to},Hy=r=>{if(ro(r))return Ei;const e=r.state;return e.wsize=0,e.whave=0,e.wnext=0,zy(r)},Gy=(r,e)=>{let t;if(ro(r))return Ei;const n=r.state;return e<0?(t=0,e=-e):(t=(e>>4)+5,e<48&&(e&=15)),e&&(e<8||e>15)?Ei:(n.window!==null&&n.wbits!==e&&(n.window=null),n.wrap=t,n.wbits=e,Hy(r))},Vy=(r,e)=>{if(!r)return Ei;const t=new V4;r.state=t,t.strm=r,t.window=null,t.mode=Wh;const n=Gy(r,e);return n!==to&&(r.state=null),n},j4=r=>Vy(r,G4);let jy=!0,cA,uA;const W4=r=>{if(jy){cA=new Int32Array(512),uA=new Int32Array(32);let e=0;for(;e<144;)r.lens[e++]=8;for(;e<256;)r.lens[e++]=9;for(;e<280;)r.lens[e++]=7;for(;e<288;)r.lens[e++]=8;for($c(hy,r.lens,0,288,cA,0,r.work,{bits:9}),e=0;e<32;)r.lens[e++]=5;$c(dy,r.lens,0,32,uA,0,r.work,{bits:5}),jy=!1}r.lencode=cA,r.lenbits=9,r.distcode=uA,r.distbits=5},Wy=(r,e,t,n)=>{let i;const s=r.state;return s.window===null&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new Uint8Array(s.wsize)),n>=s.wsize?(s.window.set(e.subarray(t-s.wsize,t),0),s.wnext=0,s.whave=s.wsize):(i=s.wsize-s.wnext,i>n&&(i=n),s.window.set(e.subarray(t-n,t-n+i),s.wnext),n-=i,n?(s.window.set(e.subarray(t-n,t),0),s.wnext=n,s.whave=s.wsize):(s.wnext+=i,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=i))),0},Y4=(r,e)=>{let t,n,i,s,o,l,h,u,d,A,p,g,_,E,m=0,v,w,x,I,R,S,T,D;const b=new Uint8Array(4);let M,L;const P=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(ro(r)||!r.output||!r.input&&r.avail_in!==0)return Ei;t=r.state,t.mode===fs&&(t.mode=aA),o=r.next_out,i=r.output,h=r.avail_out,s=r.next_in,n=r.input,l=r.avail_in,u=t.hold,d=t.bits,A=l,p=h,D=to;e:for(;;)switch(t.mode){case Wh:if(t.wrap===0){t.mode=aA;break}for(;d<16;){if(l===0)break e;l--,u+=n[s++]<<d,d+=8}if(t.wrap&2&&u===35615){t.wbits===0&&(t.wbits=15),t.check=0,b[0]=u&255,b[1]=u>>>8&255,t.check=kr(t.check,b,2,0),u=0,d=0,t.mode=my;break}if(t.head&&(t.head.done=!1),!(t.wrap&1)||(((u&255)<<8)+(u>>8))%31){r.msg="incorrect header check",t.mode=Jt;break}if((u&15)!==gy){r.msg="unknown compression method",t.mode=Jt;break}if(u>>>=4,d-=4,T=(u&15)+8,t.wbits===0&&(t.wbits=T),T>15||T>t.wbits){r.msg="invalid window size",t.mode=Jt;break}t.dmax=1<<t.wbits,t.flags=0,r.adler=t.check=1,t.mode=u&512?Cy:fs,u=0,d=0;break;case my:for(;d<16;){if(l===0)break e;l--,u+=n[s++]<<d,d+=8}if(t.flags=u,(t.flags&255)!==gy){r.msg="unknown compression method",t.mode=Jt;break}if(t.flags&57344){r.msg="unknown header flags set",t.mode=Jt;break}t.head&&(t.head.text=u>>8&1),t.flags&512&&t.wrap&4&&(b[0]=u&255,b[1]=u>>>8&255,t.check=kr(t.check,b,2,0)),u=0,d=0,t.mode=vy;case vy:for(;d<32;){if(l===0)break e;l--,u+=n[s++]<<d,d+=8}t.head&&(t.head.time=u),t.flags&512&&t.wrap&4&&(b[0]=u&255,b[1]=u>>>8&255,b[2]=u>>>16&255,b[3]=u>>>24&255,t.check=kr(t.check,b,4,0)),u=0,d=0,t.mode=_y;case _y:for(;d<16;){if(l===0)break e;l--,u+=n[s++]<<d,d+=8}t.head&&(t.head.xflags=u&255,t.head.os=u>>8),t.flags&512&&t.wrap&4&&(b[0]=u&255,b[1]=u>>>8&255,t.check=kr(t.check,b,2,0)),u=0,d=0,t.mode=yy;case yy:if(t.flags&1024){for(;d<16;){if(l===0)break e;l--,u+=n[s++]<<d,d+=8}t.length=u,t.head&&(t.head.extra_len=u),t.flags&512&&t.wrap&4&&(b[0]=u&255,b[1]=u>>>8&255,t.check=kr(t.check,b,2,0)),u=0,d=0}else t.head&&(t.head.extra=null);t.mode=Ey;case Ey:if(t.flags&1024&&(g=t.length,g>l&&(g=l),g&&(t.head&&(T=t.head.extra_len-t.length,t.head.extra||(t.head.extra=new Uint8Array(t.head.extra_len)),t.head.extra.set(n.subarray(s,s+g),T)),t.flags&512&&t.wrap&4&&(t.check=kr(t.check,n,g,s)),l-=g,s+=g,t.length-=g),t.length))break e;t.length=0,t.mode=xy;case xy:if(t.flags&2048){if(l===0)break e;g=0;do T=n[s+g++],t.head&&T&&t.length<65536&&(t.head.name+=String.fromCharCode(T));while(T&&g<l);if(t.flags&512&&t.wrap&4&&(t.check=kr(t.check,n,g,s)),l-=g,s+=g,T)break e}else t.head&&(t.head.name=null);t.length=0,t.mode=wy;case wy:if(t.flags&4096){if(l===0)break e;g=0;do T=n[s+g++],t.head&&T&&t.length<65536&&(t.head.comment+=String.fromCharCode(T));while(T&&g<l);if(t.flags&512&&t.wrap&4&&(t.check=kr(t.check,n,g,s)),l-=g,s+=g,T)break e}else t.head&&(t.head.comment=null);t.mode=Iy;case Iy:if(t.flags&512){for(;d<16;){if(l===0)break e;l--,u+=n[s++]<<d,d+=8}if(t.wrap&4&&u!==(t.check&65535)){r.msg="header crc mismatch",t.mode=Jt;break}u=0,d=0}t.head&&(t.head.hcrc=t.flags>>9&1,t.head.done=!0),r.adler=t.check=0,t.mode=fs;break;case Cy:for(;d<32;){if(l===0)break e;l--,u+=n[s++]<<d,d+=8}r.adler=t.check=Fy(u),u=0,d=0,t.mode=Yh;case Yh:if(t.havedict===0)return r.next_out=o,r.avail_out=h,r.next_in=s,r.avail_in=l,t.hold=u,t.bits=d,Q4;r.adler=t.check=1,t.mode=fs;case fs:if(e===P4||e===jh)break e;case aA:if(t.last){u>>>=d&7,d-=d&7,t.mode=lA;break}for(;d<3;){if(l===0)break e;l--,u+=n[s++]<<d,d+=8}switch(t.last=u&1,u>>>=1,d-=1,u&3){case 0:t.mode=My;break;case 1:if(W4(t),t.mode=qh,e===jh){u>>>=2,d-=2;break e}break;case 2:t.mode=Ty;break;case 3:r.msg="invalid block type",t.mode=Jt}u>>>=2,d-=2;break;case My:for(u>>>=d&7,d-=d&7;d<32;){if(l===0)break e;l--,u+=n[s++]<<d,d+=8}if((u&65535)!==(u>>>16^65535)){r.msg="invalid stored block lengths",t.mode=Jt;break}if(t.length=u&65535,u=0,d=0,t.mode=oA,e===jh)break e;case oA:t.mode=Sy;case Sy:if(g=t.length,g){if(g>l&&(g=l),g>h&&(g=h),g===0)break e;i.set(n.subarray(s,s+g),o),l-=g,s+=g,h-=g,o+=g,t.length-=g;break}t.mode=fs;break;case Ty:for(;d<14;){if(l===0)break e;l--,u+=n[s++]<<d,d+=8}if(t.nlen=(u&31)+257,u>>>=5,d-=5,t.ndist=(u&31)+1,u>>>=5,d-=5,t.ncode=(u&15)+4,u>>>=4,d-=4,t.nlen>286||t.ndist>30){r.msg="too many length or distance symbols",t.mode=Jt;break}t.have=0,t.mode=By;case By:for(;t.have<t.ncode;){for(;d<3;){if(l===0)break e;l--,u+=n[s++]<<d,d+=8}t.lens[P[t.have++]]=u&7,u>>>=3,d-=3}for(;t.have<19;)t.lens[P[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,M={bits:t.lenbits},D=$c(U4,t.lens,0,19,t.lencode,0,t.work,M),t.lenbits=M.bits,D){r.msg="invalid code lengths set",t.mode=Jt;break}t.have=0,t.mode=by;case by:for(;t.have<t.nlen+t.ndist;){for(;m=t.lencode[u&(1<<t.lenbits)-1],v=m>>>24,w=m>>>16&255,x=m&65535,!(v<=d);){if(l===0)break e;l--,u+=n[s++]<<d,d+=8}if(x<16)u>>>=v,d-=v,t.lens[t.have++]=x;else{if(x===16){for(L=v+2;d<L;){if(l===0)break e;l--,u+=n[s++]<<d,d+=8}if(u>>>=v,d-=v,t.have===0){r.msg="invalid bit length repeat",t.mode=Jt;break}T=t.lens[t.have-1],g=3+(u&3),u>>>=2,d-=2}else if(x===17){for(L=v+3;d<L;){if(l===0)break e;l--,u+=n[s++]<<d,d+=8}u>>>=v,d-=v,T=0,g=3+(u&7),u>>>=3,d-=3}else{for(L=v+7;d<L;){if(l===0)break e;l--,u+=n[s++]<<d,d+=8}u>>>=v,d-=v,T=0,g=11+(u&127),u>>>=7,d-=7}if(t.have+g>t.nlen+t.ndist){r.msg="invalid bit length repeat",t.mode=Jt;break}for(;g--;)t.lens[t.have++]=T}}if(t.mode===Jt)break;if(t.lens[256]===0){r.msg="invalid code -- missing end-of-block",t.mode=Jt;break}if(t.lenbits=9,M={bits:t.lenbits},D=$c(hy,t.lens,0,t.nlen,t.lencode,0,t.work,M),t.lenbits=M.bits,D){r.msg="invalid literal/lengths set",t.mode=Jt;break}if(t.distbits=6,t.distcode=t.distdyn,M={bits:t.distbits},D=$c(dy,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,M),t.distbits=M.bits,D){r.msg="invalid distances set",t.mode=Jt;break}if(t.mode=qh,e===jh)break e;case qh:t.mode=Xh;case Xh:if(l>=6&&h>=258){r.next_out=o,r.avail_out=h,r.next_in=s,r.avail_in=l,t.hold=u,t.bits=d,b4(r,p),o=r.next_out,i=r.output,h=r.avail_out,s=r.next_in,n=r.input,l=r.avail_in,u=t.hold,d=t.bits,t.mode===fs&&(t.back=-1);break}for(t.back=0;m=t.lencode[u&(1<<t.lenbits)-1],v=m>>>24,w=m>>>16&255,x=m&65535,!(v<=d);){if(l===0)break e;l--,u+=n[s++]<<d,d+=8}if(w&&!(w&240)){for(I=v,R=w,S=x;m=t.lencode[S+((u&(1<<I+R)-1)>>I)],v=m>>>24,w=m>>>16&255,x=m&65535,!(I+v<=d);){if(l===0)break e;l--,u+=n[s++]<<d,d+=8}u>>>=I,d-=I,t.back+=I}if(u>>>=v,d-=v,t.back+=v,t.length=x,w===0){t.mode=Uy;break}if(w&32){t.back=-1,t.mode=fs;break}if(w&64){r.msg="invalid literal/length code",t.mode=Jt;break}t.extra=w&15,t.mode=Ry;case Ry:if(t.extra){for(L=t.extra;d<L;){if(l===0)break e;l--,u+=n[s++]<<d,d+=8}t.length+=u&(1<<t.extra)-1,u>>>=t.extra,d-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=Dy;case Dy:for(;m=t.distcode[u&(1<<t.distbits)-1],v=m>>>24,w=m>>>16&255,x=m&65535,!(v<=d);){if(l===0)break e;l--,u+=n[s++]<<d,d+=8}if(!(w&240)){for(I=v,R=w,S=x;m=t.distcode[S+((u&(1<<I+R)-1)>>I)],v=m>>>24,w=m>>>16&255,x=m&65535,!(I+v<=d);){if(l===0)break e;l--,u+=n[s++]<<d,d+=8}u>>>=I,d-=I,t.back+=I}if(u>>>=v,d-=v,t.back+=v,w&64){r.msg="invalid distance code",t.mode=Jt;break}t.offset=x,t.extra=w&15,t.mode=Ly;case Ly:if(t.extra){for(L=t.extra;d<L;){if(l===0)break e;l--,u+=n[s++]<<d,d+=8}t.offset+=u&(1<<t.extra)-1,u>>>=t.extra,d-=t.extra,t.back+=t.extra}if(t.offset>t.dmax){r.msg="invalid distance too far back",t.mode=Jt;break}t.mode=Ny;case Ny:if(h===0)break e;if(g=p-h,t.offset>g){if(g=t.offset-g,g>t.whave&&t.sane){r.msg="invalid distance too far back",t.mode=Jt;break}g>t.wnext?(g-=t.wnext,_=t.wsize-g):_=t.wnext-g,g>t.length&&(g=t.length),E=t.window}else E=i,_=o-t.offset,g=t.length;g>h&&(g=h),h-=g,t.length-=g;do i[o++]=E[_++];while(--g);t.length===0&&(t.mode=Xh);break;case Uy:if(h===0)break e;i[o++]=t.length,h--,t.mode=Xh;break;case lA:if(t.wrap){for(;d<32;){if(l===0)break e;l--,u|=n[s++]<<d,d+=8}if(p-=h,r.total_out+=p,t.total+=p,t.wrap&4&&p&&(r.adler=t.check=t.flags?kr(t.check,i,p,o-p):Vc(t.check,i,p,o-p)),p=h,t.wrap&4&&(t.flags?u:Fy(u))!==t.check){r.msg="incorrect data check",t.mode=Jt;break}u=0,d=0}t.mode=Py;case Py:if(t.wrap&&t.flags){for(;d<32;){if(l===0)break e;l--,u+=n[s++]<<d,d+=8}if(t.wrap&4&&u!==(t.total&4294967295)){r.msg="incorrect length check",t.mode=Jt;break}u=0,d=0}t.mode=ky;case ky:D=k4;break e;case Jt:D=py;break e;case Qy:return Ay;case Oy:default:return Ei}return r.next_out=o,r.avail_out=h,r.next_in=s,r.avail_in=l,t.hold=u,t.bits=d,(t.wsize||p!==r.avail_out&&t.mode<Jt&&(t.mode<lA||e!==fy))&&Wy(r,r.output,r.next_out,p-r.avail_out),A-=r.avail_in,p-=r.avail_out,r.total_in+=A,r.total_out+=p,t.total+=p,t.wrap&4&&p&&(r.adler=t.check=t.flags?kr(t.check,i,p,r.next_out-p):Vc(t.check,i,p,r.next_out-p)),r.data_type=t.bits+(t.last?64:0)+(t.mode===fs?128:0)+(t.mode===qh||t.mode===oA?256:0),(A===0&&p===0||e===fy)&&D===to&&(D=O4),D},q4=r=>{if(ro(r))return Ei;let e=r.state;return e.window&&(e.window=null),r.state=null,to},X4=(r,e)=>{if(ro(r))return Ei;const t=r.state;return t.wrap&2?(t.head=e,e.done=!1,to):Ei},K4=(r,e)=>{const t=e.length;let n,i,s;return ro(r)||(n=r.state,n.wrap!==0&&n.mode!==Yh)?Ei:n.mode===Yh&&(i=1,i=Vc(i,e,t,0),i!==n.check)?py:(s=Wy(r,e,t,t),s?(n.mode=Qy,Ay):(n.havedict=1,to))};var J4=Hy,Z4=Gy,$4=zy,eB=j4,tB=Vy,rB=Y4,nB=q4,iB=X4,sB=K4,aB="pako inflate (from Nodeca project)",ps={inflateReset:J4,inflateReset2:Z4,inflateResetKeep:$4,inflateInit:eB,inflateInit2:tB,inflate:rB,inflateEnd:nB,inflateGetHeader:iB,inflateSetDictionary:sB,inflateInfo:aB};function oB(){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 lB=oB;const Yy=Object.prototype.toString,{Z_NO_FLUSH:cB,Z_FINISH:uB,Z_OK:eu,Z_STREAM_END:hA,Z_NEED_DICT:dA,Z_STREAM_ERROR:hB,Z_DATA_ERROR:qy,Z_MEM_ERROR:dB}=Ja;function tu(r){this.options=Hh.assign({chunkSize:1024*64,windowBits:15,to:""},r||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,e.windowBits===0&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(r&&r.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(e.windowBits&15||(e.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new sy,this.strm.avail_out=0;let t=ps.inflateInit2(this.strm,e.windowBits);if(t!==eu)throw new Error(Ka[t]);if(this.header=new lB,ps.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=Jc.string2buf(e.dictionary):Yy.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(t=ps.inflateSetDictionary(this.strm,e.dictionary),t!==eu)))throw new Error(Ka[t])}tu.prototype.push=function(r,e){const t=this.strm,n=this.options.chunkSize,i=this.options.dictionary;let s,o,l;if(this.ended)return!1;for(e===~~e?o=e:o=e===!0?uB:cB,Yy.call(r)==="[object ArrayBuffer]"?t.input=new Uint8Array(r):t.input=r,t.next_in=0,t.avail_in=t.input.length;;){for(t.avail_out===0&&(t.output=new Uint8Array(n),t.next_out=0,t.avail_out=n),s=ps.inflate(t,o),s===dA&&i&&(s=ps.inflateSetDictionary(t,i),s===eu?s=ps.inflate(t,o):s===qy&&(s=dA));t.avail_in>0&&s===hA&&t.state.wrap>0&&r[t.next_in]!==0;)ps.inflateReset(t),s=ps.inflate(t,o);switch(s){case hB:case qy:case dA:case dB:return this.onEnd(s),this.ended=!0,!1}if(l=t.avail_out,t.next_out&&(t.avail_out===0||s===hA))if(this.options.to==="string"){let h=Jc.utf8border(t.output,t.next_out),u=t.next_out-h,d=Jc.buf2string(t.output,h);t.next_out=u,t.avail_out=n-u,u&&t.output.set(t.output.subarray(h,h+u),0),this.onData(d)}else this.onData(t.output.length===t.next_out?t.output:t.output.subarray(0,t.next_out));if(!(s===eu&&l===0)){if(s===hA)return s=ps.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,!0;if(t.avail_in===0)break}}return!0},tu.prototype.onData=function(r){this.chunks.push(r)},tu.prototype.onEnd=function(r){r===eu&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Hh.flattenChunks(this.chunks)),this.chunks=[],this.err=r,this.msg=this.strm.msg};function fA(r,e){const t=new tu(e);if(t.push(r),t.err)throw t.msg||Ka[t.err];return t.result}function fB(r,e){return e=e||{},e.raw=!0,fA(r,e)}var pB=tu,AB=fA,gB=fB,mB=fA,vB=Ja,_B={Inflate:pB,inflate:AB,inflateRaw:gB,ungzip:mB,constants:vB};const{Deflate:yB,deflate:EB,deflateRaw:xB,gzip:wB}=T4,{Inflate:IB,inflate:CB,inflateRaw:MB,ungzip:SB}=_B;var TB=yB,BB=EB,bB=xB,RB=wB,DB=IB,LB=CB,NB=MB,UB=SB,PB=Ja,kB={Deflate:TB,deflate:BB,deflateRaw:bB,gzip:RB,Inflate:DB,inflate:LB,inflateRaw:NB,ungzip:UB,constants:PB},QB=r=>{if(r===""||!r)return"";let e=r.split("/"),t=`$$${e[1].slice(-10)}${e[3].slice(-9)}`;return String(kp.MD5(t))};async function OB(r){return await(await fetch(r,{method:"GET"})).arrayBuffer()}function FB(r){return kB.ungzip(r,{to:"string"})}var zB=r=>{let e=window.atob(r),t=e.length,n=new Uint8Array(t);for(let i=0;i<t;i+=1)n[i]=e.charCodeAt(i);return n.buffer};async function HB(r,e){let t=QB(e),n=kp.AES.decrypt(r,t).toString(kp.enc.Latin1);return zB(n)}async function GB(r,e){let t=e||`org/${r.split("org/")[1].split("/universal")[0]}`,n=Date.now(),i=await OB(r),s=Date.now()-n;n=Date.now();let o=FB(i),l=Date.now()-n;n=Date.now();let h=await HB(o,t),u=Date.now()-n;return{decodedData:h,events:{fileDownloadTime:s,fileUnzipTime:l,fileDecryptionTime:u}}}var VB=GB;/**
33
33
  * @license
34
34
  * Copyright 2010-2023 Three.js Authors
35
35
  * SPDX-License-Identifier: MIT
36
- */const Kh="163",nl={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},il={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},jB=0,Xy=1,WB=2,Ky=1,YB=2,As=3,xi=0,Qr=1,wi=2,gs=0,sl=1,AA=2,Jy=3,Zy=4,qB=5,no=100,XB=101,KB=102,JB=103,ZB=104,$B=200,eb=201,tb=202,rb=203,gA=204,mA=205,nb=206,ib=207,sb=208,ab=209,ob=210,lb=211,cb=212,ub=213,hb=214,db=0,fb=1,pb=2,Jh=3,Ab=4,gb=5,mb=6,vb=7,$y=0,_b=1,yb=2,Zs=0,eE=1,tE=2,rE=3,nE=4,Eb=5,iE=6,vA=7,sE="attached",xb="detached",aE=300,io=301,al=302,ru=303,_A=304,Zh=306,$s=1e3,Ii=1001,$h=1002,Ar=1003,oE=1004,nu=1005,gr=1006,ed=1007,Ci=1008,wb=1008,mr=1009,yA=1010,lE=1011,EA=1012,iu=1013,Mi=1014,lr=1015,Or=1016,cE=1017,uE=1018,su=1020,Ib=35902,Cb=1021,Mb=1022,vr=1023,Sb=1024,Tb=1025,ol=1026,au=1027,ea=1028,xA=1029,so=1030,td=1031,ou=1033,rd=33776,wA=33777,IA=33778,nd=33779,CA=35840,hE=35841,MA=35842,dE=35843,SA=36196,TA=37492,BA=37496,bA=37808,fE=37809,pE=37810,AE=37811,id=37812,gE=37813,mE=37814,vE=37815,_E=37816,yE=37817,EE=37818,xE=37819,wE=37820,IE=37821,sd=36492,CE=36494,ME=36495,Bb=36283,SE=36284,TE=36285,BE=36286,lu=2300,ll=2301,RA=2302,bE=2400,RE=2401,DE=2402,bb=2500,Rb=0,LE=1,DA=2,Db=3200,Lb=3201,NE=0,Nb=1,ms="",Fr="srgb",cr="srgb-linear",ad="display-p3",cu="display-p3-linear",od="linear",Ht="srgb",ld="rec709",cd="p3",cl=7680,UE=519,Ub=512,Pb=513,kb=514,PE=515,Qb=516,Ob=517,Fb=518,zb=519,LA=35044,kE="300 es",vs=2e3,ud=2001;class ao{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;const n=this._listeners;return n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;const n=this._listeners[e];if(n!==void 0){const i=n.indexOf(t);i!==-1&&n.splice(i,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const t=this._listeners[e.type];if(t!==void 0){e.target=this;const n=t.slice(0);for(let i=0,s=n.length;i<s;i++)n[i].call(this,e);e.target=null}}}const Zr=["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"];let QE=1234567;const uu=Math.PI/180,ul=180/Math.PI;function Si(){const r=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,n=Math.random()*4294967295|0;return(Zr[r&255]+Zr[r>>8&255]+Zr[r>>16&255]+Zr[r>>24&255]+"-"+Zr[e&255]+Zr[e>>8&255]+"-"+Zr[e>>16&15|64]+Zr[e>>24&255]+"-"+Zr[t&63|128]+Zr[t>>8&255]+"-"+Zr[t>>16&255]+Zr[t>>24&255]+Zr[n&255]+Zr[n>>8&255]+Zr[n>>16&255]+Zr[n>>24&255]).toLowerCase()}function Br(r,e,t){return Math.max(e,Math.min(t,r))}function NA(r,e){return(r%e+e)%e}function Hb(r,e,t,n,i){return n+(r-e)*(i-n)/(t-e)}function Gb(r,e,t){return r!==e?(t-r)/(e-r):0}function hu(r,e,t){return(1-t)*r+t*e}function Vb(r,e,t,n){return hu(r,e,1-Math.exp(-t*n))}function jb(r,e=1){return e-Math.abs(NA(r,e*2)-e)}function Wb(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*(3-2*r))}function Yb(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*r*(r*(r*6-15)+10))}function qb(r,e){return r+Math.floor(Math.random()*(e-r+1))}function Xb(r,e){return r+Math.random()*(e-r)}function Kb(r){return r*(.5-Math.random())}function Jb(r){r!==void 0&&(QE=r);let e=QE+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function Zb(r){return r*uu}function $b(r){return r*ul}function e5(r){return(r&r-1)===0&&r!==0}function t5(r){return Math.pow(2,Math.ceil(Math.log(r)/Math.LN2))}function r5(r){return Math.pow(2,Math.floor(Math.log(r)/Math.LN2))}function n5(r,e,t,n,i){const s=Math.cos,o=Math.sin,l=s(t/2),h=o(t/2),u=s((e+n)/2),d=o((e+n)/2),A=s((e-n)/2),p=o((e-n)/2),g=s((n-e)/2),_=o((n-e)/2);switch(i){case"XYX":r.set(l*d,h*A,h*p,l*u);break;case"YZY":r.set(h*p,l*d,h*A,l*u);break;case"ZXZ":r.set(h*A,h*p,l*d,l*u);break;case"XZX":r.set(l*d,h*_,h*g,l*u);break;case"YXY":r.set(h*g,l*d,h*_,l*u);break;case"ZYZ":r.set(h*_,h*g,l*d,l*u);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}function Ti(r,e){switch(e.constructor){case Float32Array:return r;case Uint32Array:return r/4294967295;case Uint16Array:return r/65535;case Uint8Array:return r/255;case Int32Array:return Math.max(r/2147483647,-1);case Int16Array:return Math.max(r/32767,-1);case Int8Array:return Math.max(r/127,-1);default:throw new Error("Invalid component type.")}}function Ut(r,e){switch(e.constructor){case Float32Array:return r;case Uint32Array:return Math.round(r*4294967295);case Uint16Array:return Math.round(r*65535);case Uint8Array:return Math.round(r*255);case Int32Array:return Math.round(r*2147483647);case Int16Array:return Math.round(r*32767);case Int8Array:return Math.round(r*127);default:throw new Error("Invalid component type.")}}const UA={DEG2RAD:uu,RAD2DEG:ul,generateUUID:Si,clamp:Br,euclideanModulo:NA,mapLinear:Hb,inverseLerp:Gb,lerp:hu,damp:Vb,pingpong:jb,smoothstep:Wb,smootherstep:Yb,randInt:qb,randFloat:Xb,randFloatSpread:Kb,seededRandom:Jb,degToRad:Zb,radToDeg:$b,isPowerOfTwo:e5,ceilPowerOfTwo:t5,floorPowerOfTwo:r5,setQuaternionFromProperEuler:n5,normalize:Ut,denormalize:Ti};class Ue{constructor(e=0,t=0){Ue.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,n=this.y,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6],this.y=i[1]*t+i[4]*n+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,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(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.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(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(Br(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const n=Math.cos(t),i=Math.sin(t),s=this.x-e.x,o=this.y-e.y;return this.x=s*n-o*i+e.x,this.y=s*i+o*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class gt{constructor(e,t,n,i,s,o,l,h,u){gt.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,n,i,s,o,l,h,u)}set(e,t,n,i,s,o,l,h,u){const d=this.elements;return d[0]=e,d[1]=i,d[2]=l,d[3]=t,d[4]=s,d[5]=h,d[6]=n,d[7]=o,d[8]=u,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,i=t.elements,s=this.elements,o=n[0],l=n[3],h=n[6],u=n[1],d=n[4],A=n[7],p=n[2],g=n[5],_=n[8],E=i[0],m=i[3],v=i[6],w=i[1],x=i[4],I=i[7],R=i[2],S=i[5],T=i[8];return s[0]=o*E+l*w+h*R,s[3]=o*m+l*x+h*S,s[6]=o*v+l*I+h*T,s[1]=u*E+d*w+A*R,s[4]=u*m+d*x+A*S,s[7]=u*v+d*I+A*T,s[2]=p*E+g*w+_*R,s[5]=p*m+g*x+_*S,s[8]=p*v+g*I+_*T,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],o=e[4],l=e[5],h=e[6],u=e[7],d=e[8];return t*o*d-t*l*u-n*s*d+n*l*h+i*s*u-i*o*h}invert(){const e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],o=e[4],l=e[5],h=e[6],u=e[7],d=e[8],A=d*o-l*u,p=l*h-d*s,g=u*s-o*h,_=t*A+n*p+i*g;if(_===0)return this.set(0,0,0,0,0,0,0,0,0);const E=1/_;return e[0]=A*E,e[1]=(i*u-d*n)*E,e[2]=(l*n-i*o)*E,e[3]=p*E,e[4]=(d*t-i*h)*E,e[5]=(i*s-l*t)*E,e[6]=g*E,e[7]=(n*h-u*t)*E,e[8]=(o*t-n*s)*E,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,i,s,o,l){const h=Math.cos(s),u=Math.sin(s);return this.set(n*h,n*u,-n*(h*o+u*l)+o+e,-i*u,i*h,-i*(-u*o+h*l)+l+t,0,0,1),this}scale(e,t){return this.premultiply(PA.makeScale(e,t)),this}rotate(e){return this.premultiply(PA.makeRotation(-e)),this}translate(e,t){return this.premultiply(PA.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,n,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,n=e.elements;for(let i=0;i<9;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const PA=new gt;function OE(r){for(let e=r.length-1;e>=0;--e)if(r[e]>=65535)return!0;return!1}function du(r){return document.createElementNS("http://www.w3.org/1999/xhtml",r)}function i5(){const r=du("canvas");return r.style.display="block",r}const FE={};function zE(r){r in FE||(FE[r]=!0,console.warn(r))}const HE=new gt().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),GE=new gt().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),hd={[cr]:{transfer:od,primaries:ld,toReference:r=>r,fromReference:r=>r},[Fr]:{transfer:Ht,primaries:ld,toReference:r=>r.convertSRGBToLinear(),fromReference:r=>r.convertLinearToSRGB()},[cu]:{transfer:od,primaries:cd,toReference:r=>r.applyMatrix3(GE),fromReference:r=>r.applyMatrix3(HE)},[ad]:{transfer:Ht,primaries:cd,toReference:r=>r.convertSRGBToLinear().applyMatrix3(GE),fromReference:r=>r.applyMatrix3(HE).convertLinearToSRGB()}},s5=new Set([cr,cu]),Tt={enabled:!0,_workingColorSpace:cr,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(r){if(!s5.has(r))throw new Error(`Unsupported working color space, "${r}".`);this._workingColorSpace=r},convert:function(r,e,t){if(this.enabled===!1||e===t||!e||!t)return r;const n=hd[e].toReference,i=hd[t].fromReference;return i(n(r))},fromWorkingColorSpace:function(r,e){return this.convert(r,this._workingColorSpace,e)},toWorkingColorSpace:function(r,e){return this.convert(r,e,this._workingColorSpace)},getPrimaries:function(r){return hd[r].primaries},getTransfer:function(r){return r===ms?od:hd[r].transfer}};function hl(r){return r<.04045?r*.0773993808:Math.pow(r*.9478672986+.0521327014,2.4)}function kA(r){return r<.0031308?r*12.92:1.055*Math.pow(r,.41666)-.055}let dl;class a5{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{dl===void 0&&(dl=du("canvas")),dl.width=e.width,dl.height=e.height;const n=dl.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=dl}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=du("canvas");t.width=e.width,t.height=e.height;const n=t.getContext("2d");n.drawImage(e,0,0,e.width,e.height);const i=n.getImageData(0,0,e.width,e.height),s=i.data;for(let o=0;o<s.length;o++)s[o]=hl(s[o]/255)*255;return n.putImageData(i,0,0),t}else if(e.data){const t=e.data.slice(0);for(let n=0;n<t.length;n++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[n]=Math.floor(hl(t[n]/255)*255):t[n]=hl(t[n]);return{data:t,width:e.width,height:e.height}}else return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}let o5=0;class VE{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:o5++}),this.uuid=Si(),this.data=e,this.dataReady=!0,this.version=0}set needsUpdate(e){e===!0&&this.version++}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.images[this.uuid]!==void 0)return e.images[this.uuid];const n={uuid:this.uuid,url:""},i=this.data;if(i!==null){let s;if(Array.isArray(i)){s=[];for(let o=0,l=i.length;o<l;o++)i[o].isDataTexture?s.push(QA(i[o].image)):s.push(QA(i[o]))}else s=QA(i);n.url=s}return t||(e.images[this.uuid]=n),n}}function QA(r){return typeof HTMLImageElement<"u"&&r instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&r instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&r instanceof ImageBitmap?a5.getDataURL(r):r.data?{data:Array.from(r.data),width:r.width,height:r.height,type:r.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let l5=0;class br extends ao{constructor(e=br.DEFAULT_IMAGE,t=br.DEFAULT_MAPPING,n=Ii,i=Ii,s=gr,o=Ci,l=vr,h=mr,u=br.DEFAULT_ANISOTROPY,d=ms){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:l5++}),this.uuid=Si(),this.name="",this.source=new VE(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=n,this.wrapT=i,this.magFilter=s,this.minFilter=o,this.anisotropy=u,this.format=l,this.internalFormat=null,this.type=h,this.offset=new Ue(0,0),this.repeat=new Ue(1,1),this.center=new Ue(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new gt,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=d,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){const t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const n={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&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==aE)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case $s:e.x=e.x-Math.floor(e.x);break;case Ii:e.x=e.x<0?0:1;break;case $h: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 $s:e.y=e.y-Math.floor(e.y);break;case Ii:e.y=e.y<0?0:1;break;case $h: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++}}br.DEFAULT_IMAGE=null,br.DEFAULT_MAPPING=aE,br.DEFAULT_ANISOTROPY=1;class Ft{constructor(e=0,t=0,n=0,i=1){Ft.prototype.isVector4=!0,this.x=e,this.y=t,this.z=n,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,i){return this.x=e,this.y=t,this.z=n,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){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: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,n=this.y,i=this.z,s=this.w,o=e.elements;return this.x=o[0]*t+o[4]*n+o[8]*i+o[12]*s,this.y=o[1]*t+o[5]*n+o[9]*i+o[13]*s,this.z=o[2]*t+o[6]*n+o[10]*i+o[14]*s,this.w=o[3]*t+o[7]*n+o[11]*i+o[15]*s,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,i,s;const o=e.elements,l=o[0],h=o[4],u=o[8],d=o[1],A=o[5],p=o[9],g=o[2],_=o[6],E=o[10];if(Math.abs(h-d)<.01&&Math.abs(u-g)<.01&&Math.abs(p-_)<.01){if(Math.abs(h+d)<.1&&Math.abs(u+g)<.1&&Math.abs(p+_)<.1&&Math.abs(l+A+E-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const v=(l+1)/2,w=(A+1)/2,x=(E+1)/2,I=(h+d)/4,R=(u+g)/4,S=(p+_)/4;return v>w&&v>x?v<.01?(n=0,i=.707106781,s=.707106781):(n=Math.sqrt(v),i=I/n,s=R/n):w>x?w<.01?(n=.707106781,i=0,s=.707106781):(i=Math.sqrt(w),n=I/i,s=S/i):x<.01?(n=.707106781,i=.707106781,s=0):(s=Math.sqrt(x),n=R/s,i=S/s),this.set(n,i,s,t),this}let m=Math.sqrt((_-p)*(_-p)+(u-g)*(u-g)+(d-h)*(d-h));return Math.abs(m)<.001&&(m=1),this.x=(_-p)/m,this.y=(u-g)/m,this.z=(d-h)/m,this.w=Math.acos((l+A+E-1)/2),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,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(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.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(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),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}}class c5 extends ao{constructor(e=1,t=1,n={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new Ft(0,0,e,t),this.scissorTest=!1,this.viewport=new Ft(0,0,e,t);const i={width:e,height:t,depth:1};n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:gr,depthBuffer:!0,stencilBuffer:!1,depthTexture:null,samples:0,count:1},n);const s=new br(i,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace);s.flipY=!1,s.generateMipmaps=n.generateMipmaps,s.internalFormat=n.internalFormat,this.textures=[];const o=n.count;for(let l=0;l<o;l++)this.textures[l]=s.clone(),this.textures[l].isRenderTargetTexture=!0;this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.depthTexture=n.depthTexture,this.samples=n.samples}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}setSize(e,t,n=1){if(this.width!==e||this.height!==t||this.depth!==n){this.width=e,this.height=t,this.depth=n;for(let i=0,s=this.textures.length;i<s;i++)this.textures[i].image.width=e,this.textures[i].image.height=t,this.textures[i].image.depth=n;this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let n=0,i=e.textures.length;n<i;n++)this.textures[n]=e.textures[n].clone(),this.textures[n].isRenderTargetTexture=!0;const t=Object.assign({},e.texture.image);return this.texture.source=new VE(t),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class cn extends c5{constructor(e=1,t=1,n={}){super(e,t,n),this.isWebGLRenderTarget=!0}}class jE extends br{constructor(e=null,t=1,n=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:n,depth:i},this.magFilter=Ar,this.minFilter=Ar,this.wrapR=Ii,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class WE extends br{constructor(e=null,t=1,n=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:n,depth:i},this.magFilter=Ar,this.minFilter=Ar,this.wrapR=Ii,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Yi{constructor(e=0,t=0,n=0,i=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=i}static slerpFlat(e,t,n,i,s,o,l){let h=n[i+0],u=n[i+1],d=n[i+2],A=n[i+3];const p=s[o+0],g=s[o+1],_=s[o+2],E=s[o+3];if(l===0){e[t+0]=h,e[t+1]=u,e[t+2]=d,e[t+3]=A;return}if(l===1){e[t+0]=p,e[t+1]=g,e[t+2]=_,e[t+3]=E;return}if(A!==E||h!==p||u!==g||d!==_){let m=1-l;const v=h*p+u*g+d*_+A*E,w=v>=0?1:-1,x=1-v*v;if(x>Number.EPSILON){const R=Math.sqrt(x),S=Math.atan2(R,v*w);m=Math.sin(m*S)/R,l=Math.sin(l*S)/R}const I=l*w;if(h=h*m+p*I,u=u*m+g*I,d=d*m+_*I,A=A*m+E*I,m===1-l){const R=1/Math.sqrt(h*h+u*u+d*d+A*A);h*=R,u*=R,d*=R,A*=R}}e[t]=h,e[t+1]=u,e[t+2]=d,e[t+3]=A}static multiplyQuaternionsFlat(e,t,n,i,s,o){const l=n[i],h=n[i+1],u=n[i+2],d=n[i+3],A=s[o],p=s[o+1],g=s[o+2],_=s[o+3];return e[t]=l*_+d*A+h*g-u*p,e[t+1]=h*_+d*p+u*A-l*g,e[t+2]=u*_+d*g+l*p-h*A,e[t+3]=d*_-l*A-h*p-u*g,e}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 w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,i){return this._x=e,this._y=t,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const n=e._x,i=e._y,s=e._z,o=e._order,l=Math.cos,h=Math.sin,u=l(n/2),d=l(i/2),A=l(s/2),p=h(n/2),g=h(i/2),_=h(s/2);switch(o){case"XYZ":this._x=p*d*A+u*g*_,this._y=u*g*A-p*d*_,this._z=u*d*_+p*g*A,this._w=u*d*A-p*g*_;break;case"YXZ":this._x=p*d*A+u*g*_,this._y=u*g*A-p*d*_,this._z=u*d*_-p*g*A,this._w=u*d*A+p*g*_;break;case"ZXY":this._x=p*d*A-u*g*_,this._y=u*g*A+p*d*_,this._z=u*d*_+p*g*A,this._w=u*d*A-p*g*_;break;case"ZYX":this._x=p*d*A-u*g*_,this._y=u*g*A+p*d*_,this._z=u*d*_-p*g*A,this._w=u*d*A+p*g*_;break;case"YZX":this._x=p*d*A+u*g*_,this._y=u*g*A+p*d*_,this._z=u*d*_-p*g*A,this._w=u*d*A-p*g*_;break;case"XZY":this._x=p*d*A-u*g*_,this._y=u*g*A-p*d*_,this._z=u*d*_+p*g*A,this._w=u*d*A+p*g*_;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const n=t/2,i=Math.sin(n);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,n=t[0],i=t[4],s=t[8],o=t[1],l=t[5],h=t[9],u=t[2],d=t[6],A=t[10],p=n+l+A;if(p>0){const g=.5/Math.sqrt(p+1);this._w=.25/g,this._x=(d-h)*g,this._y=(s-u)*g,this._z=(o-i)*g}else if(n>l&&n>A){const g=2*Math.sqrt(1+n-l-A);this._w=(d-h)/g,this._x=.25*g,this._y=(i+o)/g,this._z=(s+u)/g}else if(l>A){const g=2*Math.sqrt(1+l-n-A);this._w=(s-u)/g,this._x=(i+o)/g,this._y=.25*g,this._z=(h+d)/g}else{const g=2*Math.sqrt(1+A-n-l);this._w=(o-i)/g,this._x=(s+u)/g,this._y=(h+d)/g,this._z=.25*g}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<Number.EPSILON?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Br(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(n===0)return this;const i=Math.min(1,t/n);return this.slerp(e,i),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(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._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 e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const n=e._x,i=e._y,s=e._z,o=e._w,l=t._x,h=t._y,u=t._z,d=t._w;return this._x=n*d+o*l+i*u-s*h,this._y=i*d+o*h+s*l-n*u,this._z=s*d+o*u+n*h-i*l,this._w=o*d-n*l-i*h-s*u,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const n=this._x,i=this._y,s=this._z,o=this._w;let l=o*e._w+n*e._x+i*e._y+s*e._z;if(l<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,l=-l):this.copy(e),l>=1)return this._w=o,this._x=n,this._y=i,this._z=s,this;const h=1-l*l;if(h<=Number.EPSILON){const g=1-t;return this._w=g*o+t*this._w,this._x=g*n+t*this._x,this._y=g*i+t*this._y,this._z=g*s+t*this._z,this.normalize(),this}const u=Math.sqrt(h),d=Math.atan2(u,l),A=Math.sin((1-t)*d)/u,p=Math.sin(t*d)/u;return this._w=o*A+this._w*p,this._x=n*A+this._x*p,this._y=i*A+this._y*p,this._z=s*A+this._z*p,this._onChangeCallback(),this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),n=Math.random(),i=Math.sqrt(1-n),s=Math.sqrt(n);return this.set(i*Math.sin(e),i*Math.cos(e),s*Math.sin(t),s*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class G{constructor(e=0,t=0,n=0){G.prototype.isVector3=!0,this.x=e,this.y=t,this.z=n}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(YE.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(YE.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,n=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[3]*n+s[6]*i,this.y=s[1]*t+s[4]*n+s[7]*i,this.z=s[2]*t+s[5]*n+s[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,n=this.y,i=this.z,s=e.elements,o=1/(s[3]*t+s[7]*n+s[11]*i+s[15]);return this.x=(s[0]*t+s[4]*n+s[8]*i+s[12])*o,this.y=(s[1]*t+s[5]*n+s[9]*i+s[13])*o,this.z=(s[2]*t+s[6]*n+s[10]*i+s[14])*o,this}applyQuaternion(e){const t=this.x,n=this.y,i=this.z,s=e.x,o=e.y,l=e.z,h=e.w,u=2*(o*i-l*n),d=2*(l*t-s*i),A=2*(s*n-o*t);return this.x=t+h*u+o*A-l*d,this.y=n+h*d+l*u-s*A,this.z=i+h*A+s*d-o*u,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,n=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[4]*n+s[8]*i,this.y=s[1]*t+s[5]*n+s[9]*i,this.z=s[2]*t+s[6]*n+s[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,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(e){return this.x*e.x+this.y*e.y+this.z*e.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(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const n=e.x,i=e.y,s=e.z,o=t.x,l=t.y,h=t.z;return this.x=i*h-s*l,this.y=s*o-n*h,this.z=n*l-i*o,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return OA.copy(this).projectOnVector(e),this.sub(OA)}reflect(e){return this.sub(OA.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(Br(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y,i=this.z-e.z;return t*t+n*n+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){const i=Math.sin(t)*e;return this.x=i*Math.sin(n),this.y=Math.cos(t)*e,this.z=i*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=i,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,t=Math.random()*2-1,n=Math.sqrt(1-t*t);return this.x=n*Math.cos(e),this.y=t,this.z=n*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const OA=new G,YE=new Yi;class _r{constructor(e=new G(1/0,1/0,1/0),t=new G(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t+=3)this.expandByPoint(Bi.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,n=e.count;t<n;t++)this.expandByPoint(Bi.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const n=Bi.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.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(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);const n=e.geometry;if(n!==void 0){const s=n.getAttribute("position");if(t===!0&&s!==void 0&&e.isInstancedMesh!==!0)for(let o=0,l=s.count;o<l;o++)e.isMesh===!0?e.getVertexPosition(o,Bi):Bi.fromBufferAttribute(s,o),Bi.applyMatrix4(e.matrixWorld),this.expandByPoint(Bi);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),dd.copy(e.boundingBox)):(n.boundingBox===null&&n.computeBoundingBox(),dd.copy(n.boundingBox)),dd.applyMatrix4(e.matrixWorld),this.union(dd)}const i=e.children;for(let s=0,o=i.length;s<o;s++)this.expandByObject(i[s],t);return this}containsPoint(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y||e.z<this.min.z||e.z>this.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y||e.max.z<this.min.z||e.min.z>this.max.z)}intersectsSphere(e){return this.clampPoint(e.center,Bi),Bi.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(fu),fd.subVectors(this.max,fu),fl.subVectors(e.a,fu),pl.subVectors(e.b,fu),Al.subVectors(e.c,fu),ta.subVectors(pl,fl),ra.subVectors(Al,pl),oo.subVectors(fl,Al);let t=[0,-ta.z,ta.y,0,-ra.z,ra.y,0,-oo.z,oo.y,ta.z,0,-ta.x,ra.z,0,-ra.x,oo.z,0,-oo.x,-ta.y,ta.x,0,-ra.y,ra.x,0,-oo.y,oo.x,0];return!FA(t,fl,pl,Al,fd)||(t=[1,0,0,0,1,0,0,0,1],!FA(t,fl,pl,Al,fd))?!1:(pd.crossVectors(ta,ra),t=[pd.x,pd.y,pd.z],FA(t,fl,pl,Al,fd))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Bi).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Bi).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(_s[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),_s[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),_s[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),_s[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),_s[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),_s[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),_s[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),_s[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(_s),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const _s=[new G,new G,new G,new G,new G,new G,new G,new G],Bi=new G,dd=new _r,fl=new G,pl=new G,Al=new G,ta=new G,ra=new G,oo=new G,fu=new G,fd=new G,pd=new G,lo=new G;function FA(r,e,t,n,i){for(let s=0,o=r.length-3;s<=o;s+=3){lo.fromArray(r,s);const l=i.x*Math.abs(lo.x)+i.y*Math.abs(lo.y)+i.z*Math.abs(lo.z),h=e.dot(lo),u=t.dot(lo),d=n.dot(lo);if(Math.max(-Math.max(h,u,d),Math.min(h,u,d))>l)return!1}return!0}const u5=new _r,pu=new G,zA=new G;class bi{constructor(e=new G,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const n=this.center;t!==void 0?n.copy(t):u5.setFromPoints(e).getCenter(n);let i=0;for(let s=0,o=e.length;s<o;s++)i=Math.max(i,n.distanceToSquared(e[s]));return this.radius=Math.sqrt(i),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){const n=this.center.distanceToSquared(e);return t.copy(e),n>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;pu.subVectors(e,this.center);const t=pu.lengthSq();if(t>this.radius*this.radius){const n=Math.sqrt(t),i=(n-this.radius)*.5;this.center.addScaledVector(pu,i/n),this.radius+=i}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(zA.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(pu.copy(e.center).add(zA)),this.expandByPoint(pu.copy(e.center).sub(zA))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const ys=new G,HA=new G,Ad=new G,na=new G,GA=new G,gd=new G,VA=new G;class co{constructor(e=new G,t=new G(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,ys)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=ys.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(ys.copy(this.origin).addScaledVector(this.direction,t),ys.distanceToSquared(e))}distanceSqToSegment(e,t,n,i){HA.copy(e).add(t).multiplyScalar(.5),Ad.copy(t).sub(e).normalize(),na.copy(this.origin).sub(HA);const s=e.distanceTo(t)*.5,o=-this.direction.dot(Ad),l=na.dot(this.direction),h=-na.dot(Ad),u=na.lengthSq(),d=Math.abs(1-o*o);let A,p,g,_;if(d>0)if(A=o*h-l,p=o*l-h,_=s*d,A>=0)if(p>=-_)if(p<=_){const E=1/d;A*=E,p*=E,g=A*(A+o*p+2*l)+p*(o*A+p+2*h)+u}else p=s,A=Math.max(0,-(o*p+l)),g=-A*A+p*(p+2*h)+u;else p=-s,A=Math.max(0,-(o*p+l)),g=-A*A+p*(p+2*h)+u;else p<=-_?(A=Math.max(0,-(-o*s+l)),p=A>0?-s:Math.min(Math.max(-s,-h),s),g=-A*A+p*(p+2*h)+u):p<=_?(A=0,p=Math.min(Math.max(-s,-h),s),g=p*(p+2*h)+u):(A=Math.max(0,-(o*s+l)),p=A>0?s:Math.min(Math.max(-s,-h),s),g=-A*A+p*(p+2*h)+u);else p=o>0?-s:s,A=Math.max(0,-(o*p+l)),g=-A*A+p*(p+2*h)+u;return n&&n.copy(this.origin).addScaledVector(this.direction,A),i&&i.copy(HA).addScaledVector(Ad,p),g}intersectSphere(e,t){ys.subVectors(e.center,this.origin);const n=ys.dot(this.direction),i=ys.dot(ys)-n*n,s=e.radius*e.radius;if(i>s)return null;const o=Math.sqrt(s-i),l=n-o,h=n+o;return h<0?null:l<0?this.at(h,t):this.at(l,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){const n=this.distanceToPlane(e);return n===null?null:this.at(n,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,i,s,o,l,h;const u=1/this.direction.x,d=1/this.direction.y,A=1/this.direction.z,p=this.origin;return u>=0?(n=(e.min.x-p.x)*u,i=(e.max.x-p.x)*u):(n=(e.max.x-p.x)*u,i=(e.min.x-p.x)*u),d>=0?(s=(e.min.y-p.y)*d,o=(e.max.y-p.y)*d):(s=(e.max.y-p.y)*d,o=(e.min.y-p.y)*d),n>o||s>i||((s>n||isNaN(n))&&(n=s),(o<i||isNaN(i))&&(i=o),A>=0?(l=(e.min.z-p.z)*A,h=(e.max.z-p.z)*A):(l=(e.max.z-p.z)*A,h=(e.min.z-p.z)*A),n>h||l>i)||((l>n||n!==n)&&(n=l),(h<i||i!==i)&&(i=h),i<0)?null:this.at(n>=0?n:i,t)}intersectsBox(e){return this.intersectBox(e,ys)!==null}intersectTriangle(e,t,n,i,s){GA.subVectors(t,e),gd.subVectors(n,e),VA.crossVectors(GA,gd);let o=this.direction.dot(VA),l;if(o>0){if(i)return null;l=1}else if(o<0)l=-1,o=-o;else return null;na.subVectors(this.origin,e);const h=l*this.direction.dot(gd.crossVectors(na,gd));if(h<0)return null;const u=l*this.direction.dot(GA.cross(na));if(u<0||h+u>o)return null;const d=-l*na.dot(VA);return d<0?null:this.at(d/o,s)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class rt{constructor(e,t,n,i,s,o,l,h,u,d,A,p,g,_,E,m){rt.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,n,i,s,o,l,h,u,d,A,p,g,_,E,m)}set(e,t,n,i,s,o,l,h,u,d,A,p,g,_,E,m){const v=this.elements;return v[0]=e,v[4]=t,v[8]=n,v[12]=i,v[1]=s,v[5]=o,v[9]=l,v[13]=h,v[2]=u,v[6]=d,v[10]=A,v[14]=p,v[3]=g,v[7]=_,v[11]=E,v[15]=m,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 rt().fromArray(this.elements)}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){const t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,n=e.elements,i=1/gl.setFromMatrixColumn(e,0).length(),s=1/gl.setFromMatrixColumn(e,1).length(),o=1/gl.setFromMatrixColumn(e,2).length();return t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t[3]=0,t[4]=n[4]*s,t[5]=n[5]*s,t[6]=n[6]*s,t[7]=0,t[8]=n[8]*o,t[9]=n[9]*o,t[10]=n[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,n=e.x,i=e.y,s=e.z,o=Math.cos(n),l=Math.sin(n),h=Math.cos(i),u=Math.sin(i),d=Math.cos(s),A=Math.sin(s);if(e.order==="XYZ"){const p=o*d,g=o*A,_=l*d,E=l*A;t[0]=h*d,t[4]=-h*A,t[8]=u,t[1]=g+_*u,t[5]=p-E*u,t[9]=-l*h,t[2]=E-p*u,t[6]=_+g*u,t[10]=o*h}else if(e.order==="YXZ"){const p=h*d,g=h*A,_=u*d,E=u*A;t[0]=p+E*l,t[4]=_*l-g,t[8]=o*u,t[1]=o*A,t[5]=o*d,t[9]=-l,t[2]=g*l-_,t[6]=E+p*l,t[10]=o*h}else if(e.order==="ZXY"){const p=h*d,g=h*A,_=u*d,E=u*A;t[0]=p-E*l,t[4]=-o*A,t[8]=_+g*l,t[1]=g+_*l,t[5]=o*d,t[9]=E-p*l,t[2]=-o*u,t[6]=l,t[10]=o*h}else if(e.order==="ZYX"){const p=o*d,g=o*A,_=l*d,E=l*A;t[0]=h*d,t[4]=_*u-g,t[8]=p*u+E,t[1]=h*A,t[5]=E*u+p,t[9]=g*u-_,t[2]=-u,t[6]=l*h,t[10]=o*h}else if(e.order==="YZX"){const p=o*h,g=o*u,_=l*h,E=l*u;t[0]=h*d,t[4]=E-p*A,t[8]=_*A+g,t[1]=A,t[5]=o*d,t[9]=-l*d,t[2]=-u*d,t[6]=g*A+_,t[10]=p-E*A}else if(e.order==="XZY"){const p=o*h,g=o*u,_=l*h,E=l*u;t[0]=h*d,t[4]=-A,t[8]=u*d,t[1]=p*A+E,t[5]=o*d,t[9]=g*A-_,t[2]=_*A-g,t[6]=l*d,t[10]=E*A+p}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(h5,e,d5)}lookAt(e,t,n){const i=this.elements;return Hn.subVectors(e,t),Hn.lengthSq()===0&&(Hn.z=1),Hn.normalize(),ia.crossVectors(n,Hn),ia.lengthSq()===0&&(Math.abs(n.z)===1?Hn.x+=1e-4:Hn.z+=1e-4,Hn.normalize(),ia.crossVectors(n,Hn)),ia.normalize(),md.crossVectors(Hn,ia),i[0]=ia.x,i[4]=md.x,i[8]=Hn.x,i[1]=ia.y,i[5]=md.y,i[9]=Hn.y,i[2]=ia.z,i[6]=md.z,i[10]=Hn.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,i=t.elements,s=this.elements,o=n[0],l=n[4],h=n[8],u=n[12],d=n[1],A=n[5],p=n[9],g=n[13],_=n[2],E=n[6],m=n[10],v=n[14],w=n[3],x=n[7],I=n[11],R=n[15],S=i[0],T=i[4],D=i[8],b=i[12],M=i[1],L=i[5],P=i[9],N=i[13],W=i[2],X=i[6],K=i[10],te=i[14],V=i[3],ee=i[7],Q=i[11],z=i[15];return s[0]=o*S+l*M+h*W+u*V,s[4]=o*T+l*L+h*X+u*ee,s[8]=o*D+l*P+h*K+u*Q,s[12]=o*b+l*N+h*te+u*z,s[1]=d*S+A*M+p*W+g*V,s[5]=d*T+A*L+p*X+g*ee,s[9]=d*D+A*P+p*K+g*Q,s[13]=d*b+A*N+p*te+g*z,s[2]=_*S+E*M+m*W+v*V,s[6]=_*T+E*L+m*X+v*ee,s[10]=_*D+E*P+m*K+v*Q,s[14]=_*b+E*N+m*te+v*z,s[3]=w*S+x*M+I*W+R*V,s[7]=w*T+x*L+I*X+R*ee,s[11]=w*D+x*P+I*K+R*Q,s[15]=w*b+x*N+I*te+R*z,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[4],i=e[8],s=e[12],o=e[1],l=e[5],h=e[9],u=e[13],d=e[2],A=e[6],p=e[10],g=e[14],_=e[3],E=e[7],m=e[11],v=e[15];return _*(+s*h*A-i*u*A-s*l*p+n*u*p+i*l*g-n*h*g)+E*(+t*h*g-t*u*p+s*o*p-i*o*g+i*u*d-s*h*d)+m*(+t*u*A-t*l*g-s*o*A+n*o*g+s*l*d-n*u*d)+v*(-i*l*d-t*h*A+t*l*p+i*o*A-n*o*p+n*h*d)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){const i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=n),this}invert(){const e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],o=e[4],l=e[5],h=e[6],u=e[7],d=e[8],A=e[9],p=e[10],g=e[11],_=e[12],E=e[13],m=e[14],v=e[15],w=A*m*u-E*p*u+E*h*g-l*m*g-A*h*v+l*p*v,x=_*p*u-d*m*u-_*h*g+o*m*g+d*h*v-o*p*v,I=d*E*u-_*A*u+_*l*g-o*E*g-d*l*v+o*A*v,R=_*A*h-d*E*h-_*l*p+o*E*p+d*l*m-o*A*m,S=t*w+n*x+i*I+s*R;if(S===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const T=1/S;return e[0]=w*T,e[1]=(E*p*s-A*m*s-E*i*g+n*m*g+A*i*v-n*p*v)*T,e[2]=(l*m*s-E*h*s+E*i*u-n*m*u-l*i*v+n*h*v)*T,e[3]=(A*h*s-l*p*s-A*i*u+n*p*u+l*i*g-n*h*g)*T,e[4]=x*T,e[5]=(d*m*s-_*p*s+_*i*g-t*m*g-d*i*v+t*p*v)*T,e[6]=(_*h*s-o*m*s-_*i*u+t*m*u+o*i*v-t*h*v)*T,e[7]=(o*p*s-d*h*s+d*i*u-t*p*u-o*i*g+t*h*g)*T,e[8]=I*T,e[9]=(_*A*s-d*E*s-_*n*g+t*E*g+d*n*v-t*A*v)*T,e[10]=(o*E*s-_*l*s+_*n*u-t*E*u-o*n*v+t*l*v)*T,e[11]=(d*l*s-o*A*s-d*n*u+t*A*u+o*n*g-t*l*g)*T,e[12]=R*T,e[13]=(d*E*i-_*A*i+_*n*p-t*E*p-d*n*m+t*A*m)*T,e[14]=(_*l*i-o*E*i-_*n*h+t*E*h+o*n*m-t*l*m)*T,e[15]=(o*A*i-d*l*i+d*n*h-t*A*h-o*n*p+t*l*p)*T,this}scale(e){const t=this.elements,n=e.x,i=e.y,s=e.z;return t[0]*=n,t[4]*=i,t[8]*=s,t[1]*=n,t[5]*=i,t[9]*=s,t[2]*=n,t[6]*=i,t[10]*=s,t[3]*=n,t[7]*=i,t[11]*=s,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,i))}makeTranslation(e,t,n){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const n=Math.cos(t),i=Math.sin(t),s=1-n,o=e.x,l=e.y,h=e.z,u=s*o,d=s*l;return this.set(u*o+n,u*l-i*h,u*h+i*l,0,u*l+i*h,d*l+n,d*h-i*o,0,u*h-i*l,d*h+i*o,s*h*h+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,i,s,o){return this.set(1,n,s,0,e,1,o,0,t,i,1,0,0,0,0,1),this}compose(e,t,n){const i=this.elements,s=t._x,o=t._y,l=t._z,h=t._w,u=s+s,d=o+o,A=l+l,p=s*u,g=s*d,_=s*A,E=o*d,m=o*A,v=l*A,w=h*u,x=h*d,I=h*A,R=n.x,S=n.y,T=n.z;return i[0]=(1-(E+v))*R,i[1]=(g+I)*R,i[2]=(_-x)*R,i[3]=0,i[4]=(g-I)*S,i[5]=(1-(p+v))*S,i[6]=(m+w)*S,i[7]=0,i[8]=(_+x)*T,i[9]=(m-w)*T,i[10]=(1-(p+E))*T,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,t,n){const i=this.elements;let s=gl.set(i[0],i[1],i[2]).length();const o=gl.set(i[4],i[5],i[6]).length(),l=gl.set(i[8],i[9],i[10]).length();this.determinant()<0&&(s=-s),e.x=i[12],e.y=i[13],e.z=i[14],Ri.copy(this);const h=1/s,u=1/o,d=1/l;return Ri.elements[0]*=h,Ri.elements[1]*=h,Ri.elements[2]*=h,Ri.elements[4]*=u,Ri.elements[5]*=u,Ri.elements[6]*=u,Ri.elements[8]*=d,Ri.elements[9]*=d,Ri.elements[10]*=d,t.setFromRotationMatrix(Ri),n.x=s,n.y=o,n.z=l,this}makePerspective(e,t,n,i,s,o,l=vs){const h=this.elements,u=2*s/(t-e),d=2*s/(n-i),A=(t+e)/(t-e),p=(n+i)/(n-i);let g,_;if(l===vs)g=-(o+s)/(o-s),_=-2*o*s/(o-s);else if(l===ud)g=-o/(o-s),_=-o*s/(o-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+l);return h[0]=u,h[4]=0,h[8]=A,h[12]=0,h[1]=0,h[5]=d,h[9]=p,h[13]=0,h[2]=0,h[6]=0,h[10]=g,h[14]=_,h[3]=0,h[7]=0,h[11]=-1,h[15]=0,this}makeOrthographic(e,t,n,i,s,o,l=vs){const h=this.elements,u=1/(t-e),d=1/(n-i),A=1/(o-s),p=(t+e)*u,g=(n+i)*d;let _,E;if(l===vs)_=(o+s)*A,E=-2*A;else if(l===ud)_=s*A,E=-1*A;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+l);return h[0]=2*u,h[4]=0,h[8]=0,h[12]=-p,h[1]=0,h[5]=2*d,h[9]=0,h[13]=-g,h[2]=0,h[6]=0,h[10]=E,h[14]=-_,h[3]=0,h[7]=0,h[11]=0,h[15]=1,this}equals(e){const t=this.elements,n=e.elements;for(let i=0;i<16;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}}const gl=new G,Ri=new rt,h5=new G(0,0,0),d5=new G(1,1,1),ia=new G,md=new G,Hn=new G,qE=new rt,XE=new Yi;class qi{constructor(e=0,t=0,n=0,i=qi.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=n,this._order=i}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,t,n,i=this._order){return this._x=e,this._y=t,this._z=n,this._order=i,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,t=this._order,n=!0){const i=e.elements,s=i[0],o=i[4],l=i[8],h=i[1],u=i[5],d=i[9],A=i[2],p=i[6],g=i[10];switch(t){case"XYZ":this._y=Math.asin(Br(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-d,g),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(p,u),this._z=0);break;case"YXZ":this._x=Math.asin(-Br(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(l,g),this._z=Math.atan2(h,u)):(this._y=Math.atan2(-A,s),this._z=0);break;case"ZXY":this._x=Math.asin(Br(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(-A,g),this._z=Math.atan2(-o,u)):(this._y=0,this._z=Math.atan2(h,s));break;case"ZYX":this._y=Math.asin(-Br(A,-1,1)),Math.abs(A)<.9999999?(this._x=Math.atan2(p,g),this._z=Math.atan2(h,s)):(this._x=0,this._z=Math.atan2(-o,u));break;case"YZX":this._z=Math.asin(Br(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(-d,u),this._y=Math.atan2(-A,s)):(this._x=0,this._y=Math.atan2(l,g));break;case"XZY":this._z=Math.asin(-Br(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(p,u),this._y=Math.atan2(l,s)):(this._x=Math.atan2(-d,g),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return qE.makeRotationFromQuaternion(e),this.setFromRotationMatrix(qE,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return XE.setFromEuler(this),this.setFromQuaternion(XE,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=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+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}}qi.DEFAULT_ORDER="XYZ";class vd{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!==0}isEnabled(e){return(this.mask&(1<<e|0))!==0}}let f5=0;const KE=new G,ml=new Yi,Es=new rt,_d=new G,Au=new G,p5=new G,A5=new Yi,JE=new G(1,0,0),ZE=new G(0,1,0),$E=new G(0,0,1),e2={type:"added"},g5={type:"removed"},vl={type:"childadded",child:null},jA={type:"childremoved",child:null};class Zt extends ao{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:f5++}),this.uuid=Si(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Zt.DEFAULT_UP.clone();const e=new G,t=new qi,n=new Yi,i=new G(1,1,1);function s(){n.setFromEuler(t,!1)}function o(){t.setFromQuaternion(n,void 0,!1)}t._onChange(s),n._onChange(o),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new rt},normalMatrix:{value:new gt}}),this.matrix=new rt,this.matrixWorld=new rt,this.matrixAutoUpdate=Zt.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=Zt.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new vd,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,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return ml.setFromAxisAngle(e,t),this.quaternion.multiply(ml),this}rotateOnWorldAxis(e,t){return ml.setFromAxisAngle(e,t),this.quaternion.premultiply(ml),this}rotateX(e){return this.rotateOnAxis(JE,e)}rotateY(e){return this.rotateOnAxis(ZE,e)}rotateZ(e){return this.rotateOnAxis($E,e)}translateOnAxis(e,t){return KE.copy(e).applyQuaternion(this.quaternion),this.position.add(KE.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(JE,e)}translateY(e){return this.translateOnAxis(ZE,e)}translateZ(e){return this.translateOnAxis($E,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(Es.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?_d.copy(e):_d.set(e,t,n);const i=this.parent;this.updateWorldMatrix(!0,!1),Au.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Es.lookAt(Au,_d,this.up):Es.lookAt(_d,Au,this.up),this.quaternion.setFromRotationMatrix(Es),i&&(Es.extractRotation(i.matrixWorld),ml.setFromRotationMatrix(Es),this.quaternion.premultiply(ml.invert()))}add(e){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);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(e2),vl.child=e,this.dispatchEvent(vl),vl.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.remove(arguments[n]);return this}const t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(g5),jA.child=e,this.dispatchEvent(jA),jA.child=null),this}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),Es.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),Es.multiply(e.parent.matrixWorld)),e.applyMatrix4(Es),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(e2),vl.child=e,this.dispatchEvent(vl),vl.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let n=0,i=this.children.length;n<i;n++){const s=this.children[n].getObjectByProperty(e,t);if(s!==void 0)return s}}getObjectsByProperty(e,t,n=[]){this[e]===t&&n.push(this);const i=this.children;for(let s=0,o=i.length;s<o;s++)i[s].getObjectsByProperty(e,t,n);return n}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Au,e,p5),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Au,A5,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let n=0,i=t.length;n<i;n++)t[n].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const t=this.children;for(let n=0,i=t.length;n<i;n++)t[n].traverseVisible(e)}traverseAncestors(e){const t=this.parent;t!==null&&(e(t),t.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.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,e=!0);const t=this.children;for(let n=0,i=t.length;n<i;n++){const s=t[n];(s.matrixWorldAutoUpdate===!0||e===!0)&&s.updateMatrixWorld(e)}}updateWorldMatrix(e,t){const n=this.parent;if(e===!0&&n!==null&&n.matrixWorldAutoUpdate===!0&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),t===!0){const i=this.children;for(let s=0,o=i.length;s<o;s++){const l=i[s];l.matrixWorldAutoUpdate===!0&&l.updateWorldMatrix(!1,!0)}}}toJSON(e){const t=e===void 0||typeof e=="string",n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"});const i={};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.castShadow===!0&&(i.castShadow=!0),this.receiveShadow===!0&&(i.receiveShadow=!0),this.visible===!1&&(i.visible=!1),this.frustumCulled===!1&&(i.frustumCulled=!1),this.renderOrder!==0&&(i.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.visibility=this._visibility,i.active=this._active,i.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()})),i.maxGeometryCount=this._maxGeometryCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.geometryCount=this._geometryCount,i.matricesTexture=this._matricesTexture.toJSON(e),this.boundingSphere!==null&&(i.boundingSphere={center:i.boundingSphere.center.toArray(),radius:i.boundingSphere.radius}),this.boundingBox!==null&&(i.boundingBox={min:i.boundingBox.min.toArray(),max:i.boundingBox.max.toArray()}));function s(l,h){return l[h.uuid]===void 0&&(l[h.uuid]=h.toJSON(e)),h.uuid}if(this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(i.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=s(e.geometries,this.geometry);const l=this.geometry.parameters;if(l!==void 0&&l.shapes!==void 0){const h=l.shapes;if(Array.isArray(h))for(let u=0,d=h.length;u<d;u++){const A=h[u];s(e.shapes,A)}else s(e.shapes,h)}}if(this.isSkinnedMesh&&(i.bindMode=this.bindMode,i.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(s(e.skeletons,this.skeleton),i.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const l=[];for(let h=0,u=this.material.length;h<u;h++)l.push(s(e.materials,this.material[h]));i.material=l}else i.material=s(e.materials,this.material);if(this.children.length>0){i.children=[];for(let l=0;l<this.children.length;l++)i.children.push(this.children[l].toJSON(e).object)}if(this.animations.length>0){i.animations=[];for(let l=0;l<this.animations.length;l++){const h=this.animations[l];i.animations.push(s(e.animations,h))}}if(t){const l=o(e.geometries),h=o(e.materials),u=o(e.textures),d=o(e.images),A=o(e.shapes),p=o(e.skeletons),g=o(e.animations),_=o(e.nodes);l.length>0&&(n.geometries=l),h.length>0&&(n.materials=h),u.length>0&&(n.textures=u),d.length>0&&(n.images=d),A.length>0&&(n.shapes=A),p.length>0&&(n.skeletons=p),g.length>0&&(n.animations=g),_.length>0&&(n.nodes=_)}return n.object=i,n;function o(l){const h=[];for(const u in l){const d=l[u];delete d.metadata,h.push(d)}return h}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!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)),t===!0)for(let n=0;n<e.children.length;n++){const i=e.children[n];this.add(i.clone())}return this}}Zt.DEFAULT_UP=new G(0,1,0),Zt.DEFAULT_MATRIX_AUTO_UPDATE=!0,Zt.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const Di=new G,xs=new G,WA=new G,ws=new G,_l=new G,yl=new G,t2=new G,YA=new G,qA=new G,XA=new G;class un{constructor(e=new G,t=new G,n=new G){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,i){i.subVectors(n,t),Di.subVectors(e,t),i.cross(Di);const s=i.lengthSq();return s>0?i.multiplyScalar(1/Math.sqrt(s)):i.set(0,0,0)}static getBarycoord(e,t,n,i,s){Di.subVectors(i,t),xs.subVectors(n,t),WA.subVectors(e,t);const o=Di.dot(Di),l=Di.dot(xs),h=Di.dot(WA),u=xs.dot(xs),d=xs.dot(WA),A=o*u-l*l;if(A===0)return s.set(0,0,0),null;const p=1/A,g=(u*h-l*d)*p,_=(o*d-l*h)*p;return s.set(1-g-_,_,g)}static containsPoint(e,t,n,i){return this.getBarycoord(e,t,n,i,ws)===null?!1:ws.x>=0&&ws.y>=0&&ws.x+ws.y<=1}static getInterpolation(e,t,n,i,s,o,l,h){return this.getBarycoord(e,t,n,i,ws)===null?(h.x=0,h.y=0,"z"in h&&(h.z=0),"w"in h&&(h.w=0),null):(h.setScalar(0),h.addScaledVector(s,ws.x),h.addScaledVector(o,ws.y),h.addScaledVector(l,ws.z),h)}static isFrontFacing(e,t,n,i){return Di.subVectors(n,t),xs.subVectors(e,t),Di.cross(xs).dot(i)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,i){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,t,n,i){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,i),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Di.subVectors(this.c,this.b),xs.subVectors(this.a,this.b),Di.cross(xs).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return un.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return un.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,n,i,s){return un.getInterpolation(e,this.a,this.b,this.c,t,n,i,s)}containsPoint(e){return un.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return un.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const n=this.a,i=this.b,s=this.c;let o,l;_l.subVectors(i,n),yl.subVectors(s,n),YA.subVectors(e,n);const h=_l.dot(YA),u=yl.dot(YA);if(h<=0&&u<=0)return t.copy(n);qA.subVectors(e,i);const d=_l.dot(qA),A=yl.dot(qA);if(d>=0&&A<=d)return t.copy(i);const p=h*A-d*u;if(p<=0&&h>=0&&d<=0)return o=h/(h-d),t.copy(n).addScaledVector(_l,o);XA.subVectors(e,s);const g=_l.dot(XA),_=yl.dot(XA);if(_>=0&&g<=_)return t.copy(s);const E=g*u-h*_;if(E<=0&&u>=0&&_<=0)return l=u/(u-_),t.copy(n).addScaledVector(yl,l);const m=d*_-g*A;if(m<=0&&A-d>=0&&g-_>=0)return t2.subVectors(s,i),l=(A-d)/(A-d+(g-_)),t.copy(i).addScaledVector(t2,l);const v=1/(m+E+p);return o=E*v,l=p*v,t.copy(n).addScaledVector(_l,o).addScaledVector(yl,l)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const r2={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},sa={h:0,s:0,l:0},yd={h:0,s:0,l:0};function KA(r,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?r+(e-r)*6*t:t<1/2?e:t<2/3?r+(e-r)*6*(2/3-t):r}class Ve{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,n)}set(e,t,n){if(t===void 0&&n===void 0){const i=e;i&&i.isColor?this.copy(i):typeof i=="number"?this.setHex(i):typeof i=="string"&&this.setStyle(i)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Fr){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Tt.toWorkingColorSpace(this,t),this}setRGB(e,t,n,i=Tt.workingColorSpace){return this.r=e,this.g=t,this.b=n,Tt.toWorkingColorSpace(this,i),this}setHSL(e,t,n,i=Tt.workingColorSpace){if(e=NA(e,1),t=Br(t,0,1),n=Br(n,0,1),t===0)this.r=this.g=this.b=n;else{const s=n<=.5?n*(1+t):n+t-n*t,o=2*n-s;this.r=KA(o,s,e+1/3),this.g=KA(o,s,e),this.b=KA(o,s,e-1/3)}return Tt.toWorkingColorSpace(this,i),this}setStyle(e,t=Fr){function n(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(e)){let s;const o=i[1],l=i[2];switch(o){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(l))return n(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,t);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(l))return n(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,t);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(l))return n(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){const s=i[1],o=s.length;if(o===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,t);if(o===6)return this.setHex(parseInt(s,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=Fr){const n=r2[e.toLowerCase()];return n!==void 0?this.setHex(n,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=hl(e.r),this.g=hl(e.g),this.b=hl(e.b),this}copyLinearToSRGB(e){return this.r=kA(e.r),this.g=kA(e.g),this.b=kA(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Fr){return Tt.fromWorkingColorSpace($r.copy(this),e),Math.round(Br($r.r*255,0,255))*65536+Math.round(Br($r.g*255,0,255))*256+Math.round(Br($r.b*255,0,255))}getHexString(e=Fr){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=Tt.workingColorSpace){Tt.fromWorkingColorSpace($r.copy(this),t);const n=$r.r,i=$r.g,s=$r.b,o=Math.max(n,i,s),l=Math.min(n,i,s);let h,u;const d=(l+o)/2;if(l===o)h=0,u=0;else{const A=o-l;switch(u=d<=.5?A/(o+l):A/(2-o-l),o){case n:h=(i-s)/A+(i<s?6:0);break;case i:h=(s-n)/A+2;break;case s:h=(n-i)/A+4;break}h/=6}return e.h=h,e.s=u,e.l=d,e}getRGB(e,t=Tt.workingColorSpace){return Tt.fromWorkingColorSpace($r.copy(this),t),e.r=$r.r,e.g=$r.g,e.b=$r.b,e}getStyle(e=Fr){Tt.fromWorkingColorSpace($r.copy(this),e);const t=$r.r,n=$r.g,i=$r.b;return e!==Fr?`color(${e} ${t.toFixed(3)} ${n.toFixed(3)} ${i.toFixed(3)})`:`rgb(${Math.round(t*255)},${Math.round(n*255)},${Math.round(i*255)})`}offsetHSL(e,t,n){return this.getHSL(sa),this.setHSL(sa.h+e,sa.s+t,sa.l+n)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,n){return this.r=e.r+(t.r-e.r)*n,this.g=e.g+(t.g-e.g)*n,this.b=e.b+(t.b-e.b)*n,this}lerpHSL(e,t){this.getHSL(sa),e.getHSL(yd);const n=hu(sa.h,yd.h,t),i=hu(sa.s,yd.s,t),s=hu(sa.l,yd.l,t);return this.setHSL(n,i,s),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const t=this.r,n=this.g,i=this.b,s=e.elements;return this.r=s[0]*t+s[3]*n+s[6]*i,this.g=s[1]*t+s[4]*n+s[7]*i,this.b=s[2]*t+s[5]*n+s[8]*i,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const $r=new Ve;Ve.NAMES=r2;let m5=0;class Xi extends ao{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:m5++}),this.uuid=Si(),this.name="",this.type="Material",this.blending=sl,this.side=xi,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=gA,this.blendDst=mA,this.blendEquation=no,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new Ve(0,0,0),this.blendAlpha=0,this.depthFunc=Jh,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=UE,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=cl,this.stencilZFail=cl,this.stencilZPass=cl,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(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const n=e[t];if(n===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const i=this[t];if(i===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[t]=n}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const 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(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),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(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).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(e).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).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(e).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).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!==sl&&(n.blending=this.blending),this.side!==xi&&(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!==gA&&(n.blendSrc=this.blendSrc),this.blendDst!==mA&&(n.blendDst=this.blendDst),this.blendEquation!==no&&(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!==Jh&&(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!==UE&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==cl&&(n.stencilFail=this.stencilFail),this.stencilZFail!==cl&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==cl&&(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 i(s){const o=[];for(const l in s){const h=s[l];delete h.metadata,o.push(h)}return o}if(t){const s=i(e.textures),o=i(e.images);s.length>0&&(n.textures=s),o.length>0&&(n.images=o)}return n}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let n=null;if(t!==null){const i=t.length;n=new Array(i);for(let s=0;s!==i;++s)n[s]=t[s].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}class Ki extends Xi{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Ve(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 qi,this.combine=$y,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const Is=v5();function v5(){const r=new ArrayBuffer(4),e=new Float32Array(r),t=new Uint32Array(r),n=new Uint32Array(512),i=new Uint32Array(512);for(let h=0;h<256;++h){const u=h-127;u<-27?(n[h]=0,n[h|256]=32768,i[h]=24,i[h|256]=24):u<-14?(n[h]=1024>>-u-14,n[h|256]=1024>>-u-14|32768,i[h]=-u-1,i[h|256]=-u-1):u<=15?(n[h]=u+15<<10,n[h|256]=u+15<<10|32768,i[h]=13,i[h|256]=13):u<128?(n[h]=31744,n[h|256]=64512,i[h]=24,i[h|256]=24):(n[h]=31744,n[h|256]=64512,i[h]=13,i[h|256]=13)}const s=new Uint32Array(2048),o=new Uint32Array(64),l=new Uint32Array(64);for(let h=1;h<1024;++h){let u=h<<13,d=0;for(;!(u&8388608);)u<<=1,d-=8388608;u&=-8388609,d+=947912704,s[h]=u|d}for(let h=1024;h<2048;++h)s[h]=939524096+(h-1024<<13);for(let h=1;h<31;++h)o[h]=h<<23;o[31]=1199570944,o[32]=2147483648;for(let h=33;h<63;++h)o[h]=2147483648+(h-32<<23);o[63]=3347054592;for(let h=1;h<64;++h)h!==32&&(l[h]=1024);return{floatView:e,uint32View:t,baseTable:n,shiftTable:i,mantissaTable:s,exponentTable:o,offsetTable:l}}function _5(r){Math.abs(r)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),r=Br(r,-65504,65504),Is.floatView[0]=r;const e=Is.uint32View[0],t=e>>23&511;return Is.baseTable[t]+((e&8388607)>>Is.shiftTable[t])}function y5(r){const e=r>>10;return Is.uint32View[0]=Is.mantissaTable[Is.offsetTable[e]+(r&1023)]+Is.exponentTable[e],Is.floatView[0]}const Ed={toHalfFloat:_5,fromHalfFloat:y5},Ir=new G,xd=new Ue;class zr{constructor(e,t,n=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=n,this.usage=LA,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=lr,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return zE("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let i=0,s=this.itemSize;i<s;i++)this.array[e+i]=t.array[n+i];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,n=this.count;t<n;t++)xd.fromBufferAttribute(this,t),xd.applyMatrix3(e),this.setXY(t,xd.x,xd.y);else if(this.itemSize===3)for(let t=0,n=this.count;t<n;t++)Ir.fromBufferAttribute(this,t),Ir.applyMatrix3(e),this.setXYZ(t,Ir.x,Ir.y,Ir.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)Ir.fromBufferAttribute(this,t),Ir.applyMatrix4(e),this.setXYZ(t,Ir.x,Ir.y,Ir.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)Ir.fromBufferAttribute(this,t),Ir.applyNormalMatrix(e),this.setXYZ(t,Ir.x,Ir.y,Ir.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)Ir.fromBufferAttribute(this,t),Ir.transformDirection(e),this.setXYZ(t,Ir.x,Ir.y,Ir.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let n=this.array[e*this.itemSize+t];return this.normalized&&(n=Ti(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=Ut(n,this.array)),this.array[e*this.itemSize+t]=n,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=Ti(t,this.array)),t}setX(e,t){return this.normalized&&(t=Ut(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=Ti(t,this.array)),t}setY(e,t){return this.normalized&&(t=Ut(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=Ti(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Ut(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=Ti(t,this.array)),t}setW(e,t){return this.normalized&&(t=Ut(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=Ut(t,this.array),n=Ut(n,this.array)),this.array[e+0]=t,this.array[e+1]=n,this}setXYZ(e,t,n,i){return e*=this.itemSize,this.normalized&&(t=Ut(t,this.array),n=Ut(n,this.array),i=Ut(i,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this}setXYZW(e,t,n,i,s){return e*=this.itemSize,this.normalized&&(t=Ut(t,this.array),n=Ut(n,this.array),i=Ut(i,this.array),s=Ut(s,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this.array[e+3]=s,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(e.name=this.name),this.usage!==LA&&(e.usage=this.usage),e}}class n2 extends zr{constructor(e,t,n){super(new Uint16Array(e),t,n)}}class i2 extends zr{constructor(e,t,n){super(new Uint32Array(e),t,n)}}class Li extends zr{constructor(e,t,n){super(new Float32Array(e),t,n)}}let E5=0;const ii=new rt,JA=new Zt,El=new G,Gn=new _r,gu=new _r,Hr=new G;class Vn extends ao{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:E5++}),this.uuid=Si(),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(e){return Array.isArray(e)?this.index=new(OE(e)?i2:n2)(e,1):this.index=e,this}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,n=0){this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);const n=this.attributes.normal;if(n!==void 0){const s=new gt().getNormalMatrix(e);n.applyNormalMatrix(s),n.needsUpdate=!0}const i=this.attributes.tangent;return i!==void 0&&(i.transformDirection(e),i.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return ii.makeRotationFromQuaternion(e),this.applyMatrix4(ii),this}rotateX(e){return ii.makeRotationX(e),this.applyMatrix4(ii),this}rotateY(e){return ii.makeRotationY(e),this.applyMatrix4(ii),this}rotateZ(e){return ii.makeRotationZ(e),this.applyMatrix4(ii),this}translate(e,t,n){return ii.makeTranslation(e,t,n),this.applyMatrix4(ii),this}scale(e,t,n){return ii.makeScale(e,t,n),this.applyMatrix4(ii),this}lookAt(e){return JA.lookAt(e),JA.updateMatrix(),this.applyMatrix4(JA.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(El).negate(),this.translate(El.x,El.y,El.z),this}setFromPoints(e){const t=[];for(let n=0,i=e.length;n<i;n++){const s=e[n];t.push(s.x,s.y,s.z||0)}return this.setAttribute("position",new Li(t,3)),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new _r);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new G(-1/0,-1/0,-1/0),new G(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let n=0,i=t.length;n<i;n++){const s=t[n];Gn.setFromBufferAttribute(s),this.morphTargetsRelative?(Hr.addVectors(this.boundingBox.min,Gn.min),this.boundingBox.expandByPoint(Hr),Hr.addVectors(this.boundingBox.max,Gn.max),this.boundingBox.expandByPoint(Hr)):(this.boundingBox.expandByPoint(Gn.min),this.boundingBox.expandByPoint(Gn.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 bi);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new G,1/0);return}if(e){const n=this.boundingSphere.center;if(Gn.setFromBufferAttribute(e),t)for(let s=0,o=t.length;s<o;s++){const l=t[s];gu.setFromBufferAttribute(l),this.morphTargetsRelative?(Hr.addVectors(Gn.min,gu.min),Gn.expandByPoint(Hr),Hr.addVectors(Gn.max,gu.max),Gn.expandByPoint(Hr)):(Gn.expandByPoint(gu.min),Gn.expandByPoint(gu.max))}Gn.getCenter(n);let i=0;for(let s=0,o=e.count;s<o;s++)Hr.fromBufferAttribute(e,s),i=Math.max(i,n.distanceToSquared(Hr));if(t)for(let s=0,o=t.length;s<o;s++){const l=t[s],h=this.morphTargetsRelative;for(let u=0,d=l.count;u<d;u++)Hr.fromBufferAttribute(l,u),h&&(El.fromBufferAttribute(e,u),Hr.add(El)),i=Math.max(i,n.distanceToSquared(Hr))}this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,t=this.attributes;if(e===null||t.position===void 0||t.normal===void 0||t.uv===void 0){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const n=t.position,i=t.normal,s=t.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new zr(new Float32Array(4*n.count),4));const o=this.getAttribute("tangent"),l=[],h=[];for(let D=0;D<n.count;D++)l[D]=new G,h[D]=new G;const u=new G,d=new G,A=new G,p=new Ue,g=new Ue,_=new Ue,E=new G,m=new G;function v(D,b,M){u.fromBufferAttribute(n,D),d.fromBufferAttribute(n,b),A.fromBufferAttribute(n,M),p.fromBufferAttribute(s,D),g.fromBufferAttribute(s,b),_.fromBufferAttribute(s,M),d.sub(u),A.sub(u),g.sub(p),_.sub(p);const L=1/(g.x*_.y-_.x*g.y);isFinite(L)&&(E.copy(d).multiplyScalar(_.y).addScaledVector(A,-g.y).multiplyScalar(L),m.copy(A).multiplyScalar(g.x).addScaledVector(d,-_.x).multiplyScalar(L),l[D].add(E),l[b].add(E),l[M].add(E),h[D].add(m),h[b].add(m),h[M].add(m))}let w=this.groups;w.length===0&&(w=[{start:0,count:e.count}]);for(let D=0,b=w.length;D<b;++D){const M=w[D],L=M.start,P=M.count;for(let N=L,W=L+P;N<W;N+=3)v(e.getX(N+0),e.getX(N+1),e.getX(N+2))}const x=new G,I=new G,R=new G,S=new G;function T(D){R.fromBufferAttribute(i,D),S.copy(R);const b=l[D];x.copy(b),x.sub(R.multiplyScalar(R.dot(b))).normalize(),I.crossVectors(S,b);const M=I.dot(h[D])<0?-1:1;o.setXYZW(D,x.x,x.y,x.z,M)}for(let D=0,b=w.length;D<b;++D){const M=w[D],L=M.start,P=M.count;for(let N=L,W=L+P;N<W;N+=3)T(e.getX(N+0)),T(e.getX(N+1)),T(e.getX(N+2))}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(t!==void 0){let n=this.getAttribute("normal");if(n===void 0)n=new zr(new Float32Array(t.count*3),3),this.setAttribute("normal",n);else for(let p=0,g=n.count;p<g;p++)n.setXYZ(p,0,0,0);const i=new G,s=new G,o=new G,l=new G,h=new G,u=new G,d=new G,A=new G;if(e)for(let p=0,g=e.count;p<g;p+=3){const _=e.getX(p+0),E=e.getX(p+1),m=e.getX(p+2);i.fromBufferAttribute(t,_),s.fromBufferAttribute(t,E),o.fromBufferAttribute(t,m),d.subVectors(o,s),A.subVectors(i,s),d.cross(A),l.fromBufferAttribute(n,_),h.fromBufferAttribute(n,E),u.fromBufferAttribute(n,m),l.add(d),h.add(d),u.add(d),n.setXYZ(_,l.x,l.y,l.z),n.setXYZ(E,h.x,h.y,h.z),n.setXYZ(m,u.x,u.y,u.z)}else for(let p=0,g=t.count;p<g;p+=3)i.fromBufferAttribute(t,p+0),s.fromBufferAttribute(t,p+1),o.fromBufferAttribute(t,p+2),d.subVectors(o,s),A.subVectors(i,s),d.cross(A),n.setXYZ(p+0,d.x,d.y,d.z),n.setXYZ(p+1,d.x,d.y,d.z),n.setXYZ(p+2,d.x,d.y,d.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let t=0,n=e.count;t<n;t++)Hr.fromBufferAttribute(e,t),Hr.normalize(),e.setXYZ(t,Hr.x,Hr.y,Hr.z)}toNonIndexed(){function e(l,h){const u=l.array,d=l.itemSize,A=l.normalized,p=new u.constructor(h.length*d);let g=0,_=0;for(let E=0,m=h.length;E<m;E++){l.isInterleavedBufferAttribute?g=h[E]*l.data.stride+l.offset:g=h[E]*d;for(let v=0;v<d;v++)p[_++]=u[g++]}return new zr(p,d,A)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new Vn,n=this.index.array,i=this.attributes;for(const l in i){const h=i[l],u=e(h,n);t.setAttribute(l,u)}const s=this.morphAttributes;for(const l in s){const h=[],u=s[l];for(let d=0,A=u.length;d<A;d++){const p=u[d],g=e(p,n);h.push(g)}t.morphAttributes[l]=h}t.morphTargetsRelative=this.morphTargetsRelative;const o=this.groups;for(let l=0,h=o.length;l<h;l++){const u=o[l];t.addGroup(u.start,u.count,u.materialIndex)}return t}toJSON(){const e={metadata:{version:4.6,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,this.name!==""&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),this.parameters!==void 0){const h=this.parameters;for(const u in h)h[u]!==void 0&&(e[u]=h[u]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const n=this.attributes;for(const h in n){const u=n[h];e.data.attributes[h]=u.toJSON(e.data)}const i={};let s=!1;for(const h in this.morphAttributes){const u=this.morphAttributes[h],d=[];for(let A=0,p=u.length;A<p;A++){const g=u[A];d.push(g.toJSON(e.data))}d.length>0&&(i[h]=d,s=!0)}s&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const l=this.boundingSphere;return l!==null&&(e.data.boundingSphere={center:l.center.toArray(),radius:l.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const n=e.index;n!==null&&this.setIndex(n.clone(t));const i=e.attributes;for(const u in i){const d=i[u];this.setAttribute(u,d.clone(t))}const s=e.morphAttributes;for(const u in s){const d=[],A=s[u];for(let p=0,g=A.length;p<g;p++)d.push(A[p].clone(t));this.morphAttributes[u]=d}this.morphTargetsRelative=e.morphTargetsRelative;const o=e.groups;for(let u=0,d=o.length;u<d;u++){const A=o[u];this.addGroup(A.start,A.count,A.materialIndex)}const l=e.boundingBox;l!==null&&(this.boundingBox=l.clone());const h=e.boundingSphere;return h!==null&&(this.boundingSphere=h.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}const s2=new rt,uo=new co,wd=new bi,a2=new G,xl=new G,wl=new G,Il=new G,ZA=new G,Id=new G,Cd=new Ue,Md=new Ue,Sd=new Ue,o2=new G,l2=new G,c2=new G,Td=new G,Bd=new G;class Xr extends Zt{constructor(e=new Vn,t=new Ki){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){const e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){const n=e[t[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let i=0,s=n.length;i<s;i++){const o=n[i].name||String(i);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=i}}}}getVertexPosition(e,t){const n=this.geometry,i=n.attributes.position,s=n.morphAttributes.position,o=n.morphTargetsRelative;t.fromBufferAttribute(i,e);const l=this.morphTargetInfluences;if(s&&l){Id.set(0,0,0);for(let h=0,u=s.length;h<u;h++){const d=l[h],A=s[h];d!==0&&(ZA.fromBufferAttribute(A,e),o?Id.addScaledVector(ZA,d):Id.addScaledVector(ZA.sub(t),d))}t.add(Id)}return t}raycast(e,t){const n=this.geometry,i=this.material,s=this.matrixWorld;i!==void 0&&(n.boundingSphere===null&&n.computeBoundingSphere(),wd.copy(n.boundingSphere),wd.applyMatrix4(s),uo.copy(e.ray).recast(e.near),!(wd.containsPoint(uo.origin)===!1&&(uo.intersectSphere(wd,a2)===null||uo.origin.distanceToSquared(a2)>(e.far-e.near)**2))&&(s2.copy(s).invert(),uo.copy(e.ray).applyMatrix4(s2),!(n.boundingBox!==null&&uo.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(e,t,uo)))}_computeIntersections(e,t,n){let i;const s=this.geometry,o=this.material,l=s.index,h=s.attributes.position,u=s.attributes.uv,d=s.attributes.uv1,A=s.attributes.normal,p=s.groups,g=s.drawRange;if(l!==null)if(Array.isArray(o))for(let _=0,E=p.length;_<E;_++){const m=p[_],v=o[m.materialIndex],w=Math.max(m.start,g.start),x=Math.min(l.count,Math.min(m.start+m.count,g.start+g.count));for(let I=w,R=x;I<R;I+=3){const S=l.getX(I),T=l.getX(I+1),D=l.getX(I+2);i=bd(this,v,e,n,u,d,A,S,T,D),i&&(i.faceIndex=Math.floor(I/3),i.face.materialIndex=m.materialIndex,t.push(i))}}else{const _=Math.max(0,g.start),E=Math.min(l.count,g.start+g.count);for(let m=_,v=E;m<v;m+=3){const w=l.getX(m),x=l.getX(m+1),I=l.getX(m+2);i=bd(this,o,e,n,u,d,A,w,x,I),i&&(i.faceIndex=Math.floor(m/3),t.push(i))}}else if(h!==void 0)if(Array.isArray(o))for(let _=0,E=p.length;_<E;_++){const m=p[_],v=o[m.materialIndex],w=Math.max(m.start,g.start),x=Math.min(h.count,Math.min(m.start+m.count,g.start+g.count));for(let I=w,R=x;I<R;I+=3){const S=I,T=I+1,D=I+2;i=bd(this,v,e,n,u,d,A,S,T,D),i&&(i.faceIndex=Math.floor(I/3),i.face.materialIndex=m.materialIndex,t.push(i))}}else{const _=Math.max(0,g.start),E=Math.min(h.count,g.start+g.count);for(let m=_,v=E;m<v;m+=3){const w=m,x=m+1,I=m+2;i=bd(this,o,e,n,u,d,A,w,x,I),i&&(i.faceIndex=Math.floor(m/3),t.push(i))}}}}function x5(r,e,t,n,i,s,o,l){let h;if(e.side===Qr?h=n.intersectTriangle(o,s,i,!0,l):h=n.intersectTriangle(i,s,o,e.side===xi,l),h===null)return null;Bd.copy(l),Bd.applyMatrix4(r.matrixWorld);const u=t.ray.origin.distanceTo(Bd);return u<t.near||u>t.far?null:{distance:u,point:Bd.clone(),object:r}}function bd(r,e,t,n,i,s,o,l,h,u){r.getVertexPosition(l,xl),r.getVertexPosition(h,wl),r.getVertexPosition(u,Il);const d=x5(r,e,t,n,xl,wl,Il,Td);if(d){i&&(Cd.fromBufferAttribute(i,l),Md.fromBufferAttribute(i,h),Sd.fromBufferAttribute(i,u),d.uv=un.getInterpolation(Td,xl,wl,Il,Cd,Md,Sd,new Ue)),s&&(Cd.fromBufferAttribute(s,l),Md.fromBufferAttribute(s,h),Sd.fromBufferAttribute(s,u),d.uv1=un.getInterpolation(Td,xl,wl,Il,Cd,Md,Sd,new Ue)),o&&(o2.fromBufferAttribute(o,l),l2.fromBufferAttribute(o,h),c2.fromBufferAttribute(o,u),d.normal=un.getInterpolation(Td,xl,wl,Il,o2,l2,c2,new G),d.normal.dot(n.direction)>0&&d.normal.multiplyScalar(-1));const A={a:l,b:h,c:u,normal:new G,materialIndex:0};un.getNormal(xl,wl,Il,A.normal),d.face=A}return d}class mu extends Vn{constructor(e=1,t=1,n=1,i=1,s=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:i,heightSegments:s,depthSegments:o};const l=this;i=Math.floor(i),s=Math.floor(s),o=Math.floor(o);const h=[],u=[],d=[],A=[];let p=0,g=0;_("z","y","x",-1,-1,n,t,e,o,s,0),_("z","y","x",1,-1,n,t,-e,o,s,1),_("x","z","y",1,1,e,n,t,i,o,2),_("x","z","y",1,-1,e,n,-t,i,o,3),_("x","y","z",1,-1,e,t,n,i,s,4),_("x","y","z",-1,-1,e,t,-n,i,s,5),this.setIndex(h),this.setAttribute("position",new Li(u,3)),this.setAttribute("normal",new Li(d,3)),this.setAttribute("uv",new Li(A,2));function _(E,m,v,w,x,I,R,S,T,D,b){const M=I/T,L=R/D,P=I/2,N=R/2,W=S/2,X=T+1,K=D+1;let te=0,V=0;const ee=new G;for(let Q=0;Q<K;Q++){const z=Q*L-N;for(let Z=0;Z<X;Z++){const re=Z*M-P;ee[E]=re*w,ee[m]=z*x,ee[v]=W,u.push(ee.x,ee.y,ee.z),ee[E]=0,ee[m]=0,ee[v]=S>0?1:-1,d.push(ee.x,ee.y,ee.z),A.push(Z/T),A.push(1-Q/D),te+=1}}for(let Q=0;Q<D;Q++)for(let z=0;z<T;z++){const Z=p+z+X*Q,re=p+z+X*(Q+1),j=p+(z+1)+X*(Q+1),de=p+(z+1)+X*Q;h.push(Z,re,de),h.push(re,j,de),V+=6}l.addGroup(g,V,b),g+=V,p+=te}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new mu(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function Cl(r){const e={};for(const t in r){e[t]={};for(const n in r[t]){const i=r[t][n];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture||i.isQuaternion)?i.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[t][n]=null):e[t][n]=i.clone():Array.isArray(i)?e[t][n]=i.slice():e[t][n]=i}}return e}function hn(r){const e={};for(let t=0;t<r.length;t++){const n=Cl(r[t]);for(const i in n)e[i]=n[i]}return e}function w5(r){const e=[];for(let t=0;t<r.length;t++)e.push(r[t].clone());return e}function u2(r){const e=r.getRenderTarget();return e===null?r.outputColorSpace:e.isXRRenderTarget===!0?e.texture.colorSpace:Tt.workingColorSpace}const Ml={clone:Cl,merge:hn};var I5=`void main() {
36
+ */const Kh="163",nl={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},il={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},jB=0,Xy=1,WB=2,Ky=1,YB=2,As=3,xi=0,Qr=1,wi=2,gs=0,sl=1,pA=2,Jy=3,Zy=4,qB=5,no=100,XB=101,KB=102,JB=103,ZB=104,$B=200,eb=201,tb=202,rb=203,AA=204,gA=205,nb=206,ib=207,sb=208,ab=209,ob=210,lb=211,cb=212,ub=213,hb=214,db=0,fb=1,pb=2,Jh=3,Ab=4,gb=5,mb=6,vb=7,$y=0,_b=1,yb=2,Zs=0,mA=1,eE=2,tE=3,rE=4,Eb=5,nE=6,iE=7,sE="attached",xb="detached",aE=300,io=301,al=302,ru=303,vA=304,Zh=306,$s=1e3,Ii=1001,$h=1002,Ar=1003,oE=1004,nu=1005,gr=1006,ed=1007,Ci=1008,wb=1008,mr=1009,_A=1010,lE=1011,yA=1012,iu=1013,Mi=1014,lr=1015,Or=1016,cE=1017,uE=1018,su=1020,Ib=35902,Cb=1021,Mb=1022,vr=1023,Sb=1024,Tb=1025,ol=1026,au=1027,ea=1028,EA=1029,so=1030,td=1031,ou=1033,rd=33776,xA=33777,wA=33778,nd=33779,IA=35840,hE=35841,CA=35842,dE=35843,MA=36196,SA=37492,TA=37496,BA=37808,fE=37809,pE=37810,AE=37811,id=37812,gE=37813,mE=37814,vE=37815,_E=37816,yE=37817,EE=37818,xE=37819,wE=37820,IE=37821,sd=36492,CE=36494,ME=36495,Bb=36283,SE=36284,TE=36285,BE=36286,lu=2300,ll=2301,bA=2302,bE=2400,RE=2401,DE=2402,bb=2500,Rb=0,LE=1,RA=2,Db=3200,Lb=3201,NE=0,Nb=1,ms="",Fr="srgb",cr="srgb-linear",ad="display-p3",cu="display-p3-linear",od="linear",Ht="srgb",ld="rec709",cd="p3",cl=7680,UE=519,Ub=512,Pb=513,kb=514,PE=515,Qb=516,Ob=517,Fb=518,zb=519,DA=35044,kE="300 es",vs=2e3,ud=2001;class ao{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;const n=this._listeners;return n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;const n=this._listeners[e];if(n!==void 0){const i=n.indexOf(t);i!==-1&&n.splice(i,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const t=this._listeners[e.type];if(t!==void 0){e.target=this;const n=t.slice(0);for(let i=0,s=n.length;i<s;i++)n[i].call(this,e);e.target=null}}}const Zr=["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"];let QE=1234567;const uu=Math.PI/180,ul=180/Math.PI;function Si(){const r=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,n=Math.random()*4294967295|0;return(Zr[r&255]+Zr[r>>8&255]+Zr[r>>16&255]+Zr[r>>24&255]+"-"+Zr[e&255]+Zr[e>>8&255]+"-"+Zr[e>>16&15|64]+Zr[e>>24&255]+"-"+Zr[t&63|128]+Zr[t>>8&255]+"-"+Zr[t>>16&255]+Zr[t>>24&255]+Zr[n&255]+Zr[n>>8&255]+Zr[n>>16&255]+Zr[n>>24&255]).toLowerCase()}function Br(r,e,t){return Math.max(e,Math.min(t,r))}function LA(r,e){return(r%e+e)%e}function Hb(r,e,t,n,i){return n+(r-e)*(i-n)/(t-e)}function Gb(r,e,t){return r!==e?(t-r)/(e-r):0}function hu(r,e,t){return(1-t)*r+t*e}function Vb(r,e,t,n){return hu(r,e,1-Math.exp(-t*n))}function jb(r,e=1){return e-Math.abs(LA(r,e*2)-e)}function Wb(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*(3-2*r))}function Yb(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*r*(r*(r*6-15)+10))}function qb(r,e){return r+Math.floor(Math.random()*(e-r+1))}function Xb(r,e){return r+Math.random()*(e-r)}function Kb(r){return r*(.5-Math.random())}function Jb(r){r!==void 0&&(QE=r);let e=QE+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function Zb(r){return r*uu}function $b(r){return r*ul}function e5(r){return(r&r-1)===0&&r!==0}function t5(r){return Math.pow(2,Math.ceil(Math.log(r)/Math.LN2))}function r5(r){return Math.pow(2,Math.floor(Math.log(r)/Math.LN2))}function n5(r,e,t,n,i){const s=Math.cos,o=Math.sin,l=s(t/2),h=o(t/2),u=s((e+n)/2),d=o((e+n)/2),A=s((e-n)/2),p=o((e-n)/2),g=s((n-e)/2),_=o((n-e)/2);switch(i){case"XYX":r.set(l*d,h*A,h*p,l*u);break;case"YZY":r.set(h*p,l*d,h*A,l*u);break;case"ZXZ":r.set(h*A,h*p,l*d,l*u);break;case"XZX":r.set(l*d,h*_,h*g,l*u);break;case"YXY":r.set(h*g,l*d,h*_,l*u);break;case"ZYZ":r.set(h*_,h*g,l*d,l*u);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}function Ti(r,e){switch(e.constructor){case Float32Array:return r;case Uint32Array:return r/4294967295;case Uint16Array:return r/65535;case Uint8Array:return r/255;case Int32Array:return Math.max(r/2147483647,-1);case Int16Array:return Math.max(r/32767,-1);case Int8Array:return Math.max(r/127,-1);default:throw new Error("Invalid component type.")}}function Ut(r,e){switch(e.constructor){case Float32Array:return r;case Uint32Array:return Math.round(r*4294967295);case Uint16Array:return Math.round(r*65535);case Uint8Array:return Math.round(r*255);case Int32Array:return Math.round(r*2147483647);case Int16Array:return Math.round(r*32767);case Int8Array:return Math.round(r*127);default:throw new Error("Invalid component type.")}}const NA={DEG2RAD:uu,RAD2DEG:ul,generateUUID:Si,clamp:Br,euclideanModulo:LA,mapLinear:Hb,inverseLerp:Gb,lerp:hu,damp:Vb,pingpong:jb,smoothstep:Wb,smootherstep:Yb,randInt:qb,randFloat:Xb,randFloatSpread:Kb,seededRandom:Jb,degToRad:Zb,radToDeg:$b,isPowerOfTwo:e5,ceilPowerOfTwo:t5,floorPowerOfTwo:r5,setQuaternionFromProperEuler:n5,normalize:Ut,denormalize:Ti};class Ue{constructor(e=0,t=0){Ue.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,n=this.y,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6],this.y=i[1]*t+i[4]*n+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,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(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.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(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(Br(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const n=Math.cos(t),i=Math.sin(t),s=this.x-e.x,o=this.y-e.y;return this.x=s*n-o*i+e.x,this.y=s*i+o*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class gt{constructor(e,t,n,i,s,o,l,h,u){gt.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,n,i,s,o,l,h,u)}set(e,t,n,i,s,o,l,h,u){const d=this.elements;return d[0]=e,d[1]=i,d[2]=l,d[3]=t,d[4]=s,d[5]=h,d[6]=n,d[7]=o,d[8]=u,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,i=t.elements,s=this.elements,o=n[0],l=n[3],h=n[6],u=n[1],d=n[4],A=n[7],p=n[2],g=n[5],_=n[8],E=i[0],m=i[3],v=i[6],w=i[1],x=i[4],I=i[7],R=i[2],S=i[5],T=i[8];return s[0]=o*E+l*w+h*R,s[3]=o*m+l*x+h*S,s[6]=o*v+l*I+h*T,s[1]=u*E+d*w+A*R,s[4]=u*m+d*x+A*S,s[7]=u*v+d*I+A*T,s[2]=p*E+g*w+_*R,s[5]=p*m+g*x+_*S,s[8]=p*v+g*I+_*T,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],o=e[4],l=e[5],h=e[6],u=e[7],d=e[8];return t*o*d-t*l*u-n*s*d+n*l*h+i*s*u-i*o*h}invert(){const e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],o=e[4],l=e[5],h=e[6],u=e[7],d=e[8],A=d*o-l*u,p=l*h-d*s,g=u*s-o*h,_=t*A+n*p+i*g;if(_===0)return this.set(0,0,0,0,0,0,0,0,0);const E=1/_;return e[0]=A*E,e[1]=(i*u-d*n)*E,e[2]=(l*n-i*o)*E,e[3]=p*E,e[4]=(d*t-i*h)*E,e[5]=(i*s-l*t)*E,e[6]=g*E,e[7]=(n*h-u*t)*E,e[8]=(o*t-n*s)*E,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,i,s,o,l){const h=Math.cos(s),u=Math.sin(s);return this.set(n*h,n*u,-n*(h*o+u*l)+o+e,-i*u,i*h,-i*(-u*o+h*l)+l+t,0,0,1),this}scale(e,t){return this.premultiply(UA.makeScale(e,t)),this}rotate(e){return this.premultiply(UA.makeRotation(-e)),this}translate(e,t){return this.premultiply(UA.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,n,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,n=e.elements;for(let i=0;i<9;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const UA=new gt;function OE(r){for(let e=r.length-1;e>=0;--e)if(r[e]>=65535)return!0;return!1}function du(r){return document.createElementNS("http://www.w3.org/1999/xhtml",r)}function i5(){const r=du("canvas");return r.style.display="block",r}const FE={};function zE(r){r in FE||(FE[r]=!0,console.warn(r))}const HE=new gt().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),GE=new gt().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),hd={[cr]:{transfer:od,primaries:ld,toReference:r=>r,fromReference:r=>r},[Fr]:{transfer:Ht,primaries:ld,toReference:r=>r.convertSRGBToLinear(),fromReference:r=>r.convertLinearToSRGB()},[cu]:{transfer:od,primaries:cd,toReference:r=>r.applyMatrix3(GE),fromReference:r=>r.applyMatrix3(HE)},[ad]:{transfer:Ht,primaries:cd,toReference:r=>r.convertSRGBToLinear().applyMatrix3(GE),fromReference:r=>r.applyMatrix3(HE).convertLinearToSRGB()}},s5=new Set([cr,cu]),Tt={enabled:!0,_workingColorSpace:cr,get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(r){if(!s5.has(r))throw new Error(`Unsupported working color space, "${r}".`);this._workingColorSpace=r},convert:function(r,e,t){if(this.enabled===!1||e===t||!e||!t)return r;const n=hd[e].toReference,i=hd[t].fromReference;return i(n(r))},fromWorkingColorSpace:function(r,e){return this.convert(r,this._workingColorSpace,e)},toWorkingColorSpace:function(r,e){return this.convert(r,e,this._workingColorSpace)},getPrimaries:function(r){return hd[r].primaries},getTransfer:function(r){return r===ms?od:hd[r].transfer}};function hl(r){return r<.04045?r*.0773993808:Math.pow(r*.9478672986+.0521327014,2.4)}function PA(r){return r<.0031308?r*12.92:1.055*Math.pow(r,.41666)-.055}let dl;class a5{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{dl===void 0&&(dl=du("canvas")),dl.width=e.width,dl.height=e.height;const n=dl.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=dl}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=du("canvas");t.width=e.width,t.height=e.height;const n=t.getContext("2d");n.drawImage(e,0,0,e.width,e.height);const i=n.getImageData(0,0,e.width,e.height),s=i.data;for(let o=0;o<s.length;o++)s[o]=hl(s[o]/255)*255;return n.putImageData(i,0,0),t}else if(e.data){const t=e.data.slice(0);for(let n=0;n<t.length;n++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[n]=Math.floor(hl(t[n]/255)*255):t[n]=hl(t[n]);return{data:t,width:e.width,height:e.height}}else return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}let o5=0;class VE{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:o5++}),this.uuid=Si(),this.data=e,this.dataReady=!0,this.version=0}set needsUpdate(e){e===!0&&this.version++}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.images[this.uuid]!==void 0)return e.images[this.uuid];const n={uuid:this.uuid,url:""},i=this.data;if(i!==null){let s;if(Array.isArray(i)){s=[];for(let o=0,l=i.length;o<l;o++)i[o].isDataTexture?s.push(kA(i[o].image)):s.push(kA(i[o]))}else s=kA(i);n.url=s}return t||(e.images[this.uuid]=n),n}}function kA(r){return typeof HTMLImageElement<"u"&&r instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&r instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&r instanceof ImageBitmap?a5.getDataURL(r):r.data?{data:Array.from(r.data),width:r.width,height:r.height,type:r.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let l5=0;class br extends ao{constructor(e=br.DEFAULT_IMAGE,t=br.DEFAULT_MAPPING,n=Ii,i=Ii,s=gr,o=Ci,l=vr,h=mr,u=br.DEFAULT_ANISOTROPY,d=ms){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:l5++}),this.uuid=Si(),this.name="",this.source=new VE(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=n,this.wrapT=i,this.magFilter=s,this.minFilter=o,this.anisotropy=u,this.format=l,this.internalFormat=null,this.type=h,this.offset=new Ue(0,0),this.repeat=new Ue(1,1),this.center=new Ue(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new gt,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=d,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){const t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const n={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&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==aE)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case $s:e.x=e.x-Math.floor(e.x);break;case Ii:e.x=e.x<0?0:1;break;case $h: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 $s:e.y=e.y-Math.floor(e.y);break;case Ii:e.y=e.y<0?0:1;break;case $h: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++}}br.DEFAULT_IMAGE=null,br.DEFAULT_MAPPING=aE,br.DEFAULT_ANISOTROPY=1;class Ft{constructor(e=0,t=0,n=0,i=1){Ft.prototype.isVector4=!0,this.x=e,this.y=t,this.z=n,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,i){return this.x=e,this.y=t,this.z=n,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){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: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,n=this.y,i=this.z,s=this.w,o=e.elements;return this.x=o[0]*t+o[4]*n+o[8]*i+o[12]*s,this.y=o[1]*t+o[5]*n+o[9]*i+o[13]*s,this.z=o[2]*t+o[6]*n+o[10]*i+o[14]*s,this.w=o[3]*t+o[7]*n+o[11]*i+o[15]*s,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,i,s;const o=e.elements,l=o[0],h=o[4],u=o[8],d=o[1],A=o[5],p=o[9],g=o[2],_=o[6],E=o[10];if(Math.abs(h-d)<.01&&Math.abs(u-g)<.01&&Math.abs(p-_)<.01){if(Math.abs(h+d)<.1&&Math.abs(u+g)<.1&&Math.abs(p+_)<.1&&Math.abs(l+A+E-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const v=(l+1)/2,w=(A+1)/2,x=(E+1)/2,I=(h+d)/4,R=(u+g)/4,S=(p+_)/4;return v>w&&v>x?v<.01?(n=0,i=.707106781,s=.707106781):(n=Math.sqrt(v),i=I/n,s=R/n):w>x?w<.01?(n=.707106781,i=0,s=.707106781):(i=Math.sqrt(w),n=I/i,s=S/i):x<.01?(n=.707106781,i=.707106781,s=0):(s=Math.sqrt(x),n=R/s,i=S/s),this.set(n,i,s,t),this}let m=Math.sqrt((_-p)*(_-p)+(u-g)*(u-g)+(d-h)*(d-h));return Math.abs(m)<.001&&(m=1),this.x=(_-p)/m,this.y=(u-g)/m,this.z=(d-h)/m,this.w=Math.acos((l+A+E-1)/2),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,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(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.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(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),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}}class c5 extends ao{constructor(e=1,t=1,n={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new Ft(0,0,e,t),this.scissorTest=!1,this.viewport=new Ft(0,0,e,t);const i={width:e,height:t,depth:1};n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:gr,depthBuffer:!0,stencilBuffer:!1,depthTexture:null,samples:0,count:1},n);const s=new br(i,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace);s.flipY=!1,s.generateMipmaps=n.generateMipmaps,s.internalFormat=n.internalFormat,this.textures=[];const o=n.count;for(let l=0;l<o;l++)this.textures[l]=s.clone(),this.textures[l].isRenderTargetTexture=!0;this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.depthTexture=n.depthTexture,this.samples=n.samples}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}setSize(e,t,n=1){if(this.width!==e||this.height!==t||this.depth!==n){this.width=e,this.height=t,this.depth=n;for(let i=0,s=this.textures.length;i<s;i++)this.textures[i].image.width=e,this.textures[i].image.height=t,this.textures[i].image.depth=n;this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let n=0,i=e.textures.length;n<i;n++)this.textures[n]=e.textures[n].clone(),this.textures[n].isRenderTargetTexture=!0;const t=Object.assign({},e.texture.image);return this.texture.source=new VE(t),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class cn extends c5{constructor(e=1,t=1,n={}){super(e,t,n),this.isWebGLRenderTarget=!0}}class jE extends br{constructor(e=null,t=1,n=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:n,depth:i},this.magFilter=Ar,this.minFilter=Ar,this.wrapR=Ii,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class WE extends br{constructor(e=null,t=1,n=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:n,depth:i},this.magFilter=Ar,this.minFilter=Ar,this.wrapR=Ii,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Yi{constructor(e=0,t=0,n=0,i=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=i}static slerpFlat(e,t,n,i,s,o,l){let h=n[i+0],u=n[i+1],d=n[i+2],A=n[i+3];const p=s[o+0],g=s[o+1],_=s[o+2],E=s[o+3];if(l===0){e[t+0]=h,e[t+1]=u,e[t+2]=d,e[t+3]=A;return}if(l===1){e[t+0]=p,e[t+1]=g,e[t+2]=_,e[t+3]=E;return}if(A!==E||h!==p||u!==g||d!==_){let m=1-l;const v=h*p+u*g+d*_+A*E,w=v>=0?1:-1,x=1-v*v;if(x>Number.EPSILON){const R=Math.sqrt(x),S=Math.atan2(R,v*w);m=Math.sin(m*S)/R,l=Math.sin(l*S)/R}const I=l*w;if(h=h*m+p*I,u=u*m+g*I,d=d*m+_*I,A=A*m+E*I,m===1-l){const R=1/Math.sqrt(h*h+u*u+d*d+A*A);h*=R,u*=R,d*=R,A*=R}}e[t]=h,e[t+1]=u,e[t+2]=d,e[t+3]=A}static multiplyQuaternionsFlat(e,t,n,i,s,o){const l=n[i],h=n[i+1],u=n[i+2],d=n[i+3],A=s[o],p=s[o+1],g=s[o+2],_=s[o+3];return e[t]=l*_+d*A+h*g-u*p,e[t+1]=h*_+d*p+u*A-l*g,e[t+2]=u*_+d*g+l*p-h*A,e[t+3]=d*_-l*A-h*p-u*g,e}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 w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,i){return this._x=e,this._y=t,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const n=e._x,i=e._y,s=e._z,o=e._order,l=Math.cos,h=Math.sin,u=l(n/2),d=l(i/2),A=l(s/2),p=h(n/2),g=h(i/2),_=h(s/2);switch(o){case"XYZ":this._x=p*d*A+u*g*_,this._y=u*g*A-p*d*_,this._z=u*d*_+p*g*A,this._w=u*d*A-p*g*_;break;case"YXZ":this._x=p*d*A+u*g*_,this._y=u*g*A-p*d*_,this._z=u*d*_-p*g*A,this._w=u*d*A+p*g*_;break;case"ZXY":this._x=p*d*A-u*g*_,this._y=u*g*A+p*d*_,this._z=u*d*_+p*g*A,this._w=u*d*A-p*g*_;break;case"ZYX":this._x=p*d*A-u*g*_,this._y=u*g*A+p*d*_,this._z=u*d*_-p*g*A,this._w=u*d*A+p*g*_;break;case"YZX":this._x=p*d*A+u*g*_,this._y=u*g*A+p*d*_,this._z=u*d*_-p*g*A,this._w=u*d*A-p*g*_;break;case"XZY":this._x=p*d*A-u*g*_,this._y=u*g*A-p*d*_,this._z=u*d*_+p*g*A,this._w=u*d*A+p*g*_;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const n=t/2,i=Math.sin(n);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,n=t[0],i=t[4],s=t[8],o=t[1],l=t[5],h=t[9],u=t[2],d=t[6],A=t[10],p=n+l+A;if(p>0){const g=.5/Math.sqrt(p+1);this._w=.25/g,this._x=(d-h)*g,this._y=(s-u)*g,this._z=(o-i)*g}else if(n>l&&n>A){const g=2*Math.sqrt(1+n-l-A);this._w=(d-h)/g,this._x=.25*g,this._y=(i+o)/g,this._z=(s+u)/g}else if(l>A){const g=2*Math.sqrt(1+l-n-A);this._w=(s-u)/g,this._x=(i+o)/g,this._y=.25*g,this._z=(h+d)/g}else{const g=2*Math.sqrt(1+A-n-l);this._w=(o-i)/g,this._x=(s+u)/g,this._y=(h+d)/g,this._z=.25*g}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<Number.EPSILON?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Br(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(n===0)return this;const i=Math.min(1,t/n);return this.slerp(e,i),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(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._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 e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const n=e._x,i=e._y,s=e._z,o=e._w,l=t._x,h=t._y,u=t._z,d=t._w;return this._x=n*d+o*l+i*u-s*h,this._y=i*d+o*h+s*l-n*u,this._z=s*d+o*u+n*h-i*l,this._w=o*d-n*l-i*h-s*u,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const n=this._x,i=this._y,s=this._z,o=this._w;let l=o*e._w+n*e._x+i*e._y+s*e._z;if(l<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,l=-l):this.copy(e),l>=1)return this._w=o,this._x=n,this._y=i,this._z=s,this;const h=1-l*l;if(h<=Number.EPSILON){const g=1-t;return this._w=g*o+t*this._w,this._x=g*n+t*this._x,this._y=g*i+t*this._y,this._z=g*s+t*this._z,this.normalize(),this}const u=Math.sqrt(h),d=Math.atan2(u,l),A=Math.sin((1-t)*d)/u,p=Math.sin(t*d)/u;return this._w=o*A+this._w*p,this._x=n*A+this._x*p,this._y=i*A+this._y*p,this._z=s*A+this._z*p,this._onChangeCallback(),this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),n=Math.random(),i=Math.sqrt(1-n),s=Math.sqrt(n);return this.set(i*Math.sin(e),i*Math.cos(e),s*Math.sin(t),s*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class G{constructor(e=0,t=0,n=0){G.prototype.isVector3=!0,this.x=e,this.y=t,this.z=n}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(YE.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(YE.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,n=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[3]*n+s[6]*i,this.y=s[1]*t+s[4]*n+s[7]*i,this.z=s[2]*t+s[5]*n+s[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,n=this.y,i=this.z,s=e.elements,o=1/(s[3]*t+s[7]*n+s[11]*i+s[15]);return this.x=(s[0]*t+s[4]*n+s[8]*i+s[12])*o,this.y=(s[1]*t+s[5]*n+s[9]*i+s[13])*o,this.z=(s[2]*t+s[6]*n+s[10]*i+s[14])*o,this}applyQuaternion(e){const t=this.x,n=this.y,i=this.z,s=e.x,o=e.y,l=e.z,h=e.w,u=2*(o*i-l*n),d=2*(l*t-s*i),A=2*(s*n-o*t);return this.x=t+h*u+o*A-l*d,this.y=n+h*d+l*u-s*A,this.z=i+h*A+s*d-o*u,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,n=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[4]*n+s[8]*i,this.y=s[1]*t+s[5]*n+s[9]*i,this.z=s[2]*t+s[6]*n+s[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,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(e){return this.x*e.x+this.y*e.y+this.z*e.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(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const n=e.x,i=e.y,s=e.z,o=t.x,l=t.y,h=t.z;return this.x=i*h-s*l,this.y=s*o-n*h,this.z=n*l-i*o,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return QA.copy(this).projectOnVector(e),this.sub(QA)}reflect(e){return this.sub(QA.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(Br(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y,i=this.z-e.z;return t*t+n*n+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){const i=Math.sin(t)*e;return this.x=i*Math.sin(n),this.y=Math.cos(t)*e,this.z=i*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=i,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,t=Math.random()*2-1,n=Math.sqrt(1-t*t);return this.x=n*Math.cos(e),this.y=t,this.z=n*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const QA=new G,YE=new Yi;class _r{constructor(e=new G(1/0,1/0,1/0),t=new G(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t+=3)this.expandByPoint(Bi.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,n=e.count;t<n;t++)this.expandByPoint(Bi.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const n=Bi.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.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(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);const n=e.geometry;if(n!==void 0){const s=n.getAttribute("position");if(t===!0&&s!==void 0&&e.isInstancedMesh!==!0)for(let o=0,l=s.count;o<l;o++)e.isMesh===!0?e.getVertexPosition(o,Bi):Bi.fromBufferAttribute(s,o),Bi.applyMatrix4(e.matrixWorld),this.expandByPoint(Bi);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),dd.copy(e.boundingBox)):(n.boundingBox===null&&n.computeBoundingBox(),dd.copy(n.boundingBox)),dd.applyMatrix4(e.matrixWorld),this.union(dd)}const i=e.children;for(let s=0,o=i.length;s<o;s++)this.expandByObject(i[s],t);return this}containsPoint(e){return!(e.x<this.min.x||e.x>this.max.x||e.y<this.min.y||e.y>this.max.y||e.z<this.min.z||e.z>this.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.x<this.min.x||e.min.x>this.max.x||e.max.y<this.min.y||e.min.y>this.max.y||e.max.z<this.min.z||e.min.z>this.max.z)}intersectsSphere(e){return this.clampPoint(e.center,Bi),Bi.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(fu),fd.subVectors(this.max,fu),fl.subVectors(e.a,fu),pl.subVectors(e.b,fu),Al.subVectors(e.c,fu),ta.subVectors(pl,fl),ra.subVectors(Al,pl),oo.subVectors(fl,Al);let t=[0,-ta.z,ta.y,0,-ra.z,ra.y,0,-oo.z,oo.y,ta.z,0,-ta.x,ra.z,0,-ra.x,oo.z,0,-oo.x,-ta.y,ta.x,0,-ra.y,ra.x,0,-oo.y,oo.x,0];return!OA(t,fl,pl,Al,fd)||(t=[1,0,0,0,1,0,0,0,1],!OA(t,fl,pl,Al,fd))?!1:(pd.crossVectors(ta,ra),t=[pd.x,pd.y,pd.z],OA(t,fl,pl,Al,fd))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Bi).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Bi).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(_s[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),_s[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),_s[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),_s[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),_s[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),_s[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),_s[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),_s[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(_s),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const _s=[new G,new G,new G,new G,new G,new G,new G,new G],Bi=new G,dd=new _r,fl=new G,pl=new G,Al=new G,ta=new G,ra=new G,oo=new G,fu=new G,fd=new G,pd=new G,lo=new G;function OA(r,e,t,n,i){for(let s=0,o=r.length-3;s<=o;s+=3){lo.fromArray(r,s);const l=i.x*Math.abs(lo.x)+i.y*Math.abs(lo.y)+i.z*Math.abs(lo.z),h=e.dot(lo),u=t.dot(lo),d=n.dot(lo);if(Math.max(-Math.max(h,u,d),Math.min(h,u,d))>l)return!1}return!0}const u5=new _r,pu=new G,FA=new G;class bi{constructor(e=new G,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const n=this.center;t!==void 0?n.copy(t):u5.setFromPoints(e).getCenter(n);let i=0;for(let s=0,o=e.length;s<o;s++)i=Math.max(i,n.distanceToSquared(e[s]));return this.radius=Math.sqrt(i),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){const n=this.center.distanceToSquared(e);return t.copy(e),n>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;pu.subVectors(e,this.center);const t=pu.lengthSq();if(t>this.radius*this.radius){const n=Math.sqrt(t),i=(n-this.radius)*.5;this.center.addScaledVector(pu,i/n),this.radius+=i}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(FA.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(pu.copy(e.center).add(FA)),this.expandByPoint(pu.copy(e.center).sub(FA))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const ys=new G,zA=new G,Ad=new G,na=new G,HA=new G,gd=new G,GA=new G;class co{constructor(e=new G,t=new G(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,ys)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=ys.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(ys.copy(this.origin).addScaledVector(this.direction,t),ys.distanceToSquared(e))}distanceSqToSegment(e,t,n,i){zA.copy(e).add(t).multiplyScalar(.5),Ad.copy(t).sub(e).normalize(),na.copy(this.origin).sub(zA);const s=e.distanceTo(t)*.5,o=-this.direction.dot(Ad),l=na.dot(this.direction),h=-na.dot(Ad),u=na.lengthSq(),d=Math.abs(1-o*o);let A,p,g,_;if(d>0)if(A=o*h-l,p=o*l-h,_=s*d,A>=0)if(p>=-_)if(p<=_){const E=1/d;A*=E,p*=E,g=A*(A+o*p+2*l)+p*(o*A+p+2*h)+u}else p=s,A=Math.max(0,-(o*p+l)),g=-A*A+p*(p+2*h)+u;else p=-s,A=Math.max(0,-(o*p+l)),g=-A*A+p*(p+2*h)+u;else p<=-_?(A=Math.max(0,-(-o*s+l)),p=A>0?-s:Math.min(Math.max(-s,-h),s),g=-A*A+p*(p+2*h)+u):p<=_?(A=0,p=Math.min(Math.max(-s,-h),s),g=p*(p+2*h)+u):(A=Math.max(0,-(o*s+l)),p=A>0?s:Math.min(Math.max(-s,-h),s),g=-A*A+p*(p+2*h)+u);else p=o>0?-s:s,A=Math.max(0,-(o*p+l)),g=-A*A+p*(p+2*h)+u;return n&&n.copy(this.origin).addScaledVector(this.direction,A),i&&i.copy(zA).addScaledVector(Ad,p),g}intersectSphere(e,t){ys.subVectors(e.center,this.origin);const n=ys.dot(this.direction),i=ys.dot(ys)-n*n,s=e.radius*e.radius;if(i>s)return null;const o=Math.sqrt(s-i),l=n-o,h=n+o;return h<0?null:l<0?this.at(h,t):this.at(l,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){const n=this.distanceToPlane(e);return n===null?null:this.at(n,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,i,s,o,l,h;const u=1/this.direction.x,d=1/this.direction.y,A=1/this.direction.z,p=this.origin;return u>=0?(n=(e.min.x-p.x)*u,i=(e.max.x-p.x)*u):(n=(e.max.x-p.x)*u,i=(e.min.x-p.x)*u),d>=0?(s=(e.min.y-p.y)*d,o=(e.max.y-p.y)*d):(s=(e.max.y-p.y)*d,o=(e.min.y-p.y)*d),n>o||s>i||((s>n||isNaN(n))&&(n=s),(o<i||isNaN(i))&&(i=o),A>=0?(l=(e.min.z-p.z)*A,h=(e.max.z-p.z)*A):(l=(e.max.z-p.z)*A,h=(e.min.z-p.z)*A),n>h||l>i)||((l>n||n!==n)&&(n=l),(h<i||i!==i)&&(i=h),i<0)?null:this.at(n>=0?n:i,t)}intersectsBox(e){return this.intersectBox(e,ys)!==null}intersectTriangle(e,t,n,i,s){HA.subVectors(t,e),gd.subVectors(n,e),GA.crossVectors(HA,gd);let o=this.direction.dot(GA),l;if(o>0){if(i)return null;l=1}else if(o<0)l=-1,o=-o;else return null;na.subVectors(this.origin,e);const h=l*this.direction.dot(gd.crossVectors(na,gd));if(h<0)return null;const u=l*this.direction.dot(HA.cross(na));if(u<0||h+u>o)return null;const d=-l*na.dot(GA);return d<0?null:this.at(d/o,s)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class rt{constructor(e,t,n,i,s,o,l,h,u,d,A,p,g,_,E,m){rt.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,n,i,s,o,l,h,u,d,A,p,g,_,E,m)}set(e,t,n,i,s,o,l,h,u,d,A,p,g,_,E,m){const v=this.elements;return v[0]=e,v[4]=t,v[8]=n,v[12]=i,v[1]=s,v[5]=o,v[9]=l,v[13]=h,v[2]=u,v[6]=d,v[10]=A,v[14]=p,v[3]=g,v[7]=_,v[11]=E,v[15]=m,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 rt().fromArray(this.elements)}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){const t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,n=e.elements,i=1/gl.setFromMatrixColumn(e,0).length(),s=1/gl.setFromMatrixColumn(e,1).length(),o=1/gl.setFromMatrixColumn(e,2).length();return t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t[3]=0,t[4]=n[4]*s,t[5]=n[5]*s,t[6]=n[6]*s,t[7]=0,t[8]=n[8]*o,t[9]=n[9]*o,t[10]=n[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,n=e.x,i=e.y,s=e.z,o=Math.cos(n),l=Math.sin(n),h=Math.cos(i),u=Math.sin(i),d=Math.cos(s),A=Math.sin(s);if(e.order==="XYZ"){const p=o*d,g=o*A,_=l*d,E=l*A;t[0]=h*d,t[4]=-h*A,t[8]=u,t[1]=g+_*u,t[5]=p-E*u,t[9]=-l*h,t[2]=E-p*u,t[6]=_+g*u,t[10]=o*h}else if(e.order==="YXZ"){const p=h*d,g=h*A,_=u*d,E=u*A;t[0]=p+E*l,t[4]=_*l-g,t[8]=o*u,t[1]=o*A,t[5]=o*d,t[9]=-l,t[2]=g*l-_,t[6]=E+p*l,t[10]=o*h}else if(e.order==="ZXY"){const p=h*d,g=h*A,_=u*d,E=u*A;t[0]=p-E*l,t[4]=-o*A,t[8]=_+g*l,t[1]=g+_*l,t[5]=o*d,t[9]=E-p*l,t[2]=-o*u,t[6]=l,t[10]=o*h}else if(e.order==="ZYX"){const p=o*d,g=o*A,_=l*d,E=l*A;t[0]=h*d,t[4]=_*u-g,t[8]=p*u+E,t[1]=h*A,t[5]=E*u+p,t[9]=g*u-_,t[2]=-u,t[6]=l*h,t[10]=o*h}else if(e.order==="YZX"){const p=o*h,g=o*u,_=l*h,E=l*u;t[0]=h*d,t[4]=E-p*A,t[8]=_*A+g,t[1]=A,t[5]=o*d,t[9]=-l*d,t[2]=-u*d,t[6]=g*A+_,t[10]=p-E*A}else if(e.order==="XZY"){const p=o*h,g=o*u,_=l*h,E=l*u;t[0]=h*d,t[4]=-A,t[8]=u*d,t[1]=p*A+E,t[5]=o*d,t[9]=g*A-_,t[2]=_*A-g,t[6]=l*d,t[10]=E*A+p}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(h5,e,d5)}lookAt(e,t,n){const i=this.elements;return Hn.subVectors(e,t),Hn.lengthSq()===0&&(Hn.z=1),Hn.normalize(),ia.crossVectors(n,Hn),ia.lengthSq()===0&&(Math.abs(n.z)===1?Hn.x+=1e-4:Hn.z+=1e-4,Hn.normalize(),ia.crossVectors(n,Hn)),ia.normalize(),md.crossVectors(Hn,ia),i[0]=ia.x,i[4]=md.x,i[8]=Hn.x,i[1]=ia.y,i[5]=md.y,i[9]=Hn.y,i[2]=ia.z,i[6]=md.z,i[10]=Hn.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,i=t.elements,s=this.elements,o=n[0],l=n[4],h=n[8],u=n[12],d=n[1],A=n[5],p=n[9],g=n[13],_=n[2],E=n[6],m=n[10],v=n[14],w=n[3],x=n[7],I=n[11],R=n[15],S=i[0],T=i[4],D=i[8],b=i[12],M=i[1],L=i[5],P=i[9],N=i[13],W=i[2],X=i[6],K=i[10],te=i[14],V=i[3],ee=i[7],Q=i[11],z=i[15];return s[0]=o*S+l*M+h*W+u*V,s[4]=o*T+l*L+h*X+u*ee,s[8]=o*D+l*P+h*K+u*Q,s[12]=o*b+l*N+h*te+u*z,s[1]=d*S+A*M+p*W+g*V,s[5]=d*T+A*L+p*X+g*ee,s[9]=d*D+A*P+p*K+g*Q,s[13]=d*b+A*N+p*te+g*z,s[2]=_*S+E*M+m*W+v*V,s[6]=_*T+E*L+m*X+v*ee,s[10]=_*D+E*P+m*K+v*Q,s[14]=_*b+E*N+m*te+v*z,s[3]=w*S+x*M+I*W+R*V,s[7]=w*T+x*L+I*X+R*ee,s[11]=w*D+x*P+I*K+R*Q,s[15]=w*b+x*N+I*te+R*z,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[4],i=e[8],s=e[12],o=e[1],l=e[5],h=e[9],u=e[13],d=e[2],A=e[6],p=e[10],g=e[14],_=e[3],E=e[7],m=e[11],v=e[15];return _*(+s*h*A-i*u*A-s*l*p+n*u*p+i*l*g-n*h*g)+E*(+t*h*g-t*u*p+s*o*p-i*o*g+i*u*d-s*h*d)+m*(+t*u*A-t*l*g-s*o*A+n*o*g+s*l*d-n*u*d)+v*(-i*l*d-t*h*A+t*l*p+i*o*A-n*o*p+n*h*d)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){const i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=n),this}invert(){const e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],o=e[4],l=e[5],h=e[6],u=e[7],d=e[8],A=e[9],p=e[10],g=e[11],_=e[12],E=e[13],m=e[14],v=e[15],w=A*m*u-E*p*u+E*h*g-l*m*g-A*h*v+l*p*v,x=_*p*u-d*m*u-_*h*g+o*m*g+d*h*v-o*p*v,I=d*E*u-_*A*u+_*l*g-o*E*g-d*l*v+o*A*v,R=_*A*h-d*E*h-_*l*p+o*E*p+d*l*m-o*A*m,S=t*w+n*x+i*I+s*R;if(S===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const T=1/S;return e[0]=w*T,e[1]=(E*p*s-A*m*s-E*i*g+n*m*g+A*i*v-n*p*v)*T,e[2]=(l*m*s-E*h*s+E*i*u-n*m*u-l*i*v+n*h*v)*T,e[3]=(A*h*s-l*p*s-A*i*u+n*p*u+l*i*g-n*h*g)*T,e[4]=x*T,e[5]=(d*m*s-_*p*s+_*i*g-t*m*g-d*i*v+t*p*v)*T,e[6]=(_*h*s-o*m*s-_*i*u+t*m*u+o*i*v-t*h*v)*T,e[7]=(o*p*s-d*h*s+d*i*u-t*p*u-o*i*g+t*h*g)*T,e[8]=I*T,e[9]=(_*A*s-d*E*s-_*n*g+t*E*g+d*n*v-t*A*v)*T,e[10]=(o*E*s-_*l*s+_*n*u-t*E*u-o*n*v+t*l*v)*T,e[11]=(d*l*s-o*A*s-d*n*u+t*A*u+o*n*g-t*l*g)*T,e[12]=R*T,e[13]=(d*E*i-_*A*i+_*n*p-t*E*p-d*n*m+t*A*m)*T,e[14]=(_*l*i-o*E*i-_*n*h+t*E*h+o*n*m-t*l*m)*T,e[15]=(o*A*i-d*l*i+d*n*h-t*A*h-o*n*p+t*l*p)*T,this}scale(e){const t=this.elements,n=e.x,i=e.y,s=e.z;return t[0]*=n,t[4]*=i,t[8]*=s,t[1]*=n,t[5]*=i,t[9]*=s,t[2]*=n,t[6]*=i,t[10]*=s,t[3]*=n,t[7]*=i,t[11]*=s,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,i))}makeTranslation(e,t,n){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const n=Math.cos(t),i=Math.sin(t),s=1-n,o=e.x,l=e.y,h=e.z,u=s*o,d=s*l;return this.set(u*o+n,u*l-i*h,u*h+i*l,0,u*l+i*h,d*l+n,d*h-i*o,0,u*h-i*l,d*h+i*o,s*h*h+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,i,s,o){return this.set(1,n,s,0,e,1,o,0,t,i,1,0,0,0,0,1),this}compose(e,t,n){const i=this.elements,s=t._x,o=t._y,l=t._z,h=t._w,u=s+s,d=o+o,A=l+l,p=s*u,g=s*d,_=s*A,E=o*d,m=o*A,v=l*A,w=h*u,x=h*d,I=h*A,R=n.x,S=n.y,T=n.z;return i[0]=(1-(E+v))*R,i[1]=(g+I)*R,i[2]=(_-x)*R,i[3]=0,i[4]=(g-I)*S,i[5]=(1-(p+v))*S,i[6]=(m+w)*S,i[7]=0,i[8]=(_+x)*T,i[9]=(m-w)*T,i[10]=(1-(p+E))*T,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,t,n){const i=this.elements;let s=gl.set(i[0],i[1],i[2]).length();const o=gl.set(i[4],i[5],i[6]).length(),l=gl.set(i[8],i[9],i[10]).length();this.determinant()<0&&(s=-s),e.x=i[12],e.y=i[13],e.z=i[14],Ri.copy(this);const h=1/s,u=1/o,d=1/l;return Ri.elements[0]*=h,Ri.elements[1]*=h,Ri.elements[2]*=h,Ri.elements[4]*=u,Ri.elements[5]*=u,Ri.elements[6]*=u,Ri.elements[8]*=d,Ri.elements[9]*=d,Ri.elements[10]*=d,t.setFromRotationMatrix(Ri),n.x=s,n.y=o,n.z=l,this}makePerspective(e,t,n,i,s,o,l=vs){const h=this.elements,u=2*s/(t-e),d=2*s/(n-i),A=(t+e)/(t-e),p=(n+i)/(n-i);let g,_;if(l===vs)g=-(o+s)/(o-s),_=-2*o*s/(o-s);else if(l===ud)g=-o/(o-s),_=-o*s/(o-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+l);return h[0]=u,h[4]=0,h[8]=A,h[12]=0,h[1]=0,h[5]=d,h[9]=p,h[13]=0,h[2]=0,h[6]=0,h[10]=g,h[14]=_,h[3]=0,h[7]=0,h[11]=-1,h[15]=0,this}makeOrthographic(e,t,n,i,s,o,l=vs){const h=this.elements,u=1/(t-e),d=1/(n-i),A=1/(o-s),p=(t+e)*u,g=(n+i)*d;let _,E;if(l===vs)_=(o+s)*A,E=-2*A;else if(l===ud)_=s*A,E=-1*A;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+l);return h[0]=2*u,h[4]=0,h[8]=0,h[12]=-p,h[1]=0,h[5]=2*d,h[9]=0,h[13]=-g,h[2]=0,h[6]=0,h[10]=E,h[14]=-_,h[3]=0,h[7]=0,h[11]=0,h[15]=1,this}equals(e){const t=this.elements,n=e.elements;for(let i=0;i<16;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}}const gl=new G,Ri=new rt,h5=new G(0,0,0),d5=new G(1,1,1),ia=new G,md=new G,Hn=new G,qE=new rt,XE=new Yi;class qi{constructor(e=0,t=0,n=0,i=qi.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=n,this._order=i}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,t,n,i=this._order){return this._x=e,this._y=t,this._z=n,this._order=i,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,t=this._order,n=!0){const i=e.elements,s=i[0],o=i[4],l=i[8],h=i[1],u=i[5],d=i[9],A=i[2],p=i[6],g=i[10];switch(t){case"XYZ":this._y=Math.asin(Br(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-d,g),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(p,u),this._z=0);break;case"YXZ":this._x=Math.asin(-Br(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(l,g),this._z=Math.atan2(h,u)):(this._y=Math.atan2(-A,s),this._z=0);break;case"ZXY":this._x=Math.asin(Br(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(-A,g),this._z=Math.atan2(-o,u)):(this._y=0,this._z=Math.atan2(h,s));break;case"ZYX":this._y=Math.asin(-Br(A,-1,1)),Math.abs(A)<.9999999?(this._x=Math.atan2(p,g),this._z=Math.atan2(h,s)):(this._x=0,this._z=Math.atan2(-o,u));break;case"YZX":this._z=Math.asin(Br(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(-d,u),this._y=Math.atan2(-A,s)):(this._x=0,this._y=Math.atan2(l,g));break;case"XZY":this._z=Math.asin(-Br(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(p,u),this._y=Math.atan2(l,s)):(this._x=Math.atan2(-d,g),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return qE.makeRotationFromQuaternion(e),this.setFromRotationMatrix(qE,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return XE.setFromEuler(this),this.setFromQuaternion(XE,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=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+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}}qi.DEFAULT_ORDER="XYZ";class vd{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!==0}isEnabled(e){return(this.mask&(1<<e|0))!==0}}let f5=0;const KE=new G,ml=new Yi,Es=new rt,_d=new G,Au=new G,p5=new G,A5=new Yi,JE=new G(1,0,0),ZE=new G(0,1,0),$E=new G(0,0,1),e2={type:"added"},g5={type:"removed"},vl={type:"childadded",child:null},VA={type:"childremoved",child:null};class Zt extends ao{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:f5++}),this.uuid=Si(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Zt.DEFAULT_UP.clone();const e=new G,t=new qi,n=new Yi,i=new G(1,1,1);function s(){n.setFromEuler(t,!1)}function o(){t.setFromQuaternion(n,void 0,!1)}t._onChange(s),n._onChange(o),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new rt},normalMatrix:{value:new gt}}),this.matrix=new rt,this.matrixWorld=new rt,this.matrixAutoUpdate=Zt.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=Zt.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new vd,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,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return ml.setFromAxisAngle(e,t),this.quaternion.multiply(ml),this}rotateOnWorldAxis(e,t){return ml.setFromAxisAngle(e,t),this.quaternion.premultiply(ml),this}rotateX(e){return this.rotateOnAxis(JE,e)}rotateY(e){return this.rotateOnAxis(ZE,e)}rotateZ(e){return this.rotateOnAxis($E,e)}translateOnAxis(e,t){return KE.copy(e).applyQuaternion(this.quaternion),this.position.add(KE.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(JE,e)}translateY(e){return this.translateOnAxis(ZE,e)}translateZ(e){return this.translateOnAxis($E,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(Es.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?_d.copy(e):_d.set(e,t,n);const i=this.parent;this.updateWorldMatrix(!0,!1),Au.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Es.lookAt(Au,_d,this.up):Es.lookAt(_d,Au,this.up),this.quaternion.setFromRotationMatrix(Es),i&&(Es.extractRotation(i.matrixWorld),ml.setFromRotationMatrix(Es),this.quaternion.premultiply(ml.invert()))}add(e){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);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(e2),vl.child=e,this.dispatchEvent(vl),vl.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.remove(arguments[n]);return this}const t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(g5),VA.child=e,this.dispatchEvent(VA),VA.child=null),this}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),Es.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),Es.multiply(e.parent.matrixWorld)),e.applyMatrix4(Es),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(e2),vl.child=e,this.dispatchEvent(vl),vl.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let n=0,i=this.children.length;n<i;n++){const s=this.children[n].getObjectByProperty(e,t);if(s!==void 0)return s}}getObjectsByProperty(e,t,n=[]){this[e]===t&&n.push(this);const i=this.children;for(let s=0,o=i.length;s<o;s++)i[s].getObjectsByProperty(e,t,n);return n}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Au,e,p5),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Au,A5,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let n=0,i=t.length;n<i;n++)t[n].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const t=this.children;for(let n=0,i=t.length;n<i;n++)t[n].traverseVisible(e)}traverseAncestors(e){const t=this.parent;t!==null&&(e(t),t.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.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,e=!0);const t=this.children;for(let n=0,i=t.length;n<i;n++){const s=t[n];(s.matrixWorldAutoUpdate===!0||e===!0)&&s.updateMatrixWorld(e)}}updateWorldMatrix(e,t){const n=this.parent;if(e===!0&&n!==null&&n.matrixWorldAutoUpdate===!0&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),t===!0){const i=this.children;for(let s=0,o=i.length;s<o;s++){const l=i[s];l.matrixWorldAutoUpdate===!0&&l.updateWorldMatrix(!1,!0)}}}toJSON(e){const t=e===void 0||typeof e=="string",n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"});const i={};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.castShadow===!0&&(i.castShadow=!0),this.receiveShadow===!0&&(i.receiveShadow=!0),this.visible===!1&&(i.visible=!1),this.frustumCulled===!1&&(i.frustumCulled=!1),this.renderOrder!==0&&(i.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.visibility=this._visibility,i.active=this._active,i.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()})),i.maxGeometryCount=this._maxGeometryCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.geometryCount=this._geometryCount,i.matricesTexture=this._matricesTexture.toJSON(e),this.boundingSphere!==null&&(i.boundingSphere={center:i.boundingSphere.center.toArray(),radius:i.boundingSphere.radius}),this.boundingBox!==null&&(i.boundingBox={min:i.boundingBox.min.toArray(),max:i.boundingBox.max.toArray()}));function s(l,h){return l[h.uuid]===void 0&&(l[h.uuid]=h.toJSON(e)),h.uuid}if(this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(i.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=s(e.geometries,this.geometry);const l=this.geometry.parameters;if(l!==void 0&&l.shapes!==void 0){const h=l.shapes;if(Array.isArray(h))for(let u=0,d=h.length;u<d;u++){const A=h[u];s(e.shapes,A)}else s(e.shapes,h)}}if(this.isSkinnedMesh&&(i.bindMode=this.bindMode,i.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(s(e.skeletons,this.skeleton),i.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const l=[];for(let h=0,u=this.material.length;h<u;h++)l.push(s(e.materials,this.material[h]));i.material=l}else i.material=s(e.materials,this.material);if(this.children.length>0){i.children=[];for(let l=0;l<this.children.length;l++)i.children.push(this.children[l].toJSON(e).object)}if(this.animations.length>0){i.animations=[];for(let l=0;l<this.animations.length;l++){const h=this.animations[l];i.animations.push(s(e.animations,h))}}if(t){const l=o(e.geometries),h=o(e.materials),u=o(e.textures),d=o(e.images),A=o(e.shapes),p=o(e.skeletons),g=o(e.animations),_=o(e.nodes);l.length>0&&(n.geometries=l),h.length>0&&(n.materials=h),u.length>0&&(n.textures=u),d.length>0&&(n.images=d),A.length>0&&(n.shapes=A),p.length>0&&(n.skeletons=p),g.length>0&&(n.animations=g),_.length>0&&(n.nodes=_)}return n.object=i,n;function o(l){const h=[];for(const u in l){const d=l[u];delete d.metadata,h.push(d)}return h}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!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)),t===!0)for(let n=0;n<e.children.length;n++){const i=e.children[n];this.add(i.clone())}return this}}Zt.DEFAULT_UP=new G(0,1,0),Zt.DEFAULT_MATRIX_AUTO_UPDATE=!0,Zt.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const Di=new G,xs=new G,jA=new G,ws=new G,_l=new G,yl=new G,t2=new G,WA=new G,YA=new G,qA=new G;class un{constructor(e=new G,t=new G,n=new G){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,i){i.subVectors(n,t),Di.subVectors(e,t),i.cross(Di);const s=i.lengthSq();return s>0?i.multiplyScalar(1/Math.sqrt(s)):i.set(0,0,0)}static getBarycoord(e,t,n,i,s){Di.subVectors(i,t),xs.subVectors(n,t),jA.subVectors(e,t);const o=Di.dot(Di),l=Di.dot(xs),h=Di.dot(jA),u=xs.dot(xs),d=xs.dot(jA),A=o*u-l*l;if(A===0)return s.set(0,0,0),null;const p=1/A,g=(u*h-l*d)*p,_=(o*d-l*h)*p;return s.set(1-g-_,_,g)}static containsPoint(e,t,n,i){return this.getBarycoord(e,t,n,i,ws)===null?!1:ws.x>=0&&ws.y>=0&&ws.x+ws.y<=1}static getInterpolation(e,t,n,i,s,o,l,h){return this.getBarycoord(e,t,n,i,ws)===null?(h.x=0,h.y=0,"z"in h&&(h.z=0),"w"in h&&(h.w=0),null):(h.setScalar(0),h.addScaledVector(s,ws.x),h.addScaledVector(o,ws.y),h.addScaledVector(l,ws.z),h)}static isFrontFacing(e,t,n,i){return Di.subVectors(n,t),xs.subVectors(e,t),Di.cross(xs).dot(i)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,i){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,t,n,i){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,i),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Di.subVectors(this.c,this.b),xs.subVectors(this.a,this.b),Di.cross(xs).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return un.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return un.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,n,i,s){return un.getInterpolation(e,this.a,this.b,this.c,t,n,i,s)}containsPoint(e){return un.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return un.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const n=this.a,i=this.b,s=this.c;let o,l;_l.subVectors(i,n),yl.subVectors(s,n),WA.subVectors(e,n);const h=_l.dot(WA),u=yl.dot(WA);if(h<=0&&u<=0)return t.copy(n);YA.subVectors(e,i);const d=_l.dot(YA),A=yl.dot(YA);if(d>=0&&A<=d)return t.copy(i);const p=h*A-d*u;if(p<=0&&h>=0&&d<=0)return o=h/(h-d),t.copy(n).addScaledVector(_l,o);qA.subVectors(e,s);const g=_l.dot(qA),_=yl.dot(qA);if(_>=0&&g<=_)return t.copy(s);const E=g*u-h*_;if(E<=0&&u>=0&&_<=0)return l=u/(u-_),t.copy(n).addScaledVector(yl,l);const m=d*_-g*A;if(m<=0&&A-d>=0&&g-_>=0)return t2.subVectors(s,i),l=(A-d)/(A-d+(g-_)),t.copy(i).addScaledVector(t2,l);const v=1/(m+E+p);return o=E*v,l=p*v,t.copy(n).addScaledVector(_l,o).addScaledVector(yl,l)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const r2={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},sa={h:0,s:0,l:0},yd={h:0,s:0,l:0};function XA(r,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?r+(e-r)*6*t:t<1/2?e:t<2/3?r+(e-r)*6*(2/3-t):r}class Ve{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,n)}set(e,t,n){if(t===void 0&&n===void 0){const i=e;i&&i.isColor?this.copy(i):typeof i=="number"?this.setHex(i):typeof i=="string"&&this.setStyle(i)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Fr){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Tt.toWorkingColorSpace(this,t),this}setRGB(e,t,n,i=Tt.workingColorSpace){return this.r=e,this.g=t,this.b=n,Tt.toWorkingColorSpace(this,i),this}setHSL(e,t,n,i=Tt.workingColorSpace){if(e=LA(e,1),t=Br(t,0,1),n=Br(n,0,1),t===0)this.r=this.g=this.b=n;else{const s=n<=.5?n*(1+t):n+t-n*t,o=2*n-s;this.r=XA(o,s,e+1/3),this.g=XA(o,s,e),this.b=XA(o,s,e-1/3)}return Tt.toWorkingColorSpace(this,i),this}setStyle(e,t=Fr){function n(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(e)){let s;const o=i[1],l=i[2];switch(o){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(l))return n(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,t);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(l))return n(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,t);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(l))return n(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){const s=i[1],o=s.length;if(o===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,t);if(o===6)return this.setHex(parseInt(s,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=Fr){const n=r2[e.toLowerCase()];return n!==void 0?this.setHex(n,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=hl(e.r),this.g=hl(e.g),this.b=hl(e.b),this}copyLinearToSRGB(e){return this.r=PA(e.r),this.g=PA(e.g),this.b=PA(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Fr){return Tt.fromWorkingColorSpace($r.copy(this),e),Math.round(Br($r.r*255,0,255))*65536+Math.round(Br($r.g*255,0,255))*256+Math.round(Br($r.b*255,0,255))}getHexString(e=Fr){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=Tt.workingColorSpace){Tt.fromWorkingColorSpace($r.copy(this),t);const n=$r.r,i=$r.g,s=$r.b,o=Math.max(n,i,s),l=Math.min(n,i,s);let h,u;const d=(l+o)/2;if(l===o)h=0,u=0;else{const A=o-l;switch(u=d<=.5?A/(o+l):A/(2-o-l),o){case n:h=(i-s)/A+(i<s?6:0);break;case i:h=(s-n)/A+2;break;case s:h=(n-i)/A+4;break}h/=6}return e.h=h,e.s=u,e.l=d,e}getRGB(e,t=Tt.workingColorSpace){return Tt.fromWorkingColorSpace($r.copy(this),t),e.r=$r.r,e.g=$r.g,e.b=$r.b,e}getStyle(e=Fr){Tt.fromWorkingColorSpace($r.copy(this),e);const t=$r.r,n=$r.g,i=$r.b;return e!==Fr?`color(${e} ${t.toFixed(3)} ${n.toFixed(3)} ${i.toFixed(3)})`:`rgb(${Math.round(t*255)},${Math.round(n*255)},${Math.round(i*255)})`}offsetHSL(e,t,n){return this.getHSL(sa),this.setHSL(sa.h+e,sa.s+t,sa.l+n)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,n){return this.r=e.r+(t.r-e.r)*n,this.g=e.g+(t.g-e.g)*n,this.b=e.b+(t.b-e.b)*n,this}lerpHSL(e,t){this.getHSL(sa),e.getHSL(yd);const n=hu(sa.h,yd.h,t),i=hu(sa.s,yd.s,t),s=hu(sa.l,yd.l,t);return this.setHSL(n,i,s),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const t=this.r,n=this.g,i=this.b,s=e.elements;return this.r=s[0]*t+s[3]*n+s[6]*i,this.g=s[1]*t+s[4]*n+s[7]*i,this.b=s[2]*t+s[5]*n+s[8]*i,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const $r=new Ve;Ve.NAMES=r2;let m5=0;class Xi extends ao{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:m5++}),this.uuid=Si(),this.name="",this.type="Material",this.blending=sl,this.side=xi,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=AA,this.blendDst=gA,this.blendEquation=no,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new Ve(0,0,0),this.blendAlpha=0,this.depthFunc=Jh,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=UE,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=cl,this.stencilZFail=cl,this.stencilZPass=cl,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(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const n=e[t];if(n===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const i=this[t];if(i===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[t]=n}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const 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(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),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(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).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(e).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).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(e).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).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!==sl&&(n.blending=this.blending),this.side!==xi&&(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!==AA&&(n.blendSrc=this.blendSrc),this.blendDst!==gA&&(n.blendDst=this.blendDst),this.blendEquation!==no&&(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!==Jh&&(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!==UE&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==cl&&(n.stencilFail=this.stencilFail),this.stencilZFail!==cl&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==cl&&(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 i(s){const o=[];for(const l in s){const h=s[l];delete h.metadata,o.push(h)}return o}if(t){const s=i(e.textures),o=i(e.images);s.length>0&&(n.textures=s),o.length>0&&(n.images=o)}return n}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let n=null;if(t!==null){const i=t.length;n=new Array(i);for(let s=0;s!==i;++s)n[s]=t[s].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}class Ki extends Xi{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Ve(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 qi,this.combine=$y,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const Is=v5();function v5(){const r=new ArrayBuffer(4),e=new Float32Array(r),t=new Uint32Array(r),n=new Uint32Array(512),i=new Uint32Array(512);for(let h=0;h<256;++h){const u=h-127;u<-27?(n[h]=0,n[h|256]=32768,i[h]=24,i[h|256]=24):u<-14?(n[h]=1024>>-u-14,n[h|256]=1024>>-u-14|32768,i[h]=-u-1,i[h|256]=-u-1):u<=15?(n[h]=u+15<<10,n[h|256]=u+15<<10|32768,i[h]=13,i[h|256]=13):u<128?(n[h]=31744,n[h|256]=64512,i[h]=24,i[h|256]=24):(n[h]=31744,n[h|256]=64512,i[h]=13,i[h|256]=13)}const s=new Uint32Array(2048),o=new Uint32Array(64),l=new Uint32Array(64);for(let h=1;h<1024;++h){let u=h<<13,d=0;for(;!(u&8388608);)u<<=1,d-=8388608;u&=-8388609,d+=947912704,s[h]=u|d}for(let h=1024;h<2048;++h)s[h]=939524096+(h-1024<<13);for(let h=1;h<31;++h)o[h]=h<<23;o[31]=1199570944,o[32]=2147483648;for(let h=33;h<63;++h)o[h]=2147483648+(h-32<<23);o[63]=3347054592;for(let h=1;h<64;++h)h!==32&&(l[h]=1024);return{floatView:e,uint32View:t,baseTable:n,shiftTable:i,mantissaTable:s,exponentTable:o,offsetTable:l}}function _5(r){Math.abs(r)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),r=Br(r,-65504,65504),Is.floatView[0]=r;const e=Is.uint32View[0],t=e>>23&511;return Is.baseTable[t]+((e&8388607)>>Is.shiftTable[t])}function y5(r){const e=r>>10;return Is.uint32View[0]=Is.mantissaTable[Is.offsetTable[e]+(r&1023)]+Is.exponentTable[e],Is.floatView[0]}const Ed={toHalfFloat:_5,fromHalfFloat:y5},Ir=new G,xd=new Ue;class zr{constructor(e,t,n=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=n,this.usage=DA,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.gpuType=lr,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return zE("THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let i=0,s=this.itemSize;i<s;i++)this.array[e+i]=t.array[n+i];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,n=this.count;t<n;t++)xd.fromBufferAttribute(this,t),xd.applyMatrix3(e),this.setXY(t,xd.x,xd.y);else if(this.itemSize===3)for(let t=0,n=this.count;t<n;t++)Ir.fromBufferAttribute(this,t),Ir.applyMatrix3(e),this.setXYZ(t,Ir.x,Ir.y,Ir.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)Ir.fromBufferAttribute(this,t),Ir.applyMatrix4(e),this.setXYZ(t,Ir.x,Ir.y,Ir.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)Ir.fromBufferAttribute(this,t),Ir.applyNormalMatrix(e),this.setXYZ(t,Ir.x,Ir.y,Ir.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)Ir.fromBufferAttribute(this,t),Ir.transformDirection(e),this.setXYZ(t,Ir.x,Ir.y,Ir.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let n=this.array[e*this.itemSize+t];return this.normalized&&(n=Ti(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=Ut(n,this.array)),this.array[e*this.itemSize+t]=n,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=Ti(t,this.array)),t}setX(e,t){return this.normalized&&(t=Ut(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=Ti(t,this.array)),t}setY(e,t){return this.normalized&&(t=Ut(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=Ti(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Ut(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=Ti(t,this.array)),t}setW(e,t){return this.normalized&&(t=Ut(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=Ut(t,this.array),n=Ut(n,this.array)),this.array[e+0]=t,this.array[e+1]=n,this}setXYZ(e,t,n,i){return e*=this.itemSize,this.normalized&&(t=Ut(t,this.array),n=Ut(n,this.array),i=Ut(i,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this}setXYZW(e,t,n,i,s){return e*=this.itemSize,this.normalized&&(t=Ut(t,this.array),n=Ut(n,this.array),i=Ut(i,this.array),s=Ut(s,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this.array[e+3]=s,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(e.name=this.name),this.usage!==DA&&(e.usage=this.usage),e}}class n2 extends zr{constructor(e,t,n){super(new Uint16Array(e),t,n)}}class i2 extends zr{constructor(e,t,n){super(new Uint32Array(e),t,n)}}class Li extends zr{constructor(e,t,n){super(new Float32Array(e),t,n)}}let E5=0;const ii=new rt,KA=new Zt,El=new G,Gn=new _r,gu=new _r,Hr=new G;class Vn extends ao{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:E5++}),this.uuid=Si(),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(e){return Array.isArray(e)?this.index=new(OE(e)?i2:n2)(e,1):this.index=e,this}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,n=0){this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);const n=this.attributes.normal;if(n!==void 0){const s=new gt().getNormalMatrix(e);n.applyNormalMatrix(s),n.needsUpdate=!0}const i=this.attributes.tangent;return i!==void 0&&(i.transformDirection(e),i.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return ii.makeRotationFromQuaternion(e),this.applyMatrix4(ii),this}rotateX(e){return ii.makeRotationX(e),this.applyMatrix4(ii),this}rotateY(e){return ii.makeRotationY(e),this.applyMatrix4(ii),this}rotateZ(e){return ii.makeRotationZ(e),this.applyMatrix4(ii),this}translate(e,t,n){return ii.makeTranslation(e,t,n),this.applyMatrix4(ii),this}scale(e,t,n){return ii.makeScale(e,t,n),this.applyMatrix4(ii),this}lookAt(e){return KA.lookAt(e),KA.updateMatrix(),this.applyMatrix4(KA.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(El).negate(),this.translate(El.x,El.y,El.z),this}setFromPoints(e){const t=[];for(let n=0,i=e.length;n<i;n++){const s=e[n];t.push(s.x,s.y,s.z||0)}return this.setAttribute("position",new Li(t,3)),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new _r);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new G(-1/0,-1/0,-1/0),new G(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let n=0,i=t.length;n<i;n++){const s=t[n];Gn.setFromBufferAttribute(s),this.morphTargetsRelative?(Hr.addVectors(this.boundingBox.min,Gn.min),this.boundingBox.expandByPoint(Hr),Hr.addVectors(this.boundingBox.max,Gn.max),this.boundingBox.expandByPoint(Hr)):(this.boundingBox.expandByPoint(Gn.min),this.boundingBox.expandByPoint(Gn.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 bi);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new G,1/0);return}if(e){const n=this.boundingSphere.center;if(Gn.setFromBufferAttribute(e),t)for(let s=0,o=t.length;s<o;s++){const l=t[s];gu.setFromBufferAttribute(l),this.morphTargetsRelative?(Hr.addVectors(Gn.min,gu.min),Gn.expandByPoint(Hr),Hr.addVectors(Gn.max,gu.max),Gn.expandByPoint(Hr)):(Gn.expandByPoint(gu.min),Gn.expandByPoint(gu.max))}Gn.getCenter(n);let i=0;for(let s=0,o=e.count;s<o;s++)Hr.fromBufferAttribute(e,s),i=Math.max(i,n.distanceToSquared(Hr));if(t)for(let s=0,o=t.length;s<o;s++){const l=t[s],h=this.morphTargetsRelative;for(let u=0,d=l.count;u<d;u++)Hr.fromBufferAttribute(l,u),h&&(El.fromBufferAttribute(e,u),Hr.add(El)),i=Math.max(i,n.distanceToSquared(Hr))}this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,t=this.attributes;if(e===null||t.position===void 0||t.normal===void 0||t.uv===void 0){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const n=t.position,i=t.normal,s=t.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new zr(new Float32Array(4*n.count),4));const o=this.getAttribute("tangent"),l=[],h=[];for(let D=0;D<n.count;D++)l[D]=new G,h[D]=new G;const u=new G,d=new G,A=new G,p=new Ue,g=new Ue,_=new Ue,E=new G,m=new G;function v(D,b,M){u.fromBufferAttribute(n,D),d.fromBufferAttribute(n,b),A.fromBufferAttribute(n,M),p.fromBufferAttribute(s,D),g.fromBufferAttribute(s,b),_.fromBufferAttribute(s,M),d.sub(u),A.sub(u),g.sub(p),_.sub(p);const L=1/(g.x*_.y-_.x*g.y);isFinite(L)&&(E.copy(d).multiplyScalar(_.y).addScaledVector(A,-g.y).multiplyScalar(L),m.copy(A).multiplyScalar(g.x).addScaledVector(d,-_.x).multiplyScalar(L),l[D].add(E),l[b].add(E),l[M].add(E),h[D].add(m),h[b].add(m),h[M].add(m))}let w=this.groups;w.length===0&&(w=[{start:0,count:e.count}]);for(let D=0,b=w.length;D<b;++D){const M=w[D],L=M.start,P=M.count;for(let N=L,W=L+P;N<W;N+=3)v(e.getX(N+0),e.getX(N+1),e.getX(N+2))}const x=new G,I=new G,R=new G,S=new G;function T(D){R.fromBufferAttribute(i,D),S.copy(R);const b=l[D];x.copy(b),x.sub(R.multiplyScalar(R.dot(b))).normalize(),I.crossVectors(S,b);const M=I.dot(h[D])<0?-1:1;o.setXYZW(D,x.x,x.y,x.z,M)}for(let D=0,b=w.length;D<b;++D){const M=w[D],L=M.start,P=M.count;for(let N=L,W=L+P;N<W;N+=3)T(e.getX(N+0)),T(e.getX(N+1)),T(e.getX(N+2))}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(t!==void 0){let n=this.getAttribute("normal");if(n===void 0)n=new zr(new Float32Array(t.count*3),3),this.setAttribute("normal",n);else for(let p=0,g=n.count;p<g;p++)n.setXYZ(p,0,0,0);const i=new G,s=new G,o=new G,l=new G,h=new G,u=new G,d=new G,A=new G;if(e)for(let p=0,g=e.count;p<g;p+=3){const _=e.getX(p+0),E=e.getX(p+1),m=e.getX(p+2);i.fromBufferAttribute(t,_),s.fromBufferAttribute(t,E),o.fromBufferAttribute(t,m),d.subVectors(o,s),A.subVectors(i,s),d.cross(A),l.fromBufferAttribute(n,_),h.fromBufferAttribute(n,E),u.fromBufferAttribute(n,m),l.add(d),h.add(d),u.add(d),n.setXYZ(_,l.x,l.y,l.z),n.setXYZ(E,h.x,h.y,h.z),n.setXYZ(m,u.x,u.y,u.z)}else for(let p=0,g=t.count;p<g;p+=3)i.fromBufferAttribute(t,p+0),s.fromBufferAttribute(t,p+1),o.fromBufferAttribute(t,p+2),d.subVectors(o,s),A.subVectors(i,s),d.cross(A),n.setXYZ(p+0,d.x,d.y,d.z),n.setXYZ(p+1,d.x,d.y,d.z),n.setXYZ(p+2,d.x,d.y,d.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let t=0,n=e.count;t<n;t++)Hr.fromBufferAttribute(e,t),Hr.normalize(),e.setXYZ(t,Hr.x,Hr.y,Hr.z)}toNonIndexed(){function e(l,h){const u=l.array,d=l.itemSize,A=l.normalized,p=new u.constructor(h.length*d);let g=0,_=0;for(let E=0,m=h.length;E<m;E++){l.isInterleavedBufferAttribute?g=h[E]*l.data.stride+l.offset:g=h[E]*d;for(let v=0;v<d;v++)p[_++]=u[g++]}return new zr(p,d,A)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new Vn,n=this.index.array,i=this.attributes;for(const l in i){const h=i[l],u=e(h,n);t.setAttribute(l,u)}const s=this.morphAttributes;for(const l in s){const h=[],u=s[l];for(let d=0,A=u.length;d<A;d++){const p=u[d],g=e(p,n);h.push(g)}t.morphAttributes[l]=h}t.morphTargetsRelative=this.morphTargetsRelative;const o=this.groups;for(let l=0,h=o.length;l<h;l++){const u=o[l];t.addGroup(u.start,u.count,u.materialIndex)}return t}toJSON(){const e={metadata:{version:4.6,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,this.name!==""&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),this.parameters!==void 0){const h=this.parameters;for(const u in h)h[u]!==void 0&&(e[u]=h[u]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const n=this.attributes;for(const h in n){const u=n[h];e.data.attributes[h]=u.toJSON(e.data)}const i={};let s=!1;for(const h in this.morphAttributes){const u=this.morphAttributes[h],d=[];for(let A=0,p=u.length;A<p;A++){const g=u[A];d.push(g.toJSON(e.data))}d.length>0&&(i[h]=d,s=!0)}s&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const l=this.boundingSphere;return l!==null&&(e.data.boundingSphere={center:l.center.toArray(),radius:l.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const n=e.index;n!==null&&this.setIndex(n.clone(t));const i=e.attributes;for(const u in i){const d=i[u];this.setAttribute(u,d.clone(t))}const s=e.morphAttributes;for(const u in s){const d=[],A=s[u];for(let p=0,g=A.length;p<g;p++)d.push(A[p].clone(t));this.morphAttributes[u]=d}this.morphTargetsRelative=e.morphTargetsRelative;const o=e.groups;for(let u=0,d=o.length;u<d;u++){const A=o[u];this.addGroup(A.start,A.count,A.materialIndex)}const l=e.boundingBox;l!==null&&(this.boundingBox=l.clone());const h=e.boundingSphere;return h!==null&&(this.boundingSphere=h.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}const s2=new rt,uo=new co,wd=new bi,a2=new G,xl=new G,wl=new G,Il=new G,JA=new G,Id=new G,Cd=new Ue,Md=new Ue,Sd=new Ue,o2=new G,l2=new G,c2=new G,Td=new G,Bd=new G;class Xr extends Zt{constructor(e=new Vn,t=new Ki){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){const e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){const n=e[t[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let i=0,s=n.length;i<s;i++){const o=n[i].name||String(i);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=i}}}}getVertexPosition(e,t){const n=this.geometry,i=n.attributes.position,s=n.morphAttributes.position,o=n.morphTargetsRelative;t.fromBufferAttribute(i,e);const l=this.morphTargetInfluences;if(s&&l){Id.set(0,0,0);for(let h=0,u=s.length;h<u;h++){const d=l[h],A=s[h];d!==0&&(JA.fromBufferAttribute(A,e),o?Id.addScaledVector(JA,d):Id.addScaledVector(JA.sub(t),d))}t.add(Id)}return t}raycast(e,t){const n=this.geometry,i=this.material,s=this.matrixWorld;i!==void 0&&(n.boundingSphere===null&&n.computeBoundingSphere(),wd.copy(n.boundingSphere),wd.applyMatrix4(s),uo.copy(e.ray).recast(e.near),!(wd.containsPoint(uo.origin)===!1&&(uo.intersectSphere(wd,a2)===null||uo.origin.distanceToSquared(a2)>(e.far-e.near)**2))&&(s2.copy(s).invert(),uo.copy(e.ray).applyMatrix4(s2),!(n.boundingBox!==null&&uo.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(e,t,uo)))}_computeIntersections(e,t,n){let i;const s=this.geometry,o=this.material,l=s.index,h=s.attributes.position,u=s.attributes.uv,d=s.attributes.uv1,A=s.attributes.normal,p=s.groups,g=s.drawRange;if(l!==null)if(Array.isArray(o))for(let _=0,E=p.length;_<E;_++){const m=p[_],v=o[m.materialIndex],w=Math.max(m.start,g.start),x=Math.min(l.count,Math.min(m.start+m.count,g.start+g.count));for(let I=w,R=x;I<R;I+=3){const S=l.getX(I),T=l.getX(I+1),D=l.getX(I+2);i=bd(this,v,e,n,u,d,A,S,T,D),i&&(i.faceIndex=Math.floor(I/3),i.face.materialIndex=m.materialIndex,t.push(i))}}else{const _=Math.max(0,g.start),E=Math.min(l.count,g.start+g.count);for(let m=_,v=E;m<v;m+=3){const w=l.getX(m),x=l.getX(m+1),I=l.getX(m+2);i=bd(this,o,e,n,u,d,A,w,x,I),i&&(i.faceIndex=Math.floor(m/3),t.push(i))}}else if(h!==void 0)if(Array.isArray(o))for(let _=0,E=p.length;_<E;_++){const m=p[_],v=o[m.materialIndex],w=Math.max(m.start,g.start),x=Math.min(h.count,Math.min(m.start+m.count,g.start+g.count));for(let I=w,R=x;I<R;I+=3){const S=I,T=I+1,D=I+2;i=bd(this,v,e,n,u,d,A,S,T,D),i&&(i.faceIndex=Math.floor(I/3),i.face.materialIndex=m.materialIndex,t.push(i))}}else{const _=Math.max(0,g.start),E=Math.min(h.count,g.start+g.count);for(let m=_,v=E;m<v;m+=3){const w=m,x=m+1,I=m+2;i=bd(this,o,e,n,u,d,A,w,x,I),i&&(i.faceIndex=Math.floor(m/3),t.push(i))}}}}function x5(r,e,t,n,i,s,o,l){let h;if(e.side===Qr?h=n.intersectTriangle(o,s,i,!0,l):h=n.intersectTriangle(i,s,o,e.side===xi,l),h===null)return null;Bd.copy(l),Bd.applyMatrix4(r.matrixWorld);const u=t.ray.origin.distanceTo(Bd);return u<t.near||u>t.far?null:{distance:u,point:Bd.clone(),object:r}}function bd(r,e,t,n,i,s,o,l,h,u){r.getVertexPosition(l,xl),r.getVertexPosition(h,wl),r.getVertexPosition(u,Il);const d=x5(r,e,t,n,xl,wl,Il,Td);if(d){i&&(Cd.fromBufferAttribute(i,l),Md.fromBufferAttribute(i,h),Sd.fromBufferAttribute(i,u),d.uv=un.getInterpolation(Td,xl,wl,Il,Cd,Md,Sd,new Ue)),s&&(Cd.fromBufferAttribute(s,l),Md.fromBufferAttribute(s,h),Sd.fromBufferAttribute(s,u),d.uv1=un.getInterpolation(Td,xl,wl,Il,Cd,Md,Sd,new Ue)),o&&(o2.fromBufferAttribute(o,l),l2.fromBufferAttribute(o,h),c2.fromBufferAttribute(o,u),d.normal=un.getInterpolation(Td,xl,wl,Il,o2,l2,c2,new G),d.normal.dot(n.direction)>0&&d.normal.multiplyScalar(-1));const A={a:l,b:h,c:u,normal:new G,materialIndex:0};un.getNormal(xl,wl,Il,A.normal),d.face=A}return d}class mu extends Vn{constructor(e=1,t=1,n=1,i=1,s=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:i,heightSegments:s,depthSegments:o};const l=this;i=Math.floor(i),s=Math.floor(s),o=Math.floor(o);const h=[],u=[],d=[],A=[];let p=0,g=0;_("z","y","x",-1,-1,n,t,e,o,s,0),_("z","y","x",1,-1,n,t,-e,o,s,1),_("x","z","y",1,1,e,n,t,i,o,2),_("x","z","y",1,-1,e,n,-t,i,o,3),_("x","y","z",1,-1,e,t,n,i,s,4),_("x","y","z",-1,-1,e,t,-n,i,s,5),this.setIndex(h),this.setAttribute("position",new Li(u,3)),this.setAttribute("normal",new Li(d,3)),this.setAttribute("uv",new Li(A,2));function _(E,m,v,w,x,I,R,S,T,D,b){const M=I/T,L=R/D,P=I/2,N=R/2,W=S/2,X=T+1,K=D+1;let te=0,V=0;const ee=new G;for(let Q=0;Q<K;Q++){const z=Q*L-N;for(let Z=0;Z<X;Z++){const re=Z*M-P;ee[E]=re*w,ee[m]=z*x,ee[v]=W,u.push(ee.x,ee.y,ee.z),ee[E]=0,ee[m]=0,ee[v]=S>0?1:-1,d.push(ee.x,ee.y,ee.z),A.push(Z/T),A.push(1-Q/D),te+=1}}for(let Q=0;Q<D;Q++)for(let z=0;z<T;z++){const Z=p+z+X*Q,re=p+z+X*(Q+1),j=p+(z+1)+X*(Q+1),de=p+(z+1)+X*Q;h.push(Z,re,de),h.push(re,j,de),V+=6}l.addGroup(g,V,b),g+=V,p+=te}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new mu(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function Cl(r){const e={};for(const t in r){e[t]={};for(const n in r[t]){const i=r[t][n];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture||i.isQuaternion)?i.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[t][n]=null):e[t][n]=i.clone():Array.isArray(i)?e[t][n]=i.slice():e[t][n]=i}}return e}function hn(r){const e={};for(let t=0;t<r.length;t++){const n=Cl(r[t]);for(const i in n)e[i]=n[i]}return e}function w5(r){const e=[];for(let t=0;t<r.length;t++)e.push(r[t].clone());return e}function u2(r){const e=r.getRenderTarget();return e===null?r.outputColorSpace:e.isXRRenderTarget===!0?e.texture.colorSpace:Tt.workingColorSpace}const Ml={clone:Cl,merge:hn};var I5=`void main() {
37
37
  gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
38
38
  }`,C5=`void main() {
39
39
  gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
@@ -72,7 +72,7 @@ var KQ=Object.defineProperty;var JQ=(Wa,us,hs)=>us in Wa?KQ(Wa,us,{enumerable:!0
72
72
  gl_FragColor = texture2D( tEquirect, sampleUV );
73
73
 
74
74
  }
75
- `},i=new mu(5,5,5),s=new Cr({name:"CubemapFromEquirect",uniforms:Cl(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:Qr,blending:gs});s.uniforms.tEquirect.value=t;const o=new Xr(i,s),l=t.minFilter;return t.minFilter===Ci&&(t.minFilter=gr),new M5(1,10,this).update(e,o),t.minFilter=l,o.geometry.dispose(),o.material.dispose(),this}clear(e,t,n,i){const s=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,n,i);e.setRenderTarget(s)}}const $A=new G,T5=new G,B5=new gt;class Ji{constructor(e=new G(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,n,i){return this.normal.set(e,t,n),this.constant=i,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){const i=$A.subVectors(n,t).cross(T5.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){const n=e.delta($A),i=this.normal.dot(n);if(i===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const s=-(e.start.dot(this.normal)+this.constant)/i;return s<0||s>1?null:t.copy(e.start).addScaledVector(n,s)}intersectsLine(e){const t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const n=t||B5.getNormalMatrix(e),i=this.coplanarPoint($A).applyMatrix4(e),s=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(s),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const ho=new bi,Rd=new G;class eg{constructor(e=new Ji,t=new Ji,n=new Ji,i=new Ji,s=new Ji,o=new Ji){this.planes=[e,t,n,i,s,o]}set(e,t,n,i,s,o){const l=this.planes;return l[0].copy(e),l[1].copy(t),l[2].copy(n),l[3].copy(i),l[4].copy(s),l[5].copy(o),this}copy(e){const t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e,t=vs){const n=this.planes,i=e.elements,s=i[0],o=i[1],l=i[2],h=i[3],u=i[4],d=i[5],A=i[6],p=i[7],g=i[8],_=i[9],E=i[10],m=i[11],v=i[12],w=i[13],x=i[14],I=i[15];if(n[0].setComponents(h-s,p-u,m-g,I-v).normalize(),n[1].setComponents(h+s,p+u,m+g,I+v).normalize(),n[2].setComponents(h+o,p+d,m+_,I+w).normalize(),n[3].setComponents(h-o,p-d,m-_,I-w).normalize(),n[4].setComponents(h-l,p-A,m-E,I-x).normalize(),t===vs)n[5].setComponents(h+l,p+A,m+E,I+x).normalize();else if(t===ud)n[5].setComponents(l,A,E,x).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),ho.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),ho.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(ho)}intersectsSprite(e){return ho.center.set(0,0,0),ho.radius=.7071067811865476,ho.applyMatrix4(e.matrixWorld),this.intersectsSphere(ho)}intersectsSphere(e){const t=this.planes,n=e.center,i=-e.radius;for(let s=0;s<6;s++)if(t[s].distanceToPoint(n)<i)return!1;return!0}intersectsBox(e){const t=this.planes;for(let n=0;n<6;n++){const i=t[n];if(Rd.x=i.normal.x>0?e.max.x:e.min.x,Rd.y=i.normal.y>0?e.max.y:e.min.y,Rd.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(Rd)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function A2(){let r=null,e=!1,t=null,n=null;function i(s,o){t(s,o),n=r.requestAnimationFrame(i)}return{start:function(){e!==!0&&t!==null&&(n=r.requestAnimationFrame(i),e=!0)},stop:function(){r.cancelAnimationFrame(n),e=!1},setAnimationLoop:function(s){t=s},setContext:function(s){r=s}}}function b5(r){const e=new WeakMap;function t(l,h){const u=l.array,d=l.usage,A=u.byteLength,p=r.createBuffer();r.bindBuffer(h,p),r.bufferData(h,u,d),l.onUploadCallback();let g;if(u instanceof Float32Array)g=r.FLOAT;else if(u instanceof Uint16Array)l.isFloat16BufferAttribute?g=r.HALF_FLOAT:g=r.UNSIGNED_SHORT;else if(u instanceof Int16Array)g=r.SHORT;else if(u instanceof Uint32Array)g=r.UNSIGNED_INT;else if(u instanceof Int32Array)g=r.INT;else if(u instanceof Int8Array)g=r.BYTE;else if(u instanceof Uint8Array)g=r.UNSIGNED_BYTE;else if(u instanceof Uint8ClampedArray)g=r.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+u);return{buffer:p,type:g,bytesPerElement:u.BYTES_PER_ELEMENT,version:l.version,size:A}}function n(l,h,u){const d=h.array,A=h._updateRange,p=h.updateRanges;if(r.bindBuffer(u,l),A.count===-1&&p.length===0&&r.bufferSubData(u,0,d),p.length!==0){for(let g=0,_=p.length;g<_;g++){const E=p[g];r.bufferSubData(u,E.start*d.BYTES_PER_ELEMENT,d,E.start,E.count)}h.clearUpdateRanges()}A.count!==-1&&(r.bufferSubData(u,A.offset*d.BYTES_PER_ELEMENT,d,A.offset,A.count),A.count=-1),h.onUploadCallback()}function i(l){return l.isInterleavedBufferAttribute&&(l=l.data),e.get(l)}function s(l){l.isInterleavedBufferAttribute&&(l=l.data);const h=e.get(l);h&&(r.deleteBuffer(h.buffer),e.delete(l))}function o(l,h){if(l.isGLBufferAttribute){const d=e.get(l);(!d||d.version<l.version)&&e.set(l,{buffer:l.buffer,type:l.type,bytesPerElement:l.elementSize,version:l.version});return}l.isInterleavedBufferAttribute&&(l=l.data);const u=e.get(l);if(u===void 0)e.set(l,t(l,h));else if(u.version<l.version){if(u.size!==l.array.byteLength)throw new Error("THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.");n(u.buffer,l,h),u.version=l.version}}return{get:i,remove:s,update:o}}class vu extends Vn{constructor(e=1,t=1,n=1,i=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:i};const s=e/2,o=t/2,l=Math.floor(n),h=Math.floor(i),u=l+1,d=h+1,A=e/l,p=t/h,g=[],_=[],E=[],m=[];for(let v=0;v<d;v++){const w=v*p-o;for(let x=0;x<u;x++){const I=x*A-s;_.push(I,-w,0),E.push(0,0,1),m.push(x/l),m.push(1-v/h)}}for(let v=0;v<h;v++)for(let w=0;w<l;w++){const x=w+u*v,I=w+u*(v+1),R=w+1+u*(v+1),S=w+1+u*v;g.push(x,I,S),g.push(I,R,S)}this.setIndex(g),this.setAttribute("position",new Li(_,3)),this.setAttribute("normal",new Li(E,3)),this.setAttribute("uv",new Li(m,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new vu(e.width,e.height,e.widthSegments,e.heightSegments)}}var R5=`#ifdef USE_ALPHAHASH
75
+ `},i=new mu(5,5,5),s=new Cr({name:"CubemapFromEquirect",uniforms:Cl(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:Qr,blending:gs});s.uniforms.tEquirect.value=t;const o=new Xr(i,s),l=t.minFilter;return t.minFilter===Ci&&(t.minFilter=gr),new M5(1,10,this).update(e,o),t.minFilter=l,o.geometry.dispose(),o.material.dispose(),this}clear(e,t,n,i){const s=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,n,i);e.setRenderTarget(s)}}const ZA=new G,T5=new G,B5=new gt;class Ji{constructor(e=new G(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,n,i){return this.normal.set(e,t,n),this.constant=i,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){const i=ZA.subVectors(n,t).cross(T5.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){const n=e.delta(ZA),i=this.normal.dot(n);if(i===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const s=-(e.start.dot(this.normal)+this.constant)/i;return s<0||s>1?null:t.copy(e.start).addScaledVector(n,s)}intersectsLine(e){const t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const n=t||B5.getNormalMatrix(e),i=this.coplanarPoint(ZA).applyMatrix4(e),s=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(s),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const ho=new bi,Rd=new G;class $A{constructor(e=new Ji,t=new Ji,n=new Ji,i=new Ji,s=new Ji,o=new Ji){this.planes=[e,t,n,i,s,o]}set(e,t,n,i,s,o){const l=this.planes;return l[0].copy(e),l[1].copy(t),l[2].copy(n),l[3].copy(i),l[4].copy(s),l[5].copy(o),this}copy(e){const t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e,t=vs){const n=this.planes,i=e.elements,s=i[0],o=i[1],l=i[2],h=i[3],u=i[4],d=i[5],A=i[6],p=i[7],g=i[8],_=i[9],E=i[10],m=i[11],v=i[12],w=i[13],x=i[14],I=i[15];if(n[0].setComponents(h-s,p-u,m-g,I-v).normalize(),n[1].setComponents(h+s,p+u,m+g,I+v).normalize(),n[2].setComponents(h+o,p+d,m+_,I+w).normalize(),n[3].setComponents(h-o,p-d,m-_,I-w).normalize(),n[4].setComponents(h-l,p-A,m-E,I-x).normalize(),t===vs)n[5].setComponents(h+l,p+A,m+E,I+x).normalize();else if(t===ud)n[5].setComponents(l,A,E,x).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),ho.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),ho.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(ho)}intersectsSprite(e){return ho.center.set(0,0,0),ho.radius=.7071067811865476,ho.applyMatrix4(e.matrixWorld),this.intersectsSphere(ho)}intersectsSphere(e){const t=this.planes,n=e.center,i=-e.radius;for(let s=0;s<6;s++)if(t[s].distanceToPoint(n)<i)return!1;return!0}intersectsBox(e){const t=this.planes;for(let n=0;n<6;n++){const i=t[n];if(Rd.x=i.normal.x>0?e.max.x:e.min.x,Rd.y=i.normal.y>0?e.max.y:e.min.y,Rd.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(Rd)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function A2(){let r=null,e=!1,t=null,n=null;function i(s,o){t(s,o),n=r.requestAnimationFrame(i)}return{start:function(){e!==!0&&t!==null&&(n=r.requestAnimationFrame(i),e=!0)},stop:function(){r.cancelAnimationFrame(n),e=!1},setAnimationLoop:function(s){t=s},setContext:function(s){r=s}}}function b5(r){const e=new WeakMap;function t(l,h){const u=l.array,d=l.usage,A=u.byteLength,p=r.createBuffer();r.bindBuffer(h,p),r.bufferData(h,u,d),l.onUploadCallback();let g;if(u instanceof Float32Array)g=r.FLOAT;else if(u instanceof Uint16Array)l.isFloat16BufferAttribute?g=r.HALF_FLOAT:g=r.UNSIGNED_SHORT;else if(u instanceof Int16Array)g=r.SHORT;else if(u instanceof Uint32Array)g=r.UNSIGNED_INT;else if(u instanceof Int32Array)g=r.INT;else if(u instanceof Int8Array)g=r.BYTE;else if(u instanceof Uint8Array)g=r.UNSIGNED_BYTE;else if(u instanceof Uint8ClampedArray)g=r.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+u);return{buffer:p,type:g,bytesPerElement:u.BYTES_PER_ELEMENT,version:l.version,size:A}}function n(l,h,u){const d=h.array,A=h._updateRange,p=h.updateRanges;if(r.bindBuffer(u,l),A.count===-1&&p.length===0&&r.bufferSubData(u,0,d),p.length!==0){for(let g=0,_=p.length;g<_;g++){const E=p[g];r.bufferSubData(u,E.start*d.BYTES_PER_ELEMENT,d,E.start,E.count)}h.clearUpdateRanges()}A.count!==-1&&(r.bufferSubData(u,A.offset*d.BYTES_PER_ELEMENT,d,A.offset,A.count),A.count=-1),h.onUploadCallback()}function i(l){return l.isInterleavedBufferAttribute&&(l=l.data),e.get(l)}function s(l){l.isInterleavedBufferAttribute&&(l=l.data);const h=e.get(l);h&&(r.deleteBuffer(h.buffer),e.delete(l))}function o(l,h){if(l.isGLBufferAttribute){const d=e.get(l);(!d||d.version<l.version)&&e.set(l,{buffer:l.buffer,type:l.type,bytesPerElement:l.elementSize,version:l.version});return}l.isInterleavedBufferAttribute&&(l=l.data);const u=e.get(l);if(u===void 0)e.set(l,t(l,h));else if(u.version<l.version){if(u.size!==l.array.byteLength)throw new Error("THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.");n(u.buffer,l,h),u.version=l.version}}return{get:i,remove:s,update:o}}class vu extends Vn{constructor(e=1,t=1,n=1,i=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:i};const s=e/2,o=t/2,l=Math.floor(n),h=Math.floor(i),u=l+1,d=h+1,A=e/l,p=t/h,g=[],_=[],E=[],m=[];for(let v=0;v<d;v++){const w=v*p-o;for(let x=0;x<u;x++){const I=x*A-s;_.push(I,-w,0),E.push(0,0,1),m.push(x/l),m.push(1-v/h)}}for(let v=0;v<h;v++)for(let w=0;w<l;w++){const x=w+u*v,I=w+u*(v+1),R=w+1+u*(v+1),S=w+1+u*v;g.push(x,I,S),g.push(I,R,S)}this.setIndex(g),this.setAttribute("position",new Li(_,3)),this.setAttribute("normal",new Li(E,3)),this.setAttribute("uv",new Li(m,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new vu(e.width,e.height,e.widthSegments,e.heightSegments)}}var R5=`#ifdef USE_ALPHAHASH
76
76
  if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;
77
77
  #endif`,D5=`#ifdef USE_ALPHAHASH
78
78
  const float ALPHA_HASH_SCALE = 0.05;
@@ -3574,7 +3574,7 @@ void main() {
3574
3574
  #include <tonemapping_fragment>
3575
3575
  #include <colorspace_fragment>
3576
3576
  #include <fog_fragment>
3577
- }`,mt={alphahash_fragment:R5,alphahash_pars_fragment:D5,alphamap_fragment:L5,alphamap_pars_fragment:N5,alphatest_fragment:U5,alphatest_pars_fragment:P5,aomap_fragment:k5,aomap_pars_fragment:Q5,batching_pars_vertex:O5,batching_vertex:F5,begin_vertex:z5,beginnormal_vertex:H5,bsdfs:G5,iridescence_fragment:V5,bumpmap_pars_fragment:j5,clipping_planes_fragment:W5,clipping_planes_pars_fragment:Y5,clipping_planes_pars_vertex:q5,clipping_planes_vertex:X5,color_fragment:K5,color_pars_fragment:J5,color_pars_vertex:Z5,color_vertex:$5,common:eR,cube_uv_reflection_fragment:tR,defaultnormal_vertex:rR,displacementmap_pars_vertex:nR,displacementmap_vertex:iR,emissivemap_fragment:sR,emissivemap_pars_fragment:aR,colorspace_fragment:oR,colorspace_pars_fragment:lR,envmap_fragment:cR,envmap_common_pars_fragment:uR,envmap_pars_fragment:hR,envmap_pars_vertex:dR,envmap_physical_pars_fragment:IR,envmap_vertex:fR,fog_vertex:pR,fog_pars_vertex:AR,fog_fragment:gR,fog_pars_fragment:mR,gradientmap_pars_fragment:vR,lightmap_fragment:_R,lightmap_pars_fragment:yR,lights_lambert_fragment:ER,lights_lambert_pars_fragment:xR,lights_pars_begin:wR,lights_toon_fragment:CR,lights_toon_pars_fragment:MR,lights_phong_fragment:SR,lights_phong_pars_fragment:TR,lights_physical_fragment:BR,lights_physical_pars_fragment:bR,lights_fragment_begin:RR,lights_fragment_maps:DR,lights_fragment_end:LR,logdepthbuf_fragment:NR,logdepthbuf_pars_fragment:UR,logdepthbuf_pars_vertex:PR,logdepthbuf_vertex:kR,map_fragment:QR,map_pars_fragment:OR,map_particle_fragment:FR,map_particle_pars_fragment:zR,metalnessmap_fragment:HR,metalnessmap_pars_fragment:GR,morphinstance_vertex:VR,morphcolor_vertex:jR,morphnormal_vertex:WR,morphtarget_pars_vertex:YR,morphtarget_vertex:qR,normal_fragment_begin:XR,normal_fragment_maps:KR,normal_pars_fragment:JR,normal_pars_vertex:ZR,normal_vertex:$R,normalmap_pars_fragment:e6,clearcoat_normal_fragment_begin:t6,clearcoat_normal_fragment_maps:r6,clearcoat_pars_fragment:n6,iridescence_pars_fragment:i6,opaque_fragment:s6,packing:a6,premultiplied_alpha_fragment:o6,project_vertex:l6,dithering_fragment:c6,dithering_pars_fragment:u6,roughnessmap_fragment:h6,roughnessmap_pars_fragment:d6,shadowmap_pars_fragment:f6,shadowmap_pars_vertex:p6,shadowmap_vertex:A6,shadowmask_pars_fragment:g6,skinbase_vertex:m6,skinning_pars_vertex:v6,skinning_vertex:_6,skinnormal_vertex:y6,specularmap_fragment:E6,specularmap_pars_fragment:x6,tonemapping_fragment:w6,tonemapping_pars_fragment:I6,transmission_fragment:C6,transmission_pars_fragment:M6,uv_pars_fragment:S6,uv_pars_vertex:T6,uv_vertex:B6,worldpos_vertex:b6,background_vert:R6,background_frag:D6,backgroundCube_vert:L6,backgroundCube_frag:N6,cube_vert:U6,cube_frag:P6,depth_vert:k6,depth_frag:Q6,distanceRGBA_vert:O6,distanceRGBA_frag:F6,equirect_vert:z6,equirect_frag:H6,linedashed_vert:G6,linedashed_frag:V6,meshbasic_vert:j6,meshbasic_frag:W6,meshlambert_vert:Y6,meshlambert_frag:q6,meshmatcap_vert:X6,meshmatcap_frag:K6,meshnormal_vert:J6,meshnormal_frag:Z6,meshphong_vert:$6,meshphong_frag:eD,meshphysical_vert:tD,meshphysical_frag:rD,meshtoon_vert:nD,meshtoon_frag:iD,points_vert:sD,points_frag:aD,shadow_vert:oD,shadow_frag:lD,sprite_vert:cD,sprite_frag:uD},Ne={common:{diffuse:{value:new Ve(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new gt},alphaMap:{value:null},alphaMapTransform:{value:new gt},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new gt}},envmap:{envMap:{value:null},envMapRotation:{value:new gt},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new gt}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new gt}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new gt},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new gt},normalScale:{value:new Ue(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new gt},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new gt}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new gt}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new gt}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Ve(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Ve(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new gt},alphaTest:{value:0},uvTransform:{value:new gt}},sprite:{diffuse:{value:new Ve(16777215)},opacity:{value:1},center:{value:new Ue(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new gt},alphaMap:{value:null},alphaMapTransform:{value:new gt},alphaTest:{value:0}}},Zi={basic:{uniforms:hn([Ne.common,Ne.specularmap,Ne.envmap,Ne.aomap,Ne.lightmap,Ne.fog]),vertexShader:mt.meshbasic_vert,fragmentShader:mt.meshbasic_frag},lambert:{uniforms:hn([Ne.common,Ne.specularmap,Ne.envmap,Ne.aomap,Ne.lightmap,Ne.emissivemap,Ne.bumpmap,Ne.normalmap,Ne.displacementmap,Ne.fog,Ne.lights,{emissive:{value:new Ve(0)}}]),vertexShader:mt.meshlambert_vert,fragmentShader:mt.meshlambert_frag},phong:{uniforms:hn([Ne.common,Ne.specularmap,Ne.envmap,Ne.aomap,Ne.lightmap,Ne.emissivemap,Ne.bumpmap,Ne.normalmap,Ne.displacementmap,Ne.fog,Ne.lights,{emissive:{value:new Ve(0)},specular:{value:new Ve(1118481)},shininess:{value:30}}]),vertexShader:mt.meshphong_vert,fragmentShader:mt.meshphong_frag},standard:{uniforms:hn([Ne.common,Ne.envmap,Ne.aomap,Ne.lightmap,Ne.emissivemap,Ne.bumpmap,Ne.normalmap,Ne.displacementmap,Ne.roughnessmap,Ne.metalnessmap,Ne.fog,Ne.lights,{emissive:{value:new Ve(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:mt.meshphysical_vert,fragmentShader:mt.meshphysical_frag},toon:{uniforms:hn([Ne.common,Ne.aomap,Ne.lightmap,Ne.emissivemap,Ne.bumpmap,Ne.normalmap,Ne.displacementmap,Ne.gradientmap,Ne.fog,Ne.lights,{emissive:{value:new Ve(0)}}]),vertexShader:mt.meshtoon_vert,fragmentShader:mt.meshtoon_frag},matcap:{uniforms:hn([Ne.common,Ne.bumpmap,Ne.normalmap,Ne.displacementmap,Ne.fog,{matcap:{value:null}}]),vertexShader:mt.meshmatcap_vert,fragmentShader:mt.meshmatcap_frag},points:{uniforms:hn([Ne.points,Ne.fog]),vertexShader:mt.points_vert,fragmentShader:mt.points_frag},dashed:{uniforms:hn([Ne.common,Ne.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:mt.linedashed_vert,fragmentShader:mt.linedashed_frag},depth:{uniforms:hn([Ne.common,Ne.displacementmap]),vertexShader:mt.depth_vert,fragmentShader:mt.depth_frag},normal:{uniforms:hn([Ne.common,Ne.bumpmap,Ne.normalmap,Ne.displacementmap,{opacity:{value:1}}]),vertexShader:mt.meshnormal_vert,fragmentShader:mt.meshnormal_frag},sprite:{uniforms:hn([Ne.sprite,Ne.fog]),vertexShader:mt.sprite_vert,fragmentShader:mt.sprite_frag},background:{uniforms:{uvTransform:{value:new gt},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:mt.background_vert,fragmentShader:mt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new gt}},vertexShader:mt.backgroundCube_vert,fragmentShader:mt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:mt.cube_vert,fragmentShader:mt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:mt.equirect_vert,fragmentShader:mt.equirect_frag},distanceRGBA:{uniforms:hn([Ne.common,Ne.displacementmap,{referencePosition:{value:new G},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:mt.distanceRGBA_vert,fragmentShader:mt.distanceRGBA_frag},shadow:{uniforms:hn([Ne.lights,Ne.fog,{color:{value:new Ve(0)},opacity:{value:1}}]),vertexShader:mt.shadow_vert,fragmentShader:mt.shadow_frag}};Zi.physical={uniforms:hn([Zi.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new gt},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new gt},clearcoatNormalScale:{value:new Ue(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new gt},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new gt},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new gt},sheen:{value:0},sheenColor:{value:new Ve(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new gt},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new gt},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new gt},transmissionSamplerSize:{value:new Ue},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new gt},attenuationDistance:{value:0},attenuationColor:{value:new Ve(0)},specularColor:{value:new Ve(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new gt},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new gt},anisotropyVector:{value:new Ue},anisotropyMap:{value:null},anisotropyMapTransform:{value:new gt}}]),vertexShader:mt.meshphysical_vert,fragmentShader:mt.meshphysical_frag};const Dd={r:0,b:0,g:0},fo=new qi,hD=new rt;function dD(r,e,t,n,i,s,o){const l=new Ve(0);let h=s===!0?0:1,u,d,A=null,p=0,g=null;function _(m,v){let w=!1,x=v.isScene===!0?v.background:null;x&&x.isTexture&&(x=(v.backgroundBlurriness>0?t:e).get(x)),x===null?E(l,h):x&&x.isColor&&(E(x,1),w=!0);const I=r.xr.getEnvironmentBlendMode();I==="additive"?n.buffers.color.setClear(0,0,0,1,o):I==="alpha-blend"&&n.buffers.color.setClear(0,0,0,0,o),(r.autoClear||w)&&r.clear(r.autoClearColor,r.autoClearDepth,r.autoClearStencil),x&&(x.isCubeTexture||x.mapping===Zh)?(d===void 0&&(d=new Xr(new mu(1,1,1),new Cr({name:"BackgroundCubeMaterial",uniforms:Cl(Zi.backgroundCube.uniforms),vertexShader:Zi.backgroundCube.vertexShader,fragmentShader:Zi.backgroundCube.fragmentShader,side:Qr,depthTest:!1,depthWrite:!1,fog:!1})),d.geometry.deleteAttribute("normal"),d.geometry.deleteAttribute("uv"),d.onBeforeRender=function(R,S,T){this.matrixWorld.copyPosition(T.matrixWorld)},Object.defineProperty(d.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(d)),fo.copy(v.backgroundRotation),fo.x*=-1,fo.y*=-1,fo.z*=-1,x.isCubeTexture&&x.isRenderTargetTexture===!1&&(fo.y*=-1,fo.z*=-1),d.material.uniforms.envMap.value=x,d.material.uniforms.flipEnvMap.value=x.isCubeTexture&&x.isRenderTargetTexture===!1?-1:1,d.material.uniforms.backgroundBlurriness.value=v.backgroundBlurriness,d.material.uniforms.backgroundIntensity.value=v.backgroundIntensity,d.material.uniforms.backgroundRotation.value.setFromMatrix4(hD.makeRotationFromEuler(fo)),d.material.toneMapped=Tt.getTransfer(x.colorSpace)!==Ht,(A!==x||p!==x.version||g!==r.toneMapping)&&(d.material.needsUpdate=!0,A=x,p=x.version,g=r.toneMapping),d.layers.enableAll(),m.unshift(d,d.geometry,d.material,0,0,null)):x&&x.isTexture&&(u===void 0&&(u=new Xr(new vu(2,2),new Cr({name:"BackgroundMaterial",uniforms:Cl(Zi.background.uniforms),vertexShader:Zi.background.vertexShader,fragmentShader:Zi.background.fragmentShader,side:xi,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),Object.defineProperty(u.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(u)),u.material.uniforms.t2D.value=x,u.material.uniforms.backgroundIntensity.value=v.backgroundIntensity,u.material.toneMapped=Tt.getTransfer(x.colorSpace)!==Ht,x.matrixAutoUpdate===!0&&x.updateMatrix(),u.material.uniforms.uvTransform.value.copy(x.matrix),(A!==x||p!==x.version||g!==r.toneMapping)&&(u.material.needsUpdate=!0,A=x,p=x.version,g=r.toneMapping),u.layers.enableAll(),m.unshift(u,u.geometry,u.material,0,0,null))}function E(m,v){m.getRGB(Dd,u2(r)),n.buffers.color.setClear(Dd.r,Dd.g,Dd.b,v,o)}return{getClearColor:function(){return l},setClearColor:function(m,v=1){l.set(m),h=v,E(l,h)},getClearAlpha:function(){return h},setClearAlpha:function(m){h=m,E(l,h)},render:_}}function fD(r,e){const t=r.getParameter(r.MAX_VERTEX_ATTRIBS),n={},i=p(null);let s=i,o=!1;function l(M,L,P,N,W){let X=!1;const K=A(N,P,L);s!==K&&(s=K,u(s.object)),X=g(M,N,P,W),X&&_(M,N,P,W),W!==null&&e.update(W,r.ELEMENT_ARRAY_BUFFER),(X||o)&&(o=!1,I(M,L,P,N),W!==null&&r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,e.get(W).buffer))}function h(){return r.createVertexArray()}function u(M){return r.bindVertexArray(M)}function d(M){return r.deleteVertexArray(M)}function A(M,L,P){const N=P.wireframe===!0;let W=n[M.id];W===void 0&&(W={},n[M.id]=W);let X=W[L.id];X===void 0&&(X={},W[L.id]=X);let K=X[N];return K===void 0&&(K=p(h()),X[N]=K),K}function p(M){const L=[],P=[],N=[];for(let W=0;W<t;W++)L[W]=0,P[W]=0,N[W]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:L,enabledAttributes:P,attributeDivisors:N,object:M,attributes:{},index:null}}function g(M,L,P,N){const W=s.attributes,X=L.attributes;let K=0;const te=P.getAttributes();for(const V in te)if(te[V].location>=0){const ee=W[V];let Q=X[V];if(Q===void 0&&(V==="instanceMatrix"&&M.instanceMatrix&&(Q=M.instanceMatrix),V==="instanceColor"&&M.instanceColor&&(Q=M.instanceColor)),ee===void 0||ee.attribute!==Q||Q&&ee.data!==Q.data)return!0;K++}return s.attributesNum!==K||s.index!==N}function _(M,L,P,N){const W={},X=L.attributes;let K=0;const te=P.getAttributes();for(const V in te)if(te[V].location>=0){let ee=X[V];ee===void 0&&(V==="instanceMatrix"&&M.instanceMatrix&&(ee=M.instanceMatrix),V==="instanceColor"&&M.instanceColor&&(ee=M.instanceColor));const Q={};Q.attribute=ee,ee&&ee.data&&(Q.data=ee.data),W[V]=Q,K++}s.attributes=W,s.attributesNum=K,s.index=N}function E(){const M=s.newAttributes;for(let L=0,P=M.length;L<P;L++)M[L]=0}function m(M){v(M,0)}function v(M,L){const P=s.newAttributes,N=s.enabledAttributes,W=s.attributeDivisors;P[M]=1,N[M]===0&&(r.enableVertexAttribArray(M),N[M]=1),W[M]!==L&&(r.vertexAttribDivisor(M,L),W[M]=L)}function w(){const M=s.newAttributes,L=s.enabledAttributes;for(let P=0,N=L.length;P<N;P++)L[P]!==M[P]&&(r.disableVertexAttribArray(P),L[P]=0)}function x(M,L,P,N,W,X,K){K===!0?r.vertexAttribIPointer(M,L,P,W,X):r.vertexAttribPointer(M,L,P,N,W,X)}function I(M,L,P,N){E();const W=N.attributes,X=P.getAttributes(),K=L.defaultAttributeValues;for(const te in X){const V=X[te];if(V.location>=0){let ee=W[te];if(ee===void 0&&(te==="instanceMatrix"&&M.instanceMatrix&&(ee=M.instanceMatrix),te==="instanceColor"&&M.instanceColor&&(ee=M.instanceColor)),ee!==void 0){const Q=ee.normalized,z=ee.itemSize,Z=e.get(ee);if(Z===void 0)continue;const re=Z.buffer,j=Z.type,de=Z.bytesPerElement,Ae=j===r.INT||j===r.UNSIGNED_INT||ee.gpuType===iu;if(ee.isInterleavedBufferAttribute){const _e=ee.data,Ee=_e.stride,Le=ee.offset;if(_e.isInstancedInterleavedBuffer){for(let st=0;st<V.locationSize;st++)v(V.location+st,_e.meshPerAttribute);M.isInstancedMesh!==!0&&N._maxInstanceCount===void 0&&(N._maxInstanceCount=_e.meshPerAttribute*_e.count)}else for(let st=0;st<V.locationSize;st++)m(V.location+st);r.bindBuffer(r.ARRAY_BUFFER,re);for(let st=0;st<V.locationSize;st++)x(V.location+st,z/V.locationSize,j,Q,Ee*de,(Le+z/V.locationSize*st)*de,Ae)}else{if(ee.isInstancedBufferAttribute){for(let _e=0;_e<V.locationSize;_e++)v(V.location+_e,ee.meshPerAttribute);M.isInstancedMesh!==!0&&N._maxInstanceCount===void 0&&(N._maxInstanceCount=ee.meshPerAttribute*ee.count)}else for(let _e=0;_e<V.locationSize;_e++)m(V.location+_e);r.bindBuffer(r.ARRAY_BUFFER,re);for(let _e=0;_e<V.locationSize;_e++)x(V.location+_e,z/V.locationSize,j,Q,z*de,z/V.locationSize*_e*de,Ae)}}else if(K!==void 0){const Q=K[te];if(Q!==void 0)switch(Q.length){case 2:r.vertexAttrib2fv(V.location,Q);break;case 3:r.vertexAttrib3fv(V.location,Q);break;case 4:r.vertexAttrib4fv(V.location,Q);break;default:r.vertexAttrib1fv(V.location,Q)}}}}w()}function R(){D();for(const M in n){const L=n[M];for(const P in L){const N=L[P];for(const W in N)d(N[W].object),delete N[W];delete L[P]}delete n[M]}}function S(M){if(n[M.id]===void 0)return;const L=n[M.id];for(const P in L){const N=L[P];for(const W in N)d(N[W].object),delete N[W];delete L[P]}delete n[M.id]}function T(M){for(const L in n){const P=n[L];if(P[M.id]===void 0)continue;const N=P[M.id];for(const W in N)d(N[W].object),delete N[W];delete P[M.id]}}function D(){b(),o=!0,s!==i&&(s=i,u(s.object))}function b(){i.geometry=null,i.program=null,i.wireframe=!1}return{setup:l,reset:D,resetDefaultState:b,dispose:R,releaseStatesOfGeometry:S,releaseStatesOfProgram:T,initAttributes:E,enableAttribute:m,disableUnusedAttributes:w}}function pD(r,e,t){let n;function i(h){n=h}function s(h,u){r.drawArrays(n,h,u),t.update(u,n,1)}function o(h,u,d){d!==0&&(r.drawArraysInstanced(n,h,u,d),t.update(u,n,d))}function l(h,u,d){if(d===0)return;const A=e.get("WEBGL_multi_draw");if(A===null)for(let p=0;p<d;p++)this.render(h[p],u[p]);else{A.multiDrawArraysWEBGL(n,h,0,u,0,d);let p=0;for(let g=0;g<d;g++)p+=u[g];t.update(p,n,1)}}this.setMode=i,this.render=s,this.renderInstances=o,this.renderMultiDraw=l}function AD(r,e,t){let n;function i(){if(n!==void 0)return n;if(e.has("EXT_texture_filter_anisotropic")===!0){const x=e.get("EXT_texture_filter_anisotropic");n=r.getParameter(x.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else n=0;return n}function s(x){if(x==="highp"){if(r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.HIGH_FLOAT).precision>0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT).precision>0)return"highp";x="mediump"}return x==="mediump"&&r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.MEDIUM_FLOAT).precision>0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let o=t.precision!==void 0?t.precision:"highp";const l=s(o);l!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",l,"instead."),o=l);const h=t.logarithmicDepthBuffer===!0,u=r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS),d=r.getParameter(r.MAX_VERTEX_TEXTURE_IMAGE_UNITS),A=r.getParameter(r.MAX_TEXTURE_SIZE),p=r.getParameter(r.MAX_CUBE_MAP_TEXTURE_SIZE),g=r.getParameter(r.MAX_VERTEX_ATTRIBS),_=r.getParameter(r.MAX_VERTEX_UNIFORM_VECTORS),E=r.getParameter(r.MAX_VARYING_VECTORS),m=r.getParameter(r.MAX_FRAGMENT_UNIFORM_VECTORS),v=d>0,w=r.getParameter(r.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:i,getMaxPrecision:s,precision:o,logarithmicDepthBuffer:h,maxTextures:u,maxVertexTextures:d,maxTextureSize:A,maxCubemapSize:p,maxAttributes:g,maxVertexUniforms:_,maxVaryings:E,maxFragmentUniforms:m,vertexTextures:v,maxSamples:w}}function gD(r){const e=this;let t=null,n=0,i=!1,s=!1;const o=new Ji,l=new gt,h={value:null,needsUpdate:!1};this.uniform=h,this.numPlanes=0,this.numIntersection=0,this.init=function(A,p){const g=A.length!==0||p||n!==0||i;return i=p,n=A.length,g},this.beginShadows=function(){s=!0,d(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(A,p){t=d(A,p,0)},this.setState=function(A,p,g){const _=A.clippingPlanes,E=A.clipIntersection,m=A.clipShadows,v=r.get(A);if(!i||_===null||_.length===0||s&&!m)s?d(null):u();else{const w=s?0:n,x=w*4;let I=v.clippingState||null;h.value=I,I=d(_,p,x,g);for(let R=0;R!==x;++R)I[R]=t[R];v.clippingState=I,this.numIntersection=E?this.numPlanes:0,this.numPlanes+=w}};function u(){h.value!==t&&(h.value=t,h.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function d(A,p,g,_){const E=A!==null?A.length:0;let m=null;if(E!==0){if(m=h.value,_!==!0||m===null){const v=g+E*4,w=p.matrixWorldInverse;l.getNormalMatrix(w),(m===null||m.length<v)&&(m=new Float32Array(v));for(let x=0,I=g;x!==E;++x,I+=4)o.copy(A[x]).applyMatrix4(w,l),o.normal.toArray(m,I),m[I+3]=o.constant}h.value=m,h.needsUpdate=!0}return e.numPlanes=E,e.numIntersection=0,m}}function mD(r){let e=new WeakMap;function t(o,l){return l===ru?o.mapping=io:l===_A&&(o.mapping=al),o}function n(o){if(o&&o.isTexture){const l=o.mapping;if(l===ru||l===_A)if(e.has(o)){const h=e.get(o).texture;return t(h,o.mapping)}else{const h=o.image;if(h&&h.height>0){const u=new S5(h.height);return u.fromEquirectangularTexture(r,o),e.set(o,u),o.addEventListener("dispose",i),t(u.texture,o.mapping)}else return null}}return o}function i(o){const l=o.target;l.removeEventListener("dispose",i);const h=e.get(l);h!==void 0&&(e.delete(l),h.dispose())}function s(){e=new WeakMap}return{get:n,dispose:s}}class _u extends h2{constructor(e=-1,t=1,n=1,i=-1,s=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=i,this.near=s,this.far=o,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,n,i,s,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let s=n-e,o=n+e,l=i+t,h=i-t;if(this.view!==null&&this.view.enabled){const u=(this.right-this.left)/this.view.fullWidth/this.zoom,d=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=u*this.view.offsetX,o=s+u*this.view.width,l-=d*this.view.offsetY,h=l-d*this.view.height}this.projectionMatrix.makeOrthographic(s,o,l,h,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}const Bl=4,g2=[.125,.215,.35,.446,.526,.582],po=20,tg=new _u,m2=new Ve;let rg=null,ng=0,ig=0,sg=!1;const Ao=(1+Math.sqrt(5))/2,bl=1/Ao,v2=[new G(1,1,1),new G(-1,1,1),new G(1,1,-1),new G(-1,1,-1),new G(0,Ao,bl),new G(0,Ao,-bl),new G(bl,0,Ao),new G(-bl,0,Ao),new G(Ao,bl,0),new G(-Ao,bl,0)];class _2{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,n=.1,i=100){rg=this._renderer.getRenderTarget(),ng=this._renderer.getActiveCubeFace(),ig=this._renderer.getActiveMipmapLevel(),sg=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(256);const s=this._allocateTargets();return s.depthBuffer=!0,this._sceneToCubeUV(e,n,i,s),t>0&&this._blur(s,0,0,t),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=x2(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=E2(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodPlanes.length;e++)this._lodPlanes[e].dispose()}_cleanup(e){this._renderer.setRenderTarget(rg,ng,ig),this._renderer.xr.enabled=sg,e.scissorTest=!1,Ld(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===io||e.mapping===al?this._setSize(e.image.length===0?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),rg=this._renderer.getRenderTarget(),ng=this._renderer.getActiveCubeFace(),ig=this._renderer.getActiveMipmapLevel(),sg=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;const n=t||this._allocateTargets();return this._textureToCubeUV(e,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){const e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,n={magFilter:gr,minFilter:gr,generateMipmaps:!1,type:Or,format:vr,colorSpace:cr,depthBuffer:!1},i=y2(e,t,n);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=y2(e,t,n);const{_lodMax:s}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=vD(s)),this._blurMaterial=_D(s,e,t)}return i}_compileMaterial(e){const t=new Xr(this._lodPlanes[0],e);this._renderer.compile(t,tg)}_sceneToCubeUV(e,t,n,i){const s=new dn(90,1,t,n),o=[1,-1,1,1,1,1],l=[1,1,1,-1,-1,-1],h=this._renderer,u=h.autoClear,d=h.toneMapping;h.getClearColor(m2),h.toneMapping=Zs,h.autoClear=!1;const A=new Ki({name:"PMREM.Background",side:Qr,depthWrite:!1,depthTest:!1}),p=new Xr(new mu,A);let g=!1;const _=e.background;_?_.isColor&&(A.color.copy(_),e.background=null,g=!0):(A.color.copy(m2),g=!0);for(let E=0;E<6;E++){const m=E%3;m===0?(s.up.set(0,o[E],0),s.lookAt(l[E],0,0)):m===1?(s.up.set(0,0,o[E]),s.lookAt(0,l[E],0)):(s.up.set(0,o[E],0),s.lookAt(0,0,l[E]));const v=this._cubeSize;Ld(i,m*v,E>2?v:0,v,v),h.setRenderTarget(i),g&&h.render(p,s),h.render(e,s)}p.geometry.dispose(),p.material.dispose(),h.toneMapping=d,h.autoClear=u,e.background=_}_textureToCubeUV(e,t){const n=this._renderer,i=e.mapping===io||e.mapping===al;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=x2()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=E2());const s=i?this._cubemapMaterial:this._equirectMaterial,o=new Xr(this._lodPlanes[0],s),l=s.uniforms;l.envMap.value=e;const h=this._cubeSize;Ld(t,0,0,3*h,2*h),n.setRenderTarget(t),n.render(o,tg)}_applyPMREM(e){const t=this._renderer,n=t.autoClear;t.autoClear=!1;for(let i=1;i<this._lodPlanes.length;i++){const s=Math.sqrt(this._sigmas[i]*this._sigmas[i]-this._sigmas[i-1]*this._sigmas[i-1]),o=v2[(i-1)%v2.length];this._blur(e,i-1,i,s,o)}t.autoClear=n}_blur(e,t,n,i,s){const o=this._pingPongRenderTarget;this._halfBlur(e,o,t,n,i,"latitudinal",s),this._halfBlur(o,e,n,n,i,"longitudinal",s)}_halfBlur(e,t,n,i,s,o,l){const h=this._renderer,u=this._blurMaterial;o!=="latitudinal"&&o!=="longitudinal"&&console.error("blur direction must be either latitudinal or longitudinal!");const d=3,A=new Xr(this._lodPlanes[i],u),p=u.uniforms,g=this._sizeLods[n]-1,_=isFinite(s)?Math.PI/(2*g):2*Math.PI/(2*po-1),E=s/_,m=isFinite(s)?1+Math.floor(d*E):po;m>po&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${m} samples when the maximum is set to ${po}`);const v=[];let w=0;for(let T=0;T<po;++T){const D=T/E,b=Math.exp(-D*D/2);v.push(b),T===0?w+=b:T<m&&(w+=2*b)}for(let T=0;T<v.length;T++)v[T]=v[T]/w;p.envMap.value=e.texture,p.samples.value=m,p.weights.value=v,p.latitudinal.value=o==="latitudinal",l&&(p.poleAxis.value=l);const{_lodMax:x}=this;p.dTheta.value=_,p.mipInt.value=x-n;const I=this._sizeLods[i],R=3*I*(i>x-Bl?i-x+Bl:0),S=4*(this._cubeSize-I);Ld(t,R,S,3*I,2*I),h.setRenderTarget(t),h.render(A,tg)}}function vD(r){const e=[],t=[],n=[];let i=r;const s=r-Bl+1+g2.length;for(let o=0;o<s;o++){const l=Math.pow(2,i);t.push(l);let h=1/l;o>r-Bl?h=g2[o-r+Bl-1]:o===0&&(h=0),n.push(h);const u=1/(l-2),d=-u,A=1+u,p=[d,d,A,d,A,A,d,d,A,A,d,A],g=6,_=6,E=3,m=2,v=1,w=new Float32Array(E*_*g),x=new Float32Array(m*_*g),I=new Float32Array(v*_*g);for(let S=0;S<g;S++){const T=S%3*2/3-1,D=S>2?0:-1,b=[T,D,0,T+2/3,D,0,T+2/3,D+1,0,T,D,0,T+2/3,D+1,0,T,D+1,0];w.set(b,E*_*S),x.set(p,m*_*S);const M=[S,S,S,S,S,S];I.set(M,v*_*S)}const R=new Vn;R.setAttribute("position",new zr(w,E)),R.setAttribute("uv",new zr(x,m)),R.setAttribute("faceIndex",new zr(I,v)),e.push(R),i>Bl&&i--}return{lodPlanes:e,sizeLods:t,sigmas:n}}function y2(r,e,t){const n=new cn(r,e,t);return n.texture.mapping=Zh,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function Ld(r,e,t,n,i){r.viewport.set(e,t,n,i),r.scissor.set(e,t,n,i)}function _D(r,e,t){const n=new Float32Array(po),i=new G(0,1,0);return new Cr({name:"SphericalGaussianBlur",defines:{n:po,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${r}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:ag(),fragmentShader:`
3577
+ }`,mt={alphahash_fragment:R5,alphahash_pars_fragment:D5,alphamap_fragment:L5,alphamap_pars_fragment:N5,alphatest_fragment:U5,alphatest_pars_fragment:P5,aomap_fragment:k5,aomap_pars_fragment:Q5,batching_pars_vertex:O5,batching_vertex:F5,begin_vertex:z5,beginnormal_vertex:H5,bsdfs:G5,iridescence_fragment:V5,bumpmap_pars_fragment:j5,clipping_planes_fragment:W5,clipping_planes_pars_fragment:Y5,clipping_planes_pars_vertex:q5,clipping_planes_vertex:X5,color_fragment:K5,color_pars_fragment:J5,color_pars_vertex:Z5,color_vertex:$5,common:eR,cube_uv_reflection_fragment:tR,defaultnormal_vertex:rR,displacementmap_pars_vertex:nR,displacementmap_vertex:iR,emissivemap_fragment:sR,emissivemap_pars_fragment:aR,colorspace_fragment:oR,colorspace_pars_fragment:lR,envmap_fragment:cR,envmap_common_pars_fragment:uR,envmap_pars_fragment:hR,envmap_pars_vertex:dR,envmap_physical_pars_fragment:IR,envmap_vertex:fR,fog_vertex:pR,fog_pars_vertex:AR,fog_fragment:gR,fog_pars_fragment:mR,gradientmap_pars_fragment:vR,lightmap_fragment:_R,lightmap_pars_fragment:yR,lights_lambert_fragment:ER,lights_lambert_pars_fragment:xR,lights_pars_begin:wR,lights_toon_fragment:CR,lights_toon_pars_fragment:MR,lights_phong_fragment:SR,lights_phong_pars_fragment:TR,lights_physical_fragment:BR,lights_physical_pars_fragment:bR,lights_fragment_begin:RR,lights_fragment_maps:DR,lights_fragment_end:LR,logdepthbuf_fragment:NR,logdepthbuf_pars_fragment:UR,logdepthbuf_pars_vertex:PR,logdepthbuf_vertex:kR,map_fragment:QR,map_pars_fragment:OR,map_particle_fragment:FR,map_particle_pars_fragment:zR,metalnessmap_fragment:HR,metalnessmap_pars_fragment:GR,morphinstance_vertex:VR,morphcolor_vertex:jR,morphnormal_vertex:WR,morphtarget_pars_vertex:YR,morphtarget_vertex:qR,normal_fragment_begin:XR,normal_fragment_maps:KR,normal_pars_fragment:JR,normal_pars_vertex:ZR,normal_vertex:$R,normalmap_pars_fragment:e6,clearcoat_normal_fragment_begin:t6,clearcoat_normal_fragment_maps:r6,clearcoat_pars_fragment:n6,iridescence_pars_fragment:i6,opaque_fragment:s6,packing:a6,premultiplied_alpha_fragment:o6,project_vertex:l6,dithering_fragment:c6,dithering_pars_fragment:u6,roughnessmap_fragment:h6,roughnessmap_pars_fragment:d6,shadowmap_pars_fragment:f6,shadowmap_pars_vertex:p6,shadowmap_vertex:A6,shadowmask_pars_fragment:g6,skinbase_vertex:m6,skinning_pars_vertex:v6,skinning_vertex:_6,skinnormal_vertex:y6,specularmap_fragment:E6,specularmap_pars_fragment:x6,tonemapping_fragment:w6,tonemapping_pars_fragment:I6,transmission_fragment:C6,transmission_pars_fragment:M6,uv_pars_fragment:S6,uv_pars_vertex:T6,uv_vertex:B6,worldpos_vertex:b6,background_vert:R6,background_frag:D6,backgroundCube_vert:L6,backgroundCube_frag:N6,cube_vert:U6,cube_frag:P6,depth_vert:k6,depth_frag:Q6,distanceRGBA_vert:O6,distanceRGBA_frag:F6,equirect_vert:z6,equirect_frag:H6,linedashed_vert:G6,linedashed_frag:V6,meshbasic_vert:j6,meshbasic_frag:W6,meshlambert_vert:Y6,meshlambert_frag:q6,meshmatcap_vert:X6,meshmatcap_frag:K6,meshnormal_vert:J6,meshnormal_frag:Z6,meshphong_vert:$6,meshphong_frag:eD,meshphysical_vert:tD,meshphysical_frag:rD,meshtoon_vert:nD,meshtoon_frag:iD,points_vert:sD,points_frag:aD,shadow_vert:oD,shadow_frag:lD,sprite_vert:cD,sprite_frag:uD},Ne={common:{diffuse:{value:new Ve(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new gt},alphaMap:{value:null},alphaMapTransform:{value:new gt},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new gt}},envmap:{envMap:{value:null},envMapRotation:{value:new gt},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new gt}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new gt}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new gt},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new gt},normalScale:{value:new Ue(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new gt},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new gt}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new gt}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new gt}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Ve(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Ve(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new gt},alphaTest:{value:0},uvTransform:{value:new gt}},sprite:{diffuse:{value:new Ve(16777215)},opacity:{value:1},center:{value:new Ue(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new gt},alphaMap:{value:null},alphaMapTransform:{value:new gt},alphaTest:{value:0}}},Zi={basic:{uniforms:hn([Ne.common,Ne.specularmap,Ne.envmap,Ne.aomap,Ne.lightmap,Ne.fog]),vertexShader:mt.meshbasic_vert,fragmentShader:mt.meshbasic_frag},lambert:{uniforms:hn([Ne.common,Ne.specularmap,Ne.envmap,Ne.aomap,Ne.lightmap,Ne.emissivemap,Ne.bumpmap,Ne.normalmap,Ne.displacementmap,Ne.fog,Ne.lights,{emissive:{value:new Ve(0)}}]),vertexShader:mt.meshlambert_vert,fragmentShader:mt.meshlambert_frag},phong:{uniforms:hn([Ne.common,Ne.specularmap,Ne.envmap,Ne.aomap,Ne.lightmap,Ne.emissivemap,Ne.bumpmap,Ne.normalmap,Ne.displacementmap,Ne.fog,Ne.lights,{emissive:{value:new Ve(0)},specular:{value:new Ve(1118481)},shininess:{value:30}}]),vertexShader:mt.meshphong_vert,fragmentShader:mt.meshphong_frag},standard:{uniforms:hn([Ne.common,Ne.envmap,Ne.aomap,Ne.lightmap,Ne.emissivemap,Ne.bumpmap,Ne.normalmap,Ne.displacementmap,Ne.roughnessmap,Ne.metalnessmap,Ne.fog,Ne.lights,{emissive:{value:new Ve(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:mt.meshphysical_vert,fragmentShader:mt.meshphysical_frag},toon:{uniforms:hn([Ne.common,Ne.aomap,Ne.lightmap,Ne.emissivemap,Ne.bumpmap,Ne.normalmap,Ne.displacementmap,Ne.gradientmap,Ne.fog,Ne.lights,{emissive:{value:new Ve(0)}}]),vertexShader:mt.meshtoon_vert,fragmentShader:mt.meshtoon_frag},matcap:{uniforms:hn([Ne.common,Ne.bumpmap,Ne.normalmap,Ne.displacementmap,Ne.fog,{matcap:{value:null}}]),vertexShader:mt.meshmatcap_vert,fragmentShader:mt.meshmatcap_frag},points:{uniforms:hn([Ne.points,Ne.fog]),vertexShader:mt.points_vert,fragmentShader:mt.points_frag},dashed:{uniforms:hn([Ne.common,Ne.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:mt.linedashed_vert,fragmentShader:mt.linedashed_frag},depth:{uniforms:hn([Ne.common,Ne.displacementmap]),vertexShader:mt.depth_vert,fragmentShader:mt.depth_frag},normal:{uniforms:hn([Ne.common,Ne.bumpmap,Ne.normalmap,Ne.displacementmap,{opacity:{value:1}}]),vertexShader:mt.meshnormal_vert,fragmentShader:mt.meshnormal_frag},sprite:{uniforms:hn([Ne.sprite,Ne.fog]),vertexShader:mt.sprite_vert,fragmentShader:mt.sprite_frag},background:{uniforms:{uvTransform:{value:new gt},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:mt.background_vert,fragmentShader:mt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new gt}},vertexShader:mt.backgroundCube_vert,fragmentShader:mt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:mt.cube_vert,fragmentShader:mt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:mt.equirect_vert,fragmentShader:mt.equirect_frag},distanceRGBA:{uniforms:hn([Ne.common,Ne.displacementmap,{referencePosition:{value:new G},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:mt.distanceRGBA_vert,fragmentShader:mt.distanceRGBA_frag},shadow:{uniforms:hn([Ne.lights,Ne.fog,{color:{value:new Ve(0)},opacity:{value:1}}]),vertexShader:mt.shadow_vert,fragmentShader:mt.shadow_frag}};Zi.physical={uniforms:hn([Zi.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new gt},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new gt},clearcoatNormalScale:{value:new Ue(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new gt},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new gt},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new gt},sheen:{value:0},sheenColor:{value:new Ve(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new gt},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new gt},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new gt},transmissionSamplerSize:{value:new Ue},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new gt},attenuationDistance:{value:0},attenuationColor:{value:new Ve(0)},specularColor:{value:new Ve(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new gt},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new gt},anisotropyVector:{value:new Ue},anisotropyMap:{value:null},anisotropyMapTransform:{value:new gt}}]),vertexShader:mt.meshphysical_vert,fragmentShader:mt.meshphysical_frag};const Dd={r:0,b:0,g:0},fo=new qi,hD=new rt;function dD(r,e,t,n,i,s,o){const l=new Ve(0);let h=s===!0?0:1,u,d,A=null,p=0,g=null;function _(m,v){let w=!1,x=v.isScene===!0?v.background:null;x&&x.isTexture&&(x=(v.backgroundBlurriness>0?t:e).get(x)),x===null?E(l,h):x&&x.isColor&&(E(x,1),w=!0);const I=r.xr.getEnvironmentBlendMode();I==="additive"?n.buffers.color.setClear(0,0,0,1,o):I==="alpha-blend"&&n.buffers.color.setClear(0,0,0,0,o),(r.autoClear||w)&&r.clear(r.autoClearColor,r.autoClearDepth,r.autoClearStencil),x&&(x.isCubeTexture||x.mapping===Zh)?(d===void 0&&(d=new Xr(new mu(1,1,1),new Cr({name:"BackgroundCubeMaterial",uniforms:Cl(Zi.backgroundCube.uniforms),vertexShader:Zi.backgroundCube.vertexShader,fragmentShader:Zi.backgroundCube.fragmentShader,side:Qr,depthTest:!1,depthWrite:!1,fog:!1})),d.geometry.deleteAttribute("normal"),d.geometry.deleteAttribute("uv"),d.onBeforeRender=function(R,S,T){this.matrixWorld.copyPosition(T.matrixWorld)},Object.defineProperty(d.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(d)),fo.copy(v.backgroundRotation),fo.x*=-1,fo.y*=-1,fo.z*=-1,x.isCubeTexture&&x.isRenderTargetTexture===!1&&(fo.y*=-1,fo.z*=-1),d.material.uniforms.envMap.value=x,d.material.uniforms.flipEnvMap.value=x.isCubeTexture&&x.isRenderTargetTexture===!1?-1:1,d.material.uniforms.backgroundBlurriness.value=v.backgroundBlurriness,d.material.uniforms.backgroundIntensity.value=v.backgroundIntensity,d.material.uniforms.backgroundRotation.value.setFromMatrix4(hD.makeRotationFromEuler(fo)),d.material.toneMapped=Tt.getTransfer(x.colorSpace)!==Ht,(A!==x||p!==x.version||g!==r.toneMapping)&&(d.material.needsUpdate=!0,A=x,p=x.version,g=r.toneMapping),d.layers.enableAll(),m.unshift(d,d.geometry,d.material,0,0,null)):x&&x.isTexture&&(u===void 0&&(u=new Xr(new vu(2,2),new Cr({name:"BackgroundMaterial",uniforms:Cl(Zi.background.uniforms),vertexShader:Zi.background.vertexShader,fragmentShader:Zi.background.fragmentShader,side:xi,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),Object.defineProperty(u.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(u)),u.material.uniforms.t2D.value=x,u.material.uniforms.backgroundIntensity.value=v.backgroundIntensity,u.material.toneMapped=Tt.getTransfer(x.colorSpace)!==Ht,x.matrixAutoUpdate===!0&&x.updateMatrix(),u.material.uniforms.uvTransform.value.copy(x.matrix),(A!==x||p!==x.version||g!==r.toneMapping)&&(u.material.needsUpdate=!0,A=x,p=x.version,g=r.toneMapping),u.layers.enableAll(),m.unshift(u,u.geometry,u.material,0,0,null))}function E(m,v){m.getRGB(Dd,u2(r)),n.buffers.color.setClear(Dd.r,Dd.g,Dd.b,v,o)}return{getClearColor:function(){return l},setClearColor:function(m,v=1){l.set(m),h=v,E(l,h)},getClearAlpha:function(){return h},setClearAlpha:function(m){h=m,E(l,h)},render:_}}function fD(r,e){const t=r.getParameter(r.MAX_VERTEX_ATTRIBS),n={},i=p(null);let s=i,o=!1;function l(M,L,P,N,W){let X=!1;const K=A(N,P,L);s!==K&&(s=K,u(s.object)),X=g(M,N,P,W),X&&_(M,N,P,W),W!==null&&e.update(W,r.ELEMENT_ARRAY_BUFFER),(X||o)&&(o=!1,I(M,L,P,N),W!==null&&r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,e.get(W).buffer))}function h(){return r.createVertexArray()}function u(M){return r.bindVertexArray(M)}function d(M){return r.deleteVertexArray(M)}function A(M,L,P){const N=P.wireframe===!0;let W=n[M.id];W===void 0&&(W={},n[M.id]=W);let X=W[L.id];X===void 0&&(X={},W[L.id]=X);let K=X[N];return K===void 0&&(K=p(h()),X[N]=K),K}function p(M){const L=[],P=[],N=[];for(let W=0;W<t;W++)L[W]=0,P[W]=0,N[W]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:L,enabledAttributes:P,attributeDivisors:N,object:M,attributes:{},index:null}}function g(M,L,P,N){const W=s.attributes,X=L.attributes;let K=0;const te=P.getAttributes();for(const V in te)if(te[V].location>=0){const ee=W[V];let Q=X[V];if(Q===void 0&&(V==="instanceMatrix"&&M.instanceMatrix&&(Q=M.instanceMatrix),V==="instanceColor"&&M.instanceColor&&(Q=M.instanceColor)),ee===void 0||ee.attribute!==Q||Q&&ee.data!==Q.data)return!0;K++}return s.attributesNum!==K||s.index!==N}function _(M,L,P,N){const W={},X=L.attributes;let K=0;const te=P.getAttributes();for(const V in te)if(te[V].location>=0){let ee=X[V];ee===void 0&&(V==="instanceMatrix"&&M.instanceMatrix&&(ee=M.instanceMatrix),V==="instanceColor"&&M.instanceColor&&(ee=M.instanceColor));const Q={};Q.attribute=ee,ee&&ee.data&&(Q.data=ee.data),W[V]=Q,K++}s.attributes=W,s.attributesNum=K,s.index=N}function E(){const M=s.newAttributes;for(let L=0,P=M.length;L<P;L++)M[L]=0}function m(M){v(M,0)}function v(M,L){const P=s.newAttributes,N=s.enabledAttributes,W=s.attributeDivisors;P[M]=1,N[M]===0&&(r.enableVertexAttribArray(M),N[M]=1),W[M]!==L&&(r.vertexAttribDivisor(M,L),W[M]=L)}function w(){const M=s.newAttributes,L=s.enabledAttributes;for(let P=0,N=L.length;P<N;P++)L[P]!==M[P]&&(r.disableVertexAttribArray(P),L[P]=0)}function x(M,L,P,N,W,X,K){K===!0?r.vertexAttribIPointer(M,L,P,W,X):r.vertexAttribPointer(M,L,P,N,W,X)}function I(M,L,P,N){E();const W=N.attributes,X=P.getAttributes(),K=L.defaultAttributeValues;for(const te in X){const V=X[te];if(V.location>=0){let ee=W[te];if(ee===void 0&&(te==="instanceMatrix"&&M.instanceMatrix&&(ee=M.instanceMatrix),te==="instanceColor"&&M.instanceColor&&(ee=M.instanceColor)),ee!==void 0){const Q=ee.normalized,z=ee.itemSize,Z=e.get(ee);if(Z===void 0)continue;const re=Z.buffer,j=Z.type,de=Z.bytesPerElement,Ae=j===r.INT||j===r.UNSIGNED_INT||ee.gpuType===iu;if(ee.isInterleavedBufferAttribute){const _e=ee.data,Ee=_e.stride,Le=ee.offset;if(_e.isInstancedInterleavedBuffer){for(let st=0;st<V.locationSize;st++)v(V.location+st,_e.meshPerAttribute);M.isInstancedMesh!==!0&&N._maxInstanceCount===void 0&&(N._maxInstanceCount=_e.meshPerAttribute*_e.count)}else for(let st=0;st<V.locationSize;st++)m(V.location+st);r.bindBuffer(r.ARRAY_BUFFER,re);for(let st=0;st<V.locationSize;st++)x(V.location+st,z/V.locationSize,j,Q,Ee*de,(Le+z/V.locationSize*st)*de,Ae)}else{if(ee.isInstancedBufferAttribute){for(let _e=0;_e<V.locationSize;_e++)v(V.location+_e,ee.meshPerAttribute);M.isInstancedMesh!==!0&&N._maxInstanceCount===void 0&&(N._maxInstanceCount=ee.meshPerAttribute*ee.count)}else for(let _e=0;_e<V.locationSize;_e++)m(V.location+_e);r.bindBuffer(r.ARRAY_BUFFER,re);for(let _e=0;_e<V.locationSize;_e++)x(V.location+_e,z/V.locationSize,j,Q,z*de,z/V.locationSize*_e*de,Ae)}}else if(K!==void 0){const Q=K[te];if(Q!==void 0)switch(Q.length){case 2:r.vertexAttrib2fv(V.location,Q);break;case 3:r.vertexAttrib3fv(V.location,Q);break;case 4:r.vertexAttrib4fv(V.location,Q);break;default:r.vertexAttrib1fv(V.location,Q)}}}}w()}function R(){D();for(const M in n){const L=n[M];for(const P in L){const N=L[P];for(const W in N)d(N[W].object),delete N[W];delete L[P]}delete n[M]}}function S(M){if(n[M.id]===void 0)return;const L=n[M.id];for(const P in L){const N=L[P];for(const W in N)d(N[W].object),delete N[W];delete L[P]}delete n[M.id]}function T(M){for(const L in n){const P=n[L];if(P[M.id]===void 0)continue;const N=P[M.id];for(const W in N)d(N[W].object),delete N[W];delete P[M.id]}}function D(){b(),o=!0,s!==i&&(s=i,u(s.object))}function b(){i.geometry=null,i.program=null,i.wireframe=!1}return{setup:l,reset:D,resetDefaultState:b,dispose:R,releaseStatesOfGeometry:S,releaseStatesOfProgram:T,initAttributes:E,enableAttribute:m,disableUnusedAttributes:w}}function pD(r,e,t){let n;function i(h){n=h}function s(h,u){r.drawArrays(n,h,u),t.update(u,n,1)}function o(h,u,d){d!==0&&(r.drawArraysInstanced(n,h,u,d),t.update(u,n,d))}function l(h,u,d){if(d===0)return;const A=e.get("WEBGL_multi_draw");if(A===null)for(let p=0;p<d;p++)this.render(h[p],u[p]);else{A.multiDrawArraysWEBGL(n,h,0,u,0,d);let p=0;for(let g=0;g<d;g++)p+=u[g];t.update(p,n,1)}}this.setMode=i,this.render=s,this.renderInstances=o,this.renderMultiDraw=l}function AD(r,e,t){let n;function i(){if(n!==void 0)return n;if(e.has("EXT_texture_filter_anisotropic")===!0){const x=e.get("EXT_texture_filter_anisotropic");n=r.getParameter(x.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else n=0;return n}function s(x){if(x==="highp"){if(r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.HIGH_FLOAT).precision>0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT).precision>0)return"highp";x="mediump"}return x==="mediump"&&r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.MEDIUM_FLOAT).precision>0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let o=t.precision!==void 0?t.precision:"highp";const l=s(o);l!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",l,"instead."),o=l);const h=t.logarithmicDepthBuffer===!0,u=r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS),d=r.getParameter(r.MAX_VERTEX_TEXTURE_IMAGE_UNITS),A=r.getParameter(r.MAX_TEXTURE_SIZE),p=r.getParameter(r.MAX_CUBE_MAP_TEXTURE_SIZE),g=r.getParameter(r.MAX_VERTEX_ATTRIBS),_=r.getParameter(r.MAX_VERTEX_UNIFORM_VECTORS),E=r.getParameter(r.MAX_VARYING_VECTORS),m=r.getParameter(r.MAX_FRAGMENT_UNIFORM_VECTORS),v=d>0,w=r.getParameter(r.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:i,getMaxPrecision:s,precision:o,logarithmicDepthBuffer:h,maxTextures:u,maxVertexTextures:d,maxTextureSize:A,maxCubemapSize:p,maxAttributes:g,maxVertexUniforms:_,maxVaryings:E,maxFragmentUniforms:m,vertexTextures:v,maxSamples:w}}function gD(r){const e=this;let t=null,n=0,i=!1,s=!1;const o=new Ji,l=new gt,h={value:null,needsUpdate:!1};this.uniform=h,this.numPlanes=0,this.numIntersection=0,this.init=function(A,p){const g=A.length!==0||p||n!==0||i;return i=p,n=A.length,g},this.beginShadows=function(){s=!0,d(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(A,p){t=d(A,p,0)},this.setState=function(A,p,g){const _=A.clippingPlanes,E=A.clipIntersection,m=A.clipShadows,v=r.get(A);if(!i||_===null||_.length===0||s&&!m)s?d(null):u();else{const w=s?0:n,x=w*4;let I=v.clippingState||null;h.value=I,I=d(_,p,x,g);for(let R=0;R!==x;++R)I[R]=t[R];v.clippingState=I,this.numIntersection=E?this.numPlanes:0,this.numPlanes+=w}};function u(){h.value!==t&&(h.value=t,h.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function d(A,p,g,_){const E=A!==null?A.length:0;let m=null;if(E!==0){if(m=h.value,_!==!0||m===null){const v=g+E*4,w=p.matrixWorldInverse;l.getNormalMatrix(w),(m===null||m.length<v)&&(m=new Float32Array(v));for(let x=0,I=g;x!==E;++x,I+=4)o.copy(A[x]).applyMatrix4(w,l),o.normal.toArray(m,I),m[I+3]=o.constant}h.value=m,h.needsUpdate=!0}return e.numPlanes=E,e.numIntersection=0,m}}function mD(r){let e=new WeakMap;function t(o,l){return l===ru?o.mapping=io:l===vA&&(o.mapping=al),o}function n(o){if(o&&o.isTexture){const l=o.mapping;if(l===ru||l===vA)if(e.has(o)){const h=e.get(o).texture;return t(h,o.mapping)}else{const h=o.image;if(h&&h.height>0){const u=new S5(h.height);return u.fromEquirectangularTexture(r,o),e.set(o,u),o.addEventListener("dispose",i),t(u.texture,o.mapping)}else return null}}return o}function i(o){const l=o.target;l.removeEventListener("dispose",i);const h=e.get(l);h!==void 0&&(e.delete(l),h.dispose())}function s(){e=new WeakMap}return{get:n,dispose:s}}class _u extends h2{constructor(e=-1,t=1,n=1,i=-1,s=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=i,this.near=s,this.far=o,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,n,i,s,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let s=n-e,o=n+e,l=i+t,h=i-t;if(this.view!==null&&this.view.enabled){const u=(this.right-this.left)/this.view.fullWidth/this.zoom,d=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=u*this.view.offsetX,o=s+u*this.view.width,l-=d*this.view.offsetY,h=l-d*this.view.height}this.projectionMatrix.makeOrthographic(s,o,l,h,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}const Bl=4,g2=[.125,.215,.35,.446,.526,.582],po=20,eg=new _u,m2=new Ve;let tg=null,rg=0,ng=0,ig=!1;const Ao=(1+Math.sqrt(5))/2,bl=1/Ao,v2=[new G(1,1,1),new G(-1,1,1),new G(1,1,-1),new G(-1,1,-1),new G(0,Ao,bl),new G(0,Ao,-bl),new G(bl,0,Ao),new G(-bl,0,Ao),new G(Ao,bl,0),new G(-Ao,bl,0)];class _2{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,n=.1,i=100){tg=this._renderer.getRenderTarget(),rg=this._renderer.getActiveCubeFace(),ng=this._renderer.getActiveMipmapLevel(),ig=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(256);const s=this._allocateTargets();return s.depthBuffer=!0,this._sceneToCubeUV(e,n,i,s),t>0&&this._blur(s,0,0,t),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=x2(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=E2(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodPlanes.length;e++)this._lodPlanes[e].dispose()}_cleanup(e){this._renderer.setRenderTarget(tg,rg,ng),this._renderer.xr.enabled=ig,e.scissorTest=!1,Ld(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===io||e.mapping===al?this._setSize(e.image.length===0?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),tg=this._renderer.getRenderTarget(),rg=this._renderer.getActiveCubeFace(),ng=this._renderer.getActiveMipmapLevel(),ig=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;const n=t||this._allocateTargets();return this._textureToCubeUV(e,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){const e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,n={magFilter:gr,minFilter:gr,generateMipmaps:!1,type:Or,format:vr,colorSpace:cr,depthBuffer:!1},i=y2(e,t,n);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=y2(e,t,n);const{_lodMax:s}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=vD(s)),this._blurMaterial=_D(s,e,t)}return i}_compileMaterial(e){const t=new Xr(this._lodPlanes[0],e);this._renderer.compile(t,eg)}_sceneToCubeUV(e,t,n,i){const s=new dn(90,1,t,n),o=[1,-1,1,1,1,1],l=[1,1,1,-1,-1,-1],h=this._renderer,u=h.autoClear,d=h.toneMapping;h.getClearColor(m2),h.toneMapping=Zs,h.autoClear=!1;const A=new Ki({name:"PMREM.Background",side:Qr,depthWrite:!1,depthTest:!1}),p=new Xr(new mu,A);let g=!1;const _=e.background;_?_.isColor&&(A.color.copy(_),e.background=null,g=!0):(A.color.copy(m2),g=!0);for(let E=0;E<6;E++){const m=E%3;m===0?(s.up.set(0,o[E],0),s.lookAt(l[E],0,0)):m===1?(s.up.set(0,0,o[E]),s.lookAt(0,l[E],0)):(s.up.set(0,o[E],0),s.lookAt(0,0,l[E]));const v=this._cubeSize;Ld(i,m*v,E>2?v:0,v,v),h.setRenderTarget(i),g&&h.render(p,s),h.render(e,s)}p.geometry.dispose(),p.material.dispose(),h.toneMapping=d,h.autoClear=u,e.background=_}_textureToCubeUV(e,t){const n=this._renderer,i=e.mapping===io||e.mapping===al;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=x2()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=E2());const s=i?this._cubemapMaterial:this._equirectMaterial,o=new Xr(this._lodPlanes[0],s),l=s.uniforms;l.envMap.value=e;const h=this._cubeSize;Ld(t,0,0,3*h,2*h),n.setRenderTarget(t),n.render(o,eg)}_applyPMREM(e){const t=this._renderer,n=t.autoClear;t.autoClear=!1;for(let i=1;i<this._lodPlanes.length;i++){const s=Math.sqrt(this._sigmas[i]*this._sigmas[i]-this._sigmas[i-1]*this._sigmas[i-1]),o=v2[(i-1)%v2.length];this._blur(e,i-1,i,s,o)}t.autoClear=n}_blur(e,t,n,i,s){const o=this._pingPongRenderTarget;this._halfBlur(e,o,t,n,i,"latitudinal",s),this._halfBlur(o,e,n,n,i,"longitudinal",s)}_halfBlur(e,t,n,i,s,o,l){const h=this._renderer,u=this._blurMaterial;o!=="latitudinal"&&o!=="longitudinal"&&console.error("blur direction must be either latitudinal or longitudinal!");const d=3,A=new Xr(this._lodPlanes[i],u),p=u.uniforms,g=this._sizeLods[n]-1,_=isFinite(s)?Math.PI/(2*g):2*Math.PI/(2*po-1),E=s/_,m=isFinite(s)?1+Math.floor(d*E):po;m>po&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${m} samples when the maximum is set to ${po}`);const v=[];let w=0;for(let T=0;T<po;++T){const D=T/E,b=Math.exp(-D*D/2);v.push(b),T===0?w+=b:T<m&&(w+=2*b)}for(let T=0;T<v.length;T++)v[T]=v[T]/w;p.envMap.value=e.texture,p.samples.value=m,p.weights.value=v,p.latitudinal.value=o==="latitudinal",l&&(p.poleAxis.value=l);const{_lodMax:x}=this;p.dTheta.value=_,p.mipInt.value=x-n;const I=this._sizeLods[i],R=3*I*(i>x-Bl?i-x+Bl:0),S=4*(this._cubeSize-I);Ld(t,R,S,3*I,2*I),h.setRenderTarget(t),h.render(A,eg)}}function vD(r){const e=[],t=[],n=[];let i=r;const s=r-Bl+1+g2.length;for(let o=0;o<s;o++){const l=Math.pow(2,i);t.push(l);let h=1/l;o>r-Bl?h=g2[o-r+Bl-1]:o===0&&(h=0),n.push(h);const u=1/(l-2),d=-u,A=1+u,p=[d,d,A,d,A,A,d,d,A,A,d,A],g=6,_=6,E=3,m=2,v=1,w=new Float32Array(E*_*g),x=new Float32Array(m*_*g),I=new Float32Array(v*_*g);for(let S=0;S<g;S++){const T=S%3*2/3-1,D=S>2?0:-1,b=[T,D,0,T+2/3,D,0,T+2/3,D+1,0,T,D,0,T+2/3,D+1,0,T,D+1,0];w.set(b,E*_*S),x.set(p,m*_*S);const M=[S,S,S,S,S,S];I.set(M,v*_*S)}const R=new Vn;R.setAttribute("position",new zr(w,E)),R.setAttribute("uv",new zr(x,m)),R.setAttribute("faceIndex",new zr(I,v)),e.push(R),i>Bl&&i--}return{lodPlanes:e,sizeLods:t,sigmas:n}}function y2(r,e,t){const n=new cn(r,e,t);return n.texture.mapping=Zh,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function Ld(r,e,t,n,i){r.viewport.set(e,t,n,i),r.scissor.set(e,t,n,i)}function _D(r,e,t){const n=new Float32Array(po),i=new G(0,1,0);return new Cr({name:"SphericalGaussianBlur",defines:{n:po,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${r}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:sg(),fragmentShader:`
3578
3578
 
3579
3579
  precision mediump float;
3580
3580
  precision mediump int;
@@ -3634,7 +3634,7 @@ void main() {
3634
3634
  }
3635
3635
 
3636
3636
  }
3637
- `,blending:gs,depthTest:!1,depthWrite:!1})}function E2(){return new Cr({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:ag(),fragmentShader:`
3637
+ `,blending:gs,depthTest:!1,depthWrite:!1})}function E2(){return new Cr({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:sg(),fragmentShader:`
3638
3638
 
3639
3639
  precision mediump float;
3640
3640
  precision mediump int;
@@ -3653,7 +3653,7 @@ void main() {
3653
3653
  gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );
3654
3654
 
3655
3655
  }
3656
- `,blending:gs,depthTest:!1,depthWrite:!1})}function x2(){return new Cr({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:ag(),fragmentShader:`
3656
+ `,blending:gs,depthTest:!1,depthWrite:!1})}function x2(){return new Cr({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:sg(),fragmentShader:`
3657
3657
 
3658
3658
  precision mediump float;
3659
3659
  precision mediump int;
@@ -3669,7 +3669,7 @@ void main() {
3669
3669
  gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );
3670
3670
 
3671
3671
  }
3672
- `,blending:gs,depthTest:!1,depthWrite:!1})}function ag(){return`
3672
+ `,blending:gs,depthTest:!1,depthWrite:!1})}function sg(){return`
3673
3673
 
3674
3674
  precision mediump float;
3675
3675
  precision mediump int;
@@ -3724,15 +3724,15 @@ void main() {
3724
3724
  gl_Position = vec4( position, 1.0 );
3725
3725
 
3726
3726
  }
3727
- `}function yD(r){let e=new WeakMap,t=null;function n(l){if(l&&l.isTexture){const h=l.mapping,u=h===ru||h===_A,d=h===io||h===al;if(u||d){let A=e.get(l);const p=A!==void 0?A.texture.pmremVersion:0;if(l.isRenderTargetTexture&&l.pmremVersion!==p)return t===null&&(t=new _2(r)),A=u?t.fromEquirectangular(l,A):t.fromCubemap(l,A),A.texture.pmremVersion=l.pmremVersion,e.set(l,A),A.texture;if(A!==void 0)return A.texture;{const g=l.image;return u&&g&&g.height>0||d&&g&&i(g)?(t===null&&(t=new _2(r)),A=u?t.fromEquirectangular(l):t.fromCubemap(l),A.texture.pmremVersion=l.pmremVersion,e.set(l,A),l.addEventListener("dispose",s),A.texture):null}}}return l}function i(l){let h=0;const u=6;for(let d=0;d<u;d++)l[d]!==void 0&&h++;return h===u}function s(l){const h=l.target;h.removeEventListener("dispose",s);const u=e.get(h);u!==void 0&&(e.delete(h),u.dispose())}function o(){e=new WeakMap,t!==null&&(t.dispose(),t=null)}return{get:n,dispose:o}}function ED(r){const e={};function t(n){if(e[n]!==void 0)return e[n];let i;switch(n){case"WEBGL_depth_texture":i=r.getExtension("WEBGL_depth_texture")||r.getExtension("MOZ_WEBGL_depth_texture")||r.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":i=r.getExtension("EXT_texture_filter_anisotropic")||r.getExtension("MOZ_EXT_texture_filter_anisotropic")||r.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":i=r.getExtension("WEBGL_compressed_texture_s3tc")||r.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||r.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":i=r.getExtension("WEBGL_compressed_texture_pvrtc")||r.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:i=r.getExtension(n)}return e[n]=i,i}return{has:function(n){return t(n)!==null},init:function(){t("EXT_color_buffer_float"),t("WEBGL_clip_cull_distance"),t("OES_texture_float_linear"),t("EXT_color_buffer_half_float"),t("WEBGL_multisampled_render_to_texture"),t("WEBGL_render_shared_exponent")},get:function(n){const i=t(n);return i===null&&console.warn("THREE.WebGLRenderer: "+n+" extension not supported."),i}}}function xD(r,e,t,n){const i={},s=new WeakMap;function o(A){const p=A.target;p.index!==null&&e.remove(p.index);for(const _ in p.attributes)e.remove(p.attributes[_]);for(const _ in p.morphAttributes){const E=p.morphAttributes[_];for(let m=0,v=E.length;m<v;m++)e.remove(E[m])}p.removeEventListener("dispose",o),delete i[p.id];const g=s.get(p);g&&(e.remove(g),s.delete(p)),n.releaseStatesOfGeometry(p),p.isInstancedBufferGeometry===!0&&delete p._maxInstanceCount,t.memory.geometries--}function l(A,p){return i[p.id]===!0||(p.addEventListener("dispose",o),i[p.id]=!0,t.memory.geometries++),p}function h(A){const p=A.attributes;for(const _ in p)e.update(p[_],r.ARRAY_BUFFER);const g=A.morphAttributes;for(const _ in g){const E=g[_];for(let m=0,v=E.length;m<v;m++)e.update(E[m],r.ARRAY_BUFFER)}}function u(A){const p=[],g=A.index,_=A.attributes.position;let E=0;if(g!==null){const w=g.array;E=g.version;for(let x=0,I=w.length;x<I;x+=3){const R=w[x+0],S=w[x+1],T=w[x+2];p.push(R,S,S,T,T,R)}}else if(_!==void 0){const w=_.array;E=_.version;for(let x=0,I=w.length/3-1;x<I;x+=3){const R=x+0,S=x+1,T=x+2;p.push(R,S,S,T,T,R)}}else return;const m=new(OE(p)?i2:n2)(p,1);m.version=E;const v=s.get(A);v&&e.remove(v),s.set(A,m)}function d(A){const p=s.get(A);if(p){const g=A.index;g!==null&&p.version<g.version&&u(A)}else u(A);return s.get(A)}return{get:l,update:h,getWireframeAttribute:d}}function wD(r,e,t){let n;function i(A){n=A}let s,o;function l(A){s=A.type,o=A.bytesPerElement}function h(A,p){r.drawElements(n,p,s,A*o),t.update(p,n,1)}function u(A,p,g){g!==0&&(r.drawElementsInstanced(n,p,s,A*o,g),t.update(p,n,g))}function d(A,p,g){if(g===0)return;const _=e.get("WEBGL_multi_draw");if(_===null)for(let E=0;E<g;E++)this.render(A[E]/o,p[E]);else{_.multiDrawElementsWEBGL(n,p,0,s,A,0,g);let E=0;for(let m=0;m<g;m++)E+=p[m];t.update(E,n,1)}}this.setMode=i,this.setIndex=l,this.render=h,this.renderInstances=u,this.renderMultiDraw=d}function ID(r){const e={geometries:0,textures:0},t={frame:0,calls:0,triangles:0,points:0,lines:0};function n(s,o,l){switch(t.calls++,o){case r.TRIANGLES:t.triangles+=l*(s/3);break;case r.LINES:t.lines+=l*(s/2);break;case r.LINE_STRIP:t.lines+=l*(s-1);break;case r.LINE_LOOP:t.lines+=l*s;break;case r.POINTS:t.points+=l*s;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",o);break}}function i(){t.calls=0,t.triangles=0,t.points=0,t.lines=0}return{memory:e,render:t,programs:null,autoReset:!0,reset:i,update:n}}function CD(r,e,t){const n=new WeakMap,i=new Ft;function s(o,l,h){const u=o.morphTargetInfluences,d=l.morphAttributes.position||l.morphAttributes.normal||l.morphAttributes.color,A=d!==void 0?d.length:0;let p=n.get(l);if(p===void 0||p.count!==A){let g=function(){D.dispose(),n.delete(l),l.removeEventListener("dispose",g)};p!==void 0&&p.texture.dispose();const _=l.morphAttributes.position!==void 0,E=l.morphAttributes.normal!==void 0,m=l.morphAttributes.color!==void 0,v=l.morphAttributes.position||[],w=l.morphAttributes.normal||[],x=l.morphAttributes.color||[];let I=0;_===!0&&(I=1),E===!0&&(I=2),m===!0&&(I=3);let R=l.attributes.position.count*I,S=1;R>e.maxTextureSize&&(S=Math.ceil(R/e.maxTextureSize),R=e.maxTextureSize);const T=new Float32Array(R*S*4*A),D=new jE(T,R,S,A);D.type=lr,D.needsUpdate=!0;const b=I*4;for(let M=0;M<A;M++){const L=v[M],P=w[M],N=x[M],W=R*S*4*M;for(let X=0;X<L.count;X++){const K=X*b;_===!0&&(i.fromBufferAttribute(L,X),T[W+K+0]=i.x,T[W+K+1]=i.y,T[W+K+2]=i.z,T[W+K+3]=0),E===!0&&(i.fromBufferAttribute(P,X),T[W+K+4]=i.x,T[W+K+5]=i.y,T[W+K+6]=i.z,T[W+K+7]=0),m===!0&&(i.fromBufferAttribute(N,X),T[W+K+8]=i.x,T[W+K+9]=i.y,T[W+K+10]=i.z,T[W+K+11]=N.itemSize===4?i.w:1)}}p={count:A,texture:D,size:new Ue(R,S)},n.set(l,p),l.addEventListener("dispose",g)}if(o.isInstancedMesh===!0&&o.morphTexture!==null)h.getUniforms().setValue(r,"morphTexture",o.morphTexture,t);else{let g=0;for(let E=0;E<u.length;E++)g+=u[E];const _=l.morphTargetsRelative?1:1-g;h.getUniforms().setValue(r,"morphTargetBaseInfluence",_),h.getUniforms().setValue(r,"morphTargetInfluences",u)}h.getUniforms().setValue(r,"morphTargetsTexture",p.texture,t),h.getUniforms().setValue(r,"morphTargetsTextureSize",p.size)}return{update:s}}function MD(r,e,t,n){let i=new WeakMap;function s(h){const u=n.render.frame,d=h.geometry,A=e.get(h,d);if(i.get(A)!==u&&(e.update(A),i.set(A,u)),h.isInstancedMesh&&(h.hasEventListener("dispose",l)===!1&&h.addEventListener("dispose",l),i.get(h)!==u&&(t.update(h.instanceMatrix,r.ARRAY_BUFFER),h.instanceColor!==null&&t.update(h.instanceColor,r.ARRAY_BUFFER),i.set(h,u))),h.isSkinnedMesh){const p=h.skeleton;i.get(p)!==u&&(p.update(),i.set(p,u))}return A}function o(){i=new WeakMap}function l(h){const u=h.target;u.removeEventListener("dispose",l),t.remove(u.instanceMatrix),u.instanceColor!==null&&t.remove(u.instanceColor)}return{update:s,dispose:o}}class w2 extends br{constructor(e,t,n,i,s,o,l,h,u,d){if(d=d!==void 0?d:ol,d!==ol&&d!==au)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");n===void 0&&d===ol&&(n=Mi),n===void 0&&d===au&&(n=su),super(null,i,s,o,l,h,d,n,u),this.isDepthTexture=!0,this.image={width:e,height:t},this.magFilter=l!==void 0?l:Ar,this.minFilter=h!==void 0?h:Ar,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}}const I2=new br,C2=new w2(1,1);C2.compareFunction=PE;const M2=new jE,S2=new WE,T2=new p2,B2=[],b2=[],R2=new Float32Array(16),D2=new Float32Array(9),L2=new Float32Array(4);function Rl(r,e,t){const n=r[0];if(n<=0||n>0)return r;const i=e*t;let s=B2[i];if(s===void 0&&(s=new Float32Array(i),B2[i]=s),e!==0){n.toArray(s,0);for(let o=1,l=0;o!==e;++o)l+=t,r[o].toArray(s,l)}return s}function Rr(r,e){if(r.length!==e.length)return!1;for(let t=0,n=r.length;t<n;t++)if(r[t]!==e[t])return!1;return!0}function Dr(r,e){for(let t=0,n=e.length;t<n;t++)r[t]=e[t]}function Nd(r,e){let t=b2[e];t===void 0&&(t=new Int32Array(e),b2[e]=t);for(let n=0;n!==e;++n)t[n]=r.allocateTextureUnit();return t}function SD(r,e){const t=this.cache;t[0]!==e&&(r.uniform1f(this.addr,e),t[0]=e)}function TD(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(r.uniform2f(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(Rr(t,e))return;r.uniform2fv(this.addr,e),Dr(t,e)}}function BD(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(r.uniform3f(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else if(e.r!==void 0)(t[0]!==e.r||t[1]!==e.g||t[2]!==e.b)&&(r.uniform3f(this.addr,e.r,e.g,e.b),t[0]=e.r,t[1]=e.g,t[2]=e.b);else{if(Rr(t,e))return;r.uniform3fv(this.addr,e),Dr(t,e)}}function bD(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(r.uniform4f(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(Rr(t,e))return;r.uniform4fv(this.addr,e),Dr(t,e)}}function RD(r,e){const t=this.cache,n=e.elements;if(n===void 0){if(Rr(t,e))return;r.uniformMatrix2fv(this.addr,!1,e),Dr(t,e)}else{if(Rr(t,n))return;L2.set(n),r.uniformMatrix2fv(this.addr,!1,L2),Dr(t,n)}}function DD(r,e){const t=this.cache,n=e.elements;if(n===void 0){if(Rr(t,e))return;r.uniformMatrix3fv(this.addr,!1,e),Dr(t,e)}else{if(Rr(t,n))return;D2.set(n),r.uniformMatrix3fv(this.addr,!1,D2),Dr(t,n)}}function LD(r,e){const t=this.cache,n=e.elements;if(n===void 0){if(Rr(t,e))return;r.uniformMatrix4fv(this.addr,!1,e),Dr(t,e)}else{if(Rr(t,n))return;R2.set(n),r.uniformMatrix4fv(this.addr,!1,R2),Dr(t,n)}}function ND(r,e){const t=this.cache;t[0]!==e&&(r.uniform1i(this.addr,e),t[0]=e)}function UD(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(r.uniform2i(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(Rr(t,e))return;r.uniform2iv(this.addr,e),Dr(t,e)}}function PD(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(r.uniform3i(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(Rr(t,e))return;r.uniform3iv(this.addr,e),Dr(t,e)}}function kD(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(r.uniform4i(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(Rr(t,e))return;r.uniform4iv(this.addr,e),Dr(t,e)}}function QD(r,e){const t=this.cache;t[0]!==e&&(r.uniform1ui(this.addr,e),t[0]=e)}function OD(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(r.uniform2ui(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(Rr(t,e))return;r.uniform2uiv(this.addr,e),Dr(t,e)}}function FD(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(r.uniform3ui(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(Rr(t,e))return;r.uniform3uiv(this.addr,e),Dr(t,e)}}function zD(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(r.uniform4ui(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(Rr(t,e))return;r.uniform4uiv(this.addr,e),Dr(t,e)}}function HD(r,e,t){const n=this.cache,i=t.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i);const s=this.type===r.SAMPLER_2D_SHADOW?C2:I2;t.setTexture2D(e||s,i)}function GD(r,e,t){const n=this.cache,i=t.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),t.setTexture3D(e||S2,i)}function VD(r,e,t){const n=this.cache,i=t.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),t.setTextureCube(e||T2,i)}function jD(r,e,t){const n=this.cache,i=t.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),t.setTexture2DArray(e||M2,i)}function WD(r){switch(r){case 5126:return SD;case 35664:return TD;case 35665:return BD;case 35666:return bD;case 35674:return RD;case 35675:return DD;case 35676:return LD;case 5124:case 35670:return ND;case 35667:case 35671:return UD;case 35668:case 35672:return PD;case 35669:case 35673:return kD;case 5125:return QD;case 36294:return OD;case 36295:return FD;case 36296:return zD;case 35678:case 36198:case 36298:case 36306:case 35682:return HD;case 35679:case 36299:case 36307:return GD;case 35680:case 36300:case 36308:case 36293:return VD;case 36289:case 36303:case 36311:case 36292:return jD}}function YD(r,e){r.uniform1fv(this.addr,e)}function qD(r,e){const t=Rl(e,this.size,2);r.uniform2fv(this.addr,t)}function XD(r,e){const t=Rl(e,this.size,3);r.uniform3fv(this.addr,t)}function KD(r,e){const t=Rl(e,this.size,4);r.uniform4fv(this.addr,t)}function JD(r,e){const t=Rl(e,this.size,4);r.uniformMatrix2fv(this.addr,!1,t)}function ZD(r,e){const t=Rl(e,this.size,9);r.uniformMatrix3fv(this.addr,!1,t)}function $D(r,e){const t=Rl(e,this.size,16);r.uniformMatrix4fv(this.addr,!1,t)}function eL(r,e){r.uniform1iv(this.addr,e)}function tL(r,e){r.uniform2iv(this.addr,e)}function rL(r,e){r.uniform3iv(this.addr,e)}function nL(r,e){r.uniform4iv(this.addr,e)}function iL(r,e){r.uniform1uiv(this.addr,e)}function sL(r,e){r.uniform2uiv(this.addr,e)}function aL(r,e){r.uniform3uiv(this.addr,e)}function oL(r,e){r.uniform4uiv(this.addr,e)}function lL(r,e,t){const n=this.cache,i=e.length,s=Nd(t,i);Rr(n,s)||(r.uniform1iv(this.addr,s),Dr(n,s));for(let o=0;o!==i;++o)t.setTexture2D(e[o]||I2,s[o])}function cL(r,e,t){const n=this.cache,i=e.length,s=Nd(t,i);Rr(n,s)||(r.uniform1iv(this.addr,s),Dr(n,s));for(let o=0;o!==i;++o)t.setTexture3D(e[o]||S2,s[o])}function uL(r,e,t){const n=this.cache,i=e.length,s=Nd(t,i);Rr(n,s)||(r.uniform1iv(this.addr,s),Dr(n,s));for(let o=0;o!==i;++o)t.setTextureCube(e[o]||T2,s[o])}function hL(r,e,t){const n=this.cache,i=e.length,s=Nd(t,i);Rr(n,s)||(r.uniform1iv(this.addr,s),Dr(n,s));for(let o=0;o!==i;++o)t.setTexture2DArray(e[o]||M2,s[o])}function dL(r){switch(r){case 5126:return YD;case 35664:return qD;case 35665:return XD;case 35666:return KD;case 35674:return JD;case 35675:return ZD;case 35676:return $D;case 5124:case 35670:return eL;case 35667:case 35671:return tL;case 35668:case 35672:return rL;case 35669:case 35673:return nL;case 5125:return iL;case 36294:return sL;case 36295:return aL;case 36296:return oL;case 35678:case 36198:case 36298:case 36306:case 35682:return lL;case 35679:case 36299:case 36307:return cL;case 35680:case 36300:case 36308:case 36293:return uL;case 36289:case 36303:case 36311:case 36292:return hL}}class fL{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.setValue=WD(t.type)}}class pL{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.size=t.size,this.setValue=dL(t.type)}}class AL{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,t,n){const i=this.seq;for(let s=0,o=i.length;s!==o;++s){const l=i[s];l.setValue(e,t[l.id],n)}}}const og=/(\w+)(\])?(\[|\.)?/g;function N2(r,e){r.seq.push(e),r.map[e.id]=e}function gL(r,e,t){const n=r.name,i=n.length;for(og.lastIndex=0;;){const s=og.exec(n),o=og.lastIndex;let l=s[1];const h=s[2]==="]",u=s[3];if(h&&(l=l|0),u===void 0||u==="["&&o+2===i){N2(t,u===void 0?new fL(l,r,e):new pL(l,r,e));break}else{let d=t.map[l];d===void 0&&(d=new AL(l),N2(t,d)),t=d}}}class Ud{constructor(e,t){this.seq=[],this.map={};const n=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let i=0;i<n;++i){const s=e.getActiveUniform(t,i),o=e.getUniformLocation(t,s.name);gL(s,o,this)}}setValue(e,t,n,i){const s=this.map[t];s!==void 0&&s.setValue(e,n,i)}setOptional(e,t,n){const i=t[n];i!==void 0&&this.setValue(e,n,i)}static upload(e,t,n,i){for(let s=0,o=t.length;s!==o;++s){const l=t[s],h=n[l.id];h.needsUpdate!==!1&&l.setValue(e,h.value,i)}}static seqWithValue(e,t){const n=[];for(let i=0,s=e.length;i!==s;++i){const o=e[i];o.id in t&&n.push(o)}return n}}function U2(r,e,t){const n=r.createShader(e);return r.shaderSource(n,t),r.compileShader(n),n}const mL=37297;let vL=0;function _L(r,e){const t=r.split(`
3727
+ `}function yD(r){let e=new WeakMap,t=null;function n(l){if(l&&l.isTexture){const h=l.mapping,u=h===ru||h===vA,d=h===io||h===al;if(u||d){let A=e.get(l);const p=A!==void 0?A.texture.pmremVersion:0;if(l.isRenderTargetTexture&&l.pmremVersion!==p)return t===null&&(t=new _2(r)),A=u?t.fromEquirectangular(l,A):t.fromCubemap(l,A),A.texture.pmremVersion=l.pmremVersion,e.set(l,A),A.texture;if(A!==void 0)return A.texture;{const g=l.image;return u&&g&&g.height>0||d&&g&&i(g)?(t===null&&(t=new _2(r)),A=u?t.fromEquirectangular(l):t.fromCubemap(l),A.texture.pmremVersion=l.pmremVersion,e.set(l,A),l.addEventListener("dispose",s),A.texture):null}}}return l}function i(l){let h=0;const u=6;for(let d=0;d<u;d++)l[d]!==void 0&&h++;return h===u}function s(l){const h=l.target;h.removeEventListener("dispose",s);const u=e.get(h);u!==void 0&&(e.delete(h),u.dispose())}function o(){e=new WeakMap,t!==null&&(t.dispose(),t=null)}return{get:n,dispose:o}}function ED(r){const e={};function t(n){if(e[n]!==void 0)return e[n];let i;switch(n){case"WEBGL_depth_texture":i=r.getExtension("WEBGL_depth_texture")||r.getExtension("MOZ_WEBGL_depth_texture")||r.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":i=r.getExtension("EXT_texture_filter_anisotropic")||r.getExtension("MOZ_EXT_texture_filter_anisotropic")||r.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":i=r.getExtension("WEBGL_compressed_texture_s3tc")||r.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||r.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":i=r.getExtension("WEBGL_compressed_texture_pvrtc")||r.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:i=r.getExtension(n)}return e[n]=i,i}return{has:function(n){return t(n)!==null},init:function(){t("EXT_color_buffer_float"),t("WEBGL_clip_cull_distance"),t("OES_texture_float_linear"),t("EXT_color_buffer_half_float"),t("WEBGL_multisampled_render_to_texture"),t("WEBGL_render_shared_exponent")},get:function(n){const i=t(n);return i===null&&console.warn("THREE.WebGLRenderer: "+n+" extension not supported."),i}}}function xD(r,e,t,n){const i={},s=new WeakMap;function o(A){const p=A.target;p.index!==null&&e.remove(p.index);for(const _ in p.attributes)e.remove(p.attributes[_]);for(const _ in p.morphAttributes){const E=p.morphAttributes[_];for(let m=0,v=E.length;m<v;m++)e.remove(E[m])}p.removeEventListener("dispose",o),delete i[p.id];const g=s.get(p);g&&(e.remove(g),s.delete(p)),n.releaseStatesOfGeometry(p),p.isInstancedBufferGeometry===!0&&delete p._maxInstanceCount,t.memory.geometries--}function l(A,p){return i[p.id]===!0||(p.addEventListener("dispose",o),i[p.id]=!0,t.memory.geometries++),p}function h(A){const p=A.attributes;for(const _ in p)e.update(p[_],r.ARRAY_BUFFER);const g=A.morphAttributes;for(const _ in g){const E=g[_];for(let m=0,v=E.length;m<v;m++)e.update(E[m],r.ARRAY_BUFFER)}}function u(A){const p=[],g=A.index,_=A.attributes.position;let E=0;if(g!==null){const w=g.array;E=g.version;for(let x=0,I=w.length;x<I;x+=3){const R=w[x+0],S=w[x+1],T=w[x+2];p.push(R,S,S,T,T,R)}}else if(_!==void 0){const w=_.array;E=_.version;for(let x=0,I=w.length/3-1;x<I;x+=3){const R=x+0,S=x+1,T=x+2;p.push(R,S,S,T,T,R)}}else return;const m=new(OE(p)?i2:n2)(p,1);m.version=E;const v=s.get(A);v&&e.remove(v),s.set(A,m)}function d(A){const p=s.get(A);if(p){const g=A.index;g!==null&&p.version<g.version&&u(A)}else u(A);return s.get(A)}return{get:l,update:h,getWireframeAttribute:d}}function wD(r,e,t){let n;function i(A){n=A}let s,o;function l(A){s=A.type,o=A.bytesPerElement}function h(A,p){r.drawElements(n,p,s,A*o),t.update(p,n,1)}function u(A,p,g){g!==0&&(r.drawElementsInstanced(n,p,s,A*o,g),t.update(p,n,g))}function d(A,p,g){if(g===0)return;const _=e.get("WEBGL_multi_draw");if(_===null)for(let E=0;E<g;E++)this.render(A[E]/o,p[E]);else{_.multiDrawElementsWEBGL(n,p,0,s,A,0,g);let E=0;for(let m=0;m<g;m++)E+=p[m];t.update(E,n,1)}}this.setMode=i,this.setIndex=l,this.render=h,this.renderInstances=u,this.renderMultiDraw=d}function ID(r){const e={geometries:0,textures:0},t={frame:0,calls:0,triangles:0,points:0,lines:0};function n(s,o,l){switch(t.calls++,o){case r.TRIANGLES:t.triangles+=l*(s/3);break;case r.LINES:t.lines+=l*(s/2);break;case r.LINE_STRIP:t.lines+=l*(s-1);break;case r.LINE_LOOP:t.lines+=l*s;break;case r.POINTS:t.points+=l*s;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",o);break}}function i(){t.calls=0,t.triangles=0,t.points=0,t.lines=0}return{memory:e,render:t,programs:null,autoReset:!0,reset:i,update:n}}function CD(r,e,t){const n=new WeakMap,i=new Ft;function s(o,l,h){const u=o.morphTargetInfluences,d=l.morphAttributes.position||l.morphAttributes.normal||l.morphAttributes.color,A=d!==void 0?d.length:0;let p=n.get(l);if(p===void 0||p.count!==A){let g=function(){D.dispose(),n.delete(l),l.removeEventListener("dispose",g)};p!==void 0&&p.texture.dispose();const _=l.morphAttributes.position!==void 0,E=l.morphAttributes.normal!==void 0,m=l.morphAttributes.color!==void 0,v=l.morphAttributes.position||[],w=l.morphAttributes.normal||[],x=l.morphAttributes.color||[];let I=0;_===!0&&(I=1),E===!0&&(I=2),m===!0&&(I=3);let R=l.attributes.position.count*I,S=1;R>e.maxTextureSize&&(S=Math.ceil(R/e.maxTextureSize),R=e.maxTextureSize);const T=new Float32Array(R*S*4*A),D=new jE(T,R,S,A);D.type=lr,D.needsUpdate=!0;const b=I*4;for(let M=0;M<A;M++){const L=v[M],P=w[M],N=x[M],W=R*S*4*M;for(let X=0;X<L.count;X++){const K=X*b;_===!0&&(i.fromBufferAttribute(L,X),T[W+K+0]=i.x,T[W+K+1]=i.y,T[W+K+2]=i.z,T[W+K+3]=0),E===!0&&(i.fromBufferAttribute(P,X),T[W+K+4]=i.x,T[W+K+5]=i.y,T[W+K+6]=i.z,T[W+K+7]=0),m===!0&&(i.fromBufferAttribute(N,X),T[W+K+8]=i.x,T[W+K+9]=i.y,T[W+K+10]=i.z,T[W+K+11]=N.itemSize===4?i.w:1)}}p={count:A,texture:D,size:new Ue(R,S)},n.set(l,p),l.addEventListener("dispose",g)}if(o.isInstancedMesh===!0&&o.morphTexture!==null)h.getUniforms().setValue(r,"morphTexture",o.morphTexture,t);else{let g=0;for(let E=0;E<u.length;E++)g+=u[E];const _=l.morphTargetsRelative?1:1-g;h.getUniforms().setValue(r,"morphTargetBaseInfluence",_),h.getUniforms().setValue(r,"morphTargetInfluences",u)}h.getUniforms().setValue(r,"morphTargetsTexture",p.texture,t),h.getUniforms().setValue(r,"morphTargetsTextureSize",p.size)}return{update:s}}function MD(r,e,t,n){let i=new WeakMap;function s(h){const u=n.render.frame,d=h.geometry,A=e.get(h,d);if(i.get(A)!==u&&(e.update(A),i.set(A,u)),h.isInstancedMesh&&(h.hasEventListener("dispose",l)===!1&&h.addEventListener("dispose",l),i.get(h)!==u&&(t.update(h.instanceMatrix,r.ARRAY_BUFFER),h.instanceColor!==null&&t.update(h.instanceColor,r.ARRAY_BUFFER),i.set(h,u))),h.isSkinnedMesh){const p=h.skeleton;i.get(p)!==u&&(p.update(),i.set(p,u))}return A}function o(){i=new WeakMap}function l(h){const u=h.target;u.removeEventListener("dispose",l),t.remove(u.instanceMatrix),u.instanceColor!==null&&t.remove(u.instanceColor)}return{update:s,dispose:o}}class w2 extends br{constructor(e,t,n,i,s,o,l,h,u,d){if(d=d!==void 0?d:ol,d!==ol&&d!==au)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");n===void 0&&d===ol&&(n=Mi),n===void 0&&d===au&&(n=su),super(null,i,s,o,l,h,d,n,u),this.isDepthTexture=!0,this.image={width:e,height:t},this.magFilter=l!==void 0?l:Ar,this.minFilter=h!==void 0?h:Ar,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}}const I2=new br,C2=new w2(1,1);C2.compareFunction=PE;const M2=new jE,S2=new WE,T2=new p2,B2=[],b2=[],R2=new Float32Array(16),D2=new Float32Array(9),L2=new Float32Array(4);function Rl(r,e,t){const n=r[0];if(n<=0||n>0)return r;const i=e*t;let s=B2[i];if(s===void 0&&(s=new Float32Array(i),B2[i]=s),e!==0){n.toArray(s,0);for(let o=1,l=0;o!==e;++o)l+=t,r[o].toArray(s,l)}return s}function Rr(r,e){if(r.length!==e.length)return!1;for(let t=0,n=r.length;t<n;t++)if(r[t]!==e[t])return!1;return!0}function Dr(r,e){for(let t=0,n=e.length;t<n;t++)r[t]=e[t]}function Nd(r,e){let t=b2[e];t===void 0&&(t=new Int32Array(e),b2[e]=t);for(let n=0;n!==e;++n)t[n]=r.allocateTextureUnit();return t}function SD(r,e){const t=this.cache;t[0]!==e&&(r.uniform1f(this.addr,e),t[0]=e)}function TD(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(r.uniform2f(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(Rr(t,e))return;r.uniform2fv(this.addr,e),Dr(t,e)}}function BD(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(r.uniform3f(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else if(e.r!==void 0)(t[0]!==e.r||t[1]!==e.g||t[2]!==e.b)&&(r.uniform3f(this.addr,e.r,e.g,e.b),t[0]=e.r,t[1]=e.g,t[2]=e.b);else{if(Rr(t,e))return;r.uniform3fv(this.addr,e),Dr(t,e)}}function bD(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(r.uniform4f(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(Rr(t,e))return;r.uniform4fv(this.addr,e),Dr(t,e)}}function RD(r,e){const t=this.cache,n=e.elements;if(n===void 0){if(Rr(t,e))return;r.uniformMatrix2fv(this.addr,!1,e),Dr(t,e)}else{if(Rr(t,n))return;L2.set(n),r.uniformMatrix2fv(this.addr,!1,L2),Dr(t,n)}}function DD(r,e){const t=this.cache,n=e.elements;if(n===void 0){if(Rr(t,e))return;r.uniformMatrix3fv(this.addr,!1,e),Dr(t,e)}else{if(Rr(t,n))return;D2.set(n),r.uniformMatrix3fv(this.addr,!1,D2),Dr(t,n)}}function LD(r,e){const t=this.cache,n=e.elements;if(n===void 0){if(Rr(t,e))return;r.uniformMatrix4fv(this.addr,!1,e),Dr(t,e)}else{if(Rr(t,n))return;R2.set(n),r.uniformMatrix4fv(this.addr,!1,R2),Dr(t,n)}}function ND(r,e){const t=this.cache;t[0]!==e&&(r.uniform1i(this.addr,e),t[0]=e)}function UD(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(r.uniform2i(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(Rr(t,e))return;r.uniform2iv(this.addr,e),Dr(t,e)}}function PD(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(r.uniform3i(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(Rr(t,e))return;r.uniform3iv(this.addr,e),Dr(t,e)}}function kD(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(r.uniform4i(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(Rr(t,e))return;r.uniform4iv(this.addr,e),Dr(t,e)}}function QD(r,e){const t=this.cache;t[0]!==e&&(r.uniform1ui(this.addr,e),t[0]=e)}function OD(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(r.uniform2ui(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(Rr(t,e))return;r.uniform2uiv(this.addr,e),Dr(t,e)}}function FD(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(r.uniform3ui(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(Rr(t,e))return;r.uniform3uiv(this.addr,e),Dr(t,e)}}function zD(r,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(r.uniform4ui(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(Rr(t,e))return;r.uniform4uiv(this.addr,e),Dr(t,e)}}function HD(r,e,t){const n=this.cache,i=t.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i);const s=this.type===r.SAMPLER_2D_SHADOW?C2:I2;t.setTexture2D(e||s,i)}function GD(r,e,t){const n=this.cache,i=t.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),t.setTexture3D(e||S2,i)}function VD(r,e,t){const n=this.cache,i=t.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),t.setTextureCube(e||T2,i)}function jD(r,e,t){const n=this.cache,i=t.allocateTextureUnit();n[0]!==i&&(r.uniform1i(this.addr,i),n[0]=i),t.setTexture2DArray(e||M2,i)}function WD(r){switch(r){case 5126:return SD;case 35664:return TD;case 35665:return BD;case 35666:return bD;case 35674:return RD;case 35675:return DD;case 35676:return LD;case 5124:case 35670:return ND;case 35667:case 35671:return UD;case 35668:case 35672:return PD;case 35669:case 35673:return kD;case 5125:return QD;case 36294:return OD;case 36295:return FD;case 36296:return zD;case 35678:case 36198:case 36298:case 36306:case 35682:return HD;case 35679:case 36299:case 36307:return GD;case 35680:case 36300:case 36308:case 36293:return VD;case 36289:case 36303:case 36311:case 36292:return jD}}function YD(r,e){r.uniform1fv(this.addr,e)}function qD(r,e){const t=Rl(e,this.size,2);r.uniform2fv(this.addr,t)}function XD(r,e){const t=Rl(e,this.size,3);r.uniform3fv(this.addr,t)}function KD(r,e){const t=Rl(e,this.size,4);r.uniform4fv(this.addr,t)}function JD(r,e){const t=Rl(e,this.size,4);r.uniformMatrix2fv(this.addr,!1,t)}function ZD(r,e){const t=Rl(e,this.size,9);r.uniformMatrix3fv(this.addr,!1,t)}function $D(r,e){const t=Rl(e,this.size,16);r.uniformMatrix4fv(this.addr,!1,t)}function eL(r,e){r.uniform1iv(this.addr,e)}function tL(r,e){r.uniform2iv(this.addr,e)}function rL(r,e){r.uniform3iv(this.addr,e)}function nL(r,e){r.uniform4iv(this.addr,e)}function iL(r,e){r.uniform1uiv(this.addr,e)}function sL(r,e){r.uniform2uiv(this.addr,e)}function aL(r,e){r.uniform3uiv(this.addr,e)}function oL(r,e){r.uniform4uiv(this.addr,e)}function lL(r,e,t){const n=this.cache,i=e.length,s=Nd(t,i);Rr(n,s)||(r.uniform1iv(this.addr,s),Dr(n,s));for(let o=0;o!==i;++o)t.setTexture2D(e[o]||I2,s[o])}function cL(r,e,t){const n=this.cache,i=e.length,s=Nd(t,i);Rr(n,s)||(r.uniform1iv(this.addr,s),Dr(n,s));for(let o=0;o!==i;++o)t.setTexture3D(e[o]||S2,s[o])}function uL(r,e,t){const n=this.cache,i=e.length,s=Nd(t,i);Rr(n,s)||(r.uniform1iv(this.addr,s),Dr(n,s));for(let o=0;o!==i;++o)t.setTextureCube(e[o]||T2,s[o])}function hL(r,e,t){const n=this.cache,i=e.length,s=Nd(t,i);Rr(n,s)||(r.uniform1iv(this.addr,s),Dr(n,s));for(let o=0;o!==i;++o)t.setTexture2DArray(e[o]||M2,s[o])}function dL(r){switch(r){case 5126:return YD;case 35664:return qD;case 35665:return XD;case 35666:return KD;case 35674:return JD;case 35675:return ZD;case 35676:return $D;case 5124:case 35670:return eL;case 35667:case 35671:return tL;case 35668:case 35672:return rL;case 35669:case 35673:return nL;case 5125:return iL;case 36294:return sL;case 36295:return aL;case 36296:return oL;case 35678:case 36198:case 36298:case 36306:case 35682:return lL;case 35679:case 36299:case 36307:return cL;case 35680:case 36300:case 36308:case 36293:return uL;case 36289:case 36303:case 36311:case 36292:return hL}}class fL{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.setValue=WD(t.type)}}class pL{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.size=t.size,this.setValue=dL(t.type)}}class AL{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,t,n){const i=this.seq;for(let s=0,o=i.length;s!==o;++s){const l=i[s];l.setValue(e,t[l.id],n)}}}const ag=/(\w+)(\])?(\[|\.)?/g;function N2(r,e){r.seq.push(e),r.map[e.id]=e}function gL(r,e,t){const n=r.name,i=n.length;for(ag.lastIndex=0;;){const s=ag.exec(n),o=ag.lastIndex;let l=s[1];const h=s[2]==="]",u=s[3];if(h&&(l=l|0),u===void 0||u==="["&&o+2===i){N2(t,u===void 0?new fL(l,r,e):new pL(l,r,e));break}else{let d=t.map[l];d===void 0&&(d=new AL(l),N2(t,d)),t=d}}}class Ud{constructor(e,t){this.seq=[],this.map={};const n=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let i=0;i<n;++i){const s=e.getActiveUniform(t,i),o=e.getUniformLocation(t,s.name);gL(s,o,this)}}setValue(e,t,n,i){const s=this.map[t];s!==void 0&&s.setValue(e,n,i)}setOptional(e,t,n){const i=t[n];i!==void 0&&this.setValue(e,n,i)}static upload(e,t,n,i){for(let s=0,o=t.length;s!==o;++s){const l=t[s],h=n[l.id];h.needsUpdate!==!1&&l.setValue(e,h.value,i)}}static seqWithValue(e,t){const n=[];for(let i=0,s=e.length;i!==s;++i){const o=e[i];o.id in t&&n.push(o)}return n}}function U2(r,e,t){const n=r.createShader(e);return r.shaderSource(n,t),r.compileShader(n),n}const mL=37297;let vL=0;function _L(r,e){const t=r.split(`
3728
3728
  `),n=[],i=Math.max(e-6,0),s=Math.min(e+6,t.length);for(let o=i;o<s;o++){const l=o+1;n.push(`${l===e?">":" "} ${l}: ${t[o]}`)}return n.join(`
3729
3729
  `)}function yL(r){const e=Tt.getPrimaries(Tt.workingColorSpace),t=Tt.getPrimaries(r);let n;switch(e===t?n="":e===cd&&t===ld?n="LinearDisplayP3ToLinearSRGB":e===ld&&t===cd&&(n="LinearSRGBToLinearDisplayP3"),r){case cr:case cu:return[n,"LinearTransferOETF"];case Fr:case ad:return[n,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",r),[n,"LinearTransferOETF"]}}function P2(r,e,t){const n=r.getShaderParameter(e,r.COMPILE_STATUS),i=r.getShaderInfoLog(e).trim();if(n&&i==="")return"";const s=/ERROR: 0:(\d+)/.exec(i);if(s){const o=parseInt(s[1]);return t.toUpperCase()+`
3730
3730
 
3731
3731
  `+i+`
3732
3732
 
3733
- `+_L(r.getShaderSource(e),o)}else return i}function EL(r,e){const t=yL(e);return`vec4 ${r}( vec4 value ) { return ${t[0]}( ${t[1]}( value ) ); }`}function xL(r,e){let t;switch(e){case eE:t="Linear";break;case tE:t="Reinhard";break;case rE:t="OptimizedCineon";break;case nE:t="ACESFilmic";break;case iE:t="AgX";break;case vA:t="Neutral";break;case Eb:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+r+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}function wL(r){return[r.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",r.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(yu).join(`
3733
+ `+_L(r.getShaderSource(e),o)}else return i}function EL(r,e){const t=yL(e);return`vec4 ${r}( vec4 value ) { return ${t[0]}( ${t[1]}( value ) ); }`}function xL(r,e){let t;switch(e){case mA:t="Linear";break;case eE:t="Reinhard";break;case tE:t="OptimizedCineon";break;case rE:t="ACESFilmic";break;case nE:t="AgX";break;case iE:t="Neutral";break;case Eb:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+r+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}function wL(r){return[r.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",r.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(yu).join(`
3734
3734
  `)}function IL(r){const e=[];for(const t in r){const n=r[t];n!==!1&&e.push("#define "+t+" "+n)}return e.join(`
3735
- `)}function CL(r,e){const t={},n=r.getProgramParameter(e,r.ACTIVE_ATTRIBUTES);for(let i=0;i<n;i++){const s=r.getActiveAttrib(e,i),o=s.name;let l=1;s.type===r.FLOAT_MAT2&&(l=2),s.type===r.FLOAT_MAT3&&(l=3),s.type===r.FLOAT_MAT4&&(l=4),t[o]={type:s.type,location:r.getAttribLocation(e,o),locationSize:l}}return t}function yu(r){return r!==""}function k2(r,e){const t=e.numSpotLightShadows+e.numSpotLightMaps-e.numSpotLightShadowsWithMaps;return r.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,e.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,t).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,e.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function Q2(r,e){return r.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const ML=/^[ \t]*#include +<([\w\d./]+)>/gm;function lg(r){return r.replace(ML,TL)}const SL=new Map([["encodings_fragment","colorspace_fragment"],["encodings_pars_fragment","colorspace_pars_fragment"],["output_fragment","opaque_fragment"]]);function TL(r,e){let t=mt[e];if(t===void 0){const n=SL.get(e);if(n!==void 0)t=mt[n],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,n);else throw new Error("Can not resolve #include <"+e+">")}return lg(t)}const BL=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function O2(r){return r.replace(BL,bL)}function bL(r,e,t,n){let i="";for(let s=parseInt(e);s<parseInt(t);s++)i+=n.replace(/\[\s*i\s*\]/g,"[ "+s+" ]").replace(/UNROLLED_LOOP_INDEX/g,s);return i}function F2(r){let e=`precision ${r.precision} float;
3735
+ `)}function CL(r,e){const t={},n=r.getProgramParameter(e,r.ACTIVE_ATTRIBUTES);for(let i=0;i<n;i++){const s=r.getActiveAttrib(e,i),o=s.name;let l=1;s.type===r.FLOAT_MAT2&&(l=2),s.type===r.FLOAT_MAT3&&(l=3),s.type===r.FLOAT_MAT4&&(l=4),t[o]={type:s.type,location:r.getAttribLocation(e,o),locationSize:l}}return t}function yu(r){return r!==""}function k2(r,e){const t=e.numSpotLightShadows+e.numSpotLightMaps-e.numSpotLightShadowsWithMaps;return r.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,e.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,t).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,e.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function Q2(r,e){return r.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const ML=/^[ \t]*#include +<([\w\d./]+)>/gm;function og(r){return r.replace(ML,TL)}const SL=new Map([["encodings_fragment","colorspace_fragment"],["encodings_pars_fragment","colorspace_pars_fragment"],["output_fragment","opaque_fragment"]]);function TL(r,e){let t=mt[e];if(t===void 0){const n=SL.get(e);if(n!==void 0)t=mt[n],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,n);else throw new Error("Can not resolve #include <"+e+">")}return og(t)}const BL=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function O2(r){return r.replace(BL,bL)}function bL(r,e,t,n){let i="";for(let s=parseInt(e);s<parseInt(t);s++)i+=n.replace(/\[\s*i\s*\]/g,"[ "+s+" ]").replace(/UNROLLED_LOOP_INDEX/g,s);return i}function F2(r){let e=`precision ${r.precision} float;
3736
3736
  precision ${r.precision} int;
3737
3737
  precision ${r.precision} sampler2D;
3738
3738
  precision ${r.precision} samplerCube;
@@ -3761,7 +3761,7 @@ void main() {
3761
3761
  `].filter(yu).join(`
3762
3762
  `),v=[F2(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,_,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+u:"",t.envMap?"#define "+d:"",t.envMap?"#define "+A:"",p?"#define CUBEUV_TEXEL_WIDTH "+p.texelWidth:"",p?"#define CUBEUV_TEXEL_HEIGHT "+p.texelHeight:"",p?"#define CUBEUV_MAX_MIP "+p.maxMip+".0":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescence?"#define USE_IRIDESCENCE":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+h:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.useLegacyLights?"#define LEGACY_LIGHTS":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==Zs?"#define TONE_MAPPING":"",t.toneMapping!==Zs?mt.tonemapping_pars_fragment:"",t.toneMapping!==Zs?xL("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",mt.colorspace_pars_fragment,EL("linearToOutputTexel",t.outputColorSpace),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",`
3763
3763
  `].filter(yu).join(`
3764
- `)),o=lg(o),o=k2(o,t),o=Q2(o,t),l=lg(l),l=k2(l,t),l=Q2(l,t),o=O2(o),l=O2(l),t.isRawShaderMaterial!==!0&&(w=`#version 300 es
3764
+ `)),o=og(o),o=k2(o,t),o=Q2(o,t),l=og(l),l=k2(l,t),l=Q2(l,t),o=O2(o),l=O2(l),t.isRawShaderMaterial!==!0&&(w=`#version 300 es
3765
3765
  `,m=[g,"#define attribute in","#define varying out","#define texture2D texture"].join(`
3766
3766
  `)+`
3767
3767
  `+m,v=["#define varying in",t.glslVersion===kE?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===kE?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(`
@@ -3801,7 +3801,7 @@ void main() {
3801
3801
  squared_mean = squared_mean / samples;
3802
3802
  float std_dev = sqrt( squared_mean - mean * mean );
3803
3803
  gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );
3804
- }`;function $L(r,e,t){let n=new eg;const i=new Ue,s=new Ue,o=new Ft,l=new V2({depthPacking:Lb}),h=new KL,u={},d=t.maxTextureSize,A={[xi]:Qr,[Qr]:xi,[wi]:wi},p=new Cr({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Ue},radius:{value:4}},vertexShader:JL,fragmentShader:ZL}),g=p.clone();g.defines.HORIZONTAL_PASS=1;const _=new Vn;_.setAttribute("position",new zr(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const E=new Xr(_,p),m=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Ky;let v=this.type;this.render=function(S,T,D){if(m.enabled===!1||m.autoUpdate===!1&&m.needsUpdate===!1||S.length===0)return;const b=r.getRenderTarget(),M=r.getActiveCubeFace(),L=r.getActiveMipmapLevel(),P=r.state;P.setBlending(gs),P.buffers.color.setClear(1,1,1,1),P.buffers.depth.setTest(!0),P.setScissorTest(!1);const N=v!==As&&this.type===As,W=v===As&&this.type!==As;for(let X=0,K=S.length;X<K;X++){const te=S[X],V=te.shadow;if(V===void 0){console.warn("THREE.WebGLShadowMap:",te,"has no shadow.");continue}if(V.autoUpdate===!1&&V.needsUpdate===!1)continue;i.copy(V.mapSize);const ee=V.getFrameExtents();if(i.multiply(ee),s.copy(V.mapSize),(i.x>d||i.y>d)&&(i.x>d&&(s.x=Math.floor(d/ee.x),i.x=s.x*ee.x,V.mapSize.x=s.x),i.y>d&&(s.y=Math.floor(d/ee.y),i.y=s.y*ee.y,V.mapSize.y=s.y)),V.map===null||N===!0||W===!0){const z=this.type!==As?{minFilter:Ar,magFilter:Ar}:{};V.map!==null&&V.map.dispose(),V.map=new cn(i.x,i.y,z),V.map.texture.name=te.name+".shadowMap",V.camera.updateProjectionMatrix()}r.setRenderTarget(V.map),r.clear();const Q=V.getViewportCount();for(let z=0;z<Q;z++){const Z=V.getViewport(z);o.set(s.x*Z.x,s.y*Z.y,s.x*Z.z,s.y*Z.w),P.viewport(o),V.updateMatrices(te,z),n=V.getFrustum(),I(T,D,V.camera,te,this.type)}V.isPointLightShadow!==!0&&this.type===As&&w(V,D),V.needsUpdate=!1}v=this.type,m.needsUpdate=!1,r.setRenderTarget(b,M,L)};function w(S,T){const D=e.update(E);p.defines.VSM_SAMPLES!==S.blurSamples&&(p.defines.VSM_SAMPLES=S.blurSamples,g.defines.VSM_SAMPLES=S.blurSamples,p.needsUpdate=!0,g.needsUpdate=!0),S.mapPass===null&&(S.mapPass=new cn(i.x,i.y)),p.uniforms.shadow_pass.value=S.map.texture,p.uniforms.resolution.value=S.mapSize,p.uniforms.radius.value=S.radius,r.setRenderTarget(S.mapPass),r.clear(),r.renderBufferDirect(T,null,D,p,E,null),g.uniforms.shadow_pass.value=S.mapPass.texture,g.uniforms.resolution.value=S.mapSize,g.uniforms.radius.value=S.radius,r.setRenderTarget(S.map),r.clear(),r.renderBufferDirect(T,null,D,g,E,null)}function x(S,T,D,b){let M=null;const L=D.isPointLight===!0?S.customDistanceMaterial:S.customDepthMaterial;if(L!==void 0)M=L;else if(M=D.isPointLight===!0?h:l,r.localClippingEnabled&&T.clipShadows===!0&&Array.isArray(T.clippingPlanes)&&T.clippingPlanes.length!==0||T.displacementMap&&T.displacementScale!==0||T.alphaMap&&T.alphaTest>0||T.map&&T.alphaTest>0){const P=M.uuid,N=T.uuid;let W=u[P];W===void 0&&(W={},u[P]=W);let X=W[N];X===void 0&&(X=M.clone(),W[N]=X,T.addEventListener("dispose",R)),M=X}if(M.visible=T.visible,M.wireframe=T.wireframe,b===As?M.side=T.shadowSide!==null?T.shadowSide:T.side:M.side=T.shadowSide!==null?T.shadowSide:A[T.side],M.alphaMap=T.alphaMap,M.alphaTest=T.alphaTest,M.map=T.map,M.clipShadows=T.clipShadows,M.clippingPlanes=T.clippingPlanes,M.clipIntersection=T.clipIntersection,M.displacementMap=T.displacementMap,M.displacementScale=T.displacementScale,M.displacementBias=T.displacementBias,M.wireframeLinewidth=T.wireframeLinewidth,M.linewidth=T.linewidth,D.isPointLight===!0&&M.isMeshDistanceMaterial===!0){const P=r.properties.get(M);P.light=D}return M}function I(S,T,D,b,M){if(S.visible===!1)return;if(S.layers.test(T.layers)&&(S.isMesh||S.isLine||S.isPoints)&&(S.castShadow||S.receiveShadow&&M===As)&&(!S.frustumCulled||n.intersectsObject(S))){S.modelViewMatrix.multiplyMatrices(D.matrixWorldInverse,S.matrixWorld);const P=e.update(S),N=S.material;if(Array.isArray(N)){const W=P.groups;for(let X=0,K=W.length;X<K;X++){const te=W[X],V=N[te.materialIndex];if(V&&V.visible){const ee=x(S,V,b,M);S.onBeforeShadow(r,S,T,D,P,ee,te),r.renderBufferDirect(D,null,P,ee,S,te),S.onAfterShadow(r,S,T,D,P,ee,te)}}}else if(N.visible){const W=x(S,N,b,M);S.onBeforeShadow(r,S,T,D,P,W,null),r.renderBufferDirect(D,null,P,W,S,null),S.onAfterShadow(r,S,T,D,P,W,null)}}const L=S.children;for(let P=0,N=L.length;P<N;P++)I(L[P],T,D,b,M)}function R(S){S.target.removeEventListener("dispose",R);for(const T in u){const D=u[T],b=S.target.uuid;b in D&&(D[b].dispose(),delete D[b])}}}function e8(r){function e(){let O=!1;const ge=new Ft;let ve=null;const Fe=new Ft(0,0,0,0);return{setMask:function(Pe){ve!==Pe&&!O&&(r.colorMask(Pe,Pe,Pe,Pe),ve=Pe)},setLocked:function(Pe){O=Pe},setClear:function(Pe,vt,Lt,Nt,Bt){Bt===!0&&(Pe*=Nt,vt*=Nt,Lt*=Nt),ge.set(Pe,vt,Lt,Nt),Fe.equals(ge)===!1&&(r.clearColor(Pe,vt,Lt,Nt),Fe.copy(ge))},reset:function(){O=!1,ve=null,Fe.set(-1,0,0,0)}}}function t(){let O=!1,ge=null,ve=null,Fe=null;return{setTest:function(Pe){Pe?Ae(r.DEPTH_TEST):_e(r.DEPTH_TEST)},setMask:function(Pe){ge!==Pe&&!O&&(r.depthMask(Pe),ge=Pe)},setFunc:function(Pe){if(ve!==Pe){switch(Pe){case db:r.depthFunc(r.NEVER);break;case fb:r.depthFunc(r.ALWAYS);break;case pb:r.depthFunc(r.LESS);break;case Jh:r.depthFunc(r.LEQUAL);break;case Ab:r.depthFunc(r.EQUAL);break;case gb:r.depthFunc(r.GEQUAL);break;case mb:r.depthFunc(r.GREATER);break;case vb:r.depthFunc(r.NOTEQUAL);break;default:r.depthFunc(r.LEQUAL)}ve=Pe}},setLocked:function(Pe){O=Pe},setClear:function(Pe){Fe!==Pe&&(r.clearDepth(Pe),Fe=Pe)},reset:function(){O=!1,ge=null,ve=null,Fe=null}}}function n(){let O=!1,ge=null,ve=null,Fe=null,Pe=null,vt=null,Lt=null,Nt=null,Bt=null;return{setTest:function(_t){O||(_t?Ae(r.STENCIL_TEST):_e(r.STENCIL_TEST))},setMask:function(_t){ge!==_t&&!O&&(r.stencilMask(_t),ge=_t)},setFunc:function(_t,fr,Vt){(ve!==_t||Fe!==fr||Pe!==Vt)&&(r.stencilFunc(_t,fr,Vt),ve=_t,Fe=fr,Pe=Vt)},setOp:function(_t,fr,Vt){(vt!==_t||Lt!==fr||Nt!==Vt)&&(r.stencilOp(_t,fr,Vt),vt=_t,Lt=fr,Nt=Vt)},setLocked:function(_t){O=_t},setClear:function(_t){Bt!==_t&&(r.clearStencil(_t),Bt=_t)},reset:function(){O=!1,ge=null,ve=null,Fe=null,Pe=null,vt=null,Lt=null,Nt=null,Bt=null}}}const i=new e,s=new t,o=new n,l=new WeakMap,h=new WeakMap;let u={},d={},A=new WeakMap,p=[],g=null,_=!1,E=null,m=null,v=null,w=null,x=null,I=null,R=null,S=new Ve(0,0,0),T=0,D=!1,b=null,M=null,L=null,P=null,N=null;const W=r.getParameter(r.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let X=!1,K=0;const te=r.getParameter(r.VERSION);te.indexOf("WebGL")!==-1?(K=parseFloat(/^WebGL (\d)/.exec(te)[1]),X=K>=1):te.indexOf("OpenGL ES")!==-1&&(K=parseFloat(/^OpenGL ES (\d)/.exec(te)[1]),X=K>=2);let V=null,ee={};const Q=r.getParameter(r.SCISSOR_BOX),z=r.getParameter(r.VIEWPORT),Z=new Ft().fromArray(Q),re=new Ft().fromArray(z);function j(O,ge,ve,Fe){const Pe=new Uint8Array(4),vt=r.createTexture();r.bindTexture(O,vt),r.texParameteri(O,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(O,r.TEXTURE_MAG_FILTER,r.NEAREST);for(let Lt=0;Lt<ve;Lt++)O===r.TEXTURE_3D||O===r.TEXTURE_2D_ARRAY?r.texImage3D(ge,0,r.RGBA,1,1,Fe,0,r.RGBA,r.UNSIGNED_BYTE,Pe):r.texImage2D(ge+Lt,0,r.RGBA,1,1,0,r.RGBA,r.UNSIGNED_BYTE,Pe);return vt}const de={};de[r.TEXTURE_2D]=j(r.TEXTURE_2D,r.TEXTURE_2D,1),de[r.TEXTURE_CUBE_MAP]=j(r.TEXTURE_CUBE_MAP,r.TEXTURE_CUBE_MAP_POSITIVE_X,6),de[r.TEXTURE_2D_ARRAY]=j(r.TEXTURE_2D_ARRAY,r.TEXTURE_2D_ARRAY,1,1),de[r.TEXTURE_3D]=j(r.TEXTURE_3D,r.TEXTURE_3D,1,1),i.setClear(0,0,0,1),s.setClear(1),o.setClear(0),Ae(r.DEPTH_TEST),s.setFunc(Jh),Ke(!1),pt(Xy),Ae(r.CULL_FACE),Qe(gs);function Ae(O){u[O]!==!0&&(r.enable(O),u[O]=!0)}function _e(O){u[O]!==!1&&(r.disable(O),u[O]=!1)}function Ee(O,ge){return d[O]!==ge?(r.bindFramebuffer(O,ge),d[O]=ge,O===r.DRAW_FRAMEBUFFER&&(d[r.FRAMEBUFFER]=ge),O===r.FRAMEBUFFER&&(d[r.DRAW_FRAMEBUFFER]=ge),!0):!1}function Le(O,ge){let ve=p,Fe=!1;if(O){ve=A.get(ge),ve===void 0&&(ve=[],A.set(ge,ve));const Pe=O.textures;if(ve.length!==Pe.length||ve[0]!==r.COLOR_ATTACHMENT0){for(let vt=0,Lt=Pe.length;vt<Lt;vt++)ve[vt]=r.COLOR_ATTACHMENT0+vt;ve.length=Pe.length,Fe=!0}}else ve[0]!==r.BACK&&(ve[0]=r.BACK,Fe=!0);Fe&&r.drawBuffers(ve)}function st(O){return g!==O?(r.useProgram(O),g=O,!0):!1}const se={[no]:r.FUNC_ADD,[XB]:r.FUNC_SUBTRACT,[KB]:r.FUNC_REVERSE_SUBTRACT};se[JB]=r.MIN,se[ZB]=r.MAX;const et={[$B]:r.ZERO,[eb]:r.ONE,[tb]:r.SRC_COLOR,[gA]:r.SRC_ALPHA,[ob]:r.SRC_ALPHA_SATURATE,[sb]:r.DST_COLOR,[nb]:r.DST_ALPHA,[rb]:r.ONE_MINUS_SRC_COLOR,[mA]:r.ONE_MINUS_SRC_ALPHA,[ab]:r.ONE_MINUS_DST_COLOR,[ib]:r.ONE_MINUS_DST_ALPHA,[lb]:r.CONSTANT_COLOR,[cb]:r.ONE_MINUS_CONSTANT_COLOR,[ub]:r.CONSTANT_ALPHA,[hb]:r.ONE_MINUS_CONSTANT_ALPHA};function Qe(O,ge,ve,Fe,Pe,vt,Lt,Nt,Bt,_t){if(O===gs){_===!0&&(_e(r.BLEND),_=!1);return}if(_===!1&&(Ae(r.BLEND),_=!0),O!==qB){if(O!==E||_t!==D){if((m!==no||x!==no)&&(r.blendEquation(r.FUNC_ADD),m=no,x=no),_t)switch(O){case sl:r.blendFuncSeparate(r.ONE,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA);break;case AA:r.blendFunc(r.ONE,r.ONE);break;case Jy:r.blendFuncSeparate(r.ZERO,r.ONE_MINUS_SRC_COLOR,r.ZERO,r.ONE);break;case Zy:r.blendFuncSeparate(r.ZERO,r.SRC_COLOR,r.ZERO,r.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",O);break}else switch(O){case sl:r.blendFuncSeparate(r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA);break;case AA:r.blendFunc(r.SRC_ALPHA,r.ONE);break;case Jy:r.blendFuncSeparate(r.ZERO,r.ONE_MINUS_SRC_COLOR,r.ZERO,r.ONE);break;case Zy:r.blendFunc(r.ZERO,r.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",O);break}v=null,w=null,I=null,R=null,S.set(0,0,0),T=0,E=O,D=_t}return}Pe=Pe||ge,vt=vt||ve,Lt=Lt||Fe,(ge!==m||Pe!==x)&&(r.blendEquationSeparate(se[ge],se[Pe]),m=ge,x=Pe),(ve!==v||Fe!==w||vt!==I||Lt!==R)&&(r.blendFuncSeparate(et[ve],et[Fe],et[vt],et[Lt]),v=ve,w=Fe,I=vt,R=Lt),(Nt.equals(S)===!1||Bt!==T)&&(r.blendColor(Nt.r,Nt.g,Nt.b,Bt),S.copy(Nt),T=Bt),E=O,D=!1}function ct(O,ge){O.side===wi?_e(r.CULL_FACE):Ae(r.CULL_FACE);let ve=O.side===Qr;ge&&(ve=!ve),Ke(ve),O.blending===sl&&O.transparent===!1?Qe(gs):Qe(O.blending,O.blendEquation,O.blendSrc,O.blendDst,O.blendEquationAlpha,O.blendSrcAlpha,O.blendDstAlpha,O.blendColor,O.blendAlpha,O.premultipliedAlpha),s.setFunc(O.depthFunc),s.setTest(O.depthTest),s.setMask(O.depthWrite),i.setMask(O.colorWrite);const Fe=O.stencilWrite;o.setTest(Fe),Fe&&(o.setMask(O.stencilWriteMask),o.setFunc(O.stencilFunc,O.stencilRef,O.stencilFuncMask),o.setOp(O.stencilFail,O.stencilZFail,O.stencilZPass)),k(O.polygonOffset,O.polygonOffsetFactor,O.polygonOffsetUnits),O.alphaToCoverage===!0?Ae(r.SAMPLE_ALPHA_TO_COVERAGE):_e(r.SAMPLE_ALPHA_TO_COVERAGE)}function Ke(O){b!==O&&(O?r.frontFace(r.CW):r.frontFace(r.CCW),b=O)}function pt(O){O!==jB?(Ae(r.CULL_FACE),O!==M&&(O===Xy?r.cullFace(r.BACK):O===WB?r.cullFace(r.FRONT):r.cullFace(r.FRONT_AND_BACK))):_e(r.CULL_FACE),M=O}function Y(O){O!==L&&(X&&r.lineWidth(O),L=O)}function k(O,ge,ve){O?(Ae(r.POLYGON_OFFSET_FILL),(P!==ge||N!==ve)&&(r.polygonOffset(ge,ve),P=ge,N=ve)):_e(r.POLYGON_OFFSET_FILL)}function le(O){O?Ae(r.SCISSOR_TEST):_e(r.SCISSOR_TEST)}function pe(O){O===void 0&&(O=r.TEXTURE0+W-1),V!==O&&(r.activeTexture(O),V=O)}function me(O,ge,ve){ve===void 0&&(V===null?ve=r.TEXTURE0+W-1:ve=V);let Fe=ee[ve];Fe===void 0&&(Fe={type:void 0,texture:void 0},ee[ve]=Fe),(Fe.type!==O||Fe.texture!==ge)&&(V!==ve&&(r.activeTexture(ve),V=ve),r.bindTexture(O,ge||de[O]),Fe.type=O,Fe.texture=ge)}function ye(){const O=ee[V];O!==void 0&&O.type!==void 0&&(r.bindTexture(O.type,null),O.type=void 0,O.texture=void 0)}function He(){try{r.compressedTexImage2D.apply(r,arguments)}catch(O){console.error("THREE.WebGLState:",O)}}function Ie(){try{r.compressedTexImage3D.apply(r,arguments)}catch(O){console.error("THREE.WebGLState:",O)}}function je(){try{r.texSubImage2D.apply(r,arguments)}catch(O){console.error("THREE.WebGLState:",O)}}function Ge(){try{r.texSubImage3D.apply(r,arguments)}catch(O){console.error("THREE.WebGLState:",O)}}function Me(){try{r.compressedTexSubImage2D.apply(r,arguments)}catch(O){console.error("THREE.WebGLState:",O)}}function fe(){try{r.compressedTexSubImage3D.apply(r,arguments)}catch(O){console.error("THREE.WebGLState:",O)}}function De(){try{r.texStorage2D.apply(r,arguments)}catch(O){console.error("THREE.WebGLState:",O)}}function Be(){try{r.texStorage3D.apply(r,arguments)}catch(O){console.error("THREE.WebGLState:",O)}}function be(){try{r.texImage2D.apply(r,arguments)}catch(O){console.error("THREE.WebGLState:",O)}}function nt(){try{r.texImage3D.apply(r,arguments)}catch(O){console.error("THREE.WebGLState:",O)}}function lt(O){Z.equals(O)===!1&&(r.scissor(O.x,O.y,O.z,O.w),Z.copy(O))}function dt(O){re.equals(O)===!1&&(r.viewport(O.x,O.y,O.z,O.w),re.copy(O))}function ut(O,ge){let ve=h.get(ge);ve===void 0&&(ve=new WeakMap,h.set(ge,ve));let Fe=ve.get(O);Fe===void 0&&(Fe=r.getUniformBlockIndex(ge,O.name),ve.set(O,Fe))}function ht(O,ge){const ve=h.get(ge).get(O);l.get(ge)!==ve&&(r.uniformBlockBinding(ge,ve,O.__bindingPointIndex),l.set(ge,ve))}function H(){r.disable(r.BLEND),r.disable(r.CULL_FACE),r.disable(r.DEPTH_TEST),r.disable(r.POLYGON_OFFSET_FILL),r.disable(r.SCISSOR_TEST),r.disable(r.STENCIL_TEST),r.disable(r.SAMPLE_ALPHA_TO_COVERAGE),r.blendEquation(r.FUNC_ADD),r.blendFunc(r.ONE,r.ZERO),r.blendFuncSeparate(r.ONE,r.ZERO,r.ONE,r.ZERO),r.blendColor(0,0,0,0),r.colorMask(!0,!0,!0,!0),r.clearColor(0,0,0,0),r.depthMask(!0),r.depthFunc(r.LESS),r.clearDepth(1),r.stencilMask(4294967295),r.stencilFunc(r.ALWAYS,0,4294967295),r.stencilOp(r.KEEP,r.KEEP,r.KEEP),r.clearStencil(0),r.cullFace(r.BACK),r.frontFace(r.CCW),r.polygonOffset(0,0),r.activeTexture(r.TEXTURE0),r.bindFramebuffer(r.FRAMEBUFFER,null),r.bindFramebuffer(r.DRAW_FRAMEBUFFER,null),r.bindFramebuffer(r.READ_FRAMEBUFFER,null),r.useProgram(null),r.lineWidth(1),r.scissor(0,0,r.canvas.width,r.canvas.height),r.viewport(0,0,r.canvas.width,r.canvas.height),u={},V=null,ee={},d={},A=new WeakMap,p=[],g=null,_=!1,E=null,m=null,v=null,w=null,x=null,I=null,R=null,S=new Ve(0,0,0),T=0,D=!1,b=null,M=null,L=null,P=null,N=null,Z.set(0,0,r.canvas.width,r.canvas.height),re.set(0,0,r.canvas.width,r.canvas.height),i.reset(),s.reset(),o.reset()}return{buffers:{color:i,depth:s,stencil:o},enable:Ae,disable:_e,bindFramebuffer:Ee,drawBuffers:Le,useProgram:st,setBlending:Qe,setMaterial:ct,setFlipSided:Ke,setCullFace:pt,setLineWidth:Y,setPolygonOffset:k,setScissorTest:le,activeTexture:pe,bindTexture:me,unbindTexture:ye,compressedTexImage2D:He,compressedTexImage3D:Ie,texImage2D:be,texImage3D:nt,updateUBOMapping:ut,uniformBlockBinding:ht,texStorage2D:De,texStorage3D:Be,texSubImage2D:je,texSubImage3D:Ge,compressedTexSubImage2D:Me,compressedTexSubImage3D:fe,scissor:lt,viewport:dt,reset:H}}function t8(r,e,t,n,i,s,o){const l=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,h=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),u=new Ue,d=new WeakMap;let A;const p=new WeakMap;let g=!1;try{g=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function _(Y,k){return g?new OffscreenCanvas(Y,k):du("canvas")}function E(Y,k,le){let pe=1;const me=pt(Y);if((me.width>le||me.height>le)&&(pe=le/Math.max(me.width,me.height)),pe<1)if(typeof HTMLImageElement<"u"&&Y instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&Y instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&Y instanceof ImageBitmap||typeof VideoFrame<"u"&&Y instanceof VideoFrame){const ye=Math.floor(pe*me.width),He=Math.floor(pe*me.height);A===void 0&&(A=_(ye,He));const Ie=k?_(ye,He):A;return Ie.width=ye,Ie.height=He,Ie.getContext("2d").drawImage(Y,0,0,ye,He),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+me.width+"x"+me.height+") to ("+ye+"x"+He+")."),Ie}else return"data"in Y&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+me.width+"x"+me.height+")."),Y;return Y}function m(Y){return Y.generateMipmaps&&Y.minFilter!==Ar&&Y.minFilter!==gr}function v(Y){r.generateMipmap(Y)}function w(Y,k,le,pe,me=!1){if(Y!==null){if(r[Y]!==void 0)return r[Y];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+Y+"'")}let ye=k;if(k===r.RED&&(le===r.FLOAT&&(ye=r.R32F),le===r.HALF_FLOAT&&(ye=r.R16F),le===r.UNSIGNED_BYTE&&(ye=r.R8)),k===r.RED_INTEGER&&(le===r.UNSIGNED_BYTE&&(ye=r.R8UI),le===r.UNSIGNED_SHORT&&(ye=r.R16UI),le===r.UNSIGNED_INT&&(ye=r.R32UI),le===r.BYTE&&(ye=r.R8I),le===r.SHORT&&(ye=r.R16I),le===r.INT&&(ye=r.R32I)),k===r.RG&&(le===r.FLOAT&&(ye=r.RG32F),le===r.HALF_FLOAT&&(ye=r.RG16F),le===r.UNSIGNED_BYTE&&(ye=r.RG8)),k===r.RG_INTEGER&&(le===r.UNSIGNED_BYTE&&(ye=r.RG8UI),le===r.UNSIGNED_SHORT&&(ye=r.RG16UI),le===r.UNSIGNED_INT&&(ye=r.RG32UI),le===r.BYTE&&(ye=r.RG8I),le===r.SHORT&&(ye=r.RG16I),le===r.INT&&(ye=r.RG32I)),k===r.RGB&&le===r.UNSIGNED_INT_5_9_9_9_REV&&(ye=r.RGB9_E5),k===r.RGBA){const He=me?od:Tt.getTransfer(pe);le===r.FLOAT&&(ye=r.RGBA32F),le===r.HALF_FLOAT&&(ye=r.RGBA16F),le===r.UNSIGNED_BYTE&&(ye=He===Ht?r.SRGB8_ALPHA8:r.RGBA8),le===r.UNSIGNED_SHORT_4_4_4_4&&(ye=r.RGBA4),le===r.UNSIGNED_SHORT_5_5_5_1&&(ye=r.RGB5_A1)}return(ye===r.R16F||ye===r.R32F||ye===r.RG16F||ye===r.RG32F||ye===r.RGBA16F||ye===r.RGBA32F)&&e.get("EXT_color_buffer_float"),ye}function x(Y,k){return m(Y)===!0||Y.isFramebufferTexture&&Y.minFilter!==Ar&&Y.minFilter!==gr?Math.log2(Math.max(k.width,k.height))+1:Y.mipmaps!==void 0&&Y.mipmaps.length>0?Y.mipmaps.length:Y.isCompressedTexture&&Array.isArray(Y.image)?k.mipmaps.length:1}function I(Y){const k=Y.target;k.removeEventListener("dispose",I),S(k),k.isVideoTexture&&d.delete(k)}function R(Y){const k=Y.target;k.removeEventListener("dispose",R),D(k)}function S(Y){const k=n.get(Y);if(k.__webglInit===void 0)return;const le=Y.source,pe=p.get(le);if(pe){const me=pe[k.__cacheKey];me.usedTimes--,me.usedTimes===0&&T(Y),Object.keys(pe).length===0&&p.delete(le)}n.remove(Y)}function T(Y){const k=n.get(Y);r.deleteTexture(k.__webglTexture);const le=Y.source,pe=p.get(le);delete pe[k.__cacheKey],o.memory.textures--}function D(Y){const k=n.get(Y);if(Y.depthTexture&&Y.depthTexture.dispose(),Y.isWebGLCubeRenderTarget)for(let pe=0;pe<6;pe++){if(Array.isArray(k.__webglFramebuffer[pe]))for(let me=0;me<k.__webglFramebuffer[pe].length;me++)r.deleteFramebuffer(k.__webglFramebuffer[pe][me]);else r.deleteFramebuffer(k.__webglFramebuffer[pe]);k.__webglDepthbuffer&&r.deleteRenderbuffer(k.__webglDepthbuffer[pe])}else{if(Array.isArray(k.__webglFramebuffer))for(let pe=0;pe<k.__webglFramebuffer.length;pe++)r.deleteFramebuffer(k.__webglFramebuffer[pe]);else r.deleteFramebuffer(k.__webglFramebuffer);if(k.__webglDepthbuffer&&r.deleteRenderbuffer(k.__webglDepthbuffer),k.__webglMultisampledFramebuffer&&r.deleteFramebuffer(k.__webglMultisampledFramebuffer),k.__webglColorRenderbuffer)for(let pe=0;pe<k.__webglColorRenderbuffer.length;pe++)k.__webglColorRenderbuffer[pe]&&r.deleteRenderbuffer(k.__webglColorRenderbuffer[pe]);k.__webglDepthRenderbuffer&&r.deleteRenderbuffer(k.__webglDepthRenderbuffer)}const le=Y.textures;for(let pe=0,me=le.length;pe<me;pe++){const ye=n.get(le[pe]);ye.__webglTexture&&(r.deleteTexture(ye.__webglTexture),o.memory.textures--),n.remove(le[pe])}n.remove(Y)}let b=0;function M(){b=0}function L(){const Y=b;return Y>=i.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+Y+" texture units while this GPU supports only "+i.maxTextures),b+=1,Y}function P(Y){const k=[];return k.push(Y.wrapS),k.push(Y.wrapT),k.push(Y.wrapR||0),k.push(Y.magFilter),k.push(Y.minFilter),k.push(Y.anisotropy),k.push(Y.internalFormat),k.push(Y.format),k.push(Y.type),k.push(Y.generateMipmaps),k.push(Y.premultiplyAlpha),k.push(Y.flipY),k.push(Y.unpackAlignment),k.push(Y.colorSpace),k.join()}function N(Y,k){const le=n.get(Y);if(Y.isVideoTexture&&ct(Y),Y.isRenderTargetTexture===!1&&Y.version>0&&le.__version!==Y.version){const pe=Y.image;if(pe===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(pe.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{Z(le,Y,k);return}}t.bindTexture(r.TEXTURE_2D,le.__webglTexture,r.TEXTURE0+k)}function W(Y,k){const le=n.get(Y);if(Y.version>0&&le.__version!==Y.version){Z(le,Y,k);return}t.bindTexture(r.TEXTURE_2D_ARRAY,le.__webglTexture,r.TEXTURE0+k)}function X(Y,k){const le=n.get(Y);if(Y.version>0&&le.__version!==Y.version){Z(le,Y,k);return}t.bindTexture(r.TEXTURE_3D,le.__webglTexture,r.TEXTURE0+k)}function K(Y,k){const le=n.get(Y);if(Y.version>0&&le.__version!==Y.version){re(le,Y,k);return}t.bindTexture(r.TEXTURE_CUBE_MAP,le.__webglTexture,r.TEXTURE0+k)}const te={[$s]:r.REPEAT,[Ii]:r.CLAMP_TO_EDGE,[$h]:r.MIRRORED_REPEAT},V={[Ar]:r.NEAREST,[oE]:r.NEAREST_MIPMAP_NEAREST,[nu]:r.NEAREST_MIPMAP_LINEAR,[gr]:r.LINEAR,[ed]:r.LINEAR_MIPMAP_NEAREST,[Ci]:r.LINEAR_MIPMAP_LINEAR},ee={[Ub]:r.NEVER,[zb]:r.ALWAYS,[Pb]:r.LESS,[PE]:r.LEQUAL,[kb]:r.EQUAL,[Fb]:r.GEQUAL,[Qb]:r.GREATER,[Ob]:r.NOTEQUAL};function Q(Y,k){if(k.type===lr&&e.has("OES_texture_float_linear")===!1&&(k.magFilter===gr||k.magFilter===ed||k.magFilter===nu||k.magFilter===Ci||k.minFilter===gr||k.minFilter===ed||k.minFilter===nu||k.minFilter===Ci)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),r.texParameteri(Y,r.TEXTURE_WRAP_S,te[k.wrapS]),r.texParameteri(Y,r.TEXTURE_WRAP_T,te[k.wrapT]),(Y===r.TEXTURE_3D||Y===r.TEXTURE_2D_ARRAY)&&r.texParameteri(Y,r.TEXTURE_WRAP_R,te[k.wrapR]),r.texParameteri(Y,r.TEXTURE_MAG_FILTER,V[k.magFilter]),r.texParameteri(Y,r.TEXTURE_MIN_FILTER,V[k.minFilter]),k.compareFunction&&(r.texParameteri(Y,r.TEXTURE_COMPARE_MODE,r.COMPARE_REF_TO_TEXTURE),r.texParameteri(Y,r.TEXTURE_COMPARE_FUNC,ee[k.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(k.magFilter===Ar||k.minFilter!==nu&&k.minFilter!==Ci||k.type===lr&&e.has("OES_texture_float_linear")===!1)return;if(k.anisotropy>1||n.get(k).__currentAnisotropy){const le=e.get("EXT_texture_filter_anisotropic");r.texParameterf(Y,le.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(k.anisotropy,i.getMaxAnisotropy())),n.get(k).__currentAnisotropy=k.anisotropy}}}function z(Y,k){let le=!1;Y.__webglInit===void 0&&(Y.__webglInit=!0,k.addEventListener("dispose",I));const pe=k.source;let me=p.get(pe);me===void 0&&(me={},p.set(pe,me));const ye=P(k);if(ye!==Y.__cacheKey){me[ye]===void 0&&(me[ye]={texture:r.createTexture(),usedTimes:0},o.memory.textures++,le=!0),me[ye].usedTimes++;const He=me[Y.__cacheKey];He!==void 0&&(me[Y.__cacheKey].usedTimes--,He.usedTimes===0&&T(k)),Y.__cacheKey=ye,Y.__webglTexture=me[ye].texture}return le}function Z(Y,k,le){let pe=r.TEXTURE_2D;(k.isDataArrayTexture||k.isCompressedArrayTexture)&&(pe=r.TEXTURE_2D_ARRAY),k.isData3DTexture&&(pe=r.TEXTURE_3D);const me=z(Y,k),ye=k.source;t.bindTexture(pe,Y.__webglTexture,r.TEXTURE0+le);const He=n.get(ye);if(ye.version!==He.__version||me===!0){t.activeTexture(r.TEXTURE0+le);const Ie=Tt.getPrimaries(Tt.workingColorSpace),je=k.colorSpace===ms?null:Tt.getPrimaries(k.colorSpace),Ge=k.colorSpace===ms||Ie===je?r.NONE:r.BROWSER_DEFAULT_WEBGL;r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,k.flipY),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,k.premultiplyAlpha),r.pixelStorei(r.UNPACK_ALIGNMENT,k.unpackAlignment),r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,Ge);let Me=E(k.image,!1,i.maxTextureSize);Me=Ke(k,Me);const fe=s.convert(k.format,k.colorSpace),De=s.convert(k.type);let Be=w(k.internalFormat,fe,De,k.colorSpace,k.isVideoTexture);Q(pe,k);let be;const nt=k.mipmaps,lt=k.isVideoTexture!==!0&&Be!==SA,dt=He.__version===void 0||me===!0,ut=ye.dataReady,ht=x(k,Me);if(k.isDepthTexture)Be=r.DEPTH_COMPONENT16,k.type===lr?Be=r.DEPTH_COMPONENT32F:k.type===Mi?Be=r.DEPTH_COMPONENT24:k.type===su&&(Be=r.DEPTH24_STENCIL8),dt&&(lt?t.texStorage2D(r.TEXTURE_2D,1,Be,Me.width,Me.height):t.texImage2D(r.TEXTURE_2D,0,Be,Me.width,Me.height,0,fe,De,null));else if(k.isDataTexture)if(nt.length>0){lt&&dt&&t.texStorage2D(r.TEXTURE_2D,ht,Be,nt[0].width,nt[0].height);for(let H=0,O=nt.length;H<O;H++)be=nt[H],lt?ut&&t.texSubImage2D(r.TEXTURE_2D,H,0,0,be.width,be.height,fe,De,be.data):t.texImage2D(r.TEXTURE_2D,H,Be,be.width,be.height,0,fe,De,be.data);k.generateMipmaps=!1}else lt?(dt&&t.texStorage2D(r.TEXTURE_2D,ht,Be,Me.width,Me.height),ut&&t.texSubImage2D(r.TEXTURE_2D,0,0,0,Me.width,Me.height,fe,De,Me.data)):t.texImage2D(r.TEXTURE_2D,0,Be,Me.width,Me.height,0,fe,De,Me.data);else if(k.isCompressedTexture)if(k.isCompressedArrayTexture){lt&&dt&&t.texStorage3D(r.TEXTURE_2D_ARRAY,ht,Be,nt[0].width,nt[0].height,Me.depth);for(let H=0,O=nt.length;H<O;H++)be=nt[H],k.format!==vr?fe!==null?lt?ut&&t.compressedTexSubImage3D(r.TEXTURE_2D_ARRAY,H,0,0,0,be.width,be.height,Me.depth,fe,be.data,0,0):t.compressedTexImage3D(r.TEXTURE_2D_ARRAY,H,Be,be.width,be.height,Me.depth,0,be.data,0,0):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):lt?ut&&t.texSubImage3D(r.TEXTURE_2D_ARRAY,H,0,0,0,be.width,be.height,Me.depth,fe,De,be.data):t.texImage3D(r.TEXTURE_2D_ARRAY,H,Be,be.width,be.height,Me.depth,0,fe,De,be.data)}else{lt&&dt&&t.texStorage2D(r.TEXTURE_2D,ht,Be,nt[0].width,nt[0].height);for(let H=0,O=nt.length;H<O;H++)be=nt[H],k.format!==vr?fe!==null?lt?ut&&t.compressedTexSubImage2D(r.TEXTURE_2D,H,0,0,be.width,be.height,fe,be.data):t.compressedTexImage2D(r.TEXTURE_2D,H,Be,be.width,be.height,0,be.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):lt?ut&&t.texSubImage2D(r.TEXTURE_2D,H,0,0,be.width,be.height,fe,De,be.data):t.texImage2D(r.TEXTURE_2D,H,Be,be.width,be.height,0,fe,De,be.data)}else if(k.isDataArrayTexture)lt?(dt&&t.texStorage3D(r.TEXTURE_2D_ARRAY,ht,Be,Me.width,Me.height,Me.depth),ut&&t.texSubImage3D(r.TEXTURE_2D_ARRAY,0,0,0,0,Me.width,Me.height,Me.depth,fe,De,Me.data)):t.texImage3D(r.TEXTURE_2D_ARRAY,0,Be,Me.width,Me.height,Me.depth,0,fe,De,Me.data);else if(k.isData3DTexture)lt?(dt&&t.texStorage3D(r.TEXTURE_3D,ht,Be,Me.width,Me.height,Me.depth),ut&&t.texSubImage3D(r.TEXTURE_3D,0,0,0,0,Me.width,Me.height,Me.depth,fe,De,Me.data)):t.texImage3D(r.TEXTURE_3D,0,Be,Me.width,Me.height,Me.depth,0,fe,De,Me.data);else if(k.isFramebufferTexture){if(dt)if(lt)t.texStorage2D(r.TEXTURE_2D,ht,Be,Me.width,Me.height);else{let H=Me.width,O=Me.height;for(let ge=0;ge<ht;ge++)t.texImage2D(r.TEXTURE_2D,ge,Be,H,O,0,fe,De,null),H>>=1,O>>=1}}else if(nt.length>0){if(lt&&dt){const H=pt(nt[0]);t.texStorage2D(r.TEXTURE_2D,ht,Be,H.width,H.height)}for(let H=0,O=nt.length;H<O;H++)be=nt[H],lt?ut&&t.texSubImage2D(r.TEXTURE_2D,H,0,0,fe,De,be):t.texImage2D(r.TEXTURE_2D,H,Be,fe,De,be);k.generateMipmaps=!1}else if(lt){if(dt){const H=pt(Me);t.texStorage2D(r.TEXTURE_2D,ht,Be,H.width,H.height)}ut&&t.texSubImage2D(r.TEXTURE_2D,0,0,0,fe,De,Me)}else t.texImage2D(r.TEXTURE_2D,0,Be,fe,De,Me);m(k)&&v(pe),He.__version=ye.version,k.onUpdate&&k.onUpdate(k)}Y.__version=k.version}function re(Y,k,le){if(k.image.length!==6)return;const pe=z(Y,k),me=k.source;t.bindTexture(r.TEXTURE_CUBE_MAP,Y.__webglTexture,r.TEXTURE0+le);const ye=n.get(me);if(me.version!==ye.__version||pe===!0){t.activeTexture(r.TEXTURE0+le);const He=Tt.getPrimaries(Tt.workingColorSpace),Ie=k.colorSpace===ms?null:Tt.getPrimaries(k.colorSpace),je=k.colorSpace===ms||He===Ie?r.NONE:r.BROWSER_DEFAULT_WEBGL;r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,k.flipY),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,k.premultiplyAlpha),r.pixelStorei(r.UNPACK_ALIGNMENT,k.unpackAlignment),r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,je);const Ge=k.isCompressedTexture||k.image[0].isCompressedTexture,Me=k.image[0]&&k.image[0].isDataTexture,fe=[];for(let O=0;O<6;O++)!Ge&&!Me?fe[O]=E(k.image[O],!0,i.maxCubemapSize):fe[O]=Me?k.image[O].image:k.image[O],fe[O]=Ke(k,fe[O]);const De=fe[0],Be=s.convert(k.format,k.colorSpace),be=s.convert(k.type),nt=w(k.internalFormat,Be,be,k.colorSpace),lt=k.isVideoTexture!==!0,dt=ye.__version===void 0||pe===!0,ut=me.dataReady;let ht=x(k,De);Q(r.TEXTURE_CUBE_MAP,k);let H;if(Ge){lt&&dt&&t.texStorage2D(r.TEXTURE_CUBE_MAP,ht,nt,De.width,De.height);for(let O=0;O<6;O++){H=fe[O].mipmaps;for(let ge=0;ge<H.length;ge++){const ve=H[ge];k.format!==vr?Be!==null?lt?ut&&t.compressedTexSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+O,ge,0,0,ve.width,ve.height,Be,ve.data):t.compressedTexImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+O,ge,nt,ve.width,ve.height,0,ve.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):lt?ut&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+O,ge,0,0,ve.width,ve.height,Be,be,ve.data):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+O,ge,nt,ve.width,ve.height,0,Be,be,ve.data)}}}else{if(H=k.mipmaps,lt&&dt){H.length>0&&ht++;const O=pt(fe[0]);t.texStorage2D(r.TEXTURE_CUBE_MAP,ht,nt,O.width,O.height)}for(let O=0;O<6;O++)if(Me){lt?ut&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+O,0,0,0,fe[O].width,fe[O].height,Be,be,fe[O].data):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+O,0,nt,fe[O].width,fe[O].height,0,Be,be,fe[O].data);for(let ge=0;ge<H.length;ge++){const ve=H[ge].image[O].image;lt?ut&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+O,ge+1,0,0,ve.width,ve.height,Be,be,ve.data):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+O,ge+1,nt,ve.width,ve.height,0,Be,be,ve.data)}}else{lt?ut&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+O,0,0,0,Be,be,fe[O]):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+O,0,nt,Be,be,fe[O]);for(let ge=0;ge<H.length;ge++){const ve=H[ge];lt?ut&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+O,ge+1,0,0,Be,be,ve.image[O]):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+O,ge+1,nt,Be,be,ve.image[O])}}}m(k)&&v(r.TEXTURE_CUBE_MAP),ye.__version=me.version,k.onUpdate&&k.onUpdate(k)}Y.__version=k.version}function j(Y,k,le,pe,me,ye){const He=s.convert(le.format,le.colorSpace),Ie=s.convert(le.type),je=w(le.internalFormat,He,Ie,le.colorSpace);if(!n.get(k).__hasExternalTextures){const Ge=Math.max(1,k.width>>ye),Me=Math.max(1,k.height>>ye);me===r.TEXTURE_3D||me===r.TEXTURE_2D_ARRAY?t.texImage3D(me,ye,je,Ge,Me,k.depth,0,He,Ie,null):t.texImage2D(me,ye,je,Ge,Me,0,He,Ie,null)}t.bindFramebuffer(r.FRAMEBUFFER,Y),Qe(k)?l.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,pe,me,n.get(le).__webglTexture,0,et(k)):(me===r.TEXTURE_2D||me>=r.TEXTURE_CUBE_MAP_POSITIVE_X&&me<=r.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&r.framebufferTexture2D(r.FRAMEBUFFER,pe,me,n.get(le).__webglTexture,ye),t.bindFramebuffer(r.FRAMEBUFFER,null)}function de(Y,k,le){if(r.bindRenderbuffer(r.RENDERBUFFER,Y),k.depthBuffer&&!k.stencilBuffer){let pe=r.DEPTH_COMPONENT24;if(le||Qe(k)){const me=k.depthTexture;me&&me.isDepthTexture&&(me.type===lr?pe=r.DEPTH_COMPONENT32F:me.type===Mi&&(pe=r.DEPTH_COMPONENT24));const ye=et(k);Qe(k)?l.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,ye,pe,k.width,k.height):r.renderbufferStorageMultisample(r.RENDERBUFFER,ye,pe,k.width,k.height)}else r.renderbufferStorage(r.RENDERBUFFER,pe,k.width,k.height);r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.RENDERBUFFER,Y)}else if(k.depthBuffer&&k.stencilBuffer){const pe=et(k);le&&Qe(k)===!1?r.renderbufferStorageMultisample(r.RENDERBUFFER,pe,r.DEPTH24_STENCIL8,k.width,k.height):Qe(k)?l.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,pe,r.DEPTH24_STENCIL8,k.width,k.height):r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,k.width,k.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,Y)}else{const pe=k.textures;for(let me=0;me<pe.length;me++){const ye=pe[me],He=s.convert(ye.format,ye.colorSpace),Ie=s.convert(ye.type),je=w(ye.internalFormat,He,Ie,ye.colorSpace),Ge=et(k);le&&Qe(k)===!1?r.renderbufferStorageMultisample(r.RENDERBUFFER,Ge,je,k.width,k.height):Qe(k)?l.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,Ge,je,k.width,k.height):r.renderbufferStorage(r.RENDERBUFFER,je,k.width,k.height)}}r.bindRenderbuffer(r.RENDERBUFFER,null)}function Ae(Y,k){if(k&&k.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(r.FRAMEBUFFER,Y),!(k.depthTexture&&k.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");(!n.get(k.depthTexture).__webglTexture||k.depthTexture.image.width!==k.width||k.depthTexture.image.height!==k.height)&&(k.depthTexture.image.width=k.width,k.depthTexture.image.height=k.height,k.depthTexture.needsUpdate=!0),N(k.depthTexture,0);const le=n.get(k.depthTexture).__webglTexture,pe=et(k);if(k.depthTexture.format===ol)Qe(k)?l.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,le,0,pe):r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,le,0);else if(k.depthTexture.format===au)Qe(k)?l.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.TEXTURE_2D,le,0,pe):r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.TEXTURE_2D,le,0);else throw new Error("Unknown depthTexture format")}function _e(Y){const k=n.get(Y),le=Y.isWebGLCubeRenderTarget===!0;if(Y.depthTexture&&!k.__autoAllocateDepthBuffer){if(le)throw new Error("target.depthTexture not supported in Cube render targets");Ae(k.__webglFramebuffer,Y)}else if(le){k.__webglDepthbuffer=[];for(let pe=0;pe<6;pe++)t.bindFramebuffer(r.FRAMEBUFFER,k.__webglFramebuffer[pe]),k.__webglDepthbuffer[pe]=r.createRenderbuffer(),de(k.__webglDepthbuffer[pe],Y,!1)}else t.bindFramebuffer(r.FRAMEBUFFER,k.__webglFramebuffer),k.__webglDepthbuffer=r.createRenderbuffer(),de(k.__webglDepthbuffer,Y,!1);t.bindFramebuffer(r.FRAMEBUFFER,null)}function Ee(Y,k,le){const pe=n.get(Y);k!==void 0&&j(pe.__webglFramebuffer,Y,Y.texture,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,0),le!==void 0&&_e(Y)}function Le(Y){const k=Y.texture,le=n.get(Y),pe=n.get(k);Y.addEventListener("dispose",R);const me=Y.textures,ye=Y.isWebGLCubeRenderTarget===!0,He=me.length>1;if(He||(pe.__webglTexture===void 0&&(pe.__webglTexture=r.createTexture()),pe.__version=k.version,o.memory.textures++),ye){le.__webglFramebuffer=[];for(let Ie=0;Ie<6;Ie++)if(k.mipmaps&&k.mipmaps.length>0){le.__webglFramebuffer[Ie]=[];for(let je=0;je<k.mipmaps.length;je++)le.__webglFramebuffer[Ie][je]=r.createFramebuffer()}else le.__webglFramebuffer[Ie]=r.createFramebuffer()}else{if(k.mipmaps&&k.mipmaps.length>0){le.__webglFramebuffer=[];for(let Ie=0;Ie<k.mipmaps.length;Ie++)le.__webglFramebuffer[Ie]=r.createFramebuffer()}else le.__webglFramebuffer=r.createFramebuffer();if(He)for(let Ie=0,je=me.length;Ie<je;Ie++){const Ge=n.get(me[Ie]);Ge.__webglTexture===void 0&&(Ge.__webglTexture=r.createTexture(),o.memory.textures++)}if(Y.samples>0&&Qe(Y)===!1){le.__webglMultisampledFramebuffer=r.createFramebuffer(),le.__webglColorRenderbuffer=[],t.bindFramebuffer(r.FRAMEBUFFER,le.__webglMultisampledFramebuffer);for(let Ie=0;Ie<me.length;Ie++){const je=me[Ie];le.__webglColorRenderbuffer[Ie]=r.createRenderbuffer(),r.bindRenderbuffer(r.RENDERBUFFER,le.__webglColorRenderbuffer[Ie]);const Ge=s.convert(je.format,je.colorSpace),Me=s.convert(je.type),fe=w(je.internalFormat,Ge,Me,je.colorSpace,Y.isXRRenderTarget===!0),De=et(Y);r.renderbufferStorageMultisample(r.RENDERBUFFER,De,fe,Y.width,Y.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+Ie,r.RENDERBUFFER,le.__webglColorRenderbuffer[Ie])}r.bindRenderbuffer(r.RENDERBUFFER,null),Y.depthBuffer&&(le.__webglDepthRenderbuffer=r.createRenderbuffer(),de(le.__webglDepthRenderbuffer,Y,!0)),t.bindFramebuffer(r.FRAMEBUFFER,null)}}if(ye){t.bindTexture(r.TEXTURE_CUBE_MAP,pe.__webglTexture),Q(r.TEXTURE_CUBE_MAP,k);for(let Ie=0;Ie<6;Ie++)if(k.mipmaps&&k.mipmaps.length>0)for(let je=0;je<k.mipmaps.length;je++)j(le.__webglFramebuffer[Ie][je],Y,k,r.COLOR_ATTACHMENT0,r.TEXTURE_CUBE_MAP_POSITIVE_X+Ie,je);else j(le.__webglFramebuffer[Ie],Y,k,r.COLOR_ATTACHMENT0,r.TEXTURE_CUBE_MAP_POSITIVE_X+Ie,0);m(k)&&v(r.TEXTURE_CUBE_MAP),t.unbindTexture()}else if(He){for(let Ie=0,je=me.length;Ie<je;Ie++){const Ge=me[Ie],Me=n.get(Ge);t.bindTexture(r.TEXTURE_2D,Me.__webglTexture),Q(r.TEXTURE_2D,Ge),j(le.__webglFramebuffer,Y,Ge,r.COLOR_ATTACHMENT0+Ie,r.TEXTURE_2D,0),m(Ge)&&v(r.TEXTURE_2D)}t.unbindTexture()}else{let Ie=r.TEXTURE_2D;if((Y.isWebGL3DRenderTarget||Y.isWebGLArrayRenderTarget)&&(Ie=Y.isWebGL3DRenderTarget?r.TEXTURE_3D:r.TEXTURE_2D_ARRAY),t.bindTexture(Ie,pe.__webglTexture),Q(Ie,k),k.mipmaps&&k.mipmaps.length>0)for(let je=0;je<k.mipmaps.length;je++)j(le.__webglFramebuffer[je],Y,k,r.COLOR_ATTACHMENT0,Ie,je);else j(le.__webglFramebuffer,Y,k,r.COLOR_ATTACHMENT0,Ie,0);m(k)&&v(Ie),t.unbindTexture()}Y.depthBuffer&&_e(Y)}function st(Y){const k=Y.textures;for(let le=0,pe=k.length;le<pe;le++){const me=k[le];if(m(me)){const ye=Y.isWebGLCubeRenderTarget?r.TEXTURE_CUBE_MAP:r.TEXTURE_2D,He=n.get(me).__webglTexture;t.bindTexture(ye,He),v(ye),t.unbindTexture()}}}function se(Y){if(Y.samples>0&&Qe(Y)===!1){const k=Y.textures,le=Y.width,pe=Y.height;let me=r.COLOR_BUFFER_BIT;const ye=[],He=Y.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,Ie=n.get(Y),je=k.length>1;if(je)for(let Ge=0;Ge<k.length;Ge++)t.bindFramebuffer(r.FRAMEBUFFER,Ie.__webglMultisampledFramebuffer),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+Ge,r.RENDERBUFFER,null),t.bindFramebuffer(r.FRAMEBUFFER,Ie.__webglFramebuffer),r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0+Ge,r.TEXTURE_2D,null,0);t.bindFramebuffer(r.READ_FRAMEBUFFER,Ie.__webglMultisampledFramebuffer),t.bindFramebuffer(r.DRAW_FRAMEBUFFER,Ie.__webglFramebuffer);for(let Ge=0;Ge<k.length;Ge++){ye.push(r.COLOR_ATTACHMENT0+Ge),Y.depthBuffer&&ye.push(He);const Me=Ie.__ignoreDepthValues!==void 0?Ie.__ignoreDepthValues:!1;if(Me===!1&&(Y.depthBuffer&&(me|=r.DEPTH_BUFFER_BIT),Y.stencilBuffer&&Ie.__isTransmissionRenderTarget!==!0&&(me|=r.STENCIL_BUFFER_BIT)),je&&r.framebufferRenderbuffer(r.READ_FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.RENDERBUFFER,Ie.__webglColorRenderbuffer[Ge]),Me===!0&&(r.invalidateFramebuffer(r.READ_FRAMEBUFFER,[He]),r.invalidateFramebuffer(r.DRAW_FRAMEBUFFER,[He])),je){const fe=n.get(k[Ge]).__webglTexture;r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,fe,0)}r.blitFramebuffer(0,0,le,pe,0,0,le,pe,me,r.NEAREST),h&&r.invalidateFramebuffer(r.READ_FRAMEBUFFER,ye)}if(t.bindFramebuffer(r.READ_FRAMEBUFFER,null),t.bindFramebuffer(r.DRAW_FRAMEBUFFER,null),je)for(let Ge=0;Ge<k.length;Ge++){t.bindFramebuffer(r.FRAMEBUFFER,Ie.__webglMultisampledFramebuffer),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+Ge,r.RENDERBUFFER,Ie.__webglColorRenderbuffer[Ge]);const Me=n.get(k[Ge]).__webglTexture;t.bindFramebuffer(r.FRAMEBUFFER,Ie.__webglFramebuffer),r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0+Ge,r.TEXTURE_2D,Me,0)}t.bindFramebuffer(r.DRAW_FRAMEBUFFER,Ie.__webglMultisampledFramebuffer)}}function et(Y){return Math.min(i.maxSamples,Y.samples)}function Qe(Y){const k=n.get(Y);return Y.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&k.__useRenderToTexture!==!1}function ct(Y){const k=o.render.frame;d.get(Y)!==k&&(d.set(Y,k),Y.update())}function Ke(Y,k){const le=Y.colorSpace,pe=Y.format,me=Y.type;return Y.isCompressedTexture===!0||Y.isVideoTexture===!0||le!==cr&&le!==ms&&(Tt.getTransfer(le)===Ht?(pe!==vr||me!==mr)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",le)),k}function pt(Y){return typeof HTMLImageElement<"u"&&Y instanceof HTMLImageElement?(u.width=Y.naturalWidth||Y.width,u.height=Y.naturalHeight||Y.height):typeof VideoFrame<"u"&&Y instanceof VideoFrame?(u.width=Y.displayWidth,u.height=Y.displayHeight):(u.width=Y.width,u.height=Y.height),u}this.allocateTextureUnit=L,this.resetTextureUnits=M,this.setTexture2D=N,this.setTexture2DArray=W,this.setTexture3D=X,this.setTextureCube=K,this.rebindTextures=Ee,this.setupRenderTarget=Le,this.updateRenderTargetMipmap=st,this.updateMultisampleRenderTarget=se,this.setupDepthRenderbuffer=_e,this.setupFrameBufferTexture=j,this.useMultisampledRTT=Qe}function r8(r,e){function t(n,i=ms){let s;const o=Tt.getTransfer(i);if(n===mr)return r.UNSIGNED_BYTE;if(n===cE)return r.UNSIGNED_SHORT_4_4_4_4;if(n===uE)return r.UNSIGNED_SHORT_5_5_5_1;if(n===Ib)return r.UNSIGNED_INT_5_9_9_9_REV;if(n===yA)return r.BYTE;if(n===lE)return r.SHORT;if(n===EA)return r.UNSIGNED_SHORT;if(n===iu)return r.INT;if(n===Mi)return r.UNSIGNED_INT;if(n===lr)return r.FLOAT;if(n===Or)return r.HALF_FLOAT;if(n===Cb)return r.ALPHA;if(n===Mb)return r.RGB;if(n===vr)return r.RGBA;if(n===Sb)return r.LUMINANCE;if(n===Tb)return r.LUMINANCE_ALPHA;if(n===ol)return r.DEPTH_COMPONENT;if(n===au)return r.DEPTH_STENCIL;if(n===ea)return r.RED;if(n===xA)return r.RED_INTEGER;if(n===so)return r.RG;if(n===td)return r.RG_INTEGER;if(n===ou)return r.RGBA_INTEGER;if(n===rd||n===wA||n===IA||n===nd)if(o===Ht)if(s=e.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(n===rd)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===wA)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===IA)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===nd)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=e.get("WEBGL_compressed_texture_s3tc"),s!==null){if(n===rd)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===wA)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===IA)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===nd)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(n===CA||n===hE||n===MA||n===dE)if(s=e.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(n===CA)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===hE)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===MA)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===dE)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(n===SA)return s=e.get("WEBGL_compressed_texture_etc1"),s!==null?s.COMPRESSED_RGB_ETC1_WEBGL:null;if(n===TA||n===BA)if(s=e.get("WEBGL_compressed_texture_etc"),s!==null){if(n===TA)return o===Ht?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(n===BA)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(n===bA||n===fE||n===pE||n===AE||n===id||n===gE||n===mE||n===vE||n===_E||n===yE||n===EE||n===xE||n===wE||n===IE)if(s=e.get("WEBGL_compressed_texture_astc"),s!==null){if(n===bA)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===fE)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===pE)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===AE)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===id)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===gE)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===mE)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===vE)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===_E)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===yE)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===EE)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===xE)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===wE)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===IE)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(n===sd||n===CE||n===ME)if(s=e.get("EXT_texture_compression_bptc"),s!==null){if(n===sd)return o===Ht?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===CE)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===ME)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(n===Bb||n===SE||n===TE||n===BE)if(s=e.get("EXT_texture_compression_rgtc"),s!==null){if(n===sd)return s.COMPRESSED_RED_RGTC1_EXT;if(n===SE)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===TE)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===BE)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return n===su?r.UNSIGNED_INT_24_8:r[n]!==void 0?r[n]:null}return{convert:t}}class n8 extends dn{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class oa extends Zt{constructor(){super(),this.isGroup=!0,this.type="Group"}}const i8={type:"move"};class cg{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new oa,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new oa,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new G,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new G),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new oa,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new G,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new G),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const n of e.hand.values())this._getHandJoint(t,n)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,n){let i=null,s=null,o=null;const l=this._targetRay,h=this._grip,u=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(u&&e.hand){o=!0;for(const E of e.hand.values()){const m=t.getJointPose(E,n),v=this._getHandJoint(u,E);m!==null&&(v.matrix.fromArray(m.transform.matrix),v.matrix.decompose(v.position,v.rotation,v.scale),v.matrixWorldNeedsUpdate=!0,v.jointRadius=m.radius),v.visible=m!==null}const d=u.joints["index-finger-tip"],A=u.joints["thumb-tip"],p=d.position.distanceTo(A.position),g=.02,_=.005;u.inputState.pinching&&p>g+_?(u.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!u.inputState.pinching&&p<=g-_&&(u.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else h!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,n),s!==null&&(h.matrix.fromArray(s.transform.matrix),h.matrix.decompose(h.position,h.rotation,h.scale),h.matrixWorldNeedsUpdate=!0,s.linearVelocity?(h.hasLinearVelocity=!0,h.linearVelocity.copy(s.linearVelocity)):h.hasLinearVelocity=!1,s.angularVelocity?(h.hasAngularVelocity=!0,h.angularVelocity.copy(s.angularVelocity)):h.hasAngularVelocity=!1));l!==null&&(i=t.getPose(e.targetRaySpace,n),i===null&&s!==null&&(i=s),i!==null&&(l.matrix.fromArray(i.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,i.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(i.linearVelocity)):l.hasLinearVelocity=!1,i.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(i.angularVelocity)):l.hasAngularVelocity=!1,this.dispatchEvent(i8)))}return l!==null&&(l.visible=i!==null),h!==null&&(h.visible=s!==null),u!==null&&(u.visible=o!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const n=new oa;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}}const s8=`
3804
+ }`;function $L(r,e,t){let n=new $A;const i=new Ue,s=new Ue,o=new Ft,l=new V2({depthPacking:Lb}),h=new KL,u={},d=t.maxTextureSize,A={[xi]:Qr,[Qr]:xi,[wi]:wi},p=new Cr({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Ue},radius:{value:4}},vertexShader:JL,fragmentShader:ZL}),g=p.clone();g.defines.HORIZONTAL_PASS=1;const _=new Vn;_.setAttribute("position",new zr(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const E=new Xr(_,p),m=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Ky;let v=this.type;this.render=function(S,T,D){if(m.enabled===!1||m.autoUpdate===!1&&m.needsUpdate===!1||S.length===0)return;const b=r.getRenderTarget(),M=r.getActiveCubeFace(),L=r.getActiveMipmapLevel(),P=r.state;P.setBlending(gs),P.buffers.color.setClear(1,1,1,1),P.buffers.depth.setTest(!0),P.setScissorTest(!1);const N=v!==As&&this.type===As,W=v===As&&this.type!==As;for(let X=0,K=S.length;X<K;X++){const te=S[X],V=te.shadow;if(V===void 0){console.warn("THREE.WebGLShadowMap:",te,"has no shadow.");continue}if(V.autoUpdate===!1&&V.needsUpdate===!1)continue;i.copy(V.mapSize);const ee=V.getFrameExtents();if(i.multiply(ee),s.copy(V.mapSize),(i.x>d||i.y>d)&&(i.x>d&&(s.x=Math.floor(d/ee.x),i.x=s.x*ee.x,V.mapSize.x=s.x),i.y>d&&(s.y=Math.floor(d/ee.y),i.y=s.y*ee.y,V.mapSize.y=s.y)),V.map===null||N===!0||W===!0){const z=this.type!==As?{minFilter:Ar,magFilter:Ar}:{};V.map!==null&&V.map.dispose(),V.map=new cn(i.x,i.y,z),V.map.texture.name=te.name+".shadowMap",V.camera.updateProjectionMatrix()}r.setRenderTarget(V.map),r.clear();const Q=V.getViewportCount();for(let z=0;z<Q;z++){const Z=V.getViewport(z);o.set(s.x*Z.x,s.y*Z.y,s.x*Z.z,s.y*Z.w),P.viewport(o),V.updateMatrices(te,z),n=V.getFrustum(),I(T,D,V.camera,te,this.type)}V.isPointLightShadow!==!0&&this.type===As&&w(V,D),V.needsUpdate=!1}v=this.type,m.needsUpdate=!1,r.setRenderTarget(b,M,L)};function w(S,T){const D=e.update(E);p.defines.VSM_SAMPLES!==S.blurSamples&&(p.defines.VSM_SAMPLES=S.blurSamples,g.defines.VSM_SAMPLES=S.blurSamples,p.needsUpdate=!0,g.needsUpdate=!0),S.mapPass===null&&(S.mapPass=new cn(i.x,i.y)),p.uniforms.shadow_pass.value=S.map.texture,p.uniforms.resolution.value=S.mapSize,p.uniforms.radius.value=S.radius,r.setRenderTarget(S.mapPass),r.clear(),r.renderBufferDirect(T,null,D,p,E,null),g.uniforms.shadow_pass.value=S.mapPass.texture,g.uniforms.resolution.value=S.mapSize,g.uniforms.radius.value=S.radius,r.setRenderTarget(S.map),r.clear(),r.renderBufferDirect(T,null,D,g,E,null)}function x(S,T,D,b){let M=null;const L=D.isPointLight===!0?S.customDistanceMaterial:S.customDepthMaterial;if(L!==void 0)M=L;else if(M=D.isPointLight===!0?h:l,r.localClippingEnabled&&T.clipShadows===!0&&Array.isArray(T.clippingPlanes)&&T.clippingPlanes.length!==0||T.displacementMap&&T.displacementScale!==0||T.alphaMap&&T.alphaTest>0||T.map&&T.alphaTest>0){const P=M.uuid,N=T.uuid;let W=u[P];W===void 0&&(W={},u[P]=W);let X=W[N];X===void 0&&(X=M.clone(),W[N]=X,T.addEventListener("dispose",R)),M=X}if(M.visible=T.visible,M.wireframe=T.wireframe,b===As?M.side=T.shadowSide!==null?T.shadowSide:T.side:M.side=T.shadowSide!==null?T.shadowSide:A[T.side],M.alphaMap=T.alphaMap,M.alphaTest=T.alphaTest,M.map=T.map,M.clipShadows=T.clipShadows,M.clippingPlanes=T.clippingPlanes,M.clipIntersection=T.clipIntersection,M.displacementMap=T.displacementMap,M.displacementScale=T.displacementScale,M.displacementBias=T.displacementBias,M.wireframeLinewidth=T.wireframeLinewidth,M.linewidth=T.linewidth,D.isPointLight===!0&&M.isMeshDistanceMaterial===!0){const P=r.properties.get(M);P.light=D}return M}function I(S,T,D,b,M){if(S.visible===!1)return;if(S.layers.test(T.layers)&&(S.isMesh||S.isLine||S.isPoints)&&(S.castShadow||S.receiveShadow&&M===As)&&(!S.frustumCulled||n.intersectsObject(S))){S.modelViewMatrix.multiplyMatrices(D.matrixWorldInverse,S.matrixWorld);const P=e.update(S),N=S.material;if(Array.isArray(N)){const W=P.groups;for(let X=0,K=W.length;X<K;X++){const te=W[X],V=N[te.materialIndex];if(V&&V.visible){const ee=x(S,V,b,M);S.onBeforeShadow(r,S,T,D,P,ee,te),r.renderBufferDirect(D,null,P,ee,S,te),S.onAfterShadow(r,S,T,D,P,ee,te)}}}else if(N.visible){const W=x(S,N,b,M);S.onBeforeShadow(r,S,T,D,P,W,null),r.renderBufferDirect(D,null,P,W,S,null),S.onAfterShadow(r,S,T,D,P,W,null)}}const L=S.children;for(let P=0,N=L.length;P<N;P++)I(L[P],T,D,b,M)}function R(S){S.target.removeEventListener("dispose",R);for(const T in u){const D=u[T],b=S.target.uuid;b in D&&(D[b].dispose(),delete D[b])}}}function e8(r){function e(){let O=!1;const ge=new Ft;let ve=null;const Fe=new Ft(0,0,0,0);return{setMask:function(Pe){ve!==Pe&&!O&&(r.colorMask(Pe,Pe,Pe,Pe),ve=Pe)},setLocked:function(Pe){O=Pe},setClear:function(Pe,vt,Lt,Nt,Bt){Bt===!0&&(Pe*=Nt,vt*=Nt,Lt*=Nt),ge.set(Pe,vt,Lt,Nt),Fe.equals(ge)===!1&&(r.clearColor(Pe,vt,Lt,Nt),Fe.copy(ge))},reset:function(){O=!1,ve=null,Fe.set(-1,0,0,0)}}}function t(){let O=!1,ge=null,ve=null,Fe=null;return{setTest:function(Pe){Pe?Ae(r.DEPTH_TEST):_e(r.DEPTH_TEST)},setMask:function(Pe){ge!==Pe&&!O&&(r.depthMask(Pe),ge=Pe)},setFunc:function(Pe){if(ve!==Pe){switch(Pe){case db:r.depthFunc(r.NEVER);break;case fb:r.depthFunc(r.ALWAYS);break;case pb:r.depthFunc(r.LESS);break;case Jh:r.depthFunc(r.LEQUAL);break;case Ab:r.depthFunc(r.EQUAL);break;case gb:r.depthFunc(r.GEQUAL);break;case mb:r.depthFunc(r.GREATER);break;case vb:r.depthFunc(r.NOTEQUAL);break;default:r.depthFunc(r.LEQUAL)}ve=Pe}},setLocked:function(Pe){O=Pe},setClear:function(Pe){Fe!==Pe&&(r.clearDepth(Pe),Fe=Pe)},reset:function(){O=!1,ge=null,ve=null,Fe=null}}}function n(){let O=!1,ge=null,ve=null,Fe=null,Pe=null,vt=null,Lt=null,Nt=null,Bt=null;return{setTest:function(_t){O||(_t?Ae(r.STENCIL_TEST):_e(r.STENCIL_TEST))},setMask:function(_t){ge!==_t&&!O&&(r.stencilMask(_t),ge=_t)},setFunc:function(_t,fr,Vt){(ve!==_t||Fe!==fr||Pe!==Vt)&&(r.stencilFunc(_t,fr,Vt),ve=_t,Fe=fr,Pe=Vt)},setOp:function(_t,fr,Vt){(vt!==_t||Lt!==fr||Nt!==Vt)&&(r.stencilOp(_t,fr,Vt),vt=_t,Lt=fr,Nt=Vt)},setLocked:function(_t){O=_t},setClear:function(_t){Bt!==_t&&(r.clearStencil(_t),Bt=_t)},reset:function(){O=!1,ge=null,ve=null,Fe=null,Pe=null,vt=null,Lt=null,Nt=null,Bt=null}}}const i=new e,s=new t,o=new n,l=new WeakMap,h=new WeakMap;let u={},d={},A=new WeakMap,p=[],g=null,_=!1,E=null,m=null,v=null,w=null,x=null,I=null,R=null,S=new Ve(0,0,0),T=0,D=!1,b=null,M=null,L=null,P=null,N=null;const W=r.getParameter(r.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let X=!1,K=0;const te=r.getParameter(r.VERSION);te.indexOf("WebGL")!==-1?(K=parseFloat(/^WebGL (\d)/.exec(te)[1]),X=K>=1):te.indexOf("OpenGL ES")!==-1&&(K=parseFloat(/^OpenGL ES (\d)/.exec(te)[1]),X=K>=2);let V=null,ee={};const Q=r.getParameter(r.SCISSOR_BOX),z=r.getParameter(r.VIEWPORT),Z=new Ft().fromArray(Q),re=new Ft().fromArray(z);function j(O,ge,ve,Fe){const Pe=new Uint8Array(4),vt=r.createTexture();r.bindTexture(O,vt),r.texParameteri(O,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(O,r.TEXTURE_MAG_FILTER,r.NEAREST);for(let Lt=0;Lt<ve;Lt++)O===r.TEXTURE_3D||O===r.TEXTURE_2D_ARRAY?r.texImage3D(ge,0,r.RGBA,1,1,Fe,0,r.RGBA,r.UNSIGNED_BYTE,Pe):r.texImage2D(ge+Lt,0,r.RGBA,1,1,0,r.RGBA,r.UNSIGNED_BYTE,Pe);return vt}const de={};de[r.TEXTURE_2D]=j(r.TEXTURE_2D,r.TEXTURE_2D,1),de[r.TEXTURE_CUBE_MAP]=j(r.TEXTURE_CUBE_MAP,r.TEXTURE_CUBE_MAP_POSITIVE_X,6),de[r.TEXTURE_2D_ARRAY]=j(r.TEXTURE_2D_ARRAY,r.TEXTURE_2D_ARRAY,1,1),de[r.TEXTURE_3D]=j(r.TEXTURE_3D,r.TEXTURE_3D,1,1),i.setClear(0,0,0,1),s.setClear(1),o.setClear(0),Ae(r.DEPTH_TEST),s.setFunc(Jh),Ke(!1),pt(Xy),Ae(r.CULL_FACE),Qe(gs);function Ae(O){u[O]!==!0&&(r.enable(O),u[O]=!0)}function _e(O){u[O]!==!1&&(r.disable(O),u[O]=!1)}function Ee(O,ge){return d[O]!==ge?(r.bindFramebuffer(O,ge),d[O]=ge,O===r.DRAW_FRAMEBUFFER&&(d[r.FRAMEBUFFER]=ge),O===r.FRAMEBUFFER&&(d[r.DRAW_FRAMEBUFFER]=ge),!0):!1}function Le(O,ge){let ve=p,Fe=!1;if(O){ve=A.get(ge),ve===void 0&&(ve=[],A.set(ge,ve));const Pe=O.textures;if(ve.length!==Pe.length||ve[0]!==r.COLOR_ATTACHMENT0){for(let vt=0,Lt=Pe.length;vt<Lt;vt++)ve[vt]=r.COLOR_ATTACHMENT0+vt;ve.length=Pe.length,Fe=!0}}else ve[0]!==r.BACK&&(ve[0]=r.BACK,Fe=!0);Fe&&r.drawBuffers(ve)}function st(O){return g!==O?(r.useProgram(O),g=O,!0):!1}const se={[no]:r.FUNC_ADD,[XB]:r.FUNC_SUBTRACT,[KB]:r.FUNC_REVERSE_SUBTRACT};se[JB]=r.MIN,se[ZB]=r.MAX;const et={[$B]:r.ZERO,[eb]:r.ONE,[tb]:r.SRC_COLOR,[AA]:r.SRC_ALPHA,[ob]:r.SRC_ALPHA_SATURATE,[sb]:r.DST_COLOR,[nb]:r.DST_ALPHA,[rb]:r.ONE_MINUS_SRC_COLOR,[gA]:r.ONE_MINUS_SRC_ALPHA,[ab]:r.ONE_MINUS_DST_COLOR,[ib]:r.ONE_MINUS_DST_ALPHA,[lb]:r.CONSTANT_COLOR,[cb]:r.ONE_MINUS_CONSTANT_COLOR,[ub]:r.CONSTANT_ALPHA,[hb]:r.ONE_MINUS_CONSTANT_ALPHA};function Qe(O,ge,ve,Fe,Pe,vt,Lt,Nt,Bt,_t){if(O===gs){_===!0&&(_e(r.BLEND),_=!1);return}if(_===!1&&(Ae(r.BLEND),_=!0),O!==qB){if(O!==E||_t!==D){if((m!==no||x!==no)&&(r.blendEquation(r.FUNC_ADD),m=no,x=no),_t)switch(O){case sl:r.blendFuncSeparate(r.ONE,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA);break;case pA:r.blendFunc(r.ONE,r.ONE);break;case Jy:r.blendFuncSeparate(r.ZERO,r.ONE_MINUS_SRC_COLOR,r.ZERO,r.ONE);break;case Zy:r.blendFuncSeparate(r.ZERO,r.SRC_COLOR,r.ZERO,r.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",O);break}else switch(O){case sl:r.blendFuncSeparate(r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA);break;case pA:r.blendFunc(r.SRC_ALPHA,r.ONE);break;case Jy:r.blendFuncSeparate(r.ZERO,r.ONE_MINUS_SRC_COLOR,r.ZERO,r.ONE);break;case Zy:r.blendFunc(r.ZERO,r.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",O);break}v=null,w=null,I=null,R=null,S.set(0,0,0),T=0,E=O,D=_t}return}Pe=Pe||ge,vt=vt||ve,Lt=Lt||Fe,(ge!==m||Pe!==x)&&(r.blendEquationSeparate(se[ge],se[Pe]),m=ge,x=Pe),(ve!==v||Fe!==w||vt!==I||Lt!==R)&&(r.blendFuncSeparate(et[ve],et[Fe],et[vt],et[Lt]),v=ve,w=Fe,I=vt,R=Lt),(Nt.equals(S)===!1||Bt!==T)&&(r.blendColor(Nt.r,Nt.g,Nt.b,Bt),S.copy(Nt),T=Bt),E=O,D=!1}function ct(O,ge){O.side===wi?_e(r.CULL_FACE):Ae(r.CULL_FACE);let ve=O.side===Qr;ge&&(ve=!ve),Ke(ve),O.blending===sl&&O.transparent===!1?Qe(gs):Qe(O.blending,O.blendEquation,O.blendSrc,O.blendDst,O.blendEquationAlpha,O.blendSrcAlpha,O.blendDstAlpha,O.blendColor,O.blendAlpha,O.premultipliedAlpha),s.setFunc(O.depthFunc),s.setTest(O.depthTest),s.setMask(O.depthWrite),i.setMask(O.colorWrite);const Fe=O.stencilWrite;o.setTest(Fe),Fe&&(o.setMask(O.stencilWriteMask),o.setFunc(O.stencilFunc,O.stencilRef,O.stencilFuncMask),o.setOp(O.stencilFail,O.stencilZFail,O.stencilZPass)),k(O.polygonOffset,O.polygonOffsetFactor,O.polygonOffsetUnits),O.alphaToCoverage===!0?Ae(r.SAMPLE_ALPHA_TO_COVERAGE):_e(r.SAMPLE_ALPHA_TO_COVERAGE)}function Ke(O){b!==O&&(O?r.frontFace(r.CW):r.frontFace(r.CCW),b=O)}function pt(O){O!==jB?(Ae(r.CULL_FACE),O!==M&&(O===Xy?r.cullFace(r.BACK):O===WB?r.cullFace(r.FRONT):r.cullFace(r.FRONT_AND_BACK))):_e(r.CULL_FACE),M=O}function Y(O){O!==L&&(X&&r.lineWidth(O),L=O)}function k(O,ge,ve){O?(Ae(r.POLYGON_OFFSET_FILL),(P!==ge||N!==ve)&&(r.polygonOffset(ge,ve),P=ge,N=ve)):_e(r.POLYGON_OFFSET_FILL)}function le(O){O?Ae(r.SCISSOR_TEST):_e(r.SCISSOR_TEST)}function pe(O){O===void 0&&(O=r.TEXTURE0+W-1),V!==O&&(r.activeTexture(O),V=O)}function me(O,ge,ve){ve===void 0&&(V===null?ve=r.TEXTURE0+W-1:ve=V);let Fe=ee[ve];Fe===void 0&&(Fe={type:void 0,texture:void 0},ee[ve]=Fe),(Fe.type!==O||Fe.texture!==ge)&&(V!==ve&&(r.activeTexture(ve),V=ve),r.bindTexture(O,ge||de[O]),Fe.type=O,Fe.texture=ge)}function ye(){const O=ee[V];O!==void 0&&O.type!==void 0&&(r.bindTexture(O.type,null),O.type=void 0,O.texture=void 0)}function He(){try{r.compressedTexImage2D.apply(r,arguments)}catch(O){console.error("THREE.WebGLState:",O)}}function Ie(){try{r.compressedTexImage3D.apply(r,arguments)}catch(O){console.error("THREE.WebGLState:",O)}}function je(){try{r.texSubImage2D.apply(r,arguments)}catch(O){console.error("THREE.WebGLState:",O)}}function Ge(){try{r.texSubImage3D.apply(r,arguments)}catch(O){console.error("THREE.WebGLState:",O)}}function Me(){try{r.compressedTexSubImage2D.apply(r,arguments)}catch(O){console.error("THREE.WebGLState:",O)}}function fe(){try{r.compressedTexSubImage3D.apply(r,arguments)}catch(O){console.error("THREE.WebGLState:",O)}}function De(){try{r.texStorage2D.apply(r,arguments)}catch(O){console.error("THREE.WebGLState:",O)}}function Be(){try{r.texStorage3D.apply(r,arguments)}catch(O){console.error("THREE.WebGLState:",O)}}function be(){try{r.texImage2D.apply(r,arguments)}catch(O){console.error("THREE.WebGLState:",O)}}function nt(){try{r.texImage3D.apply(r,arguments)}catch(O){console.error("THREE.WebGLState:",O)}}function lt(O){Z.equals(O)===!1&&(r.scissor(O.x,O.y,O.z,O.w),Z.copy(O))}function dt(O){re.equals(O)===!1&&(r.viewport(O.x,O.y,O.z,O.w),re.copy(O))}function ut(O,ge){let ve=h.get(ge);ve===void 0&&(ve=new WeakMap,h.set(ge,ve));let Fe=ve.get(O);Fe===void 0&&(Fe=r.getUniformBlockIndex(ge,O.name),ve.set(O,Fe))}function ht(O,ge){const ve=h.get(ge).get(O);l.get(ge)!==ve&&(r.uniformBlockBinding(ge,ve,O.__bindingPointIndex),l.set(ge,ve))}function H(){r.disable(r.BLEND),r.disable(r.CULL_FACE),r.disable(r.DEPTH_TEST),r.disable(r.POLYGON_OFFSET_FILL),r.disable(r.SCISSOR_TEST),r.disable(r.STENCIL_TEST),r.disable(r.SAMPLE_ALPHA_TO_COVERAGE),r.blendEquation(r.FUNC_ADD),r.blendFunc(r.ONE,r.ZERO),r.blendFuncSeparate(r.ONE,r.ZERO,r.ONE,r.ZERO),r.blendColor(0,0,0,0),r.colorMask(!0,!0,!0,!0),r.clearColor(0,0,0,0),r.depthMask(!0),r.depthFunc(r.LESS),r.clearDepth(1),r.stencilMask(4294967295),r.stencilFunc(r.ALWAYS,0,4294967295),r.stencilOp(r.KEEP,r.KEEP,r.KEEP),r.clearStencil(0),r.cullFace(r.BACK),r.frontFace(r.CCW),r.polygonOffset(0,0),r.activeTexture(r.TEXTURE0),r.bindFramebuffer(r.FRAMEBUFFER,null),r.bindFramebuffer(r.DRAW_FRAMEBUFFER,null),r.bindFramebuffer(r.READ_FRAMEBUFFER,null),r.useProgram(null),r.lineWidth(1),r.scissor(0,0,r.canvas.width,r.canvas.height),r.viewport(0,0,r.canvas.width,r.canvas.height),u={},V=null,ee={},d={},A=new WeakMap,p=[],g=null,_=!1,E=null,m=null,v=null,w=null,x=null,I=null,R=null,S=new Ve(0,0,0),T=0,D=!1,b=null,M=null,L=null,P=null,N=null,Z.set(0,0,r.canvas.width,r.canvas.height),re.set(0,0,r.canvas.width,r.canvas.height),i.reset(),s.reset(),o.reset()}return{buffers:{color:i,depth:s,stencil:o},enable:Ae,disable:_e,bindFramebuffer:Ee,drawBuffers:Le,useProgram:st,setBlending:Qe,setMaterial:ct,setFlipSided:Ke,setCullFace:pt,setLineWidth:Y,setPolygonOffset:k,setScissorTest:le,activeTexture:pe,bindTexture:me,unbindTexture:ye,compressedTexImage2D:He,compressedTexImage3D:Ie,texImage2D:be,texImage3D:nt,updateUBOMapping:ut,uniformBlockBinding:ht,texStorage2D:De,texStorage3D:Be,texSubImage2D:je,texSubImage3D:Ge,compressedTexSubImage2D:Me,compressedTexSubImage3D:fe,scissor:lt,viewport:dt,reset:H}}function t8(r,e,t,n,i,s,o){const l=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,h=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),u=new Ue,d=new WeakMap;let A;const p=new WeakMap;let g=!1;try{g=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function _(Y,k){return g?new OffscreenCanvas(Y,k):du("canvas")}function E(Y,k,le){let pe=1;const me=pt(Y);if((me.width>le||me.height>le)&&(pe=le/Math.max(me.width,me.height)),pe<1)if(typeof HTMLImageElement<"u"&&Y instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&Y instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&Y instanceof ImageBitmap||typeof VideoFrame<"u"&&Y instanceof VideoFrame){const ye=Math.floor(pe*me.width),He=Math.floor(pe*me.height);A===void 0&&(A=_(ye,He));const Ie=k?_(ye,He):A;return Ie.width=ye,Ie.height=He,Ie.getContext("2d").drawImage(Y,0,0,ye,He),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+me.width+"x"+me.height+") to ("+ye+"x"+He+")."),Ie}else return"data"in Y&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+me.width+"x"+me.height+")."),Y;return Y}function m(Y){return Y.generateMipmaps&&Y.minFilter!==Ar&&Y.minFilter!==gr}function v(Y){r.generateMipmap(Y)}function w(Y,k,le,pe,me=!1){if(Y!==null){if(r[Y]!==void 0)return r[Y];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+Y+"'")}let ye=k;if(k===r.RED&&(le===r.FLOAT&&(ye=r.R32F),le===r.HALF_FLOAT&&(ye=r.R16F),le===r.UNSIGNED_BYTE&&(ye=r.R8)),k===r.RED_INTEGER&&(le===r.UNSIGNED_BYTE&&(ye=r.R8UI),le===r.UNSIGNED_SHORT&&(ye=r.R16UI),le===r.UNSIGNED_INT&&(ye=r.R32UI),le===r.BYTE&&(ye=r.R8I),le===r.SHORT&&(ye=r.R16I),le===r.INT&&(ye=r.R32I)),k===r.RG&&(le===r.FLOAT&&(ye=r.RG32F),le===r.HALF_FLOAT&&(ye=r.RG16F),le===r.UNSIGNED_BYTE&&(ye=r.RG8)),k===r.RG_INTEGER&&(le===r.UNSIGNED_BYTE&&(ye=r.RG8UI),le===r.UNSIGNED_SHORT&&(ye=r.RG16UI),le===r.UNSIGNED_INT&&(ye=r.RG32UI),le===r.BYTE&&(ye=r.RG8I),le===r.SHORT&&(ye=r.RG16I),le===r.INT&&(ye=r.RG32I)),k===r.RGB&&le===r.UNSIGNED_INT_5_9_9_9_REV&&(ye=r.RGB9_E5),k===r.RGBA){const He=me?od:Tt.getTransfer(pe);le===r.FLOAT&&(ye=r.RGBA32F),le===r.HALF_FLOAT&&(ye=r.RGBA16F),le===r.UNSIGNED_BYTE&&(ye=He===Ht?r.SRGB8_ALPHA8:r.RGBA8),le===r.UNSIGNED_SHORT_4_4_4_4&&(ye=r.RGBA4),le===r.UNSIGNED_SHORT_5_5_5_1&&(ye=r.RGB5_A1)}return(ye===r.R16F||ye===r.R32F||ye===r.RG16F||ye===r.RG32F||ye===r.RGBA16F||ye===r.RGBA32F)&&e.get("EXT_color_buffer_float"),ye}function x(Y,k){return m(Y)===!0||Y.isFramebufferTexture&&Y.minFilter!==Ar&&Y.minFilter!==gr?Math.log2(Math.max(k.width,k.height))+1:Y.mipmaps!==void 0&&Y.mipmaps.length>0?Y.mipmaps.length:Y.isCompressedTexture&&Array.isArray(Y.image)?k.mipmaps.length:1}function I(Y){const k=Y.target;k.removeEventListener("dispose",I),S(k),k.isVideoTexture&&d.delete(k)}function R(Y){const k=Y.target;k.removeEventListener("dispose",R),D(k)}function S(Y){const k=n.get(Y);if(k.__webglInit===void 0)return;const le=Y.source,pe=p.get(le);if(pe){const me=pe[k.__cacheKey];me.usedTimes--,me.usedTimes===0&&T(Y),Object.keys(pe).length===0&&p.delete(le)}n.remove(Y)}function T(Y){const k=n.get(Y);r.deleteTexture(k.__webglTexture);const le=Y.source,pe=p.get(le);delete pe[k.__cacheKey],o.memory.textures--}function D(Y){const k=n.get(Y);if(Y.depthTexture&&Y.depthTexture.dispose(),Y.isWebGLCubeRenderTarget)for(let pe=0;pe<6;pe++){if(Array.isArray(k.__webglFramebuffer[pe]))for(let me=0;me<k.__webglFramebuffer[pe].length;me++)r.deleteFramebuffer(k.__webglFramebuffer[pe][me]);else r.deleteFramebuffer(k.__webglFramebuffer[pe]);k.__webglDepthbuffer&&r.deleteRenderbuffer(k.__webglDepthbuffer[pe])}else{if(Array.isArray(k.__webglFramebuffer))for(let pe=0;pe<k.__webglFramebuffer.length;pe++)r.deleteFramebuffer(k.__webglFramebuffer[pe]);else r.deleteFramebuffer(k.__webglFramebuffer);if(k.__webglDepthbuffer&&r.deleteRenderbuffer(k.__webglDepthbuffer),k.__webglMultisampledFramebuffer&&r.deleteFramebuffer(k.__webglMultisampledFramebuffer),k.__webglColorRenderbuffer)for(let pe=0;pe<k.__webglColorRenderbuffer.length;pe++)k.__webglColorRenderbuffer[pe]&&r.deleteRenderbuffer(k.__webglColorRenderbuffer[pe]);k.__webglDepthRenderbuffer&&r.deleteRenderbuffer(k.__webglDepthRenderbuffer)}const le=Y.textures;for(let pe=0,me=le.length;pe<me;pe++){const ye=n.get(le[pe]);ye.__webglTexture&&(r.deleteTexture(ye.__webglTexture),o.memory.textures--),n.remove(le[pe])}n.remove(Y)}let b=0;function M(){b=0}function L(){const Y=b;return Y>=i.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+Y+" texture units while this GPU supports only "+i.maxTextures),b+=1,Y}function P(Y){const k=[];return k.push(Y.wrapS),k.push(Y.wrapT),k.push(Y.wrapR||0),k.push(Y.magFilter),k.push(Y.minFilter),k.push(Y.anisotropy),k.push(Y.internalFormat),k.push(Y.format),k.push(Y.type),k.push(Y.generateMipmaps),k.push(Y.premultiplyAlpha),k.push(Y.flipY),k.push(Y.unpackAlignment),k.push(Y.colorSpace),k.join()}function N(Y,k){const le=n.get(Y);if(Y.isVideoTexture&&ct(Y),Y.isRenderTargetTexture===!1&&Y.version>0&&le.__version!==Y.version){const pe=Y.image;if(pe===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(pe.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{Z(le,Y,k);return}}t.bindTexture(r.TEXTURE_2D,le.__webglTexture,r.TEXTURE0+k)}function W(Y,k){const le=n.get(Y);if(Y.version>0&&le.__version!==Y.version){Z(le,Y,k);return}t.bindTexture(r.TEXTURE_2D_ARRAY,le.__webglTexture,r.TEXTURE0+k)}function X(Y,k){const le=n.get(Y);if(Y.version>0&&le.__version!==Y.version){Z(le,Y,k);return}t.bindTexture(r.TEXTURE_3D,le.__webglTexture,r.TEXTURE0+k)}function K(Y,k){const le=n.get(Y);if(Y.version>0&&le.__version!==Y.version){re(le,Y,k);return}t.bindTexture(r.TEXTURE_CUBE_MAP,le.__webglTexture,r.TEXTURE0+k)}const te={[$s]:r.REPEAT,[Ii]:r.CLAMP_TO_EDGE,[$h]:r.MIRRORED_REPEAT},V={[Ar]:r.NEAREST,[oE]:r.NEAREST_MIPMAP_NEAREST,[nu]:r.NEAREST_MIPMAP_LINEAR,[gr]:r.LINEAR,[ed]:r.LINEAR_MIPMAP_NEAREST,[Ci]:r.LINEAR_MIPMAP_LINEAR},ee={[Ub]:r.NEVER,[zb]:r.ALWAYS,[Pb]:r.LESS,[PE]:r.LEQUAL,[kb]:r.EQUAL,[Fb]:r.GEQUAL,[Qb]:r.GREATER,[Ob]:r.NOTEQUAL};function Q(Y,k){if(k.type===lr&&e.has("OES_texture_float_linear")===!1&&(k.magFilter===gr||k.magFilter===ed||k.magFilter===nu||k.magFilter===Ci||k.minFilter===gr||k.minFilter===ed||k.minFilter===nu||k.minFilter===Ci)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),r.texParameteri(Y,r.TEXTURE_WRAP_S,te[k.wrapS]),r.texParameteri(Y,r.TEXTURE_WRAP_T,te[k.wrapT]),(Y===r.TEXTURE_3D||Y===r.TEXTURE_2D_ARRAY)&&r.texParameteri(Y,r.TEXTURE_WRAP_R,te[k.wrapR]),r.texParameteri(Y,r.TEXTURE_MAG_FILTER,V[k.magFilter]),r.texParameteri(Y,r.TEXTURE_MIN_FILTER,V[k.minFilter]),k.compareFunction&&(r.texParameteri(Y,r.TEXTURE_COMPARE_MODE,r.COMPARE_REF_TO_TEXTURE),r.texParameteri(Y,r.TEXTURE_COMPARE_FUNC,ee[k.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(k.magFilter===Ar||k.minFilter!==nu&&k.minFilter!==Ci||k.type===lr&&e.has("OES_texture_float_linear")===!1)return;if(k.anisotropy>1||n.get(k).__currentAnisotropy){const le=e.get("EXT_texture_filter_anisotropic");r.texParameterf(Y,le.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(k.anisotropy,i.getMaxAnisotropy())),n.get(k).__currentAnisotropy=k.anisotropy}}}function z(Y,k){let le=!1;Y.__webglInit===void 0&&(Y.__webglInit=!0,k.addEventListener("dispose",I));const pe=k.source;let me=p.get(pe);me===void 0&&(me={},p.set(pe,me));const ye=P(k);if(ye!==Y.__cacheKey){me[ye]===void 0&&(me[ye]={texture:r.createTexture(),usedTimes:0},o.memory.textures++,le=!0),me[ye].usedTimes++;const He=me[Y.__cacheKey];He!==void 0&&(me[Y.__cacheKey].usedTimes--,He.usedTimes===0&&T(k)),Y.__cacheKey=ye,Y.__webglTexture=me[ye].texture}return le}function Z(Y,k,le){let pe=r.TEXTURE_2D;(k.isDataArrayTexture||k.isCompressedArrayTexture)&&(pe=r.TEXTURE_2D_ARRAY),k.isData3DTexture&&(pe=r.TEXTURE_3D);const me=z(Y,k),ye=k.source;t.bindTexture(pe,Y.__webglTexture,r.TEXTURE0+le);const He=n.get(ye);if(ye.version!==He.__version||me===!0){t.activeTexture(r.TEXTURE0+le);const Ie=Tt.getPrimaries(Tt.workingColorSpace),je=k.colorSpace===ms?null:Tt.getPrimaries(k.colorSpace),Ge=k.colorSpace===ms||Ie===je?r.NONE:r.BROWSER_DEFAULT_WEBGL;r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,k.flipY),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,k.premultiplyAlpha),r.pixelStorei(r.UNPACK_ALIGNMENT,k.unpackAlignment),r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,Ge);let Me=E(k.image,!1,i.maxTextureSize);Me=Ke(k,Me);const fe=s.convert(k.format,k.colorSpace),De=s.convert(k.type);let Be=w(k.internalFormat,fe,De,k.colorSpace,k.isVideoTexture);Q(pe,k);let be;const nt=k.mipmaps,lt=k.isVideoTexture!==!0&&Be!==MA,dt=He.__version===void 0||me===!0,ut=ye.dataReady,ht=x(k,Me);if(k.isDepthTexture)Be=r.DEPTH_COMPONENT16,k.type===lr?Be=r.DEPTH_COMPONENT32F:k.type===Mi?Be=r.DEPTH_COMPONENT24:k.type===su&&(Be=r.DEPTH24_STENCIL8),dt&&(lt?t.texStorage2D(r.TEXTURE_2D,1,Be,Me.width,Me.height):t.texImage2D(r.TEXTURE_2D,0,Be,Me.width,Me.height,0,fe,De,null));else if(k.isDataTexture)if(nt.length>0){lt&&dt&&t.texStorage2D(r.TEXTURE_2D,ht,Be,nt[0].width,nt[0].height);for(let H=0,O=nt.length;H<O;H++)be=nt[H],lt?ut&&t.texSubImage2D(r.TEXTURE_2D,H,0,0,be.width,be.height,fe,De,be.data):t.texImage2D(r.TEXTURE_2D,H,Be,be.width,be.height,0,fe,De,be.data);k.generateMipmaps=!1}else lt?(dt&&t.texStorage2D(r.TEXTURE_2D,ht,Be,Me.width,Me.height),ut&&t.texSubImage2D(r.TEXTURE_2D,0,0,0,Me.width,Me.height,fe,De,Me.data)):t.texImage2D(r.TEXTURE_2D,0,Be,Me.width,Me.height,0,fe,De,Me.data);else if(k.isCompressedTexture)if(k.isCompressedArrayTexture){lt&&dt&&t.texStorage3D(r.TEXTURE_2D_ARRAY,ht,Be,nt[0].width,nt[0].height,Me.depth);for(let H=0,O=nt.length;H<O;H++)be=nt[H],k.format!==vr?fe!==null?lt?ut&&t.compressedTexSubImage3D(r.TEXTURE_2D_ARRAY,H,0,0,0,be.width,be.height,Me.depth,fe,be.data,0,0):t.compressedTexImage3D(r.TEXTURE_2D_ARRAY,H,Be,be.width,be.height,Me.depth,0,be.data,0,0):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):lt?ut&&t.texSubImage3D(r.TEXTURE_2D_ARRAY,H,0,0,0,be.width,be.height,Me.depth,fe,De,be.data):t.texImage3D(r.TEXTURE_2D_ARRAY,H,Be,be.width,be.height,Me.depth,0,fe,De,be.data)}else{lt&&dt&&t.texStorage2D(r.TEXTURE_2D,ht,Be,nt[0].width,nt[0].height);for(let H=0,O=nt.length;H<O;H++)be=nt[H],k.format!==vr?fe!==null?lt?ut&&t.compressedTexSubImage2D(r.TEXTURE_2D,H,0,0,be.width,be.height,fe,be.data):t.compressedTexImage2D(r.TEXTURE_2D,H,Be,be.width,be.height,0,be.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):lt?ut&&t.texSubImage2D(r.TEXTURE_2D,H,0,0,be.width,be.height,fe,De,be.data):t.texImage2D(r.TEXTURE_2D,H,Be,be.width,be.height,0,fe,De,be.data)}else if(k.isDataArrayTexture)lt?(dt&&t.texStorage3D(r.TEXTURE_2D_ARRAY,ht,Be,Me.width,Me.height,Me.depth),ut&&t.texSubImage3D(r.TEXTURE_2D_ARRAY,0,0,0,0,Me.width,Me.height,Me.depth,fe,De,Me.data)):t.texImage3D(r.TEXTURE_2D_ARRAY,0,Be,Me.width,Me.height,Me.depth,0,fe,De,Me.data);else if(k.isData3DTexture)lt?(dt&&t.texStorage3D(r.TEXTURE_3D,ht,Be,Me.width,Me.height,Me.depth),ut&&t.texSubImage3D(r.TEXTURE_3D,0,0,0,0,Me.width,Me.height,Me.depth,fe,De,Me.data)):t.texImage3D(r.TEXTURE_3D,0,Be,Me.width,Me.height,Me.depth,0,fe,De,Me.data);else if(k.isFramebufferTexture){if(dt)if(lt)t.texStorage2D(r.TEXTURE_2D,ht,Be,Me.width,Me.height);else{let H=Me.width,O=Me.height;for(let ge=0;ge<ht;ge++)t.texImage2D(r.TEXTURE_2D,ge,Be,H,O,0,fe,De,null),H>>=1,O>>=1}}else if(nt.length>0){if(lt&&dt){const H=pt(nt[0]);t.texStorage2D(r.TEXTURE_2D,ht,Be,H.width,H.height)}for(let H=0,O=nt.length;H<O;H++)be=nt[H],lt?ut&&t.texSubImage2D(r.TEXTURE_2D,H,0,0,fe,De,be):t.texImage2D(r.TEXTURE_2D,H,Be,fe,De,be);k.generateMipmaps=!1}else if(lt){if(dt){const H=pt(Me);t.texStorage2D(r.TEXTURE_2D,ht,Be,H.width,H.height)}ut&&t.texSubImage2D(r.TEXTURE_2D,0,0,0,fe,De,Me)}else t.texImage2D(r.TEXTURE_2D,0,Be,fe,De,Me);m(k)&&v(pe),He.__version=ye.version,k.onUpdate&&k.onUpdate(k)}Y.__version=k.version}function re(Y,k,le){if(k.image.length!==6)return;const pe=z(Y,k),me=k.source;t.bindTexture(r.TEXTURE_CUBE_MAP,Y.__webglTexture,r.TEXTURE0+le);const ye=n.get(me);if(me.version!==ye.__version||pe===!0){t.activeTexture(r.TEXTURE0+le);const He=Tt.getPrimaries(Tt.workingColorSpace),Ie=k.colorSpace===ms?null:Tt.getPrimaries(k.colorSpace),je=k.colorSpace===ms||He===Ie?r.NONE:r.BROWSER_DEFAULT_WEBGL;r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,k.flipY),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,k.premultiplyAlpha),r.pixelStorei(r.UNPACK_ALIGNMENT,k.unpackAlignment),r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,je);const Ge=k.isCompressedTexture||k.image[0].isCompressedTexture,Me=k.image[0]&&k.image[0].isDataTexture,fe=[];for(let O=0;O<6;O++)!Ge&&!Me?fe[O]=E(k.image[O],!0,i.maxCubemapSize):fe[O]=Me?k.image[O].image:k.image[O],fe[O]=Ke(k,fe[O]);const De=fe[0],Be=s.convert(k.format,k.colorSpace),be=s.convert(k.type),nt=w(k.internalFormat,Be,be,k.colorSpace),lt=k.isVideoTexture!==!0,dt=ye.__version===void 0||pe===!0,ut=me.dataReady;let ht=x(k,De);Q(r.TEXTURE_CUBE_MAP,k);let H;if(Ge){lt&&dt&&t.texStorage2D(r.TEXTURE_CUBE_MAP,ht,nt,De.width,De.height);for(let O=0;O<6;O++){H=fe[O].mipmaps;for(let ge=0;ge<H.length;ge++){const ve=H[ge];k.format!==vr?Be!==null?lt?ut&&t.compressedTexSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+O,ge,0,0,ve.width,ve.height,Be,ve.data):t.compressedTexImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+O,ge,nt,ve.width,ve.height,0,ve.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):lt?ut&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+O,ge,0,0,ve.width,ve.height,Be,be,ve.data):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+O,ge,nt,ve.width,ve.height,0,Be,be,ve.data)}}}else{if(H=k.mipmaps,lt&&dt){H.length>0&&ht++;const O=pt(fe[0]);t.texStorage2D(r.TEXTURE_CUBE_MAP,ht,nt,O.width,O.height)}for(let O=0;O<6;O++)if(Me){lt?ut&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+O,0,0,0,fe[O].width,fe[O].height,Be,be,fe[O].data):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+O,0,nt,fe[O].width,fe[O].height,0,Be,be,fe[O].data);for(let ge=0;ge<H.length;ge++){const ve=H[ge].image[O].image;lt?ut&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+O,ge+1,0,0,ve.width,ve.height,Be,be,ve.data):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+O,ge+1,nt,ve.width,ve.height,0,Be,be,ve.data)}}else{lt?ut&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+O,0,0,0,Be,be,fe[O]):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+O,0,nt,Be,be,fe[O]);for(let ge=0;ge<H.length;ge++){const ve=H[ge];lt?ut&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+O,ge+1,0,0,Be,be,ve.image[O]):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+O,ge+1,nt,Be,be,ve.image[O])}}}m(k)&&v(r.TEXTURE_CUBE_MAP),ye.__version=me.version,k.onUpdate&&k.onUpdate(k)}Y.__version=k.version}function j(Y,k,le,pe,me,ye){const He=s.convert(le.format,le.colorSpace),Ie=s.convert(le.type),je=w(le.internalFormat,He,Ie,le.colorSpace);if(!n.get(k).__hasExternalTextures){const Ge=Math.max(1,k.width>>ye),Me=Math.max(1,k.height>>ye);me===r.TEXTURE_3D||me===r.TEXTURE_2D_ARRAY?t.texImage3D(me,ye,je,Ge,Me,k.depth,0,He,Ie,null):t.texImage2D(me,ye,je,Ge,Me,0,He,Ie,null)}t.bindFramebuffer(r.FRAMEBUFFER,Y),Qe(k)?l.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,pe,me,n.get(le).__webglTexture,0,et(k)):(me===r.TEXTURE_2D||me>=r.TEXTURE_CUBE_MAP_POSITIVE_X&&me<=r.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&r.framebufferTexture2D(r.FRAMEBUFFER,pe,me,n.get(le).__webglTexture,ye),t.bindFramebuffer(r.FRAMEBUFFER,null)}function de(Y,k,le){if(r.bindRenderbuffer(r.RENDERBUFFER,Y),k.depthBuffer&&!k.stencilBuffer){let pe=r.DEPTH_COMPONENT24;if(le||Qe(k)){const me=k.depthTexture;me&&me.isDepthTexture&&(me.type===lr?pe=r.DEPTH_COMPONENT32F:me.type===Mi&&(pe=r.DEPTH_COMPONENT24));const ye=et(k);Qe(k)?l.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,ye,pe,k.width,k.height):r.renderbufferStorageMultisample(r.RENDERBUFFER,ye,pe,k.width,k.height)}else r.renderbufferStorage(r.RENDERBUFFER,pe,k.width,k.height);r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.RENDERBUFFER,Y)}else if(k.depthBuffer&&k.stencilBuffer){const pe=et(k);le&&Qe(k)===!1?r.renderbufferStorageMultisample(r.RENDERBUFFER,pe,r.DEPTH24_STENCIL8,k.width,k.height):Qe(k)?l.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,pe,r.DEPTH24_STENCIL8,k.width,k.height):r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,k.width,k.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,Y)}else{const pe=k.textures;for(let me=0;me<pe.length;me++){const ye=pe[me],He=s.convert(ye.format,ye.colorSpace),Ie=s.convert(ye.type),je=w(ye.internalFormat,He,Ie,ye.colorSpace),Ge=et(k);le&&Qe(k)===!1?r.renderbufferStorageMultisample(r.RENDERBUFFER,Ge,je,k.width,k.height):Qe(k)?l.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,Ge,je,k.width,k.height):r.renderbufferStorage(r.RENDERBUFFER,je,k.width,k.height)}}r.bindRenderbuffer(r.RENDERBUFFER,null)}function Ae(Y,k){if(k&&k.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(r.FRAMEBUFFER,Y),!(k.depthTexture&&k.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");(!n.get(k.depthTexture).__webglTexture||k.depthTexture.image.width!==k.width||k.depthTexture.image.height!==k.height)&&(k.depthTexture.image.width=k.width,k.depthTexture.image.height=k.height,k.depthTexture.needsUpdate=!0),N(k.depthTexture,0);const le=n.get(k.depthTexture).__webglTexture,pe=et(k);if(k.depthTexture.format===ol)Qe(k)?l.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,le,0,pe):r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,le,0);else if(k.depthTexture.format===au)Qe(k)?l.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.TEXTURE_2D,le,0,pe):r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.TEXTURE_2D,le,0);else throw new Error("Unknown depthTexture format")}function _e(Y){const k=n.get(Y),le=Y.isWebGLCubeRenderTarget===!0;if(Y.depthTexture&&!k.__autoAllocateDepthBuffer){if(le)throw new Error("target.depthTexture not supported in Cube render targets");Ae(k.__webglFramebuffer,Y)}else if(le){k.__webglDepthbuffer=[];for(let pe=0;pe<6;pe++)t.bindFramebuffer(r.FRAMEBUFFER,k.__webglFramebuffer[pe]),k.__webglDepthbuffer[pe]=r.createRenderbuffer(),de(k.__webglDepthbuffer[pe],Y,!1)}else t.bindFramebuffer(r.FRAMEBUFFER,k.__webglFramebuffer),k.__webglDepthbuffer=r.createRenderbuffer(),de(k.__webglDepthbuffer,Y,!1);t.bindFramebuffer(r.FRAMEBUFFER,null)}function Ee(Y,k,le){const pe=n.get(Y);k!==void 0&&j(pe.__webglFramebuffer,Y,Y.texture,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,0),le!==void 0&&_e(Y)}function Le(Y){const k=Y.texture,le=n.get(Y),pe=n.get(k);Y.addEventListener("dispose",R);const me=Y.textures,ye=Y.isWebGLCubeRenderTarget===!0,He=me.length>1;if(He||(pe.__webglTexture===void 0&&(pe.__webglTexture=r.createTexture()),pe.__version=k.version,o.memory.textures++),ye){le.__webglFramebuffer=[];for(let Ie=0;Ie<6;Ie++)if(k.mipmaps&&k.mipmaps.length>0){le.__webglFramebuffer[Ie]=[];for(let je=0;je<k.mipmaps.length;je++)le.__webglFramebuffer[Ie][je]=r.createFramebuffer()}else le.__webglFramebuffer[Ie]=r.createFramebuffer()}else{if(k.mipmaps&&k.mipmaps.length>0){le.__webglFramebuffer=[];for(let Ie=0;Ie<k.mipmaps.length;Ie++)le.__webglFramebuffer[Ie]=r.createFramebuffer()}else le.__webglFramebuffer=r.createFramebuffer();if(He)for(let Ie=0,je=me.length;Ie<je;Ie++){const Ge=n.get(me[Ie]);Ge.__webglTexture===void 0&&(Ge.__webglTexture=r.createTexture(),o.memory.textures++)}if(Y.samples>0&&Qe(Y)===!1){le.__webglMultisampledFramebuffer=r.createFramebuffer(),le.__webglColorRenderbuffer=[],t.bindFramebuffer(r.FRAMEBUFFER,le.__webglMultisampledFramebuffer);for(let Ie=0;Ie<me.length;Ie++){const je=me[Ie];le.__webglColorRenderbuffer[Ie]=r.createRenderbuffer(),r.bindRenderbuffer(r.RENDERBUFFER,le.__webglColorRenderbuffer[Ie]);const Ge=s.convert(je.format,je.colorSpace),Me=s.convert(je.type),fe=w(je.internalFormat,Ge,Me,je.colorSpace,Y.isXRRenderTarget===!0),De=et(Y);r.renderbufferStorageMultisample(r.RENDERBUFFER,De,fe,Y.width,Y.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+Ie,r.RENDERBUFFER,le.__webglColorRenderbuffer[Ie])}r.bindRenderbuffer(r.RENDERBUFFER,null),Y.depthBuffer&&(le.__webglDepthRenderbuffer=r.createRenderbuffer(),de(le.__webglDepthRenderbuffer,Y,!0)),t.bindFramebuffer(r.FRAMEBUFFER,null)}}if(ye){t.bindTexture(r.TEXTURE_CUBE_MAP,pe.__webglTexture),Q(r.TEXTURE_CUBE_MAP,k);for(let Ie=0;Ie<6;Ie++)if(k.mipmaps&&k.mipmaps.length>0)for(let je=0;je<k.mipmaps.length;je++)j(le.__webglFramebuffer[Ie][je],Y,k,r.COLOR_ATTACHMENT0,r.TEXTURE_CUBE_MAP_POSITIVE_X+Ie,je);else j(le.__webglFramebuffer[Ie],Y,k,r.COLOR_ATTACHMENT0,r.TEXTURE_CUBE_MAP_POSITIVE_X+Ie,0);m(k)&&v(r.TEXTURE_CUBE_MAP),t.unbindTexture()}else if(He){for(let Ie=0,je=me.length;Ie<je;Ie++){const Ge=me[Ie],Me=n.get(Ge);t.bindTexture(r.TEXTURE_2D,Me.__webglTexture),Q(r.TEXTURE_2D,Ge),j(le.__webglFramebuffer,Y,Ge,r.COLOR_ATTACHMENT0+Ie,r.TEXTURE_2D,0),m(Ge)&&v(r.TEXTURE_2D)}t.unbindTexture()}else{let Ie=r.TEXTURE_2D;if((Y.isWebGL3DRenderTarget||Y.isWebGLArrayRenderTarget)&&(Ie=Y.isWebGL3DRenderTarget?r.TEXTURE_3D:r.TEXTURE_2D_ARRAY),t.bindTexture(Ie,pe.__webglTexture),Q(Ie,k),k.mipmaps&&k.mipmaps.length>0)for(let je=0;je<k.mipmaps.length;je++)j(le.__webglFramebuffer[je],Y,k,r.COLOR_ATTACHMENT0,Ie,je);else j(le.__webglFramebuffer,Y,k,r.COLOR_ATTACHMENT0,Ie,0);m(k)&&v(Ie),t.unbindTexture()}Y.depthBuffer&&_e(Y)}function st(Y){const k=Y.textures;for(let le=0,pe=k.length;le<pe;le++){const me=k[le];if(m(me)){const ye=Y.isWebGLCubeRenderTarget?r.TEXTURE_CUBE_MAP:r.TEXTURE_2D,He=n.get(me).__webglTexture;t.bindTexture(ye,He),v(ye),t.unbindTexture()}}}function se(Y){if(Y.samples>0&&Qe(Y)===!1){const k=Y.textures,le=Y.width,pe=Y.height;let me=r.COLOR_BUFFER_BIT;const ye=[],He=Y.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,Ie=n.get(Y),je=k.length>1;if(je)for(let Ge=0;Ge<k.length;Ge++)t.bindFramebuffer(r.FRAMEBUFFER,Ie.__webglMultisampledFramebuffer),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+Ge,r.RENDERBUFFER,null),t.bindFramebuffer(r.FRAMEBUFFER,Ie.__webglFramebuffer),r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0+Ge,r.TEXTURE_2D,null,0);t.bindFramebuffer(r.READ_FRAMEBUFFER,Ie.__webglMultisampledFramebuffer),t.bindFramebuffer(r.DRAW_FRAMEBUFFER,Ie.__webglFramebuffer);for(let Ge=0;Ge<k.length;Ge++){ye.push(r.COLOR_ATTACHMENT0+Ge),Y.depthBuffer&&ye.push(He);const Me=Ie.__ignoreDepthValues!==void 0?Ie.__ignoreDepthValues:!1;if(Me===!1&&(Y.depthBuffer&&(me|=r.DEPTH_BUFFER_BIT),Y.stencilBuffer&&Ie.__isTransmissionRenderTarget!==!0&&(me|=r.STENCIL_BUFFER_BIT)),je&&r.framebufferRenderbuffer(r.READ_FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.RENDERBUFFER,Ie.__webglColorRenderbuffer[Ge]),Me===!0&&(r.invalidateFramebuffer(r.READ_FRAMEBUFFER,[He]),r.invalidateFramebuffer(r.DRAW_FRAMEBUFFER,[He])),je){const fe=n.get(k[Ge]).__webglTexture;r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,fe,0)}r.blitFramebuffer(0,0,le,pe,0,0,le,pe,me,r.NEAREST),h&&r.invalidateFramebuffer(r.READ_FRAMEBUFFER,ye)}if(t.bindFramebuffer(r.READ_FRAMEBUFFER,null),t.bindFramebuffer(r.DRAW_FRAMEBUFFER,null),je)for(let Ge=0;Ge<k.length;Ge++){t.bindFramebuffer(r.FRAMEBUFFER,Ie.__webglMultisampledFramebuffer),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+Ge,r.RENDERBUFFER,Ie.__webglColorRenderbuffer[Ge]);const Me=n.get(k[Ge]).__webglTexture;t.bindFramebuffer(r.FRAMEBUFFER,Ie.__webglFramebuffer),r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0+Ge,r.TEXTURE_2D,Me,0)}t.bindFramebuffer(r.DRAW_FRAMEBUFFER,Ie.__webglMultisampledFramebuffer)}}function et(Y){return Math.min(i.maxSamples,Y.samples)}function Qe(Y){const k=n.get(Y);return Y.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&k.__useRenderToTexture!==!1}function ct(Y){const k=o.render.frame;d.get(Y)!==k&&(d.set(Y,k),Y.update())}function Ke(Y,k){const le=Y.colorSpace,pe=Y.format,me=Y.type;return Y.isCompressedTexture===!0||Y.isVideoTexture===!0||le!==cr&&le!==ms&&(Tt.getTransfer(le)===Ht?(pe!==vr||me!==mr)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",le)),k}function pt(Y){return typeof HTMLImageElement<"u"&&Y instanceof HTMLImageElement?(u.width=Y.naturalWidth||Y.width,u.height=Y.naturalHeight||Y.height):typeof VideoFrame<"u"&&Y instanceof VideoFrame?(u.width=Y.displayWidth,u.height=Y.displayHeight):(u.width=Y.width,u.height=Y.height),u}this.allocateTextureUnit=L,this.resetTextureUnits=M,this.setTexture2D=N,this.setTexture2DArray=W,this.setTexture3D=X,this.setTextureCube=K,this.rebindTextures=Ee,this.setupRenderTarget=Le,this.updateRenderTargetMipmap=st,this.updateMultisampleRenderTarget=se,this.setupDepthRenderbuffer=_e,this.setupFrameBufferTexture=j,this.useMultisampledRTT=Qe}function r8(r,e){function t(n,i=ms){let s;const o=Tt.getTransfer(i);if(n===mr)return r.UNSIGNED_BYTE;if(n===cE)return r.UNSIGNED_SHORT_4_4_4_4;if(n===uE)return r.UNSIGNED_SHORT_5_5_5_1;if(n===Ib)return r.UNSIGNED_INT_5_9_9_9_REV;if(n===_A)return r.BYTE;if(n===lE)return r.SHORT;if(n===yA)return r.UNSIGNED_SHORT;if(n===iu)return r.INT;if(n===Mi)return r.UNSIGNED_INT;if(n===lr)return r.FLOAT;if(n===Or)return r.HALF_FLOAT;if(n===Cb)return r.ALPHA;if(n===Mb)return r.RGB;if(n===vr)return r.RGBA;if(n===Sb)return r.LUMINANCE;if(n===Tb)return r.LUMINANCE_ALPHA;if(n===ol)return r.DEPTH_COMPONENT;if(n===au)return r.DEPTH_STENCIL;if(n===ea)return r.RED;if(n===EA)return r.RED_INTEGER;if(n===so)return r.RG;if(n===td)return r.RG_INTEGER;if(n===ou)return r.RGBA_INTEGER;if(n===rd||n===xA||n===wA||n===nd)if(o===Ht)if(s=e.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(n===rd)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===xA)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===wA)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===nd)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=e.get("WEBGL_compressed_texture_s3tc"),s!==null){if(n===rd)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===xA)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===wA)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===nd)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(n===IA||n===hE||n===CA||n===dE)if(s=e.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(n===IA)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===hE)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===CA)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===dE)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(n===MA)return s=e.get("WEBGL_compressed_texture_etc1"),s!==null?s.COMPRESSED_RGB_ETC1_WEBGL:null;if(n===SA||n===TA)if(s=e.get("WEBGL_compressed_texture_etc"),s!==null){if(n===SA)return o===Ht?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(n===TA)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(n===BA||n===fE||n===pE||n===AE||n===id||n===gE||n===mE||n===vE||n===_E||n===yE||n===EE||n===xE||n===wE||n===IE)if(s=e.get("WEBGL_compressed_texture_astc"),s!==null){if(n===BA)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===fE)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===pE)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===AE)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===id)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===gE)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===mE)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===vE)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===_E)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===yE)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===EE)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===xE)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===wE)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===IE)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(n===sd||n===CE||n===ME)if(s=e.get("EXT_texture_compression_bptc"),s!==null){if(n===sd)return o===Ht?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===CE)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===ME)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(n===Bb||n===SE||n===TE||n===BE)if(s=e.get("EXT_texture_compression_rgtc"),s!==null){if(n===sd)return s.COMPRESSED_RED_RGTC1_EXT;if(n===SE)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===TE)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===BE)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return n===su?r.UNSIGNED_INT_24_8:r[n]!==void 0?r[n]:null}return{convert:t}}class n8 extends dn{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class oa extends Zt{constructor(){super(),this.isGroup=!0,this.type="Group"}}const i8={type:"move"};class lg{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new oa,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new oa,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new G,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new G),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new oa,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new G,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new G),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const n of e.hand.values())this._getHandJoint(t,n)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,n){let i=null,s=null,o=null;const l=this._targetRay,h=this._grip,u=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(u&&e.hand){o=!0;for(const E of e.hand.values()){const m=t.getJointPose(E,n),v=this._getHandJoint(u,E);m!==null&&(v.matrix.fromArray(m.transform.matrix),v.matrix.decompose(v.position,v.rotation,v.scale),v.matrixWorldNeedsUpdate=!0,v.jointRadius=m.radius),v.visible=m!==null}const d=u.joints["index-finger-tip"],A=u.joints["thumb-tip"],p=d.position.distanceTo(A.position),g=.02,_=.005;u.inputState.pinching&&p>g+_?(u.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!u.inputState.pinching&&p<=g-_&&(u.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else h!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,n),s!==null&&(h.matrix.fromArray(s.transform.matrix),h.matrix.decompose(h.position,h.rotation,h.scale),h.matrixWorldNeedsUpdate=!0,s.linearVelocity?(h.hasLinearVelocity=!0,h.linearVelocity.copy(s.linearVelocity)):h.hasLinearVelocity=!1,s.angularVelocity?(h.hasAngularVelocity=!0,h.angularVelocity.copy(s.angularVelocity)):h.hasAngularVelocity=!1));l!==null&&(i=t.getPose(e.targetRaySpace,n),i===null&&s!==null&&(i=s),i!==null&&(l.matrix.fromArray(i.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,i.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(i.linearVelocity)):l.hasLinearVelocity=!1,i.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(i.angularVelocity)):l.hasAngularVelocity=!1,this.dispatchEvent(i8)))}return l!==null&&(l.visible=i!==null),h!==null&&(h.visible=s!==null),u!==null&&(u.visible=o!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const n=new oa;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}}const s8=`
3805
3805
  void main() {
3806
3806
 
3807
3807
  gl_Position = vec4( position, 1.0 );
@@ -3825,8 +3825,8 @@ void main() {
3825
3825
 
3826
3826
  }
3827
3827
 
3828
- }`;class o8{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,n){if(this.texture===null){const i=new br,s=e.properties.get(i);s.__webglTexture=t.texture,(t.depthNear!=n.depthNear||t.depthFar!=n.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=i}}render(e,t){if(this.texture!==null){if(this.mesh===null){const n=t.cameras[0].viewport,i=new Cr({vertexShader:s8,fragmentShader:a8,uniforms:{depthColor:{value:this.texture},depthWidth:{value:n.z},depthHeight:{value:n.w}}});this.mesh=new Xr(new vu(20,20),i)}e.render(this.mesh,t)}}reset(){this.texture=null,this.mesh=null}}class l8 extends ao{constructor(e,t){super();const n=this;let i=null,s=1,o=null,l="local-floor",h=1,u=null,d=null,A=null,p=null,g=null,_=null;const E=new o8,m=t.getContextAttributes();let v=null,w=null;const x=[],I=[],R=new Ue;let S=null;const T=new dn;T.layers.enable(1),T.viewport=new Ft;const D=new dn;D.layers.enable(2),D.viewport=new Ft;const b=[T,D],M=new n8;M.layers.enable(1),M.layers.enable(2);let L=null,P=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(j){let de=x[j];return de===void 0&&(de=new cg,x[j]=de),de.getTargetRaySpace()},this.getControllerGrip=function(j){let de=x[j];return de===void 0&&(de=new cg,x[j]=de),de.getGripSpace()},this.getHand=function(j){let de=x[j];return de===void 0&&(de=new cg,x[j]=de),de.getHandSpace()};function N(j){const de=I.indexOf(j.inputSource);if(de===-1)return;const Ae=x[de];Ae!==void 0&&(Ae.update(j.inputSource,j.frame,u||o),Ae.dispatchEvent({type:j.type,data:j.inputSource}))}function W(){i.removeEventListener("select",N),i.removeEventListener("selectstart",N),i.removeEventListener("selectend",N),i.removeEventListener("squeeze",N),i.removeEventListener("squeezestart",N),i.removeEventListener("squeezeend",N),i.removeEventListener("end",W),i.removeEventListener("inputsourceschange",X);for(let j=0;j<x.length;j++){const de=I[j];de!==null&&(I[j]=null,x[j].disconnect(de))}L=null,P=null,E.reset(),e.setRenderTarget(v),g=null,p=null,A=null,i=null,w=null,re.stop(),n.isPresenting=!1,e.setPixelRatio(S),e.setSize(R.width,R.height,!1),n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(j){s=j,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(j){l=j,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return u||o},this.setReferenceSpace=function(j){u=j},this.getBaseLayer=function(){return p!==null?p:g},this.getBinding=function(){return A},this.getFrame=function(){return _},this.getSession=function(){return i},this.setSession=async function(j){if(i=j,i!==null){if(v=e.getRenderTarget(),i.addEventListener("select",N),i.addEventListener("selectstart",N),i.addEventListener("selectend",N),i.addEventListener("squeeze",N),i.addEventListener("squeezestart",N),i.addEventListener("squeezeend",N),i.addEventListener("end",W),i.addEventListener("inputsourceschange",X),m.xrCompatible!==!0&&await t.makeXRCompatible(),S=e.getPixelRatio(),e.getSize(R),i.renderState.layers===void 0){const de={antialias:m.antialias,alpha:!0,depth:m.depth,stencil:m.stencil,framebufferScaleFactor:s};g=new XRWebGLLayer(i,t,de),i.updateRenderState({baseLayer:g}),e.setPixelRatio(1),e.setSize(g.framebufferWidth,g.framebufferHeight,!1),w=new cn(g.framebufferWidth,g.framebufferHeight,{format:vr,type:mr,colorSpace:e.outputColorSpace,stencilBuffer:m.stencil})}else{let de=null,Ae=null,_e=null;m.depth&&(_e=m.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,de=m.stencil?au:ol,Ae=m.stencil?su:Mi);const Ee={colorFormat:t.RGBA8,depthFormat:_e,scaleFactor:s};A=new XRWebGLBinding(i,t),p=A.createProjectionLayer(Ee),i.updateRenderState({layers:[p]}),e.setPixelRatio(1),e.setSize(p.textureWidth,p.textureHeight,!1),w=new cn(p.textureWidth,p.textureHeight,{format:vr,type:mr,depthTexture:new w2(p.textureWidth,p.textureHeight,Ae,void 0,void 0,void 0,void 0,void 0,void 0,de),stencilBuffer:m.stencil,colorSpace:e.outputColorSpace,samples:m.antialias?4:0});const Le=e.properties.get(w);Le.__ignoreDepthValues=p.ignoreDepthValues}w.isXRRenderTarget=!0,this.setFoveation(h),u=null,o=await i.requestReferenceSpace(l),re.setContext(i),re.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(i!==null)return i.environmentBlendMode};function X(j){for(let de=0;de<j.removed.length;de++){const Ae=j.removed[de],_e=I.indexOf(Ae);_e>=0&&(I[_e]=null,x[_e].disconnect(Ae))}for(let de=0;de<j.added.length;de++){const Ae=j.added[de];let _e=I.indexOf(Ae);if(_e===-1){for(let Le=0;Le<x.length;Le++)if(Le>=I.length){I.push(Ae),_e=Le;break}else if(I[Le]===null){I[Le]=Ae,_e=Le;break}if(_e===-1)break}const Ee=x[_e];Ee&&Ee.connect(Ae)}}const K=new G,te=new G;function V(j,de,Ae){K.setFromMatrixPosition(de.matrixWorld),te.setFromMatrixPosition(Ae.matrixWorld);const _e=K.distanceTo(te),Ee=de.projectionMatrix.elements,Le=Ae.projectionMatrix.elements,st=Ee[14]/(Ee[10]-1),se=Ee[14]/(Ee[10]+1),et=(Ee[9]+1)/Ee[5],Qe=(Ee[9]-1)/Ee[5],ct=(Ee[8]-1)/Ee[0],Ke=(Le[8]+1)/Le[0],pt=st*ct,Y=st*Ke,k=_e/(-ct+Ke),le=k*-ct;de.matrixWorld.decompose(j.position,j.quaternion,j.scale),j.translateX(le),j.translateZ(k),j.matrixWorld.compose(j.position,j.quaternion,j.scale),j.matrixWorldInverse.copy(j.matrixWorld).invert();const pe=st+k,me=se+k,ye=pt-le,He=Y+(_e-le),Ie=et*se/me*pe,je=Qe*se/me*pe;j.projectionMatrix.makePerspective(ye,He,Ie,je,pe,me),j.projectionMatrixInverse.copy(j.projectionMatrix).invert()}function ee(j,de){de===null?j.matrixWorld.copy(j.matrix):j.matrixWorld.multiplyMatrices(de.matrixWorld,j.matrix),j.matrixWorldInverse.copy(j.matrixWorld).invert()}this.updateCamera=function(j){if(i===null)return;E.texture!==null&&(j.near=E.depthNear,j.far=E.depthFar),M.near=D.near=T.near=j.near,M.far=D.far=T.far=j.far,(L!==M.near||P!==M.far)&&(i.updateRenderState({depthNear:M.near,depthFar:M.far}),L=M.near,P=M.far,T.near=L,T.far=P,D.near=L,D.far=P,T.updateProjectionMatrix(),D.updateProjectionMatrix(),j.updateProjectionMatrix());const de=j.parent,Ae=M.cameras;ee(M,de);for(let _e=0;_e<Ae.length;_e++)ee(Ae[_e],de);Ae.length===2?V(M,T,D):M.projectionMatrix.copy(T.projectionMatrix),Q(j,M,de)};function Q(j,de,Ae){Ae===null?j.matrix.copy(de.matrixWorld):(j.matrix.copy(Ae.matrixWorld),j.matrix.invert(),j.matrix.multiply(de.matrixWorld)),j.matrix.decompose(j.position,j.quaternion,j.scale),j.updateMatrixWorld(!0),j.projectionMatrix.copy(de.projectionMatrix),j.projectionMatrixInverse.copy(de.projectionMatrixInverse),j.isPerspectiveCamera&&(j.fov=ul*2*Math.atan(1/j.projectionMatrix.elements[5]),j.zoom=1)}this.getCamera=function(){return M},this.getFoveation=function(){if(!(p===null&&g===null))return h},this.setFoveation=function(j){h=j,p!==null&&(p.fixedFoveation=j),g!==null&&g.fixedFoveation!==void 0&&(g.fixedFoveation=j)},this.hasDepthSensing=function(){return E.texture!==null};let z=null;function Z(j,de){if(d=de.getViewerPose(u||o),_=de,d!==null){const Ae=d.views;g!==null&&(e.setRenderTargetFramebuffer(w,g.framebuffer),e.setRenderTarget(w));let _e=!1;Ae.length!==M.cameras.length&&(M.cameras.length=0,_e=!0);for(let Le=0;Le<Ae.length;Le++){const st=Ae[Le];let se=null;if(g!==null)se=g.getViewport(st);else{const Qe=A.getViewSubImage(p,st);se=Qe.viewport,Le===0&&(e.setRenderTargetTextures(w,Qe.colorTexture,p.ignoreDepthValues?void 0:Qe.depthStencilTexture),e.setRenderTarget(w))}let et=b[Le];et===void 0&&(et=new dn,et.layers.enable(Le),et.viewport=new Ft,b[Le]=et),et.matrix.fromArray(st.transform.matrix),et.matrix.decompose(et.position,et.quaternion,et.scale),et.projectionMatrix.fromArray(st.projectionMatrix),et.projectionMatrixInverse.copy(et.projectionMatrix).invert(),et.viewport.set(se.x,se.y,se.width,se.height),Le===0&&(M.matrix.copy(et.matrix),M.matrix.decompose(M.position,M.quaternion,M.scale)),_e===!0&&M.cameras.push(et)}const Ee=i.enabledFeatures;if(Ee&&Ee.includes("depth-sensing")){const Le=A.getDepthInformation(Ae[0]);Le&&Le.isValid&&Le.texture&&E.init(e,Le,i.renderState)}}for(let Ae=0;Ae<x.length;Ae++){const _e=I[Ae],Ee=x[Ae];_e!==null&&Ee!==void 0&&Ee.update(_e,de,u||o)}E.render(e,M),z&&z(j,de),de.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:de}),_=null}const re=new A2;re.setAnimationLoop(Z),this.setAnimationLoop=function(j){z=j},this.dispose=function(){}}}const go=new qi,c8=new rt;function u8(r,e){function t(m,v){m.matrixAutoUpdate===!0&&m.updateMatrix(),v.value.copy(m.matrix)}function n(m,v){v.color.getRGB(m.fogColor.value,u2(r)),v.isFog?(m.fogNear.value=v.near,m.fogFar.value=v.far):v.isFogExp2&&(m.fogDensity.value=v.density)}function i(m,v,w,x,I){v.isMeshBasicMaterial||v.isMeshLambertMaterial?s(m,v):v.isMeshToonMaterial?(s(m,v),A(m,v)):v.isMeshPhongMaterial?(s(m,v),d(m,v)):v.isMeshStandardMaterial?(s(m,v),p(m,v),v.isMeshPhysicalMaterial&&g(m,v,I)):v.isMeshMatcapMaterial?(s(m,v),_(m,v)):v.isMeshDepthMaterial?s(m,v):v.isMeshDistanceMaterial?(s(m,v),E(m,v)):v.isMeshNormalMaterial?s(m,v):v.isLineBasicMaterial?(o(m,v),v.isLineDashedMaterial&&l(m,v)):v.isPointsMaterial?h(m,v,w,x):v.isSpriteMaterial?u(m,v):v.isShadowMaterial?(m.color.value.copy(v.color),m.opacity.value=v.opacity):v.isShaderMaterial&&(v.uniformsNeedUpdate=!1)}function s(m,v){m.opacity.value=v.opacity,v.color&&m.diffuse.value.copy(v.color),v.emissive&&m.emissive.value.copy(v.emissive).multiplyScalar(v.emissiveIntensity),v.map&&(m.map.value=v.map,t(v.map,m.mapTransform)),v.alphaMap&&(m.alphaMap.value=v.alphaMap,t(v.alphaMap,m.alphaMapTransform)),v.bumpMap&&(m.bumpMap.value=v.bumpMap,t(v.bumpMap,m.bumpMapTransform),m.bumpScale.value=v.bumpScale,v.side===Qr&&(m.bumpScale.value*=-1)),v.normalMap&&(m.normalMap.value=v.normalMap,t(v.normalMap,m.normalMapTransform),m.normalScale.value.copy(v.normalScale),v.side===Qr&&m.normalScale.value.negate()),v.displacementMap&&(m.displacementMap.value=v.displacementMap,t(v.displacementMap,m.displacementMapTransform),m.displacementScale.value=v.displacementScale,m.displacementBias.value=v.displacementBias),v.emissiveMap&&(m.emissiveMap.value=v.emissiveMap,t(v.emissiveMap,m.emissiveMapTransform)),v.specularMap&&(m.specularMap.value=v.specularMap,t(v.specularMap,m.specularMapTransform)),v.alphaTest>0&&(m.alphaTest.value=v.alphaTest);const w=e.get(v),x=w.envMap,I=w.envMapRotation;if(x&&(m.envMap.value=x,go.copy(I),go.x*=-1,go.y*=-1,go.z*=-1,x.isCubeTexture&&x.isRenderTargetTexture===!1&&(go.y*=-1,go.z*=-1),m.envMapRotation.value.setFromMatrix4(c8.makeRotationFromEuler(go)),m.flipEnvMap.value=x.isCubeTexture&&x.isRenderTargetTexture===!1?-1:1,m.reflectivity.value=v.reflectivity,m.ior.value=v.ior,m.refractionRatio.value=v.refractionRatio),v.lightMap){m.lightMap.value=v.lightMap;const R=r._useLegacyLights===!0?Math.PI:1;m.lightMapIntensity.value=v.lightMapIntensity*R,t(v.lightMap,m.lightMapTransform)}v.aoMap&&(m.aoMap.value=v.aoMap,m.aoMapIntensity.value=v.aoMapIntensity,t(v.aoMap,m.aoMapTransform))}function o(m,v){m.diffuse.value.copy(v.color),m.opacity.value=v.opacity,v.map&&(m.map.value=v.map,t(v.map,m.mapTransform))}function l(m,v){m.dashSize.value=v.dashSize,m.totalSize.value=v.dashSize+v.gapSize,m.scale.value=v.scale}function h(m,v,w,x){m.diffuse.value.copy(v.color),m.opacity.value=v.opacity,m.size.value=v.size*w,m.scale.value=x*.5,v.map&&(m.map.value=v.map,t(v.map,m.uvTransform)),v.alphaMap&&(m.alphaMap.value=v.alphaMap,t(v.alphaMap,m.alphaMapTransform)),v.alphaTest>0&&(m.alphaTest.value=v.alphaTest)}function u(m,v){m.diffuse.value.copy(v.color),m.opacity.value=v.opacity,m.rotation.value=v.rotation,v.map&&(m.map.value=v.map,t(v.map,m.mapTransform)),v.alphaMap&&(m.alphaMap.value=v.alphaMap,t(v.alphaMap,m.alphaMapTransform)),v.alphaTest>0&&(m.alphaTest.value=v.alphaTest)}function d(m,v){m.specular.value.copy(v.specular),m.shininess.value=Math.max(v.shininess,1e-4)}function A(m,v){v.gradientMap&&(m.gradientMap.value=v.gradientMap)}function p(m,v){m.metalness.value=v.metalness,v.metalnessMap&&(m.metalnessMap.value=v.metalnessMap,t(v.metalnessMap,m.metalnessMapTransform)),m.roughness.value=v.roughness,v.roughnessMap&&(m.roughnessMap.value=v.roughnessMap,t(v.roughnessMap,m.roughnessMapTransform)),v.envMap&&(m.envMapIntensity.value=v.envMapIntensity)}function g(m,v,w){m.ior.value=v.ior,v.sheen>0&&(m.sheenColor.value.copy(v.sheenColor).multiplyScalar(v.sheen),m.sheenRoughness.value=v.sheenRoughness,v.sheenColorMap&&(m.sheenColorMap.value=v.sheenColorMap,t(v.sheenColorMap,m.sheenColorMapTransform)),v.sheenRoughnessMap&&(m.sheenRoughnessMap.value=v.sheenRoughnessMap,t(v.sheenRoughnessMap,m.sheenRoughnessMapTransform))),v.clearcoat>0&&(m.clearcoat.value=v.clearcoat,m.clearcoatRoughness.value=v.clearcoatRoughness,v.clearcoatMap&&(m.clearcoatMap.value=v.clearcoatMap,t(v.clearcoatMap,m.clearcoatMapTransform)),v.clearcoatRoughnessMap&&(m.clearcoatRoughnessMap.value=v.clearcoatRoughnessMap,t(v.clearcoatRoughnessMap,m.clearcoatRoughnessMapTransform)),v.clearcoatNormalMap&&(m.clearcoatNormalMap.value=v.clearcoatNormalMap,t(v.clearcoatNormalMap,m.clearcoatNormalMapTransform),m.clearcoatNormalScale.value.copy(v.clearcoatNormalScale),v.side===Qr&&m.clearcoatNormalScale.value.negate())),v.iridescence>0&&(m.iridescence.value=v.iridescence,m.iridescenceIOR.value=v.iridescenceIOR,m.iridescenceThicknessMinimum.value=v.iridescenceThicknessRange[0],m.iridescenceThicknessMaximum.value=v.iridescenceThicknessRange[1],v.iridescenceMap&&(m.iridescenceMap.value=v.iridescenceMap,t(v.iridescenceMap,m.iridescenceMapTransform)),v.iridescenceThicknessMap&&(m.iridescenceThicknessMap.value=v.iridescenceThicknessMap,t(v.iridescenceThicknessMap,m.iridescenceThicknessMapTransform))),v.transmission>0&&(m.transmission.value=v.transmission,m.transmissionSamplerMap.value=w.texture,m.transmissionSamplerSize.value.set(w.width,w.height),v.transmissionMap&&(m.transmissionMap.value=v.transmissionMap,t(v.transmissionMap,m.transmissionMapTransform)),m.thickness.value=v.thickness,v.thicknessMap&&(m.thicknessMap.value=v.thicknessMap,t(v.thicknessMap,m.thicknessMapTransform)),m.attenuationDistance.value=v.attenuationDistance,m.attenuationColor.value.copy(v.attenuationColor)),v.anisotropy>0&&(m.anisotropyVector.value.set(v.anisotropy*Math.cos(v.anisotropyRotation),v.anisotropy*Math.sin(v.anisotropyRotation)),v.anisotropyMap&&(m.anisotropyMap.value=v.anisotropyMap,t(v.anisotropyMap,m.anisotropyMapTransform))),m.specularIntensity.value=v.specularIntensity,m.specularColor.value.copy(v.specularColor),v.specularColorMap&&(m.specularColorMap.value=v.specularColorMap,t(v.specularColorMap,m.specularColorMapTransform)),v.specularIntensityMap&&(m.specularIntensityMap.value=v.specularIntensityMap,t(v.specularIntensityMap,m.specularIntensityMapTransform))}function _(m,v){v.matcap&&(m.matcap.value=v.matcap)}function E(m,v){const w=e.get(v).light;m.referencePosition.value.setFromMatrixPosition(w.matrixWorld),m.nearDistance.value=w.shadow.camera.near,m.farDistance.value=w.shadow.camera.far}return{refreshFogUniforms:n,refreshMaterialUniforms:i}}function h8(r,e,t,n){let i={},s={},o=[];const l=r.getParameter(r.MAX_UNIFORM_BUFFER_BINDINGS);function h(w,x){const I=x.program;n.uniformBlockBinding(w,I)}function u(w,x){let I=i[w.id];I===void 0&&(_(w),I=d(w),i[w.id]=I,w.addEventListener("dispose",m));const R=x.program;n.updateUBOMapping(w,R);const S=e.render.frame;s[w.id]!==S&&(p(w),s[w.id]=S)}function d(w){const x=A();w.__bindingPointIndex=x;const I=r.createBuffer(),R=w.__size,S=w.usage;return r.bindBuffer(r.UNIFORM_BUFFER,I),r.bufferData(r.UNIFORM_BUFFER,R,S),r.bindBuffer(r.UNIFORM_BUFFER,null),r.bindBufferBase(r.UNIFORM_BUFFER,x,I),I}function A(){for(let w=0;w<l;w++)if(o.indexOf(w)===-1)return o.push(w),w;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function p(w){const x=i[w.id],I=w.uniforms,R=w.__cache;r.bindBuffer(r.UNIFORM_BUFFER,x);for(let S=0,T=I.length;S<T;S++){const D=Array.isArray(I[S])?I[S]:[I[S]];for(let b=0,M=D.length;b<M;b++){const L=D[b];if(g(L,S,b,R)===!0){const P=L.__offset,N=Array.isArray(L.value)?L.value:[L.value];let W=0;for(let X=0;X<N.length;X++){const K=N[X],te=E(K);typeof K=="number"||typeof K=="boolean"?(L.__data[0]=K,r.bufferSubData(r.UNIFORM_BUFFER,P+W,L.__data)):K.isMatrix3?(L.__data[0]=K.elements[0],L.__data[1]=K.elements[1],L.__data[2]=K.elements[2],L.__data[3]=0,L.__data[4]=K.elements[3],L.__data[5]=K.elements[4],L.__data[6]=K.elements[5],L.__data[7]=0,L.__data[8]=K.elements[6],L.__data[9]=K.elements[7],L.__data[10]=K.elements[8],L.__data[11]=0):(K.toArray(L.__data,W),W+=te.storage/Float32Array.BYTES_PER_ELEMENT)}r.bufferSubData(r.UNIFORM_BUFFER,P,L.__data)}}}r.bindBuffer(r.UNIFORM_BUFFER,null)}function g(w,x,I,R){const S=w.value,T=x+"_"+I;if(R[T]===void 0)return typeof S=="number"||typeof S=="boolean"?R[T]=S:R[T]=S.clone(),!0;{const D=R[T];if(typeof S=="number"||typeof S=="boolean"){if(D!==S)return R[T]=S,!0}else if(D.equals(S)===!1)return D.copy(S),!0}return!1}function _(w){const x=w.uniforms;let I=0;const R=16;for(let T=0,D=x.length;T<D;T++){const b=Array.isArray(x[T])?x[T]:[x[T]];for(let M=0,L=b.length;M<L;M++){const P=b[M],N=Array.isArray(P.value)?P.value:[P.value];for(let W=0,X=N.length;W<X;W++){const K=N[W],te=E(K),V=I%R;V!==0&&R-V<te.boundary&&(I+=R-V),P.__data=new Float32Array(te.storage/Float32Array.BYTES_PER_ELEMENT),P.__offset=I,I+=te.storage}}}const S=I%R;return S>0&&(I+=R-S),w.__size=I,w.__cache={},this}function E(w){const x={boundary:0,storage:0};return typeof w=="number"||typeof w=="boolean"?(x.boundary=4,x.storage=4):w.isVector2?(x.boundary=8,x.storage=8):w.isVector3||w.isColor?(x.boundary=16,x.storage=12):w.isVector4?(x.boundary=16,x.storage=16):w.isMatrix3?(x.boundary=48,x.storage=48):w.isMatrix4?(x.boundary=64,x.storage=64):w.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",w),x}function m(w){const x=w.target;x.removeEventListener("dispose",m);const I=o.indexOf(x.__bindingPointIndex);o.splice(I,1),r.deleteBuffer(i[x.id]),delete i[x.id],delete s[x.id]}function v(){for(const w in i)r.deleteBuffer(i[w]);o=[],i={},s={}}return{bind:h,update:u,dispose:v}}class d8{constructor(e={}){const{canvas:t=i5(),context:n=null,depth:i=!0,stencil:s=!1,alpha:o=!1,antialias:l=!1,premultipliedAlpha:h=!0,preserveDrawingBuffer:u=!1,powerPreference:d="default",failIfMajorPerformanceCaveat:A=!1}=e;this.isWebGLRenderer=!0;let p;if(n!==null){if(typeof WebGLRenderingContext<"u"&&n instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");p=n.getContextAttributes().alpha}else p=o;const g=new Uint32Array(4),_=new Int32Array(4);let E=null,m=null;const v=[],w=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=Fr,this._useLegacyLights=!1,this.toneMapping=Zs,this.toneMappingExposure=1;const x=this;let I=!1,R=0,S=0,T=null,D=-1,b=null;const M=new Ft,L=new Ft;let P=null;const N=new Ve(0);let W=0,X=t.width,K=t.height,te=1,V=null,ee=null;const Q=new Ft(0,0,X,K),z=new Ft(0,0,X,K);let Z=!1;const re=new eg;let j=!1,de=!1;const Ae=new rt,_e=new Ue,Ee=new G,Le={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function st(){return T===null?te:1}let se=n;function et(F,ne){const ue=t.getContext(F,ne);return ue!==null?ue:null}try{const F={alpha:!0,depth:i,stencil:s,antialias:l,premultipliedAlpha:h,preserveDrawingBuffer:u,powerPreference:d,failIfMajorPerformanceCaveat:A};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${Kh}`),t.addEventListener("webglcontextlost",ge,!1),t.addEventListener("webglcontextrestored",ve,!1),t.addEventListener("webglcontextcreationerror",Fe,!1),se===null){const ne="webgl2";if(se=et(ne,F),se===null)throw et(ne)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(F){throw console.error("THREE.WebGLRenderer: "+F.message),F}let Qe,ct,Ke,pt,Y,k,le,pe,me,ye,He,Ie,je,Ge,Me,fe,De,Be,be,nt,lt,dt,ut,ht;function H(){Qe=new ED(se),Qe.init(),ct=new AD(se,Qe,e),dt=new r8(se,Qe),Ke=new e8(se),pt=new ID(se),Y=new zL,k=new t8(se,Qe,Ke,Y,ct,dt,pt),le=new mD(x),pe=new yD(x),me=new b5(se),ut=new fD(se,me),ye=new xD(se,me,pt,ut),He=new MD(se,ye,me,pt),be=new CD(se,ct,k),fe=new gD(Y),Ie=new FL(x,le,pe,Qe,ct,ut,fe),je=new u8(x,Y),Ge=new GL,Me=new XL(Qe),Be=new dD(x,le,pe,Ke,He,p,h),De=new $L(x,He,ct),ht=new h8(se,pt,ct,Ke),nt=new pD(se,Qe,pt),lt=new wD(se,Qe,pt),pt.programs=Ie.programs,x.capabilities=ct,x.extensions=Qe,x.properties=Y,x.renderLists=Ge,x.shadowMap=De,x.state=Ke,x.info=pt}H();const O=new l8(x,se);this.xr=O,this.getContext=function(){return se},this.getContextAttributes=function(){return se.getContextAttributes()},this.forceContextLoss=function(){const F=Qe.get("WEBGL_lose_context");F&&F.loseContext()},this.forceContextRestore=function(){const F=Qe.get("WEBGL_lose_context");F&&F.restoreContext()},this.getPixelRatio=function(){return te},this.setPixelRatio=function(F){F!==void 0&&(te=F,this.setSize(X,K,!1))},this.getSize=function(F){return F.set(X,K)},this.setSize=function(F,ne,ue=!0){if(O.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}X=F,K=ne,t.width=Math.floor(F*te),t.height=Math.floor(ne*te),ue===!0&&(t.style.width=F+"px",t.style.height=ne+"px"),this.setViewport(0,0,F,ne)},this.getDrawingBufferSize=function(F){return F.set(X*te,K*te).floor()},this.setDrawingBufferSize=function(F,ne,ue){X=F,K=ne,te=ue,t.width=Math.floor(F*ue),t.height=Math.floor(ne*ue),this.setViewport(0,0,F,ne)},this.getCurrentViewport=function(F){return F.copy(M)},this.getViewport=function(F){return F.copy(Q)},this.setViewport=function(F,ne,ue,he){F.isVector4?Q.set(F.x,F.y,F.z,F.w):Q.set(F,ne,ue,he),Ke.viewport(M.copy(Q).multiplyScalar(te).round())},this.getScissor=function(F){return F.copy(z)},this.setScissor=function(F,ne,ue,he){F.isVector4?z.set(F.x,F.y,F.z,F.w):z.set(F,ne,ue,he),Ke.scissor(L.copy(z).multiplyScalar(te).round())},this.getScissorTest=function(){return Z},this.setScissorTest=function(F){Ke.setScissorTest(Z=F)},this.setOpaqueSort=function(F){V=F},this.setTransparentSort=function(F){ee=F},this.getClearColor=function(F){return F.copy(Be.getClearColor())},this.setClearColor=function(){Be.setClearColor.apply(Be,arguments)},this.getClearAlpha=function(){return Be.getClearAlpha()},this.setClearAlpha=function(){Be.setClearAlpha.apply(Be,arguments)},this.clear=function(F=!0,ne=!0,ue=!0){let he=0;if(F){let oe=!1;if(T!==null){const Re=T.texture.format;oe=Re===ou||Re===td||Re===xA}if(oe){const Re=T.texture.type,Je=Re===mr||Re===Mi||Re===EA||Re===su||Re===cE||Re===uE,it=Be.getClearColor(),at=Be.getClearAlpha(),Xe=it.r,At=it.g,ft=it.b;Je?(g[0]=Xe,g[1]=At,g[2]=ft,g[3]=at,se.clearBufferuiv(se.COLOR,0,g)):(_[0]=Xe,_[1]=At,_[2]=ft,_[3]=at,se.clearBufferiv(se.COLOR,0,_))}else he|=se.COLOR_BUFFER_BIT}ne&&(he|=se.DEPTH_BUFFER_BIT),ue&&(he|=se.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),se.clear(he)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){t.removeEventListener("webglcontextlost",ge,!1),t.removeEventListener("webglcontextrestored",ve,!1),t.removeEventListener("webglcontextcreationerror",Fe,!1),Ge.dispose(),Me.dispose(),Y.dispose(),le.dispose(),pe.dispose(),He.dispose(),ut.dispose(),ht.dispose(),Ie.dispose(),O.dispose(),O.removeEventListener("sessionstart",fr),O.removeEventListener("sessionend",Vt),Er.stop()};function ge(F){F.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),I=!0}function ve(){console.log("THREE.WebGLRenderer: Context Restored."),I=!1;const F=pt.autoReset,ne=De.enabled,ue=De.autoUpdate,he=De.needsUpdate,oe=De.type;H(),pt.autoReset=F,De.enabled=ne,De.autoUpdate=ue,De.needsUpdate=he,De.type=oe}function Fe(F){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",F.statusMessage)}function Pe(F){const ne=F.target;ne.removeEventListener("dispose",Pe),vt(ne)}function vt(F){Lt(F),Y.remove(F)}function Lt(F){const ne=Y.get(F).programs;ne!==void 0&&(ne.forEach(function(ue){Ie.releaseProgram(ue)}),F.isShaderMaterial&&Ie.releaseShaderCache(F))}this.renderBufferDirect=function(F,ne,ue,he,oe,Re){ne===null&&(ne=Le);const Je=oe.isMesh&&oe.matrixWorld.determinant()<0,it=d0(F,ne,ue,he,oe);Ke.setMaterial(he,Je);let at=ue.index,Xe=1;if(he.wireframe===!0){if(at=ye.getWireframeAttribute(ue),at===void 0)return;Xe=2}const At=ue.drawRange,ft=ue.attributes.position;let Lr=At.start*Xe,er=(At.start+At.count)*Xe;Re!==null&&(Lr=Math.max(Lr,Re.start*Xe),er=Math.min(er,(Re.start+Re.count)*Xe)),at!==null?(Lr=Math.max(Lr,0),er=Math.min(er,at.count)):ft!=null&&(Lr=Math.max(Lr,0),er=Math.min(er,ft.count));const Dn=er-Lr;if(Dn<0||Dn===1/0)return;ut.setup(oe,he,it,ue,at);let pi,jt=nt;if(at!==null&&(pi=me.get(at),jt=lt,jt.setIndex(pi)),oe.isMesh)he.wireframe===!0?(Ke.setLineWidth(he.wireframeLinewidth*st()),jt.setMode(se.LINES)):jt.setMode(se.TRIANGLES);else if(oe.isLine){let tt=he.linewidth;tt===void 0&&(tt=1),Ke.setLineWidth(tt*st()),oe.isLineSegments?jt.setMode(se.LINES):oe.isLineLoop?jt.setMode(se.LINE_LOOP):jt.setMode(se.LINE_STRIP)}else oe.isPoints?jt.setMode(se.POINTS):oe.isSprite&&jt.setMode(se.TRIANGLES);if(oe.isBatchedMesh)jt.renderMultiDraw(oe._multiDrawStarts,oe._multiDrawCounts,oe._multiDrawCount);else if(oe.isInstancedMesh)jt.renderInstances(Lr,Dn,oe.count);else if(ue.isInstancedBufferGeometry){const tt=ue._maxInstanceCount!==void 0?ue._maxInstanceCount:1/0,Zu=Math.min(ue.instanceCount,tt);jt.renderInstances(Lr,Dn,Zu)}else jt.render(Lr,Dn)};function Nt(F,ne,ue){F.transparent===!0&&F.side===wi&&F.forceSinglePass===!1?(F.side=Qr,F.needsUpdate=!0,Us(F,ne,ue),F.side=xi,F.needsUpdate=!0,Us(F,ne,ue),F.side=wi):Us(F,ne,ue)}this.compile=function(F,ne,ue=null){ue===null&&(ue=F),m=Me.get(ue),m.init(),w.push(m),ue.traverseVisible(function(oe){oe.isLight&&oe.layers.test(ne.layers)&&(m.pushLight(oe),oe.castShadow&&m.pushShadow(oe))}),F!==ue&&F.traverseVisible(function(oe){oe.isLight&&oe.layers.test(ne.layers)&&(m.pushLight(oe),oe.castShadow&&m.pushShadow(oe))}),m.setupLights(x._useLegacyLights);const he=new Set;return F.traverse(function(oe){const Re=oe.material;if(Re)if(Array.isArray(Re))for(let Je=0;Je<Re.length;Je++){const it=Re[Je];Nt(it,ue,oe),he.add(it)}else Nt(Re,ue,oe),he.add(Re)}),w.pop(),m=null,he},this.compileAsync=function(F,ne,ue=null){const he=this.compile(F,ne,ue);return new Promise(oe=>{function Re(){if(he.forEach(function(Je){Y.get(Je).currentProgram.isReady()&&he.delete(Je)}),he.size===0){oe(F);return}setTimeout(Re,10)}Qe.get("KHR_parallel_shader_compile")!==null?Re():setTimeout(Re,10)})};let Bt=null;function _t(F){Bt&&Bt(F)}function fr(){Er.stop()}function Vt(){Er.start()}const Er=new A2;Er.setAnimationLoop(_t),typeof self<"u"&&Er.setContext(self),this.setAnimationLoop=function(F){Bt=F,O.setAnimationLoop(F),F===null?Er.stop():Er.start()},O.addEventListener("sessionstart",fr),O.addEventListener("sessionend",Vt),this.render=function(F,ne){if(ne!==void 0&&ne.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(I===!0)return;F.matrixWorldAutoUpdate===!0&&F.updateMatrixWorld(),ne.parent===null&&ne.matrixWorldAutoUpdate===!0&&ne.updateMatrixWorld(),O.enabled===!0&&O.isPresenting===!0&&(O.cameraAutoUpdate===!0&&O.updateCamera(ne),ne=O.getCamera()),F.isScene===!0&&F.onBeforeRender(x,F,ne,T),m=Me.get(F,w.length),m.init(),w.push(m),Ae.multiplyMatrices(ne.projectionMatrix,ne.matrixWorldInverse),re.setFromProjectionMatrix(Ae),de=this.localClippingEnabled,j=fe.init(this.clippingPlanes,de),E=Ge.get(F,v.length),E.init(),v.push(E),Rn(F,ne,0,x.sortObjects),E.finish(),x.sortObjects===!0&&E.sort(V,ee),this.info.render.frame++,j===!0&&fe.beginShadows();const ue=m.state.shadowsArray;if(De.render(ue,F,ne),j===!0&&fe.endShadows(),this.info.autoReset===!0&&this.info.reset(),(O.enabled===!1||O.isPresenting===!1||O.hasDepthSensing()===!1)&&Be.render(E,F),m.setupLights(x._useLegacyLights),ne.isArrayCamera){const he=ne.cameras;for(let oe=0,Re=he.length;oe<Re;oe++){const Je=he[oe];qt(E,F,Je,Je.viewport)}}else qt(E,F,ne);T!==null&&(k.updateMultisampleRenderTarget(T),k.updateRenderTargetMipmap(T)),F.isScene===!0&&F.onAfterRender(x,F,ne),ut.resetDefaultState(),D=-1,b=null,w.pop(),w.length>0?m=w[w.length-1]:m=null,v.pop(),v.length>0?E=v[v.length-1]:E=null};function Rn(F,ne,ue,he){if(F.visible===!1)return;if(F.layers.test(ne.layers)){if(F.isGroup)ue=F.renderOrder;else if(F.isLOD)F.autoUpdate===!0&&F.update(ne);else if(F.isLight)m.pushLight(F),F.castShadow&&m.pushShadow(F);else if(F.isSprite){if(!F.frustumCulled||re.intersectsSprite(F)){he&&Ee.setFromMatrixPosition(F.matrixWorld).applyMatrix4(Ae);const Re=He.update(F),Je=F.material;Je.visible&&E.push(F,Re,Je,ue,Ee.z,null)}}else if((F.isMesh||F.isLine||F.isPoints)&&(!F.frustumCulled||re.intersectsObject(F))){const Re=He.update(F),Je=F.material;if(he&&(F.boundingSphere!==void 0?(F.boundingSphere===null&&F.computeBoundingSphere(),Ee.copy(F.boundingSphere.center)):(Re.boundingSphere===null&&Re.computeBoundingSphere(),Ee.copy(Re.boundingSphere.center)),Ee.applyMatrix4(F.matrixWorld).applyMatrix4(Ae)),Array.isArray(Je)){const it=Re.groups;for(let at=0,Xe=it.length;at<Xe;at++){const At=it[at],ft=Je[At.materialIndex];ft&&ft.visible&&E.push(F,Re,ft,ue,Ee.z,At)}}else Je.visible&&E.push(F,Re,Je,ue,Ee.z,null)}}const oe=F.children;for(let Re=0,Je=oe.length;Re<Je;Re++)Rn(oe[Re],ne,ue,he)}function qt(F,ne,ue,he){const oe=F.opaque,Re=F.transmissive,Je=F.transparent;m.setupLightsView(ue),j===!0&&fe.setGlobalState(x.clippingPlanes,ue),Re.length>0&&fi(oe,Re,ne,ue),he&&Ke.viewport(M.copy(he)),oe.length>0&&Zn(oe,ne,ue),Re.length>0&&Zn(Re,ne,ue),Je.length>0&&Zn(Je,ne,ue),Ke.buffers.depth.setTest(!0),Ke.buffers.depth.setMask(!0),Ke.buffers.color.setMask(!0),Ke.setPolygonOffset(!1)}function fi(F,ne,ue,he){if((ue.isScene===!0?ue.overrideMaterial:null)!==null)return;if(m.state.transmissionRenderTarget===null){m.state.transmissionRenderTarget=new cn(1,1,{generateMipmaps:!0,type:Qe.has("EXT_color_buffer_half_float")||Qe.has("EXT_color_buffer_float")?Or:mr,minFilter:Ci,samples:4,stencilBuffer:s});const at=Y.get(m.state.transmissionRenderTarget);at.__isTransmissionRenderTarget=!0}const oe=m.state.transmissionRenderTarget;x.getDrawingBufferSize(_e),oe.setSize(_e.x,_e.y);const Re=x.getRenderTarget();x.setRenderTarget(oe),x.getClearColor(N),W=x.getClearAlpha(),W<1&&x.setClearColor(16777215,.5),x.clear();const Je=x.toneMapping;x.toneMapping=Zs,Zn(F,ue,he),k.updateMultisampleRenderTarget(oe),k.updateRenderTargetMipmap(oe);let it=!1;for(let at=0,Xe=ne.length;at<Xe;at++){const At=ne[at],ft=At.object,Lr=At.geometry,er=At.material,Dn=At.group;if(er.side===wi&&ft.layers.test(he.layers)){const pi=er.side;er.side=Qr,er.needsUpdate=!0,Ns(ft,ue,he,Lr,er,Dn),er.side=pi,er.needsUpdate=!0,it=!0}}it===!0&&(k.updateMultisampleRenderTarget(oe),k.updateRenderTargetMipmap(oe)),x.setRenderTarget(Re),x.setClearColor(N,W),x.toneMapping=Je}function Zn(F,ne,ue){const he=ne.isScene===!0?ne.overrideMaterial:null;for(let oe=0,Re=F.length;oe<Re;oe++){const Je=F[oe],it=Je.object,at=Je.geometry,Xe=he===null?Je.material:he,At=Je.group;it.layers.test(ue.layers)&&Ns(it,ne,ue,at,Xe,At)}}function Ns(F,ne,ue,he,oe,Re){F.onBeforeRender(x,ne,ue,he,oe,Re),F.modelViewMatrix.multiplyMatrices(ue.matrixWorldInverse,F.matrixWorld),F.normalMatrix.getNormalMatrix(F.modelViewMatrix),oe.onBeforeRender(x,ne,ue,he,F,Re),oe.transparent===!0&&oe.side===wi&&oe.forceSinglePass===!1?(oe.side=Qr,oe.needsUpdate=!0,x.renderBufferDirect(ue,ne,he,oe,F,Re),oe.side=xi,oe.needsUpdate=!0,x.renderBufferDirect(ue,ne,he,oe,F,Re),oe.side=wi):x.renderBufferDirect(ue,ne,he,oe,F,Re),F.onAfterRender(x,ne,ue,he,oe,Re)}function Us(F,ne,ue){ne.isScene!==!0&&(ne=Le);const he=Y.get(F),oe=m.state.lights,Re=m.state.shadowsArray,Je=oe.state.version,it=Ie.getParameters(F,oe.state,Re,ne,ue),at=Ie.getProgramCacheKey(it);let Xe=he.programs;he.environment=F.isMeshStandardMaterial?ne.environment:null,he.fog=ne.fog,he.envMap=(F.isMeshStandardMaterial?pe:le).get(F.envMap||he.environment),he.envMapRotation=he.environment!==null&&F.envMap===null?ne.environmentRotation:F.envMapRotation,Xe===void 0&&(F.addEventListener("dispose",Pe),Xe=new Map,he.programs=Xe);let At=Xe.get(at);if(At!==void 0){if(he.currentProgram===At&&he.lightsStateVersion===Je)return Rf(F,it),At}else it.uniforms=Ie.getUniforms(F),F.onBuild(ue,it,x),F.onBeforeCompile(it,x),At=Ie.acquireProgram(it,at),Xe.set(at,At),he.uniforms=it.uniforms;const ft=he.uniforms;return(!F.isShaderMaterial&&!F.isRawShaderMaterial||F.clipping===!0)&&(ft.clippingPlanes=fe.uniform),Rf(F,it),he.needsLights=Ps(F),he.lightsStateVersion=Je,he.needsLights&&(ft.ambientLightColor.value=oe.state.ambient,ft.lightProbe.value=oe.state.probe,ft.directionalLights.value=oe.state.directional,ft.directionalLightShadows.value=oe.state.directionalShadow,ft.spotLights.value=oe.state.spot,ft.spotLightShadows.value=oe.state.spotShadow,ft.rectAreaLights.value=oe.state.rectArea,ft.ltc_1.value=oe.state.rectAreaLTC1,ft.ltc_2.value=oe.state.rectAreaLTC2,ft.pointLights.value=oe.state.point,ft.pointLightShadows.value=oe.state.pointShadow,ft.hemisphereLights.value=oe.state.hemi,ft.directionalShadowMap.value=oe.state.directionalShadowMap,ft.directionalShadowMatrix.value=oe.state.directionalShadowMatrix,ft.spotShadowMap.value=oe.state.spotShadowMap,ft.spotLightMatrix.value=oe.state.spotLightMatrix,ft.spotLightMap.value=oe.state.spotLightMap,ft.pointShadowMap.value=oe.state.pointShadowMap,ft.pointShadowMatrix.value=oe.state.pointShadowMatrix),he.currentProgram=At,he.uniformsList=null,At}function dc(F){if(F.uniformsList===null){const ne=F.currentProgram.getUniforms();F.uniformsList=Ud.seqWithValue(ne.seq,F.uniforms)}return F.uniformsList}function Rf(F,ne){const ue=Y.get(F);ue.outputColorSpace=ne.outputColorSpace,ue.batching=ne.batching,ue.instancing=ne.instancing,ue.instancingColor=ne.instancingColor,ue.instancingMorph=ne.instancingMorph,ue.skinning=ne.skinning,ue.morphTargets=ne.morphTargets,ue.morphNormals=ne.morphNormals,ue.morphColors=ne.morphColors,ue.morphTargetsCount=ne.morphTargetsCount,ue.numClippingPlanes=ne.numClippingPlanes,ue.numIntersection=ne.numClipIntersection,ue.vertexAlphas=ne.vertexAlphas,ue.vertexTangents=ne.vertexTangents,ue.toneMapping=ne.toneMapping}function d0(F,ne,ue,he,oe){ne.isScene!==!0&&(ne=Le),k.resetTextureUnits();const Re=ne.fog,Je=he.isMeshStandardMaterial?ne.environment:null,it=T===null?x.outputColorSpace:T.isXRRenderTarget===!0?T.texture.colorSpace:cr,at=(he.isMeshStandardMaterial?pe:le).get(he.envMap||Je),Xe=he.vertexColors===!0&&!!ue.attributes.color&&ue.attributes.color.itemSize===4,At=!!ue.attributes.tangent&&(!!he.normalMap||he.anisotropy>0),ft=!!ue.morphAttributes.position,Lr=!!ue.morphAttributes.normal,er=!!ue.morphAttributes.color;let Dn=Zs;he.toneMapped&&(T===null||T.isXRRenderTarget===!0)&&(Dn=x.toneMapping);const pi=ue.morphAttributes.position||ue.morphAttributes.normal||ue.morphAttributes.color,jt=pi!==void 0?pi.length:0,tt=Y.get(he),Zu=m.state.lights;if(j===!0&&(de===!0||F!==b)){const Nn=F===b&&he.id===D;fe.setState(he,F,Nn)}let vn=!1;he.version===tt.__version?(tt.needsLights&&tt.lightsStateVersion!==Zu.state.version||tt.outputColorSpace!==it||oe.isBatchedMesh&&tt.batching===!1||!oe.isBatchedMesh&&tt.batching===!0||oe.isInstancedMesh&&tt.instancing===!1||!oe.isInstancedMesh&&tt.instancing===!0||oe.isSkinnedMesh&&tt.skinning===!1||!oe.isSkinnedMesh&&tt.skinning===!0||oe.isInstancedMesh&&tt.instancingColor===!0&&oe.instanceColor===null||oe.isInstancedMesh&&tt.instancingColor===!1&&oe.instanceColor!==null||oe.isInstancedMesh&&tt.instancingMorph===!0&&oe.morphTexture===null||oe.isInstancedMesh&&tt.instancingMorph===!1&&oe.morphTexture!==null||tt.envMap!==at||he.fog===!0&&tt.fog!==Re||tt.numClippingPlanes!==void 0&&(tt.numClippingPlanes!==fe.numPlanes||tt.numIntersection!==fe.numIntersection)||tt.vertexAlphas!==Xe||tt.vertexTangents!==At||tt.morphTargets!==ft||tt.morphNormals!==Lr||tt.morphColors!==er||tt.toneMapping!==Dn||tt.morphTargetsCount!==jt)&&(vn=!0):(vn=!0,tt.__version=he.version);let ks=tt.currentProgram;vn===!0&&(ks=Us(he,ne,oe));let Df=!1,Uo=!1,Ca=!1;const xr=ks.getUniforms(),Ln=tt.uniforms;if(Ke.useProgram(ks.program)&&(Df=!0,Uo=!0,Ca=!0),he.id!==D&&(D=he.id,Uo=!0),Df||b!==F){xr.setValue(se,"projectionMatrix",F.projectionMatrix),xr.setValue(se,"viewMatrix",F.matrixWorldInverse);const Nn=xr.map.cameraPosition;Nn!==void 0&&Nn.setValue(se,Ee.setFromMatrixPosition(F.matrixWorld)),ct.logarithmicDepthBuffer&&xr.setValue(se,"logDepthBufFC",2/(Math.log(F.far+1)/Math.LN2)),(he.isMeshPhongMaterial||he.isMeshToonMaterial||he.isMeshLambertMaterial||he.isMeshBasicMaterial||he.isMeshStandardMaterial||he.isShaderMaterial)&&xr.setValue(se,"isOrthographic",F.isOrthographicCamera===!0),b!==F&&(b=F,Uo=!0,Ca=!0)}if(oe.isSkinnedMesh){xr.setOptional(se,oe,"bindMatrix"),xr.setOptional(se,oe,"bindMatrixInverse");const Nn=oe.skeleton;Nn&&(Nn.boneTexture===null&&Nn.computeBoneTexture(),xr.setValue(se,"boneTexture",Nn.boneTexture,k))}oe.isBatchedMesh&&(xr.setOptional(se,oe,"batchingTexture"),xr.setValue(se,"batchingTexture",oe._matricesTexture,k));const Ma=ue.morphAttributes;if((Ma.position!==void 0||Ma.normal!==void 0||Ma.color!==void 0)&&be.update(oe,ue,ks),(Uo||tt.receiveShadow!==oe.receiveShadow)&&(tt.receiveShadow=oe.receiveShadow,xr.setValue(se,"receiveShadow",oe.receiveShadow)),he.isMeshGouraudMaterial&&he.envMap!==null&&(Ln.envMap.value=at,Ln.flipEnvMap.value=at.isCubeTexture&&at.isRenderTargetTexture===!1?-1:1),he.isMeshStandardMaterial&&he.envMap===null&&ne.environment!==null&&(Ln.envMapIntensity.value=ne.environmentIntensity),Uo&&(xr.setValue(se,"toneMappingExposure",x.toneMappingExposure),tt.needsLights&&f0(Ln,Ca),Re&&he.fog===!0&&je.refreshFogUniforms(Ln,Re),je.refreshMaterialUniforms(Ln,he,te,K,m.state.transmissionRenderTarget),Ud.upload(se,dc(tt),Ln,k)),he.isShaderMaterial&&he.uniformsNeedUpdate===!0&&(Ud.upload(se,dc(tt),Ln,k),he.uniformsNeedUpdate=!1),he.isSpriteMaterial&&xr.setValue(se,"center",oe.center),xr.setValue(se,"modelViewMatrix",oe.modelViewMatrix),xr.setValue(se,"normalMatrix",oe.normalMatrix),xr.setValue(se,"modelMatrix",oe.matrixWorld),he.isShaderMaterial||he.isRawShaderMaterial){const Nn=he.uniformsGroups;for(let $u=0,eh=Nn.length;$u<eh;$u++){const th=Nn[$u];ht.update(th,ks),ht.bind(th,ks)}}return ks}function f0(F,ne){F.ambientLightColor.needsUpdate=ne,F.lightProbe.needsUpdate=ne,F.directionalLights.needsUpdate=ne,F.directionalLightShadows.needsUpdate=ne,F.pointLights.needsUpdate=ne,F.pointLightShadows.needsUpdate=ne,F.spotLights.needsUpdate=ne,F.spotLightShadows.needsUpdate=ne,F.rectAreaLights.needsUpdate=ne,F.hemisphereLights.needsUpdate=ne}function Ps(F){return F.isMeshLambertMaterial||F.isMeshToonMaterial||F.isMeshPhongMaterial||F.isMeshStandardMaterial||F.isShadowMaterial||F.isShaderMaterial&&F.lights===!0}this.getActiveCubeFace=function(){return R},this.getActiveMipmapLevel=function(){return S},this.getRenderTarget=function(){return T},this.setRenderTargetTextures=function(F,ne,ue){Y.get(F.texture).__webglTexture=ne,Y.get(F.depthTexture).__webglTexture=ue;const he=Y.get(F);he.__hasExternalTextures=!0,he.__autoAllocateDepthBuffer=ue===void 0,he.__autoAllocateDepthBuffer||Qe.has("WEBGL_multisampled_render_to_texture")===!0&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),he.__useRenderToTexture=!1)},this.setRenderTargetFramebuffer=function(F,ne){const ue=Y.get(F);ue.__webglFramebuffer=ne,ue.__useDefaultFramebuffer=ne===void 0},this.setRenderTarget=function(F,ne=0,ue=0){T=F,R=ne,S=ue;let he=!0,oe=null,Re=!1,Je=!1;if(F){const it=Y.get(F);it.__useDefaultFramebuffer!==void 0?(Ke.bindFramebuffer(se.FRAMEBUFFER,null),he=!1):it.__webglFramebuffer===void 0?k.setupRenderTarget(F):it.__hasExternalTextures&&k.rebindTextures(F,Y.get(F.texture).__webglTexture,Y.get(F.depthTexture).__webglTexture);const at=F.texture;(at.isData3DTexture||at.isDataArrayTexture||at.isCompressedArrayTexture)&&(Je=!0);const Xe=Y.get(F).__webglFramebuffer;F.isWebGLCubeRenderTarget?(Array.isArray(Xe[ne])?oe=Xe[ne][ue]:oe=Xe[ne],Re=!0):F.samples>0&&k.useMultisampledRTT(F)===!1?oe=Y.get(F).__webglMultisampledFramebuffer:Array.isArray(Xe)?oe=Xe[ue]:oe=Xe,M.copy(F.viewport),L.copy(F.scissor),P=F.scissorTest}else M.copy(Q).multiplyScalar(te).floor(),L.copy(z).multiplyScalar(te).floor(),P=Z;if(Ke.bindFramebuffer(se.FRAMEBUFFER,oe)&&he&&Ke.drawBuffers(F,oe),Ke.viewport(M),Ke.scissor(L),Ke.setScissorTest(P),Re){const it=Y.get(F.texture);se.framebufferTexture2D(se.FRAMEBUFFER,se.COLOR_ATTACHMENT0,se.TEXTURE_CUBE_MAP_POSITIVE_X+ne,it.__webglTexture,ue)}else if(Je){const it=Y.get(F.texture),at=ne||0;se.framebufferTextureLayer(se.FRAMEBUFFER,se.COLOR_ATTACHMENT0,it.__webglTexture,ue||0,at)}D=-1},this.readRenderTargetPixels=function(F,ne,ue,he,oe,Re,Je){if(!(F&&F.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let it=Y.get(F).__webglFramebuffer;if(F.isWebGLCubeRenderTarget&&Je!==void 0&&(it=it[Je]),it){Ke.bindFramebuffer(se.FRAMEBUFFER,it);try{const at=F.texture,Xe=at.format,At=at.type;if(Xe!==vr&&dt.convert(Xe)!==se.getParameter(se.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const ft=At===Or&&(Qe.has("EXT_color_buffer_half_float")||Qe.has("EXT_color_buffer_float"));if(At!==mr&&dt.convert(At)!==se.getParameter(se.IMPLEMENTATION_COLOR_READ_TYPE)&&At!==lr&&!ft){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}ne>=0&&ne<=F.width-he&&ue>=0&&ue<=F.height-oe&&se.readPixels(ne,ue,he,oe,dt.convert(Xe),dt.convert(At),Re)}finally{const at=T!==null?Y.get(T).__webglFramebuffer:null;Ke.bindFramebuffer(se.FRAMEBUFFER,at)}}},this.copyFramebufferToTexture=function(F,ne,ue=0){const he=Math.pow(2,-ue),oe=Math.floor(ne.image.width*he),Re=Math.floor(ne.image.height*he);k.setTexture2D(ne,0),se.copyTexSubImage2D(se.TEXTURE_2D,ue,0,0,F.x,F.y,oe,Re),Ke.unbindTexture()},this.copyTextureToTexture=function(F,ne,ue,he=0){const oe=ne.image.width,Re=ne.image.height,Je=dt.convert(ue.format),it=dt.convert(ue.type);k.setTexture2D(ue,0),se.pixelStorei(se.UNPACK_FLIP_Y_WEBGL,ue.flipY),se.pixelStorei(se.UNPACK_PREMULTIPLY_ALPHA_WEBGL,ue.premultiplyAlpha),se.pixelStorei(se.UNPACK_ALIGNMENT,ue.unpackAlignment),ne.isDataTexture?se.texSubImage2D(se.TEXTURE_2D,he,F.x,F.y,oe,Re,Je,it,ne.image.data):ne.isCompressedTexture?se.compressedTexSubImage2D(se.TEXTURE_2D,he,F.x,F.y,ne.mipmaps[0].width,ne.mipmaps[0].height,Je,ne.mipmaps[0].data):se.texSubImage2D(se.TEXTURE_2D,he,F.x,F.y,Je,it,ne.image),he===0&&ue.generateMipmaps&&se.generateMipmap(se.TEXTURE_2D),Ke.unbindTexture()},this.copyTextureToTexture3D=function(F,ne,ue,he,oe=0){const Re=Math.round(F.max.x-F.min.x),Je=Math.round(F.max.y-F.min.y),it=F.max.z-F.min.z+1,at=dt.convert(he.format),Xe=dt.convert(he.type);let At;if(he.isData3DTexture)k.setTexture3D(he,0),At=se.TEXTURE_3D;else if(he.isDataArrayTexture||he.isCompressedArrayTexture)k.setTexture2DArray(he,0),At=se.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}se.pixelStorei(se.UNPACK_FLIP_Y_WEBGL,he.flipY),se.pixelStorei(se.UNPACK_PREMULTIPLY_ALPHA_WEBGL,he.premultiplyAlpha),se.pixelStorei(se.UNPACK_ALIGNMENT,he.unpackAlignment);const ft=se.getParameter(se.UNPACK_ROW_LENGTH),Lr=se.getParameter(se.UNPACK_IMAGE_HEIGHT),er=se.getParameter(se.UNPACK_SKIP_PIXELS),Dn=se.getParameter(se.UNPACK_SKIP_ROWS),pi=se.getParameter(se.UNPACK_SKIP_IMAGES),jt=ue.isCompressedTexture?ue.mipmaps[oe]:ue.image;se.pixelStorei(se.UNPACK_ROW_LENGTH,jt.width),se.pixelStorei(se.UNPACK_IMAGE_HEIGHT,jt.height),se.pixelStorei(se.UNPACK_SKIP_PIXELS,F.min.x),se.pixelStorei(se.UNPACK_SKIP_ROWS,F.min.y),se.pixelStorei(se.UNPACK_SKIP_IMAGES,F.min.z),ue.isDataTexture||ue.isData3DTexture?se.texSubImage3D(At,oe,ne.x,ne.y,ne.z,Re,Je,it,at,Xe,jt.data):he.isCompressedArrayTexture?se.compressedTexSubImage3D(At,oe,ne.x,ne.y,ne.z,Re,Je,it,at,jt.data):se.texSubImage3D(At,oe,ne.x,ne.y,ne.z,Re,Je,it,at,Xe,jt),se.pixelStorei(se.UNPACK_ROW_LENGTH,ft),se.pixelStorei(se.UNPACK_IMAGE_HEIGHT,Lr),se.pixelStorei(se.UNPACK_SKIP_PIXELS,er),se.pixelStorei(se.UNPACK_SKIP_ROWS,Dn),se.pixelStorei(se.UNPACK_SKIP_IMAGES,pi),oe===0&&he.generateMipmaps&&se.generateMipmap(At),Ke.unbindTexture()},this.initTexture=function(F){F.isCubeTexture?k.setTextureCube(F,0):F.isData3DTexture?k.setTexture3D(F,0):F.isDataArrayTexture||F.isCompressedArrayTexture?k.setTexture2DArray(F,0):k.setTexture2D(F,0),Ke.unbindTexture()},this.resetState=function(){R=0,S=0,T=null,Ke.reset(),ut.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return vs}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=e===ad?"display-p3":"srgb",t.unpackColorSpace=Tt.workingColorSpace===cu?"display-p3":"srgb"}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(e){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=e}}class f8 extends Zt{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new qi,this.environmentIntensity=1,this.environmentRotation=new qi,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}}class p8{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=LA,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=Si()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return zE("THREE.InterleavedBuffer: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let i=0,s=this.stride;i<s;i++)this.array[e+i]=t.array[n+i];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Si()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),n=new this.constructor(t,this.stride);return n.setUsage(this.usage),n}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Si()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}const fn=new G;class ug{constructor(e,t,n,i=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=e,this.itemSize=t,this.offset=n,this.normalized=i}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,n=this.data.count;t<n;t++)fn.fromBufferAttribute(this,t),fn.applyMatrix4(e),this.setXYZ(t,fn.x,fn.y,fn.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)fn.fromBufferAttribute(this,t),fn.applyNormalMatrix(e),this.setXYZ(t,fn.x,fn.y,fn.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)fn.fromBufferAttribute(this,t),fn.transformDirection(e),this.setXYZ(t,fn.x,fn.y,fn.z);return this}getComponent(e,t){let n=this.array[e*this.data.stride+this.offset+t];return this.normalized&&(n=Ti(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=Ut(n,this.array)),this.data.array[e*this.data.stride+this.offset+t]=n,this}setX(e,t){return this.normalized&&(t=Ut(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=Ut(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=Ut(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=Ut(t,this.array)),this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){let t=this.data.array[e*this.data.stride+this.offset];return this.normalized&&(t=Ti(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=Ti(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=Ti(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=Ti(t,this.array)),t}setXY(e,t,n){return e=e*this.data.stride+this.offset,this.normalized&&(t=Ut(t,this.array),n=Ut(n,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this}setXYZ(e,t,n,i){return e=e*this.data.stride+this.offset,this.normalized&&(t=Ut(t,this.array),n=Ut(n,this.array),i=Ut(i,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=i,this}setXYZW(e,t,n,i,s){return e=e*this.data.stride+this.offset,this.normalized&&(t=Ut(t,this.array),n=Ut(n,this.array),i=Ut(i,this.array),s=Ut(s,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=i,this.data.array[e+3]=s,this}clone(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let n=0;n<this.count;n++){const i=n*this.data.stride+this.offset;for(let s=0;s<this.itemSize;s++)t.push(this.data.array[i+s])}return new zr(new this.array.constructor(t),this.itemSize,this.normalized)}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new ug(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let n=0;n<this.count;n++){const i=n*this.data.stride+this.offset;for(let s=0;s<this.itemSize;s++)t.push(this.data.array[i+s])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}const j2=new G,W2=new Ft,Y2=new Ft,A8=new G,q2=new rt,Pd=new G,hg=new bi,X2=new rt,dg=new co;class g8 extends Xr{constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=sE,this.bindMatrix=new rt,this.bindMatrixInverse=new rt,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){const e=this.geometry;this.boundingBox===null&&(this.boundingBox=new _r),this.boundingBox.makeEmpty();const t=e.getAttribute("position");for(let n=0;n<t.count;n++)this.getVertexPosition(n,Pd),this.boundingBox.expandByPoint(Pd)}computeBoundingSphere(){const e=this.geometry;this.boundingSphere===null&&(this.boundingSphere=new bi),this.boundingSphere.makeEmpty();const t=e.getAttribute("position");for(let n=0;n<t.count;n++)this.getVertexPosition(n,Pd),this.boundingSphere.expandByPoint(Pd)}copy(e,t){return super.copy(e,t),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}raycast(e,t){const n=this.material,i=this.matrixWorld;n!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),hg.copy(this.boundingSphere),hg.applyMatrix4(i),e.ray.intersectsSphere(hg)!==!1&&(X2.copy(i).invert(),dg.copy(e.ray).applyMatrix4(X2),!(this.boundingBox!==null&&dg.intersectsBox(this.boundingBox)===!1)&&this._computeIntersections(e,t,dg)))}getVertexPosition(e,t){return super.getVertexPosition(e,t),this.applyBoneTransform(e,t),t}bind(e,t){this.skeleton=e,t===void 0&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const e=new Ft,t=this.geometry.attributes.skinWeight;for(let n=0,i=t.count;n<i;n++){e.fromBufferAttribute(t,n);const s=1/e.manhattanLength();s!==1/0?e.multiplyScalar(s):e.set(1,0,0,0),t.setXYZW(n,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMode===sE?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===xb?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(e,t){const n=this.skeleton,i=this.geometry;W2.fromBufferAttribute(i.attributes.skinIndex,e),Y2.fromBufferAttribute(i.attributes.skinWeight,e),j2.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let s=0;s<4;s++){const o=Y2.getComponent(s);if(o!==0){const l=W2.getComponent(s);q2.multiplyMatrices(n.bones[l].matrixWorld,n.boneInverses[l]),t.addScaledVector(A8.copy(j2).applyMatrix4(q2),o)}}return t.applyMatrix4(this.bindMatrixInverse)}}class K2 extends Zt{constructor(){super(),this.isBone=!0,this.type="Bone"}}class mo extends br{constructor(e=null,t=1,n=1,i,s,o,l,h,u=Ar,d=Ar,A,p){super(null,o,l,h,u,d,i,s,A,p),this.isDataTexture=!0,this.image={data:e,width:t,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const J2=new rt,m8=new rt;class fg{constructor(e=[],t=[]){this.uuid=Si(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.init()}init(){const e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(e.length*16),t.length===0)this.calculateInverses();else if(e.length!==t.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let n=0,i=this.bones.length;n<i;n++)this.boneInverses.push(new rt)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){const n=new rt;this.bones[e]&&n.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(n)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){const n=this.bones[e];n&&n.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){const n=this.bones[e];n&&(n.parent&&n.parent.isBone?(n.matrix.copy(n.parent.matrixWorld).invert(),n.matrix.multiply(n.matrixWorld)):n.matrix.copy(n.matrixWorld),n.matrix.decompose(n.position,n.quaternion,n.scale))}}update(){const e=this.bones,t=this.boneInverses,n=this.boneMatrices,i=this.boneTexture;for(let s=0,o=e.length;s<o;s++){const l=e[s]?e[s].matrixWorld:m8;J2.multiplyMatrices(l,t[s]),J2.toArray(n,s*16)}i!==null&&(i.needsUpdate=!0)}clone(){return new fg(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(this.bones.length*4);e=Math.ceil(e/4)*4,e=Math.max(e,4);const t=new Float32Array(e*e*4);t.set(this.boneMatrices);const n=new mo(t,e,e,vr,lr);return n.needsUpdate=!0,this.boneMatrices=t,this.boneTexture=n,this}getBoneByName(e){for(let t=0,n=this.bones.length;t<n;t++){const i=this.bones[t];if(i.name===e)return i}}dispose(){this.boneTexture!==null&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let n=0,i=e.bones.length;n<i;n++){const s=e.bones[n];let o=t[s];o===void 0&&(console.warn("THREE.Skeleton: No bone found with UUID:",s),o=new K2),this.bones.push(o),this.boneInverses.push(new rt().fromArray(e.boneInverses[n]))}return this.init(),this}toJSON(){const e={metadata:{version:4.6,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;const t=this.bones,n=this.boneInverses;for(let i=0,s=t.length;i<s;i++){const o=t[i];e.bones.push(o.uuid);const l=n[i];e.boneInverses.push(l.toArray())}return e}}class pg extends zr{constructor(e,t,n,i=1){super(e,t,n),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=i}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){const e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}const Dl=new rt,Z2=new rt,kd=[],$2=new _r,v8=new rt,Eu=new Xr,xu=new bi;class _8 extends Xr{constructor(e,t,n){super(e,t),this.isInstancedMesh=!0,this.instanceMatrix=new pg(new Float32Array(n*16),16),this.instanceColor=null,this.morphTexture=null,this.count=n,this.boundingBox=null,this.boundingSphere=null;for(let i=0;i<n;i++)this.setMatrixAt(i,v8)}computeBoundingBox(){const e=this.geometry,t=this.count;this.boundingBox===null&&(this.boundingBox=new _r),e.boundingBox===null&&e.computeBoundingBox(),this.boundingBox.makeEmpty();for(let n=0;n<t;n++)this.getMatrixAt(n,Dl),$2.copy(e.boundingBox).applyMatrix4(Dl),this.boundingBox.union($2)}computeBoundingSphere(){const e=this.geometry,t=this.count;this.boundingSphere===null&&(this.boundingSphere=new bi),e.boundingSphere===null&&e.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(let n=0;n<t;n++)this.getMatrixAt(n,Dl),xu.copy(e.boundingSphere).applyMatrix4(Dl),this.boundingSphere.union(xu)}copy(e,t){return super.copy(e,t),this.instanceMatrix.copy(e.instanceMatrix),e.morphTexture!==null&&(this.morphTexture=e.morphTexture.clone()),e.instanceColor!==null&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}getColorAt(e,t){t.fromArray(this.instanceColor.array,e*3)}getMatrixAt(e,t){t.fromArray(this.instanceMatrix.array,e*16)}getMorphAt(e,t){const n=t.morphTargetInfluences,i=this.morphTexture.source.data.data,s=n.length+1,o=e*s+1;for(let l=0;l<n.length;l++)n[l]=i[o+l]}raycast(e,t){const n=this.matrixWorld,i=this.count;if(Eu.geometry=this.geometry,Eu.material=this.material,Eu.material!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),xu.copy(this.boundingSphere),xu.applyMatrix4(n),e.ray.intersectsSphere(xu)!==!1))for(let s=0;s<i;s++){this.getMatrixAt(s,Dl),Z2.multiplyMatrices(n,Dl),Eu.matrixWorld=Z2,Eu.raycast(e,kd);for(let o=0,l=kd.length;o<l;o++){const h=kd[o];h.instanceId=s,h.object=this,t.push(h)}kd.length=0}}setColorAt(e,t){this.instanceColor===null&&(this.instanceColor=new pg(new Float32Array(this.instanceMatrix.count*3),3)),t.toArray(this.instanceColor.array,e*3)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,e*16)}setMorphAt(e,t){const n=t.morphTargetInfluences,i=n.length+1;this.morphTexture===null&&(this.morphTexture=new mo(new Float32Array(i*this.count),i,this.count,ea,lr));const s=this.morphTexture.source.data.data;let o=0;for(let u=0;u<n.length;u++)o+=n[u];const l=this.geometry.morphTargetsRelative?1:1-o,h=i*e;s[h]=l,s.set(n,h+1)}updateMorphTargets(){}dispose(){return this.dispatchEvent({type:"dispose"}),this.morphTexture!==null&&(this.morphTexture.dispose(),this.morphTexture=null),this}}class ex extends Xi{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new Ve(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}}const tx=new G,rx=new G,nx=new rt,Ag=new co,Qd=new bi;class gg extends Zt{constructor(e=new Vn,t=new ex){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,n=[0];for(let i=1,s=t.count;i<s;i++)tx.fromBufferAttribute(t,i-1),rx.fromBufferAttribute(t,i),n[i]=n[i-1],n[i]+=tx.distanceTo(rx);e.setAttribute("lineDistance",new Li(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,t){const n=this.geometry,i=this.matrixWorld,s=e.params.Line.threshold,o=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),Qd.copy(n.boundingSphere),Qd.applyMatrix4(i),Qd.radius+=s,e.ray.intersectsSphere(Qd)===!1)return;nx.copy(i).invert(),Ag.copy(e.ray).applyMatrix4(nx);const l=s/((this.scale.x+this.scale.y+this.scale.z)/3),h=l*l,u=new G,d=new G,A=new G,p=new G,g=this.isLineSegments?2:1,_=n.index,E=n.attributes.position;if(_!==null){const m=Math.max(0,o.start),v=Math.min(_.count,o.start+o.count);for(let w=m,x=v-1;w<x;w+=g){const I=_.getX(w),R=_.getX(w+1);if(u.fromBufferAttribute(E,I),d.fromBufferAttribute(E,R),Ag.distanceSqToSegment(u,d,p,A)>h)continue;p.applyMatrix4(this.matrixWorld);const S=e.ray.origin.distanceTo(p);S<e.near||S>e.far||t.push({distance:S,point:A.clone().applyMatrix4(this.matrixWorld),index:w,face:null,faceIndex:null,object:this})}}else{const m=Math.max(0,o.start),v=Math.min(E.count,o.start+o.count);for(let w=m,x=v-1;w<x;w+=g){if(u.fromBufferAttribute(E,w),d.fromBufferAttribute(E,w+1),Ag.distanceSqToSegment(u,d,p,A)>h)continue;p.applyMatrix4(this.matrixWorld);const I=e.ray.origin.distanceTo(p);I<e.near||I>e.far||t.push({distance:I,point:A.clone().applyMatrix4(this.matrixWorld),index:w,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){const n=e[t[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let i=0,s=n.length;i<s;i++){const o=n[i].name||String(i);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=i}}}}}const ix=new G,sx=new G;class y8 extends gg{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,n=[];for(let i=0,s=t.count;i<s;i+=2)ix.fromBufferAttribute(t,i),sx.fromBufferAttribute(t,i+1),n[i]=i===0?0:n[i-1],n[i+1]=n[i]+ix.distanceTo(sx);e.setAttribute("lineDistance",new Li(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class E8 extends gg{constructor(e,t){super(e,t),this.isLineLoop=!0,this.type="LineLoop"}}class ax extends Xi{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new Ve(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}const ox=new rt,mg=new co,Od=new bi,Fd=new G;class x8 extends Zt{constructor(e=new Vn,t=new ax){super(),this.isPoints=!0,this.type="Points",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}raycast(e,t){const n=this.geometry,i=this.matrixWorld,s=e.params.Points.threshold,o=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),Od.copy(n.boundingSphere),Od.applyMatrix4(i),Od.radius+=s,e.ray.intersectsSphere(Od)===!1)return;ox.copy(i).invert(),mg.copy(e.ray).applyMatrix4(ox);const l=s/((this.scale.x+this.scale.y+this.scale.z)/3),h=l*l,u=n.index,d=n.attributes.position;if(u!==null){const A=Math.max(0,o.start),p=Math.min(u.count,o.start+o.count);for(let g=A,_=p;g<_;g++){const E=u.getX(g);Fd.fromBufferAttribute(d,E),lx(Fd,E,h,i,e,t,this)}}else{const A=Math.max(0,o.start),p=Math.min(d.count,o.start+o.count);for(let g=A,_=p;g<_;g++)Fd.fromBufferAttribute(d,g),lx(Fd,g,h,i,e,t,this)}}updateMorphTargets(){const e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){const n=e[t[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let i=0,s=n.length;i<s;i++){const o=n[i].name||String(i);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=i}}}}}function lx(r,e,t,n,i,s,o){const l=mg.distanceSqToPoint(r);if(l<t){const h=new G;mg.closestPointToPoint(r,h),h.applyMatrix4(n);const u=i.ray.origin.distanceTo(h);if(u<i.near||u>i.far)return;s.push({distance:u,distanceToRay:Math.sqrt(l),point:h,index:e,face:null,object:o})}}class zd extends br{constructor(e,t,n,i,s,o,l,h,u,d,A,p){super(null,o,l,h,u,d,i,s,A,p),this.isCompressedTexture=!0,this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class w8 extends zd{constructor(e,t,n,i,s,o){super(e,t,n,s,o),this.isCompressedArrayTexture=!0,this.image.depth=i,this.wrapR=Ii}}class I8 extends zd{constructor(e,t,n){super(void 0,e[0].width,e[0].height,t,n,io),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class C8 extends Cr{constructor(e){super(e),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}class vg extends Xi{constructor(e){super(),this.isMeshStandardMaterial=!0,this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new Ve(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ve(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=NE,this.normalScale=new Ue(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new qi,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class Ni extends vg{constructor(e){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new Ue(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return Br(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(t){this.ior=(1+.4*t)/(1-.4*t)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new Ve(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new Ve(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new Ve(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(e)}get anisotropy(){return this._anisotropy}set anisotropy(e){this._anisotropy>0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}function Hd(r,e,t){return!r||!t&&r.constructor===e?r:typeof e.BYTES_PER_ELEMENT=="number"?new e(r):Array.prototype.slice.call(r)}function M8(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}function S8(r){function e(i,s){return r[i]-r[s]}const t=r.length,n=new Array(t);for(let i=0;i!==t;++i)n[i]=i;return n.sort(e),n}function cx(r,e,t){const n=r.length,i=new r.constructor(n);for(let s=0,o=0;o!==n;++s){const l=t[s]*e;for(let h=0;h!==e;++h)i[o++]=r[l+h]}return i}function ux(r,e,t,n){let i=1,s=r[0];for(;s!==void 0&&s[n]===void 0;)s=r[i++];if(s===void 0)return;let o=s[n];if(o!==void 0)if(Array.isArray(o))do o=s[n],o!==void 0&&(e.push(s.time),t.push.apply(t,o)),s=r[i++];while(s!==void 0);else if(o.toArray!==void 0)do o=s[n],o!==void 0&&(e.push(s.time),o.toArray(t,t.length)),s=r[i++];while(s!==void 0);else do o=s[n],o!==void 0&&(e.push(s.time),t.push(o)),s=r[i++];while(s!==void 0)}class wu{constructor(e,t,n,i){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=i!==void 0?i:new t.constructor(n),this.sampleValues=t,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let n=this._cachedIndex,i=t[n],s=t[n-1];e:{t:{let o;r:{n:if(!(e<i)){for(let l=n+2;;){if(i===void 0){if(e<s)break n;return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}if(n===l)break;if(s=i,i=t[++n],e<i)break t}o=t.length;break r}if(!(e>=s)){const l=t[1];e<l&&(n=2,s=l);for(let h=n-2;;){if(s===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(n===h)break;if(i=s,s=t[--n-1],e>=s)break t}o=n,n=0;break r}break e}for(;n<o;){const l=n+o>>>1;e<t[l]?o=l:n=l+1}if(i=t[n],s=t[n-1],s===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(i===void 0)return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}this._cachedIndex=n,this.intervalChanged_(n,s,i)}return this.interpolate_(n,s,e,i)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,i=this.valueSize,s=e*i;for(let o=0;o!==i;++o)t[o]=n[s+o];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}class T8 extends wu{constructor(e,t,n,i){super(e,t,n,i),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:bE,endingEnd:bE}}intervalChanged_(e,t,n){const i=this.parameterPositions;let s=e-2,o=e+1,l=i[s],h=i[o];if(l===void 0)switch(this.getSettings_().endingStart){case RE:s=e,l=2*t-n;break;case DE:s=i.length-2,l=t+i[s]-i[s+1];break;default:s=e,l=n}if(h===void 0)switch(this.getSettings_().endingEnd){case RE:o=e,h=2*n-t;break;case DE:o=1,h=n+i[1]-i[0];break;default:o=e-1,h=t}const u=(n-t)*.5,d=this.valueSize;this._weightPrev=u/(t-l),this._weightNext=u/(h-n),this._offsetPrev=s*d,this._offsetNext=o*d}interpolate_(e,t,n,i){const s=this.resultBuffer,o=this.sampleValues,l=this.valueSize,h=e*l,u=h-l,d=this._offsetPrev,A=this._offsetNext,p=this._weightPrev,g=this._weightNext,_=(n-t)/(i-t),E=_*_,m=E*_,v=-p*m+2*p*E-p*_,w=(1+p)*m+(-1.5-2*p)*E+(-.5+p)*_+1,x=(-1-g)*m+(1.5+g)*E+.5*_,I=g*m-g*E;for(let R=0;R!==l;++R)s[R]=v*o[d+R]+w*o[u+R]+x*o[h+R]+I*o[A+R];return s}}class B8 extends wu{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){const s=this.resultBuffer,o=this.sampleValues,l=this.valueSize,h=e*l,u=h-l,d=(n-t)/(i-t),A=1-d;for(let p=0;p!==l;++p)s[p]=o[u+p]*A+o[h+p]*d;return s}}class b8 extends wu{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e){return this.copySampleValue_(e-1)}}class $i{constructor(e,t,n,i){if(e===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(t===void 0||t.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=Hd(t,this.TimeBufferType),this.values=Hd(n,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}static toJSON(e){const t=e.constructor;let n;if(t.toJSON!==this.toJSON)n=t.toJSON(e);else{n={name:e.name,times:Hd(e.times,Array),values:Hd(e.values,Array)};const i=e.getInterpolation();i!==e.DefaultInterpolation&&(n.interpolation=i)}return n.type=e.ValueTypeName,n}InterpolantFactoryMethodDiscrete(e){return new b8(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new B8(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new T8(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case lu:t=this.InterpolantFactoryMethodDiscrete;break;case ll:t=this.InterpolantFactoryMethodLinear;break;case RA:t=this.InterpolantFactoryMethodSmooth;break}if(t===void 0){const n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(e!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(n);return console.warn("THREE.KeyframeTrack:",n),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return lu;case this.InterpolantFactoryMethodLinear:return ll;case this.InterpolantFactoryMethodSmooth:return RA}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){const t=this.times;for(let n=0,i=t.length;n!==i;++n)t[n]+=e}return this}scale(e){if(e!==1){const t=this.times;for(let n=0,i=t.length;n!==i;++n)t[n]*=e}return this}trim(e,t){const n=this.times,i=n.length;let s=0,o=i-1;for(;s!==i&&n[s]<e;)++s;for(;o!==-1&&n[o]>t;)--o;if(++o,s!==0||o!==i){s>=o&&(o=Math.max(o,1),s=o-1);const l=this.getValueSize();this.times=n.slice(s,o),this.values=this.values.slice(s*l,o*l)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const n=this.times,i=this.values,s=n.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let l=0;l!==s;l++){const h=n[l];if(typeof h=="number"&&isNaN(h)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,l,h),e=!1;break}if(o!==null&&o>h){console.error("THREE.KeyframeTrack: Out of order keys.",this,l,h,o),e=!1;break}o=h}if(i!==void 0&&M8(i))for(let l=0,h=i.length;l!==h;++l){const u=i[l];if(isNaN(u)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,l,u),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),n=this.getValueSize(),i=this.getInterpolation()===RA,s=e.length-1;let o=1;for(let l=1;l<s;++l){let h=!1;const u=e[l],d=e[l+1];if(u!==d&&(l!==1||u!==e[0]))if(i)h=!0;else{const A=l*n,p=A-n,g=A+n;for(let _=0;_!==n;++_){const E=t[A+_];if(E!==t[p+_]||E!==t[g+_]){h=!0;break}}}if(h){if(l!==o){e[o]=e[l];const A=l*n,p=o*n;for(let g=0;g!==n;++g)t[p+g]=t[A+g]}++o}}if(s>0){e[o]=e[s];for(let l=s*n,h=o*n,u=0;u!==n;++u)t[h+u]=t[l+u];++o}return o!==e.length?(this.times=e.slice(0,o),this.values=t.slice(0,o*n)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),n=this.constructor,i=new n(this.name,e,t);return i.createInterpolant=this.createInterpolant,i}}$i.prototype.TimeBufferType=Float32Array,$i.prototype.ValueBufferType=Float32Array,$i.prototype.DefaultInterpolation=ll;class Ll extends $i{}Ll.prototype.ValueTypeName="bool",Ll.prototype.ValueBufferType=Array,Ll.prototype.DefaultInterpolation=lu,Ll.prototype.InterpolantFactoryMethodLinear=void 0,Ll.prototype.InterpolantFactoryMethodSmooth=void 0;class hx extends $i{}hx.prototype.ValueTypeName="color";class Nl extends $i{}Nl.prototype.ValueTypeName="number";class R8 extends wu{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){const s=this.resultBuffer,o=this.sampleValues,l=this.valueSize,h=(n-t)/(i-t);let u=e*l;for(let d=u+l;u!==d;u+=4)Yi.slerpFlat(s,0,o,u-l,o,u,h);return s}}class vo extends $i{InterpolantFactoryMethodLinear(e){return new R8(this.times,this.values,this.getValueSize(),e)}}vo.prototype.ValueTypeName="quaternion",vo.prototype.DefaultInterpolation=ll,vo.prototype.InterpolantFactoryMethodSmooth=void 0;class Ul extends $i{}Ul.prototype.ValueTypeName="string",Ul.prototype.ValueBufferType=Array,Ul.prototype.DefaultInterpolation=lu,Ul.prototype.InterpolantFactoryMethodLinear=void 0,Ul.prototype.InterpolantFactoryMethodSmooth=void 0;class Pl extends $i{}Pl.prototype.ValueTypeName="vector";class D8{constructor(e="",t=-1,n=[],i=bb){this.name=e,this.tracks=n,this.duration=t,this.blendMode=i,this.uuid=Si(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],n=e.tracks,i=1/(e.fps||1);for(let o=0,l=n.length;o!==l;++o)t.push(N8(n[o]).scale(i));const s=new this(e.name,e.duration,t,e.blendMode);return s.uuid=e.uuid,s}static toJSON(e){const t=[],n=e.tracks,i={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let s=0,o=n.length;s!==o;++s)t.push($i.toJSON(n[s]));return i}static CreateFromMorphTargetSequence(e,t,n,i){const s=t.length,o=[];for(let l=0;l<s;l++){let h=[],u=[];h.push((l+s-1)%s,l,(l+1)%s),u.push(0,1,0);const d=S8(h);h=cx(h,1,d),u=cx(u,1,d),!i&&h[0]===0&&(h.push(s),u.push(u[0])),o.push(new Nl(".morphTargetInfluences["+t[l].name+"]",h,u).scale(1/n))}return new this(e,-1,o)}static findByName(e,t){let n=e;if(!Array.isArray(e)){const i=e;n=i.geometry&&i.geometry.animations||i.animations}for(let i=0;i<n.length;i++)if(n[i].name===t)return n[i];return null}static CreateClipsFromMorphTargetSequences(e,t,n){const i={},s=/^([\w-]*?)([\d]+)$/;for(let l=0,h=e.length;l<h;l++){const u=e[l],d=u.name.match(s);if(d&&d.length>1){const A=d[1];let p=i[A];p||(i[A]=p=[]),p.push(u)}}const o=[];for(const l in i)o.push(this.CreateFromMorphTargetSequence(l,i[l],t,n));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const n=function(d,A,p,g,_){if(p.length!==0){const E=[],m=[];ux(p,E,m,g),E.length!==0&&_.push(new d(A,E,m))}},i=[],s=e.name||"default",o=e.fps||30,l=e.blendMode;let h=e.length||-1;const u=e.hierarchy||[];for(let d=0;d<u.length;d++){const A=u[d].keys;if(!(!A||A.length===0))if(A[0].morphTargets){const p={};let g;for(g=0;g<A.length;g++)if(A[g].morphTargets)for(let _=0;_<A[g].morphTargets.length;_++)p[A[g].morphTargets[_]]=-1;for(const _ in p){const E=[],m=[];for(let v=0;v!==A[g].morphTargets.length;++v){const w=A[g];E.push(w.time),m.push(w.morphTarget===_?1:0)}i.push(new Nl(".morphTargetInfluence["+_+"]",E,m))}h=p.length*o}else{const p=".bones["+t[d].name+"]";n(Pl,p+".position",A,"pos",i),n(vo,p+".quaternion",A,"rot",i),n(Pl,p+".scale",A,"scl",i)}}return i.length===0?null:new this(s,h,i,l)}resetDuration(){const e=this.tracks;let t=0;for(let n=0,i=e.length;n!==i;++n){const s=this.tracks[n];t=Math.max(t,s.times[s.times.length-1])}return this.duration=t,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let e=!0;for(let t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){const e=[];for(let t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());return new this.constructor(this.name,this.duration,e,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}function L8(r){switch(r.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Nl;case"vector":case"vector2":case"vector3":case"vector4":return Pl;case"color":return hx;case"quaternion":return vo;case"bool":case"boolean":return Ll;case"string":return Ul}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+r)}function N8(r){if(r.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const e=L8(r.type);if(r.times===void 0){const t=[],n=[];ux(r.keys,t,n,"value"),r.times=t,r.values=n}return e.parse!==void 0?e.parse(r):new e(r.name,r.times,r.values,r.interpolation)}const la={enabled:!1,files:{},add:function(r,e){this.enabled!==!1&&(this.files[r]=e)},get:function(r){if(this.enabled!==!1)return this.files[r]},remove:function(r){delete this.files[r]},clear:function(){this.files={}}};class dx{constructor(e,t,n){const i=this;let s=!1,o=0,l=0,h;const u=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this.itemStart=function(d){l++,s===!1&&i.onStart!==void 0&&i.onStart(d,o,l),s=!0},this.itemEnd=function(d){o++,i.onProgress!==void 0&&i.onProgress(d,o,l),o===l&&(s=!1,i.onLoad!==void 0&&i.onLoad())},this.itemError=function(d){i.onError!==void 0&&i.onError(d)},this.resolveURL=function(d){return h?h(d):d},this.setURLModifier=function(d){return h=d,this},this.addHandler=function(d,A){return u.push(d,A),this},this.removeHandler=function(d){const A=u.indexOf(d);return A!==-1&&u.splice(A,2),this},this.getHandler=function(d){for(let A=0,p=u.length;A<p;A+=2){const g=u[A],_=u[A+1];if(g.global&&(g.lastIndex=0),g.test(d))return _}return null}}}const U8=new dx;class ca{constructor(e){this.manager=e!==void 0?e:U8,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){const n=this;return new Promise(function(i,s){n.load(e,i,t,s)})}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}}ca.DEFAULT_MATERIAL_NAME="__DEFAULT";const Cs={};class P8 extends Error{constructor(e,t){super(e),this.response=t}}class kl extends ca{constructor(e){super(e)}load(e,t,n,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=la.get(e);if(s!==void 0)return this.manager.itemStart(e),setTimeout(()=>{t&&t(s),this.manager.itemEnd(e)},0),s;if(Cs[e]!==void 0){Cs[e].push({onLoad:t,onProgress:n,onError:i});return}Cs[e]=[],Cs[e].push({onLoad:t,onProgress:n,onError:i});const o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),l=this.mimeType,h=this.responseType;fetch(o).then(u=>{if(u.status===200||u.status===0){if(u.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||u.body===void 0||u.body.getReader===void 0)return u;const d=Cs[e],A=u.body.getReader(),p=u.headers.get("Content-Length")||u.headers.get("X-File-Size"),g=p?parseInt(p):0,_=g!==0;let E=0;const m=new ReadableStream({start(v){w();function w(){A.read().then(({done:x,value:I})=>{if(x)v.close();else{E+=I.byteLength;const R=new ProgressEvent("progress",{lengthComputable:_,loaded:E,total:g});for(let S=0,T=d.length;S<T;S++){const D=d[S];D.onProgress&&D.onProgress(R)}v.enqueue(I),w()}})}}});return new Response(m)}else throw new P8(`fetch for "${u.url}" responded with ${u.status}: ${u.statusText}`,u)}).then(u=>{switch(h){case"arraybuffer":return u.arrayBuffer();case"blob":return u.blob();case"document":return u.text().then(d=>new DOMParser().parseFromString(d,l));case"json":return u.json();default:if(l===void 0)return u.text();{const d=/charset="?([^;"\s]*)"?/i.exec(l),A=d&&d[1]?d[1].toLowerCase():void 0,p=new TextDecoder(A);return u.arrayBuffer().then(g=>p.decode(g))}}}).then(u=>{la.add(e,u);const d=Cs[e];delete Cs[e];for(let A=0,p=d.length;A<p;A++){const g=d[A];g.onLoad&&g.onLoad(u)}}).catch(u=>{const d=Cs[e];if(d===void 0)throw this.manager.itemError(e),u;delete Cs[e];for(let A=0,p=d.length;A<p;A++){const g=d[A];g.onError&&g.onError(u)}this.manager.itemError(e)}).finally(()=>{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class k8 extends ca{constructor(e){super(e)}load(e,t,n,i){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,o=la.get(e);if(o!==void 0)return s.manager.itemStart(e),setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o;const l=du("img");function h(){d(),la.add(e,this),t&&t(this),s.manager.itemEnd(e)}function u(A){d(),i&&i(A),s.manager.itemError(e),s.manager.itemEnd(e)}function d(){l.removeEventListener("load",h,!1),l.removeEventListener("error",u,!1)}return l.addEventListener("load",h,!1),l.addEventListener("error",u,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(l.crossOrigin=this.crossOrigin),s.manager.itemStart(e),l.src=e,l}}class Q8 extends ca{constructor(e){super(e)}load(e,t,n,i){const s=this,o=new mo,l=new kl(this.manager);return l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setPath(this.path),l.setWithCredentials(s.withCredentials),l.load(e,function(h){let u;try{u=s.parse(h)}catch(d){if(i!==void 0)i(d);else{console.error(d);return}}u.image!==void 0?o.image=u.image:u.data!==void 0&&(o.image.width=u.width,o.image.height=u.height,o.image.data=u.data),o.wrapS=u.wrapS!==void 0?u.wrapS:Ii,o.wrapT=u.wrapT!==void 0?u.wrapT:Ii,o.magFilter=u.magFilter!==void 0?u.magFilter:gr,o.minFilter=u.minFilter!==void 0?u.minFilter:gr,o.anisotropy=u.anisotropy!==void 0?u.anisotropy:1,u.colorSpace!==void 0&&(o.colorSpace=u.colorSpace),u.flipY!==void 0&&(o.flipY=u.flipY),u.format!==void 0&&(o.format=u.format),u.type!==void 0&&(o.type=u.type),u.mipmaps!==void 0&&(o.mipmaps=u.mipmaps,o.minFilter=Ci),u.mipmapCount===1&&(o.minFilter=gr),u.generateMipmaps!==void 0&&(o.generateMipmaps=u.generateMipmaps),o.needsUpdate=!0,t&&t(o,u)},n,i),o}}class fx extends ca{constructor(e){super(e)}load(e,t,n,i){const s=new br,o=new k8(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(e,function(l){s.image=l,s.needsUpdate=!0,t!==void 0&&t(s)},n,i),s}}class Gd extends Zt{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new Ve(e),this.intensity=t}dispose(){}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,this.groundColor!==void 0&&(t.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(t.object.distance=this.distance),this.angle!==void 0&&(t.object.angle=this.angle),this.decay!==void 0&&(t.object.decay=this.decay),this.penumbra!==void 0&&(t.object.penumbra=this.penumbra),this.shadow!==void 0&&(t.object.shadow=this.shadow.toJSON()),t}}class O8 extends Gd{constructor(e,t,n){super(e,n),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(Zt.DEFAULT_UP),this.updateMatrix(),this.groundColor=new Ve(t)}copy(e,t){return super.copy(e,t),this.groundColor.copy(e.groundColor),this}}const _g=new rt,px=new G,Ax=new G;class yg{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Ue(512,512),this.map=null,this.mapPass=null,this.matrix=new rt,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new eg,this._frameExtents=new Ue(1,1),this._viewportCount=1,this._viewports=[new Ft(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,n=this.matrix;px.setFromMatrixPosition(e.matrixWorld),t.position.copy(px),Ax.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(Ax),t.updateMatrixWorld(),_g.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(_g),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(_g)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const e={};return this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class F8 extends yg{constructor(){super(new dn(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(e){const t=this.camera,n=ul*2*e.angle*this.focus,i=this.mapSize.width/this.mapSize.height,s=e.distance||t.far;(n!==t.fov||i!==t.aspect||s!==t.far)&&(t.fov=n,t.aspect=i,t.far=s,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class z8 extends Gd{constructor(e,t,n=0,i=Math.PI/3,s=0,o=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(Zt.DEFAULT_UP),this.updateMatrix(),this.target=new Zt,this.distance=n,this.angle=i,this.penumbra=s,this.decay=o,this.map=null,this.shadow=new F8}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}const gx=new rt,Iu=new G,Eg=new G;class H8 extends yg{constructor(){super(new dn(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new Ue(4,2),this._viewportCount=6,this._viewports=[new Ft(2,1,1,1),new Ft(0,1,1,1),new Ft(3,1,1,1),new Ft(1,1,1,1),new Ft(3,0,1,1),new Ft(1,0,1,1)],this._cubeDirections=[new G(1,0,0),new G(-1,0,0),new G(0,0,1),new G(0,0,-1),new G(0,1,0),new G(0,-1,0)],this._cubeUps=[new G(0,1,0),new G(0,1,0),new G(0,1,0),new G(0,1,0),new G(0,0,1),new G(0,0,-1)]}updateMatrices(e,t=0){const n=this.camera,i=this.matrix,s=e.distance||n.far;s!==n.far&&(n.far=s,n.updateProjectionMatrix()),Iu.setFromMatrixPosition(e.matrixWorld),n.position.copy(Iu),Eg.copy(n.position),Eg.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt(Eg),n.updateMatrixWorld(),i.makeTranslation(-Iu.x,-Iu.y,-Iu.z),gx.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(gx)}}class G8 extends Gd{constructor(e,t,n=0,i=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=n,this.decay=i,this.shadow=new H8}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}class V8 extends yg{constructor(){super(new _u(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class mx extends Gd{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(Zt.DEFAULT_UP),this.updateMatrix(),this.target=new Zt,this.shadow=new V8}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class Cu{static decodeText(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let n=0,i=e.length;n<i;n++)t+=String.fromCharCode(e[n]);try{return decodeURIComponent(escape(t))}catch{return t}}static extractUrlBase(e){const t=e.lastIndexOf("/");return t===-1?"./":e.slice(0,t+1)}static resolveURL(e,t){return typeof e!="string"||e===""?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}}class j8 extends ca{constructor(e){super(e),this.isImageBitmapLoader=!0,typeof createImageBitmap>"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,n,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,o=la.get(e);if(o!==void 0){if(s.manager.itemStart(e),o.then){o.then(u=>{t&&t(u),s.manager.itemEnd(e)}).catch(u=>{i&&i(u)});return}return setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o}const l={};l.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",l.headers=this.requestHeader;const h=fetch(e,l).then(function(u){return u.blob()}).then(function(u){return createImageBitmap(u,Object.assign(s.options,{colorSpaceConversion:"none"}))}).then(function(u){return la.add(e,u),t&&t(u),s.manager.itemEnd(e),u}).catch(function(u){i&&i(u),la.remove(e),s.manager.itemError(e),s.manager.itemEnd(e)});la.add(e,h),s.manager.itemStart(e)}}class W8{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=vx(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=vx();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function vx(){return(typeof performance>"u"?Date:performance).now()}const xg="\\[\\]\\.:\\/",Y8=new RegExp("["+xg+"]","g"),wg="[^"+xg+"]",q8="[^"+xg.replace("\\.","")+"]",X8=/((?:WC+[\/:])*)/.source.replace("WC",wg),K8=/(WCOD+)?/.source.replace("WCOD",q8),J8=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",wg),Z8=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",wg),$8=new RegExp("^"+X8+K8+J8+Z8+"$"),eN=["material","materials","bones","map"];class tN{constructor(e,t,n){const i=n||Pt.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,i)}getValue(e,t){this.bind();const n=this._targetGroup.nCachedObjects_,i=this._bindings[n];i!==void 0&&i.getValue(e,t)}setValue(e,t){const n=this._bindings;for(let i=this._targetGroup.nCachedObjects_,s=n.length;i!==s;++i)n[i].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}}class Pt{constructor(e,t,n){this.path=t,this.parsedPath=n||Pt.parseTrackName(t),this.node=Pt.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,n){return e&&e.isAnimationObjectGroup?new Pt.Composite(e,t,n):new Pt(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(Y8,"")}static parseTrackName(e){const t=$8.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){const s=n.nodeName.substring(i+1);eN.indexOf(s)!==-1&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=s)}if(n.propertyName===null||n.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const n=e.skeleton.getBoneByName(t);if(n!==void 0)return n}if(e.children){const n=function(s){for(let o=0;o<s.length;o++){const l=s[o];if(l.name===t||l.uuid===t)return l;const h=n(l.children);if(h)return h}return null},i=n(e.children);if(i)return i}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(e,t){const n=this.resolvedProperty;for(let i=0,s=n.length;i!==s;++i)e[t++]=n[i]}_getValue_arrayElement(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,t){this.resolvedProperty.toArray(e,t)}_setValue_direct(e,t){this.targetObject[this.propertyName]=e[t]}_setValue_direct_setNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,t){const n=this.resolvedProperty;for(let i=0,s=n.length;i!==s;++i)n[i]=e[t++]}_setValue_array_setNeedsUpdate(e,t){const n=this.resolvedProperty;for(let i=0,s=n.length;i!==s;++i)n[i]=e[t++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,t){const n=this.resolvedProperty;for(let i=0,s=n.length;i!==s;++i)n[i]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}_setValue_arrayElement_setNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,t){this.resolvedProperty.fromArray(e,t)}_setValue_fromArray_setNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,t){this.bind(),this.getValue(e,t)}_setValue_unbound(e,t){this.bind(),this.setValue(e,t)}bind(){let e=this.node;const t=this.parsedPath,n=t.objectName,i=t.propertyName;let s=t.propertyIndex;if(e||(e=Pt.findNode(this.rootNode,t.nodeName),this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e){console.warn("THREE.PropertyBinding: No target node found for track: "+this.path+".");return}if(n){let u=t.objectIndex;switch(n){case"materials":if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.materials){console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}e=e.material.materials;break;case"bones":if(!e.skeleton){console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}e=e.skeleton.bones;for(let d=0;d<e.length;d++)if(e[d].name===u){u=d;break}break;case"map":if("map"in e){e=e.map;break}if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.map){console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);return}e=e.material.map;break;default:if(e[n]===void 0){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}e=e[n]}if(u!==void 0){if(e[u]===void 0){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);return}e=e[u]}}const o=e[i];if(o===void 0){const u=t.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+u+"."+i+" but it wasn't found.",e);return}let l=this.Versioning.None;this.targetObject=e,e.needsUpdate!==void 0?l=this.Versioning.NeedsUpdate:e.matrixWorldNeedsUpdate!==void 0&&(l=this.Versioning.MatrixWorldNeedsUpdate);let h=this.BindingType.Direct;if(s!==void 0){if(i==="morphTargetInfluences"){if(!e.geometry){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(!e.geometry.morphAttributes){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}e.morphTargetDictionary[s]!==void 0&&(s=e.morphTargetDictionary[s])}h=this.BindingType.ArrayElement,this.resolvedProperty=o,this.propertyIndex=s}else o.fromArray!==void 0&&o.toArray!==void 0?(h=this.BindingType.HasFromToArray,this.resolvedProperty=o):Array.isArray(o)?(h=this.BindingType.EntireArray,this.resolvedProperty=o):this.propertyName=i;this.getValue=this.GetterByBindingType[h],this.setValue=this.SetterByBindingTypeAndVersioning[h][l]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}Pt.Composite=tN,Pt.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Pt.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},Pt.prototype.GetterByBindingType=[Pt.prototype._getValue_direct,Pt.prototype._getValue_array,Pt.prototype._getValue_arrayElement,Pt.prototype._getValue_toArray],Pt.prototype.SetterByBindingTypeAndVersioning=[[Pt.prototype._setValue_direct,Pt.prototype._setValue_direct_setNeedsUpdate,Pt.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[Pt.prototype._setValue_array,Pt.prototype._setValue_array_setNeedsUpdate,Pt.prototype._setValue_array_setMatrixWorldNeedsUpdate],[Pt.prototype._setValue_arrayElement,Pt.prototype._setValue_arrayElement_setNeedsUpdate,Pt.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[Pt.prototype._setValue_fromArray,Pt.prototype._setValue_fromArray_setNeedsUpdate,Pt.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];const _x=new rt;class rN{constructor(e,t,n=0,i=1/0){this.ray=new co(e,t),this.near=n,this.far=i,this.camera=null,this.layers=new vd,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,t){t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):console.error("THREE.Raycaster: Unsupported camera type: "+t.type)}setFromXRController(e){return _x.identity().extractRotation(e.matrixWorld),this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(_x),this}intersectObject(e,t=!0,n=[]){return Ig(e,this,n,t),n.sort(yx),n}intersectObjects(e,t=!0,n=[]){for(let i=0,s=e.length;i<s;i++)Ig(e[i],this,n,t);return n.sort(yx),n}}function yx(r,e){return r.distance-e.distance}function Ig(r,e,t,n){if(r.layers.test(e.layers)&&r.raycast(e,t),n===!0){const i=r.children;for(let s=0,o=i.length;s<o;s++)Ig(i[s],e,t,!0)}}class Ex{constructor(e=1,t=0,n=0){return this.radius=e,this.phi=t,this.theta=n,this}set(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,n){return this.radius=Math.sqrt(e*e+t*t+n*n),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,n),this.phi=Math.acos(Br(t/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}const xx=new G,Vd=new G;class Ms{constructor(e=new G,t=new G){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){xx.subVectors(e,this.start),Vd.subVectors(this.end,this.start);const n=Vd.dot(Vd);let i=Vd.dot(xx)/n;return t&&(i=Br(i,0,1)),i}closestPointToPoint(e,t,n){const i=this.closestPointToPointParameter(e,t);return this.delta(n).multiplyScalar(i).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:Kh}})),typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=Kh);const wx={type:"change"},Cg={type:"start"},Ix={type:"end"},jd=new co,Cx=new Ji,nN=Math.cos(70*UA.DEG2RAD);class iN extends ao{constructor(e,t){super(),this.object=e,this.domElement=t,this.domElement.style.touchAction="none",this.enabled=!0,this.target=new G,this.cursor=new G,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:nl.ROTATE,MIDDLE:nl.DOLLY,RIGHT:nl.PAN},this.touches={ONE:il.ROTATE,TWO:il.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this.getPolarAngle=function(){return l.phi},this.getAzimuthalAngle=function(){return l.theta},this.getDistance=function(){return this.object.position.distanceTo(this.target)},this.listenToKeyEvents=function(H){H.addEventListener("keydown",fe),this._domElementKeyEvents=H},this.stopListenToKeyEvents=function(){this._domElementKeyEvents.removeEventListener("keydown",fe),this._domElementKeyEvents=null},this.saveState=function(){n.target0.copy(n.target),n.position0.copy(n.object.position),n.zoom0=n.object.zoom},this.reset=function(){n.target.copy(n.target0),n.object.position.copy(n.position0),n.object.zoom=n.zoom0,n.object.updateProjectionMatrix(),n.dispatchEvent(wx),n.update(),s=i.NONE},this.update=function(){const H=new G,O=new Yi().setFromUnitVectors(e.up,new G(0,1,0)),ge=O.clone().invert(),ve=new G,Fe=new Yi,Pe=new G,vt=2*Math.PI;return function(Lt=null){const Nt=n.object.position;H.copy(Nt).sub(n.target),H.applyQuaternion(O),l.setFromVector3(H),n.autoRotate&&s===i.NONE&&P(M(Lt)),n.enableDamping?(l.theta+=h.theta*n.dampingFactor,l.phi+=h.phi*n.dampingFactor):(l.theta+=h.theta,l.phi+=h.phi);let Bt=n.minAzimuthAngle,_t=n.maxAzimuthAngle;isFinite(Bt)&&isFinite(_t)&&(Bt<-Math.PI?Bt+=vt:Bt>Math.PI&&(Bt-=vt),_t<-Math.PI?_t+=vt:_t>Math.PI&&(_t-=vt),Bt<=_t?l.theta=Math.max(Bt,Math.min(_t,l.theta)):l.theta=l.theta>(Bt+_t)/2?Math.max(Bt,l.theta):Math.min(_t,l.theta)),l.phi=Math.max(n.minPolarAngle,Math.min(n.maxPolarAngle,l.phi)),l.makeSafe(),n.enableDamping===!0?n.target.addScaledVector(d,n.dampingFactor):n.target.add(d),n.target.sub(n.cursor),n.target.clampLength(n.minTargetRadius,n.maxTargetRadius),n.target.add(n.cursor);let fr=!1;if(n.zoomToCursor&&S||n.object.isOrthographicCamera)l.radius=Q(l.radius);else{const Vt=l.radius;l.radius=Q(l.radius*u),fr=Vt!=l.radius}if(H.setFromSpherical(l),H.applyQuaternion(ge),Nt.copy(n.target).add(H),n.object.lookAt(n.target),n.enableDamping===!0?(h.theta*=1-n.dampingFactor,h.phi*=1-n.dampingFactor,d.multiplyScalar(1-n.dampingFactor)):(h.set(0,0,0),d.set(0,0,0)),n.zoomToCursor&&S){let Vt=null;if(n.object.isPerspectiveCamera){const Er=H.length();Vt=Q(Er*u);const Rn=Er-Vt;n.object.position.addScaledVector(I,Rn),n.object.updateMatrixWorld(),fr=!!Rn}else if(n.object.isOrthographicCamera){const Er=new G(R.x,R.y,0);Er.unproject(n.object);const Rn=n.object.zoom;n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/u)),n.object.updateProjectionMatrix(),fr=Rn!==n.object.zoom;const qt=new G(R.x,R.y,0);qt.unproject(n.object),n.object.position.sub(qt).add(Er),n.object.updateMatrixWorld(),Vt=H.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),n.zoomToCursor=!1;Vt!==null&&(this.screenSpacePanning?n.target.set(0,0,-1).transformDirection(n.object.matrix).multiplyScalar(Vt).add(n.object.position):(jd.origin.copy(n.object.position),jd.direction.set(0,0,-1).transformDirection(n.object.matrix),Math.abs(n.object.up.dot(jd.direction))<nN?e.lookAt(n.target):(Cx.setFromNormalAndCoplanarPoint(n.object.up,n.target),jd.intersectPlane(Cx,n.target))))}else if(n.object.isOrthographicCamera){const Vt=n.object.zoom;n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/u)),Vt!==n.object.zoom&&(n.object.updateProjectionMatrix(),fr=!0)}return u=1,S=!1,fr||ve.distanceToSquared(n.object.position)>o||8*(1-Fe.dot(n.object.quaternion))>o||Pe.distanceToSquared(n.target)>o?(n.dispatchEvent(wx),ve.copy(n.object.position),Fe.copy(n.object.quaternion),Pe.copy(n.target),!0):!1}}(),this.dispose=function(){n.domElement.removeEventListener("contextmenu",be),n.domElement.removeEventListener("pointerdown",le),n.domElement.removeEventListener("pointercancel",me),n.domElement.removeEventListener("wheel",Ie),n.domElement.removeEventListener("pointermove",pe),n.domElement.removeEventListener("pointerup",me),n.domElement.getRootNode().removeEventListener("keydown",Ge,{capture:!0}),n._domElementKeyEvents!==null&&(n._domElementKeyEvents.removeEventListener("keydown",fe),n._domElementKeyEvents=null)};const n=this,i={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let s=i.NONE;const o=1e-6,l=new Ex,h=new Ex;let u=1;const d=new G,A=new Ue,p=new Ue,g=new Ue,_=new Ue,E=new Ue,m=new Ue,v=new Ue,w=new Ue,x=new Ue,I=new G,R=new Ue;let S=!1;const T=[],D={};let b=!1;function M(H){return H!==null?2*Math.PI/60*n.autoRotateSpeed*H:2*Math.PI/60/60*n.autoRotateSpeed}function L(H){const O=Math.abs(H*.01);return Math.pow(.95,n.zoomSpeed*O)}function P(H){h.theta-=H}function N(H){h.phi-=H}const W=function(){const H=new G;return function(O,ge){H.setFromMatrixColumn(ge,0),H.multiplyScalar(-O),d.add(H)}}(),X=function(){const H=new G;return function(O,ge){n.screenSpacePanning===!0?H.setFromMatrixColumn(ge,1):(H.setFromMatrixColumn(ge,0),H.crossVectors(n.object.up,H)),H.multiplyScalar(O),d.add(H)}}(),K=function(){const H=new G;return function(O,ge){const ve=n.domElement;if(n.object.isPerspectiveCamera){const Fe=n.object.position;H.copy(Fe).sub(n.target);let Pe=H.length();Pe*=Math.tan(n.object.fov/2*Math.PI/180),W(2*O*Pe/ve.clientHeight,n.object.matrix),X(2*ge*Pe/ve.clientHeight,n.object.matrix)}else n.object.isOrthographicCamera?(W(O*(n.object.right-n.object.left)/n.object.zoom/ve.clientWidth,n.object.matrix),X(ge*(n.object.top-n.object.bottom)/n.object.zoom/ve.clientHeight,n.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),n.enablePan=!1)}}();function te(H){n.object.isPerspectiveCamera||n.object.isOrthographicCamera?u/=H:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function V(H){n.object.isPerspectiveCamera||n.object.isOrthographicCamera?u*=H:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function ee(H,O){if(!n.zoomToCursor)return;S=!0;const ge=n.domElement.getBoundingClientRect(),ve=H-ge.left,Fe=O-ge.top,Pe=ge.width,vt=ge.height;R.x=ve/Pe*2-1,R.y=-(Fe/vt)*2+1,I.set(R.x,R.y,1).unproject(n.object).sub(n.object.position).normalize()}function Q(H){return Math.max(n.minDistance,Math.min(n.maxDistance,H))}function z(H){A.set(H.clientX,H.clientY)}function Z(H){ee(H.clientX,H.clientX),v.set(H.clientX,H.clientY)}function re(H){_.set(H.clientX,H.clientY)}function j(H){p.set(H.clientX,H.clientY),g.subVectors(p,A).multiplyScalar(n.rotateSpeed);const O=n.domElement;P(2*Math.PI*g.x/O.clientHeight),N(2*Math.PI*g.y/O.clientHeight),A.copy(p),n.update()}function de(H){w.set(H.clientX,H.clientY),x.subVectors(w,v),x.y>0?te(L(x.y)):x.y<0&&V(L(x.y)),v.copy(w),n.update()}function Ae(H){E.set(H.clientX,H.clientY),m.subVectors(E,_).multiplyScalar(n.panSpeed),K(m.x,m.y),_.copy(E),n.update()}function _e(H){ee(H.clientX,H.clientY),H.deltaY<0?V(L(H.deltaY)):H.deltaY>0&&te(L(H.deltaY)),n.update()}function Ee(H){let O=!1;switch(H.code){case n.keys.UP:H.ctrlKey||H.metaKey||H.shiftKey?N(2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):K(0,n.keyPanSpeed),O=!0;break;case n.keys.BOTTOM:H.ctrlKey||H.metaKey||H.shiftKey?N(-2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):K(0,-n.keyPanSpeed),O=!0;break;case n.keys.LEFT:H.ctrlKey||H.metaKey||H.shiftKey?P(2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):K(n.keyPanSpeed,0),O=!0;break;case n.keys.RIGHT:H.ctrlKey||H.metaKey||H.shiftKey?P(-2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):K(-n.keyPanSpeed,0),O=!0;break}O&&(H.preventDefault(),n.update())}function Le(H){if(T.length===1)A.set(H.pageX,H.pageY);else{const O=ht(H),ge=.5*(H.pageX+O.x),ve=.5*(H.pageY+O.y);A.set(ge,ve)}}function st(H){if(T.length===1)_.set(H.pageX,H.pageY);else{const O=ht(H),ge=.5*(H.pageX+O.x),ve=.5*(H.pageY+O.y);_.set(ge,ve)}}function se(H){const O=ht(H),ge=H.pageX-O.x,ve=H.pageY-O.y,Fe=Math.sqrt(ge*ge+ve*ve);v.set(0,Fe)}function et(H){n.enableZoom&&se(H),n.enablePan&&st(H)}function Qe(H){n.enableZoom&&se(H),n.enableRotate&&Le(H)}function ct(H){if(T.length==1)p.set(H.pageX,H.pageY);else{const ge=ht(H),ve=.5*(H.pageX+ge.x),Fe=.5*(H.pageY+ge.y);p.set(ve,Fe)}g.subVectors(p,A).multiplyScalar(n.rotateSpeed);const O=n.domElement;P(2*Math.PI*g.x/O.clientHeight),N(2*Math.PI*g.y/O.clientHeight),A.copy(p)}function Ke(H){if(T.length===1)E.set(H.pageX,H.pageY);else{const O=ht(H),ge=.5*(H.pageX+O.x),ve=.5*(H.pageY+O.y);E.set(ge,ve)}m.subVectors(E,_).multiplyScalar(n.panSpeed),K(m.x,m.y),_.copy(E)}function pt(H){const O=ht(H),ge=H.pageX-O.x,ve=H.pageY-O.y,Fe=Math.sqrt(ge*ge+ve*ve);w.set(0,Fe),x.set(0,Math.pow(w.y/v.y,n.zoomSpeed)),te(x.y),v.copy(w);const Pe=(H.pageX+O.x)*.5,vt=(H.pageY+O.y)*.5;ee(Pe,vt)}function Y(H){n.enableZoom&&pt(H),n.enablePan&&Ke(H)}function k(H){n.enableZoom&&pt(H),n.enableRotate&&ct(H)}function le(H){n.enabled!==!1&&(T.length===0&&(n.domElement.setPointerCapture(H.pointerId),n.domElement.addEventListener("pointermove",pe),n.domElement.addEventListener("pointerup",me)),!dt(H)&&(nt(H),H.pointerType==="touch"?De(H):ye(H)))}function pe(H){n.enabled!==!1&&(H.pointerType==="touch"?Be(H):He(H))}function me(H){switch(lt(H),T.length){case 0:n.domElement.releasePointerCapture(H.pointerId),n.domElement.removeEventListener("pointermove",pe),n.domElement.removeEventListener("pointerup",me),n.dispatchEvent(Ix),s=i.NONE;break;case 1:const O=T[0],ge=D[O];De({pointerId:O,pageX:ge.x,pageY:ge.y});break}}function ye(H){let O;switch(H.button){case 0:O=n.mouseButtons.LEFT;break;case 1:O=n.mouseButtons.MIDDLE;break;case 2:O=n.mouseButtons.RIGHT;break;default:O=-1}switch(O){case nl.DOLLY:if(n.enableZoom===!1)return;Z(H),s=i.DOLLY;break;case nl.ROTATE:if(H.ctrlKey||H.metaKey||H.shiftKey){if(n.enablePan===!1)return;re(H),s=i.PAN}else{if(n.enableRotate===!1)return;z(H),s=i.ROTATE}break;case nl.PAN:if(H.ctrlKey||H.metaKey||H.shiftKey){if(n.enableRotate===!1)return;z(H),s=i.ROTATE}else{if(n.enablePan===!1)return;re(H),s=i.PAN}break;default:s=i.NONE}s!==i.NONE&&n.dispatchEvent(Cg)}function He(H){switch(s){case i.ROTATE:if(n.enableRotate===!1)return;j(H);break;case i.DOLLY:if(n.enableZoom===!1)return;de(H);break;case i.PAN:if(n.enablePan===!1)return;Ae(H);break}}function Ie(H){n.enabled===!1||n.enableZoom===!1||s!==i.NONE||(H.preventDefault(),n.dispatchEvent(Cg),_e(je(H)),n.dispatchEvent(Ix))}function je(H){const O=H.deltaMode,ge={clientX:H.clientX,clientY:H.clientY,deltaY:H.deltaY};switch(O){case 1:ge.deltaY*=16;break;case 2:ge.deltaY*=100;break}return H.ctrlKey&&!b&&(ge.deltaY*=10),ge}function Ge(H){H.key==="Control"&&(b=!0,n.domElement.getRootNode().addEventListener("keyup",Me,{passive:!0,capture:!0}))}function Me(H){H.key==="Control"&&(b=!1,n.domElement.getRootNode().removeEventListener("keyup",Me,{passive:!0,capture:!0}))}function fe(H){n.enabled===!1||n.enablePan===!1||Ee(H)}function De(H){switch(ut(H),T.length){case 1:switch(n.touches.ONE){case il.ROTATE:if(n.enableRotate===!1)return;Le(H),s=i.TOUCH_ROTATE;break;case il.PAN:if(n.enablePan===!1)return;st(H),s=i.TOUCH_PAN;break;default:s=i.NONE}break;case 2:switch(n.touches.TWO){case il.DOLLY_PAN:if(n.enableZoom===!1&&n.enablePan===!1)return;et(H),s=i.TOUCH_DOLLY_PAN;break;case il.DOLLY_ROTATE:if(n.enableZoom===!1&&n.enableRotate===!1)return;Qe(H),s=i.TOUCH_DOLLY_ROTATE;break;default:s=i.NONE}break;default:s=i.NONE}s!==i.NONE&&n.dispatchEvent(Cg)}function Be(H){switch(ut(H),s){case i.TOUCH_ROTATE:if(n.enableRotate===!1)return;ct(H),n.update();break;case i.TOUCH_PAN:if(n.enablePan===!1)return;Ke(H),n.update();break;case i.TOUCH_DOLLY_PAN:if(n.enableZoom===!1&&n.enablePan===!1)return;Y(H),n.update();break;case i.TOUCH_DOLLY_ROTATE:if(n.enableZoom===!1&&n.enableRotate===!1)return;k(H),n.update();break;default:s=i.NONE}}function be(H){n.enabled!==!1&&H.preventDefault()}function nt(H){T.push(H.pointerId)}function lt(H){delete D[H.pointerId];for(let O=0;O<T.length;O++)if(T[O]==H.pointerId){T.splice(O,1);return}}function dt(H){for(let O=0;O<T.length;O++)if(T[O]==H.pointerId)return!0;return!1}function ut(H){let O=D[H.pointerId];O===void 0&&(O=new Ue,D[H.pointerId]=O),O.set(H.pageX,H.pageY)}function ht(H){const O=H.pointerId===T[0]?T[1]:T[0];return D[O]}n.domElement.addEventListener("contextmenu",be),n.domElement.addEventListener("pointerdown",le),n.domElement.addEventListener("pointercancel",me),n.domElement.addEventListener("wheel",Ie,{passive:!1}),n.domElement.getRootNode().addEventListener("keydown",Ge,{passive:!0,capture:!0}),this.update()}}function Mx(r,e){if(e===Rb)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),r;if(e===DA||e===LE){let t=r.getIndex();if(t===null){const o=[],l=r.getAttribute("position");if(l!==void 0){for(let h=0;h<l.count;h++)o.push(h);r.setIndex(o),t=r.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),r}const n=t.count-2,i=[];if(e===DA)for(let o=1;o<=n;o++)i.push(t.getX(0)),i.push(t.getX(o)),i.push(t.getX(o+1));else for(let o=0;o<n;o++)o%2===0?(i.push(t.getX(o)),i.push(t.getX(o+1)),i.push(t.getX(o+2))):(i.push(t.getX(o+2)),i.push(t.getX(o+1)),i.push(t.getX(o)));i.length/3!==n&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const s=r.clone();return s.setIndex(i),s.clearGroups(),s}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",e),r}class sN extends ca{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new uN(t)}),this.register(function(t){return new _N(t)}),this.register(function(t){return new yN(t)}),this.register(function(t){return new EN(t)}),this.register(function(t){return new dN(t)}),this.register(function(t){return new fN(t)}),this.register(function(t){return new pN(t)}),this.register(function(t){return new AN(t)}),this.register(function(t){return new cN(t)}),this.register(function(t){return new gN(t)}),this.register(function(t){return new hN(t)}),this.register(function(t){return new vN(t)}),this.register(function(t){return new mN(t)}),this.register(function(t){return new oN(t)}),this.register(function(t){return new xN(t)}),this.register(function(t){return new wN(t)})}load(e,t,n,i){const s=this;let o;if(this.resourcePath!=="")o=this.resourcePath;else if(this.path!==""){const u=Cu.extractUrlBase(e);o=Cu.resolveURL(u,this.path)}else o=Cu.extractUrlBase(e);this.manager.itemStart(e);const l=function(u){i?i(u):console.error(u),s.manager.itemError(e),s.manager.itemEnd(e)},h=new kl(this.manager);h.setPath(this.path),h.setResponseType("arraybuffer"),h.setRequestHeader(this.requestHeader),h.setWithCredentials(this.withCredentials),h.load(e,function(u){try{s.parse(u,o,function(d){t(d),s.manager.itemEnd(e)},l)}catch(d){l(d)}},n,l)}setDRACOLoader(e){return this.dracoLoader=e,this}setDDSLoader(){throw new Error('THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".')}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,n,i){let s;const o={},l={},h=new TextDecoder;if(typeof e=="string")s=JSON.parse(e);else if(e instanceof ArrayBuffer)if(h.decode(new Uint8Array(e,0,4))===Sx){try{o[wt.KHR_BINARY_GLTF]=new IN(e)}catch(d){i&&i(d);return}s=JSON.parse(o[wt.KHR_BINARY_GLTF].content)}else s=JSON.parse(h.decode(e));else s=e;if(s.asset===void 0||s.asset.version[0]<2){i&&i(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}const u=new kN(s,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});u.fileLoader.setRequestHeader(this.requestHeader);for(let d=0;d<this.pluginCallbacks.length;d++){const A=this.pluginCallbacks[d](u);A.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),l[A.name]=A,o[A.name]=!0}if(s.extensionsUsed)for(let d=0;d<s.extensionsUsed.length;++d){const A=s.extensionsUsed[d],p=s.extensionsRequired||[];switch(A){case wt.KHR_MATERIALS_UNLIT:o[A]=new lN;break;case wt.KHR_DRACO_MESH_COMPRESSION:o[A]=new CN(s,this.dracoLoader);break;case wt.KHR_TEXTURE_TRANSFORM:o[A]=new MN;break;case wt.KHR_MESH_QUANTIZATION:o[A]=new SN;break;default:p.indexOf(A)>=0&&l[A]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+A+'".')}}u.setExtensions(o),u.setPlugins(l),u.parse(n,i)}parseAsync(e,t){const n=this;return new Promise(function(i,s){n.parse(e,t,i,s)})}}function aN(){let r={};return{get:function(e){return r[e]},add:function(e,t){r[e]=t},remove:function(e){delete r[e]},removeAll:function(){r={}}}}const wt={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class oN{constructor(e){this.parser=e,this.name=wt.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let n=0,i=t.length;n<i;n++){const s=t[n];s.extensions&&s.extensions[this.name]&&s.extensions[this.name].light!==void 0&&e._addNodeRef(this.cache,s.extensions[this.name].light)}}_loadLight(e){const t=this.parser,n="light:"+e;let i=t.cache.get(n);if(i)return i;const s=t.json,o=((s.extensions&&s.extensions[this.name]||{}).lights||[])[e];let l;const h=new Ve(16777215);o.color!==void 0&&h.setRGB(o.color[0],o.color[1],o.color[2],cr);const u=o.range!==void 0?o.range:0;switch(o.type){case"directional":l=new mx(h),l.target.position.set(0,0,-1),l.add(l.target);break;case"point":l=new G8(h),l.distance=u;break;case"spot":l=new z8(h),l.distance=u,o.spot=o.spot||{},o.spot.innerConeAngle=o.spot.innerConeAngle!==void 0?o.spot.innerConeAngle:0,o.spot.outerConeAngle=o.spot.outerConeAngle!==void 0?o.spot.outerConeAngle:Math.PI/4,l.angle=o.spot.outerConeAngle,l.penumbra=1-o.spot.innerConeAngle/o.spot.outerConeAngle,l.target.position.set(0,0,-1),l.add(l.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+o.type)}return l.position.set(0,0,0),l.decay=2,ha(l,o),o.intensity!==void 0&&(l.intensity=o.intensity),l.name=t.createUniqueName(o.name||"light_"+e),i=Promise.resolve(l),t.cache.add(n,i),i}getDependency(e,t){if(e==="light")return this._loadLight(t)}createNodeAttachment(e){const t=this,n=this.parser,i=n.json.nodes[e],s=(i.extensions&&i.extensions[this.name]||{}).light;return s===void 0?null:this._loadLight(s).then(function(o){return n._getNodeRef(t.cache,s,o)})}}class lN{constructor(){this.name=wt.KHR_MATERIALS_UNLIT}getMaterialType(){return Ki}extendParams(e,t,n){const i=[];e.color=new Ve(1,1,1),e.opacity=1;const s=t.pbrMetallicRoughness;if(s){if(Array.isArray(s.baseColorFactor)){const o=s.baseColorFactor;e.color.setRGB(o[0],o[1],o[2],cr),e.opacity=o[3]}s.baseColorTexture!==void 0&&i.push(n.assignTexture(e,"map",s.baseColorTexture,Fr))}return Promise.all(i)}}class cN{constructor(e){this.parser=e,this.name=wt.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){const n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const i=n.extensions[this.name].emissiveStrength;return i!==void 0&&(t.emissiveIntensity=i),Promise.resolve()}}class uN{constructor(e){this.parser=e,this.name=wt.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:Ni}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],o=i.extensions[this.name];if(o.clearcoatFactor!==void 0&&(t.clearcoat=o.clearcoatFactor),o.clearcoatTexture!==void 0&&s.push(n.assignTexture(t,"clearcoatMap",o.clearcoatTexture)),o.clearcoatRoughnessFactor!==void 0&&(t.clearcoatRoughness=o.clearcoatRoughnessFactor),o.clearcoatRoughnessTexture!==void 0&&s.push(n.assignTexture(t,"clearcoatRoughnessMap",o.clearcoatRoughnessTexture)),o.clearcoatNormalTexture!==void 0&&(s.push(n.assignTexture(t,"clearcoatNormalMap",o.clearcoatNormalTexture)),o.clearcoatNormalTexture.scale!==void 0)){const l=o.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new Ue(l,l)}return Promise.all(s)}}class hN{constructor(e){this.parser=e,this.name=wt.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:Ni}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],o=i.extensions[this.name];return o.iridescenceFactor!==void 0&&(t.iridescence=o.iridescenceFactor),o.iridescenceTexture!==void 0&&s.push(n.assignTexture(t,"iridescenceMap",o.iridescenceTexture)),o.iridescenceIor!==void 0&&(t.iridescenceIOR=o.iridescenceIor),t.iridescenceThicknessRange===void 0&&(t.iridescenceThicknessRange=[100,400]),o.iridescenceThicknessMinimum!==void 0&&(t.iridescenceThicknessRange[0]=o.iridescenceThicknessMinimum),o.iridescenceThicknessMaximum!==void 0&&(t.iridescenceThicknessRange[1]=o.iridescenceThicknessMaximum),o.iridescenceThicknessTexture!==void 0&&s.push(n.assignTexture(t,"iridescenceThicknessMap",o.iridescenceThicknessTexture)),Promise.all(s)}}class dN{constructor(e){this.parser=e,this.name=wt.KHR_MATERIALS_SHEEN}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:Ni}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[];t.sheenColor=new Ve(0,0,0),t.sheenRoughness=0,t.sheen=1;const o=i.extensions[this.name];if(o.sheenColorFactor!==void 0){const l=o.sheenColorFactor;t.sheenColor.setRGB(l[0],l[1],l[2],cr)}return o.sheenRoughnessFactor!==void 0&&(t.sheenRoughness=o.sheenRoughnessFactor),o.sheenColorTexture!==void 0&&s.push(n.assignTexture(t,"sheenColorMap",o.sheenColorTexture,Fr)),o.sheenRoughnessTexture!==void 0&&s.push(n.assignTexture(t,"sheenRoughnessMap",o.sheenRoughnessTexture)),Promise.all(s)}}class fN{constructor(e){this.parser=e,this.name=wt.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:Ni}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],o=i.extensions[this.name];return o.transmissionFactor!==void 0&&(t.transmission=o.transmissionFactor),o.transmissionTexture!==void 0&&s.push(n.assignTexture(t,"transmissionMap",o.transmissionTexture)),Promise.all(s)}}class pN{constructor(e){this.parser=e,this.name=wt.KHR_MATERIALS_VOLUME}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:Ni}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],o=i.extensions[this.name];t.thickness=o.thicknessFactor!==void 0?o.thicknessFactor:0,o.thicknessTexture!==void 0&&s.push(n.assignTexture(t,"thicknessMap",o.thicknessTexture)),t.attenuationDistance=o.attenuationDistance||1/0;const l=o.attenuationColor||[1,1,1];return t.attenuationColor=new Ve().setRGB(l[0],l[1],l[2],cr),Promise.all(s)}}class AN{constructor(e){this.parser=e,this.name=wt.KHR_MATERIALS_IOR}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:Ni}extendMaterialParams(e,t){const n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const i=n.extensions[this.name];return t.ior=i.ior!==void 0?i.ior:1.5,Promise.resolve()}}class gN{constructor(e){this.parser=e,this.name=wt.KHR_MATERIALS_SPECULAR}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:Ni}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],o=i.extensions[this.name];t.specularIntensity=o.specularFactor!==void 0?o.specularFactor:1,o.specularTexture!==void 0&&s.push(n.assignTexture(t,"specularIntensityMap",o.specularTexture));const l=o.specularColorFactor||[1,1,1];return t.specularColor=new Ve().setRGB(l[0],l[1],l[2],cr),o.specularColorTexture!==void 0&&s.push(n.assignTexture(t,"specularColorMap",o.specularColorTexture,Fr)),Promise.all(s)}}class mN{constructor(e){this.parser=e,this.name=wt.EXT_MATERIALS_BUMP}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:Ni}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],o=i.extensions[this.name];return t.bumpScale=o.bumpFactor!==void 0?o.bumpFactor:1,o.bumpTexture!==void 0&&s.push(n.assignTexture(t,"bumpMap",o.bumpTexture)),Promise.all(s)}}class vN{constructor(e){this.parser=e,this.name=wt.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:Ni}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],o=i.extensions[this.name];return o.anisotropyStrength!==void 0&&(t.anisotropy=o.anisotropyStrength),o.anisotropyRotation!==void 0&&(t.anisotropyRotation=o.anisotropyRotation),o.anisotropyTexture!==void 0&&s.push(n.assignTexture(t,"anisotropyMap",o.anisotropyTexture)),Promise.all(s)}}class _N{constructor(e){this.parser=e,this.name=wt.KHR_TEXTURE_BASISU}loadTexture(e){const t=this.parser,n=t.json,i=n.textures[e];if(!i.extensions||!i.extensions[this.name])return null;const s=i.extensions[this.name],o=t.options.ktx2Loader;if(!o){if(n.extensionsRequired&&n.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,s.source,o)}}class yN{constructor(e){this.parser=e,this.name=wt.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const t=this.name,n=this.parser,i=n.json,s=i.textures[e];if(!s.extensions||!s.extensions[t])return null;const o=s.extensions[t],l=i.images[o.source];let h=n.textureLoader;if(l.uri){const u=n.options.manager.getHandler(l.uri);u!==null&&(h=u)}return this.detectSupport().then(function(u){if(u)return n.loadTextureImage(e,o.source,h);if(i.extensionsRequired&&i.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return n.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class EN{constructor(e){this.parser=e,this.name=wt.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const t=this.name,n=this.parser,i=n.json,s=i.textures[e];if(!s.extensions||!s.extensions[t])return null;const o=s.extensions[t],l=i.images[o.source];let h=n.textureLoader;if(l.uri){const u=n.options.manager.getHandler(l.uri);u!==null&&(h=u)}return this.detectSupport().then(function(u){if(u)return n.loadTextureImage(e,o.source,h);if(i.extensionsRequired&&i.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return n.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class xN{constructor(e){this.name=wt.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,n=t.bufferViews[e];if(n.extensions&&n.extensions[this.name]){const i=n.extensions[this.name],s=this.parser.getDependency("buffer",i.buffer),o=this.parser.options.meshoptDecoder;if(!o||!o.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return s.then(function(l){const h=i.byteOffset||0,u=i.byteLength||0,d=i.count,A=i.byteStride,p=new Uint8Array(l,h,u);return o.decodeGltfBufferAsync?o.decodeGltfBufferAsync(d,A,p,i.mode,i.filter).then(function(g){return g.buffer}):o.ready.then(function(){const g=new ArrayBuffer(d*A);return o.decodeGltfBuffer(new Uint8Array(g),d,A,p,i.mode,i.filter),g})})}else return null}}class wN{constructor(e){this.name=wt.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,n=t.nodes[e];if(!n.extensions||!n.extensions[this.name]||n.mesh===void 0)return null;const i=t.meshes[n.mesh];for(const h of i.primitives)if(h.mode!==si.TRIANGLES&&h.mode!==si.TRIANGLE_STRIP&&h.mode!==si.TRIANGLE_FAN&&h.mode!==void 0)return null;const s=n.extensions[this.name].attributes,o=[],l={};for(const h in s)o.push(this.parser.getDependency("accessor",s[h]).then(u=>(l[h]=u,l[h])));return o.length<1?null:(o.push(this.parser.createNodeMesh(e)),Promise.all(o).then(h=>{const u=h.pop(),d=u.isGroup?u.children:[u],A=h[0].count,p=[];for(const g of d){const _=new rt,E=new G,m=new Yi,v=new G(1,1,1),w=new _8(g.geometry,g.material,A);for(let x=0;x<A;x++)l.TRANSLATION&&E.fromBufferAttribute(l.TRANSLATION,x),l.ROTATION&&m.fromBufferAttribute(l.ROTATION,x),l.SCALE&&v.fromBufferAttribute(l.SCALE,x),w.setMatrixAt(x,_.compose(E,m,v));for(const x in l)if(x==="_COLOR_0"){const I=l[x];w.instanceColor=new pg(I.array,I.itemSize,I.normalized)}else x!=="TRANSLATION"&&x!=="ROTATION"&&x!=="SCALE"&&g.geometry.setAttribute(x,l[x]);Zt.prototype.copy.call(w,g),this.parser.assignFinalMaterial(w),p.push(w)}return u.isGroup?(u.clear(),u.add(...p),u):p[0]}))}}const Sx="glTF",Mu=12,Tx={JSON:1313821514,BIN:5130562};class IN{constructor(e){this.name=wt.KHR_BINARY_GLTF,this.content=null,this.body=null;const t=new DataView(e,0,Mu),n=new TextDecoder;if(this.header={magic:n.decode(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==Sx)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const i=this.header.length-Mu,s=new DataView(e,Mu);let o=0;for(;o<i;){const l=s.getUint32(o,!0);o+=4;const h=s.getUint32(o,!0);if(o+=4,h===Tx.JSON){const u=new Uint8Array(e,Mu+o,l);this.content=n.decode(u)}else if(h===Tx.BIN){const u=Mu+o;this.body=e.slice(u,u+l)}o+=l}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class CN{constructor(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=wt.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){const n=this.json,i=this.dracoLoader,s=e.extensions[this.name].bufferView,o=e.extensions[this.name].attributes,l={},h={},u={};for(const d in o){const A=Sg[d]||d.toLowerCase();l[A]=o[d]}for(const d in e.attributes){const A=Sg[d]||d.toLowerCase();if(o[d]!==void 0){const p=n.accessors[e.attributes[d]],g=Ql[p.componentType];u[A]=g.name,h[A]=p.normalized===!0}}return t.getDependency("bufferView",s).then(function(d){return new Promise(function(A,p){i.decodeDracoFile(d,function(g){for(const _ in g.attributes){const E=g.attributes[_],m=h[_];m!==void 0&&(E.normalized=m)}A(g)},l,u,cr,p)})})}}class MN{constructor(){this.name=wt.KHR_TEXTURE_TRANSFORM}extendTexture(e,t){return(t.texCoord===void 0||t.texCoord===e.channel)&&t.offset===void 0&&t.rotation===void 0&&t.scale===void 0||(e=e.clone(),t.texCoord!==void 0&&(e.channel=t.texCoord),t.offset!==void 0&&e.offset.fromArray(t.offset),t.rotation!==void 0&&(e.rotation=t.rotation),t.scale!==void 0&&e.repeat.fromArray(t.scale),e.needsUpdate=!0),e}}class SN{constructor(){this.name=wt.KHR_MESH_QUANTIZATION}}class Bx extends wu{constructor(e,t,n,i){super(e,t,n,i)}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,i=this.valueSize,s=e*i*3+i;for(let o=0;o!==i;o++)t[o]=n[s+o];return t}interpolate_(e,t,n,i){const s=this.resultBuffer,o=this.sampleValues,l=this.valueSize,h=l*2,u=l*3,d=i-t,A=(n-t)/d,p=A*A,g=p*A,_=e*u,E=_-u,m=-2*g+3*p,v=g-p,w=1-m,x=v-p+A;for(let I=0;I!==l;I++){const R=o[E+I+l],S=o[E+I+h]*d,T=o[_+I+l],D=o[_+I]*d;s[I]=w*R+x*S+m*T+v*D}return s}}const TN=new Yi;class BN extends Bx{interpolate_(e,t,n,i){const s=super.interpolate_(e,t,n,i);return TN.fromArray(s).normalize().toArray(s),s}}const si={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123},Ql={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},bx={9728:Ar,9729:gr,9984:oE,9985:ed,9986:nu,9987:Ci},Rx={33071:Ii,33648:$h,10497:$s},Mg={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Sg={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},ua={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},bN={CUBICSPLINE:void 0,LINEAR:ll,STEP:lu},Tg={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function RN(r){return r.DefaultMaterial===void 0&&(r.DefaultMaterial=new vg({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:xi})),r.DefaultMaterial}function _o(r,e,t){for(const n in t.extensions)r[n]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[n]=t.extensions[n])}function ha(r,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(r.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function DN(r,e,t){let n=!1,i=!1,s=!1;for(let u=0,d=e.length;u<d;u++){const A=e[u];if(A.POSITION!==void 0&&(n=!0),A.NORMAL!==void 0&&(i=!0),A.COLOR_0!==void 0&&(s=!0),n&&i&&s)break}if(!n&&!i&&!s)return Promise.resolve(r);const o=[],l=[],h=[];for(let u=0,d=e.length;u<d;u++){const A=e[u];if(n){const p=A.POSITION!==void 0?t.getDependency("accessor",A.POSITION):r.attributes.position;o.push(p)}if(i){const p=A.NORMAL!==void 0?t.getDependency("accessor",A.NORMAL):r.attributes.normal;l.push(p)}if(s){const p=A.COLOR_0!==void 0?t.getDependency("accessor",A.COLOR_0):r.attributes.color;h.push(p)}}return Promise.all([Promise.all(o),Promise.all(l),Promise.all(h)]).then(function(u){const d=u[0],A=u[1],p=u[2];return n&&(r.morphAttributes.position=d),i&&(r.morphAttributes.normal=A),s&&(r.morphAttributes.color=p),r.morphTargetsRelative=!0,r})}function LN(r,e){if(r.updateMorphTargets(),e.weights!==void 0)for(let t=0,n=e.weights.length;t<n;t++)r.morphTargetInfluences[t]=e.weights[t];if(e.extras&&Array.isArray(e.extras.targetNames)){const t=e.extras.targetNames;if(r.morphTargetInfluences.length===t.length){r.morphTargetDictionary={};for(let n=0,i=t.length;n<i;n++)r.morphTargetDictionary[t[n]]=n}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function NN(r){let e;const t=r.extensions&&r.extensions[wt.KHR_DRACO_MESH_COMPRESSION];if(t?e="draco:"+t.bufferView+":"+t.indices+":"+Bg(t.attributes):e=r.indices+":"+Bg(r.attributes)+":"+r.mode,r.targets!==void 0)for(let n=0,i=r.targets.length;n<i;n++)e+=":"+Bg(r.targets[n]);return e}function Bg(r){let e="";const t=Object.keys(r).sort();for(let n=0,i=t.length;n<i;n++)e+=t[n]+":"+r[t[n]]+";";return e}function bg(r){switch(r){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}function UN(r){return r.search(/\.jpe?g($|\?)/i)>0||r.search(/^data\:image\/jpeg/)===0?"image/jpeg":r.search(/\.webp($|\?)/i)>0||r.search(/^data\:image\/webp/)===0?"image/webp":"image/png"}const PN=new rt;class kN{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new aN,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let n=!1,i=!1,s=-1;typeof navigator<"u"&&(n=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)===!0,i=navigator.userAgent.indexOf("Firefox")>-1,s=i?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),typeof createImageBitmap>"u"||n||i&&s<98?this.textureLoader=new fx(this.options.manager):this.textureLoader=new j8(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new kl(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const n=this,i=this.json,s=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(o){return o._markDefs&&o._markDefs()}),Promise.all(this._invokeAll(function(o){return o.beforeRoot&&o.beforeRoot()})).then(function(){return Promise.all([n.getDependencies("scene"),n.getDependencies("animation"),n.getDependencies("camera")])}).then(function(o){const l={scene:o[0][i.scene||0],scenes:o[0],animations:o[1],cameras:o[2],asset:i.asset,parser:n,userData:{}};return _o(s,l,i),ha(l,i),Promise.all(n._invokeAll(function(h){return h.afterRoot&&h.afterRoot(l)})).then(function(){for(const h of l.scenes)h.updateMatrixWorld();e(l)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],n=this.json.meshes||[];for(let i=0,s=t.length;i<s;i++){const o=t[i].joints;for(let l=0,h=o.length;l<h;l++)e[o[l]].isBone=!0}for(let i=0,s=e.length;i<s;i++){const o=e[i];o.mesh!==void 0&&(this._addNodeRef(this.meshCache,o.mesh),o.skin!==void 0&&(n[o.mesh].isSkinnedMesh=!0)),o.camera!==void 0&&this._addNodeRef(this.cameraCache,o.camera)}}_addNodeRef(e,t){t!==void 0&&(e.refs[t]===void 0&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}_getNodeRef(e,t,n){if(e.refs[t]<=1)return n;const i=n.clone(),s=(o,l)=>{const h=this.associations.get(o);h!=null&&this.associations.set(l,h);for(const[u,d]of o.children.entries())s(d,l.children[u])};return s(n,i),i.name+="_instance_"+e.uses[t]++,i}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let n=0;n<t.length;n++){const i=e(t[n]);if(i)return i}return null}_invokeAll(e){const t=Object.values(this.plugins);t.unshift(this);const n=[];for(let i=0;i<t.length;i++){const s=e(t[i]);s&&n.push(s)}return n}getDependency(e,t){const n=e+":"+t;let i=this.cache.get(n);if(!i){switch(e){case"scene":i=this.loadScene(t);break;case"node":i=this._invokeOne(function(s){return s.loadNode&&s.loadNode(t)});break;case"mesh":i=this._invokeOne(function(s){return s.loadMesh&&s.loadMesh(t)});break;case"accessor":i=this.loadAccessor(t);break;case"bufferView":i=this._invokeOne(function(s){return s.loadBufferView&&s.loadBufferView(t)});break;case"buffer":i=this.loadBuffer(t);break;case"material":i=this._invokeOne(function(s){return s.loadMaterial&&s.loadMaterial(t)});break;case"texture":i=this._invokeOne(function(s){return s.loadTexture&&s.loadTexture(t)});break;case"skin":i=this.loadSkin(t);break;case"animation":i=this._invokeOne(function(s){return s.loadAnimation&&s.loadAnimation(t)});break;case"camera":i=this.loadCamera(t);break;default:if(i=this._invokeOne(function(s){return s!=this&&s.getDependency&&s.getDependency(e,t)}),!i)throw new Error("Unknown type: "+e);break}this.cache.add(n,i)}return i}getDependencies(e){let t=this.cache.get(e);if(!t){const n=this,i=this.json[e+(e==="mesh"?"es":"s")]||[];t=Promise.all(i.map(function(s,o){return n.getDependency(e,o)})),this.cache.add(e,t)}return t}loadBuffer(e){const t=this.json.buffers[e],n=this.fileLoader;if(t.type&&t.type!=="arraybuffer")throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(t.uri===void 0&&e===0)return Promise.resolve(this.extensions[wt.KHR_BINARY_GLTF].body);const i=this.options;return new Promise(function(s,o){n.load(Cu.resolveURL(t.uri,i.path),s,void 0,function(){o(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))})})}loadBufferView(e){const t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then(function(n){const i=t.byteLength||0,s=t.byteOffset||0;return n.slice(s,s+i)})}loadAccessor(e){const t=this,n=this.json,i=this.json.accessors[e];if(i.bufferView===void 0&&i.sparse===void 0){const o=Mg[i.type],l=Ql[i.componentType],h=i.normalized===!0,u=new l(i.count*o);return Promise.resolve(new zr(u,o,h))}const s=[];return i.bufferView!==void 0?s.push(this.getDependency("bufferView",i.bufferView)):s.push(null),i.sparse!==void 0&&(s.push(this.getDependency("bufferView",i.sparse.indices.bufferView)),s.push(this.getDependency("bufferView",i.sparse.values.bufferView))),Promise.all(s).then(function(o){const l=o[0],h=Mg[i.type],u=Ql[i.componentType],d=u.BYTES_PER_ELEMENT,A=d*h,p=i.byteOffset||0,g=i.bufferView!==void 0?n.bufferViews[i.bufferView].byteStride:void 0,_=i.normalized===!0;let E,m;if(g&&g!==A){const v=Math.floor(p/g),w="InterleavedBuffer:"+i.bufferView+":"+i.componentType+":"+v+":"+i.count;let x=t.cache.get(w);x||(E=new u(l,v*g,i.count*g/d),x=new p8(E,g/d),t.cache.add(w,x)),m=new ug(x,h,p%g/d,_)}else l===null?E=new u(i.count*h):E=new u(l,p,i.count*h),m=new zr(E,h,_);if(i.sparse!==void 0){const v=Mg.SCALAR,w=Ql[i.sparse.indices.componentType],x=i.sparse.indices.byteOffset||0,I=i.sparse.values.byteOffset||0,R=new w(o[1],x,i.sparse.count*v),S=new u(o[2],I,i.sparse.count*h);l!==null&&(m=new zr(m.array.slice(),m.itemSize,m.normalized));for(let T=0,D=R.length;T<D;T++){const b=R[T];if(m.setX(b,S[T*h]),h>=2&&m.setY(b,S[T*h+1]),h>=3&&m.setZ(b,S[T*h+2]),h>=4&&m.setW(b,S[T*h+3]),h>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return m})}loadTexture(e){const t=this.json,n=this.options,i=t.textures[e].source,s=t.images[i];let o=this.textureLoader;if(s.uri){const l=n.manager.getHandler(s.uri);l!==null&&(o=l)}return this.loadTextureImage(e,i,o)}loadTextureImage(e,t,n){const i=this,s=this.json,o=s.textures[e],l=s.images[t],h=(l.uri||l.bufferView)+":"+o.sampler;if(this.textureCache[h])return this.textureCache[h];const u=this.loadImageSource(t,n).then(function(d){d.flipY=!1,d.name=o.name||l.name||"",d.name===""&&typeof l.uri=="string"&&l.uri.startsWith("data:image/")===!1&&(d.name=l.uri);const A=(s.samplers||{})[o.sampler]||{};return d.magFilter=bx[A.magFilter]||gr,d.minFilter=bx[A.minFilter]||Ci,d.wrapS=Rx[A.wrapS]||$s,d.wrapT=Rx[A.wrapT]||$s,i.associations.set(d,{textures:e}),d}).catch(function(){return null});return this.textureCache[h]=u,u}loadImageSource(e,t){const n=this,i=this.json,s=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(A=>A.clone());const o=i.images[e],l=self.URL||self.webkitURL;let h=o.uri||"",u=!1;if(o.bufferView!==void 0)h=n.getDependency("bufferView",o.bufferView).then(function(A){u=!0;const p=new Blob([A],{type:o.mimeType});return h=l.createObjectURL(p),h});else if(o.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const d=Promise.resolve(h).then(function(A){return new Promise(function(p,g){let _=p;t.isImageBitmapLoader===!0&&(_=function(E){const m=new br(E);m.needsUpdate=!0,p(m)}),t.load(Cu.resolveURL(A,s.path),_,void 0,g)})}).then(function(A){return u===!0&&l.revokeObjectURL(h),A.userData.mimeType=o.mimeType||UN(o.uri),A}).catch(function(A){throw console.error("THREE.GLTFLoader: Couldn't load texture",h),A});return this.sourceCache[e]=d,d}assignTexture(e,t,n,i){const s=this;return this.getDependency("texture",n.index).then(function(o){if(!o)return null;if(n.texCoord!==void 0&&n.texCoord>0&&(o=o.clone(),o.channel=n.texCoord),s.extensions[wt.KHR_TEXTURE_TRANSFORM]){const l=n.extensions!==void 0?n.extensions[wt.KHR_TEXTURE_TRANSFORM]:void 0;if(l){const h=s.associations.get(o);o=s.extensions[wt.KHR_TEXTURE_TRANSFORM].extendTexture(o,l),s.associations.set(o,h)}}return i!==void 0&&(o.colorSpace=i),e[t]=o,o})}assignFinalMaterial(e){const t=e.geometry;let n=e.material;const i=t.attributes.tangent===void 0,s=t.attributes.color!==void 0,o=t.attributes.normal===void 0;if(e.isPoints){const l="PointsMaterial:"+n.uuid;let h=this.cache.get(l);h||(h=new ax,Xi.prototype.copy.call(h,n),h.color.copy(n.color),h.map=n.map,h.sizeAttenuation=!1,this.cache.add(l,h)),n=h}else if(e.isLine){const l="LineBasicMaterial:"+n.uuid;let h=this.cache.get(l);h||(h=new ex,Xi.prototype.copy.call(h,n),h.color.copy(n.color),h.map=n.map,this.cache.add(l,h)),n=h}if(i||s||o){let l="ClonedMaterial:"+n.uuid+":";i&&(l+="derivative-tangents:"),s&&(l+="vertex-colors:"),o&&(l+="flat-shading:");let h=this.cache.get(l);h||(h=n.clone(),s&&(h.vertexColors=!0),o&&(h.flatShading=!0),i&&(h.normalScale&&(h.normalScale.y*=-1),h.clearcoatNormalScale&&(h.clearcoatNormalScale.y*=-1)),this.cache.add(l,h),this.associations.set(h,this.associations.get(n))),n=h}e.material=n}getMaterialType(){return vg}loadMaterial(e){const t=this,n=this.json,i=this.extensions,s=n.materials[e];let o;const l={},h=s.extensions||{},u=[];if(h[wt.KHR_MATERIALS_UNLIT]){const A=i[wt.KHR_MATERIALS_UNLIT];o=A.getMaterialType(),u.push(A.extendParams(l,s,t))}else{const A=s.pbrMetallicRoughness||{};if(l.color=new Ve(1,1,1),l.opacity=1,Array.isArray(A.baseColorFactor)){const p=A.baseColorFactor;l.color.setRGB(p[0],p[1],p[2],cr),l.opacity=p[3]}A.baseColorTexture!==void 0&&u.push(t.assignTexture(l,"map",A.baseColorTexture,Fr)),l.metalness=A.metallicFactor!==void 0?A.metallicFactor:1,l.roughness=A.roughnessFactor!==void 0?A.roughnessFactor:1,A.metallicRoughnessTexture!==void 0&&(u.push(t.assignTexture(l,"metalnessMap",A.metallicRoughnessTexture)),u.push(t.assignTexture(l,"roughnessMap",A.metallicRoughnessTexture))),o=this._invokeOne(function(p){return p.getMaterialType&&p.getMaterialType(e)}),u.push(Promise.all(this._invokeAll(function(p){return p.extendMaterialParams&&p.extendMaterialParams(e,l)})))}s.doubleSided===!0&&(l.side=wi);const d=s.alphaMode||Tg.OPAQUE;if(d===Tg.BLEND?(l.transparent=!0,l.depthWrite=!1):(l.transparent=!1,d===Tg.MASK&&(l.alphaTest=s.alphaCutoff!==void 0?s.alphaCutoff:.5)),s.normalTexture!==void 0&&o!==Ki&&(u.push(t.assignTexture(l,"normalMap",s.normalTexture)),l.normalScale=new Ue(1,1),s.normalTexture.scale!==void 0)){const A=s.normalTexture.scale;l.normalScale.set(A,A)}if(s.occlusionTexture!==void 0&&o!==Ki&&(u.push(t.assignTexture(l,"aoMap",s.occlusionTexture)),s.occlusionTexture.strength!==void 0&&(l.aoMapIntensity=s.occlusionTexture.strength)),s.emissiveFactor!==void 0&&o!==Ki){const A=s.emissiveFactor;l.emissive=new Ve().setRGB(A[0],A[1],A[2],cr)}return s.emissiveTexture!==void 0&&o!==Ki&&u.push(t.assignTexture(l,"emissiveMap",s.emissiveTexture,Fr)),Promise.all(u).then(function(){const A=new o(l);return s.name&&(A.name=s.name),ha(A,s),t.associations.set(A,{materials:e}),s.extensions&&_o(i,A,s),A})}createUniqueName(e){const t=Pt.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,n=this.extensions,i=this.primitiveCache;function s(l){return n[wt.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(l,t).then(function(h){return Dx(h,l,t)})}const o=[];for(let l=0,h=e.length;l<h;l++){const u=e[l],d=NN(u),A=i[d];if(A)o.push(A.promise);else{let p;u.extensions&&u.extensions[wt.KHR_DRACO_MESH_COMPRESSION]?p=s(u):p=Dx(new Vn,u,t),i[d]={primitive:u,promise:p},o.push(p)}}return Promise.all(o)}loadMesh(e){const t=this,n=this.json,i=this.extensions,s=n.meshes[e],o=s.primitives,l=[];for(let h=0,u=o.length;h<u;h++){const d=o[h].material===void 0?RN(this.cache):this.getDependency("material",o[h].material);l.push(d)}return l.push(t.loadGeometries(o)),Promise.all(l).then(function(h){const u=h.slice(0,h.length-1),d=h[h.length-1],A=[];for(let g=0,_=d.length;g<_;g++){const E=d[g],m=o[g];let v;const w=u[g];if(m.mode===si.TRIANGLES||m.mode===si.TRIANGLE_STRIP||m.mode===si.TRIANGLE_FAN||m.mode===void 0)v=s.isSkinnedMesh===!0?new g8(E,w):new Xr(E,w),v.isSkinnedMesh===!0&&v.normalizeSkinWeights(),m.mode===si.TRIANGLE_STRIP?v.geometry=Mx(v.geometry,LE):m.mode===si.TRIANGLE_FAN&&(v.geometry=Mx(v.geometry,DA));else if(m.mode===si.LINES)v=new y8(E,w);else if(m.mode===si.LINE_STRIP)v=new gg(E,w);else if(m.mode===si.LINE_LOOP)v=new E8(E,w);else if(m.mode===si.POINTS)v=new x8(E,w);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+m.mode);Object.keys(v.geometry.morphAttributes).length>0&&LN(v,s),v.name=t.createUniqueName(s.name||"mesh_"+e),ha(v,s),m.extensions&&_o(i,v,m),t.assignFinalMaterial(v),A.push(v)}for(let g=0,_=A.length;g<_;g++)t.associations.set(A[g],{meshes:e,primitives:g});if(A.length===1)return s.extensions&&_o(i,A[0],s),A[0];const p=new oa;s.extensions&&_o(i,p,s),t.associations.set(p,{meshes:e});for(let g=0,_=A.length;g<_;g++)p.add(A[g]);return p})}loadCamera(e){let t;const n=this.json.cameras[e],i=n[n.type];if(!i){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return n.type==="perspective"?t=new dn(UA.radToDeg(i.yfov),i.aspectRatio||1,i.znear||1,i.zfar||2e6):n.type==="orthographic"&&(t=new _u(-i.xmag,i.xmag,i.ymag,-i.ymag,i.znear,i.zfar)),n.name&&(t.name=this.createUniqueName(n.name)),ha(t,n),Promise.resolve(t)}loadSkin(e){const t=this.json.skins[e],n=[];for(let i=0,s=t.joints.length;i<s;i++)n.push(this._loadNodeShallow(t.joints[i]));return t.inverseBindMatrices!==void 0?n.push(this.getDependency("accessor",t.inverseBindMatrices)):n.push(null),Promise.all(n).then(function(i){const s=i.pop(),o=i,l=[],h=[];for(let u=0,d=o.length;u<d;u++){const A=o[u];if(A){l.push(A);const p=new rt;s!==null&&p.fromArray(s.array,u*16),h.push(p)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[u])}return new fg(l,h)})}loadAnimation(e){const t=this.json,n=this,i=t.animations[e],s=i.name?i.name:"animation_"+e,o=[],l=[],h=[],u=[],d=[];for(let A=0,p=i.channels.length;A<p;A++){const g=i.channels[A],_=i.samplers[g.sampler],E=g.target,m=E.node,v=i.parameters!==void 0?i.parameters[_.input]:_.input,w=i.parameters!==void 0?i.parameters[_.output]:_.output;E.node!==void 0&&(o.push(this.getDependency("node",m)),l.push(this.getDependency("accessor",v)),h.push(this.getDependency("accessor",w)),u.push(_),d.push(E))}return Promise.all([Promise.all(o),Promise.all(l),Promise.all(h),Promise.all(u),Promise.all(d)]).then(function(A){const p=A[0],g=A[1],_=A[2],E=A[3],m=A[4],v=[];for(let w=0,x=p.length;w<x;w++){const I=p[w],R=g[w],S=_[w],T=E[w],D=m[w];if(I===void 0)continue;I.updateMatrix&&I.updateMatrix();const b=n._createAnimationTracks(I,R,S,T,D);if(b)for(let M=0;M<b.length;M++)v.push(b[M])}return new D8(s,void 0,v)})}createNodeMesh(e){const t=this.json,n=this,i=t.nodes[e];return i.mesh===void 0?null:n.getDependency("mesh",i.mesh).then(function(s){const o=n._getNodeRef(n.meshCache,i.mesh,s);return i.weights!==void 0&&o.traverse(function(l){if(l.isMesh)for(let h=0,u=i.weights.length;h<u;h++)l.morphTargetInfluences[h]=i.weights[h]}),o})}loadNode(e){const t=this.json,n=this,i=t.nodes[e],s=n._loadNodeShallow(e),o=[],l=i.children||[];for(let u=0,d=l.length;u<d;u++)o.push(n.getDependency("node",l[u]));const h=i.skin===void 0?Promise.resolve(null):n.getDependency("skin",i.skin);return Promise.all([s,Promise.all(o),h]).then(function(u){const d=u[0],A=u[1],p=u[2];p!==null&&d.traverse(function(g){g.isSkinnedMesh&&g.bind(p,PN)});for(let g=0,_=A.length;g<_;g++)d.add(A[g]);return d})}_loadNodeShallow(e){const t=this.json,n=this.extensions,i=this;if(this.nodeCache[e]!==void 0)return this.nodeCache[e];const s=t.nodes[e],o=s.name?i.createUniqueName(s.name):"",l=[],h=i._invokeOne(function(u){return u.createNodeMesh&&u.createNodeMesh(e)});return h&&l.push(h),s.camera!==void 0&&l.push(i.getDependency("camera",s.camera).then(function(u){return i._getNodeRef(i.cameraCache,s.camera,u)})),i._invokeAll(function(u){return u.createNodeAttachment&&u.createNodeAttachment(e)}).forEach(function(u){l.push(u)}),this.nodeCache[e]=Promise.all(l).then(function(u){let d;if(s.isBone===!0?d=new K2:u.length>1?d=new oa:u.length===1?d=u[0]:d=new Zt,d!==u[0])for(let A=0,p=u.length;A<p;A++)d.add(u[A]);if(s.name&&(d.userData.name=s.name,d.name=o),ha(d,s),s.extensions&&_o(n,d,s),s.matrix!==void 0){const A=new rt;A.fromArray(s.matrix),d.applyMatrix4(A)}else s.translation!==void 0&&d.position.fromArray(s.translation),s.rotation!==void 0&&d.quaternion.fromArray(s.rotation),s.scale!==void 0&&d.scale.fromArray(s.scale);return i.associations.has(d)||i.associations.set(d,{}),i.associations.get(d).nodes=e,d}),this.nodeCache[e]}loadScene(e){const t=this.extensions,n=this.json.scenes[e],i=this,s=new oa;n.name&&(s.name=i.createUniqueName(n.name)),ha(s,n),n.extensions&&_o(t,s,n);const o=n.nodes||[],l=[];for(let h=0,u=o.length;h<u;h++)l.push(i.getDependency("node",o[h]));return Promise.all(l).then(function(h){for(let d=0,A=h.length;d<A;d++)s.add(h[d]);const u=d=>{const A=new Map;for(const[p,g]of i.associations)(p instanceof Xi||p instanceof br)&&A.set(p,g);return d.traverse(p=>{const g=i.associations.get(p);g!=null&&A.set(p,g)}),A};return i.associations=u(s),s})}_createAnimationTracks(e,t,n,i,s){const o=[],l=e.name?e.name:e.uuid,h=[];ua[s.path]===ua.weights?e.traverse(function(p){p.morphTargetInfluences&&h.push(p.name?p.name:p.uuid)}):h.push(l);let u;switch(ua[s.path]){case ua.weights:u=Nl;break;case ua.rotation:u=vo;break;case ua.position:case ua.scale:u=Pl;break;default:switch(n.itemSize){case 1:u=Nl;break;case 2:case 3:default:u=Pl;break}break}const d=i.interpolation!==void 0?bN[i.interpolation]:ll,A=this._getArrayFromAccessor(n);for(let p=0,g=h.length;p<g;p++){const _=new u(h[p]+"."+ua[s.path],t.array,A,d);i.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(_),o.push(_)}return o}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){const n=bg(t.constructor),i=new Float32Array(t.length);for(let s=0,o=t.length;s<o;s++)i[s]=t[s]*n;t=i}return t}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(t){const n=this instanceof vo?BN:Bx;return new n(this.times,this.values,this.getValueSize()/3,t)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function QN(r,e,t){const n=e.attributes,i=new _r;if(n.POSITION!==void 0){const l=t.json.accessors[n.POSITION],h=l.min,u=l.max;if(h!==void 0&&u!==void 0){if(i.set(new G(h[0],h[1],h[2]),new G(u[0],u[1],u[2])),l.normalized){const d=bg(Ql[l.componentType]);i.min.multiplyScalar(d),i.max.multiplyScalar(d)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const s=e.targets;if(s!==void 0){const l=new G,h=new G;for(let u=0,d=s.length;u<d;u++){const A=s[u];if(A.POSITION!==void 0){const p=t.json.accessors[A.POSITION],g=p.min,_=p.max;if(g!==void 0&&_!==void 0){if(h.setX(Math.max(Math.abs(g[0]),Math.abs(_[0]))),h.setY(Math.max(Math.abs(g[1]),Math.abs(_[1]))),h.setZ(Math.max(Math.abs(g[2]),Math.abs(_[2]))),p.normalized){const E=bg(Ql[p.componentType]);h.multiplyScalar(E)}l.max(h)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}i.expandByVector(l)}r.boundingBox=i;const o=new bi;i.getCenter(o.center),o.radius=i.min.distanceTo(i.max)/2,r.boundingSphere=o}function Dx(r,e,t){const n=e.attributes,i=[];function s(o,l){return t.getDependency("accessor",o).then(function(h){r.setAttribute(l,h)})}for(const o in n){const l=Sg[o]||o.toLowerCase();l in r.attributes||i.push(s(n[o],l))}if(e.indices!==void 0&&!r.index){const o=t.getDependency("accessor",e.indices).then(function(l){r.setIndex(l)});i.push(o)}return Tt.workingColorSpace!==cr&&"COLOR_0"in n&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${Tt.workingColorSpace}" not supported.`),ha(r,e),QN(r,e,t),Promise.all(i).then(function(){return e.targets!==void 0?DN(r,e.targets,t):r})}class ON{constructor(e=4){this.pool=e,this.queue=[],this.workers=[],this.workersResolve=[],this.workerStatus=0}_initWorker(e){if(!this.workers[e]){const t=this.workerCreator();t.addEventListener("message",this._onMessage.bind(this,e)),this.workers[e]=t}}_getIdleWorker(){for(let e=0;e<this.pool;e++)if(!(this.workerStatus&1<<e))return e;return-1}_onMessage(e,t){const n=this.workersResolve[e];if(n&&n(t),this.queue.length){const{resolve:i,msg:s,transfer:o}=this.queue.shift();this.workersResolve[e]=i,this.workers[e].postMessage(s,o)}else this.workerStatus^=1<<e}setWorkerCreator(e){this.workerCreator=e}setWorkerLimit(e){this.pool=e}postMessage(e,t){return new Promise(n=>{const i=this._getIdleWorker();i!==-1?(this._initWorker(i),this.workerStatus|=1<<i,this.workersResolve[i]=n,this.workers[i].postMessage(e,t)):this.queue.push({resolve:n,msg:e,transfer:t})})}dispose(){this.workers.forEach(e=>e.terminate()),this.workersResolve.length=0,this.workers.length=0,this.queue.length=0,this.workerStatus=0}}const FN=0,Lx=2,zN=1,Nx=2,HN=0,GN=1,VN=10,jN=0,Ux=9,Px=15,kx=16,Qx=22,Ox=37,Fx=43,zx=76,Hx=83,Gx=97,Vx=100,jx=103,Wx=109,Yx=165,qx=166;class WN{constructor(){this.vkFormat=0,this.typeSize=1,this.pixelWidth=0,this.pixelHeight=0,this.pixelDepth=0,this.layerCount=0,this.faceCount=1,this.supercompressionScheme=0,this.levels=[],this.dataFormatDescriptor=[{vendorId:0,descriptorType:0,descriptorBlockSize:0,versionNumber:2,colorModel:0,colorPrimaries:1,transferFunction:2,flags:0,texelBlockDimension:[0,0,0,0],bytesPlane:[0,0,0,0,0,0,0,0],samples:[]}],this.keyValue={},this.globalData=null}}class Su{constructor(e,t,n,i){this._dataView=new DataView(e.buffer,e.byteOffset+t,n),this._littleEndian=i,this._offset=0}_nextUint8(){const e=this._dataView.getUint8(this._offset);return this._offset+=1,e}_nextUint16(){const e=this._dataView.getUint16(this._offset,this._littleEndian);return this._offset+=2,e}_nextUint32(){const e=this._dataView.getUint32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint64(){const e=this._dataView.getUint32(this._offset,this._littleEndian)+4294967296*this._dataView.getUint32(this._offset+4,this._littleEndian);return this._offset+=8,e}_nextInt32(){const e=this._dataView.getInt32(this._offset,this._littleEndian);return this._offset+=4,e}_skip(e){return this._offset+=e,this}_scan(e,t=0){const n=this._offset;let i=0;for(;this._dataView.getUint8(this._offset)!==t&&i<e;)i++,this._offset++;return i<e&&this._offset++,new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+n,i)}}const pn=[171,75,84,88,32,50,48,187,13,10,26,10];function Xx(r){return typeof TextDecoder<"u"?new TextDecoder().decode(r):Buffer.from(r).toString("utf8")}function YN(r){const e=new Uint8Array(r.buffer,r.byteOffset,pn.length);if(e[0]!==pn[0]||e[1]!==pn[1]||e[2]!==pn[2]||e[3]!==pn[3]||e[4]!==pn[4]||e[5]!==pn[5]||e[6]!==pn[6]||e[7]!==pn[7]||e[8]!==pn[8]||e[9]!==pn[9]||e[10]!==pn[10]||e[11]!==pn[11])throw new Error("Missing KTX 2.0 identifier.");const t=new WN,n=17*Uint32Array.BYTES_PER_ELEMENT,i=new Su(r,pn.length,n,!0);t.vkFormat=i._nextUint32(),t.typeSize=i._nextUint32(),t.pixelWidth=i._nextUint32(),t.pixelHeight=i._nextUint32(),t.pixelDepth=i._nextUint32(),t.layerCount=i._nextUint32(),t.faceCount=i._nextUint32();const s=i._nextUint32();t.supercompressionScheme=i._nextUint32();const o=i._nextUint32(),l=i._nextUint32(),h=i._nextUint32(),u=i._nextUint32(),d=i._nextUint64(),A=i._nextUint64(),p=new Su(r,pn.length+n,3*s*8,!0);for(let te=0;te<s;te++)t.levels.push({levelData:new Uint8Array(r.buffer,r.byteOffset+p._nextUint64(),p._nextUint64()),uncompressedByteLength:p._nextUint64()});const g=new Su(r,o,l,!0),_={vendorId:g._skip(4)._nextUint16(),descriptorType:g._nextUint16(),versionNumber:g._nextUint16(),descriptorBlockSize:g._nextUint16(),colorModel:g._nextUint8(),colorPrimaries:g._nextUint8(),transferFunction:g._nextUint8(),flags:g._nextUint8(),texelBlockDimension:[g._nextUint8(),g._nextUint8(),g._nextUint8(),g._nextUint8()],bytesPlane:[g._nextUint8(),g._nextUint8(),g._nextUint8(),g._nextUint8(),g._nextUint8(),g._nextUint8(),g._nextUint8(),g._nextUint8()],samples:[]},E=(_.descriptorBlockSize/4-6)/4;for(let te=0;te<E;te++){const V={bitOffset:g._nextUint16(),bitLength:g._nextUint8(),channelType:g._nextUint8(),samplePosition:[g._nextUint8(),g._nextUint8(),g._nextUint8(),g._nextUint8()],sampleLower:-1/0,sampleUpper:1/0};64&V.channelType?(V.sampleLower=g._nextInt32(),V.sampleUpper=g._nextInt32()):(V.sampleLower=g._nextUint32(),V.sampleUpper=g._nextUint32()),_.samples[te]=V}t.dataFormatDescriptor.length=0,t.dataFormatDescriptor.push(_);const m=new Su(r,h,u,!0);for(;m._offset<u;){const te=m._nextUint32(),V=m._scan(te),ee=Xx(V),Q=m._scan(te-V.byteLength);t.keyValue[ee]=ee.match(/^ktx/i)?Xx(Q):Q,m._offset%4&&m._skip(4-m._offset%4)}if(A<=0)return t;const v=new Su(r,d,A,!0),w=v._nextUint16(),x=v._nextUint16(),I=v._nextUint32(),R=v._nextUint32(),S=v._nextUint32(),T=v._nextUint32(),D=[];for(let te=0;te<s;te++)D.push({imageFlags:v._nextUint32(),rgbSliceByteOffset:v._nextUint32(),rgbSliceByteLength:v._nextUint32(),alphaSliceByteOffset:v._nextUint32(),alphaSliceByteLength:v._nextUint32()});const b=d+v._offset,M=b+I,L=M+R,P=L+S,N=new Uint8Array(r.buffer,r.byteOffset+b,I),W=new Uint8Array(r.buffer,r.byteOffset+M,R),X=new Uint8Array(r.buffer,r.byteOffset+L,S),K=new Uint8Array(r.buffer,r.byteOffset+P,T);return t.globalData={endpointCount:w,selectorCount:x,imageDescs:D,endpointsData:N,selectorsData:W,tablesData:X,extendedData:K},t}let Rg,Ss,Dg;const Lg={env:{emscripten_notify_memory_growth:function(r){Dg=new Uint8Array(Ss.exports.memory.buffer)}}};class qN{init(){return Rg||(Rg=typeof fetch<"u"?fetch("data:application/wasm;base64,"+Kx).then(e=>e.arrayBuffer()).then(e=>WebAssembly.instantiate(e,Lg)).then(this._init):WebAssembly.instantiate(Buffer.from(Kx,"base64"),Lg).then(this._init),Rg)}_init(e){Ss=e.instance,Lg.env.emscripten_notify_memory_growth(0)}decode(e,t=0){if(!Ss)throw new Error("ZSTDDecoder: Await .init() before decoding.");const n=e.byteLength,i=Ss.exports.malloc(n);Dg.set(e,i),t=t||Number(Ss.exports.ZSTD_findDecompressedSize(i,n));const s=Ss.exports.malloc(t),o=Ss.exports.ZSTD_decompress(s,t,i,n),l=Dg.slice(s,s+o);return Ss.exports.free(i),Ss.exports.free(s),l}}const Kx="AGFzbQEAAAABpQEVYAF/AX9gAn9/AGADf39/AX9gBX9/f39/AX9gAX8AYAJ/fwF/YAR/f39/AX9gA39/fwBgBn9/f39/fwF/YAd/f39/f39/AX9gAn9/AX5gAn5+AX5gAABgBX9/f39/AGAGf39/f39/AGAIf39/f39/f38AYAl/f39/f39/f38AYAABf2AIf39/f39/f38Bf2ANf39/f39/f39/f39/fwF/YAF/AX4CJwEDZW52H2Vtc2NyaXB0ZW5fbm90aWZ5X21lbW9yeV9ncm93dGgABANpaAEFAAAFAgEFCwACAQABAgIFBQcAAwABDgsBAQcAEhMHAAUBDAQEAAANBwQCAgYCBAgDAwMDBgEACQkHBgICAAYGAgQUBwYGAwIGAAMCAQgBBwUGCgoEEQAEBAEIAwgDBQgDEA8IAAcABAUBcAECAgUEAQCAAgYJAX8BQaCgwAILB2AHBm1lbW9yeQIABm1hbGxvYwAoBGZyZWUAJgxaU1REX2lzRXJyb3IAaBlaU1REX2ZpbmREZWNvbXByZXNzZWRTaXplAFQPWlNURF9kZWNvbXByZXNzAEoGX3N0YXJ0ACQJBwEAQQELASQKussBaA8AIAAgACgCBCABajYCBAsZACAAKAIAIAAoAgRBH3F0QQAgAWtBH3F2CwgAIABBiH9LC34BBH9BAyEBIAAoAgQiA0EgTQRAIAAoAggiASAAKAIQTwRAIAAQDQ8LIAAoAgwiAiABRgRAQQFBAiADQSBJGw8LIAAgASABIAJrIANBA3YiBCABIARrIAJJIgEbIgJrIgQ2AgggACADIAJBA3RrNgIEIAAgBCgAADYCAAsgAQsUAQF/IAAgARACIQIgACABEAEgAgv3AQECfyACRQRAIABCADcCACAAQQA2AhAgAEIANwIIQbh/DwsgACABNgIMIAAgAUEEajYCECACQQRPBEAgACABIAJqIgFBfGoiAzYCCCAAIAMoAAA2AgAgAUF/ai0AACIBBEAgAEEIIAEQFGs2AgQgAg8LIABBADYCBEF/DwsgACABNgIIIAAgAS0AACIDNgIAIAJBfmoiBEEBTQRAIARBAWtFBEAgACABLQACQRB0IANyIgM2AgALIAAgAS0AAUEIdCADajYCAAsgASACakF/ai0AACIBRQRAIABBADYCBEFsDwsgAEEoIAEQFCACQQN0ams2AgQgAgsWACAAIAEpAAA3AAAgACABKQAINwAICy8BAX8gAUECdEGgHWooAgAgACgCAEEgIAEgACgCBGprQR9xdnEhAiAAIAEQASACCyEAIAFCz9bTvtLHq9lCfiAAfEIfiUKHla+vmLbem55/fgsdAQF/IAAoAgggACgCDEYEfyAAKAIEQSBGBUEACwuCBAEDfyACQYDAAE8EQCAAIAEgAhBnIAAPCyAAIAJqIQMCQCAAIAFzQQNxRQRAAkAgAkEBSARAIAAhAgwBCyAAQQNxRQRAIAAhAgwBCyAAIQIDQCACIAEtAAA6AAAgAUEBaiEBIAJBAWoiAiADTw0BIAJBA3ENAAsLAkAgA0F8cSIEQcAASQ0AIAIgBEFAaiIFSw0AA0AgAiABKAIANgIAIAIgASgCBDYCBCACIAEoAgg2AgggAiABKAIMNgIMIAIgASgCEDYCECACIAEoAhQ2AhQgAiABKAIYNgIYIAIgASgCHDYCHCACIAEoAiA2AiAgAiABKAIkNgIkIAIgASgCKDYCKCACIAEoAiw2AiwgAiABKAIwNgIwIAIgASgCNDYCNCACIAEoAjg2AjggAiABKAI8NgI8IAFBQGshASACQUBrIgIgBU0NAAsLIAIgBE8NAQNAIAIgASgCADYCACABQQRqIQEgAkEEaiICIARJDQALDAELIANBBEkEQCAAIQIMAQsgA0F8aiIEIABJBEAgACECDAELIAAhAgNAIAIgAS0AADoAACACIAEtAAE6AAEgAiABLQACOgACIAIgAS0AAzoAAyABQQRqIQEgAkEEaiICIARNDQALCyACIANJBEADQCACIAEtAAA6AAAgAUEBaiEBIAJBAWoiAiADRw0ACwsgAAsMACAAIAEpAAA3AAALQQECfyAAKAIIIgEgACgCEEkEQEEDDwsgACAAKAIEIgJBB3E2AgQgACABIAJBA3ZrIgE2AgggACABKAAANgIAQQALDAAgACABKAIANgAAC/cCAQJ/AkAgACABRg0AAkAgASACaiAASwRAIAAgAmoiBCABSw0BCyAAIAEgAhALDwsgACABc0EDcSEDAkACQCAAIAFJBEAgAwRAIAAhAwwDCyAAQQNxRQRAIAAhAwwCCyAAIQMDQCACRQ0EIAMgAS0AADoAACABQQFqIQEgAkF/aiECIANBAWoiA0EDcQ0ACwwBCwJAIAMNACAEQQNxBEADQCACRQ0FIAAgAkF/aiICaiIDIAEgAmotAAA6AAAgA0EDcQ0ACwsgAkEDTQ0AA0AgACACQXxqIgJqIAEgAmooAgA2AgAgAkEDSw0ACwsgAkUNAgNAIAAgAkF/aiICaiABIAJqLQAAOgAAIAINAAsMAgsgAkEDTQ0AIAIhBANAIAMgASgCADYCACABQQRqIQEgA0EEaiEDIARBfGoiBEEDSw0ACyACQQNxIQILIAJFDQADQCADIAEtAAA6AAAgA0EBaiEDIAFBAWohASACQX9qIgINAAsLIAAL8wICAn8BfgJAIAJFDQAgACACaiIDQX9qIAE6AAAgACABOgAAIAJBA0kNACADQX5qIAE6AAAgACABOgABIANBfWogAToAACAAIAE6AAIgAkEHSQ0AIANBfGogAToAACAAIAE6AAMgAkEJSQ0AIABBACAAa0EDcSIEaiIDIAFB/wFxQYGChAhsIgE2AgAgAyACIARrQXxxIgRqIgJBfGogATYCACAEQQlJDQAgAyABNgIIIAMgATYCBCACQXhqIAE2AgAgAkF0aiABNgIAIARBGUkNACADIAE2AhggAyABNgIUIAMgATYCECADIAE2AgwgAkFwaiABNgIAIAJBbGogATYCACACQWhqIAE2AgAgAkFkaiABNgIAIAQgA0EEcUEYciIEayICQSBJDQAgAa0iBUIghiAFhCEFIAMgBGohAQNAIAEgBTcDGCABIAU3AxAgASAFNwMIIAEgBTcDACABQSBqIQEgAkFgaiICQR9LDQALCyAACy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAIajYCACADCy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAFajYCACADCx8AIAAgASACKAIEEAg2AgAgARAEGiAAIAJBCGo2AgQLCAAgAGdBH3MLugUBDX8jAEEQayIKJAACfyAEQQNNBEAgCkEANgIMIApBDGogAyAEEAsaIAAgASACIApBDGpBBBAVIgBBbCAAEAMbIAAgACAESxsMAQsgAEEAIAEoAgBBAXRBAmoQECENQVQgAygAACIGQQ9xIgBBCksNABogAiAAQQVqNgIAIAMgBGoiAkF8aiEMIAJBeWohDiACQXtqIRAgAEEGaiELQQQhBSAGQQR2IQRBICAAdCIAQQFyIQkgASgCACEPQQAhAiADIQYCQANAIAlBAkggAiAPS3JFBEAgAiEHAkAgCARAA0AgBEH//wNxQf//A0YEQCAHQRhqIQcgBiAQSQR/IAZBAmoiBigAACAFdgUgBUEQaiEFIARBEHYLIQQMAQsLA0AgBEEDcSIIQQNGBEAgBUECaiEFIARBAnYhBCAHQQNqIQcMAQsLIAcgCGoiByAPSw0EIAVBAmohBQNAIAIgB0kEQCANIAJBAXRqQQA7AQAgAkEBaiECDAELCyAGIA5LQQAgBiAFQQN1aiIHIAxLG0UEQCAHKAAAIAVBB3EiBXYhBAwCCyAEQQJ2IQQLIAYhBwsCfyALQX9qIAQgAEF/anEiBiAAQQF0QX9qIgggCWsiEUkNABogBCAIcSIEQQAgESAEIABIG2shBiALCyEIIA0gAkEBdGogBkF/aiIEOwEAIAlBASAGayAEIAZBAUgbayEJA0AgCSAASARAIABBAXUhACALQX9qIQsMAQsLAn8gByAOS0EAIAcgBSAIaiIFQQN1aiIGIAxLG0UEQCAFQQdxDAELIAUgDCIGIAdrQQN0awshBSACQQFqIQIgBEUhCCAGKAAAIAVBH3F2IQQMAQsLQWwgCUEBRyAFQSBKcg0BGiABIAJBf2o2AgAgBiAFQQdqQQN1aiADawwBC0FQCyEAIApBEGokACAACwkAQQFBBSAAGwsMACAAIAEoAAA2AAALqgMBCn8jAEHwAGsiCiQAIAJBAWohDiAAQQhqIQtBgIAEIAVBf2p0QRB1IQxBACECQQEhBkEBIAV0IglBf2oiDyEIA0AgAiAORkUEQAJAIAEgAkEBdCINai8BACIHQf//A0YEQCALIAhBA3RqIAI2AgQgCEF/aiEIQQEhBwwBCyAGQQAgDCAHQRB0QRB1ShshBgsgCiANaiAHOwEAIAJBAWohAgwBCwsgACAFNgIEIAAgBjYCACAJQQN2IAlBAXZqQQNqIQxBACEAQQAhBkEAIQIDQCAGIA5GBEADQAJAIAAgCUYNACAKIAsgAEEDdGoiASgCBCIGQQF0aiICIAIvAQAiAkEBajsBACABIAUgAhAUayIIOgADIAEgAiAIQf8BcXQgCWs7AQAgASAEIAZBAnQiAmooAgA6AAIgASACIANqKAIANgIEIABBAWohAAwBCwsFIAEgBkEBdGouAQAhDUEAIQcDQCAHIA1ORQRAIAsgAkEDdGogBjYCBANAIAIgDGogD3EiAiAISw0ACyAHQQFqIQcMAQsLIAZBAWohBgwBCwsgCkHwAGokAAsjAEIAIAEQCSAAhUKHla+vmLbem55/fkLj3MqV/M7y9YV/fAsQACAAQn43AwggACABNgIACyQBAX8gAARAIAEoAgQiAgRAIAEoAgggACACEQEADwsgABAmCwsfACAAIAEgAi8BABAINgIAIAEQBBogACACQQRqNgIEC0oBAX9BoCAoAgAiASAAaiIAQX9MBEBBiCBBMDYCAEF/DwsCQCAAPwBBEHRNDQAgABBmDQBBiCBBMDYCAEF/DwtBoCAgADYCACABC9cBAQh/Qbp/IQoCQCACKAIEIgggAigCACIJaiIOIAEgAGtLDQBBbCEKIAkgBCADKAIAIgtrSw0AIAAgCWoiBCACKAIIIgxrIQ0gACABQWBqIg8gCyAJQQAQKSADIAkgC2o2AgACQAJAIAwgBCAFa00EQCANIQUMAQsgDCAEIAZrSw0CIAcgDSAFayIAaiIBIAhqIAdNBEAgBCABIAgQDxoMAgsgBCABQQAgAGsQDyEBIAIgACAIaiIINgIEIAEgAGshBAsgBCAPIAUgCEEBECkLIA4hCgsgCgubAgEBfyMAQYABayINJAAgDSADNgJ8AkAgAkEDSwRAQX8hCQwBCwJAAkACQAJAIAJBAWsOAwADAgELIAZFBEBBuH8hCQwEC0FsIQkgBS0AACICIANLDQMgACAHIAJBAnQiAmooAgAgAiAIaigCABA7IAEgADYCAEEBIQkMAwsgASAJNgIAQQAhCQwCCyAKRQRAQWwhCQwCC0EAIQkgC0UgDEEZSHINAUEIIAR0QQhqIQBBACECA0AgAiAATw0CIAJBQGshAgwAAAsAC0FsIQkgDSANQfwAaiANQfgAaiAFIAYQFSICEAMNACANKAJ4IgMgBEsNACAAIA0gDSgCfCAHIAggAxAYIAEgADYCACACIQkLIA1BgAFqJAAgCQsLACAAIAEgAhALGgsQACAALwAAIAAtAAJBEHRyCy8AAn9BuH8gAUEISQ0AGkFyIAAoAAQiAEF3Sw0AGkG4fyAAQQhqIgAgACABSxsLCwkAIAAgATsAAAsDAAELigYBBX8gACAAKAIAIgVBfnE2AgBBACAAIAVBAXZqQYQgKAIAIgQgAEYbIQECQAJAIAAoAgQiAkUNACACKAIAIgNBAXENACACQQhqIgUgA0EBdkF4aiIDQQggA0EISxtnQR9zQQJ0QYAfaiIDKAIARgRAIAMgAigCDDYCAAsgAigCCCIDBEAgAyACKAIMNgIECyACKAIMIgMEQCADIAIoAgg2AgALIAIgAigCACAAKAIAQX5xajYCAEGEICEAAkACQCABRQ0AIAEgAjYCBCABKAIAIgNBAXENASADQQF2QXhqIgNBCCADQQhLG2dBH3NBAnRBgB9qIgMoAgAgAUEIakYEQCADIAEoAgw2AgALIAEoAggiAwRAIAMgASgCDDYCBAsgASgCDCIDBEAgAyABKAIINgIAQYQgKAIAIQQLIAIgAigCACABKAIAQX5xajYCACABIARGDQAgASABKAIAQQF2akEEaiEACyAAIAI2AgALIAIoAgBBAXZBeGoiAEEIIABBCEsbZ0Efc0ECdEGAH2oiASgCACEAIAEgBTYCACACIAA2AgwgAkEANgIIIABFDQEgACAFNgIADwsCQCABRQ0AIAEoAgAiAkEBcQ0AIAJBAXZBeGoiAkEIIAJBCEsbZ0Efc0ECdEGAH2oiAigCACABQQhqRgRAIAIgASgCDDYCAAsgASgCCCICBEAgAiABKAIMNgIECyABKAIMIgIEQCACIAEoAgg2AgBBhCAoAgAhBAsgACAAKAIAIAEoAgBBfnFqIgI2AgACQCABIARHBEAgASABKAIAQQF2aiAANgIEIAAoAgAhAgwBC0GEICAANgIACyACQQF2QXhqIgFBCCABQQhLG2dBH3NBAnRBgB9qIgIoAgAhASACIABBCGoiAjYCACAAIAE2AgwgAEEANgIIIAFFDQEgASACNgIADwsgBUEBdkF4aiIBQQggAUEISxtnQR9zQQJ0QYAfaiICKAIAIQEgAiAAQQhqIgI2AgAgACABNgIMIABBADYCCCABRQ0AIAEgAjYCAAsLDgAgAARAIABBeGoQJQsLgAIBA38CQCAAQQ9qQXhxQYQgKAIAKAIAQQF2ayICEB1Bf0YNAAJAQYQgKAIAIgAoAgAiAUEBcQ0AIAFBAXZBeGoiAUEIIAFBCEsbZ0Efc0ECdEGAH2oiASgCACAAQQhqRgRAIAEgACgCDDYCAAsgACgCCCIBBEAgASAAKAIMNgIECyAAKAIMIgFFDQAgASAAKAIINgIAC0EBIQEgACAAKAIAIAJBAXRqIgI2AgAgAkEBcQ0AIAJBAXZBeGoiAkEIIAJBCEsbZ0Efc0ECdEGAH2oiAygCACECIAMgAEEIaiIDNgIAIAAgAjYCDCAAQQA2AgggAkUNACACIAM2AgALIAELtwIBA38CQAJAIABBASAAGyICEDgiAA0AAkACQEGEICgCACIARQ0AIAAoAgAiA0EBcQ0AIAAgA0EBcjYCACADQQF2QXhqIgFBCCABQQhLG2dBH3NBAnRBgB9qIgEoAgAgAEEIakYEQCABIAAoAgw2AgALIAAoAggiAQRAIAEgACgCDDYCBAsgACgCDCIBBEAgASAAKAIINgIACyACECchAkEAIQFBhCAoAgAhACACDQEgACAAKAIAQX5xNgIAQQAPCyACQQ9qQXhxIgMQHSICQX9GDQIgAkEHakF4cSIAIAJHBEAgACACaxAdQX9GDQMLAkBBhCAoAgAiAUUEQEGAICAANgIADAELIAAgATYCBAtBhCAgADYCACAAIANBAXRBAXI2AgAMAQsgAEUNAQsgAEEIaiEBCyABC7kDAQJ/IAAgA2ohBQJAIANBB0wEQANAIAAgBU8NAiAAIAItAAA6AAAgAEEBaiEAIAJBAWohAgwAAAsACyAEQQFGBEACQCAAIAJrIgZBB00EQCAAIAItAAA6AAAgACACLQABOgABIAAgAi0AAjoAAiAAIAItAAM6AAMgAEEEaiACIAZBAnQiBkHAHmooAgBqIgIQFyACIAZB4B5qKAIAayECDAELIAAgAhAMCyACQQhqIQIgAEEIaiEACwJAAkACQAJAIAUgAU0EQCAAIANqIQEgBEEBRyAAIAJrQQ9Kcg0BA0AgACACEAwgAkEIaiECIABBCGoiACABSQ0ACwwFCyAAIAFLBEAgACEBDAQLIARBAUcgACACa0EPSnINASAAIQMgAiEEA0AgAyAEEAwgBEEIaiEEIANBCGoiAyABSQ0ACwwCCwNAIAAgAhAHIAJBEGohAiAAQRBqIgAgAUkNAAsMAwsgACEDIAIhBANAIAMgBBAHIARBEGohBCADQRBqIgMgAUkNAAsLIAIgASAAa2ohAgsDQCABIAVPDQEgASACLQAAOgAAIAFBAWohASACQQFqIQIMAAALAAsLQQECfyAAIAAoArjgASIDNgLE4AEgACgCvOABIQQgACABNgK84AEgACABIAJqNgK44AEgACABIAQgA2tqNgLA4AELpgEBAX8gACAAKALs4QEQFjYCyOABIABCADcD+OABIABCADcDuOABIABBwOABakIANwMAIABBqNAAaiIBQYyAgOAANgIAIABBADYCmOIBIABCADcDiOEBIABCAzcDgOEBIABBrNABakHgEikCADcCACAAQbTQAWpB6BIoAgA2AgAgACABNgIMIAAgAEGYIGo2AgggACAAQaAwajYCBCAAIABBEGo2AgALYQEBf0G4fyEDAkAgAUEDSQ0AIAIgABAhIgFBA3YiADYCCCACIAFBAXE2AgQgAiABQQF2QQNxIgM2AgACQCADQX9qIgFBAksNAAJAIAFBAWsOAgEAAgtBbA8LIAAhAwsgAwsMACAAIAEgAkEAEC4LiAQCA38CfiADEBYhBCAAQQBBKBAQIQAgBCACSwRAIAQPCyABRQRAQX8PCwJAAkAgA0EBRg0AIAEoAAAiBkGo6r5pRg0AQXYhAyAGQXBxQdDUtMIBRw0BQQghAyACQQhJDQEgAEEAQSgQECEAIAEoAAQhASAAQQE2AhQgACABrTcDAEEADwsgASACIAMQLyIDIAJLDQAgACADNgIYQXIhAyABIARqIgVBf2otAAAiAkEIcQ0AIAJBIHEiBkUEQEFwIQMgBS0AACIFQacBSw0BIAVBB3GtQgEgBUEDdkEKaq2GIgdCA4h+IAd8IQggBEEBaiEECyACQQZ2IQMgAkECdiEFAkAgAkEDcUF/aiICQQJLBEBBACECDAELAkACQAJAIAJBAWsOAgECAAsgASAEai0AACECIARBAWohBAwCCyABIARqLwAAIQIgBEECaiEEDAELIAEgBGooAAAhAiAEQQRqIQQLIAVBAXEhBQJ+AkACQAJAIANBf2oiA0ECTQRAIANBAWsOAgIDAQtCfyAGRQ0DGiABIARqMQAADAMLIAEgBGovAACtQoACfAwCCyABIARqKAAArQwBCyABIARqKQAACyEHIAAgBTYCICAAIAI2AhwgACAHNwMAQQAhAyAAQQA2AhQgACAHIAggBhsiBzcDCCAAIAdCgIAIIAdCgIAIVBs+AhALIAMLWwEBf0G4fyEDIAIQFiICIAFNBH8gACACakF/ai0AACIAQQNxQQJ0QaAeaigCACACaiAAQQZ2IgFBAnRBsB5qKAIAaiAAQSBxIgBFaiABRSAAQQV2cWoFQbh/CwsdACAAKAKQ4gEQWiAAQQA2AqDiASAAQgA3A5DiAQu1AwEFfyMAQZACayIKJABBuH8hBgJAIAVFDQAgBCwAACIIQf8BcSEHAkAgCEF/TARAIAdBgn9qQQF2IgggBU8NAkFsIQYgB0GBf2oiBUGAAk8NAiAEQQFqIQdBACEGA0AgBiAFTwRAIAUhBiAIIQcMAwUgACAGaiAHIAZBAXZqIgQtAABBBHY6AAAgACAGQQFyaiAELQAAQQ9xOgAAIAZBAmohBgwBCwAACwALIAcgBU8NASAAIARBAWogByAKEFMiBhADDQELIAYhBEEAIQYgAUEAQTQQECEJQQAhBQNAIAQgBkcEQCAAIAZqIggtAAAiAUELSwRAQWwhBgwDBSAJIAFBAnRqIgEgASgCAEEBajYCACAGQQFqIQZBASAILQAAdEEBdSAFaiEFDAILAAsLQWwhBiAFRQ0AIAUQFEEBaiIBQQxLDQAgAyABNgIAQQFBASABdCAFayIDEBQiAXQgA0cNACAAIARqIAFBAWoiADoAACAJIABBAnRqIgAgACgCAEEBajYCACAJKAIEIgBBAkkgAEEBcXINACACIARBAWo2AgAgB0EBaiEGCyAKQZACaiQAIAYLxhEBDH8jAEHwAGsiBSQAQWwhCwJAIANBCkkNACACLwAAIQogAi8AAiEJIAIvAAQhByAFQQhqIAQQDgJAIAMgByAJIApqakEGaiIMSQ0AIAUtAAohCCAFQdgAaiACQQZqIgIgChAGIgsQAw0BIAVBQGsgAiAKaiICIAkQBiILEAMNASAFQShqIAIgCWoiAiAHEAYiCxADDQEgBUEQaiACIAdqIAMgDGsQBiILEAMNASAAIAFqIg9BfWohECAEQQRqIQZBASELIAAgAUEDakECdiIDaiIMIANqIgIgA2oiDiEDIAIhBCAMIQcDQCALIAMgEElxBEAgACAGIAVB2ABqIAgQAkECdGoiCS8BADsAACAFQdgAaiAJLQACEAEgCS0AAyELIAcgBiAFQUBrIAgQAkECdGoiCS8BADsAACAFQUBrIAktAAIQASAJLQADIQogBCAGIAVBKGogCBACQQJ0aiIJLwEAOwAAIAVBKGogCS0AAhABIAktAAMhCSADIAYgBUEQaiAIEAJBAnRqIg0vAQA7AAAgBUEQaiANLQACEAEgDS0AAyENIAAgC2oiCyAGIAVB2ABqIAgQAkECdGoiAC8BADsAACAFQdgAaiAALQACEAEgAC0AAyEAIAcgCmoiCiAGIAVBQGsgCBACQQJ0aiIHLwEAOwAAIAVBQGsgBy0AAhABIActAAMhByAEIAlqIgkgBiAFQShqIAgQAkECdGoiBC8BADsAACAFQShqIAQtAAIQASAELQADIQQgAyANaiIDIAYgBUEQaiAIEAJBAnRqIg0vAQA7AAAgBUEQaiANLQACEAEgACALaiEAIAcgCmohByAEIAlqIQQgAyANLQADaiEDIAVB2ABqEA0gBUFAaxANciAFQShqEA1yIAVBEGoQDXJFIQsMAQsLIAQgDksgByACS3INAEFsIQsgACAMSw0BIAxBfWohCQNAQQAgACAJSSAFQdgAahAEGwRAIAAgBiAFQdgAaiAIEAJBAnRqIgovAQA7AAAgBUHYAGogCi0AAhABIAAgCi0AA2oiACAGIAVB2ABqIAgQAkECdGoiCi8BADsAACAFQdgAaiAKLQACEAEgACAKLQADaiEADAEFIAxBfmohCgNAIAVB2ABqEAQgACAKS3JFBEAgACAGIAVB2ABqIAgQAkECdGoiCS8BADsAACAFQdgAaiAJLQACEAEgACAJLQADaiEADAELCwNAIAAgCk0EQCAAIAYgBUHYAGogCBACQQJ0aiIJLwEAOwAAIAVB2ABqIAktAAIQASAAIAktAANqIQAMAQsLAkAgACAMTw0AIAAgBiAFQdgAaiAIEAIiAEECdGoiDC0AADoAACAMLQADQQFGBEAgBUHYAGogDC0AAhABDAELIAUoAlxBH0sNACAFQdgAaiAGIABBAnRqLQACEAEgBSgCXEEhSQ0AIAVBIDYCXAsgAkF9aiEMA0BBACAHIAxJIAVBQGsQBBsEQCAHIAYgBUFAayAIEAJBAnRqIgAvAQA7AAAgBUFAayAALQACEAEgByAALQADaiIAIAYgBUFAayAIEAJBAnRqIgcvAQA7AAAgBUFAayAHLQACEAEgACAHLQADaiEHDAEFIAJBfmohDANAIAVBQGsQBCAHIAxLckUEQCAHIAYgBUFAayAIEAJBAnRqIgAvAQA7AAAgBUFAayAALQACEAEgByAALQADaiEHDAELCwNAIAcgDE0EQCAHIAYgBUFAayAIEAJBAnRqIgAvAQA7AAAgBUFAayAALQACEAEgByAALQADaiEHDAELCwJAIAcgAk8NACAHIAYgBUFAayAIEAIiAEECdGoiAi0AADoAACACLQADQQFGBEAgBUFAayACLQACEAEMAQsgBSgCREEfSw0AIAVBQGsgBiAAQQJ0ai0AAhABIAUoAkRBIUkNACAFQSA2AkQLIA5BfWohAgNAQQAgBCACSSAFQShqEAQbBEAgBCAGIAVBKGogCBACQQJ0aiIALwEAOwAAIAVBKGogAC0AAhABIAQgAC0AA2oiACAGIAVBKGogCBACQQJ0aiIELwEAOwAAIAVBKGogBC0AAhABIAAgBC0AA2ohBAwBBSAOQX5qIQIDQCAFQShqEAQgBCACS3JFBEAgBCAGIAVBKGogCBACQQJ0aiIALwEAOwAAIAVBKGogAC0AAhABIAQgAC0AA2ohBAwBCwsDQCAEIAJNBEAgBCAGIAVBKGogCBACQQJ0aiIALwEAOwAAIAVBKGogAC0AAhABIAQgAC0AA2ohBAwBCwsCQCAEIA5PDQAgBCAGIAVBKGogCBACIgBBAnRqIgItAAA6AAAgAi0AA0EBRgRAIAVBKGogAi0AAhABDAELIAUoAixBH0sNACAFQShqIAYgAEECdGotAAIQASAFKAIsQSFJDQAgBUEgNgIsCwNAQQAgAyAQSSAFQRBqEAQbBEAgAyAGIAVBEGogCBACQQJ0aiIALwEAOwAAIAVBEGogAC0AAhABIAMgAC0AA2oiACAGIAVBEGogCBACQQJ0aiICLwEAOwAAIAVBEGogAi0AAhABIAAgAi0AA2ohAwwBBSAPQX5qIQIDQCAFQRBqEAQgAyACS3JFBEAgAyAGIAVBEGogCBACQQJ0aiIALwEAOwAAIAVBEGogAC0AAhABIAMgAC0AA2ohAwwBCwsDQCADIAJNBEAgAyAGIAVBEGogCBACQQJ0aiIALwEAOwAAIAVBEGogAC0AAhABIAMgAC0AA2ohAwwBCwsCQCADIA9PDQAgAyAGIAVBEGogCBACIgBBAnRqIgItAAA6AAAgAi0AA0EBRgRAIAVBEGogAi0AAhABDAELIAUoAhRBH0sNACAFQRBqIAYgAEECdGotAAIQASAFKAIUQSFJDQAgBUEgNgIUCyABQWwgBUHYAGoQCiAFQUBrEApxIAVBKGoQCnEgBUEQahAKcRshCwwJCwAACwALAAALAAsAAAsACwAACwALQWwhCwsgBUHwAGokACALC7UEAQ5/IwBBEGsiBiQAIAZBBGogABAOQVQhBQJAIARB3AtJDQAgBi0ABCEHIANB8ARqQQBB7AAQECEIIAdBDEsNACADQdwJaiIJIAggBkEIaiAGQQxqIAEgAhAxIhAQA0UEQCAGKAIMIgQgB0sNASADQdwFaiEPIANBpAVqIREgAEEEaiESIANBqAVqIQEgBCEFA0AgBSICQX9qIQUgCCACQQJ0aigCAEUNAAsgAkEBaiEOQQEhBQNAIAUgDk9FBEAgCCAFQQJ0IgtqKAIAIQwgASALaiAKNgIAIAVBAWohBSAKIAxqIQoMAQsLIAEgCjYCAEEAIQUgBigCCCELA0AgBSALRkUEQCABIAUgCWotAAAiDEECdGoiDSANKAIAIg1BAWo2AgAgDyANQQF0aiINIAw6AAEgDSAFOgAAIAVBAWohBQwBCwtBACEBIANBADYCqAUgBEF/cyAHaiEJQQEhBQNAIAUgDk9FBEAgCCAFQQJ0IgtqKAIAIQwgAyALaiABNgIAIAwgBSAJanQgAWohASAFQQFqIQUMAQsLIAcgBEEBaiIBIAJrIgRrQQFqIQgDQEEBIQUgBCAIT0UEQANAIAUgDk9FBEAgBUECdCIJIAMgBEE0bGpqIAMgCWooAgAgBHY2AgAgBUEBaiEFDAELCyAEQQFqIQQMAQsLIBIgByAPIAogESADIAIgARBkIAZBAToABSAGIAc6AAYgACAGKAIENgIACyAQIQULIAZBEGokACAFC8ENAQt/IwBB8ABrIgUkAEFsIQkCQCADQQpJDQAgAi8AACEKIAIvAAIhDCACLwAEIQYgBUEIaiAEEA4CQCADIAYgCiAMampBBmoiDUkNACAFLQAKIQcgBUHYAGogAkEGaiICIAoQBiIJEAMNASAFQUBrIAIgCmoiAiAMEAYiCRADDQEgBUEoaiACIAxqIgIgBhAGIgkQAw0BIAVBEGogAiAGaiADIA1rEAYiCRADDQEgACABaiIOQX1qIQ8gBEEEaiEGQQEhCSAAIAFBA2pBAnYiAmoiCiACaiIMIAJqIg0hAyAMIQQgCiECA0AgCSADIA9JcQRAIAYgBUHYAGogBxACQQF0aiIILQAAIQsgBUHYAGogCC0AARABIAAgCzoAACAGIAVBQGsgBxACQQF0aiIILQAAIQsgBUFAayAILQABEAEgAiALOgAAIAYgBUEoaiAHEAJBAXRqIggtAAAhCyAFQShqIAgtAAEQASAEIAs6AAAgBiAFQRBqIAcQAkEBdGoiCC0AACELIAVBEGogCC0AARABIAMgCzoAACAGIAVB2ABqIAcQAkEBdGoiCC0AACELIAVB2ABqIAgtAAEQASAAIAs6AAEgBiAFQUBrIAcQAkEBdGoiCC0AACELIAVBQGsgCC0AARABIAIgCzoAASAGIAVBKGogBxACQQF0aiIILQAAIQsgBUEoaiAILQABEAEgBCALOgABIAYgBUEQaiAHEAJBAXRqIggtAAAhCyAFQRBqIAgtAAEQASADIAs6AAEgA0ECaiEDIARBAmohBCACQQJqIQIgAEECaiEAIAkgBUHYAGoQDUVxIAVBQGsQDUVxIAVBKGoQDUVxIAVBEGoQDUVxIQkMAQsLIAQgDUsgAiAMS3INAEFsIQkgACAKSw0BIApBfWohCQNAIAVB2ABqEAQgACAJT3JFBEAgBiAFQdgAaiAHEAJBAXRqIggtAAAhCyAFQdgAaiAILQABEAEgACALOgAAIAYgBUHYAGogBxACQQF0aiIILQAAIQsgBUHYAGogCC0AARABIAAgCzoAASAAQQJqIQAMAQsLA0AgBUHYAGoQBCAAIApPckUEQCAGIAVB2ABqIAcQAkEBdGoiCS0AACEIIAVB2ABqIAktAAEQASAAIAg6AAAgAEEBaiEADAELCwNAIAAgCkkEQCAGIAVB2ABqIAcQAkEBdGoiCS0AACEIIAVB2ABqIAktAAEQASAAIAg6AAAgAEEBaiEADAELCyAMQX1qIQADQCAFQUBrEAQgAiAAT3JFBEAgBiAFQUBrIAcQAkEBdGoiCi0AACEJIAVBQGsgCi0AARABIAIgCToAACAGIAVBQGsgBxACQQF0aiIKLQAAIQkgBUFAayAKLQABEAEgAiAJOgABIAJBAmohAgwBCwsDQCAFQUBrEAQgAiAMT3JFBEAgBiAFQUBrIAcQAkEBdGoiAC0AACEKIAVBQGsgAC0AARABIAIgCjoAACACQQFqIQIMAQsLA0AgAiAMSQRAIAYgBUFAayAHEAJBAXRqIgAtAAAhCiAFQUBrIAAtAAEQASACIAo6AAAgAkEBaiECDAELCyANQX1qIQADQCAFQShqEAQgBCAAT3JFBEAgBiAFQShqIAcQAkEBdGoiAi0AACEKIAVBKGogAi0AARABIAQgCjoAACAGIAVBKGogBxACQQF0aiICLQAAIQogBUEoaiACLQABEAEgBCAKOgABIARBAmohBAwBCwsDQCAFQShqEAQgBCANT3JFBEAgBiAFQShqIAcQAkEBdGoiAC0AACECIAVBKGogAC0AARABIAQgAjoAACAEQQFqIQQMAQsLA0AgBCANSQRAIAYgBUEoaiAHEAJBAXRqIgAtAAAhAiAFQShqIAAtAAEQASAEIAI6AAAgBEEBaiEEDAELCwNAIAVBEGoQBCADIA9PckUEQCAGIAVBEGogBxACQQF0aiIALQAAIQIgBUEQaiAALQABEAEgAyACOgAAIAYgBUEQaiAHEAJBAXRqIgAtAAAhAiAFQRBqIAAtAAEQASADIAI6AAEgA0ECaiEDDAELCwNAIAVBEGoQBCADIA5PckUEQCAGIAVBEGogBxACQQF0aiIALQAAIQIgBUEQaiAALQABEAEgAyACOgAAIANBAWohAwwBCwsDQCADIA5JBEAgBiAFQRBqIAcQAkEBdGoiAC0AACECIAVBEGogAC0AARABIAMgAjoAACADQQFqIQMMAQsLIAFBbCAFQdgAahAKIAVBQGsQCnEgBUEoahAKcSAFQRBqEApxGyEJDAELQWwhCQsgBUHwAGokACAJC8oCAQR/IwBBIGsiBSQAIAUgBBAOIAUtAAIhByAFQQhqIAIgAxAGIgIQA0UEQCAEQQRqIQIgACABaiIDQX1qIQQDQCAFQQhqEAQgACAET3JFBEAgAiAFQQhqIAcQAkEBdGoiBi0AACEIIAVBCGogBi0AARABIAAgCDoAACACIAVBCGogBxACQQF0aiIGLQAAIQggBUEIaiAGLQABEAEgACAIOgABIABBAmohAAwBCwsDQCAFQQhqEAQgACADT3JFBEAgAiAFQQhqIAcQAkEBdGoiBC0AACEGIAVBCGogBC0AARABIAAgBjoAACAAQQFqIQAMAQsLA0AgACADT0UEQCACIAVBCGogBxACQQF0aiIELQAAIQYgBUEIaiAELQABEAEgACAGOgAAIABBAWohAAwBCwsgAUFsIAVBCGoQChshAgsgBUEgaiQAIAILtgMBCX8jAEEQayIGJAAgBkEANgIMIAZBADYCCEFUIQQCQAJAIANBQGsiDCADIAZBCGogBkEMaiABIAIQMSICEAMNACAGQQRqIAAQDiAGKAIMIgcgBi0ABEEBaksNASAAQQRqIQogBkEAOgAFIAYgBzoABiAAIAYoAgQ2AgAgB0EBaiEJQQEhBANAIAQgCUkEQCADIARBAnRqIgEoAgAhACABIAU2AgAgACAEQX9qdCAFaiEFIARBAWohBAwBCwsgB0EBaiEHQQAhBSAGKAIIIQkDQCAFIAlGDQEgAyAFIAxqLQAAIgRBAnRqIgBBASAEdEEBdSILIAAoAgAiAWoiADYCACAHIARrIQhBACEEAkAgC0EDTQRAA0AgBCALRg0CIAogASAEakEBdGoiACAIOgABIAAgBToAACAEQQFqIQQMAAALAAsDQCABIABPDQEgCiABQQF0aiIEIAg6AAEgBCAFOgAAIAQgCDoAAyAEIAU6AAIgBCAIOgAFIAQgBToABCAEIAg6AAcgBCAFOgAGIAFBBGohAQwAAAsACyAFQQFqIQUMAAALAAsgAiEECyAGQRBqJAAgBAutAQECfwJAQYQgKAIAIABHIAAoAgBBAXYiAyABa0F4aiICQXhxQQhHcgR/IAIFIAMQJ0UNASACQQhqC0EQSQ0AIAAgACgCACICQQFxIAAgAWpBD2pBeHEiASAAa0EBdHI2AgAgASAANgIEIAEgASgCAEEBcSAAIAJBAXZqIAFrIgJBAXRyNgIAQYQgIAEgAkH/////B3FqQQRqQYQgKAIAIABGGyABNgIAIAEQJQsLygIBBX8CQAJAAkAgAEEIIABBCEsbZ0EfcyAAaUEBR2oiAUEESSAAIAF2cg0AIAFBAnRB/B5qKAIAIgJFDQADQCACQXhqIgMoAgBBAXZBeGoiBSAATwRAIAIgBUEIIAVBCEsbZ0Efc0ECdEGAH2oiASgCAEYEQCABIAIoAgQ2AgALDAMLIARBHksNASAEQQFqIQQgAigCBCICDQALC0EAIQMgAUEgTw0BA0AgAUECdEGAH2ooAgAiAkUEQCABQR5LIQIgAUEBaiEBIAJFDQEMAwsLIAIgAkF4aiIDKAIAQQF2QXhqIgFBCCABQQhLG2dBH3NBAnRBgB9qIgEoAgBGBEAgASACKAIENgIACwsgAigCACIBBEAgASACKAIENgIECyACKAIEIgEEQCABIAIoAgA2AgALIAMgAygCAEEBcjYCACADIAAQNwsgAwvhCwINfwV+IwBB8ABrIgckACAHIAAoAvDhASIINgJcIAEgAmohDSAIIAAoAoDiAWohDwJAAkAgBUUEQCABIQQMAQsgACgCxOABIRAgACgCwOABIREgACgCvOABIQ4gAEEBNgKM4QFBACEIA0AgCEEDRwRAIAcgCEECdCICaiAAIAJqQazQAWooAgA2AkQgCEEBaiEIDAELC0FsIQwgB0EYaiADIAQQBhADDQEgB0EsaiAHQRhqIAAoAgAQEyAHQTRqIAdBGGogACgCCBATIAdBPGogB0EYaiAAKAIEEBMgDUFgaiESIAEhBEEAIQwDQCAHKAIwIAcoAixBA3RqKQIAIhRCEIinQf8BcSEIIAcoAkAgBygCPEEDdGopAgAiFUIQiKdB/wFxIQsgBygCOCAHKAI0QQN0aikCACIWQiCIpyEJIBVCIIghFyAUQiCIpyECAkAgFkIQiKdB/wFxIgNBAk8EQAJAIAZFIANBGUlyRQRAIAkgB0EYaiADQSAgBygCHGsiCiAKIANLGyIKEAUgAyAKayIDdGohCSAHQRhqEAQaIANFDQEgB0EYaiADEAUgCWohCQwBCyAHQRhqIAMQBSAJaiEJIAdBGGoQBBoLIAcpAkQhGCAHIAk2AkQgByAYNwNIDAELAkAgA0UEQCACBEAgBygCRCEJDAMLIAcoAkghCQwBCwJAAkAgB0EYakEBEAUgCSACRWpqIgNBA0YEQCAHKAJEQX9qIgMgA0VqIQkMAQsgA0ECdCAHaigCRCIJIAlFaiEJIANBAUYNAQsgByAHKAJINgJMCwsgByAHKAJENgJIIAcgCTYCRAsgF6chAyALBEAgB0EYaiALEAUgA2ohAwsgCCALakEUTwRAIAdBGGoQBBoLIAgEQCAHQRhqIAgQBSACaiECCyAHQRhqEAQaIAcgB0EYaiAUQhiIp0H/AXEQCCAUp0H//wNxajYCLCAHIAdBGGogFUIYiKdB/wFxEAggFadB//8DcWo2AjwgB0EYahAEGiAHIAdBGGogFkIYiKdB/wFxEAggFqdB//8DcWo2AjQgByACNgJgIAcoAlwhCiAHIAk2AmggByADNgJkAkACQAJAIAQgAiADaiILaiASSw0AIAIgCmoiEyAPSw0AIA0gBGsgC0Egak8NAQsgByAHKQNoNwMQIAcgBykDYDcDCCAEIA0gB0EIaiAHQdwAaiAPIA4gESAQEB4hCwwBCyACIARqIQggBCAKEAcgAkERTwRAIARBEGohAgNAIAIgCkEQaiIKEAcgAkEQaiICIAhJDQALCyAIIAlrIQIgByATNgJcIAkgCCAOa0sEQCAJIAggEWtLBEBBbCELDAILIBAgAiAOayICaiIKIANqIBBNBEAgCCAKIAMQDxoMAgsgCCAKQQAgAmsQDyEIIAcgAiADaiIDNgJkIAggAmshCCAOIQILIAlBEE8EQCADIAhqIQMDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALDAELAkAgCUEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgCUECdCIDQcAeaigCAGoiAhAXIAIgA0HgHmooAgBrIQIgBygCZCEDDAELIAggAhAMCyADQQlJDQAgAyAIaiEDIAhBCGoiCCACQQhqIgJrQQ9MBEADQCAIIAIQDCACQQhqIQIgCEEIaiIIIANJDQAMAgALAAsDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALCyAHQRhqEAQaIAsgDCALEAMiAhshDCAEIAQgC2ogAhshBCAFQX9qIgUNAAsgDBADDQFBbCEMIAdBGGoQBEECSQ0BQQAhCANAIAhBA0cEQCAAIAhBAnQiAmpBrNABaiACIAdqKAJENgIAIAhBAWohCAwBCwsgBygCXCEIC0G6fyEMIA8gCGsiACANIARrSw0AIAQEfyAEIAggABALIABqBUEACyABayEMCyAHQfAAaiQAIAwLkRcCFn8FfiMAQdABayIHJAAgByAAKALw4QEiCDYCvAEgASACaiESIAggACgCgOIBaiETAkACQCAFRQRAIAEhAwwBCyAAKALE4AEhESAAKALA4AEhFSAAKAK84AEhDyAAQQE2AozhAUEAIQgDQCAIQQNHBEAgByAIQQJ0IgJqIAAgAmpBrNABaigCADYCVCAIQQFqIQgMAQsLIAcgETYCZCAHIA82AmAgByABIA9rNgJoQWwhECAHQShqIAMgBBAGEAMNASAFQQQgBUEESBshFyAHQTxqIAdBKGogACgCABATIAdBxABqIAdBKGogACgCCBATIAdBzABqIAdBKGogACgCBBATQQAhBCAHQeAAaiEMIAdB5ABqIQoDQCAHQShqEARBAksgBCAXTnJFBEAgBygCQCAHKAI8QQN0aikCACIdQhCIp0H/AXEhCyAHKAJQIAcoAkxBA3RqKQIAIh5CEIinQf8BcSEJIAcoAkggBygCREEDdGopAgAiH0IgiKchCCAeQiCIISAgHUIgiKchAgJAIB9CEIinQf8BcSIDQQJPBEACQCAGRSADQRlJckUEQCAIIAdBKGogA0EgIAcoAixrIg0gDSADSxsiDRAFIAMgDWsiA3RqIQggB0EoahAEGiADRQ0BIAdBKGogAxAFIAhqIQgMAQsgB0EoaiADEAUgCGohCCAHQShqEAQaCyAHKQJUISEgByAINgJUIAcgITcDWAwBCwJAIANFBEAgAgRAIAcoAlQhCAwDCyAHKAJYIQgMAQsCQAJAIAdBKGpBARAFIAggAkVqaiIDQQNGBEAgBygCVEF/aiIDIANFaiEIDAELIANBAnQgB2ooAlQiCCAIRWohCCADQQFGDQELIAcgBygCWDYCXAsLIAcgBygCVDYCWCAHIAg2AlQLICCnIQMgCQRAIAdBKGogCRAFIANqIQMLIAkgC2pBFE8EQCAHQShqEAQaCyALBEAgB0EoaiALEAUgAmohAgsgB0EoahAEGiAHIAcoAmggAmoiCSADajYCaCAKIAwgCCAJSxsoAgAhDSAHIAdBKGogHUIYiKdB/wFxEAggHadB//8DcWo2AjwgByAHQShqIB5CGIinQf8BcRAIIB6nQf//A3FqNgJMIAdBKGoQBBogB0EoaiAfQhiIp0H/AXEQCCEOIAdB8ABqIARBBHRqIgsgCSANaiAIazYCDCALIAg2AgggCyADNgIEIAsgAjYCACAHIA4gH6dB//8DcWo2AkQgBEEBaiEEDAELCyAEIBdIDQEgEkFgaiEYIAdB4ABqIRogB0HkAGohGyABIQMDQCAHQShqEARBAksgBCAFTnJFBEAgBygCQCAHKAI8QQN0aikCACIdQhCIp0H/AXEhCyAHKAJQIAcoAkxBA3RqKQIAIh5CEIinQf8BcSEIIAcoAkggBygCREEDdGopAgAiH0IgiKchCSAeQiCIISAgHUIgiKchDAJAIB9CEIinQf8BcSICQQJPBEACQCAGRSACQRlJckUEQCAJIAdBKGogAkEgIAcoAixrIgogCiACSxsiChAFIAIgCmsiAnRqIQkgB0EoahAEGiACRQ0BIAdBKGogAhAFIAlqIQkMAQsgB0EoaiACEAUgCWohCSAHQShqEAQaCyAHKQJUISEgByAJNgJUIAcgITcDWAwBCwJAIAJFBEAgDARAIAcoAlQhCQwDCyAHKAJYIQkMAQsCQAJAIAdBKGpBARAFIAkgDEVqaiICQQNGBEAgBygCVEF/aiICIAJFaiEJDAELIAJBAnQgB2ooAlQiCSAJRWohCSACQQFGDQELIAcgBygCWDYCXAsLIAcgBygCVDYCWCAHIAk2AlQLICCnIRQgCARAIAdBKGogCBAFIBRqIRQLIAggC2pBFE8EQCAHQShqEAQaCyALBEAgB0EoaiALEAUgDGohDAsgB0EoahAEGiAHIAcoAmggDGoiGSAUajYCaCAbIBogCSAZSxsoAgAhHCAHIAdBKGogHUIYiKdB/wFxEAggHadB//8DcWo2AjwgByAHQShqIB5CGIinQf8BcRAIIB6nQf//A3FqNgJMIAdBKGoQBBogByAHQShqIB9CGIinQf8BcRAIIB+nQf//A3FqNgJEIAcgB0HwAGogBEEDcUEEdGoiDSkDCCIdNwPIASAHIA0pAwAiHjcDwAECQAJAAkAgBygCvAEiDiAepyICaiIWIBNLDQAgAyAHKALEASIKIAJqIgtqIBhLDQAgEiADayALQSBqTw0BCyAHIAcpA8gBNwMQIAcgBykDwAE3AwggAyASIAdBCGogB0G8AWogEyAPIBUgERAeIQsMAQsgAiADaiEIIAMgDhAHIAJBEU8EQCADQRBqIQIDQCACIA5BEGoiDhAHIAJBEGoiAiAISQ0ACwsgCCAdpyIOayECIAcgFjYCvAEgDiAIIA9rSwRAIA4gCCAVa0sEQEFsIQsMAgsgESACIA9rIgJqIhYgCmogEU0EQCAIIBYgChAPGgwCCyAIIBZBACACaxAPIQggByACIApqIgo2AsQBIAggAmshCCAPIQILIA5BEE8EQCAIIApqIQoDQCAIIAIQByACQRBqIQIgCEEQaiIIIApJDQALDAELAkAgDkEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgDkECdCIKQcAeaigCAGoiAhAXIAIgCkHgHmooAgBrIQIgBygCxAEhCgwBCyAIIAIQDAsgCkEJSQ0AIAggCmohCiAIQQhqIgggAkEIaiICa0EPTARAA0AgCCACEAwgAkEIaiECIAhBCGoiCCAKSQ0ADAIACwALA0AgCCACEAcgAkEQaiECIAhBEGoiCCAKSQ0ACwsgCxADBEAgCyEQDAQFIA0gDDYCACANIBkgHGogCWs2AgwgDSAJNgIIIA0gFDYCBCAEQQFqIQQgAyALaiEDDAILAAsLIAQgBUgNASAEIBdrIQtBACEEA0AgCyAFSARAIAcgB0HwAGogC0EDcUEEdGoiAikDCCIdNwPIASAHIAIpAwAiHjcDwAECQAJAAkAgBygCvAEiDCAepyICaiIKIBNLDQAgAyAHKALEASIJIAJqIhBqIBhLDQAgEiADayAQQSBqTw0BCyAHIAcpA8gBNwMgIAcgBykDwAE3AxggAyASIAdBGGogB0G8AWogEyAPIBUgERAeIRAMAQsgAiADaiEIIAMgDBAHIAJBEU8EQCADQRBqIQIDQCACIAxBEGoiDBAHIAJBEGoiAiAISQ0ACwsgCCAdpyIGayECIAcgCjYCvAEgBiAIIA9rSwRAIAYgCCAVa0sEQEFsIRAMAgsgESACIA9rIgJqIgwgCWogEU0EQCAIIAwgCRAPGgwCCyAIIAxBACACaxAPIQggByACIAlqIgk2AsQBIAggAmshCCAPIQILIAZBEE8EQCAIIAlqIQYDQCAIIAIQByACQRBqIQIgCEEQaiIIIAZJDQALDAELAkAgBkEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgBkECdCIGQcAeaigCAGoiAhAXIAIgBkHgHmooAgBrIQIgBygCxAEhCQwBCyAIIAIQDAsgCUEJSQ0AIAggCWohBiAIQQhqIgggAkEIaiICa0EPTARAA0AgCCACEAwgAkEIaiECIAhBCGoiCCAGSQ0ADAIACwALA0AgCCACEAcgAkEQaiECIAhBEGoiCCAGSQ0ACwsgEBADDQMgC0EBaiELIAMgEGohAwwBCwsDQCAEQQNHBEAgACAEQQJ0IgJqQazQAWogAiAHaigCVDYCACAEQQFqIQQMAQsLIAcoArwBIQgLQbp/IRAgEyAIayIAIBIgA2tLDQAgAwR/IAMgCCAAEAsgAGoFQQALIAFrIRALIAdB0AFqJAAgEAslACAAQgA3AgAgAEEAOwEIIABBADoACyAAIAE2AgwgACACOgAKC7QFAQN/IwBBMGsiBCQAIABB/wFqIgVBfWohBgJAIAMvAQIEQCAEQRhqIAEgAhAGIgIQAw0BIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahASOgAAIAMgBEEIaiAEQRhqEBI6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0FIAEgBEEQaiAEQRhqEBI6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBSABIARBCGogBEEYahASOgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEjoAACABIAJqIABrIQIMAwsgAyAEQRBqIARBGGoQEjoAAiADIARBCGogBEEYahASOgADIANBBGohAwwAAAsACyAEQRhqIAEgAhAGIgIQAw0AIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahAROgAAIAMgBEEIaiAEQRhqEBE6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0EIAEgBEEQaiAEQRhqEBE6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBCABIARBCGogBEEYahAROgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEToAACABIAJqIABrIQIMAgsgAyAEQRBqIARBGGoQEToAAiADIARBCGogBEEYahAROgADIANBBGohAwwAAAsACyAEQTBqJAAgAgtpAQF/An8CQAJAIAJBB00NACABKAAAQbfIwuF+Rw0AIAAgASgABDYCmOIBQWIgAEEQaiABIAIQPiIDEAMNAhogAEKBgICAEDcDiOEBIAAgASADaiACIANrECoMAQsgACABIAIQKgtBAAsLrQMBBn8jAEGAAWsiAyQAQWIhCAJAIAJBCUkNACAAQZjQAGogAUEIaiIEIAJBeGogAEGY0AAQMyIFEAMiBg0AIANBHzYCfCADIANB/ABqIANB+ABqIAQgBCAFaiAGGyIEIAEgAmoiAiAEaxAVIgUQAw0AIAMoAnwiBkEfSw0AIAMoAngiB0EJTw0AIABBiCBqIAMgBkGAC0GADCAHEBggA0E0NgJ8IAMgA0H8AGogA0H4AGogBCAFaiIEIAIgBGsQFSIFEAMNACADKAJ8IgZBNEsNACADKAJ4IgdBCk8NACAAQZAwaiADIAZBgA1B4A4gBxAYIANBIzYCfCADIANB/ABqIANB+ABqIAQgBWoiBCACIARrEBUiBRADDQAgAygCfCIGQSNLDQAgAygCeCIHQQpPDQAgACADIAZBwBBB0BEgBxAYIAQgBWoiBEEMaiIFIAJLDQAgAiAFayEFQQAhAgNAIAJBA0cEQCAEKAAAIgZBf2ogBU8NAiAAIAJBAnRqQZzQAWogBjYCACACQQFqIQIgBEEEaiEEDAELCyAEIAFrIQgLIANBgAFqJAAgCAtGAQN/IABBCGohAyAAKAIEIQJBACEAA0AgACACdkUEQCABIAMgAEEDdGotAAJBFktqIQEgAEEBaiEADAELCyABQQggAmt0C4YDAQV/Qbh/IQcCQCADRQ0AIAItAAAiBEUEQCABQQA2AgBBAUG4fyADQQFGGw8LAn8gAkEBaiIFIARBGHRBGHUiBkF/Sg0AGiAGQX9GBEAgA0EDSA0CIAUvAABBgP4BaiEEIAJBA2oMAQsgA0ECSA0BIAItAAEgBEEIdHJBgIB+aiEEIAJBAmoLIQUgASAENgIAIAVBAWoiASACIANqIgNLDQBBbCEHIABBEGogACAFLQAAIgVBBnZBI0EJIAEgAyABa0HAEEHQEUHwEiAAKAKM4QEgACgCnOIBIAQQHyIGEAMiCA0AIABBmCBqIABBCGogBUEEdkEDcUEfQQggASABIAZqIAgbIgEgAyABa0GAC0GADEGAFyAAKAKM4QEgACgCnOIBIAQQHyIGEAMiCA0AIABBoDBqIABBBGogBUECdkEDcUE0QQkgASABIAZqIAgbIgEgAyABa0GADUHgDkGQGSAAKAKM4QEgACgCnOIBIAQQHyIAEAMNACAAIAFqIAJrIQcLIAcLrQMBCn8jAEGABGsiCCQAAn9BUiACQf8BSw0AGkFUIANBDEsNABogAkEBaiELIABBBGohCUGAgAQgA0F/anRBEHUhCkEAIQJBASEEQQEgA3QiB0F/aiIMIQUDQCACIAtGRQRAAkAgASACQQF0Ig1qLwEAIgZB//8DRgRAIAkgBUECdGogAjoAAiAFQX9qIQVBASEGDAELIARBACAKIAZBEHRBEHVKGyEECyAIIA1qIAY7AQAgAkEBaiECDAELCyAAIAQ7AQIgACADOwEAIAdBA3YgB0EBdmpBA2ohBkEAIQRBACECA0AgBCALRkUEQCABIARBAXRqLgEAIQpBACEAA0AgACAKTkUEQCAJIAJBAnRqIAQ6AAIDQCACIAZqIAxxIgIgBUsNAAsgAEEBaiEADAELCyAEQQFqIQQMAQsLQX8gAg0AGkEAIQIDfyACIAdGBH9BAAUgCCAJIAJBAnRqIgAtAAJBAXRqIgEgAS8BACIBQQFqOwEAIAAgAyABEBRrIgU6AAMgACABIAVB/wFxdCAHazsBACACQQFqIQIMAQsLCyEFIAhBgARqJAAgBQvjBgEIf0FsIQcCQCACQQNJDQACQAJAAkACQCABLQAAIgNBA3EiCUEBaw4DAwEAAgsgACgCiOEBDQBBYg8LIAJBBUkNAkEDIQYgASgAACEFAn8CQAJAIANBAnZBA3EiCEF+aiIEQQFNBEAgBEEBaw0BDAILIAVBDnZB/wdxIQQgBUEEdkH/B3EhAyAIRQwCCyAFQRJ2IQRBBCEGIAVBBHZB//8AcSEDQQAMAQsgBUEEdkH//w9xIgNBgIAISw0DIAEtAARBCnQgBUEWdnIhBEEFIQZBAAshBSAEIAZqIgogAksNAgJAIANBgQZJDQAgACgCnOIBRQ0AQQAhAgNAIAJBg4ABSw0BIAJBQGshAgwAAAsACwJ/IAlBA0YEQCABIAZqIQEgAEHw4gFqIQIgACgCDCEGIAUEQCACIAMgASAEIAYQXwwCCyACIAMgASAEIAYQXQwBCyAAQbjQAWohAiABIAZqIQEgAEHw4gFqIQYgAEGo0ABqIQggBQRAIAggBiADIAEgBCACEF4MAQsgCCAGIAMgASAEIAIQXAsQAw0CIAAgAzYCgOIBIABBATYCiOEBIAAgAEHw4gFqNgLw4QEgCUECRgRAIAAgAEGo0ABqNgIMCyAAIANqIgBBiOMBakIANwAAIABBgOMBakIANwAAIABB+OIBakIANwAAIABB8OIBakIANwAAIAoPCwJ/AkACQAJAIANBAnZBA3FBf2oiBEECSw0AIARBAWsOAgACAQtBASEEIANBA3YMAgtBAiEEIAEvAABBBHYMAQtBAyEEIAEQIUEEdgsiAyAEaiIFQSBqIAJLBEAgBSACSw0CIABB8OIBaiABIARqIAMQCyEBIAAgAzYCgOIBIAAgATYC8OEBIAEgA2oiAEIANwAYIABCADcAECAAQgA3AAggAEIANwAAIAUPCyAAIAM2AoDiASAAIAEgBGo2AvDhASAFDwsCfwJAAkACQCADQQJ2QQNxQX9qIgRBAksNACAEQQFrDgIAAgELQQEhByADQQN2DAILQQIhByABLwAAQQR2DAELIAJBBEkgARAhIgJBj4CAAUtyDQFBAyEHIAJBBHYLIQIgAEHw4gFqIAEgB2otAAAgAkEgahAQIQEgACACNgKA4gEgACABNgLw4QEgB0EBaiEHCyAHC0sAIABC+erQ0OfJoeThADcDICAAQgA3AxggAELP1tO+0ser2UI3AxAgAELW64Lu6v2J9eAANwMIIABCADcDACAAQShqQQBBKBAQGgviAgICfwV+IABBKGoiASAAKAJIaiECAn4gACkDACIDQiBaBEAgACkDECIEQgeJIAApAwgiBUIBiXwgACkDGCIGQgyJfCAAKQMgIgdCEol8IAUQGSAEEBkgBhAZIAcQGQwBCyAAKQMYQsXP2bLx5brqJ3wLIAN8IQMDQCABQQhqIgAgAk0EQEIAIAEpAAAQCSADhUIbiUKHla+vmLbem55/fkLj3MqV/M7y9YV/fCEDIAAhAQwBCwsCQCABQQRqIgAgAksEQCABIQAMAQsgASgAAK1Ch5Wvr5i23puef34gA4VCF4lCz9bTvtLHq9lCfkL5893xmfaZqxZ8IQMLA0AgACACSQRAIAAxAABCxc/ZsvHluuonfiADhUILiUKHla+vmLbem55/fiEDIABBAWohAAwBCwsgA0IhiCADhULP1tO+0ser2UJ+IgNCHYggA4VC+fPd8Zn2masWfiIDQiCIIAOFC+8CAgJ/BH4gACAAKQMAIAKtfDcDAAJAAkAgACgCSCIDIAJqIgRBH00EQCABRQ0BIAAgA2pBKGogASACECAgACgCSCACaiEEDAELIAEgAmohAgJ/IAMEQCAAQShqIgQgA2ogAUEgIANrECAgACAAKQMIIAQpAAAQCTcDCCAAIAApAxAgACkAMBAJNwMQIAAgACkDGCAAKQA4EAk3AxggACAAKQMgIABBQGspAAAQCTcDICAAKAJIIQMgAEEANgJIIAEgA2tBIGohAQsgAUEgaiACTQsEQCACQWBqIQMgACkDICEFIAApAxghBiAAKQMQIQcgACkDCCEIA0AgCCABKQAAEAkhCCAHIAEpAAgQCSEHIAYgASkAEBAJIQYgBSABKQAYEAkhBSABQSBqIgEgA00NAAsgACAFNwMgIAAgBjcDGCAAIAc3AxAgACAINwMICyABIAJPDQEgAEEoaiABIAIgAWsiBBAgCyAAIAQ2AkgLCy8BAX8gAEUEQEG2f0EAIAMbDwtBun8hBCADIAFNBH8gACACIAMQEBogAwVBun8LCy8BAX8gAEUEQEG2f0EAIAMbDwtBun8hBCADIAFNBH8gACACIAMQCxogAwVBun8LC6gCAQZ/IwBBEGsiByQAIABB2OABaikDAEKAgIAQViEIQbh/IQUCQCAEQf//B0sNACAAIAMgBBBCIgUQAyIGDQAgACgCnOIBIQkgACAHQQxqIAMgAyAFaiAGGyIKIARBACAFIAYbayIGEEAiAxADBEAgAyEFDAELIAcoAgwhBCABRQRAQbp/IQUgBEEASg0BCyAGIANrIQUgAyAKaiEDAkAgCQRAIABBADYCnOIBDAELAkACQAJAIARBBUgNACAAQdjgAWopAwBCgICACFgNAAwBCyAAQQA2ApziAQwBCyAAKAIIED8hBiAAQQA2ApziASAGQRRPDQELIAAgASACIAMgBSAEIAgQOSEFDAELIAAgASACIAMgBSAEIAgQOiEFCyAHQRBqJAAgBQtnACAAQdDgAWogASACIAAoAuzhARAuIgEQAwRAIAEPC0G4fyECAkAgAQ0AIABB7OABaigCACIBBEBBYCECIAAoApjiASABRw0BC0EAIQIgAEHw4AFqKAIARQ0AIABBkOEBahBDCyACCycBAX8QVyIERQRAQUAPCyAEIAAgASACIAMgBBBLEE8hACAEEFYgAAs/AQF/AkACQAJAIAAoAqDiAUEBaiIBQQJLDQAgAUEBaw4CAAECCyAAEDBBAA8LIABBADYCoOIBCyAAKAKU4gELvAMCB38BfiMAQRBrIgkkAEG4fyEGAkAgBCgCACIIQQVBCSAAKALs4QEiBRtJDQAgAygCACIHQQFBBSAFGyAFEC8iBRADBEAgBSEGDAELIAggBUEDakkNACAAIAcgBRBJIgYQAw0AIAEgAmohCiAAQZDhAWohCyAIIAVrIQIgBSAHaiEHIAEhBQNAIAcgAiAJECwiBhADDQEgAkF9aiICIAZJBEBBuH8hBgwCCyAJKAIAIghBAksEQEFsIQYMAgsgB0EDaiEHAn8CQAJAAkAgCEEBaw4CAgABCyAAIAUgCiAFayAHIAYQSAwCCyAFIAogBWsgByAGEEcMAQsgBSAKIAVrIActAAAgCSgCCBBGCyIIEAMEQCAIIQYMAgsgACgC8OABBEAgCyAFIAgQRQsgAiAGayECIAYgB2ohByAFIAhqIQUgCSgCBEUNAAsgACkD0OABIgxCf1IEQEFsIQYgDCAFIAFrrFINAQsgACgC8OABBEBBaiEGIAJBBEkNASALEEQhDCAHKAAAIAynRw0BIAdBBGohByACQXxqIQILIAMgBzYCACAEIAI2AgAgBSABayEGCyAJQRBqJAAgBgsuACAAECsCf0EAQQAQAw0AGiABRSACRXJFBEBBYiAAIAEgAhA9EAMNARoLQQALCzcAIAEEQCAAIAAoAsTgASABKAIEIAEoAghqRzYCnOIBCyAAECtBABADIAFFckUEQCAAIAEQWwsL0QIBB38jAEEQayIGJAAgBiAENgIIIAYgAzYCDCAFBEAgBSgCBCEKIAUoAgghCQsgASEIAkACQANAIAAoAuzhARAWIQsCQANAIAQgC0kNASADKAAAQXBxQdDUtMIBRgRAIAMgBBAiIgcQAw0EIAQgB2shBCADIAdqIQMMAQsLIAYgAzYCDCAGIAQ2AggCQCAFBEAgACAFEE5BACEHQQAQA0UNAQwFCyAAIAogCRBNIgcQAw0ECyAAIAgQUCAMQQFHQQAgACAIIAIgBkEMaiAGQQhqEEwiByIDa0EAIAMQAxtBCkdyRQRAQbh/IQcMBAsgBxADDQMgAiAHayECIAcgCGohCEEBIQwgBigCDCEDIAYoAgghBAwBCwsgBiADNgIMIAYgBDYCCEG4fyEHIAQNASAIIAFrIQcMAQsgBiADNgIMIAYgBDYCCAsgBkEQaiQAIAcLRgECfyABIAAoArjgASICRwRAIAAgAjYCxOABIAAgATYCuOABIAAoArzgASEDIAAgATYCvOABIAAgASADIAJrajYCwOABCwutAgIEfwF+IwBBQGoiBCQAAkACQCACQQhJDQAgASgAAEFwcUHQ1LTCAUcNACABIAIQIiEBIABCADcDCCAAQQA2AgQgACABNgIADAELIARBGGogASACEC0iAxADBEAgACADEBoMAQsgAwRAIABBuH8QGgwBCyACIAQoAjAiA2shAiABIANqIQMDQAJAIAAgAyACIARBCGoQLCIFEAMEfyAFBSACIAVBA2oiBU8NAUG4fwsQGgwCCyAGQQFqIQYgAiAFayECIAMgBWohAyAEKAIMRQ0ACyAEKAI4BEAgAkEDTQRAIABBuH8QGgwCCyADQQRqIQMLIAQoAighAiAEKQMYIQcgAEEANgIEIAAgAyABazYCACAAIAIgBmytIAcgB0J/URs3AwgLIARBQGskAAslAQF/IwBBEGsiAiQAIAIgACABEFEgAigCACEAIAJBEGokACAAC30BBH8jAEGQBGsiBCQAIARB/wE2AggCQCAEQRBqIARBCGogBEEMaiABIAIQFSIGEAMEQCAGIQUMAQtBVCEFIAQoAgwiB0EGSw0AIAMgBEEQaiAEKAIIIAcQQSIFEAMNACAAIAEgBmogAiAGayADEDwhBQsgBEGQBGokACAFC4cBAgJ/An5BABAWIQMCQANAIAEgA08EQAJAIAAoAABBcHFB0NS0wgFGBEAgACABECIiAhADRQ0BQn4PCyAAIAEQVSIEQn1WDQMgBCAFfCIFIARUIQJCfiEEIAINAyAAIAEQUiICEAMNAwsgASACayEBIAAgAmohAAwBCwtCfiAFIAEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQQh2QQFxIQIgAEEANgLg4gEgACACNgKM4gEgAUEgaiQAC3YBA38jAEEwayIBJAAgAARAIAEgAEHE0AFqIgIoAgA2AiggASAAKQK80AE3AyAgACgCACEDIAEgAigCADYCGCABIAApArzQATcDECADIAFBEGoQGyABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALzAEBAX8gACABKAK00AE2ApjiASAAIAEoAgQiAjYCwOABIAAgAjYCvOABIAAgAiABKAIIaiICNgK44AEgACACNgLE4AEgASgCuNABBEAgAEKBgICAEDcDiOEBIAAgAUGk0ABqNgIMIAAgAUGUIGo2AgggACABQZwwajYCBCAAIAFBDGo2AgAgAEGs0AFqIAFBqNABaigCADYCACAAQbDQAWogAUGs0AFqKAIANgIAIABBtNABaiABQbDQAWooAgA2AgAPCyAAQgA3A4jhAQs7ACACRQRAQbp/DwsgBEUEQEFsDwsgAiAEEGAEQCAAIAEgAiADIAQgBRBhDwsgACABIAIgAyAEIAUQZQtGAQF/IwBBEGsiBSQAIAVBCGogBBAOAn8gBS0ACQRAIAAgASACIAMgBBAyDAELIAAgASACIAMgBBA0CyEAIAVBEGokACAACzQAIAAgAyAEIAUQNiIFEAMEQCAFDwsgBSAESQR/IAEgAiADIAVqIAQgBWsgABA1BUG4fwsLRgEBfyMAQRBrIgUkACAFQQhqIAQQDgJ/IAUtAAkEQCAAIAEgAiADIAQQYgwBCyAAIAEgAiADIAQQNQshACAFQRBqJAAgAAtZAQF/QQ8hAiABIABJBEAgAUEEdCAAbiECCyAAQQh2IgEgAkEYbCIAQYwIaigCAGwgAEGICGooAgBqIgJBA3YgAmogAEGACGooAgAgAEGECGooAgAgAWxqSQs3ACAAIAMgBCAFQYAQEDMiBRADBEAgBQ8LIAUgBEkEfyABIAIgAyAFaiAEIAVrIAAQMgVBuH8LC78DAQN/IwBBIGsiBSQAIAVBCGogAiADEAYiAhADRQRAIAAgAWoiB0F9aiEGIAUgBBAOIARBBGohAiAFLQACIQMDQEEAIAAgBkkgBUEIahAEGwRAIAAgAiAFQQhqIAMQAkECdGoiBC8BADsAACAFQQhqIAQtAAIQASAAIAQtAANqIgQgAiAFQQhqIAMQAkECdGoiAC8BADsAACAFQQhqIAAtAAIQASAEIAAtAANqIQAMAQUgB0F+aiEEA0AgBUEIahAEIAAgBEtyRQRAIAAgAiAFQQhqIAMQAkECdGoiBi8BADsAACAFQQhqIAYtAAIQASAAIAYtAANqIQAMAQsLA0AgACAES0UEQCAAIAIgBUEIaiADEAJBAnRqIgYvAQA7AAAgBUEIaiAGLQACEAEgACAGLQADaiEADAELCwJAIAAgB08NACAAIAIgBUEIaiADEAIiA0ECdGoiAC0AADoAACAALQADQQFGBEAgBUEIaiAALQACEAEMAQsgBSgCDEEfSw0AIAVBCGogAiADQQJ0ai0AAhABIAUoAgxBIUkNACAFQSA2AgwLIAFBbCAFQQhqEAobIQILCwsgBUEgaiQAIAILkgIBBH8jAEFAaiIJJAAgCSADQTQQCyEDAkAgBEECSA0AIAMgBEECdGooAgAhCSADQTxqIAgQIyADQQE6AD8gAyACOgA+QQAhBCADKAI8IQoDQCAEIAlGDQEgACAEQQJ0aiAKNgEAIARBAWohBAwAAAsAC0EAIQkDQCAGIAlGRQRAIAMgBSAJQQF0aiIKLQABIgtBAnRqIgwoAgAhBCADQTxqIAotAABBCHQgCGpB//8DcRAjIANBAjoAPyADIAcgC2siCiACajoAPiAEQQEgASAKa3RqIQogAygCPCELA0AgACAEQQJ0aiALNgEAIARBAWoiBCAKSQ0ACyAMIAo2AgAgCUEBaiEJDAELCyADQUBrJAALowIBCX8jAEHQAGsiCSQAIAlBEGogBUE0EAsaIAcgBmshDyAHIAFrIRADQAJAIAMgCkcEQEEBIAEgByACIApBAXRqIgYtAAEiDGsiCGsiC3QhDSAGLQAAIQ4gCUEQaiAMQQJ0aiIMKAIAIQYgCyAPTwRAIAAgBkECdGogCyAIIAUgCEE0bGogCCAQaiIIQQEgCEEBShsiCCACIAQgCEECdGooAgAiCEEBdGogAyAIayAHIA4QYyAGIA1qIQgMAgsgCUEMaiAOECMgCUEBOgAPIAkgCDoADiAGIA1qIQggCSgCDCELA0AgBiAITw0CIAAgBkECdGogCzYBACAGQQFqIQYMAAALAAsgCUHQAGokAA8LIAwgCDYCACAKQQFqIQoMAAALAAs0ACAAIAMgBCAFEDYiBRADBEAgBQ8LIAUgBEkEfyABIAIgAyAFaiAEIAVrIAAQNAVBuH8LCyMAIAA/AEEQdGtB//8DakEQdkAAQX9GBEBBAA8LQQAQAEEBCzsBAX8gAgRAA0AgACABIAJBgCAgAkGAIEkbIgMQCyEAIAFBgCBqIQEgAEGAIGohACACIANrIgINAAsLCwYAIAAQAwsLqBUJAEGICAsNAQAAAAEAAAACAAAAAgBBoAgLswYBAAAAAQAAAAIAAAACAAAAJgAAAIIAAAAhBQAASgAAAGcIAAAmAAAAwAEAAIAAAABJBQAASgAAAL4IAAApAAAALAIAAIAAAABJBQAASgAAAL4IAAAvAAAAygIAAIAAAACKBQAASgAAAIQJAAA1AAAAcwMAAIAAAACdBQAASgAAAKAJAAA9AAAAgQMAAIAAAADrBQAASwAAAD4KAABEAAAAngMAAIAAAABNBgAASwAAAKoKAABLAAAAswMAAIAAAADBBgAATQAAAB8NAABNAAAAUwQAAIAAAAAjCAAAUQAAAKYPAABUAAAAmQQAAIAAAABLCQAAVwAAALESAABYAAAA2gQAAIAAAABvCQAAXQAAACMUAABUAAAARQUAAIAAAABUCgAAagAAAIwUAABqAAAArwUAAIAAAAB2CQAAfAAAAE4QAAB8AAAA0gIAAIAAAABjBwAAkQAAAJAHAACSAAAAAAAAAAEAAAABAAAABQAAAA0AAAAdAAAAPQAAAH0AAAD9AAAA/QEAAP0DAAD9BwAA/Q8AAP0fAAD9PwAA/X8AAP3/AAD9/wEA/f8DAP3/BwD9/w8A/f8fAP3/PwD9/38A/f//AP3//wH9//8D/f//B/3//w/9//8f/f//P/3//38AAAAAAQAAAAIAAAADAAAABAAAAAUAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAABEAAAASAAAAEwAAABQAAAAVAAAAFgAAABcAAAAYAAAAGQAAABoAAAAbAAAAHAAAAB0AAAAeAAAAHwAAAAMAAAAEAAAABQAAAAYAAAAHAAAACAAAAAkAAAAKAAAACwAAAAwAAAANAAAADgAAAA8AAAAQAAAAEQAAABIAAAATAAAAFAAAABUAAAAWAAAAFwAAABgAAAAZAAAAGgAAABsAAAAcAAAAHQAAAB4AAAAfAAAAIAAAACEAAAAiAAAAIwAAACUAAAAnAAAAKQAAACsAAAAvAAAAMwAAADsAAABDAAAAUwAAAGMAAACDAAAAAwEAAAMCAAADBAAAAwgAAAMQAAADIAAAA0AAAAOAAAADAAEAQeAPC1EBAAAAAQAAAAEAAAABAAAAAgAAAAIAAAADAAAAAwAAAAQAAAAEAAAABQAAAAcAAAAIAAAACQAAAAoAAAALAAAADAAAAA0AAAAOAAAADwAAABAAQcQQC4sBAQAAAAIAAAADAAAABAAAAAUAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAABIAAAAUAAAAFgAAABgAAAAcAAAAIAAAACgAAAAwAAAAQAAAAIAAAAAAAQAAAAIAAAAEAAAACAAAABAAAAAgAAAAQAAAAIAAAAAAAQBBkBIL5gQBAAAAAQAAAAEAAAABAAAAAgAAAAIAAAADAAAAAwAAAAQAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAAAEAAAAEAAAACAAAAAAAAAABAAEBBgAAAAAAAAQAAAAAEAAABAAAAAAgAAAFAQAAAAAAAAUDAAAAAAAABQQAAAAAAAAFBgAAAAAAAAUHAAAAAAAABQkAAAAAAAAFCgAAAAAAAAUMAAAAAAAABg4AAAAAAAEFEAAAAAAAAQUUAAAAAAABBRYAAAAAAAIFHAAAAAAAAwUgAAAAAAAEBTAAAAAgAAYFQAAAAAAABwWAAAAAAAAIBgABAAAAAAoGAAQAAAAADAYAEAAAIAAABAAAAAAAAAAEAQAAAAAAAAUCAAAAIAAABQQAAAAAAAAFBQAAACAAAAUHAAAAAAAABQgAAAAgAAAFCgAAAAAAAAULAAAAAAAABg0AAAAgAAEFEAAAAAAAAQUSAAAAIAABBRYAAAAAAAIFGAAAACAAAwUgAAAAAAADBSgAAAAAAAYEQAAAABAABgRAAAAAIAAHBYAAAAAAAAkGAAIAAAAACwYACAAAMAAABAAAAAAQAAAEAQAAACAAAAUCAAAAIAAABQMAAAAgAAAFBQAAACAAAAUGAAAAIAAABQgAAAAgAAAFCQAAACAAAAULAAAAIAAABQwAAAAAAAAGDwAAACAAAQUSAAAAIAABBRQAAAAgAAIFGAAAACAAAgUcAAAAIAADBSgAAAAgAAQFMAAAAAAAEAYAAAEAAAAPBgCAAAAAAA4GAEAAAAAADQYAIABBgBcLhwIBAAEBBQAAAAAAAAUAAAAAAAAGBD0AAAAAAAkF/QEAAAAADwX9fwAAAAAVBf3/HwAAAAMFBQAAAAAABwR9AAAAAAAMBf0PAAAAABIF/f8DAAAAFwX9/38AAAAFBR0AAAAAAAgE/QAAAAAADgX9PwAAAAAUBf3/DwAAAAIFAQAAABAABwR9AAAAAAALBf0HAAAAABEF/f8BAAAAFgX9/z8AAAAEBQ0AAAAQAAgE/QAAAAAADQX9HwAAAAATBf3/BwAAAAEFAQAAABAABgQ9AAAAAAAKBf0DAAAAABAF/f8AAAAAHAX9//8PAAAbBf3//wcAABoF/f//AwAAGQX9//8BAAAYBf3//wBBkBkLhgQBAAEBBgAAAAAAAAYDAAAAAAAABAQAAAAgAAAFBQAAAAAAAAUGAAAAAAAABQgAAAAAAAAFCQAAAAAAAAULAAAAAAAABg0AAAAAAAAGEAAAAAAAAAYTAAAAAAAABhYAAAAAAAAGGQAAAAAAAAYcAAAAAAAABh8AAAAAAAAGIgAAAAAAAQYlAAAAAAABBikAAAAAAAIGLwAAAAAAAwY7AAAAAAAEBlMAAAAAAAcGgwAAAAAACQYDAgAAEAAABAQAAAAAAAAEBQAAACAAAAUGAAAAAAAABQcAAAAgAAAFCQAAAAAAAAUKAAAAAAAABgwAAAAAAAAGDwAAAAAAAAYSAAAAAAAABhUAAAAAAAAGGAAAAAAAAAYbAAAAAAAABh4AAAAAAAAGIQAAAAAAAQYjAAAAAAABBicAAAAAAAIGKwAAAAAAAwYzAAAAAAAEBkMAAAAAAAUGYwAAAAAACAYDAQAAIAAABAQAAAAwAAAEBAAAABAAAAQFAAAAIAAABQcAAAAgAAAFCAAAACAAAAUKAAAAIAAABQsAAAAAAAAGDgAAAAAAAAYRAAAAAAAABhQAAAAAAAAGFwAAAAAAAAYaAAAAAAAABh0AAAAAAAAGIAAAAAAAEAYDAAEAAAAPBgOAAAAAAA4GA0AAAAAADQYDIAAAAAAMBgMQAAAAAAsGAwgAAAAACgYDBABBpB0L2QEBAAAAAwAAAAcAAAAPAAAAHwAAAD8AAAB/AAAA/wAAAP8BAAD/AwAA/wcAAP8PAAD/HwAA/z8AAP9/AAD//wAA//8BAP//AwD//wcA//8PAP//HwD//z8A//9/AP///wD///8B////A////wf///8P////H////z////9/AAAAAAEAAAACAAAABAAAAAAAAAACAAAABAAAAAgAAAAAAAAAAQAAAAIAAAABAAAABAAAAAQAAAAEAAAABAAAAAgAAAAIAAAACAAAAAcAAAAIAAAACQAAAAoAAAALAEGgIAsDwBBQ",Ng=new WeakMap;let Ug=0,Pg;class es extends ca{constructor(e){super(e),this.transcoderPath="",this.transcoderBinary=null,this.transcoderPending=null,this.workerPool=new ON,this.workerSourceURL="",this.workerConfig=null,typeof MSC_TRANSCODER<"u"&&console.warn('THREE.KTX2Loader: Please update to latest "basis_transcoder". "msc_basis_transcoder" is no longer supported in three.js r125+.')}setTranscoderPath(e){return this.transcoderPath=e,this}setWorkerLimit(e){return this.workerPool.setWorkerLimit(e),this}async detectSupportAsync(e){return this.workerConfig={astcSupported:await e.hasFeatureAsync("texture-compression-astc"),etc1Supported:await e.hasFeatureAsync("texture-compression-etc1"),etc2Supported:await e.hasFeatureAsync("texture-compression-etc2"),dxtSupported:await e.hasFeatureAsync("texture-compression-bc"),bptcSupported:await e.hasFeatureAsync("texture-compression-bptc"),pvrtcSupported:await e.hasFeatureAsync("texture-compression-pvrtc")},this}detectSupport(e){return e.isWebGPURenderer===!0?this.workerConfig={astcSupported:e.hasFeature("texture-compression-astc"),etc1Supported:e.hasFeature("texture-compression-etc1"),etc2Supported:e.hasFeature("texture-compression-etc2"),dxtSupported:e.hasFeature("texture-compression-bc"),bptcSupported:e.hasFeature("texture-compression-bptc"),pvrtcSupported:e.hasFeature("texture-compression-pvrtc")}:(this.workerConfig={astcSupported:e.extensions.has("WEBGL_compressed_texture_astc"),etc1Supported:e.extensions.has("WEBGL_compressed_texture_etc1"),etc2Supported:e.extensions.has("WEBGL_compressed_texture_etc"),dxtSupported:e.extensions.has("WEBGL_compressed_texture_s3tc"),bptcSupported:e.extensions.has("EXT_texture_compression_bptc"),pvrtcSupported:e.extensions.has("WEBGL_compressed_texture_pvrtc")||e.extensions.has("WEBKIT_WEBGL_compressed_texture_pvrtc")},this.workerConfig.etc1Supported=!1),this}init(){if(!this.transcoderPending){const e=new kl(this.manager);e.setPath(this.transcoderPath),e.setWithCredentials(this.withCredentials);const t=e.loadAsync("basis_transcoder.js"),n=new kl(this.manager);n.setPath(this.transcoderPath),n.setResponseType("arraybuffer"),n.setWithCredentials(this.withCredentials);const i=n.loadAsync("basis_transcoder.wasm");this.transcoderPending=Promise.all([t,i]).then(([s,o])=>{const l=es.BasisWorker.toString(),h=["/* constants */","let _EngineFormat = "+JSON.stringify(es.EngineFormat),"let _TranscoderFormat = "+JSON.stringify(es.TranscoderFormat),"let _BasisFormat = "+JSON.stringify(es.BasisFormat),"/* basis_transcoder.js */",s,"/* worker */",l.substring(l.indexOf("{")+1,l.lastIndexOf("}"))].join(`
3829
- `);this.workerSourceURL=URL.createObjectURL(new Blob([h])),this.transcoderBinary=o,this.workerPool.setWorkerCreator(()=>{const u=new Worker(this.workerSourceURL),d=this.transcoderBinary.slice(0);return u.postMessage({type:"init",config:this.workerConfig,transcoderBinary:d},[d]),u})}),Ug>0&&console.warn("THREE.KTX2Loader: Multiple active KTX2 loaders may cause performance issues. Use a single KTX2Loader instance, or call .dispose() on old instances."),Ug++}return this.transcoderPending}load(e,t,n,i){if(this.workerConfig===null)throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");const s=new kl(this.manager);s.setResponseType("arraybuffer"),s.setWithCredentials(this.withCredentials),s.load(e,o=>{if(Ng.has(o))return Ng.get(o).promise.then(t).catch(i);this._createTexture(o).then(l=>t?t(l):null).catch(i)},n,i)}_createTextureFrom(e,t){const{faces:n,width:i,height:s,format:o,type:l,error:h,dfdFlags:u}=e;if(l==="error")return Promise.reject(h);let d;if(t.faceCount===6)d=new I8(n,o,mr);else{const A=n[0].mipmaps;d=t.layerCount>1?new w8(A,i,s,t.layerCount,o,mr):new zd(A,i,s,o,mr)}return d.minFilter=n[0].mipmaps.length===1?gr:Ci,d.magFilter=gr,d.generateMipmaps=!1,d.needsUpdate=!0,d.colorSpace=Jx(t),d.premultiplyAlpha=!!(u&zN),d}async _createTexture(e,t={}){const n=YN(new Uint8Array(e));if(n.vkFormat!==jN)return KN(n);const i=t,s=this.init().then(()=>this.workerPool.postMessage({type:"transcode",buffer:e,taskConfig:i},[e])).then(o=>this._createTextureFrom(o.data,n));return Ng.set(e,{promise:s}),s}dispose(){return this.workerPool.dispose(),this.workerSourceURL&&URL.revokeObjectURL(this.workerSourceURL),Ug--,this}}es.BasisFormat={ETC1S:0,UASTC_4x4:1},es.TranscoderFormat={ETC1:0,ETC2:1,BC1:2,BC3:3,BC4:4,BC5:5,BC7_M6_OPAQUE_ONLY:6,BC7_M5:7,PVRTC1_4_RGB:8,PVRTC1_4_RGBA:9,ASTC_4x4:10,ATC_RGB:11,ATC_RGBA_INTERPOLATED_ALPHA:12,RGBA32:13,RGB565:14,BGR565:15,RGBA4444:16},es.EngineFormat={RGBAFormat:vr,RGBA_ASTC_4x4_Format:bA,RGBA_BPTC_Format:sd,RGBA_ETC2_EAC_Format:BA,RGBA_PVRTC_4BPPV1_Format:MA,RGBA_S3TC_DXT5_Format:nd,RGB_ETC1_Format:SA,RGB_ETC2_Format:TA,RGB_PVRTC_4BPPV1_Format:CA,RGB_S3TC_DXT1_Format:rd},es.BasisWorker=function(){let r,e,t;const n=_EngineFormat,i=_TranscoderFormat,s=_BasisFormat;self.addEventListener("message",function(_){const E=_.data;switch(E.type){case"init":r=E.config,o(E.transcoderBinary);break;case"transcode":e.then(()=>{try{const{faces:m,buffers:v,width:w,height:x,hasAlpha:I,format:R,dfdFlags:S}=l(E.buffer);self.postMessage({type:"transcode",id:E.id,faces:m,width:w,height:x,hasAlpha:I,format:R,dfdFlags:S},v)}catch(m){console.error(m),self.postMessage({type:"error",id:E.id,error:m.message})}});break}});function o(_){e=new Promise(E=>{t={wasmBinary:_,onRuntimeInitialized:E},BASIS(t)}).then(()=>{t.initializeBasis(),t.KTX2File===void 0&&console.warn("THREE.KTX2Loader: Please update Basis Universal transcoder.")})}function l(_){const E=new t.KTX2File(new Uint8Array(_));function m(){E.close(),E.delete()}if(!E.isValid())throw m(),new Error("THREE.KTX2Loader: Invalid or unsupported .ktx2 file");const v=E.isUASTC()?s.UASTC_4x4:s.ETC1S,w=E.getWidth(),x=E.getHeight(),I=E.getLayers()||1,R=E.getLevels(),S=E.getFaces(),T=E.getHasAlpha(),D=E.getDFDFlags(),{transcoderFormat:b,engineFormat:M}=A(v,w,x,T);if(!w||!x||!R)throw m(),new Error("THREE.KTX2Loader: Invalid texture");if(!E.startTranscoding())throw m(),new Error("THREE.KTX2Loader: .startTranscoding failed");const L=[],P=[];for(let N=0;N<S;N++){const W=[];for(let X=0;X<R;X++){const K=[];let te,V;for(let Q=0;Q<I;Q++){const z=E.getImageLevelInfo(X,Q,N);N===0&&X===0&&Q===0&&(z.origWidth%4!==0||z.origHeight%4!==0)&&console.warn("THREE.KTX2Loader: ETC1S and UASTC textures should use multiple-of-four dimensions."),R>1?(te=z.origWidth,V=z.origHeight):(te=z.width,V=z.height);const Z=new Uint8Array(E.getImageTranscodedSizeInBytes(X,Q,0,b));if(!E.transcodeImage(Z,X,Q,N,b,0,-1,-1))throw m(),new Error("THREE.KTX2Loader: .transcodeImage failed.");K.push(Z)}const ee=g(K);W.push({data:ee,width:te,height:V}),P.push(ee.buffer)}L.push({mipmaps:W,width:w,height:x,format:M})}return m(),{faces:L,buffers:P,width:w,height:x,hasAlpha:T,format:M,dfdFlags:D}}const h=[{if:"astcSupported",basisFormat:[s.UASTC_4x4],transcoderFormat:[i.ASTC_4x4,i.ASTC_4x4],engineFormat:[n.RGBA_ASTC_4x4_Format,n.RGBA_ASTC_4x4_Format],priorityETC1S:1/0,priorityUASTC:1,needsPowerOfTwo:!1},{if:"bptcSupported",basisFormat:[s.ETC1S,s.UASTC_4x4],transcoderFormat:[i.BC7_M5,i.BC7_M5],engineFormat:[n.RGBA_BPTC_Format,n.RGBA_BPTC_Format],priorityETC1S:3,priorityUASTC:2,needsPowerOfTwo:!1},{if:"dxtSupported",basisFormat:[s.ETC1S,s.UASTC_4x4],transcoderFormat:[i.BC1,i.BC3],engineFormat:[n.RGB_S3TC_DXT1_Format,n.RGBA_S3TC_DXT5_Format],priorityETC1S:4,priorityUASTC:5,needsPowerOfTwo:!1},{if:"etc2Supported",basisFormat:[s.ETC1S,s.UASTC_4x4],transcoderFormat:[i.ETC1,i.ETC2],engineFormat:[n.RGB_ETC2_Format,n.RGBA_ETC2_EAC_Format],priorityETC1S:1,priorityUASTC:3,needsPowerOfTwo:!1},{if:"etc1Supported",basisFormat:[s.ETC1S,s.UASTC_4x4],transcoderFormat:[i.ETC1],engineFormat:[n.RGB_ETC1_Format],priorityETC1S:2,priorityUASTC:4,needsPowerOfTwo:!1},{if:"pvrtcSupported",basisFormat:[s.ETC1S,s.UASTC_4x4],transcoderFormat:[i.PVRTC1_4_RGB,i.PVRTC1_4_RGBA],engineFormat:[n.RGB_PVRTC_4BPPV1_Format,n.RGBA_PVRTC_4BPPV1_Format],priorityETC1S:5,priorityUASTC:6,needsPowerOfTwo:!0}],u=h.sort(function(_,E){return _.priorityETC1S-E.priorityETC1S}),d=h.sort(function(_,E){return _.priorityUASTC-E.priorityUASTC});function A(_,E,m,v){let w,x;const I=_===s.ETC1S?u:d;for(let R=0;R<I.length;R++){const S=I[R];if(r[S.if]&&S.basisFormat.includes(_)&&!(v&&S.transcoderFormat.length<2)&&!(S.needsPowerOfTwo&&!(p(E)&&p(m))))return w=S.transcoderFormat[v?1:0],x=S.engineFormat[v?1:0],{transcoderFormat:w,engineFormat:x}}return console.warn("THREE.KTX2Loader: No suitable compressed texture format found. Decoding to RGBA32."),w=i.RGBA32,x=n.RGBAFormat,{transcoderFormat:w,engineFormat:x}}function p(_){return _<=2?!0:(_&_-1)===0&&_!==0}function g(_){if(_.length===1)return _[0];let E=0;for(let w=0;w<_.length;w++){const x=_[w];E+=x.byteLength}const m=new Uint8Array(E);let v=0;for(let w=0;w<_.length;w++){const x=_[w];m.set(x,v),v+=x.byteLength}return m}};const XN=new Set([vr,so,ea]),kg={[Wx]:vr,[Gx]:vr,[Ox]:vr,[Fx]:vr,[jx]:so,[Hx]:so,[kx]:so,[Qx]:so,[Vx]:ea,[zx]:ea,[Px]:ea,[Ux]:ea,[qx]:id,[Yx]:id},Qg={[Wx]:lr,[Gx]:Or,[Ox]:mr,[Fx]:mr,[jx]:lr,[Hx]:Or,[kx]:mr,[Qx]:mr,[Vx]:lr,[zx]:Or,[Px]:mr,[Ux]:mr,[qx]:mr,[Yx]:mr};async function KN(r){const{vkFormat:e}=r;if(kg[e]===void 0)throw new Error("THREE.KTX2Loader: Unsupported vkFormat.");let t;r.supercompressionScheme===Lx&&(Pg||(Pg=new Promise(async s=>{const o=new qN;await o.init(),s(o)})),t=await Pg);const n=[];for(let s=0;s<r.levels.length;s++){const o=Math.max(1,r.pixelWidth>>s),l=Math.max(1,r.pixelHeight>>s),h=r.pixelDepth?Math.max(1,r.pixelDepth>>s):0,u=r.levels[s];let d;if(r.supercompressionScheme===FN)d=u.levelData;else if(r.supercompressionScheme===Lx)d=t.decode(u.levelData,u.uncompressedByteLength);else throw new Error("THREE.KTX2Loader: Unsupported supercompressionScheme.");let A;Qg[e]===lr?A=new Float32Array(d.buffer,d.byteOffset,d.byteLength/Float32Array.BYTES_PER_ELEMENT):Qg[e]===Or?A=new Uint16Array(d.buffer,d.byteOffset,d.byteLength/Uint16Array.BYTES_PER_ELEMENT):A=d,n.push({data:A,width:o,height:l,depth:h})}let i;if(XN.has(kg[e]))i=r.pixelDepth===0?new mo(n[0].data,r.pixelWidth,r.pixelHeight):new WE(n[0].data,r.pixelWidth,r.pixelHeight,r.pixelDepth);else{if(r.pixelDepth>0)throw new Error("THREE.KTX2Loader: Unsupported pixelDepth.");i=new zd(n,r.pixelWidth,r.pixelHeight)}return i.mipmaps=n,i.type=Qg[e],i.format=kg[e],i.colorSpace=Jx(r),i.needsUpdate=!0,Promise.resolve(i)}function Jx(r){const e=r.dataFormatDescriptor[0];return e.colorPrimaries===GN?e.transferFunction===Nx?Fr:cr:e.colorPrimaries===VN?e.transferFunction===Nx?ad:cu:(e.colorPrimaries===HN||console.warn(`THREE.KTX2Loader: Unsupported color primaries, "${e.colorPrimaries}"`),ms)}class JN extends Q8{constructor(e){super(e),this.type=Or}parse(e){const t=function(v,w){switch(v){case 1:throw new Error("THREE.RGBELoader: Read Error: "+(w||""));case 2:throw new Error("THREE.RGBELoader: Write Error: "+(w||""));case 3:throw new Error("THREE.RGBELoader: Bad File Format: "+(w||""));default:case 4:throw new Error("THREE.RGBELoader: Memory Error: "+(w||""))}},n=`
3828
+ }`;class o8{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,n){if(this.texture===null){const i=new br,s=e.properties.get(i);s.__webglTexture=t.texture,(t.depthNear!=n.depthNear||t.depthFar!=n.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=i}}render(e,t){if(this.texture!==null){if(this.mesh===null){const n=t.cameras[0].viewport,i=new Cr({vertexShader:s8,fragmentShader:a8,uniforms:{depthColor:{value:this.texture},depthWidth:{value:n.z},depthHeight:{value:n.w}}});this.mesh=new Xr(new vu(20,20),i)}e.render(this.mesh,t)}}reset(){this.texture=null,this.mesh=null}}class l8 extends ao{constructor(e,t){super();const n=this;let i=null,s=1,o=null,l="local-floor",h=1,u=null,d=null,A=null,p=null,g=null,_=null;const E=new o8,m=t.getContextAttributes();let v=null,w=null;const x=[],I=[],R=new Ue;let S=null;const T=new dn;T.layers.enable(1),T.viewport=new Ft;const D=new dn;D.layers.enable(2),D.viewport=new Ft;const b=[T,D],M=new n8;M.layers.enable(1),M.layers.enable(2);let L=null,P=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(j){let de=x[j];return de===void 0&&(de=new lg,x[j]=de),de.getTargetRaySpace()},this.getControllerGrip=function(j){let de=x[j];return de===void 0&&(de=new lg,x[j]=de),de.getGripSpace()},this.getHand=function(j){let de=x[j];return de===void 0&&(de=new lg,x[j]=de),de.getHandSpace()};function N(j){const de=I.indexOf(j.inputSource);if(de===-1)return;const Ae=x[de];Ae!==void 0&&(Ae.update(j.inputSource,j.frame,u||o),Ae.dispatchEvent({type:j.type,data:j.inputSource}))}function W(){i.removeEventListener("select",N),i.removeEventListener("selectstart",N),i.removeEventListener("selectend",N),i.removeEventListener("squeeze",N),i.removeEventListener("squeezestart",N),i.removeEventListener("squeezeend",N),i.removeEventListener("end",W),i.removeEventListener("inputsourceschange",X);for(let j=0;j<x.length;j++){const de=I[j];de!==null&&(I[j]=null,x[j].disconnect(de))}L=null,P=null,E.reset(),e.setRenderTarget(v),g=null,p=null,A=null,i=null,w=null,re.stop(),n.isPresenting=!1,e.setPixelRatio(S),e.setSize(R.width,R.height,!1),n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(j){s=j,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(j){l=j,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return u||o},this.setReferenceSpace=function(j){u=j},this.getBaseLayer=function(){return p!==null?p:g},this.getBinding=function(){return A},this.getFrame=function(){return _},this.getSession=function(){return i},this.setSession=async function(j){if(i=j,i!==null){if(v=e.getRenderTarget(),i.addEventListener("select",N),i.addEventListener("selectstart",N),i.addEventListener("selectend",N),i.addEventListener("squeeze",N),i.addEventListener("squeezestart",N),i.addEventListener("squeezeend",N),i.addEventListener("end",W),i.addEventListener("inputsourceschange",X),m.xrCompatible!==!0&&await t.makeXRCompatible(),S=e.getPixelRatio(),e.getSize(R),i.renderState.layers===void 0){const de={antialias:m.antialias,alpha:!0,depth:m.depth,stencil:m.stencil,framebufferScaleFactor:s};g=new XRWebGLLayer(i,t,de),i.updateRenderState({baseLayer:g}),e.setPixelRatio(1),e.setSize(g.framebufferWidth,g.framebufferHeight,!1),w=new cn(g.framebufferWidth,g.framebufferHeight,{format:vr,type:mr,colorSpace:e.outputColorSpace,stencilBuffer:m.stencil})}else{let de=null,Ae=null,_e=null;m.depth&&(_e=m.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,de=m.stencil?au:ol,Ae=m.stencil?su:Mi);const Ee={colorFormat:t.RGBA8,depthFormat:_e,scaleFactor:s};A=new XRWebGLBinding(i,t),p=A.createProjectionLayer(Ee),i.updateRenderState({layers:[p]}),e.setPixelRatio(1),e.setSize(p.textureWidth,p.textureHeight,!1),w=new cn(p.textureWidth,p.textureHeight,{format:vr,type:mr,depthTexture:new w2(p.textureWidth,p.textureHeight,Ae,void 0,void 0,void 0,void 0,void 0,void 0,de),stencilBuffer:m.stencil,colorSpace:e.outputColorSpace,samples:m.antialias?4:0});const Le=e.properties.get(w);Le.__ignoreDepthValues=p.ignoreDepthValues}w.isXRRenderTarget=!0,this.setFoveation(h),u=null,o=await i.requestReferenceSpace(l),re.setContext(i),re.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(i!==null)return i.environmentBlendMode};function X(j){for(let de=0;de<j.removed.length;de++){const Ae=j.removed[de],_e=I.indexOf(Ae);_e>=0&&(I[_e]=null,x[_e].disconnect(Ae))}for(let de=0;de<j.added.length;de++){const Ae=j.added[de];let _e=I.indexOf(Ae);if(_e===-1){for(let Le=0;Le<x.length;Le++)if(Le>=I.length){I.push(Ae),_e=Le;break}else if(I[Le]===null){I[Le]=Ae,_e=Le;break}if(_e===-1)break}const Ee=x[_e];Ee&&Ee.connect(Ae)}}const K=new G,te=new G;function V(j,de,Ae){K.setFromMatrixPosition(de.matrixWorld),te.setFromMatrixPosition(Ae.matrixWorld);const _e=K.distanceTo(te),Ee=de.projectionMatrix.elements,Le=Ae.projectionMatrix.elements,st=Ee[14]/(Ee[10]-1),se=Ee[14]/(Ee[10]+1),et=(Ee[9]+1)/Ee[5],Qe=(Ee[9]-1)/Ee[5],ct=(Ee[8]-1)/Ee[0],Ke=(Le[8]+1)/Le[0],pt=st*ct,Y=st*Ke,k=_e/(-ct+Ke),le=k*-ct;de.matrixWorld.decompose(j.position,j.quaternion,j.scale),j.translateX(le),j.translateZ(k),j.matrixWorld.compose(j.position,j.quaternion,j.scale),j.matrixWorldInverse.copy(j.matrixWorld).invert();const pe=st+k,me=se+k,ye=pt-le,He=Y+(_e-le),Ie=et*se/me*pe,je=Qe*se/me*pe;j.projectionMatrix.makePerspective(ye,He,Ie,je,pe,me),j.projectionMatrixInverse.copy(j.projectionMatrix).invert()}function ee(j,de){de===null?j.matrixWorld.copy(j.matrix):j.matrixWorld.multiplyMatrices(de.matrixWorld,j.matrix),j.matrixWorldInverse.copy(j.matrixWorld).invert()}this.updateCamera=function(j){if(i===null)return;E.texture!==null&&(j.near=E.depthNear,j.far=E.depthFar),M.near=D.near=T.near=j.near,M.far=D.far=T.far=j.far,(L!==M.near||P!==M.far)&&(i.updateRenderState({depthNear:M.near,depthFar:M.far}),L=M.near,P=M.far,T.near=L,T.far=P,D.near=L,D.far=P,T.updateProjectionMatrix(),D.updateProjectionMatrix(),j.updateProjectionMatrix());const de=j.parent,Ae=M.cameras;ee(M,de);for(let _e=0;_e<Ae.length;_e++)ee(Ae[_e],de);Ae.length===2?V(M,T,D):M.projectionMatrix.copy(T.projectionMatrix),Q(j,M,de)};function Q(j,de,Ae){Ae===null?j.matrix.copy(de.matrixWorld):(j.matrix.copy(Ae.matrixWorld),j.matrix.invert(),j.matrix.multiply(de.matrixWorld)),j.matrix.decompose(j.position,j.quaternion,j.scale),j.updateMatrixWorld(!0),j.projectionMatrix.copy(de.projectionMatrix),j.projectionMatrixInverse.copy(de.projectionMatrixInverse),j.isPerspectiveCamera&&(j.fov=ul*2*Math.atan(1/j.projectionMatrix.elements[5]),j.zoom=1)}this.getCamera=function(){return M},this.getFoveation=function(){if(!(p===null&&g===null))return h},this.setFoveation=function(j){h=j,p!==null&&(p.fixedFoveation=j),g!==null&&g.fixedFoveation!==void 0&&(g.fixedFoveation=j)},this.hasDepthSensing=function(){return E.texture!==null};let z=null;function Z(j,de){if(d=de.getViewerPose(u||o),_=de,d!==null){const Ae=d.views;g!==null&&(e.setRenderTargetFramebuffer(w,g.framebuffer),e.setRenderTarget(w));let _e=!1;Ae.length!==M.cameras.length&&(M.cameras.length=0,_e=!0);for(let Le=0;Le<Ae.length;Le++){const st=Ae[Le];let se=null;if(g!==null)se=g.getViewport(st);else{const Qe=A.getViewSubImage(p,st);se=Qe.viewport,Le===0&&(e.setRenderTargetTextures(w,Qe.colorTexture,p.ignoreDepthValues?void 0:Qe.depthStencilTexture),e.setRenderTarget(w))}let et=b[Le];et===void 0&&(et=new dn,et.layers.enable(Le),et.viewport=new Ft,b[Le]=et),et.matrix.fromArray(st.transform.matrix),et.matrix.decompose(et.position,et.quaternion,et.scale),et.projectionMatrix.fromArray(st.projectionMatrix),et.projectionMatrixInverse.copy(et.projectionMatrix).invert(),et.viewport.set(se.x,se.y,se.width,se.height),Le===0&&(M.matrix.copy(et.matrix),M.matrix.decompose(M.position,M.quaternion,M.scale)),_e===!0&&M.cameras.push(et)}const Ee=i.enabledFeatures;if(Ee&&Ee.includes("depth-sensing")){const Le=A.getDepthInformation(Ae[0]);Le&&Le.isValid&&Le.texture&&E.init(e,Le,i.renderState)}}for(let Ae=0;Ae<x.length;Ae++){const _e=I[Ae],Ee=x[Ae];_e!==null&&Ee!==void 0&&Ee.update(_e,de,u||o)}E.render(e,M),z&&z(j,de),de.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:de}),_=null}const re=new A2;re.setAnimationLoop(Z),this.setAnimationLoop=function(j){z=j},this.dispose=function(){}}}const go=new qi,c8=new rt;function u8(r,e){function t(m,v){m.matrixAutoUpdate===!0&&m.updateMatrix(),v.value.copy(m.matrix)}function n(m,v){v.color.getRGB(m.fogColor.value,u2(r)),v.isFog?(m.fogNear.value=v.near,m.fogFar.value=v.far):v.isFogExp2&&(m.fogDensity.value=v.density)}function i(m,v,w,x,I){v.isMeshBasicMaterial||v.isMeshLambertMaterial?s(m,v):v.isMeshToonMaterial?(s(m,v),A(m,v)):v.isMeshPhongMaterial?(s(m,v),d(m,v)):v.isMeshStandardMaterial?(s(m,v),p(m,v),v.isMeshPhysicalMaterial&&g(m,v,I)):v.isMeshMatcapMaterial?(s(m,v),_(m,v)):v.isMeshDepthMaterial?s(m,v):v.isMeshDistanceMaterial?(s(m,v),E(m,v)):v.isMeshNormalMaterial?s(m,v):v.isLineBasicMaterial?(o(m,v),v.isLineDashedMaterial&&l(m,v)):v.isPointsMaterial?h(m,v,w,x):v.isSpriteMaterial?u(m,v):v.isShadowMaterial?(m.color.value.copy(v.color),m.opacity.value=v.opacity):v.isShaderMaterial&&(v.uniformsNeedUpdate=!1)}function s(m,v){m.opacity.value=v.opacity,v.color&&m.diffuse.value.copy(v.color),v.emissive&&m.emissive.value.copy(v.emissive).multiplyScalar(v.emissiveIntensity),v.map&&(m.map.value=v.map,t(v.map,m.mapTransform)),v.alphaMap&&(m.alphaMap.value=v.alphaMap,t(v.alphaMap,m.alphaMapTransform)),v.bumpMap&&(m.bumpMap.value=v.bumpMap,t(v.bumpMap,m.bumpMapTransform),m.bumpScale.value=v.bumpScale,v.side===Qr&&(m.bumpScale.value*=-1)),v.normalMap&&(m.normalMap.value=v.normalMap,t(v.normalMap,m.normalMapTransform),m.normalScale.value.copy(v.normalScale),v.side===Qr&&m.normalScale.value.negate()),v.displacementMap&&(m.displacementMap.value=v.displacementMap,t(v.displacementMap,m.displacementMapTransform),m.displacementScale.value=v.displacementScale,m.displacementBias.value=v.displacementBias),v.emissiveMap&&(m.emissiveMap.value=v.emissiveMap,t(v.emissiveMap,m.emissiveMapTransform)),v.specularMap&&(m.specularMap.value=v.specularMap,t(v.specularMap,m.specularMapTransform)),v.alphaTest>0&&(m.alphaTest.value=v.alphaTest);const w=e.get(v),x=w.envMap,I=w.envMapRotation;if(x&&(m.envMap.value=x,go.copy(I),go.x*=-1,go.y*=-1,go.z*=-1,x.isCubeTexture&&x.isRenderTargetTexture===!1&&(go.y*=-1,go.z*=-1),m.envMapRotation.value.setFromMatrix4(c8.makeRotationFromEuler(go)),m.flipEnvMap.value=x.isCubeTexture&&x.isRenderTargetTexture===!1?-1:1,m.reflectivity.value=v.reflectivity,m.ior.value=v.ior,m.refractionRatio.value=v.refractionRatio),v.lightMap){m.lightMap.value=v.lightMap;const R=r._useLegacyLights===!0?Math.PI:1;m.lightMapIntensity.value=v.lightMapIntensity*R,t(v.lightMap,m.lightMapTransform)}v.aoMap&&(m.aoMap.value=v.aoMap,m.aoMapIntensity.value=v.aoMapIntensity,t(v.aoMap,m.aoMapTransform))}function o(m,v){m.diffuse.value.copy(v.color),m.opacity.value=v.opacity,v.map&&(m.map.value=v.map,t(v.map,m.mapTransform))}function l(m,v){m.dashSize.value=v.dashSize,m.totalSize.value=v.dashSize+v.gapSize,m.scale.value=v.scale}function h(m,v,w,x){m.diffuse.value.copy(v.color),m.opacity.value=v.opacity,m.size.value=v.size*w,m.scale.value=x*.5,v.map&&(m.map.value=v.map,t(v.map,m.uvTransform)),v.alphaMap&&(m.alphaMap.value=v.alphaMap,t(v.alphaMap,m.alphaMapTransform)),v.alphaTest>0&&(m.alphaTest.value=v.alphaTest)}function u(m,v){m.diffuse.value.copy(v.color),m.opacity.value=v.opacity,m.rotation.value=v.rotation,v.map&&(m.map.value=v.map,t(v.map,m.mapTransform)),v.alphaMap&&(m.alphaMap.value=v.alphaMap,t(v.alphaMap,m.alphaMapTransform)),v.alphaTest>0&&(m.alphaTest.value=v.alphaTest)}function d(m,v){m.specular.value.copy(v.specular),m.shininess.value=Math.max(v.shininess,1e-4)}function A(m,v){v.gradientMap&&(m.gradientMap.value=v.gradientMap)}function p(m,v){m.metalness.value=v.metalness,v.metalnessMap&&(m.metalnessMap.value=v.metalnessMap,t(v.metalnessMap,m.metalnessMapTransform)),m.roughness.value=v.roughness,v.roughnessMap&&(m.roughnessMap.value=v.roughnessMap,t(v.roughnessMap,m.roughnessMapTransform)),v.envMap&&(m.envMapIntensity.value=v.envMapIntensity)}function g(m,v,w){m.ior.value=v.ior,v.sheen>0&&(m.sheenColor.value.copy(v.sheenColor).multiplyScalar(v.sheen),m.sheenRoughness.value=v.sheenRoughness,v.sheenColorMap&&(m.sheenColorMap.value=v.sheenColorMap,t(v.sheenColorMap,m.sheenColorMapTransform)),v.sheenRoughnessMap&&(m.sheenRoughnessMap.value=v.sheenRoughnessMap,t(v.sheenRoughnessMap,m.sheenRoughnessMapTransform))),v.clearcoat>0&&(m.clearcoat.value=v.clearcoat,m.clearcoatRoughness.value=v.clearcoatRoughness,v.clearcoatMap&&(m.clearcoatMap.value=v.clearcoatMap,t(v.clearcoatMap,m.clearcoatMapTransform)),v.clearcoatRoughnessMap&&(m.clearcoatRoughnessMap.value=v.clearcoatRoughnessMap,t(v.clearcoatRoughnessMap,m.clearcoatRoughnessMapTransform)),v.clearcoatNormalMap&&(m.clearcoatNormalMap.value=v.clearcoatNormalMap,t(v.clearcoatNormalMap,m.clearcoatNormalMapTransform),m.clearcoatNormalScale.value.copy(v.clearcoatNormalScale),v.side===Qr&&m.clearcoatNormalScale.value.negate())),v.iridescence>0&&(m.iridescence.value=v.iridescence,m.iridescenceIOR.value=v.iridescenceIOR,m.iridescenceThicknessMinimum.value=v.iridescenceThicknessRange[0],m.iridescenceThicknessMaximum.value=v.iridescenceThicknessRange[1],v.iridescenceMap&&(m.iridescenceMap.value=v.iridescenceMap,t(v.iridescenceMap,m.iridescenceMapTransform)),v.iridescenceThicknessMap&&(m.iridescenceThicknessMap.value=v.iridescenceThicknessMap,t(v.iridescenceThicknessMap,m.iridescenceThicknessMapTransform))),v.transmission>0&&(m.transmission.value=v.transmission,m.transmissionSamplerMap.value=w.texture,m.transmissionSamplerSize.value.set(w.width,w.height),v.transmissionMap&&(m.transmissionMap.value=v.transmissionMap,t(v.transmissionMap,m.transmissionMapTransform)),m.thickness.value=v.thickness,v.thicknessMap&&(m.thicknessMap.value=v.thicknessMap,t(v.thicknessMap,m.thicknessMapTransform)),m.attenuationDistance.value=v.attenuationDistance,m.attenuationColor.value.copy(v.attenuationColor)),v.anisotropy>0&&(m.anisotropyVector.value.set(v.anisotropy*Math.cos(v.anisotropyRotation),v.anisotropy*Math.sin(v.anisotropyRotation)),v.anisotropyMap&&(m.anisotropyMap.value=v.anisotropyMap,t(v.anisotropyMap,m.anisotropyMapTransform))),m.specularIntensity.value=v.specularIntensity,m.specularColor.value.copy(v.specularColor),v.specularColorMap&&(m.specularColorMap.value=v.specularColorMap,t(v.specularColorMap,m.specularColorMapTransform)),v.specularIntensityMap&&(m.specularIntensityMap.value=v.specularIntensityMap,t(v.specularIntensityMap,m.specularIntensityMapTransform))}function _(m,v){v.matcap&&(m.matcap.value=v.matcap)}function E(m,v){const w=e.get(v).light;m.referencePosition.value.setFromMatrixPosition(w.matrixWorld),m.nearDistance.value=w.shadow.camera.near,m.farDistance.value=w.shadow.camera.far}return{refreshFogUniforms:n,refreshMaterialUniforms:i}}function h8(r,e,t,n){let i={},s={},o=[];const l=r.getParameter(r.MAX_UNIFORM_BUFFER_BINDINGS);function h(w,x){const I=x.program;n.uniformBlockBinding(w,I)}function u(w,x){let I=i[w.id];I===void 0&&(_(w),I=d(w),i[w.id]=I,w.addEventListener("dispose",m));const R=x.program;n.updateUBOMapping(w,R);const S=e.render.frame;s[w.id]!==S&&(p(w),s[w.id]=S)}function d(w){const x=A();w.__bindingPointIndex=x;const I=r.createBuffer(),R=w.__size,S=w.usage;return r.bindBuffer(r.UNIFORM_BUFFER,I),r.bufferData(r.UNIFORM_BUFFER,R,S),r.bindBuffer(r.UNIFORM_BUFFER,null),r.bindBufferBase(r.UNIFORM_BUFFER,x,I),I}function A(){for(let w=0;w<l;w++)if(o.indexOf(w)===-1)return o.push(w),w;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function p(w){const x=i[w.id],I=w.uniforms,R=w.__cache;r.bindBuffer(r.UNIFORM_BUFFER,x);for(let S=0,T=I.length;S<T;S++){const D=Array.isArray(I[S])?I[S]:[I[S]];for(let b=0,M=D.length;b<M;b++){const L=D[b];if(g(L,S,b,R)===!0){const P=L.__offset,N=Array.isArray(L.value)?L.value:[L.value];let W=0;for(let X=0;X<N.length;X++){const K=N[X],te=E(K);typeof K=="number"||typeof K=="boolean"?(L.__data[0]=K,r.bufferSubData(r.UNIFORM_BUFFER,P+W,L.__data)):K.isMatrix3?(L.__data[0]=K.elements[0],L.__data[1]=K.elements[1],L.__data[2]=K.elements[2],L.__data[3]=0,L.__data[4]=K.elements[3],L.__data[5]=K.elements[4],L.__data[6]=K.elements[5],L.__data[7]=0,L.__data[8]=K.elements[6],L.__data[9]=K.elements[7],L.__data[10]=K.elements[8],L.__data[11]=0):(K.toArray(L.__data,W),W+=te.storage/Float32Array.BYTES_PER_ELEMENT)}r.bufferSubData(r.UNIFORM_BUFFER,P,L.__data)}}}r.bindBuffer(r.UNIFORM_BUFFER,null)}function g(w,x,I,R){const S=w.value,T=x+"_"+I;if(R[T]===void 0)return typeof S=="number"||typeof S=="boolean"?R[T]=S:R[T]=S.clone(),!0;{const D=R[T];if(typeof S=="number"||typeof S=="boolean"){if(D!==S)return R[T]=S,!0}else if(D.equals(S)===!1)return D.copy(S),!0}return!1}function _(w){const x=w.uniforms;let I=0;const R=16;for(let T=0,D=x.length;T<D;T++){const b=Array.isArray(x[T])?x[T]:[x[T]];for(let M=0,L=b.length;M<L;M++){const P=b[M],N=Array.isArray(P.value)?P.value:[P.value];for(let W=0,X=N.length;W<X;W++){const K=N[W],te=E(K),V=I%R;V!==0&&R-V<te.boundary&&(I+=R-V),P.__data=new Float32Array(te.storage/Float32Array.BYTES_PER_ELEMENT),P.__offset=I,I+=te.storage}}}const S=I%R;return S>0&&(I+=R-S),w.__size=I,w.__cache={},this}function E(w){const x={boundary:0,storage:0};return typeof w=="number"||typeof w=="boolean"?(x.boundary=4,x.storage=4):w.isVector2?(x.boundary=8,x.storage=8):w.isVector3||w.isColor?(x.boundary=16,x.storage=12):w.isVector4?(x.boundary=16,x.storage=16):w.isMatrix3?(x.boundary=48,x.storage=48):w.isMatrix4?(x.boundary=64,x.storage=64):w.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",w),x}function m(w){const x=w.target;x.removeEventListener("dispose",m);const I=o.indexOf(x.__bindingPointIndex);o.splice(I,1),r.deleteBuffer(i[x.id]),delete i[x.id],delete s[x.id]}function v(){for(const w in i)r.deleteBuffer(i[w]);o=[],i={},s={}}return{bind:h,update:u,dispose:v}}class d8{constructor(e={}){const{canvas:t=i5(),context:n=null,depth:i=!0,stencil:s=!1,alpha:o=!1,antialias:l=!1,premultipliedAlpha:h=!0,preserveDrawingBuffer:u=!1,powerPreference:d="default",failIfMajorPerformanceCaveat:A=!1}=e;this.isWebGLRenderer=!0;let p;if(n!==null){if(typeof WebGLRenderingContext<"u"&&n instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");p=n.getContextAttributes().alpha}else p=o;const g=new Uint32Array(4),_=new Int32Array(4);let E=null,m=null;const v=[],w=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this._outputColorSpace=Fr,this._useLegacyLights=!1,this.toneMapping=Zs,this.toneMappingExposure=1;const x=this;let I=!1,R=0,S=0,T=null,D=-1,b=null;const M=new Ft,L=new Ft;let P=null;const N=new Ve(0);let W=0,X=t.width,K=t.height,te=1,V=null,ee=null;const Q=new Ft(0,0,X,K),z=new Ft(0,0,X,K);let Z=!1;const re=new $A;let j=!1,de=!1;const Ae=new rt,_e=new Ue,Ee=new G,Le={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function st(){return T===null?te:1}let se=n;function et(F,ne){const ue=t.getContext(F,ne);return ue!==null?ue:null}try{const F={alpha:!0,depth:i,stencil:s,antialias:l,premultipliedAlpha:h,preserveDrawingBuffer:u,powerPreference:d,failIfMajorPerformanceCaveat:A};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${Kh}`),t.addEventListener("webglcontextlost",ge,!1),t.addEventListener("webglcontextrestored",ve,!1),t.addEventListener("webglcontextcreationerror",Fe,!1),se===null){const ne="webgl2";if(se=et(ne,F),se===null)throw et(ne)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(F){throw console.error("THREE.WebGLRenderer: "+F.message),F}let Qe,ct,Ke,pt,Y,k,le,pe,me,ye,He,Ie,je,Ge,Me,fe,De,Be,be,nt,lt,dt,ut,ht;function H(){Qe=new ED(se),Qe.init(),ct=new AD(se,Qe,e),dt=new r8(se,Qe),Ke=new e8(se),pt=new ID(se),Y=new zL,k=new t8(se,Qe,Ke,Y,ct,dt,pt),le=new mD(x),pe=new yD(x),me=new b5(se),ut=new fD(se,me),ye=new xD(se,me,pt,ut),He=new MD(se,ye,me,pt),be=new CD(se,ct,k),fe=new gD(Y),Ie=new FL(x,le,pe,Qe,ct,ut,fe),je=new u8(x,Y),Ge=new GL,Me=new XL(Qe),Be=new dD(x,le,pe,Ke,He,p,h),De=new $L(x,He,ct),ht=new h8(se,pt,ct,Ke),nt=new pD(se,Qe,pt),lt=new wD(se,Qe,pt),pt.programs=Ie.programs,x.capabilities=ct,x.extensions=Qe,x.properties=Y,x.renderLists=Ge,x.shadowMap=De,x.state=Ke,x.info=pt}H();const O=new l8(x,se);this.xr=O,this.getContext=function(){return se},this.getContextAttributes=function(){return se.getContextAttributes()},this.forceContextLoss=function(){const F=Qe.get("WEBGL_lose_context");F&&F.loseContext()},this.forceContextRestore=function(){const F=Qe.get("WEBGL_lose_context");F&&F.restoreContext()},this.getPixelRatio=function(){return te},this.setPixelRatio=function(F){F!==void 0&&(te=F,this.setSize(X,K,!1))},this.getSize=function(F){return F.set(X,K)},this.setSize=function(F,ne,ue=!0){if(O.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}X=F,K=ne,t.width=Math.floor(F*te),t.height=Math.floor(ne*te),ue===!0&&(t.style.width=F+"px",t.style.height=ne+"px"),this.setViewport(0,0,F,ne)},this.getDrawingBufferSize=function(F){return F.set(X*te,K*te).floor()},this.setDrawingBufferSize=function(F,ne,ue){X=F,K=ne,te=ue,t.width=Math.floor(F*ue),t.height=Math.floor(ne*ue),this.setViewport(0,0,F,ne)},this.getCurrentViewport=function(F){return F.copy(M)},this.getViewport=function(F){return F.copy(Q)},this.setViewport=function(F,ne,ue,he){F.isVector4?Q.set(F.x,F.y,F.z,F.w):Q.set(F,ne,ue,he),Ke.viewport(M.copy(Q).multiplyScalar(te).round())},this.getScissor=function(F){return F.copy(z)},this.setScissor=function(F,ne,ue,he){F.isVector4?z.set(F.x,F.y,F.z,F.w):z.set(F,ne,ue,he),Ke.scissor(L.copy(z).multiplyScalar(te).round())},this.getScissorTest=function(){return Z},this.setScissorTest=function(F){Ke.setScissorTest(Z=F)},this.setOpaqueSort=function(F){V=F},this.setTransparentSort=function(F){ee=F},this.getClearColor=function(F){return F.copy(Be.getClearColor())},this.setClearColor=function(){Be.setClearColor.apply(Be,arguments)},this.getClearAlpha=function(){return Be.getClearAlpha()},this.setClearAlpha=function(){Be.setClearAlpha.apply(Be,arguments)},this.clear=function(F=!0,ne=!0,ue=!0){let he=0;if(F){let oe=!1;if(T!==null){const Re=T.texture.format;oe=Re===ou||Re===td||Re===EA}if(oe){const Re=T.texture.type,Je=Re===mr||Re===Mi||Re===yA||Re===su||Re===cE||Re===uE,it=Be.getClearColor(),at=Be.getClearAlpha(),Xe=it.r,At=it.g,ft=it.b;Je?(g[0]=Xe,g[1]=At,g[2]=ft,g[3]=at,se.clearBufferuiv(se.COLOR,0,g)):(_[0]=Xe,_[1]=At,_[2]=ft,_[3]=at,se.clearBufferiv(se.COLOR,0,_))}else he|=se.COLOR_BUFFER_BIT}ne&&(he|=se.DEPTH_BUFFER_BIT),ue&&(he|=se.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),se.clear(he)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){t.removeEventListener("webglcontextlost",ge,!1),t.removeEventListener("webglcontextrestored",ve,!1),t.removeEventListener("webglcontextcreationerror",Fe,!1),Ge.dispose(),Me.dispose(),Y.dispose(),le.dispose(),pe.dispose(),He.dispose(),ut.dispose(),ht.dispose(),Ie.dispose(),O.dispose(),O.removeEventListener("sessionstart",fr),O.removeEventListener("sessionend",Vt),Er.stop()};function ge(F){F.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),I=!0}function ve(){console.log("THREE.WebGLRenderer: Context Restored."),I=!1;const F=pt.autoReset,ne=De.enabled,ue=De.autoUpdate,he=De.needsUpdate,oe=De.type;H(),pt.autoReset=F,De.enabled=ne,De.autoUpdate=ue,De.needsUpdate=he,De.type=oe}function Fe(F){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",F.statusMessage)}function Pe(F){const ne=F.target;ne.removeEventListener("dispose",Pe),vt(ne)}function vt(F){Lt(F),Y.remove(F)}function Lt(F){const ne=Y.get(F).programs;ne!==void 0&&(ne.forEach(function(ue){Ie.releaseProgram(ue)}),F.isShaderMaterial&&Ie.releaseShaderCache(F))}this.renderBufferDirect=function(F,ne,ue,he,oe,Re){ne===null&&(ne=Le);const Je=oe.isMesh&&oe.matrixWorld.determinant()<0,it=d0(F,ne,ue,he,oe);Ke.setMaterial(he,Je);let at=ue.index,Xe=1;if(he.wireframe===!0){if(at=ye.getWireframeAttribute(ue),at===void 0)return;Xe=2}const At=ue.drawRange,ft=ue.attributes.position;let Lr=At.start*Xe,er=(At.start+At.count)*Xe;Re!==null&&(Lr=Math.max(Lr,Re.start*Xe),er=Math.min(er,(Re.start+Re.count)*Xe)),at!==null?(Lr=Math.max(Lr,0),er=Math.min(er,at.count)):ft!=null&&(Lr=Math.max(Lr,0),er=Math.min(er,ft.count));const Dn=er-Lr;if(Dn<0||Dn===1/0)return;ut.setup(oe,he,it,ue,at);let pi,jt=nt;if(at!==null&&(pi=me.get(at),jt=lt,jt.setIndex(pi)),oe.isMesh)he.wireframe===!0?(Ke.setLineWidth(he.wireframeLinewidth*st()),jt.setMode(se.LINES)):jt.setMode(se.TRIANGLES);else if(oe.isLine){let tt=he.linewidth;tt===void 0&&(tt=1),Ke.setLineWidth(tt*st()),oe.isLineSegments?jt.setMode(se.LINES):oe.isLineLoop?jt.setMode(se.LINE_LOOP):jt.setMode(se.LINE_STRIP)}else oe.isPoints?jt.setMode(se.POINTS):oe.isSprite&&jt.setMode(se.TRIANGLES);if(oe.isBatchedMesh)jt.renderMultiDraw(oe._multiDrawStarts,oe._multiDrawCounts,oe._multiDrawCount);else if(oe.isInstancedMesh)jt.renderInstances(Lr,Dn,oe.count);else if(ue.isInstancedBufferGeometry){const tt=ue._maxInstanceCount!==void 0?ue._maxInstanceCount:1/0,Zu=Math.min(ue.instanceCount,tt);jt.renderInstances(Lr,Dn,Zu)}else jt.render(Lr,Dn)};function Nt(F,ne,ue){F.transparent===!0&&F.side===wi&&F.forceSinglePass===!1?(F.side=Qr,F.needsUpdate=!0,Us(F,ne,ue),F.side=xi,F.needsUpdate=!0,Us(F,ne,ue),F.side=wi):Us(F,ne,ue)}this.compile=function(F,ne,ue=null){ue===null&&(ue=F),m=Me.get(ue),m.init(),w.push(m),ue.traverseVisible(function(oe){oe.isLight&&oe.layers.test(ne.layers)&&(m.pushLight(oe),oe.castShadow&&m.pushShadow(oe))}),F!==ue&&F.traverseVisible(function(oe){oe.isLight&&oe.layers.test(ne.layers)&&(m.pushLight(oe),oe.castShadow&&m.pushShadow(oe))}),m.setupLights(x._useLegacyLights);const he=new Set;return F.traverse(function(oe){const Re=oe.material;if(Re)if(Array.isArray(Re))for(let Je=0;Je<Re.length;Je++){const it=Re[Je];Nt(it,ue,oe),he.add(it)}else Nt(Re,ue,oe),he.add(Re)}),w.pop(),m=null,he},this.compileAsync=function(F,ne,ue=null){const he=this.compile(F,ne,ue);return new Promise(oe=>{function Re(){if(he.forEach(function(Je){Y.get(Je).currentProgram.isReady()&&he.delete(Je)}),he.size===0){oe(F);return}setTimeout(Re,10)}Qe.get("KHR_parallel_shader_compile")!==null?Re():setTimeout(Re,10)})};let Bt=null;function _t(F){Bt&&Bt(F)}function fr(){Er.stop()}function Vt(){Er.start()}const Er=new A2;Er.setAnimationLoop(_t),typeof self<"u"&&Er.setContext(self),this.setAnimationLoop=function(F){Bt=F,O.setAnimationLoop(F),F===null?Er.stop():Er.start()},O.addEventListener("sessionstart",fr),O.addEventListener("sessionend",Vt),this.render=function(F,ne){if(ne!==void 0&&ne.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(I===!0)return;F.matrixWorldAutoUpdate===!0&&F.updateMatrixWorld(),ne.parent===null&&ne.matrixWorldAutoUpdate===!0&&ne.updateMatrixWorld(),O.enabled===!0&&O.isPresenting===!0&&(O.cameraAutoUpdate===!0&&O.updateCamera(ne),ne=O.getCamera()),F.isScene===!0&&F.onBeforeRender(x,F,ne,T),m=Me.get(F,w.length),m.init(),w.push(m),Ae.multiplyMatrices(ne.projectionMatrix,ne.matrixWorldInverse),re.setFromProjectionMatrix(Ae),de=this.localClippingEnabled,j=fe.init(this.clippingPlanes,de),E=Ge.get(F,v.length),E.init(),v.push(E),Rn(F,ne,0,x.sortObjects),E.finish(),x.sortObjects===!0&&E.sort(V,ee),this.info.render.frame++,j===!0&&fe.beginShadows();const ue=m.state.shadowsArray;if(De.render(ue,F,ne),j===!0&&fe.endShadows(),this.info.autoReset===!0&&this.info.reset(),(O.enabled===!1||O.isPresenting===!1||O.hasDepthSensing()===!1)&&Be.render(E,F),m.setupLights(x._useLegacyLights),ne.isArrayCamera){const he=ne.cameras;for(let oe=0,Re=he.length;oe<Re;oe++){const Je=he[oe];qt(E,F,Je,Je.viewport)}}else qt(E,F,ne);T!==null&&(k.updateMultisampleRenderTarget(T),k.updateRenderTargetMipmap(T)),F.isScene===!0&&F.onAfterRender(x,F,ne),ut.resetDefaultState(),D=-1,b=null,w.pop(),w.length>0?m=w[w.length-1]:m=null,v.pop(),v.length>0?E=v[v.length-1]:E=null};function Rn(F,ne,ue,he){if(F.visible===!1)return;if(F.layers.test(ne.layers)){if(F.isGroup)ue=F.renderOrder;else if(F.isLOD)F.autoUpdate===!0&&F.update(ne);else if(F.isLight)m.pushLight(F),F.castShadow&&m.pushShadow(F);else if(F.isSprite){if(!F.frustumCulled||re.intersectsSprite(F)){he&&Ee.setFromMatrixPosition(F.matrixWorld).applyMatrix4(Ae);const Re=He.update(F),Je=F.material;Je.visible&&E.push(F,Re,Je,ue,Ee.z,null)}}else if((F.isMesh||F.isLine||F.isPoints)&&(!F.frustumCulled||re.intersectsObject(F))){const Re=He.update(F),Je=F.material;if(he&&(F.boundingSphere!==void 0?(F.boundingSphere===null&&F.computeBoundingSphere(),Ee.copy(F.boundingSphere.center)):(Re.boundingSphere===null&&Re.computeBoundingSphere(),Ee.copy(Re.boundingSphere.center)),Ee.applyMatrix4(F.matrixWorld).applyMatrix4(Ae)),Array.isArray(Je)){const it=Re.groups;for(let at=0,Xe=it.length;at<Xe;at++){const At=it[at],ft=Je[At.materialIndex];ft&&ft.visible&&E.push(F,Re,ft,ue,Ee.z,At)}}else Je.visible&&E.push(F,Re,Je,ue,Ee.z,null)}}const oe=F.children;for(let Re=0,Je=oe.length;Re<Je;Re++)Rn(oe[Re],ne,ue,he)}function qt(F,ne,ue,he){const oe=F.opaque,Re=F.transmissive,Je=F.transparent;m.setupLightsView(ue),j===!0&&fe.setGlobalState(x.clippingPlanes,ue),Re.length>0&&fi(oe,Re,ne,ue),he&&Ke.viewport(M.copy(he)),oe.length>0&&Zn(oe,ne,ue),Re.length>0&&Zn(Re,ne,ue),Je.length>0&&Zn(Je,ne,ue),Ke.buffers.depth.setTest(!0),Ke.buffers.depth.setMask(!0),Ke.buffers.color.setMask(!0),Ke.setPolygonOffset(!1)}function fi(F,ne,ue,he){if((ue.isScene===!0?ue.overrideMaterial:null)!==null)return;if(m.state.transmissionRenderTarget===null){m.state.transmissionRenderTarget=new cn(1,1,{generateMipmaps:!0,type:Qe.has("EXT_color_buffer_half_float")||Qe.has("EXT_color_buffer_float")?Or:mr,minFilter:Ci,samples:4,stencilBuffer:s});const at=Y.get(m.state.transmissionRenderTarget);at.__isTransmissionRenderTarget=!0}const oe=m.state.transmissionRenderTarget;x.getDrawingBufferSize(_e),oe.setSize(_e.x,_e.y);const Re=x.getRenderTarget();x.setRenderTarget(oe),x.getClearColor(N),W=x.getClearAlpha(),W<1&&x.setClearColor(16777215,.5),x.clear();const Je=x.toneMapping;x.toneMapping=Zs,Zn(F,ue,he),k.updateMultisampleRenderTarget(oe),k.updateRenderTargetMipmap(oe);let it=!1;for(let at=0,Xe=ne.length;at<Xe;at++){const At=ne[at],ft=At.object,Lr=At.geometry,er=At.material,Dn=At.group;if(er.side===wi&&ft.layers.test(he.layers)){const pi=er.side;er.side=Qr,er.needsUpdate=!0,Ns(ft,ue,he,Lr,er,Dn),er.side=pi,er.needsUpdate=!0,it=!0}}it===!0&&(k.updateMultisampleRenderTarget(oe),k.updateRenderTargetMipmap(oe)),x.setRenderTarget(Re),x.setClearColor(N,W),x.toneMapping=Je}function Zn(F,ne,ue){const he=ne.isScene===!0?ne.overrideMaterial:null;for(let oe=0,Re=F.length;oe<Re;oe++){const Je=F[oe],it=Je.object,at=Je.geometry,Xe=he===null?Je.material:he,At=Je.group;it.layers.test(ue.layers)&&Ns(it,ne,ue,at,Xe,At)}}function Ns(F,ne,ue,he,oe,Re){F.onBeforeRender(x,ne,ue,he,oe,Re),F.modelViewMatrix.multiplyMatrices(ue.matrixWorldInverse,F.matrixWorld),F.normalMatrix.getNormalMatrix(F.modelViewMatrix),oe.onBeforeRender(x,ne,ue,he,F,Re),oe.transparent===!0&&oe.side===wi&&oe.forceSinglePass===!1?(oe.side=Qr,oe.needsUpdate=!0,x.renderBufferDirect(ue,ne,he,oe,F,Re),oe.side=xi,oe.needsUpdate=!0,x.renderBufferDirect(ue,ne,he,oe,F,Re),oe.side=wi):x.renderBufferDirect(ue,ne,he,oe,F,Re),F.onAfterRender(x,ne,ue,he,oe,Re)}function Us(F,ne,ue){ne.isScene!==!0&&(ne=Le);const he=Y.get(F),oe=m.state.lights,Re=m.state.shadowsArray,Je=oe.state.version,it=Ie.getParameters(F,oe.state,Re,ne,ue),at=Ie.getProgramCacheKey(it);let Xe=he.programs;he.environment=F.isMeshStandardMaterial?ne.environment:null,he.fog=ne.fog,he.envMap=(F.isMeshStandardMaterial?pe:le).get(F.envMap||he.environment),he.envMapRotation=he.environment!==null&&F.envMap===null?ne.environmentRotation:F.envMapRotation,Xe===void 0&&(F.addEventListener("dispose",Pe),Xe=new Map,he.programs=Xe);let At=Xe.get(at);if(At!==void 0){if(he.currentProgram===At&&he.lightsStateVersion===Je)return bf(F,it),At}else it.uniforms=Ie.getUniforms(F),F.onBuild(ue,it,x),F.onBeforeCompile(it,x),At=Ie.acquireProgram(it,at),Xe.set(at,At),he.uniforms=it.uniforms;const ft=he.uniforms;return(!F.isShaderMaterial&&!F.isRawShaderMaterial||F.clipping===!0)&&(ft.clippingPlanes=fe.uniform),bf(F,it),he.needsLights=Ps(F),he.lightsStateVersion=Je,he.needsLights&&(ft.ambientLightColor.value=oe.state.ambient,ft.lightProbe.value=oe.state.probe,ft.directionalLights.value=oe.state.directional,ft.directionalLightShadows.value=oe.state.directionalShadow,ft.spotLights.value=oe.state.spot,ft.spotLightShadows.value=oe.state.spotShadow,ft.rectAreaLights.value=oe.state.rectArea,ft.ltc_1.value=oe.state.rectAreaLTC1,ft.ltc_2.value=oe.state.rectAreaLTC2,ft.pointLights.value=oe.state.point,ft.pointLightShadows.value=oe.state.pointShadow,ft.hemisphereLights.value=oe.state.hemi,ft.directionalShadowMap.value=oe.state.directionalShadowMap,ft.directionalShadowMatrix.value=oe.state.directionalShadowMatrix,ft.spotShadowMap.value=oe.state.spotShadowMap,ft.spotLightMatrix.value=oe.state.spotLightMatrix,ft.spotLightMap.value=oe.state.spotLightMap,ft.pointShadowMap.value=oe.state.pointShadowMap,ft.pointShadowMatrix.value=oe.state.pointShadowMatrix),he.currentProgram=At,he.uniformsList=null,At}function dc(F){if(F.uniformsList===null){const ne=F.currentProgram.getUniforms();F.uniformsList=Ud.seqWithValue(ne.seq,F.uniforms)}return F.uniformsList}function bf(F,ne){const ue=Y.get(F);ue.outputColorSpace=ne.outputColorSpace,ue.batching=ne.batching,ue.instancing=ne.instancing,ue.instancingColor=ne.instancingColor,ue.instancingMorph=ne.instancingMorph,ue.skinning=ne.skinning,ue.morphTargets=ne.morphTargets,ue.morphNormals=ne.morphNormals,ue.morphColors=ne.morphColors,ue.morphTargetsCount=ne.morphTargetsCount,ue.numClippingPlanes=ne.numClippingPlanes,ue.numIntersection=ne.numClipIntersection,ue.vertexAlphas=ne.vertexAlphas,ue.vertexTangents=ne.vertexTangents,ue.toneMapping=ne.toneMapping}function d0(F,ne,ue,he,oe){ne.isScene!==!0&&(ne=Le),k.resetTextureUnits();const Re=ne.fog,Je=he.isMeshStandardMaterial?ne.environment:null,it=T===null?x.outputColorSpace:T.isXRRenderTarget===!0?T.texture.colorSpace:cr,at=(he.isMeshStandardMaterial?pe:le).get(he.envMap||Je),Xe=he.vertexColors===!0&&!!ue.attributes.color&&ue.attributes.color.itemSize===4,At=!!ue.attributes.tangent&&(!!he.normalMap||he.anisotropy>0),ft=!!ue.morphAttributes.position,Lr=!!ue.morphAttributes.normal,er=!!ue.morphAttributes.color;let Dn=Zs;he.toneMapped&&(T===null||T.isXRRenderTarget===!0)&&(Dn=x.toneMapping);const pi=ue.morphAttributes.position||ue.morphAttributes.normal||ue.morphAttributes.color,jt=pi!==void 0?pi.length:0,tt=Y.get(he),Zu=m.state.lights;if(j===!0&&(de===!0||F!==b)){const Nn=F===b&&he.id===D;fe.setState(he,F,Nn)}let vn=!1;he.version===tt.__version?(tt.needsLights&&tt.lightsStateVersion!==Zu.state.version||tt.outputColorSpace!==it||oe.isBatchedMesh&&tt.batching===!1||!oe.isBatchedMesh&&tt.batching===!0||oe.isInstancedMesh&&tt.instancing===!1||!oe.isInstancedMesh&&tt.instancing===!0||oe.isSkinnedMesh&&tt.skinning===!1||!oe.isSkinnedMesh&&tt.skinning===!0||oe.isInstancedMesh&&tt.instancingColor===!0&&oe.instanceColor===null||oe.isInstancedMesh&&tt.instancingColor===!1&&oe.instanceColor!==null||oe.isInstancedMesh&&tt.instancingMorph===!0&&oe.morphTexture===null||oe.isInstancedMesh&&tt.instancingMorph===!1&&oe.morphTexture!==null||tt.envMap!==at||he.fog===!0&&tt.fog!==Re||tt.numClippingPlanes!==void 0&&(tt.numClippingPlanes!==fe.numPlanes||tt.numIntersection!==fe.numIntersection)||tt.vertexAlphas!==Xe||tt.vertexTangents!==At||tt.morphTargets!==ft||tt.morphNormals!==Lr||tt.morphColors!==er||tt.toneMapping!==Dn||tt.morphTargetsCount!==jt)&&(vn=!0):(vn=!0,tt.__version=he.version);let ks=tt.currentProgram;vn===!0&&(ks=Us(he,ne,oe));let Rf=!1,Uo=!1,Ca=!1;const xr=ks.getUniforms(),Ln=tt.uniforms;if(Ke.useProgram(ks.program)&&(Rf=!0,Uo=!0,Ca=!0),he.id!==D&&(D=he.id,Uo=!0),Rf||b!==F){xr.setValue(se,"projectionMatrix",F.projectionMatrix),xr.setValue(se,"viewMatrix",F.matrixWorldInverse);const Nn=xr.map.cameraPosition;Nn!==void 0&&Nn.setValue(se,Ee.setFromMatrixPosition(F.matrixWorld)),ct.logarithmicDepthBuffer&&xr.setValue(se,"logDepthBufFC",2/(Math.log(F.far+1)/Math.LN2)),(he.isMeshPhongMaterial||he.isMeshToonMaterial||he.isMeshLambertMaterial||he.isMeshBasicMaterial||he.isMeshStandardMaterial||he.isShaderMaterial)&&xr.setValue(se,"isOrthographic",F.isOrthographicCamera===!0),b!==F&&(b=F,Uo=!0,Ca=!0)}if(oe.isSkinnedMesh){xr.setOptional(se,oe,"bindMatrix"),xr.setOptional(se,oe,"bindMatrixInverse");const Nn=oe.skeleton;Nn&&(Nn.boneTexture===null&&Nn.computeBoneTexture(),xr.setValue(se,"boneTexture",Nn.boneTexture,k))}oe.isBatchedMesh&&(xr.setOptional(se,oe,"batchingTexture"),xr.setValue(se,"batchingTexture",oe._matricesTexture,k));const Ma=ue.morphAttributes;if((Ma.position!==void 0||Ma.normal!==void 0||Ma.color!==void 0)&&be.update(oe,ue,ks),(Uo||tt.receiveShadow!==oe.receiveShadow)&&(tt.receiveShadow=oe.receiveShadow,xr.setValue(se,"receiveShadow",oe.receiveShadow)),he.isMeshGouraudMaterial&&he.envMap!==null&&(Ln.envMap.value=at,Ln.flipEnvMap.value=at.isCubeTexture&&at.isRenderTargetTexture===!1?-1:1),he.isMeshStandardMaterial&&he.envMap===null&&ne.environment!==null&&(Ln.envMapIntensity.value=ne.environmentIntensity),Uo&&(xr.setValue(se,"toneMappingExposure",x.toneMappingExposure),tt.needsLights&&f0(Ln,Ca),Re&&he.fog===!0&&je.refreshFogUniforms(Ln,Re),je.refreshMaterialUniforms(Ln,he,te,K,m.state.transmissionRenderTarget),Ud.upload(se,dc(tt),Ln,k)),he.isShaderMaterial&&he.uniformsNeedUpdate===!0&&(Ud.upload(se,dc(tt),Ln,k),he.uniformsNeedUpdate=!1),he.isSpriteMaterial&&xr.setValue(se,"center",oe.center),xr.setValue(se,"modelViewMatrix",oe.modelViewMatrix),xr.setValue(se,"normalMatrix",oe.normalMatrix),xr.setValue(se,"modelMatrix",oe.matrixWorld),he.isShaderMaterial||he.isRawShaderMaterial){const Nn=he.uniformsGroups;for(let $u=0,eh=Nn.length;$u<eh;$u++){const th=Nn[$u];ht.update(th,ks),ht.bind(th,ks)}}return ks}function f0(F,ne){F.ambientLightColor.needsUpdate=ne,F.lightProbe.needsUpdate=ne,F.directionalLights.needsUpdate=ne,F.directionalLightShadows.needsUpdate=ne,F.pointLights.needsUpdate=ne,F.pointLightShadows.needsUpdate=ne,F.spotLights.needsUpdate=ne,F.spotLightShadows.needsUpdate=ne,F.rectAreaLights.needsUpdate=ne,F.hemisphereLights.needsUpdate=ne}function Ps(F){return F.isMeshLambertMaterial||F.isMeshToonMaterial||F.isMeshPhongMaterial||F.isMeshStandardMaterial||F.isShadowMaterial||F.isShaderMaterial&&F.lights===!0}this.getActiveCubeFace=function(){return R},this.getActiveMipmapLevel=function(){return S},this.getRenderTarget=function(){return T},this.setRenderTargetTextures=function(F,ne,ue){Y.get(F.texture).__webglTexture=ne,Y.get(F.depthTexture).__webglTexture=ue;const he=Y.get(F);he.__hasExternalTextures=!0,he.__autoAllocateDepthBuffer=ue===void 0,he.__autoAllocateDepthBuffer||Qe.has("WEBGL_multisampled_render_to_texture")===!0&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),he.__useRenderToTexture=!1)},this.setRenderTargetFramebuffer=function(F,ne){const ue=Y.get(F);ue.__webglFramebuffer=ne,ue.__useDefaultFramebuffer=ne===void 0},this.setRenderTarget=function(F,ne=0,ue=0){T=F,R=ne,S=ue;let he=!0,oe=null,Re=!1,Je=!1;if(F){const it=Y.get(F);it.__useDefaultFramebuffer!==void 0?(Ke.bindFramebuffer(se.FRAMEBUFFER,null),he=!1):it.__webglFramebuffer===void 0?k.setupRenderTarget(F):it.__hasExternalTextures&&k.rebindTextures(F,Y.get(F.texture).__webglTexture,Y.get(F.depthTexture).__webglTexture);const at=F.texture;(at.isData3DTexture||at.isDataArrayTexture||at.isCompressedArrayTexture)&&(Je=!0);const Xe=Y.get(F).__webglFramebuffer;F.isWebGLCubeRenderTarget?(Array.isArray(Xe[ne])?oe=Xe[ne][ue]:oe=Xe[ne],Re=!0):F.samples>0&&k.useMultisampledRTT(F)===!1?oe=Y.get(F).__webglMultisampledFramebuffer:Array.isArray(Xe)?oe=Xe[ue]:oe=Xe,M.copy(F.viewport),L.copy(F.scissor),P=F.scissorTest}else M.copy(Q).multiplyScalar(te).floor(),L.copy(z).multiplyScalar(te).floor(),P=Z;if(Ke.bindFramebuffer(se.FRAMEBUFFER,oe)&&he&&Ke.drawBuffers(F,oe),Ke.viewport(M),Ke.scissor(L),Ke.setScissorTest(P),Re){const it=Y.get(F.texture);se.framebufferTexture2D(se.FRAMEBUFFER,se.COLOR_ATTACHMENT0,se.TEXTURE_CUBE_MAP_POSITIVE_X+ne,it.__webglTexture,ue)}else if(Je){const it=Y.get(F.texture),at=ne||0;se.framebufferTextureLayer(se.FRAMEBUFFER,se.COLOR_ATTACHMENT0,it.__webglTexture,ue||0,at)}D=-1},this.readRenderTargetPixels=function(F,ne,ue,he,oe,Re,Je){if(!(F&&F.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let it=Y.get(F).__webglFramebuffer;if(F.isWebGLCubeRenderTarget&&Je!==void 0&&(it=it[Je]),it){Ke.bindFramebuffer(se.FRAMEBUFFER,it);try{const at=F.texture,Xe=at.format,At=at.type;if(Xe!==vr&&dt.convert(Xe)!==se.getParameter(se.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const ft=At===Or&&(Qe.has("EXT_color_buffer_half_float")||Qe.has("EXT_color_buffer_float"));if(At!==mr&&dt.convert(At)!==se.getParameter(se.IMPLEMENTATION_COLOR_READ_TYPE)&&At!==lr&&!ft){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}ne>=0&&ne<=F.width-he&&ue>=0&&ue<=F.height-oe&&se.readPixels(ne,ue,he,oe,dt.convert(Xe),dt.convert(At),Re)}finally{const at=T!==null?Y.get(T).__webglFramebuffer:null;Ke.bindFramebuffer(se.FRAMEBUFFER,at)}}},this.copyFramebufferToTexture=function(F,ne,ue=0){const he=Math.pow(2,-ue),oe=Math.floor(ne.image.width*he),Re=Math.floor(ne.image.height*he);k.setTexture2D(ne,0),se.copyTexSubImage2D(se.TEXTURE_2D,ue,0,0,F.x,F.y,oe,Re),Ke.unbindTexture()},this.copyTextureToTexture=function(F,ne,ue,he=0){const oe=ne.image.width,Re=ne.image.height,Je=dt.convert(ue.format),it=dt.convert(ue.type);k.setTexture2D(ue,0),se.pixelStorei(se.UNPACK_FLIP_Y_WEBGL,ue.flipY),se.pixelStorei(se.UNPACK_PREMULTIPLY_ALPHA_WEBGL,ue.premultiplyAlpha),se.pixelStorei(se.UNPACK_ALIGNMENT,ue.unpackAlignment),ne.isDataTexture?se.texSubImage2D(se.TEXTURE_2D,he,F.x,F.y,oe,Re,Je,it,ne.image.data):ne.isCompressedTexture?se.compressedTexSubImage2D(se.TEXTURE_2D,he,F.x,F.y,ne.mipmaps[0].width,ne.mipmaps[0].height,Je,ne.mipmaps[0].data):se.texSubImage2D(se.TEXTURE_2D,he,F.x,F.y,Je,it,ne.image),he===0&&ue.generateMipmaps&&se.generateMipmap(se.TEXTURE_2D),Ke.unbindTexture()},this.copyTextureToTexture3D=function(F,ne,ue,he,oe=0){const Re=Math.round(F.max.x-F.min.x),Je=Math.round(F.max.y-F.min.y),it=F.max.z-F.min.z+1,at=dt.convert(he.format),Xe=dt.convert(he.type);let At;if(he.isData3DTexture)k.setTexture3D(he,0),At=se.TEXTURE_3D;else if(he.isDataArrayTexture||he.isCompressedArrayTexture)k.setTexture2DArray(he,0),At=se.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}se.pixelStorei(se.UNPACK_FLIP_Y_WEBGL,he.flipY),se.pixelStorei(se.UNPACK_PREMULTIPLY_ALPHA_WEBGL,he.premultiplyAlpha),se.pixelStorei(se.UNPACK_ALIGNMENT,he.unpackAlignment);const ft=se.getParameter(se.UNPACK_ROW_LENGTH),Lr=se.getParameter(se.UNPACK_IMAGE_HEIGHT),er=se.getParameter(se.UNPACK_SKIP_PIXELS),Dn=se.getParameter(se.UNPACK_SKIP_ROWS),pi=se.getParameter(se.UNPACK_SKIP_IMAGES),jt=ue.isCompressedTexture?ue.mipmaps[oe]:ue.image;se.pixelStorei(se.UNPACK_ROW_LENGTH,jt.width),se.pixelStorei(se.UNPACK_IMAGE_HEIGHT,jt.height),se.pixelStorei(se.UNPACK_SKIP_PIXELS,F.min.x),se.pixelStorei(se.UNPACK_SKIP_ROWS,F.min.y),se.pixelStorei(se.UNPACK_SKIP_IMAGES,F.min.z),ue.isDataTexture||ue.isData3DTexture?se.texSubImage3D(At,oe,ne.x,ne.y,ne.z,Re,Je,it,at,Xe,jt.data):he.isCompressedArrayTexture?se.compressedTexSubImage3D(At,oe,ne.x,ne.y,ne.z,Re,Je,it,at,jt.data):se.texSubImage3D(At,oe,ne.x,ne.y,ne.z,Re,Je,it,at,Xe,jt),se.pixelStorei(se.UNPACK_ROW_LENGTH,ft),se.pixelStorei(se.UNPACK_IMAGE_HEIGHT,Lr),se.pixelStorei(se.UNPACK_SKIP_PIXELS,er),se.pixelStorei(se.UNPACK_SKIP_ROWS,Dn),se.pixelStorei(se.UNPACK_SKIP_IMAGES,pi),oe===0&&he.generateMipmaps&&se.generateMipmap(At),Ke.unbindTexture()},this.initTexture=function(F){F.isCubeTexture?k.setTextureCube(F,0):F.isData3DTexture?k.setTexture3D(F,0):F.isDataArrayTexture||F.isCompressedArrayTexture?k.setTexture2DArray(F,0):k.setTexture2D(F,0),Ke.unbindTexture()},this.resetState=function(){R=0,S=0,T=null,Ke.reset(),ut.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return vs}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=e===ad?"display-p3":"srgb",t.unpackColorSpace=Tt.workingColorSpace===cu?"display-p3":"srgb"}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(e){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=e}}class f8 extends Zt{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new qi,this.environmentIntensity=1,this.environmentRotation=new qi,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}}class p8{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=DA,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=Si()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return zE("THREE.InterleavedBuffer: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead."),this._updateRange}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let i=0,s=this.stride;i<s;i++)this.array[e+i]=t.array[n+i];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Si()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),n=new this.constructor(t,this.stride);return n.setUsage(this.usage),n}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Si()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}const fn=new G;class cg{constructor(e,t,n,i=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=e,this.itemSize=t,this.offset=n,this.normalized=i}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,n=this.data.count;t<n;t++)fn.fromBufferAttribute(this,t),fn.applyMatrix4(e),this.setXYZ(t,fn.x,fn.y,fn.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)fn.fromBufferAttribute(this,t),fn.applyNormalMatrix(e),this.setXYZ(t,fn.x,fn.y,fn.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)fn.fromBufferAttribute(this,t),fn.transformDirection(e),this.setXYZ(t,fn.x,fn.y,fn.z);return this}getComponent(e,t){let n=this.array[e*this.data.stride+this.offset+t];return this.normalized&&(n=Ti(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=Ut(n,this.array)),this.data.array[e*this.data.stride+this.offset+t]=n,this}setX(e,t){return this.normalized&&(t=Ut(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=Ut(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=Ut(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=Ut(t,this.array)),this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){let t=this.data.array[e*this.data.stride+this.offset];return this.normalized&&(t=Ti(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=Ti(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=Ti(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=Ti(t,this.array)),t}setXY(e,t,n){return e=e*this.data.stride+this.offset,this.normalized&&(t=Ut(t,this.array),n=Ut(n,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this}setXYZ(e,t,n,i){return e=e*this.data.stride+this.offset,this.normalized&&(t=Ut(t,this.array),n=Ut(n,this.array),i=Ut(i,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=i,this}setXYZW(e,t,n,i,s){return e=e*this.data.stride+this.offset,this.normalized&&(t=Ut(t,this.array),n=Ut(n,this.array),i=Ut(i,this.array),s=Ut(s,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=i,this.data.array[e+3]=s,this}clone(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let n=0;n<this.count;n++){const i=n*this.data.stride+this.offset;for(let s=0;s<this.itemSize;s++)t.push(this.data.array[i+s])}return new zr(new this.array.constructor(t),this.itemSize,this.normalized)}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new cg(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let n=0;n<this.count;n++){const i=n*this.data.stride+this.offset;for(let s=0;s<this.itemSize;s++)t.push(this.data.array[i+s])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}const j2=new G,W2=new Ft,Y2=new Ft,A8=new G,q2=new rt,Pd=new G,ug=new bi,X2=new rt,hg=new co;class g8 extends Xr{constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=sE,this.bindMatrix=new rt,this.bindMatrixInverse=new rt,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){const e=this.geometry;this.boundingBox===null&&(this.boundingBox=new _r),this.boundingBox.makeEmpty();const t=e.getAttribute("position");for(let n=0;n<t.count;n++)this.getVertexPosition(n,Pd),this.boundingBox.expandByPoint(Pd)}computeBoundingSphere(){const e=this.geometry;this.boundingSphere===null&&(this.boundingSphere=new bi),this.boundingSphere.makeEmpty();const t=e.getAttribute("position");for(let n=0;n<t.count;n++)this.getVertexPosition(n,Pd),this.boundingSphere.expandByPoint(Pd)}copy(e,t){return super.copy(e,t),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}raycast(e,t){const n=this.material,i=this.matrixWorld;n!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),ug.copy(this.boundingSphere),ug.applyMatrix4(i),e.ray.intersectsSphere(ug)!==!1&&(X2.copy(i).invert(),hg.copy(e.ray).applyMatrix4(X2),!(this.boundingBox!==null&&hg.intersectsBox(this.boundingBox)===!1)&&this._computeIntersections(e,t,hg)))}getVertexPosition(e,t){return super.getVertexPosition(e,t),this.applyBoneTransform(e,t),t}bind(e,t){this.skeleton=e,t===void 0&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const e=new Ft,t=this.geometry.attributes.skinWeight;for(let n=0,i=t.count;n<i;n++){e.fromBufferAttribute(t,n);const s=1/e.manhattanLength();s!==1/0?e.multiplyScalar(s):e.set(1,0,0,0),t.setXYZW(n,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMode===sE?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===xb?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(e,t){const n=this.skeleton,i=this.geometry;W2.fromBufferAttribute(i.attributes.skinIndex,e),Y2.fromBufferAttribute(i.attributes.skinWeight,e),j2.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let s=0;s<4;s++){const o=Y2.getComponent(s);if(o!==0){const l=W2.getComponent(s);q2.multiplyMatrices(n.bones[l].matrixWorld,n.boneInverses[l]),t.addScaledVector(A8.copy(j2).applyMatrix4(q2),o)}}return t.applyMatrix4(this.bindMatrixInverse)}}class K2 extends Zt{constructor(){super(),this.isBone=!0,this.type="Bone"}}class mo extends br{constructor(e=null,t=1,n=1,i,s,o,l,h,u=Ar,d=Ar,A,p){super(null,o,l,h,u,d,i,s,A,p),this.isDataTexture=!0,this.image={data:e,width:t,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const J2=new rt,m8=new rt;class dg{constructor(e=[],t=[]){this.uuid=Si(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.init()}init(){const e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(e.length*16),t.length===0)this.calculateInverses();else if(e.length!==t.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let n=0,i=this.bones.length;n<i;n++)this.boneInverses.push(new rt)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){const n=new rt;this.bones[e]&&n.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(n)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){const n=this.bones[e];n&&n.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){const n=this.bones[e];n&&(n.parent&&n.parent.isBone?(n.matrix.copy(n.parent.matrixWorld).invert(),n.matrix.multiply(n.matrixWorld)):n.matrix.copy(n.matrixWorld),n.matrix.decompose(n.position,n.quaternion,n.scale))}}update(){const e=this.bones,t=this.boneInverses,n=this.boneMatrices,i=this.boneTexture;for(let s=0,o=e.length;s<o;s++){const l=e[s]?e[s].matrixWorld:m8;J2.multiplyMatrices(l,t[s]),J2.toArray(n,s*16)}i!==null&&(i.needsUpdate=!0)}clone(){return new dg(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(this.bones.length*4);e=Math.ceil(e/4)*4,e=Math.max(e,4);const t=new Float32Array(e*e*4);t.set(this.boneMatrices);const n=new mo(t,e,e,vr,lr);return n.needsUpdate=!0,this.boneMatrices=t,this.boneTexture=n,this}getBoneByName(e){for(let t=0,n=this.bones.length;t<n;t++){const i=this.bones[t];if(i.name===e)return i}}dispose(){this.boneTexture!==null&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let n=0,i=e.bones.length;n<i;n++){const s=e.bones[n];let o=t[s];o===void 0&&(console.warn("THREE.Skeleton: No bone found with UUID:",s),o=new K2),this.bones.push(o),this.boneInverses.push(new rt().fromArray(e.boneInverses[n]))}return this.init(),this}toJSON(){const e={metadata:{version:4.6,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;const t=this.bones,n=this.boneInverses;for(let i=0,s=t.length;i<s;i++){const o=t[i];e.bones.push(o.uuid);const l=n[i];e.boneInverses.push(l.toArray())}return e}}class fg extends zr{constructor(e,t,n,i=1){super(e,t,n),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=i}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){const e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}const Dl=new rt,Z2=new rt,kd=[],$2=new _r,v8=new rt,Eu=new Xr,xu=new bi;class _8 extends Xr{constructor(e,t,n){super(e,t),this.isInstancedMesh=!0,this.instanceMatrix=new fg(new Float32Array(n*16),16),this.instanceColor=null,this.morphTexture=null,this.count=n,this.boundingBox=null,this.boundingSphere=null;for(let i=0;i<n;i++)this.setMatrixAt(i,v8)}computeBoundingBox(){const e=this.geometry,t=this.count;this.boundingBox===null&&(this.boundingBox=new _r),e.boundingBox===null&&e.computeBoundingBox(),this.boundingBox.makeEmpty();for(let n=0;n<t;n++)this.getMatrixAt(n,Dl),$2.copy(e.boundingBox).applyMatrix4(Dl),this.boundingBox.union($2)}computeBoundingSphere(){const e=this.geometry,t=this.count;this.boundingSphere===null&&(this.boundingSphere=new bi),e.boundingSphere===null&&e.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(let n=0;n<t;n++)this.getMatrixAt(n,Dl),xu.copy(e.boundingSphere).applyMatrix4(Dl),this.boundingSphere.union(xu)}copy(e,t){return super.copy(e,t),this.instanceMatrix.copy(e.instanceMatrix),e.morphTexture!==null&&(this.morphTexture=e.morphTexture.clone()),e.instanceColor!==null&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}getColorAt(e,t){t.fromArray(this.instanceColor.array,e*3)}getMatrixAt(e,t){t.fromArray(this.instanceMatrix.array,e*16)}getMorphAt(e,t){const n=t.morphTargetInfluences,i=this.morphTexture.source.data.data,s=n.length+1,o=e*s+1;for(let l=0;l<n.length;l++)n[l]=i[o+l]}raycast(e,t){const n=this.matrixWorld,i=this.count;if(Eu.geometry=this.geometry,Eu.material=this.material,Eu.material!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),xu.copy(this.boundingSphere),xu.applyMatrix4(n),e.ray.intersectsSphere(xu)!==!1))for(let s=0;s<i;s++){this.getMatrixAt(s,Dl),Z2.multiplyMatrices(n,Dl),Eu.matrixWorld=Z2,Eu.raycast(e,kd);for(let o=0,l=kd.length;o<l;o++){const h=kd[o];h.instanceId=s,h.object=this,t.push(h)}kd.length=0}}setColorAt(e,t){this.instanceColor===null&&(this.instanceColor=new fg(new Float32Array(this.instanceMatrix.count*3),3)),t.toArray(this.instanceColor.array,e*3)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,e*16)}setMorphAt(e,t){const n=t.morphTargetInfluences,i=n.length+1;this.morphTexture===null&&(this.morphTexture=new mo(new Float32Array(i*this.count),i,this.count,ea,lr));const s=this.morphTexture.source.data.data;let o=0;for(let u=0;u<n.length;u++)o+=n[u];const l=this.geometry.morphTargetsRelative?1:1-o,h=i*e;s[h]=l,s.set(n,h+1)}updateMorphTargets(){}dispose(){return this.dispatchEvent({type:"dispose"}),this.morphTexture!==null&&(this.morphTexture.dispose(),this.morphTexture=null),this}}class ex extends Xi{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new Ve(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}}const tx=new G,rx=new G,nx=new rt,pg=new co,Qd=new bi;class Ag extends Zt{constructor(e=new Vn,t=new ex){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,n=[0];for(let i=1,s=t.count;i<s;i++)tx.fromBufferAttribute(t,i-1),rx.fromBufferAttribute(t,i),n[i]=n[i-1],n[i]+=tx.distanceTo(rx);e.setAttribute("lineDistance",new Li(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,t){const n=this.geometry,i=this.matrixWorld,s=e.params.Line.threshold,o=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),Qd.copy(n.boundingSphere),Qd.applyMatrix4(i),Qd.radius+=s,e.ray.intersectsSphere(Qd)===!1)return;nx.copy(i).invert(),pg.copy(e.ray).applyMatrix4(nx);const l=s/((this.scale.x+this.scale.y+this.scale.z)/3),h=l*l,u=new G,d=new G,A=new G,p=new G,g=this.isLineSegments?2:1,_=n.index,E=n.attributes.position;if(_!==null){const m=Math.max(0,o.start),v=Math.min(_.count,o.start+o.count);for(let w=m,x=v-1;w<x;w+=g){const I=_.getX(w),R=_.getX(w+1);if(u.fromBufferAttribute(E,I),d.fromBufferAttribute(E,R),pg.distanceSqToSegment(u,d,p,A)>h)continue;p.applyMatrix4(this.matrixWorld);const S=e.ray.origin.distanceTo(p);S<e.near||S>e.far||t.push({distance:S,point:A.clone().applyMatrix4(this.matrixWorld),index:w,face:null,faceIndex:null,object:this})}}else{const m=Math.max(0,o.start),v=Math.min(E.count,o.start+o.count);for(let w=m,x=v-1;w<x;w+=g){if(u.fromBufferAttribute(E,w),d.fromBufferAttribute(E,w+1),pg.distanceSqToSegment(u,d,p,A)>h)continue;p.applyMatrix4(this.matrixWorld);const I=e.ray.origin.distanceTo(p);I<e.near||I>e.far||t.push({distance:I,point:A.clone().applyMatrix4(this.matrixWorld),index:w,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){const n=e[t[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let i=0,s=n.length;i<s;i++){const o=n[i].name||String(i);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=i}}}}}const ix=new G,sx=new G;class y8 extends Ag{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,n=[];for(let i=0,s=t.count;i<s;i+=2)ix.fromBufferAttribute(t,i),sx.fromBufferAttribute(t,i+1),n[i]=i===0?0:n[i-1],n[i+1]=n[i]+ix.distanceTo(sx);e.setAttribute("lineDistance",new Li(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class E8 extends Ag{constructor(e,t){super(e,t),this.isLineLoop=!0,this.type="LineLoop"}}class ax extends Xi{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new Ve(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}const ox=new rt,gg=new co,Od=new bi,Fd=new G;class x8 extends Zt{constructor(e=new Vn,t=new ax){super(),this.isPoints=!0,this.type="Points",this.geometry=e,this.material=t,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}raycast(e,t){const n=this.geometry,i=this.matrixWorld,s=e.params.Points.threshold,o=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),Od.copy(n.boundingSphere),Od.applyMatrix4(i),Od.radius+=s,e.ray.intersectsSphere(Od)===!1)return;ox.copy(i).invert(),gg.copy(e.ray).applyMatrix4(ox);const l=s/((this.scale.x+this.scale.y+this.scale.z)/3),h=l*l,u=n.index,d=n.attributes.position;if(u!==null){const A=Math.max(0,o.start),p=Math.min(u.count,o.start+o.count);for(let g=A,_=p;g<_;g++){const E=u.getX(g);Fd.fromBufferAttribute(d,E),lx(Fd,E,h,i,e,t,this)}}else{const A=Math.max(0,o.start),p=Math.min(d.count,o.start+o.count);for(let g=A,_=p;g<_;g++)Fd.fromBufferAttribute(d,g),lx(Fd,g,h,i,e,t,this)}}updateMorphTargets(){const e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){const n=e[t[0]];if(n!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let i=0,s=n.length;i<s;i++){const o=n[i].name||String(i);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=i}}}}}function lx(r,e,t,n,i,s,o){const l=gg.distanceSqToPoint(r);if(l<t){const h=new G;gg.closestPointToPoint(r,h),h.applyMatrix4(n);const u=i.ray.origin.distanceTo(h);if(u<i.near||u>i.far)return;s.push({distance:u,distanceToRay:Math.sqrt(l),point:h,index:e,face:null,object:o})}}class zd extends br{constructor(e,t,n,i,s,o,l,h,u,d,A,p){super(null,o,l,h,u,d,i,s,A,p),this.isCompressedTexture=!0,this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class w8 extends zd{constructor(e,t,n,i,s,o){super(e,t,n,s,o),this.isCompressedArrayTexture=!0,this.image.depth=i,this.wrapR=Ii}}class I8 extends zd{constructor(e,t,n){super(void 0,e[0].width,e[0].height,t,n,io),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class C8 extends Cr{constructor(e){super(e),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}class mg extends Xi{constructor(e){super(),this.isMeshStandardMaterial=!0,this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new Ve(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ve(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=NE,this.normalScale=new Ue(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new qi,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class Ni extends mg{constructor(e){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new Ue(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return Br(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(t){this.ior=(1+.4*t)/(1-.4*t)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new Ve(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new Ve(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new Ve(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(e)}get anisotropy(){return this._anisotropy}set anisotropy(e){this._anisotropy>0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}function Hd(r,e,t){return!r||!t&&r.constructor===e?r:typeof e.BYTES_PER_ELEMENT=="number"?new e(r):Array.prototype.slice.call(r)}function M8(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}function S8(r){function e(i,s){return r[i]-r[s]}const t=r.length,n=new Array(t);for(let i=0;i!==t;++i)n[i]=i;return n.sort(e),n}function cx(r,e,t){const n=r.length,i=new r.constructor(n);for(let s=0,o=0;o!==n;++s){const l=t[s]*e;for(let h=0;h!==e;++h)i[o++]=r[l+h]}return i}function ux(r,e,t,n){let i=1,s=r[0];for(;s!==void 0&&s[n]===void 0;)s=r[i++];if(s===void 0)return;let o=s[n];if(o!==void 0)if(Array.isArray(o))do o=s[n],o!==void 0&&(e.push(s.time),t.push.apply(t,o)),s=r[i++];while(s!==void 0);else if(o.toArray!==void 0)do o=s[n],o!==void 0&&(e.push(s.time),o.toArray(t,t.length)),s=r[i++];while(s!==void 0);else do o=s[n],o!==void 0&&(e.push(s.time),t.push(o)),s=r[i++];while(s!==void 0)}class wu{constructor(e,t,n,i){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=i!==void 0?i:new t.constructor(n),this.sampleValues=t,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let n=this._cachedIndex,i=t[n],s=t[n-1];e:{t:{let o;r:{n:if(!(e<i)){for(let l=n+2;;){if(i===void 0){if(e<s)break n;return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}if(n===l)break;if(s=i,i=t[++n],e<i)break t}o=t.length;break r}if(!(e>=s)){const l=t[1];e<l&&(n=2,s=l);for(let h=n-2;;){if(s===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(n===h)break;if(i=s,s=t[--n-1],e>=s)break t}o=n,n=0;break r}break e}for(;n<o;){const l=n+o>>>1;e<t[l]?o=l:n=l+1}if(i=t[n],s=t[n-1],s===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(i===void 0)return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}this._cachedIndex=n,this.intervalChanged_(n,s,i)}return this.interpolate_(n,s,e,i)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,i=this.valueSize,s=e*i;for(let o=0;o!==i;++o)t[o]=n[s+o];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}class T8 extends wu{constructor(e,t,n,i){super(e,t,n,i),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:bE,endingEnd:bE}}intervalChanged_(e,t,n){const i=this.parameterPositions;let s=e-2,o=e+1,l=i[s],h=i[o];if(l===void 0)switch(this.getSettings_().endingStart){case RE:s=e,l=2*t-n;break;case DE:s=i.length-2,l=t+i[s]-i[s+1];break;default:s=e,l=n}if(h===void 0)switch(this.getSettings_().endingEnd){case RE:o=e,h=2*n-t;break;case DE:o=1,h=n+i[1]-i[0];break;default:o=e-1,h=t}const u=(n-t)*.5,d=this.valueSize;this._weightPrev=u/(t-l),this._weightNext=u/(h-n),this._offsetPrev=s*d,this._offsetNext=o*d}interpolate_(e,t,n,i){const s=this.resultBuffer,o=this.sampleValues,l=this.valueSize,h=e*l,u=h-l,d=this._offsetPrev,A=this._offsetNext,p=this._weightPrev,g=this._weightNext,_=(n-t)/(i-t),E=_*_,m=E*_,v=-p*m+2*p*E-p*_,w=(1+p)*m+(-1.5-2*p)*E+(-.5+p)*_+1,x=(-1-g)*m+(1.5+g)*E+.5*_,I=g*m-g*E;for(let R=0;R!==l;++R)s[R]=v*o[d+R]+w*o[u+R]+x*o[h+R]+I*o[A+R];return s}}class B8 extends wu{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){const s=this.resultBuffer,o=this.sampleValues,l=this.valueSize,h=e*l,u=h-l,d=(n-t)/(i-t),A=1-d;for(let p=0;p!==l;++p)s[p]=o[u+p]*A+o[h+p]*d;return s}}class b8 extends wu{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e){return this.copySampleValue_(e-1)}}class $i{constructor(e,t,n,i){if(e===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(t===void 0||t.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=Hd(t,this.TimeBufferType),this.values=Hd(n,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}static toJSON(e){const t=e.constructor;let n;if(t.toJSON!==this.toJSON)n=t.toJSON(e);else{n={name:e.name,times:Hd(e.times,Array),values:Hd(e.values,Array)};const i=e.getInterpolation();i!==e.DefaultInterpolation&&(n.interpolation=i)}return n.type=e.ValueTypeName,n}InterpolantFactoryMethodDiscrete(e){return new b8(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new B8(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new T8(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case lu:t=this.InterpolantFactoryMethodDiscrete;break;case ll:t=this.InterpolantFactoryMethodLinear;break;case bA:t=this.InterpolantFactoryMethodSmooth;break}if(t===void 0){const n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(e!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(n);return console.warn("THREE.KeyframeTrack:",n),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return lu;case this.InterpolantFactoryMethodLinear:return ll;case this.InterpolantFactoryMethodSmooth:return bA}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){const t=this.times;for(let n=0,i=t.length;n!==i;++n)t[n]+=e}return this}scale(e){if(e!==1){const t=this.times;for(let n=0,i=t.length;n!==i;++n)t[n]*=e}return this}trim(e,t){const n=this.times,i=n.length;let s=0,o=i-1;for(;s!==i&&n[s]<e;)++s;for(;o!==-1&&n[o]>t;)--o;if(++o,s!==0||o!==i){s>=o&&(o=Math.max(o,1),s=o-1);const l=this.getValueSize();this.times=n.slice(s,o),this.values=this.values.slice(s*l,o*l)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const n=this.times,i=this.values,s=n.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let l=0;l!==s;l++){const h=n[l];if(typeof h=="number"&&isNaN(h)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,l,h),e=!1;break}if(o!==null&&o>h){console.error("THREE.KeyframeTrack: Out of order keys.",this,l,h,o),e=!1;break}o=h}if(i!==void 0&&M8(i))for(let l=0,h=i.length;l!==h;++l){const u=i[l];if(isNaN(u)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,l,u),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),n=this.getValueSize(),i=this.getInterpolation()===bA,s=e.length-1;let o=1;for(let l=1;l<s;++l){let h=!1;const u=e[l],d=e[l+1];if(u!==d&&(l!==1||u!==e[0]))if(i)h=!0;else{const A=l*n,p=A-n,g=A+n;for(let _=0;_!==n;++_){const E=t[A+_];if(E!==t[p+_]||E!==t[g+_]){h=!0;break}}}if(h){if(l!==o){e[o]=e[l];const A=l*n,p=o*n;for(let g=0;g!==n;++g)t[p+g]=t[A+g]}++o}}if(s>0){e[o]=e[s];for(let l=s*n,h=o*n,u=0;u!==n;++u)t[h+u]=t[l+u];++o}return o!==e.length?(this.times=e.slice(0,o),this.values=t.slice(0,o*n)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),n=this.constructor,i=new n(this.name,e,t);return i.createInterpolant=this.createInterpolant,i}}$i.prototype.TimeBufferType=Float32Array,$i.prototype.ValueBufferType=Float32Array,$i.prototype.DefaultInterpolation=ll;class Ll extends $i{}Ll.prototype.ValueTypeName="bool",Ll.prototype.ValueBufferType=Array,Ll.prototype.DefaultInterpolation=lu,Ll.prototype.InterpolantFactoryMethodLinear=void 0,Ll.prototype.InterpolantFactoryMethodSmooth=void 0;class hx extends $i{}hx.prototype.ValueTypeName="color";class Nl extends $i{}Nl.prototype.ValueTypeName="number";class R8 extends wu{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){const s=this.resultBuffer,o=this.sampleValues,l=this.valueSize,h=(n-t)/(i-t);let u=e*l;for(let d=u+l;u!==d;u+=4)Yi.slerpFlat(s,0,o,u-l,o,u,h);return s}}class vo extends $i{InterpolantFactoryMethodLinear(e){return new R8(this.times,this.values,this.getValueSize(),e)}}vo.prototype.ValueTypeName="quaternion",vo.prototype.DefaultInterpolation=ll,vo.prototype.InterpolantFactoryMethodSmooth=void 0;class Ul extends $i{}Ul.prototype.ValueTypeName="string",Ul.prototype.ValueBufferType=Array,Ul.prototype.DefaultInterpolation=lu,Ul.prototype.InterpolantFactoryMethodLinear=void 0,Ul.prototype.InterpolantFactoryMethodSmooth=void 0;class Pl extends $i{}Pl.prototype.ValueTypeName="vector";class D8{constructor(e="",t=-1,n=[],i=bb){this.name=e,this.tracks=n,this.duration=t,this.blendMode=i,this.uuid=Si(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],n=e.tracks,i=1/(e.fps||1);for(let o=0,l=n.length;o!==l;++o)t.push(N8(n[o]).scale(i));const s=new this(e.name,e.duration,t,e.blendMode);return s.uuid=e.uuid,s}static toJSON(e){const t=[],n=e.tracks,i={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let s=0,o=n.length;s!==o;++s)t.push($i.toJSON(n[s]));return i}static CreateFromMorphTargetSequence(e,t,n,i){const s=t.length,o=[];for(let l=0;l<s;l++){let h=[],u=[];h.push((l+s-1)%s,l,(l+1)%s),u.push(0,1,0);const d=S8(h);h=cx(h,1,d),u=cx(u,1,d),!i&&h[0]===0&&(h.push(s),u.push(u[0])),o.push(new Nl(".morphTargetInfluences["+t[l].name+"]",h,u).scale(1/n))}return new this(e,-1,o)}static findByName(e,t){let n=e;if(!Array.isArray(e)){const i=e;n=i.geometry&&i.geometry.animations||i.animations}for(let i=0;i<n.length;i++)if(n[i].name===t)return n[i];return null}static CreateClipsFromMorphTargetSequences(e,t,n){const i={},s=/^([\w-]*?)([\d]+)$/;for(let l=0,h=e.length;l<h;l++){const u=e[l],d=u.name.match(s);if(d&&d.length>1){const A=d[1];let p=i[A];p||(i[A]=p=[]),p.push(u)}}const o=[];for(const l in i)o.push(this.CreateFromMorphTargetSequence(l,i[l],t,n));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const n=function(d,A,p,g,_){if(p.length!==0){const E=[],m=[];ux(p,E,m,g),E.length!==0&&_.push(new d(A,E,m))}},i=[],s=e.name||"default",o=e.fps||30,l=e.blendMode;let h=e.length||-1;const u=e.hierarchy||[];for(let d=0;d<u.length;d++){const A=u[d].keys;if(!(!A||A.length===0))if(A[0].morphTargets){const p={};let g;for(g=0;g<A.length;g++)if(A[g].morphTargets)for(let _=0;_<A[g].morphTargets.length;_++)p[A[g].morphTargets[_]]=-1;for(const _ in p){const E=[],m=[];for(let v=0;v!==A[g].morphTargets.length;++v){const w=A[g];E.push(w.time),m.push(w.morphTarget===_?1:0)}i.push(new Nl(".morphTargetInfluence["+_+"]",E,m))}h=p.length*o}else{const p=".bones["+t[d].name+"]";n(Pl,p+".position",A,"pos",i),n(vo,p+".quaternion",A,"rot",i),n(Pl,p+".scale",A,"scl",i)}}return i.length===0?null:new this(s,h,i,l)}resetDuration(){const e=this.tracks;let t=0;for(let n=0,i=e.length;n!==i;++n){const s=this.tracks[n];t=Math.max(t,s.times[s.times.length-1])}return this.duration=t,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let e=!0;for(let t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){const e=[];for(let t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());return new this.constructor(this.name,this.duration,e,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}function L8(r){switch(r.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Nl;case"vector":case"vector2":case"vector3":case"vector4":return Pl;case"color":return hx;case"quaternion":return vo;case"bool":case"boolean":return Ll;case"string":return Ul}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+r)}function N8(r){if(r.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const e=L8(r.type);if(r.times===void 0){const t=[],n=[];ux(r.keys,t,n,"value"),r.times=t,r.values=n}return e.parse!==void 0?e.parse(r):new e(r.name,r.times,r.values,r.interpolation)}const la={enabled:!1,files:{},add:function(r,e){this.enabled!==!1&&(this.files[r]=e)},get:function(r){if(this.enabled!==!1)return this.files[r]},remove:function(r){delete this.files[r]},clear:function(){this.files={}}};class dx{constructor(e,t,n){const i=this;let s=!1,o=0,l=0,h;const u=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this.itemStart=function(d){l++,s===!1&&i.onStart!==void 0&&i.onStart(d,o,l),s=!0},this.itemEnd=function(d){o++,i.onProgress!==void 0&&i.onProgress(d,o,l),o===l&&(s=!1,i.onLoad!==void 0&&i.onLoad())},this.itemError=function(d){i.onError!==void 0&&i.onError(d)},this.resolveURL=function(d){return h?h(d):d},this.setURLModifier=function(d){return h=d,this},this.addHandler=function(d,A){return u.push(d,A),this},this.removeHandler=function(d){const A=u.indexOf(d);return A!==-1&&u.splice(A,2),this},this.getHandler=function(d){for(let A=0,p=u.length;A<p;A+=2){const g=u[A],_=u[A+1];if(g.global&&(g.lastIndex=0),g.test(d))return _}return null}}}const U8=new dx;class ca{constructor(e){this.manager=e!==void 0?e:U8,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){const n=this;return new Promise(function(i,s){n.load(e,i,t,s)})}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}}ca.DEFAULT_MATERIAL_NAME="__DEFAULT";const Cs={};class P8 extends Error{constructor(e,t){super(e),this.response=t}}class kl extends ca{constructor(e){super(e)}load(e,t,n,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=la.get(e);if(s!==void 0)return this.manager.itemStart(e),setTimeout(()=>{t&&t(s),this.manager.itemEnd(e)},0),s;if(Cs[e]!==void 0){Cs[e].push({onLoad:t,onProgress:n,onError:i});return}Cs[e]=[],Cs[e].push({onLoad:t,onProgress:n,onError:i});const o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),l=this.mimeType,h=this.responseType;fetch(o).then(u=>{if(u.status===200||u.status===0){if(u.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||u.body===void 0||u.body.getReader===void 0)return u;const d=Cs[e],A=u.body.getReader(),p=u.headers.get("Content-Length")||u.headers.get("X-File-Size"),g=p?parseInt(p):0,_=g!==0;let E=0;const m=new ReadableStream({start(v){w();function w(){A.read().then(({done:x,value:I})=>{if(x)v.close();else{E+=I.byteLength;const R=new ProgressEvent("progress",{lengthComputable:_,loaded:E,total:g});for(let S=0,T=d.length;S<T;S++){const D=d[S];D.onProgress&&D.onProgress(R)}v.enqueue(I),w()}})}}});return new Response(m)}else throw new P8(`fetch for "${u.url}" responded with ${u.status}: ${u.statusText}`,u)}).then(u=>{switch(h){case"arraybuffer":return u.arrayBuffer();case"blob":return u.blob();case"document":return u.text().then(d=>new DOMParser().parseFromString(d,l));case"json":return u.json();default:if(l===void 0)return u.text();{const d=/charset="?([^;"\s]*)"?/i.exec(l),A=d&&d[1]?d[1].toLowerCase():void 0,p=new TextDecoder(A);return u.arrayBuffer().then(g=>p.decode(g))}}}).then(u=>{la.add(e,u);const d=Cs[e];delete Cs[e];for(let A=0,p=d.length;A<p;A++){const g=d[A];g.onLoad&&g.onLoad(u)}}).catch(u=>{const d=Cs[e];if(d===void 0)throw this.manager.itemError(e),u;delete Cs[e];for(let A=0,p=d.length;A<p;A++){const g=d[A];g.onError&&g.onError(u)}this.manager.itemError(e)}).finally(()=>{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class k8 extends ca{constructor(e){super(e)}load(e,t,n,i){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,o=la.get(e);if(o!==void 0)return s.manager.itemStart(e),setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o;const l=du("img");function h(){d(),la.add(e,this),t&&t(this),s.manager.itemEnd(e)}function u(A){d(),i&&i(A),s.manager.itemError(e),s.manager.itemEnd(e)}function d(){l.removeEventListener("load",h,!1),l.removeEventListener("error",u,!1)}return l.addEventListener("load",h,!1),l.addEventListener("error",u,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(l.crossOrigin=this.crossOrigin),s.manager.itemStart(e),l.src=e,l}}class Q8 extends ca{constructor(e){super(e)}load(e,t,n,i){const s=this,o=new mo,l=new kl(this.manager);return l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setPath(this.path),l.setWithCredentials(s.withCredentials),l.load(e,function(h){let u;try{u=s.parse(h)}catch(d){if(i!==void 0)i(d);else{console.error(d);return}}u.image!==void 0?o.image=u.image:u.data!==void 0&&(o.image.width=u.width,o.image.height=u.height,o.image.data=u.data),o.wrapS=u.wrapS!==void 0?u.wrapS:Ii,o.wrapT=u.wrapT!==void 0?u.wrapT:Ii,o.magFilter=u.magFilter!==void 0?u.magFilter:gr,o.minFilter=u.minFilter!==void 0?u.minFilter:gr,o.anisotropy=u.anisotropy!==void 0?u.anisotropy:1,u.colorSpace!==void 0&&(o.colorSpace=u.colorSpace),u.flipY!==void 0&&(o.flipY=u.flipY),u.format!==void 0&&(o.format=u.format),u.type!==void 0&&(o.type=u.type),u.mipmaps!==void 0&&(o.mipmaps=u.mipmaps,o.minFilter=Ci),u.mipmapCount===1&&(o.minFilter=gr),u.generateMipmaps!==void 0&&(o.generateMipmaps=u.generateMipmaps),o.needsUpdate=!0,t&&t(o,u)},n,i),o}}class fx extends ca{constructor(e){super(e)}load(e,t,n,i){const s=new br,o=new k8(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(e,function(l){s.image=l,s.needsUpdate=!0,t!==void 0&&t(s)},n,i),s}}class Gd extends Zt{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new Ve(e),this.intensity=t}dispose(){}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,this.groundColor!==void 0&&(t.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(t.object.distance=this.distance),this.angle!==void 0&&(t.object.angle=this.angle),this.decay!==void 0&&(t.object.decay=this.decay),this.penumbra!==void 0&&(t.object.penumbra=this.penumbra),this.shadow!==void 0&&(t.object.shadow=this.shadow.toJSON()),t}}class O8 extends Gd{constructor(e,t,n){super(e,n),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(Zt.DEFAULT_UP),this.updateMatrix(),this.groundColor=new Ve(t)}copy(e,t){return super.copy(e,t),this.groundColor.copy(e.groundColor),this}}const vg=new rt,px=new G,Ax=new G;class _g{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Ue(512,512),this.map=null,this.mapPass=null,this.matrix=new rt,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new $A,this._frameExtents=new Ue(1,1),this._viewportCount=1,this._viewports=[new Ft(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,n=this.matrix;px.setFromMatrixPosition(e.matrixWorld),t.position.copy(px),Ax.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(Ax),t.updateMatrixWorld(),vg.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(vg),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(vg)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const e={};return this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class F8 extends _g{constructor(){super(new dn(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(e){const t=this.camera,n=ul*2*e.angle*this.focus,i=this.mapSize.width/this.mapSize.height,s=e.distance||t.far;(n!==t.fov||i!==t.aspect||s!==t.far)&&(t.fov=n,t.aspect=i,t.far=s,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class z8 extends Gd{constructor(e,t,n=0,i=Math.PI/3,s=0,o=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(Zt.DEFAULT_UP),this.updateMatrix(),this.target=new Zt,this.distance=n,this.angle=i,this.penumbra=s,this.decay=o,this.map=null,this.shadow=new F8}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}const gx=new rt,Iu=new G,yg=new G;class H8 extends _g{constructor(){super(new dn(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new Ue(4,2),this._viewportCount=6,this._viewports=[new Ft(2,1,1,1),new Ft(0,1,1,1),new Ft(3,1,1,1),new Ft(1,1,1,1),new Ft(3,0,1,1),new Ft(1,0,1,1)],this._cubeDirections=[new G(1,0,0),new G(-1,0,0),new G(0,0,1),new G(0,0,-1),new G(0,1,0),new G(0,-1,0)],this._cubeUps=[new G(0,1,0),new G(0,1,0),new G(0,1,0),new G(0,1,0),new G(0,0,1),new G(0,0,-1)]}updateMatrices(e,t=0){const n=this.camera,i=this.matrix,s=e.distance||n.far;s!==n.far&&(n.far=s,n.updateProjectionMatrix()),Iu.setFromMatrixPosition(e.matrixWorld),n.position.copy(Iu),yg.copy(n.position),yg.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt(yg),n.updateMatrixWorld(),i.makeTranslation(-Iu.x,-Iu.y,-Iu.z),gx.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(gx)}}class G8 extends Gd{constructor(e,t,n=0,i=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=n,this.decay=i,this.shadow=new H8}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}class V8 extends _g{constructor(){super(new _u(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class mx extends Gd{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(Zt.DEFAULT_UP),this.updateMatrix(),this.target=new Zt,this.shadow=new V8}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class Cu{static decodeText(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let n=0,i=e.length;n<i;n++)t+=String.fromCharCode(e[n]);try{return decodeURIComponent(escape(t))}catch{return t}}static extractUrlBase(e){const t=e.lastIndexOf("/");return t===-1?"./":e.slice(0,t+1)}static resolveURL(e,t){return typeof e!="string"||e===""?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}}class j8 extends ca{constructor(e){super(e),this.isImageBitmapLoader=!0,typeof createImageBitmap>"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,n,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,o=la.get(e);if(o!==void 0){if(s.manager.itemStart(e),o.then){o.then(u=>{t&&t(u),s.manager.itemEnd(e)}).catch(u=>{i&&i(u)});return}return setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o}const l={};l.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",l.headers=this.requestHeader;const h=fetch(e,l).then(function(u){return u.blob()}).then(function(u){return createImageBitmap(u,Object.assign(s.options,{colorSpaceConversion:"none"}))}).then(function(u){return la.add(e,u),t&&t(u),s.manager.itemEnd(e),u}).catch(function(u){i&&i(u),la.remove(e),s.manager.itemError(e),s.manager.itemEnd(e)});la.add(e,h),s.manager.itemStart(e)}}class W8{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=vx(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=vx();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function vx(){return(typeof performance>"u"?Date:performance).now()}const Eg="\\[\\]\\.:\\/",Y8=new RegExp("["+Eg+"]","g"),xg="[^"+Eg+"]",q8="[^"+Eg.replace("\\.","")+"]",X8=/((?:WC+[\/:])*)/.source.replace("WC",xg),K8=/(WCOD+)?/.source.replace("WCOD",q8),J8=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",xg),Z8=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",xg),$8=new RegExp("^"+X8+K8+J8+Z8+"$"),eN=["material","materials","bones","map"];class tN{constructor(e,t,n){const i=n||Pt.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,i)}getValue(e,t){this.bind();const n=this._targetGroup.nCachedObjects_,i=this._bindings[n];i!==void 0&&i.getValue(e,t)}setValue(e,t){const n=this._bindings;for(let i=this._targetGroup.nCachedObjects_,s=n.length;i!==s;++i)n[i].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}}class Pt{constructor(e,t,n){this.path=t,this.parsedPath=n||Pt.parseTrackName(t),this.node=Pt.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,n){return e&&e.isAnimationObjectGroup?new Pt.Composite(e,t,n):new Pt(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(Y8,"")}static parseTrackName(e){const t=$8.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){const s=n.nodeName.substring(i+1);eN.indexOf(s)!==-1&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=s)}if(n.propertyName===null||n.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const n=e.skeleton.getBoneByName(t);if(n!==void 0)return n}if(e.children){const n=function(s){for(let o=0;o<s.length;o++){const l=s[o];if(l.name===t||l.uuid===t)return l;const h=n(l.children);if(h)return h}return null},i=n(e.children);if(i)return i}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(e,t){const n=this.resolvedProperty;for(let i=0,s=n.length;i!==s;++i)e[t++]=n[i]}_getValue_arrayElement(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,t){this.resolvedProperty.toArray(e,t)}_setValue_direct(e,t){this.targetObject[this.propertyName]=e[t]}_setValue_direct_setNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,t){const n=this.resolvedProperty;for(let i=0,s=n.length;i!==s;++i)n[i]=e[t++]}_setValue_array_setNeedsUpdate(e,t){const n=this.resolvedProperty;for(let i=0,s=n.length;i!==s;++i)n[i]=e[t++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,t){const n=this.resolvedProperty;for(let i=0,s=n.length;i!==s;++i)n[i]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}_setValue_arrayElement_setNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,t){this.resolvedProperty.fromArray(e,t)}_setValue_fromArray_setNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,t){this.bind(),this.getValue(e,t)}_setValue_unbound(e,t){this.bind(),this.setValue(e,t)}bind(){let e=this.node;const t=this.parsedPath,n=t.objectName,i=t.propertyName;let s=t.propertyIndex;if(e||(e=Pt.findNode(this.rootNode,t.nodeName),this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e){console.warn("THREE.PropertyBinding: No target node found for track: "+this.path+".");return}if(n){let u=t.objectIndex;switch(n){case"materials":if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.materials){console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}e=e.material.materials;break;case"bones":if(!e.skeleton){console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}e=e.skeleton.bones;for(let d=0;d<e.length;d++)if(e[d].name===u){u=d;break}break;case"map":if("map"in e){e=e.map;break}if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.map){console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);return}e=e.material.map;break;default:if(e[n]===void 0){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}e=e[n]}if(u!==void 0){if(e[u]===void 0){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);return}e=e[u]}}const o=e[i];if(o===void 0){const u=t.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+u+"."+i+" but it wasn't found.",e);return}let l=this.Versioning.None;this.targetObject=e,e.needsUpdate!==void 0?l=this.Versioning.NeedsUpdate:e.matrixWorldNeedsUpdate!==void 0&&(l=this.Versioning.MatrixWorldNeedsUpdate);let h=this.BindingType.Direct;if(s!==void 0){if(i==="morphTargetInfluences"){if(!e.geometry){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(!e.geometry.morphAttributes){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}e.morphTargetDictionary[s]!==void 0&&(s=e.morphTargetDictionary[s])}h=this.BindingType.ArrayElement,this.resolvedProperty=o,this.propertyIndex=s}else o.fromArray!==void 0&&o.toArray!==void 0?(h=this.BindingType.HasFromToArray,this.resolvedProperty=o):Array.isArray(o)?(h=this.BindingType.EntireArray,this.resolvedProperty=o):this.propertyName=i;this.getValue=this.GetterByBindingType[h],this.setValue=this.SetterByBindingTypeAndVersioning[h][l]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}Pt.Composite=tN,Pt.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Pt.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},Pt.prototype.GetterByBindingType=[Pt.prototype._getValue_direct,Pt.prototype._getValue_array,Pt.prototype._getValue_arrayElement,Pt.prototype._getValue_toArray],Pt.prototype.SetterByBindingTypeAndVersioning=[[Pt.prototype._setValue_direct,Pt.prototype._setValue_direct_setNeedsUpdate,Pt.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[Pt.prototype._setValue_array,Pt.prototype._setValue_array_setNeedsUpdate,Pt.prototype._setValue_array_setMatrixWorldNeedsUpdate],[Pt.prototype._setValue_arrayElement,Pt.prototype._setValue_arrayElement_setNeedsUpdate,Pt.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[Pt.prototype._setValue_fromArray,Pt.prototype._setValue_fromArray_setNeedsUpdate,Pt.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];const _x=new rt;class rN{constructor(e,t,n=0,i=1/0){this.ray=new co(e,t),this.near=n,this.far=i,this.camera=null,this.layers=new vd,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,t){t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):console.error("THREE.Raycaster: Unsupported camera type: "+t.type)}setFromXRController(e){return _x.identity().extractRotation(e.matrixWorld),this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(_x),this}intersectObject(e,t=!0,n=[]){return wg(e,this,n,t),n.sort(yx),n}intersectObjects(e,t=!0,n=[]){for(let i=0,s=e.length;i<s;i++)wg(e[i],this,n,t);return n.sort(yx),n}}function yx(r,e){return r.distance-e.distance}function wg(r,e,t,n){if(r.layers.test(e.layers)&&r.raycast(e,t),n===!0){const i=r.children;for(let s=0,o=i.length;s<o;s++)wg(i[s],e,t,!0)}}class Ex{constructor(e=1,t=0,n=0){return this.radius=e,this.phi=t,this.theta=n,this}set(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,n){return this.radius=Math.sqrt(e*e+t*t+n*n),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,n),this.phi=Math.acos(Br(t/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}const xx=new G,Vd=new G;class Ms{constructor(e=new G,t=new G){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){xx.subVectors(e,this.start),Vd.subVectors(this.end,this.start);const n=Vd.dot(Vd);let i=Vd.dot(xx)/n;return t&&(i=Br(i,0,1)),i}closestPointToPoint(e,t,n){const i=this.closestPointToPointParameter(e,t);return this.delta(n).multiplyScalar(i).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:Kh}})),typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=Kh);const wx={type:"change"},Ig={type:"start"},Ix={type:"end"},jd=new co,Cx=new Ji,nN=Math.cos(70*NA.DEG2RAD);class iN extends ao{constructor(e,t){super(),this.object=e,this.domElement=t,this.domElement.style.touchAction="none",this.enabled=!0,this.target=new G,this.cursor=new G,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:nl.ROTATE,MIDDLE:nl.DOLLY,RIGHT:nl.PAN},this.touches={ONE:il.ROTATE,TWO:il.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this.getPolarAngle=function(){return l.phi},this.getAzimuthalAngle=function(){return l.theta},this.getDistance=function(){return this.object.position.distanceTo(this.target)},this.listenToKeyEvents=function(H){H.addEventListener("keydown",fe),this._domElementKeyEvents=H},this.stopListenToKeyEvents=function(){this._domElementKeyEvents.removeEventListener("keydown",fe),this._domElementKeyEvents=null},this.saveState=function(){n.target0.copy(n.target),n.position0.copy(n.object.position),n.zoom0=n.object.zoom},this.reset=function(){n.target.copy(n.target0),n.object.position.copy(n.position0),n.object.zoom=n.zoom0,n.object.updateProjectionMatrix(),n.dispatchEvent(wx),n.update(),s=i.NONE},this.update=function(){const H=new G,O=new Yi().setFromUnitVectors(e.up,new G(0,1,0)),ge=O.clone().invert(),ve=new G,Fe=new Yi,Pe=new G,vt=2*Math.PI;return function(Lt=null){const Nt=n.object.position;H.copy(Nt).sub(n.target),H.applyQuaternion(O),l.setFromVector3(H),n.autoRotate&&s===i.NONE&&P(M(Lt)),n.enableDamping?(l.theta+=h.theta*n.dampingFactor,l.phi+=h.phi*n.dampingFactor):(l.theta+=h.theta,l.phi+=h.phi);let Bt=n.minAzimuthAngle,_t=n.maxAzimuthAngle;isFinite(Bt)&&isFinite(_t)&&(Bt<-Math.PI?Bt+=vt:Bt>Math.PI&&(Bt-=vt),_t<-Math.PI?_t+=vt:_t>Math.PI&&(_t-=vt),Bt<=_t?l.theta=Math.max(Bt,Math.min(_t,l.theta)):l.theta=l.theta>(Bt+_t)/2?Math.max(Bt,l.theta):Math.min(_t,l.theta)),l.phi=Math.max(n.minPolarAngle,Math.min(n.maxPolarAngle,l.phi)),l.makeSafe(),n.enableDamping===!0?n.target.addScaledVector(d,n.dampingFactor):n.target.add(d),n.target.sub(n.cursor),n.target.clampLength(n.minTargetRadius,n.maxTargetRadius),n.target.add(n.cursor);let fr=!1;if(n.zoomToCursor&&S||n.object.isOrthographicCamera)l.radius=Q(l.radius);else{const Vt=l.radius;l.radius=Q(l.radius*u),fr=Vt!=l.radius}if(H.setFromSpherical(l),H.applyQuaternion(ge),Nt.copy(n.target).add(H),n.object.lookAt(n.target),n.enableDamping===!0?(h.theta*=1-n.dampingFactor,h.phi*=1-n.dampingFactor,d.multiplyScalar(1-n.dampingFactor)):(h.set(0,0,0),d.set(0,0,0)),n.zoomToCursor&&S){let Vt=null;if(n.object.isPerspectiveCamera){const Er=H.length();Vt=Q(Er*u);const Rn=Er-Vt;n.object.position.addScaledVector(I,Rn),n.object.updateMatrixWorld(),fr=!!Rn}else if(n.object.isOrthographicCamera){const Er=new G(R.x,R.y,0);Er.unproject(n.object);const Rn=n.object.zoom;n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/u)),n.object.updateProjectionMatrix(),fr=Rn!==n.object.zoom;const qt=new G(R.x,R.y,0);qt.unproject(n.object),n.object.position.sub(qt).add(Er),n.object.updateMatrixWorld(),Vt=H.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),n.zoomToCursor=!1;Vt!==null&&(this.screenSpacePanning?n.target.set(0,0,-1).transformDirection(n.object.matrix).multiplyScalar(Vt).add(n.object.position):(jd.origin.copy(n.object.position),jd.direction.set(0,0,-1).transformDirection(n.object.matrix),Math.abs(n.object.up.dot(jd.direction))<nN?e.lookAt(n.target):(Cx.setFromNormalAndCoplanarPoint(n.object.up,n.target),jd.intersectPlane(Cx,n.target))))}else if(n.object.isOrthographicCamera){const Vt=n.object.zoom;n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/u)),Vt!==n.object.zoom&&(n.object.updateProjectionMatrix(),fr=!0)}return u=1,S=!1,fr||ve.distanceToSquared(n.object.position)>o||8*(1-Fe.dot(n.object.quaternion))>o||Pe.distanceToSquared(n.target)>o?(n.dispatchEvent(wx),ve.copy(n.object.position),Fe.copy(n.object.quaternion),Pe.copy(n.target),!0):!1}}(),this.dispose=function(){n.domElement.removeEventListener("contextmenu",be),n.domElement.removeEventListener("pointerdown",le),n.domElement.removeEventListener("pointercancel",me),n.domElement.removeEventListener("wheel",Ie),n.domElement.removeEventListener("pointermove",pe),n.domElement.removeEventListener("pointerup",me),n.domElement.getRootNode().removeEventListener("keydown",Ge,{capture:!0}),n._domElementKeyEvents!==null&&(n._domElementKeyEvents.removeEventListener("keydown",fe),n._domElementKeyEvents=null)};const n=this,i={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let s=i.NONE;const o=1e-6,l=new Ex,h=new Ex;let u=1;const d=new G,A=new Ue,p=new Ue,g=new Ue,_=new Ue,E=new Ue,m=new Ue,v=new Ue,w=new Ue,x=new Ue,I=new G,R=new Ue;let S=!1;const T=[],D={};let b=!1;function M(H){return H!==null?2*Math.PI/60*n.autoRotateSpeed*H:2*Math.PI/60/60*n.autoRotateSpeed}function L(H){const O=Math.abs(H*.01);return Math.pow(.95,n.zoomSpeed*O)}function P(H){h.theta-=H}function N(H){h.phi-=H}const W=function(){const H=new G;return function(O,ge){H.setFromMatrixColumn(ge,0),H.multiplyScalar(-O),d.add(H)}}(),X=function(){const H=new G;return function(O,ge){n.screenSpacePanning===!0?H.setFromMatrixColumn(ge,1):(H.setFromMatrixColumn(ge,0),H.crossVectors(n.object.up,H)),H.multiplyScalar(O),d.add(H)}}(),K=function(){const H=new G;return function(O,ge){const ve=n.domElement;if(n.object.isPerspectiveCamera){const Fe=n.object.position;H.copy(Fe).sub(n.target);let Pe=H.length();Pe*=Math.tan(n.object.fov/2*Math.PI/180),W(2*O*Pe/ve.clientHeight,n.object.matrix),X(2*ge*Pe/ve.clientHeight,n.object.matrix)}else n.object.isOrthographicCamera?(W(O*(n.object.right-n.object.left)/n.object.zoom/ve.clientWidth,n.object.matrix),X(ge*(n.object.top-n.object.bottom)/n.object.zoom/ve.clientHeight,n.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),n.enablePan=!1)}}();function te(H){n.object.isPerspectiveCamera||n.object.isOrthographicCamera?u/=H:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function V(H){n.object.isPerspectiveCamera||n.object.isOrthographicCamera?u*=H:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function ee(H,O){if(!n.zoomToCursor)return;S=!0;const ge=n.domElement.getBoundingClientRect(),ve=H-ge.left,Fe=O-ge.top,Pe=ge.width,vt=ge.height;R.x=ve/Pe*2-1,R.y=-(Fe/vt)*2+1,I.set(R.x,R.y,1).unproject(n.object).sub(n.object.position).normalize()}function Q(H){return Math.max(n.minDistance,Math.min(n.maxDistance,H))}function z(H){A.set(H.clientX,H.clientY)}function Z(H){ee(H.clientX,H.clientX),v.set(H.clientX,H.clientY)}function re(H){_.set(H.clientX,H.clientY)}function j(H){p.set(H.clientX,H.clientY),g.subVectors(p,A).multiplyScalar(n.rotateSpeed);const O=n.domElement;P(2*Math.PI*g.x/O.clientHeight),N(2*Math.PI*g.y/O.clientHeight),A.copy(p),n.update()}function de(H){w.set(H.clientX,H.clientY),x.subVectors(w,v),x.y>0?te(L(x.y)):x.y<0&&V(L(x.y)),v.copy(w),n.update()}function Ae(H){E.set(H.clientX,H.clientY),m.subVectors(E,_).multiplyScalar(n.panSpeed),K(m.x,m.y),_.copy(E),n.update()}function _e(H){ee(H.clientX,H.clientY),H.deltaY<0?V(L(H.deltaY)):H.deltaY>0&&te(L(H.deltaY)),n.update()}function Ee(H){let O=!1;switch(H.code){case n.keys.UP:H.ctrlKey||H.metaKey||H.shiftKey?N(2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):K(0,n.keyPanSpeed),O=!0;break;case n.keys.BOTTOM:H.ctrlKey||H.metaKey||H.shiftKey?N(-2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):K(0,-n.keyPanSpeed),O=!0;break;case n.keys.LEFT:H.ctrlKey||H.metaKey||H.shiftKey?P(2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):K(n.keyPanSpeed,0),O=!0;break;case n.keys.RIGHT:H.ctrlKey||H.metaKey||H.shiftKey?P(-2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):K(-n.keyPanSpeed,0),O=!0;break}O&&(H.preventDefault(),n.update())}function Le(H){if(T.length===1)A.set(H.pageX,H.pageY);else{const O=ht(H),ge=.5*(H.pageX+O.x),ve=.5*(H.pageY+O.y);A.set(ge,ve)}}function st(H){if(T.length===1)_.set(H.pageX,H.pageY);else{const O=ht(H),ge=.5*(H.pageX+O.x),ve=.5*(H.pageY+O.y);_.set(ge,ve)}}function se(H){const O=ht(H),ge=H.pageX-O.x,ve=H.pageY-O.y,Fe=Math.sqrt(ge*ge+ve*ve);v.set(0,Fe)}function et(H){n.enableZoom&&se(H),n.enablePan&&st(H)}function Qe(H){n.enableZoom&&se(H),n.enableRotate&&Le(H)}function ct(H){if(T.length==1)p.set(H.pageX,H.pageY);else{const ge=ht(H),ve=.5*(H.pageX+ge.x),Fe=.5*(H.pageY+ge.y);p.set(ve,Fe)}g.subVectors(p,A).multiplyScalar(n.rotateSpeed);const O=n.domElement;P(2*Math.PI*g.x/O.clientHeight),N(2*Math.PI*g.y/O.clientHeight),A.copy(p)}function Ke(H){if(T.length===1)E.set(H.pageX,H.pageY);else{const O=ht(H),ge=.5*(H.pageX+O.x),ve=.5*(H.pageY+O.y);E.set(ge,ve)}m.subVectors(E,_).multiplyScalar(n.panSpeed),K(m.x,m.y),_.copy(E)}function pt(H){const O=ht(H),ge=H.pageX-O.x,ve=H.pageY-O.y,Fe=Math.sqrt(ge*ge+ve*ve);w.set(0,Fe),x.set(0,Math.pow(w.y/v.y,n.zoomSpeed)),te(x.y),v.copy(w);const Pe=(H.pageX+O.x)*.5,vt=(H.pageY+O.y)*.5;ee(Pe,vt)}function Y(H){n.enableZoom&&pt(H),n.enablePan&&Ke(H)}function k(H){n.enableZoom&&pt(H),n.enableRotate&&ct(H)}function le(H){n.enabled!==!1&&(T.length===0&&(n.domElement.setPointerCapture(H.pointerId),n.domElement.addEventListener("pointermove",pe),n.domElement.addEventListener("pointerup",me)),!dt(H)&&(nt(H),H.pointerType==="touch"?De(H):ye(H)))}function pe(H){n.enabled!==!1&&(H.pointerType==="touch"?Be(H):He(H))}function me(H){switch(lt(H),T.length){case 0:n.domElement.releasePointerCapture(H.pointerId),n.domElement.removeEventListener("pointermove",pe),n.domElement.removeEventListener("pointerup",me),n.dispatchEvent(Ix),s=i.NONE;break;case 1:const O=T[0],ge=D[O];De({pointerId:O,pageX:ge.x,pageY:ge.y});break}}function ye(H){let O;switch(H.button){case 0:O=n.mouseButtons.LEFT;break;case 1:O=n.mouseButtons.MIDDLE;break;case 2:O=n.mouseButtons.RIGHT;break;default:O=-1}switch(O){case nl.DOLLY:if(n.enableZoom===!1)return;Z(H),s=i.DOLLY;break;case nl.ROTATE:if(H.ctrlKey||H.metaKey||H.shiftKey){if(n.enablePan===!1)return;re(H),s=i.PAN}else{if(n.enableRotate===!1)return;z(H),s=i.ROTATE}break;case nl.PAN:if(H.ctrlKey||H.metaKey||H.shiftKey){if(n.enableRotate===!1)return;z(H),s=i.ROTATE}else{if(n.enablePan===!1)return;re(H),s=i.PAN}break;default:s=i.NONE}s!==i.NONE&&n.dispatchEvent(Ig)}function He(H){switch(s){case i.ROTATE:if(n.enableRotate===!1)return;j(H);break;case i.DOLLY:if(n.enableZoom===!1)return;de(H);break;case i.PAN:if(n.enablePan===!1)return;Ae(H);break}}function Ie(H){n.enabled===!1||n.enableZoom===!1||s!==i.NONE||(H.preventDefault(),n.dispatchEvent(Ig),_e(je(H)),n.dispatchEvent(Ix))}function je(H){const O=H.deltaMode,ge={clientX:H.clientX,clientY:H.clientY,deltaY:H.deltaY};switch(O){case 1:ge.deltaY*=16;break;case 2:ge.deltaY*=100;break}return H.ctrlKey&&!b&&(ge.deltaY*=10),ge}function Ge(H){H.key==="Control"&&(b=!0,n.domElement.getRootNode().addEventListener("keyup",Me,{passive:!0,capture:!0}))}function Me(H){H.key==="Control"&&(b=!1,n.domElement.getRootNode().removeEventListener("keyup",Me,{passive:!0,capture:!0}))}function fe(H){n.enabled===!1||n.enablePan===!1||Ee(H)}function De(H){switch(ut(H),T.length){case 1:switch(n.touches.ONE){case il.ROTATE:if(n.enableRotate===!1)return;Le(H),s=i.TOUCH_ROTATE;break;case il.PAN:if(n.enablePan===!1)return;st(H),s=i.TOUCH_PAN;break;default:s=i.NONE}break;case 2:switch(n.touches.TWO){case il.DOLLY_PAN:if(n.enableZoom===!1&&n.enablePan===!1)return;et(H),s=i.TOUCH_DOLLY_PAN;break;case il.DOLLY_ROTATE:if(n.enableZoom===!1&&n.enableRotate===!1)return;Qe(H),s=i.TOUCH_DOLLY_ROTATE;break;default:s=i.NONE}break;default:s=i.NONE}s!==i.NONE&&n.dispatchEvent(Ig)}function Be(H){switch(ut(H),s){case i.TOUCH_ROTATE:if(n.enableRotate===!1)return;ct(H),n.update();break;case i.TOUCH_PAN:if(n.enablePan===!1)return;Ke(H),n.update();break;case i.TOUCH_DOLLY_PAN:if(n.enableZoom===!1&&n.enablePan===!1)return;Y(H),n.update();break;case i.TOUCH_DOLLY_ROTATE:if(n.enableZoom===!1&&n.enableRotate===!1)return;k(H),n.update();break;default:s=i.NONE}}function be(H){n.enabled!==!1&&H.preventDefault()}function nt(H){T.push(H.pointerId)}function lt(H){delete D[H.pointerId];for(let O=0;O<T.length;O++)if(T[O]==H.pointerId){T.splice(O,1);return}}function dt(H){for(let O=0;O<T.length;O++)if(T[O]==H.pointerId)return!0;return!1}function ut(H){let O=D[H.pointerId];O===void 0&&(O=new Ue,D[H.pointerId]=O),O.set(H.pageX,H.pageY)}function ht(H){const O=H.pointerId===T[0]?T[1]:T[0];return D[O]}n.domElement.addEventListener("contextmenu",be),n.domElement.addEventListener("pointerdown",le),n.domElement.addEventListener("pointercancel",me),n.domElement.addEventListener("wheel",Ie,{passive:!1}),n.domElement.getRootNode().addEventListener("keydown",Ge,{passive:!0,capture:!0}),this.update()}}function Mx(r,e){if(e===Rb)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),r;if(e===RA||e===LE){let t=r.getIndex();if(t===null){const o=[],l=r.getAttribute("position");if(l!==void 0){for(let h=0;h<l.count;h++)o.push(h);r.setIndex(o),t=r.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),r}const n=t.count-2,i=[];if(e===RA)for(let o=1;o<=n;o++)i.push(t.getX(0)),i.push(t.getX(o)),i.push(t.getX(o+1));else for(let o=0;o<n;o++)o%2===0?(i.push(t.getX(o)),i.push(t.getX(o+1)),i.push(t.getX(o+2))):(i.push(t.getX(o+2)),i.push(t.getX(o+1)),i.push(t.getX(o)));i.length/3!==n&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const s=r.clone();return s.setIndex(i),s.clearGroups(),s}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",e),r}class sN extends ca{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new uN(t)}),this.register(function(t){return new _N(t)}),this.register(function(t){return new yN(t)}),this.register(function(t){return new EN(t)}),this.register(function(t){return new dN(t)}),this.register(function(t){return new fN(t)}),this.register(function(t){return new pN(t)}),this.register(function(t){return new AN(t)}),this.register(function(t){return new cN(t)}),this.register(function(t){return new gN(t)}),this.register(function(t){return new hN(t)}),this.register(function(t){return new vN(t)}),this.register(function(t){return new mN(t)}),this.register(function(t){return new oN(t)}),this.register(function(t){return new xN(t)}),this.register(function(t){return new wN(t)})}load(e,t,n,i){const s=this;let o;if(this.resourcePath!=="")o=this.resourcePath;else if(this.path!==""){const u=Cu.extractUrlBase(e);o=Cu.resolveURL(u,this.path)}else o=Cu.extractUrlBase(e);this.manager.itemStart(e);const l=function(u){i?i(u):console.error(u),s.manager.itemError(e),s.manager.itemEnd(e)},h=new kl(this.manager);h.setPath(this.path),h.setResponseType("arraybuffer"),h.setRequestHeader(this.requestHeader),h.setWithCredentials(this.withCredentials),h.load(e,function(u){try{s.parse(u,o,function(d){t(d),s.manager.itemEnd(e)},l)}catch(d){l(d)}},n,l)}setDRACOLoader(e){return this.dracoLoader=e,this}setDDSLoader(){throw new Error('THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".')}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,n,i){let s;const o={},l={},h=new TextDecoder;if(typeof e=="string")s=JSON.parse(e);else if(e instanceof ArrayBuffer)if(h.decode(new Uint8Array(e,0,4))===Sx){try{o[wt.KHR_BINARY_GLTF]=new IN(e)}catch(d){i&&i(d);return}s=JSON.parse(o[wt.KHR_BINARY_GLTF].content)}else s=JSON.parse(h.decode(e));else s=e;if(s.asset===void 0||s.asset.version[0]<2){i&&i(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}const u=new kN(s,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});u.fileLoader.setRequestHeader(this.requestHeader);for(let d=0;d<this.pluginCallbacks.length;d++){const A=this.pluginCallbacks[d](u);A.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),l[A.name]=A,o[A.name]=!0}if(s.extensionsUsed)for(let d=0;d<s.extensionsUsed.length;++d){const A=s.extensionsUsed[d],p=s.extensionsRequired||[];switch(A){case wt.KHR_MATERIALS_UNLIT:o[A]=new lN;break;case wt.KHR_DRACO_MESH_COMPRESSION:o[A]=new CN(s,this.dracoLoader);break;case wt.KHR_TEXTURE_TRANSFORM:o[A]=new MN;break;case wt.KHR_MESH_QUANTIZATION:o[A]=new SN;break;default:p.indexOf(A)>=0&&l[A]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+A+'".')}}u.setExtensions(o),u.setPlugins(l),u.parse(n,i)}parseAsync(e,t){const n=this;return new Promise(function(i,s){n.parse(e,t,i,s)})}}function aN(){let r={};return{get:function(e){return r[e]},add:function(e,t){r[e]=t},remove:function(e){delete r[e]},removeAll:function(){r={}}}}const wt={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class oN{constructor(e){this.parser=e,this.name=wt.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let n=0,i=t.length;n<i;n++){const s=t[n];s.extensions&&s.extensions[this.name]&&s.extensions[this.name].light!==void 0&&e._addNodeRef(this.cache,s.extensions[this.name].light)}}_loadLight(e){const t=this.parser,n="light:"+e;let i=t.cache.get(n);if(i)return i;const s=t.json,o=((s.extensions&&s.extensions[this.name]||{}).lights||[])[e];let l;const h=new Ve(16777215);o.color!==void 0&&h.setRGB(o.color[0],o.color[1],o.color[2],cr);const u=o.range!==void 0?o.range:0;switch(o.type){case"directional":l=new mx(h),l.target.position.set(0,0,-1),l.add(l.target);break;case"point":l=new G8(h),l.distance=u;break;case"spot":l=new z8(h),l.distance=u,o.spot=o.spot||{},o.spot.innerConeAngle=o.spot.innerConeAngle!==void 0?o.spot.innerConeAngle:0,o.spot.outerConeAngle=o.spot.outerConeAngle!==void 0?o.spot.outerConeAngle:Math.PI/4,l.angle=o.spot.outerConeAngle,l.penumbra=1-o.spot.innerConeAngle/o.spot.outerConeAngle,l.target.position.set(0,0,-1),l.add(l.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+o.type)}return l.position.set(0,0,0),l.decay=2,ha(l,o),o.intensity!==void 0&&(l.intensity=o.intensity),l.name=t.createUniqueName(o.name||"light_"+e),i=Promise.resolve(l),t.cache.add(n,i),i}getDependency(e,t){if(e==="light")return this._loadLight(t)}createNodeAttachment(e){const t=this,n=this.parser,i=n.json.nodes[e],s=(i.extensions&&i.extensions[this.name]||{}).light;return s===void 0?null:this._loadLight(s).then(function(o){return n._getNodeRef(t.cache,s,o)})}}class lN{constructor(){this.name=wt.KHR_MATERIALS_UNLIT}getMaterialType(){return Ki}extendParams(e,t,n){const i=[];e.color=new Ve(1,1,1),e.opacity=1;const s=t.pbrMetallicRoughness;if(s){if(Array.isArray(s.baseColorFactor)){const o=s.baseColorFactor;e.color.setRGB(o[0],o[1],o[2],cr),e.opacity=o[3]}s.baseColorTexture!==void 0&&i.push(n.assignTexture(e,"map",s.baseColorTexture,Fr))}return Promise.all(i)}}class cN{constructor(e){this.parser=e,this.name=wt.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){const n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const i=n.extensions[this.name].emissiveStrength;return i!==void 0&&(t.emissiveIntensity=i),Promise.resolve()}}class uN{constructor(e){this.parser=e,this.name=wt.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:Ni}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],o=i.extensions[this.name];if(o.clearcoatFactor!==void 0&&(t.clearcoat=o.clearcoatFactor),o.clearcoatTexture!==void 0&&s.push(n.assignTexture(t,"clearcoatMap",o.clearcoatTexture)),o.clearcoatRoughnessFactor!==void 0&&(t.clearcoatRoughness=o.clearcoatRoughnessFactor),o.clearcoatRoughnessTexture!==void 0&&s.push(n.assignTexture(t,"clearcoatRoughnessMap",o.clearcoatRoughnessTexture)),o.clearcoatNormalTexture!==void 0&&(s.push(n.assignTexture(t,"clearcoatNormalMap",o.clearcoatNormalTexture)),o.clearcoatNormalTexture.scale!==void 0)){const l=o.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new Ue(l,l)}return Promise.all(s)}}class hN{constructor(e){this.parser=e,this.name=wt.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:Ni}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],o=i.extensions[this.name];return o.iridescenceFactor!==void 0&&(t.iridescence=o.iridescenceFactor),o.iridescenceTexture!==void 0&&s.push(n.assignTexture(t,"iridescenceMap",o.iridescenceTexture)),o.iridescenceIor!==void 0&&(t.iridescenceIOR=o.iridescenceIor),t.iridescenceThicknessRange===void 0&&(t.iridescenceThicknessRange=[100,400]),o.iridescenceThicknessMinimum!==void 0&&(t.iridescenceThicknessRange[0]=o.iridescenceThicknessMinimum),o.iridescenceThicknessMaximum!==void 0&&(t.iridescenceThicknessRange[1]=o.iridescenceThicknessMaximum),o.iridescenceThicknessTexture!==void 0&&s.push(n.assignTexture(t,"iridescenceThicknessMap",o.iridescenceThicknessTexture)),Promise.all(s)}}class dN{constructor(e){this.parser=e,this.name=wt.KHR_MATERIALS_SHEEN}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:Ni}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[];t.sheenColor=new Ve(0,0,0),t.sheenRoughness=0,t.sheen=1;const o=i.extensions[this.name];if(o.sheenColorFactor!==void 0){const l=o.sheenColorFactor;t.sheenColor.setRGB(l[0],l[1],l[2],cr)}return o.sheenRoughnessFactor!==void 0&&(t.sheenRoughness=o.sheenRoughnessFactor),o.sheenColorTexture!==void 0&&s.push(n.assignTexture(t,"sheenColorMap",o.sheenColorTexture,Fr)),o.sheenRoughnessTexture!==void 0&&s.push(n.assignTexture(t,"sheenRoughnessMap",o.sheenRoughnessTexture)),Promise.all(s)}}class fN{constructor(e){this.parser=e,this.name=wt.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:Ni}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],o=i.extensions[this.name];return o.transmissionFactor!==void 0&&(t.transmission=o.transmissionFactor),o.transmissionTexture!==void 0&&s.push(n.assignTexture(t,"transmissionMap",o.transmissionTexture)),Promise.all(s)}}class pN{constructor(e){this.parser=e,this.name=wt.KHR_MATERIALS_VOLUME}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:Ni}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],o=i.extensions[this.name];t.thickness=o.thicknessFactor!==void 0?o.thicknessFactor:0,o.thicknessTexture!==void 0&&s.push(n.assignTexture(t,"thicknessMap",o.thicknessTexture)),t.attenuationDistance=o.attenuationDistance||1/0;const l=o.attenuationColor||[1,1,1];return t.attenuationColor=new Ve().setRGB(l[0],l[1],l[2],cr),Promise.all(s)}}class AN{constructor(e){this.parser=e,this.name=wt.KHR_MATERIALS_IOR}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:Ni}extendMaterialParams(e,t){const n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const i=n.extensions[this.name];return t.ior=i.ior!==void 0?i.ior:1.5,Promise.resolve()}}class gN{constructor(e){this.parser=e,this.name=wt.KHR_MATERIALS_SPECULAR}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:Ni}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],o=i.extensions[this.name];t.specularIntensity=o.specularFactor!==void 0?o.specularFactor:1,o.specularTexture!==void 0&&s.push(n.assignTexture(t,"specularIntensityMap",o.specularTexture));const l=o.specularColorFactor||[1,1,1];return t.specularColor=new Ve().setRGB(l[0],l[1],l[2],cr),o.specularColorTexture!==void 0&&s.push(n.assignTexture(t,"specularColorMap",o.specularColorTexture,Fr)),Promise.all(s)}}class mN{constructor(e){this.parser=e,this.name=wt.EXT_MATERIALS_BUMP}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:Ni}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],o=i.extensions[this.name];return t.bumpScale=o.bumpFactor!==void 0?o.bumpFactor:1,o.bumpTexture!==void 0&&s.push(n.assignTexture(t,"bumpMap",o.bumpTexture)),Promise.all(s)}}class vN{constructor(e){this.parser=e,this.name=wt.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:Ni}extendMaterialParams(e,t){const n=this.parser,i=n.json.materials[e];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const s=[],o=i.extensions[this.name];return o.anisotropyStrength!==void 0&&(t.anisotropy=o.anisotropyStrength),o.anisotropyRotation!==void 0&&(t.anisotropyRotation=o.anisotropyRotation),o.anisotropyTexture!==void 0&&s.push(n.assignTexture(t,"anisotropyMap",o.anisotropyTexture)),Promise.all(s)}}class _N{constructor(e){this.parser=e,this.name=wt.KHR_TEXTURE_BASISU}loadTexture(e){const t=this.parser,n=t.json,i=n.textures[e];if(!i.extensions||!i.extensions[this.name])return null;const s=i.extensions[this.name],o=t.options.ktx2Loader;if(!o){if(n.extensionsRequired&&n.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,s.source,o)}}class yN{constructor(e){this.parser=e,this.name=wt.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const t=this.name,n=this.parser,i=n.json,s=i.textures[e];if(!s.extensions||!s.extensions[t])return null;const o=s.extensions[t],l=i.images[o.source];let h=n.textureLoader;if(l.uri){const u=n.options.manager.getHandler(l.uri);u!==null&&(h=u)}return this.detectSupport().then(function(u){if(u)return n.loadTextureImage(e,o.source,h);if(i.extensionsRequired&&i.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return n.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class EN{constructor(e){this.parser=e,this.name=wt.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const t=this.name,n=this.parser,i=n.json,s=i.textures[e];if(!s.extensions||!s.extensions[t])return null;const o=s.extensions[t],l=i.images[o.source];let h=n.textureLoader;if(l.uri){const u=n.options.manager.getHandler(l.uri);u!==null&&(h=u)}return this.detectSupport().then(function(u){if(u)return n.loadTextureImage(e,o.source,h);if(i.extensionsRequired&&i.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return n.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class xN{constructor(e){this.name=wt.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,n=t.bufferViews[e];if(n.extensions&&n.extensions[this.name]){const i=n.extensions[this.name],s=this.parser.getDependency("buffer",i.buffer),o=this.parser.options.meshoptDecoder;if(!o||!o.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return s.then(function(l){const h=i.byteOffset||0,u=i.byteLength||0,d=i.count,A=i.byteStride,p=new Uint8Array(l,h,u);return o.decodeGltfBufferAsync?o.decodeGltfBufferAsync(d,A,p,i.mode,i.filter).then(function(g){return g.buffer}):o.ready.then(function(){const g=new ArrayBuffer(d*A);return o.decodeGltfBuffer(new Uint8Array(g),d,A,p,i.mode,i.filter),g})})}else return null}}class wN{constructor(e){this.name=wt.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,n=t.nodes[e];if(!n.extensions||!n.extensions[this.name]||n.mesh===void 0)return null;const i=t.meshes[n.mesh];for(const h of i.primitives)if(h.mode!==si.TRIANGLES&&h.mode!==si.TRIANGLE_STRIP&&h.mode!==si.TRIANGLE_FAN&&h.mode!==void 0)return null;const s=n.extensions[this.name].attributes,o=[],l={};for(const h in s)o.push(this.parser.getDependency("accessor",s[h]).then(u=>(l[h]=u,l[h])));return o.length<1?null:(o.push(this.parser.createNodeMesh(e)),Promise.all(o).then(h=>{const u=h.pop(),d=u.isGroup?u.children:[u],A=h[0].count,p=[];for(const g of d){const _=new rt,E=new G,m=new Yi,v=new G(1,1,1),w=new _8(g.geometry,g.material,A);for(let x=0;x<A;x++)l.TRANSLATION&&E.fromBufferAttribute(l.TRANSLATION,x),l.ROTATION&&m.fromBufferAttribute(l.ROTATION,x),l.SCALE&&v.fromBufferAttribute(l.SCALE,x),w.setMatrixAt(x,_.compose(E,m,v));for(const x in l)if(x==="_COLOR_0"){const I=l[x];w.instanceColor=new fg(I.array,I.itemSize,I.normalized)}else x!=="TRANSLATION"&&x!=="ROTATION"&&x!=="SCALE"&&g.geometry.setAttribute(x,l[x]);Zt.prototype.copy.call(w,g),this.parser.assignFinalMaterial(w),p.push(w)}return u.isGroup?(u.clear(),u.add(...p),u):p[0]}))}}const Sx="glTF",Mu=12,Tx={JSON:1313821514,BIN:5130562};class IN{constructor(e){this.name=wt.KHR_BINARY_GLTF,this.content=null,this.body=null;const t=new DataView(e,0,Mu),n=new TextDecoder;if(this.header={magic:n.decode(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==Sx)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const i=this.header.length-Mu,s=new DataView(e,Mu);let o=0;for(;o<i;){const l=s.getUint32(o,!0);o+=4;const h=s.getUint32(o,!0);if(o+=4,h===Tx.JSON){const u=new Uint8Array(e,Mu+o,l);this.content=n.decode(u)}else if(h===Tx.BIN){const u=Mu+o;this.body=e.slice(u,u+l)}o+=l}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class CN{constructor(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=wt.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){const n=this.json,i=this.dracoLoader,s=e.extensions[this.name].bufferView,o=e.extensions[this.name].attributes,l={},h={},u={};for(const d in o){const A=Mg[d]||d.toLowerCase();l[A]=o[d]}for(const d in e.attributes){const A=Mg[d]||d.toLowerCase();if(o[d]!==void 0){const p=n.accessors[e.attributes[d]],g=Ql[p.componentType];u[A]=g.name,h[A]=p.normalized===!0}}return t.getDependency("bufferView",s).then(function(d){return new Promise(function(A,p){i.decodeDracoFile(d,function(g){for(const _ in g.attributes){const E=g.attributes[_],m=h[_];m!==void 0&&(E.normalized=m)}A(g)},l,u,cr,p)})})}}class MN{constructor(){this.name=wt.KHR_TEXTURE_TRANSFORM}extendTexture(e,t){return(t.texCoord===void 0||t.texCoord===e.channel)&&t.offset===void 0&&t.rotation===void 0&&t.scale===void 0||(e=e.clone(),t.texCoord!==void 0&&(e.channel=t.texCoord),t.offset!==void 0&&e.offset.fromArray(t.offset),t.rotation!==void 0&&(e.rotation=t.rotation),t.scale!==void 0&&e.repeat.fromArray(t.scale),e.needsUpdate=!0),e}}class SN{constructor(){this.name=wt.KHR_MESH_QUANTIZATION}}class Bx extends wu{constructor(e,t,n,i){super(e,t,n,i)}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,i=this.valueSize,s=e*i*3+i;for(let o=0;o!==i;o++)t[o]=n[s+o];return t}interpolate_(e,t,n,i){const s=this.resultBuffer,o=this.sampleValues,l=this.valueSize,h=l*2,u=l*3,d=i-t,A=(n-t)/d,p=A*A,g=p*A,_=e*u,E=_-u,m=-2*g+3*p,v=g-p,w=1-m,x=v-p+A;for(let I=0;I!==l;I++){const R=o[E+I+l],S=o[E+I+h]*d,T=o[_+I+l],D=o[_+I]*d;s[I]=w*R+x*S+m*T+v*D}return s}}const TN=new Yi;class BN extends Bx{interpolate_(e,t,n,i){const s=super.interpolate_(e,t,n,i);return TN.fromArray(s).normalize().toArray(s),s}}const si={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123},Ql={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},bx={9728:Ar,9729:gr,9984:oE,9985:ed,9986:nu,9987:Ci},Rx={33071:Ii,33648:$h,10497:$s},Cg={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Mg={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},ua={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},bN={CUBICSPLINE:void 0,LINEAR:ll,STEP:lu},Sg={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function RN(r){return r.DefaultMaterial===void 0&&(r.DefaultMaterial=new mg({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:xi})),r.DefaultMaterial}function _o(r,e,t){for(const n in t.extensions)r[n]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[n]=t.extensions[n])}function ha(r,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(r.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function DN(r,e,t){let n=!1,i=!1,s=!1;for(let u=0,d=e.length;u<d;u++){const A=e[u];if(A.POSITION!==void 0&&(n=!0),A.NORMAL!==void 0&&(i=!0),A.COLOR_0!==void 0&&(s=!0),n&&i&&s)break}if(!n&&!i&&!s)return Promise.resolve(r);const o=[],l=[],h=[];for(let u=0,d=e.length;u<d;u++){const A=e[u];if(n){const p=A.POSITION!==void 0?t.getDependency("accessor",A.POSITION):r.attributes.position;o.push(p)}if(i){const p=A.NORMAL!==void 0?t.getDependency("accessor",A.NORMAL):r.attributes.normal;l.push(p)}if(s){const p=A.COLOR_0!==void 0?t.getDependency("accessor",A.COLOR_0):r.attributes.color;h.push(p)}}return Promise.all([Promise.all(o),Promise.all(l),Promise.all(h)]).then(function(u){const d=u[0],A=u[1],p=u[2];return n&&(r.morphAttributes.position=d),i&&(r.morphAttributes.normal=A),s&&(r.morphAttributes.color=p),r.morphTargetsRelative=!0,r})}function LN(r,e){if(r.updateMorphTargets(),e.weights!==void 0)for(let t=0,n=e.weights.length;t<n;t++)r.morphTargetInfluences[t]=e.weights[t];if(e.extras&&Array.isArray(e.extras.targetNames)){const t=e.extras.targetNames;if(r.morphTargetInfluences.length===t.length){r.morphTargetDictionary={};for(let n=0,i=t.length;n<i;n++)r.morphTargetDictionary[t[n]]=n}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function NN(r){let e;const t=r.extensions&&r.extensions[wt.KHR_DRACO_MESH_COMPRESSION];if(t?e="draco:"+t.bufferView+":"+t.indices+":"+Tg(t.attributes):e=r.indices+":"+Tg(r.attributes)+":"+r.mode,r.targets!==void 0)for(let n=0,i=r.targets.length;n<i;n++)e+=":"+Tg(r.targets[n]);return e}function Tg(r){let e="";const t=Object.keys(r).sort();for(let n=0,i=t.length;n<i;n++)e+=t[n]+":"+r[t[n]]+";";return e}function Bg(r){switch(r){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}function UN(r){return r.search(/\.jpe?g($|\?)/i)>0||r.search(/^data\:image\/jpeg/)===0?"image/jpeg":r.search(/\.webp($|\?)/i)>0||r.search(/^data\:image\/webp/)===0?"image/webp":"image/png"}const PN=new rt;class kN{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new aN,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let n=!1,i=!1,s=-1;typeof navigator<"u"&&(n=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)===!0,i=navigator.userAgent.indexOf("Firefox")>-1,s=i?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),typeof createImageBitmap>"u"||n||i&&s<98?this.textureLoader=new fx(this.options.manager):this.textureLoader=new j8(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new kl(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const n=this,i=this.json,s=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(o){return o._markDefs&&o._markDefs()}),Promise.all(this._invokeAll(function(o){return o.beforeRoot&&o.beforeRoot()})).then(function(){return Promise.all([n.getDependencies("scene"),n.getDependencies("animation"),n.getDependencies("camera")])}).then(function(o){const l={scene:o[0][i.scene||0],scenes:o[0],animations:o[1],cameras:o[2],asset:i.asset,parser:n,userData:{}};return _o(s,l,i),ha(l,i),Promise.all(n._invokeAll(function(h){return h.afterRoot&&h.afterRoot(l)})).then(function(){for(const h of l.scenes)h.updateMatrixWorld();e(l)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],n=this.json.meshes||[];for(let i=0,s=t.length;i<s;i++){const o=t[i].joints;for(let l=0,h=o.length;l<h;l++)e[o[l]].isBone=!0}for(let i=0,s=e.length;i<s;i++){const o=e[i];o.mesh!==void 0&&(this._addNodeRef(this.meshCache,o.mesh),o.skin!==void 0&&(n[o.mesh].isSkinnedMesh=!0)),o.camera!==void 0&&this._addNodeRef(this.cameraCache,o.camera)}}_addNodeRef(e,t){t!==void 0&&(e.refs[t]===void 0&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}_getNodeRef(e,t,n){if(e.refs[t]<=1)return n;const i=n.clone(),s=(o,l)=>{const h=this.associations.get(o);h!=null&&this.associations.set(l,h);for(const[u,d]of o.children.entries())s(d,l.children[u])};return s(n,i),i.name+="_instance_"+e.uses[t]++,i}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let n=0;n<t.length;n++){const i=e(t[n]);if(i)return i}return null}_invokeAll(e){const t=Object.values(this.plugins);t.unshift(this);const n=[];for(let i=0;i<t.length;i++){const s=e(t[i]);s&&n.push(s)}return n}getDependency(e,t){const n=e+":"+t;let i=this.cache.get(n);if(!i){switch(e){case"scene":i=this.loadScene(t);break;case"node":i=this._invokeOne(function(s){return s.loadNode&&s.loadNode(t)});break;case"mesh":i=this._invokeOne(function(s){return s.loadMesh&&s.loadMesh(t)});break;case"accessor":i=this.loadAccessor(t);break;case"bufferView":i=this._invokeOne(function(s){return s.loadBufferView&&s.loadBufferView(t)});break;case"buffer":i=this.loadBuffer(t);break;case"material":i=this._invokeOne(function(s){return s.loadMaterial&&s.loadMaterial(t)});break;case"texture":i=this._invokeOne(function(s){return s.loadTexture&&s.loadTexture(t)});break;case"skin":i=this.loadSkin(t);break;case"animation":i=this._invokeOne(function(s){return s.loadAnimation&&s.loadAnimation(t)});break;case"camera":i=this.loadCamera(t);break;default:if(i=this._invokeOne(function(s){return s!=this&&s.getDependency&&s.getDependency(e,t)}),!i)throw new Error("Unknown type: "+e);break}this.cache.add(n,i)}return i}getDependencies(e){let t=this.cache.get(e);if(!t){const n=this,i=this.json[e+(e==="mesh"?"es":"s")]||[];t=Promise.all(i.map(function(s,o){return n.getDependency(e,o)})),this.cache.add(e,t)}return t}loadBuffer(e){const t=this.json.buffers[e],n=this.fileLoader;if(t.type&&t.type!=="arraybuffer")throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(t.uri===void 0&&e===0)return Promise.resolve(this.extensions[wt.KHR_BINARY_GLTF].body);const i=this.options;return new Promise(function(s,o){n.load(Cu.resolveURL(t.uri,i.path),s,void 0,function(){o(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))})})}loadBufferView(e){const t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then(function(n){const i=t.byteLength||0,s=t.byteOffset||0;return n.slice(s,s+i)})}loadAccessor(e){const t=this,n=this.json,i=this.json.accessors[e];if(i.bufferView===void 0&&i.sparse===void 0){const o=Cg[i.type],l=Ql[i.componentType],h=i.normalized===!0,u=new l(i.count*o);return Promise.resolve(new zr(u,o,h))}const s=[];return i.bufferView!==void 0?s.push(this.getDependency("bufferView",i.bufferView)):s.push(null),i.sparse!==void 0&&(s.push(this.getDependency("bufferView",i.sparse.indices.bufferView)),s.push(this.getDependency("bufferView",i.sparse.values.bufferView))),Promise.all(s).then(function(o){const l=o[0],h=Cg[i.type],u=Ql[i.componentType],d=u.BYTES_PER_ELEMENT,A=d*h,p=i.byteOffset||0,g=i.bufferView!==void 0?n.bufferViews[i.bufferView].byteStride:void 0,_=i.normalized===!0;let E,m;if(g&&g!==A){const v=Math.floor(p/g),w="InterleavedBuffer:"+i.bufferView+":"+i.componentType+":"+v+":"+i.count;let x=t.cache.get(w);x||(E=new u(l,v*g,i.count*g/d),x=new p8(E,g/d),t.cache.add(w,x)),m=new cg(x,h,p%g/d,_)}else l===null?E=new u(i.count*h):E=new u(l,p,i.count*h),m=new zr(E,h,_);if(i.sparse!==void 0){const v=Cg.SCALAR,w=Ql[i.sparse.indices.componentType],x=i.sparse.indices.byteOffset||0,I=i.sparse.values.byteOffset||0,R=new w(o[1],x,i.sparse.count*v),S=new u(o[2],I,i.sparse.count*h);l!==null&&(m=new zr(m.array.slice(),m.itemSize,m.normalized));for(let T=0,D=R.length;T<D;T++){const b=R[T];if(m.setX(b,S[T*h]),h>=2&&m.setY(b,S[T*h+1]),h>=3&&m.setZ(b,S[T*h+2]),h>=4&&m.setW(b,S[T*h+3]),h>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return m})}loadTexture(e){const t=this.json,n=this.options,i=t.textures[e].source,s=t.images[i];let o=this.textureLoader;if(s.uri){const l=n.manager.getHandler(s.uri);l!==null&&(o=l)}return this.loadTextureImage(e,i,o)}loadTextureImage(e,t,n){const i=this,s=this.json,o=s.textures[e],l=s.images[t],h=(l.uri||l.bufferView)+":"+o.sampler;if(this.textureCache[h])return this.textureCache[h];const u=this.loadImageSource(t,n).then(function(d){d.flipY=!1,d.name=o.name||l.name||"",d.name===""&&typeof l.uri=="string"&&l.uri.startsWith("data:image/")===!1&&(d.name=l.uri);const A=(s.samplers||{})[o.sampler]||{};return d.magFilter=bx[A.magFilter]||gr,d.minFilter=bx[A.minFilter]||Ci,d.wrapS=Rx[A.wrapS]||$s,d.wrapT=Rx[A.wrapT]||$s,i.associations.set(d,{textures:e}),d}).catch(function(){return null});return this.textureCache[h]=u,u}loadImageSource(e,t){const n=this,i=this.json,s=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(A=>A.clone());const o=i.images[e],l=self.URL||self.webkitURL;let h=o.uri||"",u=!1;if(o.bufferView!==void 0)h=n.getDependency("bufferView",o.bufferView).then(function(A){u=!0;const p=new Blob([A],{type:o.mimeType});return h=l.createObjectURL(p),h});else if(o.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const d=Promise.resolve(h).then(function(A){return new Promise(function(p,g){let _=p;t.isImageBitmapLoader===!0&&(_=function(E){const m=new br(E);m.needsUpdate=!0,p(m)}),t.load(Cu.resolveURL(A,s.path),_,void 0,g)})}).then(function(A){return u===!0&&l.revokeObjectURL(h),A.userData.mimeType=o.mimeType||UN(o.uri),A}).catch(function(A){throw console.error("THREE.GLTFLoader: Couldn't load texture",h),A});return this.sourceCache[e]=d,d}assignTexture(e,t,n,i){const s=this;return this.getDependency("texture",n.index).then(function(o){if(!o)return null;if(n.texCoord!==void 0&&n.texCoord>0&&(o=o.clone(),o.channel=n.texCoord),s.extensions[wt.KHR_TEXTURE_TRANSFORM]){const l=n.extensions!==void 0?n.extensions[wt.KHR_TEXTURE_TRANSFORM]:void 0;if(l){const h=s.associations.get(o);o=s.extensions[wt.KHR_TEXTURE_TRANSFORM].extendTexture(o,l),s.associations.set(o,h)}}return i!==void 0&&(o.colorSpace=i),e[t]=o,o})}assignFinalMaterial(e){const t=e.geometry;let n=e.material;const i=t.attributes.tangent===void 0,s=t.attributes.color!==void 0,o=t.attributes.normal===void 0;if(e.isPoints){const l="PointsMaterial:"+n.uuid;let h=this.cache.get(l);h||(h=new ax,Xi.prototype.copy.call(h,n),h.color.copy(n.color),h.map=n.map,h.sizeAttenuation=!1,this.cache.add(l,h)),n=h}else if(e.isLine){const l="LineBasicMaterial:"+n.uuid;let h=this.cache.get(l);h||(h=new ex,Xi.prototype.copy.call(h,n),h.color.copy(n.color),h.map=n.map,this.cache.add(l,h)),n=h}if(i||s||o){let l="ClonedMaterial:"+n.uuid+":";i&&(l+="derivative-tangents:"),s&&(l+="vertex-colors:"),o&&(l+="flat-shading:");let h=this.cache.get(l);h||(h=n.clone(),s&&(h.vertexColors=!0),o&&(h.flatShading=!0),i&&(h.normalScale&&(h.normalScale.y*=-1),h.clearcoatNormalScale&&(h.clearcoatNormalScale.y*=-1)),this.cache.add(l,h),this.associations.set(h,this.associations.get(n))),n=h}e.material=n}getMaterialType(){return mg}loadMaterial(e){const t=this,n=this.json,i=this.extensions,s=n.materials[e];let o;const l={},h=s.extensions||{},u=[];if(h[wt.KHR_MATERIALS_UNLIT]){const A=i[wt.KHR_MATERIALS_UNLIT];o=A.getMaterialType(),u.push(A.extendParams(l,s,t))}else{const A=s.pbrMetallicRoughness||{};if(l.color=new Ve(1,1,1),l.opacity=1,Array.isArray(A.baseColorFactor)){const p=A.baseColorFactor;l.color.setRGB(p[0],p[1],p[2],cr),l.opacity=p[3]}A.baseColorTexture!==void 0&&u.push(t.assignTexture(l,"map",A.baseColorTexture,Fr)),l.metalness=A.metallicFactor!==void 0?A.metallicFactor:1,l.roughness=A.roughnessFactor!==void 0?A.roughnessFactor:1,A.metallicRoughnessTexture!==void 0&&(u.push(t.assignTexture(l,"metalnessMap",A.metallicRoughnessTexture)),u.push(t.assignTexture(l,"roughnessMap",A.metallicRoughnessTexture))),o=this._invokeOne(function(p){return p.getMaterialType&&p.getMaterialType(e)}),u.push(Promise.all(this._invokeAll(function(p){return p.extendMaterialParams&&p.extendMaterialParams(e,l)})))}s.doubleSided===!0&&(l.side=wi);const d=s.alphaMode||Sg.OPAQUE;if(d===Sg.BLEND?(l.transparent=!0,l.depthWrite=!1):(l.transparent=!1,d===Sg.MASK&&(l.alphaTest=s.alphaCutoff!==void 0?s.alphaCutoff:.5)),s.normalTexture!==void 0&&o!==Ki&&(u.push(t.assignTexture(l,"normalMap",s.normalTexture)),l.normalScale=new Ue(1,1),s.normalTexture.scale!==void 0)){const A=s.normalTexture.scale;l.normalScale.set(A,A)}if(s.occlusionTexture!==void 0&&o!==Ki&&(u.push(t.assignTexture(l,"aoMap",s.occlusionTexture)),s.occlusionTexture.strength!==void 0&&(l.aoMapIntensity=s.occlusionTexture.strength)),s.emissiveFactor!==void 0&&o!==Ki){const A=s.emissiveFactor;l.emissive=new Ve().setRGB(A[0],A[1],A[2],cr)}return s.emissiveTexture!==void 0&&o!==Ki&&u.push(t.assignTexture(l,"emissiveMap",s.emissiveTexture,Fr)),Promise.all(u).then(function(){const A=new o(l);return s.name&&(A.name=s.name),ha(A,s),t.associations.set(A,{materials:e}),s.extensions&&_o(i,A,s),A})}createUniqueName(e){const t=Pt.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,n=this.extensions,i=this.primitiveCache;function s(l){return n[wt.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(l,t).then(function(h){return Dx(h,l,t)})}const o=[];for(let l=0,h=e.length;l<h;l++){const u=e[l],d=NN(u),A=i[d];if(A)o.push(A.promise);else{let p;u.extensions&&u.extensions[wt.KHR_DRACO_MESH_COMPRESSION]?p=s(u):p=Dx(new Vn,u,t),i[d]={primitive:u,promise:p},o.push(p)}}return Promise.all(o)}loadMesh(e){const t=this,n=this.json,i=this.extensions,s=n.meshes[e],o=s.primitives,l=[];for(let h=0,u=o.length;h<u;h++){const d=o[h].material===void 0?RN(this.cache):this.getDependency("material",o[h].material);l.push(d)}return l.push(t.loadGeometries(o)),Promise.all(l).then(function(h){const u=h.slice(0,h.length-1),d=h[h.length-1],A=[];for(let g=0,_=d.length;g<_;g++){const E=d[g],m=o[g];let v;const w=u[g];if(m.mode===si.TRIANGLES||m.mode===si.TRIANGLE_STRIP||m.mode===si.TRIANGLE_FAN||m.mode===void 0)v=s.isSkinnedMesh===!0?new g8(E,w):new Xr(E,w),v.isSkinnedMesh===!0&&v.normalizeSkinWeights(),m.mode===si.TRIANGLE_STRIP?v.geometry=Mx(v.geometry,LE):m.mode===si.TRIANGLE_FAN&&(v.geometry=Mx(v.geometry,RA));else if(m.mode===si.LINES)v=new y8(E,w);else if(m.mode===si.LINE_STRIP)v=new Ag(E,w);else if(m.mode===si.LINE_LOOP)v=new E8(E,w);else if(m.mode===si.POINTS)v=new x8(E,w);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+m.mode);Object.keys(v.geometry.morphAttributes).length>0&&LN(v,s),v.name=t.createUniqueName(s.name||"mesh_"+e),ha(v,s),m.extensions&&_o(i,v,m),t.assignFinalMaterial(v),A.push(v)}for(let g=0,_=A.length;g<_;g++)t.associations.set(A[g],{meshes:e,primitives:g});if(A.length===1)return s.extensions&&_o(i,A[0],s),A[0];const p=new oa;s.extensions&&_o(i,p,s),t.associations.set(p,{meshes:e});for(let g=0,_=A.length;g<_;g++)p.add(A[g]);return p})}loadCamera(e){let t;const n=this.json.cameras[e],i=n[n.type];if(!i){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return n.type==="perspective"?t=new dn(NA.radToDeg(i.yfov),i.aspectRatio||1,i.znear||1,i.zfar||2e6):n.type==="orthographic"&&(t=new _u(-i.xmag,i.xmag,i.ymag,-i.ymag,i.znear,i.zfar)),n.name&&(t.name=this.createUniqueName(n.name)),ha(t,n),Promise.resolve(t)}loadSkin(e){const t=this.json.skins[e],n=[];for(let i=0,s=t.joints.length;i<s;i++)n.push(this._loadNodeShallow(t.joints[i]));return t.inverseBindMatrices!==void 0?n.push(this.getDependency("accessor",t.inverseBindMatrices)):n.push(null),Promise.all(n).then(function(i){const s=i.pop(),o=i,l=[],h=[];for(let u=0,d=o.length;u<d;u++){const A=o[u];if(A){l.push(A);const p=new rt;s!==null&&p.fromArray(s.array,u*16),h.push(p)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[u])}return new dg(l,h)})}loadAnimation(e){const t=this.json,n=this,i=t.animations[e],s=i.name?i.name:"animation_"+e,o=[],l=[],h=[],u=[],d=[];for(let A=0,p=i.channels.length;A<p;A++){const g=i.channels[A],_=i.samplers[g.sampler],E=g.target,m=E.node,v=i.parameters!==void 0?i.parameters[_.input]:_.input,w=i.parameters!==void 0?i.parameters[_.output]:_.output;E.node!==void 0&&(o.push(this.getDependency("node",m)),l.push(this.getDependency("accessor",v)),h.push(this.getDependency("accessor",w)),u.push(_),d.push(E))}return Promise.all([Promise.all(o),Promise.all(l),Promise.all(h),Promise.all(u),Promise.all(d)]).then(function(A){const p=A[0],g=A[1],_=A[2],E=A[3],m=A[4],v=[];for(let w=0,x=p.length;w<x;w++){const I=p[w],R=g[w],S=_[w],T=E[w],D=m[w];if(I===void 0)continue;I.updateMatrix&&I.updateMatrix();const b=n._createAnimationTracks(I,R,S,T,D);if(b)for(let M=0;M<b.length;M++)v.push(b[M])}return new D8(s,void 0,v)})}createNodeMesh(e){const t=this.json,n=this,i=t.nodes[e];return i.mesh===void 0?null:n.getDependency("mesh",i.mesh).then(function(s){const o=n._getNodeRef(n.meshCache,i.mesh,s);return i.weights!==void 0&&o.traverse(function(l){if(l.isMesh)for(let h=0,u=i.weights.length;h<u;h++)l.morphTargetInfluences[h]=i.weights[h]}),o})}loadNode(e){const t=this.json,n=this,i=t.nodes[e],s=n._loadNodeShallow(e),o=[],l=i.children||[];for(let u=0,d=l.length;u<d;u++)o.push(n.getDependency("node",l[u]));const h=i.skin===void 0?Promise.resolve(null):n.getDependency("skin",i.skin);return Promise.all([s,Promise.all(o),h]).then(function(u){const d=u[0],A=u[1],p=u[2];p!==null&&d.traverse(function(g){g.isSkinnedMesh&&g.bind(p,PN)});for(let g=0,_=A.length;g<_;g++)d.add(A[g]);return d})}_loadNodeShallow(e){const t=this.json,n=this.extensions,i=this;if(this.nodeCache[e]!==void 0)return this.nodeCache[e];const s=t.nodes[e],o=s.name?i.createUniqueName(s.name):"",l=[],h=i._invokeOne(function(u){return u.createNodeMesh&&u.createNodeMesh(e)});return h&&l.push(h),s.camera!==void 0&&l.push(i.getDependency("camera",s.camera).then(function(u){return i._getNodeRef(i.cameraCache,s.camera,u)})),i._invokeAll(function(u){return u.createNodeAttachment&&u.createNodeAttachment(e)}).forEach(function(u){l.push(u)}),this.nodeCache[e]=Promise.all(l).then(function(u){let d;if(s.isBone===!0?d=new K2:u.length>1?d=new oa:u.length===1?d=u[0]:d=new Zt,d!==u[0])for(let A=0,p=u.length;A<p;A++)d.add(u[A]);if(s.name&&(d.userData.name=s.name,d.name=o),ha(d,s),s.extensions&&_o(n,d,s),s.matrix!==void 0){const A=new rt;A.fromArray(s.matrix),d.applyMatrix4(A)}else s.translation!==void 0&&d.position.fromArray(s.translation),s.rotation!==void 0&&d.quaternion.fromArray(s.rotation),s.scale!==void 0&&d.scale.fromArray(s.scale);return i.associations.has(d)||i.associations.set(d,{}),i.associations.get(d).nodes=e,d}),this.nodeCache[e]}loadScene(e){const t=this.extensions,n=this.json.scenes[e],i=this,s=new oa;n.name&&(s.name=i.createUniqueName(n.name)),ha(s,n),n.extensions&&_o(t,s,n);const o=n.nodes||[],l=[];for(let h=0,u=o.length;h<u;h++)l.push(i.getDependency("node",o[h]));return Promise.all(l).then(function(h){for(let d=0,A=h.length;d<A;d++)s.add(h[d]);const u=d=>{const A=new Map;for(const[p,g]of i.associations)(p instanceof Xi||p instanceof br)&&A.set(p,g);return d.traverse(p=>{const g=i.associations.get(p);g!=null&&A.set(p,g)}),A};return i.associations=u(s),s})}_createAnimationTracks(e,t,n,i,s){const o=[],l=e.name?e.name:e.uuid,h=[];ua[s.path]===ua.weights?e.traverse(function(p){p.morphTargetInfluences&&h.push(p.name?p.name:p.uuid)}):h.push(l);let u;switch(ua[s.path]){case ua.weights:u=Nl;break;case ua.rotation:u=vo;break;case ua.position:case ua.scale:u=Pl;break;default:switch(n.itemSize){case 1:u=Nl;break;case 2:case 3:default:u=Pl;break}break}const d=i.interpolation!==void 0?bN[i.interpolation]:ll,A=this._getArrayFromAccessor(n);for(let p=0,g=h.length;p<g;p++){const _=new u(h[p]+"."+ua[s.path],t.array,A,d);i.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(_),o.push(_)}return o}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){const n=Bg(t.constructor),i=new Float32Array(t.length);for(let s=0,o=t.length;s<o;s++)i[s]=t[s]*n;t=i}return t}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(t){const n=this instanceof vo?BN:Bx;return new n(this.times,this.values,this.getValueSize()/3,t)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function QN(r,e,t){const n=e.attributes,i=new _r;if(n.POSITION!==void 0){const l=t.json.accessors[n.POSITION],h=l.min,u=l.max;if(h!==void 0&&u!==void 0){if(i.set(new G(h[0],h[1],h[2]),new G(u[0],u[1],u[2])),l.normalized){const d=Bg(Ql[l.componentType]);i.min.multiplyScalar(d),i.max.multiplyScalar(d)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const s=e.targets;if(s!==void 0){const l=new G,h=new G;for(let u=0,d=s.length;u<d;u++){const A=s[u];if(A.POSITION!==void 0){const p=t.json.accessors[A.POSITION],g=p.min,_=p.max;if(g!==void 0&&_!==void 0){if(h.setX(Math.max(Math.abs(g[0]),Math.abs(_[0]))),h.setY(Math.max(Math.abs(g[1]),Math.abs(_[1]))),h.setZ(Math.max(Math.abs(g[2]),Math.abs(_[2]))),p.normalized){const E=Bg(Ql[p.componentType]);h.multiplyScalar(E)}l.max(h)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}i.expandByVector(l)}r.boundingBox=i;const o=new bi;i.getCenter(o.center),o.radius=i.min.distanceTo(i.max)/2,r.boundingSphere=o}function Dx(r,e,t){const n=e.attributes,i=[];function s(o,l){return t.getDependency("accessor",o).then(function(h){r.setAttribute(l,h)})}for(const o in n){const l=Mg[o]||o.toLowerCase();l in r.attributes||i.push(s(n[o],l))}if(e.indices!==void 0&&!r.index){const o=t.getDependency("accessor",e.indices).then(function(l){r.setIndex(l)});i.push(o)}return Tt.workingColorSpace!==cr&&"COLOR_0"in n&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${Tt.workingColorSpace}" not supported.`),ha(r,e),QN(r,e,t),Promise.all(i).then(function(){return e.targets!==void 0?DN(r,e.targets,t):r})}class ON{constructor(e=4){this.pool=e,this.queue=[],this.workers=[],this.workersResolve=[],this.workerStatus=0}_initWorker(e){if(!this.workers[e]){const t=this.workerCreator();t.addEventListener("message",this._onMessage.bind(this,e)),this.workers[e]=t}}_getIdleWorker(){for(let e=0;e<this.pool;e++)if(!(this.workerStatus&1<<e))return e;return-1}_onMessage(e,t){const n=this.workersResolve[e];if(n&&n(t),this.queue.length){const{resolve:i,msg:s,transfer:o}=this.queue.shift();this.workersResolve[e]=i,this.workers[e].postMessage(s,o)}else this.workerStatus^=1<<e}setWorkerCreator(e){this.workerCreator=e}setWorkerLimit(e){this.pool=e}postMessage(e,t){return new Promise(n=>{const i=this._getIdleWorker();i!==-1?(this._initWorker(i),this.workerStatus|=1<<i,this.workersResolve[i]=n,this.workers[i].postMessage(e,t)):this.queue.push({resolve:n,msg:e,transfer:t})})}dispose(){this.workers.forEach(e=>e.terminate()),this.workersResolve.length=0,this.workers.length=0,this.queue.length=0,this.workerStatus=0}}const FN=0,Lx=2,zN=1,Nx=2,HN=0,GN=1,VN=10,jN=0,Ux=9,Px=15,kx=16,Qx=22,Ox=37,Fx=43,zx=76,Hx=83,Gx=97,Vx=100,jx=103,Wx=109,Yx=165,qx=166;class WN{constructor(){this.vkFormat=0,this.typeSize=1,this.pixelWidth=0,this.pixelHeight=0,this.pixelDepth=0,this.layerCount=0,this.faceCount=1,this.supercompressionScheme=0,this.levels=[],this.dataFormatDescriptor=[{vendorId:0,descriptorType:0,descriptorBlockSize:0,versionNumber:2,colorModel:0,colorPrimaries:1,transferFunction:2,flags:0,texelBlockDimension:[0,0,0,0],bytesPlane:[0,0,0,0,0,0,0,0],samples:[]}],this.keyValue={},this.globalData=null}}class Su{constructor(e,t,n,i){this._dataView=new DataView(e.buffer,e.byteOffset+t,n),this._littleEndian=i,this._offset=0}_nextUint8(){const e=this._dataView.getUint8(this._offset);return this._offset+=1,e}_nextUint16(){const e=this._dataView.getUint16(this._offset,this._littleEndian);return this._offset+=2,e}_nextUint32(){const e=this._dataView.getUint32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint64(){const e=this._dataView.getUint32(this._offset,this._littleEndian)+4294967296*this._dataView.getUint32(this._offset+4,this._littleEndian);return this._offset+=8,e}_nextInt32(){const e=this._dataView.getInt32(this._offset,this._littleEndian);return this._offset+=4,e}_skip(e){return this._offset+=e,this}_scan(e,t=0){const n=this._offset;let i=0;for(;this._dataView.getUint8(this._offset)!==t&&i<e;)i++,this._offset++;return i<e&&this._offset++,new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+n,i)}}const pn=[171,75,84,88,32,50,48,187,13,10,26,10];function Xx(r){return typeof TextDecoder<"u"?new TextDecoder().decode(r):Buffer.from(r).toString("utf8")}function YN(r){const e=new Uint8Array(r.buffer,r.byteOffset,pn.length);if(e[0]!==pn[0]||e[1]!==pn[1]||e[2]!==pn[2]||e[3]!==pn[3]||e[4]!==pn[4]||e[5]!==pn[5]||e[6]!==pn[6]||e[7]!==pn[7]||e[8]!==pn[8]||e[9]!==pn[9]||e[10]!==pn[10]||e[11]!==pn[11])throw new Error("Missing KTX 2.0 identifier.");const t=new WN,n=17*Uint32Array.BYTES_PER_ELEMENT,i=new Su(r,pn.length,n,!0);t.vkFormat=i._nextUint32(),t.typeSize=i._nextUint32(),t.pixelWidth=i._nextUint32(),t.pixelHeight=i._nextUint32(),t.pixelDepth=i._nextUint32(),t.layerCount=i._nextUint32(),t.faceCount=i._nextUint32();const s=i._nextUint32();t.supercompressionScheme=i._nextUint32();const o=i._nextUint32(),l=i._nextUint32(),h=i._nextUint32(),u=i._nextUint32(),d=i._nextUint64(),A=i._nextUint64(),p=new Su(r,pn.length+n,3*s*8,!0);for(let te=0;te<s;te++)t.levels.push({levelData:new Uint8Array(r.buffer,r.byteOffset+p._nextUint64(),p._nextUint64()),uncompressedByteLength:p._nextUint64()});const g=new Su(r,o,l,!0),_={vendorId:g._skip(4)._nextUint16(),descriptorType:g._nextUint16(),versionNumber:g._nextUint16(),descriptorBlockSize:g._nextUint16(),colorModel:g._nextUint8(),colorPrimaries:g._nextUint8(),transferFunction:g._nextUint8(),flags:g._nextUint8(),texelBlockDimension:[g._nextUint8(),g._nextUint8(),g._nextUint8(),g._nextUint8()],bytesPlane:[g._nextUint8(),g._nextUint8(),g._nextUint8(),g._nextUint8(),g._nextUint8(),g._nextUint8(),g._nextUint8(),g._nextUint8()],samples:[]},E=(_.descriptorBlockSize/4-6)/4;for(let te=0;te<E;te++){const V={bitOffset:g._nextUint16(),bitLength:g._nextUint8(),channelType:g._nextUint8(),samplePosition:[g._nextUint8(),g._nextUint8(),g._nextUint8(),g._nextUint8()],sampleLower:-1/0,sampleUpper:1/0};64&V.channelType?(V.sampleLower=g._nextInt32(),V.sampleUpper=g._nextInt32()):(V.sampleLower=g._nextUint32(),V.sampleUpper=g._nextUint32()),_.samples[te]=V}t.dataFormatDescriptor.length=0,t.dataFormatDescriptor.push(_);const m=new Su(r,h,u,!0);for(;m._offset<u;){const te=m._nextUint32(),V=m._scan(te),ee=Xx(V),Q=m._scan(te-V.byteLength);t.keyValue[ee]=ee.match(/^ktx/i)?Xx(Q):Q,m._offset%4&&m._skip(4-m._offset%4)}if(A<=0)return t;const v=new Su(r,d,A,!0),w=v._nextUint16(),x=v._nextUint16(),I=v._nextUint32(),R=v._nextUint32(),S=v._nextUint32(),T=v._nextUint32(),D=[];for(let te=0;te<s;te++)D.push({imageFlags:v._nextUint32(),rgbSliceByteOffset:v._nextUint32(),rgbSliceByteLength:v._nextUint32(),alphaSliceByteOffset:v._nextUint32(),alphaSliceByteLength:v._nextUint32()});const b=d+v._offset,M=b+I,L=M+R,P=L+S,N=new Uint8Array(r.buffer,r.byteOffset+b,I),W=new Uint8Array(r.buffer,r.byteOffset+M,R),X=new Uint8Array(r.buffer,r.byteOffset+L,S),K=new Uint8Array(r.buffer,r.byteOffset+P,T);return t.globalData={endpointCount:w,selectorCount:x,imageDescs:D,endpointsData:N,selectorsData:W,tablesData:X,extendedData:K},t}let bg,Ss,Rg;const Dg={env:{emscripten_notify_memory_growth:function(r){Rg=new Uint8Array(Ss.exports.memory.buffer)}}};class qN{init(){return bg||(bg=typeof fetch<"u"?fetch("data:application/wasm;base64,"+Kx).then(e=>e.arrayBuffer()).then(e=>WebAssembly.instantiate(e,Dg)).then(this._init):WebAssembly.instantiate(Buffer.from(Kx,"base64"),Dg).then(this._init),bg)}_init(e){Ss=e.instance,Dg.env.emscripten_notify_memory_growth(0)}decode(e,t=0){if(!Ss)throw new Error("ZSTDDecoder: Await .init() before decoding.");const n=e.byteLength,i=Ss.exports.malloc(n);Rg.set(e,i),t=t||Number(Ss.exports.ZSTD_findDecompressedSize(i,n));const s=Ss.exports.malloc(t),o=Ss.exports.ZSTD_decompress(s,t,i,n),l=Rg.slice(s,s+o);return Ss.exports.free(i),Ss.exports.free(s),l}}const Kx="AGFzbQEAAAABpQEVYAF/AX9gAn9/AGADf39/AX9gBX9/f39/AX9gAX8AYAJ/fwF/YAR/f39/AX9gA39/fwBgBn9/f39/fwF/YAd/f39/f39/AX9gAn9/AX5gAn5+AX5gAABgBX9/f39/AGAGf39/f39/AGAIf39/f39/f38AYAl/f39/f39/f38AYAABf2AIf39/f39/f38Bf2ANf39/f39/f39/f39/fwF/YAF/AX4CJwEDZW52H2Vtc2NyaXB0ZW5fbm90aWZ5X21lbW9yeV9ncm93dGgABANpaAEFAAAFAgEFCwACAQABAgIFBQcAAwABDgsBAQcAEhMHAAUBDAQEAAANBwQCAgYCBAgDAwMDBgEACQkHBgICAAYGAgQUBwYGAwIGAAMCAQgBBwUGCgoEEQAEBAEIAwgDBQgDEA8IAAcABAUBcAECAgUEAQCAAgYJAX8BQaCgwAILB2AHBm1lbW9yeQIABm1hbGxvYwAoBGZyZWUAJgxaU1REX2lzRXJyb3IAaBlaU1REX2ZpbmREZWNvbXByZXNzZWRTaXplAFQPWlNURF9kZWNvbXByZXNzAEoGX3N0YXJ0ACQJBwEAQQELASQKussBaA8AIAAgACgCBCABajYCBAsZACAAKAIAIAAoAgRBH3F0QQAgAWtBH3F2CwgAIABBiH9LC34BBH9BAyEBIAAoAgQiA0EgTQRAIAAoAggiASAAKAIQTwRAIAAQDQ8LIAAoAgwiAiABRgRAQQFBAiADQSBJGw8LIAAgASABIAJrIANBA3YiBCABIARrIAJJIgEbIgJrIgQ2AgggACADIAJBA3RrNgIEIAAgBCgAADYCAAsgAQsUAQF/IAAgARACIQIgACABEAEgAgv3AQECfyACRQRAIABCADcCACAAQQA2AhAgAEIANwIIQbh/DwsgACABNgIMIAAgAUEEajYCECACQQRPBEAgACABIAJqIgFBfGoiAzYCCCAAIAMoAAA2AgAgAUF/ai0AACIBBEAgAEEIIAEQFGs2AgQgAg8LIABBADYCBEF/DwsgACABNgIIIAAgAS0AACIDNgIAIAJBfmoiBEEBTQRAIARBAWtFBEAgACABLQACQRB0IANyIgM2AgALIAAgAS0AAUEIdCADajYCAAsgASACakF/ai0AACIBRQRAIABBADYCBEFsDwsgAEEoIAEQFCACQQN0ams2AgQgAgsWACAAIAEpAAA3AAAgACABKQAINwAICy8BAX8gAUECdEGgHWooAgAgACgCAEEgIAEgACgCBGprQR9xdnEhAiAAIAEQASACCyEAIAFCz9bTvtLHq9lCfiAAfEIfiUKHla+vmLbem55/fgsdAQF/IAAoAgggACgCDEYEfyAAKAIEQSBGBUEACwuCBAEDfyACQYDAAE8EQCAAIAEgAhBnIAAPCyAAIAJqIQMCQCAAIAFzQQNxRQRAAkAgAkEBSARAIAAhAgwBCyAAQQNxRQRAIAAhAgwBCyAAIQIDQCACIAEtAAA6AAAgAUEBaiEBIAJBAWoiAiADTw0BIAJBA3ENAAsLAkAgA0F8cSIEQcAASQ0AIAIgBEFAaiIFSw0AA0AgAiABKAIANgIAIAIgASgCBDYCBCACIAEoAgg2AgggAiABKAIMNgIMIAIgASgCEDYCECACIAEoAhQ2AhQgAiABKAIYNgIYIAIgASgCHDYCHCACIAEoAiA2AiAgAiABKAIkNgIkIAIgASgCKDYCKCACIAEoAiw2AiwgAiABKAIwNgIwIAIgASgCNDYCNCACIAEoAjg2AjggAiABKAI8NgI8IAFBQGshASACQUBrIgIgBU0NAAsLIAIgBE8NAQNAIAIgASgCADYCACABQQRqIQEgAkEEaiICIARJDQALDAELIANBBEkEQCAAIQIMAQsgA0F8aiIEIABJBEAgACECDAELIAAhAgNAIAIgAS0AADoAACACIAEtAAE6AAEgAiABLQACOgACIAIgAS0AAzoAAyABQQRqIQEgAkEEaiICIARNDQALCyACIANJBEADQCACIAEtAAA6AAAgAUEBaiEBIAJBAWoiAiADRw0ACwsgAAsMACAAIAEpAAA3AAALQQECfyAAKAIIIgEgACgCEEkEQEEDDwsgACAAKAIEIgJBB3E2AgQgACABIAJBA3ZrIgE2AgggACABKAAANgIAQQALDAAgACABKAIANgAAC/cCAQJ/AkAgACABRg0AAkAgASACaiAASwRAIAAgAmoiBCABSw0BCyAAIAEgAhALDwsgACABc0EDcSEDAkACQCAAIAFJBEAgAwRAIAAhAwwDCyAAQQNxRQRAIAAhAwwCCyAAIQMDQCACRQ0EIAMgAS0AADoAACABQQFqIQEgAkF/aiECIANBAWoiA0EDcQ0ACwwBCwJAIAMNACAEQQNxBEADQCACRQ0FIAAgAkF/aiICaiIDIAEgAmotAAA6AAAgA0EDcQ0ACwsgAkEDTQ0AA0AgACACQXxqIgJqIAEgAmooAgA2AgAgAkEDSw0ACwsgAkUNAgNAIAAgAkF/aiICaiABIAJqLQAAOgAAIAINAAsMAgsgAkEDTQ0AIAIhBANAIAMgASgCADYCACABQQRqIQEgA0EEaiEDIARBfGoiBEEDSw0ACyACQQNxIQILIAJFDQADQCADIAEtAAA6AAAgA0EBaiEDIAFBAWohASACQX9qIgINAAsLIAAL8wICAn8BfgJAIAJFDQAgACACaiIDQX9qIAE6AAAgACABOgAAIAJBA0kNACADQX5qIAE6AAAgACABOgABIANBfWogAToAACAAIAE6AAIgAkEHSQ0AIANBfGogAToAACAAIAE6AAMgAkEJSQ0AIABBACAAa0EDcSIEaiIDIAFB/wFxQYGChAhsIgE2AgAgAyACIARrQXxxIgRqIgJBfGogATYCACAEQQlJDQAgAyABNgIIIAMgATYCBCACQXhqIAE2AgAgAkF0aiABNgIAIARBGUkNACADIAE2AhggAyABNgIUIAMgATYCECADIAE2AgwgAkFwaiABNgIAIAJBbGogATYCACACQWhqIAE2AgAgAkFkaiABNgIAIAQgA0EEcUEYciIEayICQSBJDQAgAa0iBUIghiAFhCEFIAMgBGohAQNAIAEgBTcDGCABIAU3AxAgASAFNwMIIAEgBTcDACABQSBqIQEgAkFgaiICQR9LDQALCyAACy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAIajYCACADCy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAFajYCACADCx8AIAAgASACKAIEEAg2AgAgARAEGiAAIAJBCGo2AgQLCAAgAGdBH3MLugUBDX8jAEEQayIKJAACfyAEQQNNBEAgCkEANgIMIApBDGogAyAEEAsaIAAgASACIApBDGpBBBAVIgBBbCAAEAMbIAAgACAESxsMAQsgAEEAIAEoAgBBAXRBAmoQECENQVQgAygAACIGQQ9xIgBBCksNABogAiAAQQVqNgIAIAMgBGoiAkF8aiEMIAJBeWohDiACQXtqIRAgAEEGaiELQQQhBSAGQQR2IQRBICAAdCIAQQFyIQkgASgCACEPQQAhAiADIQYCQANAIAlBAkggAiAPS3JFBEAgAiEHAkAgCARAA0AgBEH//wNxQf//A0YEQCAHQRhqIQcgBiAQSQR/IAZBAmoiBigAACAFdgUgBUEQaiEFIARBEHYLIQQMAQsLA0AgBEEDcSIIQQNGBEAgBUECaiEFIARBAnYhBCAHQQNqIQcMAQsLIAcgCGoiByAPSw0EIAVBAmohBQNAIAIgB0kEQCANIAJBAXRqQQA7AQAgAkEBaiECDAELCyAGIA5LQQAgBiAFQQN1aiIHIAxLG0UEQCAHKAAAIAVBB3EiBXYhBAwCCyAEQQJ2IQQLIAYhBwsCfyALQX9qIAQgAEF/anEiBiAAQQF0QX9qIgggCWsiEUkNABogBCAIcSIEQQAgESAEIABIG2shBiALCyEIIA0gAkEBdGogBkF/aiIEOwEAIAlBASAGayAEIAZBAUgbayEJA0AgCSAASARAIABBAXUhACALQX9qIQsMAQsLAn8gByAOS0EAIAcgBSAIaiIFQQN1aiIGIAxLG0UEQCAFQQdxDAELIAUgDCIGIAdrQQN0awshBSACQQFqIQIgBEUhCCAGKAAAIAVBH3F2IQQMAQsLQWwgCUEBRyAFQSBKcg0BGiABIAJBf2o2AgAgBiAFQQdqQQN1aiADawwBC0FQCyEAIApBEGokACAACwkAQQFBBSAAGwsMACAAIAEoAAA2AAALqgMBCn8jAEHwAGsiCiQAIAJBAWohDiAAQQhqIQtBgIAEIAVBf2p0QRB1IQxBACECQQEhBkEBIAV0IglBf2oiDyEIA0AgAiAORkUEQAJAIAEgAkEBdCINai8BACIHQf//A0YEQCALIAhBA3RqIAI2AgQgCEF/aiEIQQEhBwwBCyAGQQAgDCAHQRB0QRB1ShshBgsgCiANaiAHOwEAIAJBAWohAgwBCwsgACAFNgIEIAAgBjYCACAJQQN2IAlBAXZqQQNqIQxBACEAQQAhBkEAIQIDQCAGIA5GBEADQAJAIAAgCUYNACAKIAsgAEEDdGoiASgCBCIGQQF0aiICIAIvAQAiAkEBajsBACABIAUgAhAUayIIOgADIAEgAiAIQf8BcXQgCWs7AQAgASAEIAZBAnQiAmooAgA6AAIgASACIANqKAIANgIEIABBAWohAAwBCwsFIAEgBkEBdGouAQAhDUEAIQcDQCAHIA1ORQRAIAsgAkEDdGogBjYCBANAIAIgDGogD3EiAiAISw0ACyAHQQFqIQcMAQsLIAZBAWohBgwBCwsgCkHwAGokAAsjAEIAIAEQCSAAhUKHla+vmLbem55/fkLj3MqV/M7y9YV/fAsQACAAQn43AwggACABNgIACyQBAX8gAARAIAEoAgQiAgRAIAEoAgggACACEQEADwsgABAmCwsfACAAIAEgAi8BABAINgIAIAEQBBogACACQQRqNgIEC0oBAX9BoCAoAgAiASAAaiIAQX9MBEBBiCBBMDYCAEF/DwsCQCAAPwBBEHRNDQAgABBmDQBBiCBBMDYCAEF/DwtBoCAgADYCACABC9cBAQh/Qbp/IQoCQCACKAIEIgggAigCACIJaiIOIAEgAGtLDQBBbCEKIAkgBCADKAIAIgtrSw0AIAAgCWoiBCACKAIIIgxrIQ0gACABQWBqIg8gCyAJQQAQKSADIAkgC2o2AgACQAJAIAwgBCAFa00EQCANIQUMAQsgDCAEIAZrSw0CIAcgDSAFayIAaiIBIAhqIAdNBEAgBCABIAgQDxoMAgsgBCABQQAgAGsQDyEBIAIgACAIaiIINgIEIAEgAGshBAsgBCAPIAUgCEEBECkLIA4hCgsgCgubAgEBfyMAQYABayINJAAgDSADNgJ8AkAgAkEDSwRAQX8hCQwBCwJAAkACQAJAIAJBAWsOAwADAgELIAZFBEBBuH8hCQwEC0FsIQkgBS0AACICIANLDQMgACAHIAJBAnQiAmooAgAgAiAIaigCABA7IAEgADYCAEEBIQkMAwsgASAJNgIAQQAhCQwCCyAKRQRAQWwhCQwCC0EAIQkgC0UgDEEZSHINAUEIIAR0QQhqIQBBACECA0AgAiAATw0CIAJBQGshAgwAAAsAC0FsIQkgDSANQfwAaiANQfgAaiAFIAYQFSICEAMNACANKAJ4IgMgBEsNACAAIA0gDSgCfCAHIAggAxAYIAEgADYCACACIQkLIA1BgAFqJAAgCQsLACAAIAEgAhALGgsQACAALwAAIAAtAAJBEHRyCy8AAn9BuH8gAUEISQ0AGkFyIAAoAAQiAEF3Sw0AGkG4fyAAQQhqIgAgACABSxsLCwkAIAAgATsAAAsDAAELigYBBX8gACAAKAIAIgVBfnE2AgBBACAAIAVBAXZqQYQgKAIAIgQgAEYbIQECQAJAIAAoAgQiAkUNACACKAIAIgNBAXENACACQQhqIgUgA0EBdkF4aiIDQQggA0EISxtnQR9zQQJ0QYAfaiIDKAIARgRAIAMgAigCDDYCAAsgAigCCCIDBEAgAyACKAIMNgIECyACKAIMIgMEQCADIAIoAgg2AgALIAIgAigCACAAKAIAQX5xajYCAEGEICEAAkACQCABRQ0AIAEgAjYCBCABKAIAIgNBAXENASADQQF2QXhqIgNBCCADQQhLG2dBH3NBAnRBgB9qIgMoAgAgAUEIakYEQCADIAEoAgw2AgALIAEoAggiAwRAIAMgASgCDDYCBAsgASgCDCIDBEAgAyABKAIINgIAQYQgKAIAIQQLIAIgAigCACABKAIAQX5xajYCACABIARGDQAgASABKAIAQQF2akEEaiEACyAAIAI2AgALIAIoAgBBAXZBeGoiAEEIIABBCEsbZ0Efc0ECdEGAH2oiASgCACEAIAEgBTYCACACIAA2AgwgAkEANgIIIABFDQEgACAFNgIADwsCQCABRQ0AIAEoAgAiAkEBcQ0AIAJBAXZBeGoiAkEIIAJBCEsbZ0Efc0ECdEGAH2oiAigCACABQQhqRgRAIAIgASgCDDYCAAsgASgCCCICBEAgAiABKAIMNgIECyABKAIMIgIEQCACIAEoAgg2AgBBhCAoAgAhBAsgACAAKAIAIAEoAgBBfnFqIgI2AgACQCABIARHBEAgASABKAIAQQF2aiAANgIEIAAoAgAhAgwBC0GEICAANgIACyACQQF2QXhqIgFBCCABQQhLG2dBH3NBAnRBgB9qIgIoAgAhASACIABBCGoiAjYCACAAIAE2AgwgAEEANgIIIAFFDQEgASACNgIADwsgBUEBdkF4aiIBQQggAUEISxtnQR9zQQJ0QYAfaiICKAIAIQEgAiAAQQhqIgI2AgAgACABNgIMIABBADYCCCABRQ0AIAEgAjYCAAsLDgAgAARAIABBeGoQJQsLgAIBA38CQCAAQQ9qQXhxQYQgKAIAKAIAQQF2ayICEB1Bf0YNAAJAQYQgKAIAIgAoAgAiAUEBcQ0AIAFBAXZBeGoiAUEIIAFBCEsbZ0Efc0ECdEGAH2oiASgCACAAQQhqRgRAIAEgACgCDDYCAAsgACgCCCIBBEAgASAAKAIMNgIECyAAKAIMIgFFDQAgASAAKAIINgIAC0EBIQEgACAAKAIAIAJBAXRqIgI2AgAgAkEBcQ0AIAJBAXZBeGoiAkEIIAJBCEsbZ0Efc0ECdEGAH2oiAygCACECIAMgAEEIaiIDNgIAIAAgAjYCDCAAQQA2AgggAkUNACACIAM2AgALIAELtwIBA38CQAJAIABBASAAGyICEDgiAA0AAkACQEGEICgCACIARQ0AIAAoAgAiA0EBcQ0AIAAgA0EBcjYCACADQQF2QXhqIgFBCCABQQhLG2dBH3NBAnRBgB9qIgEoAgAgAEEIakYEQCABIAAoAgw2AgALIAAoAggiAQRAIAEgACgCDDYCBAsgACgCDCIBBEAgASAAKAIINgIACyACECchAkEAIQFBhCAoAgAhACACDQEgACAAKAIAQX5xNgIAQQAPCyACQQ9qQXhxIgMQHSICQX9GDQIgAkEHakF4cSIAIAJHBEAgACACaxAdQX9GDQMLAkBBhCAoAgAiAUUEQEGAICAANgIADAELIAAgATYCBAtBhCAgADYCACAAIANBAXRBAXI2AgAMAQsgAEUNAQsgAEEIaiEBCyABC7kDAQJ/IAAgA2ohBQJAIANBB0wEQANAIAAgBU8NAiAAIAItAAA6AAAgAEEBaiEAIAJBAWohAgwAAAsACyAEQQFGBEACQCAAIAJrIgZBB00EQCAAIAItAAA6AAAgACACLQABOgABIAAgAi0AAjoAAiAAIAItAAM6AAMgAEEEaiACIAZBAnQiBkHAHmooAgBqIgIQFyACIAZB4B5qKAIAayECDAELIAAgAhAMCyACQQhqIQIgAEEIaiEACwJAAkACQAJAIAUgAU0EQCAAIANqIQEgBEEBRyAAIAJrQQ9Kcg0BA0AgACACEAwgAkEIaiECIABBCGoiACABSQ0ACwwFCyAAIAFLBEAgACEBDAQLIARBAUcgACACa0EPSnINASAAIQMgAiEEA0AgAyAEEAwgBEEIaiEEIANBCGoiAyABSQ0ACwwCCwNAIAAgAhAHIAJBEGohAiAAQRBqIgAgAUkNAAsMAwsgACEDIAIhBANAIAMgBBAHIARBEGohBCADQRBqIgMgAUkNAAsLIAIgASAAa2ohAgsDQCABIAVPDQEgASACLQAAOgAAIAFBAWohASACQQFqIQIMAAALAAsLQQECfyAAIAAoArjgASIDNgLE4AEgACgCvOABIQQgACABNgK84AEgACABIAJqNgK44AEgACABIAQgA2tqNgLA4AELpgEBAX8gACAAKALs4QEQFjYCyOABIABCADcD+OABIABCADcDuOABIABBwOABakIANwMAIABBqNAAaiIBQYyAgOAANgIAIABBADYCmOIBIABCADcDiOEBIABCAzcDgOEBIABBrNABakHgEikCADcCACAAQbTQAWpB6BIoAgA2AgAgACABNgIMIAAgAEGYIGo2AgggACAAQaAwajYCBCAAIABBEGo2AgALYQEBf0G4fyEDAkAgAUEDSQ0AIAIgABAhIgFBA3YiADYCCCACIAFBAXE2AgQgAiABQQF2QQNxIgM2AgACQCADQX9qIgFBAksNAAJAIAFBAWsOAgEAAgtBbA8LIAAhAwsgAwsMACAAIAEgAkEAEC4LiAQCA38CfiADEBYhBCAAQQBBKBAQIQAgBCACSwRAIAQPCyABRQRAQX8PCwJAAkAgA0EBRg0AIAEoAAAiBkGo6r5pRg0AQXYhAyAGQXBxQdDUtMIBRw0BQQghAyACQQhJDQEgAEEAQSgQECEAIAEoAAQhASAAQQE2AhQgACABrTcDAEEADwsgASACIAMQLyIDIAJLDQAgACADNgIYQXIhAyABIARqIgVBf2otAAAiAkEIcQ0AIAJBIHEiBkUEQEFwIQMgBS0AACIFQacBSw0BIAVBB3GtQgEgBUEDdkEKaq2GIgdCA4h+IAd8IQggBEEBaiEECyACQQZ2IQMgAkECdiEFAkAgAkEDcUF/aiICQQJLBEBBACECDAELAkACQAJAIAJBAWsOAgECAAsgASAEai0AACECIARBAWohBAwCCyABIARqLwAAIQIgBEECaiEEDAELIAEgBGooAAAhAiAEQQRqIQQLIAVBAXEhBQJ+AkACQAJAIANBf2oiA0ECTQRAIANBAWsOAgIDAQtCfyAGRQ0DGiABIARqMQAADAMLIAEgBGovAACtQoACfAwCCyABIARqKAAArQwBCyABIARqKQAACyEHIAAgBTYCICAAIAI2AhwgACAHNwMAQQAhAyAAQQA2AhQgACAHIAggBhsiBzcDCCAAIAdCgIAIIAdCgIAIVBs+AhALIAMLWwEBf0G4fyEDIAIQFiICIAFNBH8gACACakF/ai0AACIAQQNxQQJ0QaAeaigCACACaiAAQQZ2IgFBAnRBsB5qKAIAaiAAQSBxIgBFaiABRSAAQQV2cWoFQbh/CwsdACAAKAKQ4gEQWiAAQQA2AqDiASAAQgA3A5DiAQu1AwEFfyMAQZACayIKJABBuH8hBgJAIAVFDQAgBCwAACIIQf8BcSEHAkAgCEF/TARAIAdBgn9qQQF2IgggBU8NAkFsIQYgB0GBf2oiBUGAAk8NAiAEQQFqIQdBACEGA0AgBiAFTwRAIAUhBiAIIQcMAwUgACAGaiAHIAZBAXZqIgQtAABBBHY6AAAgACAGQQFyaiAELQAAQQ9xOgAAIAZBAmohBgwBCwAACwALIAcgBU8NASAAIARBAWogByAKEFMiBhADDQELIAYhBEEAIQYgAUEAQTQQECEJQQAhBQNAIAQgBkcEQCAAIAZqIggtAAAiAUELSwRAQWwhBgwDBSAJIAFBAnRqIgEgASgCAEEBajYCACAGQQFqIQZBASAILQAAdEEBdSAFaiEFDAILAAsLQWwhBiAFRQ0AIAUQFEEBaiIBQQxLDQAgAyABNgIAQQFBASABdCAFayIDEBQiAXQgA0cNACAAIARqIAFBAWoiADoAACAJIABBAnRqIgAgACgCAEEBajYCACAJKAIEIgBBAkkgAEEBcXINACACIARBAWo2AgAgB0EBaiEGCyAKQZACaiQAIAYLxhEBDH8jAEHwAGsiBSQAQWwhCwJAIANBCkkNACACLwAAIQogAi8AAiEJIAIvAAQhByAFQQhqIAQQDgJAIAMgByAJIApqakEGaiIMSQ0AIAUtAAohCCAFQdgAaiACQQZqIgIgChAGIgsQAw0BIAVBQGsgAiAKaiICIAkQBiILEAMNASAFQShqIAIgCWoiAiAHEAYiCxADDQEgBUEQaiACIAdqIAMgDGsQBiILEAMNASAAIAFqIg9BfWohECAEQQRqIQZBASELIAAgAUEDakECdiIDaiIMIANqIgIgA2oiDiEDIAIhBCAMIQcDQCALIAMgEElxBEAgACAGIAVB2ABqIAgQAkECdGoiCS8BADsAACAFQdgAaiAJLQACEAEgCS0AAyELIAcgBiAFQUBrIAgQAkECdGoiCS8BADsAACAFQUBrIAktAAIQASAJLQADIQogBCAGIAVBKGogCBACQQJ0aiIJLwEAOwAAIAVBKGogCS0AAhABIAktAAMhCSADIAYgBUEQaiAIEAJBAnRqIg0vAQA7AAAgBUEQaiANLQACEAEgDS0AAyENIAAgC2oiCyAGIAVB2ABqIAgQAkECdGoiAC8BADsAACAFQdgAaiAALQACEAEgAC0AAyEAIAcgCmoiCiAGIAVBQGsgCBACQQJ0aiIHLwEAOwAAIAVBQGsgBy0AAhABIActAAMhByAEIAlqIgkgBiAFQShqIAgQAkECdGoiBC8BADsAACAFQShqIAQtAAIQASAELQADIQQgAyANaiIDIAYgBUEQaiAIEAJBAnRqIg0vAQA7AAAgBUEQaiANLQACEAEgACALaiEAIAcgCmohByAEIAlqIQQgAyANLQADaiEDIAVB2ABqEA0gBUFAaxANciAFQShqEA1yIAVBEGoQDXJFIQsMAQsLIAQgDksgByACS3INAEFsIQsgACAMSw0BIAxBfWohCQNAQQAgACAJSSAFQdgAahAEGwRAIAAgBiAFQdgAaiAIEAJBAnRqIgovAQA7AAAgBUHYAGogCi0AAhABIAAgCi0AA2oiACAGIAVB2ABqIAgQAkECdGoiCi8BADsAACAFQdgAaiAKLQACEAEgACAKLQADaiEADAEFIAxBfmohCgNAIAVB2ABqEAQgACAKS3JFBEAgACAGIAVB2ABqIAgQAkECdGoiCS8BADsAACAFQdgAaiAJLQACEAEgACAJLQADaiEADAELCwNAIAAgCk0EQCAAIAYgBUHYAGogCBACQQJ0aiIJLwEAOwAAIAVB2ABqIAktAAIQASAAIAktAANqIQAMAQsLAkAgACAMTw0AIAAgBiAFQdgAaiAIEAIiAEECdGoiDC0AADoAACAMLQADQQFGBEAgBUHYAGogDC0AAhABDAELIAUoAlxBH0sNACAFQdgAaiAGIABBAnRqLQACEAEgBSgCXEEhSQ0AIAVBIDYCXAsgAkF9aiEMA0BBACAHIAxJIAVBQGsQBBsEQCAHIAYgBUFAayAIEAJBAnRqIgAvAQA7AAAgBUFAayAALQACEAEgByAALQADaiIAIAYgBUFAayAIEAJBAnRqIgcvAQA7AAAgBUFAayAHLQACEAEgACAHLQADaiEHDAEFIAJBfmohDANAIAVBQGsQBCAHIAxLckUEQCAHIAYgBUFAayAIEAJBAnRqIgAvAQA7AAAgBUFAayAALQACEAEgByAALQADaiEHDAELCwNAIAcgDE0EQCAHIAYgBUFAayAIEAJBAnRqIgAvAQA7AAAgBUFAayAALQACEAEgByAALQADaiEHDAELCwJAIAcgAk8NACAHIAYgBUFAayAIEAIiAEECdGoiAi0AADoAACACLQADQQFGBEAgBUFAayACLQACEAEMAQsgBSgCREEfSw0AIAVBQGsgBiAAQQJ0ai0AAhABIAUoAkRBIUkNACAFQSA2AkQLIA5BfWohAgNAQQAgBCACSSAFQShqEAQbBEAgBCAGIAVBKGogCBACQQJ0aiIALwEAOwAAIAVBKGogAC0AAhABIAQgAC0AA2oiACAGIAVBKGogCBACQQJ0aiIELwEAOwAAIAVBKGogBC0AAhABIAAgBC0AA2ohBAwBBSAOQX5qIQIDQCAFQShqEAQgBCACS3JFBEAgBCAGIAVBKGogCBACQQJ0aiIALwEAOwAAIAVBKGogAC0AAhABIAQgAC0AA2ohBAwBCwsDQCAEIAJNBEAgBCAGIAVBKGogCBACQQJ0aiIALwEAOwAAIAVBKGogAC0AAhABIAQgAC0AA2ohBAwBCwsCQCAEIA5PDQAgBCAGIAVBKGogCBACIgBBAnRqIgItAAA6AAAgAi0AA0EBRgRAIAVBKGogAi0AAhABDAELIAUoAixBH0sNACAFQShqIAYgAEECdGotAAIQASAFKAIsQSFJDQAgBUEgNgIsCwNAQQAgAyAQSSAFQRBqEAQbBEAgAyAGIAVBEGogCBACQQJ0aiIALwEAOwAAIAVBEGogAC0AAhABIAMgAC0AA2oiACAGIAVBEGogCBACQQJ0aiICLwEAOwAAIAVBEGogAi0AAhABIAAgAi0AA2ohAwwBBSAPQX5qIQIDQCAFQRBqEAQgAyACS3JFBEAgAyAGIAVBEGogCBACQQJ0aiIALwEAOwAAIAVBEGogAC0AAhABIAMgAC0AA2ohAwwBCwsDQCADIAJNBEAgAyAGIAVBEGogCBACQQJ0aiIALwEAOwAAIAVBEGogAC0AAhABIAMgAC0AA2ohAwwBCwsCQCADIA9PDQAgAyAGIAVBEGogCBACIgBBAnRqIgItAAA6AAAgAi0AA0EBRgRAIAVBEGogAi0AAhABDAELIAUoAhRBH0sNACAFQRBqIAYgAEECdGotAAIQASAFKAIUQSFJDQAgBUEgNgIUCyABQWwgBUHYAGoQCiAFQUBrEApxIAVBKGoQCnEgBUEQahAKcRshCwwJCwAACwALAAALAAsAAAsACwAACwALQWwhCwsgBUHwAGokACALC7UEAQ5/IwBBEGsiBiQAIAZBBGogABAOQVQhBQJAIARB3AtJDQAgBi0ABCEHIANB8ARqQQBB7AAQECEIIAdBDEsNACADQdwJaiIJIAggBkEIaiAGQQxqIAEgAhAxIhAQA0UEQCAGKAIMIgQgB0sNASADQdwFaiEPIANBpAVqIREgAEEEaiESIANBqAVqIQEgBCEFA0AgBSICQX9qIQUgCCACQQJ0aigCAEUNAAsgAkEBaiEOQQEhBQNAIAUgDk9FBEAgCCAFQQJ0IgtqKAIAIQwgASALaiAKNgIAIAVBAWohBSAKIAxqIQoMAQsLIAEgCjYCAEEAIQUgBigCCCELA0AgBSALRkUEQCABIAUgCWotAAAiDEECdGoiDSANKAIAIg1BAWo2AgAgDyANQQF0aiINIAw6AAEgDSAFOgAAIAVBAWohBQwBCwtBACEBIANBADYCqAUgBEF/cyAHaiEJQQEhBQNAIAUgDk9FBEAgCCAFQQJ0IgtqKAIAIQwgAyALaiABNgIAIAwgBSAJanQgAWohASAFQQFqIQUMAQsLIAcgBEEBaiIBIAJrIgRrQQFqIQgDQEEBIQUgBCAIT0UEQANAIAUgDk9FBEAgBUECdCIJIAMgBEE0bGpqIAMgCWooAgAgBHY2AgAgBUEBaiEFDAELCyAEQQFqIQQMAQsLIBIgByAPIAogESADIAIgARBkIAZBAToABSAGIAc6AAYgACAGKAIENgIACyAQIQULIAZBEGokACAFC8ENAQt/IwBB8ABrIgUkAEFsIQkCQCADQQpJDQAgAi8AACEKIAIvAAIhDCACLwAEIQYgBUEIaiAEEA4CQCADIAYgCiAMampBBmoiDUkNACAFLQAKIQcgBUHYAGogAkEGaiICIAoQBiIJEAMNASAFQUBrIAIgCmoiAiAMEAYiCRADDQEgBUEoaiACIAxqIgIgBhAGIgkQAw0BIAVBEGogAiAGaiADIA1rEAYiCRADDQEgACABaiIOQX1qIQ8gBEEEaiEGQQEhCSAAIAFBA2pBAnYiAmoiCiACaiIMIAJqIg0hAyAMIQQgCiECA0AgCSADIA9JcQRAIAYgBUHYAGogBxACQQF0aiIILQAAIQsgBUHYAGogCC0AARABIAAgCzoAACAGIAVBQGsgBxACQQF0aiIILQAAIQsgBUFAayAILQABEAEgAiALOgAAIAYgBUEoaiAHEAJBAXRqIggtAAAhCyAFQShqIAgtAAEQASAEIAs6AAAgBiAFQRBqIAcQAkEBdGoiCC0AACELIAVBEGogCC0AARABIAMgCzoAACAGIAVB2ABqIAcQAkEBdGoiCC0AACELIAVB2ABqIAgtAAEQASAAIAs6AAEgBiAFQUBrIAcQAkEBdGoiCC0AACELIAVBQGsgCC0AARABIAIgCzoAASAGIAVBKGogBxACQQF0aiIILQAAIQsgBUEoaiAILQABEAEgBCALOgABIAYgBUEQaiAHEAJBAXRqIggtAAAhCyAFQRBqIAgtAAEQASADIAs6AAEgA0ECaiEDIARBAmohBCACQQJqIQIgAEECaiEAIAkgBUHYAGoQDUVxIAVBQGsQDUVxIAVBKGoQDUVxIAVBEGoQDUVxIQkMAQsLIAQgDUsgAiAMS3INAEFsIQkgACAKSw0BIApBfWohCQNAIAVB2ABqEAQgACAJT3JFBEAgBiAFQdgAaiAHEAJBAXRqIggtAAAhCyAFQdgAaiAILQABEAEgACALOgAAIAYgBUHYAGogBxACQQF0aiIILQAAIQsgBUHYAGogCC0AARABIAAgCzoAASAAQQJqIQAMAQsLA0AgBUHYAGoQBCAAIApPckUEQCAGIAVB2ABqIAcQAkEBdGoiCS0AACEIIAVB2ABqIAktAAEQASAAIAg6AAAgAEEBaiEADAELCwNAIAAgCkkEQCAGIAVB2ABqIAcQAkEBdGoiCS0AACEIIAVB2ABqIAktAAEQASAAIAg6AAAgAEEBaiEADAELCyAMQX1qIQADQCAFQUBrEAQgAiAAT3JFBEAgBiAFQUBrIAcQAkEBdGoiCi0AACEJIAVBQGsgCi0AARABIAIgCToAACAGIAVBQGsgBxACQQF0aiIKLQAAIQkgBUFAayAKLQABEAEgAiAJOgABIAJBAmohAgwBCwsDQCAFQUBrEAQgAiAMT3JFBEAgBiAFQUBrIAcQAkEBdGoiAC0AACEKIAVBQGsgAC0AARABIAIgCjoAACACQQFqIQIMAQsLA0AgAiAMSQRAIAYgBUFAayAHEAJBAXRqIgAtAAAhCiAFQUBrIAAtAAEQASACIAo6AAAgAkEBaiECDAELCyANQX1qIQADQCAFQShqEAQgBCAAT3JFBEAgBiAFQShqIAcQAkEBdGoiAi0AACEKIAVBKGogAi0AARABIAQgCjoAACAGIAVBKGogBxACQQF0aiICLQAAIQogBUEoaiACLQABEAEgBCAKOgABIARBAmohBAwBCwsDQCAFQShqEAQgBCANT3JFBEAgBiAFQShqIAcQAkEBdGoiAC0AACECIAVBKGogAC0AARABIAQgAjoAACAEQQFqIQQMAQsLA0AgBCANSQRAIAYgBUEoaiAHEAJBAXRqIgAtAAAhAiAFQShqIAAtAAEQASAEIAI6AAAgBEEBaiEEDAELCwNAIAVBEGoQBCADIA9PckUEQCAGIAVBEGogBxACQQF0aiIALQAAIQIgBUEQaiAALQABEAEgAyACOgAAIAYgBUEQaiAHEAJBAXRqIgAtAAAhAiAFQRBqIAAtAAEQASADIAI6AAEgA0ECaiEDDAELCwNAIAVBEGoQBCADIA5PckUEQCAGIAVBEGogBxACQQF0aiIALQAAIQIgBUEQaiAALQABEAEgAyACOgAAIANBAWohAwwBCwsDQCADIA5JBEAgBiAFQRBqIAcQAkEBdGoiAC0AACECIAVBEGogAC0AARABIAMgAjoAACADQQFqIQMMAQsLIAFBbCAFQdgAahAKIAVBQGsQCnEgBUEoahAKcSAFQRBqEApxGyEJDAELQWwhCQsgBUHwAGokACAJC8oCAQR/IwBBIGsiBSQAIAUgBBAOIAUtAAIhByAFQQhqIAIgAxAGIgIQA0UEQCAEQQRqIQIgACABaiIDQX1qIQQDQCAFQQhqEAQgACAET3JFBEAgAiAFQQhqIAcQAkEBdGoiBi0AACEIIAVBCGogBi0AARABIAAgCDoAACACIAVBCGogBxACQQF0aiIGLQAAIQggBUEIaiAGLQABEAEgACAIOgABIABBAmohAAwBCwsDQCAFQQhqEAQgACADT3JFBEAgAiAFQQhqIAcQAkEBdGoiBC0AACEGIAVBCGogBC0AARABIAAgBjoAACAAQQFqIQAMAQsLA0AgACADT0UEQCACIAVBCGogBxACQQF0aiIELQAAIQYgBUEIaiAELQABEAEgACAGOgAAIABBAWohAAwBCwsgAUFsIAVBCGoQChshAgsgBUEgaiQAIAILtgMBCX8jAEEQayIGJAAgBkEANgIMIAZBADYCCEFUIQQCQAJAIANBQGsiDCADIAZBCGogBkEMaiABIAIQMSICEAMNACAGQQRqIAAQDiAGKAIMIgcgBi0ABEEBaksNASAAQQRqIQogBkEAOgAFIAYgBzoABiAAIAYoAgQ2AgAgB0EBaiEJQQEhBANAIAQgCUkEQCADIARBAnRqIgEoAgAhACABIAU2AgAgACAEQX9qdCAFaiEFIARBAWohBAwBCwsgB0EBaiEHQQAhBSAGKAIIIQkDQCAFIAlGDQEgAyAFIAxqLQAAIgRBAnRqIgBBASAEdEEBdSILIAAoAgAiAWoiADYCACAHIARrIQhBACEEAkAgC0EDTQRAA0AgBCALRg0CIAogASAEakEBdGoiACAIOgABIAAgBToAACAEQQFqIQQMAAALAAsDQCABIABPDQEgCiABQQF0aiIEIAg6AAEgBCAFOgAAIAQgCDoAAyAEIAU6AAIgBCAIOgAFIAQgBToABCAEIAg6AAcgBCAFOgAGIAFBBGohAQwAAAsACyAFQQFqIQUMAAALAAsgAiEECyAGQRBqJAAgBAutAQECfwJAQYQgKAIAIABHIAAoAgBBAXYiAyABa0F4aiICQXhxQQhHcgR/IAIFIAMQJ0UNASACQQhqC0EQSQ0AIAAgACgCACICQQFxIAAgAWpBD2pBeHEiASAAa0EBdHI2AgAgASAANgIEIAEgASgCAEEBcSAAIAJBAXZqIAFrIgJBAXRyNgIAQYQgIAEgAkH/////B3FqQQRqQYQgKAIAIABGGyABNgIAIAEQJQsLygIBBX8CQAJAAkAgAEEIIABBCEsbZ0EfcyAAaUEBR2oiAUEESSAAIAF2cg0AIAFBAnRB/B5qKAIAIgJFDQADQCACQXhqIgMoAgBBAXZBeGoiBSAATwRAIAIgBUEIIAVBCEsbZ0Efc0ECdEGAH2oiASgCAEYEQCABIAIoAgQ2AgALDAMLIARBHksNASAEQQFqIQQgAigCBCICDQALC0EAIQMgAUEgTw0BA0AgAUECdEGAH2ooAgAiAkUEQCABQR5LIQIgAUEBaiEBIAJFDQEMAwsLIAIgAkF4aiIDKAIAQQF2QXhqIgFBCCABQQhLG2dBH3NBAnRBgB9qIgEoAgBGBEAgASACKAIENgIACwsgAigCACIBBEAgASACKAIENgIECyACKAIEIgEEQCABIAIoAgA2AgALIAMgAygCAEEBcjYCACADIAAQNwsgAwvhCwINfwV+IwBB8ABrIgckACAHIAAoAvDhASIINgJcIAEgAmohDSAIIAAoAoDiAWohDwJAAkAgBUUEQCABIQQMAQsgACgCxOABIRAgACgCwOABIREgACgCvOABIQ4gAEEBNgKM4QFBACEIA0AgCEEDRwRAIAcgCEECdCICaiAAIAJqQazQAWooAgA2AkQgCEEBaiEIDAELC0FsIQwgB0EYaiADIAQQBhADDQEgB0EsaiAHQRhqIAAoAgAQEyAHQTRqIAdBGGogACgCCBATIAdBPGogB0EYaiAAKAIEEBMgDUFgaiESIAEhBEEAIQwDQCAHKAIwIAcoAixBA3RqKQIAIhRCEIinQf8BcSEIIAcoAkAgBygCPEEDdGopAgAiFUIQiKdB/wFxIQsgBygCOCAHKAI0QQN0aikCACIWQiCIpyEJIBVCIIghFyAUQiCIpyECAkAgFkIQiKdB/wFxIgNBAk8EQAJAIAZFIANBGUlyRQRAIAkgB0EYaiADQSAgBygCHGsiCiAKIANLGyIKEAUgAyAKayIDdGohCSAHQRhqEAQaIANFDQEgB0EYaiADEAUgCWohCQwBCyAHQRhqIAMQBSAJaiEJIAdBGGoQBBoLIAcpAkQhGCAHIAk2AkQgByAYNwNIDAELAkAgA0UEQCACBEAgBygCRCEJDAMLIAcoAkghCQwBCwJAAkAgB0EYakEBEAUgCSACRWpqIgNBA0YEQCAHKAJEQX9qIgMgA0VqIQkMAQsgA0ECdCAHaigCRCIJIAlFaiEJIANBAUYNAQsgByAHKAJINgJMCwsgByAHKAJENgJIIAcgCTYCRAsgF6chAyALBEAgB0EYaiALEAUgA2ohAwsgCCALakEUTwRAIAdBGGoQBBoLIAgEQCAHQRhqIAgQBSACaiECCyAHQRhqEAQaIAcgB0EYaiAUQhiIp0H/AXEQCCAUp0H//wNxajYCLCAHIAdBGGogFUIYiKdB/wFxEAggFadB//8DcWo2AjwgB0EYahAEGiAHIAdBGGogFkIYiKdB/wFxEAggFqdB//8DcWo2AjQgByACNgJgIAcoAlwhCiAHIAk2AmggByADNgJkAkACQAJAIAQgAiADaiILaiASSw0AIAIgCmoiEyAPSw0AIA0gBGsgC0Egak8NAQsgByAHKQNoNwMQIAcgBykDYDcDCCAEIA0gB0EIaiAHQdwAaiAPIA4gESAQEB4hCwwBCyACIARqIQggBCAKEAcgAkERTwRAIARBEGohAgNAIAIgCkEQaiIKEAcgAkEQaiICIAhJDQALCyAIIAlrIQIgByATNgJcIAkgCCAOa0sEQCAJIAggEWtLBEBBbCELDAILIBAgAiAOayICaiIKIANqIBBNBEAgCCAKIAMQDxoMAgsgCCAKQQAgAmsQDyEIIAcgAiADaiIDNgJkIAggAmshCCAOIQILIAlBEE8EQCADIAhqIQMDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALDAELAkAgCUEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgCUECdCIDQcAeaigCAGoiAhAXIAIgA0HgHmooAgBrIQIgBygCZCEDDAELIAggAhAMCyADQQlJDQAgAyAIaiEDIAhBCGoiCCACQQhqIgJrQQ9MBEADQCAIIAIQDCACQQhqIQIgCEEIaiIIIANJDQAMAgALAAsDQCAIIAIQByACQRBqIQIgCEEQaiIIIANJDQALCyAHQRhqEAQaIAsgDCALEAMiAhshDCAEIAQgC2ogAhshBCAFQX9qIgUNAAsgDBADDQFBbCEMIAdBGGoQBEECSQ0BQQAhCANAIAhBA0cEQCAAIAhBAnQiAmpBrNABaiACIAdqKAJENgIAIAhBAWohCAwBCwsgBygCXCEIC0G6fyEMIA8gCGsiACANIARrSw0AIAQEfyAEIAggABALIABqBUEACyABayEMCyAHQfAAaiQAIAwLkRcCFn8FfiMAQdABayIHJAAgByAAKALw4QEiCDYCvAEgASACaiESIAggACgCgOIBaiETAkACQCAFRQRAIAEhAwwBCyAAKALE4AEhESAAKALA4AEhFSAAKAK84AEhDyAAQQE2AozhAUEAIQgDQCAIQQNHBEAgByAIQQJ0IgJqIAAgAmpBrNABaigCADYCVCAIQQFqIQgMAQsLIAcgETYCZCAHIA82AmAgByABIA9rNgJoQWwhECAHQShqIAMgBBAGEAMNASAFQQQgBUEESBshFyAHQTxqIAdBKGogACgCABATIAdBxABqIAdBKGogACgCCBATIAdBzABqIAdBKGogACgCBBATQQAhBCAHQeAAaiEMIAdB5ABqIQoDQCAHQShqEARBAksgBCAXTnJFBEAgBygCQCAHKAI8QQN0aikCACIdQhCIp0H/AXEhCyAHKAJQIAcoAkxBA3RqKQIAIh5CEIinQf8BcSEJIAcoAkggBygCREEDdGopAgAiH0IgiKchCCAeQiCIISAgHUIgiKchAgJAIB9CEIinQf8BcSIDQQJPBEACQCAGRSADQRlJckUEQCAIIAdBKGogA0EgIAcoAixrIg0gDSADSxsiDRAFIAMgDWsiA3RqIQggB0EoahAEGiADRQ0BIAdBKGogAxAFIAhqIQgMAQsgB0EoaiADEAUgCGohCCAHQShqEAQaCyAHKQJUISEgByAINgJUIAcgITcDWAwBCwJAIANFBEAgAgRAIAcoAlQhCAwDCyAHKAJYIQgMAQsCQAJAIAdBKGpBARAFIAggAkVqaiIDQQNGBEAgBygCVEF/aiIDIANFaiEIDAELIANBAnQgB2ooAlQiCCAIRWohCCADQQFGDQELIAcgBygCWDYCXAsLIAcgBygCVDYCWCAHIAg2AlQLICCnIQMgCQRAIAdBKGogCRAFIANqIQMLIAkgC2pBFE8EQCAHQShqEAQaCyALBEAgB0EoaiALEAUgAmohAgsgB0EoahAEGiAHIAcoAmggAmoiCSADajYCaCAKIAwgCCAJSxsoAgAhDSAHIAdBKGogHUIYiKdB/wFxEAggHadB//8DcWo2AjwgByAHQShqIB5CGIinQf8BcRAIIB6nQf//A3FqNgJMIAdBKGoQBBogB0EoaiAfQhiIp0H/AXEQCCEOIAdB8ABqIARBBHRqIgsgCSANaiAIazYCDCALIAg2AgggCyADNgIEIAsgAjYCACAHIA4gH6dB//8DcWo2AkQgBEEBaiEEDAELCyAEIBdIDQEgEkFgaiEYIAdB4ABqIRogB0HkAGohGyABIQMDQCAHQShqEARBAksgBCAFTnJFBEAgBygCQCAHKAI8QQN0aikCACIdQhCIp0H/AXEhCyAHKAJQIAcoAkxBA3RqKQIAIh5CEIinQf8BcSEIIAcoAkggBygCREEDdGopAgAiH0IgiKchCSAeQiCIISAgHUIgiKchDAJAIB9CEIinQf8BcSICQQJPBEACQCAGRSACQRlJckUEQCAJIAdBKGogAkEgIAcoAixrIgogCiACSxsiChAFIAIgCmsiAnRqIQkgB0EoahAEGiACRQ0BIAdBKGogAhAFIAlqIQkMAQsgB0EoaiACEAUgCWohCSAHQShqEAQaCyAHKQJUISEgByAJNgJUIAcgITcDWAwBCwJAIAJFBEAgDARAIAcoAlQhCQwDCyAHKAJYIQkMAQsCQAJAIAdBKGpBARAFIAkgDEVqaiICQQNGBEAgBygCVEF/aiICIAJFaiEJDAELIAJBAnQgB2ooAlQiCSAJRWohCSACQQFGDQELIAcgBygCWDYCXAsLIAcgBygCVDYCWCAHIAk2AlQLICCnIRQgCARAIAdBKGogCBAFIBRqIRQLIAggC2pBFE8EQCAHQShqEAQaCyALBEAgB0EoaiALEAUgDGohDAsgB0EoahAEGiAHIAcoAmggDGoiGSAUajYCaCAbIBogCSAZSxsoAgAhHCAHIAdBKGogHUIYiKdB/wFxEAggHadB//8DcWo2AjwgByAHQShqIB5CGIinQf8BcRAIIB6nQf//A3FqNgJMIAdBKGoQBBogByAHQShqIB9CGIinQf8BcRAIIB+nQf//A3FqNgJEIAcgB0HwAGogBEEDcUEEdGoiDSkDCCIdNwPIASAHIA0pAwAiHjcDwAECQAJAAkAgBygCvAEiDiAepyICaiIWIBNLDQAgAyAHKALEASIKIAJqIgtqIBhLDQAgEiADayALQSBqTw0BCyAHIAcpA8gBNwMQIAcgBykDwAE3AwggAyASIAdBCGogB0G8AWogEyAPIBUgERAeIQsMAQsgAiADaiEIIAMgDhAHIAJBEU8EQCADQRBqIQIDQCACIA5BEGoiDhAHIAJBEGoiAiAISQ0ACwsgCCAdpyIOayECIAcgFjYCvAEgDiAIIA9rSwRAIA4gCCAVa0sEQEFsIQsMAgsgESACIA9rIgJqIhYgCmogEU0EQCAIIBYgChAPGgwCCyAIIBZBACACaxAPIQggByACIApqIgo2AsQBIAggAmshCCAPIQILIA5BEE8EQCAIIApqIQoDQCAIIAIQByACQRBqIQIgCEEQaiIIIApJDQALDAELAkAgDkEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgDkECdCIKQcAeaigCAGoiAhAXIAIgCkHgHmooAgBrIQIgBygCxAEhCgwBCyAIIAIQDAsgCkEJSQ0AIAggCmohCiAIQQhqIgggAkEIaiICa0EPTARAA0AgCCACEAwgAkEIaiECIAhBCGoiCCAKSQ0ADAIACwALA0AgCCACEAcgAkEQaiECIAhBEGoiCCAKSQ0ACwsgCxADBEAgCyEQDAQFIA0gDDYCACANIBkgHGogCWs2AgwgDSAJNgIIIA0gFDYCBCAEQQFqIQQgAyALaiEDDAILAAsLIAQgBUgNASAEIBdrIQtBACEEA0AgCyAFSARAIAcgB0HwAGogC0EDcUEEdGoiAikDCCIdNwPIASAHIAIpAwAiHjcDwAECQAJAAkAgBygCvAEiDCAepyICaiIKIBNLDQAgAyAHKALEASIJIAJqIhBqIBhLDQAgEiADayAQQSBqTw0BCyAHIAcpA8gBNwMgIAcgBykDwAE3AxggAyASIAdBGGogB0G8AWogEyAPIBUgERAeIRAMAQsgAiADaiEIIAMgDBAHIAJBEU8EQCADQRBqIQIDQCACIAxBEGoiDBAHIAJBEGoiAiAISQ0ACwsgCCAdpyIGayECIAcgCjYCvAEgBiAIIA9rSwRAIAYgCCAVa0sEQEFsIRAMAgsgESACIA9rIgJqIgwgCWogEU0EQCAIIAwgCRAPGgwCCyAIIAxBACACaxAPIQggByACIAlqIgk2AsQBIAggAmshCCAPIQILIAZBEE8EQCAIIAlqIQYDQCAIIAIQByACQRBqIQIgCEEQaiIIIAZJDQALDAELAkAgBkEHTQRAIAggAi0AADoAACAIIAItAAE6AAEgCCACLQACOgACIAggAi0AAzoAAyAIQQRqIAIgBkECdCIGQcAeaigCAGoiAhAXIAIgBkHgHmooAgBrIQIgBygCxAEhCQwBCyAIIAIQDAsgCUEJSQ0AIAggCWohBiAIQQhqIgggAkEIaiICa0EPTARAA0AgCCACEAwgAkEIaiECIAhBCGoiCCAGSQ0ADAIACwALA0AgCCACEAcgAkEQaiECIAhBEGoiCCAGSQ0ACwsgEBADDQMgC0EBaiELIAMgEGohAwwBCwsDQCAEQQNHBEAgACAEQQJ0IgJqQazQAWogAiAHaigCVDYCACAEQQFqIQQMAQsLIAcoArwBIQgLQbp/IRAgEyAIayIAIBIgA2tLDQAgAwR/IAMgCCAAEAsgAGoFQQALIAFrIRALIAdB0AFqJAAgEAslACAAQgA3AgAgAEEAOwEIIABBADoACyAAIAE2AgwgACACOgAKC7QFAQN/IwBBMGsiBCQAIABB/wFqIgVBfWohBgJAIAMvAQIEQCAEQRhqIAEgAhAGIgIQAw0BIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahASOgAAIAMgBEEIaiAEQRhqEBI6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0FIAEgBEEQaiAEQRhqEBI6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBSABIARBCGogBEEYahASOgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEjoAACABIAJqIABrIQIMAwsgAyAEQRBqIARBGGoQEjoAAiADIARBCGogBEEYahASOgADIANBBGohAwwAAAsACyAEQRhqIAEgAhAGIgIQAw0AIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahAROgAAIAMgBEEIaiAEQRhqEBE6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0EIAEgBEEQaiAEQRhqEBE6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBCABIARBCGogBEEYahAROgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEToAACABIAJqIABrIQIMAgsgAyAEQRBqIARBGGoQEToAAiADIARBCGogBEEYahAROgADIANBBGohAwwAAAsACyAEQTBqJAAgAgtpAQF/An8CQAJAIAJBB00NACABKAAAQbfIwuF+Rw0AIAAgASgABDYCmOIBQWIgAEEQaiABIAIQPiIDEAMNAhogAEKBgICAEDcDiOEBIAAgASADaiACIANrECoMAQsgACABIAIQKgtBAAsLrQMBBn8jAEGAAWsiAyQAQWIhCAJAIAJBCUkNACAAQZjQAGogAUEIaiIEIAJBeGogAEGY0AAQMyIFEAMiBg0AIANBHzYCfCADIANB/ABqIANB+ABqIAQgBCAFaiAGGyIEIAEgAmoiAiAEaxAVIgUQAw0AIAMoAnwiBkEfSw0AIAMoAngiB0EJTw0AIABBiCBqIAMgBkGAC0GADCAHEBggA0E0NgJ8IAMgA0H8AGogA0H4AGogBCAFaiIEIAIgBGsQFSIFEAMNACADKAJ8IgZBNEsNACADKAJ4IgdBCk8NACAAQZAwaiADIAZBgA1B4A4gBxAYIANBIzYCfCADIANB/ABqIANB+ABqIAQgBWoiBCACIARrEBUiBRADDQAgAygCfCIGQSNLDQAgAygCeCIHQQpPDQAgACADIAZBwBBB0BEgBxAYIAQgBWoiBEEMaiIFIAJLDQAgAiAFayEFQQAhAgNAIAJBA0cEQCAEKAAAIgZBf2ogBU8NAiAAIAJBAnRqQZzQAWogBjYCACACQQFqIQIgBEEEaiEEDAELCyAEIAFrIQgLIANBgAFqJAAgCAtGAQN/IABBCGohAyAAKAIEIQJBACEAA0AgACACdkUEQCABIAMgAEEDdGotAAJBFktqIQEgAEEBaiEADAELCyABQQggAmt0C4YDAQV/Qbh/IQcCQCADRQ0AIAItAAAiBEUEQCABQQA2AgBBAUG4fyADQQFGGw8LAn8gAkEBaiIFIARBGHRBGHUiBkF/Sg0AGiAGQX9GBEAgA0EDSA0CIAUvAABBgP4BaiEEIAJBA2oMAQsgA0ECSA0BIAItAAEgBEEIdHJBgIB+aiEEIAJBAmoLIQUgASAENgIAIAVBAWoiASACIANqIgNLDQBBbCEHIABBEGogACAFLQAAIgVBBnZBI0EJIAEgAyABa0HAEEHQEUHwEiAAKAKM4QEgACgCnOIBIAQQHyIGEAMiCA0AIABBmCBqIABBCGogBUEEdkEDcUEfQQggASABIAZqIAgbIgEgAyABa0GAC0GADEGAFyAAKAKM4QEgACgCnOIBIAQQHyIGEAMiCA0AIABBoDBqIABBBGogBUECdkEDcUE0QQkgASABIAZqIAgbIgEgAyABa0GADUHgDkGQGSAAKAKM4QEgACgCnOIBIAQQHyIAEAMNACAAIAFqIAJrIQcLIAcLrQMBCn8jAEGABGsiCCQAAn9BUiACQf8BSw0AGkFUIANBDEsNABogAkEBaiELIABBBGohCUGAgAQgA0F/anRBEHUhCkEAIQJBASEEQQEgA3QiB0F/aiIMIQUDQCACIAtGRQRAAkAgASACQQF0Ig1qLwEAIgZB//8DRgRAIAkgBUECdGogAjoAAiAFQX9qIQVBASEGDAELIARBACAKIAZBEHRBEHVKGyEECyAIIA1qIAY7AQAgAkEBaiECDAELCyAAIAQ7AQIgACADOwEAIAdBA3YgB0EBdmpBA2ohBkEAIQRBACECA0AgBCALRkUEQCABIARBAXRqLgEAIQpBACEAA0AgACAKTkUEQCAJIAJBAnRqIAQ6AAIDQCACIAZqIAxxIgIgBUsNAAsgAEEBaiEADAELCyAEQQFqIQQMAQsLQX8gAg0AGkEAIQIDfyACIAdGBH9BAAUgCCAJIAJBAnRqIgAtAAJBAXRqIgEgAS8BACIBQQFqOwEAIAAgAyABEBRrIgU6AAMgACABIAVB/wFxdCAHazsBACACQQFqIQIMAQsLCyEFIAhBgARqJAAgBQvjBgEIf0FsIQcCQCACQQNJDQACQAJAAkACQCABLQAAIgNBA3EiCUEBaw4DAwEAAgsgACgCiOEBDQBBYg8LIAJBBUkNAkEDIQYgASgAACEFAn8CQAJAIANBAnZBA3EiCEF+aiIEQQFNBEAgBEEBaw0BDAILIAVBDnZB/wdxIQQgBUEEdkH/B3EhAyAIRQwCCyAFQRJ2IQRBBCEGIAVBBHZB//8AcSEDQQAMAQsgBUEEdkH//w9xIgNBgIAISw0DIAEtAARBCnQgBUEWdnIhBEEFIQZBAAshBSAEIAZqIgogAksNAgJAIANBgQZJDQAgACgCnOIBRQ0AQQAhAgNAIAJBg4ABSw0BIAJBQGshAgwAAAsACwJ/IAlBA0YEQCABIAZqIQEgAEHw4gFqIQIgACgCDCEGIAUEQCACIAMgASAEIAYQXwwCCyACIAMgASAEIAYQXQwBCyAAQbjQAWohAiABIAZqIQEgAEHw4gFqIQYgAEGo0ABqIQggBQRAIAggBiADIAEgBCACEF4MAQsgCCAGIAMgASAEIAIQXAsQAw0CIAAgAzYCgOIBIABBATYCiOEBIAAgAEHw4gFqNgLw4QEgCUECRgRAIAAgAEGo0ABqNgIMCyAAIANqIgBBiOMBakIANwAAIABBgOMBakIANwAAIABB+OIBakIANwAAIABB8OIBakIANwAAIAoPCwJ/AkACQAJAIANBAnZBA3FBf2oiBEECSw0AIARBAWsOAgACAQtBASEEIANBA3YMAgtBAiEEIAEvAABBBHYMAQtBAyEEIAEQIUEEdgsiAyAEaiIFQSBqIAJLBEAgBSACSw0CIABB8OIBaiABIARqIAMQCyEBIAAgAzYCgOIBIAAgATYC8OEBIAEgA2oiAEIANwAYIABCADcAECAAQgA3AAggAEIANwAAIAUPCyAAIAM2AoDiASAAIAEgBGo2AvDhASAFDwsCfwJAAkACQCADQQJ2QQNxQX9qIgRBAksNACAEQQFrDgIAAgELQQEhByADQQN2DAILQQIhByABLwAAQQR2DAELIAJBBEkgARAhIgJBj4CAAUtyDQFBAyEHIAJBBHYLIQIgAEHw4gFqIAEgB2otAAAgAkEgahAQIQEgACACNgKA4gEgACABNgLw4QEgB0EBaiEHCyAHC0sAIABC+erQ0OfJoeThADcDICAAQgA3AxggAELP1tO+0ser2UI3AxAgAELW64Lu6v2J9eAANwMIIABCADcDACAAQShqQQBBKBAQGgviAgICfwV+IABBKGoiASAAKAJIaiECAn4gACkDACIDQiBaBEAgACkDECIEQgeJIAApAwgiBUIBiXwgACkDGCIGQgyJfCAAKQMgIgdCEol8IAUQGSAEEBkgBhAZIAcQGQwBCyAAKQMYQsXP2bLx5brqJ3wLIAN8IQMDQCABQQhqIgAgAk0EQEIAIAEpAAAQCSADhUIbiUKHla+vmLbem55/fkLj3MqV/M7y9YV/fCEDIAAhAQwBCwsCQCABQQRqIgAgAksEQCABIQAMAQsgASgAAK1Ch5Wvr5i23puef34gA4VCF4lCz9bTvtLHq9lCfkL5893xmfaZqxZ8IQMLA0AgACACSQRAIAAxAABCxc/ZsvHluuonfiADhUILiUKHla+vmLbem55/fiEDIABBAWohAAwBCwsgA0IhiCADhULP1tO+0ser2UJ+IgNCHYggA4VC+fPd8Zn2masWfiIDQiCIIAOFC+8CAgJ/BH4gACAAKQMAIAKtfDcDAAJAAkAgACgCSCIDIAJqIgRBH00EQCABRQ0BIAAgA2pBKGogASACECAgACgCSCACaiEEDAELIAEgAmohAgJ/IAMEQCAAQShqIgQgA2ogAUEgIANrECAgACAAKQMIIAQpAAAQCTcDCCAAIAApAxAgACkAMBAJNwMQIAAgACkDGCAAKQA4EAk3AxggACAAKQMgIABBQGspAAAQCTcDICAAKAJIIQMgAEEANgJIIAEgA2tBIGohAQsgAUEgaiACTQsEQCACQWBqIQMgACkDICEFIAApAxghBiAAKQMQIQcgACkDCCEIA0AgCCABKQAAEAkhCCAHIAEpAAgQCSEHIAYgASkAEBAJIQYgBSABKQAYEAkhBSABQSBqIgEgA00NAAsgACAFNwMgIAAgBjcDGCAAIAc3AxAgACAINwMICyABIAJPDQEgAEEoaiABIAIgAWsiBBAgCyAAIAQ2AkgLCy8BAX8gAEUEQEG2f0EAIAMbDwtBun8hBCADIAFNBH8gACACIAMQEBogAwVBun8LCy8BAX8gAEUEQEG2f0EAIAMbDwtBun8hBCADIAFNBH8gACACIAMQCxogAwVBun8LC6gCAQZ/IwBBEGsiByQAIABB2OABaikDAEKAgIAQViEIQbh/IQUCQCAEQf//B0sNACAAIAMgBBBCIgUQAyIGDQAgACgCnOIBIQkgACAHQQxqIAMgAyAFaiAGGyIKIARBACAFIAYbayIGEEAiAxADBEAgAyEFDAELIAcoAgwhBCABRQRAQbp/IQUgBEEASg0BCyAGIANrIQUgAyAKaiEDAkAgCQRAIABBADYCnOIBDAELAkACQAJAIARBBUgNACAAQdjgAWopAwBCgICACFgNAAwBCyAAQQA2ApziAQwBCyAAKAIIED8hBiAAQQA2ApziASAGQRRPDQELIAAgASACIAMgBSAEIAgQOSEFDAELIAAgASACIAMgBSAEIAgQOiEFCyAHQRBqJAAgBQtnACAAQdDgAWogASACIAAoAuzhARAuIgEQAwRAIAEPC0G4fyECAkAgAQ0AIABB7OABaigCACIBBEBBYCECIAAoApjiASABRw0BC0EAIQIgAEHw4AFqKAIARQ0AIABBkOEBahBDCyACCycBAX8QVyIERQRAQUAPCyAEIAAgASACIAMgBBBLEE8hACAEEFYgAAs/AQF/AkACQAJAIAAoAqDiAUEBaiIBQQJLDQAgAUEBaw4CAAECCyAAEDBBAA8LIABBADYCoOIBCyAAKAKU4gELvAMCB38BfiMAQRBrIgkkAEG4fyEGAkAgBCgCACIIQQVBCSAAKALs4QEiBRtJDQAgAygCACIHQQFBBSAFGyAFEC8iBRADBEAgBSEGDAELIAggBUEDakkNACAAIAcgBRBJIgYQAw0AIAEgAmohCiAAQZDhAWohCyAIIAVrIQIgBSAHaiEHIAEhBQNAIAcgAiAJECwiBhADDQEgAkF9aiICIAZJBEBBuH8hBgwCCyAJKAIAIghBAksEQEFsIQYMAgsgB0EDaiEHAn8CQAJAAkAgCEEBaw4CAgABCyAAIAUgCiAFayAHIAYQSAwCCyAFIAogBWsgByAGEEcMAQsgBSAKIAVrIActAAAgCSgCCBBGCyIIEAMEQCAIIQYMAgsgACgC8OABBEAgCyAFIAgQRQsgAiAGayECIAYgB2ohByAFIAhqIQUgCSgCBEUNAAsgACkD0OABIgxCf1IEQEFsIQYgDCAFIAFrrFINAQsgACgC8OABBEBBaiEGIAJBBEkNASALEEQhDCAHKAAAIAynRw0BIAdBBGohByACQXxqIQILIAMgBzYCACAEIAI2AgAgBSABayEGCyAJQRBqJAAgBgsuACAAECsCf0EAQQAQAw0AGiABRSACRXJFBEBBYiAAIAEgAhA9EAMNARoLQQALCzcAIAEEQCAAIAAoAsTgASABKAIEIAEoAghqRzYCnOIBCyAAECtBABADIAFFckUEQCAAIAEQWwsL0QIBB38jAEEQayIGJAAgBiAENgIIIAYgAzYCDCAFBEAgBSgCBCEKIAUoAgghCQsgASEIAkACQANAIAAoAuzhARAWIQsCQANAIAQgC0kNASADKAAAQXBxQdDUtMIBRgRAIAMgBBAiIgcQAw0EIAQgB2shBCADIAdqIQMMAQsLIAYgAzYCDCAGIAQ2AggCQCAFBEAgACAFEE5BACEHQQAQA0UNAQwFCyAAIAogCRBNIgcQAw0ECyAAIAgQUCAMQQFHQQAgACAIIAIgBkEMaiAGQQhqEEwiByIDa0EAIAMQAxtBCkdyRQRAQbh/IQcMBAsgBxADDQMgAiAHayECIAcgCGohCEEBIQwgBigCDCEDIAYoAgghBAwBCwsgBiADNgIMIAYgBDYCCEG4fyEHIAQNASAIIAFrIQcMAQsgBiADNgIMIAYgBDYCCAsgBkEQaiQAIAcLRgECfyABIAAoArjgASICRwRAIAAgAjYCxOABIAAgATYCuOABIAAoArzgASEDIAAgATYCvOABIAAgASADIAJrajYCwOABCwutAgIEfwF+IwBBQGoiBCQAAkACQCACQQhJDQAgASgAAEFwcUHQ1LTCAUcNACABIAIQIiEBIABCADcDCCAAQQA2AgQgACABNgIADAELIARBGGogASACEC0iAxADBEAgACADEBoMAQsgAwRAIABBuH8QGgwBCyACIAQoAjAiA2shAiABIANqIQMDQAJAIAAgAyACIARBCGoQLCIFEAMEfyAFBSACIAVBA2oiBU8NAUG4fwsQGgwCCyAGQQFqIQYgAiAFayECIAMgBWohAyAEKAIMRQ0ACyAEKAI4BEAgAkEDTQRAIABBuH8QGgwCCyADQQRqIQMLIAQoAighAiAEKQMYIQcgAEEANgIEIAAgAyABazYCACAAIAIgBmytIAcgB0J/URs3AwgLIARBQGskAAslAQF/IwBBEGsiAiQAIAIgACABEFEgAigCACEAIAJBEGokACAAC30BBH8jAEGQBGsiBCQAIARB/wE2AggCQCAEQRBqIARBCGogBEEMaiABIAIQFSIGEAMEQCAGIQUMAQtBVCEFIAQoAgwiB0EGSw0AIAMgBEEQaiAEKAIIIAcQQSIFEAMNACAAIAEgBmogAiAGayADEDwhBQsgBEGQBGokACAFC4cBAgJ/An5BABAWIQMCQANAIAEgA08EQAJAIAAoAABBcHFB0NS0wgFGBEAgACABECIiAhADRQ0BQn4PCyAAIAEQVSIEQn1WDQMgBCAFfCIFIARUIQJCfiEEIAINAyAAIAEQUiICEAMNAwsgASACayEBIAAgAmohAAwBCwtCfiAFIAEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQQh2QQFxIQIgAEEANgLg4gEgACACNgKM4gEgAUEgaiQAC3YBA38jAEEwayIBJAAgAARAIAEgAEHE0AFqIgIoAgA2AiggASAAKQK80AE3AyAgACgCACEDIAEgAigCADYCGCABIAApArzQATcDECADIAFBEGoQGyABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALzAEBAX8gACABKAK00AE2ApjiASAAIAEoAgQiAjYCwOABIAAgAjYCvOABIAAgAiABKAIIaiICNgK44AEgACACNgLE4AEgASgCuNABBEAgAEKBgICAEDcDiOEBIAAgAUGk0ABqNgIMIAAgAUGUIGo2AgggACABQZwwajYCBCAAIAFBDGo2AgAgAEGs0AFqIAFBqNABaigCADYCACAAQbDQAWogAUGs0AFqKAIANgIAIABBtNABaiABQbDQAWooAgA2AgAPCyAAQgA3A4jhAQs7ACACRQRAQbp/DwsgBEUEQEFsDwsgAiAEEGAEQCAAIAEgAiADIAQgBRBhDwsgACABIAIgAyAEIAUQZQtGAQF/IwBBEGsiBSQAIAVBCGogBBAOAn8gBS0ACQRAIAAgASACIAMgBBAyDAELIAAgASACIAMgBBA0CyEAIAVBEGokACAACzQAIAAgAyAEIAUQNiIFEAMEQCAFDwsgBSAESQR/IAEgAiADIAVqIAQgBWsgABA1BUG4fwsLRgEBfyMAQRBrIgUkACAFQQhqIAQQDgJ/IAUtAAkEQCAAIAEgAiADIAQQYgwBCyAAIAEgAiADIAQQNQshACAFQRBqJAAgAAtZAQF/QQ8hAiABIABJBEAgAUEEdCAAbiECCyAAQQh2IgEgAkEYbCIAQYwIaigCAGwgAEGICGooAgBqIgJBA3YgAmogAEGACGooAgAgAEGECGooAgAgAWxqSQs3ACAAIAMgBCAFQYAQEDMiBRADBEAgBQ8LIAUgBEkEfyABIAIgAyAFaiAEIAVrIAAQMgVBuH8LC78DAQN/IwBBIGsiBSQAIAVBCGogAiADEAYiAhADRQRAIAAgAWoiB0F9aiEGIAUgBBAOIARBBGohAiAFLQACIQMDQEEAIAAgBkkgBUEIahAEGwRAIAAgAiAFQQhqIAMQAkECdGoiBC8BADsAACAFQQhqIAQtAAIQASAAIAQtAANqIgQgAiAFQQhqIAMQAkECdGoiAC8BADsAACAFQQhqIAAtAAIQASAEIAAtAANqIQAMAQUgB0F+aiEEA0AgBUEIahAEIAAgBEtyRQRAIAAgAiAFQQhqIAMQAkECdGoiBi8BADsAACAFQQhqIAYtAAIQASAAIAYtAANqIQAMAQsLA0AgACAES0UEQCAAIAIgBUEIaiADEAJBAnRqIgYvAQA7AAAgBUEIaiAGLQACEAEgACAGLQADaiEADAELCwJAIAAgB08NACAAIAIgBUEIaiADEAIiA0ECdGoiAC0AADoAACAALQADQQFGBEAgBUEIaiAALQACEAEMAQsgBSgCDEEfSw0AIAVBCGogAiADQQJ0ai0AAhABIAUoAgxBIUkNACAFQSA2AgwLIAFBbCAFQQhqEAobIQILCwsgBUEgaiQAIAILkgIBBH8jAEFAaiIJJAAgCSADQTQQCyEDAkAgBEECSA0AIAMgBEECdGooAgAhCSADQTxqIAgQIyADQQE6AD8gAyACOgA+QQAhBCADKAI8IQoDQCAEIAlGDQEgACAEQQJ0aiAKNgEAIARBAWohBAwAAAsAC0EAIQkDQCAGIAlGRQRAIAMgBSAJQQF0aiIKLQABIgtBAnRqIgwoAgAhBCADQTxqIAotAABBCHQgCGpB//8DcRAjIANBAjoAPyADIAcgC2siCiACajoAPiAEQQEgASAKa3RqIQogAygCPCELA0AgACAEQQJ0aiALNgEAIARBAWoiBCAKSQ0ACyAMIAo2AgAgCUEBaiEJDAELCyADQUBrJAALowIBCX8jAEHQAGsiCSQAIAlBEGogBUE0EAsaIAcgBmshDyAHIAFrIRADQAJAIAMgCkcEQEEBIAEgByACIApBAXRqIgYtAAEiDGsiCGsiC3QhDSAGLQAAIQ4gCUEQaiAMQQJ0aiIMKAIAIQYgCyAPTwRAIAAgBkECdGogCyAIIAUgCEE0bGogCCAQaiIIQQEgCEEBShsiCCACIAQgCEECdGooAgAiCEEBdGogAyAIayAHIA4QYyAGIA1qIQgMAgsgCUEMaiAOECMgCUEBOgAPIAkgCDoADiAGIA1qIQggCSgCDCELA0AgBiAITw0CIAAgBkECdGogCzYBACAGQQFqIQYMAAALAAsgCUHQAGokAA8LIAwgCDYCACAKQQFqIQoMAAALAAs0ACAAIAMgBCAFEDYiBRADBEAgBQ8LIAUgBEkEfyABIAIgAyAFaiAEIAVrIAAQNAVBuH8LCyMAIAA/AEEQdGtB//8DakEQdkAAQX9GBEBBAA8LQQAQAEEBCzsBAX8gAgRAA0AgACABIAJBgCAgAkGAIEkbIgMQCyEAIAFBgCBqIQEgAEGAIGohACACIANrIgINAAsLCwYAIAAQAwsLqBUJAEGICAsNAQAAAAEAAAACAAAAAgBBoAgLswYBAAAAAQAAAAIAAAACAAAAJgAAAIIAAAAhBQAASgAAAGcIAAAmAAAAwAEAAIAAAABJBQAASgAAAL4IAAApAAAALAIAAIAAAABJBQAASgAAAL4IAAAvAAAAygIAAIAAAACKBQAASgAAAIQJAAA1AAAAcwMAAIAAAACdBQAASgAAAKAJAAA9AAAAgQMAAIAAAADrBQAASwAAAD4KAABEAAAAngMAAIAAAABNBgAASwAAAKoKAABLAAAAswMAAIAAAADBBgAATQAAAB8NAABNAAAAUwQAAIAAAAAjCAAAUQAAAKYPAABUAAAAmQQAAIAAAABLCQAAVwAAALESAABYAAAA2gQAAIAAAABvCQAAXQAAACMUAABUAAAARQUAAIAAAABUCgAAagAAAIwUAABqAAAArwUAAIAAAAB2CQAAfAAAAE4QAAB8AAAA0gIAAIAAAABjBwAAkQAAAJAHAACSAAAAAAAAAAEAAAABAAAABQAAAA0AAAAdAAAAPQAAAH0AAAD9AAAA/QEAAP0DAAD9BwAA/Q8AAP0fAAD9PwAA/X8AAP3/AAD9/wEA/f8DAP3/BwD9/w8A/f8fAP3/PwD9/38A/f//AP3//wH9//8D/f//B/3//w/9//8f/f//P/3//38AAAAAAQAAAAIAAAADAAAABAAAAAUAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAABEAAAASAAAAEwAAABQAAAAVAAAAFgAAABcAAAAYAAAAGQAAABoAAAAbAAAAHAAAAB0AAAAeAAAAHwAAAAMAAAAEAAAABQAAAAYAAAAHAAAACAAAAAkAAAAKAAAACwAAAAwAAAANAAAADgAAAA8AAAAQAAAAEQAAABIAAAATAAAAFAAAABUAAAAWAAAAFwAAABgAAAAZAAAAGgAAABsAAAAcAAAAHQAAAB4AAAAfAAAAIAAAACEAAAAiAAAAIwAAACUAAAAnAAAAKQAAACsAAAAvAAAAMwAAADsAAABDAAAAUwAAAGMAAACDAAAAAwEAAAMCAAADBAAAAwgAAAMQAAADIAAAA0AAAAOAAAADAAEAQeAPC1EBAAAAAQAAAAEAAAABAAAAAgAAAAIAAAADAAAAAwAAAAQAAAAEAAAABQAAAAcAAAAIAAAACQAAAAoAAAALAAAADAAAAA0AAAAOAAAADwAAABAAQcQQC4sBAQAAAAIAAAADAAAABAAAAAUAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAABIAAAAUAAAAFgAAABgAAAAcAAAAIAAAACgAAAAwAAAAQAAAAIAAAAAAAQAAAAIAAAAEAAAACAAAABAAAAAgAAAAQAAAAIAAAAAAAQBBkBIL5gQBAAAAAQAAAAEAAAABAAAAAgAAAAIAAAADAAAAAwAAAAQAAAAGAAAABwAAAAgAAAAJAAAACgAAAAsAAAAMAAAADQAAAA4AAAAPAAAAEAAAAAEAAAAEAAAACAAAAAAAAAABAAEBBgAAAAAAAAQAAAAAEAAABAAAAAAgAAAFAQAAAAAAAAUDAAAAAAAABQQAAAAAAAAFBgAAAAAAAAUHAAAAAAAABQkAAAAAAAAFCgAAAAAAAAUMAAAAAAAABg4AAAAAAAEFEAAAAAAAAQUUAAAAAAABBRYAAAAAAAIFHAAAAAAAAwUgAAAAAAAEBTAAAAAgAAYFQAAAAAAABwWAAAAAAAAIBgABAAAAAAoGAAQAAAAADAYAEAAAIAAABAAAAAAAAAAEAQAAAAAAAAUCAAAAIAAABQQAAAAAAAAFBQAAACAAAAUHAAAAAAAABQgAAAAgAAAFCgAAAAAAAAULAAAAAAAABg0AAAAgAAEFEAAAAAAAAQUSAAAAIAABBRYAAAAAAAIFGAAAACAAAwUgAAAAAAADBSgAAAAAAAYEQAAAABAABgRAAAAAIAAHBYAAAAAAAAkGAAIAAAAACwYACAAAMAAABAAAAAAQAAAEAQAAACAAAAUCAAAAIAAABQMAAAAgAAAFBQAAACAAAAUGAAAAIAAABQgAAAAgAAAFCQAAACAAAAULAAAAIAAABQwAAAAAAAAGDwAAACAAAQUSAAAAIAABBRQAAAAgAAIFGAAAACAAAgUcAAAAIAADBSgAAAAgAAQFMAAAAAAAEAYAAAEAAAAPBgCAAAAAAA4GAEAAAAAADQYAIABBgBcLhwIBAAEBBQAAAAAAAAUAAAAAAAAGBD0AAAAAAAkF/QEAAAAADwX9fwAAAAAVBf3/HwAAAAMFBQAAAAAABwR9AAAAAAAMBf0PAAAAABIF/f8DAAAAFwX9/38AAAAFBR0AAAAAAAgE/QAAAAAADgX9PwAAAAAUBf3/DwAAAAIFAQAAABAABwR9AAAAAAALBf0HAAAAABEF/f8BAAAAFgX9/z8AAAAEBQ0AAAAQAAgE/QAAAAAADQX9HwAAAAATBf3/BwAAAAEFAQAAABAABgQ9AAAAAAAKBf0DAAAAABAF/f8AAAAAHAX9//8PAAAbBf3//wcAABoF/f//AwAAGQX9//8BAAAYBf3//wBBkBkLhgQBAAEBBgAAAAAAAAYDAAAAAAAABAQAAAAgAAAFBQAAAAAAAAUGAAAAAAAABQgAAAAAAAAFCQAAAAAAAAULAAAAAAAABg0AAAAAAAAGEAAAAAAAAAYTAAAAAAAABhYAAAAAAAAGGQAAAAAAAAYcAAAAAAAABh8AAAAAAAAGIgAAAAAAAQYlAAAAAAABBikAAAAAAAIGLwAAAAAAAwY7AAAAAAAEBlMAAAAAAAcGgwAAAAAACQYDAgAAEAAABAQAAAAAAAAEBQAAACAAAAUGAAAAAAAABQcAAAAgAAAFCQAAAAAAAAUKAAAAAAAABgwAAAAAAAAGDwAAAAAAAAYSAAAAAAAABhUAAAAAAAAGGAAAAAAAAAYbAAAAAAAABh4AAAAAAAAGIQAAAAAAAQYjAAAAAAABBicAAAAAAAIGKwAAAAAAAwYzAAAAAAAEBkMAAAAAAAUGYwAAAAAACAYDAQAAIAAABAQAAAAwAAAEBAAAABAAAAQFAAAAIAAABQcAAAAgAAAFCAAAACAAAAUKAAAAIAAABQsAAAAAAAAGDgAAAAAAAAYRAAAAAAAABhQAAAAAAAAGFwAAAAAAAAYaAAAAAAAABh0AAAAAAAAGIAAAAAAAEAYDAAEAAAAPBgOAAAAAAA4GA0AAAAAADQYDIAAAAAAMBgMQAAAAAAsGAwgAAAAACgYDBABBpB0L2QEBAAAAAwAAAAcAAAAPAAAAHwAAAD8AAAB/AAAA/wAAAP8BAAD/AwAA/wcAAP8PAAD/HwAA/z8AAP9/AAD//wAA//8BAP//AwD//wcA//8PAP//HwD//z8A//9/AP///wD///8B////A////wf///8P////H////z////9/AAAAAAEAAAACAAAABAAAAAAAAAACAAAABAAAAAgAAAAAAAAAAQAAAAIAAAABAAAABAAAAAQAAAAEAAAABAAAAAgAAAAIAAAACAAAAAcAAAAIAAAACQAAAAoAAAALAEGgIAsDwBBQ",Lg=new WeakMap;let Ng=0,Ug;class es extends ca{constructor(e){super(e),this.transcoderPath="",this.transcoderBinary=null,this.transcoderPending=null,this.workerPool=new ON,this.workerSourceURL="",this.workerConfig=null,typeof MSC_TRANSCODER<"u"&&console.warn('THREE.KTX2Loader: Please update to latest "basis_transcoder". "msc_basis_transcoder" is no longer supported in three.js r125+.')}setTranscoderPath(e){return this.transcoderPath=e,this}setWorkerLimit(e){return this.workerPool.setWorkerLimit(e),this}async detectSupportAsync(e){return this.workerConfig={astcSupported:await e.hasFeatureAsync("texture-compression-astc"),etc1Supported:await e.hasFeatureAsync("texture-compression-etc1"),etc2Supported:await e.hasFeatureAsync("texture-compression-etc2"),dxtSupported:await e.hasFeatureAsync("texture-compression-bc"),bptcSupported:await e.hasFeatureAsync("texture-compression-bptc"),pvrtcSupported:await e.hasFeatureAsync("texture-compression-pvrtc")},this}detectSupport(e){return e.isWebGPURenderer===!0?this.workerConfig={astcSupported:e.hasFeature("texture-compression-astc"),etc1Supported:e.hasFeature("texture-compression-etc1"),etc2Supported:e.hasFeature("texture-compression-etc2"),dxtSupported:e.hasFeature("texture-compression-bc"),bptcSupported:e.hasFeature("texture-compression-bptc"),pvrtcSupported:e.hasFeature("texture-compression-pvrtc")}:(this.workerConfig={astcSupported:e.extensions.has("WEBGL_compressed_texture_astc"),etc1Supported:e.extensions.has("WEBGL_compressed_texture_etc1"),etc2Supported:e.extensions.has("WEBGL_compressed_texture_etc"),dxtSupported:e.extensions.has("WEBGL_compressed_texture_s3tc"),bptcSupported:e.extensions.has("EXT_texture_compression_bptc"),pvrtcSupported:e.extensions.has("WEBGL_compressed_texture_pvrtc")||e.extensions.has("WEBKIT_WEBGL_compressed_texture_pvrtc")},this.workerConfig.etc1Supported=!1),this}init(){if(!this.transcoderPending){const e=new kl(this.manager);e.setPath(this.transcoderPath),e.setWithCredentials(this.withCredentials);const t=e.loadAsync("basis_transcoder.js"),n=new kl(this.manager);n.setPath(this.transcoderPath),n.setResponseType("arraybuffer"),n.setWithCredentials(this.withCredentials);const i=n.loadAsync("basis_transcoder.wasm");this.transcoderPending=Promise.all([t,i]).then(([s,o])=>{const l=es.BasisWorker.toString(),h=["/* constants */","let _EngineFormat = "+JSON.stringify(es.EngineFormat),"let _TranscoderFormat = "+JSON.stringify(es.TranscoderFormat),"let _BasisFormat = "+JSON.stringify(es.BasisFormat),"/* basis_transcoder.js */",s,"/* worker */",l.substring(l.indexOf("{")+1,l.lastIndexOf("}"))].join(`
3829
+ `);this.workerSourceURL=URL.createObjectURL(new Blob([h])),this.transcoderBinary=o,this.workerPool.setWorkerCreator(()=>{const u=new Worker(this.workerSourceURL),d=this.transcoderBinary.slice(0);return u.postMessage({type:"init",config:this.workerConfig,transcoderBinary:d},[d]),u})}),Ng>0&&console.warn("THREE.KTX2Loader: Multiple active KTX2 loaders may cause performance issues. Use a single KTX2Loader instance, or call .dispose() on old instances."),Ng++}return this.transcoderPending}load(e,t,n,i){if(this.workerConfig===null)throw new Error("THREE.KTX2Loader: Missing initialization with `.detectSupport( renderer )`.");const s=new kl(this.manager);s.setResponseType("arraybuffer"),s.setWithCredentials(this.withCredentials),s.load(e,o=>{if(Lg.has(o))return Lg.get(o).promise.then(t).catch(i);this._createTexture(o).then(l=>t?t(l):null).catch(i)},n,i)}_createTextureFrom(e,t){const{faces:n,width:i,height:s,format:o,type:l,error:h,dfdFlags:u}=e;if(l==="error")return Promise.reject(h);let d;if(t.faceCount===6)d=new I8(n,o,mr);else{const A=n[0].mipmaps;d=t.layerCount>1?new w8(A,i,s,t.layerCount,o,mr):new zd(A,i,s,o,mr)}return d.minFilter=n[0].mipmaps.length===1?gr:Ci,d.magFilter=gr,d.generateMipmaps=!1,d.needsUpdate=!0,d.colorSpace=Jx(t),d.premultiplyAlpha=!!(u&zN),d}async _createTexture(e,t={}){const n=YN(new Uint8Array(e));if(n.vkFormat!==jN)return KN(n);const i=t,s=this.init().then(()=>this.workerPool.postMessage({type:"transcode",buffer:e,taskConfig:i},[e])).then(o=>this._createTextureFrom(o.data,n));return Lg.set(e,{promise:s}),s}dispose(){return this.workerPool.dispose(),this.workerSourceURL&&URL.revokeObjectURL(this.workerSourceURL),Ng--,this}}es.BasisFormat={ETC1S:0,UASTC_4x4:1},es.TranscoderFormat={ETC1:0,ETC2:1,BC1:2,BC3:3,BC4:4,BC5:5,BC7_M6_OPAQUE_ONLY:6,BC7_M5:7,PVRTC1_4_RGB:8,PVRTC1_4_RGBA:9,ASTC_4x4:10,ATC_RGB:11,ATC_RGBA_INTERPOLATED_ALPHA:12,RGBA32:13,RGB565:14,BGR565:15,RGBA4444:16},es.EngineFormat={RGBAFormat:vr,RGBA_ASTC_4x4_Format:BA,RGBA_BPTC_Format:sd,RGBA_ETC2_EAC_Format:TA,RGBA_PVRTC_4BPPV1_Format:CA,RGBA_S3TC_DXT5_Format:nd,RGB_ETC1_Format:MA,RGB_ETC2_Format:SA,RGB_PVRTC_4BPPV1_Format:IA,RGB_S3TC_DXT1_Format:rd},es.BasisWorker=function(){let r,e,t;const n=_EngineFormat,i=_TranscoderFormat,s=_BasisFormat;self.addEventListener("message",function(_){const E=_.data;switch(E.type){case"init":r=E.config,o(E.transcoderBinary);break;case"transcode":e.then(()=>{try{const{faces:m,buffers:v,width:w,height:x,hasAlpha:I,format:R,dfdFlags:S}=l(E.buffer);self.postMessage({type:"transcode",id:E.id,faces:m,width:w,height:x,hasAlpha:I,format:R,dfdFlags:S},v)}catch(m){console.error(m),self.postMessage({type:"error",id:E.id,error:m.message})}});break}});function o(_){e=new Promise(E=>{t={wasmBinary:_,onRuntimeInitialized:E},BASIS(t)}).then(()=>{t.initializeBasis(),t.KTX2File===void 0&&console.warn("THREE.KTX2Loader: Please update Basis Universal transcoder.")})}function l(_){const E=new t.KTX2File(new Uint8Array(_));function m(){E.close(),E.delete()}if(!E.isValid())throw m(),new Error("THREE.KTX2Loader: Invalid or unsupported .ktx2 file");const v=E.isUASTC()?s.UASTC_4x4:s.ETC1S,w=E.getWidth(),x=E.getHeight(),I=E.getLayers()||1,R=E.getLevels(),S=E.getFaces(),T=E.getHasAlpha(),D=E.getDFDFlags(),{transcoderFormat:b,engineFormat:M}=A(v,w,x,T);if(!w||!x||!R)throw m(),new Error("THREE.KTX2Loader: Invalid texture");if(!E.startTranscoding())throw m(),new Error("THREE.KTX2Loader: .startTranscoding failed");const L=[],P=[];for(let N=0;N<S;N++){const W=[];for(let X=0;X<R;X++){const K=[];let te,V;for(let Q=0;Q<I;Q++){const z=E.getImageLevelInfo(X,Q,N);N===0&&X===0&&Q===0&&(z.origWidth%4!==0||z.origHeight%4!==0)&&console.warn("THREE.KTX2Loader: ETC1S and UASTC textures should use multiple-of-four dimensions."),R>1?(te=z.origWidth,V=z.origHeight):(te=z.width,V=z.height);const Z=new Uint8Array(E.getImageTranscodedSizeInBytes(X,Q,0,b));if(!E.transcodeImage(Z,X,Q,N,b,0,-1,-1))throw m(),new Error("THREE.KTX2Loader: .transcodeImage failed.");K.push(Z)}const ee=g(K);W.push({data:ee,width:te,height:V}),P.push(ee.buffer)}L.push({mipmaps:W,width:w,height:x,format:M})}return m(),{faces:L,buffers:P,width:w,height:x,hasAlpha:T,format:M,dfdFlags:D}}const h=[{if:"astcSupported",basisFormat:[s.UASTC_4x4],transcoderFormat:[i.ASTC_4x4,i.ASTC_4x4],engineFormat:[n.RGBA_ASTC_4x4_Format,n.RGBA_ASTC_4x4_Format],priorityETC1S:1/0,priorityUASTC:1,needsPowerOfTwo:!1},{if:"bptcSupported",basisFormat:[s.ETC1S,s.UASTC_4x4],transcoderFormat:[i.BC7_M5,i.BC7_M5],engineFormat:[n.RGBA_BPTC_Format,n.RGBA_BPTC_Format],priorityETC1S:3,priorityUASTC:2,needsPowerOfTwo:!1},{if:"dxtSupported",basisFormat:[s.ETC1S,s.UASTC_4x4],transcoderFormat:[i.BC1,i.BC3],engineFormat:[n.RGB_S3TC_DXT1_Format,n.RGBA_S3TC_DXT5_Format],priorityETC1S:4,priorityUASTC:5,needsPowerOfTwo:!1},{if:"etc2Supported",basisFormat:[s.ETC1S,s.UASTC_4x4],transcoderFormat:[i.ETC1,i.ETC2],engineFormat:[n.RGB_ETC2_Format,n.RGBA_ETC2_EAC_Format],priorityETC1S:1,priorityUASTC:3,needsPowerOfTwo:!1},{if:"etc1Supported",basisFormat:[s.ETC1S,s.UASTC_4x4],transcoderFormat:[i.ETC1],engineFormat:[n.RGB_ETC1_Format],priorityETC1S:2,priorityUASTC:4,needsPowerOfTwo:!1},{if:"pvrtcSupported",basisFormat:[s.ETC1S,s.UASTC_4x4],transcoderFormat:[i.PVRTC1_4_RGB,i.PVRTC1_4_RGBA],engineFormat:[n.RGB_PVRTC_4BPPV1_Format,n.RGBA_PVRTC_4BPPV1_Format],priorityETC1S:5,priorityUASTC:6,needsPowerOfTwo:!0}],u=h.sort(function(_,E){return _.priorityETC1S-E.priorityETC1S}),d=h.sort(function(_,E){return _.priorityUASTC-E.priorityUASTC});function A(_,E,m,v){let w,x;const I=_===s.ETC1S?u:d;for(let R=0;R<I.length;R++){const S=I[R];if(r[S.if]&&S.basisFormat.includes(_)&&!(v&&S.transcoderFormat.length<2)&&!(S.needsPowerOfTwo&&!(p(E)&&p(m))))return w=S.transcoderFormat[v?1:0],x=S.engineFormat[v?1:0],{transcoderFormat:w,engineFormat:x}}return console.warn("THREE.KTX2Loader: No suitable compressed texture format found. Decoding to RGBA32."),w=i.RGBA32,x=n.RGBAFormat,{transcoderFormat:w,engineFormat:x}}function p(_){return _<=2?!0:(_&_-1)===0&&_!==0}function g(_){if(_.length===1)return _[0];let E=0;for(let w=0;w<_.length;w++){const x=_[w];E+=x.byteLength}const m=new Uint8Array(E);let v=0;for(let w=0;w<_.length;w++){const x=_[w];m.set(x,v),v+=x.byteLength}return m}};const XN=new Set([vr,so,ea]),Pg={[Wx]:vr,[Gx]:vr,[Ox]:vr,[Fx]:vr,[jx]:so,[Hx]:so,[kx]:so,[Qx]:so,[Vx]:ea,[zx]:ea,[Px]:ea,[Ux]:ea,[qx]:id,[Yx]:id},kg={[Wx]:lr,[Gx]:Or,[Ox]:mr,[Fx]:mr,[jx]:lr,[Hx]:Or,[kx]:mr,[Qx]:mr,[Vx]:lr,[zx]:Or,[Px]:mr,[Ux]:mr,[qx]:mr,[Yx]:mr};async function KN(r){const{vkFormat:e}=r;if(Pg[e]===void 0)throw new Error("THREE.KTX2Loader: Unsupported vkFormat.");let t;r.supercompressionScheme===Lx&&(Ug||(Ug=new Promise(async s=>{const o=new qN;await o.init(),s(o)})),t=await Ug);const n=[];for(let s=0;s<r.levels.length;s++){const o=Math.max(1,r.pixelWidth>>s),l=Math.max(1,r.pixelHeight>>s),h=r.pixelDepth?Math.max(1,r.pixelDepth>>s):0,u=r.levels[s];let d;if(r.supercompressionScheme===FN)d=u.levelData;else if(r.supercompressionScheme===Lx)d=t.decode(u.levelData,u.uncompressedByteLength);else throw new Error("THREE.KTX2Loader: Unsupported supercompressionScheme.");let A;kg[e]===lr?A=new Float32Array(d.buffer,d.byteOffset,d.byteLength/Float32Array.BYTES_PER_ELEMENT):kg[e]===Or?A=new Uint16Array(d.buffer,d.byteOffset,d.byteLength/Uint16Array.BYTES_PER_ELEMENT):A=d,n.push({data:A,width:o,height:l,depth:h})}let i;if(XN.has(Pg[e]))i=r.pixelDepth===0?new mo(n[0].data,r.pixelWidth,r.pixelHeight):new WE(n[0].data,r.pixelWidth,r.pixelHeight,r.pixelDepth);else{if(r.pixelDepth>0)throw new Error("THREE.KTX2Loader: Unsupported pixelDepth.");i=new zd(n,r.pixelWidth,r.pixelHeight)}return i.mipmaps=n,i.type=kg[e],i.format=Pg[e],i.colorSpace=Jx(r),i.needsUpdate=!0,Promise.resolve(i)}function Jx(r){const e=r.dataFormatDescriptor[0];return e.colorPrimaries===GN?e.transferFunction===Nx?Fr:cr:e.colorPrimaries===VN?e.transferFunction===Nx?ad:cu:(e.colorPrimaries===HN||console.warn(`THREE.KTX2Loader: Unsupported color primaries, "${e.colorPrimaries}"`),ms)}class JN extends Q8{constructor(e){super(e),this.type=Or}parse(e){const t=function(v,w){switch(v){case 1:throw new Error("THREE.RGBELoader: Read Error: "+(w||""));case 2:throw new Error("THREE.RGBELoader: Write Error: "+(w||""));case 3:throw new Error("THREE.RGBELoader: Bad File Format: "+(w||""));default:case 4:throw new Error("THREE.RGBELoader: Memory Error: "+(w||""))}},n=`
3830
3830
  `,i=function(v,w,x){w=w||1024;let I=v.pos,R=-1,S=0,T="",D=String.fromCharCode.apply(null,new Uint16Array(v.subarray(I,I+128)));for(;0>(R=D.indexOf(n))&&S<w&&I<v.byteLength;)T+=D,S+=D.length,I+=128,D+=String.fromCharCode.apply(null,new Uint16Array(v.subarray(I,I+128)));return-1<R?(x!==!1&&(v.pos+=S+R+1),T+D.slice(0,R)):!1},s=function(v){const w=/^#\?(\S+)/,x=/^\s*GAMMA\s*=\s*(\d+(\.\d+)?)\s*$/,I=/^\s*EXPOSURE\s*=\s*(\d+(\.\d+)?)\s*$/,R=/^\s*FORMAT=(\S+)\s*$/,S=/^\s*\-Y\s+(\d+)\s+\+X\s+(\d+)\s*$/,T={valid:0,string:"",comments:"",programtype:"RGBE",format:"",gamma:1,exposure:1,width:0,height:0};let D,b;for((v.pos>=v.byteLength||!(D=i(v)))&&t(1,"no header found"),(b=D.match(w))||t(3,"bad initial token"),T.valid|=1,T.programtype=b[1],T.string+=D+`
3831
3831
  `;D=i(v),D!==!1;){if(T.string+=D+`
3832
3832
  `,D.charAt(0)==="#"){T.comments+=D+`
@@ -3853,7 +3853,7 @@ void main() {
3853
3853
  gl_FragColor = opacity * texel;
3854
3854
 
3855
3855
 
3856
- }`};class Ol{constructor(){this.isPass=!0,this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1}setSize(){}render(){console.error("THREE.Pass: .render() must be implemented in derived pass.")}dispose(){}}const ZN=new _u(-1,1,1,-1,0,1);class $N extends Vn{constructor(){super(),this.setAttribute("position",new Li([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute("uv",new Li([0,2,0,0,2,0],2))}}const eU=new $N;class Og{constructor(e){this._mesh=new Xr(eU,e)}dispose(){this._mesh.geometry.dispose()}render(e){e.render(this._mesh,ZN)}get material(){return this._mesh.material}set material(e){this._mesh.material=e}}class Fg extends Ol{constructor(e,t){super(),this.textureID=t!==void 0?t:"tDiffuse",e instanceof Cr?(this.uniforms=e.uniforms,this.material=e):e&&(this.uniforms=Ml.clone(e.uniforms),this.material=new Cr({name:e.name!==void 0?e.name:"unspecified",defines:Object.assign({},e.defines),uniforms:this.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader})),this.fsQuad=new Og(this.material)}render(e,t,n){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=n.texture),this.fsQuad.material=this.material,this.renderToScreen?(e.setRenderTarget(null),this.fsQuad.render(e)):(e.setRenderTarget(t),this.clear&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),this.fsQuad.render(e))}dispose(){this.material.dispose(),this.fsQuad.dispose()}}class $x extends Ol{constructor(e,t){super(),this.scene=e,this.camera=t,this.clear=!0,this.needsSwap=!1,this.inverse=!1}render(e,t,n){const i=e.getContext(),s=e.state;s.buffers.color.setMask(!1),s.buffers.depth.setMask(!1),s.buffers.color.setLocked(!0),s.buffers.depth.setLocked(!0);let o,l;this.inverse?(o=0,l=1):(o=1,l=0),s.buffers.stencil.setTest(!0),s.buffers.stencil.setOp(i.REPLACE,i.REPLACE,i.REPLACE),s.buffers.stencil.setFunc(i.ALWAYS,o,4294967295),s.buffers.stencil.setClear(l),s.buffers.stencil.setLocked(!0),e.setRenderTarget(n),this.clear&&e.clear(),e.render(this.scene,this.camera),e.setRenderTarget(t),this.clear&&e.clear(),e.render(this.scene,this.camera),s.buffers.color.setLocked(!1),s.buffers.depth.setLocked(!1),s.buffers.color.setMask(!0),s.buffers.depth.setMask(!0),s.buffers.stencil.setLocked(!1),s.buffers.stencil.setFunc(i.EQUAL,1,4294967295),s.buffers.stencil.setOp(i.KEEP,i.KEEP,i.KEEP),s.buffers.stencil.setLocked(!0)}}class tU extends Ol{constructor(){super(),this.needsSwap=!1}render(e){e.state.buffers.stencil.setLocked(!1),e.state.buffers.stencil.setTest(!1)}}class zg{constructor(e,t){if(this.renderer=e,this._pixelRatio=e.getPixelRatio(),t===void 0){const n=e.getSize(new Ue);this._width=n.width,this._height=n.height,t=new cn(this._width*this._pixelRatio,this._height*this._pixelRatio,{type:Or}),t.texture.name="EffectComposer.rt1"}else this._width=t.width,this._height=t.height;this.renderTarget1=t,this.renderTarget2=t.clone(),this.renderTarget2.texture.name="EffectComposer.rt2",this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2,this.renderToScreen=!0,this.passes=[],this.copyPass=new Fg(Zx),this.copyPass.material.blending=gs,this.clock=new W8}swapBuffers(){const e=this.readBuffer;this.readBuffer=this.writeBuffer,this.writeBuffer=e}addPass(e){this.passes.push(e),e.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}insertPass(e,t){this.passes.splice(t,0,e),e.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}removePass(e){const t=this.passes.indexOf(e);t!==-1&&this.passes.splice(t,1)}isLastEnabledPass(e){for(let t=e+1;t<this.passes.length;t++)if(this.passes[t].enabled)return!1;return!0}render(e){e===void 0&&(e=this.clock.getDelta());const t=this.renderer.getRenderTarget();let n=!1;for(let i=0,s=this.passes.length;i<s;i++){const o=this.passes[i];if(o.enabled!==!1){if(o.renderToScreen=this.renderToScreen&&this.isLastEnabledPass(i),o.render(this.renderer,this.writeBuffer,this.readBuffer,e,n),o.needsSwap){if(n){const l=this.renderer.getContext(),h=this.renderer.state.buffers.stencil;h.setFunc(l.NOTEQUAL,1,4294967295),this.copyPass.render(this.renderer,this.writeBuffer,this.readBuffer,e),h.setFunc(l.EQUAL,1,4294967295)}this.swapBuffers()}$x!==void 0&&(o instanceof $x?n=!0:o instanceof tU&&(n=!1))}}this.renderer.setRenderTarget(t)}reset(e){if(e===void 0){const t=this.renderer.getSize(new Ue);this._pixelRatio=this.renderer.getPixelRatio(),this._width=t.width,this._height=t.height,e=this.renderTarget1.clone(),e.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}this.renderTarget1.dispose(),this.renderTarget2.dispose(),this.renderTarget1=e,this.renderTarget2=e.clone(),this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2}setSize(e,t){this._width=e,this._height=t;const n=this._width*this._pixelRatio,i=this._height*this._pixelRatio;this.renderTarget1.setSize(n,i),this.renderTarget2.setSize(n,i);for(let s=0;s<this.passes.length;s++)this.passes[s].setSize(n,i)}setPixelRatio(e){this._pixelRatio=e,this.setSize(this._width,this._height)}dispose(){this.renderTarget1.dispose(),this.renderTarget2.dispose(),this.copyPass.dispose()}}const rU={name:"OutputShader",uniforms:{tDiffuse:{value:null},toneMappingExposure:{value:1}},vertexShader:`
3856
+ }`};class Ol{constructor(){this.isPass=!0,this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1}setSize(){}render(){console.error("THREE.Pass: .render() must be implemented in derived pass.")}dispose(){}}const ZN=new _u(-1,1,1,-1,0,1);class $N extends Vn{constructor(){super(),this.setAttribute("position",new Li([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute("uv",new Li([0,2,0,0,2,0],2))}}const eU=new $N;class Qg{constructor(e){this._mesh=new Xr(eU,e)}dispose(){this._mesh.geometry.dispose()}render(e){e.render(this._mesh,ZN)}get material(){return this._mesh.material}set material(e){this._mesh.material=e}}class Og extends Ol{constructor(e,t){super(),this.textureID=t!==void 0?t:"tDiffuse",e instanceof Cr?(this.uniforms=e.uniforms,this.material=e):e&&(this.uniforms=Ml.clone(e.uniforms),this.material=new Cr({name:e.name!==void 0?e.name:"unspecified",defines:Object.assign({},e.defines),uniforms:this.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader})),this.fsQuad=new Qg(this.material)}render(e,t,n){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=n.texture),this.fsQuad.material=this.material,this.renderToScreen?(e.setRenderTarget(null),this.fsQuad.render(e)):(e.setRenderTarget(t),this.clear&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),this.fsQuad.render(e))}dispose(){this.material.dispose(),this.fsQuad.dispose()}}class $x extends Ol{constructor(e,t){super(),this.scene=e,this.camera=t,this.clear=!0,this.needsSwap=!1,this.inverse=!1}render(e,t,n){const i=e.getContext(),s=e.state;s.buffers.color.setMask(!1),s.buffers.depth.setMask(!1),s.buffers.color.setLocked(!0),s.buffers.depth.setLocked(!0);let o,l;this.inverse?(o=0,l=1):(o=1,l=0),s.buffers.stencil.setTest(!0),s.buffers.stencil.setOp(i.REPLACE,i.REPLACE,i.REPLACE),s.buffers.stencil.setFunc(i.ALWAYS,o,4294967295),s.buffers.stencil.setClear(l),s.buffers.stencil.setLocked(!0),e.setRenderTarget(n),this.clear&&e.clear(),e.render(this.scene,this.camera),e.setRenderTarget(t),this.clear&&e.clear(),e.render(this.scene,this.camera),s.buffers.color.setLocked(!1),s.buffers.depth.setLocked(!1),s.buffers.color.setMask(!0),s.buffers.depth.setMask(!0),s.buffers.stencil.setLocked(!1),s.buffers.stencil.setFunc(i.EQUAL,1,4294967295),s.buffers.stencil.setOp(i.KEEP,i.KEEP,i.KEEP),s.buffers.stencil.setLocked(!0)}}class tU extends Ol{constructor(){super(),this.needsSwap=!1}render(e){e.state.buffers.stencil.setLocked(!1),e.state.buffers.stencil.setTest(!1)}}class Fg{constructor(e,t){if(this.renderer=e,this._pixelRatio=e.getPixelRatio(),t===void 0){const n=e.getSize(new Ue);this._width=n.width,this._height=n.height,t=new cn(this._width*this._pixelRatio,this._height*this._pixelRatio,{type:Or}),t.texture.name="EffectComposer.rt1"}else this._width=t.width,this._height=t.height;this.renderTarget1=t,this.renderTarget2=t.clone(),this.renderTarget2.texture.name="EffectComposer.rt2",this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2,this.renderToScreen=!0,this.passes=[],this.copyPass=new Og(Zx),this.copyPass.material.blending=gs,this.clock=new W8}swapBuffers(){const e=this.readBuffer;this.readBuffer=this.writeBuffer,this.writeBuffer=e}addPass(e){this.passes.push(e),e.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}insertPass(e,t){this.passes.splice(t,0,e),e.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}removePass(e){const t=this.passes.indexOf(e);t!==-1&&this.passes.splice(t,1)}isLastEnabledPass(e){for(let t=e+1;t<this.passes.length;t++)if(this.passes[t].enabled)return!1;return!0}render(e){e===void 0&&(e=this.clock.getDelta());const t=this.renderer.getRenderTarget();let n=!1;for(let i=0,s=this.passes.length;i<s;i++){const o=this.passes[i];if(o.enabled!==!1){if(o.renderToScreen=this.renderToScreen&&this.isLastEnabledPass(i),o.render(this.renderer,this.writeBuffer,this.readBuffer,e,n),o.needsSwap){if(n){const l=this.renderer.getContext(),h=this.renderer.state.buffers.stencil;h.setFunc(l.NOTEQUAL,1,4294967295),this.copyPass.render(this.renderer,this.writeBuffer,this.readBuffer,e),h.setFunc(l.EQUAL,1,4294967295)}this.swapBuffers()}$x!==void 0&&(o instanceof $x?n=!0:o instanceof tU&&(n=!1))}}this.renderer.setRenderTarget(t)}reset(e){if(e===void 0){const t=this.renderer.getSize(new Ue);this._pixelRatio=this.renderer.getPixelRatio(),this._width=t.width,this._height=t.height,e=this.renderTarget1.clone(),e.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}this.renderTarget1.dispose(),this.renderTarget2.dispose(),this.renderTarget1=e,this.renderTarget2=e.clone(),this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2}setSize(e,t){this._width=e,this._height=t;const n=this._width*this._pixelRatio,i=this._height*this._pixelRatio;this.renderTarget1.setSize(n,i),this.renderTarget2.setSize(n,i);for(let s=0;s<this.passes.length;s++)this.passes[s].setSize(n,i)}setPixelRatio(e){this._pixelRatio=e,this.setSize(this._width,this._height)}dispose(){this.renderTarget1.dispose(),this.renderTarget2.dispose(),this.copyPass.dispose()}}const rU={name:"OutputShader",uniforms:{tDiffuse:{value:null},toneMappingExposure:{value:1}},vertexShader:`
3857
3857
  precision highp float;
3858
3858
 
3859
3859
  uniform mat4 modelViewMatrix;
@@ -3920,7 +3920,7 @@ void main() {
3920
3920
 
3921
3921
  #endif
3922
3922
 
3923
- }`};class ew extends Ol{constructor(){super();const e=rU;this.uniforms=Ml.clone(e.uniforms),this.material=new C8({name:e.name,uniforms:this.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader}),this.fsQuad=new Og(this.material),this._outputColorSpace=null,this._toneMapping=null}render(e,t,n){this.uniforms.tDiffuse.value=n.texture,this.uniforms.toneMappingExposure.value=e.toneMappingExposure,(this._outputColorSpace!==e.outputColorSpace||this._toneMapping!==e.toneMapping)&&(this._outputColorSpace=e.outputColorSpace,this._toneMapping=e.toneMapping,this.material.defines={},Tt.getTransfer(this._outputColorSpace)===Ht&&(this.material.defines.SRGB_TRANSFER=""),this._toneMapping===eE?this.material.defines.LINEAR_TONE_MAPPING="":this._toneMapping===tE?this.material.defines.REINHARD_TONE_MAPPING="":this._toneMapping===rE?this.material.defines.CINEON_TONE_MAPPING="":this._toneMapping===nE?this.material.defines.ACES_FILMIC_TONE_MAPPING="":this._toneMapping===iE?this.material.defines.AGX_TONE_MAPPING="":this._toneMapping===vA&&(this.material.defines.NEUTRAL_TONE_MAPPING=""),this.material.needsUpdate=!0),this.renderToScreen===!0?(e.setRenderTarget(null),this.fsQuad.render(e)):(e.setRenderTarget(t),this.clear&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),this.fsQuad.render(e))}dispose(){this.material.dispose(),this.fsQuad.dispose()}}class tw extends Ol{constructor(e,t,n=null,i=null,s=null){super(),this.scene=e,this.camera=t,this.overrideMaterial=n,this.clearColor=i,this.clearAlpha=s,this.clear=!0,this.clearDepth=!1,this.needsSwap=!1,this._oldClearColor=new Ve}render(e,t,n){const i=e.autoClear;e.autoClear=!1;let s,o;this.overrideMaterial!==null&&(o=this.scene.overrideMaterial,this.scene.overrideMaterial=this.overrideMaterial),this.clearColor!==null&&(e.getClearColor(this._oldClearColor),e.setClearColor(this.clearColor)),this.clearAlpha!==null&&(s=e.getClearAlpha(),e.setClearAlpha(this.clearAlpha)),this.clearDepth==!0&&e.clearDepth(),e.setRenderTarget(this.renderToScreen?null:n),this.clear===!0&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),e.render(this.scene,this.camera),this.clearColor!==null&&e.setClearColor(this._oldClearColor),this.clearAlpha!==null&&e.setClearAlpha(s),this.overrideMaterial!==null&&(this.scene.overrideMaterial=o),e.autoClear=i}}const nU={name:"LuminosityHighPassShader",shaderID:"luminosityHighPass",uniforms:{tDiffuse:{value:null},luminosityThreshold:{value:1},smoothWidth:{value:1},defaultColor:{value:new Ve(0)},defaultOpacity:{value:0}},vertexShader:`
3923
+ }`};class ew extends Ol{constructor(){super();const e=rU;this.uniforms=Ml.clone(e.uniforms),this.material=new C8({name:e.name,uniforms:this.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader}),this.fsQuad=new Qg(this.material),this._outputColorSpace=null,this._toneMapping=null}render(e,t,n){this.uniforms.tDiffuse.value=n.texture,this.uniforms.toneMappingExposure.value=e.toneMappingExposure,(this._outputColorSpace!==e.outputColorSpace||this._toneMapping!==e.toneMapping)&&(this._outputColorSpace=e.outputColorSpace,this._toneMapping=e.toneMapping,this.material.defines={},Tt.getTransfer(this._outputColorSpace)===Ht&&(this.material.defines.SRGB_TRANSFER=""),this._toneMapping===mA?this.material.defines.LINEAR_TONE_MAPPING="":this._toneMapping===eE?this.material.defines.REINHARD_TONE_MAPPING="":this._toneMapping===tE?this.material.defines.CINEON_TONE_MAPPING="":this._toneMapping===rE?this.material.defines.ACES_FILMIC_TONE_MAPPING="":this._toneMapping===nE?this.material.defines.AGX_TONE_MAPPING="":this._toneMapping===iE&&(this.material.defines.NEUTRAL_TONE_MAPPING=""),this.material.needsUpdate=!0),this.renderToScreen===!0?(e.setRenderTarget(null),this.fsQuad.render(e)):(e.setRenderTarget(t),this.clear&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),this.fsQuad.render(e))}dispose(){this.material.dispose(),this.fsQuad.dispose()}}class tw extends Ol{constructor(e,t,n=null,i=null,s=null){super(),this.scene=e,this.camera=t,this.overrideMaterial=n,this.clearColor=i,this.clearAlpha=s,this.clear=!0,this.clearDepth=!1,this.needsSwap=!1,this._oldClearColor=new Ve}render(e,t,n){const i=e.autoClear;e.autoClear=!1;let s,o;this.overrideMaterial!==null&&(o=this.scene.overrideMaterial,this.scene.overrideMaterial=this.overrideMaterial),this.clearColor!==null&&(e.getClearColor(this._oldClearColor),e.setClearColor(this.clearColor)),this.clearAlpha!==null&&(s=e.getClearAlpha(),e.setClearAlpha(this.clearAlpha)),this.clearDepth==!0&&e.clearDepth(),e.setRenderTarget(this.renderToScreen?null:n),this.clear===!0&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),e.render(this.scene,this.camera),this.clearColor!==null&&e.setClearColor(this._oldClearColor),this.clearAlpha!==null&&e.setClearAlpha(s),this.overrideMaterial!==null&&(this.scene.overrideMaterial=o),e.autoClear=i}}const nU={name:"LuminosityHighPassShader",shaderID:"luminosityHighPass",uniforms:{tDiffuse:{value:null},luminosityThreshold:{value:1},smoothWidth:{value:1},defaultColor:{value:new Ve(0)},defaultOpacity:{value:0}},vertexShader:`
3924
3924
 
3925
3925
  varying vec2 vUv;
3926
3926
 
@@ -3954,7 +3954,7 @@ void main() {
3954
3954
 
3955
3955
  gl_FragColor = mix( outputColor, texel, alpha );
3956
3956
 
3957
- }`};class yo extends Ol{constructor(e,t,n,i){super(),this.strength=t!==void 0?t:1,this.radius=n,this.threshold=i,this.resolution=e!==void 0?new Ue(e.x,e.y):new Ue(256,256),this.clearColor=new Ve(0,0,0),this.renderTargetsHorizontal=[],this.renderTargetsVertical=[],this.nMips=5;let s=Math.round(this.resolution.x/2),o=Math.round(this.resolution.y/2);this.renderTargetBright=new cn(s,o,{type:Or}),this.renderTargetBright.texture.name="UnrealBloomPass.bright",this.renderTargetBright.texture.generateMipmaps=!1;for(let A=0;A<this.nMips;A++){const p=new cn(s,o,{type:Or});p.texture.name="UnrealBloomPass.h"+A,p.texture.generateMipmaps=!1,this.renderTargetsHorizontal.push(p);const g=new cn(s,o,{type:Or});g.texture.name="UnrealBloomPass.v"+A,g.texture.generateMipmaps=!1,this.renderTargetsVertical.push(g),s=Math.round(s/2),o=Math.round(o/2)}const l=nU;this.highPassUniforms=Ml.clone(l.uniforms),this.highPassUniforms.luminosityThreshold.value=i,this.highPassUniforms.smoothWidth.value=.01,this.materialHighPassFilter=new Cr({uniforms:this.highPassUniforms,vertexShader:l.vertexShader,fragmentShader:l.fragmentShader}),this.separableBlurMaterials=[];const h=[3,5,7,9,11];s=Math.round(this.resolution.x/2),o=Math.round(this.resolution.y/2);for(let A=0;A<this.nMips;A++)this.separableBlurMaterials.push(this.getSeperableBlurMaterial(h[A])),this.separableBlurMaterials[A].uniforms.invSize.value=new Ue(1/s,1/o),s=Math.round(s/2),o=Math.round(o/2);this.compositeMaterial=this.getCompositeMaterial(this.nMips),this.compositeMaterial.uniforms.blurTexture1.value=this.renderTargetsVertical[0].texture,this.compositeMaterial.uniforms.blurTexture2.value=this.renderTargetsVertical[1].texture,this.compositeMaterial.uniforms.blurTexture3.value=this.renderTargetsVertical[2].texture,this.compositeMaterial.uniforms.blurTexture4.value=this.renderTargetsVertical[3].texture,this.compositeMaterial.uniforms.blurTexture5.value=this.renderTargetsVertical[4].texture,this.compositeMaterial.uniforms.bloomStrength.value=t,this.compositeMaterial.uniforms.bloomRadius.value=.1;const u=[1,.8,.6,.4,.2];this.compositeMaterial.uniforms.bloomFactors.value=u,this.bloomTintColors=[new G(1,1,1),new G(1,1,1),new G(1,1,1),new G(1,1,1),new G(1,1,1)],this.compositeMaterial.uniforms.bloomTintColors.value=this.bloomTintColors;const d=Zx;this.copyUniforms=Ml.clone(d.uniforms),this.blendMaterial=new Cr({uniforms:this.copyUniforms,vertexShader:d.vertexShader,fragmentShader:d.fragmentShader,blending:AA,depthTest:!1,depthWrite:!1,transparent:!0}),this.enabled=!0,this.needsSwap=!1,this._oldClearColor=new Ve,this.oldClearAlpha=1,this.basic=new Ki,this.fsQuad=new Og(null)}dispose(){for(let e=0;e<this.renderTargetsHorizontal.length;e++)this.renderTargetsHorizontal[e].dispose();for(let e=0;e<this.renderTargetsVertical.length;e++)this.renderTargetsVertical[e].dispose();this.renderTargetBright.dispose();for(let e=0;e<this.separableBlurMaterials.length;e++)this.separableBlurMaterials[e].dispose();this.compositeMaterial.dispose(),this.blendMaterial.dispose(),this.basic.dispose(),this.fsQuad.dispose()}setSize(e,t){let n=Math.round(e/2),i=Math.round(t/2);this.renderTargetBright.setSize(n,i);for(let s=0;s<this.nMips;s++)this.renderTargetsHorizontal[s].setSize(n,i),this.renderTargetsVertical[s].setSize(n,i),this.separableBlurMaterials[s].uniforms.invSize.value=new Ue(1/n,1/i),n=Math.round(n/2),i=Math.round(i/2)}render(e,t,n,i,s){e.getClearColor(this._oldClearColor),this.oldClearAlpha=e.getClearAlpha();const o=e.autoClear;e.autoClear=!1,e.setClearColor(this.clearColor,0),s&&e.state.buffers.stencil.setTest(!1),this.renderToScreen&&(this.fsQuad.material=this.basic,this.basic.map=n.texture,e.setRenderTarget(null),e.clear(),this.fsQuad.render(e)),this.highPassUniforms.tDiffuse.value=n.texture,this.highPassUniforms.luminosityThreshold.value=this.threshold,this.fsQuad.material=this.materialHighPassFilter,e.setRenderTarget(this.renderTargetBright),e.clear(),this.fsQuad.render(e);let l=this.renderTargetBright;for(let h=0;h<this.nMips;h++)this.fsQuad.material=this.separableBlurMaterials[h],this.separableBlurMaterials[h].uniforms.colorTexture.value=l.texture,this.separableBlurMaterials[h].uniforms.direction.value=yo.BlurDirectionX,e.setRenderTarget(this.renderTargetsHorizontal[h]),e.clear(),this.fsQuad.render(e),this.separableBlurMaterials[h].uniforms.colorTexture.value=this.renderTargetsHorizontal[h].texture,this.separableBlurMaterials[h].uniforms.direction.value=yo.BlurDirectionY,e.setRenderTarget(this.renderTargetsVertical[h]),e.clear(),this.fsQuad.render(e),l=this.renderTargetsVertical[h];this.fsQuad.material=this.compositeMaterial,this.compositeMaterial.uniforms.bloomStrength.value=this.strength,this.compositeMaterial.uniforms.bloomRadius.value=this.radius,this.compositeMaterial.uniforms.bloomTintColors.value=this.bloomTintColors,e.setRenderTarget(this.renderTargetsHorizontal[0]),e.clear(),this.fsQuad.render(e),this.fsQuad.material=this.blendMaterial,this.copyUniforms.tDiffuse.value=this.renderTargetsHorizontal[0].texture,s&&e.state.buffers.stencil.setTest(!0),this.renderToScreen?(e.setRenderTarget(null),this.fsQuad.render(e)):(e.setRenderTarget(n),this.fsQuad.render(e)),e.setClearColor(this._oldClearColor,this.oldClearAlpha),e.autoClear=o}getSeperableBlurMaterial(e){const t=[];for(let n=0;n<e;n++)t.push(.39894*Math.exp(-.5*n*n/(e*e))/e);return new Cr({defines:{KERNEL_RADIUS:e},uniforms:{colorTexture:{value:null},invSize:{value:new Ue(.5,.5)},direction:{value:new Ue(.5,.5)},gaussianCoefficients:{value:t}},vertexShader:`varying vec2 vUv;
3957
+ }`};class yo extends Ol{constructor(e,t,n,i){super(),this.strength=t!==void 0?t:1,this.radius=n,this.threshold=i,this.resolution=e!==void 0?new Ue(e.x,e.y):new Ue(256,256),this.clearColor=new Ve(0,0,0),this.renderTargetsHorizontal=[],this.renderTargetsVertical=[],this.nMips=5;let s=Math.round(this.resolution.x/2),o=Math.round(this.resolution.y/2);this.renderTargetBright=new cn(s,o,{type:Or}),this.renderTargetBright.texture.name="UnrealBloomPass.bright",this.renderTargetBright.texture.generateMipmaps=!1;for(let A=0;A<this.nMips;A++){const p=new cn(s,o,{type:Or});p.texture.name="UnrealBloomPass.h"+A,p.texture.generateMipmaps=!1,this.renderTargetsHorizontal.push(p);const g=new cn(s,o,{type:Or});g.texture.name="UnrealBloomPass.v"+A,g.texture.generateMipmaps=!1,this.renderTargetsVertical.push(g),s=Math.round(s/2),o=Math.round(o/2)}const l=nU;this.highPassUniforms=Ml.clone(l.uniforms),this.highPassUniforms.luminosityThreshold.value=i,this.highPassUniforms.smoothWidth.value=.01,this.materialHighPassFilter=new Cr({uniforms:this.highPassUniforms,vertexShader:l.vertexShader,fragmentShader:l.fragmentShader}),this.separableBlurMaterials=[];const h=[3,5,7,9,11];s=Math.round(this.resolution.x/2),o=Math.round(this.resolution.y/2);for(let A=0;A<this.nMips;A++)this.separableBlurMaterials.push(this.getSeperableBlurMaterial(h[A])),this.separableBlurMaterials[A].uniforms.invSize.value=new Ue(1/s,1/o),s=Math.round(s/2),o=Math.round(o/2);this.compositeMaterial=this.getCompositeMaterial(this.nMips),this.compositeMaterial.uniforms.blurTexture1.value=this.renderTargetsVertical[0].texture,this.compositeMaterial.uniforms.blurTexture2.value=this.renderTargetsVertical[1].texture,this.compositeMaterial.uniforms.blurTexture3.value=this.renderTargetsVertical[2].texture,this.compositeMaterial.uniforms.blurTexture4.value=this.renderTargetsVertical[3].texture,this.compositeMaterial.uniforms.blurTexture5.value=this.renderTargetsVertical[4].texture,this.compositeMaterial.uniforms.bloomStrength.value=t,this.compositeMaterial.uniforms.bloomRadius.value=.1;const u=[1,.8,.6,.4,.2];this.compositeMaterial.uniforms.bloomFactors.value=u,this.bloomTintColors=[new G(1,1,1),new G(1,1,1),new G(1,1,1),new G(1,1,1),new G(1,1,1)],this.compositeMaterial.uniforms.bloomTintColors.value=this.bloomTintColors;const d=Zx;this.copyUniforms=Ml.clone(d.uniforms),this.blendMaterial=new Cr({uniforms:this.copyUniforms,vertexShader:d.vertexShader,fragmentShader:d.fragmentShader,blending:pA,depthTest:!1,depthWrite:!1,transparent:!0}),this.enabled=!0,this.needsSwap=!1,this._oldClearColor=new Ve,this.oldClearAlpha=1,this.basic=new Ki,this.fsQuad=new Qg(null)}dispose(){for(let e=0;e<this.renderTargetsHorizontal.length;e++)this.renderTargetsHorizontal[e].dispose();for(let e=0;e<this.renderTargetsVertical.length;e++)this.renderTargetsVertical[e].dispose();this.renderTargetBright.dispose();for(let e=0;e<this.separableBlurMaterials.length;e++)this.separableBlurMaterials[e].dispose();this.compositeMaterial.dispose(),this.blendMaterial.dispose(),this.basic.dispose(),this.fsQuad.dispose()}setSize(e,t){let n=Math.round(e/2),i=Math.round(t/2);this.renderTargetBright.setSize(n,i);for(let s=0;s<this.nMips;s++)this.renderTargetsHorizontal[s].setSize(n,i),this.renderTargetsVertical[s].setSize(n,i),this.separableBlurMaterials[s].uniforms.invSize.value=new Ue(1/n,1/i),n=Math.round(n/2),i=Math.round(i/2)}render(e,t,n,i,s){e.getClearColor(this._oldClearColor),this.oldClearAlpha=e.getClearAlpha();const o=e.autoClear;e.autoClear=!1,e.setClearColor(this.clearColor,0),s&&e.state.buffers.stencil.setTest(!1),this.renderToScreen&&(this.fsQuad.material=this.basic,this.basic.map=n.texture,e.setRenderTarget(null),e.clear(),this.fsQuad.render(e)),this.highPassUniforms.tDiffuse.value=n.texture,this.highPassUniforms.luminosityThreshold.value=this.threshold,this.fsQuad.material=this.materialHighPassFilter,e.setRenderTarget(this.renderTargetBright),e.clear(),this.fsQuad.render(e);let l=this.renderTargetBright;for(let h=0;h<this.nMips;h++)this.fsQuad.material=this.separableBlurMaterials[h],this.separableBlurMaterials[h].uniforms.colorTexture.value=l.texture,this.separableBlurMaterials[h].uniforms.direction.value=yo.BlurDirectionX,e.setRenderTarget(this.renderTargetsHorizontal[h]),e.clear(),this.fsQuad.render(e),this.separableBlurMaterials[h].uniforms.colorTexture.value=this.renderTargetsHorizontal[h].texture,this.separableBlurMaterials[h].uniforms.direction.value=yo.BlurDirectionY,e.setRenderTarget(this.renderTargetsVertical[h]),e.clear(),this.fsQuad.render(e),l=this.renderTargetsVertical[h];this.fsQuad.material=this.compositeMaterial,this.compositeMaterial.uniforms.bloomStrength.value=this.strength,this.compositeMaterial.uniforms.bloomRadius.value=this.radius,this.compositeMaterial.uniforms.bloomTintColors.value=this.bloomTintColors,e.setRenderTarget(this.renderTargetsHorizontal[0]),e.clear(),this.fsQuad.render(e),this.fsQuad.material=this.blendMaterial,this.copyUniforms.tDiffuse.value=this.renderTargetsHorizontal[0].texture,s&&e.state.buffers.stencil.setTest(!0),this.renderToScreen?(e.setRenderTarget(null),this.fsQuad.render(e)):(e.setRenderTarget(n),this.fsQuad.render(e)),e.setClearColor(this._oldClearColor,this.oldClearAlpha),e.autoClear=o}getSeperableBlurMaterial(e){const t=[];for(let n=0;n<e;n++)t.push(.39894*Math.exp(-.5*n*n/(e*e))/e);return new Cr({defines:{KERNEL_RADIUS:e},uniforms:{colorTexture:{value:null},invSize:{value:new Ue(.5,.5)},direction:{value:new Ue(.5,.5)},gaussianCoefficients:{value:t}},vertexShader:`varying vec2 vUv;
3958
3958
  void main() {
3959
3959
  vUv = uv;
3960
3960
  gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
@@ -4068,7 +4068,7 @@ void main() {
4068
4068
 
4069
4069
  gl_FragColor = sum;
4070
4070
 
4071
- }`},rw=0,aU=1,nw=2,iw=2,Hg=1.25,sw=1,Eo=6*4+4+4,Wd=65535,oU=Math.pow(2,-24),Gg=Symbol("SKIP_GENERATION");function aw(r){return r.index?r.index.count:r.attributes.position.count}function Fl(r){return aw(r)/3}function ow(r,e=ArrayBuffer){return r>65535?new Uint32Array(new e(4*r)):new Uint16Array(new e(2*r))}function lU(r,e){if(!r.index){const t=r.attributes.position.count,n=e.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer,i=ow(t,n);r.setIndex(new zr(i,1));for(let s=0;s<t;s++)i[s]=s}}function lw(r){const e=Fl(r),t=r.drawRange,n=t.start/3,i=(t.start+t.count)/3,s=Math.max(0,n),o=Math.min(e,i)-s;return[{offset:Math.floor(s),count:Math.floor(o)}]}function cw(r){if(!r.groups||!r.groups.length)return lw(r);const e=[],t=new Set,n=r.drawRange,i=n.start/3,s=(n.start+n.count)/3;for(const l of r.groups){const h=l.start/3,u=(l.start+l.count)/3;t.add(Math.max(i,h)),t.add(Math.min(s,u))}const o=Array.from(t.values()).sort((l,h)=>l-h);for(let l=0;l<o.length-1;l++){const h=o[l],u=o[l+1];e.push({offset:Math.floor(h),count:Math.floor(u-h)})}return e}function cU(r){if(r.groups.length===0)return!1;const e=Fl(r),t=cw(r).sort((s,o)=>s.offset-o.offset),n=t[t.length-1];n.count=Math.min(e-n.offset,n.count);let i=0;return t.forEach(({count:s})=>i+=s),e!==i}function rr(r,e,t){return t.min.x=e[r],t.min.y=e[r+1],t.min.z=e[r+2],t.max.x=e[r+3],t.max.y=e[r+4],t.max.z=e[r+5],t}function uU(r){r[0]=r[1]=r[2]=1/0,r[3]=r[4]=r[5]=-1/0}function uw(r){let e=-1,t=-1/0;for(let n=0;n<3;n++){const i=r[n+3]-r[n];i>t&&(t=i,e=n)}return e}function hw(r,e){e.set(r)}function dw(r,e,t){let n,i;for(let s=0;s<3;s++){const o=s+3;n=r[s],i=e[s],t[s]=n<i?n:i,n=r[o],i=e[o],t[o]=n>i?n:i}}function Yd(r,e,t){for(let n=0;n<3;n++){const i=e[r+2*n],s=e[r+2*n+1],o=i-s,l=i+s;o<t[n]&&(t[n]=o),l>t[n+3]&&(t[n+3]=l)}}function Tu(r){const e=r[3]-r[0],t=r[4]-r[1],n=r[5]-r[2];return 2*(e*t+t*n+n*e)}function Vg(r,e,t,n,i=null){let s=1/0,o=1/0,l=1/0,h=-1/0,u=-1/0,d=-1/0,A=1/0,p=1/0,g=1/0,_=-1/0,E=-1/0,m=-1/0;const v=i!==null;for(let w=e*6,x=(e+t)*6;w<x;w+=6){const I=r[w+0],R=r[w+1],S=I-R,T=I+R;S<s&&(s=S),T>h&&(h=T),v&&I<A&&(A=I),v&&I>_&&(_=I);const D=r[w+2],b=r[w+3],M=D-b,L=D+b;M<o&&(o=M),L>u&&(u=L),v&&D<p&&(p=D),v&&D>E&&(E=D);const P=r[w+4],N=r[w+5],W=P-N,X=P+N;W<l&&(l=W),X>d&&(d=X),v&&P<g&&(g=P),v&&P>m&&(m=P)}n[0]=s,n[1]=o,n[2]=l,n[3]=h,n[4]=u,n[5]=d,v&&(i[0]=A,i[1]=p,i[2]=g,i[3]=_,i[4]=E,i[5]=m)}function hU(r,e,t,n){let i=1/0,s=1/0,o=1/0,l=-1/0,h=-1/0,u=-1/0;for(let d=e*6,A=(e+t)*6;d<A;d+=6){const p=r[d+0];p<i&&(i=p),p>l&&(l=p);const g=r[d+2];g<s&&(s=g),g>h&&(h=g);const _=r[d+4];_<o&&(o=_),_>u&&(u=_)}n[0]=i,n[1]=s,n[2]=o,n[3]=l,n[4]=h,n[5]=u}function dU(r,e){uU(e);const t=r.attributes.position,n=r.index?r.index.array:null,i=Fl(r),s=new Float32Array(i*6),o=t.normalized,l=t.array,h=t.offset||0;let u=3;t.isInterleavedBufferAttribute&&(u=t.data.stride);const d=["getX","getY","getZ"];for(let A=0;A<i;A++){const p=A*3,g=A*6;let _=p+0,E=p+1,m=p+2;n&&(_=n[_],E=n[E],m=n[m]),o||(_=_*u+h,E=E*u+h,m=m*u+h);for(let v=0;v<3;v++){let w,x,I;o?(w=t[d[v]](_),x=t[d[v]](E),I=t[d[v]](m)):(w=l[_+v],x=l[E+v],I=l[m+v]);let R=w;x<R&&(R=x),I<R&&(R=I);let S=w;x>S&&(S=x),I>S&&(S=I);const T=(S-R)/2,D=v*2;s[g+D+0]=R+T,s[g+D+1]=T+(Math.abs(R)+T)*oU,R<e[v]&&(e[v]=R),S>e[v+3]&&(e[v+3]=S)}}return s}const Ts=32,fU=(r,e)=>r.candidate-e.candidate,da=new Array(Ts).fill().map(()=>({count:0,bounds:new Float32Array(6),rightCacheBounds:new Float32Array(6),leftCacheBounds:new Float32Array(6),candidate:0})),qd=new Float32Array(6);function pU(r,e,t,n,i,s){let o=-1,l=0;if(s===rw)o=uw(e),o!==-1&&(l=(e[o]+e[o+3])/2);else if(s===aU)o=uw(r),o!==-1&&(l=AU(t,n,i,o));else if(s===nw){const h=Tu(r);let u=Hg*i;const d=n*6,A=(n+i)*6;for(let p=0;p<3;p++){const g=e[p],_=(e[p+3]-g)/Ts;if(i<Ts/4){const E=[...da];E.length=i;let m=0;for(let w=d;w<A;w+=6,m++){const x=E[m];x.candidate=t[w+2*p],x.count=0;const{bounds:I,leftCacheBounds:R,rightCacheBounds:S}=x;for(let T=0;T<3;T++)S[T]=1/0,S[T+3]=-1/0,R[T]=1/0,R[T+3]=-1/0,I[T]=1/0,I[T+3]=-1/0;Yd(w,t,I)}E.sort(fU);let v=i;for(let w=0;w<v;w++){const x=E[w];for(;w+1<v&&E[w+1].candidate===x.candidate;)E.splice(w+1,1),v--}for(let w=d;w<A;w+=6){const x=t[w+2*p];for(let I=0;I<v;I++){const R=E[I];x>=R.candidate?Yd(w,t,R.rightCacheBounds):(Yd(w,t,R.leftCacheBounds),R.count++)}}for(let w=0;w<v;w++){const x=E[w],I=x.count,R=i-x.count,S=x.leftCacheBounds,T=x.rightCacheBounds;let D=0;I!==0&&(D=Tu(S)/h);let b=0;R!==0&&(b=Tu(T)/h);const M=sw+Hg*(D*I+b*R);M<u&&(o=p,u=M,l=x.candidate)}}else{for(let v=0;v<Ts;v++){const w=da[v];w.count=0,w.candidate=g+_+v*_;const x=w.bounds;for(let I=0;I<3;I++)x[I]=1/0,x[I+3]=-1/0}for(let v=d;v<A;v+=6){let w=~~((t[v+2*p]-g)/_);w>=Ts&&(w=Ts-1);const x=da[w];x.count++,Yd(v,t,x.bounds)}const E=da[Ts-1];hw(E.bounds,E.rightCacheBounds);for(let v=Ts-2;v>=0;v--){const w=da[v],x=da[v+1];dw(w.bounds,x.rightCacheBounds,w.rightCacheBounds)}let m=0;for(let v=0;v<Ts-1;v++){const w=da[v],x=w.count,I=w.bounds,R=da[v+1].rightCacheBounds;x!==0&&(m===0?hw(I,qd):dw(I,qd,qd)),m+=x;let S=0,T=0;m!==0&&(S=Tu(qd)/h);const D=i-m;D!==0&&(T=Tu(R)/h);const b=sw+Hg*(S*m+T*D);b<u&&(o=p,u=b,l=w.candidate)}}}}else console.warn(`MeshBVH: Invalid build strategy value ${s} used.`);return{axis:o,pos:l}}function AU(r,e,t,n){let i=0;for(let s=e,o=e+t;s<o;s++)i+=r[s*6+n*2];return i/t}class Xd{constructor(){}}function gU(r,e,t,n,i,s){let o=n,l=n+i-1;const h=s.pos,u=s.axis*2;for(;;){for(;o<=l&&t[o*6+u]<h;)o++;for(;o<=l&&t[l*6+u]>=h;)l--;if(o<l){for(let d=0;d<3;d++){let A=e[o*3+d];e[o*3+d]=e[l*3+d],e[l*3+d]=A}for(let d=0;d<6;d++){let A=t[o*6+d];t[o*6+d]=t[l*6+d],t[l*6+d]=A}o++,l--}else return o}}function mU(r,e,t,n,i,s){let o=n,l=n+i-1;const h=s.pos,u=s.axis*2;for(;;){for(;o<=l&&t[o*6+u]<h;)o++;for(;o<=l&&t[l*6+u]>=h;)l--;if(o<l){let d=r[o];r[o]=r[l],r[l]=d;for(let A=0;A<6;A++){let p=t[o*6+A];t[o*6+A]=t[l*6+A],t[l*6+A]=p}o++,l--}else return o}}function vU(r,e){const t=(r.index?r.index.count:r.attributes.position.count)/3,n=t>2**16,i=n?4:2,s=e?new SharedArrayBuffer(t*i):new ArrayBuffer(t*i),o=n?new Uint32Array(s):new Uint16Array(s);for(let l=0,h=o.length;l<h;l++)o[l]=l;return o}function _U(r,e){const t=r.geometry,n=t.index?t.index.array:null,i=e.maxDepth,s=e.verbose,o=e.maxLeafTris,l=e.strategy,h=e.onProgress,u=Fl(t),d=r._indirectBuffer;let A=!1;const p=new Float32Array(6),g=new Float32Array(6),_=dU(t,p),E=e.indirect?mU:gU,m=[],v=e.indirect?lw(t):cw(t);if(v.length===1){const I=v[0],R=new Xd;R.boundingData=p,hU(_,I.offset,I.count,g),x(R,I.offset,I.count,g),m.push(R)}else for(let I of v){const R=new Xd;R.boundingData=new Float32Array(6),Vg(_,I.offset,I.count,R.boundingData,g),x(R,I.offset,I.count,g),m.push(R)}return m;function w(I){h&&h(I/u)}function x(I,R,S,T=null,D=0){if(!A&&D>=i&&(A=!0,s&&(console.warn(`MeshBVH: Max depth of ${i} reached when generating BVH. Consider increasing maxDepth.`),console.warn(t))),S<=o||D>=i)return w(R+S),I.offset=R,I.count=S,I;const b=pU(I.boundingData,T,_,R,S,l);if(b.axis===-1)return w(R+S),I.offset=R,I.count=S,I;const M=E(d,n,_,R,S,b);if(M===R||M===R+S)w(R+S),I.offset=R,I.count=S;else{I.splitAxis=b.axis;const L=new Xd,P=R,N=M-R;I.left=L,L.boundingData=new Float32Array(6),Vg(_,P,N,L.boundingData,g),x(L,P,N,g,D+1);const W=new Xd,X=M,K=S-N;I.right=W,W.boundingData=new Float32Array(6),Vg(_,X,K,W.boundingData,g),x(W,X,K,g,D+1)}return I}}function yU(r,e){const t=r.geometry;e.indirect&&(r._indirectBuffer=vU(t,e.useSharedArrayBuffer),cU(t)&&!e.verbose&&console.warn('MeshBVH: Provided geometry contains groups that do not fully span the vertex contents while using the "indirect" option. BVH may incorrectly report intersections on unrendered portions of the geometry.')),r._indirectBuffer||lU(t,e);const n=_U(r,e);let i,s,o;const l=[],h=e.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer;for(let A=0;A<n.length;A++){const p=n[A];let g=u(p);const _=new h(Eo*g);i=new Float32Array(_),s=new Uint32Array(_),o=new Uint16Array(_),d(0,p),l.push(_)}r._roots=l;return;function u(A){return A.count?1:1+u(A.left)+u(A.right)}function d(A,p){const g=A/4,_=A/2,E=!!p.count,m=p.boundingData;for(let v=0;v<6;v++)i[g+v]=m[v];if(E){const v=p.offset,w=p.count;return s[g+6]=v,o[_+14]=w,o[_+15]=Wd,A+Eo}else{const v=p.left,w=p.right,x=p.splitAxis;let I;if(I=d(A+Eo,v),I/4>Math.pow(2,32))throw new Error("MeshBVH: Cannot store child pointer greater than 32 bits.");return s[g+6]=I/4,I=d(I,w),s[g+7]=x,I}}}class Bs{constructor(){this.min=1/0,this.max=-1/0}setFromPointsField(e,t){let n=1/0,i=-1/0;for(let s=0,o=e.length;s<o;s++){const l=e[s][t];n=l<n?l:n,i=l>i?l:i}this.min=n,this.max=i}setFromPoints(e,t){let n=1/0,i=-1/0;for(let s=0,o=t.length;s<o;s++){const l=t[s],h=e.dot(l);n=h<n?h:n,i=h>i?h:i}this.min=n,this.max=i}isSeparated(e){return this.min>e.max||e.min>this.max}}Bs.prototype.setFromBox=function(){const r=new G;return function(e,t){const n=t.min,i=t.max;let s=1/0,o=-1/0;for(let l=0;l<=1;l++)for(let h=0;h<=1;h++)for(let u=0;u<=1;u++){r.x=n.x*l+i.x*(1-l),r.y=n.y*h+i.y*(1-h),r.z=n.z*u+i.z*(1-u);const d=e.dot(r);s=Math.min(d,s),o=Math.max(d,o)}this.min=s,this.max=o}}();const EU=function(){const r=new G,e=new G,t=new G;return function(n,i,s){const o=n.start,l=r,h=i.start,u=e;t.subVectors(o,h),r.subVectors(n.end,n.start),e.subVectors(i.end,i.start);const d=t.dot(u),A=u.dot(l),p=u.dot(u),g=t.dot(l),_=l.dot(l)*p-A*A;let E,m;_!==0?E=(d*A-g*p)/_:E=0,m=(d+E*A)/p,s.x=E,s.y=m}}(),jg=function(){const r=new Ue,e=new G,t=new G;return function(n,i,s,o){EU(n,i,r);let l=r.x,h=r.y;if(l>=0&&l<=1&&h>=0&&h<=1){n.at(l,s),i.at(h,o);return}else if(l>=0&&l<=1){h<0?i.at(0,o):i.at(1,o),n.closestPointToPoint(o,!0,s);return}else if(h>=0&&h<=1){l<0?n.at(0,s):n.at(1,s),i.closestPointToPoint(s,!0,o);return}else{let u;l<0?u=n.start:u=n.end;let d;h<0?d=i.start:d=i.end;const A=e,p=t;if(n.closestPointToPoint(d,!0,e),i.closestPointToPoint(u,!0,t),A.distanceToSquared(d)<=p.distanceToSquared(u)){s.copy(A),o.copy(d);return}else{s.copy(u),o.copy(p);return}}}}(),xU=function(){const r=new G,e=new G,t=new Ji,n=new Ms;return function(i,s){const{radius:o,center:l}=i,{a:h,b:u,c:d}=s;if(n.start=h,n.end=u,n.closestPointToPoint(l,!0,r).distanceTo(l)<=o||(n.start=h,n.end=d,n.closestPointToPoint(l,!0,r).distanceTo(l)<=o)||(n.start=u,n.end=d,n.closestPointToPoint(l,!0,r).distanceTo(l)<=o))return!0;const A=s.getPlane(t);if(Math.abs(A.distanceToPoint(l))<=o){const p=A.projectPoint(l,e);if(s.containsPoint(p))return!0}return!1}}(),wU=1e-15;function Wg(r){return Math.abs(r)<wU}class Ui extends un{constructor(...e){super(...e),this.isExtendedTriangle=!0,this.satAxes=new Array(4).fill().map(()=>new G),this.satBounds=new Array(4).fill().map(()=>new Bs),this.points=[this.a,this.b,this.c],this.sphere=new bi,this.plane=new Ji,this.needsUpdate=!0}intersectsSphere(e){return xU(e,this)}update(){const e=this.a,t=this.b,n=this.c,i=this.points,s=this.satAxes,o=this.satBounds,l=s[0],h=o[0];this.getNormal(l),h.setFromPoints(l,i);const u=s[1],d=o[1];u.subVectors(e,t),d.setFromPoints(u,i);const A=s[2],p=o[2];A.subVectors(t,n),p.setFromPoints(A,i);const g=s[3],_=o[3];g.subVectors(n,e),_.setFromPoints(g,i),this.sphere.setFromPoints(this.points),this.plane.setFromNormalAndCoplanarPoint(l,e),this.needsUpdate=!1}}Ui.prototype.closestPointToSegment=function(){const r=new G,e=new G,t=new Ms;return function(n,i=null,s=null){const{start:o,end:l}=n,h=this.points;let u,d=1/0;for(let A=0;A<3;A++){const p=(A+1)%3;t.start.copy(h[A]),t.end.copy(h[p]),jg(t,n,r,e),u=r.distanceToSquared(e),u<d&&(d=u,i&&i.copy(r),s&&s.copy(e))}return this.closestPointToPoint(o,r),u=o.distanceToSquared(r),u<d&&(d=u,i&&i.copy(r),s&&s.copy(o)),this.closestPointToPoint(l,r),u=l.distanceToSquared(r),u<d&&(d=u,i&&i.copy(r),s&&s.copy(l)),Math.sqrt(d)}}(),Ui.prototype.intersectsTriangle=function(){const r=new Ui,e=new Array(3),t=new Array(3),n=new Bs,i=new Bs,s=new G,o=new G,l=new G,h=new G,u=new G,d=new Ms,A=new Ms,p=new Ms,g=new G;function _(E,m,v){const w=E.points;let x=0,I=-1;for(let R=0;R<3;R++){const{start:S,end:T}=d;S.copy(w[R]),T.copy(w[(R+1)%3]),d.delta(o);const D=Wg(m.distanceToPoint(S));if(Wg(m.normal.dot(o))&&D){v.copy(d),x=2;break}const b=m.intersectLine(d,g);if(!b&&D&&g.copy(S),(b||D)&&!Wg(g.distanceTo(T))){if(x<=1)(x===1?v.start:v.end).copy(g),D&&(I=x);else if(x>=2){(I===1?v.start:v.end).copy(g),x=2;break}if(x++,x===2&&I===-1)break}}return x}return function(E,m=null,v=!1){this.needsUpdate&&this.update(),E.isExtendedTriangle?E.needsUpdate&&E.update():(r.copy(E),r.update(),E=r);const w=this.plane,x=E.plane;if(Math.abs(w.normal.dot(x.normal))>1-1e-10){const I=this.satBounds,R=this.satAxes;t[0]=E.a,t[1]=E.b,t[2]=E.c;for(let D=0;D<4;D++){const b=I[D],M=R[D];if(n.setFromPoints(M,t),b.isSeparated(n))return!1}const S=E.satBounds,T=E.satAxes;e[0]=this.a,e[1]=this.b,e[2]=this.c;for(let D=0;D<4;D++){const b=S[D],M=T[D];if(n.setFromPoints(M,e),b.isSeparated(n))return!1}for(let D=0;D<4;D++){const b=R[D];for(let M=0;M<4;M++){const L=T[M];if(s.crossVectors(b,L),n.setFromPoints(s,e),i.setFromPoints(s,t),n.isSeparated(i))return!1}}return m&&(v||console.warn("ExtendedTriangle.intersectsTriangle: Triangles are coplanar which does not support an output edge. Setting edge to 0, 0, 0."),m.start.set(0,0,0),m.end.set(0,0,0)),!0}else{const I=_(this,x,A);if(I===1&&E.containsPoint(A.end))return m&&(m.start.copy(A.end),m.end.copy(A.end)),!0;if(I!==2)return!1;const R=_(E,w,p);if(R===1&&this.containsPoint(p.end))return m&&(m.start.copy(p.end),m.end.copy(p.end)),!0;if(R!==2)return!1;if(A.delta(l),p.delta(h),l.dot(h)<0){let P=p.start;p.start=p.end,p.end=P}const S=A.start.dot(l),T=A.end.dot(l),D=p.start.dot(l),b=p.end.dot(l),M=T<D,L=S<b;return S!==b&&D!==T&&M===L?!1:(m&&(u.subVectors(A.start,p.start),u.dot(l)>0?m.start.copy(A.start):m.start.copy(p.start),u.subVectors(A.end,p.end),u.dot(l)<0?m.end.copy(A.end):m.end.copy(p.end)),!0)}}}(),Ui.prototype.distanceToPoint=function(){const r=new G;return function(e){return this.closestPointToPoint(e,r),e.distanceTo(r)}}(),Ui.prototype.distanceToTriangle=function(){const r=new G,e=new G,t=["a","b","c"],n=new Ms,i=new Ms;return function(s,o=null,l=null){const h=o||l?n:null;if(this.intersectsTriangle(s,h))return(o||l)&&(o&&h.getCenter(o),l&&h.getCenter(l)),0;let u=1/0;for(let d=0;d<3;d++){let A;const p=t[d],g=s[p];this.closestPointToPoint(g,r),A=g.distanceToSquared(r),A<u&&(u=A,o&&o.copy(r),l&&l.copy(g));const _=this[p];s.closestPointToPoint(_,r),A=_.distanceToSquared(r),A<u&&(u=A,o&&o.copy(_),l&&l.copy(r))}for(let d=0;d<3;d++){const A=t[d],p=t[(d+1)%3];n.set(this[A],this[p]);for(let g=0;g<3;g++){const _=t[g],E=t[(g+1)%3];i.set(s[_],s[E]),jg(n,i,r,e);const m=r.distanceToSquared(e);m<u&&(u=m,o&&o.copy(r),l&&l.copy(e))}}return Math.sqrt(u)}}();class An{constructor(e,t,n){this.isOrientedBox=!0,this.min=new G,this.max=new G,this.matrix=new rt,this.invMatrix=new rt,this.points=new Array(8).fill().map(()=>new G),this.satAxes=new Array(3).fill().map(()=>new G),this.satBounds=new Array(3).fill().map(()=>new Bs),this.alignedSatBounds=new Array(3).fill().map(()=>new Bs),this.needsUpdate=!1,e&&this.min.copy(e),t&&this.max.copy(t),n&&this.matrix.copy(n)}set(e,t,n){this.min.copy(e),this.max.copy(t),this.matrix.copy(n),this.needsUpdate=!0}copy(e){this.min.copy(e.min),this.max.copy(e.max),this.matrix.copy(e.matrix),this.needsUpdate=!0}}An.prototype.update=function(){return function(){const r=this.matrix,e=this.min,t=this.max,n=this.points;for(let h=0;h<=1;h++)for(let u=0;u<=1;u++)for(let d=0;d<=1;d++){const A=1*h|2*u|4*d,p=n[A];p.x=h?t.x:e.x,p.y=u?t.y:e.y,p.z=d?t.z:e.z,p.applyMatrix4(r)}const i=this.satBounds,s=this.satAxes,o=n[0];for(let h=0;h<3;h++){const u=s[h],d=i[h],A=1<<h,p=n[A];u.subVectors(o,p),d.setFromPoints(u,n)}const l=this.alignedSatBounds;l[0].setFromPointsField(n,"x"),l[1].setFromPointsField(n,"y"),l[2].setFromPointsField(n,"z"),this.invMatrix.copy(this.matrix).invert(),this.needsUpdate=!1}}(),An.prototype.intersectsBox=function(){const r=new Bs;return function(e){this.needsUpdate&&this.update();const t=e.min,n=e.max,i=this.satBounds,s=this.satAxes,o=this.alignedSatBounds;if(r.min=t.x,r.max=n.x,o[0].isSeparated(r)||(r.min=t.y,r.max=n.y,o[1].isSeparated(r))||(r.min=t.z,r.max=n.z,o[2].isSeparated(r)))return!1;for(let l=0;l<3;l++){const h=s[l],u=i[l];if(r.setFromBox(h,e),u.isSeparated(r))return!1}return!0}}(),An.prototype.intersectsTriangle=function(){const r=new Ui,e=new Array(3),t=new Bs,n=new Bs,i=new G;return function(s){this.needsUpdate&&this.update(),s.isExtendedTriangle?s.needsUpdate&&s.update():(r.copy(s),r.update(),s=r);const o=this.satBounds,l=this.satAxes;e[0]=s.a,e[1]=s.b,e[2]=s.c;for(let A=0;A<3;A++){const p=o[A],g=l[A];if(t.setFromPoints(g,e),p.isSeparated(t))return!1}const h=s.satBounds,u=s.satAxes,d=this.points;for(let A=0;A<3;A++){const p=h[A],g=u[A];if(t.setFromPoints(g,d),p.isSeparated(t))return!1}for(let A=0;A<3;A++){const p=l[A];for(let g=0;g<4;g++){const _=u[g];if(i.crossVectors(p,_),t.setFromPoints(i,e),n.setFromPoints(i,d),t.isSeparated(n))return!1}}return!0}}(),An.prototype.closestPointToPoint=function(){return function(r,e){return this.needsUpdate&&this.update(),e.copy(r).applyMatrix4(this.invMatrix).clamp(this.min,this.max).applyMatrix4(this.matrix),e}}(),An.prototype.distanceToPoint=function(){const r=new G;return function(e){return this.closestPointToPoint(e,r),e.distanceTo(r)}}(),An.prototype.distanceToBox=function(){const r=["x","y","z"],e=new Array(12).fill().map(()=>new Ms),t=new Array(12).fill().map(()=>new Ms),n=new G,i=new G;return function(s,o=0,l=null,h=null){if(this.needsUpdate&&this.update(),this.intersectsBox(s))return(l||h)&&(s.getCenter(i),this.closestPointToPoint(i,n),s.closestPointToPoint(n,i),l&&l.copy(n),h&&h.copy(i)),0;const u=o*o,d=s.min,A=s.max,p=this.points;let g=1/0;for(let E=0;E<8;E++){const m=p[E];i.copy(m).clamp(d,A);const v=m.distanceToSquared(i);if(v<g&&(g=v,l&&l.copy(m),h&&h.copy(i),v<u))return Math.sqrt(v)}let _=0;for(let E=0;E<3;E++)for(let m=0;m<=1;m++)for(let v=0;v<=1;v++){const w=(E+1)%3,x=(E+2)%3,I=m<<w|v<<x,R=1<<E|m<<w|v<<x,S=p[I],T=p[R];e[_].set(S,T);const D=r[E],b=r[w],M=r[x],L=t[_],P=L.start,N=L.end;P[D]=d[D],P[b]=m?d[b]:A[b],P[M]=v?d[M]:A[b],N[D]=A[D],N[b]=m?d[b]:A[b],N[M]=v?d[M]:A[b],_++}for(let E=0;E<=1;E++)for(let m=0;m<=1;m++)for(let v=0;v<=1;v++){i.x=E?A.x:d.x,i.y=m?A.y:d.y,i.z=v?A.z:d.z,this.closestPointToPoint(i,n);const w=i.distanceToSquared(n);if(w<g&&(g=w,l&&l.copy(n),h&&h.copy(i),w<u))return Math.sqrt(w)}for(let E=0;E<12;E++){const m=e[E];for(let v=0;v<12;v++){const w=t[v];jg(m,w,n,i);const x=n.distanceToSquared(i);if(x<g&&(g=x,l&&l.copy(n),h&&h.copy(i),x<u))return Math.sqrt(x)}}return Math.sqrt(g)}}();class Yg{constructor(e){this._getNewPrimitive=e,this._primitives=[]}getPrimitive(){const e=this._primitives;return e.length===0?this._getNewPrimitive():e.pop()}releasePrimitive(e){this._primitives.push(e)}}class IU extends Yg{constructor(){super(()=>new Ui)}}const ai=new IU;function xn(r,e){return e[r+15]===65535}function wn(r,e){return e[r+6]}function jn(r,e){return e[r+14]}function oi(r){return r+8}function Wn(r,e){return e[r+6]}function qg(r,e){return e[r+7]}class CU{constructor(){this.float32Array=null,this.uint16Array=null,this.uint32Array=null;const e=[];let t=null;this.setBuffer=n=>{t&&e.push(t),t=n,this.float32Array=new Float32Array(n),this.uint16Array=new Uint16Array(n),this.uint32Array=new Uint32Array(n)},this.clearBuffer=()=>{t=null,this.float32Array=null,this.uint16Array=null,this.uint32Array=null,e.length!==0&&this.setBuffer(e.pop())}}}const Yt=new CU;let fa,zl;const Hl=[],Kd=new Yg(()=>new _r);function MU(r,e,t,n,i,s){fa=Kd.getPrimitive(),zl=Kd.getPrimitive(),Hl.push(fa,zl),Yt.setBuffer(r._roots[e]);const o=Xg(0,r.geometry,t,n,i,s);Yt.clearBuffer(),Kd.releasePrimitive(fa),Kd.releasePrimitive(zl),Hl.pop(),Hl.pop();const l=Hl.length;return l>0&&(zl=Hl[l-1],fa=Hl[l-2]),o}function Xg(r,e,t,n,i=null,s=0,o=0){const{float32Array:l,uint16Array:h,uint32Array:u}=Yt;let d=r*2;if(xn(d,h)){const A=wn(r,u),p=jn(d,h);return rr(r,l,fa),n(A,p,!1,o,s+r,fa)}else{let A=function(L){const{uint16Array:P,uint32Array:N}=Yt;let W=L*2;for(;!xn(W,P);)L=oi(L),W=L*2;return wn(L,N)},p=function(L){const{uint16Array:P,uint32Array:N}=Yt;let W=L*2;for(;!xn(W,P);)L=Wn(L,N),W=L*2;return wn(L,N)+jn(W,P)};const g=oi(r),_=Wn(r,u);let E=g,m=_,v,w,x,I;if(i&&(x=fa,I=zl,rr(E,l,x),rr(m,l,I),v=i(x),w=i(I),w<v)){E=_,m=g;const L=v;v=w,w=L,x=I}x||(x=fa,rr(E,l,x));const R=xn(E*2,h),S=t(x,R,v,o+1,s+E);let T;if(S===iw){const L=A(E),P=p(E)-L;T=n(L,P,!0,o+1,s+E,x)}else T=S&&Xg(E,e,t,n,i,s,o+1);if(T)return!0;I=zl,rr(m,l,I);const D=xn(m*2,h),b=t(I,D,w,o+1,s+m);let M;if(b===iw){const L=A(m),P=p(m)-L;M=n(L,P,!0,o+1,s+m,I)}else M=b&&Xg(m,e,t,n,i,s,o+1);return!!M}}const Bu=new G,Kg=new G;function SU(r,e,t={},n=0,i=1/0){const s=n*n,o=i*i;let l=1/0,h=null;if(r.shapecast({boundsTraverseOrder:d=>(Bu.copy(e).clamp(d.min,d.max),Bu.distanceToSquared(e)),intersectsBounds:(d,A,p)=>p<l&&p<o,intersectsTriangle:(d,A)=>{d.closestPointToPoint(e,Bu);const p=e.distanceToSquared(Bu);return p<l&&(Kg.copy(Bu),l=p,h=A),p<s}}),l===1/0)return null;const u=Math.sqrt(l);return t.point?t.point.copy(Kg):t.point=Kg.clone(),t.distance=u,t.faceIndex=h,t}const Gl=new G,Vl=new G,jl=new G,Jd=new Ue,Zd=new Ue,$d=new Ue,fw=new G,pw=new G,Aw=new G,ef=new G;function TU(r,e,t,n,i,s){let o;return s===Qr?o=r.intersectTriangle(n,t,e,!0,i):o=r.intersectTriangle(e,t,n,s!==wi,i),o===null?null:{distance:r.origin.distanceTo(i),point:i.clone()}}function BU(r,e,t,n,i,s,o,l,h){Gl.fromBufferAttribute(e,s),Vl.fromBufferAttribute(e,o),jl.fromBufferAttribute(e,l);const u=TU(r,Gl,Vl,jl,ef,h);if(u){n&&(Jd.fromBufferAttribute(n,s),Zd.fromBufferAttribute(n,o),$d.fromBufferAttribute(n,l),u.uv=un.getInterpolation(ef,Gl,Vl,jl,Jd,Zd,$d,new Ue)),i&&(Jd.fromBufferAttribute(i,s),Zd.fromBufferAttribute(i,o),$d.fromBufferAttribute(i,l),u.uv1=un.getInterpolation(ef,Gl,Vl,jl,Jd,Zd,$d,new Ue)),t&&(fw.fromBufferAttribute(t,s),pw.fromBufferAttribute(t,o),Aw.fromBufferAttribute(t,l),u.normal=un.getInterpolation(ef,Gl,Vl,jl,fw,pw,Aw,new G),u.normal.dot(r.direction)>0&&u.normal.multiplyScalar(-1));const d={a:s,b:o,c:l,normal:new G,materialIndex:0};un.getNormal(Gl,Vl,jl,d.normal),u.face=d,u.faceIndex=s}return u}function tf(r,e,t,n,i){const s=n*3;let o=s+0,l=s+1,h=s+2;const u=r.index;r.index&&(o=u.getX(o),l=u.getX(l),h=u.getX(h));const{position:d,normal:A,uv:p,uv1:g}=r.attributes,_=BU(t,d,A,p,g,o,l,h,e);return _?(_.faceIndex=n,i&&i.push(_),_):null}function Mr(r,e,t,n){const i=r.a,s=r.b,o=r.c;let l=e,h=e+1,u=e+2;t&&(l=t.getX(l),h=t.getX(h),u=t.getX(u)),i.x=n.getX(l),i.y=n.getY(l),i.z=n.getZ(l),s.x=n.getX(h),s.y=n.getY(h),s.z=n.getZ(h),o.x=n.getX(u),o.y=n.getY(u),o.z=n.getZ(u)}function bU(r,e,t,n,i,s){const{geometry:o,_indirectBuffer:l}=r;for(let h=n,u=n+i;h<u;h++)tf(o,e,t,h,s)}function RU(r,e,t,n,i){const{geometry:s,_indirectBuffer:o}=r;let l=1/0,h=null;for(let u=n,d=n+i;u<d;u++){let A;A=tf(s,e,t,u),A&&A.distance<l&&(h=A,l=A.distance)}return h}function DU(r,e,t,n,i,s,o){const{geometry:l}=t,{index:h}=l,u=l.attributes.position;for(let d=r,A=e+r;d<A;d++){let p;if(p=d,Mr(o,p*3,h,u),o.needsUpdate=!0,n(o,p,i,s))return!0}return!1}function LU(r,e=null){e&&Array.isArray(e)&&(e=new Set(e));const t=r.geometry,n=t.index?t.index.array:null,i=t.attributes.position;let s,o,l,h,u=0;const d=r._roots;for(let p=0,g=d.length;p<g;p++)s=d[p],o=new Uint32Array(s),l=new Uint16Array(s),h=new Float32Array(s),A(0,u),u+=s.byteLength;function A(p,g,_=!1){const E=p*2;if(l[E+15]===Wd){const m=o[p+6],v=l[E+14];let w=1/0,x=1/0,I=1/0,R=-1/0,S=-1/0,T=-1/0;for(let D=3*m,b=3*(m+v);D<b;D++){let M=n[D];const L=i.getX(M),P=i.getY(M),N=i.getZ(M);L<w&&(w=L),L>R&&(R=L),P<x&&(x=P),P>S&&(S=P),N<I&&(I=N),N>T&&(T=N)}return h[p+0]!==w||h[p+1]!==x||h[p+2]!==I||h[p+3]!==R||h[p+4]!==S||h[p+5]!==T?(h[p+0]=w,h[p+1]=x,h[p+2]=I,h[p+3]=R,h[p+4]=S,h[p+5]=T,!0):!1}else{const m=p+8,v=o[p+6],w=m+g,x=v+g;let I=_,R=!1,S=!1;e?I||(R=e.has(w),S=e.has(x),I=!R&&!S):(R=!0,S=!0);const T=I||R,D=I||S;let b=!1;T&&(b=A(m,g,I));let M=!1;D&&(M=A(v,g,I));const L=b||M;if(L)for(let P=0;P<3;P++){const N=m+P,W=v+P,X=h[N],K=h[N+3],te=h[W],V=h[W+3];h[p+P]=X<te?X:te,h[p+P+3]=K>V?K:V}return L}}}const gw=new _r;function pa(r,e,t,n){return rr(r,e,gw),t.intersectBox(gw,n)}function NU(r,e,t,n,i,s){const{geometry:o,_indirectBuffer:l}=r;for(let h=n,u=n+i;h<u;h++){let d=l?l[h]:h;tf(o,e,t,d,s)}}function UU(r,e,t,n,i){const{geometry:s,_indirectBuffer:o}=r;let l=1/0,h=null;for(let u=n,d=n+i;u<d;u++){let A;A=tf(s,e,t,o?o[u]:u),A&&A.distance<l&&(h=A,l=A.distance)}return h}function PU(r,e,t,n,i,s,o){const{geometry:l}=t,{index:h}=l,u=l.attributes.position;for(let d=r,A=e+r;d<A;d++){let p;if(p=t.resolveTriangleIndex(d),Mr(o,p*3,h,u),o.needsUpdate=!0,n(o,p,i,s))return!0}return!1}const mw=new G;function kU(r,e,t,n,i){Yt.setBuffer(r._roots[e]),Jg(0,r,t,n,i),Yt.clearBuffer()}function Jg(r,e,t,n,i){const{float32Array:s,uint16Array:o,uint32Array:l}=Yt,h=r*2;if(xn(h,o)){const u=wn(r,l),d=jn(h,o);bU(e,t,n,u,d,i)}else{const u=oi(r);pa(u,s,n,mw)&&Jg(u,e,t,n,i);const d=Wn(r,l);pa(d,s,n,mw)&&Jg(d,e,t,n,i)}}const vw=new G,QU=["x","y","z"];function OU(r,e,t,n){Yt.setBuffer(r._roots[e]);const i=Zg(0,r,t,n);return Yt.clearBuffer(),i}function Zg(r,e,t,n){const{float32Array:i,uint16Array:s,uint32Array:o}=Yt;let l=r*2;if(xn(l,s)){const h=wn(r,o),u=jn(l,s);return RU(e,t,n,h,u)}else{const h=qg(r,o),u=QU[h],d=n.direction[u]>=0;let A,p;d?(A=oi(r),p=Wn(r,o)):(A=Wn(r,o),p=oi(r));const g=pa(A,i,n,vw)?Zg(A,e,t,n):null;if(g){const E=g.point[u];if(d?E<=i[p+h]:E>=i[p+h+3])return g}const _=pa(p,i,n,vw)?Zg(p,e,t,n):null;return g&&_?g.distance<=_.distance?g:_:g||_||null}}const rf=new _r,Wl=new Ui,Yl=new Ui,bu=new rt,_w=new An,nf=new An;function FU(r,e,t,n){Yt.setBuffer(r._roots[e]);const i=$g(0,r,t,n);return Yt.clearBuffer(),i}function $g(r,e,t,n,i=null){const{float32Array:s,uint16Array:o,uint32Array:l}=Yt;let h=r*2;if(i===null&&(t.boundingBox||t.computeBoundingBox(),_w.set(t.boundingBox.min,t.boundingBox.max,n),i=_w),xn(h,o)){const u=e.geometry,d=u.index,A=u.attributes.position,p=t.index,g=t.attributes.position,_=wn(r,l),E=jn(h,o);if(bu.copy(n).invert(),t.boundsTree)return rr(r,s,nf),nf.matrix.copy(bu),nf.needsUpdate=!0,t.boundsTree.shapecast({intersectsBounds:m=>nf.intersectsBox(m),intersectsTriangle:m=>{m.a.applyMatrix4(n),m.b.applyMatrix4(n),m.c.applyMatrix4(n),m.needsUpdate=!0;for(let v=_*3,w=(E+_)*3;v<w;v+=3)if(Mr(Yl,v,d,A),Yl.needsUpdate=!0,m.intersectsTriangle(Yl))return!0;return!1}});for(let m=_*3,v=(E+_)*3;m<v;m+=3){Mr(Wl,m,d,A),Wl.a.applyMatrix4(bu),Wl.b.applyMatrix4(bu),Wl.c.applyMatrix4(bu),Wl.needsUpdate=!0;for(let w=0,x=p.count;w<x;w+=3)if(Mr(Yl,w,p,g),Yl.needsUpdate=!0,Wl.intersectsTriangle(Yl))return!0}}else{const u=r+8,d=l[r+6];return rr(u,s,rf),!!(i.intersectsBox(rf)&&$g(u,e,t,n,i)||(rr(d,s,rf),i.intersectsBox(rf)&&$g(d,e,t,n,i)))}}const sf=new rt,em=new An,Ru=new An,zU=new G,HU=new G,GU=new G,VU=new G;function jU(r,e,t,n={},i={},s=0,o=1/0){e.boundingBox||e.computeBoundingBox(),em.set(e.boundingBox.min,e.boundingBox.max,t),em.needsUpdate=!0;const l=r.geometry,h=l.attributes.position,u=l.index,d=e.attributes.position,A=e.index,p=ai.getPrimitive(),g=ai.getPrimitive();let _=zU,E=HU,m=null,v=null;i&&(m=GU,v=VU);let w=1/0,x=null,I=null;return sf.copy(t).invert(),Ru.matrix.copy(sf),r.shapecast({boundsTraverseOrder:R=>em.distanceToBox(R),intersectsBounds:(R,S,T)=>T<w&&T<o?(S&&(Ru.min.copy(R.min),Ru.max.copy(R.max),Ru.needsUpdate=!0),!0):!1,intersectsRange:(R,S)=>{if(e.boundsTree)return e.boundsTree.shapecast({boundsTraverseOrder:T=>Ru.distanceToBox(T),intersectsBounds:(T,D,b)=>b<w&&b<o,intersectsRange:(T,D)=>{for(let b=T,M=T+D;b<M;b++){Mr(g,3*b,A,d),g.a.applyMatrix4(t),g.b.applyMatrix4(t),g.c.applyMatrix4(t),g.needsUpdate=!0;for(let L=R,P=R+S;L<P;L++){Mr(p,3*L,u,h),p.needsUpdate=!0;const N=p.distanceToTriangle(g,_,m);if(N<w&&(E.copy(_),v&&v.copy(m),w=N,x=L,I=b),N<s)return!0}}}});{const T=Fl(e);for(let D=0,b=T;D<b;D++){Mr(g,3*D,A,d),g.a.applyMatrix4(t),g.b.applyMatrix4(t),g.c.applyMatrix4(t),g.needsUpdate=!0;for(let M=R,L=R+S;M<L;M++){Mr(p,3*M,u,h),p.needsUpdate=!0;const P=p.distanceToTriangle(g,_,m);if(P<w&&(E.copy(_),v&&v.copy(m),w=P,x=M,I=D),P<s)return!0}}}}}),ai.releasePrimitive(p),ai.releasePrimitive(g),w===1/0?null:(n.point?n.point.copy(E):n.point=E.clone(),n.distance=w,n.faceIndex=x,i&&(i.point?i.point.copy(v):i.point=v.clone(),i.point.applyMatrix4(sf),E.applyMatrix4(sf),i.distance=E.sub(i.point).length(),i.faceIndex=I),n)}function WU(r,e=null){e&&Array.isArray(e)&&(e=new Set(e));const t=r.geometry,n=t.index?t.index.array:null,i=t.attributes.position;let s,o,l,h,u=0;const d=r._roots;for(let p=0,g=d.length;p<g;p++)s=d[p],o=new Uint32Array(s),l=new Uint16Array(s),h=new Float32Array(s),A(0,u),u+=s.byteLength;function A(p,g,_=!1){const E=p*2;if(l[E+15]===Wd){const m=o[p+6],v=l[E+14];let w=1/0,x=1/0,I=1/0,R=-1/0,S=-1/0,T=-1/0;for(let D=m,b=m+v;D<b;D++){const M=3*r.resolveTriangleIndex(D);for(let L=0;L<3;L++){let P=M+L;P=n?n[P]:P;const N=i.getX(P),W=i.getY(P),X=i.getZ(P);N<w&&(w=N),N>R&&(R=N),W<x&&(x=W),W>S&&(S=W),X<I&&(I=X),X>T&&(T=X)}}return h[p+0]!==w||h[p+1]!==x||h[p+2]!==I||h[p+3]!==R||h[p+4]!==S||h[p+5]!==T?(h[p+0]=w,h[p+1]=x,h[p+2]=I,h[p+3]=R,h[p+4]=S,h[p+5]=T,!0):!1}else{const m=p+8,v=o[p+6],w=m+g,x=v+g;let I=_,R=!1,S=!1;e?I||(R=e.has(w),S=e.has(x),I=!R&&!S):(R=!0,S=!0);const T=I||R,D=I||S;let b=!1;T&&(b=A(m,g,I));let M=!1;D&&(M=A(v,g,I));const L=b||M;if(L)for(let P=0;P<3;P++){const N=m+P,W=v+P,X=h[N],K=h[N+3],te=h[W],V=h[W+3];h[p+P]=X<te?X:te,h[p+P+3]=K>V?K:V}return L}}}const yw=new G;function YU(r,e,t,n,i){Yt.setBuffer(r._roots[e]),tm(0,r,t,n,i),Yt.clearBuffer()}function tm(r,e,t,n,i){const{float32Array:s,uint16Array:o,uint32Array:l}=Yt,h=r*2;if(xn(h,o)){const u=wn(r,l),d=jn(h,o);NU(e,t,n,u,d,i)}else{const u=oi(r);pa(u,s,n,yw)&&tm(u,e,t,n,i);const d=Wn(r,l);pa(d,s,n,yw)&&tm(d,e,t,n,i)}}const Ew=new G,qU=["x","y","z"];function XU(r,e,t,n){Yt.setBuffer(r._roots[e]);const i=rm(0,r,t,n);return Yt.clearBuffer(),i}function rm(r,e,t,n){const{float32Array:i,uint16Array:s,uint32Array:o}=Yt;let l=r*2;if(xn(l,s)){const h=wn(r,o),u=jn(l,s);return UU(e,t,n,h,u)}else{const h=qg(r,o),u=qU[h],d=n.direction[u]>=0;let A,p;d?(A=oi(r),p=Wn(r,o)):(A=Wn(r,o),p=oi(r));const g=pa(A,i,n,Ew)?rm(A,e,t,n):null;if(g){const E=g.point[u];if(d?E<=i[p+h]:E>=i[p+h+3])return g}const _=pa(p,i,n,Ew)?rm(p,e,t,n):null;return g&&_?g.distance<=_.distance?g:_:g||_||null}}const af=new _r,ql=new Ui,Xl=new Ui,Du=new rt,xw=new An,of=new An;function KU(r,e,t,n){Yt.setBuffer(r._roots[e]);const i=nm(0,r,t,n);return Yt.clearBuffer(),i}function nm(r,e,t,n,i=null){const{float32Array:s,uint16Array:o,uint32Array:l}=Yt;let h=r*2;if(i===null&&(t.boundingBox||t.computeBoundingBox(),xw.set(t.boundingBox.min,t.boundingBox.max,n),i=xw),xn(h,o)){const u=e.geometry,d=u.index,A=u.attributes.position,p=t.index,g=t.attributes.position,_=wn(r,l),E=jn(h,o);if(Du.copy(n).invert(),t.boundsTree)return rr(r,s,of),of.matrix.copy(Du),of.needsUpdate=!0,t.boundsTree.shapecast({intersectsBounds:m=>of.intersectsBox(m),intersectsTriangle:m=>{m.a.applyMatrix4(n),m.b.applyMatrix4(n),m.c.applyMatrix4(n),m.needsUpdate=!0;for(let v=_,w=E+_;v<w;v++)if(Mr(Xl,3*e.resolveTriangleIndex(v),d,A),Xl.needsUpdate=!0,m.intersectsTriangle(Xl))return!0;return!1}});for(let m=_,v=E+_;m<v;m++){const w=e.resolveTriangleIndex(m);Mr(ql,3*w,d,A),ql.a.applyMatrix4(Du),ql.b.applyMatrix4(Du),ql.c.applyMatrix4(Du),ql.needsUpdate=!0;for(let x=0,I=p.count;x<I;x+=3)if(Mr(Xl,x,p,g),Xl.needsUpdate=!0,ql.intersectsTriangle(Xl))return!0}}else{const u=r+8,d=l[r+6];return rr(u,s,af),!!(i.intersectsBox(af)&&nm(u,e,t,n,i)||(rr(d,s,af),i.intersectsBox(af)&&nm(d,e,t,n,i)))}}const lf=new rt,im=new An,Lu=new An,JU=new G,ZU=new G,$U=new G,eP=new G;function tP(r,e,t,n={},i={},s=0,o=1/0){e.boundingBox||e.computeBoundingBox(),im.set(e.boundingBox.min,e.boundingBox.max,t),im.needsUpdate=!0;const l=r.geometry,h=l.attributes.position,u=l.index,d=e.attributes.position,A=e.index,p=ai.getPrimitive(),g=ai.getPrimitive();let _=JU,E=ZU,m=null,v=null;i&&(m=$U,v=eP);let w=1/0,x=null,I=null;return lf.copy(t).invert(),Lu.matrix.copy(lf),r.shapecast({boundsTraverseOrder:R=>im.distanceToBox(R),intersectsBounds:(R,S,T)=>T<w&&T<o?(S&&(Lu.min.copy(R.min),Lu.max.copy(R.max),Lu.needsUpdate=!0),!0):!1,intersectsRange:(R,S)=>{if(e.boundsTree){const T=e.boundsTree;return T.shapecast({boundsTraverseOrder:D=>Lu.distanceToBox(D),intersectsBounds:(D,b,M)=>M<w&&M<o,intersectsRange:(D,b)=>{for(let M=D,L=D+b;M<L;M++){const P=T.resolveTriangleIndex(M);Mr(g,3*P,A,d),g.a.applyMatrix4(t),g.b.applyMatrix4(t),g.c.applyMatrix4(t),g.needsUpdate=!0;for(let N=R,W=R+S;N<W;N++){const X=r.resolveTriangleIndex(N);Mr(p,3*X,u,h),p.needsUpdate=!0;const K=p.distanceToTriangle(g,_,m);if(K<w&&(E.copy(_),v&&v.copy(m),w=K,x=N,I=M),K<s)return!0}}}})}else{const T=Fl(e);for(let D=0,b=T;D<b;D++){Mr(g,3*D,A,d),g.a.applyMatrix4(t),g.b.applyMatrix4(t),g.c.applyMatrix4(t),g.needsUpdate=!0;for(let M=R,L=R+S;M<L;M++){const P=r.resolveTriangleIndex(M);Mr(p,3*P,u,h),p.needsUpdate=!0;const N=p.distanceToTriangle(g,_,m);if(N<w&&(E.copy(_),v&&v.copy(m),w=N,x=M,I=D),N<s)return!0}}}}}),ai.releasePrimitive(p),ai.releasePrimitive(g),w===1/0?null:(n.point?n.point.copy(E):n.point=E.clone(),n.distance=w,n.faceIndex=x,i&&(i.point?i.point.copy(v):i.point=v.clone(),i.point.applyMatrix4(lf),E.applyMatrix4(lf),i.distance=E.sub(i.point).length(),i.faceIndex=I),n)}function rP(){return typeof SharedArrayBuffer<"u"}const Nu=new Yt.constructor,cf=new Yt.constructor,Aa=new Yg(()=>new _r),Kl=new _r,Jl=new _r,sm=new _r,am=new _r;let om=!1;function nP(r,e,t,n){if(om)throw new Error("MeshBVH: Recursive calls to bvhcast not supported.");om=!0;const i=r._roots,s=e._roots;let o,l=0,h=0;const u=new rt().copy(t).invert();for(let d=0,A=i.length;d<A;d++){Nu.setBuffer(i[d]),h=0;const p=Aa.getPrimitive();rr(0,Nu.float32Array,p),p.applyMatrix4(u);for(let g=0,_=s.length;g<_&&(cf.setBuffer(s[d]),o=Pi(0,0,t,u,n,l,h,0,0,p),cf.clearBuffer(),h+=s[g].length,!o);g++);if(Aa.releasePrimitive(p),Nu.clearBuffer(),l+=i[d].length,o)break}return om=!1,o}function Pi(r,e,t,n,i,s=0,o=0,l=0,h=0,u=null,d=!1){let A,p;d?(A=cf,p=Nu):(A=Nu,p=cf);const g=A.float32Array,_=A.uint32Array,E=A.uint16Array,m=p.float32Array,v=p.uint32Array,w=p.uint16Array,x=r*2,I=e*2,R=xn(x,E),S=xn(I,w);let T=!1;if(S&&R)d?T=i(wn(e,v),jn(e*2,w),wn(r,_),jn(r*2,E),h,o+e,l,s+r):T=i(wn(r,_),jn(r*2,E),wn(e,v),jn(e*2,w),l,s+r,h,o+e);else if(S){const D=Aa.getPrimitive();rr(e,m,D),D.applyMatrix4(t);const b=oi(r),M=Wn(r,_);rr(b,g,Kl),rr(M,g,Jl);const L=D.intersectsBox(Kl),P=D.intersectsBox(Jl);T=L&&Pi(e,b,n,t,i,o,s,h,l+1,D,!d)||P&&Pi(e,M,n,t,i,o,s,h,l+1,D,!d),Aa.releasePrimitive(D)}else{const D=oi(e),b=Wn(e,v);rr(D,m,sm),rr(b,m,am);const M=u.intersectsBox(sm),L=u.intersectsBox(am);if(M&&L)T=Pi(r,D,t,n,i,s,o,l,h+1,u,d)||Pi(r,b,t,n,i,s,o,l,h+1,u,d);else if(M)if(R)T=Pi(r,D,t,n,i,s,o,l,h+1,u,d);else{const P=Aa.getPrimitive();P.copy(sm).applyMatrix4(t);const N=oi(r),W=Wn(r,_);rr(N,g,Kl),rr(W,g,Jl);const X=P.intersectsBox(Kl),K=P.intersectsBox(Jl);T=X&&Pi(D,N,n,t,i,o,s,h,l+1,P,!d)||K&&Pi(D,W,n,t,i,o,s,h,l+1,P,!d),Aa.releasePrimitive(P)}else if(L)if(R)T=Pi(r,b,t,n,i,s,o,l,h+1,u,d);else{const P=Aa.getPrimitive();P.copy(am).applyMatrix4(t);const N=oi(r),W=Wn(r,_);rr(N,g,Kl),rr(W,g,Jl);const X=P.intersectsBox(Kl),K=P.intersectsBox(Jl);T=X&&Pi(b,N,n,t,i,o,s,h,l+1,P,!d)||K&&Pi(b,W,n,t,i,o,s,h,l+1,P,!d),Aa.releasePrimitive(P)}}return T}const uf=new An,ww=new _r;class lm{static serialize(e,t={}){t={cloneBuffers:!0,...t};const n=e.geometry,i=e._roots,s=e._indirectBuffer,o=n.getIndex();let l;return t.cloneBuffers?l={roots:i.map(h=>h.slice()),index:o.array.slice(),indirectBuffer:s?s.slice():null}:l={roots:i,index:o.array,indirectBuffer:s},l}static deserialize(e,t,n={}){n={setIndex:!0,indirect:!!e.indirectBuffer,...n};const{index:i,roots:s,indirectBuffer:o}=e,l=new lm(t,{...n,[Gg]:!0});if(l._roots=s,l._indirectBuffer=o||null,n.setIndex){const h=t.getIndex();if(h===null){const u=new zr(e.index,1,!1);t.setIndex(u)}else h.array!==i&&(h.array.set(i),h.needsUpdate=!0)}return l}get indirect(){return!!this._indirectBuffer}constructor(e,t={}){if(e.isBufferGeometry){if(e.index&&e.index.isInterleavedBufferAttribute)throw new Error("MeshBVH: InterleavedBufferAttribute is not supported for the index attribute.")}else throw new Error("MeshBVH: Only BufferGeometries are supported.");if(t=Object.assign({strategy:rw,maxDepth:40,maxLeafTris:10,verbose:!0,useSharedArrayBuffer:!1,setBoundingBox:!0,onProgress:null,indirect:!1,[Gg]:!1},t),t.useSharedArrayBuffer&&!rP())throw new Error("MeshBVH: SharedArrayBuffer is not available.");this.geometry=e,this._roots=null,this._indirectBuffer=null,t[Gg]||(yU(this,t),!e.boundingBox&&t.setBoundingBox&&(e.boundingBox=this.getBoundingBox(new _r)));const{_indirectBuffer:n}=this;this.resolveTriangleIndex=t.indirect?i=>n[i]:i=>i}refit(e=null){return(this.indirect?WU:LU)(this,e)}traverse(e,t=0){const n=this._roots[t],i=new Uint32Array(n),s=new Uint16Array(n);o(0);function o(l,h=0){const u=l*2,d=s[u+15]===Wd;if(d){const A=i[l+6],p=s[u+14];e(h,d,new Float32Array(n,l*4,6),A,p)}else{const A=l+Eo/4,p=i[l+6],g=i[l+7];e(h,d,new Float32Array(n,l*4,6),g)||(o(A,h+1),o(p,h+1))}}}raycast(e,t=xi){const n=this._roots,i=this.geometry,s=[],o=t.isMaterial,l=Array.isArray(t),h=i.groups,u=o?t.side:t,d=this.indirect?YU:kU;for(let A=0,p=n.length;A<p;A++){const g=l?t[h[A].materialIndex].side:u,_=s.length;if(d(this,A,g,e,s),l){const E=h[A].materialIndex;for(let m=_,v=s.length;m<v;m++)s[m].face.materialIndex=E}}return s}raycastFirst(e,t=xi){const n=this._roots,i=this.geometry,s=t.isMaterial,o=Array.isArray(t);let l=null;const h=i.groups,u=s?t.side:t,d=this.indirect?XU:OU;for(let A=0,p=n.length;A<p;A++){const g=o?t[h[A].materialIndex].side:u,_=d(this,A,g,e);_!=null&&(l==null||_.distance<l.distance)&&(l=_,o&&(_.face.materialIndex=h[A].materialIndex))}return l}intersectsGeometry(e,t){let n=!1;const i=this._roots,s=this.indirect?KU:FU;for(let o=0,l=i.length;o<l&&(n=s(this,o,e,t),!n);o++);return n}shapecast(e){const t=ai.getPrimitive(),n=this.indirect?PU:DU;let{boundsTraverseOrder:i,intersectsBounds:s,intersectsRange:o,intersectsTriangle:l}=e;if(o&&l){const A=o;o=(p,g,_,E,m)=>A(p,g,_,E,m)?!0:n(p,g,this,l,_,E,t)}else o||(l?o=(A,p,g,_)=>n(A,p,this,l,g,_,t):o=(A,p,g)=>g);let h=!1,u=0;const d=this._roots;for(let A=0,p=d.length;A<p;A++){const g=d[A];if(h=MU(this,A,s,o,i,u),h)break;u+=g.byteLength}return ai.releasePrimitive(t),h}bvhcast(e,t,n){let{intersectsRanges:i,intersectsTriangles:s}=n;const o=ai.getPrimitive(),l=this.geometry.index,h=this.geometry.attributes.position,u=this.indirect?_=>{const E=this.resolveTriangleIndex(_);Mr(o,E*3,l,h)}:_=>{Mr(o,_*3,l,h)},d=ai.getPrimitive(),A=e.geometry.index,p=e.geometry.attributes.position,g=e.indirect?_=>{const E=e.resolveTriangleIndex(_);Mr(d,E*3,A,p)}:_=>{Mr(d,_*3,A,p)};if(s){const _=(E,m,v,w,x,I,R,S)=>{for(let T=v,D=v+w;T<D;T++){g(T),d.a.applyMatrix4(t),d.b.applyMatrix4(t),d.c.applyMatrix4(t),d.needsUpdate=!0;for(let b=E,M=E+m;b<M;b++)if(u(b),o.needsUpdate=!0,s(o,d,b,T,x,I,R,S))return!0}return!1};if(i){const E=i;i=function(m,v,w,x,I,R,S,T){return E(m,v,w,x,I,R,S,T)?!0:_(m,v,w,x,I,R,S,T)}}else i=_}return nP(this,e,t,i)}intersectsBox(e,t){return uf.set(e.min,e.max,t),uf.needsUpdate=!0,this.shapecast({intersectsBounds:n=>uf.intersectsBox(n),intersectsTriangle:n=>uf.intersectsTriangle(n)})}intersectsSphere(e){return this.shapecast({intersectsBounds:t=>e.intersectsBox(t),intersectsTriangle:t=>t.intersectsSphere(e)})}closestPointToGeometry(e,t,n={},i={},s=0,o=1/0){return(this.indirect?tP:jU)(this,e,t,n,i,s,o)}closestPointToPoint(e,t={},n=0,i=1/0){return SU(this,e,t,n,i)}getBoundingBox(e){return e.makeEmpty(),this._roots.forEach(t=>{rr(0,new Float32Array(t),ww),e.union(ww)}),e}}function iP(r){switch(r){case 1:return"R";case 2:return"RG";case 3:return"RGBA";case 4:return"RGBA"}throw new Error}function sP(r){switch(r){case 1:return ea;case 2:return so;case 3:return vr;case 4:return vr}}function Iw(r){switch(r){case 1:return xA;case 2:return td;case 3:return ou;case 4:return ou}}class Cw extends mo{constructor(){super(),this.minFilter=Ar,this.magFilter=Ar,this.generateMipmaps=!1,this.overrideItemSize=null,this._forcedType=null}updateFrom(e){const t=this.overrideItemSize,n=e.itemSize,i=e.count;if(t!==null){if(n*i%t!==0)throw new Error("VertexAttributeTexture: overrideItemSize must divide evenly into buffer length.");e.itemSize=t,e.count=i*n/t}const s=e.itemSize,o=e.count,l=e.normalized,h=e.array.constructor,u=h.BYTES_PER_ELEMENT;let d=this._forcedType,A=s;if(d===null)switch(h){case Float32Array:d=lr;break;case Uint8Array:case Uint16Array:case Uint32Array:d=Mi;break;case Int8Array:case Int16Array:case Int32Array:d=iu;break}let p,g,_,E,m=iP(s);switch(d){case lr:_=1,g=sP(s),l&&u===1?(E=h,m+="8",h===Uint8Array?p=mr:(p=yA,m+="_SNORM")):(E=Float32Array,m+="32F",p=lr);break;case iu:m+=u*8+"I",_=l?Math.pow(2,h.BYTES_PER_ELEMENT*8-1):1,g=Iw(s),u===1?(E=Int8Array,p=yA):u===2?(E=Int16Array,p=lE):(E=Int32Array,p=iu);break;case Mi:m+=u*8+"UI",_=l?Math.pow(2,h.BYTES_PER_ELEMENT*8-1):1,g=Iw(s),u===1?(E=Uint8Array,p=mr):u===2?(E=Uint16Array,p=EA):(E=Uint32Array,p=Mi);break}A===3&&(g===vr||g===ou)&&(A=4);const v=Math.ceil(Math.sqrt(o)),w=A*v*v,x=new E(w),I=e.normalized;e.normalized=!1;for(let R=0;R<o;R++){const S=A*R;x[S]=e.getX(R)/_,s>=2&&(x[S+1]=e.getY(R)/_),s>=3&&(x[S+2]=e.getZ(R)/_,A===4&&(x[S+3]=1)),s>=4&&(x[S+3]=e.getW(R)/_)}e.normalized=I,this.internalFormat=m,this.format=g,this.type=p,this.image.width=v,this.image.height=v,this.image.data=x,this.needsUpdate=!0,this.dispose(),e.itemSize=n,e.count=i}}class aP extends Cw{constructor(){super(),this._forcedType=Mi}}class oP extends Cw{constructor(){super(),this._forcedType=lr}}class Mw{constructor(){this.index=new aP,this.position=new oP,this.bvhBounds=new mo,this.bvhContents=new mo,this._cachedIndexAttr=null,this.index.overrideItemSize=3}updateFrom(e){const{geometry:t}=e;if(cP(e,this.bvhBounds,this.bvhContents),this.position.updateFrom(t.attributes.position),e.indirect){const n=e._indirectBuffer;if(this._cachedIndexAttr===null||this._cachedIndexAttr.count!==n.length)if(t.index)this._cachedIndexAttr=t.index.clone();else{const i=ow(aw(t));this._cachedIndexAttr=new zr(i,1,!1)}lP(t,n,this._cachedIndexAttr),this.index.updateFrom(this._cachedIndexAttr)}else this.index.updateFrom(t.index)}dispose(){const{index:e,position:t,bvhBounds:n,bvhContents:i}=this;e&&e.dispose(),t&&t.dispose(),n&&n.dispose(),i&&i.dispose()}}function lP(r,e,t){const n=t.array,i=r.index?r.index.array:null;for(let s=0,o=e.length;s<o;s++){const l=3*s,h=3*e[s];for(let u=0;u<3;u++)n[l+u]=i?i[h+u]:h+u}}function cP(r,e,t){const n=r._roots;if(n.length!==1)throw new Error("MeshBVHUniformStruct: Multi-root BVHs not supported.");const i=n[0],s=new Uint16Array(i),o=new Uint32Array(i),l=new Float32Array(i),h=i.byteLength/Eo,u=2*Math.ceil(Math.sqrt(h/2)),d=new Float32Array(4*u*u),A=Math.ceil(Math.sqrt(h)),p=new Uint32Array(2*A*A);for(let g=0;g<h;g++){const _=g*Eo/4,E=_*2,m=_;for(let v=0;v<3;v++)d[8*g+0+v]=l[m+0+v],d[8*g+4+v]=l[m+3+v];if(xn(E,s)){const v=jn(E,s),w=wn(_,o),x=4294901760|v;p[g*2+0]=x,p[g*2+1]=w}else{const v=4*Wn(_,o)/Eo,w=qg(_,o);p[g*2+0]=w,p[g*2+1]=v}}e.image.data=d,e.image.width=u,e.image.height=u,e.format=vr,e.type=lr,e.internalFormat="RGBA32F",e.minFilter=Ar,e.magFilter=Ar,e.generateMipmaps=!1,e.needsUpdate=!0,e.dispose(),t.image.data=p,t.image.width=A,t.image.height=A,t.format=td,t.type=Mi,t.internalFormat="RG32UI",t.minFilter=Ar,t.magFilter=Ar,t.generateMipmaps=!1,t.needsUpdate=!0,t.dispose()}const uP=`
4071
+ }`},rw=0,aU=1,nw=2,iw=2,zg=1.25,sw=1,Eo=6*4+4+4,Wd=65535,oU=Math.pow(2,-24),Hg=Symbol("SKIP_GENERATION");function aw(r){return r.index?r.index.count:r.attributes.position.count}function Fl(r){return aw(r)/3}function ow(r,e=ArrayBuffer){return r>65535?new Uint32Array(new e(4*r)):new Uint16Array(new e(2*r))}function lU(r,e){if(!r.index){const t=r.attributes.position.count,n=e.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer,i=ow(t,n);r.setIndex(new zr(i,1));for(let s=0;s<t;s++)i[s]=s}}function lw(r){const e=Fl(r),t=r.drawRange,n=t.start/3,i=(t.start+t.count)/3,s=Math.max(0,n),o=Math.min(e,i)-s;return[{offset:Math.floor(s),count:Math.floor(o)}]}function cw(r){if(!r.groups||!r.groups.length)return lw(r);const e=[],t=new Set,n=r.drawRange,i=n.start/3,s=(n.start+n.count)/3;for(const l of r.groups){const h=l.start/3,u=(l.start+l.count)/3;t.add(Math.max(i,h)),t.add(Math.min(s,u))}const o=Array.from(t.values()).sort((l,h)=>l-h);for(let l=0;l<o.length-1;l++){const h=o[l],u=o[l+1];e.push({offset:Math.floor(h),count:Math.floor(u-h)})}return e}function cU(r){if(r.groups.length===0)return!1;const e=Fl(r),t=cw(r).sort((s,o)=>s.offset-o.offset),n=t[t.length-1];n.count=Math.min(e-n.offset,n.count);let i=0;return t.forEach(({count:s})=>i+=s),e!==i}function rr(r,e,t){return t.min.x=e[r],t.min.y=e[r+1],t.min.z=e[r+2],t.max.x=e[r+3],t.max.y=e[r+4],t.max.z=e[r+5],t}function uU(r){r[0]=r[1]=r[2]=1/0,r[3]=r[4]=r[5]=-1/0}function uw(r){let e=-1,t=-1/0;for(let n=0;n<3;n++){const i=r[n+3]-r[n];i>t&&(t=i,e=n)}return e}function hw(r,e){e.set(r)}function dw(r,e,t){let n,i;for(let s=0;s<3;s++){const o=s+3;n=r[s],i=e[s],t[s]=n<i?n:i,n=r[o],i=e[o],t[o]=n>i?n:i}}function Yd(r,e,t){for(let n=0;n<3;n++){const i=e[r+2*n],s=e[r+2*n+1],o=i-s,l=i+s;o<t[n]&&(t[n]=o),l>t[n+3]&&(t[n+3]=l)}}function Tu(r){const e=r[3]-r[0],t=r[4]-r[1],n=r[5]-r[2];return 2*(e*t+t*n+n*e)}function Gg(r,e,t,n,i=null){let s=1/0,o=1/0,l=1/0,h=-1/0,u=-1/0,d=-1/0,A=1/0,p=1/0,g=1/0,_=-1/0,E=-1/0,m=-1/0;const v=i!==null;for(let w=e*6,x=(e+t)*6;w<x;w+=6){const I=r[w+0],R=r[w+1],S=I-R,T=I+R;S<s&&(s=S),T>h&&(h=T),v&&I<A&&(A=I),v&&I>_&&(_=I);const D=r[w+2],b=r[w+3],M=D-b,L=D+b;M<o&&(o=M),L>u&&(u=L),v&&D<p&&(p=D),v&&D>E&&(E=D);const P=r[w+4],N=r[w+5],W=P-N,X=P+N;W<l&&(l=W),X>d&&(d=X),v&&P<g&&(g=P),v&&P>m&&(m=P)}n[0]=s,n[1]=o,n[2]=l,n[3]=h,n[4]=u,n[5]=d,v&&(i[0]=A,i[1]=p,i[2]=g,i[3]=_,i[4]=E,i[5]=m)}function hU(r,e,t,n){let i=1/0,s=1/0,o=1/0,l=-1/0,h=-1/0,u=-1/0;for(let d=e*6,A=(e+t)*6;d<A;d+=6){const p=r[d+0];p<i&&(i=p),p>l&&(l=p);const g=r[d+2];g<s&&(s=g),g>h&&(h=g);const _=r[d+4];_<o&&(o=_),_>u&&(u=_)}n[0]=i,n[1]=s,n[2]=o,n[3]=l,n[4]=h,n[5]=u}function dU(r,e){uU(e);const t=r.attributes.position,n=r.index?r.index.array:null,i=Fl(r),s=new Float32Array(i*6),o=t.normalized,l=t.array,h=t.offset||0;let u=3;t.isInterleavedBufferAttribute&&(u=t.data.stride);const d=["getX","getY","getZ"];for(let A=0;A<i;A++){const p=A*3,g=A*6;let _=p+0,E=p+1,m=p+2;n&&(_=n[_],E=n[E],m=n[m]),o||(_=_*u+h,E=E*u+h,m=m*u+h);for(let v=0;v<3;v++){let w,x,I;o?(w=t[d[v]](_),x=t[d[v]](E),I=t[d[v]](m)):(w=l[_+v],x=l[E+v],I=l[m+v]);let R=w;x<R&&(R=x),I<R&&(R=I);let S=w;x>S&&(S=x),I>S&&(S=I);const T=(S-R)/2,D=v*2;s[g+D+0]=R+T,s[g+D+1]=T+(Math.abs(R)+T)*oU,R<e[v]&&(e[v]=R),S>e[v+3]&&(e[v+3]=S)}}return s}const Ts=32,fU=(r,e)=>r.candidate-e.candidate,da=new Array(Ts).fill().map(()=>({count:0,bounds:new Float32Array(6),rightCacheBounds:new Float32Array(6),leftCacheBounds:new Float32Array(6),candidate:0})),qd=new Float32Array(6);function pU(r,e,t,n,i,s){let o=-1,l=0;if(s===rw)o=uw(e),o!==-1&&(l=(e[o]+e[o+3])/2);else if(s===aU)o=uw(r),o!==-1&&(l=AU(t,n,i,o));else if(s===nw){const h=Tu(r);let u=zg*i;const d=n*6,A=(n+i)*6;for(let p=0;p<3;p++){const g=e[p],_=(e[p+3]-g)/Ts;if(i<Ts/4){const E=[...da];E.length=i;let m=0;for(let w=d;w<A;w+=6,m++){const x=E[m];x.candidate=t[w+2*p],x.count=0;const{bounds:I,leftCacheBounds:R,rightCacheBounds:S}=x;for(let T=0;T<3;T++)S[T]=1/0,S[T+3]=-1/0,R[T]=1/0,R[T+3]=-1/0,I[T]=1/0,I[T+3]=-1/0;Yd(w,t,I)}E.sort(fU);let v=i;for(let w=0;w<v;w++){const x=E[w];for(;w+1<v&&E[w+1].candidate===x.candidate;)E.splice(w+1,1),v--}for(let w=d;w<A;w+=6){const x=t[w+2*p];for(let I=0;I<v;I++){const R=E[I];x>=R.candidate?Yd(w,t,R.rightCacheBounds):(Yd(w,t,R.leftCacheBounds),R.count++)}}for(let w=0;w<v;w++){const x=E[w],I=x.count,R=i-x.count,S=x.leftCacheBounds,T=x.rightCacheBounds;let D=0;I!==0&&(D=Tu(S)/h);let b=0;R!==0&&(b=Tu(T)/h);const M=sw+zg*(D*I+b*R);M<u&&(o=p,u=M,l=x.candidate)}}else{for(let v=0;v<Ts;v++){const w=da[v];w.count=0,w.candidate=g+_+v*_;const x=w.bounds;for(let I=0;I<3;I++)x[I]=1/0,x[I+3]=-1/0}for(let v=d;v<A;v+=6){let w=~~((t[v+2*p]-g)/_);w>=Ts&&(w=Ts-1);const x=da[w];x.count++,Yd(v,t,x.bounds)}const E=da[Ts-1];hw(E.bounds,E.rightCacheBounds);for(let v=Ts-2;v>=0;v--){const w=da[v],x=da[v+1];dw(w.bounds,x.rightCacheBounds,w.rightCacheBounds)}let m=0;for(let v=0;v<Ts-1;v++){const w=da[v],x=w.count,I=w.bounds,R=da[v+1].rightCacheBounds;x!==0&&(m===0?hw(I,qd):dw(I,qd,qd)),m+=x;let S=0,T=0;m!==0&&(S=Tu(qd)/h);const D=i-m;D!==0&&(T=Tu(R)/h);const b=sw+zg*(S*m+T*D);b<u&&(o=p,u=b,l=w.candidate)}}}}else console.warn(`MeshBVH: Invalid build strategy value ${s} used.`);return{axis:o,pos:l}}function AU(r,e,t,n){let i=0;for(let s=e,o=e+t;s<o;s++)i+=r[s*6+n*2];return i/t}class Xd{constructor(){}}function gU(r,e,t,n,i,s){let o=n,l=n+i-1;const h=s.pos,u=s.axis*2;for(;;){for(;o<=l&&t[o*6+u]<h;)o++;for(;o<=l&&t[l*6+u]>=h;)l--;if(o<l){for(let d=0;d<3;d++){let A=e[o*3+d];e[o*3+d]=e[l*3+d],e[l*3+d]=A}for(let d=0;d<6;d++){let A=t[o*6+d];t[o*6+d]=t[l*6+d],t[l*6+d]=A}o++,l--}else return o}}function mU(r,e,t,n,i,s){let o=n,l=n+i-1;const h=s.pos,u=s.axis*2;for(;;){for(;o<=l&&t[o*6+u]<h;)o++;for(;o<=l&&t[l*6+u]>=h;)l--;if(o<l){let d=r[o];r[o]=r[l],r[l]=d;for(let A=0;A<6;A++){let p=t[o*6+A];t[o*6+A]=t[l*6+A],t[l*6+A]=p}o++,l--}else return o}}function vU(r,e){const t=(r.index?r.index.count:r.attributes.position.count)/3,n=t>2**16,i=n?4:2,s=e?new SharedArrayBuffer(t*i):new ArrayBuffer(t*i),o=n?new Uint32Array(s):new Uint16Array(s);for(let l=0,h=o.length;l<h;l++)o[l]=l;return o}function _U(r,e){const t=r.geometry,n=t.index?t.index.array:null,i=e.maxDepth,s=e.verbose,o=e.maxLeafTris,l=e.strategy,h=e.onProgress,u=Fl(t),d=r._indirectBuffer;let A=!1;const p=new Float32Array(6),g=new Float32Array(6),_=dU(t,p),E=e.indirect?mU:gU,m=[],v=e.indirect?lw(t):cw(t);if(v.length===1){const I=v[0],R=new Xd;R.boundingData=p,hU(_,I.offset,I.count,g),x(R,I.offset,I.count,g),m.push(R)}else for(let I of v){const R=new Xd;R.boundingData=new Float32Array(6),Gg(_,I.offset,I.count,R.boundingData,g),x(R,I.offset,I.count,g),m.push(R)}return m;function w(I){h&&h(I/u)}function x(I,R,S,T=null,D=0){if(!A&&D>=i&&(A=!0,s&&(console.warn(`MeshBVH: Max depth of ${i} reached when generating BVH. Consider increasing maxDepth.`),console.warn(t))),S<=o||D>=i)return w(R+S),I.offset=R,I.count=S,I;const b=pU(I.boundingData,T,_,R,S,l);if(b.axis===-1)return w(R+S),I.offset=R,I.count=S,I;const M=E(d,n,_,R,S,b);if(M===R||M===R+S)w(R+S),I.offset=R,I.count=S;else{I.splitAxis=b.axis;const L=new Xd,P=R,N=M-R;I.left=L,L.boundingData=new Float32Array(6),Gg(_,P,N,L.boundingData,g),x(L,P,N,g,D+1);const W=new Xd,X=M,K=S-N;I.right=W,W.boundingData=new Float32Array(6),Gg(_,X,K,W.boundingData,g),x(W,X,K,g,D+1)}return I}}function yU(r,e){const t=r.geometry;e.indirect&&(r._indirectBuffer=vU(t,e.useSharedArrayBuffer),cU(t)&&!e.verbose&&console.warn('MeshBVH: Provided geometry contains groups that do not fully span the vertex contents while using the "indirect" option. BVH may incorrectly report intersections on unrendered portions of the geometry.')),r._indirectBuffer||lU(t,e);const n=_U(r,e);let i,s,o;const l=[],h=e.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer;for(let A=0;A<n.length;A++){const p=n[A];let g=u(p);const _=new h(Eo*g);i=new Float32Array(_),s=new Uint32Array(_),o=new Uint16Array(_),d(0,p),l.push(_)}r._roots=l;return;function u(A){return A.count?1:1+u(A.left)+u(A.right)}function d(A,p){const g=A/4,_=A/2,E=!!p.count,m=p.boundingData;for(let v=0;v<6;v++)i[g+v]=m[v];if(E){const v=p.offset,w=p.count;return s[g+6]=v,o[_+14]=w,o[_+15]=Wd,A+Eo}else{const v=p.left,w=p.right,x=p.splitAxis;let I;if(I=d(A+Eo,v),I/4>Math.pow(2,32))throw new Error("MeshBVH: Cannot store child pointer greater than 32 bits.");return s[g+6]=I/4,I=d(I,w),s[g+7]=x,I}}}class Bs{constructor(){this.min=1/0,this.max=-1/0}setFromPointsField(e,t){let n=1/0,i=-1/0;for(let s=0,o=e.length;s<o;s++){const l=e[s][t];n=l<n?l:n,i=l>i?l:i}this.min=n,this.max=i}setFromPoints(e,t){let n=1/0,i=-1/0;for(let s=0,o=t.length;s<o;s++){const l=t[s],h=e.dot(l);n=h<n?h:n,i=h>i?h:i}this.min=n,this.max=i}isSeparated(e){return this.min>e.max||e.min>this.max}}Bs.prototype.setFromBox=function(){const r=new G;return function(e,t){const n=t.min,i=t.max;let s=1/0,o=-1/0;for(let l=0;l<=1;l++)for(let h=0;h<=1;h++)for(let u=0;u<=1;u++){r.x=n.x*l+i.x*(1-l),r.y=n.y*h+i.y*(1-h),r.z=n.z*u+i.z*(1-u);const d=e.dot(r);s=Math.min(d,s),o=Math.max(d,o)}this.min=s,this.max=o}}();const EU=function(){const r=new G,e=new G,t=new G;return function(n,i,s){const o=n.start,l=r,h=i.start,u=e;t.subVectors(o,h),r.subVectors(n.end,n.start),e.subVectors(i.end,i.start);const d=t.dot(u),A=u.dot(l),p=u.dot(u),g=t.dot(l),_=l.dot(l)*p-A*A;let E,m;_!==0?E=(d*A-g*p)/_:E=0,m=(d+E*A)/p,s.x=E,s.y=m}}(),Vg=function(){const r=new Ue,e=new G,t=new G;return function(n,i,s,o){EU(n,i,r);let l=r.x,h=r.y;if(l>=0&&l<=1&&h>=0&&h<=1){n.at(l,s),i.at(h,o);return}else if(l>=0&&l<=1){h<0?i.at(0,o):i.at(1,o),n.closestPointToPoint(o,!0,s);return}else if(h>=0&&h<=1){l<0?n.at(0,s):n.at(1,s),i.closestPointToPoint(s,!0,o);return}else{let u;l<0?u=n.start:u=n.end;let d;h<0?d=i.start:d=i.end;const A=e,p=t;if(n.closestPointToPoint(d,!0,e),i.closestPointToPoint(u,!0,t),A.distanceToSquared(d)<=p.distanceToSquared(u)){s.copy(A),o.copy(d);return}else{s.copy(u),o.copy(p);return}}}}(),xU=function(){const r=new G,e=new G,t=new Ji,n=new Ms;return function(i,s){const{radius:o,center:l}=i,{a:h,b:u,c:d}=s;if(n.start=h,n.end=u,n.closestPointToPoint(l,!0,r).distanceTo(l)<=o||(n.start=h,n.end=d,n.closestPointToPoint(l,!0,r).distanceTo(l)<=o)||(n.start=u,n.end=d,n.closestPointToPoint(l,!0,r).distanceTo(l)<=o))return!0;const A=s.getPlane(t);if(Math.abs(A.distanceToPoint(l))<=o){const p=A.projectPoint(l,e);if(s.containsPoint(p))return!0}return!1}}(),wU=1e-15;function jg(r){return Math.abs(r)<wU}class Ui extends un{constructor(...e){super(...e),this.isExtendedTriangle=!0,this.satAxes=new Array(4).fill().map(()=>new G),this.satBounds=new Array(4).fill().map(()=>new Bs),this.points=[this.a,this.b,this.c],this.sphere=new bi,this.plane=new Ji,this.needsUpdate=!0}intersectsSphere(e){return xU(e,this)}update(){const e=this.a,t=this.b,n=this.c,i=this.points,s=this.satAxes,o=this.satBounds,l=s[0],h=o[0];this.getNormal(l),h.setFromPoints(l,i);const u=s[1],d=o[1];u.subVectors(e,t),d.setFromPoints(u,i);const A=s[2],p=o[2];A.subVectors(t,n),p.setFromPoints(A,i);const g=s[3],_=o[3];g.subVectors(n,e),_.setFromPoints(g,i),this.sphere.setFromPoints(this.points),this.plane.setFromNormalAndCoplanarPoint(l,e),this.needsUpdate=!1}}Ui.prototype.closestPointToSegment=function(){const r=new G,e=new G,t=new Ms;return function(n,i=null,s=null){const{start:o,end:l}=n,h=this.points;let u,d=1/0;for(let A=0;A<3;A++){const p=(A+1)%3;t.start.copy(h[A]),t.end.copy(h[p]),Vg(t,n,r,e),u=r.distanceToSquared(e),u<d&&(d=u,i&&i.copy(r),s&&s.copy(e))}return this.closestPointToPoint(o,r),u=o.distanceToSquared(r),u<d&&(d=u,i&&i.copy(r),s&&s.copy(o)),this.closestPointToPoint(l,r),u=l.distanceToSquared(r),u<d&&(d=u,i&&i.copy(r),s&&s.copy(l)),Math.sqrt(d)}}(),Ui.prototype.intersectsTriangle=function(){const r=new Ui,e=new Array(3),t=new Array(3),n=new Bs,i=new Bs,s=new G,o=new G,l=new G,h=new G,u=new G,d=new Ms,A=new Ms,p=new Ms,g=new G;function _(E,m,v){const w=E.points;let x=0,I=-1;for(let R=0;R<3;R++){const{start:S,end:T}=d;S.copy(w[R]),T.copy(w[(R+1)%3]),d.delta(o);const D=jg(m.distanceToPoint(S));if(jg(m.normal.dot(o))&&D){v.copy(d),x=2;break}const b=m.intersectLine(d,g);if(!b&&D&&g.copy(S),(b||D)&&!jg(g.distanceTo(T))){if(x<=1)(x===1?v.start:v.end).copy(g),D&&(I=x);else if(x>=2){(I===1?v.start:v.end).copy(g),x=2;break}if(x++,x===2&&I===-1)break}}return x}return function(E,m=null,v=!1){this.needsUpdate&&this.update(),E.isExtendedTriangle?E.needsUpdate&&E.update():(r.copy(E),r.update(),E=r);const w=this.plane,x=E.plane;if(Math.abs(w.normal.dot(x.normal))>1-1e-10){const I=this.satBounds,R=this.satAxes;t[0]=E.a,t[1]=E.b,t[2]=E.c;for(let D=0;D<4;D++){const b=I[D],M=R[D];if(n.setFromPoints(M,t),b.isSeparated(n))return!1}const S=E.satBounds,T=E.satAxes;e[0]=this.a,e[1]=this.b,e[2]=this.c;for(let D=0;D<4;D++){const b=S[D],M=T[D];if(n.setFromPoints(M,e),b.isSeparated(n))return!1}for(let D=0;D<4;D++){const b=R[D];for(let M=0;M<4;M++){const L=T[M];if(s.crossVectors(b,L),n.setFromPoints(s,e),i.setFromPoints(s,t),n.isSeparated(i))return!1}}return m&&(v||console.warn("ExtendedTriangle.intersectsTriangle: Triangles are coplanar which does not support an output edge. Setting edge to 0, 0, 0."),m.start.set(0,0,0),m.end.set(0,0,0)),!0}else{const I=_(this,x,A);if(I===1&&E.containsPoint(A.end))return m&&(m.start.copy(A.end),m.end.copy(A.end)),!0;if(I!==2)return!1;const R=_(E,w,p);if(R===1&&this.containsPoint(p.end))return m&&(m.start.copy(p.end),m.end.copy(p.end)),!0;if(R!==2)return!1;if(A.delta(l),p.delta(h),l.dot(h)<0){let P=p.start;p.start=p.end,p.end=P}const S=A.start.dot(l),T=A.end.dot(l),D=p.start.dot(l),b=p.end.dot(l),M=T<D,L=S<b;return S!==b&&D!==T&&M===L?!1:(m&&(u.subVectors(A.start,p.start),u.dot(l)>0?m.start.copy(A.start):m.start.copy(p.start),u.subVectors(A.end,p.end),u.dot(l)<0?m.end.copy(A.end):m.end.copy(p.end)),!0)}}}(),Ui.prototype.distanceToPoint=function(){const r=new G;return function(e){return this.closestPointToPoint(e,r),e.distanceTo(r)}}(),Ui.prototype.distanceToTriangle=function(){const r=new G,e=new G,t=["a","b","c"],n=new Ms,i=new Ms;return function(s,o=null,l=null){const h=o||l?n:null;if(this.intersectsTriangle(s,h))return(o||l)&&(o&&h.getCenter(o),l&&h.getCenter(l)),0;let u=1/0;for(let d=0;d<3;d++){let A;const p=t[d],g=s[p];this.closestPointToPoint(g,r),A=g.distanceToSquared(r),A<u&&(u=A,o&&o.copy(r),l&&l.copy(g));const _=this[p];s.closestPointToPoint(_,r),A=_.distanceToSquared(r),A<u&&(u=A,o&&o.copy(_),l&&l.copy(r))}for(let d=0;d<3;d++){const A=t[d],p=t[(d+1)%3];n.set(this[A],this[p]);for(let g=0;g<3;g++){const _=t[g],E=t[(g+1)%3];i.set(s[_],s[E]),Vg(n,i,r,e);const m=r.distanceToSquared(e);m<u&&(u=m,o&&o.copy(r),l&&l.copy(e))}}return Math.sqrt(u)}}();class An{constructor(e,t,n){this.isOrientedBox=!0,this.min=new G,this.max=new G,this.matrix=new rt,this.invMatrix=new rt,this.points=new Array(8).fill().map(()=>new G),this.satAxes=new Array(3).fill().map(()=>new G),this.satBounds=new Array(3).fill().map(()=>new Bs),this.alignedSatBounds=new Array(3).fill().map(()=>new Bs),this.needsUpdate=!1,e&&this.min.copy(e),t&&this.max.copy(t),n&&this.matrix.copy(n)}set(e,t,n){this.min.copy(e),this.max.copy(t),this.matrix.copy(n),this.needsUpdate=!0}copy(e){this.min.copy(e.min),this.max.copy(e.max),this.matrix.copy(e.matrix),this.needsUpdate=!0}}An.prototype.update=function(){return function(){const r=this.matrix,e=this.min,t=this.max,n=this.points;for(let h=0;h<=1;h++)for(let u=0;u<=1;u++)for(let d=0;d<=1;d++){const A=1*h|2*u|4*d,p=n[A];p.x=h?t.x:e.x,p.y=u?t.y:e.y,p.z=d?t.z:e.z,p.applyMatrix4(r)}const i=this.satBounds,s=this.satAxes,o=n[0];for(let h=0;h<3;h++){const u=s[h],d=i[h],A=1<<h,p=n[A];u.subVectors(o,p),d.setFromPoints(u,n)}const l=this.alignedSatBounds;l[0].setFromPointsField(n,"x"),l[1].setFromPointsField(n,"y"),l[2].setFromPointsField(n,"z"),this.invMatrix.copy(this.matrix).invert(),this.needsUpdate=!1}}(),An.prototype.intersectsBox=function(){const r=new Bs;return function(e){this.needsUpdate&&this.update();const t=e.min,n=e.max,i=this.satBounds,s=this.satAxes,o=this.alignedSatBounds;if(r.min=t.x,r.max=n.x,o[0].isSeparated(r)||(r.min=t.y,r.max=n.y,o[1].isSeparated(r))||(r.min=t.z,r.max=n.z,o[2].isSeparated(r)))return!1;for(let l=0;l<3;l++){const h=s[l],u=i[l];if(r.setFromBox(h,e),u.isSeparated(r))return!1}return!0}}(),An.prototype.intersectsTriangle=function(){const r=new Ui,e=new Array(3),t=new Bs,n=new Bs,i=new G;return function(s){this.needsUpdate&&this.update(),s.isExtendedTriangle?s.needsUpdate&&s.update():(r.copy(s),r.update(),s=r);const o=this.satBounds,l=this.satAxes;e[0]=s.a,e[1]=s.b,e[2]=s.c;for(let A=0;A<3;A++){const p=o[A],g=l[A];if(t.setFromPoints(g,e),p.isSeparated(t))return!1}const h=s.satBounds,u=s.satAxes,d=this.points;for(let A=0;A<3;A++){const p=h[A],g=u[A];if(t.setFromPoints(g,d),p.isSeparated(t))return!1}for(let A=0;A<3;A++){const p=l[A];for(let g=0;g<4;g++){const _=u[g];if(i.crossVectors(p,_),t.setFromPoints(i,e),n.setFromPoints(i,d),t.isSeparated(n))return!1}}return!0}}(),An.prototype.closestPointToPoint=function(){return function(r,e){return this.needsUpdate&&this.update(),e.copy(r).applyMatrix4(this.invMatrix).clamp(this.min,this.max).applyMatrix4(this.matrix),e}}(),An.prototype.distanceToPoint=function(){const r=new G;return function(e){return this.closestPointToPoint(e,r),e.distanceTo(r)}}(),An.prototype.distanceToBox=function(){const r=["x","y","z"],e=new Array(12).fill().map(()=>new Ms),t=new Array(12).fill().map(()=>new Ms),n=new G,i=new G;return function(s,o=0,l=null,h=null){if(this.needsUpdate&&this.update(),this.intersectsBox(s))return(l||h)&&(s.getCenter(i),this.closestPointToPoint(i,n),s.closestPointToPoint(n,i),l&&l.copy(n),h&&h.copy(i)),0;const u=o*o,d=s.min,A=s.max,p=this.points;let g=1/0;for(let E=0;E<8;E++){const m=p[E];i.copy(m).clamp(d,A);const v=m.distanceToSquared(i);if(v<g&&(g=v,l&&l.copy(m),h&&h.copy(i),v<u))return Math.sqrt(v)}let _=0;for(let E=0;E<3;E++)for(let m=0;m<=1;m++)for(let v=0;v<=1;v++){const w=(E+1)%3,x=(E+2)%3,I=m<<w|v<<x,R=1<<E|m<<w|v<<x,S=p[I],T=p[R];e[_].set(S,T);const D=r[E],b=r[w],M=r[x],L=t[_],P=L.start,N=L.end;P[D]=d[D],P[b]=m?d[b]:A[b],P[M]=v?d[M]:A[b],N[D]=A[D],N[b]=m?d[b]:A[b],N[M]=v?d[M]:A[b],_++}for(let E=0;E<=1;E++)for(let m=0;m<=1;m++)for(let v=0;v<=1;v++){i.x=E?A.x:d.x,i.y=m?A.y:d.y,i.z=v?A.z:d.z,this.closestPointToPoint(i,n);const w=i.distanceToSquared(n);if(w<g&&(g=w,l&&l.copy(n),h&&h.copy(i),w<u))return Math.sqrt(w)}for(let E=0;E<12;E++){const m=e[E];for(let v=0;v<12;v++){const w=t[v];Vg(m,w,n,i);const x=n.distanceToSquared(i);if(x<g&&(g=x,l&&l.copy(n),h&&h.copy(i),x<u))return Math.sqrt(x)}}return Math.sqrt(g)}}();class Wg{constructor(e){this._getNewPrimitive=e,this._primitives=[]}getPrimitive(){const e=this._primitives;return e.length===0?this._getNewPrimitive():e.pop()}releasePrimitive(e){this._primitives.push(e)}}class IU extends Wg{constructor(){super(()=>new Ui)}}const ai=new IU;function xn(r,e){return e[r+15]===65535}function wn(r,e){return e[r+6]}function jn(r,e){return e[r+14]}function oi(r){return r+8}function Wn(r,e){return e[r+6]}function Yg(r,e){return e[r+7]}class CU{constructor(){this.float32Array=null,this.uint16Array=null,this.uint32Array=null;const e=[];let t=null;this.setBuffer=n=>{t&&e.push(t),t=n,this.float32Array=new Float32Array(n),this.uint16Array=new Uint16Array(n),this.uint32Array=new Uint32Array(n)},this.clearBuffer=()=>{t=null,this.float32Array=null,this.uint16Array=null,this.uint32Array=null,e.length!==0&&this.setBuffer(e.pop())}}}const Yt=new CU;let fa,zl;const Hl=[],Kd=new Wg(()=>new _r);function MU(r,e,t,n,i,s){fa=Kd.getPrimitive(),zl=Kd.getPrimitive(),Hl.push(fa,zl),Yt.setBuffer(r._roots[e]);const o=qg(0,r.geometry,t,n,i,s);Yt.clearBuffer(),Kd.releasePrimitive(fa),Kd.releasePrimitive(zl),Hl.pop(),Hl.pop();const l=Hl.length;return l>0&&(zl=Hl[l-1],fa=Hl[l-2]),o}function qg(r,e,t,n,i=null,s=0,o=0){const{float32Array:l,uint16Array:h,uint32Array:u}=Yt;let d=r*2;if(xn(d,h)){const A=wn(r,u),p=jn(d,h);return rr(r,l,fa),n(A,p,!1,o,s+r,fa)}else{let A=function(L){const{uint16Array:P,uint32Array:N}=Yt;let W=L*2;for(;!xn(W,P);)L=oi(L),W=L*2;return wn(L,N)},p=function(L){const{uint16Array:P,uint32Array:N}=Yt;let W=L*2;for(;!xn(W,P);)L=Wn(L,N),W=L*2;return wn(L,N)+jn(W,P)};const g=oi(r),_=Wn(r,u);let E=g,m=_,v,w,x,I;if(i&&(x=fa,I=zl,rr(E,l,x),rr(m,l,I),v=i(x),w=i(I),w<v)){E=_,m=g;const L=v;v=w,w=L,x=I}x||(x=fa,rr(E,l,x));const R=xn(E*2,h),S=t(x,R,v,o+1,s+E);let T;if(S===iw){const L=A(E),P=p(E)-L;T=n(L,P,!0,o+1,s+E,x)}else T=S&&qg(E,e,t,n,i,s,o+1);if(T)return!0;I=zl,rr(m,l,I);const D=xn(m*2,h),b=t(I,D,w,o+1,s+m);let M;if(b===iw){const L=A(m),P=p(m)-L;M=n(L,P,!0,o+1,s+m,I)}else M=b&&qg(m,e,t,n,i,s,o+1);return!!M}}const Bu=new G,Xg=new G;function SU(r,e,t={},n=0,i=1/0){const s=n*n,o=i*i;let l=1/0,h=null;if(r.shapecast({boundsTraverseOrder:d=>(Bu.copy(e).clamp(d.min,d.max),Bu.distanceToSquared(e)),intersectsBounds:(d,A,p)=>p<l&&p<o,intersectsTriangle:(d,A)=>{d.closestPointToPoint(e,Bu);const p=e.distanceToSquared(Bu);return p<l&&(Xg.copy(Bu),l=p,h=A),p<s}}),l===1/0)return null;const u=Math.sqrt(l);return t.point?t.point.copy(Xg):t.point=Xg.clone(),t.distance=u,t.faceIndex=h,t}const Gl=new G,Vl=new G,jl=new G,Jd=new Ue,Zd=new Ue,$d=new Ue,fw=new G,pw=new G,Aw=new G,ef=new G;function TU(r,e,t,n,i,s){let o;return s===Qr?o=r.intersectTriangle(n,t,e,!0,i):o=r.intersectTriangle(e,t,n,s!==wi,i),o===null?null:{distance:r.origin.distanceTo(i),point:i.clone()}}function BU(r,e,t,n,i,s,o,l,h){Gl.fromBufferAttribute(e,s),Vl.fromBufferAttribute(e,o),jl.fromBufferAttribute(e,l);const u=TU(r,Gl,Vl,jl,ef,h);if(u){n&&(Jd.fromBufferAttribute(n,s),Zd.fromBufferAttribute(n,o),$d.fromBufferAttribute(n,l),u.uv=un.getInterpolation(ef,Gl,Vl,jl,Jd,Zd,$d,new Ue)),i&&(Jd.fromBufferAttribute(i,s),Zd.fromBufferAttribute(i,o),$d.fromBufferAttribute(i,l),u.uv1=un.getInterpolation(ef,Gl,Vl,jl,Jd,Zd,$d,new Ue)),t&&(fw.fromBufferAttribute(t,s),pw.fromBufferAttribute(t,o),Aw.fromBufferAttribute(t,l),u.normal=un.getInterpolation(ef,Gl,Vl,jl,fw,pw,Aw,new G),u.normal.dot(r.direction)>0&&u.normal.multiplyScalar(-1));const d={a:s,b:o,c:l,normal:new G,materialIndex:0};un.getNormal(Gl,Vl,jl,d.normal),u.face=d,u.faceIndex=s}return u}function tf(r,e,t,n,i){const s=n*3;let o=s+0,l=s+1,h=s+2;const u=r.index;r.index&&(o=u.getX(o),l=u.getX(l),h=u.getX(h));const{position:d,normal:A,uv:p,uv1:g}=r.attributes,_=BU(t,d,A,p,g,o,l,h,e);return _?(_.faceIndex=n,i&&i.push(_),_):null}function Mr(r,e,t,n){const i=r.a,s=r.b,o=r.c;let l=e,h=e+1,u=e+2;t&&(l=t.getX(l),h=t.getX(h),u=t.getX(u)),i.x=n.getX(l),i.y=n.getY(l),i.z=n.getZ(l),s.x=n.getX(h),s.y=n.getY(h),s.z=n.getZ(h),o.x=n.getX(u),o.y=n.getY(u),o.z=n.getZ(u)}function bU(r,e,t,n,i,s){const{geometry:o,_indirectBuffer:l}=r;for(let h=n,u=n+i;h<u;h++)tf(o,e,t,h,s)}function RU(r,e,t,n,i){const{geometry:s,_indirectBuffer:o}=r;let l=1/0,h=null;for(let u=n,d=n+i;u<d;u++){let A;A=tf(s,e,t,u),A&&A.distance<l&&(h=A,l=A.distance)}return h}function DU(r,e,t,n,i,s,o){const{geometry:l}=t,{index:h}=l,u=l.attributes.position;for(let d=r,A=e+r;d<A;d++){let p;if(p=d,Mr(o,p*3,h,u),o.needsUpdate=!0,n(o,p,i,s))return!0}return!1}function LU(r,e=null){e&&Array.isArray(e)&&(e=new Set(e));const t=r.geometry,n=t.index?t.index.array:null,i=t.attributes.position;let s,o,l,h,u=0;const d=r._roots;for(let p=0,g=d.length;p<g;p++)s=d[p],o=new Uint32Array(s),l=new Uint16Array(s),h=new Float32Array(s),A(0,u),u+=s.byteLength;function A(p,g,_=!1){const E=p*2;if(l[E+15]===Wd){const m=o[p+6],v=l[E+14];let w=1/0,x=1/0,I=1/0,R=-1/0,S=-1/0,T=-1/0;for(let D=3*m,b=3*(m+v);D<b;D++){let M=n[D];const L=i.getX(M),P=i.getY(M),N=i.getZ(M);L<w&&(w=L),L>R&&(R=L),P<x&&(x=P),P>S&&(S=P),N<I&&(I=N),N>T&&(T=N)}return h[p+0]!==w||h[p+1]!==x||h[p+2]!==I||h[p+3]!==R||h[p+4]!==S||h[p+5]!==T?(h[p+0]=w,h[p+1]=x,h[p+2]=I,h[p+3]=R,h[p+4]=S,h[p+5]=T,!0):!1}else{const m=p+8,v=o[p+6],w=m+g,x=v+g;let I=_,R=!1,S=!1;e?I||(R=e.has(w),S=e.has(x),I=!R&&!S):(R=!0,S=!0);const T=I||R,D=I||S;let b=!1;T&&(b=A(m,g,I));let M=!1;D&&(M=A(v,g,I));const L=b||M;if(L)for(let P=0;P<3;P++){const N=m+P,W=v+P,X=h[N],K=h[N+3],te=h[W],V=h[W+3];h[p+P]=X<te?X:te,h[p+P+3]=K>V?K:V}return L}}}const gw=new _r;function pa(r,e,t,n){return rr(r,e,gw),t.intersectBox(gw,n)}function NU(r,e,t,n,i,s){const{geometry:o,_indirectBuffer:l}=r;for(let h=n,u=n+i;h<u;h++){let d=l?l[h]:h;tf(o,e,t,d,s)}}function UU(r,e,t,n,i){const{geometry:s,_indirectBuffer:o}=r;let l=1/0,h=null;for(let u=n,d=n+i;u<d;u++){let A;A=tf(s,e,t,o?o[u]:u),A&&A.distance<l&&(h=A,l=A.distance)}return h}function PU(r,e,t,n,i,s,o){const{geometry:l}=t,{index:h}=l,u=l.attributes.position;for(let d=r,A=e+r;d<A;d++){let p;if(p=t.resolveTriangleIndex(d),Mr(o,p*3,h,u),o.needsUpdate=!0,n(o,p,i,s))return!0}return!1}const mw=new G;function kU(r,e,t,n,i){Yt.setBuffer(r._roots[e]),Kg(0,r,t,n,i),Yt.clearBuffer()}function Kg(r,e,t,n,i){const{float32Array:s,uint16Array:o,uint32Array:l}=Yt,h=r*2;if(xn(h,o)){const u=wn(r,l),d=jn(h,o);bU(e,t,n,u,d,i)}else{const u=oi(r);pa(u,s,n,mw)&&Kg(u,e,t,n,i);const d=Wn(r,l);pa(d,s,n,mw)&&Kg(d,e,t,n,i)}}const vw=new G,QU=["x","y","z"];function OU(r,e,t,n){Yt.setBuffer(r._roots[e]);const i=Jg(0,r,t,n);return Yt.clearBuffer(),i}function Jg(r,e,t,n){const{float32Array:i,uint16Array:s,uint32Array:o}=Yt;let l=r*2;if(xn(l,s)){const h=wn(r,o),u=jn(l,s);return RU(e,t,n,h,u)}else{const h=Yg(r,o),u=QU[h],d=n.direction[u]>=0;let A,p;d?(A=oi(r),p=Wn(r,o)):(A=Wn(r,o),p=oi(r));const g=pa(A,i,n,vw)?Jg(A,e,t,n):null;if(g){const E=g.point[u];if(d?E<=i[p+h]:E>=i[p+h+3])return g}const _=pa(p,i,n,vw)?Jg(p,e,t,n):null;return g&&_?g.distance<=_.distance?g:_:g||_||null}}const rf=new _r,Wl=new Ui,Yl=new Ui,bu=new rt,_w=new An,nf=new An;function FU(r,e,t,n){Yt.setBuffer(r._roots[e]);const i=Zg(0,r,t,n);return Yt.clearBuffer(),i}function Zg(r,e,t,n,i=null){const{float32Array:s,uint16Array:o,uint32Array:l}=Yt;let h=r*2;if(i===null&&(t.boundingBox||t.computeBoundingBox(),_w.set(t.boundingBox.min,t.boundingBox.max,n),i=_w),xn(h,o)){const u=e.geometry,d=u.index,A=u.attributes.position,p=t.index,g=t.attributes.position,_=wn(r,l),E=jn(h,o);if(bu.copy(n).invert(),t.boundsTree)return rr(r,s,nf),nf.matrix.copy(bu),nf.needsUpdate=!0,t.boundsTree.shapecast({intersectsBounds:m=>nf.intersectsBox(m),intersectsTriangle:m=>{m.a.applyMatrix4(n),m.b.applyMatrix4(n),m.c.applyMatrix4(n),m.needsUpdate=!0;for(let v=_*3,w=(E+_)*3;v<w;v+=3)if(Mr(Yl,v,d,A),Yl.needsUpdate=!0,m.intersectsTriangle(Yl))return!0;return!1}});for(let m=_*3,v=(E+_)*3;m<v;m+=3){Mr(Wl,m,d,A),Wl.a.applyMatrix4(bu),Wl.b.applyMatrix4(bu),Wl.c.applyMatrix4(bu),Wl.needsUpdate=!0;for(let w=0,x=p.count;w<x;w+=3)if(Mr(Yl,w,p,g),Yl.needsUpdate=!0,Wl.intersectsTriangle(Yl))return!0}}else{const u=r+8,d=l[r+6];return rr(u,s,rf),!!(i.intersectsBox(rf)&&Zg(u,e,t,n,i)||(rr(d,s,rf),i.intersectsBox(rf)&&Zg(d,e,t,n,i)))}}const sf=new rt,$g=new An,Ru=new An,zU=new G,HU=new G,GU=new G,VU=new G;function jU(r,e,t,n={},i={},s=0,o=1/0){e.boundingBox||e.computeBoundingBox(),$g.set(e.boundingBox.min,e.boundingBox.max,t),$g.needsUpdate=!0;const l=r.geometry,h=l.attributes.position,u=l.index,d=e.attributes.position,A=e.index,p=ai.getPrimitive(),g=ai.getPrimitive();let _=zU,E=HU,m=null,v=null;i&&(m=GU,v=VU);let w=1/0,x=null,I=null;return sf.copy(t).invert(),Ru.matrix.copy(sf),r.shapecast({boundsTraverseOrder:R=>$g.distanceToBox(R),intersectsBounds:(R,S,T)=>T<w&&T<o?(S&&(Ru.min.copy(R.min),Ru.max.copy(R.max),Ru.needsUpdate=!0),!0):!1,intersectsRange:(R,S)=>{if(e.boundsTree)return e.boundsTree.shapecast({boundsTraverseOrder:T=>Ru.distanceToBox(T),intersectsBounds:(T,D,b)=>b<w&&b<o,intersectsRange:(T,D)=>{for(let b=T,M=T+D;b<M;b++){Mr(g,3*b,A,d),g.a.applyMatrix4(t),g.b.applyMatrix4(t),g.c.applyMatrix4(t),g.needsUpdate=!0;for(let L=R,P=R+S;L<P;L++){Mr(p,3*L,u,h),p.needsUpdate=!0;const N=p.distanceToTriangle(g,_,m);if(N<w&&(E.copy(_),v&&v.copy(m),w=N,x=L,I=b),N<s)return!0}}}});{const T=Fl(e);for(let D=0,b=T;D<b;D++){Mr(g,3*D,A,d),g.a.applyMatrix4(t),g.b.applyMatrix4(t),g.c.applyMatrix4(t),g.needsUpdate=!0;for(let M=R,L=R+S;M<L;M++){Mr(p,3*M,u,h),p.needsUpdate=!0;const P=p.distanceToTriangle(g,_,m);if(P<w&&(E.copy(_),v&&v.copy(m),w=P,x=M,I=D),P<s)return!0}}}}}),ai.releasePrimitive(p),ai.releasePrimitive(g),w===1/0?null:(n.point?n.point.copy(E):n.point=E.clone(),n.distance=w,n.faceIndex=x,i&&(i.point?i.point.copy(v):i.point=v.clone(),i.point.applyMatrix4(sf),E.applyMatrix4(sf),i.distance=E.sub(i.point).length(),i.faceIndex=I),n)}function WU(r,e=null){e&&Array.isArray(e)&&(e=new Set(e));const t=r.geometry,n=t.index?t.index.array:null,i=t.attributes.position;let s,o,l,h,u=0;const d=r._roots;for(let p=0,g=d.length;p<g;p++)s=d[p],o=new Uint32Array(s),l=new Uint16Array(s),h=new Float32Array(s),A(0,u),u+=s.byteLength;function A(p,g,_=!1){const E=p*2;if(l[E+15]===Wd){const m=o[p+6],v=l[E+14];let w=1/0,x=1/0,I=1/0,R=-1/0,S=-1/0,T=-1/0;for(let D=m,b=m+v;D<b;D++){const M=3*r.resolveTriangleIndex(D);for(let L=0;L<3;L++){let P=M+L;P=n?n[P]:P;const N=i.getX(P),W=i.getY(P),X=i.getZ(P);N<w&&(w=N),N>R&&(R=N),W<x&&(x=W),W>S&&(S=W),X<I&&(I=X),X>T&&(T=X)}}return h[p+0]!==w||h[p+1]!==x||h[p+2]!==I||h[p+3]!==R||h[p+4]!==S||h[p+5]!==T?(h[p+0]=w,h[p+1]=x,h[p+2]=I,h[p+3]=R,h[p+4]=S,h[p+5]=T,!0):!1}else{const m=p+8,v=o[p+6],w=m+g,x=v+g;let I=_,R=!1,S=!1;e?I||(R=e.has(w),S=e.has(x),I=!R&&!S):(R=!0,S=!0);const T=I||R,D=I||S;let b=!1;T&&(b=A(m,g,I));let M=!1;D&&(M=A(v,g,I));const L=b||M;if(L)for(let P=0;P<3;P++){const N=m+P,W=v+P,X=h[N],K=h[N+3],te=h[W],V=h[W+3];h[p+P]=X<te?X:te,h[p+P+3]=K>V?K:V}return L}}}const yw=new G;function YU(r,e,t,n,i){Yt.setBuffer(r._roots[e]),em(0,r,t,n,i),Yt.clearBuffer()}function em(r,e,t,n,i){const{float32Array:s,uint16Array:o,uint32Array:l}=Yt,h=r*2;if(xn(h,o)){const u=wn(r,l),d=jn(h,o);NU(e,t,n,u,d,i)}else{const u=oi(r);pa(u,s,n,yw)&&em(u,e,t,n,i);const d=Wn(r,l);pa(d,s,n,yw)&&em(d,e,t,n,i)}}const Ew=new G,qU=["x","y","z"];function XU(r,e,t,n){Yt.setBuffer(r._roots[e]);const i=tm(0,r,t,n);return Yt.clearBuffer(),i}function tm(r,e,t,n){const{float32Array:i,uint16Array:s,uint32Array:o}=Yt;let l=r*2;if(xn(l,s)){const h=wn(r,o),u=jn(l,s);return UU(e,t,n,h,u)}else{const h=Yg(r,o),u=qU[h],d=n.direction[u]>=0;let A,p;d?(A=oi(r),p=Wn(r,o)):(A=Wn(r,o),p=oi(r));const g=pa(A,i,n,Ew)?tm(A,e,t,n):null;if(g){const E=g.point[u];if(d?E<=i[p+h]:E>=i[p+h+3])return g}const _=pa(p,i,n,Ew)?tm(p,e,t,n):null;return g&&_?g.distance<=_.distance?g:_:g||_||null}}const af=new _r,ql=new Ui,Xl=new Ui,Du=new rt,xw=new An,of=new An;function KU(r,e,t,n){Yt.setBuffer(r._roots[e]);const i=rm(0,r,t,n);return Yt.clearBuffer(),i}function rm(r,e,t,n,i=null){const{float32Array:s,uint16Array:o,uint32Array:l}=Yt;let h=r*2;if(i===null&&(t.boundingBox||t.computeBoundingBox(),xw.set(t.boundingBox.min,t.boundingBox.max,n),i=xw),xn(h,o)){const u=e.geometry,d=u.index,A=u.attributes.position,p=t.index,g=t.attributes.position,_=wn(r,l),E=jn(h,o);if(Du.copy(n).invert(),t.boundsTree)return rr(r,s,of),of.matrix.copy(Du),of.needsUpdate=!0,t.boundsTree.shapecast({intersectsBounds:m=>of.intersectsBox(m),intersectsTriangle:m=>{m.a.applyMatrix4(n),m.b.applyMatrix4(n),m.c.applyMatrix4(n),m.needsUpdate=!0;for(let v=_,w=E+_;v<w;v++)if(Mr(Xl,3*e.resolveTriangleIndex(v),d,A),Xl.needsUpdate=!0,m.intersectsTriangle(Xl))return!0;return!1}});for(let m=_,v=E+_;m<v;m++){const w=e.resolveTriangleIndex(m);Mr(ql,3*w,d,A),ql.a.applyMatrix4(Du),ql.b.applyMatrix4(Du),ql.c.applyMatrix4(Du),ql.needsUpdate=!0;for(let x=0,I=p.count;x<I;x+=3)if(Mr(Xl,x,p,g),Xl.needsUpdate=!0,ql.intersectsTriangle(Xl))return!0}}else{const u=r+8,d=l[r+6];return rr(u,s,af),!!(i.intersectsBox(af)&&rm(u,e,t,n,i)||(rr(d,s,af),i.intersectsBox(af)&&rm(d,e,t,n,i)))}}const lf=new rt,nm=new An,Lu=new An,JU=new G,ZU=new G,$U=new G,eP=new G;function tP(r,e,t,n={},i={},s=0,o=1/0){e.boundingBox||e.computeBoundingBox(),nm.set(e.boundingBox.min,e.boundingBox.max,t),nm.needsUpdate=!0;const l=r.geometry,h=l.attributes.position,u=l.index,d=e.attributes.position,A=e.index,p=ai.getPrimitive(),g=ai.getPrimitive();let _=JU,E=ZU,m=null,v=null;i&&(m=$U,v=eP);let w=1/0,x=null,I=null;return lf.copy(t).invert(),Lu.matrix.copy(lf),r.shapecast({boundsTraverseOrder:R=>nm.distanceToBox(R),intersectsBounds:(R,S,T)=>T<w&&T<o?(S&&(Lu.min.copy(R.min),Lu.max.copy(R.max),Lu.needsUpdate=!0),!0):!1,intersectsRange:(R,S)=>{if(e.boundsTree){const T=e.boundsTree;return T.shapecast({boundsTraverseOrder:D=>Lu.distanceToBox(D),intersectsBounds:(D,b,M)=>M<w&&M<o,intersectsRange:(D,b)=>{for(let M=D,L=D+b;M<L;M++){const P=T.resolveTriangleIndex(M);Mr(g,3*P,A,d),g.a.applyMatrix4(t),g.b.applyMatrix4(t),g.c.applyMatrix4(t),g.needsUpdate=!0;for(let N=R,W=R+S;N<W;N++){const X=r.resolveTriangleIndex(N);Mr(p,3*X,u,h),p.needsUpdate=!0;const K=p.distanceToTriangle(g,_,m);if(K<w&&(E.copy(_),v&&v.copy(m),w=K,x=N,I=M),K<s)return!0}}}})}else{const T=Fl(e);for(let D=0,b=T;D<b;D++){Mr(g,3*D,A,d),g.a.applyMatrix4(t),g.b.applyMatrix4(t),g.c.applyMatrix4(t),g.needsUpdate=!0;for(let M=R,L=R+S;M<L;M++){const P=r.resolveTriangleIndex(M);Mr(p,3*P,u,h),p.needsUpdate=!0;const N=p.distanceToTriangle(g,_,m);if(N<w&&(E.copy(_),v&&v.copy(m),w=N,x=M,I=D),N<s)return!0}}}}}),ai.releasePrimitive(p),ai.releasePrimitive(g),w===1/0?null:(n.point?n.point.copy(E):n.point=E.clone(),n.distance=w,n.faceIndex=x,i&&(i.point?i.point.copy(v):i.point=v.clone(),i.point.applyMatrix4(lf),E.applyMatrix4(lf),i.distance=E.sub(i.point).length(),i.faceIndex=I),n)}function rP(){return typeof SharedArrayBuffer<"u"}const Nu=new Yt.constructor,cf=new Yt.constructor,Aa=new Wg(()=>new _r),Kl=new _r,Jl=new _r,im=new _r,sm=new _r;let am=!1;function nP(r,e,t,n){if(am)throw new Error("MeshBVH: Recursive calls to bvhcast not supported.");am=!0;const i=r._roots,s=e._roots;let o,l=0,h=0;const u=new rt().copy(t).invert();for(let d=0,A=i.length;d<A;d++){Nu.setBuffer(i[d]),h=0;const p=Aa.getPrimitive();rr(0,Nu.float32Array,p),p.applyMatrix4(u);for(let g=0,_=s.length;g<_&&(cf.setBuffer(s[d]),o=Pi(0,0,t,u,n,l,h,0,0,p),cf.clearBuffer(),h+=s[g].length,!o);g++);if(Aa.releasePrimitive(p),Nu.clearBuffer(),l+=i[d].length,o)break}return am=!1,o}function Pi(r,e,t,n,i,s=0,o=0,l=0,h=0,u=null,d=!1){let A,p;d?(A=cf,p=Nu):(A=Nu,p=cf);const g=A.float32Array,_=A.uint32Array,E=A.uint16Array,m=p.float32Array,v=p.uint32Array,w=p.uint16Array,x=r*2,I=e*2,R=xn(x,E),S=xn(I,w);let T=!1;if(S&&R)d?T=i(wn(e,v),jn(e*2,w),wn(r,_),jn(r*2,E),h,o+e,l,s+r):T=i(wn(r,_),jn(r*2,E),wn(e,v),jn(e*2,w),l,s+r,h,o+e);else if(S){const D=Aa.getPrimitive();rr(e,m,D),D.applyMatrix4(t);const b=oi(r),M=Wn(r,_);rr(b,g,Kl),rr(M,g,Jl);const L=D.intersectsBox(Kl),P=D.intersectsBox(Jl);T=L&&Pi(e,b,n,t,i,o,s,h,l+1,D,!d)||P&&Pi(e,M,n,t,i,o,s,h,l+1,D,!d),Aa.releasePrimitive(D)}else{const D=oi(e),b=Wn(e,v);rr(D,m,im),rr(b,m,sm);const M=u.intersectsBox(im),L=u.intersectsBox(sm);if(M&&L)T=Pi(r,D,t,n,i,s,o,l,h+1,u,d)||Pi(r,b,t,n,i,s,o,l,h+1,u,d);else if(M)if(R)T=Pi(r,D,t,n,i,s,o,l,h+1,u,d);else{const P=Aa.getPrimitive();P.copy(im).applyMatrix4(t);const N=oi(r),W=Wn(r,_);rr(N,g,Kl),rr(W,g,Jl);const X=P.intersectsBox(Kl),K=P.intersectsBox(Jl);T=X&&Pi(D,N,n,t,i,o,s,h,l+1,P,!d)||K&&Pi(D,W,n,t,i,o,s,h,l+1,P,!d),Aa.releasePrimitive(P)}else if(L)if(R)T=Pi(r,b,t,n,i,s,o,l,h+1,u,d);else{const P=Aa.getPrimitive();P.copy(sm).applyMatrix4(t);const N=oi(r),W=Wn(r,_);rr(N,g,Kl),rr(W,g,Jl);const X=P.intersectsBox(Kl),K=P.intersectsBox(Jl);T=X&&Pi(b,N,n,t,i,o,s,h,l+1,P,!d)||K&&Pi(b,W,n,t,i,o,s,h,l+1,P,!d),Aa.releasePrimitive(P)}}return T}const uf=new An,ww=new _r;class om{static serialize(e,t={}){t={cloneBuffers:!0,...t};const n=e.geometry,i=e._roots,s=e._indirectBuffer,o=n.getIndex();let l;return t.cloneBuffers?l={roots:i.map(h=>h.slice()),index:o.array.slice(),indirectBuffer:s?s.slice():null}:l={roots:i,index:o.array,indirectBuffer:s},l}static deserialize(e,t,n={}){n={setIndex:!0,indirect:!!e.indirectBuffer,...n};const{index:i,roots:s,indirectBuffer:o}=e,l=new om(t,{...n,[Hg]:!0});if(l._roots=s,l._indirectBuffer=o||null,n.setIndex){const h=t.getIndex();if(h===null){const u=new zr(e.index,1,!1);t.setIndex(u)}else h.array!==i&&(h.array.set(i),h.needsUpdate=!0)}return l}get indirect(){return!!this._indirectBuffer}constructor(e,t={}){if(e.isBufferGeometry){if(e.index&&e.index.isInterleavedBufferAttribute)throw new Error("MeshBVH: InterleavedBufferAttribute is not supported for the index attribute.")}else throw new Error("MeshBVH: Only BufferGeometries are supported.");if(t=Object.assign({strategy:rw,maxDepth:40,maxLeafTris:10,verbose:!0,useSharedArrayBuffer:!1,setBoundingBox:!0,onProgress:null,indirect:!1,[Hg]:!1},t),t.useSharedArrayBuffer&&!rP())throw new Error("MeshBVH: SharedArrayBuffer is not available.");this.geometry=e,this._roots=null,this._indirectBuffer=null,t[Hg]||(yU(this,t),!e.boundingBox&&t.setBoundingBox&&(e.boundingBox=this.getBoundingBox(new _r)));const{_indirectBuffer:n}=this;this.resolveTriangleIndex=t.indirect?i=>n[i]:i=>i}refit(e=null){return(this.indirect?WU:LU)(this,e)}traverse(e,t=0){const n=this._roots[t],i=new Uint32Array(n),s=new Uint16Array(n);o(0);function o(l,h=0){const u=l*2,d=s[u+15]===Wd;if(d){const A=i[l+6],p=s[u+14];e(h,d,new Float32Array(n,l*4,6),A,p)}else{const A=l+Eo/4,p=i[l+6],g=i[l+7];e(h,d,new Float32Array(n,l*4,6),g)||(o(A,h+1),o(p,h+1))}}}raycast(e,t=xi){const n=this._roots,i=this.geometry,s=[],o=t.isMaterial,l=Array.isArray(t),h=i.groups,u=o?t.side:t,d=this.indirect?YU:kU;for(let A=0,p=n.length;A<p;A++){const g=l?t[h[A].materialIndex].side:u,_=s.length;if(d(this,A,g,e,s),l){const E=h[A].materialIndex;for(let m=_,v=s.length;m<v;m++)s[m].face.materialIndex=E}}return s}raycastFirst(e,t=xi){const n=this._roots,i=this.geometry,s=t.isMaterial,o=Array.isArray(t);let l=null;const h=i.groups,u=s?t.side:t,d=this.indirect?XU:OU;for(let A=0,p=n.length;A<p;A++){const g=o?t[h[A].materialIndex].side:u,_=d(this,A,g,e);_!=null&&(l==null||_.distance<l.distance)&&(l=_,o&&(_.face.materialIndex=h[A].materialIndex))}return l}intersectsGeometry(e,t){let n=!1;const i=this._roots,s=this.indirect?KU:FU;for(let o=0,l=i.length;o<l&&(n=s(this,o,e,t),!n);o++);return n}shapecast(e){const t=ai.getPrimitive(),n=this.indirect?PU:DU;let{boundsTraverseOrder:i,intersectsBounds:s,intersectsRange:o,intersectsTriangle:l}=e;if(o&&l){const A=o;o=(p,g,_,E,m)=>A(p,g,_,E,m)?!0:n(p,g,this,l,_,E,t)}else o||(l?o=(A,p,g,_)=>n(A,p,this,l,g,_,t):o=(A,p,g)=>g);let h=!1,u=0;const d=this._roots;for(let A=0,p=d.length;A<p;A++){const g=d[A];if(h=MU(this,A,s,o,i,u),h)break;u+=g.byteLength}return ai.releasePrimitive(t),h}bvhcast(e,t,n){let{intersectsRanges:i,intersectsTriangles:s}=n;const o=ai.getPrimitive(),l=this.geometry.index,h=this.geometry.attributes.position,u=this.indirect?_=>{const E=this.resolveTriangleIndex(_);Mr(o,E*3,l,h)}:_=>{Mr(o,_*3,l,h)},d=ai.getPrimitive(),A=e.geometry.index,p=e.geometry.attributes.position,g=e.indirect?_=>{const E=e.resolveTriangleIndex(_);Mr(d,E*3,A,p)}:_=>{Mr(d,_*3,A,p)};if(s){const _=(E,m,v,w,x,I,R,S)=>{for(let T=v,D=v+w;T<D;T++){g(T),d.a.applyMatrix4(t),d.b.applyMatrix4(t),d.c.applyMatrix4(t),d.needsUpdate=!0;for(let b=E,M=E+m;b<M;b++)if(u(b),o.needsUpdate=!0,s(o,d,b,T,x,I,R,S))return!0}return!1};if(i){const E=i;i=function(m,v,w,x,I,R,S,T){return E(m,v,w,x,I,R,S,T)?!0:_(m,v,w,x,I,R,S,T)}}else i=_}return nP(this,e,t,i)}intersectsBox(e,t){return uf.set(e.min,e.max,t),uf.needsUpdate=!0,this.shapecast({intersectsBounds:n=>uf.intersectsBox(n),intersectsTriangle:n=>uf.intersectsTriangle(n)})}intersectsSphere(e){return this.shapecast({intersectsBounds:t=>e.intersectsBox(t),intersectsTriangle:t=>t.intersectsSphere(e)})}closestPointToGeometry(e,t,n={},i={},s=0,o=1/0){return(this.indirect?tP:jU)(this,e,t,n,i,s,o)}closestPointToPoint(e,t={},n=0,i=1/0){return SU(this,e,t,n,i)}getBoundingBox(e){return e.makeEmpty(),this._roots.forEach(t=>{rr(0,new Float32Array(t),ww),e.union(ww)}),e}}function iP(r){switch(r){case 1:return"R";case 2:return"RG";case 3:return"RGBA";case 4:return"RGBA"}throw new Error}function sP(r){switch(r){case 1:return ea;case 2:return so;case 3:return vr;case 4:return vr}}function Iw(r){switch(r){case 1:return EA;case 2:return td;case 3:return ou;case 4:return ou}}class Cw extends mo{constructor(){super(),this.minFilter=Ar,this.magFilter=Ar,this.generateMipmaps=!1,this.overrideItemSize=null,this._forcedType=null}updateFrom(e){const t=this.overrideItemSize,n=e.itemSize,i=e.count;if(t!==null){if(n*i%t!==0)throw new Error("VertexAttributeTexture: overrideItemSize must divide evenly into buffer length.");e.itemSize=t,e.count=i*n/t}const s=e.itemSize,o=e.count,l=e.normalized,h=e.array.constructor,u=h.BYTES_PER_ELEMENT;let d=this._forcedType,A=s;if(d===null)switch(h){case Float32Array:d=lr;break;case Uint8Array:case Uint16Array:case Uint32Array:d=Mi;break;case Int8Array:case Int16Array:case Int32Array:d=iu;break}let p,g,_,E,m=iP(s);switch(d){case lr:_=1,g=sP(s),l&&u===1?(E=h,m+="8",h===Uint8Array?p=mr:(p=_A,m+="_SNORM")):(E=Float32Array,m+="32F",p=lr);break;case iu:m+=u*8+"I",_=l?Math.pow(2,h.BYTES_PER_ELEMENT*8-1):1,g=Iw(s),u===1?(E=Int8Array,p=_A):u===2?(E=Int16Array,p=lE):(E=Int32Array,p=iu);break;case Mi:m+=u*8+"UI",_=l?Math.pow(2,h.BYTES_PER_ELEMENT*8-1):1,g=Iw(s),u===1?(E=Uint8Array,p=mr):u===2?(E=Uint16Array,p=yA):(E=Uint32Array,p=Mi);break}A===3&&(g===vr||g===ou)&&(A=4);const v=Math.ceil(Math.sqrt(o)),w=A*v*v,x=new E(w),I=e.normalized;e.normalized=!1;for(let R=0;R<o;R++){const S=A*R;x[S]=e.getX(R)/_,s>=2&&(x[S+1]=e.getY(R)/_),s>=3&&(x[S+2]=e.getZ(R)/_,A===4&&(x[S+3]=1)),s>=4&&(x[S+3]=e.getW(R)/_)}e.normalized=I,this.internalFormat=m,this.format=g,this.type=p,this.image.width=v,this.image.height=v,this.image.data=x,this.needsUpdate=!0,this.dispose(),e.itemSize=n,e.count=i}}class aP extends Cw{constructor(){super(),this._forcedType=Mi}}class oP extends Cw{constructor(){super(),this._forcedType=lr}}class Mw{constructor(){this.index=new aP,this.position=new oP,this.bvhBounds=new mo,this.bvhContents=new mo,this._cachedIndexAttr=null,this.index.overrideItemSize=3}updateFrom(e){const{geometry:t}=e;if(cP(e,this.bvhBounds,this.bvhContents),this.position.updateFrom(t.attributes.position),e.indirect){const n=e._indirectBuffer;if(this._cachedIndexAttr===null||this._cachedIndexAttr.count!==n.length)if(t.index)this._cachedIndexAttr=t.index.clone();else{const i=ow(aw(t));this._cachedIndexAttr=new zr(i,1,!1)}lP(t,n,this._cachedIndexAttr),this.index.updateFrom(this._cachedIndexAttr)}else this.index.updateFrom(t.index)}dispose(){const{index:e,position:t,bvhBounds:n,bvhContents:i}=this;e&&e.dispose(),t&&t.dispose(),n&&n.dispose(),i&&i.dispose()}}function lP(r,e,t){const n=t.array,i=r.index?r.index.array:null;for(let s=0,o=e.length;s<o;s++){const l=3*s,h=3*e[s];for(let u=0;u<3;u++)n[l+u]=i?i[h+u]:h+u}}function cP(r,e,t){const n=r._roots;if(n.length!==1)throw new Error("MeshBVHUniformStruct: Multi-root BVHs not supported.");const i=n[0],s=new Uint16Array(i),o=new Uint32Array(i),l=new Float32Array(i),h=i.byteLength/Eo,u=2*Math.ceil(Math.sqrt(h/2)),d=new Float32Array(4*u*u),A=Math.ceil(Math.sqrt(h)),p=new Uint32Array(2*A*A);for(let g=0;g<h;g++){const _=g*Eo/4,E=_*2,m=_;for(let v=0;v<3;v++)d[8*g+0+v]=l[m+0+v],d[8*g+4+v]=l[m+3+v];if(xn(E,s)){const v=jn(E,s),w=wn(_,o),x=4294901760|v;p[g*2+0]=x,p[g*2+1]=w}else{const v=4*Wn(_,o)/Eo,w=Yg(_,o);p[g*2+0]=w,p[g*2+1]=v}}e.image.data=d,e.image.width=u,e.image.height=u,e.format=vr,e.type=lr,e.internalFormat="RGBA32F",e.minFilter=Ar,e.magFilter=Ar,e.generateMipmaps=!1,e.needsUpdate=!0,e.dispose(),t.image.data=p,t.image.width=A,t.image.height=A,t.format=td,t.type=Mi,t.internalFormat="RG32UI",t.minFilter=Ar,t.magFilter=Ar,t.generateMipmaps=!1,t.needsUpdate=!0,t.dispose()}const uP=`
4072
4072
  #ifndef TRI_INTERSECT_EPSILON
4073
4073
  #define TRI_INTERSECT_EPSILON 1e-5
4074
4074
  #endif
@@ -4335,7 +4335,7 @@ bool bvhIntersectFirstHit(
4335
4335
  return found;
4336
4336
 
4337
4337
  }
4338
- `;function dP(r,e,t,n){const i=class extends Cr{constructor(s={}){const o=Object.entries(r);super({uniforms:o.reduce((l,[h,u])=>{const d=Ml.clone({[h]:{value:u}});return{...l,...d}},{}),vertexShader:e,fragmentShader:t}),this.key="",o.forEach(([l])=>Object.defineProperty(this,l,{get:()=>this.uniforms[l].value,set:h=>this.uniforms[l].value=h})),Object.assign(this,s),n&&n(this)}};return i.key=UA.generateUUID(),i}const fP=()=>parseInt(Kh.replace(/\D+/g,"")),pP=fP(),AP=dP({envMap:null,bounces:2,ior:2.8,correctMips:!0,aberrationStrength:0,fresnel:1,bvh:new Mw,color:new Ve("#d9ebf4").multiplyScalar(.5),resolution:new Ue,viewMatrixInverse:new rt,projectionMatrixInverse:new rt},`
4338
+ `;function dP(r,e,t,n){const i=class extends Cr{constructor(s={}){const o=Object.entries(r);super({uniforms:o.reduce((l,[h,u])=>{const d=Ml.clone({[h]:{value:u}});return{...l,...d}},{}),vertexShader:e,fragmentShader:t}),this.key="",o.forEach(([l])=>Object.defineProperty(this,l,{get:()=>this.uniforms[l].value,set:h=>this.uniforms[l].value=h})),Object.assign(this,s),n&&n(this)}};return i.key=NA.generateUUID(),i}const fP=()=>parseInt(Kh.replace(/\D+/g,"")),pP=fP(),AP=dP({envMap:null,bounces:2,ior:2.8,correctMips:!0,aberrationStrength:0,fresnel:1,bvh:new Mw,color:new Ve("#d9ebf4").multiplyScalar(.5),resolution:new Ue,viewMatrixInverse:new rt,projectionMatrixInverse:new rt},`
4339
4339
  uniform mat4 viewMatrixInverse;
4340
4340
 
4341
4341
  varying vec3 vWorldPosition;
@@ -4490,7 +4490,7 @@ bool bvhIntersectFirstHit(
4490
4490
  * Subject to the terms at https://gsap.com/standard-license or for
4491
4491
  * Club GSAP members, the agreement issued with that membership.
4492
4492
  * @author: Jack Doyle, jack@greensock.com
4493
- */var Yn={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},Zl={duration:.5,overwrite:!1,delay:0},cm,en,$t,li=1e8,Gt=1/li,um=Math.PI*2,gP=um/4,mP=0,Tw=Math.sqrt,vP=Math.cos,_P=Math.sin,Gr=function(r){return typeof r=="string"},ur=function(r){return typeof r=="function"},Rs=function(r){return typeof r=="number"},hm=function(r){return typeof r>"u"},ts=function(r){return typeof r=="object"},In=function(r){return r!==!1},dm=function(){return typeof window<"u"},hf=function(r){return ur(r)||Gr(r)},Bw=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},tn=Array.isArray,fm=/(?:-?\.?\d|\.)+/gi,bw=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,$l=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,pm=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,Rw=/[+-]=-?[.\d]+/,Dw=/[^,'"\[\]\s]+/gi,yP=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,nr,rs,Am,gm,qn={},df={},Lw,Nw=function(r){return(df=wo(r,qn))&&Sn},mm=function(r,e){return console.warn("Invalid property",r,"set to",e,"Missing plugin? gsap.registerPlugin()")},Uu=function(r,e){return!e&&console.warn(r)},Uw=function(r,e){return r&&(qn[r]=e)&&df&&(df[r]=e)||qn},Pu=function(){return 0},EP={suppressEvents:!0,isStart:!0,kill:!1},ff={suppressEvents:!0,kill:!1},xP={suppressEvents:!0},vm={},ga=[],_m={},Pw,Xn={},ym={},kw=30,pf=[],Em="",xm=function(r){var e=r[0],t,n;if(ts(e)||ur(e)||(r=[r]),!(t=(e._gsap||{}).harness)){for(n=pf.length;n--&&!pf[n].targetTest(e););t=pf[n]}for(n=r.length;n--;)r[n]&&(r[n]._gsap||(r[n]._gsap=new dI(r[n],t)))||r.splice(n,1);return r},xo=function(r){return r._gsap||xm(hi(r))[0]._gsap},Qw=function(r,e,t){return(t=r[e])&&ur(t)?r[e]():hm(t)&&r.getAttribute&&r.getAttribute(e)||t},Cn=function(r,e){return(r=r.split(",")).forEach(e)||r},yr=function(r){return Math.round(r*1e5)/1e5||0},Vr=function(r){return Math.round(r*1e7)/1e7||0},ec=function(r,e){var t=e.charAt(0),n=parseFloat(e.substr(2));return r=parseFloat(r),t==="+"?r+n:t==="-"?r-n:t==="*"?r*n:r/n},wP=function(r,e){for(var t=e.length,n=0;r.indexOf(e[n])<0&&++n<t;);return n<t},Af=function(){var r=ga.length,e=ga.slice(0),t,n;for(_m={},ga.length=0,t=0;t<r;t++)n=e[t],n&&n._lazy&&(n.render(n._lazy[0],n._lazy[1],!0)._lazy=0)},Ow=function(r,e,t,n){ga.length&&!en&&Af(),r.render(e,t,n||en&&e<0&&(r._initted||r._startAt)),ga.length&&!en&&Af()},Fw=function(r){var e=parseFloat(r);return(e||e===0)&&(r+"").match(Dw).length<2?e:Gr(r)?r.trim():r},zw=function(r){return r},ci=function(r,e){for(var t in e)t in r||(r[t]=e[t]);return r},IP=function(r){return function(e,t){for(var n in t)n in e||n==="duration"&&r||n==="ease"||(e[n]=t[n])}},wo=function(r,e){for(var t in e)r[t]=e[t];return r},Hw=function r(e,t){for(var n in t)n!=="__proto__"&&n!=="constructor"&&n!=="prototype"&&(e[n]=ts(t[n])?r(e[n]||(e[n]={}),t[n]):t[n]);return e},gf=function(r,e){var t={},n;for(n in r)n in e||(t[n]=r[n]);return t},ku=function(r){var e=r.parent||nr,t=r.keyframes?IP(tn(r.keyframes)):ci;if(In(r.inherit))for(;e;)t(r,e.vars.defaults),e=e.parent||e._dp;return r},CP=function(r,e){for(var t=r.length,n=t===e.length;n&&t--&&r[t]===e[t];);return t<0},Gw=function(r,e,t,n,i){t===void 0&&(t="_first"),n===void 0&&(n="_last");var s=r[n],o;if(i)for(o=e[i];s&&s[i]>o;)s=s._prev;return s?(e._next=s._next,s._next=e):(e._next=r[t],r[t]=e),e._next?e._next._prev=e:r[n]=e,e._prev=s,e.parent=e._dp=r,e},mf=function(r,e,t,n){t===void 0&&(t="_first"),n===void 0&&(n="_last");var i=e._prev,s=e._next;i?i._next=s:r[t]===e&&(r[t]=s),s?s._prev=i:r[n]===e&&(r[n]=i),e._next=e._prev=e.parent=null},ma=function(r,e){r.parent&&(!e||r.parent.autoRemoveChildren)&&r.parent.remove&&r.parent.remove(r),r._act=0},Io=function(r,e){if(r&&(!e||e._end>r._dur||e._start<0))for(var t=r;t;)t._dirty=1,t=t.parent;return r},MP=function(r){for(var e=r.parent;e&&e.parent;)e._dirty=1,e.totalDuration(),e=e.parent;return r},wm=function(r,e,t,n){return r._startAt&&(en?r._startAt.revert(ff):r.vars.immediateRender&&!r.vars.autoRevert||r._startAt.render(e,!0,n))},SP=function r(e){return!e||e._ts&&r(e.parent)},Vw=function(r){return r._repeat?tc(r._tTime,r=r.duration()+r._rDelay)*r:0},tc=function(r,e){var t=Math.floor(r/=e);return r&&t===r?t-1:t},vf=function(r,e){return(r-e._start)*e._ts+(e._ts>=0?0:e._dirty?e.totalDuration():e._tDur)},_f=function(r){return r._end=Vr(r._start+(r._tDur/Math.abs(r._ts||r._rts||Gt)||0))},yf=function(r,e){var t=r._dp;return t&&t.smoothChildTiming&&r._ts&&(r._start=Vr(t._time-(r._ts>0?e/r._ts:((r._dirty?r.totalDuration():r._tDur)-e)/-r._ts)),_f(r),t._dirty||Io(t,r)),r},jw=function(r,e){var t;if((e._time||!e._dur&&e._initted||e._start<r._time&&(e._dur||!e.add))&&(t=vf(r.rawTime(),e),(!e._dur||Ou(0,e.totalDuration(),t)-e._tTime>Gt)&&e.render(t,!0)),Io(r,e)._dp&&r._initted&&r._time>=r._dur&&r._ts){if(r._dur<r.duration())for(t=r;t._dp;)t.rawTime()>=0&&t.totalTime(t._tTime),t=t._dp;r._zTime=-Gt}},ns=function(r,e,t,n){return e.parent&&ma(e),e._start=Vr((Rs(t)?t:t||r!==nr?ui(r,t,e):r._time)+e._delay),e._end=Vr(e._start+(e.totalDuration()/Math.abs(e.timeScale())||0)),Gw(r,e,"_first","_last",r._sort?"_start":0),Im(e)||(r._recent=e),n||jw(r,e),r._ts<0&&yf(r,r._tTime),r},Ww=function(r,e){return(qn.ScrollTrigger||mm("scrollTrigger",e))&&qn.ScrollTrigger.create(e,r)},Yw=function(r,e,t,n,i){if(Lm(r,e,i),!r._initted)return 1;if(!t&&r._pt&&!en&&(r._dur&&r.vars.lazy!==!1||!r._dur&&r.vars.lazy)&&Pw!==Jn.frame)return ga.push(r),r._lazy=[i,n],1},TP=function r(e){var t=e.parent;return t&&t._ts&&t._initted&&!t._lock&&(t.rawTime()<0||r(t))},Im=function(r){var e=r.data;return e==="isFromStart"||e==="isStart"},BP=function(r,e,t,n){var i=r.ratio,s=e<0||!e&&(!r._start&&TP(r)&&!(!r._initted&&Im(r))||(r._ts<0||r._dp._ts<0)&&!Im(r))?0:1,o=r._rDelay,l=0,h,u,d;if(o&&r._repeat&&(l=Ou(0,r._tDur,e),u=tc(l,o),r._yoyo&&u&1&&(s=1-s),u!==tc(r._tTime,o)&&(i=1-s,r.vars.repeatRefresh&&r._initted&&r.invalidate())),s!==i||en||n||r._zTime===Gt||!e&&r._zTime){if(!r._initted&&Yw(r,e,n,t,l))return;for(d=r._zTime,r._zTime=e||(t?Gt:0),t||(t=e&&!d),r.ratio=s,r._from&&(s=1-s),r._time=0,r._tTime=l,h=r._pt;h;)h.r(s,h.d),h=h._next;e<0&&wm(r,e,t,!0),r._onUpdate&&!t&&Kn(r,"onUpdate"),l&&r._repeat&&!t&&r.parent&&Kn(r,"onRepeat"),(e>=r._tDur||e<0)&&r.ratio===s&&(s&&ma(r,1),!t&&!en&&(Kn(r,s?"onComplete":"onReverseComplete",!0),r._prom&&r._prom()))}else r._zTime||(r._zTime=e)},bP=function(r,e,t){var n;if(t>e)for(n=r._first;n&&n._start<=t;){if(n.data==="isPause"&&n._start>e)return n;n=n._next}else for(n=r._last;n&&n._start>=t;){if(n.data==="isPause"&&n._start<e)return n;n=n._prev}},rc=function(r,e,t,n){var i=r._repeat,s=Vr(e)||0,o=r._tTime/r._tDur;return o&&!n&&(r._time*=s/r._dur),r._dur=s,r._tDur=i?i<0?1e10:Vr(s*(i+1)+r._rDelay*i):s,o>0&&!n&&yf(r,r._tTime=r._tDur*o),r.parent&&_f(r),t||Io(r.parent,r),r},qw=function(r){return r instanceof gn?Io(r):rc(r,r._dur)},RP={_start:0,endTime:Pu,totalDuration:Pu},ui=function r(e,t,n){var i=e.labels,s=e._recent||RP,o=e.duration()>=li?s.endTime(!1):e._dur,l,h,u;return Gr(t)&&(isNaN(t)||t in i)?(h=t.charAt(0),u=t.substr(-1)==="%",l=t.indexOf("="),h==="<"||h===">"?(l>=0&&(t=t.replace(/=/,"")),(h==="<"?s._start:s.endTime(s._repeat>=0))+(parseFloat(t.substr(1))||0)*(u?(l<0?s:n).totalDuration()/100:1)):l<0?(t in i||(i[t]=o),i[t]):(h=parseFloat(t.charAt(l-1)+t.substr(l+1)),u&&n&&(h=h/100*(tn(n)?n[0]:n).totalDuration()),l>1?r(e,t.substr(0,l-1),n)+h:o+h)):t==null?o:+t},Qu=function(r,e,t){var n=Rs(e[1]),i=(n?2:1)+(r<2?0:1),s=e[i],o,l;if(n&&(s.duration=e[1]),s.parent=t,r){for(o=s,l=t;l&&!("immediateRender"in o);)o=l.vars.defaults||{},l=In(l.vars.inherit)&&l.parent;s.immediateRender=In(o.immediateRender),r<2?s.runBackwards=1:s.startAt=e[i-1]}return new Sr(e[0],s,e[i+1])},va=function(r,e){return r||r===0?e(r):e},Ou=function(r,e,t){return t<r?r:t>e?e:t},rn=function(r,e){return!Gr(r)||!(e=yP.exec(r))?"":e[1]},DP=function(r,e,t){return va(t,function(n){return Ou(r,e,n)})},Cm=[].slice,Xw=function(r,e){return r&&ts(r)&&"length"in r&&(!e&&!r.length||r.length-1 in r&&ts(r[0]))&&!r.nodeType&&r!==rs},LP=function(r,e,t){return t===void 0&&(t=[]),r.forEach(function(n){var i;return Gr(n)&&!e||Xw(n,1)?(i=t).push.apply(i,hi(n)):t.push(n)})||t},hi=function(r,e,t){return $t&&!e&&$t.selector?$t.selector(r):Gr(r)&&!t&&(Am||!ic())?Cm.call((e||gm).querySelectorAll(r),0):tn(r)?LP(r,t):Xw(r)?Cm.call(r,0):r?[r]:[]},Mm=function(r){return r=hi(r)[0]||Uu("Invalid scope")||{},function(e){var t=r.current||r.nativeElement||r;return hi(e,t.querySelectorAll?t:t===r?Uu("Invalid scope")||gm.createElement("div"):r)}},Kw=function(r){return r.sort(function(){return .5-Math.random()})},Jw=function(r){if(ur(r))return r;var e=ts(r)?r:{each:r},t=Co(e.ease),n=e.from||0,i=parseFloat(e.base)||0,s={},o=n>0&&n<1,l=isNaN(n)||o,h=e.axis,u=n,d=n;return Gr(n)?u=d={center:.5,edges:.5,end:1}[n]||0:!o&&l&&(u=n[0],d=n[1]),function(A,p,g){var _=(g||e).length,E=s[_],m,v,w,x,I,R,S,T,D;if(!E){if(D=e.grid==="auto"?0:(e.grid||[1,li])[1],!D){for(S=-li;S<(S=g[D++].getBoundingClientRect().left)&&D<_;);D<_&&D--}for(E=s[_]=[],m=l?Math.min(D,_)*u-.5:n%D,v=D===li?0:l?_*d/D-.5:n/D|0,S=0,T=li,R=0;R<_;R++)w=R%D-m,x=v-(R/D|0),E[R]=I=h?Math.abs(h==="y"?x:w):Tw(w*w+x*x),I>S&&(S=I),I<T&&(T=I);n==="random"&&Kw(E),E.max=S-T,E.min=T,E.v=_=(parseFloat(e.amount)||parseFloat(e.each)*(D>_?_-1:h?h==="y"?_/D:D:Math.max(D,_/D))||0)*(n==="edges"?-1:1),E.b=_<0?i-_:i,E.u=rn(e.amount||e.each)||0,t=t&&_<0?cI(t):t}return _=(E[A]-E.min)/E.max||0,Vr(E.b+(t?t(_):_)*E.v)+E.u}},Sm=function(r){var e=Math.pow(10,((r+"").split(".")[1]||"").length);return function(t){var n=Vr(Math.round(parseFloat(t)/r)*r*e);return(n-n%1)/e+(Rs(t)?0:rn(t))}},Zw=function(r,e){var t=tn(r),n,i;return!t&&ts(r)&&(n=t=r.radius||li,r.values?(r=hi(r.values),(i=!Rs(r[0]))&&(n*=n)):r=Sm(r.increment)),va(e,t?ur(r)?function(s){return i=r(s),Math.abs(i-s)<=n?i:s}:function(s){for(var o=parseFloat(i?s.x:s),l=parseFloat(i?s.y:0),h=li,u=0,d=r.length,A,p;d--;)i?(A=r[d].x-o,p=r[d].y-l,A=A*A+p*p):A=Math.abs(r[d]-o),A<h&&(h=A,u=d);return u=!n||h<=n?r[u]:s,i||u===s||Rs(s)?u:u+rn(s)}:Sm(r))},$w=function(r,e,t,n){return va(tn(r)?!e:t===!0?!!(t=0):!n,function(){return tn(r)?r[~~(Math.random()*r.length)]:(t=t||1e-5)&&(n=t<1?Math.pow(10,(t+"").length-2):1)&&Math.floor(Math.round((r-t/2+Math.random()*(e-r+t*.99))/t)*t*n)/n})},NP=function(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];return function(n){return e.reduce(function(i,s){return s(i)},n)}},UP=function(r,e){return function(t){return r(parseFloat(t))+(e||rn(t))}},PP=function(r,e,t){return tI(r,e,0,1,t)},eI=function(r,e,t){return va(t,function(n){return r[~~e(n)]})},kP=function r(e,t,n){var i=t-e;return tn(e)?eI(e,r(0,e.length),t):va(n,function(s){return(i+(s-e)%i)%i+e})},QP=function r(e,t,n){var i=t-e,s=i*2;return tn(e)?eI(e,r(0,e.length-1),t):va(n,function(o){return o=(s+(o-e)%s)%s||0,e+(o>i?s-o:o)})},Fu=function(r){for(var e=0,t="",n,i,s,o;~(n=r.indexOf("random(",e));)s=r.indexOf(")",n),o=r.charAt(n+7)==="[",i=r.substr(n+7,s-n-7).match(o?Dw:fm),t+=r.substr(e,n-e)+$w(o?i:+i[0],o?0:+i[1],+i[2]||1e-5),e=s+1;return t+r.substr(e,r.length-e)},tI=function(r,e,t,n,i){var s=e-r,o=n-t;return va(i,function(l){return t+((l-r)/s*o||0)})},OP=function r(e,t,n,i){var s=isNaN(e+t)?0:function(g){return(1-g)*e+g*t};if(!s){var o=Gr(e),l={},h,u,d,A,p;if(n===!0&&(i=1)&&(n=null),o)e={p:e},t={p:t};else if(tn(e)&&!tn(t)){for(d=[],A=e.length,p=A-2,u=1;u<A;u++)d.push(r(e[u-1],e[u]));A--,s=function(g){g*=A;var _=Math.min(p,~~g);return d[_](g-_)},n=t}else i||(e=wo(tn(e)?[]:{},e));if(!d){for(h in t)Rm.call(l,e,h,"get",t[h]);s=function(g){return Pm(g,l)||(o?e.p:e)}}}return va(n,s)},rI=function(r,e,t){var n=r.labels,i=li,s,o,l;for(s in n)o=n[s]-e,o<0==!!t&&o&&i>(o=Math.abs(o))&&(l=s,i=o);return l},Kn=function(r,e,t){var n=r.vars,i=n[e],s=$t,o=r._ctx,l,h,u;if(i)return l=n[e+"Params"],h=n.callbackScope||r,t&&ga.length&&Af(),o&&($t=o),u=l?i.apply(h,l):i.call(h),$t=s,u},zu=function(r){return ma(r),r.scrollTrigger&&r.scrollTrigger.kill(!!en),r.progress()<1&&Kn(r,"onInterrupt"),r},nc,nI=[],iI=function(r){if(r)if(r=!r.name&&r.default||r,dm()||r.headless){var e=r.name,t=ur(r),n=e&&!t&&r.init?function(){this._props=[]}:r,i={init:Pu,render:Pm,add:Rm,kill:t7,modifier:e7,rawVars:0},s={targetTest:0,get:0,getSetter:Um,aliases:{},register:0};if(ic(),r!==n){if(Xn[e])return;ci(n,ci(gf(r,i),s)),wo(n.prototype,wo(i,gf(r,s))),Xn[n.prop=e]=n,r.targetTest&&(pf.push(n),vm[e]=1),e=(e==="css"?"CSS":e.charAt(0).toUpperCase()+e.substr(1))+"Plugin"}Uw(e,n),r.register&&r.register(Sn,n,Mn)}else nI.push(r)},zt=255,Hu={aqua:[0,zt,zt],lime:[0,zt,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,zt],navy:[0,0,128],white:[zt,zt,zt],olive:[128,128,0],yellow:[zt,zt,0],orange:[zt,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[zt,0,0],pink:[zt,192,203],cyan:[0,zt,zt],transparent:[zt,zt,zt,0]},Tm=function(r,e,t){return r+=r<0?1:r>1?-1:0,(r*6<1?e+(t-e)*r*6:r<.5?t:r*3<2?e+(t-e)*(2/3-r)*6:e)*zt+.5|0},sI=function(r,e,t){var n=r?Rs(r)?[r>>16,r>>8&zt,r&zt]:0:Hu.black,i,s,o,l,h,u,d,A,p,g;if(!n){if(r.substr(-1)===","&&(r=r.substr(0,r.length-1)),Hu[r])n=Hu[r];else if(r.charAt(0)==="#"){if(r.length<6&&(i=r.charAt(1),s=r.charAt(2),o=r.charAt(3),r="#"+i+i+s+s+o+o+(r.length===5?r.charAt(4)+r.charAt(4):"")),r.length===9)return n=parseInt(r.substr(1,6),16),[n>>16,n>>8&zt,n&zt,parseInt(r.substr(7),16)/255];r=parseInt(r.substr(1),16),n=[r>>16,r>>8&zt,r&zt]}else if(r.substr(0,3)==="hsl"){if(n=g=r.match(fm),!e)l=+n[0]%360/360,h=+n[1]/100,u=+n[2]/100,s=u<=.5?u*(h+1):u+h-u*h,i=u*2-s,n.length>3&&(n[3]*=1),n[0]=Tm(l+1/3,i,s),n[1]=Tm(l,i,s),n[2]=Tm(l-1/3,i,s);else if(~r.indexOf("="))return n=r.match(bw),t&&n.length<4&&(n[3]=1),n}else n=r.match(fm)||Hu.transparent;n=n.map(Number)}return e&&!g&&(i=n[0]/zt,s=n[1]/zt,o=n[2]/zt,d=Math.max(i,s,o),A=Math.min(i,s,o),u=(d+A)/2,d===A?l=h=0:(p=d-A,h=u>.5?p/(2-d-A):p/(d+A),l=d===i?(s-o)/p+(s<o?6:0):d===s?(o-i)/p+2:(i-s)/p+4,l*=60),n[0]=~~(l+.5),n[1]=~~(h*100+.5),n[2]=~~(u*100+.5)),t&&n.length<4&&(n[3]=1),n},aI=function(r){var e=[],t=[],n=-1;return r.split(_a).forEach(function(i){var s=i.match($l)||[];e.push.apply(e,s),t.push(n+=s.length+1)}),e.c=t,e},oI=function(r,e,t){var n="",i=(r+n).match(_a),s=e?"hsla(":"rgba(",o=0,l,h,u,d;if(!i)return r;if(i=i.map(function(A){return(A=sI(A,e,1))&&s+(e?A[0]+","+A[1]+"%,"+A[2]+"%,"+A[3]:A.join(","))+")"}),t&&(u=aI(r),l=t.c,l.join(n)!==u.c.join(n)))for(h=r.replace(_a,"1").split($l),d=h.length-1;o<d;o++)n+=h[o]+(~l.indexOf(o)?i.shift()||s+"0,0,0,0)":(u.length?u:i.length?i:t).shift());if(!h)for(h=r.split(_a),d=h.length-1;o<d;o++)n+=h[o]+i[o];return n+h[d]},_a=function(){var r="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b",e;for(e in Hu)r+="|"+e+"\\b";return new RegExp(r+")","gi")}(),FP=/hsl[a]?\(/,lI=function(r){var e=r.join(" "),t;if(_a.lastIndex=0,_a.test(e))return t=FP.test(e),r[1]=oI(r[1],t),r[0]=oI(r[0],t,aI(r[1])),!0},Gu,Jn=function(){var r=Date.now,e=500,t=33,n=r(),i=n,s=1e3/240,o=s,l=[],h,u,d,A,p,g,_=function E(m){var v=r()-i,w=m===!0,x,I,R,S;if((v>e||v<0)&&(n+=v-t),i+=v,R=i-n,x=R-o,(x>0||w)&&(S=++A.frame,p=R-A.time*1e3,A.time=R=R/1e3,o+=x+(x>=s?4:s-x),I=1),w||(h=u(E)),I)for(g=0;g<l.length;g++)l[g](R,p,S,m)};return A={time:0,frame:0,tick:function(){_(!0)},deltaRatio:function(E){return p/(1e3/(E||60))},wake:function(){Lw&&(!Am&&dm()&&(rs=Am=window,gm=rs.document||{},qn.gsap=Sn,(rs.gsapVersions||(rs.gsapVersions=[])).push(Sn.version),Nw(df||rs.GreenSockGlobals||!rs.gsap&&rs||{}),nI.forEach(iI)),d=typeof requestAnimationFrame<"u"&&requestAnimationFrame,h&&A.sleep(),u=d||function(E){return setTimeout(E,o-A.time*1e3+1|0)},Gu=1,_(2))},sleep:function(){(d?cancelAnimationFrame:clearTimeout)(h),Gu=0,u=Pu},lagSmoothing:function(E,m){e=E||1/0,t=Math.min(m||33,e)},fps:function(E){s=1e3/(E||240),o=A.time*1e3+s},add:function(E,m,v){var w=m?function(x,I,R,S){E(x,I,R,S),A.remove(w)}:E;return A.remove(E),l[v?"unshift":"push"](w),ic(),w},remove:function(E,m){~(m=l.indexOf(E))&&l.splice(m,1)&&g>=m&&g--},_listeners:l},A}(),ic=function(){return!Gu&&Jn.wake()},Mt={},zP=/^[\d.\-M][\d.\-,\s]/,HP=/["']/g,GP=function(r){for(var e={},t=r.substr(1,r.length-3).split(":"),n=t[0],i=1,s=t.length,o,l,h;i<s;i++)l=t[i],o=i!==s-1?l.lastIndexOf(","):l.length,h=l.substr(0,o),e[n]=isNaN(h)?h.replace(HP,"").trim():+h,n=l.substr(o+1).trim();return e},VP=function(r){var e=r.indexOf("(")+1,t=r.indexOf(")"),n=r.indexOf("(",e);return r.substring(e,~n&&n<t?r.indexOf(")",t+1):t)},jP=function(r){var e=(r+"").split("("),t=Mt[e[0]];return t&&e.length>1&&t.config?t.config.apply(null,~r.indexOf("{")?[GP(e[1])]:VP(r).split(",").map(Fw)):Mt._CE&&zP.test(r)?Mt._CE("",r):t},cI=function(r){return function(e){return 1-r(1-e)}},uI=function r(e,t){for(var n=e._first,i;n;)n instanceof gn?r(n,t):n.vars.yoyoEase&&(!n._yoyo||!n._repeat)&&n._yoyo!==t&&(n.timeline?r(n.timeline,t):(i=n._ease,n._ease=n._yEase,n._yEase=i,n._yoyo=t)),n=n._next},Co=function(r,e){return r&&(ur(r)?r:Mt[r]||jP(r))||e},Mo=function(r,e,t,n){t===void 0&&(t=function(o){return 1-e(1-o)}),n===void 0&&(n=function(o){return o<.5?e(o*2)/2:1-e((1-o)*2)/2});var i={easeIn:e,easeOut:t,easeInOut:n},s;return Cn(r,function(o){Mt[o]=qn[o]=i,Mt[s=o.toLowerCase()]=t;for(var l in i)Mt[s+(l==="easeIn"?".in":l==="easeOut"?".out":".inOut")]=Mt[o+"."+l]=i[l]}),i},hI=function(r){return function(e){return e<.5?(1-r(1-e*2))/2:.5+r((e-.5)*2)/2}},Bm=function r(e,t,n){var i=t>=1?t:1,s=(n||(e?.3:.45))/(t<1?t:1),o=s/um*(Math.asin(1/i)||0),l=function(u){return u===1?1:i*Math.pow(2,-10*u)*_P((u-o)*s)+1},h=e==="out"?l:e==="in"?function(u){return 1-l(1-u)}:hI(l);return s=um/s,h.config=function(u,d){return r(e,u,d)},h},bm=function r(e,t){t===void 0&&(t=1.70158);var n=function(s){return s?--s*s*((t+1)*s+t)+1:0},i=e==="out"?n:e==="in"?function(s){return 1-n(1-s)}:hI(n);return i.config=function(s){return r(e,s)},i};Cn("Linear,Quad,Cubic,Quart,Quint,Strong",function(r,e){var t=e<5?e+1:e;Mo(r+",Power"+(t-1),e?function(n){return Math.pow(n,t)}:function(n){return n},function(n){return 1-Math.pow(1-n,t)},function(n){return n<.5?Math.pow(n*2,t)/2:1-Math.pow((1-n)*2,t)/2})}),Mt.Linear.easeNone=Mt.none=Mt.Linear.easeIn,Mo("Elastic",Bm("in"),Bm("out"),Bm()),function(r,e){var t=1/e,n=2*t,i=2.5*t,s=function(o){return o<t?r*o*o:o<n?r*Math.pow(o-1.5/e,2)+.75:o<i?r*(o-=2.25/e)*o+.9375:r*Math.pow(o-2.625/e,2)+.984375};Mo("Bounce",function(o){return 1-s(1-o)},s)}(7.5625,2.75),Mo("Expo",function(r){return r?Math.pow(2,10*(r-1)):0}),Mo("Circ",function(r){return-(Tw(1-r*r)-1)}),Mo("Sine",function(r){return r===1?1:-vP(r*gP)+1}),Mo("Back",bm("in"),bm("out"),bm()),Mt.SteppedEase=Mt.steps=qn.SteppedEase={config:function(r,e){r===void 0&&(r=1);var t=1/r,n=r+(e?0:1),i=e?1:0,s=1-Gt;return function(o){return((n*Ou(0,s,o)|0)+i)*t}}},Zl.ease=Mt["quad.out"],Cn("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(r){return Em+=r+","+r+"Params,"});var dI=function(r,e){this.id=mP++,r._gsap=this,this.target=r,this.harness=e,this.get=e?e.get:Qw,this.set=e?e.getSetter:Um},Vu=function(){function r(t){this.vars=t,this._delay=+t.delay||0,(this._repeat=t.repeat===1/0?-2:t.repeat||0)&&(this._rDelay=t.repeatDelay||0,this._yoyo=!!t.yoyo||!!t.yoyoEase),this._ts=1,rc(this,+t.duration,1,1),this.data=t.data,$t&&(this._ctx=$t,$t.data.push(this)),Gu||Jn.wake()}var e=r.prototype;return e.delay=function(t){return t||t===0?(this.parent&&this.parent.smoothChildTiming&&this.startTime(this._start+t-this._delay),this._delay=t,this):this._delay},e.duration=function(t){return arguments.length?this.totalDuration(this._repeat>0?t+(t+this._rDelay)*this._repeat:t):this.totalDuration()&&this._dur},e.totalDuration=function(t){return arguments.length?(this._dirty=0,rc(this,this._repeat<0?t:(t-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},e.totalTime=function(t,n){if(ic(),!arguments.length)return this._tTime;var i=this._dp;if(i&&i.smoothChildTiming&&this._ts){for(yf(this,t),!i._dp||i.parent||jw(i,this);i&&i.parent;)i.parent._time!==i._start+(i._ts>=0?i._tTime/i._ts:(i.totalDuration()-i._tTime)/-i._ts)&&i.totalTime(i._tTime,!0),i=i.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&t<this._tDur||this._ts<0&&t>0||!this._tDur&&!t)&&ns(this._dp,this,this._start-this._delay)}return(this._tTime!==t||!this._dur&&!n||this._initted&&Math.abs(this._zTime)===Gt||!t&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=t),Ow(this,t,n)),this},e.time=function(t,n){return arguments.length?this.totalTime(Math.min(this.totalDuration(),t+Vw(this))%(this._dur+this._rDelay)||(t?this._dur:0),n):this._time},e.totalProgress=function(t,n){return arguments.length?this.totalTime(this.totalDuration()*t,n):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>0?1:0},e.progress=function(t,n){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&!(this.iteration()&1)?1-t:t)+Vw(this),n):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0},e.iteration=function(t,n){var i=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(t-1)*i,n):this._repeat?tc(this._tTime,i)+1:1},e.timeScale=function(t,n){if(!arguments.length)return this._rts===-Gt?0:this._rts;if(this._rts===t)return this;var i=this.parent&&this._ts?vf(this.parent._time,this):this._tTime;return this._rts=+t||0,this._ts=this._ps||t===-Gt?0:this._rts,this.totalTime(Ou(-Math.abs(this._delay),this._tDur,i),n!==!1),_f(this),MP(this)},e.paused=function(t){return arguments.length?(this._ps!==t&&(this._ps=t,t?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(ic(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==Gt&&(this._tTime-=Gt)))),this):this._ps},e.startTime=function(t){if(arguments.length){this._start=t;var n=this.parent||this._dp;return n&&(n._sort||!this.parent)&&ns(n,this,t-this._delay),this}return this._start},e.endTime=function(t){return this._start+(In(t)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},e.rawTime=function(t){var n=this.parent||this._dp;return n?t&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?vf(n.rawTime(t),this):this._tTime:this._tTime},e.revert=function(t){t===void 0&&(t=xP);var n=en;return en=t,(this._initted||this._startAt)&&(this.timeline&&this.timeline.revert(t),this.totalTime(-.01,t.suppressEvents)),this.data!=="nested"&&t.kill!==!1&&this.kill(),en=n,this},e.globalTime=function(t){for(var n=this,i=arguments.length?t:n.rawTime();n;)i=n._start+i/(Math.abs(n._ts)||1),n=n._dp;return!this.parent&&this._sat?this._sat.globalTime(t):i},e.repeat=function(t){return arguments.length?(this._repeat=t===1/0?-2:t,qw(this)):this._repeat===-2?1/0:this._repeat},e.repeatDelay=function(t){if(arguments.length){var n=this._time;return this._rDelay=t,qw(this),n?this.time(n):this}return this._rDelay},e.yoyo=function(t){return arguments.length?(this._yoyo=t,this):this._yoyo},e.seek=function(t,n){return this.totalTime(ui(this,t),In(n))},e.restart=function(t,n){return this.play().totalTime(t?-this._delay:0,In(n))},e.play=function(t,n){return t!=null&&this.seek(t,n),this.reversed(!1).paused(!1)},e.reverse=function(t,n){return t!=null&&this.seek(t||this.totalDuration(),n),this.reversed(!0).paused(!1)},e.pause=function(t,n){return t!=null&&this.seek(t,n),this.paused(!0)},e.resume=function(){return this.paused(!1)},e.reversed=function(t){return arguments.length?(!!t!==this.reversed()&&this.timeScale(-this._rts||(t?-Gt:0)),this):this._rts<0},e.invalidate=function(){return this._initted=this._act=0,this._zTime=-Gt,this},e.isActive=function(){var t=this.parent||this._dp,n=this._start,i;return!!(!t||this._ts&&this._initted&&t.isActive()&&(i=t.rawTime(!0))>=n&&i<this.endTime(!0)-Gt)},e.eventCallback=function(t,n,i){var s=this.vars;return arguments.length>1?(n?(s[t]=n,i&&(s[t+"Params"]=i),t==="onUpdate"&&(this._onUpdate=n)):delete s[t],this):s[t]},e.then=function(t){var n=this;return new Promise(function(i){var s=ur(t)?t:zw,o=function(){var l=n.then;n.then=null,ur(s)&&(s=s(n))&&(s.then||s===n)&&(n.then=l),i(s),n.then=l};n._initted&&n.totalProgress()===1&&n._ts>=0||!n._tTime&&n._ts<0?o():n._prom=o})},e.kill=function(){zu(this)},r}();ci(Vu.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-Gt,_prom:0,_ps:!1,_rts:1});var gn=function(r){Sw(e,r);function e(n,i){var s;return n===void 0&&(n={}),s=r.call(this,n)||this,s.labels={},s.smoothChildTiming=!!n.smoothChildTiming,s.autoRemoveChildren=!!n.autoRemoveChildren,s._sort=In(n.sortChildren),nr&&ns(n.parent||nr,bs(s),i),n.reversed&&s.reverse(),n.paused&&s.paused(!0),n.scrollTrigger&&Ww(bs(s),n.scrollTrigger),s}var t=e.prototype;return t.to=function(n,i,s){return Qu(0,arguments,this),this},t.from=function(n,i,s){return Qu(1,arguments,this),this},t.fromTo=function(n,i,s,o){return Qu(2,arguments,this),this},t.set=function(n,i,s){return i.duration=0,i.parent=this,ku(i).repeatDelay||(i.repeat=0),i.immediateRender=!!i.immediateRender,new Sr(n,i,ui(this,s),1),this},t.call=function(n,i,s){return ns(this,Sr.delayedCall(0,n,i),s)},t.staggerTo=function(n,i,s,o,l,h,u){return s.duration=i,s.stagger=s.stagger||o,s.onComplete=h,s.onCompleteParams=u,s.parent=this,new Sr(n,s,ui(this,l)),this},t.staggerFrom=function(n,i,s,o,l,h,u){return s.runBackwards=1,ku(s).immediateRender=In(s.immediateRender),this.staggerTo(n,i,s,o,l,h,u)},t.staggerFromTo=function(n,i,s,o,l,h,u,d){return o.startAt=s,ku(o).immediateRender=In(o.immediateRender),this.staggerTo(n,i,o,l,h,u,d)},t.render=function(n,i,s){var o=this._time,l=this._dirty?this.totalDuration():this._tDur,h=this._dur,u=n<=0?0:Vr(n),d=this._zTime<0!=n<0&&(this._initted||!h),A,p,g,_,E,m,v,w,x,I,R,S;if(this!==nr&&u>l&&n>=0&&(u=l),u!==this._tTime||s||d){if(o!==this._time&&h&&(u+=this._time-o,n+=this._time-o),A=u,x=this._start,w=this._ts,m=!w,d&&(h||(o=this._zTime),(n||!i)&&(this._zTime=n)),this._repeat){if(R=this._yoyo,E=h+this._rDelay,this._repeat<-1&&n<0)return this.totalTime(E*100+n,i,s);if(A=Vr(u%E),u===l?(_=this._repeat,A=h):(_=~~(u/E),_&&_===u/E&&(A=h,_--),A>h&&(A=h)),I=tc(this._tTime,E),!o&&this._tTime&&I!==_&&this._tTime-I*E-this._dur<=0&&(I=_),R&&_&1&&(A=h-A,S=1),_!==I&&!this._lock){var T=R&&I&1,D=T===(R&&_&1);if(_<I&&(T=!T),o=T?0:u%h?h:u,this._lock=1,this.render(o||(S?0:Vr(_*E)),i,!h)._lock=0,this._tTime=u,!i&&this.parent&&Kn(this,"onRepeat"),this.vars.repeatRefresh&&!S&&(this.invalidate()._lock=1),o&&o!==this._time||m!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(h=this._dur,l=this._tDur,D&&(this._lock=2,o=T?h:-1e-4,this.render(o,!0),this.vars.repeatRefresh&&!S&&this.invalidate()),this._lock=0,!this._ts&&!m)return this;uI(this,S)}}if(this._hasPause&&!this._forcing&&this._lock<2&&(v=bP(this,Vr(o),Vr(A)),v&&(u-=A-(A=v._start))),this._tTime=u,this._time=A,this._act=!w,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=n,o=0),!o&&A&&!i&&!_&&(Kn(this,"onStart"),this._tTime!==u))return this;if(A>=o&&n>=0)for(p=this._first;p;){if(g=p._next,(p._act||A>=p._start)&&p._ts&&v!==p){if(p.parent!==this)return this.render(n,i,s);if(p.render(p._ts>0?(A-p._start)*p._ts:(p._dirty?p.totalDuration():p._tDur)+(A-p._start)*p._ts,i,s),A!==this._time||!this._ts&&!m){v=0,g&&(u+=this._zTime=-Gt);break}}p=g}else{p=this._last;for(var b=n<0?n:A;p;){if(g=p._prev,(p._act||b<=p._end)&&p._ts&&v!==p){if(p.parent!==this)return this.render(n,i,s);if(p.render(p._ts>0?(b-p._start)*p._ts:(p._dirty?p.totalDuration():p._tDur)+(b-p._start)*p._ts,i,s||en&&(p._initted||p._startAt)),A!==this._time||!this._ts&&!m){v=0,g&&(u+=this._zTime=b?-Gt:Gt);break}}p=g}}if(v&&!i&&(this.pause(),v.render(A>=o?0:-Gt)._zTime=A>=o?1:-1,this._ts))return this._start=x,_f(this),this.render(n,i,s);this._onUpdate&&!i&&Kn(this,"onUpdate",!0),(u===l&&this._tTime>=this.totalDuration()||!u&&o)&&(x===this._start||Math.abs(w)!==Math.abs(this._ts))&&(this._lock||((n||!h)&&(u===l&&this._ts>0||!u&&this._ts<0)&&ma(this,1),!i&&!(n<0&&!o)&&(u||o||!l)&&(Kn(this,u===l&&n>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(u<l&&this.timeScale()>0)&&this._prom())))}return this},t.add=function(n,i){var s=this;if(Rs(i)||(i=ui(this,i,n)),!(n instanceof Vu)){if(tn(n))return n.forEach(function(o){return s.add(o,i)}),this;if(Gr(n))return this.addLabel(n,i);if(ur(n))n=Sr.delayedCall(0,n);else return this}return this!==n?ns(this,n,i):this},t.getChildren=function(n,i,s,o){n===void 0&&(n=!0),i===void 0&&(i=!0),s===void 0&&(s=!0),o===void 0&&(o=-li);for(var l=[],h=this._first;h;)h._start>=o&&(h instanceof Sr?i&&l.push(h):(s&&l.push(h),n&&l.push.apply(l,h.getChildren(!0,i,s)))),h=h._next;return l},t.getById=function(n){for(var i=this.getChildren(1,1,1),s=i.length;s--;)if(i[s].vars.id===n)return i[s]},t.remove=function(n){return Gr(n)?this.removeLabel(n):ur(n)?this.killTweensOf(n):(mf(this,n),n===this._recent&&(this._recent=this._last),Io(this))},t.totalTime=function(n,i){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=Vr(Jn.time-(this._ts>0?n/this._ts:(this.totalDuration()-n)/-this._ts))),r.prototype.totalTime.call(this,n,i),this._forcing=0,this):this._tTime},t.addLabel=function(n,i){return this.labels[n]=ui(this,i),this},t.removeLabel=function(n){return delete this.labels[n],this},t.addPause=function(n,i,s){var o=Sr.delayedCall(0,i||Pu,s);return o.data="isPause",this._hasPause=1,ns(this,o,ui(this,n))},t.removePause=function(n){var i=this._first;for(n=ui(this,n);i;)i._start===n&&i.data==="isPause"&&ma(i),i=i._next},t.killTweensOf=function(n,i,s){for(var o=this.getTweensOf(n,s),l=o.length;l--;)ya!==o[l]&&o[l].kill(n,i);return this},t.getTweensOf=function(n,i){for(var s=[],o=hi(n),l=this._first,h=Rs(i),u;l;)l instanceof Sr?wP(l._targets,o)&&(h?(!ya||l._initted&&l._ts)&&l.globalTime(0)<=i&&l.globalTime(l.totalDuration())>i:!i||l.isActive())&&s.push(l):(u=l.getTweensOf(o,i)).length&&s.push.apply(s,u),l=l._next;return s},t.tweenTo=function(n,i){i=i||{};var s=this,o=ui(s,n),l=i,h=l.startAt,u=l.onStart,d=l.onStartParams,A=l.immediateRender,p,g=Sr.to(s,ci({ease:i.ease||"none",lazy:!1,immediateRender:!1,time:o,overwrite:"auto",duration:i.duration||Math.abs((o-(h&&"time"in h?h.time:s._time))/s.timeScale())||Gt,onStart:function(){if(s.pause(),!p){var _=i.duration||Math.abs((o-(h&&"time"in h?h.time:s._time))/s.timeScale());g._dur!==_&&rc(g,_,0,1).render(g._time,!0,!0),p=1}u&&u.apply(g,d||[])}},i));return A?g.render(0):g},t.tweenFromTo=function(n,i,s){return this.tweenTo(i,ci({startAt:{time:ui(this,n)}},s))},t.recent=function(){return this._recent},t.nextLabel=function(n){return n===void 0&&(n=this._time),rI(this,ui(this,n))},t.previousLabel=function(n){return n===void 0&&(n=this._time),rI(this,ui(this,n),1)},t.currentLabel=function(n){return arguments.length?this.seek(n,!0):this.previousLabel(this._time+Gt)},t.shiftChildren=function(n,i,s){s===void 0&&(s=0);for(var o=this._first,l=this.labels,h;o;)o._start>=s&&(o._start+=n,o._end+=n),o=o._next;if(i)for(h in l)l[h]>=s&&(l[h]+=n);return Io(this)},t.invalidate=function(n){var i=this._first;for(this._lock=0;i;)i.invalidate(n),i=i._next;return r.prototype.invalidate.call(this,n)},t.clear=function(n){n===void 0&&(n=!0);for(var i=this._first,s;i;)s=i._next,this.remove(i),i=s;return this._dp&&(this._time=this._tTime=this._pTime=0),n&&(this.labels={}),Io(this)},t.totalDuration=function(n){var i=0,s=this,o=s._last,l=li,h,u,d;if(arguments.length)return s.timeScale((s._repeat<0?s.duration():s.totalDuration())/(s.reversed()?-n:n));if(s._dirty){for(d=s.parent;o;)h=o._prev,o._dirty&&o.totalDuration(),u=o._start,u>l&&s._sort&&o._ts&&!s._lock?(s._lock=1,ns(s,o,u-o._delay,1)._lock=0):l=u,u<0&&o._ts&&(i-=u,(!d&&!s._dp||d&&d.smoothChildTiming)&&(s._start+=u/s._ts,s._time-=u,s._tTime-=u),s.shiftChildren(-u,!1,-1/0),l=0),o._end>i&&o._ts&&(i=o._end),o=h;rc(s,s===nr&&s._time>i?s._time:i,1,1),s._dirty=0}return s._tDur},e.updateRoot=function(n){if(nr._ts&&(Ow(nr,vf(n,nr)),Pw=Jn.frame),Jn.frame>=kw){kw+=Yn.autoSleep||120;var i=nr._first;if((!i||!i._ts)&&Yn.autoSleep&&Jn._listeners.length<2){for(;i&&!i._ts;)i=i._next;i||Jn.sleep()}}},e}(Vu);ci(gn.prototype,{_lock:0,_hasPause:0,_forcing:0});var WP=function(r,e,t,n,i,s,o){var l=new Mn(this._pt,r,e,0,1,vI,null,i),h=0,u=0,d,A,p,g,_,E,m,v;for(l.b=t,l.e=n,t+="",n+="",(m=~n.indexOf("random("))&&(n=Fu(n)),s&&(v=[t,n],s(v,r,e),t=v[0],n=v[1]),A=t.match(pm)||[];d=pm.exec(n);)g=d[0],_=n.substring(h,d.index),p?p=(p+1)%5:_.substr(-5)==="rgba("&&(p=1),g!==A[u++]&&(E=parseFloat(A[u-1])||0,l._pt={_next:l._pt,p:_||u===1?_:",",s:E,c:g.charAt(1)==="="?ec(E,g)-E:parseFloat(g)-E,m:p&&p<4?Math.round:0},h=pm.lastIndex);return l.c=h<n.length?n.substring(h,n.length):"",l.fp=o,(Rw.test(n)||m)&&(l.e=0),this._pt=l,l},Rm=function(r,e,t,n,i,s,o,l,h,u){ur(n)&&(n=n(i||0,r,s));var d=r[e],A=t!=="get"?t:ur(d)?h?r[e.indexOf("set")||!ur(r["get"+e.substr(3)])?e:"get"+e.substr(3)](h):r[e]():d,p=ur(d)?h?JP:gI:Nm,g;if(Gr(n)&&(~n.indexOf("random(")&&(n=Fu(n)),n.charAt(1)==="="&&(g=ec(A,n)+(rn(A)||0),(g||g===0)&&(n=g))),!u||A!==n||Dm)return!isNaN(A*n)&&n!==""?(g=new Mn(this._pt,r,e,+A||0,n-(A||0),typeof d=="boolean"?$P:mI,0,p),h&&(g.fp=h),o&&g.modifier(o,this,r),this._pt=g):(!d&&!(e in r)&&mm(e,n),WP.call(this,r,e,A,n,p,l||Yn.stringFilter,h))},YP=function(r,e,t,n,i){if(ur(r)&&(r=ju(r,i,e,t,n)),!ts(r)||r.style&&r.nodeType||tn(r)||Bw(r))return Gr(r)?ju(r,i,e,t,n):r;var s={},o;for(o in r)s[o]=ju(r[o],i,e,t,n);return s},fI=function(r,e,t,n,i,s){var o,l,h,u;if(Xn[r]&&(o=new Xn[r]).init(i,o.rawVars?e[r]:YP(e[r],n,i,s,t),t,n,s)!==!1&&(t._pt=l=new Mn(t._pt,i,r,0,1,o.render,o,0,o.priority),t!==nc))for(h=t._ptLookup[t._targets.indexOf(i)],u=o._props.length;u--;)h[o._props[u]]=l;return o},ya,Dm,Lm=function r(e,t,n){var i=e.vars,s=i.ease,o=i.startAt,l=i.immediateRender,h=i.lazy,u=i.onUpdate,d=i.runBackwards,A=i.yoyoEase,p=i.keyframes,g=i.autoRevert,_=e._dur,E=e._startAt,m=e._targets,v=e.parent,w=v&&v.data==="nested"?v.vars.targets:m,x=e._overwrite==="auto"&&!cm,I=e.timeline,R,S,T,D,b,M,L,P,N,W,X,K,te;if(I&&(!p||!s)&&(s="none"),e._ease=Co(s,Zl.ease),e._yEase=A?cI(Co(A===!0?s:A,Zl.ease)):0,A&&e._yoyo&&!e._repeat&&(A=e._yEase,e._yEase=e._ease,e._ease=A),e._from=!I&&!!i.runBackwards,!I||p&&!i.stagger){if(P=m[0]?xo(m[0]).harness:0,K=P&&i[P.prop],R=gf(i,vm),E&&(E._zTime<0&&E.progress(1),t<0&&d&&l&&!g?E.render(-1,!0):E.revert(d&&_?ff:EP),E._lazy=0),o){if(ma(e._startAt=Sr.set(m,ci({data:"isStart",overwrite:!1,parent:v,immediateRender:!0,lazy:!E&&In(h),startAt:null,delay:0,onUpdate:u&&function(){return Kn(e,"onUpdate")},stagger:0},o))),e._startAt._dp=0,e._startAt._sat=e,t<0&&(en||!l&&!g)&&e._startAt.revert(ff),l&&_&&t<=0&&n<=0){t&&(e._zTime=t);return}}else if(d&&_&&!E){if(t&&(l=!1),T=ci({overwrite:!1,data:"isFromStart",lazy:l&&!E&&In(h),immediateRender:l,stagger:0,parent:v},R),K&&(T[P.prop]=K),ma(e._startAt=Sr.set(m,T)),e._startAt._dp=0,e._startAt._sat=e,t<0&&(en?e._startAt.revert(ff):e._startAt.render(-1,!0)),e._zTime=t,!l)r(e._startAt,Gt,Gt);else if(!t)return}for(e._pt=e._ptCache=0,h=_&&In(h)||h&&!_,S=0;S<m.length;S++){if(b=m[S],L=b._gsap||xm(m)[S]._gsap,e._ptLookup[S]=W={},_m[L.id]&&ga.length&&Af(),X=w===m?S:w.indexOf(b),P&&(N=new P).init(b,K||R,e,X,w)!==!1&&(e._pt=D=new Mn(e._pt,b,N.name,0,1,N.render,N,0,N.priority),N._props.forEach(function(V){W[V]=D}),N.priority&&(M=1)),!P||K)for(T in R)Xn[T]&&(N=fI(T,R,e,X,b,w))?N.priority&&(M=1):W[T]=D=Rm.call(e,b,T,"get",R[T],X,w,0,i.stringFilter);e._op&&e._op[S]&&e.kill(b,e._op[S]),x&&e._pt&&(ya=e,nr.killTweensOf(b,W,e.globalTime(t)),te=!e.parent,ya=0),e._pt&&h&&(_m[L.id]=1)}M&&_I(e),e._onInit&&e._onInit(e)}e._onUpdate=u,e._initted=(!e._op||e._pt)&&!te,p&&t<=0&&I.render(li,!0,!0)},qP=function(r,e,t,n,i,s,o,l){var h=(r._pt&&r._ptCache||(r._ptCache={}))[e],u,d,A,p;if(!h)for(h=r._ptCache[e]=[],A=r._ptLookup,p=r._targets.length;p--;){if(u=A[p][e],u&&u.d&&u.d._pt)for(u=u.d._pt;u&&u.p!==e&&u.fp!==e;)u=u._next;if(!u)return Dm=1,r.vars[e]="+=0",Lm(r,o),Dm=0,l?Uu(e+" not eligible for reset"):1;h.push(u)}for(p=h.length;p--;)d=h[p],u=d._pt||d,u.s=(n||n===0)&&!i?n:u.s+(n||0)+s*u.c,u.c=t-u.s,d.e&&(d.e=yr(t)+rn(d.e)),d.b&&(d.b=u.s+rn(d.b))},XP=function(r,e){var t=r[0]?xo(r[0]).harness:0,n=t&&t.aliases,i,s,o,l;if(!n)return e;i=wo({},e);for(s in n)if(s in i)for(l=n[s].split(","),o=l.length;o--;)i[l[o]]=i[s];return i},KP=function(r,e,t,n){var i=e.ease||n||"power1.inOut",s,o;if(tn(e))o=t[r]||(t[r]=[]),e.forEach(function(l,h){return o.push({t:h/(e.length-1)*100,v:l,e:i})});else for(s in e)o=t[s]||(t[s]=[]),s==="ease"||o.push({t:parseFloat(r),v:e[s],e:i})},ju=function(r,e,t,n,i){return ur(r)?r.call(e,t,n,i):Gr(r)&&~r.indexOf("random(")?Fu(r):r},pI=Em+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,autoRevert",AI={};Cn(pI+",id,stagger,delay,duration,paused,scrollTrigger",function(r){return AI[r]=1});var Sr=function(r){Sw(e,r);function e(n,i,s,o){var l;typeof i=="number"&&(s.duration=i,i=s,s=null),l=r.call(this,o?i:ku(i))||this;var h=l.vars,u=h.duration,d=h.delay,A=h.immediateRender,p=h.stagger,g=h.overwrite,_=h.keyframes,E=h.defaults,m=h.scrollTrigger,v=h.yoyoEase,w=i.parent||nr,x=(tn(n)||Bw(n)?Rs(n[0]):"length"in i)?[n]:hi(n),I,R,S,T,D,b,M,L;if(l._targets=x.length?xm(x):Uu("GSAP target "+n+" not found. https://gsap.com",!Yn.nullTargetWarn)||[],l._ptLookup=[],l._overwrite=g,_||p||hf(u)||hf(d)){if(i=l.vars,I=l.timeline=new gn({data:"nested",defaults:E||{},targets:w&&w.data==="nested"?w.vars.targets:x}),I.kill(),I.parent=I._dp=bs(l),I._start=0,p||hf(u)||hf(d)){if(T=x.length,M=p&&Jw(p),ts(p))for(D in p)~pI.indexOf(D)&&(L||(L={}),L[D]=p[D]);for(R=0;R<T;R++)S=gf(i,AI),S.stagger=0,v&&(S.yoyoEase=v),L&&wo(S,L),b=x[R],S.duration=+ju(u,bs(l),R,b,x),S.delay=(+ju(d,bs(l),R,b,x)||0)-l._delay,!p&&T===1&&S.delay&&(l._delay=d=S.delay,l._start+=d,S.delay=0),I.to(b,S,M?M(R,b,x):0),I._ease=Mt.none;I.duration()?u=d=0:l.timeline=0}else if(_){ku(ci(I.vars.defaults,{ease:"none"})),I._ease=Co(_.ease||i.ease||"none");var P=0,N,W,X;if(tn(_))_.forEach(function(K){return I.to(x,K,">")}),I.duration();else{S={};for(D in _)D==="ease"||D==="easeEach"||KP(D,_[D],S,_.easeEach);for(D in S)for(N=S[D].sort(function(K,te){return K.t-te.t}),P=0,R=0;R<N.length;R++)W=N[R],X={ease:W.e,duration:(W.t-(R?N[R-1].t:0))/100*u},X[D]=W.v,I.to(x,X,P),P+=X.duration;I.duration()<u&&I.to({},{duration:u-I.duration()})}}u||l.duration(u=I.duration())}else l.timeline=0;return g===!0&&!cm&&(ya=bs(l),nr.killTweensOf(x),ya=0),ns(w,bs(l),s),i.reversed&&l.reverse(),i.paused&&l.paused(!0),(A||!u&&!_&&l._start===Vr(w._time)&&In(A)&&SP(bs(l))&&w.data!=="nested")&&(l._tTime=-Gt,l.render(Math.max(0,-d)||0)),m&&Ww(bs(l),m),l}var t=e.prototype;return t.render=function(n,i,s){var o=this._time,l=this._tDur,h=this._dur,u=n<0,d=n>l-Gt&&!u?l:n<Gt?0:n,A,p,g,_,E,m,v,w,x;if(!h)BP(this,n,i,s);else if(d!==this._tTime||!n||s||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==u){if(A=d,w=this.timeline,this._repeat){if(_=h+this._rDelay,this._repeat<-1&&u)return this.totalTime(_*100+n,i,s);if(A=Vr(d%_),d===l?(g=this._repeat,A=h):(g=~~(d/_),g&&g===Vr(d/_)&&(A=h,g--),A>h&&(A=h)),m=this._yoyo&&g&1,m&&(x=this._yEase,A=h-A),E=tc(this._tTime,_),A===o&&!s&&this._initted&&g===E)return this._tTime=d,this;g!==E&&(w&&this._yEase&&uI(w,m),this.vars.repeatRefresh&&!m&&!this._lock&&this._time!==_&&this._initted&&(this._lock=s=1,this.render(Vr(_*g),!0).invalidate()._lock=0))}if(!this._initted){if(Yw(this,u?n:A,s,i,d))return this._tTime=0,this;if(o!==this._time&&!(s&&this.vars.repeatRefresh&&g!==E))return this;if(h!==this._dur)return this.render(n,i,s)}if(this._tTime=d,this._time=A,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=v=(x||this._ease)(A/h),this._from&&(this.ratio=v=1-v),A&&!o&&!i&&!g&&(Kn(this,"onStart"),this._tTime!==d))return this;for(p=this._pt;p;)p.r(v,p.d),p=p._next;w&&w.render(n<0?n:w._dur*w._ease(A/this._dur),i,s)||this._startAt&&(this._zTime=n),this._onUpdate&&!i&&(u&&wm(this,n,i,s),Kn(this,"onUpdate")),this._repeat&&g!==E&&this.vars.onRepeat&&!i&&this.parent&&Kn(this,"onRepeat"),(d===this._tDur||!d)&&this._tTime===d&&(u&&!this._onUpdate&&wm(this,n,!0,!0),(n||!h)&&(d===this._tDur&&this._ts>0||!d&&this._ts<0)&&ma(this,1),!i&&!(u&&!o)&&(d||o||m)&&(Kn(this,d===l?"onComplete":"onReverseComplete",!0),this._prom&&!(d<l&&this.timeScale()>0)&&this._prom()))}return this},t.targets=function(){return this._targets},t.invalidate=function(n){return(!n||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(n),r.prototype.invalidate.call(this,n)},t.resetTo=function(n,i,s,o,l){Gu||Jn.wake(),this._ts||this.play();var h=Math.min(this._dur,(this._dp._time-this._start)*this._ts),u;return this._initted||Lm(this,h),u=this._ease(h/this._dur),qP(this,n,i,s,o,u,h,l)?this.resetTo(n,i,s,o,1):(yf(this,0),this.parent||Gw(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},t.kill=function(n,i){if(i===void 0&&(i="all"),!n&&(!i||i==="all"))return this._lazy=this._pt=0,this.parent?zu(this):this;if(this.timeline){var s=this.timeline.totalDuration();return this.timeline.killTweensOf(n,i,ya&&ya.vars.overwrite!==!0)._first||zu(this),this.parent&&s!==this.timeline.totalDuration()&&rc(this,this._dur*this.timeline._tDur/s,0,1),this}var o=this._targets,l=n?hi(n):o,h=this._ptLookup,u=this._pt,d,A,p,g,_,E,m;if((!i||i==="all")&&CP(o,l))return i==="all"&&(this._pt=0),zu(this);for(d=this._op=this._op||[],i!=="all"&&(Gr(i)&&(_={},Cn(i,function(v){return _[v]=1}),i=_),i=XP(o,i)),m=o.length;m--;)if(~l.indexOf(o[m])){A=h[m],i==="all"?(d[m]=i,g=A,p={}):(p=d[m]=d[m]||{},g=i);for(_ in g)E=A&&A[_],E&&((!("kill"in E.d)||E.d.kill(_)===!0)&&mf(this,E,"_pt"),delete A[_]),p!=="all"&&(p[_]=1)}return this._initted&&!this._pt&&u&&zu(this),this},e.to=function(n,i){return new e(n,i,arguments[2])},e.from=function(n,i){return Qu(1,arguments)},e.delayedCall=function(n,i,s,o){return new e(i,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:n,onComplete:i,onReverseComplete:i,onCompleteParams:s,onReverseCompleteParams:s,callbackScope:o})},e.fromTo=function(n,i,s){return Qu(2,arguments)},e.set=function(n,i){return i.duration=0,i.repeatDelay||(i.repeat=0),new e(n,i)},e.killTweensOf=function(n,i,s){return nr.killTweensOf(n,i,s)},e}(Vu);ci(Sr.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0}),Cn("staggerTo,staggerFrom,staggerFromTo",function(r){Sr[r]=function(){var e=new gn,t=Cm.call(arguments,0);return t.splice(r==="staggerFromTo"?5:4,0,0),e[r].apply(e,t)}});var Nm=function(r,e,t){return r[e]=t},gI=function(r,e,t){return r[e](t)},JP=function(r,e,t,n){return r[e](n.fp,t)},ZP=function(r,e,t){return r.setAttribute(e,t)},Um=function(r,e){return ur(r[e])?gI:hm(r[e])&&r.setAttribute?ZP:Nm},mI=function(r,e){return e.set(e.t,e.p,Math.round((e.s+e.c*r)*1e6)/1e6,e)},$P=function(r,e){return e.set(e.t,e.p,!!(e.s+e.c*r),e)},vI=function(r,e){var t=e._pt,n="";if(!r&&e.b)n=e.b;else if(r===1&&e.e)n=e.e;else{for(;t;)n=t.p+(t.m?t.m(t.s+t.c*r):Math.round((t.s+t.c*r)*1e4)/1e4)+n,t=t._next;n+=e.c}e.set(e.t,e.p,n,e)},Pm=function(r,e){for(var t=e._pt;t;)t.r(r,t.d),t=t._next},e7=function(r,e,t,n){for(var i=this._pt,s;i;)s=i._next,i.p===n&&i.modifier(r,e,t),i=s},t7=function(r){for(var e=this._pt,t,n;e;)n=e._next,e.p===r&&!e.op||e.op===r?mf(this,e,"_pt"):e.dep||(t=1),e=n;return!t},r7=function(r,e,t,n){n.mSet(r,e,n.m.call(n.tween,t,n.mt),n)},_I=function(r){for(var e=r._pt,t,n,i,s;e;){for(t=e._next,n=i;n&&n.pr>e.pr;)n=n._next;(e._prev=n?n._prev:s)?e._prev._next=e:i=e,(e._next=n)?n._prev=e:s=e,e=t}r._pt=i},Mn=function(){function r(t,n,i,s,o,l,h,u,d){this.t=n,this.s=s,this.c=o,this.p=i,this.r=l||mI,this.d=h||this,this.set=u||Nm,this.pr=d||0,this._next=t,t&&(t._prev=this)}var e=r.prototype;return e.modifier=function(t,n,i){this.mSet=this.mSet||this.set,this.set=r7,this.m=t,this.mt=i,this.tween=n},r}();Cn(Em+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger",function(r){return vm[r]=1}),qn.TweenMax=qn.TweenLite=Sr,qn.TimelineLite=qn.TimelineMax=gn,nr=new gn({sortChildren:!1,defaults:Zl,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0}),Yn.stringFilter=lI;var So=[],Ef={},n7=[],yI=0,i7=0,km=function(r){return(Ef[r]||n7).map(function(e){return e()})},Qm=function(){var r=Date.now(),e=[];r-yI>2&&(km("matchMediaInit"),So.forEach(function(t){var n=t.queries,i=t.conditions,s,o,l,h;for(o in n)s=rs.matchMedia(n[o]).matches,s&&(l=1),s!==i[o]&&(i[o]=s,h=1);h&&(t.revert(),l&&e.push(t))}),km("matchMediaRevert"),e.forEach(function(t){return t.onMatch(t,function(n){return t.add(null,n)})}),yI=r,km("matchMedia"))},EI=function(){function r(t,n){this.selector=n&&Mm(n),this.data=[],this._r=[],this.isReverted=!1,this.id=i7++,t&&this.add(t)}var e=r.prototype;return e.add=function(t,n,i){ur(t)&&(i=n,n=t,t=ur);var s=this,o=function(){var l=$t,h=s.selector,u;return l&&l!==s&&l.data.push(s),i&&(s.selector=Mm(i)),$t=s,u=n.apply(s,arguments),ur(u)&&s._r.push(u),$t=l,s.selector=h,s.isReverted=!1,u};return s.last=o,t===ur?o(s,function(l){return s.add(null,l)}):t?s[t]=o:o},e.ignore=function(t){var n=$t;$t=null,t(this),$t=n},e.getTweens=function(){var t=[];return this.data.forEach(function(n){return n instanceof r?t.push.apply(t,n.getTweens()):n instanceof Sr&&!(n.parent&&n.parent.data==="nested")&&t.push(n)}),t},e.clear=function(){this._r.length=this.data.length=0},e.kill=function(t,n){var i=this;if(t?function(){for(var o=i.getTweens(),l=i.data.length,h;l--;)h=i.data[l],h.data==="isFlip"&&(h.revert(),h.getChildren(!0,!0,!1).forEach(function(u){return o.splice(o.indexOf(u),1)}));for(o.map(function(u){return{g:u._dur||u._delay||u._sat&&!u._sat.vars.immediateRender?u.globalTime(0):-1/0,t:u}}).sort(function(u,d){return d.g-u.g||-1/0}).forEach(function(u){return u.t.revert(t)}),l=i.data.length;l--;)h=i.data[l],h instanceof gn?h.data!=="nested"&&(h.scrollTrigger&&h.scrollTrigger.revert(),h.kill()):!(h instanceof Sr)&&h.revert&&h.revert(t);i._r.forEach(function(u){return u(t,i)}),i.isReverted=!0}():this.data.forEach(function(o){return o.kill&&o.kill()}),this.clear(),n)for(var s=So.length;s--;)So[s].id===this.id&&So.splice(s,1)},e.revert=function(t){this.kill(t||{})},r}(),s7=function(){function r(t){this.contexts=[],this.scope=t,$t&&$t.data.push(this)}var e=r.prototype;return e.add=function(t,n,i){ts(t)||(t={matches:t});var s=new EI(0,i||this.scope),o=s.conditions={},l,h,u;$t&&!s.selector&&(s.selector=$t.selector),this.contexts.push(s),n=s.add("onMatch",n),s.queries=t;for(h in t)h==="all"?u=1:(l=rs.matchMedia(t[h]),l&&(So.indexOf(s)<0&&So.push(s),(o[h]=l.matches)&&(u=1),l.addListener?l.addListener(Qm):l.addEventListener("change",Qm)));return u&&n(s,function(d){return s.add(null,d)}),this},e.revert=function(t){this.kill(t||{})},e.kill=function(t){this.contexts.forEach(function(n){return n.kill(t,!0)})},r}(),xf={registerPlugin:function(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];e.forEach(function(n){return iI(n)})},timeline:function(r){return new gn(r)},getTweensOf:function(r,e){return nr.getTweensOf(r,e)},getProperty:function(r,e,t,n){Gr(r)&&(r=hi(r)[0]);var i=xo(r||{}).get,s=t?zw:Fw;return t==="native"&&(t=""),r&&(e?s((Xn[e]&&Xn[e].get||i)(r,e,t,n)):function(o,l,h){return s((Xn[o]&&Xn[o].get||i)(r,o,l,h))})},quickSetter:function(r,e,t){if(r=hi(r),r.length>1){var n=r.map(function(u){return Sn.quickSetter(u,e,t)}),i=n.length;return function(u){for(var d=i;d--;)n[d](u)}}r=r[0]||{};var s=Xn[e],o=xo(r),l=o.harness&&(o.harness.aliases||{})[e]||e,h=s?function(u){var d=new s;nc._pt=0,d.init(r,t?u+t:u,nc,0,[r]),d.render(1,d),nc._pt&&Pm(1,nc)}:o.set(r,l);return s?h:function(u){return h(r,l,t?u+t:u,o,1)}},quickTo:function(r,e,t){var n,i=Sn.to(r,wo((n={},n[e]="+=0.1",n.paused=!0,n),t||{})),s=function(o,l,h){return i.resetTo(e,o,l,h)};return s.tween=i,s},isTweening:function(r){return nr.getTweensOf(r,!0).length>0},defaults:function(r){return r&&r.ease&&(r.ease=Co(r.ease,Zl.ease)),Hw(Zl,r||{})},config:function(r){return Hw(Yn,r||{})},registerEffect:function(r){var e=r.name,t=r.effect,n=r.plugins,i=r.defaults,s=r.extendTimeline;(n||"").split(",").forEach(function(o){return o&&!Xn[o]&&!qn[o]&&Uu(e+" effect requires "+o+" plugin.")}),ym[e]=function(o,l,h){return t(hi(o),ci(l||{},i),h)},s&&(gn.prototype[e]=function(o,l,h){return this.add(ym[e](o,ts(l)?l:(h=l)&&{},this),h)})},registerEase:function(r,e){Mt[r]=Co(e)},parseEase:function(r,e){return arguments.length?Co(r,e):Mt},getById:function(r){return nr.getById(r)},exportRoot:function(r,e){r===void 0&&(r={});var t=new gn(r),n,i;for(t.smoothChildTiming=In(r.smoothChildTiming),nr.remove(t),t._dp=0,t._time=t._tTime=nr._time,n=nr._first;n;)i=n._next,(e||!(!n._dur&&n instanceof Sr&&n.vars.onComplete===n._targets[0]))&&ns(t,n,n._start-n._delay),n=i;return ns(nr,t,0),t},context:function(r,e){return r?new EI(r,e):$t},matchMedia:function(r){return new s7(r)},matchMediaRefresh:function(){return So.forEach(function(r){var e=r.conditions,t,n;for(n in e)e[n]&&(e[n]=!1,t=1);t&&r.revert()})||Qm()},addEventListener:function(r,e){var t=Ef[r]||(Ef[r]=[]);~t.indexOf(e)||t.push(e)},removeEventListener:function(r,e){var t=Ef[r],n=t&&t.indexOf(e);n>=0&&t.splice(n,1)},utils:{wrap:kP,wrapYoyo:QP,distribute:Jw,random:$w,snap:Zw,normalize:PP,getUnit:rn,clamp:DP,splitColor:sI,toArray:hi,selector:Mm,mapRange:tI,pipe:NP,unitize:UP,interpolate:OP,shuffle:Kw},install:Nw,effects:ym,ticker:Jn,updateRoot:gn.updateRoot,plugins:Xn,globalTimeline:nr,core:{PropTween:Mn,globals:Uw,Tween:Sr,Timeline:gn,Animation:Vu,getCache:xo,_removeLinkedListItem:mf,reverting:function(){return en},context:function(r){return r&&$t&&($t.data.push(r),r._ctx=$t),$t},suppressOverwrites:function(r){return cm=r}}};Cn("to,from,fromTo,delayedCall,set,killTweensOf",function(r){return xf[r]=Sr[r]}),Jn.add(gn.updateRoot),nc=xf.to({},{duration:0});var a7=function(r,e){for(var t=r._pt;t&&t.p!==e&&t.op!==e&&t.fp!==e;)t=t._next;return t},o7=function(r,e){var t=r._targets,n,i,s;for(n in e)for(i=t.length;i--;)s=r._ptLookup[i][n],s&&(s=s.d)&&(s._pt&&(s=a7(s,n)),s&&s.modifier&&s.modifier(e[n],r,t[i],n))},Om=function(r,e){return{name:r,rawVars:1,init:function(t,n,i){i._onInit=function(s){var o,l;if(Gr(n)&&(o={},Cn(n,function(h){return o[h]=1}),n=o),e){o={};for(l in n)o[l]=e(n[l]);n=o}o7(s,n)}}}},Sn=xf.registerPlugin({name:"attr",init:function(r,e,t,n,i){var s,o,l;this.tween=t;for(s in e)l=r.getAttribute(s)||"",o=this.add(r,"setAttribute",(l||0)+"",e[s],n,i,0,0,s),o.op=s,o.b=l,this._props.push(s)},render:function(r,e){for(var t=e._pt;t;)en?t.set(t.t,t.p,t.b,t):t.r(r,t.d),t=t._next}},{name:"endArray",init:function(r,e){for(var t=e.length;t--;)this.add(r,t,r[t]||0,e[t],0,0,0,0,0,1)}},Om("roundProps",Sm),Om("modifiers"),Om("snap",Zw))||xf;Sr.version=gn.version=Sn.version="3.12.5",Lw=1,dm()&&ic(),Mt.Power0,Mt.Power1,Mt.Power2,Mt.Power3,Mt.Power4,Mt.Linear,Mt.Quad,Mt.Cubic,Mt.Quart,Mt.Quint,Mt.Strong,Mt.Elastic,Mt.Back,Mt.SteppedEase,Mt.Bounce,Mt.Sine,Mt.Expo,Mt.Circ;/*!
4493
+ */var Yn={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},Zl={duration:.5,overwrite:!1,delay:0},lm,en,$t,li=1e8,Gt=1/li,cm=Math.PI*2,gP=cm/4,mP=0,Tw=Math.sqrt,vP=Math.cos,_P=Math.sin,Gr=function(r){return typeof r=="string"},ur=function(r){return typeof r=="function"},Rs=function(r){return typeof r=="number"},um=function(r){return typeof r>"u"},ts=function(r){return typeof r=="object"},In=function(r){return r!==!1},hm=function(){return typeof window<"u"},hf=function(r){return ur(r)||Gr(r)},Bw=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},tn=Array.isArray,dm=/(?:-?\.?\d|\.)+/gi,bw=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,$l=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,fm=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,Rw=/[+-]=-?[.\d]+/,Dw=/[^,'"\[\]\s]+/gi,yP=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,nr,rs,pm,Am,qn={},df={},Lw,Nw=function(r){return(df=wo(r,qn))&&Sn},gm=function(r,e){return console.warn("Invalid property",r,"set to",e,"Missing plugin? gsap.registerPlugin()")},Uu=function(r,e){return!e&&console.warn(r)},Uw=function(r,e){return r&&(qn[r]=e)&&df&&(df[r]=e)||qn},Pu=function(){return 0},EP={suppressEvents:!0,isStart:!0,kill:!1},ff={suppressEvents:!0,kill:!1},xP={suppressEvents:!0},mm={},ga=[],vm={},Pw,Xn={},_m={},kw=30,pf=[],ym="",Em=function(r){var e=r[0],t,n;if(ts(e)||ur(e)||(r=[r]),!(t=(e._gsap||{}).harness)){for(n=pf.length;n--&&!pf[n].targetTest(e););t=pf[n]}for(n=r.length;n--;)r[n]&&(r[n]._gsap||(r[n]._gsap=new dI(r[n],t)))||r.splice(n,1);return r},xo=function(r){return r._gsap||Em(hi(r))[0]._gsap},Qw=function(r,e,t){return(t=r[e])&&ur(t)?r[e]():um(t)&&r.getAttribute&&r.getAttribute(e)||t},Cn=function(r,e){return(r=r.split(",")).forEach(e)||r},yr=function(r){return Math.round(r*1e5)/1e5||0},Vr=function(r){return Math.round(r*1e7)/1e7||0},ec=function(r,e){var t=e.charAt(0),n=parseFloat(e.substr(2));return r=parseFloat(r),t==="+"?r+n:t==="-"?r-n:t==="*"?r*n:r/n},wP=function(r,e){for(var t=e.length,n=0;r.indexOf(e[n])<0&&++n<t;);return n<t},Af=function(){var r=ga.length,e=ga.slice(0),t,n;for(vm={},ga.length=0,t=0;t<r;t++)n=e[t],n&&n._lazy&&(n.render(n._lazy[0],n._lazy[1],!0)._lazy=0)},Ow=function(r,e,t,n){ga.length&&!en&&Af(),r.render(e,t,n||en&&e<0&&(r._initted||r._startAt)),ga.length&&!en&&Af()},Fw=function(r){var e=parseFloat(r);return(e||e===0)&&(r+"").match(Dw).length<2?e:Gr(r)?r.trim():r},zw=function(r){return r},ci=function(r,e){for(var t in e)t in r||(r[t]=e[t]);return r},IP=function(r){return function(e,t){for(var n in t)n in e||n==="duration"&&r||n==="ease"||(e[n]=t[n])}},wo=function(r,e){for(var t in e)r[t]=e[t];return r},Hw=function r(e,t){for(var n in t)n!=="__proto__"&&n!=="constructor"&&n!=="prototype"&&(e[n]=ts(t[n])?r(e[n]||(e[n]={}),t[n]):t[n]);return e},gf=function(r,e){var t={},n;for(n in r)n in e||(t[n]=r[n]);return t},ku=function(r){var e=r.parent||nr,t=r.keyframes?IP(tn(r.keyframes)):ci;if(In(r.inherit))for(;e;)t(r,e.vars.defaults),e=e.parent||e._dp;return r},CP=function(r,e){for(var t=r.length,n=t===e.length;n&&t--&&r[t]===e[t];);return t<0},Gw=function(r,e,t,n,i){t===void 0&&(t="_first"),n===void 0&&(n="_last");var s=r[n],o;if(i)for(o=e[i];s&&s[i]>o;)s=s._prev;return s?(e._next=s._next,s._next=e):(e._next=r[t],r[t]=e),e._next?e._next._prev=e:r[n]=e,e._prev=s,e.parent=e._dp=r,e},mf=function(r,e,t,n){t===void 0&&(t="_first"),n===void 0&&(n="_last");var i=e._prev,s=e._next;i?i._next=s:r[t]===e&&(r[t]=s),s?s._prev=i:r[n]===e&&(r[n]=i),e._next=e._prev=e.parent=null},ma=function(r,e){r.parent&&(!e||r.parent.autoRemoveChildren)&&r.parent.remove&&r.parent.remove(r),r._act=0},Io=function(r,e){if(r&&(!e||e._end>r._dur||e._start<0))for(var t=r;t;)t._dirty=1,t=t.parent;return r},MP=function(r){for(var e=r.parent;e&&e.parent;)e._dirty=1,e.totalDuration(),e=e.parent;return r},xm=function(r,e,t,n){return r._startAt&&(en?r._startAt.revert(ff):r.vars.immediateRender&&!r.vars.autoRevert||r._startAt.render(e,!0,n))},SP=function r(e){return!e||e._ts&&r(e.parent)},Vw=function(r){return r._repeat?tc(r._tTime,r=r.duration()+r._rDelay)*r:0},tc=function(r,e){var t=Math.floor(r/=e);return r&&t===r?t-1:t},vf=function(r,e){return(r-e._start)*e._ts+(e._ts>=0?0:e._dirty?e.totalDuration():e._tDur)},_f=function(r){return r._end=Vr(r._start+(r._tDur/Math.abs(r._ts||r._rts||Gt)||0))},yf=function(r,e){var t=r._dp;return t&&t.smoothChildTiming&&r._ts&&(r._start=Vr(t._time-(r._ts>0?e/r._ts:((r._dirty?r.totalDuration():r._tDur)-e)/-r._ts)),_f(r),t._dirty||Io(t,r)),r},jw=function(r,e){var t;if((e._time||!e._dur&&e._initted||e._start<r._time&&(e._dur||!e.add))&&(t=vf(r.rawTime(),e),(!e._dur||Ou(0,e.totalDuration(),t)-e._tTime>Gt)&&e.render(t,!0)),Io(r,e)._dp&&r._initted&&r._time>=r._dur&&r._ts){if(r._dur<r.duration())for(t=r;t._dp;)t.rawTime()>=0&&t.totalTime(t._tTime),t=t._dp;r._zTime=-Gt}},ns=function(r,e,t,n){return e.parent&&ma(e),e._start=Vr((Rs(t)?t:t||r!==nr?ui(r,t,e):r._time)+e._delay),e._end=Vr(e._start+(e.totalDuration()/Math.abs(e.timeScale())||0)),Gw(r,e,"_first","_last",r._sort?"_start":0),wm(e)||(r._recent=e),n||jw(r,e),r._ts<0&&yf(r,r._tTime),r},Ww=function(r,e){return(qn.ScrollTrigger||gm("scrollTrigger",e))&&qn.ScrollTrigger.create(e,r)},Yw=function(r,e,t,n,i){if(Dm(r,e,i),!r._initted)return 1;if(!t&&r._pt&&!en&&(r._dur&&r.vars.lazy!==!1||!r._dur&&r.vars.lazy)&&Pw!==Jn.frame)return ga.push(r),r._lazy=[i,n],1},TP=function r(e){var t=e.parent;return t&&t._ts&&t._initted&&!t._lock&&(t.rawTime()<0||r(t))},wm=function(r){var e=r.data;return e==="isFromStart"||e==="isStart"},BP=function(r,e,t,n){var i=r.ratio,s=e<0||!e&&(!r._start&&TP(r)&&!(!r._initted&&wm(r))||(r._ts<0||r._dp._ts<0)&&!wm(r))?0:1,o=r._rDelay,l=0,h,u,d;if(o&&r._repeat&&(l=Ou(0,r._tDur,e),u=tc(l,o),r._yoyo&&u&1&&(s=1-s),u!==tc(r._tTime,o)&&(i=1-s,r.vars.repeatRefresh&&r._initted&&r.invalidate())),s!==i||en||n||r._zTime===Gt||!e&&r._zTime){if(!r._initted&&Yw(r,e,n,t,l))return;for(d=r._zTime,r._zTime=e||(t?Gt:0),t||(t=e&&!d),r.ratio=s,r._from&&(s=1-s),r._time=0,r._tTime=l,h=r._pt;h;)h.r(s,h.d),h=h._next;e<0&&xm(r,e,t,!0),r._onUpdate&&!t&&Kn(r,"onUpdate"),l&&r._repeat&&!t&&r.parent&&Kn(r,"onRepeat"),(e>=r._tDur||e<0)&&r.ratio===s&&(s&&ma(r,1),!t&&!en&&(Kn(r,s?"onComplete":"onReverseComplete",!0),r._prom&&r._prom()))}else r._zTime||(r._zTime=e)},bP=function(r,e,t){var n;if(t>e)for(n=r._first;n&&n._start<=t;){if(n.data==="isPause"&&n._start>e)return n;n=n._next}else for(n=r._last;n&&n._start>=t;){if(n.data==="isPause"&&n._start<e)return n;n=n._prev}},rc=function(r,e,t,n){var i=r._repeat,s=Vr(e)||0,o=r._tTime/r._tDur;return o&&!n&&(r._time*=s/r._dur),r._dur=s,r._tDur=i?i<0?1e10:Vr(s*(i+1)+r._rDelay*i):s,o>0&&!n&&yf(r,r._tTime=r._tDur*o),r.parent&&_f(r),t||Io(r.parent,r),r},qw=function(r){return r instanceof gn?Io(r):rc(r,r._dur)},RP={_start:0,endTime:Pu,totalDuration:Pu},ui=function r(e,t,n){var i=e.labels,s=e._recent||RP,o=e.duration()>=li?s.endTime(!1):e._dur,l,h,u;return Gr(t)&&(isNaN(t)||t in i)?(h=t.charAt(0),u=t.substr(-1)==="%",l=t.indexOf("="),h==="<"||h===">"?(l>=0&&(t=t.replace(/=/,"")),(h==="<"?s._start:s.endTime(s._repeat>=0))+(parseFloat(t.substr(1))||0)*(u?(l<0?s:n).totalDuration()/100:1)):l<0?(t in i||(i[t]=o),i[t]):(h=parseFloat(t.charAt(l-1)+t.substr(l+1)),u&&n&&(h=h/100*(tn(n)?n[0]:n).totalDuration()),l>1?r(e,t.substr(0,l-1),n)+h:o+h)):t==null?o:+t},Qu=function(r,e,t){var n=Rs(e[1]),i=(n?2:1)+(r<2?0:1),s=e[i],o,l;if(n&&(s.duration=e[1]),s.parent=t,r){for(o=s,l=t;l&&!("immediateRender"in o);)o=l.vars.defaults||{},l=In(l.vars.inherit)&&l.parent;s.immediateRender=In(o.immediateRender),r<2?s.runBackwards=1:s.startAt=e[i-1]}return new Sr(e[0],s,e[i+1])},va=function(r,e){return r||r===0?e(r):e},Ou=function(r,e,t){return t<r?r:t>e?e:t},rn=function(r,e){return!Gr(r)||!(e=yP.exec(r))?"":e[1]},DP=function(r,e,t){return va(t,function(n){return Ou(r,e,n)})},Im=[].slice,Xw=function(r,e){return r&&ts(r)&&"length"in r&&(!e&&!r.length||r.length-1 in r&&ts(r[0]))&&!r.nodeType&&r!==rs},LP=function(r,e,t){return t===void 0&&(t=[]),r.forEach(function(n){var i;return Gr(n)&&!e||Xw(n,1)?(i=t).push.apply(i,hi(n)):t.push(n)})||t},hi=function(r,e,t){return $t&&!e&&$t.selector?$t.selector(r):Gr(r)&&!t&&(pm||!ic())?Im.call((e||Am).querySelectorAll(r),0):tn(r)?LP(r,t):Xw(r)?Im.call(r,0):r?[r]:[]},Cm=function(r){return r=hi(r)[0]||Uu("Invalid scope")||{},function(e){var t=r.current||r.nativeElement||r;return hi(e,t.querySelectorAll?t:t===r?Uu("Invalid scope")||Am.createElement("div"):r)}},Kw=function(r){return r.sort(function(){return .5-Math.random()})},Jw=function(r){if(ur(r))return r;var e=ts(r)?r:{each:r},t=Co(e.ease),n=e.from||0,i=parseFloat(e.base)||0,s={},o=n>0&&n<1,l=isNaN(n)||o,h=e.axis,u=n,d=n;return Gr(n)?u=d={center:.5,edges:.5,end:1}[n]||0:!o&&l&&(u=n[0],d=n[1]),function(A,p,g){var _=(g||e).length,E=s[_],m,v,w,x,I,R,S,T,D;if(!E){if(D=e.grid==="auto"?0:(e.grid||[1,li])[1],!D){for(S=-li;S<(S=g[D++].getBoundingClientRect().left)&&D<_;);D<_&&D--}for(E=s[_]=[],m=l?Math.min(D,_)*u-.5:n%D,v=D===li?0:l?_*d/D-.5:n/D|0,S=0,T=li,R=0;R<_;R++)w=R%D-m,x=v-(R/D|0),E[R]=I=h?Math.abs(h==="y"?x:w):Tw(w*w+x*x),I>S&&(S=I),I<T&&(T=I);n==="random"&&Kw(E),E.max=S-T,E.min=T,E.v=_=(parseFloat(e.amount)||parseFloat(e.each)*(D>_?_-1:h?h==="y"?_/D:D:Math.max(D,_/D))||0)*(n==="edges"?-1:1),E.b=_<0?i-_:i,E.u=rn(e.amount||e.each)||0,t=t&&_<0?cI(t):t}return _=(E[A]-E.min)/E.max||0,Vr(E.b+(t?t(_):_)*E.v)+E.u}},Mm=function(r){var e=Math.pow(10,((r+"").split(".")[1]||"").length);return function(t){var n=Vr(Math.round(parseFloat(t)/r)*r*e);return(n-n%1)/e+(Rs(t)?0:rn(t))}},Zw=function(r,e){var t=tn(r),n,i;return!t&&ts(r)&&(n=t=r.radius||li,r.values?(r=hi(r.values),(i=!Rs(r[0]))&&(n*=n)):r=Mm(r.increment)),va(e,t?ur(r)?function(s){return i=r(s),Math.abs(i-s)<=n?i:s}:function(s){for(var o=parseFloat(i?s.x:s),l=parseFloat(i?s.y:0),h=li,u=0,d=r.length,A,p;d--;)i?(A=r[d].x-o,p=r[d].y-l,A=A*A+p*p):A=Math.abs(r[d]-o),A<h&&(h=A,u=d);return u=!n||h<=n?r[u]:s,i||u===s||Rs(s)?u:u+rn(s)}:Mm(r))},$w=function(r,e,t,n){return va(tn(r)?!e:t===!0?!!(t=0):!n,function(){return tn(r)?r[~~(Math.random()*r.length)]:(t=t||1e-5)&&(n=t<1?Math.pow(10,(t+"").length-2):1)&&Math.floor(Math.round((r-t/2+Math.random()*(e-r+t*.99))/t)*t*n)/n})},NP=function(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];return function(n){return e.reduce(function(i,s){return s(i)},n)}},UP=function(r,e){return function(t){return r(parseFloat(t))+(e||rn(t))}},PP=function(r,e,t){return tI(r,e,0,1,t)},eI=function(r,e,t){return va(t,function(n){return r[~~e(n)]})},kP=function r(e,t,n){var i=t-e;return tn(e)?eI(e,r(0,e.length),t):va(n,function(s){return(i+(s-e)%i)%i+e})},QP=function r(e,t,n){var i=t-e,s=i*2;return tn(e)?eI(e,r(0,e.length-1),t):va(n,function(o){return o=(s+(o-e)%s)%s||0,e+(o>i?s-o:o)})},Fu=function(r){for(var e=0,t="",n,i,s,o;~(n=r.indexOf("random(",e));)s=r.indexOf(")",n),o=r.charAt(n+7)==="[",i=r.substr(n+7,s-n-7).match(o?Dw:dm),t+=r.substr(e,n-e)+$w(o?i:+i[0],o?0:+i[1],+i[2]||1e-5),e=s+1;return t+r.substr(e,r.length-e)},tI=function(r,e,t,n,i){var s=e-r,o=n-t;return va(i,function(l){return t+((l-r)/s*o||0)})},OP=function r(e,t,n,i){var s=isNaN(e+t)?0:function(g){return(1-g)*e+g*t};if(!s){var o=Gr(e),l={},h,u,d,A,p;if(n===!0&&(i=1)&&(n=null),o)e={p:e},t={p:t};else if(tn(e)&&!tn(t)){for(d=[],A=e.length,p=A-2,u=1;u<A;u++)d.push(r(e[u-1],e[u]));A--,s=function(g){g*=A;var _=Math.min(p,~~g);return d[_](g-_)},n=t}else i||(e=wo(tn(e)?[]:{},e));if(!d){for(h in t)bm.call(l,e,h,"get",t[h]);s=function(g){return Um(g,l)||(o?e.p:e)}}}return va(n,s)},rI=function(r,e,t){var n=r.labels,i=li,s,o,l;for(s in n)o=n[s]-e,o<0==!!t&&o&&i>(o=Math.abs(o))&&(l=s,i=o);return l},Kn=function(r,e,t){var n=r.vars,i=n[e],s=$t,o=r._ctx,l,h,u;if(i)return l=n[e+"Params"],h=n.callbackScope||r,t&&ga.length&&Af(),o&&($t=o),u=l?i.apply(h,l):i.call(h),$t=s,u},zu=function(r){return ma(r),r.scrollTrigger&&r.scrollTrigger.kill(!!en),r.progress()<1&&Kn(r,"onInterrupt"),r},nc,nI=[],iI=function(r){if(r)if(r=!r.name&&r.default||r,hm()||r.headless){var e=r.name,t=ur(r),n=e&&!t&&r.init?function(){this._props=[]}:r,i={init:Pu,render:Um,add:bm,kill:t7,modifier:e7,rawVars:0},s={targetTest:0,get:0,getSetter:Nm,aliases:{},register:0};if(ic(),r!==n){if(Xn[e])return;ci(n,ci(gf(r,i),s)),wo(n.prototype,wo(i,gf(r,s))),Xn[n.prop=e]=n,r.targetTest&&(pf.push(n),mm[e]=1),e=(e==="css"?"CSS":e.charAt(0).toUpperCase()+e.substr(1))+"Plugin"}Uw(e,n),r.register&&r.register(Sn,n,Mn)}else nI.push(r)},zt=255,Hu={aqua:[0,zt,zt],lime:[0,zt,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,zt],navy:[0,0,128],white:[zt,zt,zt],olive:[128,128,0],yellow:[zt,zt,0],orange:[zt,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[zt,0,0],pink:[zt,192,203],cyan:[0,zt,zt],transparent:[zt,zt,zt,0]},Sm=function(r,e,t){return r+=r<0?1:r>1?-1:0,(r*6<1?e+(t-e)*r*6:r<.5?t:r*3<2?e+(t-e)*(2/3-r)*6:e)*zt+.5|0},sI=function(r,e,t){var n=r?Rs(r)?[r>>16,r>>8&zt,r&zt]:0:Hu.black,i,s,o,l,h,u,d,A,p,g;if(!n){if(r.substr(-1)===","&&(r=r.substr(0,r.length-1)),Hu[r])n=Hu[r];else if(r.charAt(0)==="#"){if(r.length<6&&(i=r.charAt(1),s=r.charAt(2),o=r.charAt(3),r="#"+i+i+s+s+o+o+(r.length===5?r.charAt(4)+r.charAt(4):"")),r.length===9)return n=parseInt(r.substr(1,6),16),[n>>16,n>>8&zt,n&zt,parseInt(r.substr(7),16)/255];r=parseInt(r.substr(1),16),n=[r>>16,r>>8&zt,r&zt]}else if(r.substr(0,3)==="hsl"){if(n=g=r.match(dm),!e)l=+n[0]%360/360,h=+n[1]/100,u=+n[2]/100,s=u<=.5?u*(h+1):u+h-u*h,i=u*2-s,n.length>3&&(n[3]*=1),n[0]=Sm(l+1/3,i,s),n[1]=Sm(l,i,s),n[2]=Sm(l-1/3,i,s);else if(~r.indexOf("="))return n=r.match(bw),t&&n.length<4&&(n[3]=1),n}else n=r.match(dm)||Hu.transparent;n=n.map(Number)}return e&&!g&&(i=n[0]/zt,s=n[1]/zt,o=n[2]/zt,d=Math.max(i,s,o),A=Math.min(i,s,o),u=(d+A)/2,d===A?l=h=0:(p=d-A,h=u>.5?p/(2-d-A):p/(d+A),l=d===i?(s-o)/p+(s<o?6:0):d===s?(o-i)/p+2:(i-s)/p+4,l*=60),n[0]=~~(l+.5),n[1]=~~(h*100+.5),n[2]=~~(u*100+.5)),t&&n.length<4&&(n[3]=1),n},aI=function(r){var e=[],t=[],n=-1;return r.split(_a).forEach(function(i){var s=i.match($l)||[];e.push.apply(e,s),t.push(n+=s.length+1)}),e.c=t,e},oI=function(r,e,t){var n="",i=(r+n).match(_a),s=e?"hsla(":"rgba(",o=0,l,h,u,d;if(!i)return r;if(i=i.map(function(A){return(A=sI(A,e,1))&&s+(e?A[0]+","+A[1]+"%,"+A[2]+"%,"+A[3]:A.join(","))+")"}),t&&(u=aI(r),l=t.c,l.join(n)!==u.c.join(n)))for(h=r.replace(_a,"1").split($l),d=h.length-1;o<d;o++)n+=h[o]+(~l.indexOf(o)?i.shift()||s+"0,0,0,0)":(u.length?u:i.length?i:t).shift());if(!h)for(h=r.split(_a),d=h.length-1;o<d;o++)n+=h[o]+i[o];return n+h[d]},_a=function(){var r="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b",e;for(e in Hu)r+="|"+e+"\\b";return new RegExp(r+")","gi")}(),FP=/hsl[a]?\(/,lI=function(r){var e=r.join(" "),t;if(_a.lastIndex=0,_a.test(e))return t=FP.test(e),r[1]=oI(r[1],t),r[0]=oI(r[0],t,aI(r[1])),!0},Gu,Jn=function(){var r=Date.now,e=500,t=33,n=r(),i=n,s=1e3/240,o=s,l=[],h,u,d,A,p,g,_=function E(m){var v=r()-i,w=m===!0,x,I,R,S;if((v>e||v<0)&&(n+=v-t),i+=v,R=i-n,x=R-o,(x>0||w)&&(S=++A.frame,p=R-A.time*1e3,A.time=R=R/1e3,o+=x+(x>=s?4:s-x),I=1),w||(h=u(E)),I)for(g=0;g<l.length;g++)l[g](R,p,S,m)};return A={time:0,frame:0,tick:function(){_(!0)},deltaRatio:function(E){return p/(1e3/(E||60))},wake:function(){Lw&&(!pm&&hm()&&(rs=pm=window,Am=rs.document||{},qn.gsap=Sn,(rs.gsapVersions||(rs.gsapVersions=[])).push(Sn.version),Nw(df||rs.GreenSockGlobals||!rs.gsap&&rs||{}),nI.forEach(iI)),d=typeof requestAnimationFrame<"u"&&requestAnimationFrame,h&&A.sleep(),u=d||function(E){return setTimeout(E,o-A.time*1e3+1|0)},Gu=1,_(2))},sleep:function(){(d?cancelAnimationFrame:clearTimeout)(h),Gu=0,u=Pu},lagSmoothing:function(E,m){e=E||1/0,t=Math.min(m||33,e)},fps:function(E){s=1e3/(E||240),o=A.time*1e3+s},add:function(E,m,v){var w=m?function(x,I,R,S){E(x,I,R,S),A.remove(w)}:E;return A.remove(E),l[v?"unshift":"push"](w),ic(),w},remove:function(E,m){~(m=l.indexOf(E))&&l.splice(m,1)&&g>=m&&g--},_listeners:l},A}(),ic=function(){return!Gu&&Jn.wake()},Mt={},zP=/^[\d.\-M][\d.\-,\s]/,HP=/["']/g,GP=function(r){for(var e={},t=r.substr(1,r.length-3).split(":"),n=t[0],i=1,s=t.length,o,l,h;i<s;i++)l=t[i],o=i!==s-1?l.lastIndexOf(","):l.length,h=l.substr(0,o),e[n]=isNaN(h)?h.replace(HP,"").trim():+h,n=l.substr(o+1).trim();return e},VP=function(r){var e=r.indexOf("(")+1,t=r.indexOf(")"),n=r.indexOf("(",e);return r.substring(e,~n&&n<t?r.indexOf(")",t+1):t)},jP=function(r){var e=(r+"").split("("),t=Mt[e[0]];return t&&e.length>1&&t.config?t.config.apply(null,~r.indexOf("{")?[GP(e[1])]:VP(r).split(",").map(Fw)):Mt._CE&&zP.test(r)?Mt._CE("",r):t},cI=function(r){return function(e){return 1-r(1-e)}},uI=function r(e,t){for(var n=e._first,i;n;)n instanceof gn?r(n,t):n.vars.yoyoEase&&(!n._yoyo||!n._repeat)&&n._yoyo!==t&&(n.timeline?r(n.timeline,t):(i=n._ease,n._ease=n._yEase,n._yEase=i,n._yoyo=t)),n=n._next},Co=function(r,e){return r&&(ur(r)?r:Mt[r]||jP(r))||e},Mo=function(r,e,t,n){t===void 0&&(t=function(o){return 1-e(1-o)}),n===void 0&&(n=function(o){return o<.5?e(o*2)/2:1-e((1-o)*2)/2});var i={easeIn:e,easeOut:t,easeInOut:n},s;return Cn(r,function(o){Mt[o]=qn[o]=i,Mt[s=o.toLowerCase()]=t;for(var l in i)Mt[s+(l==="easeIn"?".in":l==="easeOut"?".out":".inOut")]=Mt[o+"."+l]=i[l]}),i},hI=function(r){return function(e){return e<.5?(1-r(1-e*2))/2:.5+r((e-.5)*2)/2}},Tm=function r(e,t,n){var i=t>=1?t:1,s=(n||(e?.3:.45))/(t<1?t:1),o=s/cm*(Math.asin(1/i)||0),l=function(u){return u===1?1:i*Math.pow(2,-10*u)*_P((u-o)*s)+1},h=e==="out"?l:e==="in"?function(u){return 1-l(1-u)}:hI(l);return s=cm/s,h.config=function(u,d){return r(e,u,d)},h},Bm=function r(e,t){t===void 0&&(t=1.70158);var n=function(s){return s?--s*s*((t+1)*s+t)+1:0},i=e==="out"?n:e==="in"?function(s){return 1-n(1-s)}:hI(n);return i.config=function(s){return r(e,s)},i};Cn("Linear,Quad,Cubic,Quart,Quint,Strong",function(r,e){var t=e<5?e+1:e;Mo(r+",Power"+(t-1),e?function(n){return Math.pow(n,t)}:function(n){return n},function(n){return 1-Math.pow(1-n,t)},function(n){return n<.5?Math.pow(n*2,t)/2:1-Math.pow((1-n)*2,t)/2})}),Mt.Linear.easeNone=Mt.none=Mt.Linear.easeIn,Mo("Elastic",Tm("in"),Tm("out"),Tm()),function(r,e){var t=1/e,n=2*t,i=2.5*t,s=function(o){return o<t?r*o*o:o<n?r*Math.pow(o-1.5/e,2)+.75:o<i?r*(o-=2.25/e)*o+.9375:r*Math.pow(o-2.625/e,2)+.984375};Mo("Bounce",function(o){return 1-s(1-o)},s)}(7.5625,2.75),Mo("Expo",function(r){return r?Math.pow(2,10*(r-1)):0}),Mo("Circ",function(r){return-(Tw(1-r*r)-1)}),Mo("Sine",function(r){return r===1?1:-vP(r*gP)+1}),Mo("Back",Bm("in"),Bm("out"),Bm()),Mt.SteppedEase=Mt.steps=qn.SteppedEase={config:function(r,e){r===void 0&&(r=1);var t=1/r,n=r+(e?0:1),i=e?1:0,s=1-Gt;return function(o){return((n*Ou(0,s,o)|0)+i)*t}}},Zl.ease=Mt["quad.out"],Cn("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(r){return ym+=r+","+r+"Params,"});var dI=function(r,e){this.id=mP++,r._gsap=this,this.target=r,this.harness=e,this.get=e?e.get:Qw,this.set=e?e.getSetter:Nm},Vu=function(){function r(t){this.vars=t,this._delay=+t.delay||0,(this._repeat=t.repeat===1/0?-2:t.repeat||0)&&(this._rDelay=t.repeatDelay||0,this._yoyo=!!t.yoyo||!!t.yoyoEase),this._ts=1,rc(this,+t.duration,1,1),this.data=t.data,$t&&(this._ctx=$t,$t.data.push(this)),Gu||Jn.wake()}var e=r.prototype;return e.delay=function(t){return t||t===0?(this.parent&&this.parent.smoothChildTiming&&this.startTime(this._start+t-this._delay),this._delay=t,this):this._delay},e.duration=function(t){return arguments.length?this.totalDuration(this._repeat>0?t+(t+this._rDelay)*this._repeat:t):this.totalDuration()&&this._dur},e.totalDuration=function(t){return arguments.length?(this._dirty=0,rc(this,this._repeat<0?t:(t-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},e.totalTime=function(t,n){if(ic(),!arguments.length)return this._tTime;var i=this._dp;if(i&&i.smoothChildTiming&&this._ts){for(yf(this,t),!i._dp||i.parent||jw(i,this);i&&i.parent;)i.parent._time!==i._start+(i._ts>=0?i._tTime/i._ts:(i.totalDuration()-i._tTime)/-i._ts)&&i.totalTime(i._tTime,!0),i=i.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&t<this._tDur||this._ts<0&&t>0||!this._tDur&&!t)&&ns(this._dp,this,this._start-this._delay)}return(this._tTime!==t||!this._dur&&!n||this._initted&&Math.abs(this._zTime)===Gt||!t&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=t),Ow(this,t,n)),this},e.time=function(t,n){return arguments.length?this.totalTime(Math.min(this.totalDuration(),t+Vw(this))%(this._dur+this._rDelay)||(t?this._dur:0),n):this._time},e.totalProgress=function(t,n){return arguments.length?this.totalTime(this.totalDuration()*t,n):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>0?1:0},e.progress=function(t,n){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&!(this.iteration()&1)?1-t:t)+Vw(this),n):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0},e.iteration=function(t,n){var i=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(t-1)*i,n):this._repeat?tc(this._tTime,i)+1:1},e.timeScale=function(t,n){if(!arguments.length)return this._rts===-Gt?0:this._rts;if(this._rts===t)return this;var i=this.parent&&this._ts?vf(this.parent._time,this):this._tTime;return this._rts=+t||0,this._ts=this._ps||t===-Gt?0:this._rts,this.totalTime(Ou(-Math.abs(this._delay),this._tDur,i),n!==!1),_f(this),MP(this)},e.paused=function(t){return arguments.length?(this._ps!==t&&(this._ps=t,t?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(ic(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==Gt&&(this._tTime-=Gt)))),this):this._ps},e.startTime=function(t){if(arguments.length){this._start=t;var n=this.parent||this._dp;return n&&(n._sort||!this.parent)&&ns(n,this,t-this._delay),this}return this._start},e.endTime=function(t){return this._start+(In(t)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},e.rawTime=function(t){var n=this.parent||this._dp;return n?t&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?vf(n.rawTime(t),this):this._tTime:this._tTime},e.revert=function(t){t===void 0&&(t=xP);var n=en;return en=t,(this._initted||this._startAt)&&(this.timeline&&this.timeline.revert(t),this.totalTime(-.01,t.suppressEvents)),this.data!=="nested"&&t.kill!==!1&&this.kill(),en=n,this},e.globalTime=function(t){for(var n=this,i=arguments.length?t:n.rawTime();n;)i=n._start+i/(Math.abs(n._ts)||1),n=n._dp;return!this.parent&&this._sat?this._sat.globalTime(t):i},e.repeat=function(t){return arguments.length?(this._repeat=t===1/0?-2:t,qw(this)):this._repeat===-2?1/0:this._repeat},e.repeatDelay=function(t){if(arguments.length){var n=this._time;return this._rDelay=t,qw(this),n?this.time(n):this}return this._rDelay},e.yoyo=function(t){return arguments.length?(this._yoyo=t,this):this._yoyo},e.seek=function(t,n){return this.totalTime(ui(this,t),In(n))},e.restart=function(t,n){return this.play().totalTime(t?-this._delay:0,In(n))},e.play=function(t,n){return t!=null&&this.seek(t,n),this.reversed(!1).paused(!1)},e.reverse=function(t,n){return t!=null&&this.seek(t||this.totalDuration(),n),this.reversed(!0).paused(!1)},e.pause=function(t,n){return t!=null&&this.seek(t,n),this.paused(!0)},e.resume=function(){return this.paused(!1)},e.reversed=function(t){return arguments.length?(!!t!==this.reversed()&&this.timeScale(-this._rts||(t?-Gt:0)),this):this._rts<0},e.invalidate=function(){return this._initted=this._act=0,this._zTime=-Gt,this},e.isActive=function(){var t=this.parent||this._dp,n=this._start,i;return!!(!t||this._ts&&this._initted&&t.isActive()&&(i=t.rawTime(!0))>=n&&i<this.endTime(!0)-Gt)},e.eventCallback=function(t,n,i){var s=this.vars;return arguments.length>1?(n?(s[t]=n,i&&(s[t+"Params"]=i),t==="onUpdate"&&(this._onUpdate=n)):delete s[t],this):s[t]},e.then=function(t){var n=this;return new Promise(function(i){var s=ur(t)?t:zw,o=function(){var l=n.then;n.then=null,ur(s)&&(s=s(n))&&(s.then||s===n)&&(n.then=l),i(s),n.then=l};n._initted&&n.totalProgress()===1&&n._ts>=0||!n._tTime&&n._ts<0?o():n._prom=o})},e.kill=function(){zu(this)},r}();ci(Vu.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-Gt,_prom:0,_ps:!1,_rts:1});var gn=function(r){Sw(e,r);function e(n,i){var s;return n===void 0&&(n={}),s=r.call(this,n)||this,s.labels={},s.smoothChildTiming=!!n.smoothChildTiming,s.autoRemoveChildren=!!n.autoRemoveChildren,s._sort=In(n.sortChildren),nr&&ns(n.parent||nr,bs(s),i),n.reversed&&s.reverse(),n.paused&&s.paused(!0),n.scrollTrigger&&Ww(bs(s),n.scrollTrigger),s}var t=e.prototype;return t.to=function(n,i,s){return Qu(0,arguments,this),this},t.from=function(n,i,s){return Qu(1,arguments,this),this},t.fromTo=function(n,i,s,o){return Qu(2,arguments,this),this},t.set=function(n,i,s){return i.duration=0,i.parent=this,ku(i).repeatDelay||(i.repeat=0),i.immediateRender=!!i.immediateRender,new Sr(n,i,ui(this,s),1),this},t.call=function(n,i,s){return ns(this,Sr.delayedCall(0,n,i),s)},t.staggerTo=function(n,i,s,o,l,h,u){return s.duration=i,s.stagger=s.stagger||o,s.onComplete=h,s.onCompleteParams=u,s.parent=this,new Sr(n,s,ui(this,l)),this},t.staggerFrom=function(n,i,s,o,l,h,u){return s.runBackwards=1,ku(s).immediateRender=In(s.immediateRender),this.staggerTo(n,i,s,o,l,h,u)},t.staggerFromTo=function(n,i,s,o,l,h,u,d){return o.startAt=s,ku(o).immediateRender=In(o.immediateRender),this.staggerTo(n,i,o,l,h,u,d)},t.render=function(n,i,s){var o=this._time,l=this._dirty?this.totalDuration():this._tDur,h=this._dur,u=n<=0?0:Vr(n),d=this._zTime<0!=n<0&&(this._initted||!h),A,p,g,_,E,m,v,w,x,I,R,S;if(this!==nr&&u>l&&n>=0&&(u=l),u!==this._tTime||s||d){if(o!==this._time&&h&&(u+=this._time-o,n+=this._time-o),A=u,x=this._start,w=this._ts,m=!w,d&&(h||(o=this._zTime),(n||!i)&&(this._zTime=n)),this._repeat){if(R=this._yoyo,E=h+this._rDelay,this._repeat<-1&&n<0)return this.totalTime(E*100+n,i,s);if(A=Vr(u%E),u===l?(_=this._repeat,A=h):(_=~~(u/E),_&&_===u/E&&(A=h,_--),A>h&&(A=h)),I=tc(this._tTime,E),!o&&this._tTime&&I!==_&&this._tTime-I*E-this._dur<=0&&(I=_),R&&_&1&&(A=h-A,S=1),_!==I&&!this._lock){var T=R&&I&1,D=T===(R&&_&1);if(_<I&&(T=!T),o=T?0:u%h?h:u,this._lock=1,this.render(o||(S?0:Vr(_*E)),i,!h)._lock=0,this._tTime=u,!i&&this.parent&&Kn(this,"onRepeat"),this.vars.repeatRefresh&&!S&&(this.invalidate()._lock=1),o&&o!==this._time||m!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(h=this._dur,l=this._tDur,D&&(this._lock=2,o=T?h:-1e-4,this.render(o,!0),this.vars.repeatRefresh&&!S&&this.invalidate()),this._lock=0,!this._ts&&!m)return this;uI(this,S)}}if(this._hasPause&&!this._forcing&&this._lock<2&&(v=bP(this,Vr(o),Vr(A)),v&&(u-=A-(A=v._start))),this._tTime=u,this._time=A,this._act=!w,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=n,o=0),!o&&A&&!i&&!_&&(Kn(this,"onStart"),this._tTime!==u))return this;if(A>=o&&n>=0)for(p=this._first;p;){if(g=p._next,(p._act||A>=p._start)&&p._ts&&v!==p){if(p.parent!==this)return this.render(n,i,s);if(p.render(p._ts>0?(A-p._start)*p._ts:(p._dirty?p.totalDuration():p._tDur)+(A-p._start)*p._ts,i,s),A!==this._time||!this._ts&&!m){v=0,g&&(u+=this._zTime=-Gt);break}}p=g}else{p=this._last;for(var b=n<0?n:A;p;){if(g=p._prev,(p._act||b<=p._end)&&p._ts&&v!==p){if(p.parent!==this)return this.render(n,i,s);if(p.render(p._ts>0?(b-p._start)*p._ts:(p._dirty?p.totalDuration():p._tDur)+(b-p._start)*p._ts,i,s||en&&(p._initted||p._startAt)),A!==this._time||!this._ts&&!m){v=0,g&&(u+=this._zTime=b?-Gt:Gt);break}}p=g}}if(v&&!i&&(this.pause(),v.render(A>=o?0:-Gt)._zTime=A>=o?1:-1,this._ts))return this._start=x,_f(this),this.render(n,i,s);this._onUpdate&&!i&&Kn(this,"onUpdate",!0),(u===l&&this._tTime>=this.totalDuration()||!u&&o)&&(x===this._start||Math.abs(w)!==Math.abs(this._ts))&&(this._lock||((n||!h)&&(u===l&&this._ts>0||!u&&this._ts<0)&&ma(this,1),!i&&!(n<0&&!o)&&(u||o||!l)&&(Kn(this,u===l&&n>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(u<l&&this.timeScale()>0)&&this._prom())))}return this},t.add=function(n,i){var s=this;if(Rs(i)||(i=ui(this,i,n)),!(n instanceof Vu)){if(tn(n))return n.forEach(function(o){return s.add(o,i)}),this;if(Gr(n))return this.addLabel(n,i);if(ur(n))n=Sr.delayedCall(0,n);else return this}return this!==n?ns(this,n,i):this},t.getChildren=function(n,i,s,o){n===void 0&&(n=!0),i===void 0&&(i=!0),s===void 0&&(s=!0),o===void 0&&(o=-li);for(var l=[],h=this._first;h;)h._start>=o&&(h instanceof Sr?i&&l.push(h):(s&&l.push(h),n&&l.push.apply(l,h.getChildren(!0,i,s)))),h=h._next;return l},t.getById=function(n){for(var i=this.getChildren(1,1,1),s=i.length;s--;)if(i[s].vars.id===n)return i[s]},t.remove=function(n){return Gr(n)?this.removeLabel(n):ur(n)?this.killTweensOf(n):(mf(this,n),n===this._recent&&(this._recent=this._last),Io(this))},t.totalTime=function(n,i){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=Vr(Jn.time-(this._ts>0?n/this._ts:(this.totalDuration()-n)/-this._ts))),r.prototype.totalTime.call(this,n,i),this._forcing=0,this):this._tTime},t.addLabel=function(n,i){return this.labels[n]=ui(this,i),this},t.removeLabel=function(n){return delete this.labels[n],this},t.addPause=function(n,i,s){var o=Sr.delayedCall(0,i||Pu,s);return o.data="isPause",this._hasPause=1,ns(this,o,ui(this,n))},t.removePause=function(n){var i=this._first;for(n=ui(this,n);i;)i._start===n&&i.data==="isPause"&&ma(i),i=i._next},t.killTweensOf=function(n,i,s){for(var o=this.getTweensOf(n,s),l=o.length;l--;)ya!==o[l]&&o[l].kill(n,i);return this},t.getTweensOf=function(n,i){for(var s=[],o=hi(n),l=this._first,h=Rs(i),u;l;)l instanceof Sr?wP(l._targets,o)&&(h?(!ya||l._initted&&l._ts)&&l.globalTime(0)<=i&&l.globalTime(l.totalDuration())>i:!i||l.isActive())&&s.push(l):(u=l.getTweensOf(o,i)).length&&s.push.apply(s,u),l=l._next;return s},t.tweenTo=function(n,i){i=i||{};var s=this,o=ui(s,n),l=i,h=l.startAt,u=l.onStart,d=l.onStartParams,A=l.immediateRender,p,g=Sr.to(s,ci({ease:i.ease||"none",lazy:!1,immediateRender:!1,time:o,overwrite:"auto",duration:i.duration||Math.abs((o-(h&&"time"in h?h.time:s._time))/s.timeScale())||Gt,onStart:function(){if(s.pause(),!p){var _=i.duration||Math.abs((o-(h&&"time"in h?h.time:s._time))/s.timeScale());g._dur!==_&&rc(g,_,0,1).render(g._time,!0,!0),p=1}u&&u.apply(g,d||[])}},i));return A?g.render(0):g},t.tweenFromTo=function(n,i,s){return this.tweenTo(i,ci({startAt:{time:ui(this,n)}},s))},t.recent=function(){return this._recent},t.nextLabel=function(n){return n===void 0&&(n=this._time),rI(this,ui(this,n))},t.previousLabel=function(n){return n===void 0&&(n=this._time),rI(this,ui(this,n),1)},t.currentLabel=function(n){return arguments.length?this.seek(n,!0):this.previousLabel(this._time+Gt)},t.shiftChildren=function(n,i,s){s===void 0&&(s=0);for(var o=this._first,l=this.labels,h;o;)o._start>=s&&(o._start+=n,o._end+=n),o=o._next;if(i)for(h in l)l[h]>=s&&(l[h]+=n);return Io(this)},t.invalidate=function(n){var i=this._first;for(this._lock=0;i;)i.invalidate(n),i=i._next;return r.prototype.invalidate.call(this,n)},t.clear=function(n){n===void 0&&(n=!0);for(var i=this._first,s;i;)s=i._next,this.remove(i),i=s;return this._dp&&(this._time=this._tTime=this._pTime=0),n&&(this.labels={}),Io(this)},t.totalDuration=function(n){var i=0,s=this,o=s._last,l=li,h,u,d;if(arguments.length)return s.timeScale((s._repeat<0?s.duration():s.totalDuration())/(s.reversed()?-n:n));if(s._dirty){for(d=s.parent;o;)h=o._prev,o._dirty&&o.totalDuration(),u=o._start,u>l&&s._sort&&o._ts&&!s._lock?(s._lock=1,ns(s,o,u-o._delay,1)._lock=0):l=u,u<0&&o._ts&&(i-=u,(!d&&!s._dp||d&&d.smoothChildTiming)&&(s._start+=u/s._ts,s._time-=u,s._tTime-=u),s.shiftChildren(-u,!1,-1/0),l=0),o._end>i&&o._ts&&(i=o._end),o=h;rc(s,s===nr&&s._time>i?s._time:i,1,1),s._dirty=0}return s._tDur},e.updateRoot=function(n){if(nr._ts&&(Ow(nr,vf(n,nr)),Pw=Jn.frame),Jn.frame>=kw){kw+=Yn.autoSleep||120;var i=nr._first;if((!i||!i._ts)&&Yn.autoSleep&&Jn._listeners.length<2){for(;i&&!i._ts;)i=i._next;i||Jn.sleep()}}},e}(Vu);ci(gn.prototype,{_lock:0,_hasPause:0,_forcing:0});var WP=function(r,e,t,n,i,s,o){var l=new Mn(this._pt,r,e,0,1,vI,null,i),h=0,u=0,d,A,p,g,_,E,m,v;for(l.b=t,l.e=n,t+="",n+="",(m=~n.indexOf("random("))&&(n=Fu(n)),s&&(v=[t,n],s(v,r,e),t=v[0],n=v[1]),A=t.match(fm)||[];d=fm.exec(n);)g=d[0],_=n.substring(h,d.index),p?p=(p+1)%5:_.substr(-5)==="rgba("&&(p=1),g!==A[u++]&&(E=parseFloat(A[u-1])||0,l._pt={_next:l._pt,p:_||u===1?_:",",s:E,c:g.charAt(1)==="="?ec(E,g)-E:parseFloat(g)-E,m:p&&p<4?Math.round:0},h=fm.lastIndex);return l.c=h<n.length?n.substring(h,n.length):"",l.fp=o,(Rw.test(n)||m)&&(l.e=0),this._pt=l,l},bm=function(r,e,t,n,i,s,o,l,h,u){ur(n)&&(n=n(i||0,r,s));var d=r[e],A=t!=="get"?t:ur(d)?h?r[e.indexOf("set")||!ur(r["get"+e.substr(3)])?e:"get"+e.substr(3)](h):r[e]():d,p=ur(d)?h?JP:gI:Lm,g;if(Gr(n)&&(~n.indexOf("random(")&&(n=Fu(n)),n.charAt(1)==="="&&(g=ec(A,n)+(rn(A)||0),(g||g===0)&&(n=g))),!u||A!==n||Rm)return!isNaN(A*n)&&n!==""?(g=new Mn(this._pt,r,e,+A||0,n-(A||0),typeof d=="boolean"?$P:mI,0,p),h&&(g.fp=h),o&&g.modifier(o,this,r),this._pt=g):(!d&&!(e in r)&&gm(e,n),WP.call(this,r,e,A,n,p,l||Yn.stringFilter,h))},YP=function(r,e,t,n,i){if(ur(r)&&(r=ju(r,i,e,t,n)),!ts(r)||r.style&&r.nodeType||tn(r)||Bw(r))return Gr(r)?ju(r,i,e,t,n):r;var s={},o;for(o in r)s[o]=ju(r[o],i,e,t,n);return s},fI=function(r,e,t,n,i,s){var o,l,h,u;if(Xn[r]&&(o=new Xn[r]).init(i,o.rawVars?e[r]:YP(e[r],n,i,s,t),t,n,s)!==!1&&(t._pt=l=new Mn(t._pt,i,r,0,1,o.render,o,0,o.priority),t!==nc))for(h=t._ptLookup[t._targets.indexOf(i)],u=o._props.length;u--;)h[o._props[u]]=l;return o},ya,Rm,Dm=function r(e,t,n){var i=e.vars,s=i.ease,o=i.startAt,l=i.immediateRender,h=i.lazy,u=i.onUpdate,d=i.runBackwards,A=i.yoyoEase,p=i.keyframes,g=i.autoRevert,_=e._dur,E=e._startAt,m=e._targets,v=e.parent,w=v&&v.data==="nested"?v.vars.targets:m,x=e._overwrite==="auto"&&!lm,I=e.timeline,R,S,T,D,b,M,L,P,N,W,X,K,te;if(I&&(!p||!s)&&(s="none"),e._ease=Co(s,Zl.ease),e._yEase=A?cI(Co(A===!0?s:A,Zl.ease)):0,A&&e._yoyo&&!e._repeat&&(A=e._yEase,e._yEase=e._ease,e._ease=A),e._from=!I&&!!i.runBackwards,!I||p&&!i.stagger){if(P=m[0]?xo(m[0]).harness:0,K=P&&i[P.prop],R=gf(i,mm),E&&(E._zTime<0&&E.progress(1),t<0&&d&&l&&!g?E.render(-1,!0):E.revert(d&&_?ff:EP),E._lazy=0),o){if(ma(e._startAt=Sr.set(m,ci({data:"isStart",overwrite:!1,parent:v,immediateRender:!0,lazy:!E&&In(h),startAt:null,delay:0,onUpdate:u&&function(){return Kn(e,"onUpdate")},stagger:0},o))),e._startAt._dp=0,e._startAt._sat=e,t<0&&(en||!l&&!g)&&e._startAt.revert(ff),l&&_&&t<=0&&n<=0){t&&(e._zTime=t);return}}else if(d&&_&&!E){if(t&&(l=!1),T=ci({overwrite:!1,data:"isFromStart",lazy:l&&!E&&In(h),immediateRender:l,stagger:0,parent:v},R),K&&(T[P.prop]=K),ma(e._startAt=Sr.set(m,T)),e._startAt._dp=0,e._startAt._sat=e,t<0&&(en?e._startAt.revert(ff):e._startAt.render(-1,!0)),e._zTime=t,!l)r(e._startAt,Gt,Gt);else if(!t)return}for(e._pt=e._ptCache=0,h=_&&In(h)||h&&!_,S=0;S<m.length;S++){if(b=m[S],L=b._gsap||Em(m)[S]._gsap,e._ptLookup[S]=W={},vm[L.id]&&ga.length&&Af(),X=w===m?S:w.indexOf(b),P&&(N=new P).init(b,K||R,e,X,w)!==!1&&(e._pt=D=new Mn(e._pt,b,N.name,0,1,N.render,N,0,N.priority),N._props.forEach(function(V){W[V]=D}),N.priority&&(M=1)),!P||K)for(T in R)Xn[T]&&(N=fI(T,R,e,X,b,w))?N.priority&&(M=1):W[T]=D=bm.call(e,b,T,"get",R[T],X,w,0,i.stringFilter);e._op&&e._op[S]&&e.kill(b,e._op[S]),x&&e._pt&&(ya=e,nr.killTweensOf(b,W,e.globalTime(t)),te=!e.parent,ya=0),e._pt&&h&&(vm[L.id]=1)}M&&_I(e),e._onInit&&e._onInit(e)}e._onUpdate=u,e._initted=(!e._op||e._pt)&&!te,p&&t<=0&&I.render(li,!0,!0)},qP=function(r,e,t,n,i,s,o,l){var h=(r._pt&&r._ptCache||(r._ptCache={}))[e],u,d,A,p;if(!h)for(h=r._ptCache[e]=[],A=r._ptLookup,p=r._targets.length;p--;){if(u=A[p][e],u&&u.d&&u.d._pt)for(u=u.d._pt;u&&u.p!==e&&u.fp!==e;)u=u._next;if(!u)return Rm=1,r.vars[e]="+=0",Dm(r,o),Rm=0,l?Uu(e+" not eligible for reset"):1;h.push(u)}for(p=h.length;p--;)d=h[p],u=d._pt||d,u.s=(n||n===0)&&!i?n:u.s+(n||0)+s*u.c,u.c=t-u.s,d.e&&(d.e=yr(t)+rn(d.e)),d.b&&(d.b=u.s+rn(d.b))},XP=function(r,e){var t=r[0]?xo(r[0]).harness:0,n=t&&t.aliases,i,s,o,l;if(!n)return e;i=wo({},e);for(s in n)if(s in i)for(l=n[s].split(","),o=l.length;o--;)i[l[o]]=i[s];return i},KP=function(r,e,t,n){var i=e.ease||n||"power1.inOut",s,o;if(tn(e))o=t[r]||(t[r]=[]),e.forEach(function(l,h){return o.push({t:h/(e.length-1)*100,v:l,e:i})});else for(s in e)o=t[s]||(t[s]=[]),s==="ease"||o.push({t:parseFloat(r),v:e[s],e:i})},ju=function(r,e,t,n,i){return ur(r)?r.call(e,t,n,i):Gr(r)&&~r.indexOf("random(")?Fu(r):r},pI=ym+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,autoRevert",AI={};Cn(pI+",id,stagger,delay,duration,paused,scrollTrigger",function(r){return AI[r]=1});var Sr=function(r){Sw(e,r);function e(n,i,s,o){var l;typeof i=="number"&&(s.duration=i,i=s,s=null),l=r.call(this,o?i:ku(i))||this;var h=l.vars,u=h.duration,d=h.delay,A=h.immediateRender,p=h.stagger,g=h.overwrite,_=h.keyframes,E=h.defaults,m=h.scrollTrigger,v=h.yoyoEase,w=i.parent||nr,x=(tn(n)||Bw(n)?Rs(n[0]):"length"in i)?[n]:hi(n),I,R,S,T,D,b,M,L;if(l._targets=x.length?Em(x):Uu("GSAP target "+n+" not found. https://gsap.com",!Yn.nullTargetWarn)||[],l._ptLookup=[],l._overwrite=g,_||p||hf(u)||hf(d)){if(i=l.vars,I=l.timeline=new gn({data:"nested",defaults:E||{},targets:w&&w.data==="nested"?w.vars.targets:x}),I.kill(),I.parent=I._dp=bs(l),I._start=0,p||hf(u)||hf(d)){if(T=x.length,M=p&&Jw(p),ts(p))for(D in p)~pI.indexOf(D)&&(L||(L={}),L[D]=p[D]);for(R=0;R<T;R++)S=gf(i,AI),S.stagger=0,v&&(S.yoyoEase=v),L&&wo(S,L),b=x[R],S.duration=+ju(u,bs(l),R,b,x),S.delay=(+ju(d,bs(l),R,b,x)||0)-l._delay,!p&&T===1&&S.delay&&(l._delay=d=S.delay,l._start+=d,S.delay=0),I.to(b,S,M?M(R,b,x):0),I._ease=Mt.none;I.duration()?u=d=0:l.timeline=0}else if(_){ku(ci(I.vars.defaults,{ease:"none"})),I._ease=Co(_.ease||i.ease||"none");var P=0,N,W,X;if(tn(_))_.forEach(function(K){return I.to(x,K,">")}),I.duration();else{S={};for(D in _)D==="ease"||D==="easeEach"||KP(D,_[D],S,_.easeEach);for(D in S)for(N=S[D].sort(function(K,te){return K.t-te.t}),P=0,R=0;R<N.length;R++)W=N[R],X={ease:W.e,duration:(W.t-(R?N[R-1].t:0))/100*u},X[D]=W.v,I.to(x,X,P),P+=X.duration;I.duration()<u&&I.to({},{duration:u-I.duration()})}}u||l.duration(u=I.duration())}else l.timeline=0;return g===!0&&!lm&&(ya=bs(l),nr.killTweensOf(x),ya=0),ns(w,bs(l),s),i.reversed&&l.reverse(),i.paused&&l.paused(!0),(A||!u&&!_&&l._start===Vr(w._time)&&In(A)&&SP(bs(l))&&w.data!=="nested")&&(l._tTime=-Gt,l.render(Math.max(0,-d)||0)),m&&Ww(bs(l),m),l}var t=e.prototype;return t.render=function(n,i,s){var o=this._time,l=this._tDur,h=this._dur,u=n<0,d=n>l-Gt&&!u?l:n<Gt?0:n,A,p,g,_,E,m,v,w,x;if(!h)BP(this,n,i,s);else if(d!==this._tTime||!n||s||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==u){if(A=d,w=this.timeline,this._repeat){if(_=h+this._rDelay,this._repeat<-1&&u)return this.totalTime(_*100+n,i,s);if(A=Vr(d%_),d===l?(g=this._repeat,A=h):(g=~~(d/_),g&&g===Vr(d/_)&&(A=h,g--),A>h&&(A=h)),m=this._yoyo&&g&1,m&&(x=this._yEase,A=h-A),E=tc(this._tTime,_),A===o&&!s&&this._initted&&g===E)return this._tTime=d,this;g!==E&&(w&&this._yEase&&uI(w,m),this.vars.repeatRefresh&&!m&&!this._lock&&this._time!==_&&this._initted&&(this._lock=s=1,this.render(Vr(_*g),!0).invalidate()._lock=0))}if(!this._initted){if(Yw(this,u?n:A,s,i,d))return this._tTime=0,this;if(o!==this._time&&!(s&&this.vars.repeatRefresh&&g!==E))return this;if(h!==this._dur)return this.render(n,i,s)}if(this._tTime=d,this._time=A,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=v=(x||this._ease)(A/h),this._from&&(this.ratio=v=1-v),A&&!o&&!i&&!g&&(Kn(this,"onStart"),this._tTime!==d))return this;for(p=this._pt;p;)p.r(v,p.d),p=p._next;w&&w.render(n<0?n:w._dur*w._ease(A/this._dur),i,s)||this._startAt&&(this._zTime=n),this._onUpdate&&!i&&(u&&xm(this,n,i,s),Kn(this,"onUpdate")),this._repeat&&g!==E&&this.vars.onRepeat&&!i&&this.parent&&Kn(this,"onRepeat"),(d===this._tDur||!d)&&this._tTime===d&&(u&&!this._onUpdate&&xm(this,n,!0,!0),(n||!h)&&(d===this._tDur&&this._ts>0||!d&&this._ts<0)&&ma(this,1),!i&&!(u&&!o)&&(d||o||m)&&(Kn(this,d===l?"onComplete":"onReverseComplete",!0),this._prom&&!(d<l&&this.timeScale()>0)&&this._prom()))}return this},t.targets=function(){return this._targets},t.invalidate=function(n){return(!n||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(n),r.prototype.invalidate.call(this,n)},t.resetTo=function(n,i,s,o,l){Gu||Jn.wake(),this._ts||this.play();var h=Math.min(this._dur,(this._dp._time-this._start)*this._ts),u;return this._initted||Dm(this,h),u=this._ease(h/this._dur),qP(this,n,i,s,o,u,h,l)?this.resetTo(n,i,s,o,1):(yf(this,0),this.parent||Gw(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},t.kill=function(n,i){if(i===void 0&&(i="all"),!n&&(!i||i==="all"))return this._lazy=this._pt=0,this.parent?zu(this):this;if(this.timeline){var s=this.timeline.totalDuration();return this.timeline.killTweensOf(n,i,ya&&ya.vars.overwrite!==!0)._first||zu(this),this.parent&&s!==this.timeline.totalDuration()&&rc(this,this._dur*this.timeline._tDur/s,0,1),this}var o=this._targets,l=n?hi(n):o,h=this._ptLookup,u=this._pt,d,A,p,g,_,E,m;if((!i||i==="all")&&CP(o,l))return i==="all"&&(this._pt=0),zu(this);for(d=this._op=this._op||[],i!=="all"&&(Gr(i)&&(_={},Cn(i,function(v){return _[v]=1}),i=_),i=XP(o,i)),m=o.length;m--;)if(~l.indexOf(o[m])){A=h[m],i==="all"?(d[m]=i,g=A,p={}):(p=d[m]=d[m]||{},g=i);for(_ in g)E=A&&A[_],E&&((!("kill"in E.d)||E.d.kill(_)===!0)&&mf(this,E,"_pt"),delete A[_]),p!=="all"&&(p[_]=1)}return this._initted&&!this._pt&&u&&zu(this),this},e.to=function(n,i){return new e(n,i,arguments[2])},e.from=function(n,i){return Qu(1,arguments)},e.delayedCall=function(n,i,s,o){return new e(i,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:n,onComplete:i,onReverseComplete:i,onCompleteParams:s,onReverseCompleteParams:s,callbackScope:o})},e.fromTo=function(n,i,s){return Qu(2,arguments)},e.set=function(n,i){return i.duration=0,i.repeatDelay||(i.repeat=0),new e(n,i)},e.killTweensOf=function(n,i,s){return nr.killTweensOf(n,i,s)},e}(Vu);ci(Sr.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0}),Cn("staggerTo,staggerFrom,staggerFromTo",function(r){Sr[r]=function(){var e=new gn,t=Im.call(arguments,0);return t.splice(r==="staggerFromTo"?5:4,0,0),e[r].apply(e,t)}});var Lm=function(r,e,t){return r[e]=t},gI=function(r,e,t){return r[e](t)},JP=function(r,e,t,n){return r[e](n.fp,t)},ZP=function(r,e,t){return r.setAttribute(e,t)},Nm=function(r,e){return ur(r[e])?gI:um(r[e])&&r.setAttribute?ZP:Lm},mI=function(r,e){return e.set(e.t,e.p,Math.round((e.s+e.c*r)*1e6)/1e6,e)},$P=function(r,e){return e.set(e.t,e.p,!!(e.s+e.c*r),e)},vI=function(r,e){var t=e._pt,n="";if(!r&&e.b)n=e.b;else if(r===1&&e.e)n=e.e;else{for(;t;)n=t.p+(t.m?t.m(t.s+t.c*r):Math.round((t.s+t.c*r)*1e4)/1e4)+n,t=t._next;n+=e.c}e.set(e.t,e.p,n,e)},Um=function(r,e){for(var t=e._pt;t;)t.r(r,t.d),t=t._next},e7=function(r,e,t,n){for(var i=this._pt,s;i;)s=i._next,i.p===n&&i.modifier(r,e,t),i=s},t7=function(r){for(var e=this._pt,t,n;e;)n=e._next,e.p===r&&!e.op||e.op===r?mf(this,e,"_pt"):e.dep||(t=1),e=n;return!t},r7=function(r,e,t,n){n.mSet(r,e,n.m.call(n.tween,t,n.mt),n)},_I=function(r){for(var e=r._pt,t,n,i,s;e;){for(t=e._next,n=i;n&&n.pr>e.pr;)n=n._next;(e._prev=n?n._prev:s)?e._prev._next=e:i=e,(e._next=n)?n._prev=e:s=e,e=t}r._pt=i},Mn=function(){function r(t,n,i,s,o,l,h,u,d){this.t=n,this.s=s,this.c=o,this.p=i,this.r=l||mI,this.d=h||this,this.set=u||Lm,this.pr=d||0,this._next=t,t&&(t._prev=this)}var e=r.prototype;return e.modifier=function(t,n,i){this.mSet=this.mSet||this.set,this.set=r7,this.m=t,this.mt=i,this.tween=n},r}();Cn(ym+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger",function(r){return mm[r]=1}),qn.TweenMax=qn.TweenLite=Sr,qn.TimelineLite=qn.TimelineMax=gn,nr=new gn({sortChildren:!1,defaults:Zl,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0}),Yn.stringFilter=lI;var So=[],Ef={},n7=[],yI=0,i7=0,Pm=function(r){return(Ef[r]||n7).map(function(e){return e()})},km=function(){var r=Date.now(),e=[];r-yI>2&&(Pm("matchMediaInit"),So.forEach(function(t){var n=t.queries,i=t.conditions,s,o,l,h;for(o in n)s=rs.matchMedia(n[o]).matches,s&&(l=1),s!==i[o]&&(i[o]=s,h=1);h&&(t.revert(),l&&e.push(t))}),Pm("matchMediaRevert"),e.forEach(function(t){return t.onMatch(t,function(n){return t.add(null,n)})}),yI=r,Pm("matchMedia"))},EI=function(){function r(t,n){this.selector=n&&Cm(n),this.data=[],this._r=[],this.isReverted=!1,this.id=i7++,t&&this.add(t)}var e=r.prototype;return e.add=function(t,n,i){ur(t)&&(i=n,n=t,t=ur);var s=this,o=function(){var l=$t,h=s.selector,u;return l&&l!==s&&l.data.push(s),i&&(s.selector=Cm(i)),$t=s,u=n.apply(s,arguments),ur(u)&&s._r.push(u),$t=l,s.selector=h,s.isReverted=!1,u};return s.last=o,t===ur?o(s,function(l){return s.add(null,l)}):t?s[t]=o:o},e.ignore=function(t){var n=$t;$t=null,t(this),$t=n},e.getTweens=function(){var t=[];return this.data.forEach(function(n){return n instanceof r?t.push.apply(t,n.getTweens()):n instanceof Sr&&!(n.parent&&n.parent.data==="nested")&&t.push(n)}),t},e.clear=function(){this._r.length=this.data.length=0},e.kill=function(t,n){var i=this;if(t?function(){for(var o=i.getTweens(),l=i.data.length,h;l--;)h=i.data[l],h.data==="isFlip"&&(h.revert(),h.getChildren(!0,!0,!1).forEach(function(u){return o.splice(o.indexOf(u),1)}));for(o.map(function(u){return{g:u._dur||u._delay||u._sat&&!u._sat.vars.immediateRender?u.globalTime(0):-1/0,t:u}}).sort(function(u,d){return d.g-u.g||-1/0}).forEach(function(u){return u.t.revert(t)}),l=i.data.length;l--;)h=i.data[l],h instanceof gn?h.data!=="nested"&&(h.scrollTrigger&&h.scrollTrigger.revert(),h.kill()):!(h instanceof Sr)&&h.revert&&h.revert(t);i._r.forEach(function(u){return u(t,i)}),i.isReverted=!0}():this.data.forEach(function(o){return o.kill&&o.kill()}),this.clear(),n)for(var s=So.length;s--;)So[s].id===this.id&&So.splice(s,1)},e.revert=function(t){this.kill(t||{})},r}(),s7=function(){function r(t){this.contexts=[],this.scope=t,$t&&$t.data.push(this)}var e=r.prototype;return e.add=function(t,n,i){ts(t)||(t={matches:t});var s=new EI(0,i||this.scope),o=s.conditions={},l,h,u;$t&&!s.selector&&(s.selector=$t.selector),this.contexts.push(s),n=s.add("onMatch",n),s.queries=t;for(h in t)h==="all"?u=1:(l=rs.matchMedia(t[h]),l&&(So.indexOf(s)<0&&So.push(s),(o[h]=l.matches)&&(u=1),l.addListener?l.addListener(km):l.addEventListener("change",km)));return u&&n(s,function(d){return s.add(null,d)}),this},e.revert=function(t){this.kill(t||{})},e.kill=function(t){this.contexts.forEach(function(n){return n.kill(t,!0)})},r}(),xf={registerPlugin:function(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];e.forEach(function(n){return iI(n)})},timeline:function(r){return new gn(r)},getTweensOf:function(r,e){return nr.getTweensOf(r,e)},getProperty:function(r,e,t,n){Gr(r)&&(r=hi(r)[0]);var i=xo(r||{}).get,s=t?zw:Fw;return t==="native"&&(t=""),r&&(e?s((Xn[e]&&Xn[e].get||i)(r,e,t,n)):function(o,l,h){return s((Xn[o]&&Xn[o].get||i)(r,o,l,h))})},quickSetter:function(r,e,t){if(r=hi(r),r.length>1){var n=r.map(function(u){return Sn.quickSetter(u,e,t)}),i=n.length;return function(u){for(var d=i;d--;)n[d](u)}}r=r[0]||{};var s=Xn[e],o=xo(r),l=o.harness&&(o.harness.aliases||{})[e]||e,h=s?function(u){var d=new s;nc._pt=0,d.init(r,t?u+t:u,nc,0,[r]),d.render(1,d),nc._pt&&Um(1,nc)}:o.set(r,l);return s?h:function(u){return h(r,l,t?u+t:u,o,1)}},quickTo:function(r,e,t){var n,i=Sn.to(r,wo((n={},n[e]="+=0.1",n.paused=!0,n),t||{})),s=function(o,l,h){return i.resetTo(e,o,l,h)};return s.tween=i,s},isTweening:function(r){return nr.getTweensOf(r,!0).length>0},defaults:function(r){return r&&r.ease&&(r.ease=Co(r.ease,Zl.ease)),Hw(Zl,r||{})},config:function(r){return Hw(Yn,r||{})},registerEffect:function(r){var e=r.name,t=r.effect,n=r.plugins,i=r.defaults,s=r.extendTimeline;(n||"").split(",").forEach(function(o){return o&&!Xn[o]&&!qn[o]&&Uu(e+" effect requires "+o+" plugin.")}),_m[e]=function(o,l,h){return t(hi(o),ci(l||{},i),h)},s&&(gn.prototype[e]=function(o,l,h){return this.add(_m[e](o,ts(l)?l:(h=l)&&{},this),h)})},registerEase:function(r,e){Mt[r]=Co(e)},parseEase:function(r,e){return arguments.length?Co(r,e):Mt},getById:function(r){return nr.getById(r)},exportRoot:function(r,e){r===void 0&&(r={});var t=new gn(r),n,i;for(t.smoothChildTiming=In(r.smoothChildTiming),nr.remove(t),t._dp=0,t._time=t._tTime=nr._time,n=nr._first;n;)i=n._next,(e||!(!n._dur&&n instanceof Sr&&n.vars.onComplete===n._targets[0]))&&ns(t,n,n._start-n._delay),n=i;return ns(nr,t,0),t},context:function(r,e){return r?new EI(r,e):$t},matchMedia:function(r){return new s7(r)},matchMediaRefresh:function(){return So.forEach(function(r){var e=r.conditions,t,n;for(n in e)e[n]&&(e[n]=!1,t=1);t&&r.revert()})||km()},addEventListener:function(r,e){var t=Ef[r]||(Ef[r]=[]);~t.indexOf(e)||t.push(e)},removeEventListener:function(r,e){var t=Ef[r],n=t&&t.indexOf(e);n>=0&&t.splice(n,1)},utils:{wrap:kP,wrapYoyo:QP,distribute:Jw,random:$w,snap:Zw,normalize:PP,getUnit:rn,clamp:DP,splitColor:sI,toArray:hi,selector:Cm,mapRange:tI,pipe:NP,unitize:UP,interpolate:OP,shuffle:Kw},install:Nw,effects:_m,ticker:Jn,updateRoot:gn.updateRoot,plugins:Xn,globalTimeline:nr,core:{PropTween:Mn,globals:Uw,Tween:Sr,Timeline:gn,Animation:Vu,getCache:xo,_removeLinkedListItem:mf,reverting:function(){return en},context:function(r){return r&&$t&&($t.data.push(r),r._ctx=$t),$t},suppressOverwrites:function(r){return lm=r}}};Cn("to,from,fromTo,delayedCall,set,killTweensOf",function(r){return xf[r]=Sr[r]}),Jn.add(gn.updateRoot),nc=xf.to({},{duration:0});var a7=function(r,e){for(var t=r._pt;t&&t.p!==e&&t.op!==e&&t.fp!==e;)t=t._next;return t},o7=function(r,e){var t=r._targets,n,i,s;for(n in e)for(i=t.length;i--;)s=r._ptLookup[i][n],s&&(s=s.d)&&(s._pt&&(s=a7(s,n)),s&&s.modifier&&s.modifier(e[n],r,t[i],n))},Qm=function(r,e){return{name:r,rawVars:1,init:function(t,n,i){i._onInit=function(s){var o,l;if(Gr(n)&&(o={},Cn(n,function(h){return o[h]=1}),n=o),e){o={};for(l in n)o[l]=e(n[l]);n=o}o7(s,n)}}}},Sn=xf.registerPlugin({name:"attr",init:function(r,e,t,n,i){var s,o,l;this.tween=t;for(s in e)l=r.getAttribute(s)||"",o=this.add(r,"setAttribute",(l||0)+"",e[s],n,i,0,0,s),o.op=s,o.b=l,this._props.push(s)},render:function(r,e){for(var t=e._pt;t;)en?t.set(t.t,t.p,t.b,t):t.r(r,t.d),t=t._next}},{name:"endArray",init:function(r,e){for(var t=e.length;t--;)this.add(r,t,r[t]||0,e[t],0,0,0,0,0,1)}},Qm("roundProps",Mm),Qm("modifiers"),Qm("snap",Zw))||xf;Sr.version=gn.version=Sn.version="3.12.5",Lw=1,hm()&&ic(),Mt.Power0,Mt.Power1,Mt.Power2,Mt.Power3,Mt.Power4,Mt.Linear,Mt.Quad,Mt.Cubic,Mt.Quart,Mt.Quint,Mt.Strong,Mt.Elastic,Mt.Back,Mt.SteppedEase,Mt.Bounce,Mt.Sine,Mt.Expo,Mt.Circ;/*!
4494
4494
  * CSSPlugin 3.12.5
4495
4495
  * https://gsap.com
4496
4496
  *
@@ -4498,10 +4498,10 @@ bool bvhIntersectFirstHit(
4498
4498
  * Subject to the terms at https://gsap.com/standard-license or for
4499
4499
  * Club GSAP members, the agreement issued with that membership.
4500
4500
  * @author: Jack Doyle, jack@greensock.com
4501
- */var xI,Ea,sc,Fm,To,wI,zm,l7=function(){return typeof window<"u"},Ds={},Bo=180/Math.PI,ac=Math.PI/180,oc=Math.atan2,II=1e8,Hm=/([A-Z])/g,c7=/(left|right|width|margin|padding|x)/i,u7=/[\s,\(]\S/,is={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},Gm=function(r,e){return e.set(e.t,e.p,Math.round((e.s+e.c*r)*1e4)/1e4+e.u,e)},h7=function(r,e){return e.set(e.t,e.p,r===1?e.e:Math.round((e.s+e.c*r)*1e4)/1e4+e.u,e)},d7=function(r,e){return e.set(e.t,e.p,r?Math.round((e.s+e.c*r)*1e4)/1e4+e.u:e.b,e)},f7=function(r,e){var t=e.s+e.c*r;e.set(e.t,e.p,~~(t+(t<0?-.5:.5))+e.u,e)},CI=function(r,e){return e.set(e.t,e.p,r?e.e:e.b,e)},MI=function(r,e){return e.set(e.t,e.p,r!==1?e.b:e.e,e)},p7=function(r,e,t){return r.style[e]=t},A7=function(r,e,t){return r.style.setProperty(e,t)},g7=function(r,e,t){return r._gsap[e]=t},m7=function(r,e,t){return r._gsap.scaleX=r._gsap.scaleY=t},v7=function(r,e,t,n,i){var s=r._gsap;s.scaleX=s.scaleY=t,s.renderTransform(i,s)},_7=function(r,e,t,n,i){var s=r._gsap;s[e]=t,s.renderTransform(i,s)},ir="transform",Tn=ir+"Origin",y7=function r(e,t){var n=this,i=this.target,s=i.style,o=i._gsap;if(e in Ds&&s){if(this.tfm=this.tfm||{},e!=="transform")e=is[e]||e,~e.indexOf(",")?e.split(",").forEach(function(l){return n.tfm[l]=Ls(i,l)}):this.tfm[e]=o.x?o[e]:Ls(i,e),e===Tn&&(this.tfm.zOrigin=o.zOrigin);else return is.transform.split(",").forEach(function(l){return r.call(n,l,t)});if(this.props.indexOf(ir)>=0)return;o.svg&&(this.svgo=i.getAttribute("data-svg-origin"),this.props.push(Tn,t,"")),e=ir}(s||t)&&this.props.push(e,t,s[e])},SI=function(r){r.translate&&(r.removeProperty("translate"),r.removeProperty("scale"),r.removeProperty("rotate"))},E7=function(){var r=this.props,e=this.target,t=e.style,n=e._gsap,i,s;for(i=0;i<r.length;i+=3)r[i+1]?e[r[i]]=r[i+2]:r[i+2]?t[r[i]]=r[i+2]:t.removeProperty(r[i].substr(0,2)==="--"?r[i]:r[i].replace(Hm,"-$1").toLowerCase());if(this.tfm){for(s in this.tfm)n[s]=this.tfm[s];n.svg&&(n.renderTransform(),e.setAttribute("data-svg-origin",this.svgo||"")),i=zm(),(!i||!i.isStart)&&!t[ir]&&(SI(t),n.zOrigin&&t[Tn]&&(t[Tn]+=" "+n.zOrigin+"px",n.zOrigin=0,n.renderTransform()),n.uncache=1)}},TI=function(r,e){var t={target:r,props:[],revert:E7,save:y7};return r._gsap||Sn.core.getCache(r),e&&e.split(",").forEach(function(n){return t.save(n)}),t},BI,Vm=function(r,e){var t=Ea.createElementNS?Ea.createElementNS((e||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),r):Ea.createElement(r);return t&&t.style?t:Ea.createElement(r)},ss=function r(e,t,n){var i=getComputedStyle(e);return i[t]||i.getPropertyValue(t.replace(Hm,"-$1").toLowerCase())||i.getPropertyValue(t)||!n&&r(e,lc(t)||t,1)||""},bI="O,Moz,ms,Ms,Webkit".split(","),lc=function(r,e,t){var n=e||To,i=n.style,s=5;if(r in i&&!t)return r;for(r=r.charAt(0).toUpperCase()+r.substr(1);s--&&!(bI[s]+r in i););return s<0?null:(s===3?"ms":s>=0?bI[s]:"")+r},jm=function(){l7()&&window.document&&(xI=window,Ea=xI.document,sc=Ea.documentElement,To=Vm("div")||{style:{}},Vm("div"),ir=lc(ir),Tn=ir+"Origin",To.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",BI=!!lc("perspective"),zm=Sn.core.reverting,Fm=1)},Wm=function r(e){var t=Vm("svg",this.ownerSVGElement&&this.ownerSVGElement.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),n=this.parentNode,i=this.nextSibling,s=this.style.cssText,o;if(sc.appendChild(t),t.appendChild(this),this.style.display="block",e)try{o=this.getBBox(),this._gsapBBox=this.getBBox,this.getBBox=r}catch{}else this._gsapBBox&&(o=this._gsapBBox());return n&&(i?n.insertBefore(this,i):n.appendChild(this)),sc.removeChild(t),this.style.cssText=s,o},RI=function(r,e){for(var t=e.length;t--;)if(r.hasAttribute(e[t]))return r.getAttribute(e[t])},DI=function(r){var e;try{e=r.getBBox()}catch{e=Wm.call(r,!0)}return e&&(e.width||e.height)||r.getBBox===Wm||(e=Wm.call(r,!0)),e&&!e.width&&!e.x&&!e.y?{x:+RI(r,["x","cx","x1"])||0,y:+RI(r,["y","cy","y1"])||0,width:0,height:0}:e},LI=function(r){return!!(r.getCTM&&(!r.parentNode||r.ownerSVGElement)&&DI(r))},bo=function(r,e){if(e){var t=r.style,n;e in Ds&&e!==Tn&&(e=ir),t.removeProperty?(n=e.substr(0,2),(n==="ms"||e.substr(0,6)==="webkit")&&(e="-"+e),t.removeProperty(n==="--"?e:e.replace(Hm,"-$1").toLowerCase())):t.removeAttribute(e)}},xa=function(r,e,t,n,i,s){var o=new Mn(r._pt,e,t,0,1,s?MI:CI);return r._pt=o,o.b=n,o.e=i,r._props.push(t),o},NI={deg:1,rad:1,turn:1},x7={grid:1,flex:1},wa=function r(e,t,n,i){var s=parseFloat(n)||0,o=(n+"").trim().substr((s+"").length)||"px",l=To.style,h=c7.test(t),u=e.tagName.toLowerCase()==="svg",d=(u?"client":"offset")+(h?"Width":"Height"),A=100,p=i==="px",g=i==="%",_,E,m,v;if(i===o||!s||NI[i]||NI[o])return s;if(o!=="px"&&!p&&(s=r(e,t,n,"px")),v=e.getCTM&&LI(e),(g||o==="%")&&(Ds[t]||~t.indexOf("adius")))return _=v?e.getBBox()[h?"width":"height"]:e[d],yr(g?s/_*A:s/100*_);if(l[h?"width":"height"]=A+(p?o:i),E=~t.indexOf("adius")||i==="em"&&e.appendChild&&!u?e:e.parentNode,v&&(E=(e.ownerSVGElement||{}).parentNode),(!E||E===Ea||!E.appendChild)&&(E=Ea.body),m=E._gsap,m&&g&&m.width&&h&&m.time===Jn.time&&!m.uncache)return yr(s/m.width*A);if(g&&(t==="height"||t==="width")){var w=e.style[t];e.style[t]=A+i,_=e[d],w?e.style[t]=w:bo(e,t)}else(g||o==="%")&&!x7[ss(E,"display")]&&(l.position=ss(e,"position")),E===e&&(l.position="static"),E.appendChild(To),_=To[d],E.removeChild(To),l.position="absolute";return h&&g&&(m=xo(E),m.time=Jn.time,m.width=E[d]),yr(p?_*s/A:_&&s?A/_*s:0)},Ls=function(r,e,t,n){var i;return Fm||jm(),e in is&&e!=="transform"&&(e=is[e],~e.indexOf(",")&&(e=e.split(",")[0])),Ds[e]&&e!=="transform"?(i=Yu(r,n),i=e!=="transformOrigin"?i[e]:i.svg?i.origin:If(ss(r,Tn))+" "+i.zOrigin+"px"):(i=r.style[e],(!i||i==="auto"||n||~(i+"").indexOf("calc("))&&(i=wf[e]&&wf[e](r,e,t)||ss(r,e)||Qw(r,e)||(e==="opacity"?1:0))),t&&!~(i+"").trim().indexOf(" ")?wa(r,e,i,t)+t:i},w7=function(r,e,t,n){if(!t||t==="none"){var i=lc(e,r,1),s=i&&ss(r,i,1);s&&s!==t?(e=i,t=s):e==="borderColor"&&(t=ss(r,"borderTopColor"))}var o=new Mn(this._pt,r.style,e,0,1,vI),l=0,h=0,u,d,A,p,g,_,E,m,v,w,x,I;if(o.b=t,o.e=n,t+="",n+="",n==="auto"&&(_=r.style[e],r.style[e]=n,n=ss(r,e)||n,_?r.style[e]=_:bo(r,e)),u=[t,n],lI(u),t=u[0],n=u[1],A=t.match($l)||[],I=n.match($l)||[],I.length){for(;d=$l.exec(n);)E=d[0],v=n.substring(l,d.index),g?g=(g+1)%5:(v.substr(-5)==="rgba("||v.substr(-5)==="hsla(")&&(g=1),E!==(_=A[h++]||"")&&(p=parseFloat(_)||0,x=_.substr((p+"").length),E.charAt(1)==="="&&(E=ec(p,E)+x),m=parseFloat(E),w=E.substr((m+"").length),l=$l.lastIndex-w.length,w||(w=w||Yn.units[e]||x,l===n.length&&(n+=w,o.e+=w)),x!==w&&(p=wa(r,e,_,w)||0),o._pt={_next:o._pt,p:v||h===1?v:",",s:p,c:m-p,m:g&&g<4||e==="zIndex"?Math.round:0});o.c=l<n.length?n.substring(l,n.length):""}else o.r=e==="display"&&n==="none"?MI:CI;return Rw.test(n)&&(o.e=0),this._pt=o,o},UI={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},I7=function(r){var e=r.split(" "),t=e[0],n=e[1]||"50%";return(t==="top"||t==="bottom"||n==="left"||n==="right")&&(r=t,t=n,n=r),e[0]=UI[t]||t,e[1]=UI[n]||n,e.join(" ")},C7=function(r,e){if(e.tween&&e.tween._time===e.tween._dur){var t=e.t,n=t.style,i=e.u,s=t._gsap,o,l,h;if(i==="all"||i===!0)n.cssText="",l=1;else for(i=i.split(","),h=i.length;--h>-1;)o=i[h],Ds[o]&&(l=1,o=o==="transformOrigin"?Tn:ir),bo(t,o);l&&(bo(t,ir),s&&(s.svg&&t.removeAttribute("transform"),Yu(t,1),s.uncache=1,SI(n)))}},wf={clearProps:function(r,e,t,n,i){if(i.data!=="isFromStart"){var s=r._pt=new Mn(r._pt,e,t,0,0,C7);return s.u=n,s.pr=-10,s.tween=i,r._props.push(t),1}}},Wu=[1,0,0,1,0,0],PI={},kI=function(r){return r==="matrix(1, 0, 0, 1, 0, 0)"||r==="none"||!r},QI=function(r){var e=ss(r,ir);return kI(e)?Wu:e.substr(7).match(bw).map(yr)},Ym=function(r,e){var t=r._gsap||xo(r),n=r.style,i=QI(r),s,o,l,h;return t.svg&&r.getAttribute("transform")?(l=r.transform.baseVal.consolidate().matrix,i=[l.a,l.b,l.c,l.d,l.e,l.f],i.join(",")==="1,0,0,1,0,0"?Wu:i):(i===Wu&&!r.offsetParent&&r!==sc&&!t.svg&&(l=n.display,n.display="block",s=r.parentNode,(!s||!r.offsetParent)&&(h=1,o=r.nextElementSibling,sc.appendChild(r)),i=QI(r),l?n.display=l:bo(r,"display"),h&&(o?s.insertBefore(r,o):s?s.appendChild(r):sc.removeChild(r))),e&&i.length>6?[i[0],i[1],i[4],i[5],i[12],i[13]]:i)},qm=function(r,e,t,n,i,s){var o=r._gsap,l=i||Ym(r,!0),h=o.xOrigin||0,u=o.yOrigin||0,d=o.xOffset||0,A=o.yOffset||0,p=l[0],g=l[1],_=l[2],E=l[3],m=l[4],v=l[5],w=e.split(" "),x=parseFloat(w[0])||0,I=parseFloat(w[1])||0,R,S,T,D;t?l!==Wu&&(S=p*E-g*_)&&(T=x*(E/S)+I*(-_/S)+(_*v-E*m)/S,D=x*(-g/S)+I*(p/S)-(p*v-g*m)/S,x=T,I=D):(R=DI(r),x=R.x+(~w[0].indexOf("%")?x/100*R.width:x),I=R.y+(~(w[1]||w[0]).indexOf("%")?I/100*R.height:I)),n||n!==!1&&o.smooth?(m=x-h,v=I-u,o.xOffset=d+(m*p+v*_)-m,o.yOffset=A+(m*g+v*E)-v):o.xOffset=o.yOffset=0,o.xOrigin=x,o.yOrigin=I,o.smooth=!!n,o.origin=e,o.originIsAbsolute=!!t,r.style[Tn]="0px 0px",s&&(xa(s,o,"xOrigin",h,x),xa(s,o,"yOrigin",u,I),xa(s,o,"xOffset",d,o.xOffset),xa(s,o,"yOffset",A,o.yOffset)),r.setAttribute("data-svg-origin",x+" "+I)},Yu=function(r,e){var t=r._gsap||new dI(r);if("x"in t&&!e&&!t.uncache)return t;var n=r.style,i=t.scaleX<0,s="px",o="deg",l=getComputedStyle(r),h=ss(r,Tn)||"0",u,d,A,p,g,_,E,m,v,w,x,I,R,S,T,D,b,M,L,P,N,W,X,K,te,V,ee,Q,z,Z,re,j;return u=d=A=_=E=m=v=w=x=0,p=g=1,t.svg=!!(r.getCTM&&LI(r)),l.translate&&((l.translate!=="none"||l.scale!=="none"||l.rotate!=="none")&&(n[ir]=(l.translate!=="none"?"translate3d("+(l.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+(l.rotate!=="none"?"rotate("+l.rotate+") ":"")+(l.scale!=="none"?"scale("+l.scale.split(" ").join(",")+") ":"")+(l[ir]!=="none"?l[ir]:"")),n.scale=n.rotate=n.translate="none"),S=Ym(r,t.svg),t.svg&&(t.uncache?(te=r.getBBox(),h=t.xOrigin-te.x+"px "+(t.yOrigin-te.y)+"px",K=""):K=!e&&r.getAttribute("data-svg-origin"),qm(r,K||h,!!K||t.originIsAbsolute,t.smooth!==!1,S)),I=t.xOrigin||0,R=t.yOrigin||0,S!==Wu&&(M=S[0],L=S[1],P=S[2],N=S[3],u=W=S[4],d=X=S[5],S.length===6?(p=Math.sqrt(M*M+L*L),g=Math.sqrt(N*N+P*P),_=M||L?oc(L,M)*Bo:0,v=P||N?oc(P,N)*Bo+_:0,v&&(g*=Math.abs(Math.cos(v*ac))),t.svg&&(u-=I-(I*M+R*P),d-=R-(I*L+R*N))):(j=S[6],Z=S[7],ee=S[8],Q=S[9],z=S[10],re=S[11],u=S[12],d=S[13],A=S[14],T=oc(j,z),E=T*Bo,T&&(D=Math.cos(-T),b=Math.sin(-T),K=W*D+ee*b,te=X*D+Q*b,V=j*D+z*b,ee=W*-b+ee*D,Q=X*-b+Q*D,z=j*-b+z*D,re=Z*-b+re*D,W=K,X=te,j=V),T=oc(-P,z),m=T*Bo,T&&(D=Math.cos(-T),b=Math.sin(-T),K=M*D-ee*b,te=L*D-Q*b,V=P*D-z*b,re=N*b+re*D,M=K,L=te,P=V),T=oc(L,M),_=T*Bo,T&&(D=Math.cos(T),b=Math.sin(T),K=M*D+L*b,te=W*D+X*b,L=L*D-M*b,X=X*D-W*b,M=K,W=te),E&&Math.abs(E)+Math.abs(_)>359.9&&(E=_=0,m=180-m),p=yr(Math.sqrt(M*M+L*L+P*P)),g=yr(Math.sqrt(X*X+j*j)),T=oc(W,X),v=Math.abs(T)>2e-4?T*Bo:0,x=re?1/(re<0?-re:re):0),t.svg&&(K=r.getAttribute("transform"),t.forceCSS=r.setAttribute("transform","")||!kI(ss(r,ir)),K&&r.setAttribute("transform",K))),Math.abs(v)>90&&Math.abs(v)<270&&(i?(p*=-1,v+=_<=0?180:-180,_+=_<=0?180:-180):(g*=-1,v+=v<=0?180:-180)),e=e||t.uncache,t.x=u-((t.xPercent=u&&(!e&&t.xPercent||(Math.round(r.offsetWidth/2)===Math.round(-u)?-50:0)))?r.offsetWidth*t.xPercent/100:0)+s,t.y=d-((t.yPercent=d&&(!e&&t.yPercent||(Math.round(r.offsetHeight/2)===Math.round(-d)?-50:0)))?r.offsetHeight*t.yPercent/100:0)+s,t.z=A+s,t.scaleX=yr(p),t.scaleY=yr(g),t.rotation=yr(_)+o,t.rotationX=yr(E)+o,t.rotationY=yr(m)+o,t.skewX=v+o,t.skewY=w+o,t.transformPerspective=x+s,(t.zOrigin=parseFloat(h.split(" ")[2])||!e&&t.zOrigin||0)&&(n[Tn]=If(h)),t.xOffset=t.yOffset=0,t.force3D=Yn.force3D,t.renderTransform=t.svg?S7:BI?OI:M7,t.uncache=0,t},If=function(r){return(r=r.split(" "))[0]+" "+r[1]},Xm=function(r,e,t){var n=rn(e);return yr(parseFloat(e)+parseFloat(wa(r,"x",t+"px",n)))+n},M7=function(r,e){e.z="0px",e.rotationY=e.rotationX="0deg",e.force3D=0,OI(r,e)},Ro="0deg",qu="0px",Do=") ",OI=function(r,e){var t=e||this,n=t.xPercent,i=t.yPercent,s=t.x,o=t.y,l=t.z,h=t.rotation,u=t.rotationY,d=t.rotationX,A=t.skewX,p=t.skewY,g=t.scaleX,_=t.scaleY,E=t.transformPerspective,m=t.force3D,v=t.target,w=t.zOrigin,x="",I=m==="auto"&&r&&r!==1||m===!0;if(w&&(d!==Ro||u!==Ro)){var R=parseFloat(u)*ac,S=Math.sin(R),T=Math.cos(R),D;R=parseFloat(d)*ac,D=Math.cos(R),s=Xm(v,s,S*D*-w),o=Xm(v,o,-Math.sin(R)*-w),l=Xm(v,l,T*D*-w+w)}E!==qu&&(x+="perspective("+E+Do),(n||i)&&(x+="translate("+n+"%, "+i+"%) "),(I||s!==qu||o!==qu||l!==qu)&&(x+=l!==qu||I?"translate3d("+s+", "+o+", "+l+") ":"translate("+s+", "+o+Do),h!==Ro&&(x+="rotate("+h+Do),u!==Ro&&(x+="rotateY("+u+Do),d!==Ro&&(x+="rotateX("+d+Do),(A!==Ro||p!==Ro)&&(x+="skew("+A+", "+p+Do),(g!==1||_!==1)&&(x+="scale("+g+", "+_+Do),v.style[ir]=x||"translate(0, 0)"},S7=function(r,e){var t=e||this,n=t.xPercent,i=t.yPercent,s=t.x,o=t.y,l=t.rotation,h=t.skewX,u=t.skewY,d=t.scaleX,A=t.scaleY,p=t.target,g=t.xOrigin,_=t.yOrigin,E=t.xOffset,m=t.yOffset,v=t.forceCSS,w=parseFloat(s),x=parseFloat(o),I,R,S,T,D;l=parseFloat(l),h=parseFloat(h),u=parseFloat(u),u&&(u=parseFloat(u),h+=u,l+=u),l||h?(l*=ac,h*=ac,I=Math.cos(l)*d,R=Math.sin(l)*d,S=Math.sin(l-h)*-A,T=Math.cos(l-h)*A,h&&(u*=ac,D=Math.tan(h-u),D=Math.sqrt(1+D*D),S*=D,T*=D,u&&(D=Math.tan(u),D=Math.sqrt(1+D*D),I*=D,R*=D)),I=yr(I),R=yr(R),S=yr(S),T=yr(T)):(I=d,T=A,R=S=0),(w&&!~(s+"").indexOf("px")||x&&!~(o+"").indexOf("px"))&&(w=wa(p,"x",s,"px"),x=wa(p,"y",o,"px")),(g||_||E||m)&&(w=yr(w+g-(g*I+_*S)+E),x=yr(x+_-(g*R+_*T)+m)),(n||i)&&(D=p.getBBox(),w=yr(w+n/100*D.width),x=yr(x+i/100*D.height)),D="matrix("+I+","+R+","+S+","+T+","+w+","+x+")",p.setAttribute("transform",D),v&&(p.style[ir]=D)},T7=function(r,e,t,n,i){var s=360,o=Gr(i),l=parseFloat(i)*(o&&~i.indexOf("rad")?Bo:1),h=l-n,u=n+h+"deg",d,A;return o&&(d=i.split("_")[1],d==="short"&&(h%=s,h!==h%(s/2)&&(h+=h<0?s:-s)),d==="cw"&&h<0?h=(h+s*II)%s-~~(h/s)*s:d==="ccw"&&h>0&&(h=(h-s*II)%s-~~(h/s)*s)),r._pt=A=new Mn(r._pt,e,t,n,h,h7),A.e=u,A.u="deg",r._props.push(t),A},FI=function(r,e){for(var t in e)r[t]=e[t];return r},B7=function(r,e,t){var n=FI({},t._gsap),i="perspective,force3D,transformOrigin,svgOrigin",s=t.style,o,l,h,u,d,A,p,g;n.svg?(h=t.getAttribute("transform"),t.setAttribute("transform",""),s[ir]=e,o=Yu(t,1),bo(t,ir),t.setAttribute("transform",h)):(h=getComputedStyle(t)[ir],s[ir]=e,o=Yu(t,1),s[ir]=h);for(l in Ds)h=n[l],u=o[l],h!==u&&i.indexOf(l)<0&&(p=rn(h),g=rn(u),d=p!==g?wa(t,l,h,g):parseFloat(h),A=parseFloat(u),r._pt=new Mn(r._pt,o,l,d,A-d,Gm),r._pt.u=g||0,r._props.push(l));FI(o,n)};Cn("padding,margin,Width,Radius",function(r,e){var t="Top",n="Right",i="Bottom",s="Left",o=(e<3?[t,n,i,s]:[t+s,t+n,i+n,i+s]).map(function(l){return e<2?r+l:"border"+l+r});wf[e>1?"border"+r:r]=function(l,h,u,d,A){var p,g;if(arguments.length<4)return p=o.map(function(_){return Ls(l,_,u)}),g=p.join(" "),g.split(p[0]).length===5?p[0]:g;p=(d+"").split(" "),g={},o.forEach(function(_,E){return g[_]=p[E]=p[E]||p[(E-1)/2|0]}),l.init(h,g,A)}});var zI={name:"css",register:jm,targetTest:function(r){return r.style&&r.nodeType},init:function(r,e,t,n,i){var s=this._props,o=r.style,l=t.vars.startAt,h,u,d,A,p,g,_,E,m,v,w,x,I,R,S,T;Fm||jm(),this.styles=this.styles||TI(r),T=this.styles.props,this.tween=t;for(_ in e)if(_!=="autoRound"&&(u=e[_],!(Xn[_]&&fI(_,e,t,n,r,i)))){if(p=typeof u,g=wf[_],p==="function"&&(u=u.call(t,n,r,i),p=typeof u),p==="string"&&~u.indexOf("random(")&&(u=Fu(u)),g)g(this,r,_,u,t)&&(S=1);else if(_.substr(0,2)==="--")h=(getComputedStyle(r).getPropertyValue(_)+"").trim(),u+="",_a.lastIndex=0,_a.test(h)||(E=rn(h),m=rn(u)),m?E!==m&&(h=wa(r,_,h,m)+m):E&&(u+=E),this.add(o,"setProperty",h,u,n,i,0,0,_),s.push(_),T.push(_,0,o[_]);else if(p!=="undefined"){if(l&&_ in l?(h=typeof l[_]=="function"?l[_].call(t,n,r,i):l[_],Gr(h)&&~h.indexOf("random(")&&(h=Fu(h)),rn(h+"")||h==="auto"||(h+=Yn.units[_]||rn(Ls(r,_))||""),(h+"").charAt(1)==="="&&(h=Ls(r,_))):h=Ls(r,_),A=parseFloat(h),v=p==="string"&&u.charAt(1)==="="&&u.substr(0,2),v&&(u=u.substr(2)),d=parseFloat(u),_ in is&&(_==="autoAlpha"&&(A===1&&Ls(r,"visibility")==="hidden"&&d&&(A=0),T.push("visibility",0,o.visibility),xa(this,o,"visibility",A?"inherit":"hidden",d?"inherit":"hidden",!d)),_!=="scale"&&_!=="transform"&&(_=is[_],~_.indexOf(",")&&(_=_.split(",")[0]))),w=_ in Ds,w){if(this.styles.save(_),x||(I=r._gsap,I.renderTransform&&!e.parseTransform||Yu(r,e.parseTransform),R=e.smoothOrigin!==!1&&I.smooth,x=this._pt=new Mn(this._pt,o,ir,0,1,I.renderTransform,I,0,-1),x.dep=1),_==="scale")this._pt=new Mn(this._pt,I,"scaleY",I.scaleY,(v?ec(I.scaleY,v+d):d)-I.scaleY||0,Gm),this._pt.u=0,s.push("scaleY",_),_+="X";else if(_==="transformOrigin"){T.push(Tn,0,o[Tn]),u=I7(u),I.svg?qm(r,u,0,R,0,this):(m=parseFloat(u.split(" ")[2])||0,m!==I.zOrigin&&xa(this,I,"zOrigin",I.zOrigin,m),xa(this,o,_,If(h),If(u)));continue}else if(_==="svgOrigin"){qm(r,u,1,R,0,this);continue}else if(_ in PI){T7(this,I,_,A,v?ec(A,v+u):u);continue}else if(_==="smoothOrigin"){xa(this,I,"smooth",I.smooth,u);continue}else if(_==="force3D"){I[_]=u;continue}else if(_==="transform"){B7(this,u,r);continue}}else _ in o||(_=lc(_)||_);if(w||(d||d===0)&&(A||A===0)&&!u7.test(u)&&_ in o)E=(h+"").substr((A+"").length),d||(d=0),m=rn(u)||(_ in Yn.units?Yn.units[_]:E),E!==m&&(A=wa(r,_,h,m)),this._pt=new Mn(this._pt,w?I:o,_,A,(v?ec(A,v+d):d)-A,!w&&(m==="px"||_==="zIndex")&&e.autoRound!==!1?f7:Gm),this._pt.u=m||0,E!==m&&m!=="%"&&(this._pt.b=h,this._pt.r=d7);else if(_ in o)w7.call(this,r,_,h,v?v+u:u);else if(_ in r)this.add(r,_,h||r[_],v?v+u:u,n,i);else if(_!=="parseTransform"){mm(_,u);continue}w||(_ in o?T.push(_,0,o[_]):T.push(_,1,h||r[_])),s.push(_)}}S&&_I(this)},render:function(r,e){if(e.tween._time||!zm())for(var t=e._pt;t;)t.r(r,t.d),t=t._next;else e.styles.revert()},get:Ls,aliases:is,getSetter:function(r,e,t){var n=is[e];return n&&n.indexOf(",")<0&&(e=n),e in Ds&&e!==Tn&&(r._gsap.x||Ls(r,"x"))?t&&wI===t?e==="scale"?m7:g7:(wI=t||{})&&(e==="scale"?v7:_7):r.style&&!hm(r.style[e])?p7:~e.indexOf("-")?A7:Um(r,e)},core:{_removeProperty:bo,_getMatrix:Ym}};Sn.utils.checkPrefix=lc,Sn.core.getStyleSaver=TI,function(r,e,t,n){var i=Cn(r+","+e+","+t,function(s){Ds[s]=1});Cn(e,function(s){Yn.units[s]="deg",PI[s]=1}),is[i[13]]=r+","+e,Cn(n,function(s){var o=s.split(":");is[o[1]]=i[o[0]]})}("x,y,z,scale,scaleX,scaleY,xPercent,yPercent","rotation,rotationX,rotationY,skewX,skewY","transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective","0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY"),Cn("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(r){Yn.units[r]="px"}),Sn.registerPlugin(zI);var Km=Sn.registerPlugin(zI)||Sn;Km.core.Tween;const di=/iPhone|iPod|Android/i.test(navigator.userAgent),HI=new JN;let cc=null;const b7={Front:{value:di?new G(4.7,1.9,7.5):new G(1.8,.65,2.5)},Back:{value:di?new G(0,1.9,-7.5):new G(0,.65,-4)},Left:{value:di?new G(-9.14,1.17,3):new G(-3.5,.4,1)},Right:{value:di?new G(9.14,1.17,3):new G(3.5,.4,1)},Top:{value:di?new G(0,9.23,3):new G(0,3.5,1)},Bottom:{value:di?new G(.6,-9.23,3):new G(.1,-3.5,1)},FlatFront:{value:new G(0,0,3)},FlatLeft:{value:new G(-2,0,0)},FlatRight:{value:new G(2,0,0)},FlatTop:{value:new G(0,.75,1)}};let Bn,Cf=!1,Jm=!1,Zm,hr,Lo=!1,$m=!1,e0,Xu;const R7=new Ni({metalness:0,roughness:1,ior:1,opacity:1,clearcoat:0,color:new Ve(16777215),transparent:!1,shadowSide:Qr,depthWrite:!0,map:null,alphaMap:null,aoMap:null,roughnessMap:null,metalnessMap:null,normalMap:null});let No,Ia=[],t0,r0,n0=!1,i0=!1;const s0=[0,.4,.7,1],GI=[.85,.62,.3,0],VI=[new Ve(16777215),new Ve(16777215),new Ve(16777215),new Ve(16777215)],dr={resolution:{value:new Ue(0,0)},color:{value:new Ve(16777215)},opacity:{value:1},metalness:{value:1},maxX:{value:.1},minX:{value:-.1},minY:{value:-.1},maxY:{value:.1},uAlpha:{value:!1},gradientColors:{value:VI},positions:{value:s0},opacities:{value:GI}};let Mf={bloomOn:new Ve(0),bloomOff:new Ve(16777215)};const jI=1;let Ku=null;const WI=new vd;WI.set(jI);const uc={threshold:.2,strength:.7,radius:.5,exposure:1};var YI;const qI=(YI=document.getElementById("vertexshader"))==null?void 0:YI.textContent;var XI;const KI=(XI=document.getElementById("fragmentshader"))==null?void 0:XI.textContent,D7=new Ki({color:"black"}),Sf={};function L7(r){r.isMesh&&WI.test(r.layers)===!1&&(Sf[r.uuid]=r.material,r.material=D7)}function N7(r){Sf[r.uuid]&&(r.material=Sf[r.uuid],delete Sf[r.uuid])}class U7{constructor(){xt(this,"scene"),xt(this,"camera"),xt(this,"renderer"),xt(this,"canvas"),xt(this,"canvasSize"),xt(this,"isInitialised"),xt(this,"orgId"),xt(this,"textureLoader"),xt(this,"raycaster"),xt(this,"isTouchDown"),xt(this,"touchDownTime"),xt(this,"touchDownTimeout"),xt(this,"onPointerDown",e=>{e.target.localName==="canvas"&&(this.isTouchDown=!0,this.touchDownTime=Date.now())}),xt(this,"onPointerMove",e=>{e.target.localName==="canvas"&&this.isTouchDown&&(this.isTouchDown=!1,this.touchDownTime=0)}),xt(this,"onPointerUp",e=>{e.target.localName==="canvas"&&this.isTouchDown&&(this.isTouchDown=!1,Date.now()-this.touchDownTime>this.touchDownTimeout?(this.isTouchDown=!1,console.log("Long touch or rogue touch canceled")):this.handlePointerOnValidInput(e))}),xt(this,"handlePointerOnValidInput",e=>{const{isValid:t,x:n,y:i}=this.checkInputValidity(e);if(!t)return;const s=new Ue;if(s.x=n/this.canvas.clientWidth*2-1,s.y=-(i/this.canvas.clientHeight)*2+1,this.raycaster.setFromCamera(s,this.camera),!this.isTouchDown||this.isTouchDown&&Date.now()-this.touchDownTime<=this.touchDownTimeout){const o=this.raycaster.intersectObjects(this.scene.children,!0);for(const l of o)if(l.object.name.toLowerCase().includes("gemstone")){const h=new CustomEvent("gemZoneDetectedOnTouch",{detail:l.object.name.replace("Gemstone_Zone","")});document.dispatchEvent(h);break}}}),xt(this,"checkInputValidity",e=>{let t,n;return t=e.clientX,n=e.clientY-Math.round(window.innerHeight*(di?.1:.08)),n<0||n>this.canvas.clientHeight?{isValid:!1,x:0,y:0}:{isValid:!0,x:t,y:n}}),this.scene=new f8,this.canvasSize=new Ue,this.isInitialised=!1,this.textureLoader=new fx,this.raycaster=new rN,this.isTouchDown=!1,this.touchDownTime=0,this.touchDownTimeout=500,this.orgId=""}async intialise(e){Xu=e,this.canvas=document.querySelector("canvas.sprie-config-webgl");const t=this.canvas.clientWidth,n=this.canvas.clientHeight;this.canvasSize.set(t,n),this.camera=new dn(12,t/n,.1,1e4),this.camera.lookAt(0,0,0),this.scene.background=e?Mf.bloomOff.multiplyScalar(3):Mf.bloomOff,this.renderer=new d8({canvas:this.canvas,alpha:!0,premultipliedAlpha:!0,powerPreference:di?"default":"high-performance"}),this.renderer.toneMapping=vA,this.renderer.setClearColor(16777215),this.renderer.outputColorSpace=Fr,this.resizeRenderer(),HI.load("https://sprie-jarvis-public.s3.eu-west-2.amazonaws.com/environment_desaturated.hdr",i=>{i.mapping=ru,i.colorSpace=cr,this.scene.environment=i}),HI.load("https://sprie-jarvis-public.s3.eu-west-2.amazonaws.com/gems1.hdr",i=>{i.mapping=ru,i.colorSpace=cr,No=i}),document.addEventListener("mousedown",this.onPointerDown),document.addEventListener("mousemove",this.onPointerMove),document.addEventListener("mouseup",this.onPointerUp),this.isInitialised=!0}resizeRenderer(){var e;const t=Math.min(window.devicePixelRatio,2),n=Math.floor(this.canvas.clientWidth*t),i=Math.floor(this.canvas.clientHeight*t),s=this.canvas.clientWidth!==n||this.canvas.clientHeight!==i;return s&&((e=this.renderer)==null||e.setSize(n,i,!1)),s}cleanUp(){document.removeEventListener("mousedown",this.onPointerDown),document.removeEventListener("mousemove",this.onPointerMove),document.removeEventListener("mouseup",this.onPointerUp),this.renderer&&this.renderer.dispose()}loadModelInsideScene(e){this.scene.traverse(t=>{t.name=="Scene"&&(this.scene.remove(t),t.traverse(n=>{n instanceof Xr&&(n.geometry.dispose(),n.material.dispose())}))}),this.scene.add(e)}setLighting(e){const t=new O8(16777215,16777215,2);t.color.setHSL(.6,1,.6),t.groundColor.setHSL(.095,1,.75),t.position.set(0,50,0),e.add(t);const n=new mx(16777215,1.5);n.color.setHSL(.1,1,.95),n.position.set(-1,1.75,1),n.position.multiplyScalar(30),e.add(n)}setupShadows(){const e={shadow:{blur:.6,darkness:1,opacity:.6},plane:{color:"#ffffff",opacity:1},showWireframe:!1},t=new oa;t.position.y=-.315,this.scene.add(t);const n=new cn(256,256);n.texture.generateMipmaps=!1;const i=new cn(256,256);i.texture.generateMipmaps=!1;const s=new vu(2.5,2.5).rotateX(Math.PI/2),o=new Ki({map:n.texture,opacity:e.shadow.opacity,transparent:!0,depthWrite:!1}),l=new Xr(s,o);l.renderOrder=1,t.add(l),l.scale.y=-1;const h=new Xr(s);h.visible=!1,t.add(h);const u=new _u(-2.5/2,2.5/2,2.5/2,-2.5/2,0,.4);u.rotation.x=Math.PI/2,t.add(u);const d=new V2;d.userData.darkness={value:e.shadow.darkness},d.onBeforeCompile=E=>{const m=E;m.uniforms.darkness=d.userData.darkness,m.fragmentShader=`
4501
+ */var xI,Ea,sc,Om,To,wI,Fm,l7=function(){return typeof window<"u"},Ds={},Bo=180/Math.PI,ac=Math.PI/180,oc=Math.atan2,II=1e8,zm=/([A-Z])/g,c7=/(left|right|width|margin|padding|x)/i,u7=/[\s,\(]\S/,is={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},Hm=function(r,e){return e.set(e.t,e.p,Math.round((e.s+e.c*r)*1e4)/1e4+e.u,e)},h7=function(r,e){return e.set(e.t,e.p,r===1?e.e:Math.round((e.s+e.c*r)*1e4)/1e4+e.u,e)},d7=function(r,e){return e.set(e.t,e.p,r?Math.round((e.s+e.c*r)*1e4)/1e4+e.u:e.b,e)},f7=function(r,e){var t=e.s+e.c*r;e.set(e.t,e.p,~~(t+(t<0?-.5:.5))+e.u,e)},CI=function(r,e){return e.set(e.t,e.p,r?e.e:e.b,e)},MI=function(r,e){return e.set(e.t,e.p,r!==1?e.b:e.e,e)},p7=function(r,e,t){return r.style[e]=t},A7=function(r,e,t){return r.style.setProperty(e,t)},g7=function(r,e,t){return r._gsap[e]=t},m7=function(r,e,t){return r._gsap.scaleX=r._gsap.scaleY=t},v7=function(r,e,t,n,i){var s=r._gsap;s.scaleX=s.scaleY=t,s.renderTransform(i,s)},_7=function(r,e,t,n,i){var s=r._gsap;s[e]=t,s.renderTransform(i,s)},ir="transform",Tn=ir+"Origin",y7=function r(e,t){var n=this,i=this.target,s=i.style,o=i._gsap;if(e in Ds&&s){if(this.tfm=this.tfm||{},e!=="transform")e=is[e]||e,~e.indexOf(",")?e.split(",").forEach(function(l){return n.tfm[l]=Ls(i,l)}):this.tfm[e]=o.x?o[e]:Ls(i,e),e===Tn&&(this.tfm.zOrigin=o.zOrigin);else return is.transform.split(",").forEach(function(l){return r.call(n,l,t)});if(this.props.indexOf(ir)>=0)return;o.svg&&(this.svgo=i.getAttribute("data-svg-origin"),this.props.push(Tn,t,"")),e=ir}(s||t)&&this.props.push(e,t,s[e])},SI=function(r){r.translate&&(r.removeProperty("translate"),r.removeProperty("scale"),r.removeProperty("rotate"))},E7=function(){var r=this.props,e=this.target,t=e.style,n=e._gsap,i,s;for(i=0;i<r.length;i+=3)r[i+1]?e[r[i]]=r[i+2]:r[i+2]?t[r[i]]=r[i+2]:t.removeProperty(r[i].substr(0,2)==="--"?r[i]:r[i].replace(zm,"-$1").toLowerCase());if(this.tfm){for(s in this.tfm)n[s]=this.tfm[s];n.svg&&(n.renderTransform(),e.setAttribute("data-svg-origin",this.svgo||"")),i=Fm(),(!i||!i.isStart)&&!t[ir]&&(SI(t),n.zOrigin&&t[Tn]&&(t[Tn]+=" "+n.zOrigin+"px",n.zOrigin=0,n.renderTransform()),n.uncache=1)}},TI=function(r,e){var t={target:r,props:[],revert:E7,save:y7};return r._gsap||Sn.core.getCache(r),e&&e.split(",").forEach(function(n){return t.save(n)}),t},BI,Gm=function(r,e){var t=Ea.createElementNS?Ea.createElementNS((e||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),r):Ea.createElement(r);return t&&t.style?t:Ea.createElement(r)},ss=function r(e,t,n){var i=getComputedStyle(e);return i[t]||i.getPropertyValue(t.replace(zm,"-$1").toLowerCase())||i.getPropertyValue(t)||!n&&r(e,lc(t)||t,1)||""},bI="O,Moz,ms,Ms,Webkit".split(","),lc=function(r,e,t){var n=e||To,i=n.style,s=5;if(r in i&&!t)return r;for(r=r.charAt(0).toUpperCase()+r.substr(1);s--&&!(bI[s]+r in i););return s<0?null:(s===3?"ms":s>=0?bI[s]:"")+r},Vm=function(){l7()&&window.document&&(xI=window,Ea=xI.document,sc=Ea.documentElement,To=Gm("div")||{style:{}},Gm("div"),ir=lc(ir),Tn=ir+"Origin",To.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",BI=!!lc("perspective"),Fm=Sn.core.reverting,Om=1)},jm=function r(e){var t=Gm("svg",this.ownerSVGElement&&this.ownerSVGElement.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),n=this.parentNode,i=this.nextSibling,s=this.style.cssText,o;if(sc.appendChild(t),t.appendChild(this),this.style.display="block",e)try{o=this.getBBox(),this._gsapBBox=this.getBBox,this.getBBox=r}catch{}else this._gsapBBox&&(o=this._gsapBBox());return n&&(i?n.insertBefore(this,i):n.appendChild(this)),sc.removeChild(t),this.style.cssText=s,o},RI=function(r,e){for(var t=e.length;t--;)if(r.hasAttribute(e[t]))return r.getAttribute(e[t])},DI=function(r){var e;try{e=r.getBBox()}catch{e=jm.call(r,!0)}return e&&(e.width||e.height)||r.getBBox===jm||(e=jm.call(r,!0)),e&&!e.width&&!e.x&&!e.y?{x:+RI(r,["x","cx","x1"])||0,y:+RI(r,["y","cy","y1"])||0,width:0,height:0}:e},LI=function(r){return!!(r.getCTM&&(!r.parentNode||r.ownerSVGElement)&&DI(r))},bo=function(r,e){if(e){var t=r.style,n;e in Ds&&e!==Tn&&(e=ir),t.removeProperty?(n=e.substr(0,2),(n==="ms"||e.substr(0,6)==="webkit")&&(e="-"+e),t.removeProperty(n==="--"?e:e.replace(zm,"-$1").toLowerCase())):t.removeAttribute(e)}},xa=function(r,e,t,n,i,s){var o=new Mn(r._pt,e,t,0,1,s?MI:CI);return r._pt=o,o.b=n,o.e=i,r._props.push(t),o},NI={deg:1,rad:1,turn:1},x7={grid:1,flex:1},wa=function r(e,t,n,i){var s=parseFloat(n)||0,o=(n+"").trim().substr((s+"").length)||"px",l=To.style,h=c7.test(t),u=e.tagName.toLowerCase()==="svg",d=(u?"client":"offset")+(h?"Width":"Height"),A=100,p=i==="px",g=i==="%",_,E,m,v;if(i===o||!s||NI[i]||NI[o])return s;if(o!=="px"&&!p&&(s=r(e,t,n,"px")),v=e.getCTM&&LI(e),(g||o==="%")&&(Ds[t]||~t.indexOf("adius")))return _=v?e.getBBox()[h?"width":"height"]:e[d],yr(g?s/_*A:s/100*_);if(l[h?"width":"height"]=A+(p?o:i),E=~t.indexOf("adius")||i==="em"&&e.appendChild&&!u?e:e.parentNode,v&&(E=(e.ownerSVGElement||{}).parentNode),(!E||E===Ea||!E.appendChild)&&(E=Ea.body),m=E._gsap,m&&g&&m.width&&h&&m.time===Jn.time&&!m.uncache)return yr(s/m.width*A);if(g&&(t==="height"||t==="width")){var w=e.style[t];e.style[t]=A+i,_=e[d],w?e.style[t]=w:bo(e,t)}else(g||o==="%")&&!x7[ss(E,"display")]&&(l.position=ss(e,"position")),E===e&&(l.position="static"),E.appendChild(To),_=To[d],E.removeChild(To),l.position="absolute";return h&&g&&(m=xo(E),m.time=Jn.time,m.width=E[d]),yr(p?_*s/A:_&&s?A/_*s:0)},Ls=function(r,e,t,n){var i;return Om||Vm(),e in is&&e!=="transform"&&(e=is[e],~e.indexOf(",")&&(e=e.split(",")[0])),Ds[e]&&e!=="transform"?(i=Yu(r,n),i=e!=="transformOrigin"?i[e]:i.svg?i.origin:If(ss(r,Tn))+" "+i.zOrigin+"px"):(i=r.style[e],(!i||i==="auto"||n||~(i+"").indexOf("calc("))&&(i=wf[e]&&wf[e](r,e,t)||ss(r,e)||Qw(r,e)||(e==="opacity"?1:0))),t&&!~(i+"").trim().indexOf(" ")?wa(r,e,i,t)+t:i},w7=function(r,e,t,n){if(!t||t==="none"){var i=lc(e,r,1),s=i&&ss(r,i,1);s&&s!==t?(e=i,t=s):e==="borderColor"&&(t=ss(r,"borderTopColor"))}var o=new Mn(this._pt,r.style,e,0,1,vI),l=0,h=0,u,d,A,p,g,_,E,m,v,w,x,I;if(o.b=t,o.e=n,t+="",n+="",n==="auto"&&(_=r.style[e],r.style[e]=n,n=ss(r,e)||n,_?r.style[e]=_:bo(r,e)),u=[t,n],lI(u),t=u[0],n=u[1],A=t.match($l)||[],I=n.match($l)||[],I.length){for(;d=$l.exec(n);)E=d[0],v=n.substring(l,d.index),g?g=(g+1)%5:(v.substr(-5)==="rgba("||v.substr(-5)==="hsla(")&&(g=1),E!==(_=A[h++]||"")&&(p=parseFloat(_)||0,x=_.substr((p+"").length),E.charAt(1)==="="&&(E=ec(p,E)+x),m=parseFloat(E),w=E.substr((m+"").length),l=$l.lastIndex-w.length,w||(w=w||Yn.units[e]||x,l===n.length&&(n+=w,o.e+=w)),x!==w&&(p=wa(r,e,_,w)||0),o._pt={_next:o._pt,p:v||h===1?v:",",s:p,c:m-p,m:g&&g<4||e==="zIndex"?Math.round:0});o.c=l<n.length?n.substring(l,n.length):""}else o.r=e==="display"&&n==="none"?MI:CI;return Rw.test(n)&&(o.e=0),this._pt=o,o},UI={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},I7=function(r){var e=r.split(" "),t=e[0],n=e[1]||"50%";return(t==="top"||t==="bottom"||n==="left"||n==="right")&&(r=t,t=n,n=r),e[0]=UI[t]||t,e[1]=UI[n]||n,e.join(" ")},C7=function(r,e){if(e.tween&&e.tween._time===e.tween._dur){var t=e.t,n=t.style,i=e.u,s=t._gsap,o,l,h;if(i==="all"||i===!0)n.cssText="",l=1;else for(i=i.split(","),h=i.length;--h>-1;)o=i[h],Ds[o]&&(l=1,o=o==="transformOrigin"?Tn:ir),bo(t,o);l&&(bo(t,ir),s&&(s.svg&&t.removeAttribute("transform"),Yu(t,1),s.uncache=1,SI(n)))}},wf={clearProps:function(r,e,t,n,i){if(i.data!=="isFromStart"){var s=r._pt=new Mn(r._pt,e,t,0,0,C7);return s.u=n,s.pr=-10,s.tween=i,r._props.push(t),1}}},Wu=[1,0,0,1,0,0],PI={},kI=function(r){return r==="matrix(1, 0, 0, 1, 0, 0)"||r==="none"||!r},QI=function(r){var e=ss(r,ir);return kI(e)?Wu:e.substr(7).match(bw).map(yr)},Wm=function(r,e){var t=r._gsap||xo(r),n=r.style,i=QI(r),s,o,l,h;return t.svg&&r.getAttribute("transform")?(l=r.transform.baseVal.consolidate().matrix,i=[l.a,l.b,l.c,l.d,l.e,l.f],i.join(",")==="1,0,0,1,0,0"?Wu:i):(i===Wu&&!r.offsetParent&&r!==sc&&!t.svg&&(l=n.display,n.display="block",s=r.parentNode,(!s||!r.offsetParent)&&(h=1,o=r.nextElementSibling,sc.appendChild(r)),i=QI(r),l?n.display=l:bo(r,"display"),h&&(o?s.insertBefore(r,o):s?s.appendChild(r):sc.removeChild(r))),e&&i.length>6?[i[0],i[1],i[4],i[5],i[12],i[13]]:i)},Ym=function(r,e,t,n,i,s){var o=r._gsap,l=i||Wm(r,!0),h=o.xOrigin||0,u=o.yOrigin||0,d=o.xOffset||0,A=o.yOffset||0,p=l[0],g=l[1],_=l[2],E=l[3],m=l[4],v=l[5],w=e.split(" "),x=parseFloat(w[0])||0,I=parseFloat(w[1])||0,R,S,T,D;t?l!==Wu&&(S=p*E-g*_)&&(T=x*(E/S)+I*(-_/S)+(_*v-E*m)/S,D=x*(-g/S)+I*(p/S)-(p*v-g*m)/S,x=T,I=D):(R=DI(r),x=R.x+(~w[0].indexOf("%")?x/100*R.width:x),I=R.y+(~(w[1]||w[0]).indexOf("%")?I/100*R.height:I)),n||n!==!1&&o.smooth?(m=x-h,v=I-u,o.xOffset=d+(m*p+v*_)-m,o.yOffset=A+(m*g+v*E)-v):o.xOffset=o.yOffset=0,o.xOrigin=x,o.yOrigin=I,o.smooth=!!n,o.origin=e,o.originIsAbsolute=!!t,r.style[Tn]="0px 0px",s&&(xa(s,o,"xOrigin",h,x),xa(s,o,"yOrigin",u,I),xa(s,o,"xOffset",d,o.xOffset),xa(s,o,"yOffset",A,o.yOffset)),r.setAttribute("data-svg-origin",x+" "+I)},Yu=function(r,e){var t=r._gsap||new dI(r);if("x"in t&&!e&&!t.uncache)return t;var n=r.style,i=t.scaleX<0,s="px",o="deg",l=getComputedStyle(r),h=ss(r,Tn)||"0",u,d,A,p,g,_,E,m,v,w,x,I,R,S,T,D,b,M,L,P,N,W,X,K,te,V,ee,Q,z,Z,re,j;return u=d=A=_=E=m=v=w=x=0,p=g=1,t.svg=!!(r.getCTM&&LI(r)),l.translate&&((l.translate!=="none"||l.scale!=="none"||l.rotate!=="none")&&(n[ir]=(l.translate!=="none"?"translate3d("+(l.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+(l.rotate!=="none"?"rotate("+l.rotate+") ":"")+(l.scale!=="none"?"scale("+l.scale.split(" ").join(",")+") ":"")+(l[ir]!=="none"?l[ir]:"")),n.scale=n.rotate=n.translate="none"),S=Wm(r,t.svg),t.svg&&(t.uncache?(te=r.getBBox(),h=t.xOrigin-te.x+"px "+(t.yOrigin-te.y)+"px",K=""):K=!e&&r.getAttribute("data-svg-origin"),Ym(r,K||h,!!K||t.originIsAbsolute,t.smooth!==!1,S)),I=t.xOrigin||0,R=t.yOrigin||0,S!==Wu&&(M=S[0],L=S[1],P=S[2],N=S[3],u=W=S[4],d=X=S[5],S.length===6?(p=Math.sqrt(M*M+L*L),g=Math.sqrt(N*N+P*P),_=M||L?oc(L,M)*Bo:0,v=P||N?oc(P,N)*Bo+_:0,v&&(g*=Math.abs(Math.cos(v*ac))),t.svg&&(u-=I-(I*M+R*P),d-=R-(I*L+R*N))):(j=S[6],Z=S[7],ee=S[8],Q=S[9],z=S[10],re=S[11],u=S[12],d=S[13],A=S[14],T=oc(j,z),E=T*Bo,T&&(D=Math.cos(-T),b=Math.sin(-T),K=W*D+ee*b,te=X*D+Q*b,V=j*D+z*b,ee=W*-b+ee*D,Q=X*-b+Q*D,z=j*-b+z*D,re=Z*-b+re*D,W=K,X=te,j=V),T=oc(-P,z),m=T*Bo,T&&(D=Math.cos(-T),b=Math.sin(-T),K=M*D-ee*b,te=L*D-Q*b,V=P*D-z*b,re=N*b+re*D,M=K,L=te,P=V),T=oc(L,M),_=T*Bo,T&&(D=Math.cos(T),b=Math.sin(T),K=M*D+L*b,te=W*D+X*b,L=L*D-M*b,X=X*D-W*b,M=K,W=te),E&&Math.abs(E)+Math.abs(_)>359.9&&(E=_=0,m=180-m),p=yr(Math.sqrt(M*M+L*L+P*P)),g=yr(Math.sqrt(X*X+j*j)),T=oc(W,X),v=Math.abs(T)>2e-4?T*Bo:0,x=re?1/(re<0?-re:re):0),t.svg&&(K=r.getAttribute("transform"),t.forceCSS=r.setAttribute("transform","")||!kI(ss(r,ir)),K&&r.setAttribute("transform",K))),Math.abs(v)>90&&Math.abs(v)<270&&(i?(p*=-1,v+=_<=0?180:-180,_+=_<=0?180:-180):(g*=-1,v+=v<=0?180:-180)),e=e||t.uncache,t.x=u-((t.xPercent=u&&(!e&&t.xPercent||(Math.round(r.offsetWidth/2)===Math.round(-u)?-50:0)))?r.offsetWidth*t.xPercent/100:0)+s,t.y=d-((t.yPercent=d&&(!e&&t.yPercent||(Math.round(r.offsetHeight/2)===Math.round(-d)?-50:0)))?r.offsetHeight*t.yPercent/100:0)+s,t.z=A+s,t.scaleX=yr(p),t.scaleY=yr(g),t.rotation=yr(_)+o,t.rotationX=yr(E)+o,t.rotationY=yr(m)+o,t.skewX=v+o,t.skewY=w+o,t.transformPerspective=x+s,(t.zOrigin=parseFloat(h.split(" ")[2])||!e&&t.zOrigin||0)&&(n[Tn]=If(h)),t.xOffset=t.yOffset=0,t.force3D=Yn.force3D,t.renderTransform=t.svg?S7:BI?OI:M7,t.uncache=0,t},If=function(r){return(r=r.split(" "))[0]+" "+r[1]},qm=function(r,e,t){var n=rn(e);return yr(parseFloat(e)+parseFloat(wa(r,"x",t+"px",n)))+n},M7=function(r,e){e.z="0px",e.rotationY=e.rotationX="0deg",e.force3D=0,OI(r,e)},Ro="0deg",qu="0px",Do=") ",OI=function(r,e){var t=e||this,n=t.xPercent,i=t.yPercent,s=t.x,o=t.y,l=t.z,h=t.rotation,u=t.rotationY,d=t.rotationX,A=t.skewX,p=t.skewY,g=t.scaleX,_=t.scaleY,E=t.transformPerspective,m=t.force3D,v=t.target,w=t.zOrigin,x="",I=m==="auto"&&r&&r!==1||m===!0;if(w&&(d!==Ro||u!==Ro)){var R=parseFloat(u)*ac,S=Math.sin(R),T=Math.cos(R),D;R=parseFloat(d)*ac,D=Math.cos(R),s=qm(v,s,S*D*-w),o=qm(v,o,-Math.sin(R)*-w),l=qm(v,l,T*D*-w+w)}E!==qu&&(x+="perspective("+E+Do),(n||i)&&(x+="translate("+n+"%, "+i+"%) "),(I||s!==qu||o!==qu||l!==qu)&&(x+=l!==qu||I?"translate3d("+s+", "+o+", "+l+") ":"translate("+s+", "+o+Do),h!==Ro&&(x+="rotate("+h+Do),u!==Ro&&(x+="rotateY("+u+Do),d!==Ro&&(x+="rotateX("+d+Do),(A!==Ro||p!==Ro)&&(x+="skew("+A+", "+p+Do),(g!==1||_!==1)&&(x+="scale("+g+", "+_+Do),v.style[ir]=x||"translate(0, 0)"},S7=function(r,e){var t=e||this,n=t.xPercent,i=t.yPercent,s=t.x,o=t.y,l=t.rotation,h=t.skewX,u=t.skewY,d=t.scaleX,A=t.scaleY,p=t.target,g=t.xOrigin,_=t.yOrigin,E=t.xOffset,m=t.yOffset,v=t.forceCSS,w=parseFloat(s),x=parseFloat(o),I,R,S,T,D;l=parseFloat(l),h=parseFloat(h),u=parseFloat(u),u&&(u=parseFloat(u),h+=u,l+=u),l||h?(l*=ac,h*=ac,I=Math.cos(l)*d,R=Math.sin(l)*d,S=Math.sin(l-h)*-A,T=Math.cos(l-h)*A,h&&(u*=ac,D=Math.tan(h-u),D=Math.sqrt(1+D*D),S*=D,T*=D,u&&(D=Math.tan(u),D=Math.sqrt(1+D*D),I*=D,R*=D)),I=yr(I),R=yr(R),S=yr(S),T=yr(T)):(I=d,T=A,R=S=0),(w&&!~(s+"").indexOf("px")||x&&!~(o+"").indexOf("px"))&&(w=wa(p,"x",s,"px"),x=wa(p,"y",o,"px")),(g||_||E||m)&&(w=yr(w+g-(g*I+_*S)+E),x=yr(x+_-(g*R+_*T)+m)),(n||i)&&(D=p.getBBox(),w=yr(w+n/100*D.width),x=yr(x+i/100*D.height)),D="matrix("+I+","+R+","+S+","+T+","+w+","+x+")",p.setAttribute("transform",D),v&&(p.style[ir]=D)},T7=function(r,e,t,n,i){var s=360,o=Gr(i),l=parseFloat(i)*(o&&~i.indexOf("rad")?Bo:1),h=l-n,u=n+h+"deg",d,A;return o&&(d=i.split("_")[1],d==="short"&&(h%=s,h!==h%(s/2)&&(h+=h<0?s:-s)),d==="cw"&&h<0?h=(h+s*II)%s-~~(h/s)*s:d==="ccw"&&h>0&&(h=(h-s*II)%s-~~(h/s)*s)),r._pt=A=new Mn(r._pt,e,t,n,h,h7),A.e=u,A.u="deg",r._props.push(t),A},FI=function(r,e){for(var t in e)r[t]=e[t];return r},B7=function(r,e,t){var n=FI({},t._gsap),i="perspective,force3D,transformOrigin,svgOrigin",s=t.style,o,l,h,u,d,A,p,g;n.svg?(h=t.getAttribute("transform"),t.setAttribute("transform",""),s[ir]=e,o=Yu(t,1),bo(t,ir),t.setAttribute("transform",h)):(h=getComputedStyle(t)[ir],s[ir]=e,o=Yu(t,1),s[ir]=h);for(l in Ds)h=n[l],u=o[l],h!==u&&i.indexOf(l)<0&&(p=rn(h),g=rn(u),d=p!==g?wa(t,l,h,g):parseFloat(h),A=parseFloat(u),r._pt=new Mn(r._pt,o,l,d,A-d,Hm),r._pt.u=g||0,r._props.push(l));FI(o,n)};Cn("padding,margin,Width,Radius",function(r,e){var t="Top",n="Right",i="Bottom",s="Left",o=(e<3?[t,n,i,s]:[t+s,t+n,i+n,i+s]).map(function(l){return e<2?r+l:"border"+l+r});wf[e>1?"border"+r:r]=function(l,h,u,d,A){var p,g;if(arguments.length<4)return p=o.map(function(_){return Ls(l,_,u)}),g=p.join(" "),g.split(p[0]).length===5?p[0]:g;p=(d+"").split(" "),g={},o.forEach(function(_,E){return g[_]=p[E]=p[E]||p[(E-1)/2|0]}),l.init(h,g,A)}});var zI={name:"css",register:Vm,targetTest:function(r){return r.style&&r.nodeType},init:function(r,e,t,n,i){var s=this._props,o=r.style,l=t.vars.startAt,h,u,d,A,p,g,_,E,m,v,w,x,I,R,S,T;Om||Vm(),this.styles=this.styles||TI(r),T=this.styles.props,this.tween=t;for(_ in e)if(_!=="autoRound"&&(u=e[_],!(Xn[_]&&fI(_,e,t,n,r,i)))){if(p=typeof u,g=wf[_],p==="function"&&(u=u.call(t,n,r,i),p=typeof u),p==="string"&&~u.indexOf("random(")&&(u=Fu(u)),g)g(this,r,_,u,t)&&(S=1);else if(_.substr(0,2)==="--")h=(getComputedStyle(r).getPropertyValue(_)+"").trim(),u+="",_a.lastIndex=0,_a.test(h)||(E=rn(h),m=rn(u)),m?E!==m&&(h=wa(r,_,h,m)+m):E&&(u+=E),this.add(o,"setProperty",h,u,n,i,0,0,_),s.push(_),T.push(_,0,o[_]);else if(p!=="undefined"){if(l&&_ in l?(h=typeof l[_]=="function"?l[_].call(t,n,r,i):l[_],Gr(h)&&~h.indexOf("random(")&&(h=Fu(h)),rn(h+"")||h==="auto"||(h+=Yn.units[_]||rn(Ls(r,_))||""),(h+"").charAt(1)==="="&&(h=Ls(r,_))):h=Ls(r,_),A=parseFloat(h),v=p==="string"&&u.charAt(1)==="="&&u.substr(0,2),v&&(u=u.substr(2)),d=parseFloat(u),_ in is&&(_==="autoAlpha"&&(A===1&&Ls(r,"visibility")==="hidden"&&d&&(A=0),T.push("visibility",0,o.visibility),xa(this,o,"visibility",A?"inherit":"hidden",d?"inherit":"hidden",!d)),_!=="scale"&&_!=="transform"&&(_=is[_],~_.indexOf(",")&&(_=_.split(",")[0]))),w=_ in Ds,w){if(this.styles.save(_),x||(I=r._gsap,I.renderTransform&&!e.parseTransform||Yu(r,e.parseTransform),R=e.smoothOrigin!==!1&&I.smooth,x=this._pt=new Mn(this._pt,o,ir,0,1,I.renderTransform,I,0,-1),x.dep=1),_==="scale")this._pt=new Mn(this._pt,I,"scaleY",I.scaleY,(v?ec(I.scaleY,v+d):d)-I.scaleY||0,Hm),this._pt.u=0,s.push("scaleY",_),_+="X";else if(_==="transformOrigin"){T.push(Tn,0,o[Tn]),u=I7(u),I.svg?Ym(r,u,0,R,0,this):(m=parseFloat(u.split(" ")[2])||0,m!==I.zOrigin&&xa(this,I,"zOrigin",I.zOrigin,m),xa(this,o,_,If(h),If(u)));continue}else if(_==="svgOrigin"){Ym(r,u,1,R,0,this);continue}else if(_ in PI){T7(this,I,_,A,v?ec(A,v+u):u);continue}else if(_==="smoothOrigin"){xa(this,I,"smooth",I.smooth,u);continue}else if(_==="force3D"){I[_]=u;continue}else if(_==="transform"){B7(this,u,r);continue}}else _ in o||(_=lc(_)||_);if(w||(d||d===0)&&(A||A===0)&&!u7.test(u)&&_ in o)E=(h+"").substr((A+"").length),d||(d=0),m=rn(u)||(_ in Yn.units?Yn.units[_]:E),E!==m&&(A=wa(r,_,h,m)),this._pt=new Mn(this._pt,w?I:o,_,A,(v?ec(A,v+d):d)-A,!w&&(m==="px"||_==="zIndex")&&e.autoRound!==!1?f7:Hm),this._pt.u=m||0,E!==m&&m!=="%"&&(this._pt.b=h,this._pt.r=d7);else if(_ in o)w7.call(this,r,_,h,v?v+u:u);else if(_ in r)this.add(r,_,h||r[_],v?v+u:u,n,i);else if(_!=="parseTransform"){gm(_,u);continue}w||(_ in o?T.push(_,0,o[_]):T.push(_,1,h||r[_])),s.push(_)}}S&&_I(this)},render:function(r,e){if(e.tween._time||!Fm())for(var t=e._pt;t;)t.r(r,t.d),t=t._next;else e.styles.revert()},get:Ls,aliases:is,getSetter:function(r,e,t){var n=is[e];return n&&n.indexOf(",")<0&&(e=n),e in Ds&&e!==Tn&&(r._gsap.x||Ls(r,"x"))?t&&wI===t?e==="scale"?m7:g7:(wI=t||{})&&(e==="scale"?v7:_7):r.style&&!um(r.style[e])?p7:~e.indexOf("-")?A7:Nm(r,e)},core:{_removeProperty:bo,_getMatrix:Wm}};Sn.utils.checkPrefix=lc,Sn.core.getStyleSaver=TI,function(r,e,t,n){var i=Cn(r+","+e+","+t,function(s){Ds[s]=1});Cn(e,function(s){Yn.units[s]="deg",PI[s]=1}),is[i[13]]=r+","+e,Cn(n,function(s){var o=s.split(":");is[o[1]]=i[o[0]]})}("x,y,z,scale,scaleX,scaleY,xPercent,yPercent","rotation,rotationX,rotationY,skewX,skewY","transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective","0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY"),Cn("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(r){Yn.units[r]="px"}),Sn.registerPlugin(zI);var Xm=Sn.registerPlugin(zI)||Sn;Xm.core.Tween;const di=/iPhone|iPod|Android/i.test(navigator.userAgent),HI=new JN;let cc=null;const b7={Front:{value:di?new G(4.7,1.9,7.5):new G(1.8,.65,2.5)},Back:{value:di?new G(0,1.9,-7.5):new G(0,.65,-4)},Left:{value:di?new G(-9.14,1.17,3):new G(-3.5,.4,1)},Right:{value:di?new G(9.14,1.17,3):new G(3.5,.4,1)},Top:{value:di?new G(0,9.23,3):new G(0,3.5,1)},Bottom:{value:di?new G(.6,-9.23,3):new G(.1,-3.5,1)},FlatFront:{value:new G(0,0,3)},FlatLeft:{value:new G(-2,0,0)},FlatRight:{value:new G(2,0,0)},FlatTop:{value:new G(0,.75,1)}};let Bn,Cf=!1,Km=!1,Jm,hr,Lo=!1,Zm=!1,$m,Xu;const R7=new Ni({metalness:0,roughness:1,ior:1,opacity:1,clearcoat:0,color:new Ve(16777215),transparent:!1,shadowSide:Qr,depthWrite:!0,map:null,alphaMap:null,aoMap:null,roughnessMap:null,metalnessMap:null,normalMap:null});let No,Ia=[],e0,t0,r0=!1,n0=!1;const i0=[0,.4,.7,1],GI=[.85,.62,.3,0],VI=[new Ve(16777215),new Ve(16777215),new Ve(16777215),new Ve(16777215)],dr={resolution:{value:new Ue(0,0)},color:{value:new Ve(16777215)},opacity:{value:1},metalness:{value:1},maxX:{value:.1},minX:{value:-.1},minY:{value:-.1},maxY:{value:.1},uAlpha:{value:!1},gradientColors:{value:VI},positions:{value:i0},opacities:{value:GI}};let s0={bloomOn:new Ve(0),bloomOff:new Ve(16777215)};const jI=1;let Ku=null;const WI=new vd;WI.set(jI);const uc={threshold:.2,strength:.7,radius:.5,exposure:1};var YI;const qI=(YI=document.getElementById("vertexshader"))==null?void 0:YI.textContent;var XI;const KI=(XI=document.getElementById("fragmentshader"))==null?void 0:XI.textContent,D7=new Ki({color:"black"}),Mf={};function L7(r){r.isMesh&&WI.test(r.layers)===!1&&(Mf[r.uuid]=r.material,r.material=D7)}function N7(r){Mf[r.uuid]&&(r.material=Mf[r.uuid],delete Mf[r.uuid])}class U7{constructor(){xt(this,"scene"),xt(this,"camera"),xt(this,"renderer"),xt(this,"canvas"),xt(this,"canvasSize"),xt(this,"isInitialised"),xt(this,"orgId"),xt(this,"textureLoader"),xt(this,"raycaster"),xt(this,"isTouchDown"),xt(this,"touchDownTime"),xt(this,"touchDownTimeout"),xt(this,"onPointerDown",e=>{e.target.localName==="canvas"&&(this.isTouchDown=!0,this.touchDownTime=Date.now())}),xt(this,"onPointerMove",e=>{e.target.localName==="canvas"&&this.isTouchDown&&(this.isTouchDown=!1,this.touchDownTime=0)}),xt(this,"onPointerUp",e=>{e.target.localName==="canvas"&&this.isTouchDown&&(this.isTouchDown=!1,Date.now()-this.touchDownTime>this.touchDownTimeout?(this.isTouchDown=!1,console.log("Long touch or rogue touch canceled")):this.handlePointerOnValidInput(e))}),xt(this,"handlePointerOnValidInput",e=>{const{isValid:t,x:n,y:i}=this.checkInputValidity(e);if(!t)return;const s=new Ue;if(s.x=n/this.canvas.clientWidth*2-1,s.y=-(i/this.canvas.clientHeight)*2+1,this.raycaster.setFromCamera(s,this.camera),!this.isTouchDown||this.isTouchDown&&Date.now()-this.touchDownTime<=this.touchDownTimeout){const o=this.raycaster.intersectObjects(this.scene.children,!0);for(const l of o)if(l.object.name.toLowerCase().includes("gemstone")){const h=new CustomEvent("gemZoneDetectedOnTouch",{detail:l.object.name.replace("Gemstone_Zone","")});document.dispatchEvent(h);break}}}),xt(this,"checkInputValidity",e=>{let t,n;return t=e.clientX,n=e.clientY-Math.round(window.innerHeight*(di?.1:.08)),n<0||n>this.canvas.clientHeight?{isValid:!1,x:0,y:0}:{isValid:!0,x:t,y:n}}),this.scene=new f8,this.canvasSize=new Ue,this.isInitialised=!1,this.textureLoader=new fx,this.raycaster=new rN,this.isTouchDown=!1,this.touchDownTime=0,this.touchDownTimeout=500,this.orgId=""}async intialise(e){Xu=e,this.canvas=document.querySelector("canvas.sprie-config-webgl");const t=this.canvas.clientWidth,n=this.canvas.clientHeight;this.canvasSize.set(t,n),this.camera=new dn(12,t/n,.1,1e4),this.camera.lookAt(0,0,0),this.scene.background=s0.bloomOff,this.renderer=new d8({canvas:this.canvas,alpha:!0,premultipliedAlpha:!0,powerPreference:di?"default":"high-performance"}),this.renderer.toneMapping=mA,this.renderer.setClearColor(16777215),this.renderer.outputColorSpace=Fr,this.resizeRenderer(),HI.load("https://sprie-jarvis-public.s3.eu-west-2.amazonaws.com/environment_desaturated.hdr",i=>{i.mapping=ru,i.colorSpace=cr,this.scene.environment=i}),HI.load("https://sprie-jarvis-public.s3.eu-west-2.amazonaws.com/gems1.hdr",i=>{i.mapping=ru,i.colorSpace=cr,No=i}),document.addEventListener("mousedown",this.onPointerDown),document.addEventListener("mousemove",this.onPointerMove),document.addEventListener("mouseup",this.onPointerUp),this.isInitialised=!0}resizeRenderer(){var e;const t=Math.min(window.devicePixelRatio,2),n=Math.floor(this.canvas.clientWidth*t),i=Math.floor(this.canvas.clientHeight*t),s=this.canvas.clientWidth!==n||this.canvas.clientHeight!==i;return s&&((e=this.renderer)==null||e.setSize(n,i,!1)),s}cleanUp(){document.removeEventListener("mousedown",this.onPointerDown),document.removeEventListener("mousemove",this.onPointerMove),document.removeEventListener("mouseup",this.onPointerUp),this.renderer&&this.renderer.dispose()}loadModelInsideScene(e){this.scene.traverse(t=>{t.name=="Scene"&&(this.scene.remove(t),t.traverse(n=>{n instanceof Xr&&(n.geometry.dispose(),n.material.dispose())}))}),this.scene.add(e)}setLighting(e){const t=new O8(16777215,16777215,2);t.color.setHSL(.6,1,.6),t.groundColor.setHSL(.095,1,.75),t.position.set(0,50,0),e.add(t);const n=new mx(16777215,1.5);n.color.setHSL(.1,1,.95),n.position.set(-1,1.75,1),n.position.multiplyScalar(30),e.add(n)}setupShadows(){const e={shadow:{blur:.6,darkness:1,opacity:.6},plane:{color:"#ffffff",opacity:1},showWireframe:!1},t=new oa;t.position.y=-.315,this.scene.add(t);const n=new cn(256,256);n.texture.generateMipmaps=!1;const i=new cn(256,256);i.texture.generateMipmaps=!1;const s=new vu(2.5,2.5).rotateX(Math.PI/2),o=new Ki({map:n.texture,opacity:e.shadow.opacity,transparent:!0,depthWrite:!1}),l=new Xr(s,o);l.renderOrder=1,t.add(l),l.scale.y=-1;const h=new Xr(s);h.visible=!1,t.add(h);const u=new _u(-2.5/2,2.5/2,2.5/2,-2.5/2,0,.4);u.rotation.x=Math.PI/2,t.add(u);const d=new V2;d.userData.darkness={value:e.shadow.darkness},d.onBeforeCompile=E=>{const m=E;m.uniforms.darkness=d.userData.darkness,m.fragmentShader=`
4502
4502
  uniform float darkness;
4503
4503
  ${E.fragmentShader.replace("gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );","gl_FragColor = vec4( vec3( 0.0 ), ( 1.0 - fragCoordZ ) * darkness );")}
4504
- `},d.depthTest=!1,d.depthWrite=!1;const A=new Cr(iU);A.depthTest=!1;const p=new Cr(sU);p.depthTest=!1;function g(E,m){h.visible=!0,h.material=A,h.material.uniforms.tDiffuse.value=n.texture,A.uniforms.h.value=E*1/256,m.setRenderTarget(i),m.render(h,u),h.material=p,h.material.uniforms.tDiffuse.value=i.texture,p.uniforms.v.value=E*1/256,m.setRenderTarget(n),m.render(h,u),h.visible=!1}u.far=.125,_();function _(){u.updateProjectionMatrix()}return{state:e,shadowCamera:u,depthMaterial:d,renderTarget:n,blurShadow:g}}setOrbitControls(e,t){const n=new iN(e,this.canvas);n.target.set(.003059340956040225,-.13425621157020154,-.2564218846390263);const i=di?new G(4.7,1.9,7.5):t===0?new G(2.28,.2,2.23):new G(1.8,.65,2.5);return e.position.set(i.x,i.y,i.z),n.minDistance=di?2.5:1.5,n.maxDistance=di?11:5,n.rotateSpeed=di?.8:.5,t&&t!==0&&(n.autoRotate=!0,n.autoRotateSpeed=t),n.enableDamping=!0,n.dampingFactor=.2,n.enablePan=!1,n.minPolarAngle=-Math.PI*5/36,n.maxPolarAngle=Math.PI*3/5,n.update(),n}setupMSAA(e,t){const n=new ew,i=new tw(this.scene,t),s=e.getDrawingBufferSize(new Ue),o=new cn(s.width,s.height,{samples:4,type:Or}),l=new zg(e,o);return l.addPass(i),l.addPass(n),l}setupSelectiveBloom(e){const t=new ew,n=new tw(this.scene,this.camera),i=e.getSize(new Ue),s=new yo(new Ue(i.width,i.height),uc.strength,uc.radius,uc.threshold),o=new cn(i.width,i.height,{samples:4,type:Or,colorSpace:cr}),l=new zg(e);l.renderToScreen=!1,l.addPass(n),l.addPass(s);const h=new Fg(new Cr({uniforms:{baseTexture:{value:null},bloomTexture:{value:l.renderTarget2.texture}},vertexShader:qI,fragmentShader:KI,defines:{}}),"baseTexture");h.needsSwap=!0;const u=new zg(e,o);return u.addPass(n),u.addPass(h),u.addPass(t),{unrealBloomComposer:l,mainComposer:u}}updateSelectiveBloom(e,t){if(!(e&&t&&this.renderer))return;const n=t.passes[1];t.removePass(t.passes[1]),n.dispose();const i=this.renderer.getSize(new Ue),s=new yo(new Ue(i.width,i.height),uc.strength,uc.radius,uc.threshold);t.addPass(s);const o=e.passes[1];e.removePass(e.passes[1]),o.dispose();const l=new Fg(new Cr({uniforms:{baseTexture:{value:null},bloomTexture:{value:t.renderTarget2.texture}},vertexShader:qI,fragmentShader:KI,defines:{}}),"baseTexture");l.needsSwap=!0,e.insertPass(l,1)}setupAndRenderScene(e){if(!this.camera||!this.renderer)return;this.scene.add(this.camera),Tt.enabled=!0,this.setLighting(this.scene);const t=this.setOrbitControls(this.camera,e),{state:n,shadowCamera:i,depthMaterial:s,renderTarget:o,blurShadow:l}=this.setupShadows();if(!Xu)cc=this.setupMSAA(this.renderer,this.camera);else{const u=this.setupSelectiveBloom(this.renderer);cc=u.mainComposer,Ku=u.unrealBloomComposer}const h=()=>{var u;t.update(),this.resizeRenderer()&&(this.camera.aspect=this.canvas.clientWidth/this.canvas.clientHeight,(u=this.camera)==null||u.updateProjectionMatrix());const d=this.scene.background;if(this.scene.background=null,this.scene.overrideMaterial=s,!this.renderer||!this.camera)return;const A=this.renderer.getClearAlpha();this.renderer.setClearAlpha(0),this.renderer.clear(),this.renderer.setRenderTarget(o),this.renderer.render(this.scene,i),this.scene.overrideMaterial=null,l(n.shadow.blur,this.renderer),l(n.shadow.blur*.4,this.renderer),this.renderer.setRenderTarget(null),this.renderer.setClearAlpha(A),this.scene.background=d,Ia.forEach(p=>{var g,_;p.material.uniforms.viewMatrixInverse.value=(g=this.camera)==null?void 0:g.matrixWorld,p.material.uniforms.projectionMatrixInverse.value=(_=this.camera)==null?void 0:_.projectionMatrixInverse}),requestAnimationFrame(h),Xu&&(this.scene.traverse(L7),this.scene.background=Mf.bloomOn,Ku==null||Ku.render(),this.scene.traverse(N7),this.scene.background=Mf.bloomOff),cc==null||cc.render()};h()}async downloadModel(e,t){return await Np.DownloadMA({orgId:e,assetsId:t})}getCustomisations(e){return[e==null?void 0:e.find(t=>(t==null?void 0:t.type)=="Lens"),e==null?void 0:e.find(t=>(t==null?void 0:t.type)=="Orbital")]}async renderModel(e,t){const n=new sN;e&&await this.loadEyewearFromGLTF(n,e,this.renderer,t)}async loadEyewearFromGLTF(e,t,n,i){const s=new dx,o=new es(s).setTranscoderPath("https://unpkg.com/three@0.146.0/examples/js/libs/basis/");e.setKTX2Loader(o.detectSupport(n)),Ia.length=0;const l=i,h=t.includes(".glb");let u;return h?u=await e.loadAsync(t):u=await this.LoadEncryptedGlb(e,t,l).then(d=>{let A=d.result;this.updateScene(A);let p=Number.POSITIVE_INFINITY;A.scene.traverse(g=>{g.isMesh&&(p=Math.min(p,this.getMinY(g)),this.setupLensMaterial(g),this.setupOrbitalMaterial(g),this.setupGemstoneMaterial(g),g.matrixAutoUpdate=!0)}),this.adjustSceneHeight(A,p),this.loadModelInsideScene(d.result.scene),this.sortGemstoneMaterials()}),u==null?void 0:u.scene}async LoadEncryptedGlb(e,t,n){const i=await VB(t,n);if(!i||!i.decodedData)throw new Error("Asset auth error.");return new Promise(s=>{e.parse(i.decodedData,"",o=>{s({result:o})})})}updateScene(e){e.scene.scale.set(7,7,7),e.scene.position.y-=.08}getMinY(e){let t=Number.POSITIVE_INFINITY;if(e.geometry instanceof Vn){const n=e.geometry.getAttribute("position");if(n){const i=n.array;for(let s=0;s<i.length;s+=3){const o=new G(i[s],i[s+1],i[s+2]),l=e.localToWorld(o.clone());t=Math.min(t,l.y)}}}return t}calculateLensExtents(e){let t=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;if(e.geometry instanceof Vn){const i=e.geometry.getAttribute("position");if(i){const s=i.array;for(let o=0;o<s.length;o+=3){const l=new G(s[o],s[o+1],s[o+2]),h=e.localToWorld(l.clone());t=Math.min(t,h.y),n=Math.max(n,h.y)}}}dr.minY.value=t,dr.maxY.value=n}adjustSceneHeight(e,t){let n=-.315-t;e.scene.position.y+=n,dr.minY.value+=n,dr.maxY.value+=n}setupLensMaterial(e){Cf&&e.material&&e.material.name=="Lenses"&&(this.calculateLensExtents(e),Zm=e,Bn=new Ni({metalness:0,roughness:.05,ior:1,opacity:.6,clearcoat:1,color:new Ve(16777215),transparent:!0,shadowSide:Qr,depthWrite:!1}),e.material=Bn,Bn&&(Bn.onBeforeCompile=function(t){t.uniforms.resolution=dr.resolution,t.uniforms.color=dr.color,t.uniforms.lensOpacity=dr.opacity,t.uniforms.uAlpha=dr.uAlpha,t.uniforms.colors=dr.gradientColors,t.uniforms.positions=dr.positions,t.uniforms.opacities=dr.opacities,t.uniforms.minX=dr.minX,t.uniforms.maxX=dr.maxX,t.uniforms.minY=dr.minY,t.uniforms.maxY=dr.maxY,t.vertexShader=`
4504
+ `},d.depthTest=!1,d.depthWrite=!1;const A=new Cr(iU);A.depthTest=!1;const p=new Cr(sU);p.depthTest=!1;function g(E,m){h.visible=!0,h.material=A,h.material.uniforms.tDiffuse.value=n.texture,A.uniforms.h.value=E*1/256,m.setRenderTarget(i),m.render(h,u),h.material=p,h.material.uniforms.tDiffuse.value=i.texture,p.uniforms.v.value=E*1/256,m.setRenderTarget(n),m.render(h,u),h.visible=!1}u.far=.125,_();function _(){u.updateProjectionMatrix()}return{state:e,shadowCamera:u,depthMaterial:d,renderTarget:n,blurShadow:g}}setOrbitControls(e,t){const n=new iN(e,this.canvas);n.target.set(.003059340956040225,-.13425621157020154,-.2564218846390263);const i=di?new G(4.7,1.9,7.5):t===0?new G(2.28,.2,2.23):new G(1.8,.65,2.5);return e.position.set(i.x,i.y,i.z),n.minDistance=di?2.5:1.5,n.maxDistance=di?11:5,n.rotateSpeed=di?.8:.5,t&&t!==0&&(n.autoRotate=!0,n.autoRotateSpeed=t),n.enableDamping=!0,n.dampingFactor=.2,n.enablePan=!1,n.minPolarAngle=-Math.PI*5/36,n.maxPolarAngle=Math.PI*3/5,n.update(),n}setupMSAA(e,t){const n=new ew,i=new tw(this.scene,t),s=e.getDrawingBufferSize(new Ue),o=new cn(s.width,s.height,{samples:4,type:Or}),l=new Fg(e,o);return l.addPass(i),l.addPass(n),l}setupSelectiveBloom(e){const t=new ew,n=new tw(this.scene,this.camera),i=e.getSize(new Ue),s=new yo(new Ue(i.width,i.height),uc.strength,uc.radius,uc.threshold),o=new cn(i.width,i.height,{samples:4,type:Or,colorSpace:cr}),l=new Fg(e);l.renderToScreen=!1,l.addPass(n),l.addPass(s);const h=new Og(new Cr({uniforms:{baseTexture:{value:null},bloomTexture:{value:l.renderTarget2.texture}},vertexShader:qI,fragmentShader:KI,defines:{}}),"baseTexture");h.needsSwap=!0;const u=new Fg(e,o);return u.addPass(n),u.addPass(h),u.addPass(t),{unrealBloomComposer:l,mainComposer:u}}updateSelectiveBloom(e,t){if(!(e&&t&&this.renderer))return;const n=t.passes[1];t.removePass(t.passes[1]),n.dispose();const i=this.renderer.getSize(new Ue),s=new yo(new Ue(i.width,i.height),uc.strength,uc.radius,uc.threshold);t.addPass(s);const o=e.passes[1];e.removePass(e.passes[1]),o.dispose();const l=new Og(new Cr({uniforms:{baseTexture:{value:null},bloomTexture:{value:t.renderTarget2.texture}},vertexShader:qI,fragmentShader:KI,defines:{}}),"baseTexture");l.needsSwap=!0,e.insertPass(l,1)}setupAndRenderScene(e){if(!this.camera||!this.renderer)return;this.scene.add(this.camera),Tt.enabled=!0,this.setLighting(this.scene);const t=this.setOrbitControls(this.camera,e),{state:n,shadowCamera:i,depthMaterial:s,renderTarget:o,blurShadow:l}=this.setupShadows();if(!Xu)cc=this.setupMSAA(this.renderer,this.camera);else{const u=this.setupSelectiveBloom(this.renderer);cc=u.mainComposer,Ku=u.unrealBloomComposer}const h=()=>{var u;t.update(),this.resizeRenderer()&&(this.camera.aspect=this.canvas.clientWidth/this.canvas.clientHeight,(u=this.camera)==null||u.updateProjectionMatrix());const d=this.scene.background;if(this.scene.background=null,this.scene.overrideMaterial=s,!this.renderer||!this.camera)return;const A=this.renderer.getClearAlpha();this.renderer.setClearAlpha(0),this.renderer.clear(),this.renderer.setRenderTarget(o),this.renderer.render(this.scene,i),this.scene.overrideMaterial=null,l(n.shadow.blur,this.renderer),l(n.shadow.blur*.4,this.renderer),this.renderer.setRenderTarget(null),this.renderer.setClearAlpha(A),this.scene.background=d,Ia.forEach(p=>{var g,_;p.material.uniforms.viewMatrixInverse.value=(g=this.camera)==null?void 0:g.matrixWorld,p.material.uniforms.projectionMatrixInverse.value=(_=this.camera)==null?void 0:_.projectionMatrixInverse}),requestAnimationFrame(h),Xu&&(this.scene.traverse(L7),this.scene.background=s0.bloomOn,Ku==null||Ku.render(),this.scene.traverse(N7),this.scene.background=s0.bloomOff),cc==null||cc.render()};h()}async downloadModel(e,t){return await Lp.DownloadMA({orgId:e,assetsId:t})}getCustomisations(e){return[e==null?void 0:e.find(t=>(t==null?void 0:t.type)=="Lens"),e==null?void 0:e.find(t=>(t==null?void 0:t.type)=="Orbital")]}async renderModel(e,t){const n=new sN;e&&await this.loadEyewearFromGLTF(n,e,this.renderer,t)}async loadEyewearFromGLTF(e,t,n,i){const s=new dx,o=new es(s).setTranscoderPath("https://unpkg.com/three@0.146.0/examples/js/libs/basis/");e.setKTX2Loader(o.detectSupport(n)),Ia.length=0;const l=i,h=t.includes(".glb");let u;return h?u=await e.loadAsync(t):u=await this.LoadEncryptedGlb(e,t,l).then(d=>{let A=d.result;this.updateScene(A);let p=Number.POSITIVE_INFINITY;A.scene.traverse(g=>{g.isMesh&&(p=Math.min(p,this.getMinY(g)),this.setupLensMaterial(g),this.setupOrbitalMaterial(g),this.setupGemstoneMaterial(g),g.matrixAutoUpdate=!0)}),this.adjustSceneHeight(A,p),this.loadModelInsideScene(d.result.scene),this.sortGemstoneMaterials()}),u==null?void 0:u.scene}async LoadEncryptedGlb(e,t,n){const i=await VB(t,n);if(!i||!i.decodedData)throw new Error("Asset auth error.");return new Promise(s=>{e.parse(i.decodedData,"",o=>{s({result:o})})})}updateScene(e){e.scene.scale.set(7,7,7),e.scene.position.y-=.08}getMinY(e){let t=Number.POSITIVE_INFINITY;if(e.geometry instanceof Vn){const n=e.geometry.getAttribute("position");if(n){const i=n.array;for(let s=0;s<i.length;s+=3){const o=new G(i[s],i[s+1],i[s+2]),l=e.localToWorld(o.clone());t=Math.min(t,l.y)}}}return t}calculateLensExtents(e){let t=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;if(e.geometry instanceof Vn){const i=e.geometry.getAttribute("position");if(i){const s=i.array;for(let o=0;o<s.length;o+=3){const l=new G(s[o],s[o+1],s[o+2]),h=e.localToWorld(l.clone());t=Math.min(t,h.y),n=Math.max(n,h.y)}}}dr.minY.value=t,dr.maxY.value=n}adjustSceneHeight(e,t){let n=-.315-t;e.scene.position.y+=n,dr.minY.value+=n,dr.maxY.value+=n}setupLensMaterial(e){Cf&&e.material&&e.material.name=="Lenses"&&(this.calculateLensExtents(e),Jm=e,Bn=new Ni({metalness:0,roughness:.05,ior:1,opacity:.6,clearcoat:1,color:new Ve(16777215),transparent:!0,shadowSide:Qr,depthWrite:!1}),e.material=Bn,Bn&&(Bn.onBeforeCompile=function(t){t.uniforms.resolution=dr.resolution,t.uniforms.color=dr.color,t.uniforms.lensOpacity=dr.opacity,t.uniforms.uAlpha=dr.uAlpha,t.uniforms.colors=dr.gradientColors,t.uniforms.positions=dr.positions,t.uniforms.opacities=dr.opacities,t.uniforms.minX=dr.minX,t.uniforms.maxX=dr.maxX,t.uniforms.minY=dr.minY,t.uniforms.maxY=dr.maxY,t.vertexShader=`
4505
4505
  varying vec3 vPosition;
4506
4506
  varying vec3 localPosition;
4507
4507
  varying vec2 vUv;
@@ -4519,7 +4519,7 @@ bool bvhIntersectFirstHit(
4519
4519
  varying vec2 vUv;
4520
4520
  varying vec3 localPosition;
4521
4521
  uniform vec3 colors[${VI.length}];
4522
- uniform float positions[${s0.length}];
4522
+ uniform float positions[${i0.length}];
4523
4523
  uniform float opacities[${GI.length}];
4524
4524
  uniform sampler2D shadowMap;
4525
4525
  uniform float minX;
@@ -4536,7 +4536,7 @@ bool bvhIntersectFirstHit(
4536
4536
  if (uAlpha) {
4537
4537
  float alpha = 0.0; // Initialize alpha to 1.0
4538
4538
 
4539
- for (int i = 0; i < ${s0.length} - 1; i++) {
4539
+ for (int i = 0; i < ${i0.length} - 1; i++) {
4540
4540
  if (newUv.y >= positions[i] && newUv.y < positions[i + 1]) {
4541
4541
  float t = (newUv.y - positions[i]) / (positions[i + 1] - positions[i]);
4542
4542
  alpha = mix(opacities[i], opacities[i + 1], t);
@@ -4546,9 +4546,9 @@ bool bvhIntersectFirstHit(
4546
4546
  }
4547
4547
  diffuseColor.a = alpha;
4548
4548
  }
4549
- `)},Bn.needsUpdate=!0,Lo&&(e.visible=Jm)))}setupOrbitalMaterial(e){Lo&&e.material&&e.material.name.toLowerCase()=="frame-stems"&&(e0=e,hr=R7,hr.envMap=this.scene.environment,e.material=hr,hr.needsUpdate=!0,e.visible=$m)}setupGemstoneMaterial(e){var t;if(!e.material||((t=e.material)==null?void 0:t.length)>1)return;const n=e.name.toLowerCase();if(n.includes("diamond")||n.includes("gemstone")){const i=new AP;i.toneMapped=!1,i.name=e.name,this.initGemstoneDependencies(i),i.uniforms.bvh.value=new Mw,i.uniforms.bvh.value.updateFrom(new lm(e.geometry.clone().toNonIndexed(),{strategy:nw})),e.material=i,this.setupRaycast(e),Ia.push(e),e.layers.toggle(jI)}}updateLensMaterial(e){if(Bn){if(e.direction=="u")dr.color.value=new Ve(e.color),dr.opacity.value=Xu?e.opacity:e.opacity*.9,dr.uAlpha.value=!1;else if(e.direction=="tb"){const t=e.gradientColors;dr.uAlpha.value=!0;let n=0;t.forEach(()=>{dr.gradientColors.value[n]=new Ve(t[n].color),dr.positions.value[n]=t[n].position,dr.opacities.value[n]=Xu?t[n].alpha:t[n].alpha*.817,n++})}e.finish=="MIRBLKHMC"?(Bn.clearcoat=1,Bn.clearcoatRoughness=0):e.finish=="HMCCR"?(Bn.clearcoat=0,Bn.clearcoatRoughness=1):e.finish=="MIRSILHMC"&&(Bn.clearcoat=1,Bn.clearcoatRoughness=0),Bn.roughness=e.roughness,Bn.metalness=e.metalness}}async updateOrbitalMaterial(e){Lo&&(!hr||!e||(e.ior>1?(hr.ior=1.45,hr.thickness=.0035):(hr.ior=1,hr.thickness=0),hr.opacity=1,hr.transmission=1,hr.transparent=!1,hr.clearcoat=0,hr.roughness=1,hr.metalness=e.metalness,hr.shadowSide=Qr,hr.depthWrite=!0,e.texture&&(e.texture.baseColor&&await this.downloadTexture(e.texture.baseColor).then(t=>{hr.map=t}),e.texture.opacity&&await this.downloadTexture(e.texture.opacity).then(t=>{hr.transmissionMap=t}),e.texture.orm&&await this.downloadTexture(e.texture.orm).then(t=>{hr.aoMap=t,hr.roughnessMap=t,hr.metalnessMap=t}))))}async downloadTexture(e){return await this.textureLoader.loadAsync(e).then(t=>(t.colorSpace=Fr,t.flipY=!1,t.magFilter=gr,t.minFilter=wb,t.wrapS=$s,t.wrapT=$s,t))}sortGemstoneMaterials(){Ia.sort((e,t)=>e.name.toLowerCase().localeCompare(t.name.toLowerCase()))}initGemstoneDependencies(e){var t;const n=A=>A&&A.isCubeTexture;e.uniforms.envMap.value=No,e.uniforms.aberrationStrength.value=.01,e.uniforms.resolution.value=this.canvasSize;const i={},s=n(No),o=((s?(t=No==null?void 0:No.image[0])==null?void 0:t.width:No==null?void 0:No.image.width)??1024)/4,l=Math.floor(Math.log2(o)),h=Math.pow(2,l),u=3*Math.max(h,16*7),d=4*h;s&&(i.ENVMAP_TYPE_CUBEM=""),i.CUBEUV_TEXEL_WIDTH=`${1/u}`,i.CUBEUV_TEXEL_HEIGHT=`${1/d}`,i.CUBEUV_MAX_MIP=`${l}.0`,i.CHROMATIC_ABERRATIONS="",i.FAST_CHROMA="",e.defines=i}setupRaycast(e){e.raycast=function(t,n){new co;let i=new G,s=new G;const o=this.matrixWorld;if(t.ray.intersectBox(new _r().setFromObject(e),i)===null)return;s.copy(i),s.applyMatrix4(o);let l=t.ray.origin.distanceTo(s);if(l<t.near||l>t.far)return;let h={distance:l,point:s.clone(),index:void 0,face:null,object:e};n.push(h)}}async loadFirstFrame(e,t,n){if(t&&e){const i=await this.downloadModel(e,t._id);let s;n?s=n:s=t.customisation;const[o,l]=this.getCustomisations(s);Cf=!!o,Lo=!!l,Lo||(Jm=!0,$m=!0),await this.renderModel(i.asset.cloudfrontUrl,i.decryptionKey).then(async()=>new Promise(async(h,u)=>{o&&this.updateLensMaterial(o),h(),l?await this.updateOrbitalMaterial(l).then(()=>{h()}):h()}))}else return}async changeFrame(e,t,n){if(t&&e){Cf=!1,Lo=!1;const i=await this.downloadModel(e,t._id),[s,o]=this.getCustomisations(n),[l,h]=this.getCustomisations(t.customisation);Cf=!!(l||s&&(s==null?void 0:s.sku)!=="lens-default"),Lo=!!(h||o&&(o==null?void 0:o.sku)!=="orbital-default"),await this.renderModel(i.asset.cloudfrontUrl,i.decryptionKey).then(async()=>new Promise(async(u,d)=>{!s||(s==null?void 0:s.sku)=="lens-default"?(l&&this.updateLensMaterial(l),u()):(this.updateLensMaterial(s),u()),(o==null?void 0:o.sku)=="orbital-default"?h&&await this.updateOrbitalMaterial(h).then(()=>{u()}):await this.updateOrbitalMaterial(o).then(()=>{u()})}))}}async changeLens(e,t,n,i){return new Promise((s,o)=>{if(n)this.changeFrame(t,i,e).then(()=>{s()});else{Zm&&(Zm.visible=!0);const l=e.find(h=>(h==null?void 0:h.type)=="Lens");this.updateLensMaterial(l),Jm=!0,s()}})}async changeOrbital(e){return new Promise(async(t,n)=>{e0&&(e0.visible=!0),await this.updateOrbitalMaterial(e).then(()=>{$m=!0,t()})})}async changeGemType(e,t,n){return new Promise(async(i,s)=>{try{const o=new Ve(`#${t}`);i0?(t0=o,r0=n,n0=!0,i()):(Ia[e].material.uniforms.color.value=o.multiplyScalar(n),this.updateSelectiveBloom(cc,Ku),i())}catch(o){s(o)}})}async flashFocusOnZone(e,t,n,i){return new Promise(async(s,o)=>{try{const l=Ia[e].material.uniforms.color.value,h=new Ve(t).multiplyScalar(n);Km.to(l,{r:h.r,g:h.g,b:h.b,ease:"sine.inOut",duration:.2,onStart:function(){i0=!0},onUpdate:function(){Ia[e].material.uniforms.color.value=l},onComplete:function(){i0=!1}}).yoyo(!0).repeat(i*2-1).then(()=>{n0&&(Ia[e].material.uniforms.color.value=t0.multiplyScalar(r0??1),this.updateSelectiveBloom(cc,Ku),n0=!1,t0=void 0,r0=void 0),s()})}catch(l){o(l)}})}snapCamToPos(e){return new Promise(async(t,n)=>{var i;try{if(!this.camera||!this.renderer)return;const s=(i=b7[e])==null?void 0:i.value;Km.to(this.camera.position,{duration:1,ease:"sine.inOut",x:s.x,y:s.y,z:s.z}).then(()=>t())}catch(s){n(s)}})}}class P7{constructor(){xt(this,"customRenderer"),this.customRenderer=new U7}async Init(e,t){this.customRenderer.isInitialised||(await this.customRenderer.intialise(t),this.customRenderer.setupAndRenderScene(e))}loadFirstFrame(e,t,n){return new Promise((i,s)=>{this.customRenderer.loadFirstFrame(e,t,n).then(()=>{i(1)}).catch(o=>{s(o)})})}changeFrame(e,t,n){return this.customRenderer.changeFrame(e,t,n)}changeLens(e,t,n,i){return this.customRenderer.changeLens(e,t,n,i)}changeOrbital(e){return this.customRenderer.changeOrbital(e)}changeGemType(e,t,n){return this.customRenderer.changeGemType(e,t,n)}focusOnZone(e,t,n,i){return this.customRenderer.flashFocusOnZone(e,t,n,i)}snapCamToPos(e){return this.customRenderer.snapCamToPos(e)}}class JI{constructor(e){xt(this,"orgId"),xt(this,"rendererService"),xt(this,"isLoading",!1),xt(this,"userContainerId"),xt(this,"containerElement",null),xt(this,"defaultSelectorId","dita-3dconfig-element"),xt(this,"defaultCanvasStyle",{width:"100%",height:"100%"}),xt(this,"customisationArr",[]),xt(this,"assetDetails",null),this.userContainerId=e.userContainerId,this.rendererService=new P7,this.orgId=e.orgId}prepareDOM(){const e=this.userContainerId??this.defaultSelectorId,t=document.getElementById(e);if(!t)throw new Error(`Container not found to embed 3d-configurator ${this.defaultSelectorId}`);this.containerElement=t;const n=document.createElement("canvas");return n.className="sprie-config-webgl",t.innerHTML="",t.appendChild(n),Object.assign(n.style,this.defaultCanvasStyle),!0}snapCameraToPos(e){return this.rendererService.snapCamToPos(e)}async loadFrame(e){return this.assetDetails=e.data.assetDetails,this.customisationArr=e.data.customisation,this.prepareDOM(),await this.rendererService.Init(e.autoRotateSpeed,e.forInovati),await this.rendererService.loadFirstFrame(this.orgId,this.assetDetails,this.customisationArr),this}changeFrame(e,t){return this.rendererService.changeFrame(this.orgId,e,t)}changeLens(e,t,n){return this.rendererService.changeLens(e,this.orgId,t,n)}changeOrbital(e){return this.rendererService.changeOrbital(e)}changeGemType(e,t,n){return this.rendererService.changeGemType(e,t,n)}focusOnZone(e,t,n,i){return this.rendererService.focusOnZone(e,t,n,i)}unmount(){this.containerElement&&(this.containerElement.innerHTML="",this.containerElement.style.height="0px",this.containerElement.style.width="auto")}}class ZI{constructor(){xt(this,"events"),xt(this,"authService"),xt(this,"instanceArr"),this.authService=new rS,this.events=new dS,this.instanceArr=[]}async Init(e){await this.authService.Init(e),Pc.setJWT(this.authService.authPayload.JWT)}async loadBySKU(e){const t=await Np.FetchAssetBySKUOrBarcode({sku:e.SKU,barcode:null});return await this.renderAsset({data:{assetDetails:t,customisation:t.customisation}})}async renderAsset(e){return new JI({orgId:this.authService.authPayload.ORGID,userContainerId:e.containerId}).loadFrame({containerId:e.containerId,data:{assetDetails:e.data.assetDetails,customisation:e.data.customisation}})}async getInstance(e){return new JI({orgId:this.authService.authPayload.ORGID,userContainerId:e.containerId})}}window.ThreeDConfigurator=ZI;const rO="",sr=/iPhone|iPad|iPod|Android/i.test(navigator.userAgent),nO="";var Tf=(r=>(r.Front="Front",r.Back="Back",r.Left="Left",r.Right="Right",r.Top="Top",r.Bottom="Bottom",r))(Tf||{}),mn=(r=>(r.LoadedCustomiser="Frame customiser loaded.",r.EnteredViewer="3d view of a frame with view orientation buttons",r.EnteredFramesListSection="Select a frame from the list of available frames.",r.EnteredOrbitalsListSection="Select a frame from the list of available frames.",r.EnteredLensListSection="Select a lens from the list of available lenses.",r.EnteredEngravingSection="Choose custom engraving for your frame.",r.ChangedViewFront="Changed orientation to front view",r.ChangedViewBack="Changed orientation to back view",r.ChangedViewLeft="Changed orientation to left view",r.ChangedViewRight="Changed orientation to right view",r.ChangedViewTop="Changed orientation to top view",r.ChangedViewBottom="Changed orientation to bottom view",r.ChangedFrame="Changed current 3d frame to ",r.ChangedLens="Changed current lens to ",r.ChangedOrbital="Changed current orbital to ",r.AddedEngravingText="Added the engraving text ",r.EnteredEngravingTextInput="Enter upto 15 characters for engraving. Press enter to submit.",r.EngravingInputAvailable="Input text box for engraving text is available on tab",r.EngravingInputHidden="Input text box for engraving text is disabled",r))(mn||{});function k7({frameList:r,selectedFrame:e,modelLoading:t,isSelected:n,paletteEntered:i,onChangeFrame:s}){const o=Ye.useRef(null),l=Ye.useRef(null),h=()=>{o.current&&(o.current.textContent=mn.EnteredFramesListSection)};return Ye.useEffect(()=>{i&&l.current&&l.current.querySelectorAll(".sprie-config-palette-img-box")[0].firstChild.focus()},[i]),Se.jsxs("div",{className:"sprie-config-palette",ref:l,style:{gap:sr?"3rem":"5rem",display:n?"flex":"none",padding:"0 3rem"},children:[Se.jsx("span",{className:"sprie-config-sr-only","aria-live":"assertive",ref:o}),r==null?void 0:r.map(u=>Se.jsxs("div",{className:"sprie-config-palette-img-box",children:[Se.jsx("button",{"aria-labelledby":(e==null?void 0:e._id)===u._id?"sprie-config-frameName":"",style:{border:"0",cursor:t?"default":"pointer",width:sr?45:60,height:sr?45:60},onClick:()=>s(u),onFocus:()=>h(),disabled:t,children:Se.jsx("img",{"aria-label":`Select frame ${u.name}`,src:u.variantImage,alt:u.name+"image",className:`sprie-config-image ${sr?"mobile-view":""}`,style:{border:(e==null?void 0:e._id)===u._id?"2px solid #9d9b9c":"0",borderRadius:"50%",padding:"1px"}})}),Se.jsxs("p",{className:"sprie-config-palette-img-text",children:[Se.jsx("span",{className:"sprie-config-palette-imgName",children:u.name}),Se.jsx("span",{id:"sprie-config-frameName",className:"sprie-config-sr-only",children:`Selected frame ${u.name}`})]})]},u._id))]})}function Q7({lensList:r,selectedLens:e,selectedDitaLens:t,modelLoading:n,isSelected:i,paletteEntered:s,onChangeLens:o}){const l=Ye.useRef(null),h=Ye.useRef(null),u=()=>{l.current&&(l.current.textContent=mn.EnteredLensListSection)};return Ye.useEffect(()=>{s&&h.current&&h.current.querySelectorAll(".sprie-config-palette-img-box")[0].firstChild.focus()},[s]),Se.jsxs("div",{className:"sprie-config-palette",ref:h,style:{display:i?"flex":"none",padding:"0 3rem",gap:sr?"3rem":"5rem"},children:[Se.jsx("span",{className:"sprie-config-sr-only","aria-live":"assertive",ref:l}),r==null?void 0:r.map(d=>Se.jsxs("div",{className:"sprie-config-palette-img-box",children:[Se.jsx("button",{"aria-labelledby":(e==null?void 0:e._id)===d._id?"sprie-config-lensName":"",style:{border:"0",cursor:n?"default":"pointer",width:sr?45:60,height:sr?45:60},onClick:()=>o(d),onFocus:u,disabled:n,children:Se.jsx("img",{"aria-label":`Select lens ${d.name}`,src:d.thumbnail,alt:d.name+"image",className:`sprie-config-image ${sr?"mobile-view":""}`,style:{border:(e==null?void 0:e._id)===d._id?"2px solid #9d9b9c":"0",borderRadius:"50%",padding:"1px"}})}),Se.jsxs("p",{className:"sprie-config-palette-img-text",style:{bottom:"-1.2rem",textAlign:"center"},children:[Se.jsx("span",{className:"sprie-config-palette-imgName",children:`${d.name}`}),Se.jsx("br",{}),(e==null?void 0:e._id)===d._id&&Se.jsx("span",{className:"sprie-config-price-tag",children:(t==null?void 0:t.variantId)==0?"":`(+ ${t==null?void 0:t.variantPrice}.00 ${t==null?void 0:t.priceCurrency})`}),Se.jsxs("span",{id:"sprie-config-lensName",className:"sprie-config-sr-only",children:[" ",`Selected lens ${d.name}`]})]})]},d._id))]})}const iO="";function O7({heading:r,isSelected:e,onEngravingLinkClicked:t,onChecked:n,onTextAdded:i,paletteEntered:s}){const[o,l]=Ye.useState(""),[h,u]=Ye.useState(!1),[d,A]=Ye.useState(!1);Ye.useState(!1);const p=Ye.useRef(null),g=Ye.useRef(null),_=Ye.useRef(null);Ye.useEffect(()=>{n(h),h&&p.current?(p.current.style.backgroundColor="#ffffff",_.current&&(_.current.textContent=mn.EngravingInputAvailable)):!h&&p.current&&(p.current.style.backgroundColor="transparent",_.current&&(_.current.textContent=mn.EngravingInputHidden),l(""))}),Ye.useEffect(()=>{d&&o!=""&&i(o)},[d]),Ye.useEffect(()=>{var v;s&&((v=g.current)==null||v.focus())},[s]);const E=()=>{_.current&&(_.current.textContent=mn.EnteredEngravingSection)},m=v=>{var w;v.key==="Enter"&&(i(o),(w=p.current)==null||w.blur(),_.current&&(_.current.textContent=mn.AddedEngravingText+o))};return Se.jsxs("div",{className:"sprie-config-engraving-block",style:{display:e?"flex":"none",marginTop:".5rem"},children:[Se.jsx("span",{className:"sprie-config-sr-only","aria-live":"assertive",ref:_}),Se.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".8rem"},children:[Se.jsx("input",{type:"checkbox",ref:g,className:"sprie-config-engraving-checkbox",onChange:v=>{u(v.target.checked)},onFocus:E,checked:h}),Se.jsxs("p",{style:{fontSize:".9rem",color:"#4d4d4d",fontWeight:"500",margin:"0"},children:["Add ","Laser Engraving"," ",Se.jsx("span",{style:{fontWeight:"400"},children:"(OPTIONAL)"})]})]}),Se.jsxs("div",{className:"sprie-config-engraving-inputField-block",children:[Se.jsx("input",{"aria-label":mn.EnteredEngravingTextInput,type:"text",ref:p,className:"sprie-config-engraving-inputField",placeholder:"ADD CUSTOM TEXT",value:o,onChange:v=>l(v.target.value),maxLength:15,style:{padding:"0.7rem"},disabled:!h,onBlur:()=>A(!0),onFocus:()=>A(!1),onKeyDown:v=>m(v)}),Se.jsx("span",{className:"sprie-config-engraving-inputInfo",children:`${o.length}/15 characters`})]})]})}const sO="";function F7({totalSteps:r,currentStep:e}){return Se.jsx("div",{className:"step-tracker-block",style:{margin:sr?"auto":""}})}function z7({nextSlide:r,previousSlide:e,currentIndex:t,stepsName:n,isLastStep:i}){const s=()=>{e()},o=()=>{r()};return Se.jsxs("div",{className:"carousel-header",children:[Se.jsx("button",{className:"carousel-btn prev","aria-label":`return to the step number ${t} : ${n[t-1]}`,"aria-hidden":t==0,onClick:s,style:{visibility:t!==0?"visible":"hidden"},children:Se.jsx("i",{className:"arrow left-arrow",style:{padding:".25rem"}})}),Se.jsxs("p",{children:[Se.jsx("span",{className:"step-syntax",children:`STEP ${t+1} of ${n.length} : `}),Se.jsx("span",{className:"select-syntax",children:n[t]})]}),Se.jsx("button",{className:"carousel-btn next","aria-label":`advance to step number ${t+2} : ${n[t+1]}`,"aria-hidden":!!i,onClick:o,style:{visibility:i?"hidden":"visible"},children:Se.jsx("i",{className:"arrow right-arrow",style:{padding:".25rem"}})})]})}function H7({setShowAddToCart:r,setSelectedChild:e,setSectionEntered:t,children:n}){var g;const[i,s]=Ye.useState(0),o=Nh.Children.toArray(n),l=i===o.length-1,h=Ye.useRef(null),u=(g=o.map(_=>_))==null?void 0:g.map(_=>_.props.heading),d=()=>{s(_=>_===0?Nh.Children.count(n)-1:_-1),h.current&&h.current.focus()},A=()=>{s(_=>_===Nh.Children.count(n)-1?0:_+1),h.current&&h.current.focus()};Ye.useEffect(()=>{r(!!l)},[l]),Ye.useEffect(()=>{e(i)},[i]);const p=_=>{(_.key==="Enter"||_.key===" ")&&_.target===h.current&&t(i)};return Se.jsxs("div",{className:"carousel",children:[Se.jsx("span",{className:"sprie-config-sr-only",id:"sprie-config-step-selector",children:`Customisation Step Selector. ${l?"This is an optional":""} Step ${i+1} -
4549
+ `)},Bn.needsUpdate=!0,Lo&&(e.visible=Km)))}setupOrbitalMaterial(e){Lo&&e.material&&e.material.name.toLowerCase()=="frame-stems"&&($m=e,hr=R7,hr.envMap=this.scene.environment,e.material=hr,hr.needsUpdate=!0,e.visible=Zm)}setupGemstoneMaterial(e){var t;if(!e.material||((t=e.material)==null?void 0:t.length)>1)return;const n=e.name.toLowerCase();if(n.includes("diamond")||n.includes("gemstone")){const i=new AP;i.toneMapped=!1,i.name=e.name,this.initGemstoneDependencies(i),i.uniforms.bvh.value=new Mw,i.uniforms.bvh.value.updateFrom(new om(e.geometry.clone().toNonIndexed(),{strategy:nw})),e.material=i,this.setupRaycast(e),Ia.push(e),e.layers.toggle(jI)}}updateLensMaterial(e){if(Bn){if(e.direction=="u")dr.color.value=new Ve(e.color),dr.opacity.value=Xu?e.opacity:e.opacity*.9,dr.uAlpha.value=!1;else if(e.direction=="tb"){const t=e.gradientColors;dr.uAlpha.value=!0;let n=0;t.forEach(()=>{dr.gradientColors.value[n]=new Ve(t[n].color),dr.positions.value[n]=t[n].position,dr.opacities.value[n]=Xu?t[n].alpha:t[n].alpha*.817,n++})}e.finish=="MIRBLKHMC"?(Bn.clearcoat=1,Bn.clearcoatRoughness=0):e.finish=="HMCCR"?(Bn.clearcoat=0,Bn.clearcoatRoughness=1):e.finish=="MIRSILHMC"&&(Bn.clearcoat=1,Bn.clearcoatRoughness=0),Bn.roughness=e.roughness,Bn.metalness=e.metalness}}async updateOrbitalMaterial(e){Lo&&(!hr||!e||(e.ior>1?(hr.ior=1.45,hr.thickness=.0035):(hr.ior=1,hr.thickness=0),hr.opacity=1,hr.transmission=1,hr.transparent=!1,hr.clearcoat=0,hr.roughness=1,hr.metalness=e.metalness,hr.shadowSide=Qr,hr.depthWrite=!0,e.texture&&(e.texture.baseColor&&await this.downloadTexture(e.texture.baseColor).then(t=>{hr.map=t}),e.texture.opacity&&await this.downloadTexture(e.texture.opacity).then(t=>{hr.transmissionMap=t}),e.texture.orm&&await this.downloadTexture(e.texture.orm).then(t=>{hr.aoMap=t,hr.roughnessMap=t,hr.metalnessMap=t}))))}async downloadTexture(e){return await this.textureLoader.loadAsync(e).then(t=>(t.colorSpace=Fr,t.flipY=!1,t.magFilter=gr,t.minFilter=wb,t.wrapS=$s,t.wrapT=$s,t))}sortGemstoneMaterials(){Ia.sort((e,t)=>e.name.toLowerCase().localeCompare(t.name.toLowerCase()))}initGemstoneDependencies(e){var t;const n=A=>A&&A.isCubeTexture;e.uniforms.envMap.value=No,e.uniforms.aberrationStrength.value=.01,e.uniforms.resolution.value=this.canvasSize;const i={},s=n(No),o=((s?(t=No==null?void 0:No.image[0])==null?void 0:t.width:No==null?void 0:No.image.width)??1024)/4,l=Math.floor(Math.log2(o)),h=Math.pow(2,l),u=3*Math.max(h,16*7),d=4*h;s&&(i.ENVMAP_TYPE_CUBEM=""),i.CUBEUV_TEXEL_WIDTH=`${1/u}`,i.CUBEUV_TEXEL_HEIGHT=`${1/d}`,i.CUBEUV_MAX_MIP=`${l}.0`,i.CHROMATIC_ABERRATIONS="",i.FAST_CHROMA="",e.defines=i}setupRaycast(e){e.raycast=function(t,n){new co;let i=new G,s=new G;const o=this.matrixWorld;if(t.ray.intersectBox(new _r().setFromObject(e),i)===null)return;s.copy(i),s.applyMatrix4(o);let l=t.ray.origin.distanceTo(s);if(l<t.near||l>t.far)return;let h={distance:l,point:s.clone(),index:void 0,face:null,object:e};n.push(h)}}async loadFirstFrame(e,t,n){if(t&&e){const i=await this.downloadModel(e,t._id);let s;n?s=n:s=t.customisation;const[o,l]=this.getCustomisations(s);Cf=!!o,Lo=!!l,Lo||(Km=!0,Zm=!0),await this.renderModel(i.asset.cloudfrontUrl,i.decryptionKey).then(async()=>new Promise(async(h,u)=>{o&&this.updateLensMaterial(o),h(),l?await this.updateOrbitalMaterial(l).then(()=>{h()}):h()}))}else return}async changeFrame(e,t,n){if(t&&e){Cf=!1,Lo=!1;const i=await this.downloadModel(e,t._id),[s,o]=this.getCustomisations(n),[l,h]=this.getCustomisations(t.customisation);Cf=!!(l||s&&(s==null?void 0:s.sku)!=="lens-default"),Lo=!!(h||o&&(o==null?void 0:o.sku)!=="orbital-default"),await this.renderModel(i.asset.cloudfrontUrl,i.decryptionKey).then(async()=>new Promise(async(u,d)=>{!s||(s==null?void 0:s.sku)=="lens-default"?(l&&this.updateLensMaterial(l),u()):(this.updateLensMaterial(s),u()),(o==null?void 0:o.sku)=="orbital-default"?h&&await this.updateOrbitalMaterial(h).then(()=>{u()}):await this.updateOrbitalMaterial(o).then(()=>{u()})}))}}async changeLens(e,t,n,i){return new Promise((s,o)=>{if(n)this.changeFrame(t,i,e).then(()=>{s()});else{Jm&&(Jm.visible=!0);const l=e.find(h=>(h==null?void 0:h.type)=="Lens");this.updateLensMaterial(l),Km=!0,s()}})}async changeOrbital(e){return new Promise(async(t,n)=>{$m&&($m.visible=!0),await this.updateOrbitalMaterial(e).then(()=>{Zm=!0,t()})})}async changeGemType(e,t,n){return new Promise(async(i,s)=>{try{const o=new Ve(`#${t}`);n0?(e0=o,t0=n,r0=!0,i()):(Ia[e].material.uniforms.color.value=o.multiplyScalar(n),this.updateSelectiveBloom(cc,Ku),i())}catch(o){s(o)}})}async flashFocusOnZone(e,t,n,i){return new Promise(async(s,o)=>{try{const l=Ia[e].material.uniforms.color.value,h=new Ve(t).multiplyScalar(n);Xm.to(l,{r:h.r,g:h.g,b:h.b,ease:"sine.inOut",duration:.2,onStart:function(){n0=!0},onUpdate:function(){Ia[e].material.uniforms.color.value=l},onComplete:function(){n0=!1}}).yoyo(!0).repeat(i*2-1).then(()=>{r0&&(Ia[e].material.uniforms.color.value=e0.multiplyScalar(t0??1),this.updateSelectiveBloom(cc,Ku),r0=!1,e0=void 0,t0=void 0),s()})}catch(l){o(l)}})}snapCamToPos(e){return new Promise(async(t,n)=>{var i;try{if(!this.camera||!this.renderer)return;const s=(i=b7[e])==null?void 0:i.value;Xm.to(this.camera.position,{duration:1,ease:"sine.inOut",x:s.x,y:s.y,z:s.z}).then(()=>t())}catch(s){n(s)}})}}class P7{constructor(){xt(this,"customRenderer"),this.customRenderer=new U7}async Init(e,t){this.customRenderer.isInitialised||(await this.customRenderer.intialise(t),this.customRenderer.setupAndRenderScene(e))}loadFirstFrame(e,t,n){return new Promise((i,s)=>{this.customRenderer.loadFirstFrame(e,t,n).then(()=>{i(1)}).catch(o=>{s(o)})})}changeFrame(e,t,n){return this.customRenderer.changeFrame(e,t,n)}changeLens(e,t,n,i){return this.customRenderer.changeLens(e,t,n,i)}changeOrbital(e){return this.customRenderer.changeOrbital(e)}changeGemType(e,t,n){return this.customRenderer.changeGemType(e,t,n)}focusOnZone(e,t,n,i){return this.customRenderer.flashFocusOnZone(e,t,n,i)}snapCamToPos(e){return this.customRenderer.snapCamToPos(e)}}class JI{constructor(e){xt(this,"orgId"),xt(this,"rendererService"),xt(this,"isLoading",!1),xt(this,"userContainerId"),xt(this,"containerElement",null),xt(this,"defaultSelectorId","dita-3dconfig-element"),xt(this,"defaultCanvasStyle",{width:"100%",height:"100%"}),xt(this,"customisationArr",[]),xt(this,"assetDetails",null),this.userContainerId=e.userContainerId,this.rendererService=new P7,this.orgId=e.orgId}prepareDOM(){const e=this.userContainerId??this.defaultSelectorId,t=document.getElementById(e);if(!t)throw new Error(`Container not found to embed 3d-configurator ${this.defaultSelectorId}`);this.containerElement=t;const n=document.createElement("canvas");return n.className="sprie-config-webgl",t.innerHTML="",t.appendChild(n),Object.assign(n.style,this.defaultCanvasStyle),!0}snapCameraToPos(e){return this.rendererService.snapCamToPos(e)}async loadFrame(e){return this.assetDetails=e.data.assetDetails,this.customisationArr=e.data.customisation,this.prepareDOM(),await this.rendererService.Init(e.autoRotateSpeed,e.forInovati),await this.rendererService.loadFirstFrame(this.orgId,this.assetDetails,this.customisationArr),this}changeFrame(e,t){return this.rendererService.changeFrame(this.orgId,e,t)}changeLens(e,t,n){return this.rendererService.changeLens(e,this.orgId,t,n)}changeOrbital(e){return this.rendererService.changeOrbital(e)}changeGemType(e,t,n){return this.rendererService.changeGemType(e,t,n)}focusOnZone(e,t,n,i){return this.rendererService.focusOnZone(e,t,n,i)}unmount(){this.containerElement&&(this.containerElement.innerHTML="",this.containerElement.style.height="0px",this.containerElement.style.width="auto")}}class ZI{constructor(){xt(this,"events"),xt(this,"authService"),xt(this,"instanceArr"),this.authService=new rS,this.events=new dS,this.instanceArr=[]}async Init(e){await this.authService.Init(e),Pc.setJWT(this.authService.authPayload.JWT)}async loadBySKU(e){const t=await Lp.FetchAssetBySKUOrBarcode({sku:e.SKU,barcode:null});return await this.renderAsset({data:{assetDetails:t,customisation:t.customisation}})}async renderAsset(e){return new JI({orgId:this.authService.authPayload.ORGID,userContainerId:e.containerId}).loadFrame({containerId:e.containerId,data:{assetDetails:e.data.assetDetails,customisation:e.data.customisation}})}async getInstance(e){return new JI({orgId:this.authService.authPayload.ORGID,userContainerId:e.containerId})}}window.ThreeDConfigurator=ZI;const rO="",sr=/iPhone|iPad|iPod|Android/i.test(navigator.userAgent),nO="";var Sf=(r=>(r.Front="Front",r.Back="Back",r.Left="Left",r.Right="Right",r.Top="Top",r.Bottom="Bottom",r))(Sf||{}),mn=(r=>(r.LoadedCustomiser="Frame customiser loaded.",r.EnteredViewer="3d view of a frame with view orientation buttons",r.EnteredFramesListSection="Select a frame from the list of available frames.",r.EnteredOrbitalsListSection="Select a frame from the list of available frames.",r.EnteredLensListSection="Select a lens from the list of available lenses.",r.EnteredEngravingSection="Choose custom engraving for your frame.",r.ChangedViewFront="Changed orientation to front view",r.ChangedViewBack="Changed orientation to back view",r.ChangedViewLeft="Changed orientation to left view",r.ChangedViewRight="Changed orientation to right view",r.ChangedViewTop="Changed orientation to top view",r.ChangedViewBottom="Changed orientation to bottom view",r.ChangedFrame="Changed current 3d frame to ",r.ChangedLens="Changed current lens to ",r.ChangedOrbital="Changed current orbital to ",r.AddedEngravingText="Added the engraving text ",r.EnteredEngravingTextInput="Enter upto 15 characters for engraving. Press enter to submit.",r.EngravingInputAvailable="Input text box for engraving text is available on tab",r.EngravingInputHidden="Input text box for engraving text is disabled",r))(mn||{});function k7({frameList:r,selectedFrame:e,modelLoading:t,isSelected:n,paletteEntered:i,onChangeFrame:s}){const o=Ye.useRef(null),l=Ye.useRef(null),h=()=>{o.current&&(o.current.textContent=mn.EnteredFramesListSection)};return Ye.useEffect(()=>{i&&l.current&&l.current.querySelectorAll(".sprie-config-palette-img-box")[0].firstChild.focus()},[i]),Se.jsxs("div",{className:"sprie-config-palette",ref:l,style:{gap:sr?"3rem":"5rem",display:n?"flex":"none",padding:"0 3rem"},children:[Se.jsx("span",{className:"sprie-config-sr-only","aria-live":"assertive",ref:o}),r==null?void 0:r.map(u=>Se.jsxs("div",{className:"sprie-config-palette-img-box",children:[Se.jsx("button",{"aria-labelledby":(e==null?void 0:e._id)===u._id?"sprie-config-frameName":"",style:{border:"0",cursor:t?"default":"pointer",width:sr?45:60,height:sr?45:60},onClick:()=>s(u),onFocus:()=>h(),disabled:t,children:Se.jsx("img",{"aria-label":`Select frame ${u.name}`,src:u.variantImage,alt:u.name+"image",className:`sprie-config-image ${sr?"mobile-view":""}`,style:{border:(e==null?void 0:e._id)===u._id?"2px solid #9d9b9c":"0",borderRadius:"50%",padding:"1px"}})}),Se.jsxs("p",{className:"sprie-config-palette-img-text",children:[Se.jsx("span",{className:"sprie-config-palette-imgName",children:u.name}),Se.jsx("span",{id:"sprie-config-frameName",className:"sprie-config-sr-only",children:`Selected frame ${u.name}`})]})]},u._id))]})}function Q7({lensList:r,selectedLens:e,selectedDitaLens:t,modelLoading:n,isSelected:i,paletteEntered:s,onChangeLens:o}){const l=Ye.useRef(null),h=Ye.useRef(null),u=()=>{l.current&&(l.current.textContent=mn.EnteredLensListSection)};return Ye.useEffect(()=>{s&&h.current&&h.current.querySelectorAll(".sprie-config-palette-img-box")[0].firstChild.focus()},[s]),Se.jsxs("div",{className:"sprie-config-palette",ref:h,style:{display:i?"flex":"none",padding:"0 3rem",gap:sr?"3rem":"5rem"},children:[Se.jsx("span",{className:"sprie-config-sr-only","aria-live":"assertive",ref:l}),r==null?void 0:r.map(d=>Se.jsxs("div",{className:"sprie-config-palette-img-box",children:[Se.jsx("button",{"aria-labelledby":(e==null?void 0:e._id)===d._id?"sprie-config-lensName":"",style:{border:"0",cursor:n?"default":"pointer",width:sr?45:60,height:sr?45:60},onClick:()=>o(d),onFocus:u,disabled:n,children:Se.jsx("img",{"aria-label":`Select lens ${d.name}`,src:d.thumbnail,alt:d.name+"image",className:`sprie-config-image ${sr?"mobile-view":""}`,style:{border:(e==null?void 0:e._id)===d._id?"2px solid #9d9b9c":"0",borderRadius:"50%",padding:"1px"}})}),Se.jsxs("p",{className:"sprie-config-palette-img-text",style:{bottom:"-1.2rem",textAlign:"center"},children:[Se.jsx("span",{className:"sprie-config-palette-imgName",children:`${d.name}`}),Se.jsx("br",{}),(e==null?void 0:e._id)===d._id&&Se.jsx("span",{className:"sprie-config-price-tag",children:(t==null?void 0:t.variantId)==0?"":`(+ ${t==null?void 0:t.variantPrice}.00 ${t==null?void 0:t.priceCurrency})`}),Se.jsxs("span",{id:"sprie-config-lensName",className:"sprie-config-sr-only",children:[" ",`Selected lens ${d.name}`]})]})]},d._id))]})}const iO="";function O7({heading:r,isSelected:e,onEngravingLinkClicked:t,onChecked:n,onTextAdded:i,paletteEntered:s}){const[o,l]=Ye.useState(""),[h,u]=Ye.useState(!1),[d,A]=Ye.useState(!1);Ye.useState(!1);const p=Ye.useRef(null),g=Ye.useRef(null),_=Ye.useRef(null);Ye.useEffect(()=>{n(h),h&&p.current?(p.current.style.backgroundColor="#ffffff",_.current&&(_.current.textContent=mn.EngravingInputAvailable)):!h&&p.current&&(p.current.style.backgroundColor="transparent",_.current&&(_.current.textContent=mn.EngravingInputHidden),l(""))}),Ye.useEffect(()=>{d&&o!=""&&i(o)},[d]),Ye.useEffect(()=>{var v;s&&((v=g.current)==null||v.focus())},[s]);const E=()=>{_.current&&(_.current.textContent=mn.EnteredEngravingSection)},m=v=>{var w;v.key==="Enter"&&(i(o),(w=p.current)==null||w.blur(),_.current&&(_.current.textContent=mn.AddedEngravingText+o))};return Se.jsxs("div",{className:"sprie-config-engraving-block",style:{display:e?"flex":"none",marginTop:".5rem"},children:[Se.jsx("span",{className:"sprie-config-sr-only","aria-live":"assertive",ref:_}),Se.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".8rem"},children:[Se.jsx("input",{type:"checkbox",ref:g,className:"sprie-config-engraving-checkbox",onChange:v=>{u(v.target.checked)},onFocus:E,checked:h}),Se.jsxs("p",{style:{fontSize:".9rem",color:"#4d4d4d",fontWeight:"500",margin:"0"},children:["Add ","Laser Engraving"," ",Se.jsx("span",{style:{fontWeight:"400"},children:"(OPTIONAL)"})]})]}),Se.jsxs("div",{className:"sprie-config-engraving-inputField-block",children:[Se.jsx("input",{"aria-label":mn.EnteredEngravingTextInput,type:"text",ref:p,className:"sprie-config-engraving-inputField",placeholder:"ADD CUSTOM TEXT",value:o,onChange:v=>l(v.target.value),maxLength:15,style:{padding:"0.7rem"},disabled:!h,onBlur:()=>A(!0),onFocus:()=>A(!1),onKeyDown:v=>m(v)}),Se.jsx("span",{className:"sprie-config-engraving-inputInfo",children:`${o.length}/15 characters`})]})]})}const sO="";function F7({totalSteps:r,currentStep:e}){return Se.jsx("div",{className:"step-tracker-block",style:{margin:sr?"auto":""}})}function z7({nextSlide:r,previousSlide:e,currentIndex:t,stepsName:n,isLastStep:i}){const s=()=>{e()},o=()=>{r()};return Se.jsxs("div",{className:"carousel-header",children:[Se.jsx("button",{className:"carousel-btn prev","aria-label":`return to the step number ${t} : ${n[t-1]}`,"aria-hidden":t==0,onClick:s,style:{visibility:t!==0?"visible":"hidden"},children:Se.jsx("i",{className:"arrow left-arrow",style:{padding:".25rem"}})}),Se.jsxs("p",{children:[Se.jsx("span",{className:"step-syntax",children:`STEP ${t+1} of ${n.length} : `}),Se.jsx("span",{className:"select-syntax",children:n[t]})]}),Se.jsx("button",{className:"carousel-btn next","aria-label":`advance to step number ${t+2} : ${n[t+1]}`,"aria-hidden":!!i,onClick:o,style:{visibility:i?"hidden":"visible"},children:Se.jsx("i",{className:"arrow right-arrow",style:{padding:".25rem"}})})]})}function H7({setShowAddToCart:r,setSelectedChild:e,setSectionEntered:t,children:n}){var g;const[i,s]=Ye.useState(0),o=Nh.Children.toArray(n),l=i===o.length-1,h=Ye.useRef(null),u=(g=o.map(_=>_))==null?void 0:g.map(_=>_.props.heading),d=()=>{s(_=>_===0?Nh.Children.count(n)-1:_-1),h.current&&h.current.focus()},A=()=>{s(_=>_===Nh.Children.count(n)-1?0:_+1),h.current&&h.current.focus()};Ye.useEffect(()=>{r(!!l)},[l]),Ye.useEffect(()=>{e(i)},[i]);const p=_=>{(_.key==="Enter"||_.key===" ")&&_.target===h.current&&t(i)};return Se.jsxs("div",{className:"carousel",children:[Se.jsx("span",{className:"sprie-config-sr-only",id:"sprie-config-step-selector",children:`Customisation Step Selector. ${l?"This is an optional":""} Step ${i+1} -
4550
4550
  ${o[i].props.heading}.
4551
- Press enter to `+(l?"configure your optional custom engraving. Add to cart button is now present at the end of this section.":"select or press tab for next.")}),Se.jsxs("div",{tabIndex:0,style:{height:"30%",alignContent:"center"},"aria-labelledby":"sprie-config-step-selector",onKeyDown:p,ref:h,children:[Se.jsx(z7,{nextSlide:A,previousSlide:d,currentIndex:i,stepsName:u,isLastStep:l}),Se.jsx(F7,{totalSteps:u==null?void 0:u.length,currentStep:i+1})]}),Se.jsx("div",{className:"carousel-container",style:{paddingTop:sr?"":"1rem"},children:o.map((_,E)=>Se.jsx("div",{className:"carousel-item",style:{transform:`translateX(-${i*100}%)`},children:_},E))})]})}const aO="";function $I({conditionRequired:r,onButtonClick:e}){const[t,n]=Ye.useState(!1),i=Ye.useRef(null),s=Ye.useRef(null);return Ye.useEffect(()=>{s.current&&(s.current.disabled=!t)},[t]),Ye.useEffect(()=>{i.current&&(i.current.style.display=r?"flex":"none"),s.current&&(s.current.disabled=r)},[r]),Se.jsxs("div",{className:"sprie-config-add-to-cart-block",children:[Se.jsxs("label",{htmlFor:"Sprie-Config-return-policy-checkbox",id:"Sprie-Config-return-policy-label",ref:i,style:{display:"none"},children:[Se.jsx("input",{type:"checkbox","aria-label":"return policy checkbox","aria-describedby":"sprie-config-return-policy-desc",id:"Sprie-Config-return-policy-checkbox",name:"sprie-config-return-policy-checkbox",onChange:o=>n(o.target.checked),checked:t}),Se.jsx("p",{id:"sprie-config-return-policy-desc",children:"I agree this customized Item cannot be returned or exchanged."})]}),Se.jsx("button",{className:"sprie-config-add-to-cart-btn",ref:s,onClick:e,children:"ADD TO CART"})]})}function G7({orbitalList:r,selectedOrbital:e,modelLoading:t,isSelected:n,paletteEntered:i,onChangeOrbital:s}){const o=Ye.useRef(null),l=Ye.useRef(null),h=()=>{o.current&&(o.current.textContent=mn.EnteredOrbitalsListSection)};return Ye.useEffect(()=>{i&&l.current&&l.current.querySelectorAll(".sprie-config-palette-img-box")[0].firstChild.focus()},[i]),Se.jsxs("div",{className:"sprie-config-palette",ref:l,style:{display:n?"flex":"none",padding:"0 3rem",gap:sr?"3rem":"5rem"},children:[Se.jsx("span",{className:"sprie-config-sr-only","aria-live":"assertive",ref:o}),r==null?void 0:r.map(u=>Se.jsxs("div",{className:"sprie-config-palette-img-box",children:[Se.jsx("button",{"aria-labelledby":(e==null?void 0:e._id)===u._id?"sprie-config-orbitalName":"",style:{border:"0",cursor:t?"default":"pointer",width:sr?45:60,height:sr?45:60},onClick:()=>s(u),onFocus:h,disabled:t,children:Se.jsx("img",{"aria-label":`Select orbital ${u.name}`,src:u.thumbnail,alt:u.name+"image",className:`sprie-config-image ${sr?"mobile-view":""}`,style:{border:(e==null?void 0:e._id)===u._id?"2px solid #9d9b9c":"0",borderRadius:"50%",padding:"1px"}})}),Se.jsxs("p",{className:"sprie-config-palette-img-text",style:{bottom:"-1.5rem"},children:[Se.jsx("span",{className:"sprie-config-palette-imgName",children:u.name}),Se.jsx("span",{id:"sprie-config-orbitalName",className:"sprie-config-sr-only",children:`Selected orbital ${u.name}`})]})]},u._id))]})}const V7="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/Pgo8IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDIwMDEwOTA0Ly9FTiIKICJodHRwOi8vd3d3LnczLm9yZy9UUi8yMDAxL1JFQy1TVkctMjAwMTA5MDQvRFREL3N2ZzEwLmR0ZCI+CjxzdmcgdmVyc2lvbj0iMS4wIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiB3aWR0aD0iMzIwLjAwMDAwMHB0IiBoZWlnaHQ9IjY2LjAwMDAwMHB0IiB2aWV3Qm94PSIwIDAgMzIwLjAwMDAwMCA2Ni4wMDAwMDAiCiBwcmVzZXJ2ZUFzcGVjdFJhdGlvPSJ4TWlkWU1pZCBtZWV0Ij4KCjxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAuMDAwMDAwLDY2LjAwMDAwMCkgc2NhbGUoMC4xMDAwMDAsLTAuMTAwMDAwKSIKZmlsbD0iIzAwMDAwMCIgc3Ryb2tlPSJub25lIj4KPHBhdGggZD0iTTAgNjUxIGMwIC02IDkgLTExIDIxIC0xMSAxMSAwIDI5IC01IDQwIC0xMCAxOCAtMTAgMTkgLTI0IDE5IC0zMDAKMCAtMjc2IC0xIC0yOTAgLTE5IC0zMDAgLTExIC01IC0yOSAtMTAgLTQwIC0xMCAtMTIgMCAtMjEgLTQgLTIxIC0xMCAwIC0xNAo0NDUgLTEzIDUxMiAxIDEwNyAyMyAxOTAgODUgMjM5IDE3OSAyMCAzNyAyNCA2MCAyNCAxMzUgMCA3OCAtNCA5NyAtMjggMTQ3Ci0zNCA3MCAtMTAwIDEzMCAtMTc2IDE2MCAtNTIgMjEgLTc1IDIzIC0zMTMgMjYgLTE4MCAyIC0yNTggMCAtMjU4IC03eiBtNDcwCi0zNiBjMTUgLTggMzggLTI3IDQ5IC00MSAyMCAtMjUgMjEgLTM5IDIxIC0yMzggMCAtMTk0IC0yIC0yMTQgLTIwIC0yNDQgLTExCi0xOCAtMzYgLTQwIC01NSAtNDggLTQ2IC0xOSAtMTM1IC0xOCAtMTYzIDIgLTIyIDE1IC0yMiAxNyAtMjIgMzAwIGwwIDI4NCA4MAowIGM1MiAwIDkxIC01IDExMCAtMTV6Ii8+CjxwYXRoIGQ9Ik05ODAgNjUwIGMwIC01IDExIC0xMCAyNCAtMTAgNTUgMCA1NiAtNyA1NiAtMzEwIDAgLTMwMyAtMSAtMzEwIC01NgotMzEwIC0xMyAwIC0yNCAtNCAtMjQgLTEwIDAgLTYgNjcgLTEwIDE4MCAtMTAgMTEzIDAgMTgwIDQgMTgwIDEwIDAgNiAtMTEgMTAKLTIzIDEwIC0xMyAwIC0zMSA4IC00MCAxOCAtMTUgMTYgLTE3IDUyIC0xNyAyOTQgMCAyNTQgMSAyNzYgMTggMjkxIDEwIDEwIDI4CjE3IDQwIDE3IDEyIDAgMjIgNSAyMiAxMCAwIDYgLTY3IDEwIC0xODAgMTAgLTExMyAwIC0xODAgLTQgLTE4MCAtMTB6Ii8+CjxwYXRoIGQ9Ik0xNTI2IDYwMSBjLTI1IC0zMyAtNDYgLTY0IC00NiAtNzAgMCAtNiAyNCA1IDU0IDI0IDUzIDM0IDE1OSA3NQoxOTQgNzUgMTAgMCAyOCAtMTAgNDAgLTIzIDIxIC0yMyAyMiAtMzAgMjIgLTI4OSAwIC0yODkgLTIgLTI5OCAtNTYgLTI5OCAtMTMKMCAtMjQgLTQgLTI0IC0xMCAwIC02IDY3IC0xMCAxODAgLTEwIDExMyAwIDE4MCA0IDE4MCAxMCAwIDYgLTExIDEwIC0yNCAxMAotNTQgMCAtNTYgOSAtNTYgMjk0IDAgMjUxIDEgMjY1IDIxIDI5MCAxMSAxNCAzMCAyNiA0MiAyNiAzNyAtMSAxNTMgLTQ2IDIwMQotNzggMjUgLTE3IDQ2IC0yNyA0NiAtMjEgMCA2IC0yMSAzNyAtNDYgNzAgbC00NyA1OSAtMzE3IDAgLTMxNyAwIC00NyAtNTl6Ii8+CjxwYXRoIGQ9Ik0yNDU1IDY1MCBjMyAtNSAxNSAtMTAgMjYgLTEwIDMwIDAgNjUgLTI3IDk3IC03NiBsMjkgLTQzIC05MCAtMTc4CmMtMTM2IC0yNzAgLTE2MyAtMzEzIC0xOTggLTMyMCAtNTkgLTExIC0yNiAtMjMgNjYgLTIzIDg5IDAgMTIxIDExIDc1IDI1IC0yOQo5IC0yNiA1NSAxMCAxMjYgbDMxIDYwIDE1MSAtMyAxNTEgLTMgMzkgLTczIGMzMCAtNTkgMzYgLTc3IDI4IC05MyAtNiAtMTAKLTIwIC0xOSAtMzAgLTE5IC0xMSAwIC0yMCAtNCAtMjAgLTEwIDAgLTYgNzAgLTEwIDE5MCAtMTAgMTIwIDAgMTkwIDQgMTkwIDEwCjAgNiAtMTEgMTAgLTI0IDEwIC0xNCAwIC0zNiAxMCAtNTAgMjMgLTE1IDEyIC0xMDYgMTU1IC0yMDQgMzE3IGwtMTc3IDI5NQotMTQ4IDMgYy0xMDAgMiAtMTQ2IC0xIC0xNDIgLTh6IG0yNTggLTM5OCBjLTM1IC0yIC05MiAtMiAtMTI3IDAgbC02NCAzIDYwCjExMyA2MCAxMTMgNjcgLTExMyA2NyAtMTEzIC02MyAtM3oiLz4KPC9nPgo8L3N2Zz4K",j7="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI4LjMuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCA4ODYgNjk4IiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA4ODYgNjk4OyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+Cgkuc3Qwe2ZpbGw6IzkxODQ3RTt9Cjwvc3R5bGU+CjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik04NDAuMDEsNDEuMDFjLTM2LjcxLTMxLjU2LTEwOC45NC01Ny45Ny0yNDQuNi00LjU2Yy0yMC40Nyw4LjA2LTQxLjQ2LDE3LjU3LTYyLjc1LDI4LjM2CgljMTkuMzgtNC42Niw0MzEuNTItMTAxLDE3NS42MSwxOTkuNDJsLTAuMDQsMGMtMjUuODUsMzUuNS01Ny44Miw3Mi4wOC05NC40MiwxMDcuOTdsLTMyLjcyLTI4LjE0bC02LjQ0LDE0MS43NmwxNjQuODQtNS41NwoJbC00NC4zNC0zOC4xMmM2NS41NC02My43NCwxMTcuODUtMTI5Ljk0LDE1MC4yMi0xOTAuNzdDOTA3LjQ0LDEzNC42OSw4NzYuNzEsNzIuNTcsODQwLjAxLDQxLjAxeiIvPgo8cGF0aCBjbGFzcz0ic3QwIiBkPSJNNTYyLjE3LDQyNS42N2MtNjQuNDcsNDYuMi0xMzIuNjcsODYuMjItMTk4LjQzLDExNi43NmMtMC4wOSwwLjA0LTAuMTcsMC4wOC0wLjI1LDAuMTMKCUMtMTkuMjcsNzMwLjcyLDczLjg2LDQ0MS4xMyw4OC4wNyw0MDEuNDVsLTIuMDktMS41MWMtMTQuNjcsMTcuOTMtMjcuNiwzNS42MS0zOC41Myw1Mi44NEMtMjQuNCw1NjYsMTEuMTYsNjI2LjI3LDUzLjY0LDY1Ni44OQoJYzQyLjQ4LDMwLjYzLDEyNi4wNyw1Ni4yNSwyODMuMDUsNC40M2M5OS0zMi42OSwyMDguNTgtODkuNywzMTAuMDYtMTYxLjE5bC04My43Ny0wLjQ2TDU2Mi4xNyw0MjUuNjd6Ii8+CjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik0yMTIuOSwxOTcuNzRjMCwzNS41NC0yNS43Myw1Mi44MS00MS45OCw1Mi44MXYxLjAxYzIwLjY1LDAsNDYuMzcsMTUuOTEsNDYuMzcsNTEuNDUKCWMwLDM3LjkxLTM0LjE5LDYzLjk4LTgzLjYxLDYzLjk4Yy00My42NywwLTcxLjA5LTE3LjI3LTgzLjk1LTU0Ljg0bDQyLjMxLTE4Ljk2YzQuNzQsMjQuMzcsMTcuMjYsMzYuMjIsNDEuOTgsMzYuMjIKCWMyMy43LDAsMzcuOTEtMTIuODcsMzcuNTctMzIuNWMtMC4zNC0yMC45OS0xMy4yLTI4Ljc4LTM5Ljk0LTI4Ljc4aC0xMS4xN3YtMzIuNWg5LjQ4YzI0LjM3LDAsMzYuNTYtOS44MiwzNi41Ni0yOS43OQoJYzAuMzQtMjAuNjUtMTEuNTEtMzEuNDgtMzEuODItMzEuNDhjLTIwLjY1LDAtMzMuODUsMTAuODMtMzYuOSwzMS44MmwtNDEuNjQtMTUuMjNjOC44LTM2LjksNDAuNjItNTQuMTYsODAuNTYtNTQuMTYKCUMxODUuODIsMTM2LjgxLDIxMi45LDE2Mi41NCwyMTIuOSwxOTcuNzR6Ii8+CjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik0zOTYuOTgsMTg1LjU2bC0zOS4yNywxOC4yOGMtNS40Mi0xNy42LTE3LjI2LTI4LjQzLTM4LjkzLTI4LjQzYy0yOC43OCwwLTQ5LjA4LDMwLjgtNDkuMDgsNzYuMTZ2NS43NmgxLjAxCgljNy40NS0yMy4wMiwzMS4xNC0zMy41MSw1Ni44Ny0zMy41MWM0Mi45OSwwLDczLjEyLDI3LjQyLDczLjEyLDcwLjQxYzAsNDQuMzQtMzAuOCw3Mi43OC04Mi42LDcyLjc4CgljLTU4LjIzLDAtOTAuMzgtNDIuOTktOTAuMzgtMTE1LjA5YzAtNzcuNTIsNDAuNjItMTE1LjA5LDk0LjExLTExNS4wOUMzNTcuNzEsMTM2LjgxLDM4NC4xMiwxNTAuMzUsMzk2Ljk4LDE4NS41NnogTTI4MC41MywyOTMuNTQKCWMwLDIyLjM0LDE1LjIzLDM2LjIyLDM4LjI1LDM2LjIyYzI0LjAzLDAsMzcuOTEtMTMuMiwzNy45MS0zNi4yMmMwLTIyLTEzLjg4LTM1LjU0LTM3LjkxLTM1LjU0CglDMjk1Ljc2LDI1OCwyODAuNTMsMjcyLjIyLDI4MC41MywyOTMuNTR6Ii8+CjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik00MTQuNzgsMjUxLjkxYzAtNzUuNDksMzAuMTMtMTE1LjA5LDg5LjM3LTExNS4wOXM4OS4zNywzOS42LDg5LjM3LDExNS4wOVM1NjMuMzgsMzY3LDUwNC4xNSwzNjcKCVM0MTQuNzgsMzI3LjM5LDQxNC43OCwyNTEuOTF6IE01NDYuOCwyNTEuOTFjMC01My4xNS0xMy44OC03Ny41Mi00Mi42NS03Ny41MmMtMjguNzcsMC00Mi42NSwyNC4zNy00Mi42NSw3Ny41MgoJYzAsNTMuMTUsMTMuODgsNzcuNTIsNDIuNjUsNzcuNTJDNTMyLjkyLDMyOS40Myw1NDYuOCwzMDUuMDUsNTQ2LjgsMjUxLjkxeiIvPgo8cGF0aCBjbGFzcz0ic3QwIiBkPSJNNTg4LjIsMTI4LjEzYzAtMTguNjMsMTMuNzgtMzIuMDIsMzIuOTktMzIuMDJjMTkuMjEsMCwzMi45OSwxMy4zOSwzMi45OSwzMi4wMnMtMTMuNzgsMzIuMDItMzIuOTksMzIuMDIKCUM2MDEuOTcsMTYwLjE0LDU4OC4yLDE0Ni43Niw1ODguMiwxMjguMTN6IE02NDAuNTksMTI4LjEzYzAtMTEuMjUtOC4xNS0xOS40LTE5LjQtMTkuNHMtMTkuNCw4LjE1LTE5LjQsMTkuNHM4LjE1LDE5LjQsMTkuNCwxOS40CglTNjQwLjU5LDEzOS4zOCw2NDAuNTksMTI4LjEzeiIvPgo8L3N2Zz4K",W7="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciICB2aWV3Qm94PSIwIDAgNjQgNjQiIHdpZHRoPSI0OHB4IiBoZWlnaHQ9IjQ4cHgiPjxwYXRoIGQ9Ik0gMTYgMTQgQyAxNS40ODggMTQgMTQuOTc2OTM4IDE0LjE5NDkzNyAxNC41ODU5MzggMTQuNTg1OTM4IEMgMTMuODA0OTM3IDE1LjM2NjkzNyAxMy44MDQ5MzcgMTYuNjMzMDYzIDE0LjU4NTkzOCAxNy40MTQwNjIgTCAyOS4xNzE4NzUgMzIgTCAxNC41ODU5MzggNDYuNTg1OTM4IEMgMTMuODA0OTM4IDQ3LjM2NjkzOCAxMy44MDQ5MzcgNDguNjMzMDYzIDE0LjU4NTkzOCA0OS40MTQwNjIgQyAxNC45NzY5MzcgNDkuODA1MDYyIDE1LjQ4OCA1MCAxNiA1MCBDIDE2LjUxMiA1MCAxNy4wMjMwNjIgNDkuODA1MDYyIDE3LjQxNDA2MiA0OS40MTQwNjIgTCAzMiAzNC44MjgxMjUgTCA0Ni41ODU5MzggNDkuNDE0MDYyIEMgNDcuMzY2OTM4IDUwLjE5NTA2MyA0OC42MzMwNjMgNTAuMTk1MDYyIDQ5LjQxNDA2MiA0OS40MTQwNjIgQyA1MC4xOTUwNjMgNDguNjMzMDYyIDUwLjE5NTA2MiA0Ny4zNjY5MzcgNDkuNDE0MDYyIDQ2LjU4NTkzOCBMIDM0LjgyODEyNSAzMiBMIDQ5LjQxNDA2MiAxNy40MTQwNjIgQyA1MC4xOTUwNjMgMTYuNjMzMDYzIDUwLjE5NTA2MiAxNS4zNjY5MzggNDkuNDE0MDYyIDE0LjU4NTkzOCBDIDQ4LjYzMzA2MiAxMy44MDQ5MzggNDcuMzY2OTM3IDEzLjgwNDkzOCA0Ni41ODU5MzggMTQuNTg1OTM4IEwgMzIgMjkuMTcxODc1IEwgMTcuNDE0MDYyIDE0LjU4NTkzOCBDIDE3LjAyMzA2MiAxNC4xOTQ5MzggMTYuNTEyIDE0IDE2IDE0IHoiLz48L3N2Zz4=",oO="";function Y7({snapCameraTo:r}){const e=Object.keys(Tf).map(s=>({label:Tf[s],isDisabled:!0})),[t,n]=Ye.useState(),i=s=>{n(s),r(s)};return Se.jsx("div",{className:"sprie-3d-snap-button-block",children:e.map((s,o)=>Se.jsx("button",{className:"sprie-3d-snap-button","aria-label":`orient 3d frame to ${s.label} view`,style:{backgroundColor:t!==s.label?"#ccc":"#000",color:t!==s.label?"#f3f3f3":"#fff"},onClick:()=>{i(Tf[s.label])},children:s.label},o))})}function q7({frameName:r,customEvent:e,apiService:t,frameList:n,lensList:i,orbitalList:s,showOrbitalList:o,viewerOnly:l,domService:h,ThreeDConfigurator:u,dataVariants:d,dataLenses:A,dataOrbitals:p,firstDitaVariant:g}){const[_,E]=Ye.useState(0),[m,v]=Ye.useState(),[w,x]=Ye.useState(),[I,R]=Ye.useState(),[S,T]=Ye.useState(),[D,b]=Ye.useState(!1),[M,L]=Ye.useState(!1);Ye.useState(!1),Ye.useState(!1);const[P,N]=Ye.useState(sr?M?35:30:M?28:25),[W,X]=Ye.useState(sr?10:8),[K,te]=Ye.useState(),[V,ee]=Ye.useState(),[Q,z]=Ye.useState(),[Z,re]=Ye.useState(!1),[j,de]=Ye.useState("placeholder"),[Ae,_e]=Ye.useState(0),Ee=Ye.useRef(null),Le=Ye.useRef(),st=Ye.useRef(null);Le.current=h;const se={variantId:0,variantName:"defaultName",variantPrice:0,priceCurrency:"defaultCurrency",varinatSku:"lens-default"};let et,Qe,ct;const Ke=fe=>{Le.current&&(Le.current.snapCameraToPos(fe),Me(mn[`ChangedView${fe}`]))},pt=async(fe,De)=>{fe._id===(w==null?void 0:w._id)&&!De||Le.current&&(b(!0),Le.current.changeFrame(fe,[I,S]).then(()=>{b(!1)}),x(fe),te(d==null?void 0:d.find(Be=>Be.varinatSku==fe.sku)),Me(`${mn.ChangedFrame}${fe.name}`))},Y=fe=>fe==null?void 0:fe.customisation.find(Be=>Be.type=="Lens"),k=async fe=>{var nt;if(!Le.current||fe==I)return;const De=fe.sku=="lens-default",Be=Y(w),be=me();if(!Be&&De?(b(!0),Le.current.changeLens([fe,S],!0,w).then(()=>{b(!1)})):!Be&&!De?(I==null?void 0:I.sku)=="lens-default"?(b(!0),Le.current.changeLens([fe,S],!0,w).then(()=>{b(!1)})):Le.current.changeLens([fe,S],!1,w):Be&&De?Le.current.changeLens([Be,S],!1,w):Le.current.changeLens([fe,S],!1,w),fe.sku=="lens-default")ee(se),Me(`${mn.ChangedLens}${se.variantName}`);else{const lt=(nt=fe.metadata.find(ut=>ut.key==be))==null?void 0:nt.value,dt=A==null?void 0:A.find(ut=>ut.variantId===Number.parseInt(lt));ee(dt),Me(`${mn.ChangedLens}${fe.name}. Price will increase by ${V==null?void 0:V.variantPrice} ${V==null?void 0:V.priceCurrency}`)}R(fe)},le=async fe=>{Le.current&&fe!=S&&(b(!0),await Le.current.changeOrbital(fe).then(()=>{z(p==null?void 0:p.find(De=>De.variantId==Number(fe.sku))),b(!1)}),T(fe),Me(`${mn.ChangedOrbital}${fe.name}`))},pe=()=>{if(K&&V){const fe=K.variantPrice,De=V.variantPrice;return fe+De}return 0},me=()=>{var Be;if(!w)return;const fe=(Be=w.metadata.find(be=>be.key=="baseCurve"))==null?void 0:Be.value;let De="variantId";return fe=="2B"?De="2bVariantId":fe=="6B"&&(De="6bVariantId"),De},ye=fe=>{re(fe)},He=fe=>{de(fe)},Ie=()=>{var fe,De;sr?(fe=document.querySelector('[id$="main-laser-etch-popover"]'))==null||fe.setAttribute("open",""):(De=document.querySelector('[id$="main-laser-etch-drawer"]'))==null||De.setAttribute("open","")},je=()=>{if(o&&!Q||!(w&&I)||w.name.toLowerCase().includes("default")||I.name.toLowerCase().includes("default"))return;const fe=w.metadata.find(O=>O.key=="variantId"),De=w.metadata.find(O=>O.key=="baseCurve");let Be="variantId";De&&De.value=="2B"?Be="2bVariantId":De&&De.value=="6B"&&(Be="6bVariantId");const be=I.metadata.find(O=>O.key==Be),nt=fe?Number(fe.value):null,lt=be?Number(be.value):null,dt=Q!=null&&Q.variantId?Number(Q.variantId):null,ut={frameIdentifier:nt,lensIdentifier:lt,orbitalIdentifier:dt};e.emitEvent("onAddToCart",ut);const ht=new Date().getTime(),H=[];if(lt&&be){const O={id:lt,quantity:1,properties:{_uniqueTimestamp:ht}};H.push(O)}if(dt&&(Q!=null&&Q.variantId)){const O={id:dt,quantity:1,properties:{_uniqueTimestamp:ht}};H.push(O)}if(Z){const O={id:44745490890985,quantity:1,properties:{_uniqueTimestamp:ht}};H.push(O)}if(fe){const O={id:nt,quantity:1,properties:Z?{_uniqueTimestamp:ht,customText:j}:{_uniqueTimestamp:ht}};H.push(O)}t.HandleShopifyAddToCart(H,ht)},Ge=()=>{var fe,De;sr?(fe=document.querySelector(".popover.hidden-lap-and-up.popover-full"))==null||fe.removeAttribute("open"):(De=document.querySelector(".drawer.drawer--full.hidden-phone.lens-customizer"))==null||De.removeAttribute("open")};Ye.useEffect(()=>{N(sr?M?35:30:M?28:25)},[M]),Ye.useEffect(()=>{n&&(o?n&&!et&&(et=n.find(fe=>fe._id=="660c23a0d1d8f617271918f3"),x(et)):x(n[0]))},[n]),Ye.useEffect(()=>{o?(i&&!Qe&&(Qe=i.find(fe=>fe._id=="65111d718d4c652ece493034"),k(Qe).then(()=>_e(pe()))),s&&!ct&&(ct=s.find(fe=>fe._id=="660c1c0231c23bd36b188fd4"),le(ct))):i&&!I&&R(i[0])},[w]),Ye.useEffect(()=>{te(g)},[g]),Ye.useEffect(()=>{},[Z,j]),Ye.useEffect(()=>{_e(pe())},[K,V]);const Me=fe=>{st.current&&(st.current.textContent=fe)};return Se.jsxs("section",{id:"sprie-config-main-container",ref:Ee,children:[!l&&Se.jsxs("header",{id:"sprie-config-main-header",style:{height:`${W}%`},children:[Se.jsxs("div",{id:"sprie-config-header-content",children:[Se.jsx("img",{src:V7,alt:"dita-logo",width:97,height:20}),Se.jsxs("p",{style:{margin:"0"},className:"sprie-config-mainHeader-frameName",children:[r," CUSTOMIZER"]})]}),Se.jsx("button",{className:"sprie-config-main-header-close",onClick:Ge,"aria-label":"close frame customizer",children:Se.jsx("img",{src:W7,alt:"close",style:{width:"2rem",height:"2rem"}})})]}),Se.jsx("span",{className:"sprie-config-sr-only",ref:st,"aria-live":"assertive"}),Se.jsxs("section",{tabIndex:0,"aria-label":"3D viewer",onFocus:()=>Me(mn.EnteredViewer),id:"sprie-config-viewer-container",style:{height:`${l?100:100-(P+W+(sr?8.5:0))}%`},children:[!l&&Se.jsx("img",{src:j7,alt:"360deg-logo",width:44,height:34}),!l&&Se.jsx(Y7,{snapCameraTo:Ke}),D&&Se.jsx("div",{className:"sprie-config-loadingFrame",children:Se.jsx("div",{className:"sprie-config-loader"})}),Se.jsx("div",{style:{width:"100%",height:"100%"},id:"holder-canvas"})]}),!l&&Se.jsxs("section",{id:"Sprie-config-Cust-block",style:{height:`${P}%`},children:[Se.jsxs(H7,{setShowAddToCart:L,setSelectedChild:E,setSectionEntered:v,children:[Se.jsx(k7,{modelLoading:D,frameList:n,selectedFrame:w,isSelected:_===0,onChangeFrame:pt,heading:"SELECT FRAME COLOR",paletteEntered:m===0}),o&&Se.jsx(G7,{orbitalList:s,selectedOrbital:S,modelLoading:D,isSelected:_===1,onChangeOrbital:le,heading:"SELECT ORBITAL COLOR",paletteEntered:m===1}),Se.jsx(Q7,{modelLoading:D,lensList:i,selectedLens:I,selectedDitaLens:V,isSelected:_===(o?2:1),paletteEntered:m===(o?2:1),onChangeLens:k,heading:"SELECT LENS COLOR"}),Se.jsx(O7,{heading:"LASER ENGRAVING",isSelected:_===(o?3:2),paletteEntered:m===(o?3:2),onEngravingLinkClicked:Ie,onChecked:ye,onTextAdded:He})]}),Se.jsxs("div",{className:"sprie-config-price-block",children:[Se.jsx("p",{id:"sprie-config-price-text",style:{bottom:sr?"100%":"",margin:"0 0.8rem 0.5rem 0"},children:`${Ae}.00 ${K==null?void 0:K.priceCurrency} `}),!sr&&M&&Se.jsx($I,{conditionRequired:!0,onButtonClick:je}),M&&Se.jsx("p",{id:"sprie-config-process-time-text",style:{fontSize:".9rem",textAlign:"right",marginTop:"0",marginBottom:"0.5rem"},children:"Please Allow 7-10 Days for Customization Process."})]}),sr&&M&&Se.jsx("div",{style:{position:"absolute",bottom:"0%",width:"100%"},children:Se.jsx($I,{conditionRequired:!0,onButtonClick:je})})]})]})}function X7({apiService:r,sku:e,events:t,viewerOnly:n=!1}){var A;const i=Ye.useRef(),[s,o]=Ye.useState(null),l=(s==null?void 0:s.frameName)||"",h=(s==null?void 0:s.frameList)||null,u=(s==null?void 0:s.lensList)||null,d=(s==null?void 0:s.orbitalList)||null;return s!=null&&s.dataVariants,s!=null&&s.dataLenses,s!=null&&s.dataOrbitals,Ye.useEffect(()=>((async()=>{var v,w;i.current=new ZI,await((v=i.current)==null?void 0:v.Init(r.apiKey)),e.includes("7806")&&e.endsWith("x")&&(e="7806-G-SMK-PLD-52-Zx");const p=await r.FetchAssetBySKUOrBarcode({sku:e,barcode:null}),g=((w=p==null?void 0:p.customisation)==null?void 0:w.filter(x=>x.type==="Orbital").length)>0,_=await r.FetchCustomisationList("Lens",!g),E=await r.FetchCustomisationList("Orbital",!g),m=await i.current.getInstance({containerId:"holder-canvas"});await m.loadFrame({containerId:"holder-canvas",data:{assetDetails:p,customisation:p==null?void 0:p.customisation}}),o({frameList:p==null?void 0:p.variants,lensList:_==null?void 0:_.data,orbitalList:E==null?void 0:E.data,frameName:p==null?void 0:p.group.name,showOrbitals:g,domService:m,dataVariants:await r.PopulateDataList("data-variants"),dataLenses:await r.PopulateDataList("data-lenses"),dataOrbitals:await r.PopulateDataList("data-orbital")})})(),()=>{i.current=void 0}),[r,e]),Se.jsxs(Se.Fragment,{children:[(!h||!u)&&Se.jsxs("div",{children:[Se.jsx("span",{id:"sprie-config-loader-srtext",className:"sprie-config-sr-only",children:"Loading frame customiser"}),Se.jsx("div",{className:"sprie-config-loadingBox","aria-labelledby":"sprie-config-loader-srtext",children:"Loading..."})]}),Se.jsx(q7,{customEvent:t,frameName:l,apiService:r,frameList:h,lensList:u,orbitalList:d,showOrbitalList:(s==null?void 0:s.showOrbitals)||!1,viewerOnly:n,ThreeDConfigurator:i.current,domService:s==null?void 0:s.domService,dataVariants:s==null?void 0:s.dataVariants,dataLenses:s==null?void 0:s.dataLenses,dataOrbitals:s==null?void 0:s.dataOrbitals,firstDitaVariant:(A=s==null?void 0:s.dataVariants)==null?void 0:A.find(p=>p.varinatSku==e)})]})}var a0={},eC={exports:{}},bn={},o0={exports:{}},l0={};/**
4551
+ Press enter to `+(l?"configure your optional custom engraving. Add to cart button is now present at the end of this section.":"select or press tab for next.")}),Se.jsxs("div",{tabIndex:0,style:{height:"30%",alignContent:"center"},"aria-labelledby":"sprie-config-step-selector",onKeyDown:p,ref:h,children:[Se.jsx(z7,{nextSlide:A,previousSlide:d,currentIndex:i,stepsName:u,isLastStep:l}),Se.jsx(F7,{totalSteps:u==null?void 0:u.length,currentStep:i+1})]}),Se.jsx("div",{className:"carousel-container",style:{paddingTop:sr?"":"1rem"},children:o.map((_,E)=>Se.jsx("div",{className:"carousel-item",style:{transform:`translateX(-${i*100}%)`},children:_},E))})]})}const aO="";function $I({conditionRequired:r,onButtonClick:e}){const[t,n]=Ye.useState(!1),i=Ye.useRef(null),s=Ye.useRef(null);return Ye.useEffect(()=>{s.current&&(s.current.disabled=!t)},[t]),Ye.useEffect(()=>{i.current&&(i.current.style.display=r?"flex":"none"),s.current&&(s.current.disabled=r)},[r]),Se.jsxs("div",{className:"sprie-config-add-to-cart-block",children:[Se.jsxs("label",{htmlFor:"Sprie-Config-return-policy-checkbox",id:"Sprie-Config-return-policy-label",ref:i,style:{display:"none"},children:[Se.jsx("input",{type:"checkbox","aria-label":"return policy checkbox","aria-describedby":"sprie-config-return-policy-desc",id:"Sprie-Config-return-policy-checkbox",name:"sprie-config-return-policy-checkbox",onChange:o=>n(o.target.checked),checked:t}),Se.jsx("p",{id:"sprie-config-return-policy-desc",children:"I agree this customized Item cannot be returned or exchanged."})]}),Se.jsx("button",{className:"sprie-config-add-to-cart-btn",ref:s,onClick:e,children:"ADD TO CART"})]})}function G7({orbitalList:r,selectedOrbital:e,modelLoading:t,isSelected:n,paletteEntered:i,onChangeOrbital:s}){const o=Ye.useRef(null),l=Ye.useRef(null),h=()=>{o.current&&(o.current.textContent=mn.EnteredOrbitalsListSection)};return Ye.useEffect(()=>{i&&l.current&&l.current.querySelectorAll(".sprie-config-palette-img-box")[0].firstChild.focus()},[i]),Se.jsxs("div",{className:"sprie-config-palette",ref:l,style:{display:n?"flex":"none",padding:"0 3rem",gap:sr?"3rem":"5rem"},children:[Se.jsx("span",{className:"sprie-config-sr-only","aria-live":"assertive",ref:o}),r==null?void 0:r.map(u=>Se.jsxs("div",{className:"sprie-config-palette-img-box",children:[Se.jsx("button",{"aria-labelledby":(e==null?void 0:e._id)===u._id?"sprie-config-orbitalName":"",style:{border:"0",cursor:t?"default":"pointer",width:sr?45:60,height:sr?45:60},onClick:()=>s(u),onFocus:h,disabled:t,children:Se.jsx("img",{"aria-label":`Select orbital ${u.name}`,src:u.thumbnail,alt:u.name+"image",className:`sprie-config-image ${sr?"mobile-view":""}`,style:{border:(e==null?void 0:e._id)===u._id?"2px solid #9d9b9c":"0",borderRadius:"50%",padding:"1px"}})}),Se.jsxs("p",{className:"sprie-config-palette-img-text",style:{bottom:"-1.5rem"},children:[Se.jsx("span",{className:"sprie-config-palette-imgName",children:u.name}),Se.jsx("span",{id:"sprie-config-orbitalName",className:"sprie-config-sr-only",children:`Selected orbital ${u.name}`})]})]},u._id))]})}const V7="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/Pgo8IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDIwMDEwOTA0Ly9FTiIKICJodHRwOi8vd3d3LnczLm9yZy9UUi8yMDAxL1JFQy1TVkctMjAwMTA5MDQvRFREL3N2ZzEwLmR0ZCI+CjxzdmcgdmVyc2lvbj0iMS4wIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiB3aWR0aD0iMzIwLjAwMDAwMHB0IiBoZWlnaHQ9IjY2LjAwMDAwMHB0IiB2aWV3Qm94PSIwIDAgMzIwLjAwMDAwMCA2Ni4wMDAwMDAiCiBwcmVzZXJ2ZUFzcGVjdFJhdGlvPSJ4TWlkWU1pZCBtZWV0Ij4KCjxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAuMDAwMDAwLDY2LjAwMDAwMCkgc2NhbGUoMC4xMDAwMDAsLTAuMTAwMDAwKSIKZmlsbD0iIzAwMDAwMCIgc3Ryb2tlPSJub25lIj4KPHBhdGggZD0iTTAgNjUxIGMwIC02IDkgLTExIDIxIC0xMSAxMSAwIDI5IC01IDQwIC0xMCAxOCAtMTAgMTkgLTI0IDE5IC0zMDAKMCAtMjc2IC0xIC0yOTAgLTE5IC0zMDAgLTExIC01IC0yOSAtMTAgLTQwIC0xMCAtMTIgMCAtMjEgLTQgLTIxIC0xMCAwIC0xNAo0NDUgLTEzIDUxMiAxIDEwNyAyMyAxOTAgODUgMjM5IDE3OSAyMCAzNyAyNCA2MCAyNCAxMzUgMCA3OCAtNCA5NyAtMjggMTQ3Ci0zNCA3MCAtMTAwIDEzMCAtMTc2IDE2MCAtNTIgMjEgLTc1IDIzIC0zMTMgMjYgLTE4MCAyIC0yNTggMCAtMjU4IC03eiBtNDcwCi0zNiBjMTUgLTggMzggLTI3IDQ5IC00MSAyMCAtMjUgMjEgLTM5IDIxIC0yMzggMCAtMTk0IC0yIC0yMTQgLTIwIC0yNDQgLTExCi0xOCAtMzYgLTQwIC01NSAtNDggLTQ2IC0xOSAtMTM1IC0xOCAtMTYzIDIgLTIyIDE1IC0yMiAxNyAtMjIgMzAwIGwwIDI4NCA4MAowIGM1MiAwIDkxIC01IDExMCAtMTV6Ii8+CjxwYXRoIGQ9Ik05ODAgNjUwIGMwIC01IDExIC0xMCAyNCAtMTAgNTUgMCA1NiAtNyA1NiAtMzEwIDAgLTMwMyAtMSAtMzEwIC01NgotMzEwIC0xMyAwIC0yNCAtNCAtMjQgLTEwIDAgLTYgNjcgLTEwIDE4MCAtMTAgMTEzIDAgMTgwIDQgMTgwIDEwIDAgNiAtMTEgMTAKLTIzIDEwIC0xMyAwIC0zMSA4IC00MCAxOCAtMTUgMTYgLTE3IDUyIC0xNyAyOTQgMCAyNTQgMSAyNzYgMTggMjkxIDEwIDEwIDI4CjE3IDQwIDE3IDEyIDAgMjIgNSAyMiAxMCAwIDYgLTY3IDEwIC0xODAgMTAgLTExMyAwIC0xODAgLTQgLTE4MCAtMTB6Ii8+CjxwYXRoIGQ9Ik0xNTI2IDYwMSBjLTI1IC0zMyAtNDYgLTY0IC00NiAtNzAgMCAtNiAyNCA1IDU0IDI0IDUzIDM0IDE1OSA3NQoxOTQgNzUgMTAgMCAyOCAtMTAgNDAgLTIzIDIxIC0yMyAyMiAtMzAgMjIgLTI4OSAwIC0yODkgLTIgLTI5OCAtNTYgLTI5OCAtMTMKMCAtMjQgLTQgLTI0IC0xMCAwIC02IDY3IC0xMCAxODAgLTEwIDExMyAwIDE4MCA0IDE4MCAxMCAwIDYgLTExIDEwIC0yNCAxMAotNTQgMCAtNTYgOSAtNTYgMjk0IDAgMjUxIDEgMjY1IDIxIDI5MCAxMSAxNCAzMCAyNiA0MiAyNiAzNyAtMSAxNTMgLTQ2IDIwMQotNzggMjUgLTE3IDQ2IC0yNyA0NiAtMjEgMCA2IC0yMSAzNyAtNDYgNzAgbC00NyA1OSAtMzE3IDAgLTMxNyAwIC00NyAtNTl6Ii8+CjxwYXRoIGQ9Ik0yNDU1IDY1MCBjMyAtNSAxNSAtMTAgMjYgLTEwIDMwIDAgNjUgLTI3IDk3IC03NiBsMjkgLTQzIC05MCAtMTc4CmMtMTM2IC0yNzAgLTE2MyAtMzEzIC0xOTggLTMyMCAtNTkgLTExIC0yNiAtMjMgNjYgLTIzIDg5IDAgMTIxIDExIDc1IDI1IC0yOQo5IC0yNiA1NSAxMCAxMjYgbDMxIDYwIDE1MSAtMyAxNTEgLTMgMzkgLTczIGMzMCAtNTkgMzYgLTc3IDI4IC05MyAtNiAtMTAKLTIwIC0xOSAtMzAgLTE5IC0xMSAwIC0yMCAtNCAtMjAgLTEwIDAgLTYgNzAgLTEwIDE5MCAtMTAgMTIwIDAgMTkwIDQgMTkwIDEwCjAgNiAtMTEgMTAgLTI0IDEwIC0xNCAwIC0zNiAxMCAtNTAgMjMgLTE1IDEyIC0xMDYgMTU1IC0yMDQgMzE3IGwtMTc3IDI5NQotMTQ4IDMgYy0xMDAgMiAtMTQ2IC0xIC0xNDIgLTh6IG0yNTggLTM5OCBjLTM1IC0yIC05MiAtMiAtMTI3IDAgbC02NCAzIDYwCjExMyA2MCAxMTMgNjcgLTExMyA2NyAtMTEzIC02MyAtM3oiLz4KPC9nPgo8L3N2Zz4K",j7="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI4LjMuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCA4ODYgNjk4IiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA4ODYgNjk4OyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+Cgkuc3Qwe2ZpbGw6IzkxODQ3RTt9Cjwvc3R5bGU+CjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik04NDAuMDEsNDEuMDFjLTM2LjcxLTMxLjU2LTEwOC45NC01Ny45Ny0yNDQuNi00LjU2Yy0yMC40Nyw4LjA2LTQxLjQ2LDE3LjU3LTYyLjc1LDI4LjM2CgljMTkuMzgtNC42Niw0MzEuNTItMTAxLDE3NS42MSwxOTkuNDJsLTAuMDQsMGMtMjUuODUsMzUuNS01Ny44Miw3Mi4wOC05NC40MiwxMDcuOTdsLTMyLjcyLTI4LjE0bC02LjQ0LDE0MS43NmwxNjQuODQtNS41NwoJbC00NC4zNC0zOC4xMmM2NS41NC02My43NCwxMTcuODUtMTI5Ljk0LDE1MC4yMi0xOTAuNzdDOTA3LjQ0LDEzNC42OSw4NzYuNzEsNzIuNTcsODQwLjAxLDQxLjAxeiIvPgo8cGF0aCBjbGFzcz0ic3QwIiBkPSJNNTYyLjE3LDQyNS42N2MtNjQuNDcsNDYuMi0xMzIuNjcsODYuMjItMTk4LjQzLDExNi43NmMtMC4wOSwwLjA0LTAuMTcsMC4wOC0wLjI1LDAuMTMKCUMtMTkuMjcsNzMwLjcyLDczLjg2LDQ0MS4xMyw4OC4wNyw0MDEuNDVsLTIuMDktMS41MWMtMTQuNjcsMTcuOTMtMjcuNiwzNS42MS0zOC41Myw1Mi44NEMtMjQuNCw1NjYsMTEuMTYsNjI2LjI3LDUzLjY0LDY1Ni44OQoJYzQyLjQ4LDMwLjYzLDEyNi4wNyw1Ni4yNSwyODMuMDUsNC40M2M5OS0zMi42OSwyMDguNTgtODkuNywzMTAuMDYtMTYxLjE5bC04My43Ny0wLjQ2TDU2Mi4xNyw0MjUuNjd6Ii8+CjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik0yMTIuOSwxOTcuNzRjMCwzNS41NC0yNS43Myw1Mi44MS00MS45OCw1Mi44MXYxLjAxYzIwLjY1LDAsNDYuMzcsMTUuOTEsNDYuMzcsNTEuNDUKCWMwLDM3LjkxLTM0LjE5LDYzLjk4LTgzLjYxLDYzLjk4Yy00My42NywwLTcxLjA5LTE3LjI3LTgzLjk1LTU0Ljg0bDQyLjMxLTE4Ljk2YzQuNzQsMjQuMzcsMTcuMjYsMzYuMjIsNDEuOTgsMzYuMjIKCWMyMy43LDAsMzcuOTEtMTIuODcsMzcuNTctMzIuNWMtMC4zNC0yMC45OS0xMy4yLTI4Ljc4LTM5Ljk0LTI4Ljc4aC0xMS4xN3YtMzIuNWg5LjQ4YzI0LjM3LDAsMzYuNTYtOS44MiwzNi41Ni0yOS43OQoJYzAuMzQtMjAuNjUtMTEuNTEtMzEuNDgtMzEuODItMzEuNDhjLTIwLjY1LDAtMzMuODUsMTAuODMtMzYuOSwzMS44MmwtNDEuNjQtMTUuMjNjOC44LTM2LjksNDAuNjItNTQuMTYsODAuNTYtNTQuMTYKCUMxODUuODIsMTM2LjgxLDIxMi45LDE2Mi41NCwyMTIuOSwxOTcuNzR6Ii8+CjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik0zOTYuOTgsMTg1LjU2bC0zOS4yNywxOC4yOGMtNS40Mi0xNy42LTE3LjI2LTI4LjQzLTM4LjkzLTI4LjQzYy0yOC43OCwwLTQ5LjA4LDMwLjgtNDkuMDgsNzYuMTZ2NS43NmgxLjAxCgljNy40NS0yMy4wMiwzMS4xNC0zMy41MSw1Ni44Ny0zMy41MWM0Mi45OSwwLDczLjEyLDI3LjQyLDczLjEyLDcwLjQxYzAsNDQuMzQtMzAuOCw3Mi43OC04Mi42LDcyLjc4CgljLTU4LjIzLDAtOTAuMzgtNDIuOTktOTAuMzgtMTE1LjA5YzAtNzcuNTIsNDAuNjItMTE1LjA5LDk0LjExLTExNS4wOUMzNTcuNzEsMTM2LjgxLDM4NC4xMiwxNTAuMzUsMzk2Ljk4LDE4NS41NnogTTI4MC41MywyOTMuNTQKCWMwLDIyLjM0LDE1LjIzLDM2LjIyLDM4LjI1LDM2LjIyYzI0LjAzLDAsMzcuOTEtMTMuMiwzNy45MS0zNi4yMmMwLTIyLTEzLjg4LTM1LjU0LTM3LjkxLTM1LjU0CglDMjk1Ljc2LDI1OCwyODAuNTMsMjcyLjIyLDI4MC41MywyOTMuNTR6Ii8+CjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik00MTQuNzgsMjUxLjkxYzAtNzUuNDksMzAuMTMtMTE1LjA5LDg5LjM3LTExNS4wOXM4OS4zNywzOS42LDg5LjM3LDExNS4wOVM1NjMuMzgsMzY3LDUwNC4xNSwzNjcKCVM0MTQuNzgsMzI3LjM5LDQxNC43OCwyNTEuOTF6IE01NDYuOCwyNTEuOTFjMC01My4xNS0xMy44OC03Ny41Mi00Mi42NS03Ny41MmMtMjguNzcsMC00Mi42NSwyNC4zNy00Mi42NSw3Ny41MgoJYzAsNTMuMTUsMTMuODgsNzcuNTIsNDIuNjUsNzcuNTJDNTMyLjkyLDMyOS40Myw1NDYuOCwzMDUuMDUsNTQ2LjgsMjUxLjkxeiIvPgo8cGF0aCBjbGFzcz0ic3QwIiBkPSJNNTg4LjIsMTI4LjEzYzAtMTguNjMsMTMuNzgtMzIuMDIsMzIuOTktMzIuMDJjMTkuMjEsMCwzMi45OSwxMy4zOSwzMi45OSwzMi4wMnMtMTMuNzgsMzIuMDItMzIuOTksMzIuMDIKCUM2MDEuOTcsMTYwLjE0LDU4OC4yLDE0Ni43Niw1ODguMiwxMjguMTN6IE02NDAuNTksMTI4LjEzYzAtMTEuMjUtOC4xNS0xOS40LTE5LjQtMTkuNHMtMTkuNCw4LjE1LTE5LjQsMTkuNHM4LjE1LDE5LjQsMTkuNCwxOS40CglTNjQwLjU5LDEzOS4zOCw2NDAuNTksMTI4LjEzeiIvPgo8L3N2Zz4K",W7="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciICB2aWV3Qm94PSIwIDAgNjQgNjQiIHdpZHRoPSI0OHB4IiBoZWlnaHQ9IjQ4cHgiPjxwYXRoIGQ9Ik0gMTYgMTQgQyAxNS40ODggMTQgMTQuOTc2OTM4IDE0LjE5NDkzNyAxNC41ODU5MzggMTQuNTg1OTM4IEMgMTMuODA0OTM3IDE1LjM2NjkzNyAxMy44MDQ5MzcgMTYuNjMzMDYzIDE0LjU4NTkzOCAxNy40MTQwNjIgTCAyOS4xNzE4NzUgMzIgTCAxNC41ODU5MzggNDYuNTg1OTM4IEMgMTMuODA0OTM4IDQ3LjM2NjkzOCAxMy44MDQ5MzcgNDguNjMzMDYzIDE0LjU4NTkzOCA0OS40MTQwNjIgQyAxNC45NzY5MzcgNDkuODA1MDYyIDE1LjQ4OCA1MCAxNiA1MCBDIDE2LjUxMiA1MCAxNy4wMjMwNjIgNDkuODA1MDYyIDE3LjQxNDA2MiA0OS40MTQwNjIgTCAzMiAzNC44MjgxMjUgTCA0Ni41ODU5MzggNDkuNDE0MDYyIEMgNDcuMzY2OTM4IDUwLjE5NTA2MyA0OC42MzMwNjMgNTAuMTk1MDYyIDQ5LjQxNDA2MiA0OS40MTQwNjIgQyA1MC4xOTUwNjMgNDguNjMzMDYyIDUwLjE5NTA2MiA0Ny4zNjY5MzcgNDkuNDE0MDYyIDQ2LjU4NTkzOCBMIDM0LjgyODEyNSAzMiBMIDQ5LjQxNDA2MiAxNy40MTQwNjIgQyA1MC4xOTUwNjMgMTYuNjMzMDYzIDUwLjE5NTA2MiAxNS4zNjY5MzggNDkuNDE0MDYyIDE0LjU4NTkzOCBDIDQ4LjYzMzA2MiAxMy44MDQ5MzggNDcuMzY2OTM3IDEzLjgwNDkzOCA0Ni41ODU5MzggMTQuNTg1OTM4IEwgMzIgMjkuMTcxODc1IEwgMTcuNDE0MDYyIDE0LjU4NTkzOCBDIDE3LjAyMzA2MiAxNC4xOTQ5MzggMTYuNTEyIDE0IDE2IDE0IHoiLz48L3N2Zz4=",oO="";function Y7({snapCameraTo:r}){const e=Object.keys(Sf).map(s=>({label:Sf[s],isDisabled:!0})),[t,n]=Ye.useState(),i=s=>{n(s),r(s)};return Se.jsx("div",{className:"sprie-3d-snap-button-block",children:e.map((s,o)=>Se.jsx("button",{className:"sprie-3d-snap-button","aria-label":`orient 3d frame to ${s.label} view`,style:{backgroundColor:t!==s.label?"#ccc":"#000",color:t!==s.label?"#f3f3f3":"#fff"},onClick:()=>{i(Sf[s.label])},children:s.label},o))})}function q7({frameName:r,customEvent:e,apiService:t,frameList:n,lensList:i,orbitalList:s,showOrbitalList:o,viewerOnly:l,domService:h,ThreeDConfigurator:u,dataVariants:d,dataLenses:A,dataOrbitals:p,firstDitaVariant:g}){const[_,E]=Ye.useState(0),[m,v]=Ye.useState(),[w,x]=Ye.useState(),[I,R]=Ye.useState(),[S,T]=Ye.useState(),[D,b]=Ye.useState(!1),[M,L]=Ye.useState(!1);Ye.useState(!1),Ye.useState(!1);const[P,N]=Ye.useState(sr?M?35:30:M?28:25),[W,X]=Ye.useState(sr?10:8),[K,te]=Ye.useState(),[V,ee]=Ye.useState(),[Q,z]=Ye.useState(),[Z,re]=Ye.useState(!1),[j,de]=Ye.useState("placeholder"),[Ae,_e]=Ye.useState(0),Ee=Ye.useRef(null),Le=Ye.useRef(),st=Ye.useRef(null);Le.current=h;const se={variantId:0,variantName:"defaultName",variantPrice:0,priceCurrency:"defaultCurrency",varinatSku:"lens-default"};let et,Qe,ct;const Ke=fe=>{Le.current&&(Le.current.snapCameraToPos(fe),Me(mn[`ChangedView${fe}`]))},pt=async(fe,De)=>{fe._id===(w==null?void 0:w._id)&&!De||Le.current&&(b(!0),Le.current.changeFrame(fe,[I,S]).then(()=>{b(!1)}),x(fe),te(d==null?void 0:d.find(Be=>Be.varinatSku==fe.sku)),Me(`${mn.ChangedFrame}${fe.name}`))},Y=fe=>fe==null?void 0:fe.customisation.find(Be=>Be.type=="Lens"),k=async fe=>{var nt;if(!Le.current||fe==I)return;const De=fe.sku=="lens-default",Be=Y(w),be=me();if(!Be&&De?(b(!0),Le.current.changeLens([fe,S],!0,w).then(()=>{b(!1)})):!Be&&!De?(I==null?void 0:I.sku)=="lens-default"?(b(!0),Le.current.changeLens([fe,S],!0,w).then(()=>{b(!1)})):Le.current.changeLens([fe,S],!1,w):Be&&De?Le.current.changeLens([Be,S],!1,w):Le.current.changeLens([fe,S],!1,w),fe.sku=="lens-default")ee(se),Me(`${mn.ChangedLens}${se.variantName}`);else{const lt=(nt=fe.metadata.find(ut=>ut.key==be))==null?void 0:nt.value,dt=A==null?void 0:A.find(ut=>ut.variantId===Number.parseInt(lt));ee(dt),Me(`${mn.ChangedLens}${fe.name}. Price will increase by ${V==null?void 0:V.variantPrice} ${V==null?void 0:V.priceCurrency}`)}R(fe)},le=async fe=>{Le.current&&fe!=S&&(b(!0),await Le.current.changeOrbital(fe).then(()=>{z(p==null?void 0:p.find(De=>De.variantId==Number(fe.sku))),b(!1)}),T(fe),Me(`${mn.ChangedOrbital}${fe.name}`))},pe=()=>{if(K&&V){const fe=K.variantPrice,De=V.variantPrice;return fe+De}return 0},me=()=>{var Be;if(!w)return;const fe=(Be=w.metadata.find(be=>be.key=="baseCurve"))==null?void 0:Be.value;let De="variantId";return fe=="2B"?De="2bVariantId":fe=="6B"&&(De="6bVariantId"),De},ye=fe=>{re(fe)},He=fe=>{de(fe)},Ie=()=>{var fe,De;sr?(fe=document.querySelector('[id$="main-laser-etch-popover"]'))==null||fe.setAttribute("open",""):(De=document.querySelector('[id$="main-laser-etch-drawer"]'))==null||De.setAttribute("open","")},je=()=>{if(o&&!Q||!(w&&I)||w.name.toLowerCase().includes("default")||I.name.toLowerCase().includes("default"))return;const fe=w.metadata.find(O=>O.key=="variantId"),De=w.metadata.find(O=>O.key=="baseCurve");let Be="variantId";De&&De.value=="2B"?Be="2bVariantId":De&&De.value=="6B"&&(Be="6bVariantId");const be=I.metadata.find(O=>O.key==Be),nt=fe?Number(fe.value):null,lt=be?Number(be.value):null,dt=Q!=null&&Q.variantId?Number(Q.variantId):null,ut={frameIdentifier:nt,lensIdentifier:lt,orbitalIdentifier:dt};e.emitEvent("onAddToCart",ut);const ht=new Date().getTime(),H=[];if(lt&&be){const O={id:lt,quantity:1,properties:{_uniqueTimestamp:ht}};H.push(O)}if(dt&&(Q!=null&&Q.variantId)){const O={id:dt,quantity:1,properties:{_uniqueTimestamp:ht}};H.push(O)}if(Z){const O={id:44745490890985,quantity:1,properties:{_uniqueTimestamp:ht}};H.push(O)}if(fe){const O={id:nt,quantity:1,properties:Z?{_uniqueTimestamp:ht,customText:j}:{_uniqueTimestamp:ht}};H.push(O)}t.HandleShopifyAddToCart(H,ht)},Ge=()=>{var fe,De;sr?(fe=document.querySelector(".popover.hidden-lap-and-up.popover-full"))==null||fe.removeAttribute("open"):(De=document.querySelector(".drawer.drawer--full.hidden-phone.lens-customizer"))==null||De.removeAttribute("open")};Ye.useEffect(()=>{N(sr?M?35:30:M?28:25)},[M]),Ye.useEffect(()=>{n&&(o?n&&!et&&(et=n.find(fe=>fe._id=="660c23a0d1d8f617271918f3"),x(et)):x(n[0]))},[n]),Ye.useEffect(()=>{o?(i&&!Qe&&(Qe=i.find(fe=>fe._id=="65111d718d4c652ece493034"),k(Qe).then(()=>_e(pe()))),s&&!ct&&(ct=s.find(fe=>fe._id=="660c1c0231c23bd36b188fd4"),le(ct))):i&&!I&&R(i[0])},[w]),Ye.useEffect(()=>{te(g)},[g]),Ye.useEffect(()=>{},[Z,j]),Ye.useEffect(()=>{_e(pe())},[K,V]);const Me=fe=>{st.current&&(st.current.textContent=fe)};return Se.jsxs("section",{id:"sprie-config-main-container",ref:Ee,children:[!l&&Se.jsxs("header",{id:"sprie-config-main-header",style:{height:`${W}%`},children:[Se.jsxs("div",{id:"sprie-config-header-content",children:[Se.jsx("img",{src:V7,alt:"dita-logo",width:97,height:20}),Se.jsxs("p",{style:{margin:"0"},className:"sprie-config-mainHeader-frameName",children:[r," CUSTOMIZER"]})]}),Se.jsx("button",{className:"sprie-config-main-header-close",onClick:Ge,"aria-label":"close frame customizer",children:Se.jsx("img",{src:W7,alt:"close",style:{width:"2rem",height:"2rem"}})})]}),Se.jsx("span",{className:"sprie-config-sr-only",ref:st,"aria-live":"assertive"}),Se.jsxs("section",{tabIndex:0,"aria-label":"3D viewer",onFocus:()=>Me(mn.EnteredViewer),id:"sprie-config-viewer-container",style:{height:`${l?100:100-(P+W+(sr?8.5:0))}%`},children:[!l&&Se.jsx("img",{src:j7,alt:"360deg-logo",width:44,height:34}),!l&&Se.jsx(Y7,{snapCameraTo:Ke}),D&&Se.jsx("div",{className:"sprie-config-loadingFrame",children:Se.jsx("div",{className:"sprie-config-loader"})}),Se.jsx("div",{style:{width:"100%",height:"100%"},id:"holder-canvas"})]}),!l&&Se.jsxs("section",{id:"Sprie-config-Cust-block",style:{height:`${P}%`},children:[Se.jsxs(H7,{setShowAddToCart:L,setSelectedChild:E,setSectionEntered:v,children:[Se.jsx(k7,{modelLoading:D,frameList:n,selectedFrame:w,isSelected:_===0,onChangeFrame:pt,heading:"SELECT FRAME COLOR",paletteEntered:m===0}),o&&Se.jsx(G7,{orbitalList:s,selectedOrbital:S,modelLoading:D,isSelected:_===1,onChangeOrbital:le,heading:"SELECT ORBITAL COLOR",paletteEntered:m===1}),Se.jsx(Q7,{modelLoading:D,lensList:i,selectedLens:I,selectedDitaLens:V,isSelected:_===(o?2:1),paletteEntered:m===(o?2:1),onChangeLens:k,heading:"SELECT LENS COLOR"}),Se.jsx(O7,{heading:"LASER ENGRAVING",isSelected:_===(o?3:2),paletteEntered:m===(o?3:2),onEngravingLinkClicked:Ie,onChecked:ye,onTextAdded:He})]}),Se.jsxs("div",{className:"sprie-config-price-block",children:[Se.jsx("p",{id:"sprie-config-price-text",style:{bottom:sr?"100%":"",margin:"0 0.8rem 0.5rem 0"},children:`${Ae}.00 ${K==null?void 0:K.priceCurrency} `}),!sr&&M&&Se.jsx($I,{conditionRequired:!0,onButtonClick:je}),M&&Se.jsx("p",{id:"sprie-config-process-time-text",style:{fontSize:".9rem",textAlign:"right",marginTop:"0",marginBottom:"0.5rem"},children:"Please Allow 7-10 Days for Customization Process."})]}),sr&&M&&Se.jsx("div",{style:{position:"absolute",bottom:"0%",width:"100%"},children:Se.jsx($I,{conditionRequired:!0,onButtonClick:je})})]})]})}function X7({apiService:r,sku:e,events:t,viewerOnly:n=!1}){var A;const i=Ye.useRef(),[s,o]=Ye.useState(null),l=(s==null?void 0:s.frameName)||"",h=(s==null?void 0:s.frameList)||null,u=(s==null?void 0:s.lensList)||null,d=(s==null?void 0:s.orbitalList)||null;return s!=null&&s.dataVariants,s!=null&&s.dataLenses,s!=null&&s.dataOrbitals,Ye.useEffect(()=>((async()=>{var v,w;i.current=new ZI,await((v=i.current)==null?void 0:v.Init(r.apiKey)),e.includes("7806")&&e.endsWith("x")&&(e="7806-G-SMK-PLD-52-Zx");const p=await r.FetchAssetBySKUOrBarcode({sku:e,barcode:null}),g=((w=p==null?void 0:p.customisation)==null?void 0:w.filter(x=>x.type==="Orbital").length)>0,_=await r.FetchCustomisationList("Lens",!g),E=await r.FetchCustomisationList("Orbital",!g),m=await i.current.getInstance({containerId:"holder-canvas"});await m.loadFrame({containerId:"holder-canvas",data:{assetDetails:p,customisation:p==null?void 0:p.customisation}}),o({frameList:p==null?void 0:p.variants,lensList:_==null?void 0:_.data,orbitalList:E==null?void 0:E.data,frameName:p==null?void 0:p.group.name,showOrbitals:g,domService:m,dataVariants:await r.PopulateDataList("data-variants"),dataLenses:await r.PopulateDataList("data-lenses"),dataOrbitals:await r.PopulateDataList("data-orbital")})})(),()=>{i.current=void 0}),[r,e]),Se.jsxs(Se.Fragment,{children:[(!h||!u)&&Se.jsxs("div",{children:[Se.jsx("span",{id:"sprie-config-loader-srtext",className:"sprie-config-sr-only",children:"Loading frame customiser"}),Se.jsx("div",{className:"sprie-config-loadingBox","aria-labelledby":"sprie-config-loader-srtext",children:"Loading..."})]}),Se.jsx(q7,{customEvent:t,frameName:l,apiService:r,frameList:h,lensList:u,orbitalList:d,showOrbitalList:(s==null?void 0:s.showOrbitals)||!1,viewerOnly:n,ThreeDConfigurator:i.current,domService:s==null?void 0:s.domService,dataVariants:s==null?void 0:s.dataVariants,dataLenses:s==null?void 0:s.dataLenses,dataOrbitals:s==null?void 0:s.dataOrbitals,firstDitaVariant:(A=s==null?void 0:s.dataVariants)==null?void 0:A.find(p=>p.varinatSku==e)})]})}var a0={},eC={exports:{}},bn={},o0={exports:{}},l0={};/**
4552
4552
  * @license React
4553
4553
  * scheduler.production.min.js
4554
4554
  *
@@ -4568,7 +4568,7 @@ bool bvhIntersectFirstHit(
4568
4568
  `+z+a}var re=!1;function j(a,c){if(!a||re)return"";re=!0;var f=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(c)if(c=function(){throw Error()},Object.defineProperty(c.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(c,[])}catch(ce){var y=ce}Reflect.construct(a,[],c)}else{try{c.call()}catch(ce){y=ce}a.call(c.prototype)}else{try{throw Error()}catch(ce){y=ce}a()}}catch(ce){if(ce&&y&&typeof ce.stack=="string"){for(var C=ce.stack.split(`
4569
4569
  `),B=y.stack.split(`
4570
4570
  `),U=C.length-1,q=B.length-1;1<=U&&0<=q&&C[U]!==B[q];)q--;for(;1<=U&&0<=q;U--,q--)if(C[U]!==B[q]){if(U!==1||q!==1)do if(U--,q--,0>q||C[U]!==B[q]){var J=`
4571
- `+C[U].replace(" at new "," at ");return a.displayName&&J.includes("<anonymous>")&&(J=J.replace("<anonymous>",a.displayName)),J}while(1<=U&&0<=q);break}}}finally{re=!1,Error.prepareStackTrace=f}return(a=a?a.displayName||a.name:"")?Z(a):""}function de(a){switch(a.tag){case 5:return Z(a.type);case 16:return Z("Lazy");case 13:return Z("Suspense");case 19:return Z("SuspenseList");case 0:case 2:case 15:return a=j(a.type,!1),a;case 11:return a=j(a.type.render,!1),a;case 1:return a=j(a.type,!0),a;default:return""}}function Ae(a){if(a==null)return null;if(typeof a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case T:return"Fragment";case S:return"Portal";case b:return"Profiler";case D:return"StrictMode";case N:return"Suspense";case W:return"SuspenseList"}if(typeof a=="object")switch(a.$$typeof){case L:return(a.displayName||"Context")+".Consumer";case M:return(a._context.displayName||"Context")+".Provider";case P:var c=a.render;return a=a.displayName,a||(a=c.displayName||c.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case X:return c=a.displayName||null,c!==null?c:Ae(a.type)||"Memo";case K:c=a._payload,a=a._init;try{return Ae(a(c))}catch{}}return null}function _e(a){var c=a.type;switch(a.tag){case 24:return"Cache";case 9:return(c.displayName||"Context")+".Consumer";case 10:return(c._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return a=c.render,a=a.displayName||a.name||"",c.displayName||(a!==""?"ForwardRef("+a+")":"ForwardRef");case 7:return"Fragment";case 5:return c;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Ae(c);case 8:return c===D?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof c=="function")return c.displayName||c.name||null;if(typeof c=="string")return c}return null}function Ee(a){switch(typeof a){case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function Le(a){var c=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(c==="checkbox"||c==="radio")}function st(a){var c=Le(a)?"checked":"value",f=Object.getOwnPropertyDescriptor(a.constructor.prototype,c),y=""+a[c];if(!a.hasOwnProperty(c)&&typeof f<"u"&&typeof f.get=="function"&&typeof f.set=="function"){var C=f.get,B=f.set;return Object.defineProperty(a,c,{configurable:!0,get:function(){return C.call(this)},set:function(U){y=""+U,B.call(this,U)}}),Object.defineProperty(a,c,{enumerable:f.enumerable}),{getValue:function(){return y},setValue:function(U){y=""+U},stopTracking:function(){a._valueTracker=null,delete a[c]}}}}function se(a){a._valueTracker||(a._valueTracker=st(a))}function et(a){if(!a)return!1;var c=a._valueTracker;if(!c)return!0;var f=c.getValue(),y="";return a&&(y=Le(a)?a.checked?"true":"false":a.value),a=y,a!==f?(c.setValue(a),!0):!1}function Qe(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}function ct(a,c){var f=c.checked;return Q({},c,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:f??a._wrapperState.initialChecked})}function Ke(a,c){var f=c.defaultValue==null?"":c.defaultValue,y=c.checked!=null?c.checked:c.defaultChecked;f=Ee(c.value!=null?c.value:f),a._wrapperState={initialChecked:y,initialValue:f,controlled:c.type==="checkbox"||c.type==="radio"?c.checked!=null:c.value!=null}}function pt(a,c){c=c.checked,c!=null&&x(a,"checked",c,!1)}function Y(a,c){pt(a,c);var f=Ee(c.value),y=c.type;if(f!=null)y==="number"?(f===0&&a.value===""||a.value!=f)&&(a.value=""+f):a.value!==""+f&&(a.value=""+f);else if(y==="submit"||y==="reset"){a.removeAttribute("value");return}c.hasOwnProperty("value")?le(a,c.type,f):c.hasOwnProperty("defaultValue")&&le(a,c.type,Ee(c.defaultValue)),c.checked==null&&c.defaultChecked!=null&&(a.defaultChecked=!!c.defaultChecked)}function k(a,c,f){if(c.hasOwnProperty("value")||c.hasOwnProperty("defaultValue")){var y=c.type;if(!(y!=="submit"&&y!=="reset"||c.value!==void 0&&c.value!==null))return;c=""+a._wrapperState.initialValue,f||c===a.value||(a.value=c),a.defaultValue=c}f=a.name,f!==""&&(a.name=""),a.defaultChecked=!!a._wrapperState.initialChecked,f!==""&&(a.name=f)}function le(a,c,f){(c!=="number"||Qe(a.ownerDocument)!==a)&&(f==null?a.defaultValue=""+a._wrapperState.initialValue:a.defaultValue!==""+f&&(a.defaultValue=""+f))}var pe=Array.isArray;function me(a,c,f,y){if(a=a.options,c){c={};for(var C=0;C<f.length;C++)c["$"+f[C]]=!0;for(f=0;f<a.length;f++)C=c.hasOwnProperty("$"+a[f].value),a[f].selected!==C&&(a[f].selected=C),C&&y&&(a[f].defaultSelected=!0)}else{for(f=""+Ee(f),c=null,C=0;C<a.length;C++){if(a[C].value===f){a[C].selected=!0,y&&(a[C].defaultSelected=!0);return}c!==null||a[C].disabled||(c=a[C])}c!==null&&(c.selected=!0)}}function ye(a,c){if(c.dangerouslySetInnerHTML!=null)throw Error(t(91));return Q({},c,{value:void 0,defaultValue:void 0,children:""+a._wrapperState.initialValue})}function He(a,c){var f=c.value;if(f==null){if(f=c.children,c=c.defaultValue,f!=null){if(c!=null)throw Error(t(92));if(pe(f)){if(1<f.length)throw Error(t(93));f=f[0]}c=f}c==null&&(c=""),f=c}a._wrapperState={initialValue:Ee(f)}}function Ie(a,c){var f=Ee(c.value),y=Ee(c.defaultValue);f!=null&&(f=""+f,f!==a.value&&(a.value=f),c.defaultValue==null&&a.defaultValue!==f&&(a.defaultValue=f)),y!=null&&(a.defaultValue=""+y)}function je(a){var c=a.textContent;c===a._wrapperState.initialValue&&c!==""&&c!==null&&(a.value=c)}function Ge(a){switch(a){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Me(a,c){return a==null||a==="http://www.w3.org/1999/xhtml"?Ge(c):a==="http://www.w3.org/2000/svg"&&c==="foreignObject"?"http://www.w3.org/1999/xhtml":a}var fe,De=function(a){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(c,f,y,C){MSApp.execUnsafeLocalFunction(function(){return a(c,f,y,C)})}:a}(function(a,c){if(a.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in a)a.innerHTML=c;else{for(fe=fe||document.createElement("div"),fe.innerHTML="<svg>"+c.valueOf().toString()+"</svg>",c=fe.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;c.firstChild;)a.appendChild(c.firstChild)}});function Be(a,c){if(c){var f=a.firstChild;if(f&&f===a.lastChild&&f.nodeType===3){f.nodeValue=c;return}}a.textContent=c}var be={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},nt=["Webkit","ms","Moz","O"];Object.keys(be).forEach(function(a){nt.forEach(function(c){c=c+a.charAt(0).toUpperCase()+a.substring(1),be[c]=be[a]})});function lt(a,c,f){return c==null||typeof c=="boolean"||c===""?"":f||typeof c!="number"||c===0||be.hasOwnProperty(a)&&be[a]?(""+c).trim():c+"px"}function dt(a,c){a=a.style;for(var f in c)if(c.hasOwnProperty(f)){var y=f.indexOf("--")===0,C=lt(f,c[f],y);f==="float"&&(f="cssFloat"),y?a.setProperty(f,C):a[f]=C}}var ut=Q({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ht(a,c){if(c){if(ut[a]&&(c.children!=null||c.dangerouslySetInnerHTML!=null))throw Error(t(137,a));if(c.dangerouslySetInnerHTML!=null){if(c.children!=null)throw Error(t(60));if(typeof c.dangerouslySetInnerHTML!="object"||!("__html"in c.dangerouslySetInnerHTML))throw Error(t(61))}if(c.style!=null&&typeof c.style!="object")throw Error(t(62))}}function H(a,c){if(a.indexOf("-")===-1)return typeof c.is=="string";switch(a){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var O=null;function ge(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var ve=null,Fe=null,Pe=null;function vt(a){if(a=_h(a)){if(typeof ve!="function")throw Error(t(280));var c=a.stateNode;c&&(c=qf(c),ve(a.stateNode,a.type,c))}}function Lt(a){Fe?Pe?Pe.push(a):Pe=[a]:Fe=a}function Nt(){if(Fe){var a=Fe,c=Pe;if(Pe=Fe=null,vt(a),c)for(a=0;a<c.length;a++)vt(c[a])}}function Bt(a,c){return a(c)}function _t(){}var fr=!1;function Vt(a,c,f){if(fr)return a(c,f);fr=!0;try{return Bt(a,c,f)}finally{fr=!1,(Fe!==null||Pe!==null)&&(_t(),Nt())}}function Er(a,c){var f=a.stateNode;if(f===null)return null;var y=qf(f);if(y===null)return null;f=y[c];e:switch(c){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(y=!y.disabled)||(a=a.type,y=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!y;break e;default:a=!1}if(a)return null;if(f&&typeof f!="function")throw Error(t(231,c,typeof f));return f}var Rn=!1;if(l)try{var qt={};Object.defineProperty(qt,"passive",{get:function(){Rn=!0}}),window.addEventListener("test",qt,qt),window.removeEventListener("test",qt,qt)}catch{Rn=!1}function fi(a,c,f,y,C,B,U,q,J){var ce=Array.prototype.slice.call(arguments,3);try{c.apply(f,ce)}catch(we){this.onError(we)}}var Zn=!1,Ns=null,Us=!1,dc=null,Rf={onError:function(a){Zn=!0,Ns=a}};function d0(a,c,f,y,C,B,U,q,J){Zn=!1,Ns=null,fi.apply(Rf,arguments)}function f0(a,c,f,y,C,B,U,q,J){if(d0.apply(this,arguments),Zn){if(Zn){var ce=Ns;Zn=!1,Ns=null}else throw Error(t(198));Us||(Us=!0,dc=ce)}}function Ps(a){var c=a,f=a;if(a.alternate)for(;c.return;)c=c.return;else{a=c;do c=a,c.flags&4098&&(f=c.return),a=c.return;while(a)}return c.tag===3?f:null}function F(a){if(a.tag===13){var c=a.memoizedState;if(c===null&&(a=a.alternate,a!==null&&(c=a.memoizedState)),c!==null)return c.dehydrated}return null}function ne(a){if(Ps(a)!==a)throw Error(t(188))}function ue(a){var c=a.alternate;if(!c){if(c=Ps(a),c===null)throw Error(t(188));return c!==a?null:a}for(var f=a,y=c;;){var C=f.return;if(C===null)break;var B=C.alternate;if(B===null){if(y=C.return,y!==null){f=y;continue}break}if(C.child===B.child){for(B=C.child;B;){if(B===f)return ne(C),a;if(B===y)return ne(C),c;B=B.sibling}throw Error(t(188))}if(f.return!==y.return)f=C,y=B;else{for(var U=!1,q=C.child;q;){if(q===f){U=!0,f=C,y=B;break}if(q===y){U=!0,y=C,f=B;break}q=q.sibling}if(!U){for(q=B.child;q;){if(q===f){U=!0,f=B,y=C;break}if(q===y){U=!0,y=B,f=C;break}q=q.sibling}if(!U)throw Error(t(189))}}if(f.alternate!==y)throw Error(t(190))}if(f.tag!==3)throw Error(t(188));return f.stateNode.current===f?a:c}function he(a){return a=ue(a),a!==null?oe(a):null}function oe(a){if(a.tag===5||a.tag===6)return a;for(a=a.child;a!==null;){var c=oe(a);if(c!==null)return c;a=a.sibling}return null}var Re=e.unstable_scheduleCallback,Je=e.unstable_cancelCallback,it=e.unstable_shouldYield,at=e.unstable_requestPaint,Xe=e.unstable_now,At=e.unstable_getCurrentPriorityLevel,ft=e.unstable_ImmediatePriority,Lr=e.unstable_UserBlockingPriority,er=e.unstable_NormalPriority,Dn=e.unstable_LowPriority,pi=e.unstable_IdlePriority,jt=null,tt=null;function Zu(a){if(tt&&typeof tt.onCommitFiberRoot=="function")try{tt.onCommitFiberRoot(jt,a,void 0,(a.current.flags&128)===128)}catch{}}var vn=Math.clz32?Math.clz32:Uo,ks=Math.log,Df=Math.LN2;function Uo(a){return a>>>=0,a===0?32:31-(ks(a)/Df|0)|0}var Ca=64,xr=4194304;function Ln(a){switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return a&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return a}}function Ma(a,c){var f=a.pendingLanes;if(f===0)return 0;var y=0,C=a.suspendedLanes,B=a.pingedLanes,U=f&268435455;if(U!==0){var q=U&~C;q!==0?y=Ln(q):(B&=U,B!==0&&(y=Ln(B)))}else U=f&~C,U!==0?y=Ln(U):B!==0&&(y=Ln(B));if(y===0)return 0;if(c!==0&&c!==y&&!(c&C)&&(C=y&-y,B=c&-c,C>=B||C===16&&(B&4194240)!==0))return c;if(y&4&&(y|=f&16),c=a.entangledLanes,c!==0)for(a=a.entanglements,c&=y;0<c;)f=31-vn(c),C=1<<f,y|=a[f],c&=~C;return y}function Nn(a,c){switch(a){case 1:case 2:case 4:return c+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return c+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function $u(a,c){for(var f=a.suspendedLanes,y=a.pingedLanes,C=a.expirationTimes,B=a.pendingLanes;0<B;){var U=31-vn(B),q=1<<U,J=C[U];J===-1?(!(q&f)||q&y)&&(C[U]=Nn(q,c)):J<=c&&(a.expiredLanes|=q),B&=~q}}function eh(a){return a=a.pendingLanes&-1073741825,a!==0?a:a&1073741824?1073741824:0}function th(){var a=Ca;return Ca<<=1,!(Ca&4194240)&&(Ca=64),a}function p0(a){for(var c=[],f=0;31>f;f++)c.push(a);return c}function rh(a,c,f){a.pendingLanes|=c,c!==536870912&&(a.suspendedLanes=0,a.pingedLanes=0),a=a.eventTimes,c=31-vn(c),a[c]=f}function mk(a,c){var f=a.pendingLanes&~c;a.pendingLanes=c,a.suspendedLanes=0,a.pingedLanes=0,a.expiredLanes&=c,a.mutableReadLanes&=c,a.entangledLanes&=c,c=a.entanglements;var y=a.eventTimes;for(a=a.expirationTimes;0<f;){var C=31-vn(f),B=1<<C;c[C]=0,y[C]=-1,a[C]=-1,f&=~B}}function A0(a,c){var f=a.entangledLanes|=c;for(a=a.entanglements;f;){var y=31-vn(f),C=1<<y;C&c|a[y]&c&&(a[y]|=c),f&=~C}}var kt=0;function _C(a){return a&=-a,1<a?4<a?a&268435455?16:536870912:4:1}var yC,g0,EC,xC,wC,m0=!1,Lf=[],Sa=null,Ta=null,Ba=null,nh=new Map,ih=new Map,ba=[],vk="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function IC(a,c){switch(a){case"focusin":case"focusout":Sa=null;break;case"dragenter":case"dragleave":Ta=null;break;case"mouseover":case"mouseout":Ba=null;break;case"pointerover":case"pointerout":nh.delete(c.pointerId);break;case"gotpointercapture":case"lostpointercapture":ih.delete(c.pointerId)}}function sh(a,c,f,y,C,B){return a===null||a.nativeEvent!==B?(a={blockedOn:c,domEventName:f,eventSystemFlags:y,nativeEvent:B,targetContainers:[C]},c!==null&&(c=_h(c),c!==null&&g0(c)),a):(a.eventSystemFlags|=y,c=a.targetContainers,C!==null&&c.indexOf(C)===-1&&c.push(C),a)}function _k(a,c,f,y,C){switch(c){case"focusin":return Sa=sh(Sa,a,c,f,y,C),!0;case"dragenter":return Ta=sh(Ta,a,c,f,y,C),!0;case"mouseover":return Ba=sh(Ba,a,c,f,y,C),!0;case"pointerover":var B=C.pointerId;return nh.set(B,sh(nh.get(B)||null,a,c,f,y,C)),!0;case"gotpointercapture":return B=C.pointerId,ih.set(B,sh(ih.get(B)||null,a,c,f,y,C)),!0}return!1}function CC(a){var c=Po(a.target);if(c!==null){var f=Ps(c);if(f!==null){if(c=f.tag,c===13){if(c=F(f),c!==null){a.blockedOn=c,wC(a.priority,function(){EC(f)});return}}else if(c===3&&f.stateNode.current.memoizedState.isDehydrated){a.blockedOn=f.tag===3?f.stateNode.containerInfo:null;return}}}a.blockedOn=null}function Nf(a){if(a.blockedOn!==null)return!1;for(var c=a.targetContainers;0<c.length;){var f=_0(a.domEventName,a.eventSystemFlags,c[0],a.nativeEvent);if(f===null){f=a.nativeEvent;var y=new f.constructor(f.type,f);O=y,f.target.dispatchEvent(y),O=null}else return c=_h(f),c!==null&&g0(c),a.blockedOn=f,!1;c.shift()}return!0}function MC(a,c,f){Nf(a)&&f.delete(c)}function yk(){m0=!1,Sa!==null&&Nf(Sa)&&(Sa=null),Ta!==null&&Nf(Ta)&&(Ta=null),Ba!==null&&Nf(Ba)&&(Ba=null),nh.forEach(MC),ih.forEach(MC)}function ah(a,c){a.blockedOn===c&&(a.blockedOn=null,m0||(m0=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,yk)))}function oh(a){function c(C){return ah(C,a)}if(0<Lf.length){ah(Lf[0],a);for(var f=1;f<Lf.length;f++){var y=Lf[f];y.blockedOn===a&&(y.blockedOn=null)}}for(Sa!==null&&ah(Sa,a),Ta!==null&&ah(Ta,a),Ba!==null&&ah(Ba,a),nh.forEach(c),ih.forEach(c),f=0;f<ba.length;f++)y=ba[f],y.blockedOn===a&&(y.blockedOn=null);for(;0<ba.length&&(f=ba[0],f.blockedOn===null);)CC(f),f.blockedOn===null&&ba.shift()}var fc=I.ReactCurrentBatchConfig,Uf=!0;function Ek(a,c,f,y){var C=kt,B=fc.transition;fc.transition=null;try{kt=1,v0(a,c,f,y)}finally{kt=C,fc.transition=B}}function xk(a,c,f,y){var C=kt,B=fc.transition;fc.transition=null;try{kt=4,v0(a,c,f,y)}finally{kt=C,fc.transition=B}}function v0(a,c,f,y){if(Uf){var C=_0(a,c,f,y);if(C===null)P0(a,c,y,Pf,f),IC(a,y);else if(_k(C,a,c,f,y))y.stopPropagation();else if(IC(a,y),c&4&&-1<vk.indexOf(a)){for(;C!==null;){var B=_h(C);if(B!==null&&yC(B),B=_0(a,c,f,y),B===null&&P0(a,c,y,Pf,f),B===C)break;C=B}C!==null&&y.stopPropagation()}else P0(a,c,y,null,f)}}var Pf=null;function _0(a,c,f,y){if(Pf=null,a=ge(y),a=Po(a),a!==null)if(c=Ps(a),c===null)a=null;else if(f=c.tag,f===13){if(a=F(c),a!==null)return a;a=null}else if(f===3){if(c.stateNode.current.memoizedState.isDehydrated)return c.tag===3?c.stateNode.containerInfo:null;a=null}else c!==a&&(a=null);return Pf=a,null}function SC(a){switch(a){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(At()){case ft:return 1;case Lr:return 4;case er:case Dn:return 16;case pi:return 536870912;default:return 16}default:return 16}}var Ra=null,y0=null,kf=null;function TC(){if(kf)return kf;var a,c=y0,f=c.length,y,C="value"in Ra?Ra.value:Ra.textContent,B=C.length;for(a=0;a<f&&c[a]===C[a];a++);var U=f-a;for(y=1;y<=U&&c[f-y]===C[B-y];y++);return kf=C.slice(a,1<y?1-y:void 0)}function Qf(a){var c=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&c===13&&(a=13)):a=c,a===10&&(a=13),32<=a||a===13?a:0}function Of(){return!0}function BC(){return!1}function $n(a){function c(f,y,C,B,U){this._reactName=f,this._targetInst=C,this.type=y,this.nativeEvent=B,this.target=U,this.currentTarget=null;for(var q in a)a.hasOwnProperty(q)&&(f=a[q],this[q]=f?f(B):B[q]);return this.isDefaultPrevented=(B.defaultPrevented!=null?B.defaultPrevented:B.returnValue===!1)?Of:BC,this.isPropagationStopped=BC,this}return Q(c.prototype,{preventDefault:function(){this.defaultPrevented=!0;var f=this.nativeEvent;f&&(f.preventDefault?f.preventDefault():typeof f.returnValue!="unknown"&&(f.returnValue=!1),this.isDefaultPrevented=Of)},stopPropagation:function(){var f=this.nativeEvent;f&&(f.stopPropagation?f.stopPropagation():typeof f.cancelBubble!="unknown"&&(f.cancelBubble=!0),this.isPropagationStopped=Of)},persist:function(){},isPersistent:Of}),c}var pc={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},E0=$n(pc),lh=Q({},pc,{view:0,detail:0}),wk=$n(lh),x0,w0,ch,Ff=Q({},lh,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:C0,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==ch&&(ch&&a.type==="mousemove"?(x0=a.screenX-ch.screenX,w0=a.screenY-ch.screenY):w0=x0=0,ch=a),x0)},movementY:function(a){return"movementY"in a?a.movementY:w0}}),bC=$n(Ff),Ik=Q({},Ff,{dataTransfer:0}),Ck=$n(Ik),Mk=Q({},lh,{relatedTarget:0}),I0=$n(Mk),Sk=Q({},pc,{animationName:0,elapsedTime:0,pseudoElement:0}),Tk=$n(Sk),Bk=Q({},pc,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),bk=$n(Bk),Rk=Q({},pc,{data:0}),RC=$n(Rk),Dk={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Lk={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Nk={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Uk(a){var c=this.nativeEvent;return c.getModifierState?c.getModifierState(a):(a=Nk[a])?!!c[a]:!1}function C0(){return Uk}var Pk=Q({},lh,{key:function(a){if(a.key){var c=Dk[a.key]||a.key;if(c!=="Unidentified")return c}return a.type==="keypress"?(a=Qf(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?Lk[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:C0,charCode:function(a){return a.type==="keypress"?Qf(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?Qf(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),kk=$n(Pk),Qk=Q({},Ff,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),DC=$n(Qk),Ok=Q({},lh,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:C0}),Fk=$n(Ok),zk=Q({},pc,{propertyName:0,elapsedTime:0,pseudoElement:0}),Hk=$n(zk),Gk=Q({},Ff,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),Vk=$n(Gk),jk=[9,13,27,32],M0=l&&"CompositionEvent"in window,uh=null;l&&"documentMode"in document&&(uh=document.documentMode);var Wk=l&&"TextEvent"in window&&!uh,LC=l&&(!M0||uh&&8<uh&&11>=uh),NC=String.fromCharCode(32),UC=!1;function PC(a,c){switch(a){case"keyup":return jk.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function kC(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var Ac=!1;function Yk(a,c){switch(a){case"compositionend":return kC(c);case"keypress":return c.which!==32?null:(UC=!0,NC);case"textInput":return a=c.data,a===NC&&UC?null:a;default:return null}}function qk(a,c){if(Ac)return a==="compositionend"||!M0&&PC(a,c)?(a=TC(),kf=y0=Ra=null,Ac=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1<c.char.length)return c.char;if(c.which)return String.fromCharCode(c.which)}return null;case"compositionend":return LC&&c.locale!=="ko"?null:c.data;default:return null}}var Xk={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function QC(a){var c=a&&a.nodeName&&a.nodeName.toLowerCase();return c==="input"?!!Xk[a.type]:c==="textarea"}function OC(a,c,f,y){Lt(y),c=jf(c,"onChange"),0<c.length&&(f=new E0("onChange","change",null,f,y),a.push({event:f,listeners:c}))}var hh=null,dh=null;function Kk(a){nM(a,0)}function zf(a){var c=yc(a);if(et(c))return a}function Jk(a,c){if(a==="change")return c}var FC=!1;if(l){var S0;if(l){var T0="oninput"in document;if(!T0){var zC=document.createElement("div");zC.setAttribute("oninput","return;"),T0=typeof zC.oninput=="function"}S0=T0}else S0=!1;FC=S0&&(!document.documentMode||9<document.documentMode)}function HC(){hh&&(hh.detachEvent("onpropertychange",GC),dh=hh=null)}function GC(a){if(a.propertyName==="value"&&zf(dh)){var c=[];OC(c,dh,a,ge(a)),Vt(Kk,c)}}function Zk(a,c,f){a==="focusin"?(HC(),hh=c,dh=f,hh.attachEvent("onpropertychange",GC)):a==="focusout"&&HC()}function $k(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return zf(dh)}function eQ(a,c){if(a==="click")return zf(c)}function tQ(a,c){if(a==="input"||a==="change")return zf(c)}function rQ(a,c){return a===c&&(a!==0||1/a===1/c)||a!==a&&c!==c}var ki=typeof Object.is=="function"?Object.is:rQ;function fh(a,c){if(ki(a,c))return!0;if(typeof a!="object"||a===null||typeof c!="object"||c===null)return!1;var f=Object.keys(a),y=Object.keys(c);if(f.length!==y.length)return!1;for(y=0;y<f.length;y++){var C=f[y];if(!h.call(c,C)||!ki(a[C],c[C]))return!1}return!0}function VC(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function jC(a,c){var f=VC(a);a=0;for(var y;f;){if(f.nodeType===3){if(y=a+f.textContent.length,a<=c&&y>=c)return{node:f,offset:c-a};a=y}e:{for(;f;){if(f.nextSibling){f=f.nextSibling;break e}f=f.parentNode}f=void 0}f=VC(f)}}function WC(a,c){return a&&c?a===c?!0:a&&a.nodeType===3?!1:c&&c.nodeType===3?WC(a,c.parentNode):"contains"in a?a.contains(c):a.compareDocumentPosition?!!(a.compareDocumentPosition(c)&16):!1:!1}function YC(){for(var a=window,c=Qe();c instanceof a.HTMLIFrameElement;){try{var f=typeof c.contentWindow.location.href=="string"}catch{f=!1}if(f)a=c.contentWindow;else break;c=Qe(a.document)}return c}function B0(a){var c=a&&a.nodeName&&a.nodeName.toLowerCase();return c&&(c==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||c==="textarea"||a.contentEditable==="true")}function nQ(a){var c=YC(),f=a.focusedElem,y=a.selectionRange;if(c!==f&&f&&f.ownerDocument&&WC(f.ownerDocument.documentElement,f)){if(y!==null&&B0(f)){if(c=y.start,a=y.end,a===void 0&&(a=c),"selectionStart"in f)f.selectionStart=c,f.selectionEnd=Math.min(a,f.value.length);else if(a=(c=f.ownerDocument||document)&&c.defaultView||window,a.getSelection){a=a.getSelection();var C=f.textContent.length,B=Math.min(y.start,C);y=y.end===void 0?B:Math.min(y.end,C),!a.extend&&B>y&&(C=y,y=B,B=C),C=jC(f,B);var U=jC(f,y);C&&U&&(a.rangeCount!==1||a.anchorNode!==C.node||a.anchorOffset!==C.offset||a.focusNode!==U.node||a.focusOffset!==U.offset)&&(c=c.createRange(),c.setStart(C.node,C.offset),a.removeAllRanges(),B>y?(a.addRange(c),a.extend(U.node,U.offset)):(c.setEnd(U.node,U.offset),a.addRange(c)))}}for(c=[],a=f;a=a.parentNode;)a.nodeType===1&&c.push({element:a,left:a.scrollLeft,top:a.scrollTop});for(typeof f.focus=="function"&&f.focus(),f=0;f<c.length;f++)a=c[f],a.element.scrollLeft=a.left,a.element.scrollTop=a.top}}var iQ=l&&"documentMode"in document&&11>=document.documentMode,gc=null,b0=null,ph=null,R0=!1;function qC(a,c,f){var y=f.window===f?f.document:f.nodeType===9?f:f.ownerDocument;R0||gc==null||gc!==Qe(y)||(y=gc,"selectionStart"in y&&B0(y)?y={start:y.selectionStart,end:y.selectionEnd}:(y=(y.ownerDocument&&y.ownerDocument.defaultView||window).getSelection(),y={anchorNode:y.anchorNode,anchorOffset:y.anchorOffset,focusNode:y.focusNode,focusOffset:y.focusOffset}),ph&&fh(ph,y)||(ph=y,y=jf(b0,"onSelect"),0<y.length&&(c=new E0("onSelect","select",null,c,f),a.push({event:c,listeners:y}),c.target=gc)))}function Hf(a,c){var f={};return f[a.toLowerCase()]=c.toLowerCase(),f["Webkit"+a]="webkit"+c,f["Moz"+a]="moz"+c,f}var mc={animationend:Hf("Animation","AnimationEnd"),animationiteration:Hf("Animation","AnimationIteration"),animationstart:Hf("Animation","AnimationStart"),transitionend:Hf("Transition","TransitionEnd")},D0={},XC={};l&&(XC=document.createElement("div").style,"AnimationEvent"in window||(delete mc.animationend.animation,delete mc.animationiteration.animation,delete mc.animationstart.animation),"TransitionEvent"in window||delete mc.transitionend.transition);function Gf(a){if(D0[a])return D0[a];if(!mc[a])return a;var c=mc[a],f;for(f in c)if(c.hasOwnProperty(f)&&f in XC)return D0[a]=c[f];return a}var KC=Gf("animationend"),JC=Gf("animationiteration"),ZC=Gf("animationstart"),$C=Gf("transitionend"),eM=new Map,tM="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Da(a,c){eM.set(a,c),s(c,[a])}for(var L0=0;L0<tM.length;L0++){var N0=tM[L0],sQ=N0.toLowerCase(),aQ=N0[0].toUpperCase()+N0.slice(1);Da(sQ,"on"+aQ)}Da(KC,"onAnimationEnd"),Da(JC,"onAnimationIteration"),Da(ZC,"onAnimationStart"),Da("dblclick","onDoubleClick"),Da("focusin","onFocus"),Da("focusout","onBlur"),Da($C,"onTransitionEnd"),o("onMouseEnter",["mouseout","mouseover"]),o("onMouseLeave",["mouseout","mouseover"]),o("onPointerEnter",["pointerout","pointerover"]),o("onPointerLeave",["pointerout","pointerover"]),s("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),s("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),s("onBeforeInput",["compositionend","keypress","textInput","paste"]),s("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),s("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),s("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ah="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),oQ=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ah));function rM(a,c,f){var y=a.type||"unknown-event";a.currentTarget=f,f0(y,c,void 0,a),a.currentTarget=null}function nM(a,c){c=(c&4)!==0;for(var f=0;f<a.length;f++){var y=a[f],C=y.event;y=y.listeners;e:{var B=void 0;if(c)for(var U=y.length-1;0<=U;U--){var q=y[U],J=q.instance,ce=q.currentTarget;if(q=q.listener,J!==B&&C.isPropagationStopped())break e;rM(C,q,ce),B=J}else for(U=0;U<y.length;U++){if(q=y[U],J=q.instance,ce=q.currentTarget,q=q.listener,J!==B&&C.isPropagationStopped())break e;rM(C,q,ce),B=J}}}if(Us)throw a=dc,Us=!1,dc=null,a}function Xt(a,c){var f=c[H0];f===void 0&&(f=c[H0]=new Set);var y=a+"__bubble";f.has(y)||(iM(c,a,2,!1),f.add(y))}function U0(a,c,f){var y=0;c&&(y|=4),iM(f,a,y,c)}var Vf="_reactListening"+Math.random().toString(36).slice(2);function gh(a){if(!a[Vf]){a[Vf]=!0,n.forEach(function(f){f!=="selectionchange"&&(oQ.has(f)||U0(f,!1,a),U0(f,!0,a))});var c=a.nodeType===9?a:a.ownerDocument;c===null||c[Vf]||(c[Vf]=!0,U0("selectionchange",!1,c))}}function iM(a,c,f,y){switch(SC(c)){case 1:var C=Ek;break;case 4:C=xk;break;default:C=v0}f=C.bind(null,c,f,a),C=void 0,!Rn||c!=="touchstart"&&c!=="touchmove"&&c!=="wheel"||(C=!0),y?C!==void 0?a.addEventListener(c,f,{capture:!0,passive:C}):a.addEventListener(c,f,!0):C!==void 0?a.addEventListener(c,f,{passive:C}):a.addEventListener(c,f,!1)}function P0(a,c,f,y,C){var B=y;if(!(c&1)&&!(c&2)&&y!==null)e:for(;;){if(y===null)return;var U=y.tag;if(U===3||U===4){var q=y.stateNode.containerInfo;if(q===C||q.nodeType===8&&q.parentNode===C)break;if(U===4)for(U=y.return;U!==null;){var J=U.tag;if((J===3||J===4)&&(J=U.stateNode.containerInfo,J===C||J.nodeType===8&&J.parentNode===C))return;U=U.return}for(;q!==null;){if(U=Po(q),U===null)return;if(J=U.tag,J===5||J===6){y=B=U;continue e}q=q.parentNode}}y=y.return}Vt(function(){var ce=B,we=ge(f),Ce=[];e:{var xe=eM.get(a);if(xe!==void 0){var ke=E0,ze=a;switch(a){case"keypress":if(Qf(f)===0)break e;case"keydown":case"keyup":ke=kk;break;case"focusin":ze="focus",ke=I0;break;case"focusout":ze="blur",ke=I0;break;case"beforeblur":case"afterblur":ke=I0;break;case"click":if(f.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ke=bC;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ke=Ck;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ke=Fk;break;case KC:case JC:case ZC:ke=Tk;break;case $C:ke=Hk;break;case"scroll":ke=wk;break;case"wheel":ke=Vk;break;case"copy":case"cut":case"paste":ke=bk;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ke=DC}var We=(c&4)!==0,wr=!We&&a==="scroll",ie=We?xe!==null?xe+"Capture":null:xe;We=[];for(var $=ce,ae;$!==null;){ae=$;var Te=ae.stateNode;if(ae.tag===5&&Te!==null&&(ae=Te,ie!==null&&(Te=Er($,ie),Te!=null&&We.push(mh($,Te,ae)))),wr)break;$=$.return}0<We.length&&(xe=new ke(xe,ze,null,f,we),Ce.push({event:xe,listeners:We}))}}if(!(c&7)){e:{if(xe=a==="mouseover"||a==="pointerover",ke=a==="mouseout"||a==="pointerout",xe&&f!==O&&(ze=f.relatedTarget||f.fromElement)&&(Po(ze)||ze[Qs]))break e;if((ke||xe)&&(xe=we.window===we?we:(xe=we.ownerDocument)?xe.defaultView||xe.parentWindow:window,ke?(ze=f.relatedTarget||f.toElement,ke=ce,ze=ze?Po(ze):null,ze!==null&&(wr=Ps(ze),ze!==wr||ze.tag!==5&&ze.tag!==6)&&(ze=null)):(ke=null,ze=ce),ke!==ze)){if(We=bC,Te="onMouseLeave",ie="onMouseEnter",$="mouse",(a==="pointerout"||a==="pointerover")&&(We=DC,Te="onPointerLeave",ie="onPointerEnter",$="pointer"),wr=ke==null?xe:yc(ke),ae=ze==null?xe:yc(ze),xe=new We(Te,$+"leave",ke,f,we),xe.target=wr,xe.relatedTarget=ae,Te=null,Po(we)===ce&&(We=new We(ie,$+"enter",ze,f,we),We.target=ae,We.relatedTarget=wr,Te=We),wr=Te,ke&&ze)t:{for(We=ke,ie=ze,$=0,ae=We;ae;ae=vc(ae))$++;for(ae=0,Te=ie;Te;Te=vc(Te))ae++;for(;0<$-ae;)We=vc(We),$--;for(;0<ae-$;)ie=vc(ie),ae--;for(;$--;){if(We===ie||ie!==null&&We===ie.alternate)break t;We=vc(We),ie=vc(ie)}We=null}else We=null;ke!==null&&sM(Ce,xe,ke,We,!1),ze!==null&&wr!==null&&sM(Ce,wr,ze,We,!0)}}e:{if(xe=ce?yc(ce):window,ke=xe.nodeName&&xe.nodeName.toLowerCase(),ke==="select"||ke==="input"&&xe.type==="file")var qe=Jk;else if(QC(xe))if(FC)qe=tQ;else{qe=$k;var Ze=Zk}else(ke=xe.nodeName)&&ke.toLowerCase()==="input"&&(xe.type==="checkbox"||xe.type==="radio")&&(qe=eQ);if(qe&&(qe=qe(a,ce))){OC(Ce,qe,f,we);break e}Ze&&Ze(a,xe,ce),a==="focusout"&&(Ze=xe._wrapperState)&&Ze.controlled&&xe.type==="number"&&le(xe,"number",xe.value)}switch(Ze=ce?yc(ce):window,a){case"focusin":(QC(Ze)||Ze.contentEditable==="true")&&(gc=Ze,b0=ce,ph=null);break;case"focusout":ph=b0=gc=null;break;case"mousedown":R0=!0;break;case"contextmenu":case"mouseup":case"dragend":R0=!1,qC(Ce,f,we);break;case"selectionchange":if(iQ)break;case"keydown":case"keyup":qC(Ce,f,we)}var $e;if(M0)e:{switch(a){case"compositionstart":var ot="onCompositionStart";break e;case"compositionend":ot="onCompositionEnd";break e;case"compositionupdate":ot="onCompositionUpdate";break e}ot=void 0}else Ac?PC(a,f)&&(ot="onCompositionEnd"):a==="keydown"&&f.keyCode===229&&(ot="onCompositionStart");ot&&(LC&&f.locale!=="ko"&&(Ac||ot!=="onCompositionStart"?ot==="onCompositionEnd"&&Ac&&($e=TC()):(Ra=we,y0="value"in Ra?Ra.value:Ra.textContent,Ac=!0)),Ze=jf(ce,ot),0<Ze.length&&(ot=new RC(ot,a,null,f,we),Ce.push({event:ot,listeners:Ze}),$e?ot.data=$e:($e=kC(f),$e!==null&&(ot.data=$e)))),($e=Wk?Yk(a,f):qk(a,f))&&(ce=jf(ce,"onBeforeInput"),0<ce.length&&(we=new RC("onBeforeInput","beforeinput",null,f,we),Ce.push({event:we,listeners:ce}),we.data=$e))}nM(Ce,c)})}function mh(a,c,f){return{instance:a,listener:c,currentTarget:f}}function jf(a,c){for(var f=c+"Capture",y=[];a!==null;){var C=a,B=C.stateNode;C.tag===5&&B!==null&&(C=B,B=Er(a,f),B!=null&&y.unshift(mh(a,B,C)),B=Er(a,c),B!=null&&y.push(mh(a,B,C))),a=a.return}return y}function vc(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5);return a||null}function sM(a,c,f,y,C){for(var B=c._reactName,U=[];f!==null&&f!==y;){var q=f,J=q.alternate,ce=q.stateNode;if(J!==null&&J===y)break;q.tag===5&&ce!==null&&(q=ce,C?(J=Er(f,B),J!=null&&U.unshift(mh(f,J,q))):C||(J=Er(f,B),J!=null&&U.push(mh(f,J,q)))),f=f.return}U.length!==0&&a.push({event:c,listeners:U})}var lQ=/\r\n?/g,cQ=/\u0000|\uFFFD/g;function aM(a){return(typeof a=="string"?a:""+a).replace(lQ,`
4572
- `).replace(cQ,"")}function Wf(a,c,f){if(c=aM(c),aM(a)!==c&&f)throw Error(t(425))}function Yf(){}var k0=null,Q0=null;function O0(a,c){return a==="textarea"||a==="noscript"||typeof c.children=="string"||typeof c.children=="number"||typeof c.dangerouslySetInnerHTML=="object"&&c.dangerouslySetInnerHTML!==null&&c.dangerouslySetInnerHTML.__html!=null}var F0=typeof setTimeout=="function"?setTimeout:void 0,uQ=typeof clearTimeout=="function"?clearTimeout:void 0,oM=typeof Promise=="function"?Promise:void 0,hQ=typeof queueMicrotask=="function"?queueMicrotask:typeof oM<"u"?function(a){return oM.resolve(null).then(a).catch(dQ)}:F0;function dQ(a){setTimeout(function(){throw a})}function z0(a,c){var f=c,y=0;do{var C=f.nextSibling;if(a.removeChild(f),C&&C.nodeType===8)if(f=C.data,f==="/$"){if(y===0){a.removeChild(C),oh(c);return}y--}else f!=="$"&&f!=="$?"&&f!=="$!"||y++;f=C}while(f);oh(c)}function La(a){for(;a!=null;a=a.nextSibling){var c=a.nodeType;if(c===1||c===3)break;if(c===8){if(c=a.data,c==="$"||c==="$!"||c==="$?")break;if(c==="/$")return null}}return a}function lM(a){a=a.previousSibling;for(var c=0;a;){if(a.nodeType===8){var f=a.data;if(f==="$"||f==="$!"||f==="$?"){if(c===0)return a;c--}else f==="/$"&&c++}a=a.previousSibling}return null}var _c=Math.random().toString(36).slice(2),as="__reactFiber$"+_c,vh="__reactProps$"+_c,Qs="__reactContainer$"+_c,H0="__reactEvents$"+_c,fQ="__reactListeners$"+_c,pQ="__reactHandles$"+_c;function Po(a){var c=a[as];if(c)return c;for(var f=a.parentNode;f;){if(c=f[Qs]||f[as]){if(f=c.alternate,c.child!==null||f!==null&&f.child!==null)for(a=lM(a);a!==null;){if(f=a[as])return f;a=lM(a)}return c}a=f,f=a.parentNode}return null}function _h(a){return a=a[as]||a[Qs],!a||a.tag!==5&&a.tag!==6&&a.tag!==13&&a.tag!==3?null:a}function yc(a){if(a.tag===5||a.tag===6)return a.stateNode;throw Error(t(33))}function qf(a){return a[vh]||null}var G0=[],Ec=-1;function Na(a){return{current:a}}function Kt(a){0>Ec||(a.current=G0[Ec],G0[Ec]=null,Ec--)}function Wt(a,c){Ec++,G0[Ec]=a.current,a.current=c}var Ua={},nn=Na(Ua),Un=Na(!1),ko=Ua;function xc(a,c){var f=a.type.contextTypes;if(!f)return Ua;var y=a.stateNode;if(y&&y.__reactInternalMemoizedUnmaskedChildContext===c)return y.__reactInternalMemoizedMaskedChildContext;var C={},B;for(B in f)C[B]=c[B];return y&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=c,a.__reactInternalMemoizedMaskedChildContext=C),C}function Pn(a){return a=a.childContextTypes,a!=null}function Xf(){Kt(Un),Kt(nn)}function cM(a,c,f){if(nn.current!==Ua)throw Error(t(168));Wt(nn,c),Wt(Un,f)}function uM(a,c,f){var y=a.stateNode;if(c=c.childContextTypes,typeof y.getChildContext!="function")return f;y=y.getChildContext();for(var C in y)if(!(C in c))throw Error(t(108,_e(a)||"Unknown",C));return Q({},f,y)}function Kf(a){return a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||Ua,ko=nn.current,Wt(nn,a),Wt(Un,Un.current),!0}function hM(a,c,f){var y=a.stateNode;if(!y)throw Error(t(169));f?(a=uM(a,c,ko),y.__reactInternalMemoizedMergedChildContext=a,Kt(Un),Kt(nn),Wt(nn,a)):Kt(Un),Wt(Un,f)}var Os=null,Jf=!1,V0=!1;function dM(a){Os===null?Os=[a]:Os.push(a)}function AQ(a){Jf=!0,dM(a)}function Pa(){if(!V0&&Os!==null){V0=!0;var a=0,c=kt;try{var f=Os;for(kt=1;a<f.length;a++){var y=f[a];do y=y(!0);while(y!==null)}Os=null,Jf=!1}catch(C){throw Os!==null&&(Os=Os.slice(a+1)),Re(ft,Pa),C}finally{kt=c,V0=!1}}return null}var wc=[],Ic=0,Zf=null,$f=0,Ai=[],gi=0,Qo=null,Fs=1,zs="";function Oo(a,c){wc[Ic++]=$f,wc[Ic++]=Zf,Zf=a,$f=c}function fM(a,c,f){Ai[gi++]=Fs,Ai[gi++]=zs,Ai[gi++]=Qo,Qo=a;var y=Fs;a=zs;var C=32-vn(y)-1;y&=~(1<<C),f+=1;var B=32-vn(c)+C;if(30<B){var U=C-C%5;B=(y&(1<<U)-1).toString(32),y>>=U,C-=U,Fs=1<<32-vn(c)+C|f<<C|y,zs=B+a}else Fs=1<<B|f<<C|y,zs=a}function j0(a){a.return!==null&&(Oo(a,1),fM(a,1,0))}function W0(a){for(;a===Zf;)Zf=wc[--Ic],wc[Ic]=null,$f=wc[--Ic],wc[Ic]=null;for(;a===Qo;)Qo=Ai[--gi],Ai[gi]=null,zs=Ai[--gi],Ai[gi]=null,Fs=Ai[--gi],Ai[gi]=null}var ei=null,ti=null,tr=!1,Qi=null;function pM(a,c){var f=yi(5,null,null,0);f.elementType="DELETED",f.stateNode=c,f.return=a,c=a.deletions,c===null?(a.deletions=[f],a.flags|=16):c.push(f)}function AM(a,c){switch(a.tag){case 5:var f=a.type;return c=c.nodeType!==1||f.toLowerCase()!==c.nodeName.toLowerCase()?null:c,c!==null?(a.stateNode=c,ei=a,ti=La(c.firstChild),!0):!1;case 6:return c=a.pendingProps===""||c.nodeType!==3?null:c,c!==null?(a.stateNode=c,ei=a,ti=null,!0):!1;case 13:return c=c.nodeType!==8?null:c,c!==null?(f=Qo!==null?{id:Fs,overflow:zs}:null,a.memoizedState={dehydrated:c,treeContext:f,retryLane:1073741824},f=yi(18,null,null,0),f.stateNode=c,f.return=a,a.child=f,ei=a,ti=null,!0):!1;default:return!1}}function Y0(a){return(a.mode&1)!==0&&(a.flags&128)===0}function q0(a){if(tr){var c=ti;if(c){var f=c;if(!AM(a,c)){if(Y0(a))throw Error(t(418));c=La(f.nextSibling);var y=ei;c&&AM(a,c)?pM(y,f):(a.flags=a.flags&-4097|2,tr=!1,ei=a)}}else{if(Y0(a))throw Error(t(418));a.flags=a.flags&-4097|2,tr=!1,ei=a}}}function gM(a){for(a=a.return;a!==null&&a.tag!==5&&a.tag!==3&&a.tag!==13;)a=a.return;ei=a}function ep(a){if(a!==ei)return!1;if(!tr)return gM(a),tr=!0,!1;var c;if((c=a.tag!==3)&&!(c=a.tag!==5)&&(c=a.type,c=c!=="head"&&c!=="body"&&!O0(a.type,a.memoizedProps)),c&&(c=ti)){if(Y0(a))throw mM(),Error(t(418));for(;c;)pM(a,c),c=La(c.nextSibling)}if(gM(a),a.tag===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(t(317));e:{for(a=a.nextSibling,c=0;a;){if(a.nodeType===8){var f=a.data;if(f==="/$"){if(c===0){ti=La(a.nextSibling);break e}c--}else f!=="$"&&f!=="$!"&&f!=="$?"||c++}a=a.nextSibling}ti=null}}else ti=ei?La(a.stateNode.nextSibling):null;return!0}function mM(){for(var a=ti;a;)a=La(a.nextSibling)}function Cc(){ti=ei=null,tr=!1}function X0(a){Qi===null?Qi=[a]:Qi.push(a)}var gQ=I.ReactCurrentBatchConfig;function Oi(a,c){if(a&&a.defaultProps){c=Q({},c),a=a.defaultProps;for(var f in a)c[f]===void 0&&(c[f]=a[f]);return c}return c}var tp=Na(null),rp=null,Mc=null,K0=null;function J0(){K0=Mc=rp=null}function Z0(a){var c=tp.current;Kt(tp),a._currentValue=c}function $0(a,c,f){for(;a!==null;){var y=a.alternate;if((a.childLanes&c)!==c?(a.childLanes|=c,y!==null&&(y.childLanes|=c)):y!==null&&(y.childLanes&c)!==c&&(y.childLanes|=c),a===f)break;a=a.return}}function Sc(a,c){rp=a,K0=Mc=null,a=a.dependencies,a!==null&&a.firstContext!==null&&(a.lanes&c&&(kn=!0),a.firstContext=null)}function mi(a){var c=a._currentValue;if(K0!==a)if(a={context:a,memoizedValue:c,next:null},Mc===null){if(rp===null)throw Error(t(308));Mc=a,rp.dependencies={lanes:0,firstContext:a}}else Mc=Mc.next=a;return c}var Fo=null;function e1(a){Fo===null?Fo=[a]:Fo.push(a)}function vM(a,c,f,y){var C=c.interleaved;return C===null?(f.next=f,e1(c)):(f.next=C.next,C.next=f),c.interleaved=f,Hs(a,y)}function Hs(a,c){a.lanes|=c;var f=a.alternate;for(f!==null&&(f.lanes|=c),f=a,a=a.return;a!==null;)a.childLanes|=c,f=a.alternate,f!==null&&(f.childLanes|=c),f=a,a=a.return;return f.tag===3?f.stateNode:null}var ka=!1;function t1(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function _M(a,c){a=a.updateQueue,c.updateQueue===a&&(c.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,effects:a.effects})}function Gs(a,c){return{eventTime:a,lane:c,tag:0,payload:null,callback:null,next:null}}function Qa(a,c,f){var y=a.updateQueue;if(y===null)return null;if(y=y.shared,St&2){var C=y.pending;return C===null?c.next=c:(c.next=C.next,C.next=c),y.pending=c,Hs(a,f)}return C=y.interleaved,C===null?(c.next=c,e1(y)):(c.next=C.next,C.next=c),y.interleaved=c,Hs(a,f)}function np(a,c,f){if(c=c.updateQueue,c!==null&&(c=c.shared,(f&4194240)!==0)){var y=c.lanes;y&=a.pendingLanes,f|=y,c.lanes=f,A0(a,f)}}function yM(a,c){var f=a.updateQueue,y=a.alternate;if(y!==null&&(y=y.updateQueue,f===y)){var C=null,B=null;if(f=f.firstBaseUpdate,f!==null){do{var U={eventTime:f.eventTime,lane:f.lane,tag:f.tag,payload:f.payload,callback:f.callback,next:null};B===null?C=B=U:B=B.next=U,f=f.next}while(f!==null);B===null?C=B=c:B=B.next=c}else C=B=c;f={baseState:y.baseState,firstBaseUpdate:C,lastBaseUpdate:B,shared:y.shared,effects:y.effects},a.updateQueue=f;return}a=f.lastBaseUpdate,a===null?f.firstBaseUpdate=c:a.next=c,f.lastBaseUpdate=c}function ip(a,c,f,y){var C=a.updateQueue;ka=!1;var B=C.firstBaseUpdate,U=C.lastBaseUpdate,q=C.shared.pending;if(q!==null){C.shared.pending=null;var J=q,ce=J.next;J.next=null,U===null?B=ce:U.next=ce,U=J;var we=a.alternate;we!==null&&(we=we.updateQueue,q=we.lastBaseUpdate,q!==U&&(q===null?we.firstBaseUpdate=ce:q.next=ce,we.lastBaseUpdate=J))}if(B!==null){var Ce=C.baseState;U=0,we=ce=J=null,q=B;do{var xe=q.lane,ke=q.eventTime;if((y&xe)===xe){we!==null&&(we=we.next={eventTime:ke,lane:0,tag:q.tag,payload:q.payload,callback:q.callback,next:null});e:{var ze=a,We=q;switch(xe=c,ke=f,We.tag){case 1:if(ze=We.payload,typeof ze=="function"){Ce=ze.call(ke,Ce,xe);break e}Ce=ze;break e;case 3:ze.flags=ze.flags&-65537|128;case 0:if(ze=We.payload,xe=typeof ze=="function"?ze.call(ke,Ce,xe):ze,xe==null)break e;Ce=Q({},Ce,xe);break e;case 2:ka=!0}}q.callback!==null&&q.lane!==0&&(a.flags|=64,xe=C.effects,xe===null?C.effects=[q]:xe.push(q))}else ke={eventTime:ke,lane:xe,tag:q.tag,payload:q.payload,callback:q.callback,next:null},we===null?(ce=we=ke,J=Ce):we=we.next=ke,U|=xe;if(q=q.next,q===null){if(q=C.shared.pending,q===null)break;xe=q,q=xe.next,xe.next=null,C.lastBaseUpdate=xe,C.shared.pending=null}}while(1);if(we===null&&(J=Ce),C.baseState=J,C.firstBaseUpdate=ce,C.lastBaseUpdate=we,c=C.shared.interleaved,c!==null){C=c;do U|=C.lane,C=C.next;while(C!==c)}else B===null&&(C.shared.lanes=0);Go|=U,a.lanes=U,a.memoizedState=Ce}}function EM(a,c,f){if(a=c.effects,c.effects=null,a!==null)for(c=0;c<a.length;c++){var y=a[c],C=y.callback;if(C!==null){if(y.callback=null,y=f,typeof C!="function")throw Error(t(191,C));C.call(y)}}}var xM=new r.Component().refs;function r1(a,c,f,y){c=a.memoizedState,f=f(y,c),f=f==null?c:Q({},c,f),a.memoizedState=f,a.lanes===0&&(a.updateQueue.baseState=f)}var sp={isMounted:function(a){return(a=a._reactInternals)?Ps(a)===a:!1},enqueueSetState:function(a,c,f){a=a._reactInternals;var y=yn(),C=Ha(a),B=Gs(y,C);B.payload=c,f!=null&&(B.callback=f),c=Qa(a,B,C),c!==null&&(Hi(c,a,C,y),np(c,a,C))},enqueueReplaceState:function(a,c,f){a=a._reactInternals;var y=yn(),C=Ha(a),B=Gs(y,C);B.tag=1,B.payload=c,f!=null&&(B.callback=f),c=Qa(a,B,C),c!==null&&(Hi(c,a,C,y),np(c,a,C))},enqueueForceUpdate:function(a,c){a=a._reactInternals;var f=yn(),y=Ha(a),C=Gs(f,y);C.tag=2,c!=null&&(C.callback=c),c=Qa(a,C,y),c!==null&&(Hi(c,a,y,f),np(c,a,y))}};function wM(a,c,f,y,C,B,U){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(y,B,U):c.prototype&&c.prototype.isPureReactComponent?!fh(f,y)||!fh(C,B):!0}function IM(a,c,f){var y=!1,C=Ua,B=c.contextType;return typeof B=="object"&&B!==null?B=mi(B):(C=Pn(c)?ko:nn.current,y=c.contextTypes,B=(y=y!=null)?xc(a,C):Ua),c=new c(f,B),a.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=sp,a.stateNode=c,c._reactInternals=a,y&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=C,a.__reactInternalMemoizedMaskedChildContext=B),c}function CM(a,c,f,y){a=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(f,y),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(f,y),c.state!==a&&sp.enqueueReplaceState(c,c.state,null)}function n1(a,c,f,y){var C=a.stateNode;C.props=f,C.state=a.memoizedState,C.refs=xM,t1(a);var B=c.contextType;typeof B=="object"&&B!==null?C.context=mi(B):(B=Pn(c)?ko:nn.current,C.context=xc(a,B)),C.state=a.memoizedState,B=c.getDerivedStateFromProps,typeof B=="function"&&(r1(a,c,B,f),C.state=a.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof C.getSnapshotBeforeUpdate=="function"||typeof C.UNSAFE_componentWillMount!="function"&&typeof C.componentWillMount!="function"||(c=C.state,typeof C.componentWillMount=="function"&&C.componentWillMount(),typeof C.UNSAFE_componentWillMount=="function"&&C.UNSAFE_componentWillMount(),c!==C.state&&sp.enqueueReplaceState(C,C.state,null),ip(a,f,C,y),C.state=a.memoizedState),typeof C.componentDidMount=="function"&&(a.flags|=4194308)}function yh(a,c,f){if(a=f.ref,a!==null&&typeof a!="function"&&typeof a!="object"){if(f._owner){if(f=f._owner,f){if(f.tag!==1)throw Error(t(309));var y=f.stateNode}if(!y)throw Error(t(147,a));var C=y,B=""+a;return c!==null&&c.ref!==null&&typeof c.ref=="function"&&c.ref._stringRef===B?c.ref:(c=function(U){var q=C.refs;q===xM&&(q=C.refs={}),U===null?delete q[B]:q[B]=U},c._stringRef=B,c)}if(typeof a!="string")throw Error(t(284));if(!f._owner)throw Error(t(290,a))}return a}function ap(a,c){throw a=Object.prototype.toString.call(c),Error(t(31,a==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":a))}function MM(a){var c=a._init;return c(a._payload)}function SM(a){function c(ie,$){if(a){var ae=ie.deletions;ae===null?(ie.deletions=[$],ie.flags|=16):ae.push($)}}function f(ie,$){if(!a)return null;for(;$!==null;)c(ie,$),$=$.sibling;return null}function y(ie,$){for(ie=new Map;$!==null;)$.key!==null?ie.set($.key,$):ie.set($.index,$),$=$.sibling;return ie}function C(ie,$){return ie=Va(ie,$),ie.index=0,ie.sibling=null,ie}function B(ie,$,ae){return ie.index=ae,a?(ae=ie.alternate,ae!==null?(ae=ae.index,ae<$?(ie.flags|=2,$):ae):(ie.flags|=2,$)):(ie.flags|=1048576,$)}function U(ie){return a&&ie.alternate===null&&(ie.flags|=2),ie}function q(ie,$,ae,Te){return $===null||$.tag!==6?($=F1(ae,ie.mode,Te),$.return=ie,$):($=C($,ae),$.return=ie,$)}function J(ie,$,ae,Te){var qe=ae.type;return qe===T?we(ie,$,ae.props.children,Te,ae.key):$!==null&&($.elementType===qe||typeof qe=="object"&&qe!==null&&qe.$$typeof===K&&MM(qe)===$.type)?(Te=C($,ae.props),Te.ref=yh(ie,$,ae),Te.return=ie,Te):(Te=Cp(ae.type,ae.key,ae.props,null,ie.mode,Te),Te.ref=yh(ie,$,ae),Te.return=ie,Te)}function ce(ie,$,ae,Te){return $===null||$.tag!==4||$.stateNode.containerInfo!==ae.containerInfo||$.stateNode.implementation!==ae.implementation?($=z1(ae,ie.mode,Te),$.return=ie,$):($=C($,ae.children||[]),$.return=ie,$)}function we(ie,$,ae,Te,qe){return $===null||$.tag!==7?($=Yo(ae,ie.mode,Te,qe),$.return=ie,$):($=C($,ae),$.return=ie,$)}function Ce(ie,$,ae){if(typeof $=="string"&&$!==""||typeof $=="number")return $=F1(""+$,ie.mode,ae),$.return=ie,$;if(typeof $=="object"&&$!==null){switch($.$$typeof){case R:return ae=Cp($.type,$.key,$.props,null,ie.mode,ae),ae.ref=yh(ie,null,$),ae.return=ie,ae;case S:return $=z1($,ie.mode,ae),$.return=ie,$;case K:var Te=$._init;return Ce(ie,Te($._payload),ae)}if(pe($)||ee($))return $=Yo($,ie.mode,ae,null),$.return=ie,$;ap(ie,$)}return null}function xe(ie,$,ae,Te){var qe=$!==null?$.key:null;if(typeof ae=="string"&&ae!==""||typeof ae=="number")return qe!==null?null:q(ie,$,""+ae,Te);if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case R:return ae.key===qe?J(ie,$,ae,Te):null;case S:return ae.key===qe?ce(ie,$,ae,Te):null;case K:return qe=ae._init,xe(ie,$,qe(ae._payload),Te)}if(pe(ae)||ee(ae))return qe!==null?null:we(ie,$,ae,Te,null);ap(ie,ae)}return null}function ke(ie,$,ae,Te,qe){if(typeof Te=="string"&&Te!==""||typeof Te=="number")return ie=ie.get(ae)||null,q($,ie,""+Te,qe);if(typeof Te=="object"&&Te!==null){switch(Te.$$typeof){case R:return ie=ie.get(Te.key===null?ae:Te.key)||null,J($,ie,Te,qe);case S:return ie=ie.get(Te.key===null?ae:Te.key)||null,ce($,ie,Te,qe);case K:var Ze=Te._init;return ke(ie,$,ae,Ze(Te._payload),qe)}if(pe(Te)||ee(Te))return ie=ie.get(ae)||null,we($,ie,Te,qe,null);ap($,Te)}return null}function ze(ie,$,ae,Te){for(var qe=null,Ze=null,$e=$,ot=$=0,Yr=null;$e!==null&&ot<ae.length;ot++){$e.index>ot?(Yr=$e,$e=null):Yr=$e.sibling;var bt=xe(ie,$e,ae[ot],Te);if(bt===null){$e===null&&($e=Yr);break}a&&$e&&bt.alternate===null&&c(ie,$e),$=B(bt,$,ot),Ze===null?qe=bt:Ze.sibling=bt,Ze=bt,$e=Yr}if(ot===ae.length)return f(ie,$e),tr&&Oo(ie,ot),qe;if($e===null){for(;ot<ae.length;ot++)$e=Ce(ie,ae[ot],Te),$e!==null&&($=B($e,$,ot),Ze===null?qe=$e:Ze.sibling=$e,Ze=$e);return tr&&Oo(ie,ot),qe}for($e=y(ie,$e);ot<ae.length;ot++)Yr=ke($e,ie,ot,ae[ot],Te),Yr!==null&&(a&&Yr.alternate!==null&&$e.delete(Yr.key===null?ot:Yr.key),$=B(Yr,$,ot),Ze===null?qe=Yr:Ze.sibling=Yr,Ze=Yr);return a&&$e.forEach(function(ja){return c(ie,ja)}),tr&&Oo(ie,ot),qe}function We(ie,$,ae,Te){var qe=ee(ae);if(typeof qe!="function")throw Error(t(150));if(ae=qe.call(ae),ae==null)throw Error(t(151));for(var Ze=qe=null,$e=$,ot=$=0,Yr=null,bt=ae.next();$e!==null&&!bt.done;ot++,bt=ae.next()){$e.index>ot?(Yr=$e,$e=null):Yr=$e.sibling;var ja=xe(ie,$e,bt.value,Te);if(ja===null){$e===null&&($e=Yr);break}a&&$e&&ja.alternate===null&&c(ie,$e),$=B(ja,$,ot),Ze===null?qe=ja:Ze.sibling=ja,Ze=ja,$e=Yr}if(bt.done)return f(ie,$e),tr&&Oo(ie,ot),qe;if($e===null){for(;!bt.done;ot++,bt=ae.next())bt=Ce(ie,bt.value,Te),bt!==null&&($=B(bt,$,ot),Ze===null?qe=bt:Ze.sibling=bt,Ze=bt);return tr&&Oo(ie,ot),qe}for($e=y(ie,$e);!bt.done;ot++,bt=ae.next())bt=ke($e,ie,ot,bt.value,Te),bt!==null&&(a&&bt.alternate!==null&&$e.delete(bt.key===null?ot:bt.key),$=B(bt,$,ot),Ze===null?qe=bt:Ze.sibling=bt,Ze=bt);return a&&$e.forEach(function(XQ){return c(ie,XQ)}),tr&&Oo(ie,ot),qe}function wr(ie,$,ae,Te){if(typeof ae=="object"&&ae!==null&&ae.type===T&&ae.key===null&&(ae=ae.props.children),typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case R:e:{for(var qe=ae.key,Ze=$;Ze!==null;){if(Ze.key===qe){if(qe=ae.type,qe===T){if(Ze.tag===7){f(ie,Ze.sibling),$=C(Ze,ae.props.children),$.return=ie,ie=$;break e}}else if(Ze.elementType===qe||typeof qe=="object"&&qe!==null&&qe.$$typeof===K&&MM(qe)===Ze.type){f(ie,Ze.sibling),$=C(Ze,ae.props),$.ref=yh(ie,Ze,ae),$.return=ie,ie=$;break e}f(ie,Ze);break}else c(ie,Ze);Ze=Ze.sibling}ae.type===T?($=Yo(ae.props.children,ie.mode,Te,ae.key),$.return=ie,ie=$):(Te=Cp(ae.type,ae.key,ae.props,null,ie.mode,Te),Te.ref=yh(ie,$,ae),Te.return=ie,ie=Te)}return U(ie);case S:e:{for(Ze=ae.key;$!==null;){if($.key===Ze)if($.tag===4&&$.stateNode.containerInfo===ae.containerInfo&&$.stateNode.implementation===ae.implementation){f(ie,$.sibling),$=C($,ae.children||[]),$.return=ie,ie=$;break e}else{f(ie,$);break}else c(ie,$);$=$.sibling}$=z1(ae,ie.mode,Te),$.return=ie,ie=$}return U(ie);case K:return Ze=ae._init,wr(ie,$,Ze(ae._payload),Te)}if(pe(ae))return ze(ie,$,ae,Te);if(ee(ae))return We(ie,$,ae,Te);ap(ie,ae)}return typeof ae=="string"&&ae!==""||typeof ae=="number"?(ae=""+ae,$!==null&&$.tag===6?(f(ie,$.sibling),$=C($,ae),$.return=ie,ie=$):(f(ie,$),$=F1(ae,ie.mode,Te),$.return=ie,ie=$),U(ie)):f(ie,$)}return wr}var Tc=SM(!0),TM=SM(!1),Eh={},os=Na(Eh),xh=Na(Eh),wh=Na(Eh);function zo(a){if(a===Eh)throw Error(t(174));return a}function i1(a,c){switch(Wt(wh,c),Wt(xh,a),Wt(os,Eh),a=c.nodeType,a){case 9:case 11:c=(c=c.documentElement)?c.namespaceURI:Me(null,"");break;default:a=a===8?c.parentNode:c,c=a.namespaceURI||null,a=a.tagName,c=Me(c,a)}Kt(os),Wt(os,c)}function Bc(){Kt(os),Kt(xh),Kt(wh)}function BM(a){zo(wh.current);var c=zo(os.current),f=Me(c,a.type);c!==f&&(Wt(xh,a),Wt(os,f))}function s1(a){xh.current===a&&(Kt(os),Kt(xh))}var ar=Na(0);function op(a){for(var c=a;c!==null;){if(c.tag===13){var f=c.memoizedState;if(f!==null&&(f=f.dehydrated,f===null||f.data==="$?"||f.data==="$!"))return c}else if(c.tag===19&&c.memoizedProps.revealOrder!==void 0){if(c.flags&128)return c}else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===a)break;for(;c.sibling===null;){if(c.return===null||c.return===a)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}var a1=[];function o1(){for(var a=0;a<a1.length;a++)a1[a]._workInProgressVersionPrimary=null;a1.length=0}var lp=I.ReactCurrentDispatcher,l1=I.ReactCurrentBatchConfig,Ho=0,or=null,Nr=null,jr=null,cp=!1,Ih=!1,Ch=0,mQ=0;function sn(){throw Error(t(321))}function c1(a,c){if(c===null)return!1;for(var f=0;f<c.length&&f<a.length;f++)if(!ki(a[f],c[f]))return!1;return!0}function u1(a,c,f,y,C,B){if(Ho=B,or=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,lp.current=a===null||a.memoizedState===null?EQ:xQ,a=f(y,C),Ih){B=0;do{if(Ih=!1,Ch=0,25<=B)throw Error(t(301));B+=1,jr=Nr=null,c.updateQueue=null,lp.current=wQ,a=f(y,C)}while(Ih)}if(lp.current=dp,c=Nr!==null&&Nr.next!==null,Ho=0,jr=Nr=or=null,cp=!1,c)throw Error(t(300));return a}function h1(){var a=Ch!==0;return Ch=0,a}function ls(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return jr===null?or.memoizedState=jr=a:jr=jr.next=a,jr}function vi(){if(Nr===null){var a=or.alternate;a=a!==null?a.memoizedState:null}else a=Nr.next;var c=jr===null?or.memoizedState:jr.next;if(c!==null)jr=c,Nr=a;else{if(a===null)throw Error(t(310));Nr=a,a={memoizedState:Nr.memoizedState,baseState:Nr.baseState,baseQueue:Nr.baseQueue,queue:Nr.queue,next:null},jr===null?or.memoizedState=jr=a:jr=jr.next=a}return jr}function Mh(a,c){return typeof c=="function"?c(a):c}function d1(a){var c=vi(),f=c.queue;if(f===null)throw Error(t(311));f.lastRenderedReducer=a;var y=Nr,C=y.baseQueue,B=f.pending;if(B!==null){if(C!==null){var U=C.next;C.next=B.next,B.next=U}y.baseQueue=C=B,f.pending=null}if(C!==null){B=C.next,y=y.baseState;var q=U=null,J=null,ce=B;do{var we=ce.lane;if((Ho&we)===we)J!==null&&(J=J.next={lane:0,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null}),y=ce.hasEagerState?ce.eagerState:a(y,ce.action);else{var Ce={lane:we,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null};J===null?(q=J=Ce,U=y):J=J.next=Ce,or.lanes|=we,Go|=we}ce=ce.next}while(ce!==null&&ce!==B);J===null?U=y:J.next=q,ki(y,c.memoizedState)||(kn=!0),c.memoizedState=y,c.baseState=U,c.baseQueue=J,f.lastRenderedState=y}if(a=f.interleaved,a!==null){C=a;do B=C.lane,or.lanes|=B,Go|=B,C=C.next;while(C!==a)}else C===null&&(f.lanes=0);return[c.memoizedState,f.dispatch]}function f1(a){var c=vi(),f=c.queue;if(f===null)throw Error(t(311));f.lastRenderedReducer=a;var y=f.dispatch,C=f.pending,B=c.memoizedState;if(C!==null){f.pending=null;var U=C=C.next;do B=a(B,U.action),U=U.next;while(U!==C);ki(B,c.memoizedState)||(kn=!0),c.memoizedState=B,c.baseQueue===null&&(c.baseState=B),f.lastRenderedState=B}return[B,y]}function bM(){}function RM(a,c){var f=or,y=vi(),C=c(),B=!ki(y.memoizedState,C);if(B&&(y.memoizedState=C,kn=!0),y=y.queue,p1(NM.bind(null,f,y,a),[a]),y.getSnapshot!==c||B||jr!==null&&jr.memoizedState.tag&1){if(f.flags|=2048,Sh(9,LM.bind(null,f,y,C,c),void 0,null),Wr===null)throw Error(t(349));Ho&30||DM(f,c,C)}return C}function DM(a,c,f){a.flags|=16384,a={getSnapshot:c,value:f},c=or.updateQueue,c===null?(c={lastEffect:null,stores:null},or.updateQueue=c,c.stores=[a]):(f=c.stores,f===null?c.stores=[a]:f.push(a))}function LM(a,c,f,y){c.value=f,c.getSnapshot=y,UM(c)&&PM(a)}function NM(a,c,f){return f(function(){UM(c)&&PM(a)})}function UM(a){var c=a.getSnapshot;a=a.value;try{var f=c();return!ki(a,f)}catch{return!0}}function PM(a){var c=Hs(a,1);c!==null&&Hi(c,a,1,-1)}function kM(a){var c=ls();return typeof a=="function"&&(a=a()),c.memoizedState=c.baseState=a,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Mh,lastRenderedState:a},c.queue=a,a=a.dispatch=yQ.bind(null,or,a),[c.memoizedState,a]}function Sh(a,c,f,y){return a={tag:a,create:c,destroy:f,deps:y,next:null},c=or.updateQueue,c===null?(c={lastEffect:null,stores:null},or.updateQueue=c,c.lastEffect=a.next=a):(f=c.lastEffect,f===null?c.lastEffect=a.next=a:(y=f.next,f.next=a,a.next=y,c.lastEffect=a)),a}function QM(){return vi().memoizedState}function up(a,c,f,y){var C=ls();or.flags|=a,C.memoizedState=Sh(1|c,f,void 0,y===void 0?null:y)}function hp(a,c,f,y){var C=vi();y=y===void 0?null:y;var B=void 0;if(Nr!==null){var U=Nr.memoizedState;if(B=U.destroy,y!==null&&c1(y,U.deps)){C.memoizedState=Sh(c,f,B,y);return}}or.flags|=a,C.memoizedState=Sh(1|c,f,B,y)}function OM(a,c){return up(8390656,8,a,c)}function p1(a,c){return hp(2048,8,a,c)}function FM(a,c){return hp(4,2,a,c)}function zM(a,c){return hp(4,4,a,c)}function HM(a,c){if(typeof c=="function")return a=a(),c(a),function(){c(null)};if(c!=null)return a=a(),c.current=a,function(){c.current=null}}function GM(a,c,f){return f=f!=null?f.concat([a]):null,hp(4,4,HM.bind(null,c,a),f)}function A1(){}function VM(a,c){var f=vi();c=c===void 0?null:c;var y=f.memoizedState;return y!==null&&c!==null&&c1(c,y[1])?y[0]:(f.memoizedState=[a,c],a)}function jM(a,c){var f=vi();c=c===void 0?null:c;var y=f.memoizedState;return y!==null&&c!==null&&c1(c,y[1])?y[0]:(a=a(),f.memoizedState=[a,c],a)}function WM(a,c,f){return Ho&21?(ki(f,c)||(f=th(),or.lanes|=f,Go|=f,a.baseState=!0),c):(a.baseState&&(a.baseState=!1,kn=!0),a.memoizedState=f)}function vQ(a,c){var f=kt;kt=f!==0&&4>f?f:4,a(!0);var y=l1.transition;l1.transition={};try{a(!1),c()}finally{kt=f,l1.transition=y}}function YM(){return vi().memoizedState}function _Q(a,c,f){var y=Ha(a);if(f={lane:y,action:f,hasEagerState:!1,eagerState:null,next:null},qM(a))XM(c,f);else if(f=vM(a,c,f,y),f!==null){var C=yn();Hi(f,a,y,C),KM(f,c,y)}}function yQ(a,c,f){var y=Ha(a),C={lane:y,action:f,hasEagerState:!1,eagerState:null,next:null};if(qM(a))XM(c,C);else{var B=a.alternate;if(a.lanes===0&&(B===null||B.lanes===0)&&(B=c.lastRenderedReducer,B!==null))try{var U=c.lastRenderedState,q=B(U,f);if(C.hasEagerState=!0,C.eagerState=q,ki(q,U)){var J=c.interleaved;J===null?(C.next=C,e1(c)):(C.next=J.next,J.next=C),c.interleaved=C;return}}catch{}finally{}f=vM(a,c,C,y),f!==null&&(C=yn(),Hi(f,a,y,C),KM(f,c,y))}}function qM(a){var c=a.alternate;return a===or||c!==null&&c===or}function XM(a,c){Ih=cp=!0;var f=a.pending;f===null?c.next=c:(c.next=f.next,f.next=c),a.pending=c}function KM(a,c,f){if(f&4194240){var y=c.lanes;y&=a.pendingLanes,f|=y,c.lanes=f,A0(a,f)}}var dp={readContext:mi,useCallback:sn,useContext:sn,useEffect:sn,useImperativeHandle:sn,useInsertionEffect:sn,useLayoutEffect:sn,useMemo:sn,useReducer:sn,useRef:sn,useState:sn,useDebugValue:sn,useDeferredValue:sn,useTransition:sn,useMutableSource:sn,useSyncExternalStore:sn,useId:sn,unstable_isNewReconciler:!1},EQ={readContext:mi,useCallback:function(a,c){return ls().memoizedState=[a,c===void 0?null:c],a},useContext:mi,useEffect:OM,useImperativeHandle:function(a,c,f){return f=f!=null?f.concat([a]):null,up(4194308,4,HM.bind(null,c,a),f)},useLayoutEffect:function(a,c){return up(4194308,4,a,c)},useInsertionEffect:function(a,c){return up(4,2,a,c)},useMemo:function(a,c){var f=ls();return c=c===void 0?null:c,a=a(),f.memoizedState=[a,c],a},useReducer:function(a,c,f){var y=ls();return c=f!==void 0?f(c):c,y.memoizedState=y.baseState=c,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:c},y.queue=a,a=a.dispatch=_Q.bind(null,or,a),[y.memoizedState,a]},useRef:function(a){var c=ls();return a={current:a},c.memoizedState=a},useState:kM,useDebugValue:A1,useDeferredValue:function(a){return ls().memoizedState=a},useTransition:function(){var a=kM(!1),c=a[0];return a=vQ.bind(null,a[1]),ls().memoizedState=a,[c,a]},useMutableSource:function(){},useSyncExternalStore:function(a,c,f){var y=or,C=ls();if(tr){if(f===void 0)throw Error(t(407));f=f()}else{if(f=c(),Wr===null)throw Error(t(349));Ho&30||DM(y,c,f)}C.memoizedState=f;var B={value:f,getSnapshot:c};return C.queue=B,OM(NM.bind(null,y,B,a),[a]),y.flags|=2048,Sh(9,LM.bind(null,y,B,f,c),void 0,null),f},useId:function(){var a=ls(),c=Wr.identifierPrefix;if(tr){var f=zs,y=Fs;f=(y&~(1<<32-vn(y)-1)).toString(32)+f,c=":"+c+"R"+f,f=Ch++,0<f&&(c+="H"+f.toString(32)),c+=":"}else f=mQ++,c=":"+c+"r"+f.toString(32)+":";return a.memoizedState=c},unstable_isNewReconciler:!1},xQ={readContext:mi,useCallback:VM,useContext:mi,useEffect:p1,useImperativeHandle:GM,useInsertionEffect:FM,useLayoutEffect:zM,useMemo:jM,useReducer:d1,useRef:QM,useState:function(){return d1(Mh)},useDebugValue:A1,useDeferredValue:function(a){var c=vi();return WM(c,Nr.memoizedState,a)},useTransition:function(){var a=d1(Mh)[0],c=vi().memoizedState;return[a,c]},useMutableSource:bM,useSyncExternalStore:RM,useId:YM,unstable_isNewReconciler:!1},wQ={readContext:mi,useCallback:VM,useContext:mi,useEffect:p1,useImperativeHandle:GM,useInsertionEffect:FM,useLayoutEffect:zM,useMemo:jM,useReducer:f1,useRef:QM,useState:function(){return f1(Mh)},useDebugValue:A1,useDeferredValue:function(a){var c=vi();return Nr===null?c.memoizedState=a:WM(c,Nr.memoizedState,a)},useTransition:function(){var a=f1(Mh)[0],c=vi().memoizedState;return[a,c]},useMutableSource:bM,useSyncExternalStore:RM,useId:YM,unstable_isNewReconciler:!1};function bc(a,c){try{var f="",y=c;do f+=de(y),y=y.return;while(y);var C=f}catch(B){C=`
4571
+ `+C[U].replace(" at new "," at ");return a.displayName&&J.includes("<anonymous>")&&(J=J.replace("<anonymous>",a.displayName)),J}while(1<=U&&0<=q);break}}}finally{re=!1,Error.prepareStackTrace=f}return(a=a?a.displayName||a.name:"")?Z(a):""}function de(a){switch(a.tag){case 5:return Z(a.type);case 16:return Z("Lazy");case 13:return Z("Suspense");case 19:return Z("SuspenseList");case 0:case 2:case 15:return a=j(a.type,!1),a;case 11:return a=j(a.type.render,!1),a;case 1:return a=j(a.type,!0),a;default:return""}}function Ae(a){if(a==null)return null;if(typeof a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case T:return"Fragment";case S:return"Portal";case b:return"Profiler";case D:return"StrictMode";case N:return"Suspense";case W:return"SuspenseList"}if(typeof a=="object")switch(a.$$typeof){case L:return(a.displayName||"Context")+".Consumer";case M:return(a._context.displayName||"Context")+".Provider";case P:var c=a.render;return a=a.displayName,a||(a=c.displayName||c.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case X:return c=a.displayName||null,c!==null?c:Ae(a.type)||"Memo";case K:c=a._payload,a=a._init;try{return Ae(a(c))}catch{}}return null}function _e(a){var c=a.type;switch(a.tag){case 24:return"Cache";case 9:return(c.displayName||"Context")+".Consumer";case 10:return(c._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return a=c.render,a=a.displayName||a.name||"",c.displayName||(a!==""?"ForwardRef("+a+")":"ForwardRef");case 7:return"Fragment";case 5:return c;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Ae(c);case 8:return c===D?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof c=="function")return c.displayName||c.name||null;if(typeof c=="string")return c}return null}function Ee(a){switch(typeof a){case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function Le(a){var c=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(c==="checkbox"||c==="radio")}function st(a){var c=Le(a)?"checked":"value",f=Object.getOwnPropertyDescriptor(a.constructor.prototype,c),y=""+a[c];if(!a.hasOwnProperty(c)&&typeof f<"u"&&typeof f.get=="function"&&typeof f.set=="function"){var C=f.get,B=f.set;return Object.defineProperty(a,c,{configurable:!0,get:function(){return C.call(this)},set:function(U){y=""+U,B.call(this,U)}}),Object.defineProperty(a,c,{enumerable:f.enumerable}),{getValue:function(){return y},setValue:function(U){y=""+U},stopTracking:function(){a._valueTracker=null,delete a[c]}}}}function se(a){a._valueTracker||(a._valueTracker=st(a))}function et(a){if(!a)return!1;var c=a._valueTracker;if(!c)return!0;var f=c.getValue(),y="";return a&&(y=Le(a)?a.checked?"true":"false":a.value),a=y,a!==f?(c.setValue(a),!0):!1}function Qe(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}function ct(a,c){var f=c.checked;return Q({},c,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:f??a._wrapperState.initialChecked})}function Ke(a,c){var f=c.defaultValue==null?"":c.defaultValue,y=c.checked!=null?c.checked:c.defaultChecked;f=Ee(c.value!=null?c.value:f),a._wrapperState={initialChecked:y,initialValue:f,controlled:c.type==="checkbox"||c.type==="radio"?c.checked!=null:c.value!=null}}function pt(a,c){c=c.checked,c!=null&&x(a,"checked",c,!1)}function Y(a,c){pt(a,c);var f=Ee(c.value),y=c.type;if(f!=null)y==="number"?(f===0&&a.value===""||a.value!=f)&&(a.value=""+f):a.value!==""+f&&(a.value=""+f);else if(y==="submit"||y==="reset"){a.removeAttribute("value");return}c.hasOwnProperty("value")?le(a,c.type,f):c.hasOwnProperty("defaultValue")&&le(a,c.type,Ee(c.defaultValue)),c.checked==null&&c.defaultChecked!=null&&(a.defaultChecked=!!c.defaultChecked)}function k(a,c,f){if(c.hasOwnProperty("value")||c.hasOwnProperty("defaultValue")){var y=c.type;if(!(y!=="submit"&&y!=="reset"||c.value!==void 0&&c.value!==null))return;c=""+a._wrapperState.initialValue,f||c===a.value||(a.value=c),a.defaultValue=c}f=a.name,f!==""&&(a.name=""),a.defaultChecked=!!a._wrapperState.initialChecked,f!==""&&(a.name=f)}function le(a,c,f){(c!=="number"||Qe(a.ownerDocument)!==a)&&(f==null?a.defaultValue=""+a._wrapperState.initialValue:a.defaultValue!==""+f&&(a.defaultValue=""+f))}var pe=Array.isArray;function me(a,c,f,y){if(a=a.options,c){c={};for(var C=0;C<f.length;C++)c["$"+f[C]]=!0;for(f=0;f<a.length;f++)C=c.hasOwnProperty("$"+a[f].value),a[f].selected!==C&&(a[f].selected=C),C&&y&&(a[f].defaultSelected=!0)}else{for(f=""+Ee(f),c=null,C=0;C<a.length;C++){if(a[C].value===f){a[C].selected=!0,y&&(a[C].defaultSelected=!0);return}c!==null||a[C].disabled||(c=a[C])}c!==null&&(c.selected=!0)}}function ye(a,c){if(c.dangerouslySetInnerHTML!=null)throw Error(t(91));return Q({},c,{value:void 0,defaultValue:void 0,children:""+a._wrapperState.initialValue})}function He(a,c){var f=c.value;if(f==null){if(f=c.children,c=c.defaultValue,f!=null){if(c!=null)throw Error(t(92));if(pe(f)){if(1<f.length)throw Error(t(93));f=f[0]}c=f}c==null&&(c=""),f=c}a._wrapperState={initialValue:Ee(f)}}function Ie(a,c){var f=Ee(c.value),y=Ee(c.defaultValue);f!=null&&(f=""+f,f!==a.value&&(a.value=f),c.defaultValue==null&&a.defaultValue!==f&&(a.defaultValue=f)),y!=null&&(a.defaultValue=""+y)}function je(a){var c=a.textContent;c===a._wrapperState.initialValue&&c!==""&&c!==null&&(a.value=c)}function Ge(a){switch(a){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Me(a,c){return a==null||a==="http://www.w3.org/1999/xhtml"?Ge(c):a==="http://www.w3.org/2000/svg"&&c==="foreignObject"?"http://www.w3.org/1999/xhtml":a}var fe,De=function(a){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(c,f,y,C){MSApp.execUnsafeLocalFunction(function(){return a(c,f,y,C)})}:a}(function(a,c){if(a.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in a)a.innerHTML=c;else{for(fe=fe||document.createElement("div"),fe.innerHTML="<svg>"+c.valueOf().toString()+"</svg>",c=fe.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;c.firstChild;)a.appendChild(c.firstChild)}});function Be(a,c){if(c){var f=a.firstChild;if(f&&f===a.lastChild&&f.nodeType===3){f.nodeValue=c;return}}a.textContent=c}var be={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},nt=["Webkit","ms","Moz","O"];Object.keys(be).forEach(function(a){nt.forEach(function(c){c=c+a.charAt(0).toUpperCase()+a.substring(1),be[c]=be[a]})});function lt(a,c,f){return c==null||typeof c=="boolean"||c===""?"":f||typeof c!="number"||c===0||be.hasOwnProperty(a)&&be[a]?(""+c).trim():c+"px"}function dt(a,c){a=a.style;for(var f in c)if(c.hasOwnProperty(f)){var y=f.indexOf("--")===0,C=lt(f,c[f],y);f==="float"&&(f="cssFloat"),y?a.setProperty(f,C):a[f]=C}}var ut=Q({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ht(a,c){if(c){if(ut[a]&&(c.children!=null||c.dangerouslySetInnerHTML!=null))throw Error(t(137,a));if(c.dangerouslySetInnerHTML!=null){if(c.children!=null)throw Error(t(60));if(typeof c.dangerouslySetInnerHTML!="object"||!("__html"in c.dangerouslySetInnerHTML))throw Error(t(61))}if(c.style!=null&&typeof c.style!="object")throw Error(t(62))}}function H(a,c){if(a.indexOf("-")===-1)return typeof c.is=="string";switch(a){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var O=null;function ge(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var ve=null,Fe=null,Pe=null;function vt(a){if(a=_h(a)){if(typeof ve!="function")throw Error(t(280));var c=a.stateNode;c&&(c=Yf(c),ve(a.stateNode,a.type,c))}}function Lt(a){Fe?Pe?Pe.push(a):Pe=[a]:Fe=a}function Nt(){if(Fe){var a=Fe,c=Pe;if(Pe=Fe=null,vt(a),c)for(a=0;a<c.length;a++)vt(c[a])}}function Bt(a,c){return a(c)}function _t(){}var fr=!1;function Vt(a,c,f){if(fr)return a(c,f);fr=!0;try{return Bt(a,c,f)}finally{fr=!1,(Fe!==null||Pe!==null)&&(_t(),Nt())}}function Er(a,c){var f=a.stateNode;if(f===null)return null;var y=Yf(f);if(y===null)return null;f=y[c];e:switch(c){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(y=!y.disabled)||(a=a.type,y=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!y;break e;default:a=!1}if(a)return null;if(f&&typeof f!="function")throw Error(t(231,c,typeof f));return f}var Rn=!1;if(l)try{var qt={};Object.defineProperty(qt,"passive",{get:function(){Rn=!0}}),window.addEventListener("test",qt,qt),window.removeEventListener("test",qt,qt)}catch{Rn=!1}function fi(a,c,f,y,C,B,U,q,J){var ce=Array.prototype.slice.call(arguments,3);try{c.apply(f,ce)}catch(we){this.onError(we)}}var Zn=!1,Ns=null,Us=!1,dc=null,bf={onError:function(a){Zn=!0,Ns=a}};function d0(a,c,f,y,C,B,U,q,J){Zn=!1,Ns=null,fi.apply(bf,arguments)}function f0(a,c,f,y,C,B,U,q,J){if(d0.apply(this,arguments),Zn){if(Zn){var ce=Ns;Zn=!1,Ns=null}else throw Error(t(198));Us||(Us=!0,dc=ce)}}function Ps(a){var c=a,f=a;if(a.alternate)for(;c.return;)c=c.return;else{a=c;do c=a,c.flags&4098&&(f=c.return),a=c.return;while(a)}return c.tag===3?f:null}function F(a){if(a.tag===13){var c=a.memoizedState;if(c===null&&(a=a.alternate,a!==null&&(c=a.memoizedState)),c!==null)return c.dehydrated}return null}function ne(a){if(Ps(a)!==a)throw Error(t(188))}function ue(a){var c=a.alternate;if(!c){if(c=Ps(a),c===null)throw Error(t(188));return c!==a?null:a}for(var f=a,y=c;;){var C=f.return;if(C===null)break;var B=C.alternate;if(B===null){if(y=C.return,y!==null){f=y;continue}break}if(C.child===B.child){for(B=C.child;B;){if(B===f)return ne(C),a;if(B===y)return ne(C),c;B=B.sibling}throw Error(t(188))}if(f.return!==y.return)f=C,y=B;else{for(var U=!1,q=C.child;q;){if(q===f){U=!0,f=C,y=B;break}if(q===y){U=!0,y=C,f=B;break}q=q.sibling}if(!U){for(q=B.child;q;){if(q===f){U=!0,f=B,y=C;break}if(q===y){U=!0,y=B,f=C;break}q=q.sibling}if(!U)throw Error(t(189))}}if(f.alternate!==y)throw Error(t(190))}if(f.tag!==3)throw Error(t(188));return f.stateNode.current===f?a:c}function he(a){return a=ue(a),a!==null?oe(a):null}function oe(a){if(a.tag===5||a.tag===6)return a;for(a=a.child;a!==null;){var c=oe(a);if(c!==null)return c;a=a.sibling}return null}var Re=e.unstable_scheduleCallback,Je=e.unstable_cancelCallback,it=e.unstable_shouldYield,at=e.unstable_requestPaint,Xe=e.unstable_now,At=e.unstable_getCurrentPriorityLevel,ft=e.unstable_ImmediatePriority,Lr=e.unstable_UserBlockingPriority,er=e.unstable_NormalPriority,Dn=e.unstable_LowPriority,pi=e.unstable_IdlePriority,jt=null,tt=null;function Zu(a){if(tt&&typeof tt.onCommitFiberRoot=="function")try{tt.onCommitFiberRoot(jt,a,void 0,(a.current.flags&128)===128)}catch{}}var vn=Math.clz32?Math.clz32:Uo,ks=Math.log,Rf=Math.LN2;function Uo(a){return a>>>=0,a===0?32:31-(ks(a)/Rf|0)|0}var Ca=64,xr=4194304;function Ln(a){switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return a&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return a}}function Ma(a,c){var f=a.pendingLanes;if(f===0)return 0;var y=0,C=a.suspendedLanes,B=a.pingedLanes,U=f&268435455;if(U!==0){var q=U&~C;q!==0?y=Ln(q):(B&=U,B!==0&&(y=Ln(B)))}else U=f&~C,U!==0?y=Ln(U):B!==0&&(y=Ln(B));if(y===0)return 0;if(c!==0&&c!==y&&!(c&C)&&(C=y&-y,B=c&-c,C>=B||C===16&&(B&4194240)!==0))return c;if(y&4&&(y|=f&16),c=a.entangledLanes,c!==0)for(a=a.entanglements,c&=y;0<c;)f=31-vn(c),C=1<<f,y|=a[f],c&=~C;return y}function Nn(a,c){switch(a){case 1:case 2:case 4:return c+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return c+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function $u(a,c){for(var f=a.suspendedLanes,y=a.pingedLanes,C=a.expirationTimes,B=a.pendingLanes;0<B;){var U=31-vn(B),q=1<<U,J=C[U];J===-1?(!(q&f)||q&y)&&(C[U]=Nn(q,c)):J<=c&&(a.expiredLanes|=q),B&=~q}}function eh(a){return a=a.pendingLanes&-1073741825,a!==0?a:a&1073741824?1073741824:0}function th(){var a=Ca;return Ca<<=1,!(Ca&4194240)&&(Ca=64),a}function p0(a){for(var c=[],f=0;31>f;f++)c.push(a);return c}function rh(a,c,f){a.pendingLanes|=c,c!==536870912&&(a.suspendedLanes=0,a.pingedLanes=0),a=a.eventTimes,c=31-vn(c),a[c]=f}function mk(a,c){var f=a.pendingLanes&~c;a.pendingLanes=c,a.suspendedLanes=0,a.pingedLanes=0,a.expiredLanes&=c,a.mutableReadLanes&=c,a.entangledLanes&=c,c=a.entanglements;var y=a.eventTimes;for(a=a.expirationTimes;0<f;){var C=31-vn(f),B=1<<C;c[C]=0,y[C]=-1,a[C]=-1,f&=~B}}function A0(a,c){var f=a.entangledLanes|=c;for(a=a.entanglements;f;){var y=31-vn(f),C=1<<y;C&c|a[y]&c&&(a[y]|=c),f&=~C}}var kt=0;function _C(a){return a&=-a,1<a?4<a?a&268435455?16:536870912:4:1}var yC,g0,EC,xC,wC,m0=!1,Df=[],Sa=null,Ta=null,Ba=null,nh=new Map,ih=new Map,ba=[],vk="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function IC(a,c){switch(a){case"focusin":case"focusout":Sa=null;break;case"dragenter":case"dragleave":Ta=null;break;case"mouseover":case"mouseout":Ba=null;break;case"pointerover":case"pointerout":nh.delete(c.pointerId);break;case"gotpointercapture":case"lostpointercapture":ih.delete(c.pointerId)}}function sh(a,c,f,y,C,B){return a===null||a.nativeEvent!==B?(a={blockedOn:c,domEventName:f,eventSystemFlags:y,nativeEvent:B,targetContainers:[C]},c!==null&&(c=_h(c),c!==null&&g0(c)),a):(a.eventSystemFlags|=y,c=a.targetContainers,C!==null&&c.indexOf(C)===-1&&c.push(C),a)}function _k(a,c,f,y,C){switch(c){case"focusin":return Sa=sh(Sa,a,c,f,y,C),!0;case"dragenter":return Ta=sh(Ta,a,c,f,y,C),!0;case"mouseover":return Ba=sh(Ba,a,c,f,y,C),!0;case"pointerover":var B=C.pointerId;return nh.set(B,sh(nh.get(B)||null,a,c,f,y,C)),!0;case"gotpointercapture":return B=C.pointerId,ih.set(B,sh(ih.get(B)||null,a,c,f,y,C)),!0}return!1}function CC(a){var c=Po(a.target);if(c!==null){var f=Ps(c);if(f!==null){if(c=f.tag,c===13){if(c=F(f),c!==null){a.blockedOn=c,wC(a.priority,function(){EC(f)});return}}else if(c===3&&f.stateNode.current.memoizedState.isDehydrated){a.blockedOn=f.tag===3?f.stateNode.containerInfo:null;return}}}a.blockedOn=null}function Lf(a){if(a.blockedOn!==null)return!1;for(var c=a.targetContainers;0<c.length;){var f=_0(a.domEventName,a.eventSystemFlags,c[0],a.nativeEvent);if(f===null){f=a.nativeEvent;var y=new f.constructor(f.type,f);O=y,f.target.dispatchEvent(y),O=null}else return c=_h(f),c!==null&&g0(c),a.blockedOn=f,!1;c.shift()}return!0}function MC(a,c,f){Lf(a)&&f.delete(c)}function yk(){m0=!1,Sa!==null&&Lf(Sa)&&(Sa=null),Ta!==null&&Lf(Ta)&&(Ta=null),Ba!==null&&Lf(Ba)&&(Ba=null),nh.forEach(MC),ih.forEach(MC)}function ah(a,c){a.blockedOn===c&&(a.blockedOn=null,m0||(m0=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,yk)))}function oh(a){function c(C){return ah(C,a)}if(0<Df.length){ah(Df[0],a);for(var f=1;f<Df.length;f++){var y=Df[f];y.blockedOn===a&&(y.blockedOn=null)}}for(Sa!==null&&ah(Sa,a),Ta!==null&&ah(Ta,a),Ba!==null&&ah(Ba,a),nh.forEach(c),ih.forEach(c),f=0;f<ba.length;f++)y=ba[f],y.blockedOn===a&&(y.blockedOn=null);for(;0<ba.length&&(f=ba[0],f.blockedOn===null);)CC(f),f.blockedOn===null&&ba.shift()}var fc=I.ReactCurrentBatchConfig,Nf=!0;function Ek(a,c,f,y){var C=kt,B=fc.transition;fc.transition=null;try{kt=1,v0(a,c,f,y)}finally{kt=C,fc.transition=B}}function xk(a,c,f,y){var C=kt,B=fc.transition;fc.transition=null;try{kt=4,v0(a,c,f,y)}finally{kt=C,fc.transition=B}}function v0(a,c,f,y){if(Nf){var C=_0(a,c,f,y);if(C===null)P0(a,c,y,Uf,f),IC(a,y);else if(_k(C,a,c,f,y))y.stopPropagation();else if(IC(a,y),c&4&&-1<vk.indexOf(a)){for(;C!==null;){var B=_h(C);if(B!==null&&yC(B),B=_0(a,c,f,y),B===null&&P0(a,c,y,Uf,f),B===C)break;C=B}C!==null&&y.stopPropagation()}else P0(a,c,y,null,f)}}var Uf=null;function _0(a,c,f,y){if(Uf=null,a=ge(y),a=Po(a),a!==null)if(c=Ps(a),c===null)a=null;else if(f=c.tag,f===13){if(a=F(c),a!==null)return a;a=null}else if(f===3){if(c.stateNode.current.memoizedState.isDehydrated)return c.tag===3?c.stateNode.containerInfo:null;a=null}else c!==a&&(a=null);return Uf=a,null}function SC(a){switch(a){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(At()){case ft:return 1;case Lr:return 4;case er:case Dn:return 16;case pi:return 536870912;default:return 16}default:return 16}}var Ra=null,y0=null,Pf=null;function TC(){if(Pf)return Pf;var a,c=y0,f=c.length,y,C="value"in Ra?Ra.value:Ra.textContent,B=C.length;for(a=0;a<f&&c[a]===C[a];a++);var U=f-a;for(y=1;y<=U&&c[f-y]===C[B-y];y++);return Pf=C.slice(a,1<y?1-y:void 0)}function kf(a){var c=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&c===13&&(a=13)):a=c,a===10&&(a=13),32<=a||a===13?a:0}function Qf(){return!0}function BC(){return!1}function $n(a){function c(f,y,C,B,U){this._reactName=f,this._targetInst=C,this.type=y,this.nativeEvent=B,this.target=U,this.currentTarget=null;for(var q in a)a.hasOwnProperty(q)&&(f=a[q],this[q]=f?f(B):B[q]);return this.isDefaultPrevented=(B.defaultPrevented!=null?B.defaultPrevented:B.returnValue===!1)?Qf:BC,this.isPropagationStopped=BC,this}return Q(c.prototype,{preventDefault:function(){this.defaultPrevented=!0;var f=this.nativeEvent;f&&(f.preventDefault?f.preventDefault():typeof f.returnValue!="unknown"&&(f.returnValue=!1),this.isDefaultPrevented=Qf)},stopPropagation:function(){var f=this.nativeEvent;f&&(f.stopPropagation?f.stopPropagation():typeof f.cancelBubble!="unknown"&&(f.cancelBubble=!0),this.isPropagationStopped=Qf)},persist:function(){},isPersistent:Qf}),c}var pc={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},E0=$n(pc),lh=Q({},pc,{view:0,detail:0}),wk=$n(lh),x0,w0,ch,Of=Q({},lh,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:C0,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==ch&&(ch&&a.type==="mousemove"?(x0=a.screenX-ch.screenX,w0=a.screenY-ch.screenY):w0=x0=0,ch=a),x0)},movementY:function(a){return"movementY"in a?a.movementY:w0}}),bC=$n(Of),Ik=Q({},Of,{dataTransfer:0}),Ck=$n(Ik),Mk=Q({},lh,{relatedTarget:0}),I0=$n(Mk),Sk=Q({},pc,{animationName:0,elapsedTime:0,pseudoElement:0}),Tk=$n(Sk),Bk=Q({},pc,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),bk=$n(Bk),Rk=Q({},pc,{data:0}),RC=$n(Rk),Dk={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Lk={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Nk={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Uk(a){var c=this.nativeEvent;return c.getModifierState?c.getModifierState(a):(a=Nk[a])?!!c[a]:!1}function C0(){return Uk}var Pk=Q({},lh,{key:function(a){if(a.key){var c=Dk[a.key]||a.key;if(c!=="Unidentified")return c}return a.type==="keypress"?(a=kf(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?Lk[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:C0,charCode:function(a){return a.type==="keypress"?kf(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?kf(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),kk=$n(Pk),Qk=Q({},Of,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),DC=$n(Qk),Ok=Q({},lh,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:C0}),Fk=$n(Ok),zk=Q({},pc,{propertyName:0,elapsedTime:0,pseudoElement:0}),Hk=$n(zk),Gk=Q({},Of,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),Vk=$n(Gk),jk=[9,13,27,32],M0=l&&"CompositionEvent"in window,uh=null;l&&"documentMode"in document&&(uh=document.documentMode);var Wk=l&&"TextEvent"in window&&!uh,LC=l&&(!M0||uh&&8<uh&&11>=uh),NC=String.fromCharCode(32),UC=!1;function PC(a,c){switch(a){case"keyup":return jk.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function kC(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var Ac=!1;function Yk(a,c){switch(a){case"compositionend":return kC(c);case"keypress":return c.which!==32?null:(UC=!0,NC);case"textInput":return a=c.data,a===NC&&UC?null:a;default:return null}}function qk(a,c){if(Ac)return a==="compositionend"||!M0&&PC(a,c)?(a=TC(),Pf=y0=Ra=null,Ac=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1<c.char.length)return c.char;if(c.which)return String.fromCharCode(c.which)}return null;case"compositionend":return LC&&c.locale!=="ko"?null:c.data;default:return null}}var Xk={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function QC(a){var c=a&&a.nodeName&&a.nodeName.toLowerCase();return c==="input"?!!Xk[a.type]:c==="textarea"}function OC(a,c,f,y){Lt(y),c=Vf(c,"onChange"),0<c.length&&(f=new E0("onChange","change",null,f,y),a.push({event:f,listeners:c}))}var hh=null,dh=null;function Kk(a){nM(a,0)}function Ff(a){var c=yc(a);if(et(c))return a}function Jk(a,c){if(a==="change")return c}var FC=!1;if(l){var S0;if(l){var T0="oninput"in document;if(!T0){var zC=document.createElement("div");zC.setAttribute("oninput","return;"),T0=typeof zC.oninput=="function"}S0=T0}else S0=!1;FC=S0&&(!document.documentMode||9<document.documentMode)}function HC(){hh&&(hh.detachEvent("onpropertychange",GC),dh=hh=null)}function GC(a){if(a.propertyName==="value"&&Ff(dh)){var c=[];OC(c,dh,a,ge(a)),Vt(Kk,c)}}function Zk(a,c,f){a==="focusin"?(HC(),hh=c,dh=f,hh.attachEvent("onpropertychange",GC)):a==="focusout"&&HC()}function $k(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return Ff(dh)}function eQ(a,c){if(a==="click")return Ff(c)}function tQ(a,c){if(a==="input"||a==="change")return Ff(c)}function rQ(a,c){return a===c&&(a!==0||1/a===1/c)||a!==a&&c!==c}var ki=typeof Object.is=="function"?Object.is:rQ;function fh(a,c){if(ki(a,c))return!0;if(typeof a!="object"||a===null||typeof c!="object"||c===null)return!1;var f=Object.keys(a),y=Object.keys(c);if(f.length!==y.length)return!1;for(y=0;y<f.length;y++){var C=f[y];if(!h.call(c,C)||!ki(a[C],c[C]))return!1}return!0}function VC(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function jC(a,c){var f=VC(a);a=0;for(var y;f;){if(f.nodeType===3){if(y=a+f.textContent.length,a<=c&&y>=c)return{node:f,offset:c-a};a=y}e:{for(;f;){if(f.nextSibling){f=f.nextSibling;break e}f=f.parentNode}f=void 0}f=VC(f)}}function WC(a,c){return a&&c?a===c?!0:a&&a.nodeType===3?!1:c&&c.nodeType===3?WC(a,c.parentNode):"contains"in a?a.contains(c):a.compareDocumentPosition?!!(a.compareDocumentPosition(c)&16):!1:!1}function YC(){for(var a=window,c=Qe();c instanceof a.HTMLIFrameElement;){try{var f=typeof c.contentWindow.location.href=="string"}catch{f=!1}if(f)a=c.contentWindow;else break;c=Qe(a.document)}return c}function B0(a){var c=a&&a.nodeName&&a.nodeName.toLowerCase();return c&&(c==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||c==="textarea"||a.contentEditable==="true")}function nQ(a){var c=YC(),f=a.focusedElem,y=a.selectionRange;if(c!==f&&f&&f.ownerDocument&&WC(f.ownerDocument.documentElement,f)){if(y!==null&&B0(f)){if(c=y.start,a=y.end,a===void 0&&(a=c),"selectionStart"in f)f.selectionStart=c,f.selectionEnd=Math.min(a,f.value.length);else if(a=(c=f.ownerDocument||document)&&c.defaultView||window,a.getSelection){a=a.getSelection();var C=f.textContent.length,B=Math.min(y.start,C);y=y.end===void 0?B:Math.min(y.end,C),!a.extend&&B>y&&(C=y,y=B,B=C),C=jC(f,B);var U=jC(f,y);C&&U&&(a.rangeCount!==1||a.anchorNode!==C.node||a.anchorOffset!==C.offset||a.focusNode!==U.node||a.focusOffset!==U.offset)&&(c=c.createRange(),c.setStart(C.node,C.offset),a.removeAllRanges(),B>y?(a.addRange(c),a.extend(U.node,U.offset)):(c.setEnd(U.node,U.offset),a.addRange(c)))}}for(c=[],a=f;a=a.parentNode;)a.nodeType===1&&c.push({element:a,left:a.scrollLeft,top:a.scrollTop});for(typeof f.focus=="function"&&f.focus(),f=0;f<c.length;f++)a=c[f],a.element.scrollLeft=a.left,a.element.scrollTop=a.top}}var iQ=l&&"documentMode"in document&&11>=document.documentMode,gc=null,b0=null,ph=null,R0=!1;function qC(a,c,f){var y=f.window===f?f.document:f.nodeType===9?f:f.ownerDocument;R0||gc==null||gc!==Qe(y)||(y=gc,"selectionStart"in y&&B0(y)?y={start:y.selectionStart,end:y.selectionEnd}:(y=(y.ownerDocument&&y.ownerDocument.defaultView||window).getSelection(),y={anchorNode:y.anchorNode,anchorOffset:y.anchorOffset,focusNode:y.focusNode,focusOffset:y.focusOffset}),ph&&fh(ph,y)||(ph=y,y=Vf(b0,"onSelect"),0<y.length&&(c=new E0("onSelect","select",null,c,f),a.push({event:c,listeners:y}),c.target=gc)))}function zf(a,c){var f={};return f[a.toLowerCase()]=c.toLowerCase(),f["Webkit"+a]="webkit"+c,f["Moz"+a]="moz"+c,f}var mc={animationend:zf("Animation","AnimationEnd"),animationiteration:zf("Animation","AnimationIteration"),animationstart:zf("Animation","AnimationStart"),transitionend:zf("Transition","TransitionEnd")},D0={},XC={};l&&(XC=document.createElement("div").style,"AnimationEvent"in window||(delete mc.animationend.animation,delete mc.animationiteration.animation,delete mc.animationstart.animation),"TransitionEvent"in window||delete mc.transitionend.transition);function Hf(a){if(D0[a])return D0[a];if(!mc[a])return a;var c=mc[a],f;for(f in c)if(c.hasOwnProperty(f)&&f in XC)return D0[a]=c[f];return a}var KC=Hf("animationend"),JC=Hf("animationiteration"),ZC=Hf("animationstart"),$C=Hf("transitionend"),eM=new Map,tM="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Da(a,c){eM.set(a,c),s(c,[a])}for(var L0=0;L0<tM.length;L0++){var N0=tM[L0],sQ=N0.toLowerCase(),aQ=N0[0].toUpperCase()+N0.slice(1);Da(sQ,"on"+aQ)}Da(KC,"onAnimationEnd"),Da(JC,"onAnimationIteration"),Da(ZC,"onAnimationStart"),Da("dblclick","onDoubleClick"),Da("focusin","onFocus"),Da("focusout","onBlur"),Da($C,"onTransitionEnd"),o("onMouseEnter",["mouseout","mouseover"]),o("onMouseLeave",["mouseout","mouseover"]),o("onPointerEnter",["pointerout","pointerover"]),o("onPointerLeave",["pointerout","pointerover"]),s("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),s("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),s("onBeforeInput",["compositionend","keypress","textInput","paste"]),s("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),s("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),s("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ah="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),oQ=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ah));function rM(a,c,f){var y=a.type||"unknown-event";a.currentTarget=f,f0(y,c,void 0,a),a.currentTarget=null}function nM(a,c){c=(c&4)!==0;for(var f=0;f<a.length;f++){var y=a[f],C=y.event;y=y.listeners;e:{var B=void 0;if(c)for(var U=y.length-1;0<=U;U--){var q=y[U],J=q.instance,ce=q.currentTarget;if(q=q.listener,J!==B&&C.isPropagationStopped())break e;rM(C,q,ce),B=J}else for(U=0;U<y.length;U++){if(q=y[U],J=q.instance,ce=q.currentTarget,q=q.listener,J!==B&&C.isPropagationStopped())break e;rM(C,q,ce),B=J}}}if(Us)throw a=dc,Us=!1,dc=null,a}function Xt(a,c){var f=c[H0];f===void 0&&(f=c[H0]=new Set);var y=a+"__bubble";f.has(y)||(iM(c,a,2,!1),f.add(y))}function U0(a,c,f){var y=0;c&&(y|=4),iM(f,a,y,c)}var Gf="_reactListening"+Math.random().toString(36).slice(2);function gh(a){if(!a[Gf]){a[Gf]=!0,n.forEach(function(f){f!=="selectionchange"&&(oQ.has(f)||U0(f,!1,a),U0(f,!0,a))});var c=a.nodeType===9?a:a.ownerDocument;c===null||c[Gf]||(c[Gf]=!0,U0("selectionchange",!1,c))}}function iM(a,c,f,y){switch(SC(c)){case 1:var C=Ek;break;case 4:C=xk;break;default:C=v0}f=C.bind(null,c,f,a),C=void 0,!Rn||c!=="touchstart"&&c!=="touchmove"&&c!=="wheel"||(C=!0),y?C!==void 0?a.addEventListener(c,f,{capture:!0,passive:C}):a.addEventListener(c,f,!0):C!==void 0?a.addEventListener(c,f,{passive:C}):a.addEventListener(c,f,!1)}function P0(a,c,f,y,C){var B=y;if(!(c&1)&&!(c&2)&&y!==null)e:for(;;){if(y===null)return;var U=y.tag;if(U===3||U===4){var q=y.stateNode.containerInfo;if(q===C||q.nodeType===8&&q.parentNode===C)break;if(U===4)for(U=y.return;U!==null;){var J=U.tag;if((J===3||J===4)&&(J=U.stateNode.containerInfo,J===C||J.nodeType===8&&J.parentNode===C))return;U=U.return}for(;q!==null;){if(U=Po(q),U===null)return;if(J=U.tag,J===5||J===6){y=B=U;continue e}q=q.parentNode}}y=y.return}Vt(function(){var ce=B,we=ge(f),Ce=[];e:{var xe=eM.get(a);if(xe!==void 0){var ke=E0,ze=a;switch(a){case"keypress":if(kf(f)===0)break e;case"keydown":case"keyup":ke=kk;break;case"focusin":ze="focus",ke=I0;break;case"focusout":ze="blur",ke=I0;break;case"beforeblur":case"afterblur":ke=I0;break;case"click":if(f.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ke=bC;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ke=Ck;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ke=Fk;break;case KC:case JC:case ZC:ke=Tk;break;case $C:ke=Hk;break;case"scroll":ke=wk;break;case"wheel":ke=Vk;break;case"copy":case"cut":case"paste":ke=bk;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ke=DC}var We=(c&4)!==0,wr=!We&&a==="scroll",ie=We?xe!==null?xe+"Capture":null:xe;We=[];for(var $=ce,ae;$!==null;){ae=$;var Te=ae.stateNode;if(ae.tag===5&&Te!==null&&(ae=Te,ie!==null&&(Te=Er($,ie),Te!=null&&We.push(mh($,Te,ae)))),wr)break;$=$.return}0<We.length&&(xe=new ke(xe,ze,null,f,we),Ce.push({event:xe,listeners:We}))}}if(!(c&7)){e:{if(xe=a==="mouseover"||a==="pointerover",ke=a==="mouseout"||a==="pointerout",xe&&f!==O&&(ze=f.relatedTarget||f.fromElement)&&(Po(ze)||ze[Qs]))break e;if((ke||xe)&&(xe=we.window===we?we:(xe=we.ownerDocument)?xe.defaultView||xe.parentWindow:window,ke?(ze=f.relatedTarget||f.toElement,ke=ce,ze=ze?Po(ze):null,ze!==null&&(wr=Ps(ze),ze!==wr||ze.tag!==5&&ze.tag!==6)&&(ze=null)):(ke=null,ze=ce),ke!==ze)){if(We=bC,Te="onMouseLeave",ie="onMouseEnter",$="mouse",(a==="pointerout"||a==="pointerover")&&(We=DC,Te="onPointerLeave",ie="onPointerEnter",$="pointer"),wr=ke==null?xe:yc(ke),ae=ze==null?xe:yc(ze),xe=new We(Te,$+"leave",ke,f,we),xe.target=wr,xe.relatedTarget=ae,Te=null,Po(we)===ce&&(We=new We(ie,$+"enter",ze,f,we),We.target=ae,We.relatedTarget=wr,Te=We),wr=Te,ke&&ze)t:{for(We=ke,ie=ze,$=0,ae=We;ae;ae=vc(ae))$++;for(ae=0,Te=ie;Te;Te=vc(Te))ae++;for(;0<$-ae;)We=vc(We),$--;for(;0<ae-$;)ie=vc(ie),ae--;for(;$--;){if(We===ie||ie!==null&&We===ie.alternate)break t;We=vc(We),ie=vc(ie)}We=null}else We=null;ke!==null&&sM(Ce,xe,ke,We,!1),ze!==null&&wr!==null&&sM(Ce,wr,ze,We,!0)}}e:{if(xe=ce?yc(ce):window,ke=xe.nodeName&&xe.nodeName.toLowerCase(),ke==="select"||ke==="input"&&xe.type==="file")var qe=Jk;else if(QC(xe))if(FC)qe=tQ;else{qe=$k;var Ze=Zk}else(ke=xe.nodeName)&&ke.toLowerCase()==="input"&&(xe.type==="checkbox"||xe.type==="radio")&&(qe=eQ);if(qe&&(qe=qe(a,ce))){OC(Ce,qe,f,we);break e}Ze&&Ze(a,xe,ce),a==="focusout"&&(Ze=xe._wrapperState)&&Ze.controlled&&xe.type==="number"&&le(xe,"number",xe.value)}switch(Ze=ce?yc(ce):window,a){case"focusin":(QC(Ze)||Ze.contentEditable==="true")&&(gc=Ze,b0=ce,ph=null);break;case"focusout":ph=b0=gc=null;break;case"mousedown":R0=!0;break;case"contextmenu":case"mouseup":case"dragend":R0=!1,qC(Ce,f,we);break;case"selectionchange":if(iQ)break;case"keydown":case"keyup":qC(Ce,f,we)}var $e;if(M0)e:{switch(a){case"compositionstart":var ot="onCompositionStart";break e;case"compositionend":ot="onCompositionEnd";break e;case"compositionupdate":ot="onCompositionUpdate";break e}ot=void 0}else Ac?PC(a,f)&&(ot="onCompositionEnd"):a==="keydown"&&f.keyCode===229&&(ot="onCompositionStart");ot&&(LC&&f.locale!=="ko"&&(Ac||ot!=="onCompositionStart"?ot==="onCompositionEnd"&&Ac&&($e=TC()):(Ra=we,y0="value"in Ra?Ra.value:Ra.textContent,Ac=!0)),Ze=Vf(ce,ot),0<Ze.length&&(ot=new RC(ot,a,null,f,we),Ce.push({event:ot,listeners:Ze}),$e?ot.data=$e:($e=kC(f),$e!==null&&(ot.data=$e)))),($e=Wk?Yk(a,f):qk(a,f))&&(ce=Vf(ce,"onBeforeInput"),0<ce.length&&(we=new RC("onBeforeInput","beforeinput",null,f,we),Ce.push({event:we,listeners:ce}),we.data=$e))}nM(Ce,c)})}function mh(a,c,f){return{instance:a,listener:c,currentTarget:f}}function Vf(a,c){for(var f=c+"Capture",y=[];a!==null;){var C=a,B=C.stateNode;C.tag===5&&B!==null&&(C=B,B=Er(a,f),B!=null&&y.unshift(mh(a,B,C)),B=Er(a,c),B!=null&&y.push(mh(a,B,C))),a=a.return}return y}function vc(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5);return a||null}function sM(a,c,f,y,C){for(var B=c._reactName,U=[];f!==null&&f!==y;){var q=f,J=q.alternate,ce=q.stateNode;if(J!==null&&J===y)break;q.tag===5&&ce!==null&&(q=ce,C?(J=Er(f,B),J!=null&&U.unshift(mh(f,J,q))):C||(J=Er(f,B),J!=null&&U.push(mh(f,J,q)))),f=f.return}U.length!==0&&a.push({event:c,listeners:U})}var lQ=/\r\n?/g,cQ=/\u0000|\uFFFD/g;function aM(a){return(typeof a=="string"?a:""+a).replace(lQ,`
4572
+ `).replace(cQ,"")}function jf(a,c,f){if(c=aM(c),aM(a)!==c&&f)throw Error(t(425))}function Wf(){}var k0=null,Q0=null;function O0(a,c){return a==="textarea"||a==="noscript"||typeof c.children=="string"||typeof c.children=="number"||typeof c.dangerouslySetInnerHTML=="object"&&c.dangerouslySetInnerHTML!==null&&c.dangerouslySetInnerHTML.__html!=null}var F0=typeof setTimeout=="function"?setTimeout:void 0,uQ=typeof clearTimeout=="function"?clearTimeout:void 0,oM=typeof Promise=="function"?Promise:void 0,hQ=typeof queueMicrotask=="function"?queueMicrotask:typeof oM<"u"?function(a){return oM.resolve(null).then(a).catch(dQ)}:F0;function dQ(a){setTimeout(function(){throw a})}function z0(a,c){var f=c,y=0;do{var C=f.nextSibling;if(a.removeChild(f),C&&C.nodeType===8)if(f=C.data,f==="/$"){if(y===0){a.removeChild(C),oh(c);return}y--}else f!=="$"&&f!=="$?"&&f!=="$!"||y++;f=C}while(f);oh(c)}function La(a){for(;a!=null;a=a.nextSibling){var c=a.nodeType;if(c===1||c===3)break;if(c===8){if(c=a.data,c==="$"||c==="$!"||c==="$?")break;if(c==="/$")return null}}return a}function lM(a){a=a.previousSibling;for(var c=0;a;){if(a.nodeType===8){var f=a.data;if(f==="$"||f==="$!"||f==="$?"){if(c===0)return a;c--}else f==="/$"&&c++}a=a.previousSibling}return null}var _c=Math.random().toString(36).slice(2),as="__reactFiber$"+_c,vh="__reactProps$"+_c,Qs="__reactContainer$"+_c,H0="__reactEvents$"+_c,fQ="__reactListeners$"+_c,pQ="__reactHandles$"+_c;function Po(a){var c=a[as];if(c)return c;for(var f=a.parentNode;f;){if(c=f[Qs]||f[as]){if(f=c.alternate,c.child!==null||f!==null&&f.child!==null)for(a=lM(a);a!==null;){if(f=a[as])return f;a=lM(a)}return c}a=f,f=a.parentNode}return null}function _h(a){return a=a[as]||a[Qs],!a||a.tag!==5&&a.tag!==6&&a.tag!==13&&a.tag!==3?null:a}function yc(a){if(a.tag===5||a.tag===6)return a.stateNode;throw Error(t(33))}function Yf(a){return a[vh]||null}var G0=[],Ec=-1;function Na(a){return{current:a}}function Kt(a){0>Ec||(a.current=G0[Ec],G0[Ec]=null,Ec--)}function Wt(a,c){Ec++,G0[Ec]=a.current,a.current=c}var Ua={},nn=Na(Ua),Un=Na(!1),ko=Ua;function xc(a,c){var f=a.type.contextTypes;if(!f)return Ua;var y=a.stateNode;if(y&&y.__reactInternalMemoizedUnmaskedChildContext===c)return y.__reactInternalMemoizedMaskedChildContext;var C={},B;for(B in f)C[B]=c[B];return y&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=c,a.__reactInternalMemoizedMaskedChildContext=C),C}function Pn(a){return a=a.childContextTypes,a!=null}function qf(){Kt(Un),Kt(nn)}function cM(a,c,f){if(nn.current!==Ua)throw Error(t(168));Wt(nn,c),Wt(Un,f)}function uM(a,c,f){var y=a.stateNode;if(c=c.childContextTypes,typeof y.getChildContext!="function")return f;y=y.getChildContext();for(var C in y)if(!(C in c))throw Error(t(108,_e(a)||"Unknown",C));return Q({},f,y)}function Xf(a){return a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||Ua,ko=nn.current,Wt(nn,a),Wt(Un,Un.current),!0}function hM(a,c,f){var y=a.stateNode;if(!y)throw Error(t(169));f?(a=uM(a,c,ko),y.__reactInternalMemoizedMergedChildContext=a,Kt(Un),Kt(nn),Wt(nn,a)):Kt(Un),Wt(Un,f)}var Os=null,Kf=!1,V0=!1;function dM(a){Os===null?Os=[a]:Os.push(a)}function AQ(a){Kf=!0,dM(a)}function Pa(){if(!V0&&Os!==null){V0=!0;var a=0,c=kt;try{var f=Os;for(kt=1;a<f.length;a++){var y=f[a];do y=y(!0);while(y!==null)}Os=null,Kf=!1}catch(C){throw Os!==null&&(Os=Os.slice(a+1)),Re(ft,Pa),C}finally{kt=c,V0=!1}}return null}var wc=[],Ic=0,Jf=null,Zf=0,Ai=[],gi=0,Qo=null,Fs=1,zs="";function Oo(a,c){wc[Ic++]=Zf,wc[Ic++]=Jf,Jf=a,Zf=c}function fM(a,c,f){Ai[gi++]=Fs,Ai[gi++]=zs,Ai[gi++]=Qo,Qo=a;var y=Fs;a=zs;var C=32-vn(y)-1;y&=~(1<<C),f+=1;var B=32-vn(c)+C;if(30<B){var U=C-C%5;B=(y&(1<<U)-1).toString(32),y>>=U,C-=U,Fs=1<<32-vn(c)+C|f<<C|y,zs=B+a}else Fs=1<<B|f<<C|y,zs=a}function j0(a){a.return!==null&&(Oo(a,1),fM(a,1,0))}function W0(a){for(;a===Jf;)Jf=wc[--Ic],wc[Ic]=null,Zf=wc[--Ic],wc[Ic]=null;for(;a===Qo;)Qo=Ai[--gi],Ai[gi]=null,zs=Ai[--gi],Ai[gi]=null,Fs=Ai[--gi],Ai[gi]=null}var ei=null,ti=null,tr=!1,Qi=null;function pM(a,c){var f=yi(5,null,null,0);f.elementType="DELETED",f.stateNode=c,f.return=a,c=a.deletions,c===null?(a.deletions=[f],a.flags|=16):c.push(f)}function AM(a,c){switch(a.tag){case 5:var f=a.type;return c=c.nodeType!==1||f.toLowerCase()!==c.nodeName.toLowerCase()?null:c,c!==null?(a.stateNode=c,ei=a,ti=La(c.firstChild),!0):!1;case 6:return c=a.pendingProps===""||c.nodeType!==3?null:c,c!==null?(a.stateNode=c,ei=a,ti=null,!0):!1;case 13:return c=c.nodeType!==8?null:c,c!==null?(f=Qo!==null?{id:Fs,overflow:zs}:null,a.memoizedState={dehydrated:c,treeContext:f,retryLane:1073741824},f=yi(18,null,null,0),f.stateNode=c,f.return=a,a.child=f,ei=a,ti=null,!0):!1;default:return!1}}function Y0(a){return(a.mode&1)!==0&&(a.flags&128)===0}function q0(a){if(tr){var c=ti;if(c){var f=c;if(!AM(a,c)){if(Y0(a))throw Error(t(418));c=La(f.nextSibling);var y=ei;c&&AM(a,c)?pM(y,f):(a.flags=a.flags&-4097|2,tr=!1,ei=a)}}else{if(Y0(a))throw Error(t(418));a.flags=a.flags&-4097|2,tr=!1,ei=a}}}function gM(a){for(a=a.return;a!==null&&a.tag!==5&&a.tag!==3&&a.tag!==13;)a=a.return;ei=a}function $f(a){if(a!==ei)return!1;if(!tr)return gM(a),tr=!0,!1;var c;if((c=a.tag!==3)&&!(c=a.tag!==5)&&(c=a.type,c=c!=="head"&&c!=="body"&&!O0(a.type,a.memoizedProps)),c&&(c=ti)){if(Y0(a))throw mM(),Error(t(418));for(;c;)pM(a,c),c=La(c.nextSibling)}if(gM(a),a.tag===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(t(317));e:{for(a=a.nextSibling,c=0;a;){if(a.nodeType===8){var f=a.data;if(f==="/$"){if(c===0){ti=La(a.nextSibling);break e}c--}else f!=="$"&&f!=="$!"&&f!=="$?"||c++}a=a.nextSibling}ti=null}}else ti=ei?La(a.stateNode.nextSibling):null;return!0}function mM(){for(var a=ti;a;)a=La(a.nextSibling)}function Cc(){ti=ei=null,tr=!1}function X0(a){Qi===null?Qi=[a]:Qi.push(a)}var gQ=I.ReactCurrentBatchConfig;function Oi(a,c){if(a&&a.defaultProps){c=Q({},c),a=a.defaultProps;for(var f in a)c[f]===void 0&&(c[f]=a[f]);return c}return c}var ep=Na(null),tp=null,Mc=null,K0=null;function J0(){K0=Mc=tp=null}function Z0(a){var c=ep.current;Kt(ep),a._currentValue=c}function $0(a,c,f){for(;a!==null;){var y=a.alternate;if((a.childLanes&c)!==c?(a.childLanes|=c,y!==null&&(y.childLanes|=c)):y!==null&&(y.childLanes&c)!==c&&(y.childLanes|=c),a===f)break;a=a.return}}function Sc(a,c){tp=a,K0=Mc=null,a=a.dependencies,a!==null&&a.firstContext!==null&&(a.lanes&c&&(kn=!0),a.firstContext=null)}function mi(a){var c=a._currentValue;if(K0!==a)if(a={context:a,memoizedValue:c,next:null},Mc===null){if(tp===null)throw Error(t(308));Mc=a,tp.dependencies={lanes:0,firstContext:a}}else Mc=Mc.next=a;return c}var Fo=null;function e1(a){Fo===null?Fo=[a]:Fo.push(a)}function vM(a,c,f,y){var C=c.interleaved;return C===null?(f.next=f,e1(c)):(f.next=C.next,C.next=f),c.interleaved=f,Hs(a,y)}function Hs(a,c){a.lanes|=c;var f=a.alternate;for(f!==null&&(f.lanes|=c),f=a,a=a.return;a!==null;)a.childLanes|=c,f=a.alternate,f!==null&&(f.childLanes|=c),f=a,a=a.return;return f.tag===3?f.stateNode:null}var ka=!1;function t1(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function _M(a,c){a=a.updateQueue,c.updateQueue===a&&(c.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,effects:a.effects})}function Gs(a,c){return{eventTime:a,lane:c,tag:0,payload:null,callback:null,next:null}}function Qa(a,c,f){var y=a.updateQueue;if(y===null)return null;if(y=y.shared,St&2){var C=y.pending;return C===null?c.next=c:(c.next=C.next,C.next=c),y.pending=c,Hs(a,f)}return C=y.interleaved,C===null?(c.next=c,e1(y)):(c.next=C.next,C.next=c),y.interleaved=c,Hs(a,f)}function rp(a,c,f){if(c=c.updateQueue,c!==null&&(c=c.shared,(f&4194240)!==0)){var y=c.lanes;y&=a.pendingLanes,f|=y,c.lanes=f,A0(a,f)}}function yM(a,c){var f=a.updateQueue,y=a.alternate;if(y!==null&&(y=y.updateQueue,f===y)){var C=null,B=null;if(f=f.firstBaseUpdate,f!==null){do{var U={eventTime:f.eventTime,lane:f.lane,tag:f.tag,payload:f.payload,callback:f.callback,next:null};B===null?C=B=U:B=B.next=U,f=f.next}while(f!==null);B===null?C=B=c:B=B.next=c}else C=B=c;f={baseState:y.baseState,firstBaseUpdate:C,lastBaseUpdate:B,shared:y.shared,effects:y.effects},a.updateQueue=f;return}a=f.lastBaseUpdate,a===null?f.firstBaseUpdate=c:a.next=c,f.lastBaseUpdate=c}function np(a,c,f,y){var C=a.updateQueue;ka=!1;var B=C.firstBaseUpdate,U=C.lastBaseUpdate,q=C.shared.pending;if(q!==null){C.shared.pending=null;var J=q,ce=J.next;J.next=null,U===null?B=ce:U.next=ce,U=J;var we=a.alternate;we!==null&&(we=we.updateQueue,q=we.lastBaseUpdate,q!==U&&(q===null?we.firstBaseUpdate=ce:q.next=ce,we.lastBaseUpdate=J))}if(B!==null){var Ce=C.baseState;U=0,we=ce=J=null,q=B;do{var xe=q.lane,ke=q.eventTime;if((y&xe)===xe){we!==null&&(we=we.next={eventTime:ke,lane:0,tag:q.tag,payload:q.payload,callback:q.callback,next:null});e:{var ze=a,We=q;switch(xe=c,ke=f,We.tag){case 1:if(ze=We.payload,typeof ze=="function"){Ce=ze.call(ke,Ce,xe);break e}Ce=ze;break e;case 3:ze.flags=ze.flags&-65537|128;case 0:if(ze=We.payload,xe=typeof ze=="function"?ze.call(ke,Ce,xe):ze,xe==null)break e;Ce=Q({},Ce,xe);break e;case 2:ka=!0}}q.callback!==null&&q.lane!==0&&(a.flags|=64,xe=C.effects,xe===null?C.effects=[q]:xe.push(q))}else ke={eventTime:ke,lane:xe,tag:q.tag,payload:q.payload,callback:q.callback,next:null},we===null?(ce=we=ke,J=Ce):we=we.next=ke,U|=xe;if(q=q.next,q===null){if(q=C.shared.pending,q===null)break;xe=q,q=xe.next,xe.next=null,C.lastBaseUpdate=xe,C.shared.pending=null}}while(1);if(we===null&&(J=Ce),C.baseState=J,C.firstBaseUpdate=ce,C.lastBaseUpdate=we,c=C.shared.interleaved,c!==null){C=c;do U|=C.lane,C=C.next;while(C!==c)}else B===null&&(C.shared.lanes=0);Go|=U,a.lanes=U,a.memoizedState=Ce}}function EM(a,c,f){if(a=c.effects,c.effects=null,a!==null)for(c=0;c<a.length;c++){var y=a[c],C=y.callback;if(C!==null){if(y.callback=null,y=f,typeof C!="function")throw Error(t(191,C));C.call(y)}}}var xM=new r.Component().refs;function r1(a,c,f,y){c=a.memoizedState,f=f(y,c),f=f==null?c:Q({},c,f),a.memoizedState=f,a.lanes===0&&(a.updateQueue.baseState=f)}var ip={isMounted:function(a){return(a=a._reactInternals)?Ps(a)===a:!1},enqueueSetState:function(a,c,f){a=a._reactInternals;var y=yn(),C=Ha(a),B=Gs(y,C);B.payload=c,f!=null&&(B.callback=f),c=Qa(a,B,C),c!==null&&(Hi(c,a,C,y),rp(c,a,C))},enqueueReplaceState:function(a,c,f){a=a._reactInternals;var y=yn(),C=Ha(a),B=Gs(y,C);B.tag=1,B.payload=c,f!=null&&(B.callback=f),c=Qa(a,B,C),c!==null&&(Hi(c,a,C,y),rp(c,a,C))},enqueueForceUpdate:function(a,c){a=a._reactInternals;var f=yn(),y=Ha(a),C=Gs(f,y);C.tag=2,c!=null&&(C.callback=c),c=Qa(a,C,y),c!==null&&(Hi(c,a,y,f),rp(c,a,y))}};function wM(a,c,f,y,C,B,U){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(y,B,U):c.prototype&&c.prototype.isPureReactComponent?!fh(f,y)||!fh(C,B):!0}function IM(a,c,f){var y=!1,C=Ua,B=c.contextType;return typeof B=="object"&&B!==null?B=mi(B):(C=Pn(c)?ko:nn.current,y=c.contextTypes,B=(y=y!=null)?xc(a,C):Ua),c=new c(f,B),a.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=ip,a.stateNode=c,c._reactInternals=a,y&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=C,a.__reactInternalMemoizedMaskedChildContext=B),c}function CM(a,c,f,y){a=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(f,y),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(f,y),c.state!==a&&ip.enqueueReplaceState(c,c.state,null)}function n1(a,c,f,y){var C=a.stateNode;C.props=f,C.state=a.memoizedState,C.refs=xM,t1(a);var B=c.contextType;typeof B=="object"&&B!==null?C.context=mi(B):(B=Pn(c)?ko:nn.current,C.context=xc(a,B)),C.state=a.memoizedState,B=c.getDerivedStateFromProps,typeof B=="function"&&(r1(a,c,B,f),C.state=a.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof C.getSnapshotBeforeUpdate=="function"||typeof C.UNSAFE_componentWillMount!="function"&&typeof C.componentWillMount!="function"||(c=C.state,typeof C.componentWillMount=="function"&&C.componentWillMount(),typeof C.UNSAFE_componentWillMount=="function"&&C.UNSAFE_componentWillMount(),c!==C.state&&ip.enqueueReplaceState(C,C.state,null),np(a,f,C,y),C.state=a.memoizedState),typeof C.componentDidMount=="function"&&(a.flags|=4194308)}function yh(a,c,f){if(a=f.ref,a!==null&&typeof a!="function"&&typeof a!="object"){if(f._owner){if(f=f._owner,f){if(f.tag!==1)throw Error(t(309));var y=f.stateNode}if(!y)throw Error(t(147,a));var C=y,B=""+a;return c!==null&&c.ref!==null&&typeof c.ref=="function"&&c.ref._stringRef===B?c.ref:(c=function(U){var q=C.refs;q===xM&&(q=C.refs={}),U===null?delete q[B]:q[B]=U},c._stringRef=B,c)}if(typeof a!="string")throw Error(t(284));if(!f._owner)throw Error(t(290,a))}return a}function sp(a,c){throw a=Object.prototype.toString.call(c),Error(t(31,a==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":a))}function MM(a){var c=a._init;return c(a._payload)}function SM(a){function c(ie,$){if(a){var ae=ie.deletions;ae===null?(ie.deletions=[$],ie.flags|=16):ae.push($)}}function f(ie,$){if(!a)return null;for(;$!==null;)c(ie,$),$=$.sibling;return null}function y(ie,$){for(ie=new Map;$!==null;)$.key!==null?ie.set($.key,$):ie.set($.index,$),$=$.sibling;return ie}function C(ie,$){return ie=Va(ie,$),ie.index=0,ie.sibling=null,ie}function B(ie,$,ae){return ie.index=ae,a?(ae=ie.alternate,ae!==null?(ae=ae.index,ae<$?(ie.flags|=2,$):ae):(ie.flags|=2,$)):(ie.flags|=1048576,$)}function U(ie){return a&&ie.alternate===null&&(ie.flags|=2),ie}function q(ie,$,ae,Te){return $===null||$.tag!==6?($=F1(ae,ie.mode,Te),$.return=ie,$):($=C($,ae),$.return=ie,$)}function J(ie,$,ae,Te){var qe=ae.type;return qe===T?we(ie,$,ae.props.children,Te,ae.key):$!==null&&($.elementType===qe||typeof qe=="object"&&qe!==null&&qe.$$typeof===K&&MM(qe)===$.type)?(Te=C($,ae.props),Te.ref=yh(ie,$,ae),Te.return=ie,Te):(Te=Ip(ae.type,ae.key,ae.props,null,ie.mode,Te),Te.ref=yh(ie,$,ae),Te.return=ie,Te)}function ce(ie,$,ae,Te){return $===null||$.tag!==4||$.stateNode.containerInfo!==ae.containerInfo||$.stateNode.implementation!==ae.implementation?($=z1(ae,ie.mode,Te),$.return=ie,$):($=C($,ae.children||[]),$.return=ie,$)}function we(ie,$,ae,Te,qe){return $===null||$.tag!==7?($=Yo(ae,ie.mode,Te,qe),$.return=ie,$):($=C($,ae),$.return=ie,$)}function Ce(ie,$,ae){if(typeof $=="string"&&$!==""||typeof $=="number")return $=F1(""+$,ie.mode,ae),$.return=ie,$;if(typeof $=="object"&&$!==null){switch($.$$typeof){case R:return ae=Ip($.type,$.key,$.props,null,ie.mode,ae),ae.ref=yh(ie,null,$),ae.return=ie,ae;case S:return $=z1($,ie.mode,ae),$.return=ie,$;case K:var Te=$._init;return Ce(ie,Te($._payload),ae)}if(pe($)||ee($))return $=Yo($,ie.mode,ae,null),$.return=ie,$;sp(ie,$)}return null}function xe(ie,$,ae,Te){var qe=$!==null?$.key:null;if(typeof ae=="string"&&ae!==""||typeof ae=="number")return qe!==null?null:q(ie,$,""+ae,Te);if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case R:return ae.key===qe?J(ie,$,ae,Te):null;case S:return ae.key===qe?ce(ie,$,ae,Te):null;case K:return qe=ae._init,xe(ie,$,qe(ae._payload),Te)}if(pe(ae)||ee(ae))return qe!==null?null:we(ie,$,ae,Te,null);sp(ie,ae)}return null}function ke(ie,$,ae,Te,qe){if(typeof Te=="string"&&Te!==""||typeof Te=="number")return ie=ie.get(ae)||null,q($,ie,""+Te,qe);if(typeof Te=="object"&&Te!==null){switch(Te.$$typeof){case R:return ie=ie.get(Te.key===null?ae:Te.key)||null,J($,ie,Te,qe);case S:return ie=ie.get(Te.key===null?ae:Te.key)||null,ce($,ie,Te,qe);case K:var Ze=Te._init;return ke(ie,$,ae,Ze(Te._payload),qe)}if(pe(Te)||ee(Te))return ie=ie.get(ae)||null,we($,ie,Te,qe,null);sp($,Te)}return null}function ze(ie,$,ae,Te){for(var qe=null,Ze=null,$e=$,ot=$=0,Yr=null;$e!==null&&ot<ae.length;ot++){$e.index>ot?(Yr=$e,$e=null):Yr=$e.sibling;var bt=xe(ie,$e,ae[ot],Te);if(bt===null){$e===null&&($e=Yr);break}a&&$e&&bt.alternate===null&&c(ie,$e),$=B(bt,$,ot),Ze===null?qe=bt:Ze.sibling=bt,Ze=bt,$e=Yr}if(ot===ae.length)return f(ie,$e),tr&&Oo(ie,ot),qe;if($e===null){for(;ot<ae.length;ot++)$e=Ce(ie,ae[ot],Te),$e!==null&&($=B($e,$,ot),Ze===null?qe=$e:Ze.sibling=$e,Ze=$e);return tr&&Oo(ie,ot),qe}for($e=y(ie,$e);ot<ae.length;ot++)Yr=ke($e,ie,ot,ae[ot],Te),Yr!==null&&(a&&Yr.alternate!==null&&$e.delete(Yr.key===null?ot:Yr.key),$=B(Yr,$,ot),Ze===null?qe=Yr:Ze.sibling=Yr,Ze=Yr);return a&&$e.forEach(function(ja){return c(ie,ja)}),tr&&Oo(ie,ot),qe}function We(ie,$,ae,Te){var qe=ee(ae);if(typeof qe!="function")throw Error(t(150));if(ae=qe.call(ae),ae==null)throw Error(t(151));for(var Ze=qe=null,$e=$,ot=$=0,Yr=null,bt=ae.next();$e!==null&&!bt.done;ot++,bt=ae.next()){$e.index>ot?(Yr=$e,$e=null):Yr=$e.sibling;var ja=xe(ie,$e,bt.value,Te);if(ja===null){$e===null&&($e=Yr);break}a&&$e&&ja.alternate===null&&c(ie,$e),$=B(ja,$,ot),Ze===null?qe=ja:Ze.sibling=ja,Ze=ja,$e=Yr}if(bt.done)return f(ie,$e),tr&&Oo(ie,ot),qe;if($e===null){for(;!bt.done;ot++,bt=ae.next())bt=Ce(ie,bt.value,Te),bt!==null&&($=B(bt,$,ot),Ze===null?qe=bt:Ze.sibling=bt,Ze=bt);return tr&&Oo(ie,ot),qe}for($e=y(ie,$e);!bt.done;ot++,bt=ae.next())bt=ke($e,ie,ot,bt.value,Te),bt!==null&&(a&&bt.alternate!==null&&$e.delete(bt.key===null?ot:bt.key),$=B(bt,$,ot),Ze===null?qe=bt:Ze.sibling=bt,Ze=bt);return a&&$e.forEach(function(XQ){return c(ie,XQ)}),tr&&Oo(ie,ot),qe}function wr(ie,$,ae,Te){if(typeof ae=="object"&&ae!==null&&ae.type===T&&ae.key===null&&(ae=ae.props.children),typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case R:e:{for(var qe=ae.key,Ze=$;Ze!==null;){if(Ze.key===qe){if(qe=ae.type,qe===T){if(Ze.tag===7){f(ie,Ze.sibling),$=C(Ze,ae.props.children),$.return=ie,ie=$;break e}}else if(Ze.elementType===qe||typeof qe=="object"&&qe!==null&&qe.$$typeof===K&&MM(qe)===Ze.type){f(ie,Ze.sibling),$=C(Ze,ae.props),$.ref=yh(ie,Ze,ae),$.return=ie,ie=$;break e}f(ie,Ze);break}else c(ie,Ze);Ze=Ze.sibling}ae.type===T?($=Yo(ae.props.children,ie.mode,Te,ae.key),$.return=ie,ie=$):(Te=Ip(ae.type,ae.key,ae.props,null,ie.mode,Te),Te.ref=yh(ie,$,ae),Te.return=ie,ie=Te)}return U(ie);case S:e:{for(Ze=ae.key;$!==null;){if($.key===Ze)if($.tag===4&&$.stateNode.containerInfo===ae.containerInfo&&$.stateNode.implementation===ae.implementation){f(ie,$.sibling),$=C($,ae.children||[]),$.return=ie,ie=$;break e}else{f(ie,$);break}else c(ie,$);$=$.sibling}$=z1(ae,ie.mode,Te),$.return=ie,ie=$}return U(ie);case K:return Ze=ae._init,wr(ie,$,Ze(ae._payload),Te)}if(pe(ae))return ze(ie,$,ae,Te);if(ee(ae))return We(ie,$,ae,Te);sp(ie,ae)}return typeof ae=="string"&&ae!==""||typeof ae=="number"?(ae=""+ae,$!==null&&$.tag===6?(f(ie,$.sibling),$=C($,ae),$.return=ie,ie=$):(f(ie,$),$=F1(ae,ie.mode,Te),$.return=ie,ie=$),U(ie)):f(ie,$)}return wr}var Tc=SM(!0),TM=SM(!1),Eh={},os=Na(Eh),xh=Na(Eh),wh=Na(Eh);function zo(a){if(a===Eh)throw Error(t(174));return a}function i1(a,c){switch(Wt(wh,c),Wt(xh,a),Wt(os,Eh),a=c.nodeType,a){case 9:case 11:c=(c=c.documentElement)?c.namespaceURI:Me(null,"");break;default:a=a===8?c.parentNode:c,c=a.namespaceURI||null,a=a.tagName,c=Me(c,a)}Kt(os),Wt(os,c)}function Bc(){Kt(os),Kt(xh),Kt(wh)}function BM(a){zo(wh.current);var c=zo(os.current),f=Me(c,a.type);c!==f&&(Wt(xh,a),Wt(os,f))}function s1(a){xh.current===a&&(Kt(os),Kt(xh))}var ar=Na(0);function ap(a){for(var c=a;c!==null;){if(c.tag===13){var f=c.memoizedState;if(f!==null&&(f=f.dehydrated,f===null||f.data==="$?"||f.data==="$!"))return c}else if(c.tag===19&&c.memoizedProps.revealOrder!==void 0){if(c.flags&128)return c}else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===a)break;for(;c.sibling===null;){if(c.return===null||c.return===a)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}var a1=[];function o1(){for(var a=0;a<a1.length;a++)a1[a]._workInProgressVersionPrimary=null;a1.length=0}var op=I.ReactCurrentDispatcher,l1=I.ReactCurrentBatchConfig,Ho=0,or=null,Nr=null,jr=null,lp=!1,Ih=!1,Ch=0,mQ=0;function sn(){throw Error(t(321))}function c1(a,c){if(c===null)return!1;for(var f=0;f<c.length&&f<a.length;f++)if(!ki(a[f],c[f]))return!1;return!0}function u1(a,c,f,y,C,B){if(Ho=B,or=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,op.current=a===null||a.memoizedState===null?EQ:xQ,a=f(y,C),Ih){B=0;do{if(Ih=!1,Ch=0,25<=B)throw Error(t(301));B+=1,jr=Nr=null,c.updateQueue=null,op.current=wQ,a=f(y,C)}while(Ih)}if(op.current=hp,c=Nr!==null&&Nr.next!==null,Ho=0,jr=Nr=or=null,lp=!1,c)throw Error(t(300));return a}function h1(){var a=Ch!==0;return Ch=0,a}function ls(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return jr===null?or.memoizedState=jr=a:jr=jr.next=a,jr}function vi(){if(Nr===null){var a=or.alternate;a=a!==null?a.memoizedState:null}else a=Nr.next;var c=jr===null?or.memoizedState:jr.next;if(c!==null)jr=c,Nr=a;else{if(a===null)throw Error(t(310));Nr=a,a={memoizedState:Nr.memoizedState,baseState:Nr.baseState,baseQueue:Nr.baseQueue,queue:Nr.queue,next:null},jr===null?or.memoizedState=jr=a:jr=jr.next=a}return jr}function Mh(a,c){return typeof c=="function"?c(a):c}function d1(a){var c=vi(),f=c.queue;if(f===null)throw Error(t(311));f.lastRenderedReducer=a;var y=Nr,C=y.baseQueue,B=f.pending;if(B!==null){if(C!==null){var U=C.next;C.next=B.next,B.next=U}y.baseQueue=C=B,f.pending=null}if(C!==null){B=C.next,y=y.baseState;var q=U=null,J=null,ce=B;do{var we=ce.lane;if((Ho&we)===we)J!==null&&(J=J.next={lane:0,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null}),y=ce.hasEagerState?ce.eagerState:a(y,ce.action);else{var Ce={lane:we,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null};J===null?(q=J=Ce,U=y):J=J.next=Ce,or.lanes|=we,Go|=we}ce=ce.next}while(ce!==null&&ce!==B);J===null?U=y:J.next=q,ki(y,c.memoizedState)||(kn=!0),c.memoizedState=y,c.baseState=U,c.baseQueue=J,f.lastRenderedState=y}if(a=f.interleaved,a!==null){C=a;do B=C.lane,or.lanes|=B,Go|=B,C=C.next;while(C!==a)}else C===null&&(f.lanes=0);return[c.memoizedState,f.dispatch]}function f1(a){var c=vi(),f=c.queue;if(f===null)throw Error(t(311));f.lastRenderedReducer=a;var y=f.dispatch,C=f.pending,B=c.memoizedState;if(C!==null){f.pending=null;var U=C=C.next;do B=a(B,U.action),U=U.next;while(U!==C);ki(B,c.memoizedState)||(kn=!0),c.memoizedState=B,c.baseQueue===null&&(c.baseState=B),f.lastRenderedState=B}return[B,y]}function bM(){}function RM(a,c){var f=or,y=vi(),C=c(),B=!ki(y.memoizedState,C);if(B&&(y.memoizedState=C,kn=!0),y=y.queue,p1(NM.bind(null,f,y,a),[a]),y.getSnapshot!==c||B||jr!==null&&jr.memoizedState.tag&1){if(f.flags|=2048,Sh(9,LM.bind(null,f,y,C,c),void 0,null),Wr===null)throw Error(t(349));Ho&30||DM(f,c,C)}return C}function DM(a,c,f){a.flags|=16384,a={getSnapshot:c,value:f},c=or.updateQueue,c===null?(c={lastEffect:null,stores:null},or.updateQueue=c,c.stores=[a]):(f=c.stores,f===null?c.stores=[a]:f.push(a))}function LM(a,c,f,y){c.value=f,c.getSnapshot=y,UM(c)&&PM(a)}function NM(a,c,f){return f(function(){UM(c)&&PM(a)})}function UM(a){var c=a.getSnapshot;a=a.value;try{var f=c();return!ki(a,f)}catch{return!0}}function PM(a){var c=Hs(a,1);c!==null&&Hi(c,a,1,-1)}function kM(a){var c=ls();return typeof a=="function"&&(a=a()),c.memoizedState=c.baseState=a,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Mh,lastRenderedState:a},c.queue=a,a=a.dispatch=yQ.bind(null,or,a),[c.memoizedState,a]}function Sh(a,c,f,y){return a={tag:a,create:c,destroy:f,deps:y,next:null},c=or.updateQueue,c===null?(c={lastEffect:null,stores:null},or.updateQueue=c,c.lastEffect=a.next=a):(f=c.lastEffect,f===null?c.lastEffect=a.next=a:(y=f.next,f.next=a,a.next=y,c.lastEffect=a)),a}function QM(){return vi().memoizedState}function cp(a,c,f,y){var C=ls();or.flags|=a,C.memoizedState=Sh(1|c,f,void 0,y===void 0?null:y)}function up(a,c,f,y){var C=vi();y=y===void 0?null:y;var B=void 0;if(Nr!==null){var U=Nr.memoizedState;if(B=U.destroy,y!==null&&c1(y,U.deps)){C.memoizedState=Sh(c,f,B,y);return}}or.flags|=a,C.memoizedState=Sh(1|c,f,B,y)}function OM(a,c){return cp(8390656,8,a,c)}function p1(a,c){return up(2048,8,a,c)}function FM(a,c){return up(4,2,a,c)}function zM(a,c){return up(4,4,a,c)}function HM(a,c){if(typeof c=="function")return a=a(),c(a),function(){c(null)};if(c!=null)return a=a(),c.current=a,function(){c.current=null}}function GM(a,c,f){return f=f!=null?f.concat([a]):null,up(4,4,HM.bind(null,c,a),f)}function A1(){}function VM(a,c){var f=vi();c=c===void 0?null:c;var y=f.memoizedState;return y!==null&&c!==null&&c1(c,y[1])?y[0]:(f.memoizedState=[a,c],a)}function jM(a,c){var f=vi();c=c===void 0?null:c;var y=f.memoizedState;return y!==null&&c!==null&&c1(c,y[1])?y[0]:(a=a(),f.memoizedState=[a,c],a)}function WM(a,c,f){return Ho&21?(ki(f,c)||(f=th(),or.lanes|=f,Go|=f,a.baseState=!0),c):(a.baseState&&(a.baseState=!1,kn=!0),a.memoizedState=f)}function vQ(a,c){var f=kt;kt=f!==0&&4>f?f:4,a(!0);var y=l1.transition;l1.transition={};try{a(!1),c()}finally{kt=f,l1.transition=y}}function YM(){return vi().memoizedState}function _Q(a,c,f){var y=Ha(a);if(f={lane:y,action:f,hasEagerState:!1,eagerState:null,next:null},qM(a))XM(c,f);else if(f=vM(a,c,f,y),f!==null){var C=yn();Hi(f,a,y,C),KM(f,c,y)}}function yQ(a,c,f){var y=Ha(a),C={lane:y,action:f,hasEagerState:!1,eagerState:null,next:null};if(qM(a))XM(c,C);else{var B=a.alternate;if(a.lanes===0&&(B===null||B.lanes===0)&&(B=c.lastRenderedReducer,B!==null))try{var U=c.lastRenderedState,q=B(U,f);if(C.hasEagerState=!0,C.eagerState=q,ki(q,U)){var J=c.interleaved;J===null?(C.next=C,e1(c)):(C.next=J.next,J.next=C),c.interleaved=C;return}}catch{}finally{}f=vM(a,c,C,y),f!==null&&(C=yn(),Hi(f,a,y,C),KM(f,c,y))}}function qM(a){var c=a.alternate;return a===or||c!==null&&c===or}function XM(a,c){Ih=lp=!0;var f=a.pending;f===null?c.next=c:(c.next=f.next,f.next=c),a.pending=c}function KM(a,c,f){if(f&4194240){var y=c.lanes;y&=a.pendingLanes,f|=y,c.lanes=f,A0(a,f)}}var hp={readContext:mi,useCallback:sn,useContext:sn,useEffect:sn,useImperativeHandle:sn,useInsertionEffect:sn,useLayoutEffect:sn,useMemo:sn,useReducer:sn,useRef:sn,useState:sn,useDebugValue:sn,useDeferredValue:sn,useTransition:sn,useMutableSource:sn,useSyncExternalStore:sn,useId:sn,unstable_isNewReconciler:!1},EQ={readContext:mi,useCallback:function(a,c){return ls().memoizedState=[a,c===void 0?null:c],a},useContext:mi,useEffect:OM,useImperativeHandle:function(a,c,f){return f=f!=null?f.concat([a]):null,cp(4194308,4,HM.bind(null,c,a),f)},useLayoutEffect:function(a,c){return cp(4194308,4,a,c)},useInsertionEffect:function(a,c){return cp(4,2,a,c)},useMemo:function(a,c){var f=ls();return c=c===void 0?null:c,a=a(),f.memoizedState=[a,c],a},useReducer:function(a,c,f){var y=ls();return c=f!==void 0?f(c):c,y.memoizedState=y.baseState=c,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:c},y.queue=a,a=a.dispatch=_Q.bind(null,or,a),[y.memoizedState,a]},useRef:function(a){var c=ls();return a={current:a},c.memoizedState=a},useState:kM,useDebugValue:A1,useDeferredValue:function(a){return ls().memoizedState=a},useTransition:function(){var a=kM(!1),c=a[0];return a=vQ.bind(null,a[1]),ls().memoizedState=a,[c,a]},useMutableSource:function(){},useSyncExternalStore:function(a,c,f){var y=or,C=ls();if(tr){if(f===void 0)throw Error(t(407));f=f()}else{if(f=c(),Wr===null)throw Error(t(349));Ho&30||DM(y,c,f)}C.memoizedState=f;var B={value:f,getSnapshot:c};return C.queue=B,OM(NM.bind(null,y,B,a),[a]),y.flags|=2048,Sh(9,LM.bind(null,y,B,f,c),void 0,null),f},useId:function(){var a=ls(),c=Wr.identifierPrefix;if(tr){var f=zs,y=Fs;f=(y&~(1<<32-vn(y)-1)).toString(32)+f,c=":"+c+"R"+f,f=Ch++,0<f&&(c+="H"+f.toString(32)),c+=":"}else f=mQ++,c=":"+c+"r"+f.toString(32)+":";return a.memoizedState=c},unstable_isNewReconciler:!1},xQ={readContext:mi,useCallback:VM,useContext:mi,useEffect:p1,useImperativeHandle:GM,useInsertionEffect:FM,useLayoutEffect:zM,useMemo:jM,useReducer:d1,useRef:QM,useState:function(){return d1(Mh)},useDebugValue:A1,useDeferredValue:function(a){var c=vi();return WM(c,Nr.memoizedState,a)},useTransition:function(){var a=d1(Mh)[0],c=vi().memoizedState;return[a,c]},useMutableSource:bM,useSyncExternalStore:RM,useId:YM,unstable_isNewReconciler:!1},wQ={readContext:mi,useCallback:VM,useContext:mi,useEffect:p1,useImperativeHandle:GM,useInsertionEffect:FM,useLayoutEffect:zM,useMemo:jM,useReducer:f1,useRef:QM,useState:function(){return f1(Mh)},useDebugValue:A1,useDeferredValue:function(a){var c=vi();return Nr===null?c.memoizedState=a:WM(c,Nr.memoizedState,a)},useTransition:function(){var a=f1(Mh)[0],c=vi().memoizedState;return[a,c]},useMutableSource:bM,useSyncExternalStore:RM,useId:YM,unstable_isNewReconciler:!1};function bc(a,c){try{var f="",y=c;do f+=de(y),y=y.return;while(y);var C=f}catch(B){C=`
4573
4573
  Error generating stack: `+B.message+`
4574
- `+B.stack}return{value:a,source:c,stack:C,digest:null}}function g1(a,c,f){return{value:a,source:null,stack:f??null,digest:c??null}}function m1(a,c){try{console.error(c.value)}catch(f){setTimeout(function(){throw f})}}var IQ=typeof WeakMap=="function"?WeakMap:Map;function JM(a,c,f){f=Gs(-1,f),f.tag=3,f.payload={element:null};var y=c.value;return f.callback=function(){_p||(_p=!0,D1=y),m1(a,c)},f}function ZM(a,c,f){f=Gs(-1,f),f.tag=3;var y=a.type.getDerivedStateFromError;if(typeof y=="function"){var C=c.value;f.payload=function(){return y(C)},f.callback=function(){m1(a,c)}}var B=a.stateNode;return B!==null&&typeof B.componentDidCatch=="function"&&(f.callback=function(){m1(a,c),typeof y!="function"&&(Fa===null?Fa=new Set([this]):Fa.add(this));var U=c.stack;this.componentDidCatch(c.value,{componentStack:U!==null?U:""})}),f}function $M(a,c,f){var y=a.pingCache;if(y===null){y=a.pingCache=new IQ;var C=new Set;y.set(c,C)}else C=y.get(c),C===void 0&&(C=new Set,y.set(c,C));C.has(f)||(C.add(f),a=QQ.bind(null,a,c,f),c.then(a,a))}function e3(a){do{var c;if((c=a.tag===13)&&(c=a.memoizedState,c=c!==null?c.dehydrated!==null:!0),c)return a;a=a.return}while(a!==null);return null}function t3(a,c,f,y,C){return a.mode&1?(a.flags|=65536,a.lanes=C,a):(a===c?a.flags|=65536:(a.flags|=128,f.flags|=131072,f.flags&=-52805,f.tag===1&&(f.alternate===null?f.tag=17:(c=Gs(-1,1),c.tag=2,Qa(f,c,1))),f.lanes|=1),a)}var CQ=I.ReactCurrentOwner,kn=!1;function _n(a,c,f,y){c.child=a===null?TM(c,null,f,y):Tc(c,a.child,f,y)}function r3(a,c,f,y,C){f=f.render;var B=c.ref;return Sc(c,C),y=u1(a,c,f,y,B,C),f=h1(),a!==null&&!kn?(c.updateQueue=a.updateQueue,c.flags&=-2053,a.lanes&=~C,Vs(a,c,C)):(tr&&f&&j0(c),c.flags|=1,_n(a,c,y,C),c.child)}function n3(a,c,f,y,C){if(a===null){var B=f.type;return typeof B=="function"&&!O1(B)&&B.defaultProps===void 0&&f.compare===null&&f.defaultProps===void 0?(c.tag=15,c.type=B,i3(a,c,B,y,C)):(a=Cp(f.type,null,y,c,c.mode,C),a.ref=c.ref,a.return=c,c.child=a)}if(B=a.child,!(a.lanes&C)){var U=B.memoizedProps;if(f=f.compare,f=f!==null?f:fh,f(U,y)&&a.ref===c.ref)return Vs(a,c,C)}return c.flags|=1,a=Va(B,y),a.ref=c.ref,a.return=c,c.child=a}function i3(a,c,f,y,C){if(a!==null){var B=a.memoizedProps;if(fh(B,y)&&a.ref===c.ref)if(kn=!1,c.pendingProps=y=B,(a.lanes&C)!==0)a.flags&131072&&(kn=!0);else return c.lanes=a.lanes,Vs(a,c,C)}return v1(a,c,f,y,C)}function s3(a,c,f){var y=c.pendingProps,C=y.children,B=a!==null?a.memoizedState:null;if(y.mode==="hidden")if(!(c.mode&1))c.memoizedState={baseLanes:0,cachePool:null,transitions:null},Wt(Dc,ri),ri|=f;else{if(!(f&1073741824))return a=B!==null?B.baseLanes|f:f,c.lanes=c.childLanes=1073741824,c.memoizedState={baseLanes:a,cachePool:null,transitions:null},c.updateQueue=null,Wt(Dc,ri),ri|=a,null;c.memoizedState={baseLanes:0,cachePool:null,transitions:null},y=B!==null?B.baseLanes:f,Wt(Dc,ri),ri|=y}else B!==null?(y=B.baseLanes|f,c.memoizedState=null):y=f,Wt(Dc,ri),ri|=y;return _n(a,c,C,f),c.child}function a3(a,c){var f=c.ref;(a===null&&f!==null||a!==null&&a.ref!==f)&&(c.flags|=512,c.flags|=2097152)}function v1(a,c,f,y,C){var B=Pn(f)?ko:nn.current;return B=xc(c,B),Sc(c,C),f=u1(a,c,f,y,B,C),y=h1(),a!==null&&!kn?(c.updateQueue=a.updateQueue,c.flags&=-2053,a.lanes&=~C,Vs(a,c,C)):(tr&&y&&j0(c),c.flags|=1,_n(a,c,f,C),c.child)}function o3(a,c,f,y,C){if(Pn(f)){var B=!0;Kf(c)}else B=!1;if(Sc(c,C),c.stateNode===null)pp(a,c),IM(c,f,y),n1(c,f,y,C),y=!0;else if(a===null){var U=c.stateNode,q=c.memoizedProps;U.props=q;var J=U.context,ce=f.contextType;typeof ce=="object"&&ce!==null?ce=mi(ce):(ce=Pn(f)?ko:nn.current,ce=xc(c,ce));var we=f.getDerivedStateFromProps,Ce=typeof we=="function"||typeof U.getSnapshotBeforeUpdate=="function";Ce||typeof U.UNSAFE_componentWillReceiveProps!="function"&&typeof U.componentWillReceiveProps!="function"||(q!==y||J!==ce)&&CM(c,U,y,ce),ka=!1;var xe=c.memoizedState;U.state=xe,ip(c,y,U,C),J=c.memoizedState,q!==y||xe!==J||Un.current||ka?(typeof we=="function"&&(r1(c,f,we,y),J=c.memoizedState),(q=ka||wM(c,f,q,y,xe,J,ce))?(Ce||typeof U.UNSAFE_componentWillMount!="function"&&typeof U.componentWillMount!="function"||(typeof U.componentWillMount=="function"&&U.componentWillMount(),typeof U.UNSAFE_componentWillMount=="function"&&U.UNSAFE_componentWillMount()),typeof U.componentDidMount=="function"&&(c.flags|=4194308)):(typeof U.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=y,c.memoizedState=J),U.props=y,U.state=J,U.context=ce,y=q):(typeof U.componentDidMount=="function"&&(c.flags|=4194308),y=!1)}else{U=c.stateNode,_M(a,c),q=c.memoizedProps,ce=c.type===c.elementType?q:Oi(c.type,q),U.props=ce,Ce=c.pendingProps,xe=U.context,J=f.contextType,typeof J=="object"&&J!==null?J=mi(J):(J=Pn(f)?ko:nn.current,J=xc(c,J));var ke=f.getDerivedStateFromProps;(we=typeof ke=="function"||typeof U.getSnapshotBeforeUpdate=="function")||typeof U.UNSAFE_componentWillReceiveProps!="function"&&typeof U.componentWillReceiveProps!="function"||(q!==Ce||xe!==J)&&CM(c,U,y,J),ka=!1,xe=c.memoizedState,U.state=xe,ip(c,y,U,C);var ze=c.memoizedState;q!==Ce||xe!==ze||Un.current||ka?(typeof ke=="function"&&(r1(c,f,ke,y),ze=c.memoizedState),(ce=ka||wM(c,f,ce,y,xe,ze,J)||!1)?(we||typeof U.UNSAFE_componentWillUpdate!="function"&&typeof U.componentWillUpdate!="function"||(typeof U.componentWillUpdate=="function"&&U.componentWillUpdate(y,ze,J),typeof U.UNSAFE_componentWillUpdate=="function"&&U.UNSAFE_componentWillUpdate(y,ze,J)),typeof U.componentDidUpdate=="function"&&(c.flags|=4),typeof U.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof U.componentDidUpdate!="function"||q===a.memoizedProps&&xe===a.memoizedState||(c.flags|=4),typeof U.getSnapshotBeforeUpdate!="function"||q===a.memoizedProps&&xe===a.memoizedState||(c.flags|=1024),c.memoizedProps=y,c.memoizedState=ze),U.props=y,U.state=ze,U.context=J,y=ce):(typeof U.componentDidUpdate!="function"||q===a.memoizedProps&&xe===a.memoizedState||(c.flags|=4),typeof U.getSnapshotBeforeUpdate!="function"||q===a.memoizedProps&&xe===a.memoizedState||(c.flags|=1024),y=!1)}return _1(a,c,f,y,B,C)}function _1(a,c,f,y,C,B){a3(a,c);var U=(c.flags&128)!==0;if(!y&&!U)return C&&hM(c,f,!1),Vs(a,c,B);y=c.stateNode,CQ.current=c;var q=U&&typeof f.getDerivedStateFromError!="function"?null:y.render();return c.flags|=1,a!==null&&U?(c.child=Tc(c,a.child,null,B),c.child=Tc(c,null,q,B)):_n(a,c,q,B),c.memoizedState=y.state,C&&hM(c,f,!0),c.child}function l3(a){var c=a.stateNode;c.pendingContext?cM(a,c.pendingContext,c.pendingContext!==c.context):c.context&&cM(a,c.context,!1),i1(a,c.containerInfo)}function c3(a,c,f,y,C){return Cc(),X0(C),c.flags|=256,_n(a,c,f,y),c.child}var y1={dehydrated:null,treeContext:null,retryLane:0};function E1(a){return{baseLanes:a,cachePool:null,transitions:null}}function u3(a,c,f){var y=c.pendingProps,C=ar.current,B=!1,U=(c.flags&128)!==0,q;if((q=U)||(q=a!==null&&a.memoizedState===null?!1:(C&2)!==0),q?(B=!0,c.flags&=-129):(a===null||a.memoizedState!==null)&&(C|=1),Wt(ar,C&1),a===null)return q0(c),a=c.memoizedState,a!==null&&(a=a.dehydrated,a!==null)?(c.mode&1?a.data==="$!"?c.lanes=8:c.lanes=1073741824:c.lanes=1,null):(U=y.children,a=y.fallback,B?(y=c.mode,B=c.child,U={mode:"hidden",children:U},!(y&1)&&B!==null?(B.childLanes=0,B.pendingProps=U):B=Mp(U,y,0,null),a=Yo(a,y,f,null),B.return=c,a.return=c,B.sibling=a,c.child=B,c.child.memoizedState=E1(f),c.memoizedState=y1,a):x1(c,U));if(C=a.memoizedState,C!==null&&(q=C.dehydrated,q!==null))return MQ(a,c,U,y,q,C,f);if(B){B=y.fallback,U=c.mode,C=a.child,q=C.sibling;var J={mode:"hidden",children:y.children};return!(U&1)&&c.child!==C?(y=c.child,y.childLanes=0,y.pendingProps=J,c.deletions=null):(y=Va(C,J),y.subtreeFlags=C.subtreeFlags&14680064),q!==null?B=Va(q,B):(B=Yo(B,U,f,null),B.flags|=2),B.return=c,y.return=c,y.sibling=B,c.child=y,y=B,B=c.child,U=a.child.memoizedState,U=U===null?E1(f):{baseLanes:U.baseLanes|f,cachePool:null,transitions:U.transitions},B.memoizedState=U,B.childLanes=a.childLanes&~f,c.memoizedState=y1,y}return B=a.child,a=B.sibling,y=Va(B,{mode:"visible",children:y.children}),!(c.mode&1)&&(y.lanes=f),y.return=c,y.sibling=null,a!==null&&(f=c.deletions,f===null?(c.deletions=[a],c.flags|=16):f.push(a)),c.child=y,c.memoizedState=null,y}function x1(a,c){return c=Mp({mode:"visible",children:c},a.mode,0,null),c.return=a,a.child=c}function fp(a,c,f,y){return y!==null&&X0(y),Tc(c,a.child,null,f),a=x1(c,c.pendingProps.children),a.flags|=2,c.memoizedState=null,a}function MQ(a,c,f,y,C,B,U){if(f)return c.flags&256?(c.flags&=-257,y=g1(Error(t(422))),fp(a,c,U,y)):c.memoizedState!==null?(c.child=a.child,c.flags|=128,null):(B=y.fallback,C=c.mode,y=Mp({mode:"visible",children:y.children},C,0,null),B=Yo(B,C,U,null),B.flags|=2,y.return=c,B.return=c,y.sibling=B,c.child=y,c.mode&1&&Tc(c,a.child,null,U),c.child.memoizedState=E1(U),c.memoizedState=y1,B);if(!(c.mode&1))return fp(a,c,U,null);if(C.data==="$!"){if(y=C.nextSibling&&C.nextSibling.dataset,y)var q=y.dgst;return y=q,B=Error(t(419)),y=g1(B,y,void 0),fp(a,c,U,y)}if(q=(U&a.childLanes)!==0,kn||q){if(y=Wr,y!==null){switch(U&-U){case 4:C=2;break;case 16:C=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:C=32;break;case 536870912:C=268435456;break;default:C=0}C=C&(y.suspendedLanes|U)?0:C,C!==0&&C!==B.retryLane&&(B.retryLane=C,Hs(a,C),Hi(y,a,C,-1))}return Q1(),y=g1(Error(t(421))),fp(a,c,U,y)}return C.data==="$?"?(c.flags|=128,c.child=a.child,c=OQ.bind(null,a),C._reactRetry=c,null):(a=B.treeContext,ti=La(C.nextSibling),ei=c,tr=!0,Qi=null,a!==null&&(Ai[gi++]=Fs,Ai[gi++]=zs,Ai[gi++]=Qo,Fs=a.id,zs=a.overflow,Qo=c),c=x1(c,y.children),c.flags|=4096,c)}function h3(a,c,f){a.lanes|=c;var y=a.alternate;y!==null&&(y.lanes|=c),$0(a.return,c,f)}function w1(a,c,f,y,C){var B=a.memoizedState;B===null?a.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:y,tail:f,tailMode:C}:(B.isBackwards=c,B.rendering=null,B.renderingStartTime=0,B.last=y,B.tail=f,B.tailMode=C)}function d3(a,c,f){var y=c.pendingProps,C=y.revealOrder,B=y.tail;if(_n(a,c,y.children,f),y=ar.current,y&2)y=y&1|2,c.flags|=128;else{if(a!==null&&a.flags&128)e:for(a=c.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&h3(a,f,c);else if(a.tag===19)h3(a,f,c);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===c)break e;for(;a.sibling===null;){if(a.return===null||a.return===c)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}y&=1}if(Wt(ar,y),!(c.mode&1))c.memoizedState=null;else switch(C){case"forwards":for(f=c.child,C=null;f!==null;)a=f.alternate,a!==null&&op(a)===null&&(C=f),f=f.sibling;f=C,f===null?(C=c.child,c.child=null):(C=f.sibling,f.sibling=null),w1(c,!1,C,f,B);break;case"backwards":for(f=null,C=c.child,c.child=null;C!==null;){if(a=C.alternate,a!==null&&op(a)===null){c.child=C;break}a=C.sibling,C.sibling=f,f=C,C=a}w1(c,!0,f,null,B);break;case"together":w1(c,!1,null,null,void 0);break;default:c.memoizedState=null}return c.child}function pp(a,c){!(c.mode&1)&&a!==null&&(a.alternate=null,c.alternate=null,c.flags|=2)}function Vs(a,c,f){if(a!==null&&(c.dependencies=a.dependencies),Go|=c.lanes,!(f&c.childLanes))return null;if(a!==null&&c.child!==a.child)throw Error(t(153));if(c.child!==null){for(a=c.child,f=Va(a,a.pendingProps),c.child=f,f.return=c;a.sibling!==null;)a=a.sibling,f=f.sibling=Va(a,a.pendingProps),f.return=c;f.sibling=null}return c.child}function SQ(a,c,f){switch(c.tag){case 3:l3(c),Cc();break;case 5:BM(c);break;case 1:Pn(c.type)&&Kf(c);break;case 4:i1(c,c.stateNode.containerInfo);break;case 10:var y=c.type._context,C=c.memoizedProps.value;Wt(tp,y._currentValue),y._currentValue=C;break;case 13:if(y=c.memoizedState,y!==null)return y.dehydrated!==null?(Wt(ar,ar.current&1),c.flags|=128,null):f&c.child.childLanes?u3(a,c,f):(Wt(ar,ar.current&1),a=Vs(a,c,f),a!==null?a.sibling:null);Wt(ar,ar.current&1);break;case 19:if(y=(f&c.childLanes)!==0,a.flags&128){if(y)return d3(a,c,f);c.flags|=128}if(C=c.memoizedState,C!==null&&(C.rendering=null,C.tail=null,C.lastEffect=null),Wt(ar,ar.current),y)break;return null;case 22:case 23:return c.lanes=0,s3(a,c,f)}return Vs(a,c,f)}var f3,I1,p3,A3;f3=function(a,c){for(var f=c.child;f!==null;){if(f.tag===5||f.tag===6)a.appendChild(f.stateNode);else if(f.tag!==4&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===c)break;for(;f.sibling===null;){if(f.return===null||f.return===c)return;f=f.return}f.sibling.return=f.return,f=f.sibling}},I1=function(){},p3=function(a,c,f,y){var C=a.memoizedProps;if(C!==y){a=c.stateNode,zo(os.current);var B=null;switch(f){case"input":C=ct(a,C),y=ct(a,y),B=[];break;case"select":C=Q({},C,{value:void 0}),y=Q({},y,{value:void 0}),B=[];break;case"textarea":C=ye(a,C),y=ye(a,y),B=[];break;default:typeof C.onClick!="function"&&typeof y.onClick=="function"&&(a.onclick=Yf)}ht(f,y);var U;f=null;for(ce in C)if(!y.hasOwnProperty(ce)&&C.hasOwnProperty(ce)&&C[ce]!=null)if(ce==="style"){var q=C[ce];for(U in q)q.hasOwnProperty(U)&&(f||(f={}),f[U]="")}else ce!=="dangerouslySetInnerHTML"&&ce!=="children"&&ce!=="suppressContentEditableWarning"&&ce!=="suppressHydrationWarning"&&ce!=="autoFocus"&&(i.hasOwnProperty(ce)?B||(B=[]):(B=B||[]).push(ce,null));for(ce in y){var J=y[ce];if(q=C!=null?C[ce]:void 0,y.hasOwnProperty(ce)&&J!==q&&(J!=null||q!=null))if(ce==="style")if(q){for(U in q)!q.hasOwnProperty(U)||J&&J.hasOwnProperty(U)||(f||(f={}),f[U]="");for(U in J)J.hasOwnProperty(U)&&q[U]!==J[U]&&(f||(f={}),f[U]=J[U])}else f||(B||(B=[]),B.push(ce,f)),f=J;else ce==="dangerouslySetInnerHTML"?(J=J?J.__html:void 0,q=q?q.__html:void 0,J!=null&&q!==J&&(B=B||[]).push(ce,J)):ce==="children"?typeof J!="string"&&typeof J!="number"||(B=B||[]).push(ce,""+J):ce!=="suppressContentEditableWarning"&&ce!=="suppressHydrationWarning"&&(i.hasOwnProperty(ce)?(J!=null&&ce==="onScroll"&&Xt("scroll",a),B||q===J||(B=[])):(B=B||[]).push(ce,J))}f&&(B=B||[]).push("style",f);var ce=B;(c.updateQueue=ce)&&(c.flags|=4)}},A3=function(a,c,f,y){f!==y&&(c.flags|=4)};function Th(a,c){if(!tr)switch(a.tailMode){case"hidden":c=a.tail;for(var f=null;c!==null;)c.alternate!==null&&(f=c),c=c.sibling;f===null?a.tail=null:f.sibling=null;break;case"collapsed":f=a.tail;for(var y=null;f!==null;)f.alternate!==null&&(y=f),f=f.sibling;y===null?c||a.tail===null?a.tail=null:a.tail.sibling=null:y.sibling=null}}function an(a){var c=a.alternate!==null&&a.alternate.child===a.child,f=0,y=0;if(c)for(var C=a.child;C!==null;)f|=C.lanes|C.childLanes,y|=C.subtreeFlags&14680064,y|=C.flags&14680064,C.return=a,C=C.sibling;else for(C=a.child;C!==null;)f|=C.lanes|C.childLanes,y|=C.subtreeFlags,y|=C.flags,C.return=a,C=C.sibling;return a.subtreeFlags|=y,a.childLanes=f,c}function TQ(a,c,f){var y=c.pendingProps;switch(W0(c),c.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return an(c),null;case 1:return Pn(c.type)&&Xf(),an(c),null;case 3:return y=c.stateNode,Bc(),Kt(Un),Kt(nn),o1(),y.pendingContext&&(y.context=y.pendingContext,y.pendingContext=null),(a===null||a.child===null)&&(ep(c)?c.flags|=4:a===null||a.memoizedState.isDehydrated&&!(c.flags&256)||(c.flags|=1024,Qi!==null&&(U1(Qi),Qi=null))),I1(a,c),an(c),null;case 5:s1(c);var C=zo(wh.current);if(f=c.type,a!==null&&c.stateNode!=null)p3(a,c,f,y,C),a.ref!==c.ref&&(c.flags|=512,c.flags|=2097152);else{if(!y){if(c.stateNode===null)throw Error(t(166));return an(c),null}if(a=zo(os.current),ep(c)){y=c.stateNode,f=c.type;var B=c.memoizedProps;switch(y[as]=c,y[vh]=B,a=(c.mode&1)!==0,f){case"dialog":Xt("cancel",y),Xt("close",y);break;case"iframe":case"object":case"embed":Xt("load",y);break;case"video":case"audio":for(C=0;C<Ah.length;C++)Xt(Ah[C],y);break;case"source":Xt("error",y);break;case"img":case"image":case"link":Xt("error",y),Xt("load",y);break;case"details":Xt("toggle",y);break;case"input":Ke(y,B),Xt("invalid",y);break;case"select":y._wrapperState={wasMultiple:!!B.multiple},Xt("invalid",y);break;case"textarea":He(y,B),Xt("invalid",y)}ht(f,B),C=null;for(var U in B)if(B.hasOwnProperty(U)){var q=B[U];U==="children"?typeof q=="string"?y.textContent!==q&&(B.suppressHydrationWarning!==!0&&Wf(y.textContent,q,a),C=["children",q]):typeof q=="number"&&y.textContent!==""+q&&(B.suppressHydrationWarning!==!0&&Wf(y.textContent,q,a),C=["children",""+q]):i.hasOwnProperty(U)&&q!=null&&U==="onScroll"&&Xt("scroll",y)}switch(f){case"input":se(y),k(y,B,!0);break;case"textarea":se(y),je(y);break;case"select":case"option":break;default:typeof B.onClick=="function"&&(y.onclick=Yf)}y=C,c.updateQueue=y,y!==null&&(c.flags|=4)}else{U=C.nodeType===9?C:C.ownerDocument,a==="http://www.w3.org/1999/xhtml"&&(a=Ge(f)),a==="http://www.w3.org/1999/xhtml"?f==="script"?(a=U.createElement("div"),a.innerHTML="<script><\/script>",a=a.removeChild(a.firstChild)):typeof y.is=="string"?a=U.createElement(f,{is:y.is}):(a=U.createElement(f),f==="select"&&(U=a,y.multiple?U.multiple=!0:y.size&&(U.size=y.size))):a=U.createElementNS(a,f),a[as]=c,a[vh]=y,f3(a,c,!1,!1),c.stateNode=a;e:{switch(U=H(f,y),f){case"dialog":Xt("cancel",a),Xt("close",a),C=y;break;case"iframe":case"object":case"embed":Xt("load",a),C=y;break;case"video":case"audio":for(C=0;C<Ah.length;C++)Xt(Ah[C],a);C=y;break;case"source":Xt("error",a),C=y;break;case"img":case"image":case"link":Xt("error",a),Xt("load",a),C=y;break;case"details":Xt("toggle",a),C=y;break;case"input":Ke(a,y),C=ct(a,y),Xt("invalid",a);break;case"option":C=y;break;case"select":a._wrapperState={wasMultiple:!!y.multiple},C=Q({},y,{value:void 0}),Xt("invalid",a);break;case"textarea":He(a,y),C=ye(a,y),Xt("invalid",a);break;default:C=y}ht(f,C),q=C;for(B in q)if(q.hasOwnProperty(B)){var J=q[B];B==="style"?dt(a,J):B==="dangerouslySetInnerHTML"?(J=J?J.__html:void 0,J!=null&&De(a,J)):B==="children"?typeof J=="string"?(f!=="textarea"||J!=="")&&Be(a,J):typeof J=="number"&&Be(a,""+J):B!=="suppressContentEditableWarning"&&B!=="suppressHydrationWarning"&&B!=="autoFocus"&&(i.hasOwnProperty(B)?J!=null&&B==="onScroll"&&Xt("scroll",a):J!=null&&x(a,B,J,U))}switch(f){case"input":se(a),k(a,y,!1);break;case"textarea":se(a),je(a);break;case"option":y.value!=null&&a.setAttribute("value",""+Ee(y.value));break;case"select":a.multiple=!!y.multiple,B=y.value,B!=null?me(a,!!y.multiple,B,!1):y.defaultValue!=null&&me(a,!!y.multiple,y.defaultValue,!0);break;default:typeof C.onClick=="function"&&(a.onclick=Yf)}switch(f){case"button":case"input":case"select":case"textarea":y=!!y.autoFocus;break e;case"img":y=!0;break e;default:y=!1}}y&&(c.flags|=4)}c.ref!==null&&(c.flags|=512,c.flags|=2097152)}return an(c),null;case 6:if(a&&c.stateNode!=null)A3(a,c,a.memoizedProps,y);else{if(typeof y!="string"&&c.stateNode===null)throw Error(t(166));if(f=zo(wh.current),zo(os.current),ep(c)){if(y=c.stateNode,f=c.memoizedProps,y[as]=c,(B=y.nodeValue!==f)&&(a=ei,a!==null))switch(a.tag){case 3:Wf(y.nodeValue,f,(a.mode&1)!==0);break;case 5:a.memoizedProps.suppressHydrationWarning!==!0&&Wf(y.nodeValue,f,(a.mode&1)!==0)}B&&(c.flags|=4)}else y=(f.nodeType===9?f:f.ownerDocument).createTextNode(y),y[as]=c,c.stateNode=y}return an(c),null;case 13:if(Kt(ar),y=c.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(tr&&ti!==null&&c.mode&1&&!(c.flags&128))mM(),Cc(),c.flags|=98560,B=!1;else if(B=ep(c),y!==null&&y.dehydrated!==null){if(a===null){if(!B)throw Error(t(318));if(B=c.memoizedState,B=B!==null?B.dehydrated:null,!B)throw Error(t(317));B[as]=c}else Cc(),!(c.flags&128)&&(c.memoizedState=null),c.flags|=4;an(c),B=!1}else Qi!==null&&(U1(Qi),Qi=null),B=!0;if(!B)return c.flags&65536?c:null}return c.flags&128?(c.lanes=f,c):(y=y!==null,y!==(a!==null&&a.memoizedState!==null)&&y&&(c.child.flags|=8192,c.mode&1&&(a===null||ar.current&1?Ur===0&&(Ur=3):Q1())),c.updateQueue!==null&&(c.flags|=4),an(c),null);case 4:return Bc(),I1(a,c),a===null&&gh(c.stateNode.containerInfo),an(c),null;case 10:return Z0(c.type._context),an(c),null;case 17:return Pn(c.type)&&Xf(),an(c),null;case 19:if(Kt(ar),B=c.memoizedState,B===null)return an(c),null;if(y=(c.flags&128)!==0,U=B.rendering,U===null)if(y)Th(B,!1);else{if(Ur!==0||a!==null&&a.flags&128)for(a=c.child;a!==null;){if(U=op(a),U!==null){for(c.flags|=128,Th(B,!1),y=U.updateQueue,y!==null&&(c.updateQueue=y,c.flags|=4),c.subtreeFlags=0,y=f,f=c.child;f!==null;)B=f,a=y,B.flags&=14680066,U=B.alternate,U===null?(B.childLanes=0,B.lanes=a,B.child=null,B.subtreeFlags=0,B.memoizedProps=null,B.memoizedState=null,B.updateQueue=null,B.dependencies=null,B.stateNode=null):(B.childLanes=U.childLanes,B.lanes=U.lanes,B.child=U.child,B.subtreeFlags=0,B.deletions=null,B.memoizedProps=U.memoizedProps,B.memoizedState=U.memoizedState,B.updateQueue=U.updateQueue,B.type=U.type,a=U.dependencies,B.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),f=f.sibling;return Wt(ar,ar.current&1|2),c.child}a=a.sibling}B.tail!==null&&Xe()>Lc&&(c.flags|=128,y=!0,Th(B,!1),c.lanes=4194304)}else{if(!y)if(a=op(U),a!==null){if(c.flags|=128,y=!0,f=a.updateQueue,f!==null&&(c.updateQueue=f,c.flags|=4),Th(B,!0),B.tail===null&&B.tailMode==="hidden"&&!U.alternate&&!tr)return an(c),null}else 2*Xe()-B.renderingStartTime>Lc&&f!==1073741824&&(c.flags|=128,y=!0,Th(B,!1),c.lanes=4194304);B.isBackwards?(U.sibling=c.child,c.child=U):(f=B.last,f!==null?f.sibling=U:c.child=U,B.last=U)}return B.tail!==null?(c=B.tail,B.rendering=c,B.tail=c.sibling,B.renderingStartTime=Xe(),c.sibling=null,f=ar.current,Wt(ar,y?f&1|2:f&1),c):(an(c),null);case 22:case 23:return k1(),y=c.memoizedState!==null,a!==null&&a.memoizedState!==null!==y&&(c.flags|=8192),y&&c.mode&1?ri&1073741824&&(an(c),c.subtreeFlags&6&&(c.flags|=8192)):an(c),null;case 24:return null;case 25:return null}throw Error(t(156,c.tag))}function BQ(a,c){switch(W0(c),c.tag){case 1:return Pn(c.type)&&Xf(),a=c.flags,a&65536?(c.flags=a&-65537|128,c):null;case 3:return Bc(),Kt(Un),Kt(nn),o1(),a=c.flags,a&65536&&!(a&128)?(c.flags=a&-65537|128,c):null;case 5:return s1(c),null;case 13:if(Kt(ar),a=c.memoizedState,a!==null&&a.dehydrated!==null){if(c.alternate===null)throw Error(t(340));Cc()}return a=c.flags,a&65536?(c.flags=a&-65537|128,c):null;case 19:return Kt(ar),null;case 4:return Bc(),null;case 10:return Z0(c.type._context),null;case 22:case 23:return k1(),null;case 24:return null;default:return null}}var Ap=!1,on=!1,bQ=typeof WeakSet=="function"?WeakSet:Set,Oe=null;function Rc(a,c){var f=a.ref;if(f!==null)if(typeof f=="function")try{f(null)}catch(y){pr(a,c,y)}else f.current=null}function C1(a,c,f){try{f()}catch(y){pr(a,c,y)}}var g3=!1;function RQ(a,c){if(k0=Uf,a=YC(),B0(a)){if("selectionStart"in a)var f={start:a.selectionStart,end:a.selectionEnd};else e:{f=(f=a.ownerDocument)&&f.defaultView||window;var y=f.getSelection&&f.getSelection();if(y&&y.rangeCount!==0){f=y.anchorNode;var C=y.anchorOffset,B=y.focusNode;y=y.focusOffset;try{f.nodeType,B.nodeType}catch{f=null;break e}var U=0,q=-1,J=-1,ce=0,we=0,Ce=a,xe=null;t:for(;;){for(var ke;Ce!==f||C!==0&&Ce.nodeType!==3||(q=U+C),Ce!==B||y!==0&&Ce.nodeType!==3||(J=U+y),Ce.nodeType===3&&(U+=Ce.nodeValue.length),(ke=Ce.firstChild)!==null;)xe=Ce,Ce=ke;for(;;){if(Ce===a)break t;if(xe===f&&++ce===C&&(q=U),xe===B&&++we===y&&(J=U),(ke=Ce.nextSibling)!==null)break;Ce=xe,xe=Ce.parentNode}Ce=ke}f=q===-1||J===-1?null:{start:q,end:J}}else f=null}f=f||{start:0,end:0}}else f=null;for(Q0={focusedElem:a,selectionRange:f},Uf=!1,Oe=c;Oe!==null;)if(c=Oe,a=c.child,(c.subtreeFlags&1028)!==0&&a!==null)a.return=c,Oe=a;else for(;Oe!==null;){c=Oe;try{var ze=c.alternate;if(c.flags&1024)switch(c.tag){case 0:case 11:case 15:break;case 1:if(ze!==null){var We=ze.memoizedProps,wr=ze.memoizedState,ie=c.stateNode,$=ie.getSnapshotBeforeUpdate(c.elementType===c.type?We:Oi(c.type,We),wr);ie.__reactInternalSnapshotBeforeUpdate=$}break;case 3:var ae=c.stateNode.containerInfo;ae.nodeType===1?ae.textContent="":ae.nodeType===9&&ae.documentElement&&ae.removeChild(ae.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(t(163))}}catch(Te){pr(c,c.return,Te)}if(a=c.sibling,a!==null){a.return=c.return,Oe=a;break}Oe=c.return}return ze=g3,g3=!1,ze}function Bh(a,c,f){var y=c.updateQueue;if(y=y!==null?y.lastEffect:null,y!==null){var C=y=y.next;do{if((C.tag&a)===a){var B=C.destroy;C.destroy=void 0,B!==void 0&&C1(c,f,B)}C=C.next}while(C!==y)}}function gp(a,c){if(c=c.updateQueue,c=c!==null?c.lastEffect:null,c!==null){var f=c=c.next;do{if((f.tag&a)===a){var y=f.create;f.destroy=y()}f=f.next}while(f!==c)}}function M1(a){var c=a.ref;if(c!==null){var f=a.stateNode;switch(a.tag){case 5:a=f;break;default:a=f}typeof c=="function"?c(a):c.current=a}}function m3(a){var c=a.alternate;c!==null&&(a.alternate=null,m3(c)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(c=a.stateNode,c!==null&&(delete c[as],delete c[vh],delete c[H0],delete c[fQ],delete c[pQ])),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}function v3(a){return a.tag===5||a.tag===3||a.tag===4}function _3(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||v3(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function S1(a,c,f){var y=a.tag;if(y===5||y===6)a=a.stateNode,c?f.nodeType===8?f.parentNode.insertBefore(a,c):f.insertBefore(a,c):(f.nodeType===8?(c=f.parentNode,c.insertBefore(a,f)):(c=f,c.appendChild(a)),f=f._reactRootContainer,f!=null||c.onclick!==null||(c.onclick=Yf));else if(y!==4&&(a=a.child,a!==null))for(S1(a,c,f),a=a.sibling;a!==null;)S1(a,c,f),a=a.sibling}function T1(a,c,f){var y=a.tag;if(y===5||y===6)a=a.stateNode,c?f.insertBefore(a,c):f.appendChild(a);else if(y!==4&&(a=a.child,a!==null))for(T1(a,c,f),a=a.sibling;a!==null;)T1(a,c,f),a=a.sibling}var Kr=null,Fi=!1;function Oa(a,c,f){for(f=f.child;f!==null;)y3(a,c,f),f=f.sibling}function y3(a,c,f){if(tt&&typeof tt.onCommitFiberUnmount=="function")try{tt.onCommitFiberUnmount(jt,f)}catch{}switch(f.tag){case 5:on||Rc(f,c);case 6:var y=Kr,C=Fi;Kr=null,Oa(a,c,f),Kr=y,Fi=C,Kr!==null&&(Fi?(a=Kr,f=f.stateNode,a.nodeType===8?a.parentNode.removeChild(f):a.removeChild(f)):Kr.removeChild(f.stateNode));break;case 18:Kr!==null&&(Fi?(a=Kr,f=f.stateNode,a.nodeType===8?z0(a.parentNode,f):a.nodeType===1&&z0(a,f),oh(a)):z0(Kr,f.stateNode));break;case 4:y=Kr,C=Fi,Kr=f.stateNode.containerInfo,Fi=!0,Oa(a,c,f),Kr=y,Fi=C;break;case 0:case 11:case 14:case 15:if(!on&&(y=f.updateQueue,y!==null&&(y=y.lastEffect,y!==null))){C=y=y.next;do{var B=C,U=B.destroy;B=B.tag,U!==void 0&&(B&2||B&4)&&C1(f,c,U),C=C.next}while(C!==y)}Oa(a,c,f);break;case 1:if(!on&&(Rc(f,c),y=f.stateNode,typeof y.componentWillUnmount=="function"))try{y.props=f.memoizedProps,y.state=f.memoizedState,y.componentWillUnmount()}catch(q){pr(f,c,q)}Oa(a,c,f);break;case 21:Oa(a,c,f);break;case 22:f.mode&1?(on=(y=on)||f.memoizedState!==null,Oa(a,c,f),on=y):Oa(a,c,f);break;default:Oa(a,c,f)}}function E3(a){var c=a.updateQueue;if(c!==null){a.updateQueue=null;var f=a.stateNode;f===null&&(f=a.stateNode=new bQ),c.forEach(function(y){var C=FQ.bind(null,a,y);f.has(y)||(f.add(y),y.then(C,C))})}}function zi(a,c){var f=c.deletions;if(f!==null)for(var y=0;y<f.length;y++){var C=f[y];try{var B=a,U=c,q=U;e:for(;q!==null;){switch(q.tag){case 5:Kr=q.stateNode,Fi=!1;break e;case 3:Kr=q.stateNode.containerInfo,Fi=!0;break e;case 4:Kr=q.stateNode.containerInfo,Fi=!0;break e}q=q.return}if(Kr===null)throw Error(t(160));y3(B,U,C),Kr=null,Fi=!1;var J=C.alternate;J!==null&&(J.return=null),C.return=null}catch(ce){pr(C,c,ce)}}if(c.subtreeFlags&12854)for(c=c.child;c!==null;)x3(c,a),c=c.sibling}function x3(a,c){var f=a.alternate,y=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:if(zi(c,a),cs(a),y&4){try{Bh(3,a,a.return),gp(3,a)}catch(We){pr(a,a.return,We)}try{Bh(5,a,a.return)}catch(We){pr(a,a.return,We)}}break;case 1:zi(c,a),cs(a),y&512&&f!==null&&Rc(f,f.return);break;case 5:if(zi(c,a),cs(a),y&512&&f!==null&&Rc(f,f.return),a.flags&32){var C=a.stateNode;try{Be(C,"")}catch(We){pr(a,a.return,We)}}if(y&4&&(C=a.stateNode,C!=null)){var B=a.memoizedProps,U=f!==null?f.memoizedProps:B,q=a.type,J=a.updateQueue;if(a.updateQueue=null,J!==null)try{q==="input"&&B.type==="radio"&&B.name!=null&&pt(C,B),H(q,U);var ce=H(q,B);for(U=0;U<J.length;U+=2){var we=J[U],Ce=J[U+1];we==="style"?dt(C,Ce):we==="dangerouslySetInnerHTML"?De(C,Ce):we==="children"?Be(C,Ce):x(C,we,Ce,ce)}switch(q){case"input":Y(C,B);break;case"textarea":Ie(C,B);break;case"select":var xe=C._wrapperState.wasMultiple;C._wrapperState.wasMultiple=!!B.multiple;var ke=B.value;ke!=null?me(C,!!B.multiple,ke,!1):xe!==!!B.multiple&&(B.defaultValue!=null?me(C,!!B.multiple,B.defaultValue,!0):me(C,!!B.multiple,B.multiple?[]:"",!1))}C[vh]=B}catch(We){pr(a,a.return,We)}}break;case 6:if(zi(c,a),cs(a),y&4){if(a.stateNode===null)throw Error(t(162));C=a.stateNode,B=a.memoizedProps;try{C.nodeValue=B}catch(We){pr(a,a.return,We)}}break;case 3:if(zi(c,a),cs(a),y&4&&f!==null&&f.memoizedState.isDehydrated)try{oh(c.containerInfo)}catch(We){pr(a,a.return,We)}break;case 4:zi(c,a),cs(a);break;case 13:zi(c,a),cs(a),C=a.child,C.flags&8192&&(B=C.memoizedState!==null,C.stateNode.isHidden=B,!B||C.alternate!==null&&C.alternate.memoizedState!==null||(R1=Xe())),y&4&&E3(a);break;case 22:if(we=f!==null&&f.memoizedState!==null,a.mode&1?(on=(ce=on)||we,zi(c,a),on=ce):zi(c,a),cs(a),y&8192){if(ce=a.memoizedState!==null,(a.stateNode.isHidden=ce)&&!we&&a.mode&1)for(Oe=a,we=a.child;we!==null;){for(Ce=Oe=we;Oe!==null;){switch(xe=Oe,ke=xe.child,xe.tag){case 0:case 11:case 14:case 15:Bh(4,xe,xe.return);break;case 1:Rc(xe,xe.return);var ze=xe.stateNode;if(typeof ze.componentWillUnmount=="function"){y=xe,f=xe.return;try{c=y,ze.props=c.memoizedProps,ze.state=c.memoizedState,ze.componentWillUnmount()}catch(We){pr(y,f,We)}}break;case 5:Rc(xe,xe.return);break;case 22:if(xe.memoizedState!==null){C3(Ce);continue}}ke!==null?(ke.return=xe,Oe=ke):C3(Ce)}we=we.sibling}e:for(we=null,Ce=a;;){if(Ce.tag===5){if(we===null){we=Ce;try{C=Ce.stateNode,ce?(B=C.style,typeof B.setProperty=="function"?B.setProperty("display","none","important"):B.display="none"):(q=Ce.stateNode,J=Ce.memoizedProps.style,U=J!=null&&J.hasOwnProperty("display")?J.display:null,q.style.display=lt("display",U))}catch(We){pr(a,a.return,We)}}}else if(Ce.tag===6){if(we===null)try{Ce.stateNode.nodeValue=ce?"":Ce.memoizedProps}catch(We){pr(a,a.return,We)}}else if((Ce.tag!==22&&Ce.tag!==23||Ce.memoizedState===null||Ce===a)&&Ce.child!==null){Ce.child.return=Ce,Ce=Ce.child;continue}if(Ce===a)break e;for(;Ce.sibling===null;){if(Ce.return===null||Ce.return===a)break e;we===Ce&&(we=null),Ce=Ce.return}we===Ce&&(we=null),Ce.sibling.return=Ce.return,Ce=Ce.sibling}}break;case 19:zi(c,a),cs(a),y&4&&E3(a);break;case 21:break;default:zi(c,a),cs(a)}}function cs(a){var c=a.flags;if(c&2){try{e:{for(var f=a.return;f!==null;){if(v3(f)){var y=f;break e}f=f.return}throw Error(t(160))}switch(y.tag){case 5:var C=y.stateNode;y.flags&32&&(Be(C,""),y.flags&=-33);var B=_3(a);T1(a,B,C);break;case 3:case 4:var U=y.stateNode.containerInfo,q=_3(a);S1(a,q,U);break;default:throw Error(t(161))}}catch(J){pr(a,a.return,J)}a.flags&=-3}c&4096&&(a.flags&=-4097)}function DQ(a,c,f){Oe=a,w3(a)}function w3(a,c,f){for(var y=(a.mode&1)!==0;Oe!==null;){var C=Oe,B=C.child;if(C.tag===22&&y){var U=C.memoizedState!==null||Ap;if(!U){var q=C.alternate,J=q!==null&&q.memoizedState!==null||on;q=Ap;var ce=on;if(Ap=U,(on=J)&&!ce)for(Oe=C;Oe!==null;)U=Oe,J=U.child,U.tag===22&&U.memoizedState!==null?M3(C):J!==null?(J.return=U,Oe=J):M3(C);for(;B!==null;)Oe=B,w3(B),B=B.sibling;Oe=C,Ap=q,on=ce}I3(a)}else C.subtreeFlags&8772&&B!==null?(B.return=C,Oe=B):I3(a)}}function I3(a){for(;Oe!==null;){var c=Oe;if(c.flags&8772){var f=c.alternate;try{if(c.flags&8772)switch(c.tag){case 0:case 11:case 15:on||gp(5,c);break;case 1:var y=c.stateNode;if(c.flags&4&&!on)if(f===null)y.componentDidMount();else{var C=c.elementType===c.type?f.memoizedProps:Oi(c.type,f.memoizedProps);y.componentDidUpdate(C,f.memoizedState,y.__reactInternalSnapshotBeforeUpdate)}var B=c.updateQueue;B!==null&&EM(c,B,y);break;case 3:var U=c.updateQueue;if(U!==null){if(f=null,c.child!==null)switch(c.child.tag){case 5:f=c.child.stateNode;break;case 1:f=c.child.stateNode}EM(c,U,f)}break;case 5:var q=c.stateNode;if(f===null&&c.flags&4){f=q;var J=c.memoizedProps;switch(c.type){case"button":case"input":case"select":case"textarea":J.autoFocus&&f.focus();break;case"img":J.src&&(f.src=J.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(c.memoizedState===null){var ce=c.alternate;if(ce!==null){var we=ce.memoizedState;if(we!==null){var Ce=we.dehydrated;Ce!==null&&oh(Ce)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(t(163))}on||c.flags&512&&M1(c)}catch(xe){pr(c,c.return,xe)}}if(c===a){Oe=null;break}if(f=c.sibling,f!==null){f.return=c.return,Oe=f;break}Oe=c.return}}function C3(a){for(;Oe!==null;){var c=Oe;if(c===a){Oe=null;break}var f=c.sibling;if(f!==null){f.return=c.return,Oe=f;break}Oe=c.return}}function M3(a){for(;Oe!==null;){var c=Oe;try{switch(c.tag){case 0:case 11:case 15:var f=c.return;try{gp(4,c)}catch(J){pr(c,f,J)}break;case 1:var y=c.stateNode;if(typeof y.componentDidMount=="function"){var C=c.return;try{y.componentDidMount()}catch(J){pr(c,C,J)}}var B=c.return;try{M1(c)}catch(J){pr(c,B,J)}break;case 5:var U=c.return;try{M1(c)}catch(J){pr(c,U,J)}}}catch(J){pr(c,c.return,J)}if(c===a){Oe=null;break}var q=c.sibling;if(q!==null){q.return=c.return,Oe=q;break}Oe=c.return}}var LQ=Math.ceil,mp=I.ReactCurrentDispatcher,B1=I.ReactCurrentOwner,_i=I.ReactCurrentBatchConfig,St=0,Wr=null,Tr=null,Jr=0,ri=0,Dc=Na(0),Ur=0,bh=null,Go=0,vp=0,b1=0,Rh=null,Qn=null,R1=0,Lc=1/0,js=null,_p=!1,D1=null,Fa=null,yp=!1,za=null,Ep=0,Dh=0,L1=null,xp=-1,wp=0;function yn(){return St&6?Xe():xp!==-1?xp:xp=Xe()}function Ha(a){return a.mode&1?St&2&&Jr!==0?Jr&-Jr:gQ.transition!==null?(wp===0&&(wp=th()),wp):(a=kt,a!==0||(a=window.event,a=a===void 0?16:SC(a.type)),a):1}function Hi(a,c,f,y){if(50<Dh)throw Dh=0,L1=null,Error(t(185));rh(a,f,y),(!(St&2)||a!==Wr)&&(a===Wr&&(!(St&2)&&(vp|=f),Ur===4&&Ga(a,Jr)),On(a,y),f===1&&St===0&&!(c.mode&1)&&(Lc=Xe()+500,Jf&&Pa()))}function On(a,c){var f=a.callbackNode;$u(a,c);var y=Ma(a,a===Wr?Jr:0);if(y===0)f!==null&&Je(f),a.callbackNode=null,a.callbackPriority=0;else if(c=y&-y,a.callbackPriority!==c){if(f!=null&&Je(f),c===1)a.tag===0?AQ(T3.bind(null,a)):dM(T3.bind(null,a)),hQ(function(){!(St&6)&&Pa()}),f=null;else{switch(_C(y)){case 1:f=ft;break;case 4:f=Lr;break;case 16:f=er;break;case 536870912:f=pi;break;default:f=er}f=P3(f,S3.bind(null,a))}a.callbackPriority=c,a.callbackNode=f}}function S3(a,c){if(xp=-1,wp=0,St&6)throw Error(t(327));var f=a.callbackNode;if(Nc()&&a.callbackNode!==f)return null;var y=Ma(a,a===Wr?Jr:0);if(y===0)return null;if(y&30||y&a.expiredLanes||c)c=Ip(a,y);else{c=y;var C=St;St|=2;var B=b3();(Wr!==a||Jr!==c)&&(js=null,Lc=Xe()+500,jo(a,c));do try{PQ();break}catch(q){B3(a,q)}while(1);J0(),mp.current=B,St=C,Tr!==null?c=0:(Wr=null,Jr=0,c=Ur)}if(c!==0){if(c===2&&(C=eh(a),C!==0&&(y=C,c=N1(a,C))),c===1)throw f=bh,jo(a,0),Ga(a,y),On(a,Xe()),f;if(c===6)Ga(a,y);else{if(C=a.current.alternate,!(y&30)&&!NQ(C)&&(c=Ip(a,y),c===2&&(B=eh(a),B!==0&&(y=B,c=N1(a,B))),c===1))throw f=bh,jo(a,0),Ga(a,y),On(a,Xe()),f;switch(a.finishedWork=C,a.finishedLanes=y,c){case 0:case 1:throw Error(t(345));case 2:Wo(a,Qn,js);break;case 3:if(Ga(a,y),(y&130023424)===y&&(c=R1+500-Xe(),10<c)){if(Ma(a,0)!==0)break;if(C=a.suspendedLanes,(C&y)!==y){yn(),a.pingedLanes|=a.suspendedLanes&C;break}a.timeoutHandle=F0(Wo.bind(null,a,Qn,js),c);break}Wo(a,Qn,js);break;case 4:if(Ga(a,y),(y&4194240)===y)break;for(c=a.eventTimes,C=-1;0<y;){var U=31-vn(y);B=1<<U,U=c[U],U>C&&(C=U),y&=~B}if(y=C,y=Xe()-y,y=(120>y?120:480>y?480:1080>y?1080:1920>y?1920:3e3>y?3e3:4320>y?4320:1960*LQ(y/1960))-y,10<y){a.timeoutHandle=F0(Wo.bind(null,a,Qn,js),y);break}Wo(a,Qn,js);break;case 5:Wo(a,Qn,js);break;default:throw Error(t(329))}}}return On(a,Xe()),a.callbackNode===f?S3.bind(null,a):null}function N1(a,c){var f=Rh;return a.current.memoizedState.isDehydrated&&(jo(a,c).flags|=256),a=Ip(a,c),a!==2&&(c=Qn,Qn=f,c!==null&&U1(c)),a}function U1(a){Qn===null?Qn=a:Qn.push.apply(Qn,a)}function NQ(a){for(var c=a;;){if(c.flags&16384){var f=c.updateQueue;if(f!==null&&(f=f.stores,f!==null))for(var y=0;y<f.length;y++){var C=f[y],B=C.getSnapshot;C=C.value;try{if(!ki(B(),C))return!1}catch{return!1}}}if(f=c.child,c.subtreeFlags&16384&&f!==null)f.return=c,c=f;else{if(c===a)break;for(;c.sibling===null;){if(c.return===null||c.return===a)return!0;c=c.return}c.sibling.return=c.return,c=c.sibling}}return!0}function Ga(a,c){for(c&=~b1,c&=~vp,a.suspendedLanes|=c,a.pingedLanes&=~c,a=a.expirationTimes;0<c;){var f=31-vn(c),y=1<<f;a[f]=-1,c&=~y}}function T3(a){if(St&6)throw Error(t(327));Nc();var c=Ma(a,0);if(!(c&1))return On(a,Xe()),null;var f=Ip(a,c);if(a.tag!==0&&f===2){var y=eh(a);y!==0&&(c=y,f=N1(a,y))}if(f===1)throw f=bh,jo(a,0),Ga(a,c),On(a,Xe()),f;if(f===6)throw Error(t(345));return a.finishedWork=a.current.alternate,a.finishedLanes=c,Wo(a,Qn,js),On(a,Xe()),null}function P1(a,c){var f=St;St|=1;try{return a(c)}finally{St=f,St===0&&(Lc=Xe()+500,Jf&&Pa())}}function Vo(a){za!==null&&za.tag===0&&!(St&6)&&Nc();var c=St;St|=1;var f=_i.transition,y=kt;try{if(_i.transition=null,kt=1,a)return a()}finally{kt=y,_i.transition=f,St=c,!(St&6)&&Pa()}}function k1(){ri=Dc.current,Kt(Dc)}function jo(a,c){a.finishedWork=null,a.finishedLanes=0;var f=a.timeoutHandle;if(f!==-1&&(a.timeoutHandle=-1,uQ(f)),Tr!==null)for(f=Tr.return;f!==null;){var y=f;switch(W0(y),y.tag){case 1:y=y.type.childContextTypes,y!=null&&Xf();break;case 3:Bc(),Kt(Un),Kt(nn),o1();break;case 5:s1(y);break;case 4:Bc();break;case 13:Kt(ar);break;case 19:Kt(ar);break;case 10:Z0(y.type._context);break;case 22:case 23:k1()}f=f.return}if(Wr=a,Tr=a=Va(a.current,null),Jr=ri=c,Ur=0,bh=null,b1=vp=Go=0,Qn=Rh=null,Fo!==null){for(c=0;c<Fo.length;c++)if(f=Fo[c],y=f.interleaved,y!==null){f.interleaved=null;var C=y.next,B=f.pending;if(B!==null){var U=B.next;B.next=C,y.next=U}f.pending=y}Fo=null}return a}function B3(a,c){do{var f=Tr;try{if(J0(),lp.current=dp,cp){for(var y=or.memoizedState;y!==null;){var C=y.queue;C!==null&&(C.pending=null),y=y.next}cp=!1}if(Ho=0,jr=Nr=or=null,Ih=!1,Ch=0,B1.current=null,f===null||f.return===null){Ur=1,bh=c,Tr=null;break}e:{var B=a,U=f.return,q=f,J=c;if(c=Jr,q.flags|=32768,J!==null&&typeof J=="object"&&typeof J.then=="function"){var ce=J,we=q,Ce=we.tag;if(!(we.mode&1)&&(Ce===0||Ce===11||Ce===15)){var xe=we.alternate;xe?(we.updateQueue=xe.updateQueue,we.memoizedState=xe.memoizedState,we.lanes=xe.lanes):(we.updateQueue=null,we.memoizedState=null)}var ke=e3(U);if(ke!==null){ke.flags&=-257,t3(ke,U,q,B,c),ke.mode&1&&$M(B,ce,c),c=ke,J=ce;var ze=c.updateQueue;if(ze===null){var We=new Set;We.add(J),c.updateQueue=We}else ze.add(J);break e}else{if(!(c&1)){$M(B,ce,c),Q1();break e}J=Error(t(426))}}else if(tr&&q.mode&1){var wr=e3(U);if(wr!==null){!(wr.flags&65536)&&(wr.flags|=256),t3(wr,U,q,B,c),X0(bc(J,q));break e}}B=J=bc(J,q),Ur!==4&&(Ur=2),Rh===null?Rh=[B]:Rh.push(B),B=U;do{switch(B.tag){case 3:B.flags|=65536,c&=-c,B.lanes|=c;var ie=JM(B,J,c);yM(B,ie);break e;case 1:q=J;var $=B.type,ae=B.stateNode;if(!(B.flags&128)&&(typeof $.getDerivedStateFromError=="function"||ae!==null&&typeof ae.componentDidCatch=="function"&&(Fa===null||!Fa.has(ae)))){B.flags|=65536,c&=-c,B.lanes|=c;var Te=ZM(B,q,c);yM(B,Te);break e}}B=B.return}while(B!==null)}D3(f)}catch(qe){c=qe,Tr===f&&f!==null&&(Tr=f=f.return);continue}break}while(1)}function b3(){var a=mp.current;return mp.current=dp,a===null?dp:a}function Q1(){(Ur===0||Ur===3||Ur===2)&&(Ur=4),Wr===null||!(Go&268435455)&&!(vp&268435455)||Ga(Wr,Jr)}function Ip(a,c){var f=St;St|=2;var y=b3();(Wr!==a||Jr!==c)&&(js=null,jo(a,c));do try{UQ();break}catch(C){B3(a,C)}while(1);if(J0(),St=f,mp.current=y,Tr!==null)throw Error(t(261));return Wr=null,Jr=0,Ur}function UQ(){for(;Tr!==null;)R3(Tr)}function PQ(){for(;Tr!==null&&!it();)R3(Tr)}function R3(a){var c=U3(a.alternate,a,ri);a.memoizedProps=a.pendingProps,c===null?D3(a):Tr=c,B1.current=null}function D3(a){var c=a;do{var f=c.alternate;if(a=c.return,c.flags&32768){if(f=BQ(f,c),f!==null){f.flags&=32767,Tr=f;return}if(a!==null)a.flags|=32768,a.subtreeFlags=0,a.deletions=null;else{Ur=6,Tr=null;return}}else if(f=TQ(f,c,ri),f!==null){Tr=f;return}if(c=c.sibling,c!==null){Tr=c;return}Tr=c=a}while(c!==null);Ur===0&&(Ur=5)}function Wo(a,c,f){var y=kt,C=_i.transition;try{_i.transition=null,kt=1,kQ(a,c,f,y)}finally{_i.transition=C,kt=y}return null}function kQ(a,c,f,y){do Nc();while(za!==null);if(St&6)throw Error(t(327));f=a.finishedWork;var C=a.finishedLanes;if(f===null)return null;if(a.finishedWork=null,a.finishedLanes=0,f===a.current)throw Error(t(177));a.callbackNode=null,a.callbackPriority=0;var B=f.lanes|f.childLanes;if(mk(a,B),a===Wr&&(Tr=Wr=null,Jr=0),!(f.subtreeFlags&2064)&&!(f.flags&2064)||yp||(yp=!0,P3(er,function(){return Nc(),null})),B=(f.flags&15990)!==0,f.subtreeFlags&15990||B){B=_i.transition,_i.transition=null;var U=kt;kt=1;var q=St;St|=4,B1.current=null,RQ(a,f),x3(f,a),nQ(Q0),Uf=!!k0,Q0=k0=null,a.current=f,DQ(f),at(),St=q,kt=U,_i.transition=B}else a.current=f;if(yp&&(yp=!1,za=a,Ep=C),B=a.pendingLanes,B===0&&(Fa=null),Zu(f.stateNode),On(a,Xe()),c!==null)for(y=a.onRecoverableError,f=0;f<c.length;f++)C=c[f],y(C.value,{componentStack:C.stack,digest:C.digest});if(_p)throw _p=!1,a=D1,D1=null,a;return Ep&1&&a.tag!==0&&Nc(),B=a.pendingLanes,B&1?a===L1?Dh++:(Dh=0,L1=a):Dh=0,Pa(),null}function Nc(){if(za!==null){var a=_C(Ep),c=_i.transition,f=kt;try{if(_i.transition=null,kt=16>a?16:a,za===null)var y=!1;else{if(a=za,za=null,Ep=0,St&6)throw Error(t(331));var C=St;for(St|=4,Oe=a.current;Oe!==null;){var B=Oe,U=B.child;if(Oe.flags&16){var q=B.deletions;if(q!==null){for(var J=0;J<q.length;J++){var ce=q[J];for(Oe=ce;Oe!==null;){var we=Oe;switch(we.tag){case 0:case 11:case 15:Bh(8,we,B)}var Ce=we.child;if(Ce!==null)Ce.return=we,Oe=Ce;else for(;Oe!==null;){we=Oe;var xe=we.sibling,ke=we.return;if(m3(we),we===ce){Oe=null;break}if(xe!==null){xe.return=ke,Oe=xe;break}Oe=ke}}}var ze=B.alternate;if(ze!==null){var We=ze.child;if(We!==null){ze.child=null;do{var wr=We.sibling;We.sibling=null,We=wr}while(We!==null)}}Oe=B}}if(B.subtreeFlags&2064&&U!==null)U.return=B,Oe=U;else e:for(;Oe!==null;){if(B=Oe,B.flags&2048)switch(B.tag){case 0:case 11:case 15:Bh(9,B,B.return)}var ie=B.sibling;if(ie!==null){ie.return=B.return,Oe=ie;break e}Oe=B.return}}var $=a.current;for(Oe=$;Oe!==null;){U=Oe;var ae=U.child;if(U.subtreeFlags&2064&&ae!==null)ae.return=U,Oe=ae;else e:for(U=$;Oe!==null;){if(q=Oe,q.flags&2048)try{switch(q.tag){case 0:case 11:case 15:gp(9,q)}}catch(qe){pr(q,q.return,qe)}if(q===U){Oe=null;break e}var Te=q.sibling;if(Te!==null){Te.return=q.return,Oe=Te;break e}Oe=q.return}}if(St=C,Pa(),tt&&typeof tt.onPostCommitFiberRoot=="function")try{tt.onPostCommitFiberRoot(jt,a)}catch{}y=!0}return y}finally{kt=f,_i.transition=c}}return!1}function L3(a,c,f){c=bc(f,c),c=JM(a,c,1),a=Qa(a,c,1),c=yn(),a!==null&&(rh(a,1,c),On(a,c))}function pr(a,c,f){if(a.tag===3)L3(a,a,f);else for(;c!==null;){if(c.tag===3){L3(c,a,f);break}else if(c.tag===1){var y=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof y.componentDidCatch=="function"&&(Fa===null||!Fa.has(y))){a=bc(f,a),a=ZM(c,a,1),c=Qa(c,a,1),a=yn(),c!==null&&(rh(c,1,a),On(c,a));break}}c=c.return}}function QQ(a,c,f){var y=a.pingCache;y!==null&&y.delete(c),c=yn(),a.pingedLanes|=a.suspendedLanes&f,Wr===a&&(Jr&f)===f&&(Ur===4||Ur===3&&(Jr&130023424)===Jr&&500>Xe()-R1?jo(a,0):b1|=f),On(a,c)}function N3(a,c){c===0&&(a.mode&1?(c=xr,xr<<=1,!(xr&130023424)&&(xr=4194304)):c=1);var f=yn();a=Hs(a,c),a!==null&&(rh(a,c,f),On(a,f))}function OQ(a){var c=a.memoizedState,f=0;c!==null&&(f=c.retryLane),N3(a,f)}function FQ(a,c){var f=0;switch(a.tag){case 13:var y=a.stateNode,C=a.memoizedState;C!==null&&(f=C.retryLane);break;case 19:y=a.stateNode;break;default:throw Error(t(314))}y!==null&&y.delete(c),N3(a,f)}var U3;U3=function(a,c,f){if(a!==null)if(a.memoizedProps!==c.pendingProps||Un.current)kn=!0;else{if(!(a.lanes&f)&&!(c.flags&128))return kn=!1,SQ(a,c,f);kn=!!(a.flags&131072)}else kn=!1,tr&&c.flags&1048576&&fM(c,$f,c.index);switch(c.lanes=0,c.tag){case 2:var y=c.type;pp(a,c),a=c.pendingProps;var C=xc(c,nn.current);Sc(c,f),C=u1(null,c,y,a,C,f);var B=h1();return c.flags|=1,typeof C=="object"&&C!==null&&typeof C.render=="function"&&C.$$typeof===void 0?(c.tag=1,c.memoizedState=null,c.updateQueue=null,Pn(y)?(B=!0,Kf(c)):B=!1,c.memoizedState=C.state!==null&&C.state!==void 0?C.state:null,t1(c),C.updater=sp,c.stateNode=C,C._reactInternals=c,n1(c,y,a,f),c=_1(null,c,y,!0,B,f)):(c.tag=0,tr&&B&&j0(c),_n(null,c,C,f),c=c.child),c;case 16:y=c.elementType;e:{switch(pp(a,c),a=c.pendingProps,C=y._init,y=C(y._payload),c.type=y,C=c.tag=HQ(y),a=Oi(y,a),C){case 0:c=v1(null,c,y,a,f);break e;case 1:c=o3(null,c,y,a,f);break e;case 11:c=r3(null,c,y,a,f);break e;case 14:c=n3(null,c,y,Oi(y.type,a),f);break e}throw Error(t(306,y,""))}return c;case 0:return y=c.type,C=c.pendingProps,C=c.elementType===y?C:Oi(y,C),v1(a,c,y,C,f);case 1:return y=c.type,C=c.pendingProps,C=c.elementType===y?C:Oi(y,C),o3(a,c,y,C,f);case 3:e:{if(l3(c),a===null)throw Error(t(387));y=c.pendingProps,B=c.memoizedState,C=B.element,_M(a,c),ip(c,y,null,f);var U=c.memoizedState;if(y=U.element,B.isDehydrated)if(B={element:y,isDehydrated:!1,cache:U.cache,pendingSuspenseBoundaries:U.pendingSuspenseBoundaries,transitions:U.transitions},c.updateQueue.baseState=B,c.memoizedState=B,c.flags&256){C=bc(Error(t(423)),c),c=c3(a,c,y,f,C);break e}else if(y!==C){C=bc(Error(t(424)),c),c=c3(a,c,y,f,C);break e}else for(ti=La(c.stateNode.containerInfo.firstChild),ei=c,tr=!0,Qi=null,f=TM(c,null,y,f),c.child=f;f;)f.flags=f.flags&-3|4096,f=f.sibling;else{if(Cc(),y===C){c=Vs(a,c,f);break e}_n(a,c,y,f)}c=c.child}return c;case 5:return BM(c),a===null&&q0(c),y=c.type,C=c.pendingProps,B=a!==null?a.memoizedProps:null,U=C.children,O0(y,C)?U=null:B!==null&&O0(y,B)&&(c.flags|=32),a3(a,c),_n(a,c,U,f),c.child;case 6:return a===null&&q0(c),null;case 13:return u3(a,c,f);case 4:return i1(c,c.stateNode.containerInfo),y=c.pendingProps,a===null?c.child=Tc(c,null,y,f):_n(a,c,y,f),c.child;case 11:return y=c.type,C=c.pendingProps,C=c.elementType===y?C:Oi(y,C),r3(a,c,y,C,f);case 7:return _n(a,c,c.pendingProps,f),c.child;case 8:return _n(a,c,c.pendingProps.children,f),c.child;case 12:return _n(a,c,c.pendingProps.children,f),c.child;case 10:e:{if(y=c.type._context,C=c.pendingProps,B=c.memoizedProps,U=C.value,Wt(tp,y._currentValue),y._currentValue=U,B!==null)if(ki(B.value,U)){if(B.children===C.children&&!Un.current){c=Vs(a,c,f);break e}}else for(B=c.child,B!==null&&(B.return=c);B!==null;){var q=B.dependencies;if(q!==null){U=B.child;for(var J=q.firstContext;J!==null;){if(J.context===y){if(B.tag===1){J=Gs(-1,f&-f),J.tag=2;var ce=B.updateQueue;if(ce!==null){ce=ce.shared;var we=ce.pending;we===null?J.next=J:(J.next=we.next,we.next=J),ce.pending=J}}B.lanes|=f,J=B.alternate,J!==null&&(J.lanes|=f),$0(B.return,f,c),q.lanes|=f;break}J=J.next}}else if(B.tag===10)U=B.type===c.type?null:B.child;else if(B.tag===18){if(U=B.return,U===null)throw Error(t(341));U.lanes|=f,q=U.alternate,q!==null&&(q.lanes|=f),$0(U,f,c),U=B.sibling}else U=B.child;if(U!==null)U.return=B;else for(U=B;U!==null;){if(U===c){U=null;break}if(B=U.sibling,B!==null){B.return=U.return,U=B;break}U=U.return}B=U}_n(a,c,C.children,f),c=c.child}return c;case 9:return C=c.type,y=c.pendingProps.children,Sc(c,f),C=mi(C),y=y(C),c.flags|=1,_n(a,c,y,f),c.child;case 14:return y=c.type,C=Oi(y,c.pendingProps),C=Oi(y.type,C),n3(a,c,y,C,f);case 15:return i3(a,c,c.type,c.pendingProps,f);case 17:return y=c.type,C=c.pendingProps,C=c.elementType===y?C:Oi(y,C),pp(a,c),c.tag=1,Pn(y)?(a=!0,Kf(c)):a=!1,Sc(c,f),IM(c,y,C),n1(c,y,C,f),_1(null,c,y,!0,a,f);case 19:return d3(a,c,f);case 22:return s3(a,c,f)}throw Error(t(156,c.tag))};function P3(a,c){return Re(a,c)}function zQ(a,c,f,y){this.tag=a,this.key=f,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=y,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function yi(a,c,f,y){return new zQ(a,c,f,y)}function O1(a){return a=a.prototype,!(!a||!a.isReactComponent)}function HQ(a){if(typeof a=="function")return O1(a)?1:0;if(a!=null){if(a=a.$$typeof,a===P)return 11;if(a===X)return 14}return 2}function Va(a,c){var f=a.alternate;return f===null?(f=yi(a.tag,c,a.key,a.mode),f.elementType=a.elementType,f.type=a.type,f.stateNode=a.stateNode,f.alternate=a,a.alternate=f):(f.pendingProps=c,f.type=a.type,f.flags=0,f.subtreeFlags=0,f.deletions=null),f.flags=a.flags&14680064,f.childLanes=a.childLanes,f.lanes=a.lanes,f.child=a.child,f.memoizedProps=a.memoizedProps,f.memoizedState=a.memoizedState,f.updateQueue=a.updateQueue,c=a.dependencies,f.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},f.sibling=a.sibling,f.index=a.index,f.ref=a.ref,f}function Cp(a,c,f,y,C,B){var U=2;if(y=a,typeof a=="function")O1(a)&&(U=1);else if(typeof a=="string")U=5;else e:switch(a){case T:return Yo(f.children,C,B,c);case D:U=8,C|=8;break;case b:return a=yi(12,f,c,C|2),a.elementType=b,a.lanes=B,a;case N:return a=yi(13,f,c,C),a.elementType=N,a.lanes=B,a;case W:return a=yi(19,f,c,C),a.elementType=W,a.lanes=B,a;case te:return Mp(f,C,B,c);default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case M:U=10;break e;case L:U=9;break e;case P:U=11;break e;case X:U=14;break e;case K:U=16,y=null;break e}throw Error(t(130,a==null?a:typeof a,""))}return c=yi(U,f,c,C),c.elementType=a,c.type=y,c.lanes=B,c}function Yo(a,c,f,y){return a=yi(7,a,y,c),a.lanes=f,a}function Mp(a,c,f,y){return a=yi(22,a,y,c),a.elementType=te,a.lanes=f,a.stateNode={isHidden:!1},a}function F1(a,c,f){return a=yi(6,a,null,c),a.lanes=f,a}function z1(a,c,f){return c=yi(4,a.children!==null?a.children:[],a.key,c),c.lanes=f,c.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},c}function GQ(a,c,f,y,C){this.tag=c,this.containerInfo=a,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=p0(0),this.expirationTimes=p0(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=p0(0),this.identifierPrefix=y,this.onRecoverableError=C,this.mutableSourceEagerHydrationData=null}function H1(a,c,f,y,C,B,U,q,J){return a=new GQ(a,c,f,q,J),c===1?(c=1,B===!0&&(c|=8)):c=0,B=yi(3,null,null,c),a.current=B,B.stateNode=a,B.memoizedState={element:y,isDehydrated:f,cache:null,transitions:null,pendingSuspenseBoundaries:null},t1(B),a}function VQ(a,c,f){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:S,key:y==null?null:""+y,children:a,containerInfo:c,implementation:f}}function k3(a){if(!a)return Ua;a=a._reactInternals;e:{if(Ps(a)!==a||a.tag!==1)throw Error(t(170));var c=a;do{switch(c.tag){case 3:c=c.stateNode.context;break e;case 1:if(Pn(c.type)){c=c.stateNode.__reactInternalMemoizedMergedChildContext;break e}}c=c.return}while(c!==null);throw Error(t(171))}if(a.tag===1){var f=a.type;if(Pn(f))return uM(a,f,c)}return c}function Q3(a,c,f,y,C,B,U,q,J){return a=H1(f,y,!0,a,C,B,U,q,J),a.context=k3(null),f=a.current,y=yn(),C=Ha(f),B=Gs(y,C),B.callback=c??null,Qa(f,B,C),a.current.lanes=C,rh(a,C,y),On(a,y),a}function Sp(a,c,f,y){var C=c.current,B=yn(),U=Ha(C);return f=k3(f),c.context===null?c.context=f:c.pendingContext=f,c=Gs(B,U),c.payload={element:a},y=y===void 0?null:y,y!==null&&(c.callback=y),a=Qa(C,c,U),a!==null&&(Hi(a,C,U,B),np(a,C,U)),U}function Tp(a){if(a=a.current,!a.child)return null;switch(a.child.tag){case 5:return a.child.stateNode;default:return a.child.stateNode}}function O3(a,c){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var f=a.retryLane;a.retryLane=f!==0&&f<c?f:c}}function G1(a,c){O3(a,c),(a=a.alternate)&&O3(a,c)}function jQ(){return null}var F3=typeof reportError=="function"?reportError:function(a){console.error(a)};function V1(a){this._internalRoot=a}Bp.prototype.render=V1.prototype.render=function(a){var c=this._internalRoot;if(c===null)throw Error(t(409));Sp(a,c,null,null)},Bp.prototype.unmount=V1.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var c=a.containerInfo;Vo(function(){Sp(null,a,null,null)}),c[Qs]=null}};function Bp(a){this._internalRoot=a}Bp.prototype.unstable_scheduleHydration=function(a){if(a){var c=xC();a={blockedOn:null,target:a,priority:c};for(var f=0;f<ba.length&&c!==0&&c<ba[f].priority;f++);ba.splice(f,0,a),f===0&&CC(a)}};function j1(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function bp(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11&&(a.nodeType!==8||a.nodeValue!==" react-mount-point-unstable "))}function z3(){}function WQ(a,c,f,y,C){if(C){if(typeof y=="function"){var B=y;y=function(){var ce=Tp(U);B.call(ce)}}var U=Q3(c,y,a,0,null,!1,!1,"",z3);return a._reactRootContainer=U,a[Qs]=U.current,gh(a.nodeType===8?a.parentNode:a),Vo(),U}for(;C=a.lastChild;)a.removeChild(C);if(typeof y=="function"){var q=y;y=function(){var ce=Tp(J);q.call(ce)}}var J=H1(a,0,!1,null,null,!1,!1,"",z3);return a._reactRootContainer=J,a[Qs]=J.current,gh(a.nodeType===8?a.parentNode:a),Vo(function(){Sp(c,J,f,y)}),J}function Rp(a,c,f,y,C){var B=f._reactRootContainer;if(B){var U=B;if(typeof C=="function"){var q=C;C=function(){var J=Tp(U);q.call(J)}}Sp(c,U,a,C)}else U=WQ(f,c,a,C,y);return Tp(U)}yC=function(a){switch(a.tag){case 3:var c=a.stateNode;if(c.current.memoizedState.isDehydrated){var f=Ln(c.pendingLanes);f!==0&&(A0(c,f|1),On(c,Xe()),!(St&6)&&(Lc=Xe()+500,Pa()))}break;case 13:Vo(function(){var y=Hs(a,1);if(y!==null){var C=yn();Hi(y,a,1,C)}}),G1(a,1)}},g0=function(a){if(a.tag===13){var c=Hs(a,134217728);if(c!==null){var f=yn();Hi(c,a,134217728,f)}G1(a,134217728)}},EC=function(a){if(a.tag===13){var c=Ha(a),f=Hs(a,c);if(f!==null){var y=yn();Hi(f,a,c,y)}G1(a,c)}},xC=function(){return kt},wC=function(a,c){var f=kt;try{return kt=a,c()}finally{kt=f}},ve=function(a,c,f){switch(c){case"input":if(Y(a,f),c=f.name,f.type==="radio"&&c!=null){for(f=a;f.parentNode;)f=f.parentNode;for(f=f.querySelectorAll("input[name="+JSON.stringify(""+c)+'][type="radio"]'),c=0;c<f.length;c++){var y=f[c];if(y!==a&&y.form===a.form){var C=qf(y);if(!C)throw Error(t(90));et(y),Y(y,C)}}}break;case"textarea":Ie(a,f);break;case"select":c=f.value,c!=null&&me(a,!!f.multiple,c,!1)}},Bt=P1,_t=Vo;var YQ={usingClientEntryPoint:!1,Events:[_h,yc,qf,Lt,Nt,P1]},Lh={findFiberByHostInstance:Po,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},qQ={bundleType:Lh.bundleType,version:Lh.version,rendererPackageName:Lh.rendererPackageName,rendererConfig:Lh.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:I.ReactCurrentDispatcher,findHostInstanceByFiber:function(a){return a=he(a),a===null?null:a.stateNode},findFiberByHostInstance:Lh.findFiberByHostInstance||jQ,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Dp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Dp.isDisabled&&Dp.supportsFiber)try{jt=Dp.inject(qQ),tt=Dp}catch{}}return bn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=YQ,bn.createPortal=function(a,c){var f=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!j1(c))throw Error(t(200));return VQ(a,c,null,f)},bn.createRoot=function(a,c){if(!j1(a))throw Error(t(299));var f=!1,y="",C=F3;return c!=null&&(c.unstable_strictMode===!0&&(f=!0),c.identifierPrefix!==void 0&&(y=c.identifierPrefix),c.onRecoverableError!==void 0&&(C=c.onRecoverableError)),c=H1(a,1,!1,null,null,f,!1,y,C),a[Qs]=c.current,gh(a.nodeType===8?a.parentNode:a),new V1(c)},bn.findDOMNode=function(a){if(a==null)return null;if(a.nodeType===1)return a;var c=a._reactInternals;if(c===void 0)throw typeof a.render=="function"?Error(t(188)):(a=Object.keys(a).join(","),Error(t(268,a)));return a=he(c),a=a===null?null:a.stateNode,a},bn.flushSync=function(a){return Vo(a)},bn.hydrate=function(a,c,f){if(!bp(c))throw Error(t(200));return Rp(null,a,c,!0,f)},bn.hydrateRoot=function(a,c,f){if(!j1(a))throw Error(t(405));var y=f!=null&&f.hydratedSources||null,C=!1,B="",U=F3;if(f!=null&&(f.unstable_strictMode===!0&&(C=!0),f.identifierPrefix!==void 0&&(B=f.identifierPrefix),f.onRecoverableError!==void 0&&(U=f.onRecoverableError)),c=Q3(c,null,a,1,f??null,C,!1,B,U),a[Qs]=c.current,gh(a),y)for(a=0;a<y.length;a++)f=y[a],C=f._getVersion,C=C(f._source),c.mutableSourceEagerHydrationData==null?c.mutableSourceEagerHydrationData=[f,C]:c.mutableSourceEagerHydrationData.push(f,C);return new Bp(c)},bn.render=function(a,c,f){if(!bp(c))throw Error(t(200));return Rp(null,a,c,!1,f)},bn.unmountComponentAtNode=function(a){if(!bp(a))throw Error(t(40));return a._reactRootContainer?(Vo(function(){Rp(null,null,a,!1,function(){a._reactRootContainer=null,a[Qs]=null})}),!0):!1},bn.unstable_batchedUpdates=P1,bn.unstable_renderSubtreeIntoContainer=function(a,c,f,y){if(!bp(f))throw Error(t(200));if(a==null||a._reactInternals===void 0)throw Error(t(38));return Rp(a,c,f,!1,y)},bn.version="18.2.0-next-9e3b772b8-20220608",bn}function iC(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(iC)}catch(r){console.error(r)}}iC(),eC.exports=Z7();var $7=eC.exports,sC=$7;a0.createRoot=sC.createRoot,a0.hydrateRoot=sC.hydrateRoot;class ek{constructor({apiService:e,events:t}){Rt(this,"targetElement");Rt(this,"apiService");Rt(this,"events");Rt(this,"htmlTarget");this.apiService=e,this.events=t}mount(e,t){if(!this.targetElement){const n=t.customId??"dita-3dconfig-element",i=document.getElementById(n);if(!i)throw new Error(`Element not found with id => '${n}' `);this.htmlTarget=i,this.htmlTarget.style.height="100%",this.htmlTarget.style.width="100%",this.targetElement=a0.createRoot(document.getElementById(n))}this.targetElement.render(Nh.createElement(X7,{apiService:this.apiService,events:this.events,sku:e,viewerOnly:t.viewerOnly}))}unmount(){this.targetElement&&(this.targetElement.unmount(),this.targetElement=void 0,this.htmlTarget&&(this.htmlTarget.style.height="0px",this.htmlTarget.style.width="auto"))}}var c0={exports:{}},hc=typeof Reflect=="object"?Reflect:null,aC=hc&&typeof hc.apply=="function"?hc.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)},Bf;hc&&typeof hc.ownKeys=="function"?Bf=hc.ownKeys:Object.getOwnPropertySymbols?Bf=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Bf=function(e){return Object.getOwnPropertyNames(e)};function tk(r){console&&console.warn&&console.warn(r)}var oC=Number.isNaN||function(e){return e!==e};function Ot(){Ot.init.call(this)}c0.exports=Ot,c0.exports.once=sk,Ot.EventEmitter=Ot,Ot.prototype._events=void 0,Ot.prototype._eventsCount=0,Ot.prototype._maxListeners=void 0;var lC=10;function bf(r){if(typeof r!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r)}Object.defineProperty(Ot,"defaultMaxListeners",{enumerable:!0,get:function(){return lC},set:function(r){if(typeof r!="number"||r<0||oC(r))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+r+".");lC=r}}),Ot.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},Ot.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||oC(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function cC(r){return r._maxListeners===void 0?Ot.defaultMaxListeners:r._maxListeners}Ot.prototype.getMaxListeners=function(){return cC(this)},Ot.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var i=e==="error",s=this._events;if(s!==void 0)i=i&&s.error===void 0;else if(!i)return!1;if(i){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var l=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw l.context=o,l}var h=s[e];if(h===void 0)return!1;if(typeof h=="function")aC(h,this,t);else for(var u=h.length,d=pC(h,u),n=0;n<u;++n)aC(d[n],this,t);return!0};function uC(r,e,t,n){var i,s,o;if(bf(t),s=r._events,s===void 0?(s=r._events=Object.create(null),r._eventsCount=0):(s.newListener!==void 0&&(r.emit("newListener",e,t.listener?t.listener:t),s=r._events),o=s[e]),o===void 0)o=s[e]=t,++r._eventsCount;else if(typeof o=="function"?o=s[e]=n?[t,o]:[o,t]:n?o.unshift(t):o.push(t),i=cC(r),i>0&&o.length>i&&!o.warned){o.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=r,l.type=e,l.count=o.length,tk(l)}return r}Ot.prototype.addListener=function(e,t){return uC(this,e,t,!1)},Ot.prototype.on=Ot.prototype.addListener,Ot.prototype.prependListener=function(e,t){return uC(this,e,t,!0)};function rk(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function hC(r,e,t){var n={fired:!1,wrapFn:void 0,target:r,type:e,listener:t},i=rk.bind(n);return i.listener=t,n.wrapFn=i,i}Ot.prototype.once=function(e,t){return bf(t),this.on(e,hC(this,e,t)),this},Ot.prototype.prependOnceListener=function(e,t){return bf(t),this.prependListener(e,hC(this,e,t)),this},Ot.prototype.removeListener=function(e,t){var n,i,s,o,l;if(bf(t),i=this._events,i===void 0)return this;if(n=i[e],n===void 0)return this;if(n===t||n.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,n.listener||t));else if(typeof n!="function"){for(s=-1,o=n.length-1;o>=0;o--)if(n[o]===t||n[o].listener===t){l=n[o].listener,s=o;break}if(s<0)return this;s===0?n.shift():nk(n,s),n.length===1&&(i[e]=n[0]),i.removeListener!==void 0&&this.emit("removeListener",e,l||t)}return this},Ot.prototype.off=Ot.prototype.removeListener,Ot.prototype.removeAllListeners=function(e){var t,n,i;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var s=Object.keys(n),o;for(i=0;i<s.length;++i)o=s[i],o!=="removeListener"&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(t=n[e],typeof t=="function")this.removeListener(e,t);else if(t!==void 0)for(i=t.length-1;i>=0;i--)this.removeListener(e,t[i]);return this};function dC(r,e,t){var n=r._events;if(n===void 0)return[];var i=n[e];return i===void 0?[]:typeof i=="function"?t?[i.listener||i]:[i]:t?ik(i):pC(i,i.length)}Ot.prototype.listeners=function(e){return dC(this,e,!0)},Ot.prototype.rawListeners=function(e){return dC(this,e,!1)},Ot.listenerCount=function(r,e){return typeof r.listenerCount=="function"?r.listenerCount(e):fC.call(r,e)},Ot.prototype.listenerCount=fC;function fC(r){var e=this._events;if(e!==void 0){var t=e[r];if(typeof t=="function")return 1;if(t!==void 0)return t.length}return 0}Ot.prototype.eventNames=function(){return this._eventsCount>0?Bf(this._events):[]};function pC(r,e){for(var t=new Array(e),n=0;n<e;++n)t[n]=r[n];return t}function nk(r,e){for(;e+1<r.length;e++)r[e]=r[e+1];r.pop()}function ik(r){for(var e=new Array(r.length),t=0;t<e.length;++t)e[t]=r[t].listener||r[t];return e}function sk(r,e){return new Promise(function(t,n){function i(o){r.removeListener(e,s),n(o)}function s(){typeof r.removeListener=="function"&&r.removeListener("error",i),t([].slice.call(arguments))}AC(r,e,s,{once:!0}),e!=="error"&&ak(r,i,{once:!0})})}function ak(r,e,t){typeof r.on=="function"&&AC(r,"error",e,t)}function AC(r,e,t,n){if(typeof r.on=="function")n.once?r.once(e,t):r.on(e,t);else if(typeof r.addEventListener=="function")r.addEventListener(e,function i(s){n.once&&r.removeEventListener(e,i),t(s)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof r)}var ok=c0.exports;const Ju=class Ju extends ok.EventEmitter{emitEvent(e,t){Object.keys(Ju.EVENTS).includes(e)&&this.emit(Ju.EVENTS[e],t)}};Rt(Ju,"EVENTS",{onAddToCart:"add-to-cart"});let u0=Ju;const lk={getCartUrl:((mC=window.Shopify)==null?void 0:mC.routes.root)+"cart.js",addToCartUrl:((vC=window.Shopify)==null?void 0:vC.routes.root)+"cart/add.js"},gC=Object.freeze(lk);class ck{constructor(e){Rt(this,"config");this.config=e}RequestOptions(e,t){return{method:e,headers:{Accept:"application/json","Content-Type":"application/json"},...e==="POST"&&{body:JSON.stringify(t)}}}async Get(){return(await fetch(this.config.getCartUrl,this.RequestOptions("GET"))).json()}async Post(e){return(await fetch(this.config.addToCartUrl,this.RequestOptions("POST",e||{}))).json()}}const{log:uk,error:hk}=console,dk=(...r)=>{hk("❌ Sprie Error:",...r)},fk="&ui_animations=0&ui_infos=0&ui_stop=0&ui_inspector=0&ui_watermark_link=0&ui_watermark=0&ui_ar=0&ui_help=0&ui_settings=0&ui_vr=0&ui_fullscreen=0&ui_annotations=0&ui_start=0&",pk={HOST:hs.host,STORE_PREFIX:hs.storePrefix},Ak={addToCartUrl:gC.addToCartUrl,getCartUrl:gC.getCartUrl};let h0=!1;class gk{constructor(){Rt(this,"sdkService");Rt(this,"apiService");Rt(this,"uiService");Rt(this,"events");this.events=new u0,this.apiService=new V3(new Wa(pk),new ck(Ak)),this.uiService=new ek({apiService:this.apiService,events:this.events});const e={apiService:this.apiService,config:hs,log:uk,logErr:dk,metaData:{appVersion:H3,previewUrlPrams:fk,targetClassName:"sprie-embed-element"}};this.sdkService=new j3(e),this.sdkService.Init().then(t=>{h0=t})}isReadyToLoad(){return h0}load(e,t){h0?this.loadOnAuth(e,t):this.waitForAllReady(this.isReadyToLoad,()=>this.loadOnAuth(e,t),e,t)}loadOnAuth(e,t){this.uiService.unmount(),this.uiService.mount(e,{viewerOnly:!1,customId:t})}loadViewerOnly(e,t){this.uiService.unmount(),this.uiService.mount(e,{viewerOnly:!0,customId:t})}unload(){this.uiService.unmount()}waitForAllReady(e,t,n,i){e()?t(n,i):setTimeout(()=>{this.waitForAllReady(e,t,n,i)},200)}}window.ditaConfigurator=new gk})();
4574
+ `+B.stack}return{value:a,source:c,stack:C,digest:null}}function g1(a,c,f){return{value:a,source:null,stack:f??null,digest:c??null}}function m1(a,c){try{console.error(c.value)}catch(f){setTimeout(function(){throw f})}}var IQ=typeof WeakMap=="function"?WeakMap:Map;function JM(a,c,f){f=Gs(-1,f),f.tag=3,f.payload={element:null};var y=c.value;return f.callback=function(){vp||(vp=!0,D1=y),m1(a,c)},f}function ZM(a,c,f){f=Gs(-1,f),f.tag=3;var y=a.type.getDerivedStateFromError;if(typeof y=="function"){var C=c.value;f.payload=function(){return y(C)},f.callback=function(){m1(a,c)}}var B=a.stateNode;return B!==null&&typeof B.componentDidCatch=="function"&&(f.callback=function(){m1(a,c),typeof y!="function"&&(Fa===null?Fa=new Set([this]):Fa.add(this));var U=c.stack;this.componentDidCatch(c.value,{componentStack:U!==null?U:""})}),f}function $M(a,c,f){var y=a.pingCache;if(y===null){y=a.pingCache=new IQ;var C=new Set;y.set(c,C)}else C=y.get(c),C===void 0&&(C=new Set,y.set(c,C));C.has(f)||(C.add(f),a=QQ.bind(null,a,c,f),c.then(a,a))}function e3(a){do{var c;if((c=a.tag===13)&&(c=a.memoizedState,c=c!==null?c.dehydrated!==null:!0),c)return a;a=a.return}while(a!==null);return null}function t3(a,c,f,y,C){return a.mode&1?(a.flags|=65536,a.lanes=C,a):(a===c?a.flags|=65536:(a.flags|=128,f.flags|=131072,f.flags&=-52805,f.tag===1&&(f.alternate===null?f.tag=17:(c=Gs(-1,1),c.tag=2,Qa(f,c,1))),f.lanes|=1),a)}var CQ=I.ReactCurrentOwner,kn=!1;function _n(a,c,f,y){c.child=a===null?TM(c,null,f,y):Tc(c,a.child,f,y)}function r3(a,c,f,y,C){f=f.render;var B=c.ref;return Sc(c,C),y=u1(a,c,f,y,B,C),f=h1(),a!==null&&!kn?(c.updateQueue=a.updateQueue,c.flags&=-2053,a.lanes&=~C,Vs(a,c,C)):(tr&&f&&j0(c),c.flags|=1,_n(a,c,y,C),c.child)}function n3(a,c,f,y,C){if(a===null){var B=f.type;return typeof B=="function"&&!O1(B)&&B.defaultProps===void 0&&f.compare===null&&f.defaultProps===void 0?(c.tag=15,c.type=B,i3(a,c,B,y,C)):(a=Ip(f.type,null,y,c,c.mode,C),a.ref=c.ref,a.return=c,c.child=a)}if(B=a.child,!(a.lanes&C)){var U=B.memoizedProps;if(f=f.compare,f=f!==null?f:fh,f(U,y)&&a.ref===c.ref)return Vs(a,c,C)}return c.flags|=1,a=Va(B,y),a.ref=c.ref,a.return=c,c.child=a}function i3(a,c,f,y,C){if(a!==null){var B=a.memoizedProps;if(fh(B,y)&&a.ref===c.ref)if(kn=!1,c.pendingProps=y=B,(a.lanes&C)!==0)a.flags&131072&&(kn=!0);else return c.lanes=a.lanes,Vs(a,c,C)}return v1(a,c,f,y,C)}function s3(a,c,f){var y=c.pendingProps,C=y.children,B=a!==null?a.memoizedState:null;if(y.mode==="hidden")if(!(c.mode&1))c.memoizedState={baseLanes:0,cachePool:null,transitions:null},Wt(Dc,ri),ri|=f;else{if(!(f&1073741824))return a=B!==null?B.baseLanes|f:f,c.lanes=c.childLanes=1073741824,c.memoizedState={baseLanes:a,cachePool:null,transitions:null},c.updateQueue=null,Wt(Dc,ri),ri|=a,null;c.memoizedState={baseLanes:0,cachePool:null,transitions:null},y=B!==null?B.baseLanes:f,Wt(Dc,ri),ri|=y}else B!==null?(y=B.baseLanes|f,c.memoizedState=null):y=f,Wt(Dc,ri),ri|=y;return _n(a,c,C,f),c.child}function a3(a,c){var f=c.ref;(a===null&&f!==null||a!==null&&a.ref!==f)&&(c.flags|=512,c.flags|=2097152)}function v1(a,c,f,y,C){var B=Pn(f)?ko:nn.current;return B=xc(c,B),Sc(c,C),f=u1(a,c,f,y,B,C),y=h1(),a!==null&&!kn?(c.updateQueue=a.updateQueue,c.flags&=-2053,a.lanes&=~C,Vs(a,c,C)):(tr&&y&&j0(c),c.flags|=1,_n(a,c,f,C),c.child)}function o3(a,c,f,y,C){if(Pn(f)){var B=!0;Xf(c)}else B=!1;if(Sc(c,C),c.stateNode===null)fp(a,c),IM(c,f,y),n1(c,f,y,C),y=!0;else if(a===null){var U=c.stateNode,q=c.memoizedProps;U.props=q;var J=U.context,ce=f.contextType;typeof ce=="object"&&ce!==null?ce=mi(ce):(ce=Pn(f)?ko:nn.current,ce=xc(c,ce));var we=f.getDerivedStateFromProps,Ce=typeof we=="function"||typeof U.getSnapshotBeforeUpdate=="function";Ce||typeof U.UNSAFE_componentWillReceiveProps!="function"&&typeof U.componentWillReceiveProps!="function"||(q!==y||J!==ce)&&CM(c,U,y,ce),ka=!1;var xe=c.memoizedState;U.state=xe,np(c,y,U,C),J=c.memoizedState,q!==y||xe!==J||Un.current||ka?(typeof we=="function"&&(r1(c,f,we,y),J=c.memoizedState),(q=ka||wM(c,f,q,y,xe,J,ce))?(Ce||typeof U.UNSAFE_componentWillMount!="function"&&typeof U.componentWillMount!="function"||(typeof U.componentWillMount=="function"&&U.componentWillMount(),typeof U.UNSAFE_componentWillMount=="function"&&U.UNSAFE_componentWillMount()),typeof U.componentDidMount=="function"&&(c.flags|=4194308)):(typeof U.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=y,c.memoizedState=J),U.props=y,U.state=J,U.context=ce,y=q):(typeof U.componentDidMount=="function"&&(c.flags|=4194308),y=!1)}else{U=c.stateNode,_M(a,c),q=c.memoizedProps,ce=c.type===c.elementType?q:Oi(c.type,q),U.props=ce,Ce=c.pendingProps,xe=U.context,J=f.contextType,typeof J=="object"&&J!==null?J=mi(J):(J=Pn(f)?ko:nn.current,J=xc(c,J));var ke=f.getDerivedStateFromProps;(we=typeof ke=="function"||typeof U.getSnapshotBeforeUpdate=="function")||typeof U.UNSAFE_componentWillReceiveProps!="function"&&typeof U.componentWillReceiveProps!="function"||(q!==Ce||xe!==J)&&CM(c,U,y,J),ka=!1,xe=c.memoizedState,U.state=xe,np(c,y,U,C);var ze=c.memoizedState;q!==Ce||xe!==ze||Un.current||ka?(typeof ke=="function"&&(r1(c,f,ke,y),ze=c.memoizedState),(ce=ka||wM(c,f,ce,y,xe,ze,J)||!1)?(we||typeof U.UNSAFE_componentWillUpdate!="function"&&typeof U.componentWillUpdate!="function"||(typeof U.componentWillUpdate=="function"&&U.componentWillUpdate(y,ze,J),typeof U.UNSAFE_componentWillUpdate=="function"&&U.UNSAFE_componentWillUpdate(y,ze,J)),typeof U.componentDidUpdate=="function"&&(c.flags|=4),typeof U.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof U.componentDidUpdate!="function"||q===a.memoizedProps&&xe===a.memoizedState||(c.flags|=4),typeof U.getSnapshotBeforeUpdate!="function"||q===a.memoizedProps&&xe===a.memoizedState||(c.flags|=1024),c.memoizedProps=y,c.memoizedState=ze),U.props=y,U.state=ze,U.context=J,y=ce):(typeof U.componentDidUpdate!="function"||q===a.memoizedProps&&xe===a.memoizedState||(c.flags|=4),typeof U.getSnapshotBeforeUpdate!="function"||q===a.memoizedProps&&xe===a.memoizedState||(c.flags|=1024),y=!1)}return _1(a,c,f,y,B,C)}function _1(a,c,f,y,C,B){a3(a,c);var U=(c.flags&128)!==0;if(!y&&!U)return C&&hM(c,f,!1),Vs(a,c,B);y=c.stateNode,CQ.current=c;var q=U&&typeof f.getDerivedStateFromError!="function"?null:y.render();return c.flags|=1,a!==null&&U?(c.child=Tc(c,a.child,null,B),c.child=Tc(c,null,q,B)):_n(a,c,q,B),c.memoizedState=y.state,C&&hM(c,f,!0),c.child}function l3(a){var c=a.stateNode;c.pendingContext?cM(a,c.pendingContext,c.pendingContext!==c.context):c.context&&cM(a,c.context,!1),i1(a,c.containerInfo)}function c3(a,c,f,y,C){return Cc(),X0(C),c.flags|=256,_n(a,c,f,y),c.child}var y1={dehydrated:null,treeContext:null,retryLane:0};function E1(a){return{baseLanes:a,cachePool:null,transitions:null}}function u3(a,c,f){var y=c.pendingProps,C=ar.current,B=!1,U=(c.flags&128)!==0,q;if((q=U)||(q=a!==null&&a.memoizedState===null?!1:(C&2)!==0),q?(B=!0,c.flags&=-129):(a===null||a.memoizedState!==null)&&(C|=1),Wt(ar,C&1),a===null)return q0(c),a=c.memoizedState,a!==null&&(a=a.dehydrated,a!==null)?(c.mode&1?a.data==="$!"?c.lanes=8:c.lanes=1073741824:c.lanes=1,null):(U=y.children,a=y.fallback,B?(y=c.mode,B=c.child,U={mode:"hidden",children:U},!(y&1)&&B!==null?(B.childLanes=0,B.pendingProps=U):B=Cp(U,y,0,null),a=Yo(a,y,f,null),B.return=c,a.return=c,B.sibling=a,c.child=B,c.child.memoizedState=E1(f),c.memoizedState=y1,a):x1(c,U));if(C=a.memoizedState,C!==null&&(q=C.dehydrated,q!==null))return MQ(a,c,U,y,q,C,f);if(B){B=y.fallback,U=c.mode,C=a.child,q=C.sibling;var J={mode:"hidden",children:y.children};return!(U&1)&&c.child!==C?(y=c.child,y.childLanes=0,y.pendingProps=J,c.deletions=null):(y=Va(C,J),y.subtreeFlags=C.subtreeFlags&14680064),q!==null?B=Va(q,B):(B=Yo(B,U,f,null),B.flags|=2),B.return=c,y.return=c,y.sibling=B,c.child=y,y=B,B=c.child,U=a.child.memoizedState,U=U===null?E1(f):{baseLanes:U.baseLanes|f,cachePool:null,transitions:U.transitions},B.memoizedState=U,B.childLanes=a.childLanes&~f,c.memoizedState=y1,y}return B=a.child,a=B.sibling,y=Va(B,{mode:"visible",children:y.children}),!(c.mode&1)&&(y.lanes=f),y.return=c,y.sibling=null,a!==null&&(f=c.deletions,f===null?(c.deletions=[a],c.flags|=16):f.push(a)),c.child=y,c.memoizedState=null,y}function x1(a,c){return c=Cp({mode:"visible",children:c},a.mode,0,null),c.return=a,a.child=c}function dp(a,c,f,y){return y!==null&&X0(y),Tc(c,a.child,null,f),a=x1(c,c.pendingProps.children),a.flags|=2,c.memoizedState=null,a}function MQ(a,c,f,y,C,B,U){if(f)return c.flags&256?(c.flags&=-257,y=g1(Error(t(422))),dp(a,c,U,y)):c.memoizedState!==null?(c.child=a.child,c.flags|=128,null):(B=y.fallback,C=c.mode,y=Cp({mode:"visible",children:y.children},C,0,null),B=Yo(B,C,U,null),B.flags|=2,y.return=c,B.return=c,y.sibling=B,c.child=y,c.mode&1&&Tc(c,a.child,null,U),c.child.memoizedState=E1(U),c.memoizedState=y1,B);if(!(c.mode&1))return dp(a,c,U,null);if(C.data==="$!"){if(y=C.nextSibling&&C.nextSibling.dataset,y)var q=y.dgst;return y=q,B=Error(t(419)),y=g1(B,y,void 0),dp(a,c,U,y)}if(q=(U&a.childLanes)!==0,kn||q){if(y=Wr,y!==null){switch(U&-U){case 4:C=2;break;case 16:C=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:C=32;break;case 536870912:C=268435456;break;default:C=0}C=C&(y.suspendedLanes|U)?0:C,C!==0&&C!==B.retryLane&&(B.retryLane=C,Hs(a,C),Hi(y,a,C,-1))}return Q1(),y=g1(Error(t(421))),dp(a,c,U,y)}return C.data==="$?"?(c.flags|=128,c.child=a.child,c=OQ.bind(null,a),C._reactRetry=c,null):(a=B.treeContext,ti=La(C.nextSibling),ei=c,tr=!0,Qi=null,a!==null&&(Ai[gi++]=Fs,Ai[gi++]=zs,Ai[gi++]=Qo,Fs=a.id,zs=a.overflow,Qo=c),c=x1(c,y.children),c.flags|=4096,c)}function h3(a,c,f){a.lanes|=c;var y=a.alternate;y!==null&&(y.lanes|=c),$0(a.return,c,f)}function w1(a,c,f,y,C){var B=a.memoizedState;B===null?a.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:y,tail:f,tailMode:C}:(B.isBackwards=c,B.rendering=null,B.renderingStartTime=0,B.last=y,B.tail=f,B.tailMode=C)}function d3(a,c,f){var y=c.pendingProps,C=y.revealOrder,B=y.tail;if(_n(a,c,y.children,f),y=ar.current,y&2)y=y&1|2,c.flags|=128;else{if(a!==null&&a.flags&128)e:for(a=c.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&h3(a,f,c);else if(a.tag===19)h3(a,f,c);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===c)break e;for(;a.sibling===null;){if(a.return===null||a.return===c)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}y&=1}if(Wt(ar,y),!(c.mode&1))c.memoizedState=null;else switch(C){case"forwards":for(f=c.child,C=null;f!==null;)a=f.alternate,a!==null&&ap(a)===null&&(C=f),f=f.sibling;f=C,f===null?(C=c.child,c.child=null):(C=f.sibling,f.sibling=null),w1(c,!1,C,f,B);break;case"backwards":for(f=null,C=c.child,c.child=null;C!==null;){if(a=C.alternate,a!==null&&ap(a)===null){c.child=C;break}a=C.sibling,C.sibling=f,f=C,C=a}w1(c,!0,f,null,B);break;case"together":w1(c,!1,null,null,void 0);break;default:c.memoizedState=null}return c.child}function fp(a,c){!(c.mode&1)&&a!==null&&(a.alternate=null,c.alternate=null,c.flags|=2)}function Vs(a,c,f){if(a!==null&&(c.dependencies=a.dependencies),Go|=c.lanes,!(f&c.childLanes))return null;if(a!==null&&c.child!==a.child)throw Error(t(153));if(c.child!==null){for(a=c.child,f=Va(a,a.pendingProps),c.child=f,f.return=c;a.sibling!==null;)a=a.sibling,f=f.sibling=Va(a,a.pendingProps),f.return=c;f.sibling=null}return c.child}function SQ(a,c,f){switch(c.tag){case 3:l3(c),Cc();break;case 5:BM(c);break;case 1:Pn(c.type)&&Xf(c);break;case 4:i1(c,c.stateNode.containerInfo);break;case 10:var y=c.type._context,C=c.memoizedProps.value;Wt(ep,y._currentValue),y._currentValue=C;break;case 13:if(y=c.memoizedState,y!==null)return y.dehydrated!==null?(Wt(ar,ar.current&1),c.flags|=128,null):f&c.child.childLanes?u3(a,c,f):(Wt(ar,ar.current&1),a=Vs(a,c,f),a!==null?a.sibling:null);Wt(ar,ar.current&1);break;case 19:if(y=(f&c.childLanes)!==0,a.flags&128){if(y)return d3(a,c,f);c.flags|=128}if(C=c.memoizedState,C!==null&&(C.rendering=null,C.tail=null,C.lastEffect=null),Wt(ar,ar.current),y)break;return null;case 22:case 23:return c.lanes=0,s3(a,c,f)}return Vs(a,c,f)}var f3,I1,p3,A3;f3=function(a,c){for(var f=c.child;f!==null;){if(f.tag===5||f.tag===6)a.appendChild(f.stateNode);else if(f.tag!==4&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===c)break;for(;f.sibling===null;){if(f.return===null||f.return===c)return;f=f.return}f.sibling.return=f.return,f=f.sibling}},I1=function(){},p3=function(a,c,f,y){var C=a.memoizedProps;if(C!==y){a=c.stateNode,zo(os.current);var B=null;switch(f){case"input":C=ct(a,C),y=ct(a,y),B=[];break;case"select":C=Q({},C,{value:void 0}),y=Q({},y,{value:void 0}),B=[];break;case"textarea":C=ye(a,C),y=ye(a,y),B=[];break;default:typeof C.onClick!="function"&&typeof y.onClick=="function"&&(a.onclick=Wf)}ht(f,y);var U;f=null;for(ce in C)if(!y.hasOwnProperty(ce)&&C.hasOwnProperty(ce)&&C[ce]!=null)if(ce==="style"){var q=C[ce];for(U in q)q.hasOwnProperty(U)&&(f||(f={}),f[U]="")}else ce!=="dangerouslySetInnerHTML"&&ce!=="children"&&ce!=="suppressContentEditableWarning"&&ce!=="suppressHydrationWarning"&&ce!=="autoFocus"&&(i.hasOwnProperty(ce)?B||(B=[]):(B=B||[]).push(ce,null));for(ce in y){var J=y[ce];if(q=C!=null?C[ce]:void 0,y.hasOwnProperty(ce)&&J!==q&&(J!=null||q!=null))if(ce==="style")if(q){for(U in q)!q.hasOwnProperty(U)||J&&J.hasOwnProperty(U)||(f||(f={}),f[U]="");for(U in J)J.hasOwnProperty(U)&&q[U]!==J[U]&&(f||(f={}),f[U]=J[U])}else f||(B||(B=[]),B.push(ce,f)),f=J;else ce==="dangerouslySetInnerHTML"?(J=J?J.__html:void 0,q=q?q.__html:void 0,J!=null&&q!==J&&(B=B||[]).push(ce,J)):ce==="children"?typeof J!="string"&&typeof J!="number"||(B=B||[]).push(ce,""+J):ce!=="suppressContentEditableWarning"&&ce!=="suppressHydrationWarning"&&(i.hasOwnProperty(ce)?(J!=null&&ce==="onScroll"&&Xt("scroll",a),B||q===J||(B=[])):(B=B||[]).push(ce,J))}f&&(B=B||[]).push("style",f);var ce=B;(c.updateQueue=ce)&&(c.flags|=4)}},A3=function(a,c,f,y){f!==y&&(c.flags|=4)};function Th(a,c){if(!tr)switch(a.tailMode){case"hidden":c=a.tail;for(var f=null;c!==null;)c.alternate!==null&&(f=c),c=c.sibling;f===null?a.tail=null:f.sibling=null;break;case"collapsed":f=a.tail;for(var y=null;f!==null;)f.alternate!==null&&(y=f),f=f.sibling;y===null?c||a.tail===null?a.tail=null:a.tail.sibling=null:y.sibling=null}}function an(a){var c=a.alternate!==null&&a.alternate.child===a.child,f=0,y=0;if(c)for(var C=a.child;C!==null;)f|=C.lanes|C.childLanes,y|=C.subtreeFlags&14680064,y|=C.flags&14680064,C.return=a,C=C.sibling;else for(C=a.child;C!==null;)f|=C.lanes|C.childLanes,y|=C.subtreeFlags,y|=C.flags,C.return=a,C=C.sibling;return a.subtreeFlags|=y,a.childLanes=f,c}function TQ(a,c,f){var y=c.pendingProps;switch(W0(c),c.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return an(c),null;case 1:return Pn(c.type)&&qf(),an(c),null;case 3:return y=c.stateNode,Bc(),Kt(Un),Kt(nn),o1(),y.pendingContext&&(y.context=y.pendingContext,y.pendingContext=null),(a===null||a.child===null)&&($f(c)?c.flags|=4:a===null||a.memoizedState.isDehydrated&&!(c.flags&256)||(c.flags|=1024,Qi!==null&&(U1(Qi),Qi=null))),I1(a,c),an(c),null;case 5:s1(c);var C=zo(wh.current);if(f=c.type,a!==null&&c.stateNode!=null)p3(a,c,f,y,C),a.ref!==c.ref&&(c.flags|=512,c.flags|=2097152);else{if(!y){if(c.stateNode===null)throw Error(t(166));return an(c),null}if(a=zo(os.current),$f(c)){y=c.stateNode,f=c.type;var B=c.memoizedProps;switch(y[as]=c,y[vh]=B,a=(c.mode&1)!==0,f){case"dialog":Xt("cancel",y),Xt("close",y);break;case"iframe":case"object":case"embed":Xt("load",y);break;case"video":case"audio":for(C=0;C<Ah.length;C++)Xt(Ah[C],y);break;case"source":Xt("error",y);break;case"img":case"image":case"link":Xt("error",y),Xt("load",y);break;case"details":Xt("toggle",y);break;case"input":Ke(y,B),Xt("invalid",y);break;case"select":y._wrapperState={wasMultiple:!!B.multiple},Xt("invalid",y);break;case"textarea":He(y,B),Xt("invalid",y)}ht(f,B),C=null;for(var U in B)if(B.hasOwnProperty(U)){var q=B[U];U==="children"?typeof q=="string"?y.textContent!==q&&(B.suppressHydrationWarning!==!0&&jf(y.textContent,q,a),C=["children",q]):typeof q=="number"&&y.textContent!==""+q&&(B.suppressHydrationWarning!==!0&&jf(y.textContent,q,a),C=["children",""+q]):i.hasOwnProperty(U)&&q!=null&&U==="onScroll"&&Xt("scroll",y)}switch(f){case"input":se(y),k(y,B,!0);break;case"textarea":se(y),je(y);break;case"select":case"option":break;default:typeof B.onClick=="function"&&(y.onclick=Wf)}y=C,c.updateQueue=y,y!==null&&(c.flags|=4)}else{U=C.nodeType===9?C:C.ownerDocument,a==="http://www.w3.org/1999/xhtml"&&(a=Ge(f)),a==="http://www.w3.org/1999/xhtml"?f==="script"?(a=U.createElement("div"),a.innerHTML="<script><\/script>",a=a.removeChild(a.firstChild)):typeof y.is=="string"?a=U.createElement(f,{is:y.is}):(a=U.createElement(f),f==="select"&&(U=a,y.multiple?U.multiple=!0:y.size&&(U.size=y.size))):a=U.createElementNS(a,f),a[as]=c,a[vh]=y,f3(a,c,!1,!1),c.stateNode=a;e:{switch(U=H(f,y),f){case"dialog":Xt("cancel",a),Xt("close",a),C=y;break;case"iframe":case"object":case"embed":Xt("load",a),C=y;break;case"video":case"audio":for(C=0;C<Ah.length;C++)Xt(Ah[C],a);C=y;break;case"source":Xt("error",a),C=y;break;case"img":case"image":case"link":Xt("error",a),Xt("load",a),C=y;break;case"details":Xt("toggle",a),C=y;break;case"input":Ke(a,y),C=ct(a,y),Xt("invalid",a);break;case"option":C=y;break;case"select":a._wrapperState={wasMultiple:!!y.multiple},C=Q({},y,{value:void 0}),Xt("invalid",a);break;case"textarea":He(a,y),C=ye(a,y),Xt("invalid",a);break;default:C=y}ht(f,C),q=C;for(B in q)if(q.hasOwnProperty(B)){var J=q[B];B==="style"?dt(a,J):B==="dangerouslySetInnerHTML"?(J=J?J.__html:void 0,J!=null&&De(a,J)):B==="children"?typeof J=="string"?(f!=="textarea"||J!=="")&&Be(a,J):typeof J=="number"&&Be(a,""+J):B!=="suppressContentEditableWarning"&&B!=="suppressHydrationWarning"&&B!=="autoFocus"&&(i.hasOwnProperty(B)?J!=null&&B==="onScroll"&&Xt("scroll",a):J!=null&&x(a,B,J,U))}switch(f){case"input":se(a),k(a,y,!1);break;case"textarea":se(a),je(a);break;case"option":y.value!=null&&a.setAttribute("value",""+Ee(y.value));break;case"select":a.multiple=!!y.multiple,B=y.value,B!=null?me(a,!!y.multiple,B,!1):y.defaultValue!=null&&me(a,!!y.multiple,y.defaultValue,!0);break;default:typeof C.onClick=="function"&&(a.onclick=Wf)}switch(f){case"button":case"input":case"select":case"textarea":y=!!y.autoFocus;break e;case"img":y=!0;break e;default:y=!1}}y&&(c.flags|=4)}c.ref!==null&&(c.flags|=512,c.flags|=2097152)}return an(c),null;case 6:if(a&&c.stateNode!=null)A3(a,c,a.memoizedProps,y);else{if(typeof y!="string"&&c.stateNode===null)throw Error(t(166));if(f=zo(wh.current),zo(os.current),$f(c)){if(y=c.stateNode,f=c.memoizedProps,y[as]=c,(B=y.nodeValue!==f)&&(a=ei,a!==null))switch(a.tag){case 3:jf(y.nodeValue,f,(a.mode&1)!==0);break;case 5:a.memoizedProps.suppressHydrationWarning!==!0&&jf(y.nodeValue,f,(a.mode&1)!==0)}B&&(c.flags|=4)}else y=(f.nodeType===9?f:f.ownerDocument).createTextNode(y),y[as]=c,c.stateNode=y}return an(c),null;case 13:if(Kt(ar),y=c.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(tr&&ti!==null&&c.mode&1&&!(c.flags&128))mM(),Cc(),c.flags|=98560,B=!1;else if(B=$f(c),y!==null&&y.dehydrated!==null){if(a===null){if(!B)throw Error(t(318));if(B=c.memoizedState,B=B!==null?B.dehydrated:null,!B)throw Error(t(317));B[as]=c}else Cc(),!(c.flags&128)&&(c.memoizedState=null),c.flags|=4;an(c),B=!1}else Qi!==null&&(U1(Qi),Qi=null),B=!0;if(!B)return c.flags&65536?c:null}return c.flags&128?(c.lanes=f,c):(y=y!==null,y!==(a!==null&&a.memoizedState!==null)&&y&&(c.child.flags|=8192,c.mode&1&&(a===null||ar.current&1?Ur===0&&(Ur=3):Q1())),c.updateQueue!==null&&(c.flags|=4),an(c),null);case 4:return Bc(),I1(a,c),a===null&&gh(c.stateNode.containerInfo),an(c),null;case 10:return Z0(c.type._context),an(c),null;case 17:return Pn(c.type)&&qf(),an(c),null;case 19:if(Kt(ar),B=c.memoizedState,B===null)return an(c),null;if(y=(c.flags&128)!==0,U=B.rendering,U===null)if(y)Th(B,!1);else{if(Ur!==0||a!==null&&a.flags&128)for(a=c.child;a!==null;){if(U=ap(a),U!==null){for(c.flags|=128,Th(B,!1),y=U.updateQueue,y!==null&&(c.updateQueue=y,c.flags|=4),c.subtreeFlags=0,y=f,f=c.child;f!==null;)B=f,a=y,B.flags&=14680066,U=B.alternate,U===null?(B.childLanes=0,B.lanes=a,B.child=null,B.subtreeFlags=0,B.memoizedProps=null,B.memoizedState=null,B.updateQueue=null,B.dependencies=null,B.stateNode=null):(B.childLanes=U.childLanes,B.lanes=U.lanes,B.child=U.child,B.subtreeFlags=0,B.deletions=null,B.memoizedProps=U.memoizedProps,B.memoizedState=U.memoizedState,B.updateQueue=U.updateQueue,B.type=U.type,a=U.dependencies,B.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),f=f.sibling;return Wt(ar,ar.current&1|2),c.child}a=a.sibling}B.tail!==null&&Xe()>Lc&&(c.flags|=128,y=!0,Th(B,!1),c.lanes=4194304)}else{if(!y)if(a=ap(U),a!==null){if(c.flags|=128,y=!0,f=a.updateQueue,f!==null&&(c.updateQueue=f,c.flags|=4),Th(B,!0),B.tail===null&&B.tailMode==="hidden"&&!U.alternate&&!tr)return an(c),null}else 2*Xe()-B.renderingStartTime>Lc&&f!==1073741824&&(c.flags|=128,y=!0,Th(B,!1),c.lanes=4194304);B.isBackwards?(U.sibling=c.child,c.child=U):(f=B.last,f!==null?f.sibling=U:c.child=U,B.last=U)}return B.tail!==null?(c=B.tail,B.rendering=c,B.tail=c.sibling,B.renderingStartTime=Xe(),c.sibling=null,f=ar.current,Wt(ar,y?f&1|2:f&1),c):(an(c),null);case 22:case 23:return k1(),y=c.memoizedState!==null,a!==null&&a.memoizedState!==null!==y&&(c.flags|=8192),y&&c.mode&1?ri&1073741824&&(an(c),c.subtreeFlags&6&&(c.flags|=8192)):an(c),null;case 24:return null;case 25:return null}throw Error(t(156,c.tag))}function BQ(a,c){switch(W0(c),c.tag){case 1:return Pn(c.type)&&qf(),a=c.flags,a&65536?(c.flags=a&-65537|128,c):null;case 3:return Bc(),Kt(Un),Kt(nn),o1(),a=c.flags,a&65536&&!(a&128)?(c.flags=a&-65537|128,c):null;case 5:return s1(c),null;case 13:if(Kt(ar),a=c.memoizedState,a!==null&&a.dehydrated!==null){if(c.alternate===null)throw Error(t(340));Cc()}return a=c.flags,a&65536?(c.flags=a&-65537|128,c):null;case 19:return Kt(ar),null;case 4:return Bc(),null;case 10:return Z0(c.type._context),null;case 22:case 23:return k1(),null;case 24:return null;default:return null}}var pp=!1,on=!1,bQ=typeof WeakSet=="function"?WeakSet:Set,Oe=null;function Rc(a,c){var f=a.ref;if(f!==null)if(typeof f=="function")try{f(null)}catch(y){pr(a,c,y)}else f.current=null}function C1(a,c,f){try{f()}catch(y){pr(a,c,y)}}var g3=!1;function RQ(a,c){if(k0=Nf,a=YC(),B0(a)){if("selectionStart"in a)var f={start:a.selectionStart,end:a.selectionEnd};else e:{f=(f=a.ownerDocument)&&f.defaultView||window;var y=f.getSelection&&f.getSelection();if(y&&y.rangeCount!==0){f=y.anchorNode;var C=y.anchorOffset,B=y.focusNode;y=y.focusOffset;try{f.nodeType,B.nodeType}catch{f=null;break e}var U=0,q=-1,J=-1,ce=0,we=0,Ce=a,xe=null;t:for(;;){for(var ke;Ce!==f||C!==0&&Ce.nodeType!==3||(q=U+C),Ce!==B||y!==0&&Ce.nodeType!==3||(J=U+y),Ce.nodeType===3&&(U+=Ce.nodeValue.length),(ke=Ce.firstChild)!==null;)xe=Ce,Ce=ke;for(;;){if(Ce===a)break t;if(xe===f&&++ce===C&&(q=U),xe===B&&++we===y&&(J=U),(ke=Ce.nextSibling)!==null)break;Ce=xe,xe=Ce.parentNode}Ce=ke}f=q===-1||J===-1?null:{start:q,end:J}}else f=null}f=f||{start:0,end:0}}else f=null;for(Q0={focusedElem:a,selectionRange:f},Nf=!1,Oe=c;Oe!==null;)if(c=Oe,a=c.child,(c.subtreeFlags&1028)!==0&&a!==null)a.return=c,Oe=a;else for(;Oe!==null;){c=Oe;try{var ze=c.alternate;if(c.flags&1024)switch(c.tag){case 0:case 11:case 15:break;case 1:if(ze!==null){var We=ze.memoizedProps,wr=ze.memoizedState,ie=c.stateNode,$=ie.getSnapshotBeforeUpdate(c.elementType===c.type?We:Oi(c.type,We),wr);ie.__reactInternalSnapshotBeforeUpdate=$}break;case 3:var ae=c.stateNode.containerInfo;ae.nodeType===1?ae.textContent="":ae.nodeType===9&&ae.documentElement&&ae.removeChild(ae.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(t(163))}}catch(Te){pr(c,c.return,Te)}if(a=c.sibling,a!==null){a.return=c.return,Oe=a;break}Oe=c.return}return ze=g3,g3=!1,ze}function Bh(a,c,f){var y=c.updateQueue;if(y=y!==null?y.lastEffect:null,y!==null){var C=y=y.next;do{if((C.tag&a)===a){var B=C.destroy;C.destroy=void 0,B!==void 0&&C1(c,f,B)}C=C.next}while(C!==y)}}function Ap(a,c){if(c=c.updateQueue,c=c!==null?c.lastEffect:null,c!==null){var f=c=c.next;do{if((f.tag&a)===a){var y=f.create;f.destroy=y()}f=f.next}while(f!==c)}}function M1(a){var c=a.ref;if(c!==null){var f=a.stateNode;switch(a.tag){case 5:a=f;break;default:a=f}typeof c=="function"?c(a):c.current=a}}function m3(a){var c=a.alternate;c!==null&&(a.alternate=null,m3(c)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(c=a.stateNode,c!==null&&(delete c[as],delete c[vh],delete c[H0],delete c[fQ],delete c[pQ])),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}function v3(a){return a.tag===5||a.tag===3||a.tag===4}function _3(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||v3(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function S1(a,c,f){var y=a.tag;if(y===5||y===6)a=a.stateNode,c?f.nodeType===8?f.parentNode.insertBefore(a,c):f.insertBefore(a,c):(f.nodeType===8?(c=f.parentNode,c.insertBefore(a,f)):(c=f,c.appendChild(a)),f=f._reactRootContainer,f!=null||c.onclick!==null||(c.onclick=Wf));else if(y!==4&&(a=a.child,a!==null))for(S1(a,c,f),a=a.sibling;a!==null;)S1(a,c,f),a=a.sibling}function T1(a,c,f){var y=a.tag;if(y===5||y===6)a=a.stateNode,c?f.insertBefore(a,c):f.appendChild(a);else if(y!==4&&(a=a.child,a!==null))for(T1(a,c,f),a=a.sibling;a!==null;)T1(a,c,f),a=a.sibling}var Kr=null,Fi=!1;function Oa(a,c,f){for(f=f.child;f!==null;)y3(a,c,f),f=f.sibling}function y3(a,c,f){if(tt&&typeof tt.onCommitFiberUnmount=="function")try{tt.onCommitFiberUnmount(jt,f)}catch{}switch(f.tag){case 5:on||Rc(f,c);case 6:var y=Kr,C=Fi;Kr=null,Oa(a,c,f),Kr=y,Fi=C,Kr!==null&&(Fi?(a=Kr,f=f.stateNode,a.nodeType===8?a.parentNode.removeChild(f):a.removeChild(f)):Kr.removeChild(f.stateNode));break;case 18:Kr!==null&&(Fi?(a=Kr,f=f.stateNode,a.nodeType===8?z0(a.parentNode,f):a.nodeType===1&&z0(a,f),oh(a)):z0(Kr,f.stateNode));break;case 4:y=Kr,C=Fi,Kr=f.stateNode.containerInfo,Fi=!0,Oa(a,c,f),Kr=y,Fi=C;break;case 0:case 11:case 14:case 15:if(!on&&(y=f.updateQueue,y!==null&&(y=y.lastEffect,y!==null))){C=y=y.next;do{var B=C,U=B.destroy;B=B.tag,U!==void 0&&(B&2||B&4)&&C1(f,c,U),C=C.next}while(C!==y)}Oa(a,c,f);break;case 1:if(!on&&(Rc(f,c),y=f.stateNode,typeof y.componentWillUnmount=="function"))try{y.props=f.memoizedProps,y.state=f.memoizedState,y.componentWillUnmount()}catch(q){pr(f,c,q)}Oa(a,c,f);break;case 21:Oa(a,c,f);break;case 22:f.mode&1?(on=(y=on)||f.memoizedState!==null,Oa(a,c,f),on=y):Oa(a,c,f);break;default:Oa(a,c,f)}}function E3(a){var c=a.updateQueue;if(c!==null){a.updateQueue=null;var f=a.stateNode;f===null&&(f=a.stateNode=new bQ),c.forEach(function(y){var C=FQ.bind(null,a,y);f.has(y)||(f.add(y),y.then(C,C))})}}function zi(a,c){var f=c.deletions;if(f!==null)for(var y=0;y<f.length;y++){var C=f[y];try{var B=a,U=c,q=U;e:for(;q!==null;){switch(q.tag){case 5:Kr=q.stateNode,Fi=!1;break e;case 3:Kr=q.stateNode.containerInfo,Fi=!0;break e;case 4:Kr=q.stateNode.containerInfo,Fi=!0;break e}q=q.return}if(Kr===null)throw Error(t(160));y3(B,U,C),Kr=null,Fi=!1;var J=C.alternate;J!==null&&(J.return=null),C.return=null}catch(ce){pr(C,c,ce)}}if(c.subtreeFlags&12854)for(c=c.child;c!==null;)x3(c,a),c=c.sibling}function x3(a,c){var f=a.alternate,y=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:if(zi(c,a),cs(a),y&4){try{Bh(3,a,a.return),Ap(3,a)}catch(We){pr(a,a.return,We)}try{Bh(5,a,a.return)}catch(We){pr(a,a.return,We)}}break;case 1:zi(c,a),cs(a),y&512&&f!==null&&Rc(f,f.return);break;case 5:if(zi(c,a),cs(a),y&512&&f!==null&&Rc(f,f.return),a.flags&32){var C=a.stateNode;try{Be(C,"")}catch(We){pr(a,a.return,We)}}if(y&4&&(C=a.stateNode,C!=null)){var B=a.memoizedProps,U=f!==null?f.memoizedProps:B,q=a.type,J=a.updateQueue;if(a.updateQueue=null,J!==null)try{q==="input"&&B.type==="radio"&&B.name!=null&&pt(C,B),H(q,U);var ce=H(q,B);for(U=0;U<J.length;U+=2){var we=J[U],Ce=J[U+1];we==="style"?dt(C,Ce):we==="dangerouslySetInnerHTML"?De(C,Ce):we==="children"?Be(C,Ce):x(C,we,Ce,ce)}switch(q){case"input":Y(C,B);break;case"textarea":Ie(C,B);break;case"select":var xe=C._wrapperState.wasMultiple;C._wrapperState.wasMultiple=!!B.multiple;var ke=B.value;ke!=null?me(C,!!B.multiple,ke,!1):xe!==!!B.multiple&&(B.defaultValue!=null?me(C,!!B.multiple,B.defaultValue,!0):me(C,!!B.multiple,B.multiple?[]:"",!1))}C[vh]=B}catch(We){pr(a,a.return,We)}}break;case 6:if(zi(c,a),cs(a),y&4){if(a.stateNode===null)throw Error(t(162));C=a.stateNode,B=a.memoizedProps;try{C.nodeValue=B}catch(We){pr(a,a.return,We)}}break;case 3:if(zi(c,a),cs(a),y&4&&f!==null&&f.memoizedState.isDehydrated)try{oh(c.containerInfo)}catch(We){pr(a,a.return,We)}break;case 4:zi(c,a),cs(a);break;case 13:zi(c,a),cs(a),C=a.child,C.flags&8192&&(B=C.memoizedState!==null,C.stateNode.isHidden=B,!B||C.alternate!==null&&C.alternate.memoizedState!==null||(R1=Xe())),y&4&&E3(a);break;case 22:if(we=f!==null&&f.memoizedState!==null,a.mode&1?(on=(ce=on)||we,zi(c,a),on=ce):zi(c,a),cs(a),y&8192){if(ce=a.memoizedState!==null,(a.stateNode.isHidden=ce)&&!we&&a.mode&1)for(Oe=a,we=a.child;we!==null;){for(Ce=Oe=we;Oe!==null;){switch(xe=Oe,ke=xe.child,xe.tag){case 0:case 11:case 14:case 15:Bh(4,xe,xe.return);break;case 1:Rc(xe,xe.return);var ze=xe.stateNode;if(typeof ze.componentWillUnmount=="function"){y=xe,f=xe.return;try{c=y,ze.props=c.memoizedProps,ze.state=c.memoizedState,ze.componentWillUnmount()}catch(We){pr(y,f,We)}}break;case 5:Rc(xe,xe.return);break;case 22:if(xe.memoizedState!==null){C3(Ce);continue}}ke!==null?(ke.return=xe,Oe=ke):C3(Ce)}we=we.sibling}e:for(we=null,Ce=a;;){if(Ce.tag===5){if(we===null){we=Ce;try{C=Ce.stateNode,ce?(B=C.style,typeof B.setProperty=="function"?B.setProperty("display","none","important"):B.display="none"):(q=Ce.stateNode,J=Ce.memoizedProps.style,U=J!=null&&J.hasOwnProperty("display")?J.display:null,q.style.display=lt("display",U))}catch(We){pr(a,a.return,We)}}}else if(Ce.tag===6){if(we===null)try{Ce.stateNode.nodeValue=ce?"":Ce.memoizedProps}catch(We){pr(a,a.return,We)}}else if((Ce.tag!==22&&Ce.tag!==23||Ce.memoizedState===null||Ce===a)&&Ce.child!==null){Ce.child.return=Ce,Ce=Ce.child;continue}if(Ce===a)break e;for(;Ce.sibling===null;){if(Ce.return===null||Ce.return===a)break e;we===Ce&&(we=null),Ce=Ce.return}we===Ce&&(we=null),Ce.sibling.return=Ce.return,Ce=Ce.sibling}}break;case 19:zi(c,a),cs(a),y&4&&E3(a);break;case 21:break;default:zi(c,a),cs(a)}}function cs(a){var c=a.flags;if(c&2){try{e:{for(var f=a.return;f!==null;){if(v3(f)){var y=f;break e}f=f.return}throw Error(t(160))}switch(y.tag){case 5:var C=y.stateNode;y.flags&32&&(Be(C,""),y.flags&=-33);var B=_3(a);T1(a,B,C);break;case 3:case 4:var U=y.stateNode.containerInfo,q=_3(a);S1(a,q,U);break;default:throw Error(t(161))}}catch(J){pr(a,a.return,J)}a.flags&=-3}c&4096&&(a.flags&=-4097)}function DQ(a,c,f){Oe=a,w3(a)}function w3(a,c,f){for(var y=(a.mode&1)!==0;Oe!==null;){var C=Oe,B=C.child;if(C.tag===22&&y){var U=C.memoizedState!==null||pp;if(!U){var q=C.alternate,J=q!==null&&q.memoizedState!==null||on;q=pp;var ce=on;if(pp=U,(on=J)&&!ce)for(Oe=C;Oe!==null;)U=Oe,J=U.child,U.tag===22&&U.memoizedState!==null?M3(C):J!==null?(J.return=U,Oe=J):M3(C);for(;B!==null;)Oe=B,w3(B),B=B.sibling;Oe=C,pp=q,on=ce}I3(a)}else C.subtreeFlags&8772&&B!==null?(B.return=C,Oe=B):I3(a)}}function I3(a){for(;Oe!==null;){var c=Oe;if(c.flags&8772){var f=c.alternate;try{if(c.flags&8772)switch(c.tag){case 0:case 11:case 15:on||Ap(5,c);break;case 1:var y=c.stateNode;if(c.flags&4&&!on)if(f===null)y.componentDidMount();else{var C=c.elementType===c.type?f.memoizedProps:Oi(c.type,f.memoizedProps);y.componentDidUpdate(C,f.memoizedState,y.__reactInternalSnapshotBeforeUpdate)}var B=c.updateQueue;B!==null&&EM(c,B,y);break;case 3:var U=c.updateQueue;if(U!==null){if(f=null,c.child!==null)switch(c.child.tag){case 5:f=c.child.stateNode;break;case 1:f=c.child.stateNode}EM(c,U,f)}break;case 5:var q=c.stateNode;if(f===null&&c.flags&4){f=q;var J=c.memoizedProps;switch(c.type){case"button":case"input":case"select":case"textarea":J.autoFocus&&f.focus();break;case"img":J.src&&(f.src=J.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(c.memoizedState===null){var ce=c.alternate;if(ce!==null){var we=ce.memoizedState;if(we!==null){var Ce=we.dehydrated;Ce!==null&&oh(Ce)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(t(163))}on||c.flags&512&&M1(c)}catch(xe){pr(c,c.return,xe)}}if(c===a){Oe=null;break}if(f=c.sibling,f!==null){f.return=c.return,Oe=f;break}Oe=c.return}}function C3(a){for(;Oe!==null;){var c=Oe;if(c===a){Oe=null;break}var f=c.sibling;if(f!==null){f.return=c.return,Oe=f;break}Oe=c.return}}function M3(a){for(;Oe!==null;){var c=Oe;try{switch(c.tag){case 0:case 11:case 15:var f=c.return;try{Ap(4,c)}catch(J){pr(c,f,J)}break;case 1:var y=c.stateNode;if(typeof y.componentDidMount=="function"){var C=c.return;try{y.componentDidMount()}catch(J){pr(c,C,J)}}var B=c.return;try{M1(c)}catch(J){pr(c,B,J)}break;case 5:var U=c.return;try{M1(c)}catch(J){pr(c,U,J)}}}catch(J){pr(c,c.return,J)}if(c===a){Oe=null;break}var q=c.sibling;if(q!==null){q.return=c.return,Oe=q;break}Oe=c.return}}var LQ=Math.ceil,gp=I.ReactCurrentDispatcher,B1=I.ReactCurrentOwner,_i=I.ReactCurrentBatchConfig,St=0,Wr=null,Tr=null,Jr=0,ri=0,Dc=Na(0),Ur=0,bh=null,Go=0,mp=0,b1=0,Rh=null,Qn=null,R1=0,Lc=1/0,js=null,vp=!1,D1=null,Fa=null,_p=!1,za=null,yp=0,Dh=0,L1=null,Ep=-1,xp=0;function yn(){return St&6?Xe():Ep!==-1?Ep:Ep=Xe()}function Ha(a){return a.mode&1?St&2&&Jr!==0?Jr&-Jr:gQ.transition!==null?(xp===0&&(xp=th()),xp):(a=kt,a!==0||(a=window.event,a=a===void 0?16:SC(a.type)),a):1}function Hi(a,c,f,y){if(50<Dh)throw Dh=0,L1=null,Error(t(185));rh(a,f,y),(!(St&2)||a!==Wr)&&(a===Wr&&(!(St&2)&&(mp|=f),Ur===4&&Ga(a,Jr)),On(a,y),f===1&&St===0&&!(c.mode&1)&&(Lc=Xe()+500,Kf&&Pa()))}function On(a,c){var f=a.callbackNode;$u(a,c);var y=Ma(a,a===Wr?Jr:0);if(y===0)f!==null&&Je(f),a.callbackNode=null,a.callbackPriority=0;else if(c=y&-y,a.callbackPriority!==c){if(f!=null&&Je(f),c===1)a.tag===0?AQ(T3.bind(null,a)):dM(T3.bind(null,a)),hQ(function(){!(St&6)&&Pa()}),f=null;else{switch(_C(y)){case 1:f=ft;break;case 4:f=Lr;break;case 16:f=er;break;case 536870912:f=pi;break;default:f=er}f=P3(f,S3.bind(null,a))}a.callbackPriority=c,a.callbackNode=f}}function S3(a,c){if(Ep=-1,xp=0,St&6)throw Error(t(327));var f=a.callbackNode;if(Nc()&&a.callbackNode!==f)return null;var y=Ma(a,a===Wr?Jr:0);if(y===0)return null;if(y&30||y&a.expiredLanes||c)c=wp(a,y);else{c=y;var C=St;St|=2;var B=b3();(Wr!==a||Jr!==c)&&(js=null,Lc=Xe()+500,jo(a,c));do try{PQ();break}catch(q){B3(a,q)}while(1);J0(),gp.current=B,St=C,Tr!==null?c=0:(Wr=null,Jr=0,c=Ur)}if(c!==0){if(c===2&&(C=eh(a),C!==0&&(y=C,c=N1(a,C))),c===1)throw f=bh,jo(a,0),Ga(a,y),On(a,Xe()),f;if(c===6)Ga(a,y);else{if(C=a.current.alternate,!(y&30)&&!NQ(C)&&(c=wp(a,y),c===2&&(B=eh(a),B!==0&&(y=B,c=N1(a,B))),c===1))throw f=bh,jo(a,0),Ga(a,y),On(a,Xe()),f;switch(a.finishedWork=C,a.finishedLanes=y,c){case 0:case 1:throw Error(t(345));case 2:Wo(a,Qn,js);break;case 3:if(Ga(a,y),(y&130023424)===y&&(c=R1+500-Xe(),10<c)){if(Ma(a,0)!==0)break;if(C=a.suspendedLanes,(C&y)!==y){yn(),a.pingedLanes|=a.suspendedLanes&C;break}a.timeoutHandle=F0(Wo.bind(null,a,Qn,js),c);break}Wo(a,Qn,js);break;case 4:if(Ga(a,y),(y&4194240)===y)break;for(c=a.eventTimes,C=-1;0<y;){var U=31-vn(y);B=1<<U,U=c[U],U>C&&(C=U),y&=~B}if(y=C,y=Xe()-y,y=(120>y?120:480>y?480:1080>y?1080:1920>y?1920:3e3>y?3e3:4320>y?4320:1960*LQ(y/1960))-y,10<y){a.timeoutHandle=F0(Wo.bind(null,a,Qn,js),y);break}Wo(a,Qn,js);break;case 5:Wo(a,Qn,js);break;default:throw Error(t(329))}}}return On(a,Xe()),a.callbackNode===f?S3.bind(null,a):null}function N1(a,c){var f=Rh;return a.current.memoizedState.isDehydrated&&(jo(a,c).flags|=256),a=wp(a,c),a!==2&&(c=Qn,Qn=f,c!==null&&U1(c)),a}function U1(a){Qn===null?Qn=a:Qn.push.apply(Qn,a)}function NQ(a){for(var c=a;;){if(c.flags&16384){var f=c.updateQueue;if(f!==null&&(f=f.stores,f!==null))for(var y=0;y<f.length;y++){var C=f[y],B=C.getSnapshot;C=C.value;try{if(!ki(B(),C))return!1}catch{return!1}}}if(f=c.child,c.subtreeFlags&16384&&f!==null)f.return=c,c=f;else{if(c===a)break;for(;c.sibling===null;){if(c.return===null||c.return===a)return!0;c=c.return}c.sibling.return=c.return,c=c.sibling}}return!0}function Ga(a,c){for(c&=~b1,c&=~mp,a.suspendedLanes|=c,a.pingedLanes&=~c,a=a.expirationTimes;0<c;){var f=31-vn(c),y=1<<f;a[f]=-1,c&=~y}}function T3(a){if(St&6)throw Error(t(327));Nc();var c=Ma(a,0);if(!(c&1))return On(a,Xe()),null;var f=wp(a,c);if(a.tag!==0&&f===2){var y=eh(a);y!==0&&(c=y,f=N1(a,y))}if(f===1)throw f=bh,jo(a,0),Ga(a,c),On(a,Xe()),f;if(f===6)throw Error(t(345));return a.finishedWork=a.current.alternate,a.finishedLanes=c,Wo(a,Qn,js),On(a,Xe()),null}function P1(a,c){var f=St;St|=1;try{return a(c)}finally{St=f,St===0&&(Lc=Xe()+500,Kf&&Pa())}}function Vo(a){za!==null&&za.tag===0&&!(St&6)&&Nc();var c=St;St|=1;var f=_i.transition,y=kt;try{if(_i.transition=null,kt=1,a)return a()}finally{kt=y,_i.transition=f,St=c,!(St&6)&&Pa()}}function k1(){ri=Dc.current,Kt(Dc)}function jo(a,c){a.finishedWork=null,a.finishedLanes=0;var f=a.timeoutHandle;if(f!==-1&&(a.timeoutHandle=-1,uQ(f)),Tr!==null)for(f=Tr.return;f!==null;){var y=f;switch(W0(y),y.tag){case 1:y=y.type.childContextTypes,y!=null&&qf();break;case 3:Bc(),Kt(Un),Kt(nn),o1();break;case 5:s1(y);break;case 4:Bc();break;case 13:Kt(ar);break;case 19:Kt(ar);break;case 10:Z0(y.type._context);break;case 22:case 23:k1()}f=f.return}if(Wr=a,Tr=a=Va(a.current,null),Jr=ri=c,Ur=0,bh=null,b1=mp=Go=0,Qn=Rh=null,Fo!==null){for(c=0;c<Fo.length;c++)if(f=Fo[c],y=f.interleaved,y!==null){f.interleaved=null;var C=y.next,B=f.pending;if(B!==null){var U=B.next;B.next=C,y.next=U}f.pending=y}Fo=null}return a}function B3(a,c){do{var f=Tr;try{if(J0(),op.current=hp,lp){for(var y=or.memoizedState;y!==null;){var C=y.queue;C!==null&&(C.pending=null),y=y.next}lp=!1}if(Ho=0,jr=Nr=or=null,Ih=!1,Ch=0,B1.current=null,f===null||f.return===null){Ur=1,bh=c,Tr=null;break}e:{var B=a,U=f.return,q=f,J=c;if(c=Jr,q.flags|=32768,J!==null&&typeof J=="object"&&typeof J.then=="function"){var ce=J,we=q,Ce=we.tag;if(!(we.mode&1)&&(Ce===0||Ce===11||Ce===15)){var xe=we.alternate;xe?(we.updateQueue=xe.updateQueue,we.memoizedState=xe.memoizedState,we.lanes=xe.lanes):(we.updateQueue=null,we.memoizedState=null)}var ke=e3(U);if(ke!==null){ke.flags&=-257,t3(ke,U,q,B,c),ke.mode&1&&$M(B,ce,c),c=ke,J=ce;var ze=c.updateQueue;if(ze===null){var We=new Set;We.add(J),c.updateQueue=We}else ze.add(J);break e}else{if(!(c&1)){$M(B,ce,c),Q1();break e}J=Error(t(426))}}else if(tr&&q.mode&1){var wr=e3(U);if(wr!==null){!(wr.flags&65536)&&(wr.flags|=256),t3(wr,U,q,B,c),X0(bc(J,q));break e}}B=J=bc(J,q),Ur!==4&&(Ur=2),Rh===null?Rh=[B]:Rh.push(B),B=U;do{switch(B.tag){case 3:B.flags|=65536,c&=-c,B.lanes|=c;var ie=JM(B,J,c);yM(B,ie);break e;case 1:q=J;var $=B.type,ae=B.stateNode;if(!(B.flags&128)&&(typeof $.getDerivedStateFromError=="function"||ae!==null&&typeof ae.componentDidCatch=="function"&&(Fa===null||!Fa.has(ae)))){B.flags|=65536,c&=-c,B.lanes|=c;var Te=ZM(B,q,c);yM(B,Te);break e}}B=B.return}while(B!==null)}D3(f)}catch(qe){c=qe,Tr===f&&f!==null&&(Tr=f=f.return);continue}break}while(1)}function b3(){var a=gp.current;return gp.current=hp,a===null?hp:a}function Q1(){(Ur===0||Ur===3||Ur===2)&&(Ur=4),Wr===null||!(Go&268435455)&&!(mp&268435455)||Ga(Wr,Jr)}function wp(a,c){var f=St;St|=2;var y=b3();(Wr!==a||Jr!==c)&&(js=null,jo(a,c));do try{UQ();break}catch(C){B3(a,C)}while(1);if(J0(),St=f,gp.current=y,Tr!==null)throw Error(t(261));return Wr=null,Jr=0,Ur}function UQ(){for(;Tr!==null;)R3(Tr)}function PQ(){for(;Tr!==null&&!it();)R3(Tr)}function R3(a){var c=U3(a.alternate,a,ri);a.memoizedProps=a.pendingProps,c===null?D3(a):Tr=c,B1.current=null}function D3(a){var c=a;do{var f=c.alternate;if(a=c.return,c.flags&32768){if(f=BQ(f,c),f!==null){f.flags&=32767,Tr=f;return}if(a!==null)a.flags|=32768,a.subtreeFlags=0,a.deletions=null;else{Ur=6,Tr=null;return}}else if(f=TQ(f,c,ri),f!==null){Tr=f;return}if(c=c.sibling,c!==null){Tr=c;return}Tr=c=a}while(c!==null);Ur===0&&(Ur=5)}function Wo(a,c,f){var y=kt,C=_i.transition;try{_i.transition=null,kt=1,kQ(a,c,f,y)}finally{_i.transition=C,kt=y}return null}function kQ(a,c,f,y){do Nc();while(za!==null);if(St&6)throw Error(t(327));f=a.finishedWork;var C=a.finishedLanes;if(f===null)return null;if(a.finishedWork=null,a.finishedLanes=0,f===a.current)throw Error(t(177));a.callbackNode=null,a.callbackPriority=0;var B=f.lanes|f.childLanes;if(mk(a,B),a===Wr&&(Tr=Wr=null,Jr=0),!(f.subtreeFlags&2064)&&!(f.flags&2064)||_p||(_p=!0,P3(er,function(){return Nc(),null})),B=(f.flags&15990)!==0,f.subtreeFlags&15990||B){B=_i.transition,_i.transition=null;var U=kt;kt=1;var q=St;St|=4,B1.current=null,RQ(a,f),x3(f,a),nQ(Q0),Nf=!!k0,Q0=k0=null,a.current=f,DQ(f),at(),St=q,kt=U,_i.transition=B}else a.current=f;if(_p&&(_p=!1,za=a,yp=C),B=a.pendingLanes,B===0&&(Fa=null),Zu(f.stateNode),On(a,Xe()),c!==null)for(y=a.onRecoverableError,f=0;f<c.length;f++)C=c[f],y(C.value,{componentStack:C.stack,digest:C.digest});if(vp)throw vp=!1,a=D1,D1=null,a;return yp&1&&a.tag!==0&&Nc(),B=a.pendingLanes,B&1?a===L1?Dh++:(Dh=0,L1=a):Dh=0,Pa(),null}function Nc(){if(za!==null){var a=_C(yp),c=_i.transition,f=kt;try{if(_i.transition=null,kt=16>a?16:a,za===null)var y=!1;else{if(a=za,za=null,yp=0,St&6)throw Error(t(331));var C=St;for(St|=4,Oe=a.current;Oe!==null;){var B=Oe,U=B.child;if(Oe.flags&16){var q=B.deletions;if(q!==null){for(var J=0;J<q.length;J++){var ce=q[J];for(Oe=ce;Oe!==null;){var we=Oe;switch(we.tag){case 0:case 11:case 15:Bh(8,we,B)}var Ce=we.child;if(Ce!==null)Ce.return=we,Oe=Ce;else for(;Oe!==null;){we=Oe;var xe=we.sibling,ke=we.return;if(m3(we),we===ce){Oe=null;break}if(xe!==null){xe.return=ke,Oe=xe;break}Oe=ke}}}var ze=B.alternate;if(ze!==null){var We=ze.child;if(We!==null){ze.child=null;do{var wr=We.sibling;We.sibling=null,We=wr}while(We!==null)}}Oe=B}}if(B.subtreeFlags&2064&&U!==null)U.return=B,Oe=U;else e:for(;Oe!==null;){if(B=Oe,B.flags&2048)switch(B.tag){case 0:case 11:case 15:Bh(9,B,B.return)}var ie=B.sibling;if(ie!==null){ie.return=B.return,Oe=ie;break e}Oe=B.return}}var $=a.current;for(Oe=$;Oe!==null;){U=Oe;var ae=U.child;if(U.subtreeFlags&2064&&ae!==null)ae.return=U,Oe=ae;else e:for(U=$;Oe!==null;){if(q=Oe,q.flags&2048)try{switch(q.tag){case 0:case 11:case 15:Ap(9,q)}}catch(qe){pr(q,q.return,qe)}if(q===U){Oe=null;break e}var Te=q.sibling;if(Te!==null){Te.return=q.return,Oe=Te;break e}Oe=q.return}}if(St=C,Pa(),tt&&typeof tt.onPostCommitFiberRoot=="function")try{tt.onPostCommitFiberRoot(jt,a)}catch{}y=!0}return y}finally{kt=f,_i.transition=c}}return!1}function L3(a,c,f){c=bc(f,c),c=JM(a,c,1),a=Qa(a,c,1),c=yn(),a!==null&&(rh(a,1,c),On(a,c))}function pr(a,c,f){if(a.tag===3)L3(a,a,f);else for(;c!==null;){if(c.tag===3){L3(c,a,f);break}else if(c.tag===1){var y=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof y.componentDidCatch=="function"&&(Fa===null||!Fa.has(y))){a=bc(f,a),a=ZM(c,a,1),c=Qa(c,a,1),a=yn(),c!==null&&(rh(c,1,a),On(c,a));break}}c=c.return}}function QQ(a,c,f){var y=a.pingCache;y!==null&&y.delete(c),c=yn(),a.pingedLanes|=a.suspendedLanes&f,Wr===a&&(Jr&f)===f&&(Ur===4||Ur===3&&(Jr&130023424)===Jr&&500>Xe()-R1?jo(a,0):b1|=f),On(a,c)}function N3(a,c){c===0&&(a.mode&1?(c=xr,xr<<=1,!(xr&130023424)&&(xr=4194304)):c=1);var f=yn();a=Hs(a,c),a!==null&&(rh(a,c,f),On(a,f))}function OQ(a){var c=a.memoizedState,f=0;c!==null&&(f=c.retryLane),N3(a,f)}function FQ(a,c){var f=0;switch(a.tag){case 13:var y=a.stateNode,C=a.memoizedState;C!==null&&(f=C.retryLane);break;case 19:y=a.stateNode;break;default:throw Error(t(314))}y!==null&&y.delete(c),N3(a,f)}var U3;U3=function(a,c,f){if(a!==null)if(a.memoizedProps!==c.pendingProps||Un.current)kn=!0;else{if(!(a.lanes&f)&&!(c.flags&128))return kn=!1,SQ(a,c,f);kn=!!(a.flags&131072)}else kn=!1,tr&&c.flags&1048576&&fM(c,Zf,c.index);switch(c.lanes=0,c.tag){case 2:var y=c.type;fp(a,c),a=c.pendingProps;var C=xc(c,nn.current);Sc(c,f),C=u1(null,c,y,a,C,f);var B=h1();return c.flags|=1,typeof C=="object"&&C!==null&&typeof C.render=="function"&&C.$$typeof===void 0?(c.tag=1,c.memoizedState=null,c.updateQueue=null,Pn(y)?(B=!0,Xf(c)):B=!1,c.memoizedState=C.state!==null&&C.state!==void 0?C.state:null,t1(c),C.updater=ip,c.stateNode=C,C._reactInternals=c,n1(c,y,a,f),c=_1(null,c,y,!0,B,f)):(c.tag=0,tr&&B&&j0(c),_n(null,c,C,f),c=c.child),c;case 16:y=c.elementType;e:{switch(fp(a,c),a=c.pendingProps,C=y._init,y=C(y._payload),c.type=y,C=c.tag=HQ(y),a=Oi(y,a),C){case 0:c=v1(null,c,y,a,f);break e;case 1:c=o3(null,c,y,a,f);break e;case 11:c=r3(null,c,y,a,f);break e;case 14:c=n3(null,c,y,Oi(y.type,a),f);break e}throw Error(t(306,y,""))}return c;case 0:return y=c.type,C=c.pendingProps,C=c.elementType===y?C:Oi(y,C),v1(a,c,y,C,f);case 1:return y=c.type,C=c.pendingProps,C=c.elementType===y?C:Oi(y,C),o3(a,c,y,C,f);case 3:e:{if(l3(c),a===null)throw Error(t(387));y=c.pendingProps,B=c.memoizedState,C=B.element,_M(a,c),np(c,y,null,f);var U=c.memoizedState;if(y=U.element,B.isDehydrated)if(B={element:y,isDehydrated:!1,cache:U.cache,pendingSuspenseBoundaries:U.pendingSuspenseBoundaries,transitions:U.transitions},c.updateQueue.baseState=B,c.memoizedState=B,c.flags&256){C=bc(Error(t(423)),c),c=c3(a,c,y,f,C);break e}else if(y!==C){C=bc(Error(t(424)),c),c=c3(a,c,y,f,C);break e}else for(ti=La(c.stateNode.containerInfo.firstChild),ei=c,tr=!0,Qi=null,f=TM(c,null,y,f),c.child=f;f;)f.flags=f.flags&-3|4096,f=f.sibling;else{if(Cc(),y===C){c=Vs(a,c,f);break e}_n(a,c,y,f)}c=c.child}return c;case 5:return BM(c),a===null&&q0(c),y=c.type,C=c.pendingProps,B=a!==null?a.memoizedProps:null,U=C.children,O0(y,C)?U=null:B!==null&&O0(y,B)&&(c.flags|=32),a3(a,c),_n(a,c,U,f),c.child;case 6:return a===null&&q0(c),null;case 13:return u3(a,c,f);case 4:return i1(c,c.stateNode.containerInfo),y=c.pendingProps,a===null?c.child=Tc(c,null,y,f):_n(a,c,y,f),c.child;case 11:return y=c.type,C=c.pendingProps,C=c.elementType===y?C:Oi(y,C),r3(a,c,y,C,f);case 7:return _n(a,c,c.pendingProps,f),c.child;case 8:return _n(a,c,c.pendingProps.children,f),c.child;case 12:return _n(a,c,c.pendingProps.children,f),c.child;case 10:e:{if(y=c.type._context,C=c.pendingProps,B=c.memoizedProps,U=C.value,Wt(ep,y._currentValue),y._currentValue=U,B!==null)if(ki(B.value,U)){if(B.children===C.children&&!Un.current){c=Vs(a,c,f);break e}}else for(B=c.child,B!==null&&(B.return=c);B!==null;){var q=B.dependencies;if(q!==null){U=B.child;for(var J=q.firstContext;J!==null;){if(J.context===y){if(B.tag===1){J=Gs(-1,f&-f),J.tag=2;var ce=B.updateQueue;if(ce!==null){ce=ce.shared;var we=ce.pending;we===null?J.next=J:(J.next=we.next,we.next=J),ce.pending=J}}B.lanes|=f,J=B.alternate,J!==null&&(J.lanes|=f),$0(B.return,f,c),q.lanes|=f;break}J=J.next}}else if(B.tag===10)U=B.type===c.type?null:B.child;else if(B.tag===18){if(U=B.return,U===null)throw Error(t(341));U.lanes|=f,q=U.alternate,q!==null&&(q.lanes|=f),$0(U,f,c),U=B.sibling}else U=B.child;if(U!==null)U.return=B;else for(U=B;U!==null;){if(U===c){U=null;break}if(B=U.sibling,B!==null){B.return=U.return,U=B;break}U=U.return}B=U}_n(a,c,C.children,f),c=c.child}return c;case 9:return C=c.type,y=c.pendingProps.children,Sc(c,f),C=mi(C),y=y(C),c.flags|=1,_n(a,c,y,f),c.child;case 14:return y=c.type,C=Oi(y,c.pendingProps),C=Oi(y.type,C),n3(a,c,y,C,f);case 15:return i3(a,c,c.type,c.pendingProps,f);case 17:return y=c.type,C=c.pendingProps,C=c.elementType===y?C:Oi(y,C),fp(a,c),c.tag=1,Pn(y)?(a=!0,Xf(c)):a=!1,Sc(c,f),IM(c,y,C),n1(c,y,C,f),_1(null,c,y,!0,a,f);case 19:return d3(a,c,f);case 22:return s3(a,c,f)}throw Error(t(156,c.tag))};function P3(a,c){return Re(a,c)}function zQ(a,c,f,y){this.tag=a,this.key=f,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=y,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function yi(a,c,f,y){return new zQ(a,c,f,y)}function O1(a){return a=a.prototype,!(!a||!a.isReactComponent)}function HQ(a){if(typeof a=="function")return O1(a)?1:0;if(a!=null){if(a=a.$$typeof,a===P)return 11;if(a===X)return 14}return 2}function Va(a,c){var f=a.alternate;return f===null?(f=yi(a.tag,c,a.key,a.mode),f.elementType=a.elementType,f.type=a.type,f.stateNode=a.stateNode,f.alternate=a,a.alternate=f):(f.pendingProps=c,f.type=a.type,f.flags=0,f.subtreeFlags=0,f.deletions=null),f.flags=a.flags&14680064,f.childLanes=a.childLanes,f.lanes=a.lanes,f.child=a.child,f.memoizedProps=a.memoizedProps,f.memoizedState=a.memoizedState,f.updateQueue=a.updateQueue,c=a.dependencies,f.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},f.sibling=a.sibling,f.index=a.index,f.ref=a.ref,f}function Ip(a,c,f,y,C,B){var U=2;if(y=a,typeof a=="function")O1(a)&&(U=1);else if(typeof a=="string")U=5;else e:switch(a){case T:return Yo(f.children,C,B,c);case D:U=8,C|=8;break;case b:return a=yi(12,f,c,C|2),a.elementType=b,a.lanes=B,a;case N:return a=yi(13,f,c,C),a.elementType=N,a.lanes=B,a;case W:return a=yi(19,f,c,C),a.elementType=W,a.lanes=B,a;case te:return Cp(f,C,B,c);default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case M:U=10;break e;case L:U=9;break e;case P:U=11;break e;case X:U=14;break e;case K:U=16,y=null;break e}throw Error(t(130,a==null?a:typeof a,""))}return c=yi(U,f,c,C),c.elementType=a,c.type=y,c.lanes=B,c}function Yo(a,c,f,y){return a=yi(7,a,y,c),a.lanes=f,a}function Cp(a,c,f,y){return a=yi(22,a,y,c),a.elementType=te,a.lanes=f,a.stateNode={isHidden:!1},a}function F1(a,c,f){return a=yi(6,a,null,c),a.lanes=f,a}function z1(a,c,f){return c=yi(4,a.children!==null?a.children:[],a.key,c),c.lanes=f,c.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},c}function GQ(a,c,f,y,C){this.tag=c,this.containerInfo=a,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=p0(0),this.expirationTimes=p0(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=p0(0),this.identifierPrefix=y,this.onRecoverableError=C,this.mutableSourceEagerHydrationData=null}function H1(a,c,f,y,C,B,U,q,J){return a=new GQ(a,c,f,q,J),c===1?(c=1,B===!0&&(c|=8)):c=0,B=yi(3,null,null,c),a.current=B,B.stateNode=a,B.memoizedState={element:y,isDehydrated:f,cache:null,transitions:null,pendingSuspenseBoundaries:null},t1(B),a}function VQ(a,c,f){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:S,key:y==null?null:""+y,children:a,containerInfo:c,implementation:f}}function k3(a){if(!a)return Ua;a=a._reactInternals;e:{if(Ps(a)!==a||a.tag!==1)throw Error(t(170));var c=a;do{switch(c.tag){case 3:c=c.stateNode.context;break e;case 1:if(Pn(c.type)){c=c.stateNode.__reactInternalMemoizedMergedChildContext;break e}}c=c.return}while(c!==null);throw Error(t(171))}if(a.tag===1){var f=a.type;if(Pn(f))return uM(a,f,c)}return c}function Q3(a,c,f,y,C,B,U,q,J){return a=H1(f,y,!0,a,C,B,U,q,J),a.context=k3(null),f=a.current,y=yn(),C=Ha(f),B=Gs(y,C),B.callback=c??null,Qa(f,B,C),a.current.lanes=C,rh(a,C,y),On(a,y),a}function Mp(a,c,f,y){var C=c.current,B=yn(),U=Ha(C);return f=k3(f),c.context===null?c.context=f:c.pendingContext=f,c=Gs(B,U),c.payload={element:a},y=y===void 0?null:y,y!==null&&(c.callback=y),a=Qa(C,c,U),a!==null&&(Hi(a,C,U,B),rp(a,C,U)),U}function Sp(a){if(a=a.current,!a.child)return null;switch(a.child.tag){case 5:return a.child.stateNode;default:return a.child.stateNode}}function O3(a,c){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var f=a.retryLane;a.retryLane=f!==0&&f<c?f:c}}function G1(a,c){O3(a,c),(a=a.alternate)&&O3(a,c)}function jQ(){return null}var F3=typeof reportError=="function"?reportError:function(a){console.error(a)};function V1(a){this._internalRoot=a}Tp.prototype.render=V1.prototype.render=function(a){var c=this._internalRoot;if(c===null)throw Error(t(409));Mp(a,c,null,null)},Tp.prototype.unmount=V1.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var c=a.containerInfo;Vo(function(){Mp(null,a,null,null)}),c[Qs]=null}};function Tp(a){this._internalRoot=a}Tp.prototype.unstable_scheduleHydration=function(a){if(a){var c=xC();a={blockedOn:null,target:a,priority:c};for(var f=0;f<ba.length&&c!==0&&c<ba[f].priority;f++);ba.splice(f,0,a),f===0&&CC(a)}};function j1(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function Bp(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11&&(a.nodeType!==8||a.nodeValue!==" react-mount-point-unstable "))}function z3(){}function WQ(a,c,f,y,C){if(C){if(typeof y=="function"){var B=y;y=function(){var ce=Sp(U);B.call(ce)}}var U=Q3(c,y,a,0,null,!1,!1,"",z3);return a._reactRootContainer=U,a[Qs]=U.current,gh(a.nodeType===8?a.parentNode:a),Vo(),U}for(;C=a.lastChild;)a.removeChild(C);if(typeof y=="function"){var q=y;y=function(){var ce=Sp(J);q.call(ce)}}var J=H1(a,0,!1,null,null,!1,!1,"",z3);return a._reactRootContainer=J,a[Qs]=J.current,gh(a.nodeType===8?a.parentNode:a),Vo(function(){Mp(c,J,f,y)}),J}function bp(a,c,f,y,C){var B=f._reactRootContainer;if(B){var U=B;if(typeof C=="function"){var q=C;C=function(){var J=Sp(U);q.call(J)}}Mp(c,U,a,C)}else U=WQ(f,c,a,C,y);return Sp(U)}yC=function(a){switch(a.tag){case 3:var c=a.stateNode;if(c.current.memoizedState.isDehydrated){var f=Ln(c.pendingLanes);f!==0&&(A0(c,f|1),On(c,Xe()),!(St&6)&&(Lc=Xe()+500,Pa()))}break;case 13:Vo(function(){var y=Hs(a,1);if(y!==null){var C=yn();Hi(y,a,1,C)}}),G1(a,1)}},g0=function(a){if(a.tag===13){var c=Hs(a,134217728);if(c!==null){var f=yn();Hi(c,a,134217728,f)}G1(a,134217728)}},EC=function(a){if(a.tag===13){var c=Ha(a),f=Hs(a,c);if(f!==null){var y=yn();Hi(f,a,c,y)}G1(a,c)}},xC=function(){return kt},wC=function(a,c){var f=kt;try{return kt=a,c()}finally{kt=f}},ve=function(a,c,f){switch(c){case"input":if(Y(a,f),c=f.name,f.type==="radio"&&c!=null){for(f=a;f.parentNode;)f=f.parentNode;for(f=f.querySelectorAll("input[name="+JSON.stringify(""+c)+'][type="radio"]'),c=0;c<f.length;c++){var y=f[c];if(y!==a&&y.form===a.form){var C=Yf(y);if(!C)throw Error(t(90));et(y),Y(y,C)}}}break;case"textarea":Ie(a,f);break;case"select":c=f.value,c!=null&&me(a,!!f.multiple,c,!1)}},Bt=P1,_t=Vo;var YQ={usingClientEntryPoint:!1,Events:[_h,yc,Yf,Lt,Nt,P1]},Lh={findFiberByHostInstance:Po,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},qQ={bundleType:Lh.bundleType,version:Lh.version,rendererPackageName:Lh.rendererPackageName,rendererConfig:Lh.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:I.ReactCurrentDispatcher,findHostInstanceByFiber:function(a){return a=he(a),a===null?null:a.stateNode},findFiberByHostInstance:Lh.findFiberByHostInstance||jQ,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Rp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Rp.isDisabled&&Rp.supportsFiber)try{jt=Rp.inject(qQ),tt=Rp}catch{}}return bn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=YQ,bn.createPortal=function(a,c){var f=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!j1(c))throw Error(t(200));return VQ(a,c,null,f)},bn.createRoot=function(a,c){if(!j1(a))throw Error(t(299));var f=!1,y="",C=F3;return c!=null&&(c.unstable_strictMode===!0&&(f=!0),c.identifierPrefix!==void 0&&(y=c.identifierPrefix),c.onRecoverableError!==void 0&&(C=c.onRecoverableError)),c=H1(a,1,!1,null,null,f,!1,y,C),a[Qs]=c.current,gh(a.nodeType===8?a.parentNode:a),new V1(c)},bn.findDOMNode=function(a){if(a==null)return null;if(a.nodeType===1)return a;var c=a._reactInternals;if(c===void 0)throw typeof a.render=="function"?Error(t(188)):(a=Object.keys(a).join(","),Error(t(268,a)));return a=he(c),a=a===null?null:a.stateNode,a},bn.flushSync=function(a){return Vo(a)},bn.hydrate=function(a,c,f){if(!Bp(c))throw Error(t(200));return bp(null,a,c,!0,f)},bn.hydrateRoot=function(a,c,f){if(!j1(a))throw Error(t(405));var y=f!=null&&f.hydratedSources||null,C=!1,B="",U=F3;if(f!=null&&(f.unstable_strictMode===!0&&(C=!0),f.identifierPrefix!==void 0&&(B=f.identifierPrefix),f.onRecoverableError!==void 0&&(U=f.onRecoverableError)),c=Q3(c,null,a,1,f??null,C,!1,B,U),a[Qs]=c.current,gh(a),y)for(a=0;a<y.length;a++)f=y[a],C=f._getVersion,C=C(f._source),c.mutableSourceEagerHydrationData==null?c.mutableSourceEagerHydrationData=[f,C]:c.mutableSourceEagerHydrationData.push(f,C);return new Tp(c)},bn.render=function(a,c,f){if(!Bp(c))throw Error(t(200));return bp(null,a,c,!1,f)},bn.unmountComponentAtNode=function(a){if(!Bp(a))throw Error(t(40));return a._reactRootContainer?(Vo(function(){bp(null,null,a,!1,function(){a._reactRootContainer=null,a[Qs]=null})}),!0):!1},bn.unstable_batchedUpdates=P1,bn.unstable_renderSubtreeIntoContainer=function(a,c,f,y){if(!Bp(f))throw Error(t(200));if(a==null||a._reactInternals===void 0)throw Error(t(38));return bp(a,c,f,!1,y)},bn.version="18.2.0-next-9e3b772b8-20220608",bn}function iC(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(iC)}catch(r){console.error(r)}}iC(),eC.exports=Z7();var $7=eC.exports,sC=$7;a0.createRoot=sC.createRoot,a0.hydrateRoot=sC.hydrateRoot;class ek{constructor({apiService:e,events:t}){Rt(this,"targetElement");Rt(this,"apiService");Rt(this,"events");Rt(this,"htmlTarget");this.apiService=e,this.events=t}mount(e,t){if(!this.targetElement){const n=t.customId??"dita-3dconfig-element",i=document.getElementById(n);if(!i)throw new Error(`Element not found with id => '${n}' `);this.htmlTarget=i,this.htmlTarget.style.height="100%",this.htmlTarget.style.width="100%",this.targetElement=a0.createRoot(document.getElementById(n))}this.targetElement.render(Nh.createElement(X7,{apiService:this.apiService,events:this.events,sku:e,viewerOnly:t.viewerOnly}))}unmount(){this.targetElement&&(this.targetElement.unmount(),this.targetElement=void 0,this.htmlTarget&&(this.htmlTarget.style.height="0px",this.htmlTarget.style.width="auto"))}}var c0={exports:{}},hc=typeof Reflect=="object"?Reflect:null,aC=hc&&typeof hc.apply=="function"?hc.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)},Tf;hc&&typeof hc.ownKeys=="function"?Tf=hc.ownKeys:Object.getOwnPropertySymbols?Tf=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Tf=function(e){return Object.getOwnPropertyNames(e)};function tk(r){console&&console.warn&&console.warn(r)}var oC=Number.isNaN||function(e){return e!==e};function Ot(){Ot.init.call(this)}c0.exports=Ot,c0.exports.once=sk,Ot.EventEmitter=Ot,Ot.prototype._events=void 0,Ot.prototype._eventsCount=0,Ot.prototype._maxListeners=void 0;var lC=10;function Bf(r){if(typeof r!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r)}Object.defineProperty(Ot,"defaultMaxListeners",{enumerable:!0,get:function(){return lC},set:function(r){if(typeof r!="number"||r<0||oC(r))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+r+".");lC=r}}),Ot.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},Ot.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||oC(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function cC(r){return r._maxListeners===void 0?Ot.defaultMaxListeners:r._maxListeners}Ot.prototype.getMaxListeners=function(){return cC(this)},Ot.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var i=e==="error",s=this._events;if(s!==void 0)i=i&&s.error===void 0;else if(!i)return!1;if(i){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var l=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw l.context=o,l}var h=s[e];if(h===void 0)return!1;if(typeof h=="function")aC(h,this,t);else for(var u=h.length,d=pC(h,u),n=0;n<u;++n)aC(d[n],this,t);return!0};function uC(r,e,t,n){var i,s,o;if(Bf(t),s=r._events,s===void 0?(s=r._events=Object.create(null),r._eventsCount=0):(s.newListener!==void 0&&(r.emit("newListener",e,t.listener?t.listener:t),s=r._events),o=s[e]),o===void 0)o=s[e]=t,++r._eventsCount;else if(typeof o=="function"?o=s[e]=n?[t,o]:[o,t]:n?o.unshift(t):o.push(t),i=cC(r),i>0&&o.length>i&&!o.warned){o.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=r,l.type=e,l.count=o.length,tk(l)}return r}Ot.prototype.addListener=function(e,t){return uC(this,e,t,!1)},Ot.prototype.on=Ot.prototype.addListener,Ot.prototype.prependListener=function(e,t){return uC(this,e,t,!0)};function rk(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function hC(r,e,t){var n={fired:!1,wrapFn:void 0,target:r,type:e,listener:t},i=rk.bind(n);return i.listener=t,n.wrapFn=i,i}Ot.prototype.once=function(e,t){return Bf(t),this.on(e,hC(this,e,t)),this},Ot.prototype.prependOnceListener=function(e,t){return Bf(t),this.prependListener(e,hC(this,e,t)),this},Ot.prototype.removeListener=function(e,t){var n,i,s,o,l;if(Bf(t),i=this._events,i===void 0)return this;if(n=i[e],n===void 0)return this;if(n===t||n.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,n.listener||t));else if(typeof n!="function"){for(s=-1,o=n.length-1;o>=0;o--)if(n[o]===t||n[o].listener===t){l=n[o].listener,s=o;break}if(s<0)return this;s===0?n.shift():nk(n,s),n.length===1&&(i[e]=n[0]),i.removeListener!==void 0&&this.emit("removeListener",e,l||t)}return this},Ot.prototype.off=Ot.prototype.removeListener,Ot.prototype.removeAllListeners=function(e){var t,n,i;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var s=Object.keys(n),o;for(i=0;i<s.length;++i)o=s[i],o!=="removeListener"&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(t=n[e],typeof t=="function")this.removeListener(e,t);else if(t!==void 0)for(i=t.length-1;i>=0;i--)this.removeListener(e,t[i]);return this};function dC(r,e,t){var n=r._events;if(n===void 0)return[];var i=n[e];return i===void 0?[]:typeof i=="function"?t?[i.listener||i]:[i]:t?ik(i):pC(i,i.length)}Ot.prototype.listeners=function(e){return dC(this,e,!0)},Ot.prototype.rawListeners=function(e){return dC(this,e,!1)},Ot.listenerCount=function(r,e){return typeof r.listenerCount=="function"?r.listenerCount(e):fC.call(r,e)},Ot.prototype.listenerCount=fC;function fC(r){var e=this._events;if(e!==void 0){var t=e[r];if(typeof t=="function")return 1;if(t!==void 0)return t.length}return 0}Ot.prototype.eventNames=function(){return this._eventsCount>0?Tf(this._events):[]};function pC(r,e){for(var t=new Array(e),n=0;n<e;++n)t[n]=r[n];return t}function nk(r,e){for(;e+1<r.length;e++)r[e]=r[e+1];r.pop()}function ik(r){for(var e=new Array(r.length),t=0;t<e.length;++t)e[t]=r[t].listener||r[t];return e}function sk(r,e){return new Promise(function(t,n){function i(o){r.removeListener(e,s),n(o)}function s(){typeof r.removeListener=="function"&&r.removeListener("error",i),t([].slice.call(arguments))}AC(r,e,s,{once:!0}),e!=="error"&&ak(r,i,{once:!0})})}function ak(r,e,t){typeof r.on=="function"&&AC(r,"error",e,t)}function AC(r,e,t,n){if(typeof r.on=="function")n.once?r.once(e,t):r.on(e,t);else if(typeof r.addEventListener=="function")r.addEventListener(e,function i(s){n.once&&r.removeEventListener(e,i),t(s)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof r)}var ok=c0.exports;const Ju=class Ju extends ok.EventEmitter{emitEvent(e,t){Object.keys(Ju.EVENTS).includes(e)&&this.emit(Ju.EVENTS[e],t)}};Rt(Ju,"EVENTS",{onAddToCart:"add-to-cart"});let u0=Ju;const lk={getCartUrl:((mC=window.Shopify)==null?void 0:mC.routes.root)+"cart.js",addToCartUrl:((vC=window.Shopify)==null?void 0:vC.routes.root)+"cart/add.js"},gC=Object.freeze(lk);class ck{constructor(e){Rt(this,"config");this.config=e}RequestOptions(e,t){return{method:e,headers:{Accept:"application/json","Content-Type":"application/json"},...e==="POST"&&{body:JSON.stringify(t)}}}async Get(){return(await fetch(this.config.getCartUrl,this.RequestOptions("GET"))).json()}async Post(e){return(await fetch(this.config.addToCartUrl,this.RequestOptions("POST",e||{}))).json()}}const{log:uk,error:hk}=console,dk=(...r)=>{hk("❌ Sprie Error:",...r)},fk="&ui_animations=0&ui_infos=0&ui_stop=0&ui_inspector=0&ui_watermark_link=0&ui_watermark=0&ui_ar=0&ui_help=0&ui_settings=0&ui_vr=0&ui_fullscreen=0&ui_annotations=0&ui_start=0&",pk={HOST:hs.host,STORE_PREFIX:hs.storePrefix},Ak={addToCartUrl:gC.addToCartUrl,getCartUrl:gC.getCartUrl};let h0=!1;class gk{constructor(){Rt(this,"sdkService");Rt(this,"apiService");Rt(this,"uiService");Rt(this,"events");this.events=new u0,this.apiService=new V3(new Wa(pk),new ck(Ak)),this.uiService=new ek({apiService:this.apiService,events:this.events});const e={apiService:this.apiService,config:hs,log:uk,logErr:dk,metaData:{appVersion:H3,previewUrlPrams:fk,targetClassName:"sprie-embed-element"}};this.sdkService=new j3(e),this.sdkService.Init().then(t=>{h0=t})}isReadyToLoad(){return h0}load(e,t){h0?this.loadOnAuth(e,t):this.waitForAllReady(this.isReadyToLoad,()=>this.loadOnAuth(e,t),e,t)}loadOnAuth(e,t){this.uiService.unmount(),this.uiService.mount(e,{viewerOnly:!1,customId:t})}loadViewerOnly(e,t){this.uiService.unmount(),this.uiService.mount(e,{viewerOnly:!0,customId:t})}unload(){this.uiService.unmount()}waitForAllReady(e,t,n,i){e()?t(n,i):setTimeout(()=>{this.waitForAllReady(e,t,n,i)},200)}}window.ditaConfigurator=new gk})();