@perceptimagery/dita-configurator-staging 1.0.1051 → 1.0.1053

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 +11 -11
  2. package/package.json +1 -1
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 CQ=Object.defineProperty;var SQ=(ja,ls,cs)=>ls in ja?CQ(ja,ls,{enumerable:!0,configurable:!0,writable:!0,value:cs}):ja[ls]=cs;var Bt=(ja,ls,cs)=>(SQ(ja,typeof ls!="symbol"?ls+"":ls,cs),cs);(function(){var jI,WI;"use strict";class ja{constructor(e){Bt(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 ls={storePrefix:{NODE_ENV:"production"}.STORE_PREFIX||"sprie-embed-",host:"https://api.sprie.io"},cs=Object.freeze(ls),gS="1.0.1051";function mS(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 _S{constructor(e,t){Bt(this,"isAuthenticated");Bt(this,"fetcher");Bt(this,"shopifyAPI");Bt(this,"org");Bt(this,"apiKey");Bt(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?mS(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 c;const o=(c=s.properties)==null?void 0:c.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 c=document.querySelector(".popover.hidden-lap-and-up.popover-full");c&&c.hasAttribute("open")&&c.removeAttribute("open"),document.querySelector(".mini-cart.drawer.drawer--large").setAttribute("open","")}}}var Cp=(r=>(r.Init="init",r.Preparing="preparing",r.Authenticating="authenticating",r.Fetching="fetching",r.Loading="loading",r.Done="done",r))(Cp||{});class vS{constructor({log:e,logErr:t,apiService:n,metaData:i,config:s}){Bt(this,"log");Bt(this,"logErr");Bt(this,"metaData");Bt(this,"loaderName");Bt(this,"apiKey");Bt(this,"scriptStreamEncoderId");Bt(this,"rawNodeList");Bt(this,"targetNodeList");Bt(this,"status");Bt(this,"isLoaded");Bt(this,"loadCount");Bt(this,"mutationObserver");Bt(this,"config");Bt(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=Cp.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=Cp.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 yS(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var B1={exports:{}},Bc={},b1={exports:{}},Et={};/**
3
+ var CQ=Object.defineProperty;var SQ=(ja,ls,cs)=>ls in ja?CQ(ja,ls,{enumerable:!0,configurable:!0,writable:!0,value:cs}):ja[ls]=cs;var Bt=(ja,ls,cs)=>(SQ(ja,typeof ls!="symbol"?ls+"":ls,cs),cs);(function(){var jI,WI;"use strict";class ja{constructor(e){Bt(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 ls={storePrefix:{NODE_ENV:"production"}.STORE_PREFIX||"sprie-embed-",host:"https://api.sprie.io"},cs=Object.freeze(ls),gS="1.0.1053";function mS(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 _S{constructor(e,t){Bt(this,"isAuthenticated");Bt(this,"fetcher");Bt(this,"shopifyAPI");Bt(this,"org");Bt(this,"apiKey");Bt(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?mS(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 c;const o=(c=s.properties)==null?void 0:c.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 c=document.querySelector(".popover.hidden-lap-and-up.popover-full");c&&c.hasAttribute("open")&&c.removeAttribute("open"),document.querySelector(".mini-cart.drawer.drawer--large").setAttribute("open","")}}}var Cp=(r=>(r.Init="init",r.Preparing="preparing",r.Authenticating="authenticating",r.Fetching="fetching",r.Loading="loading",r.Done="done",r))(Cp||{});class vS{constructor({log:e,logErr:t,apiService:n,metaData:i,config:s}){Bt(this,"log");Bt(this,"logErr");Bt(this,"metaData");Bt(this,"loaderName");Bt(this,"apiKey");Bt(this,"scriptStreamEncoderId");Bt(this,"rawNodeList");Bt(this,"targetNodeList");Bt(this,"status");Bt(this,"isLoaded");Bt(this,"loadCount");Bt(this,"mutationObserver");Bt(this,"config");Bt(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=Cp.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=Cp.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 yS(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var B1={exports:{}},Bc={},b1={exports:{}},Et={};/**
4
4
  * @license React
5
5
  * react.production.min.js
6
6
  *
@@ -8,7 +8,7 @@ var CQ=Object.defineProperty;var SQ=(ja,ls,cs)=>ls in ja?CQ(ja,ls,{enumerable:!0
8
8
  *
9
9
  * This source code is licensed under the MIT license found in the
10
10
  * LICENSE file in the root directory of this source tree.
11
- */var R1;function ES(){if(R1)return Et;R1=1;var r=Symbol.for("react.element"),e=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),o=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),A=Symbol.iterator;function p(Q){return Q===null||typeof Q!="object"?null:(Q=A&&Q[A]||Q["@@iterator"],typeof Q=="function"?Q:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},v=Object.assign,E={};function m(Q,z,Z){this.props=Q,this.context=z,this.refs=E,this.updater=Z||g}m.prototype.isReactComponent={},m.prototype.setState=function(Q,z){if(typeof Q!="object"&&typeof Q!="function"&&Q!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,Q,z,"setState")},m.prototype.forceUpdate=function(Q){this.updater.enqueueForceUpdate(this,Q,"forceUpdate")};function _(){}_.prototype=m.prototype;function w(Q,z,Z){this.props=Q,this.context=z,this.refs=E,this.updater=Z||g}var x=w.prototype=new _;x.constructor=w,v(x,m.prototype),x.isPureReactComponent=!0;var I=Array.isArray,R=Object.prototype.hasOwnProperty,M={current:null},T={key:!0,ref:!0,__self:!0,__source:!0};function D(Q,z,Z){var re,G={},de=null,pe=null;if(z!=null)for(re in z.ref!==void 0&&(pe=z.ref),z.key!==void 0&&(de=""+z.key),z)R.call(z,re)&&!T.hasOwnProperty(re)&&(G[re]=z[re]);var fe=arguments.length-2;if(fe===1)G.children=Z;else if(1<fe){for(var ye=Array(fe),Pe=0;Pe<fe;Pe++)ye[Pe]=arguments[Pe+2];G.children=ye}if(Q&&Q.defaultProps)for(re in fe=Q.defaultProps,fe)G[re]===void 0&&(G[re]=fe[re]);return{$$typeof:r,type:Q,key:de,ref:pe,props:G,_owner:M.current}}function b(Q,z){return{$$typeof:r,type:Q.type,key:z,ref:Q.ref,props:Q.props,_owner:Q._owner}}function S(Q){return typeof Q=="object"&&Q!==null&&Q.$$typeof===r}function L(Q){var z={"=":"=0",":":"=2"};return"$"+Q.replace(/[=:]/g,function(Z){return z[Z]})}var P=/\/+/g;function N(Q,z){return typeof Q=="object"&&Q!==null&&Q.key!=null?L(""+Q.key):z.toString(36)}function W(Q,z,Z,re,G){var de=typeof Q;(de==="undefined"||de==="boolean")&&(Q=null);var pe=!1;if(Q===null)pe=!0;else switch(de){case"string":case"number":pe=!0;break;case"object":switch(Q.$$typeof){case r:case e:pe=!0}}if(pe)return pe=Q,G=G(pe),Q=re===""?"."+N(pe,0):re,I(G)?(Z="",Q!=null&&(Z=Q.replace(P,"$&/")+"/"),W(G,z,Z,"",function(Pe){return Pe})):G!=null&&(S(G)&&(G=b(G,Z+(!G.key||pe&&pe.key===G.key?"":(""+G.key).replace(P,"$&/")+"/")+Q)),z.push(G)),1;if(pe=0,re=re===""?".":re+":",I(Q))for(var fe=0;fe<Q.length;fe++){de=Q[fe];var ye=re+N(de,fe);pe+=W(de,z,Z,ye,G)}else if(ye=p(Q),typeof ye=="function")for(Q=ye.call(Q),fe=0;!(de=Q.next()).done;)de=de.value,ye=re+N(de,fe++),pe+=W(de,z,Z,ye,G);else if(de==="object")throw z=String(Q),Error("Objects are not valid as a React child (found: "+(z==="[object Object]"?"object with keys {"+Object.keys(Q).join(", ")+"}":z)+"). If you meant to render a collection of children, use an array instead.");return pe}function X(Q,z,Z){if(Q==null)return Q;var re=[],G=0;return W(Q,re,"","",function(de){return z.call(Z,de,G++)}),re}function K(Q){if(Q._status===-1){var z=Q._result;z=z(),z.then(function(Z){(Q._status===0||Q._status===-1)&&(Q._status=1,Q._result=Z)},function(Z){(Q._status===0||Q._status===-1)&&(Q._status=2,Q._result=Z)}),Q._status===-1&&(Q._status=0,Q._result=z)}if(Q._status===1)return Q._result.default;throw Q._result}var te={current:null},H={transition:null},ee={ReactCurrentDispatcher:te,ReactCurrentBatchConfig:H,ReactCurrentOwner:M};return Et.Children={map:X,forEach:function(Q,z,Z){X(Q,function(){z.apply(this,arguments)},Z)},count:function(Q){var z=0;return X(Q,function(){z++}),z},toArray:function(Q){return X(Q,function(z){return z})||[]},only:function(Q){if(!S(Q))throw Error("React.Children.only expected to receive a single React element child.");return Q}},Et.Component=m,Et.Fragment=t,Et.Profiler=i,Et.PureComponent=w,Et.StrictMode=n,Et.Suspense=h,Et.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ee,Et.cloneElement=function(Q,z,Z){if(Q==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+Q+".");var re=v({},Q.props),G=Q.key,de=Q.ref,pe=Q._owner;if(z!=null){if(z.ref!==void 0&&(de=z.ref,pe=M.current),z.key!==void 0&&(G=""+z.key),Q.type&&Q.type.defaultProps)var fe=Q.type.defaultProps;for(ye in z)R.call(z,ye)&&!T.hasOwnProperty(ye)&&(re[ye]=z[ye]===void 0&&fe!==void 0?fe[ye]:z[ye])}var ye=arguments.length-2;if(ye===1)re.children=Z;else if(1<ye){fe=Array(ye);for(var Pe=0;Pe<ye;Pe++)fe[Pe]=arguments[Pe+2];re.children=fe}return{$$typeof:r,type:Q.type,key:G,ref:de,props:re,_owner:pe}},Et.createContext=function(Q){return Q={$$typeof:o,_currentValue:Q,_currentValue2:Q,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},Q.Provider={$$typeof:s,_context:Q},Q.Consumer=Q},Et.createElement=D,Et.createFactory=function(Q){var z=D.bind(null,Q);return z.type=Q,z},Et.createRef=function(){return{current:null}},Et.forwardRef=function(Q){return{$$typeof:c,render:Q}},Et.isValidElement=S,Et.lazy=function(Q){return{$$typeof:d,_payload:{_status:-1,_result:Q},_init:K}},Et.memo=function(Q,z){return{$$typeof:u,type:Q,compare:z===void 0?null:z}},Et.startTransition=function(Q){var z=H.transition;H.transition={};try{Q()}finally{H.transition=z}},Et.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")},Et.useCallback=function(Q,z){return te.current.useCallback(Q,z)},Et.useContext=function(Q){return te.current.useContext(Q)},Et.useDebugValue=function(){},Et.useDeferredValue=function(Q){return te.current.useDeferredValue(Q)},Et.useEffect=function(Q,z){return te.current.useEffect(Q,z)},Et.useId=function(){return te.current.useId()},Et.useImperativeHandle=function(Q,z,Z){return te.current.useImperativeHandle(Q,z,Z)},Et.useInsertionEffect=function(Q,z){return te.current.useInsertionEffect(Q,z)},Et.useLayoutEffect=function(Q,z){return te.current.useLayoutEffect(Q,z)},Et.useMemo=function(Q,z){return te.current.useMemo(Q,z)},Et.useReducer=function(Q,z,Z){return te.current.useReducer(Q,z,Z)},Et.useRef=function(Q){return te.current.useRef(Q)},Et.useState=function(Q){return te.current.useState(Q)},Et.useSyncExternalStore=function(Q,z,Z){return te.current.useSyncExternalStore(Q,z,Z)},Et.useTransition=function(){return te.current.useTransition()},Et.version="18.2.0",Et}b1.exports=ES();var We=b1.exports;const Th=yS(We);/**
11
+ */var R1;function ES(){if(R1)return Et;R1=1;var r=Symbol.for("react.element"),e=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),o=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),A=Symbol.iterator;function p(Q){return Q===null||typeof Q!="object"?null:(Q=A&&Q[A]||Q["@@iterator"],typeof Q=="function"?Q:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},v=Object.assign,E={};function m(Q,z,Z){this.props=Q,this.context=z,this.refs=E,this.updater=Z||g}m.prototype.isReactComponent={},m.prototype.setState=function(Q,z){if(typeof Q!="object"&&typeof Q!="function"&&Q!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,Q,z,"setState")},m.prototype.forceUpdate=function(Q){this.updater.enqueueForceUpdate(this,Q,"forceUpdate")};function _(){}_.prototype=m.prototype;function w(Q,z,Z){this.props=Q,this.context=z,this.refs=E,this.updater=Z||g}var x=w.prototype=new _;x.constructor=w,v(x,m.prototype),x.isPureReactComponent=!0;var I=Array.isArray,R=Object.prototype.hasOwnProperty,M={current:null},T={key:!0,ref:!0,__self:!0,__source:!0};function D(Q,z,Z){var re,G={},de=null,pe=null;if(z!=null)for(re in z.ref!==void 0&&(pe=z.ref),z.key!==void 0&&(de=""+z.key),z)R.call(z,re)&&!T.hasOwnProperty(re)&&(G[re]=z[re]);var fe=arguments.length-2;if(fe===1)G.children=Z;else if(1<fe){for(var ye=Array(fe),Pe=0;Pe<fe;Pe++)ye[Pe]=arguments[Pe+2];G.children=ye}if(Q&&Q.defaultProps)for(re in fe=Q.defaultProps,fe)G[re]===void 0&&(G[re]=fe[re]);return{$$typeof:r,type:Q,key:de,ref:pe,props:G,_owner:M.current}}function b(Q,z){return{$$typeof:r,type:Q.type,key:z,ref:Q.ref,props:Q.props,_owner:Q._owner}}function S(Q){return typeof Q=="object"&&Q!==null&&Q.$$typeof===r}function L(Q){var z={"=":"=0",":":"=2"};return"$"+Q.replace(/[=:]/g,function(Z){return z[Z]})}var P=/\/+/g;function N(Q,z){return typeof Q=="object"&&Q!==null&&Q.key!=null?L(""+Q.key):z.toString(36)}function W(Q,z,Z,re,G){var de=typeof Q;(de==="undefined"||de==="boolean")&&(Q=null);var pe=!1;if(Q===null)pe=!0;else switch(de){case"string":case"number":pe=!0;break;case"object":switch(Q.$$typeof){case r:case e:pe=!0}}if(pe)return pe=Q,G=G(pe),Q=re===""?"."+N(pe,0):re,I(G)?(Z="",Q!=null&&(Z=Q.replace(P,"$&/")+"/"),W(G,z,Z,"",function(Pe){return Pe})):G!=null&&(S(G)&&(G=b(G,Z+(!G.key||pe&&pe.key===G.key?"":(""+G.key).replace(P,"$&/")+"/")+Q)),z.push(G)),1;if(pe=0,re=re===""?".":re+":",I(Q))for(var fe=0;fe<Q.length;fe++){de=Q[fe];var ye=re+N(de,fe);pe+=W(de,z,Z,ye,G)}else if(ye=p(Q),typeof ye=="function")for(Q=ye.call(Q),fe=0;!(de=Q.next()).done;)de=de.value,ye=re+N(de,fe++),pe+=W(de,z,Z,ye,G);else if(de==="object")throw z=String(Q),Error("Objects are not valid as a React child (found: "+(z==="[object Object]"?"object with keys {"+Object.keys(Q).join(", ")+"}":z)+"). If you meant to render a collection of children, use an array instead.");return pe}function X(Q,z,Z){if(Q==null)return Q;var re=[],G=0;return W(Q,re,"","",function(de){return z.call(Z,de,G++)}),re}function K(Q){if(Q._status===-1){var z=Q._result;z=z(),z.then(function(Z){(Q._status===0||Q._status===-1)&&(Q._status=1,Q._result=Z)},function(Z){(Q._status===0||Q._status===-1)&&(Q._status=2,Q._result=Z)}),Q._status===-1&&(Q._status=0,Q._result=z)}if(Q._status===1)return Q._result.default;throw Q._result}var te={current:null},H={transition:null},ee={ReactCurrentDispatcher:te,ReactCurrentBatchConfig:H,ReactCurrentOwner:M};return Et.Children={map:X,forEach:function(Q,z,Z){X(Q,function(){z.apply(this,arguments)},Z)},count:function(Q){var z=0;return X(Q,function(){z++}),z},toArray:function(Q){return X(Q,function(z){return z})||[]},only:function(Q){if(!S(Q))throw Error("React.Children.only expected to receive a single React element child.");return Q}},Et.Component=m,Et.Fragment=t,Et.Profiler=i,Et.PureComponent=w,Et.StrictMode=n,Et.Suspense=h,Et.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ee,Et.cloneElement=function(Q,z,Z){if(Q==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+Q+".");var re=v({},Q.props),G=Q.key,de=Q.ref,pe=Q._owner;if(z!=null){if(z.ref!==void 0&&(de=z.ref,pe=M.current),z.key!==void 0&&(G=""+z.key),Q.type&&Q.type.defaultProps)var fe=Q.type.defaultProps;for(ye in z)R.call(z,ye)&&!T.hasOwnProperty(ye)&&(re[ye]=z[ye]===void 0&&fe!==void 0?fe[ye]:z[ye])}var ye=arguments.length-2;if(ye===1)re.children=Z;else if(1<ye){fe=Array(ye);for(var Pe=0;Pe<ye;Pe++)fe[Pe]=arguments[Pe+2];re.children=fe}return{$$typeof:r,type:Q.type,key:G,ref:de,props:re,_owner:pe}},Et.createContext=function(Q){return Q={$$typeof:o,_currentValue:Q,_currentValue2:Q,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},Q.Provider={$$typeof:s,_context:Q},Q.Consumer=Q},Et.createElement=D,Et.createFactory=function(Q){var z=D.bind(null,Q);return z.type=Q,z},Et.createRef=function(){return{current:null}},Et.forwardRef=function(Q){return{$$typeof:c,render:Q}},Et.isValidElement=S,Et.lazy=function(Q){return{$$typeof:d,_payload:{_status:-1,_result:Q},_init:K}},Et.memo=function(Q,z){return{$$typeof:u,type:Q,compare:z===void 0?null:z}},Et.startTransition=function(Q){var z=H.transition;H.transition={};try{Q()}finally{H.transition=z}},Et.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")},Et.useCallback=function(Q,z){return te.current.useCallback(Q,z)},Et.useContext=function(Q){return te.current.useContext(Q)},Et.useDebugValue=function(){},Et.useDeferredValue=function(Q){return te.current.useDeferredValue(Q)},Et.useEffect=function(Q,z){return te.current.useEffect(Q,z)},Et.useId=function(){return te.current.useId()},Et.useImperativeHandle=function(Q,z,Z){return te.current.useImperativeHandle(Q,z,Z)},Et.useInsertionEffect=function(Q,z){return te.current.useInsertionEffect(Q,z)},Et.useLayoutEffect=function(Q,z){return te.current.useLayoutEffect(Q,z)},Et.useMemo=function(Q,z){return te.current.useMemo(Q,z)},Et.useReducer=function(Q,z,Z){return te.current.useReducer(Q,z,Z)},Et.useRef=function(Q){return te.current.useRef(Q)},Et.useState=function(Q){return te.current.useState(Q)},Et.useSyncExternalStore=function(Q,z,Z){return te.current.useSyncExternalStore(Q,z,Z)},Et.useTransition=function(){return te.current.useTransition()},Et.version="18.2.0",Et}b1.exports=ES();var Ye=b1.exports;const Th=yS(Ye);/**
12
12
  * @license React
13
13
  * react-jsx-runtime.production.min.js
14
14
  *
@@ -16,7 +16,7 @@ var CQ=Object.defineProperty;var SQ=(ja,ls,cs)=>ls in ja?CQ(ja,ls,{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 D1;function xS(){if(D1)return Bc;D1=1;var r=We,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(c,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(c&&c.defaultProps)for(d in h=c.defaultProps,h)A[d]===void 0&&(A[d]=h[d]);return{$$typeof:e,type:c,key:p,ref:g,props:A,_owner:i.current}}return Bc.Fragment=t,Bc.jsx=o,Bc.jsxs=o,Bc}B1.exports=xS();var Me=B1.exports;const MQ="";var wS=Object.defineProperty,IS=(r,e,t)=>e in r?wS(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,kt=(r,e,t)=>(IS(r,typeof e!="symbol"?e+"":e,t),t);const CS={storePrefix:{NODE_ENV:"production"}.STORE_PREFIX||"3d-configurator-",host:"https://api.sprie.io"},L1=Object.freeze(CS);class SS{constructor(e){kt(this,"baseURL"),kt(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 bc=new SS({baseURL:L1.host});function MS(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 TS{constructor(){}async AuthServiceApi(e){const t=`/v1/widget/auth?api=${e}`,n=await bc.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 bc.Get(t)}async FetchCustomisationList(){const e="/v1/widget/list-customisation?search=type:Lens,usage:customizer&limit=50",t=await bc.Get(e),n=t.data.find(i=>i.sku==="lens-default");return{...t,data:MS(t.data,n)}}async DownloadMA(e){try{const t=`/v1/widget/org/${e.orgId}/asset/${e.assetsId}/universal-full-encrypted`,n=await bc.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 Sp=new TS;class BS{constructor(e){kt(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 Rc=new BS(L1.storePrefix);class bS{constructor(){kt(this,"authPayload"),kt(this,"apiKey"),kt(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 Sp.AuthServiceApi(this.apiKey);this.setAuthConfig({EXPIRES:e.expires,JWT:e.access,ORGID:e.orgId})}setAuthConfig(e){e.JWT&&(Rc.setItem("jwtToken",e.JWT),this.authPayload.JWT=e.JWT),e.EXPIRES&&(Rc.setItem("expires",e.EXPIRES),this.authPayload.EXPIRES=e.EXPIRES),e.ORGID&&(Rc.setItem("orgId",e.ORGID),this.authPayload.ORGID=e.ORGID)}LoadConfig(){const e=Rc.getItem("jwtToken");e&&(this.authPayload.JWT=e);const t=Rc.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 RS(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function DS(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 Mp={exports:{}},jo=typeof Reflect=="object"?Reflect:null,N1=jo&&typeof jo.apply=="function"?jo.apply:function(r,e,t){return Function.prototype.apply.call(r,e,t)},Bh;jo&&typeof jo.ownKeys=="function"?Bh=jo.ownKeys:Object.getOwnPropertySymbols?Bh=function(r){return Object.getOwnPropertyNames(r).concat(Object.getOwnPropertySymbols(r))}:Bh=function(r){return Object.getOwnPropertyNames(r)};function LS(r){console&&console.warn&&console.warn(r)}var U1=Number.isNaN||function(r){return r!==r};function Qt(){Qt.init.call(this)}Mp.exports=Qt,Mp.exports.once=kS,Qt.EventEmitter=Qt,Qt.prototype._events=void 0,Qt.prototype._eventsCount=0,Qt.prototype._maxListeners=void 0;var P1=10;function bh(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 P1},set:function(r){if(typeof r!="number"||r<0||U1(r))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+r+".");P1=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||U1(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 k1(r){return r._maxListeners===void 0?Qt.defaultMaxListeners:r._maxListeners}Qt.prototype.getMaxListeners=function(){return k1(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 c=i[r];if(c===void 0)return!1;if(typeof c=="function")N1(c,this,e);else for(var h=c.length,u=H1(c,h),t=0;t<h;++t)N1(u[t],this,e);return!0};function Q1(r,e,t,n){var i,s,o;if(bh(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=k1(r),i>0&&o.length>i&&!o.warned){o.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=r,c.type=e,c.count=o.length,LS(c)}return r}Qt.prototype.addListener=function(r,e){return Q1(this,r,e,!1)},Qt.prototype.on=Qt.prototype.addListener,Qt.prototype.prependListener=function(r,e){return Q1(this,r,e,!0)};function NS(){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 F1(r,e,t){var n={fired:!1,wrapFn:void 0,target:r,type:e,listener:t},i=NS.bind(n);return i.listener=t,n.wrapFn=i,i}Qt.prototype.once=function(r,e){return bh(e),this.on(r,F1(this,r,e)),this},Qt.prototype.prependOnceListener=function(r,e){return bh(e),this.prependListener(r,F1(this,r,e)),this},Qt.prototype.removeListener=function(r,e){var t,n,i,s,o;if(bh(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():US(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 O1(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?PS(i):H1(i,i.length)}Qt.prototype.listeners=function(r){return O1(this,r,!0)},Qt.prototype.rawListeners=function(r){return O1(this,r,!1)},Qt.listenerCount=function(r,e){return typeof r.listenerCount=="function"?r.listenerCount(e):z1.call(r,e)},Qt.prototype.listenerCount=z1;function z1(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?Bh(this._events):[]};function H1(r,e){for(var t=new Array(e),n=0;n<e;++n)t[n]=r[n];return t}function US(r,e){for(;e+1<r.length;e++)r[e]=r[e+1];r.pop()}function PS(r){for(var e=new Array(r.length),t=0;t<e.length;++t)e[t]=r[t].listener||r[t];return e}function kS(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))}G1(r,e,s,{once:!0}),e!=="error"&&QS(r,i,{once:!0})})}function QS(r,e,t){typeof r.on=="function"&&G1(r,"error",e,t)}function G1(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 FS=Mp.exports;const V1=class T1 extends FS.EventEmitter{emitEvent(e,t){Object.keys(T1.EVENTS).includes(e)&&this.emit(T1.EVENTS[e],t)}};kt(V1,"EVENTS",{onAddToCart:"add-to-cart"});let OS=V1;var j1={exports:{}};function zS(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 W1={exports:{}};const HS={},GS=Object.freeze(Object.defineProperty({__proto__:null,default:HS},Symbol.toStringTag,{value:"Module"})),VS=DS(GS);var Y1;function wt(){return Y1||(Y1=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 zS=="function")try{s=VS}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.")},c=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=c(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,M=w.sigBytes;if(this.clamp(),R%4)for(var T=0;T<M;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<M;b+=4)x[R+b>>>2]=I[b>>>2];return this.sigBytes+=M,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=[],M=0;M<I;M++){var T=x[M>>>2]>>>24-M%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)}},v=p.Latin1={stringify:function(w){for(var x=w.words,I=w.sigBytes,R=[],M=0;M<I;M++){var T=x[M>>>2]>>>24-M%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(v.stringify(w)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(w){return v.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,M=I.sigBytes,T=this.blockSize,D=T*4,b=M/D;w?b=n.ceil(b):b=n.max((b|0)-this._minBufferSize,0);var S=b*T,L=n.min(S*4,M);if(S){for(var P=0;P<S;P+=T)this._doProcessBlock(R,P);x=R.splice(0,S),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 _.HMAC.init(w,I).finalize(x)}}});var _=h.algo={};return h}(Math);return t})}(W1)),W1.exports}var q1={exports:{}},X1;function Rh(){return X1||(X1=1,function(r,e){(function(t,n){r.exports=n(wt())})(yt,function(t){return function(n){var i=t,s=i.lib,o=s.Base,c=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 c.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})}(q1)),q1.exports}var K1={exports:{}},J1;function jS(){return J1||(J1=1,function(r,e){(function(t,n){r.exports=n(wt())})(yt,function(t){return function(){if(typeof ArrayBuffer=="function"){var n=t,i=n.lib,s=i.WordArray,o=s.init,c=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)};c.prototype=s}}(),t.lib.WordArray})}(K1)),K1.exports}var Z1={exports:{}},$1;function WS(){return $1||($1=1,function(r,e){(function(t,n){r.exports=n(wt())})(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=c(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]|=c(h.charCodeAt(A)<<16-A%2*16);return s.create(d,u*2)}};function c(h){return h<<8&4278255360|h>>>8&16711935}}(),t.enc.Utf16})}(Z1)),Z1.exports}var e_={exports:{}},t_;function Wa(){return t_||(t_=1,function(r,e){(function(t,n){r.exports=n(wt())})(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 v=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(_>>>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 v=h.indexOf(g);v!==-1&&(u=v)}return c(h,u,A)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function c(h,u,d){for(var A=[],p=0,g=0;g<u;g++)if(g%4){var v=d[h.charCodeAt(g-1)]<<g%4*2,E=d[h.charCodeAt(g)]>>>6-g%4*2,m=v|E;A[p>>>2]|=m<<24-p%4*8,p++}return s.create(A,p)}}(),t.enc.Base64})}(e_)),e_.exports}var r_={exports:{}},n_;function YS(){return n_||(n_=1,function(r,e){(function(t,n){r.exports=n(wt())})(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=[],v=0;v<A;v+=3)for(var E=d[v>>>2]>>>24-v%4*8&255,m=d[v+1>>>2]>>>24-(v+1)%4*8&255,_=d[v+2>>>2]>>>24-(v+2)%4*8&255,w=E<<16|m<<8|_,x=0;x<4&&v+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 v=A.charAt(64);if(v){var E=h.indexOf(v);E!==-1&&(d=E)}return c(h,d,p)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"};function c(h,u,d){for(var A=[],p=0,g=0;g<u;g++)if(g%4){var v=d[h.charCodeAt(g-1)]<<g%4*2,E=d[h.charCodeAt(g)]>>>6-g%4*2,m=v|E;A[p>>>2]|=m<<24-p%4*8,p++}return s.create(A,p)}}(),t.enc.Base64url})}(r_)),r_.exports}var i_={exports:{}},s_;function Ya(){return s_||(s_=1,function(r,e){(function(t,n){r.exports=n(wt())})(yt,function(t){return function(n){var i=t,s=i.lib,o=s.WordArray,c=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=c.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(E,m){for(var _=0;_<16;_++){var w=m+_,x=E[w];E[w]=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360}var I=this._hash.words,R=E[m+0],M=E[m+1],T=E[m+2],D=E[m+3],b=E[m+4],S=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],H=E[m+13],ee=E[m+14],Q=E[m+15],z=I[0],Z=I[1],re=I[2],G=I[3];z=A(z,Z,re,G,R,7,u[0]),G=A(G,z,Z,re,M,12,u[1]),re=A(re,G,z,Z,T,17,u[2]),Z=A(Z,re,G,z,D,22,u[3]),z=A(z,Z,re,G,b,7,u[4]),G=A(G,z,Z,re,S,12,u[5]),re=A(re,G,z,Z,L,17,u[6]),Z=A(Z,re,G,z,P,22,u[7]),z=A(z,Z,re,G,N,7,u[8]),G=A(G,z,Z,re,W,12,u[9]),re=A(re,G,z,Z,X,17,u[10]),Z=A(Z,re,G,z,K,22,u[11]),z=A(z,Z,re,G,te,7,u[12]),G=A(G,z,Z,re,H,12,u[13]),re=A(re,G,z,Z,ee,17,u[14]),Z=A(Z,re,G,z,Q,22,u[15]),z=p(z,Z,re,G,M,5,u[16]),G=p(G,z,Z,re,L,9,u[17]),re=p(re,G,z,Z,K,14,u[18]),Z=p(Z,re,G,z,R,20,u[19]),z=p(z,Z,re,G,S,5,u[20]),G=p(G,z,Z,re,X,9,u[21]),re=p(re,G,z,Z,Q,14,u[22]),Z=p(Z,re,G,z,b,20,u[23]),z=p(z,Z,re,G,W,5,u[24]),G=p(G,z,Z,re,ee,9,u[25]),re=p(re,G,z,Z,D,14,u[26]),Z=p(Z,re,G,z,N,20,u[27]),z=p(z,Z,re,G,H,5,u[28]),G=p(G,z,Z,re,T,9,u[29]),re=p(re,G,z,Z,P,14,u[30]),Z=p(Z,re,G,z,te,20,u[31]),z=g(z,Z,re,G,S,4,u[32]),G=g(G,z,Z,re,N,11,u[33]),re=g(re,G,z,Z,K,16,u[34]),Z=g(Z,re,G,z,ee,23,u[35]),z=g(z,Z,re,G,M,4,u[36]),G=g(G,z,Z,re,b,11,u[37]),re=g(re,G,z,Z,P,16,u[38]),Z=g(Z,re,G,z,X,23,u[39]),z=g(z,Z,re,G,H,4,u[40]),G=g(G,z,Z,re,R,11,u[41]),re=g(re,G,z,Z,D,16,u[42]),Z=g(Z,re,G,z,L,23,u[43]),z=g(z,Z,re,G,W,4,u[44]),G=g(G,z,Z,re,te,11,u[45]),re=g(re,G,z,Z,Q,16,u[46]),Z=g(Z,re,G,z,T,23,u[47]),z=v(z,Z,re,G,R,6,u[48]),G=v(G,z,Z,re,P,10,u[49]),re=v(re,G,z,Z,ee,15,u[50]),Z=v(Z,re,G,z,S,21,u[51]),z=v(z,Z,re,G,te,6,u[52]),G=v(G,z,Z,re,D,10,u[53]),re=v(re,G,z,Z,X,15,u[54]),Z=v(Z,re,G,z,M,21,u[55]),z=v(z,Z,re,G,N,6,u[56]),G=v(G,z,Z,re,Q,10,u[57]),re=v(re,G,z,Z,L,15,u[58]),Z=v(Z,re,G,z,H,21,u[59]),z=v(z,Z,re,G,b,6,u[60]),G=v(G,z,Z,re,K,10,u[61]),re=v(re,G,z,Z,T,15,u[62]),Z=v(Z,re,G,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]+G|0},_doFinalize:function(){var E=this._data,m=E.words,_=this._nDataBytes*8,w=E.sigBytes*8;m[w>>>5]|=128<<24-w%32;var x=n.floor(_/4294967296),I=_;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,M=R.words,T=0;T<4;T++){var D=M[T];M[T]=(D<<8|D>>>24)&16711935|(D<<24|D>>>8)&4278255360}return R},clone:function(){var E=c.clone.call(this);return E._hash=this._hash.clone(),E}});function A(E,m,_,w,x,I,R){var M=E+(m&_|~m&w)+x+R;return(M<<I|M>>>32-I)+m}function p(E,m,_,w,x,I,R){var M=E+(m&w|_&~w)+x+R;return(M<<I|M>>>32-I)+m}function g(E,m,_,w,x,I,R){var M=E+(m^_^w)+x+R;return(M<<I|M>>>32-I)+m}function v(E,m,_,w,x,I,R){var M=E+(_^(m|~w))+x+R;return(M<<I|M>>>32-I)+m}i.MD5=c._createHelper(d),i.HmacMD5=c._createHmacHelper(d)}(Math),t.MD5})}(i_)),i_.exports}var a_={exports:{}},o_;function l_(){return o_||(o_=1,function(r,e){(function(t,n){r.exports=n(wt())})(yt,function(t){return function(){var n=t,i=n.lib,s=i.WordArray,o=i.Hasher,c=n.algo,h=[],u=c.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],v=p[1],E=p[2],m=p[3],_=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)+_+h[w];w<20?I+=(v&E|~v&m)+1518500249:w<40?I+=(v^E^m)+1859775393:w<60?I+=(v&E|v&m|E&m)-1894007588:I+=(v^E^m)-899497514,_=m,m=E,E=v<<30|v>>>2,v=g,g=I}p[0]=p[0]+g|0,p[1]=p[1]+v|0,p[2]=p[2]+E|0,p[3]=p[3]+m|0,p[4]=p[4]+_|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})}(a_)),a_.exports}var c_={exports:{}},u_;function Tp(){return u_||(u_=1,function(r,e){(function(t,n){r.exports=n(wt())})(yt,function(t){return function(n){var i=t,s=i.lib,o=s.WordArray,c=s.Hasher,h=i.algo,u=[],d=[];(function(){function g(_){for(var w=n.sqrt(_),x=2;x<=w;x++)if(!(_%x))return!1;return!0}function v(_){return(_-(_|0))*4294967296|0}for(var E=2,m=0;m<64;)g(E)&&(m<8&&(u[m]=v(n.pow(E,1/2))),d[m]=v(n.pow(E,1/3)),m++),E++})();var A=[],p=h.SHA256=c.extend({_doReset:function(){this._hash=new o.init(u.slice(0))},_doProcessBlock:function(g,v){for(var E=this._hash.words,m=E[0],_=E[1],w=E[2],x=E[3],I=E[4],R=E[5],M=E[6],T=E[7],D=0;D<64;D++){if(D<16)A[D]=g[v+D]|0;else{var b=A[D-15],S=(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]=S+A[D-7]+P+A[D-16]}var N=I&R^~I&M,W=m&_^m&w^_&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],H=X+W;T=M,M=R,R=I,I=x+te|0,x=w,w=_,_=m,m=te+H|0}E[0]=E[0]+m|0,E[1]=E[1]+_|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]+M|0,E[7]=E[7]+T|0},_doFinalize:function(){var g=this._data,v=g.words,E=this._nDataBytes*8,m=g.sigBytes*8;return v[m>>>5]|=128<<24-m%32,v[(m+64>>>9<<4)+14]=n.floor(E/4294967296),v[(m+64>>>9<<4)+15]=E,g.sigBytes=v.length*4,this._process(),this._hash},clone:function(){var g=c.clone.call(this);return g._hash=this._hash.clone(),g}});i.SHA256=c._createHelper(p),i.HmacSHA256=c._createHmacHelper(p)}(Math),t.SHA256})}(c_)),c_.exports}var h_={exports:{}},d_;function qS(){return d_||(d_=1,function(r,e){(function(t,n,i){r.exports=n(wt(),Tp())})(yt,function(t){return function(){var n=t,i=n.lib,s=i.WordArray,o=n.algo,c=o.SHA256,h=o.SHA224=c.extend({_doReset:function(){this._hash=new s.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var u=c._doFinalize.call(this);return u.sigBytes-=4,u}});n.SHA224=c._createHelper(h),n.HmacSHA224=c._createHmacHelper(h)}(),t.SHA224})}(h_)),h_.exports}var f_={exports:{}},p_;function A_(){return p_||(p_=1,function(r,e){(function(t,n,i){r.exports=n(wt(),Rh())})(yt,function(t){return function(){var n=t,i=n.lib,s=i.Hasher,o=n.x64,c=o.Word,h=o.WordArray,u=n.algo;function d(){return c.create.apply(c,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 v=0;v<80;v++)p[v]=d()})();var g=u.SHA512=s.extend({_doReset:function(){this._hash=new h.init([new c.init(1779033703,4089235720),new c.init(3144134277,2227873595),new c.init(1013904242,4271175723),new c.init(2773480762,1595750129),new c.init(1359893119,2917565137),new c.init(2600822924,725511199),new c.init(528734635,4215389547),new c.init(1541459225,327033209)])},_doProcessBlock:function(v,E){for(var m=this._hash.words,_=m[0],w=m[1],x=m[2],I=m[3],R=m[4],M=m[5],T=m[6],D=m[7],b=_.high,S=_.low,L=w.high,P=w.low,N=x.high,W=x.low,X=I.high,K=I.low,te=R.high,H=R.low,ee=M.high,Q=M.low,z=T.high,Z=T.low,re=D.high,G=D.low,de=b,pe=S,fe=L,ye=P,Pe=N,at=W,se=X,et=K,ke=te,dt=H,Xe=ee,ft=Q,Y=z,k=Z,le=re,Ae=G,me=0;me<80;me++){var Ee,Oe,Ce=p[me];if(me<16)Oe=Ce.high=v[E+me*2]|0,Ee=Ce.low=v[E+me*2+1]|0;else{var Qe=p[me-15],ve=Qe.high,xe=Qe.low,Be=(ve>>>1|xe<<31)^(ve>>>8|xe<<24)^ve>>>7,Ye=(xe>>>1|ve<<31)^(xe>>>8|ve<<24)^(xe>>>7|ve<<25),Le=p[me-2],be=Le.high,nt=Le.low,pt=(be>>>19|nt<<13)^(be<<3|nt>>>29)^be>>>6,ct=(nt>>>19|be<<13)^(nt<<3|be>>>29)^(nt>>>6|be<<26),ut=p[me-7],tt=ut.high,V=ut.low,F=p[me-16],ge=F.high,_e=F.low;Ee=Ye+V,Oe=Be+tt+(Ee>>>0<Ye>>>0?1:0),Ee=Ee+ct,Oe=Oe+pt+(Ee>>>0<ct>>>0?1:0),Ee=Ee+_e,Oe=Oe+ge+(Ee>>>0<_e>>>0?1:0),Ce.high=Oe,Ce.low=Ee}var ze=ke&Xe^~ke&Y,Ne=dt&ft^~dt&k,_t=de&fe^de&Pe^fe&Pe,Dt=pe&ye^pe&at^ye&at,Lt=(de>>>28|pe<<4)^(de<<30|pe>>>2)^(de<<25|pe>>>7),Mt=(pe>>>28|de<<4)^(pe<<30|de>>>2)^(pe<<25|de>>>7),vt=(ke>>>14|dt<<18)^(ke>>>18|dt<<14)^(ke<<23|dt>>>9),hr=(dt>>>14|ke<<18)^(dt>>>18|ke<<14)^(dt<<23|ke>>>9),Vt=A[me],_r=Vt.high,bn=Vt.low,qt=Ae+hr,hi=le+vt+(qt>>>0<Ae>>>0?1:0),qt=qt+Ne,hi=hi+ze+(qt>>>0<Ne>>>0?1:0),qt=qt+bn,hi=hi+_r+(qt>>>0<bn>>>0?1:0),qt=qt+Ee,hi=hi+Oe+(qt>>>0<Ee>>>0?1:0),Jn=Mt+Dt,Ns=Lt+_t+(Jn>>>0<Mt>>>0?1:0);le=Y,Ae=k,Y=Xe,k=ft,Xe=ke,ft=dt,dt=et+qt|0,ke=se+hi+(dt>>>0<et>>>0?1:0)|0,se=Pe,et=at,Pe=fe,at=ye,fe=de,ye=pe,pe=qt+Jn|0,de=hi+Ns+(pe>>>0<qt>>>0?1:0)|0}S=_.low=S+pe,_.high=b+de+(S>>>0<pe>>>0?1:0),P=w.low=P+ye,w.high=L+fe+(P>>>0<ye>>>0?1:0),W=x.low=W+at,x.high=N+Pe+(W>>>0<at>>>0?1:0),K=I.low=K+et,I.high=X+se+(K>>>0<et>>>0?1:0),H=R.low=H+dt,R.high=te+ke+(H>>>0<dt>>>0?1:0),Q=M.low=Q+ft,M.high=ee+Xe+(Q>>>0<ft>>>0?1:0),Z=T.low=Z+k,T.high=z+Y+(Z>>>0<k>>>0?1:0),G=D.low=G+Ae,D.high=re+le+(G>>>0<Ae>>>0?1:0)},_doFinalize:function(){var v=this._data,E=v.words,m=this._nDataBytes*8,_=v.sigBytes*8;E[_>>>5]|=128<<24-_%32,E[(_+128>>>10<<5)+30]=Math.floor(m/4294967296),E[(_+128>>>10<<5)+31]=m,v.sigBytes=E.length*4,this._process();var w=this._hash.toX32();return w},clone:function(){var v=s.clone.call(this);return v._hash=this._hash.clone(),v},blockSize:1024/32});n.SHA512=s._createHelper(g),n.HmacSHA512=s._createHmacHelper(g)}(),t.SHA512})}(f_)),f_.exports}var g_={exports:{}},m_;function XS(){return m_||(m_=1,function(r,e){(function(t,n,i){r.exports=n(wt(),Rh(),A_())})(yt,function(t){return function(){var n=t,i=n.x64,s=i.Word,o=i.WordArray,c=n.algo,h=c.SHA512,u=c.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})}(g_)),g_.exports}var __={exports:{}},v_;function KS(){return v_||(v_=1,function(r,e){(function(t,n,i){r.exports=n(wt(),Rh())})(yt,function(t){return function(n){var i=t,s=i.lib,o=s.WordArray,c=s.Hasher,h=i.x64,u=h.Word,d=i.algo,A=[],p=[],g=[];(function(){for(var m=1,_=0,w=0;w<24;w++){A[m+5*_]=(w+1)*(w+2)/2%64;var x=_%5,I=(2*m+3*_)%5;m=x,_=I}for(var m=0;m<5;m++)for(var _=0;_<5;_++)p[m+5*_]=_+(2*m+3*_)%5*5;for(var R=1,M=0;M<24;M++){for(var T=0,D=0,b=0;b<7;b++){if(R&1){var S=(1<<b)-1;S<32?D^=1<<S:T^=1<<S-32}R&128?R=R<<1^113:R<<=1}g[M]=u.create(T,D)}})();var v=[];(function(){for(var m=0;m<25;m++)v[m]=u.create()})();var E=d.SHA3=c.extend({cfg:c.cfg.extend({outputLength:512}),_doReset:function(){for(var m=this._state=[],_=0;_<25;_++)m[_]=new u.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(m,_){for(var w=this._state,x=this.blockSize/2,I=0;I<x;I++){var R=m[_+2*I],M=m[_+2*I+1];R=(R<<8|R>>>24)&16711935|(R<<24|R>>>8)&4278255360,M=(M<<8|M>>>24)&16711935|(M<<24|M>>>8)&4278255360;var T=w[I];T.high^=M,T.low^=R}for(var D=0;D<24;D++){for(var b=0;b<5;b++){for(var S=0,L=0,P=0;P<5;P++){var T=w[b+5*P];S^=T.high,L^=T.low}var N=v[b];N.high=S,N.low=L}for(var b=0;b<5;b++)for(var W=v[(b+4)%5],X=v[(b+1)%5],K=X.high,te=X.low,S=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^=S,T.low^=L}for(var H=1;H<25;H++){var S,L,T=w[H],ee=T.high,Q=T.low,z=A[H];z<32?(S=ee<<z|Q>>>32-z,L=Q<<z|ee>>>32-z):(S=Q<<z-32|ee>>>64-z,L=ee<<z-32|Q>>>64-z);var Z=v[p[H]];Z.high=S,Z.low=L}var re=v[0],G=w[0];re.high=G.high,re.low=G.low;for(var b=0;b<5;b++)for(var P=0;P<5;P++){var H=b+5*P,T=w[H],de=v[H],pe=v[(b+1)%5+5*P],fe=v[(b+2)%5+5*P];T.high=de.high^~pe.high&fe.high,T.low=de.low^~pe.low&fe.low}var T=w[0],ye=g[D];T.high^=ye.high,T.low^=ye.low}},_doFinalize:function(){var m=this._data,_=m.words;this._nDataBytes*8;var w=m.sigBytes*8,x=this.blockSize*32;_[w>>>5]|=1<<24-w%32,_[(n.ceil((w+1)/x)*x>>>5)-1]|=128,m.sigBytes=_.length*4,this._process();for(var I=this._state,R=this.cfg.outputLength/8,M=R/8,T=[],D=0;D<M;D++){var b=I[D],S=b.high,L=b.low;S=(S<<8|S>>>24)&16711935|(S<<24|S>>>8)&4278255360,L=(L<<8|L>>>24)&16711935|(L<<24|L>>>8)&4278255360,T.push(L),T.push(S)}return new o.init(T,R)},clone:function(){for(var m=c.clone.call(this),_=m._state=this._state.slice(0),w=0;w<25;w++)_[w]=_[w].clone();return m}});i.SHA3=c._createHelper(E),i.HmacSHA3=c._createHmacHelper(E)}(Math),t.SHA3})}(__)),__.exports}var y_={exports:{}},E_;function JS(){return E_||(E_=1,function(r,e){(function(t,n){r.exports=n(wt())})(yt,function(t){/** @preserve
19
+ */var D1;function xS(){if(D1)return Bc;D1=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(c,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(c&&c.defaultProps)for(d in h=c.defaultProps,h)A[d]===void 0&&(A[d]=h[d]);return{$$typeof:e,type:c,key:p,ref:g,props:A,_owner:i.current}}return Bc.Fragment=t,Bc.jsx=o,Bc.jsxs=o,Bc}B1.exports=xS();var Me=B1.exports;const MQ="";var wS=Object.defineProperty,IS=(r,e,t)=>e in r?wS(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,kt=(r,e,t)=>(IS(r,typeof e!="symbol"?e+"":e,t),t);const CS={storePrefix:{NODE_ENV:"production"}.STORE_PREFIX||"3d-configurator-",host:"https://api.sprie.io"},L1=Object.freeze(CS);class SS{constructor(e){kt(this,"baseURL"),kt(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 bc=new SS({baseURL:L1.host});function MS(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 TS{constructor(){}async AuthServiceApi(e){const t=`/v1/widget/auth?api=${e}`,n=await bc.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 bc.Get(t)}async FetchCustomisationList(){const e="/v1/widget/list-customisation?search=type:Lens,usage:customizer&limit=50",t=await bc.Get(e),n=t.data.find(i=>i.sku==="lens-default");return{...t,data:MS(t.data,n)}}async DownloadMA(e){try{const t=`/v1/widget/org/${e.orgId}/asset/${e.assetsId}/universal-full-encrypted`,n=await bc.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 Sp=new TS;class BS{constructor(e){kt(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 Rc=new BS(L1.storePrefix);class bS{constructor(){kt(this,"authPayload"),kt(this,"apiKey"),kt(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 Sp.AuthServiceApi(this.apiKey);this.setAuthConfig({EXPIRES:e.expires,JWT:e.access,ORGID:e.orgId})}setAuthConfig(e){e.JWT&&(Rc.setItem("jwtToken",e.JWT),this.authPayload.JWT=e.JWT),e.EXPIRES&&(Rc.setItem("expires",e.EXPIRES),this.authPayload.EXPIRES=e.EXPIRES),e.ORGID&&(Rc.setItem("orgId",e.ORGID),this.authPayload.ORGID=e.ORGID)}LoadConfig(){const e=Rc.getItem("jwtToken");e&&(this.authPayload.JWT=e);const t=Rc.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 RS(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function DS(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 Mp={exports:{}},jo=typeof Reflect=="object"?Reflect:null,N1=jo&&typeof jo.apply=="function"?jo.apply:function(r,e,t){return Function.prototype.apply.call(r,e,t)},Bh;jo&&typeof jo.ownKeys=="function"?Bh=jo.ownKeys:Object.getOwnPropertySymbols?Bh=function(r){return Object.getOwnPropertyNames(r).concat(Object.getOwnPropertySymbols(r))}:Bh=function(r){return Object.getOwnPropertyNames(r)};function LS(r){console&&console.warn&&console.warn(r)}var U1=Number.isNaN||function(r){return r!==r};function Qt(){Qt.init.call(this)}Mp.exports=Qt,Mp.exports.once=kS,Qt.EventEmitter=Qt,Qt.prototype._events=void 0,Qt.prototype._eventsCount=0,Qt.prototype._maxListeners=void 0;var P1=10;function bh(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 P1},set:function(r){if(typeof r!="number"||r<0||U1(r))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+r+".");P1=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||U1(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 k1(r){return r._maxListeners===void 0?Qt.defaultMaxListeners:r._maxListeners}Qt.prototype.getMaxListeners=function(){return k1(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 c=i[r];if(c===void 0)return!1;if(typeof c=="function")N1(c,this,e);else for(var h=c.length,u=H1(c,h),t=0;t<h;++t)N1(u[t],this,e);return!0};function Q1(r,e,t,n){var i,s,o;if(bh(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=k1(r),i>0&&o.length>i&&!o.warned){o.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=r,c.type=e,c.count=o.length,LS(c)}return r}Qt.prototype.addListener=function(r,e){return Q1(this,r,e,!1)},Qt.prototype.on=Qt.prototype.addListener,Qt.prototype.prependListener=function(r,e){return Q1(this,r,e,!0)};function NS(){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 F1(r,e,t){var n={fired:!1,wrapFn:void 0,target:r,type:e,listener:t},i=NS.bind(n);return i.listener=t,n.wrapFn=i,i}Qt.prototype.once=function(r,e){return bh(e),this.on(r,F1(this,r,e)),this},Qt.prototype.prependOnceListener=function(r,e){return bh(e),this.prependListener(r,F1(this,r,e)),this},Qt.prototype.removeListener=function(r,e){var t,n,i,s,o;if(bh(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():US(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 O1(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?PS(i):H1(i,i.length)}Qt.prototype.listeners=function(r){return O1(this,r,!0)},Qt.prototype.rawListeners=function(r){return O1(this,r,!1)},Qt.listenerCount=function(r,e){return typeof r.listenerCount=="function"?r.listenerCount(e):z1.call(r,e)},Qt.prototype.listenerCount=z1;function z1(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?Bh(this._events):[]};function H1(r,e){for(var t=new Array(e),n=0;n<e;++n)t[n]=r[n];return t}function US(r,e){for(;e+1<r.length;e++)r[e]=r[e+1];r.pop()}function PS(r){for(var e=new Array(r.length),t=0;t<e.length;++t)e[t]=r[t].listener||r[t];return e}function kS(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))}G1(r,e,s,{once:!0}),e!=="error"&&QS(r,i,{once:!0})})}function QS(r,e,t){typeof r.on=="function"&&G1(r,"error",e,t)}function G1(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 FS=Mp.exports;const V1=class T1 extends FS.EventEmitter{emitEvent(e,t){Object.keys(T1.EVENTS).includes(e)&&this.emit(T1.EVENTS[e],t)}};kt(V1,"EVENTS",{onAddToCart:"add-to-cart"});let OS=V1;var j1={exports:{}};function zS(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 W1={exports:{}};const HS={},GS=Object.freeze(Object.defineProperty({__proto__:null,default:HS},Symbol.toStringTag,{value:"Module"})),VS=DS(GS);var Y1;function wt(){return Y1||(Y1=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 zS=="function")try{s=VS}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.")},c=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=c(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,M=w.sigBytes;if(this.clamp(),R%4)for(var T=0;T<M;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<M;b+=4)x[R+b>>>2]=I[b>>>2];return this.sigBytes+=M,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=[],M=0;M<I;M++){var T=x[M>>>2]>>>24-M%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)}},v=p.Latin1={stringify:function(w){for(var x=w.words,I=w.sigBytes,R=[],M=0;M<I;M++){var T=x[M>>>2]>>>24-M%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(v.stringify(w)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(w){return v.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,M=I.sigBytes,T=this.blockSize,D=T*4,b=M/D;w?b=n.ceil(b):b=n.max((b|0)-this._minBufferSize,0);var S=b*T,L=n.min(S*4,M);if(S){for(var P=0;P<S;P+=T)this._doProcessBlock(R,P);x=R.splice(0,S),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 _.HMAC.init(w,I).finalize(x)}}});var _=h.algo={};return h}(Math);return t})}(W1)),W1.exports}var q1={exports:{}},X1;function Rh(){return X1||(X1=1,function(r,e){(function(t,n){r.exports=n(wt())})(yt,function(t){return function(n){var i=t,s=i.lib,o=s.Base,c=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 c.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})}(q1)),q1.exports}var K1={exports:{}},J1;function jS(){return J1||(J1=1,function(r,e){(function(t,n){r.exports=n(wt())})(yt,function(t){return function(){if(typeof ArrayBuffer=="function"){var n=t,i=n.lib,s=i.WordArray,o=s.init,c=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)};c.prototype=s}}(),t.lib.WordArray})}(K1)),K1.exports}var Z1={exports:{}},$1;function WS(){return $1||($1=1,function(r,e){(function(t,n){r.exports=n(wt())})(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=c(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]|=c(h.charCodeAt(A)<<16-A%2*16);return s.create(d,u*2)}};function c(h){return h<<8&4278255360|h>>>8&16711935}}(),t.enc.Utf16})}(Z1)),Z1.exports}var e_={exports:{}},t_;function Wa(){return t_||(t_=1,function(r,e){(function(t,n){r.exports=n(wt())})(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 v=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(_>>>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 v=h.indexOf(g);v!==-1&&(u=v)}return c(h,u,A)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function c(h,u,d){for(var A=[],p=0,g=0;g<u;g++)if(g%4){var v=d[h.charCodeAt(g-1)]<<g%4*2,E=d[h.charCodeAt(g)]>>>6-g%4*2,m=v|E;A[p>>>2]|=m<<24-p%4*8,p++}return s.create(A,p)}}(),t.enc.Base64})}(e_)),e_.exports}var r_={exports:{}},n_;function YS(){return n_||(n_=1,function(r,e){(function(t,n){r.exports=n(wt())})(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=[],v=0;v<A;v+=3)for(var E=d[v>>>2]>>>24-v%4*8&255,m=d[v+1>>>2]>>>24-(v+1)%4*8&255,_=d[v+2>>>2]>>>24-(v+2)%4*8&255,w=E<<16|m<<8|_,x=0;x<4&&v+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 v=A.charAt(64);if(v){var E=h.indexOf(v);E!==-1&&(d=E)}return c(h,d,p)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"};function c(h,u,d){for(var A=[],p=0,g=0;g<u;g++)if(g%4){var v=d[h.charCodeAt(g-1)]<<g%4*2,E=d[h.charCodeAt(g)]>>>6-g%4*2,m=v|E;A[p>>>2]|=m<<24-p%4*8,p++}return s.create(A,p)}}(),t.enc.Base64url})}(r_)),r_.exports}var i_={exports:{}},s_;function Ya(){return s_||(s_=1,function(r,e){(function(t,n){r.exports=n(wt())})(yt,function(t){return function(n){var i=t,s=i.lib,o=s.WordArray,c=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=c.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(E,m){for(var _=0;_<16;_++){var w=m+_,x=E[w];E[w]=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360}var I=this._hash.words,R=E[m+0],M=E[m+1],T=E[m+2],D=E[m+3],b=E[m+4],S=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],H=E[m+13],ee=E[m+14],Q=E[m+15],z=I[0],Z=I[1],re=I[2],G=I[3];z=A(z,Z,re,G,R,7,u[0]),G=A(G,z,Z,re,M,12,u[1]),re=A(re,G,z,Z,T,17,u[2]),Z=A(Z,re,G,z,D,22,u[3]),z=A(z,Z,re,G,b,7,u[4]),G=A(G,z,Z,re,S,12,u[5]),re=A(re,G,z,Z,L,17,u[6]),Z=A(Z,re,G,z,P,22,u[7]),z=A(z,Z,re,G,N,7,u[8]),G=A(G,z,Z,re,W,12,u[9]),re=A(re,G,z,Z,X,17,u[10]),Z=A(Z,re,G,z,K,22,u[11]),z=A(z,Z,re,G,te,7,u[12]),G=A(G,z,Z,re,H,12,u[13]),re=A(re,G,z,Z,ee,17,u[14]),Z=A(Z,re,G,z,Q,22,u[15]),z=p(z,Z,re,G,M,5,u[16]),G=p(G,z,Z,re,L,9,u[17]),re=p(re,G,z,Z,K,14,u[18]),Z=p(Z,re,G,z,R,20,u[19]),z=p(z,Z,re,G,S,5,u[20]),G=p(G,z,Z,re,X,9,u[21]),re=p(re,G,z,Z,Q,14,u[22]),Z=p(Z,re,G,z,b,20,u[23]),z=p(z,Z,re,G,W,5,u[24]),G=p(G,z,Z,re,ee,9,u[25]),re=p(re,G,z,Z,D,14,u[26]),Z=p(Z,re,G,z,N,20,u[27]),z=p(z,Z,re,G,H,5,u[28]),G=p(G,z,Z,re,T,9,u[29]),re=p(re,G,z,Z,P,14,u[30]),Z=p(Z,re,G,z,te,20,u[31]),z=g(z,Z,re,G,S,4,u[32]),G=g(G,z,Z,re,N,11,u[33]),re=g(re,G,z,Z,K,16,u[34]),Z=g(Z,re,G,z,ee,23,u[35]),z=g(z,Z,re,G,M,4,u[36]),G=g(G,z,Z,re,b,11,u[37]),re=g(re,G,z,Z,P,16,u[38]),Z=g(Z,re,G,z,X,23,u[39]),z=g(z,Z,re,G,H,4,u[40]),G=g(G,z,Z,re,R,11,u[41]),re=g(re,G,z,Z,D,16,u[42]),Z=g(Z,re,G,z,L,23,u[43]),z=g(z,Z,re,G,W,4,u[44]),G=g(G,z,Z,re,te,11,u[45]),re=g(re,G,z,Z,Q,16,u[46]),Z=g(Z,re,G,z,T,23,u[47]),z=v(z,Z,re,G,R,6,u[48]),G=v(G,z,Z,re,P,10,u[49]),re=v(re,G,z,Z,ee,15,u[50]),Z=v(Z,re,G,z,S,21,u[51]),z=v(z,Z,re,G,te,6,u[52]),G=v(G,z,Z,re,D,10,u[53]),re=v(re,G,z,Z,X,15,u[54]),Z=v(Z,re,G,z,M,21,u[55]),z=v(z,Z,re,G,N,6,u[56]),G=v(G,z,Z,re,Q,10,u[57]),re=v(re,G,z,Z,L,15,u[58]),Z=v(Z,re,G,z,H,21,u[59]),z=v(z,Z,re,G,b,6,u[60]),G=v(G,z,Z,re,K,10,u[61]),re=v(re,G,z,Z,T,15,u[62]),Z=v(Z,re,G,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]+G|0},_doFinalize:function(){var E=this._data,m=E.words,_=this._nDataBytes*8,w=E.sigBytes*8;m[w>>>5]|=128<<24-w%32;var x=n.floor(_/4294967296),I=_;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,M=R.words,T=0;T<4;T++){var D=M[T];M[T]=(D<<8|D>>>24)&16711935|(D<<24|D>>>8)&4278255360}return R},clone:function(){var E=c.clone.call(this);return E._hash=this._hash.clone(),E}});function A(E,m,_,w,x,I,R){var M=E+(m&_|~m&w)+x+R;return(M<<I|M>>>32-I)+m}function p(E,m,_,w,x,I,R){var M=E+(m&w|_&~w)+x+R;return(M<<I|M>>>32-I)+m}function g(E,m,_,w,x,I,R){var M=E+(m^_^w)+x+R;return(M<<I|M>>>32-I)+m}function v(E,m,_,w,x,I,R){var M=E+(_^(m|~w))+x+R;return(M<<I|M>>>32-I)+m}i.MD5=c._createHelper(d),i.HmacMD5=c._createHmacHelper(d)}(Math),t.MD5})}(i_)),i_.exports}var a_={exports:{}},o_;function l_(){return o_||(o_=1,function(r,e){(function(t,n){r.exports=n(wt())})(yt,function(t){return function(){var n=t,i=n.lib,s=i.WordArray,o=i.Hasher,c=n.algo,h=[],u=c.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],v=p[1],E=p[2],m=p[3],_=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)+_+h[w];w<20?I+=(v&E|~v&m)+1518500249:w<40?I+=(v^E^m)+1859775393:w<60?I+=(v&E|v&m|E&m)-1894007588:I+=(v^E^m)-899497514,_=m,m=E,E=v<<30|v>>>2,v=g,g=I}p[0]=p[0]+g|0,p[1]=p[1]+v|0,p[2]=p[2]+E|0,p[3]=p[3]+m|0,p[4]=p[4]+_|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})}(a_)),a_.exports}var c_={exports:{}},u_;function Tp(){return u_||(u_=1,function(r,e){(function(t,n){r.exports=n(wt())})(yt,function(t){return function(n){var i=t,s=i.lib,o=s.WordArray,c=s.Hasher,h=i.algo,u=[],d=[];(function(){function g(_){for(var w=n.sqrt(_),x=2;x<=w;x++)if(!(_%x))return!1;return!0}function v(_){return(_-(_|0))*4294967296|0}for(var E=2,m=0;m<64;)g(E)&&(m<8&&(u[m]=v(n.pow(E,1/2))),d[m]=v(n.pow(E,1/3)),m++),E++})();var A=[],p=h.SHA256=c.extend({_doReset:function(){this._hash=new o.init(u.slice(0))},_doProcessBlock:function(g,v){for(var E=this._hash.words,m=E[0],_=E[1],w=E[2],x=E[3],I=E[4],R=E[5],M=E[6],T=E[7],D=0;D<64;D++){if(D<16)A[D]=g[v+D]|0;else{var b=A[D-15],S=(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]=S+A[D-7]+P+A[D-16]}var N=I&R^~I&M,W=m&_^m&w^_&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],H=X+W;T=M,M=R,R=I,I=x+te|0,x=w,w=_,_=m,m=te+H|0}E[0]=E[0]+m|0,E[1]=E[1]+_|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]+M|0,E[7]=E[7]+T|0},_doFinalize:function(){var g=this._data,v=g.words,E=this._nDataBytes*8,m=g.sigBytes*8;return v[m>>>5]|=128<<24-m%32,v[(m+64>>>9<<4)+14]=n.floor(E/4294967296),v[(m+64>>>9<<4)+15]=E,g.sigBytes=v.length*4,this._process(),this._hash},clone:function(){var g=c.clone.call(this);return g._hash=this._hash.clone(),g}});i.SHA256=c._createHelper(p),i.HmacSHA256=c._createHmacHelper(p)}(Math),t.SHA256})}(c_)),c_.exports}var h_={exports:{}},d_;function qS(){return d_||(d_=1,function(r,e){(function(t,n,i){r.exports=n(wt(),Tp())})(yt,function(t){return function(){var n=t,i=n.lib,s=i.WordArray,o=n.algo,c=o.SHA256,h=o.SHA224=c.extend({_doReset:function(){this._hash=new s.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var u=c._doFinalize.call(this);return u.sigBytes-=4,u}});n.SHA224=c._createHelper(h),n.HmacSHA224=c._createHmacHelper(h)}(),t.SHA224})}(h_)),h_.exports}var f_={exports:{}},p_;function A_(){return p_||(p_=1,function(r,e){(function(t,n,i){r.exports=n(wt(),Rh())})(yt,function(t){return function(){var n=t,i=n.lib,s=i.Hasher,o=n.x64,c=o.Word,h=o.WordArray,u=n.algo;function d(){return c.create.apply(c,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 v=0;v<80;v++)p[v]=d()})();var g=u.SHA512=s.extend({_doReset:function(){this._hash=new h.init([new c.init(1779033703,4089235720),new c.init(3144134277,2227873595),new c.init(1013904242,4271175723),new c.init(2773480762,1595750129),new c.init(1359893119,2917565137),new c.init(2600822924,725511199),new c.init(528734635,4215389547),new c.init(1541459225,327033209)])},_doProcessBlock:function(v,E){for(var m=this._hash.words,_=m[0],w=m[1],x=m[2],I=m[3],R=m[4],M=m[5],T=m[6],D=m[7],b=_.high,S=_.low,L=w.high,P=w.low,N=x.high,W=x.low,X=I.high,K=I.low,te=R.high,H=R.low,ee=M.high,Q=M.low,z=T.high,Z=T.low,re=D.high,G=D.low,de=b,pe=S,fe=L,ye=P,Pe=N,at=W,se=X,et=K,ke=te,dt=H,Xe=ee,ft=Q,Y=z,k=Z,le=re,Ae=G,me=0;me<80;me++){var Ee,Oe,Ce=p[me];if(me<16)Oe=Ce.high=v[E+me*2]|0,Ee=Ce.low=v[E+me*2+1]|0;else{var Qe=p[me-15],ve=Qe.high,xe=Qe.low,Be=(ve>>>1|xe<<31)^(ve>>>8|xe<<24)^ve>>>7,We=(xe>>>1|ve<<31)^(xe>>>8|ve<<24)^(xe>>>7|ve<<25),Le=p[me-2],be=Le.high,nt=Le.low,pt=(be>>>19|nt<<13)^(be<<3|nt>>>29)^be>>>6,ct=(nt>>>19|be<<13)^(nt<<3|be>>>29)^(nt>>>6|be<<26),ut=p[me-7],tt=ut.high,V=ut.low,F=p[me-16],ge=F.high,_e=F.low;Ee=We+V,Oe=Be+tt+(Ee>>>0<We>>>0?1:0),Ee=Ee+ct,Oe=Oe+pt+(Ee>>>0<ct>>>0?1:0),Ee=Ee+_e,Oe=Oe+ge+(Ee>>>0<_e>>>0?1:0),Ce.high=Oe,Ce.low=Ee}var ze=ke&Xe^~ke&Y,Ne=dt&ft^~dt&k,_t=de&fe^de&Pe^fe&Pe,Dt=pe&ye^pe&at^ye&at,Lt=(de>>>28|pe<<4)^(de<<30|pe>>>2)^(de<<25|pe>>>7),Mt=(pe>>>28|de<<4)^(pe<<30|de>>>2)^(pe<<25|de>>>7),vt=(ke>>>14|dt<<18)^(ke>>>18|dt<<14)^(ke<<23|dt>>>9),hr=(dt>>>14|ke<<18)^(dt>>>18|ke<<14)^(dt<<23|ke>>>9),Vt=A[me],_r=Vt.high,bn=Vt.low,qt=Ae+hr,hi=le+vt+(qt>>>0<Ae>>>0?1:0),qt=qt+Ne,hi=hi+ze+(qt>>>0<Ne>>>0?1:0),qt=qt+bn,hi=hi+_r+(qt>>>0<bn>>>0?1:0),qt=qt+Ee,hi=hi+Oe+(qt>>>0<Ee>>>0?1:0),Jn=Mt+Dt,Ns=Lt+_t+(Jn>>>0<Mt>>>0?1:0);le=Y,Ae=k,Y=Xe,k=ft,Xe=ke,ft=dt,dt=et+qt|0,ke=se+hi+(dt>>>0<et>>>0?1:0)|0,se=Pe,et=at,Pe=fe,at=ye,fe=de,ye=pe,pe=qt+Jn|0,de=hi+Ns+(pe>>>0<qt>>>0?1:0)|0}S=_.low=S+pe,_.high=b+de+(S>>>0<pe>>>0?1:0),P=w.low=P+ye,w.high=L+fe+(P>>>0<ye>>>0?1:0),W=x.low=W+at,x.high=N+Pe+(W>>>0<at>>>0?1:0),K=I.low=K+et,I.high=X+se+(K>>>0<et>>>0?1:0),H=R.low=H+dt,R.high=te+ke+(H>>>0<dt>>>0?1:0),Q=M.low=Q+ft,M.high=ee+Xe+(Q>>>0<ft>>>0?1:0),Z=T.low=Z+k,T.high=z+Y+(Z>>>0<k>>>0?1:0),G=D.low=G+Ae,D.high=re+le+(G>>>0<Ae>>>0?1:0)},_doFinalize:function(){var v=this._data,E=v.words,m=this._nDataBytes*8,_=v.sigBytes*8;E[_>>>5]|=128<<24-_%32,E[(_+128>>>10<<5)+30]=Math.floor(m/4294967296),E[(_+128>>>10<<5)+31]=m,v.sigBytes=E.length*4,this._process();var w=this._hash.toX32();return w},clone:function(){var v=s.clone.call(this);return v._hash=this._hash.clone(),v},blockSize:1024/32});n.SHA512=s._createHelper(g),n.HmacSHA512=s._createHmacHelper(g)}(),t.SHA512})}(f_)),f_.exports}var g_={exports:{}},m_;function XS(){return m_||(m_=1,function(r,e){(function(t,n,i){r.exports=n(wt(),Rh(),A_())})(yt,function(t){return function(){var n=t,i=n.x64,s=i.Word,o=i.WordArray,c=n.algo,h=c.SHA512,u=c.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})}(g_)),g_.exports}var __={exports:{}},v_;function KS(){return v_||(v_=1,function(r,e){(function(t,n,i){r.exports=n(wt(),Rh())})(yt,function(t){return function(n){var i=t,s=i.lib,o=s.WordArray,c=s.Hasher,h=i.x64,u=h.Word,d=i.algo,A=[],p=[],g=[];(function(){for(var m=1,_=0,w=0;w<24;w++){A[m+5*_]=(w+1)*(w+2)/2%64;var x=_%5,I=(2*m+3*_)%5;m=x,_=I}for(var m=0;m<5;m++)for(var _=0;_<5;_++)p[m+5*_]=_+(2*m+3*_)%5*5;for(var R=1,M=0;M<24;M++){for(var T=0,D=0,b=0;b<7;b++){if(R&1){var S=(1<<b)-1;S<32?D^=1<<S:T^=1<<S-32}R&128?R=R<<1^113:R<<=1}g[M]=u.create(T,D)}})();var v=[];(function(){for(var m=0;m<25;m++)v[m]=u.create()})();var E=d.SHA3=c.extend({cfg:c.cfg.extend({outputLength:512}),_doReset:function(){for(var m=this._state=[],_=0;_<25;_++)m[_]=new u.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(m,_){for(var w=this._state,x=this.blockSize/2,I=0;I<x;I++){var R=m[_+2*I],M=m[_+2*I+1];R=(R<<8|R>>>24)&16711935|(R<<24|R>>>8)&4278255360,M=(M<<8|M>>>24)&16711935|(M<<24|M>>>8)&4278255360;var T=w[I];T.high^=M,T.low^=R}for(var D=0;D<24;D++){for(var b=0;b<5;b++){for(var S=0,L=0,P=0;P<5;P++){var T=w[b+5*P];S^=T.high,L^=T.low}var N=v[b];N.high=S,N.low=L}for(var b=0;b<5;b++)for(var W=v[(b+4)%5],X=v[(b+1)%5],K=X.high,te=X.low,S=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^=S,T.low^=L}for(var H=1;H<25;H++){var S,L,T=w[H],ee=T.high,Q=T.low,z=A[H];z<32?(S=ee<<z|Q>>>32-z,L=Q<<z|ee>>>32-z):(S=Q<<z-32|ee>>>64-z,L=ee<<z-32|Q>>>64-z);var Z=v[p[H]];Z.high=S,Z.low=L}var re=v[0],G=w[0];re.high=G.high,re.low=G.low;for(var b=0;b<5;b++)for(var P=0;P<5;P++){var H=b+5*P,T=w[H],de=v[H],pe=v[(b+1)%5+5*P],fe=v[(b+2)%5+5*P];T.high=de.high^~pe.high&fe.high,T.low=de.low^~pe.low&fe.low}var T=w[0],ye=g[D];T.high^=ye.high,T.low^=ye.low}},_doFinalize:function(){var m=this._data,_=m.words;this._nDataBytes*8;var w=m.sigBytes*8,x=this.blockSize*32;_[w>>>5]|=1<<24-w%32,_[(n.ceil((w+1)/x)*x>>>5)-1]|=128,m.sigBytes=_.length*4,this._process();for(var I=this._state,R=this.cfg.outputLength/8,M=R/8,T=[],D=0;D<M;D++){var b=I[D],S=b.high,L=b.low;S=(S<<8|S>>>24)&16711935|(S<<24|S>>>8)&4278255360,L=(L<<8|L>>>24)&16711935|(L<<24|L>>>8)&4278255360,T.push(L),T.push(S)}return new o.init(T,R)},clone:function(){for(var m=c.clone.call(this),_=m._state=this._state.slice(0),w=0;w<25;w++)_[w]=_[w].clone();return m}});i.SHA3=c._createHelper(E),i.HmacSHA3=c._createHmacHelper(E)}(Math),t.SHA3})}(__)),__.exports}var y_={exports:{}},E_;function JS(){return E_||(E_=1,function(r,e){(function(t,n){r.exports=n(wt())})(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:
@@ -3773,7 +3773,7 @@ Material Type: `+L.type+`
3773
3773
 
3774
3774
  Program Info Log: `+P+`
3775
3775
  `+te+`
3776
- `+H)}else P!==""?console.warn("THREE.WebGLProgram: Program Info Log:",P):(N===""||W==="")&&(K=!1);K&&(L.diagnostics={runnable:X,programLog:P,vertexShader:{log:N,prefix:m},fragmentShader:{log:W,prefix:_}})}i.deleteShader(R),i.deleteShader(M),D=new Bd(i,E),b=$D(i,E)}let D;this.getUniforms=function(){return D===void 0&&T(this),D};let b;this.getAttributes=function(){return b===void 0&&T(this),b};let S=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return S===!1&&(S=i.getProgramParameter(E,jD)),S},this.destroy=function(){n.releaseStatesOfProgram(this),i.deleteProgram(E),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=WD++,this.cacheKey=e,this.usedTimes=1,this.program=E,this.vertexShader=R,this.fragmentShader=M,this}let hL=0;class dL{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,n=e.fragmentShader,i=this._getShaderStage(t),s=this._getShaderStage(n),o=this._getShaderCacheForMaterial(e);return o.has(i)===!1&&(o.add(i),i.usedTimes++),o.has(s)===!1&&(o.add(s),s.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const n of t)n.usedTimes--,n.usedTimes===0&&this.shaderCache.delete(n.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let n=t.get(e);return n===void 0&&(n=new Set,t.set(e,n)),n}_getShaderStage(e){const t=this.shaderCache;let n=t.get(e);return n===void 0&&(n=new fL(e),t.set(e,n)),n}}class fL{constructor(e){this.id=hL++,this.code=e,this.usedTimes=0}}function pL(r,e,t,n,i,s,o){const c=new PA,h=new dL,u=new Set,d=[],A=i.logarithmicDepthBuffer,p=i.vertexTextures;let g=i.precision;const v={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function E(b){return u.add(b),b===0?"uv":`uv${b}`}function m(b,S,L,P,N){const W=P.fog,X=N.geometry,K=b.isMeshStandardMaterial?P.environment:null,te=(b.isMeshStandardMaterial?t:e).get(b.envMap||K),H=te&&te.mapping===Wh?te.image.height:null,ee=v[b.type];b.precision!==null&&(g=i.getMaxPrecision(b.precision),g!==b.precision&&console.warn("THREE.WebGLProgram.getParameters:",b.precision,"not supported, using",g,"instead."));const Q=X.morphAttributes.position||X.morphAttributes.normal||X.morphAttributes.color,z=Q!==void 0?Q.length:0;let Z=0;X.morphAttributes.position!==void 0&&(Z=1),X.morphAttributes.normal!==void 0&&(Z=2),X.morphAttributes.color!==void 0&&(Z=3);let re,G,de,pe;if(ee){const Mt=Ki[ee];re=Mt.vertexShader,G=Mt.fragmentShader}else re=b.vertexShader,G=b.fragmentShader,h.update(b),de=h.getVertexShaderID(b),pe=h.getFragmentShaderID(b);const fe=r.getRenderTarget(),ye=N.isInstancedMesh===!0,Pe=N.isBatchedMesh===!0,at=!!b.map,se=!!b.matcap,et=!!te,ke=!!b.aoMap,dt=!!b.lightMap,Xe=!!b.bumpMap,ft=!!b.normalMap,Y=!!b.displacementMap,k=!!b.emissiveMap,le=!!b.metalnessMap,Ae=!!b.roughnessMap,me=b.anisotropy>0,Ee=b.clearcoat>0,Oe=b.iridescence>0,Ce=b.sheen>0,Qe=b.transmission>0,ve=me&&!!b.anisotropyMap,xe=Ee&&!!b.clearcoatMap,Be=Ee&&!!b.clearcoatNormalMap,Ye=Ee&&!!b.clearcoatRoughnessMap,Le=Oe&&!!b.iridescenceMap,be=Oe&&!!b.iridescenceThicknessMap,nt=Ce&&!!b.sheenColorMap,pt=Ce&&!!b.sheenRoughnessMap,ct=!!b.specularMap,ut=!!b.specularColorMap,tt=!!b.specularIntensityMap,V=Qe&&!!b.transmissionMap,F=Qe&&!!b.thicknessMap,ge=!!b.gradientMap,_e=!!b.alphaMap,ze=b.alphaTest>0,Ne=!!b.alphaHash,_t=!!b.extensions;let Dt=Zs;b.toneMapped&&(fe===null||fe.isXRRenderTarget===!0)&&(Dt=r.toneMapping);const Lt={shaderID:ee,shaderType:b.type,shaderName:b.name,vertexShader:re,fragmentShader:G,defines:b.defines,customVertexShaderID:de,customFragmentShaderID:pe,isRawShaderMaterial:b.isRawShaderMaterial===!0,glslVersion:b.glslVersion,precision:g,batching:Pe,instancing:ye,instancingColor:ye&&N.instanceColor!==null,instancingMorph:ye&&N.morphTexture!==null,supportsVertexTextures:p,outputColorSpace:fe===null?r.outputColorSpace:fe.isXRRenderTarget===!0?fe.texture.colorSpace:Sr,alphaToCoverage:!!b.alphaToCoverage,map:at,matcap:se,envMap:et,envMapMode:et&&te.mapping,envMapCubeUVHeight:H,aoMap:ke,lightMap:dt,bumpMap:Xe,normalMap:ft,displacementMap:p&&Y,emissiveMap:k,normalMapObjectSpace:ft&&b.normalMapType===lb,normalMapTangentSpace:ft&&b.normalMapType===mE,metalnessMap:le,roughnessMap:Ae,anisotropy:me,anisotropyMap:ve,clearcoat:Ee,clearcoatMap:xe,clearcoatNormalMap:Be,clearcoatRoughnessMap:Ye,iridescence:Oe,iridescenceMap:Le,iridescenceThicknessMap:be,sheen:Ce,sheenColorMap:nt,sheenRoughnessMap:pt,specularMap:ct,specularColorMap:ut,specularIntensityMap:tt,transmission:Qe,transmissionMap:V,thicknessMap:F,gradientMap:ge,opaque:b.transparent===!1&&b.blending===rl&&b.alphaToCoverage===!1,alphaMap:_e,alphaTest:ze,alphaHash:Ne,combine:b.combine,mapUv:at&&E(b.map.channel),aoMapUv:ke&&E(b.aoMap.channel),lightMapUv:dt&&E(b.lightMap.channel),bumpMapUv:Xe&&E(b.bumpMap.channel),normalMapUv:ft&&E(b.normalMap.channel),displacementMapUv:Y&&E(b.displacementMap.channel),emissiveMapUv:k&&E(b.emissiveMap.channel),metalnessMapUv:le&&E(b.metalnessMap.channel),roughnessMapUv:Ae&&E(b.roughnessMap.channel),anisotropyMapUv:ve&&E(b.anisotropyMap.channel),clearcoatMapUv:xe&&E(b.clearcoatMap.channel),clearcoatNormalMapUv:Be&&E(b.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Ye&&E(b.clearcoatRoughnessMap.channel),iridescenceMapUv:Le&&E(b.iridescenceMap.channel),iridescenceThicknessMapUv:be&&E(b.iridescenceThicknessMap.channel),sheenColorMapUv:nt&&E(b.sheenColorMap.channel),sheenRoughnessMapUv:pt&&E(b.sheenRoughnessMap.channel),specularMapUv:ct&&E(b.specularMap.channel),specularColorMapUv:ut&&E(b.specularColorMap.channel),specularIntensityMapUv:tt&&E(b.specularIntensityMap.channel),transmissionMapUv:V&&E(b.transmissionMap.channel),thicknessMapUv:F&&E(b.thicknessMap.channel),alphaMapUv:_e&&E(b.alphaMap.channel),vertexTangents:!!X.attributes.tangent&&(ft||me),vertexColors:b.vertexColors,vertexAlphas:b.vertexColors===!0&&!!X.attributes.color&&X.attributes.color.itemSize===4,pointsUvs:N.isPoints===!0&&!!X.attributes.uv&&(at||_e),fog:!!W,useFog:b.fog===!0,fogExp2:!!W&&W.isFogExp2,flatShading:b.flatShading===!0,sizeAttenuation:b.sizeAttenuation===!0,logarithmicDepthBuffer:A,skinning:N.isSkinnedMesh===!0,morphTargets:X.morphAttributes.position!==void 0,morphNormals:X.morphAttributes.normal!==void 0,morphColors:X.morphAttributes.color!==void 0,morphTargetsCount:z,morphTextureStride:Z,numDirLights:S.directional.length,numPointLights:S.point.length,numSpotLights:S.spot.length,numSpotLightMaps:S.spotLightMap.length,numRectAreaLights:S.rectArea.length,numHemiLights:S.hemi.length,numDirLightShadows:S.directionalShadowMap.length,numPointLightShadows:S.pointShadowMap.length,numSpotLightShadows:S.spotShadowMap.length,numSpotLightShadowsWithMaps:S.numSpotLightShadowsWithMaps,numLightProbes:S.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:b.dithering,shadowMapEnabled:r.shadowMap.enabled&&L.length>0,shadowMapType:r.shadowMap.type,toneMapping:Dt,useLegacyLights:r._useLegacyLights,decodeVideoTexture:at&&b.map.isVideoTexture===!0&&Rt.getTransfer(b.map.colorSpace)===Ht,premultipliedAlpha:b.premultipliedAlpha,doubleSided:b.side===Ei,flipSided:b.side===kr,useDepthPacking:b.depthPacking>=0,depthPacking:b.depthPacking||0,index0AttributeName:b.index0AttributeName,extensionClipCullDistance:_t&&b.extensions.clipCullDistance===!0&&n.has("WEBGL_clip_cull_distance"),extensionMultiDraw:_t&&b.extensions.multiDraw===!0&&n.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:n.has("KHR_parallel_shader_compile"),customProgramCacheKey:b.customProgramCacheKey()};return Lt.vertexUv1s=u.has(1),Lt.vertexUv2s=u.has(2),Lt.vertexUv3s=u.has(3),u.clear(),Lt}function _(b){const S=[];if(b.shaderID?S.push(b.shaderID):(S.push(b.customVertexShaderID),S.push(b.customFragmentShaderID)),b.defines!==void 0)for(const L in b.defines)S.push(L),S.push(b.defines[L]);return b.isRawShaderMaterial===!1&&(w(S,b),x(S,b),S.push(r.outputColorSpace)),S.push(b.customProgramCacheKey),S.join()}function w(b,S){b.push(S.precision),b.push(S.outputColorSpace),b.push(S.envMapMode),b.push(S.envMapCubeUVHeight),b.push(S.mapUv),b.push(S.alphaMapUv),b.push(S.lightMapUv),b.push(S.aoMapUv),b.push(S.bumpMapUv),b.push(S.normalMapUv),b.push(S.displacementMapUv),b.push(S.emissiveMapUv),b.push(S.metalnessMapUv),b.push(S.roughnessMapUv),b.push(S.anisotropyMapUv),b.push(S.clearcoatMapUv),b.push(S.clearcoatNormalMapUv),b.push(S.clearcoatRoughnessMapUv),b.push(S.iridescenceMapUv),b.push(S.iridescenceThicknessMapUv),b.push(S.sheenColorMapUv),b.push(S.sheenRoughnessMapUv),b.push(S.specularMapUv),b.push(S.specularColorMapUv),b.push(S.specularIntensityMapUv),b.push(S.transmissionMapUv),b.push(S.thicknessMapUv),b.push(S.combine),b.push(S.fogExp2),b.push(S.sizeAttenuation),b.push(S.morphTargetsCount),b.push(S.morphAttributeCount),b.push(S.numDirLights),b.push(S.numPointLights),b.push(S.numSpotLights),b.push(S.numSpotLightMaps),b.push(S.numHemiLights),b.push(S.numRectAreaLights),b.push(S.numDirLightShadows),b.push(S.numPointLightShadows),b.push(S.numSpotLightShadows),b.push(S.numSpotLightShadowsWithMaps),b.push(S.numLightProbes),b.push(S.shadowMapType),b.push(S.toneMapping),b.push(S.numClippingPlanes),b.push(S.numClipIntersection),b.push(S.depthPacking)}function x(b,S){c.disableAll(),S.supportsVertexTextures&&c.enable(0),S.instancing&&c.enable(1),S.instancingColor&&c.enable(2),S.instancingMorph&&c.enable(3),S.matcap&&c.enable(4),S.envMap&&c.enable(5),S.normalMapObjectSpace&&c.enable(6),S.normalMapTangentSpace&&c.enable(7),S.clearcoat&&c.enable(8),S.iridescence&&c.enable(9),S.alphaTest&&c.enable(10),S.vertexColors&&c.enable(11),S.vertexAlphas&&c.enable(12),S.vertexUv1s&&c.enable(13),S.vertexUv2s&&c.enable(14),S.vertexUv3s&&c.enable(15),S.vertexTangents&&c.enable(16),S.anisotropy&&c.enable(17),S.alphaHash&&c.enable(18),S.batching&&c.enable(19),b.push(c.mask),c.disableAll(),S.fog&&c.enable(0),S.useFog&&c.enable(1),S.flatShading&&c.enable(2),S.logarithmicDepthBuffer&&c.enable(3),S.skinning&&c.enable(4),S.morphTargets&&c.enable(5),S.morphNormals&&c.enable(6),S.morphColors&&c.enable(7),S.premultipliedAlpha&&c.enable(8),S.shadowMapEnabled&&c.enable(9),S.useLegacyLights&&c.enable(10),S.doubleSided&&c.enable(11),S.flipSided&&c.enable(12),S.useDepthPacking&&c.enable(13),S.dithering&&c.enable(14),S.transmission&&c.enable(15),S.sheen&&c.enable(16),S.opaque&&c.enable(17),S.pointsUvs&&c.enable(18),S.decodeVideoTexture&&c.enable(19),S.alphaToCoverage&&c.enable(20),b.push(c.mask)}function I(b){const S=v[b.type];let L;if(S){const P=Ki[S];L=Id.clone(P.uniforms)}else L=b.uniforms;return L}function R(b,S){let L;for(let P=0,N=d.length;P<N;P++){const W=d[P];if(W.cacheKey===S){L=W,++L.usedTimes;break}}return L===void 0&&(L=new uL(r,S,b,s),d.push(L)),L}function M(b){if(--b.usedTimes===0){const S=d.indexOf(b);d[S]=d[d.length-1],d.pop(),b.destroy()}}function T(b){h.remove(b)}function D(){h.dispose()}return{getParameters:m,getProgramCacheKey:_,getUniforms:I,acquireProgram:R,releaseProgram:M,releaseShaderCache:T,programs:d,dispose:D}}function AL(){let r=new WeakMap;function e(s){let o=r.get(s);return o===void 0&&(o={},r.set(s,o)),o}function t(s){r.delete(s)}function n(s,o,c){r.get(s)[o]=c}function i(){r=new WeakMap}return{get:e,remove:t,update:n,dispose:i}}function gL(r,e){return r.groupOrder!==e.groupOrder?r.groupOrder-e.groupOrder:r.renderOrder!==e.renderOrder?r.renderOrder-e.renderOrder:r.material.id!==e.material.id?r.material.id-e.material.id:r.z!==e.z?r.z-e.z:r.id-e.id}function I2(r,e){return r.groupOrder!==e.groupOrder?r.groupOrder-e.groupOrder:r.renderOrder!==e.renderOrder?r.renderOrder-e.renderOrder:r.z!==e.z?e.z-r.z:r.id-e.id}function C2(){const r=[];let e=0;const t=[],n=[],i=[];function s(){e=0,t.length=0,n.length=0,i.length=0}function o(A,p,g,v,E,m){let _=r[e];return _===void 0?(_={id:A.id,object:A,geometry:p,material:g,groupOrder:v,renderOrder:A.renderOrder,z:E,group:m},r[e]=_):(_.id=A.id,_.object=A,_.geometry=p,_.material=g,_.groupOrder=v,_.renderOrder=A.renderOrder,_.z=E,_.group=m),e++,_}function c(A,p,g,v,E,m){const _=o(A,p,g,v,E,m);g.transmission>0?n.push(_):g.transparent===!0?i.push(_):t.push(_)}function h(A,p,g,v,E,m){const _=o(A,p,g,v,E,m);g.transmission>0?n.unshift(_):g.transparent===!0?i.unshift(_):t.unshift(_)}function u(A,p){t.length>1&&t.sort(A||gL),n.length>1&&n.sort(p||I2),i.length>1&&i.sort(p||I2)}function d(){for(let A=e,p=r.length;A<p;A++){const g=r[A];if(g.id===null)break;g.id=null,g.object=null,g.geometry=null,g.material=null,g.group=null}}return{opaque:t,transmissive:n,transparent:i,init:s,push:c,unshift:h,finish:d,sort:u}}function mL(){let r=new WeakMap;function e(n,i){const s=r.get(n);let o;return s===void 0?(o=new C2,r.set(n,[o])):i>=s.length?(o=new C2,s.push(o)):o=s[i],o}function t(){r=new WeakMap}return{get:e,dispose:t}}function _L(){const r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new j,color:new Ke};break;case"SpotLight":t={position:new j,direction:new j,color:new Ke,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new j,color:new Ke,distance:0,decay:0};break;case"HemisphereLight":t={direction:new j,skyColor:new Ke,groundColor:new Ke};break;case"RectAreaLight":t={color:new Ke,position:new j,halfWidth:new j,halfHeight:new j};break}return r[e.id]=t,t}}}function vL(){const r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ge};break;case"SpotLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ge};break;case"PointLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ge,shadowCameraNear:1,shadowCameraFar:1e3};break}return r[e.id]=t,t}}}let yL=0;function EL(r,e){return(e.castShadow?2:0)-(r.castShadow?2:0)+(e.map?1:0)-(r.map?1:0)}function xL(r){const e=new _L,t=vL(),n={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let u=0;u<9;u++)n.probe.push(new j);const i=new j,s=new st,o=new st;function c(u,d){let A=0,p=0,g=0;for(let L=0;L<9;L++)n.probe[L].set(0,0,0);let v=0,E=0,m=0,_=0,w=0,x=0,I=0,R=0,M=0,T=0,D=0;u.sort(EL);const b=d===!0?Math.PI:1;for(let L=0,P=u.length;L<P;L++){const N=u[L],W=N.color,X=N.intensity,K=N.distance,te=N.shadow&&N.shadow.map?N.shadow.map.texture:null;if(N.isAmbientLight)A+=W.r*X*b,p+=W.g*X*b,g+=W.b*X*b;else if(N.isLightProbe){for(let H=0;H<9;H++)n.probe[H].addScaledVector(N.sh.coefficients[H],X);D++}else if(N.isDirectionalLight){const H=e.get(N);if(H.color.copy(N.color).multiplyScalar(N.intensity*b),N.castShadow){const ee=N.shadow,Q=t.get(N);Q.shadowBias=ee.bias,Q.shadowNormalBias=ee.normalBias,Q.shadowRadius=ee.radius,Q.shadowMapSize=ee.mapSize,n.directionalShadow[v]=Q,n.directionalShadowMap[v]=te,n.directionalShadowMatrix[v]=N.shadow.matrix,x++}n.directional[v]=H,v++}else if(N.isSpotLight){const H=e.get(N);H.position.setFromMatrixPosition(N.matrixWorld),H.color.copy(W).multiplyScalar(X*b),H.distance=K,H.coneCos=Math.cos(N.angle),H.penumbraCos=Math.cos(N.angle*(1-N.penumbra)),H.decay=N.decay,n.spot[m]=H;const ee=N.shadow;if(N.map&&(n.spotLightMap[M]=N.map,M++,ee.updateMatrices(N),N.castShadow&&T++),n.spotLightMatrix[m]=ee.matrix,N.castShadow){const Q=t.get(N);Q.shadowBias=ee.bias,Q.shadowNormalBias=ee.normalBias,Q.shadowRadius=ee.radius,Q.shadowMapSize=ee.mapSize,n.spotShadow[m]=Q,n.spotShadowMap[m]=te,R++}m++}else if(N.isRectAreaLight){const H=e.get(N);H.color.copy(W).multiplyScalar(X),H.halfWidth.set(N.width*.5,0,0),H.halfHeight.set(0,N.height*.5,0),n.rectArea[_]=H,_++}else if(N.isPointLight){const H=e.get(N);if(H.color.copy(N.color).multiplyScalar(N.intensity*b),H.distance=N.distance,H.decay=N.decay,N.castShadow){const ee=N.shadow,Q=t.get(N);Q.shadowBias=ee.bias,Q.shadowNormalBias=ee.normalBias,Q.shadowRadius=ee.radius,Q.shadowMapSize=ee.mapSize,Q.shadowCameraNear=ee.camera.near,Q.shadowCameraFar=ee.camera.far,n.pointShadow[E]=Q,n.pointShadowMap[E]=te,n.pointShadowMatrix[E]=N.shadow.matrix,I++}n.point[E]=H,E++}else if(N.isHemisphereLight){const H=e.get(N);H.skyColor.copy(N.color).multiplyScalar(X*b),H.groundColor.copy(N.groundColor).multiplyScalar(X*b),n.hemi[w]=H,w++}}_>0&&(r.has("OES_texture_float_linear")===!0?(n.rectAreaLTC1=De.LTC_FLOAT_1,n.rectAreaLTC2=De.LTC_FLOAT_2):(n.rectAreaLTC1=De.LTC_HALF_1,n.rectAreaLTC2=De.LTC_HALF_2)),n.ambient[0]=A,n.ambient[1]=p,n.ambient[2]=g;const S=n.hash;(S.directionalLength!==v||S.pointLength!==E||S.spotLength!==m||S.rectAreaLength!==_||S.hemiLength!==w||S.numDirectionalShadows!==x||S.numPointShadows!==I||S.numSpotShadows!==R||S.numSpotMaps!==M||S.numLightProbes!==D)&&(n.directional.length=v,n.spot.length=m,n.rectArea.length=_,n.point.length=E,n.hemi.length=w,n.directionalShadow.length=x,n.directionalShadowMap.length=x,n.pointShadow.length=I,n.pointShadowMap.length=I,n.spotShadow.length=R,n.spotShadowMap.length=R,n.directionalShadowMatrix.length=x,n.pointShadowMatrix.length=I,n.spotLightMatrix.length=R+M-T,n.spotLightMap.length=M,n.numSpotLightShadowsWithMaps=T,n.numLightProbes=D,S.directionalLength=v,S.pointLength=E,S.spotLength=m,S.rectAreaLength=_,S.hemiLength=w,S.numDirectionalShadows=x,S.numPointShadows=I,S.numSpotShadows=R,S.numSpotMaps=M,S.numLightProbes=D,n.version=yL++)}function h(u,d){let A=0,p=0,g=0,v=0,E=0;const m=d.matrixWorldInverse;for(let _=0,w=u.length;_<w;_++){const x=u[_];if(x.isDirectionalLight){const I=n.directional[A];I.direction.setFromMatrixPosition(x.matrixWorld),i.setFromMatrixPosition(x.target.matrixWorld),I.direction.sub(i),I.direction.transformDirection(m),A++}else if(x.isSpotLight){const I=n.spot[g];I.position.setFromMatrixPosition(x.matrixWorld),I.position.applyMatrix4(m),I.direction.setFromMatrixPosition(x.matrixWorld),i.setFromMatrixPosition(x.target.matrixWorld),I.direction.sub(i),I.direction.transformDirection(m),g++}else if(x.isRectAreaLight){const I=n.rectArea[v];I.position.setFromMatrixPosition(x.matrixWorld),I.position.applyMatrix4(m),o.identity(),s.copy(x.matrixWorld),s.premultiply(m),o.extractRotation(s),I.halfWidth.set(x.width*.5,0,0),I.halfHeight.set(0,x.height*.5,0),I.halfWidth.applyMatrix4(o),I.halfHeight.applyMatrix4(o),v++}else if(x.isPointLight){const I=n.point[p];I.position.setFromMatrixPosition(x.matrixWorld),I.position.applyMatrix4(m),p++}else if(x.isHemisphereLight){const I=n.hemi[E];I.direction.setFromMatrixPosition(x.matrixWorld),I.direction.transformDirection(m),E++}}}return{setup:c,setupView:h,state:n}}function S2(r){const e=new xL(r),t=[],n=[];function i(){t.length=0,n.length=0}function s(u){t.push(u)}function o(u){n.push(u)}function c(u){e.setup(t,u)}function h(u){e.setupView(t,u)}return{init:i,state:{lightsArray:t,shadowsArray:n,lights:e,transmissionRenderTarget:null},setupLights:c,setupLightsView:h,pushLight:s,pushShadow:o}}function wL(r){let e=new WeakMap;function t(i,s=0){const o=e.get(i);let c;return o===void 0?(c=new S2(r),e.set(i,[c])):s>=o.length?(c=new S2(r),o.push(c)):c=o[s],c}function n(){e=new WeakMap}return{get:t,dispose:n}}class M2 extends qi{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=ab,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class IL extends qi{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}const CL=`void main() {
3776
+ `+H)}else P!==""?console.warn("THREE.WebGLProgram: Program Info Log:",P):(N===""||W==="")&&(K=!1);K&&(L.diagnostics={runnable:X,programLog:P,vertexShader:{log:N,prefix:m},fragmentShader:{log:W,prefix:_}})}i.deleteShader(R),i.deleteShader(M),D=new Bd(i,E),b=$D(i,E)}let D;this.getUniforms=function(){return D===void 0&&T(this),D};let b;this.getAttributes=function(){return b===void 0&&T(this),b};let S=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return S===!1&&(S=i.getProgramParameter(E,jD)),S},this.destroy=function(){n.releaseStatesOfProgram(this),i.deleteProgram(E),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=WD++,this.cacheKey=e,this.usedTimes=1,this.program=E,this.vertexShader=R,this.fragmentShader=M,this}let hL=0;class dL{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,n=e.fragmentShader,i=this._getShaderStage(t),s=this._getShaderStage(n),o=this._getShaderCacheForMaterial(e);return o.has(i)===!1&&(o.add(i),i.usedTimes++),o.has(s)===!1&&(o.add(s),s.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const n of t)n.usedTimes--,n.usedTimes===0&&this.shaderCache.delete(n.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let n=t.get(e);return n===void 0&&(n=new Set,t.set(e,n)),n}_getShaderStage(e){const t=this.shaderCache;let n=t.get(e);return n===void 0&&(n=new fL(e),t.set(e,n)),n}}class fL{constructor(e){this.id=hL++,this.code=e,this.usedTimes=0}}function pL(r,e,t,n,i,s,o){const c=new PA,h=new dL,u=new Set,d=[],A=i.logarithmicDepthBuffer,p=i.vertexTextures;let g=i.precision;const v={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function E(b){return u.add(b),b===0?"uv":`uv${b}`}function m(b,S,L,P,N){const W=P.fog,X=N.geometry,K=b.isMeshStandardMaterial?P.environment:null,te=(b.isMeshStandardMaterial?t:e).get(b.envMap||K),H=te&&te.mapping===Wh?te.image.height:null,ee=v[b.type];b.precision!==null&&(g=i.getMaxPrecision(b.precision),g!==b.precision&&console.warn("THREE.WebGLProgram.getParameters:",b.precision,"not supported, using",g,"instead."));const Q=X.morphAttributes.position||X.morphAttributes.normal||X.morphAttributes.color,z=Q!==void 0?Q.length:0;let Z=0;X.morphAttributes.position!==void 0&&(Z=1),X.morphAttributes.normal!==void 0&&(Z=2),X.morphAttributes.color!==void 0&&(Z=3);let re,G,de,pe;if(ee){const Mt=Ki[ee];re=Mt.vertexShader,G=Mt.fragmentShader}else re=b.vertexShader,G=b.fragmentShader,h.update(b),de=h.getVertexShaderID(b),pe=h.getFragmentShaderID(b);const fe=r.getRenderTarget(),ye=N.isInstancedMesh===!0,Pe=N.isBatchedMesh===!0,at=!!b.map,se=!!b.matcap,et=!!te,ke=!!b.aoMap,dt=!!b.lightMap,Xe=!!b.bumpMap,ft=!!b.normalMap,Y=!!b.displacementMap,k=!!b.emissiveMap,le=!!b.metalnessMap,Ae=!!b.roughnessMap,me=b.anisotropy>0,Ee=b.clearcoat>0,Oe=b.iridescence>0,Ce=b.sheen>0,Qe=b.transmission>0,ve=me&&!!b.anisotropyMap,xe=Ee&&!!b.clearcoatMap,Be=Ee&&!!b.clearcoatNormalMap,We=Ee&&!!b.clearcoatRoughnessMap,Le=Oe&&!!b.iridescenceMap,be=Oe&&!!b.iridescenceThicknessMap,nt=Ce&&!!b.sheenColorMap,pt=Ce&&!!b.sheenRoughnessMap,ct=!!b.specularMap,ut=!!b.specularColorMap,tt=!!b.specularIntensityMap,V=Qe&&!!b.transmissionMap,F=Qe&&!!b.thicknessMap,ge=!!b.gradientMap,_e=!!b.alphaMap,ze=b.alphaTest>0,Ne=!!b.alphaHash,_t=!!b.extensions;let Dt=Zs;b.toneMapped&&(fe===null||fe.isXRRenderTarget===!0)&&(Dt=r.toneMapping);const Lt={shaderID:ee,shaderType:b.type,shaderName:b.name,vertexShader:re,fragmentShader:G,defines:b.defines,customVertexShaderID:de,customFragmentShaderID:pe,isRawShaderMaterial:b.isRawShaderMaterial===!0,glslVersion:b.glslVersion,precision:g,batching:Pe,instancing:ye,instancingColor:ye&&N.instanceColor!==null,instancingMorph:ye&&N.morphTexture!==null,supportsVertexTextures:p,outputColorSpace:fe===null?r.outputColorSpace:fe.isXRRenderTarget===!0?fe.texture.colorSpace:Sr,alphaToCoverage:!!b.alphaToCoverage,map:at,matcap:se,envMap:et,envMapMode:et&&te.mapping,envMapCubeUVHeight:H,aoMap:ke,lightMap:dt,bumpMap:Xe,normalMap:ft,displacementMap:p&&Y,emissiveMap:k,normalMapObjectSpace:ft&&b.normalMapType===lb,normalMapTangentSpace:ft&&b.normalMapType===mE,metalnessMap:le,roughnessMap:Ae,anisotropy:me,anisotropyMap:ve,clearcoat:Ee,clearcoatMap:xe,clearcoatNormalMap:Be,clearcoatRoughnessMap:We,iridescence:Oe,iridescenceMap:Le,iridescenceThicknessMap:be,sheen:Ce,sheenColorMap:nt,sheenRoughnessMap:pt,specularMap:ct,specularColorMap:ut,specularIntensityMap:tt,transmission:Qe,transmissionMap:V,thicknessMap:F,gradientMap:ge,opaque:b.transparent===!1&&b.blending===rl&&b.alphaToCoverage===!1,alphaMap:_e,alphaTest:ze,alphaHash:Ne,combine:b.combine,mapUv:at&&E(b.map.channel),aoMapUv:ke&&E(b.aoMap.channel),lightMapUv:dt&&E(b.lightMap.channel),bumpMapUv:Xe&&E(b.bumpMap.channel),normalMapUv:ft&&E(b.normalMap.channel),displacementMapUv:Y&&E(b.displacementMap.channel),emissiveMapUv:k&&E(b.emissiveMap.channel),metalnessMapUv:le&&E(b.metalnessMap.channel),roughnessMapUv:Ae&&E(b.roughnessMap.channel),anisotropyMapUv:ve&&E(b.anisotropyMap.channel),clearcoatMapUv:xe&&E(b.clearcoatMap.channel),clearcoatNormalMapUv:Be&&E(b.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:We&&E(b.clearcoatRoughnessMap.channel),iridescenceMapUv:Le&&E(b.iridescenceMap.channel),iridescenceThicknessMapUv:be&&E(b.iridescenceThicknessMap.channel),sheenColorMapUv:nt&&E(b.sheenColorMap.channel),sheenRoughnessMapUv:pt&&E(b.sheenRoughnessMap.channel),specularMapUv:ct&&E(b.specularMap.channel),specularColorMapUv:ut&&E(b.specularColorMap.channel),specularIntensityMapUv:tt&&E(b.specularIntensityMap.channel),transmissionMapUv:V&&E(b.transmissionMap.channel),thicknessMapUv:F&&E(b.thicknessMap.channel),alphaMapUv:_e&&E(b.alphaMap.channel),vertexTangents:!!X.attributes.tangent&&(ft||me),vertexColors:b.vertexColors,vertexAlphas:b.vertexColors===!0&&!!X.attributes.color&&X.attributes.color.itemSize===4,pointsUvs:N.isPoints===!0&&!!X.attributes.uv&&(at||_e),fog:!!W,useFog:b.fog===!0,fogExp2:!!W&&W.isFogExp2,flatShading:b.flatShading===!0,sizeAttenuation:b.sizeAttenuation===!0,logarithmicDepthBuffer:A,skinning:N.isSkinnedMesh===!0,morphTargets:X.morphAttributes.position!==void 0,morphNormals:X.morphAttributes.normal!==void 0,morphColors:X.morphAttributes.color!==void 0,morphTargetsCount:z,morphTextureStride:Z,numDirLights:S.directional.length,numPointLights:S.point.length,numSpotLights:S.spot.length,numSpotLightMaps:S.spotLightMap.length,numRectAreaLights:S.rectArea.length,numHemiLights:S.hemi.length,numDirLightShadows:S.directionalShadowMap.length,numPointLightShadows:S.pointShadowMap.length,numSpotLightShadows:S.spotShadowMap.length,numSpotLightShadowsWithMaps:S.numSpotLightShadowsWithMaps,numLightProbes:S.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:b.dithering,shadowMapEnabled:r.shadowMap.enabled&&L.length>0,shadowMapType:r.shadowMap.type,toneMapping:Dt,useLegacyLights:r._useLegacyLights,decodeVideoTexture:at&&b.map.isVideoTexture===!0&&Rt.getTransfer(b.map.colorSpace)===Ht,premultipliedAlpha:b.premultipliedAlpha,doubleSided:b.side===Ei,flipSided:b.side===kr,useDepthPacking:b.depthPacking>=0,depthPacking:b.depthPacking||0,index0AttributeName:b.index0AttributeName,extensionClipCullDistance:_t&&b.extensions.clipCullDistance===!0&&n.has("WEBGL_clip_cull_distance"),extensionMultiDraw:_t&&b.extensions.multiDraw===!0&&n.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:n.has("KHR_parallel_shader_compile"),customProgramCacheKey:b.customProgramCacheKey()};return Lt.vertexUv1s=u.has(1),Lt.vertexUv2s=u.has(2),Lt.vertexUv3s=u.has(3),u.clear(),Lt}function _(b){const S=[];if(b.shaderID?S.push(b.shaderID):(S.push(b.customVertexShaderID),S.push(b.customFragmentShaderID)),b.defines!==void 0)for(const L in b.defines)S.push(L),S.push(b.defines[L]);return b.isRawShaderMaterial===!1&&(w(S,b),x(S,b),S.push(r.outputColorSpace)),S.push(b.customProgramCacheKey),S.join()}function w(b,S){b.push(S.precision),b.push(S.outputColorSpace),b.push(S.envMapMode),b.push(S.envMapCubeUVHeight),b.push(S.mapUv),b.push(S.alphaMapUv),b.push(S.lightMapUv),b.push(S.aoMapUv),b.push(S.bumpMapUv),b.push(S.normalMapUv),b.push(S.displacementMapUv),b.push(S.emissiveMapUv),b.push(S.metalnessMapUv),b.push(S.roughnessMapUv),b.push(S.anisotropyMapUv),b.push(S.clearcoatMapUv),b.push(S.clearcoatNormalMapUv),b.push(S.clearcoatRoughnessMapUv),b.push(S.iridescenceMapUv),b.push(S.iridescenceThicknessMapUv),b.push(S.sheenColorMapUv),b.push(S.sheenRoughnessMapUv),b.push(S.specularMapUv),b.push(S.specularColorMapUv),b.push(S.specularIntensityMapUv),b.push(S.transmissionMapUv),b.push(S.thicknessMapUv),b.push(S.combine),b.push(S.fogExp2),b.push(S.sizeAttenuation),b.push(S.morphTargetsCount),b.push(S.morphAttributeCount),b.push(S.numDirLights),b.push(S.numPointLights),b.push(S.numSpotLights),b.push(S.numSpotLightMaps),b.push(S.numHemiLights),b.push(S.numRectAreaLights),b.push(S.numDirLightShadows),b.push(S.numPointLightShadows),b.push(S.numSpotLightShadows),b.push(S.numSpotLightShadowsWithMaps),b.push(S.numLightProbes),b.push(S.shadowMapType),b.push(S.toneMapping),b.push(S.numClippingPlanes),b.push(S.numClipIntersection),b.push(S.depthPacking)}function x(b,S){c.disableAll(),S.supportsVertexTextures&&c.enable(0),S.instancing&&c.enable(1),S.instancingColor&&c.enable(2),S.instancingMorph&&c.enable(3),S.matcap&&c.enable(4),S.envMap&&c.enable(5),S.normalMapObjectSpace&&c.enable(6),S.normalMapTangentSpace&&c.enable(7),S.clearcoat&&c.enable(8),S.iridescence&&c.enable(9),S.alphaTest&&c.enable(10),S.vertexColors&&c.enable(11),S.vertexAlphas&&c.enable(12),S.vertexUv1s&&c.enable(13),S.vertexUv2s&&c.enable(14),S.vertexUv3s&&c.enable(15),S.vertexTangents&&c.enable(16),S.anisotropy&&c.enable(17),S.alphaHash&&c.enable(18),S.batching&&c.enable(19),b.push(c.mask),c.disableAll(),S.fog&&c.enable(0),S.useFog&&c.enable(1),S.flatShading&&c.enable(2),S.logarithmicDepthBuffer&&c.enable(3),S.skinning&&c.enable(4),S.morphTargets&&c.enable(5),S.morphNormals&&c.enable(6),S.morphColors&&c.enable(7),S.premultipliedAlpha&&c.enable(8),S.shadowMapEnabled&&c.enable(9),S.useLegacyLights&&c.enable(10),S.doubleSided&&c.enable(11),S.flipSided&&c.enable(12),S.useDepthPacking&&c.enable(13),S.dithering&&c.enable(14),S.transmission&&c.enable(15),S.sheen&&c.enable(16),S.opaque&&c.enable(17),S.pointsUvs&&c.enable(18),S.decodeVideoTexture&&c.enable(19),S.alphaToCoverage&&c.enable(20),b.push(c.mask)}function I(b){const S=v[b.type];let L;if(S){const P=Ki[S];L=Id.clone(P.uniforms)}else L=b.uniforms;return L}function R(b,S){let L;for(let P=0,N=d.length;P<N;P++){const W=d[P];if(W.cacheKey===S){L=W,++L.usedTimes;break}}return L===void 0&&(L=new uL(r,S,b,s),d.push(L)),L}function M(b){if(--b.usedTimes===0){const S=d.indexOf(b);d[S]=d[d.length-1],d.pop(),b.destroy()}}function T(b){h.remove(b)}function D(){h.dispose()}return{getParameters:m,getProgramCacheKey:_,getUniforms:I,acquireProgram:R,releaseProgram:M,releaseShaderCache:T,programs:d,dispose:D}}function AL(){let r=new WeakMap;function e(s){let o=r.get(s);return o===void 0&&(o={},r.set(s,o)),o}function t(s){r.delete(s)}function n(s,o,c){r.get(s)[o]=c}function i(){r=new WeakMap}return{get:e,remove:t,update:n,dispose:i}}function gL(r,e){return r.groupOrder!==e.groupOrder?r.groupOrder-e.groupOrder:r.renderOrder!==e.renderOrder?r.renderOrder-e.renderOrder:r.material.id!==e.material.id?r.material.id-e.material.id:r.z!==e.z?r.z-e.z:r.id-e.id}function I2(r,e){return r.groupOrder!==e.groupOrder?r.groupOrder-e.groupOrder:r.renderOrder!==e.renderOrder?r.renderOrder-e.renderOrder:r.z!==e.z?e.z-r.z:r.id-e.id}function C2(){const r=[];let e=0;const t=[],n=[],i=[];function s(){e=0,t.length=0,n.length=0,i.length=0}function o(A,p,g,v,E,m){let _=r[e];return _===void 0?(_={id:A.id,object:A,geometry:p,material:g,groupOrder:v,renderOrder:A.renderOrder,z:E,group:m},r[e]=_):(_.id=A.id,_.object=A,_.geometry=p,_.material=g,_.groupOrder=v,_.renderOrder=A.renderOrder,_.z=E,_.group=m),e++,_}function c(A,p,g,v,E,m){const _=o(A,p,g,v,E,m);g.transmission>0?n.push(_):g.transparent===!0?i.push(_):t.push(_)}function h(A,p,g,v,E,m){const _=o(A,p,g,v,E,m);g.transmission>0?n.unshift(_):g.transparent===!0?i.unshift(_):t.unshift(_)}function u(A,p){t.length>1&&t.sort(A||gL),n.length>1&&n.sort(p||I2),i.length>1&&i.sort(p||I2)}function d(){for(let A=e,p=r.length;A<p;A++){const g=r[A];if(g.id===null)break;g.id=null,g.object=null,g.geometry=null,g.material=null,g.group=null}}return{opaque:t,transmissive:n,transparent:i,init:s,push:c,unshift:h,finish:d,sort:u}}function mL(){let r=new WeakMap;function e(n,i){const s=r.get(n);let o;return s===void 0?(o=new C2,r.set(n,[o])):i>=s.length?(o=new C2,s.push(o)):o=s[i],o}function t(){r=new WeakMap}return{get:e,dispose:t}}function _L(){const r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new j,color:new Ke};break;case"SpotLight":t={position:new j,direction:new j,color:new Ke,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new j,color:new Ke,distance:0,decay:0};break;case"HemisphereLight":t={direction:new j,skyColor:new Ke,groundColor:new Ke};break;case"RectAreaLight":t={color:new Ke,position:new j,halfWidth:new j,halfHeight:new j};break}return r[e.id]=t,t}}}function vL(){const r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ge};break;case"SpotLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ge};break;case"PointLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ge,shadowCameraNear:1,shadowCameraFar:1e3};break}return r[e.id]=t,t}}}let yL=0;function EL(r,e){return(e.castShadow?2:0)-(r.castShadow?2:0)+(e.map?1:0)-(r.map?1:0)}function xL(r){const e=new _L,t=vL(),n={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let u=0;u<9;u++)n.probe.push(new j);const i=new j,s=new st,o=new st;function c(u,d){let A=0,p=0,g=0;for(let L=0;L<9;L++)n.probe[L].set(0,0,0);let v=0,E=0,m=0,_=0,w=0,x=0,I=0,R=0,M=0,T=0,D=0;u.sort(EL);const b=d===!0?Math.PI:1;for(let L=0,P=u.length;L<P;L++){const N=u[L],W=N.color,X=N.intensity,K=N.distance,te=N.shadow&&N.shadow.map?N.shadow.map.texture:null;if(N.isAmbientLight)A+=W.r*X*b,p+=W.g*X*b,g+=W.b*X*b;else if(N.isLightProbe){for(let H=0;H<9;H++)n.probe[H].addScaledVector(N.sh.coefficients[H],X);D++}else if(N.isDirectionalLight){const H=e.get(N);if(H.color.copy(N.color).multiplyScalar(N.intensity*b),N.castShadow){const ee=N.shadow,Q=t.get(N);Q.shadowBias=ee.bias,Q.shadowNormalBias=ee.normalBias,Q.shadowRadius=ee.radius,Q.shadowMapSize=ee.mapSize,n.directionalShadow[v]=Q,n.directionalShadowMap[v]=te,n.directionalShadowMatrix[v]=N.shadow.matrix,x++}n.directional[v]=H,v++}else if(N.isSpotLight){const H=e.get(N);H.position.setFromMatrixPosition(N.matrixWorld),H.color.copy(W).multiplyScalar(X*b),H.distance=K,H.coneCos=Math.cos(N.angle),H.penumbraCos=Math.cos(N.angle*(1-N.penumbra)),H.decay=N.decay,n.spot[m]=H;const ee=N.shadow;if(N.map&&(n.spotLightMap[M]=N.map,M++,ee.updateMatrices(N),N.castShadow&&T++),n.spotLightMatrix[m]=ee.matrix,N.castShadow){const Q=t.get(N);Q.shadowBias=ee.bias,Q.shadowNormalBias=ee.normalBias,Q.shadowRadius=ee.radius,Q.shadowMapSize=ee.mapSize,n.spotShadow[m]=Q,n.spotShadowMap[m]=te,R++}m++}else if(N.isRectAreaLight){const H=e.get(N);H.color.copy(W).multiplyScalar(X),H.halfWidth.set(N.width*.5,0,0),H.halfHeight.set(0,N.height*.5,0),n.rectArea[_]=H,_++}else if(N.isPointLight){const H=e.get(N);if(H.color.copy(N.color).multiplyScalar(N.intensity*b),H.distance=N.distance,H.decay=N.decay,N.castShadow){const ee=N.shadow,Q=t.get(N);Q.shadowBias=ee.bias,Q.shadowNormalBias=ee.normalBias,Q.shadowRadius=ee.radius,Q.shadowMapSize=ee.mapSize,Q.shadowCameraNear=ee.camera.near,Q.shadowCameraFar=ee.camera.far,n.pointShadow[E]=Q,n.pointShadowMap[E]=te,n.pointShadowMatrix[E]=N.shadow.matrix,I++}n.point[E]=H,E++}else if(N.isHemisphereLight){const H=e.get(N);H.skyColor.copy(N.color).multiplyScalar(X*b),H.groundColor.copy(N.groundColor).multiplyScalar(X*b),n.hemi[w]=H,w++}}_>0&&(r.has("OES_texture_float_linear")===!0?(n.rectAreaLTC1=De.LTC_FLOAT_1,n.rectAreaLTC2=De.LTC_FLOAT_2):(n.rectAreaLTC1=De.LTC_HALF_1,n.rectAreaLTC2=De.LTC_HALF_2)),n.ambient[0]=A,n.ambient[1]=p,n.ambient[2]=g;const S=n.hash;(S.directionalLength!==v||S.pointLength!==E||S.spotLength!==m||S.rectAreaLength!==_||S.hemiLength!==w||S.numDirectionalShadows!==x||S.numPointShadows!==I||S.numSpotShadows!==R||S.numSpotMaps!==M||S.numLightProbes!==D)&&(n.directional.length=v,n.spot.length=m,n.rectArea.length=_,n.point.length=E,n.hemi.length=w,n.directionalShadow.length=x,n.directionalShadowMap.length=x,n.pointShadow.length=I,n.pointShadowMap.length=I,n.spotShadow.length=R,n.spotShadowMap.length=R,n.directionalShadowMatrix.length=x,n.pointShadowMatrix.length=I,n.spotLightMatrix.length=R+M-T,n.spotLightMap.length=M,n.numSpotLightShadowsWithMaps=T,n.numLightProbes=D,S.directionalLength=v,S.pointLength=E,S.spotLength=m,S.rectAreaLength=_,S.hemiLength=w,S.numDirectionalShadows=x,S.numPointShadows=I,S.numSpotShadows=R,S.numSpotMaps=M,S.numLightProbes=D,n.version=yL++)}function h(u,d){let A=0,p=0,g=0,v=0,E=0;const m=d.matrixWorldInverse;for(let _=0,w=u.length;_<w;_++){const x=u[_];if(x.isDirectionalLight){const I=n.directional[A];I.direction.setFromMatrixPosition(x.matrixWorld),i.setFromMatrixPosition(x.target.matrixWorld),I.direction.sub(i),I.direction.transformDirection(m),A++}else if(x.isSpotLight){const I=n.spot[g];I.position.setFromMatrixPosition(x.matrixWorld),I.position.applyMatrix4(m),I.direction.setFromMatrixPosition(x.matrixWorld),i.setFromMatrixPosition(x.target.matrixWorld),I.direction.sub(i),I.direction.transformDirection(m),g++}else if(x.isRectAreaLight){const I=n.rectArea[v];I.position.setFromMatrixPosition(x.matrixWorld),I.position.applyMatrix4(m),o.identity(),s.copy(x.matrixWorld),s.premultiply(m),o.extractRotation(s),I.halfWidth.set(x.width*.5,0,0),I.halfHeight.set(0,x.height*.5,0),I.halfWidth.applyMatrix4(o),I.halfHeight.applyMatrix4(o),v++}else if(x.isPointLight){const I=n.point[p];I.position.setFromMatrixPosition(x.matrixWorld),I.position.applyMatrix4(m),p++}else if(x.isHemisphereLight){const I=n.hemi[E];I.direction.setFromMatrixPosition(x.matrixWorld),I.direction.transformDirection(m),E++}}}return{setup:c,setupView:h,state:n}}function S2(r){const e=new xL(r),t=[],n=[];function i(){t.length=0,n.length=0}function s(u){t.push(u)}function o(u){n.push(u)}function c(u){e.setup(t,u)}function h(u){e.setupView(t,u)}return{init:i,state:{lightsArray:t,shadowsArray:n,lights:e,transmissionRenderTarget:null},setupLights:c,setupLightsView:h,pushLight:s,pushShadow:o}}function wL(r){let e=new WeakMap;function t(i,s=0){const o=e.get(i);let c;return o===void 0?(c=new S2(r),e.set(i,[c])):s>=o.length?(c=new S2(r),o.push(c)):c=o[s],c}function n(){e=new WeakMap}return{get:t,dispose:n}}class M2 extends qi{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=ab,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class IL extends qi{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}const CL=`void main() {
3777
3777
  gl_Position = vec4( position, 1.0 );
3778
3778
  }`,SL=`uniform sampler2D shadow_pass;
3779
3779
  uniform vec2 resolution;
@@ -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 ML(r,e,t){let n=new WA;const i=new Ge,s=new Ge,o=new Ot,c=new M2({depthPacking:ob}),h=new IL,u={},d=t.maxTextureSize,A={[yi]:kr,[kr]:yi,[Ei]:Ei},p=new En({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Ge},radius:{value:4}},vertexShader:CL,fragmentShader:SL}),g=p.clone();g.defines.HORIZONTAL_PASS=1;const v=new Gn;v.setAttribute("position",new Fr(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const E=new Yr(v,p),m=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Dy;let _=this.type;this.render=function(M,T,D){if(m.enabled===!1||m.autoUpdate===!1&&m.needsUpdate===!1||M.length===0)return;const b=r.getRenderTarget(),S=r.getActiveCubeFace(),L=r.getActiveMipmapLevel(),P=r.state;P.setBlending(ps),P.buffers.color.setClear(1,1,1,1),P.buffers.depth.setTest(!0),P.setScissorTest(!1);const N=_!==fs&&this.type===fs,W=_===fs&&this.type!==fs;for(let X=0,K=M.length;X<K;X++){const te=M[X],H=te.shadow;if(H===void 0){console.warn("THREE.WebGLShadowMap:",te,"has no shadow.");continue}if(H.autoUpdate===!1&&H.needsUpdate===!1)continue;i.copy(H.mapSize);const ee=H.getFrameExtents();if(i.multiply(ee),s.copy(H.mapSize),(i.x>d||i.y>d)&&(i.x>d&&(s.x=Math.floor(d/ee.x),i.x=s.x*ee.x,H.mapSize.x=s.x),i.y>d&&(s.y=Math.floor(d/ee.y),i.y=s.y*ee.y,H.mapSize.y=s.y)),H.map===null||N===!0||W===!0){const z=this.type!==fs?{minFilter:fr,magFilter:fr}:{};H.map!==null&&H.map.dispose(),H.map=new Mi(i.x,i.y,z),H.map.texture.name=te.name+".shadowMap",H.camera.updateProjectionMatrix()}r.setRenderTarget(H.map),r.clear();const Q=H.getViewportCount();for(let z=0;z<Q;z++){const Z=H.getViewport(z);o.set(s.x*Z.x,s.y*Z.y,s.x*Z.z,s.y*Z.w),P.viewport(o),H.updateMatrices(te,z),n=H.getFrustum(),I(T,D,H.camera,te,this.type)}H.isPointLightShadow!==!0&&this.type===fs&&w(H,D),H.needsUpdate=!1}_=this.type,m.needsUpdate=!1,r.setRenderTarget(b,S,L)};function w(M,T){const D=e.update(E);p.defines.VSM_SAMPLES!==M.blurSamples&&(p.defines.VSM_SAMPLES=M.blurSamples,g.defines.VSM_SAMPLES=M.blurSamples,p.needsUpdate=!0,g.needsUpdate=!0),M.mapPass===null&&(M.mapPass=new Mi(i.x,i.y)),p.uniforms.shadow_pass.value=M.map.texture,p.uniforms.resolution.value=M.mapSize,p.uniforms.radius.value=M.radius,r.setRenderTarget(M.mapPass),r.clear(),r.renderBufferDirect(T,null,D,p,E,null),g.uniforms.shadow_pass.value=M.mapPass.texture,g.uniforms.resolution.value=M.mapSize,g.uniforms.radius.value=M.radius,r.setRenderTarget(M.map),r.clear(),r.renderBufferDirect(T,null,D,g,E,null)}function x(M,T,D,b){let S=null;const L=D.isPointLight===!0?M.customDistanceMaterial:M.customDepthMaterial;if(L!==void 0)S=L;else if(S=D.isPointLight===!0?h:c,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=S.uuid,N=T.uuid;let W=u[P];W===void 0&&(W={},u[P]=W);let X=W[N];X===void 0&&(X=S.clone(),W[N]=X,T.addEventListener("dispose",R)),S=X}if(S.visible=T.visible,S.wireframe=T.wireframe,b===fs?S.side=T.shadowSide!==null?T.shadowSide:T.side:S.side=T.shadowSide!==null?T.shadowSide:A[T.side],S.alphaMap=T.alphaMap,S.alphaTest=T.alphaTest,S.map=T.map,S.clipShadows=T.clipShadows,S.clippingPlanes=T.clippingPlanes,S.clipIntersection=T.clipIntersection,S.displacementMap=T.displacementMap,S.displacementScale=T.displacementScale,S.displacementBias=T.displacementBias,S.wireframeLinewidth=T.wireframeLinewidth,S.linewidth=T.linewidth,D.isPointLight===!0&&S.isMeshDistanceMaterial===!0){const P=r.properties.get(S);P.light=D}return S}function I(M,T,D,b,S){if(M.visible===!1)return;if(M.layers.test(T.layers)&&(M.isMesh||M.isLine||M.isPoints)&&(M.castShadow||M.receiveShadow&&S===fs)&&(!M.frustumCulled||n.intersectsObject(M))){M.modelViewMatrix.multiplyMatrices(D.matrixWorldInverse,M.matrixWorld);const P=e.update(M),N=M.material;if(Array.isArray(N)){const W=P.groups;for(let X=0,K=W.length;X<K;X++){const te=W[X],H=N[te.materialIndex];if(H&&H.visible){const ee=x(M,H,b,S);M.onBeforeShadow(r,M,T,D,P,ee,te),r.renderBufferDirect(D,null,P,ee,M,te),M.onAfterShadow(r,M,T,D,P,ee,te)}}}else if(N.visible){const W=x(M,N,b,S);M.onBeforeShadow(r,M,T,D,P,W,null),r.renderBufferDirect(D,null,P,W,M,null),M.onAfterShadow(r,M,T,D,P,W,null)}}const L=M.children;for(let P=0,N=L.length;P<N;P++)I(L[P],T,D,b,S)}function R(M){M.target.removeEventListener("dispose",R);for(const T in u){const D=u[T],b=M.target.uuid;b in D&&(D[b].dispose(),delete D[b])}}}function TL(r){function e(){let F=!1;const ge=new Ot;let _e=null;const ze=new Ot(0,0,0,0);return{setMask:function(Ne){_e!==Ne&&!F&&(r.colorMask(Ne,Ne,Ne,Ne),_e=Ne)},setLocked:function(Ne){F=Ne},setClear:function(Ne,_t,Dt,Lt,Mt){Mt===!0&&(Ne*=Lt,_t*=Lt,Dt*=Lt),ge.set(Ne,_t,Dt,Lt),ze.equals(ge)===!1&&(r.clearColor(Ne,_t,Dt,Lt),ze.copy(ge))},reset:function(){F=!1,_e=null,ze.set(-1,0,0,0)}}}function t(){let F=!1,ge=null,_e=null,ze=null;return{setTest:function(Ne){Ne?pe(r.DEPTH_TEST):fe(r.DEPTH_TEST)},setMask:function(Ne){ge!==Ne&&!F&&(r.depthMask(Ne),ge=Ne)},setFunc:function(Ne){if(_e!==Ne){switch(Ne){case OB:r.depthFunc(r.NEVER);break;case zB:r.depthFunc(r.ALWAYS);break;case HB:r.depthFunc(r.LESS);break;case jh:r.depthFunc(r.LEQUAL);break;case GB:r.depthFunc(r.EQUAL);break;case VB:r.depthFunc(r.GEQUAL);break;case jB:r.depthFunc(r.GREATER);break;case WB:r.depthFunc(r.NOTEQUAL);break;default:r.depthFunc(r.LEQUAL)}_e=Ne}},setLocked:function(Ne){F=Ne},setClear:function(Ne){ze!==Ne&&(r.clearDepth(Ne),ze=Ne)},reset:function(){F=!1,ge=null,_e=null,ze=null}}}function n(){let F=!1,ge=null,_e=null,ze=null,Ne=null,_t=null,Dt=null,Lt=null,Mt=null;return{setTest:function(vt){F||(vt?pe(r.STENCIL_TEST):fe(r.STENCIL_TEST))},setMask:function(vt){ge!==vt&&!F&&(r.stencilMask(vt),ge=vt)},setFunc:function(vt,hr,Vt){(_e!==vt||ze!==hr||Ne!==Vt)&&(r.stencilFunc(vt,hr,Vt),_e=vt,ze=hr,Ne=Vt)},setOp:function(vt,hr,Vt){(_t!==vt||Dt!==hr||Lt!==Vt)&&(r.stencilOp(vt,hr,Vt),_t=vt,Dt=hr,Lt=Vt)},setLocked:function(vt){F=vt},setClear:function(vt){Mt!==vt&&(r.clearStencil(vt),Mt=vt)},reset:function(){F=!1,ge=null,_e=null,ze=null,Ne=null,_t=null,Dt=null,Lt=null,Mt=null}}}const i=new e,s=new t,o=new n,c=new WeakMap,h=new WeakMap;let u={},d={},A=new WeakMap,p=[],g=null,v=!1,E=null,m=null,_=null,w=null,x=null,I=null,R=null,M=new Ke(0,0,0),T=0,D=!1,b=null,S=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 H=null,ee={};const Q=r.getParameter(r.SCISSOR_BOX),z=r.getParameter(r.VIEWPORT),Z=new Ot().fromArray(Q),re=new Ot().fromArray(z);function G(F,ge,_e,ze){const Ne=new Uint8Array(4),_t=r.createTexture();r.bindTexture(F,_t),r.texParameteri(F,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(F,r.TEXTURE_MAG_FILTER,r.NEAREST);for(let Dt=0;Dt<_e;Dt++)F===r.TEXTURE_3D||F===r.TEXTURE_2D_ARRAY?r.texImage3D(ge,0,r.RGBA,1,1,ze,0,r.RGBA,r.UNSIGNED_BYTE,Ne):r.texImage2D(ge+Dt,0,r.RGBA,1,1,0,r.RGBA,r.UNSIGNED_BYTE,Ne);return _t}const de={};de[r.TEXTURE_2D]=G(r.TEXTURE_2D,r.TEXTURE_2D,1),de[r.TEXTURE_CUBE_MAP]=G(r.TEXTURE_CUBE_MAP,r.TEXTURE_CUBE_MAP_POSITIVE_X,6),de[r.TEXTURE_2D_ARRAY]=G(r.TEXTURE_2D_ARRAY,r.TEXTURE_2D_ARRAY,1,1),de[r.TEXTURE_3D]=G(r.TEXTURE_3D,r.TEXTURE_3D,1,1),i.setClear(0,0,0,1),s.setClear(1),o.setClear(0),pe(r.DEPTH_TEST),s.setFunc(jh),Xe(!1),ft(Ry),pe(r.CULL_FACE),ke(ps);function pe(F){u[F]!==!0&&(r.enable(F),u[F]=!0)}function fe(F){u[F]!==!1&&(r.disable(F),u[F]=!1)}function ye(F,ge){return d[F]!==ge?(r.bindFramebuffer(F,ge),d[F]=ge,F===r.DRAW_FRAMEBUFFER&&(d[r.FRAMEBUFFER]=ge),F===r.FRAMEBUFFER&&(d[r.DRAW_FRAMEBUFFER]=ge),!0):!1}function Pe(F,ge){let _e=p,ze=!1;if(F){_e=A.get(ge),_e===void 0&&(_e=[],A.set(ge,_e));const Ne=F.textures;if(_e.length!==Ne.length||_e[0]!==r.COLOR_ATTACHMENT0){for(let _t=0,Dt=Ne.length;_t<Dt;_t++)_e[_t]=r.COLOR_ATTACHMENT0+_t;_e.length=Ne.length,ze=!0}}else _e[0]!==r.BACK&&(_e[0]=r.BACK,ze=!0);ze&&r.drawBuffers(_e)}function at(F){return g!==F?(r.useProgram(F),g=F,!0):!1}const se={[ro]:r.FUNC_ADD,[wB]:r.FUNC_SUBTRACT,[IB]:r.FUNC_REVERSE_SUBTRACT};se[CB]=r.MIN,se[SB]=r.MAX;const et={[MB]:r.ZERO,[TB]:r.ONE,[BB]:r.SRC_COLOR,[oA]:r.SRC_ALPHA,[UB]:r.SRC_ALPHA_SATURATE,[LB]:r.DST_COLOR,[RB]:r.DST_ALPHA,[bB]:r.ONE_MINUS_SRC_COLOR,[lA]:r.ONE_MINUS_SRC_ALPHA,[NB]:r.ONE_MINUS_DST_COLOR,[DB]:r.ONE_MINUS_DST_ALPHA,[PB]:r.CONSTANT_COLOR,[kB]:r.ONE_MINUS_CONSTANT_COLOR,[QB]:r.CONSTANT_ALPHA,[FB]:r.ONE_MINUS_CONSTANT_ALPHA};function ke(F,ge,_e,ze,Ne,_t,Dt,Lt,Mt,vt){if(F===ps){v===!0&&(fe(r.BLEND),v=!1);return}if(v===!1&&(pe(r.BLEND),v=!0),F!==xB){if(F!==E||vt!==D){if((m!==ro||x!==ro)&&(r.blendEquation(r.FUNC_ADD),m=ro,x=ro),vt)switch(F){case rl:r.blendFuncSeparate(r.ONE,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA);break;case Ly:r.blendFunc(r.ONE,r.ONE);break;case Ny:r.blendFuncSeparate(r.ZERO,r.ONE_MINUS_SRC_COLOR,r.ZERO,r.ONE);break;case Uy:r.blendFuncSeparate(r.ZERO,r.SRC_COLOR,r.ZERO,r.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",F);break}else switch(F){case rl:r.blendFuncSeparate(r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA);break;case Ly:r.blendFunc(r.SRC_ALPHA,r.ONE);break;case Ny:r.blendFuncSeparate(r.ZERO,r.ONE_MINUS_SRC_COLOR,r.ZERO,r.ONE);break;case Uy:r.blendFunc(r.ZERO,r.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",F);break}_=null,w=null,I=null,R=null,M.set(0,0,0),T=0,E=F,D=vt}return}Ne=Ne||ge,_t=_t||_e,Dt=Dt||ze,(ge!==m||Ne!==x)&&(r.blendEquationSeparate(se[ge],se[Ne]),m=ge,x=Ne),(_e!==_||ze!==w||_t!==I||Dt!==R)&&(r.blendFuncSeparate(et[_e],et[ze],et[_t],et[Dt]),_=_e,w=ze,I=_t,R=Dt),(Lt.equals(M)===!1||Mt!==T)&&(r.blendColor(Lt.r,Lt.g,Lt.b,Mt),M.copy(Lt),T=Mt),E=F,D=!1}function dt(F,ge){F.side===Ei?fe(r.CULL_FACE):pe(r.CULL_FACE);let _e=F.side===kr;ge&&(_e=!_e),Xe(_e),F.blending===rl&&F.transparent===!1?ke(ps):ke(F.blending,F.blendEquation,F.blendSrc,F.blendDst,F.blendEquationAlpha,F.blendSrcAlpha,F.blendDstAlpha,F.blendColor,F.blendAlpha,F.premultipliedAlpha),s.setFunc(F.depthFunc),s.setTest(F.depthTest),s.setMask(F.depthWrite),i.setMask(F.colorWrite);const ze=F.stencilWrite;o.setTest(ze),ze&&(o.setMask(F.stencilWriteMask),o.setFunc(F.stencilFunc,F.stencilRef,F.stencilFuncMask),o.setOp(F.stencilFail,F.stencilZFail,F.stencilZPass)),k(F.polygonOffset,F.polygonOffsetFactor,F.polygonOffsetUnits),F.alphaToCoverage===!0?pe(r.SAMPLE_ALPHA_TO_COVERAGE):fe(r.SAMPLE_ALPHA_TO_COVERAGE)}function Xe(F){b!==F&&(F?r.frontFace(r.CW):r.frontFace(r.CCW),b=F)}function ft(F){F!==vB?(pe(r.CULL_FACE),F!==S&&(F===Ry?r.cullFace(r.BACK):F===yB?r.cullFace(r.FRONT):r.cullFace(r.FRONT_AND_BACK))):fe(r.CULL_FACE),S=F}function Y(F){F!==L&&(X&&r.lineWidth(F),L=F)}function k(F,ge,_e){F?(pe(r.POLYGON_OFFSET_FILL),(P!==ge||N!==_e)&&(r.polygonOffset(ge,_e),P=ge,N=_e)):fe(r.POLYGON_OFFSET_FILL)}function le(F){F?pe(r.SCISSOR_TEST):fe(r.SCISSOR_TEST)}function Ae(F){F===void 0&&(F=r.TEXTURE0+W-1),H!==F&&(r.activeTexture(F),H=F)}function me(F,ge,_e){_e===void 0&&(H===null?_e=r.TEXTURE0+W-1:_e=H);let ze=ee[_e];ze===void 0&&(ze={type:void 0,texture:void 0},ee[_e]=ze),(ze.type!==F||ze.texture!==ge)&&(H!==_e&&(r.activeTexture(_e),H=_e),r.bindTexture(F,ge||de[F]),ze.type=F,ze.texture=ge)}function Ee(){const F=ee[H];F!==void 0&&F.type!==void 0&&(r.bindTexture(F.type,null),F.type=void 0,F.texture=void 0)}function Oe(){try{r.compressedTexImage2D.apply(r,arguments)}catch(F){console.error("THREE.WebGLState:",F)}}function Ce(){try{r.compressedTexImage3D.apply(r,arguments)}catch(F){console.error("THREE.WebGLState:",F)}}function Qe(){try{r.texSubImage2D.apply(r,arguments)}catch(F){console.error("THREE.WebGLState:",F)}}function ve(){try{r.texSubImage3D.apply(r,arguments)}catch(F){console.error("THREE.WebGLState:",F)}}function xe(){try{r.compressedTexSubImage2D.apply(r,arguments)}catch(F){console.error("THREE.WebGLState:",F)}}function Be(){try{r.compressedTexSubImage3D.apply(r,arguments)}catch(F){console.error("THREE.WebGLState:",F)}}function Ye(){try{r.texStorage2D.apply(r,arguments)}catch(F){console.error("THREE.WebGLState:",F)}}function Le(){try{r.texStorage3D.apply(r,arguments)}catch(F){console.error("THREE.WebGLState:",F)}}function be(){try{r.texImage2D.apply(r,arguments)}catch(F){console.error("THREE.WebGLState:",F)}}function nt(){try{r.texImage3D.apply(r,arguments)}catch(F){console.error("THREE.WebGLState:",F)}}function pt(F){Z.equals(F)===!1&&(r.scissor(F.x,F.y,F.z,F.w),Z.copy(F))}function ct(F){re.equals(F)===!1&&(r.viewport(F.x,F.y,F.z,F.w),re.copy(F))}function ut(F,ge){let _e=h.get(ge);_e===void 0&&(_e=new WeakMap,h.set(ge,_e));let ze=_e.get(F);ze===void 0&&(ze=r.getUniformBlockIndex(ge,F.name),_e.set(F,ze))}function tt(F,ge){const _e=h.get(ge).get(F);c.get(ge)!==_e&&(r.uniformBlockBinding(ge,_e,F.__bindingPointIndex),c.set(ge,_e))}function V(){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={},H=null,ee={},d={},A=new WeakMap,p=[],g=null,v=!1,E=null,m=null,_=null,w=null,x=null,I=null,R=null,M=new Ke(0,0,0),T=0,D=!1,b=null,S=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:pe,disable:fe,bindFramebuffer:ye,drawBuffers:Pe,useProgram:at,setBlending:ke,setMaterial:dt,setFlipSided:Xe,setCullFace:ft,setLineWidth:Y,setPolygonOffset:k,setScissorTest:le,activeTexture:Ae,bindTexture:me,unbindTexture:Ee,compressedTexImage2D:Oe,compressedTexImage3D:Ce,texImage2D:be,texImage3D:nt,updateUBOMapping:ut,uniformBlockBinding:tt,texStorage2D:Ye,texStorage3D:Le,texSubImage2D:Qe,texSubImage3D:ve,compressedTexSubImage2D:xe,compressedTexSubImage3D:Be,scissor:pt,viewport:ct,reset:V}}function BL(r,e,t,n,i,s,o){const c=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 Ge,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 v(Y,k){return g?new OffscreenCanvas(Y,k):au("canvas")}function E(Y,k,le){let Ae=1;const me=ft(Y);if((me.width>le||me.height>le)&&(Ae=le/Math.max(me.width,me.height)),Ae<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 Ee=Math.floor(Ae*me.width),Oe=Math.floor(Ae*me.height);A===void 0&&(A=v(Ee,Oe));const Ce=k?v(Ee,Oe):A;return Ce.width=Ee,Ce.height=Oe,Ce.getContext("2d").drawImage(Y,0,0,Ee,Oe),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+me.width+"x"+me.height+") to ("+Ee+"x"+Oe+")."),Ce}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!==fr&&Y.minFilter!==pr}function _(Y){r.generateMipmap(Y)}function w(Y,k,le,Ae,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 Ee=k;if(k===r.RED&&(le===r.FLOAT&&(Ee=r.R32F),le===r.HALF_FLOAT&&(Ee=r.R16F),le===r.UNSIGNED_BYTE&&(Ee=r.R8)),k===r.RED_INTEGER&&(le===r.UNSIGNED_BYTE&&(Ee=r.R8UI),le===r.UNSIGNED_SHORT&&(Ee=r.R16UI),le===r.UNSIGNED_INT&&(Ee=r.R32UI),le===r.BYTE&&(Ee=r.R8I),le===r.SHORT&&(Ee=r.R16I),le===r.INT&&(Ee=r.R32I)),k===r.RG&&(le===r.FLOAT&&(Ee=r.RG32F),le===r.HALF_FLOAT&&(Ee=r.RG16F),le===r.UNSIGNED_BYTE&&(Ee=r.RG8)),k===r.RG_INTEGER&&(le===r.UNSIGNED_BYTE&&(Ee=r.RG8UI),le===r.UNSIGNED_SHORT&&(Ee=r.RG16UI),le===r.UNSIGNED_INT&&(Ee=r.RG32UI),le===r.BYTE&&(Ee=r.RG8I),le===r.SHORT&&(Ee=r.RG16I),le===r.INT&&(Ee=r.RG32I)),k===r.RGB&&le===r.UNSIGNED_INT_5_9_9_9_REV&&(Ee=r.RGB9_E5),k===r.RGBA){const Oe=me?td:Rt.getTransfer(Ae);le===r.FLOAT&&(Ee=r.RGBA32F),le===r.HALF_FLOAT&&(Ee=r.RGBA16F),le===r.UNSIGNED_BYTE&&(Ee=Oe===Ht?r.SRGB8_ALPHA8:r.RGBA8),le===r.UNSIGNED_SHORT_4_4_4_4&&(Ee=r.RGBA4),le===r.UNSIGNED_SHORT_5_5_5_1&&(Ee=r.RGB5_A1)}return(Ee===r.R16F||Ee===r.R32F||Ee===r.RG16F||Ee===r.RG32F||Ee===r.RGBA16F||Ee===r.RGBA32F)&&e.get("EXT_color_buffer_float"),Ee}function x(Y,k){return m(Y)===!0||Y.isFramebufferTexture&&Y.minFilter!==fr&&Y.minFilter!==pr?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),M(k),k.isVideoTexture&&d.delete(k)}function R(Y){const k=Y.target;k.removeEventListener("dispose",R),D(k)}function M(Y){const k=n.get(Y);if(k.__webglInit===void 0)return;const le=Y.source,Ae=p.get(le);if(Ae){const me=Ae[k.__cacheKey];me.usedTimes--,me.usedTimes===0&&T(Y),Object.keys(Ae).length===0&&p.delete(le)}n.remove(Y)}function T(Y){const k=n.get(Y);r.deleteTexture(k.__webglTexture);const le=Y.source,Ae=p.get(le);delete Ae[k.__cacheKey],o.memory.textures--}function D(Y){const k=n.get(Y);if(Y.depthTexture&&Y.depthTexture.dispose(),Y.isWebGLCubeRenderTarget)for(let Ae=0;Ae<6;Ae++){if(Array.isArray(k.__webglFramebuffer[Ae]))for(let me=0;me<k.__webglFramebuffer[Ae].length;me++)r.deleteFramebuffer(k.__webglFramebuffer[Ae][me]);else r.deleteFramebuffer(k.__webglFramebuffer[Ae]);k.__webglDepthbuffer&&r.deleteRenderbuffer(k.__webglDepthbuffer[Ae])}else{if(Array.isArray(k.__webglFramebuffer))for(let Ae=0;Ae<k.__webglFramebuffer.length;Ae++)r.deleteFramebuffer(k.__webglFramebuffer[Ae]);else r.deleteFramebuffer(k.__webglFramebuffer);if(k.__webglDepthbuffer&&r.deleteRenderbuffer(k.__webglDepthbuffer),k.__webglMultisampledFramebuffer&&r.deleteFramebuffer(k.__webglMultisampledFramebuffer),k.__webglColorRenderbuffer)for(let Ae=0;Ae<k.__webglColorRenderbuffer.length;Ae++)k.__webglColorRenderbuffer[Ae]&&r.deleteRenderbuffer(k.__webglColorRenderbuffer[Ae]);k.__webglDepthRenderbuffer&&r.deleteRenderbuffer(k.__webglDepthRenderbuffer)}const le=Y.textures;for(let Ae=0,me=le.length;Ae<me;Ae++){const Ee=n.get(le[Ae]);Ee.__webglTexture&&(r.deleteTexture(Ee.__webglTexture),o.memory.textures--),n.remove(le[Ae])}n.remove(Y)}let b=0;function S(){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&&dt(Y),Y.isRenderTargetTexture===!1&&Y.version>0&&le.__version!==Y.version){const Ae=Y.image;if(Ae===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(Ae.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,[xi]:r.CLAMP_TO_EDGE,[Yh]:r.MIRRORED_REPEAT},H={[fr]:r.NEAREST,[Vy]:r.NEAREST_MIPMAP_NEAREST,[Jc]:r.NEAREST_MIPMAP_LINEAR,[pr]:r.LINEAR,[qh]:r.LINEAR_MIPMAP_NEAREST,[wi]:r.LINEAR_MIPMAP_LINEAR},ee={[cb]:r.NEVER,[Ab]:r.ALWAYS,[ub]:r.LESS,[vE]:r.LEQUAL,[hb]:r.EQUAL,[pb]:r.GEQUAL,[db]:r.GREATER,[fb]:r.NOTEQUAL};function Q(Y,k){if(k.type===lr&&e.has("OES_texture_float_linear")===!1&&(k.magFilter===pr||k.magFilter===qh||k.magFilter===Jc||k.magFilter===wi||k.minFilter===pr||k.minFilter===qh||k.minFilter===Jc||k.minFilter===wi)&&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,H[k.magFilter]),r.texParameteri(Y,r.TEXTURE_MIN_FILTER,H[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===fr||k.minFilter!==Jc&&k.minFilter!==wi||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 Ae=k.source;let me=p.get(Ae);me===void 0&&(me={},p.set(Ae,me));const Ee=P(k);if(Ee!==Y.__cacheKey){me[Ee]===void 0&&(me[Ee]={texture:r.createTexture(),usedTimes:0},o.memory.textures++,le=!0),me[Ee].usedTimes++;const Oe=me[Y.__cacheKey];Oe!==void 0&&(me[Y.__cacheKey].usedTimes--,Oe.usedTimes===0&&T(k)),Y.__cacheKey=Ee,Y.__webglTexture=me[Ee].texture}return le}function Z(Y,k,le){let Ae=r.TEXTURE_2D;(k.isDataArrayTexture||k.isCompressedArrayTexture)&&(Ae=r.TEXTURE_2D_ARRAY),k.isData3DTexture&&(Ae=r.TEXTURE_3D);const me=z(Y,k),Ee=k.source;t.bindTexture(Ae,Y.__webglTexture,r.TEXTURE0+le);const Oe=n.get(Ee);if(Ee.version!==Oe.__version||me===!0){t.activeTexture(r.TEXTURE0+le);const Ce=Rt.getPrimaries(Rt.workingColorSpace),Qe=k.colorSpace===As?null:Rt.getPrimaries(k.colorSpace),ve=k.colorSpace===As||Ce===Qe?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,ve);let xe=E(k.image,!1,i.maxTextureSize);xe=Xe(k,xe);const Be=s.convert(k.format,k.colorSpace),Ye=s.convert(k.type);let Le=w(k.internalFormat,Be,Ye,k.colorSpace,k.isVideoTexture);Q(Ae,k);let be;const nt=k.mipmaps,pt=k.isVideoTexture!==!0&&Le!==_A,ct=Oe.__version===void 0||me===!0,ut=Ee.dataReady,tt=x(k,xe);if(k.isDepthTexture)Le=r.DEPTH_COMPONENT16,k.type===lr?Le=r.DEPTH_COMPONENT32F:k.type===Ii?Le=r.DEPTH_COMPONENT24:k.type===$c&&(Le=r.DEPTH24_STENCIL8),ct&&(pt?t.texStorage2D(r.TEXTURE_2D,1,Le,xe.width,xe.height):t.texImage2D(r.TEXTURE_2D,0,Le,xe.width,xe.height,0,Be,Ye,null));else if(k.isDataTexture)if(nt.length>0){pt&&ct&&t.texStorage2D(r.TEXTURE_2D,tt,Le,nt[0].width,nt[0].height);for(let V=0,F=nt.length;V<F;V++)be=nt[V],pt?ut&&t.texSubImage2D(r.TEXTURE_2D,V,0,0,be.width,be.height,Be,Ye,be.data):t.texImage2D(r.TEXTURE_2D,V,Le,be.width,be.height,0,Be,Ye,be.data);k.generateMipmaps=!1}else pt?(ct&&t.texStorage2D(r.TEXTURE_2D,tt,Le,xe.width,xe.height),ut&&t.texSubImage2D(r.TEXTURE_2D,0,0,0,xe.width,xe.height,Be,Ye,xe.data)):t.texImage2D(r.TEXTURE_2D,0,Le,xe.width,xe.height,0,Be,Ye,xe.data);else if(k.isCompressedTexture)if(k.isCompressedArrayTexture){pt&&ct&&t.texStorage3D(r.TEXTURE_2D_ARRAY,tt,Le,nt[0].width,nt[0].height,xe.depth);for(let V=0,F=nt.length;V<F;V++)be=nt[V],k.format!==gr?Be!==null?pt?ut&&t.compressedTexSubImage3D(r.TEXTURE_2D_ARRAY,V,0,0,0,be.width,be.height,xe.depth,Be,be.data,0,0):t.compressedTexImage3D(r.TEXTURE_2D_ARRAY,V,Le,be.width,be.height,xe.depth,0,be.data,0,0):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):pt?ut&&t.texSubImage3D(r.TEXTURE_2D_ARRAY,V,0,0,0,be.width,be.height,xe.depth,Be,Ye,be.data):t.texImage3D(r.TEXTURE_2D_ARRAY,V,Le,be.width,be.height,xe.depth,0,Be,Ye,be.data)}else{pt&&ct&&t.texStorage2D(r.TEXTURE_2D,tt,Le,nt[0].width,nt[0].height);for(let V=0,F=nt.length;V<F;V++)be=nt[V],k.format!==gr?Be!==null?pt?ut&&t.compressedTexSubImage2D(r.TEXTURE_2D,V,0,0,be.width,be.height,Be,be.data):t.compressedTexImage2D(r.TEXTURE_2D,V,Le,be.width,be.height,0,be.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):pt?ut&&t.texSubImage2D(r.TEXTURE_2D,V,0,0,be.width,be.height,Be,Ye,be.data):t.texImage2D(r.TEXTURE_2D,V,Le,be.width,be.height,0,Be,Ye,be.data)}else if(k.isDataArrayTexture)pt?(ct&&t.texStorage3D(r.TEXTURE_2D_ARRAY,tt,Le,xe.width,xe.height,xe.depth),ut&&t.texSubImage3D(r.TEXTURE_2D_ARRAY,0,0,0,0,xe.width,xe.height,xe.depth,Be,Ye,xe.data)):t.texImage3D(r.TEXTURE_2D_ARRAY,0,Le,xe.width,xe.height,xe.depth,0,Be,Ye,xe.data);else if(k.isData3DTexture)pt?(ct&&t.texStorage3D(r.TEXTURE_3D,tt,Le,xe.width,xe.height,xe.depth),ut&&t.texSubImage3D(r.TEXTURE_3D,0,0,0,0,xe.width,xe.height,xe.depth,Be,Ye,xe.data)):t.texImage3D(r.TEXTURE_3D,0,Le,xe.width,xe.height,xe.depth,0,Be,Ye,xe.data);else if(k.isFramebufferTexture){if(ct)if(pt)t.texStorage2D(r.TEXTURE_2D,tt,Le,xe.width,xe.height);else{let V=xe.width,F=xe.height;for(let ge=0;ge<tt;ge++)t.texImage2D(r.TEXTURE_2D,ge,Le,V,F,0,Be,Ye,null),V>>=1,F>>=1}}else if(nt.length>0){if(pt&&ct){const V=ft(nt[0]);t.texStorage2D(r.TEXTURE_2D,tt,Le,V.width,V.height)}for(let V=0,F=nt.length;V<F;V++)be=nt[V],pt?ut&&t.texSubImage2D(r.TEXTURE_2D,V,0,0,Be,Ye,be):t.texImage2D(r.TEXTURE_2D,V,Le,Be,Ye,be);k.generateMipmaps=!1}else if(pt){if(ct){const V=ft(xe);t.texStorage2D(r.TEXTURE_2D,tt,Le,V.width,V.height)}ut&&t.texSubImage2D(r.TEXTURE_2D,0,0,0,Be,Ye,xe)}else t.texImage2D(r.TEXTURE_2D,0,Le,Be,Ye,xe);m(k)&&_(Ae),Oe.__version=Ee.version,k.onUpdate&&k.onUpdate(k)}Y.__version=k.version}function re(Y,k,le){if(k.image.length!==6)return;const Ae=z(Y,k),me=k.source;t.bindTexture(r.TEXTURE_CUBE_MAP,Y.__webglTexture,r.TEXTURE0+le);const Ee=n.get(me);if(me.version!==Ee.__version||Ae===!0){t.activeTexture(r.TEXTURE0+le);const Oe=Rt.getPrimaries(Rt.workingColorSpace),Ce=k.colorSpace===As?null:Rt.getPrimaries(k.colorSpace),Qe=k.colorSpace===As||Oe===Ce?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,Qe);const ve=k.isCompressedTexture||k.image[0].isCompressedTexture,xe=k.image[0]&&k.image[0].isDataTexture,Be=[];for(let F=0;F<6;F++)!ve&&!xe?Be[F]=E(k.image[F],!0,i.maxCubemapSize):Be[F]=xe?k.image[F].image:k.image[F],Be[F]=Xe(k,Be[F]);const Ye=Be[0],Le=s.convert(k.format,k.colorSpace),be=s.convert(k.type),nt=w(k.internalFormat,Le,be,k.colorSpace),pt=k.isVideoTexture!==!0,ct=Ee.__version===void 0||Ae===!0,ut=me.dataReady;let tt=x(k,Ye);Q(r.TEXTURE_CUBE_MAP,k);let V;if(ve){pt&&ct&&t.texStorage2D(r.TEXTURE_CUBE_MAP,tt,nt,Ye.width,Ye.height);for(let F=0;F<6;F++){V=Be[F].mipmaps;for(let ge=0;ge<V.length;ge++){const _e=V[ge];k.format!==gr?Le!==null?pt?ut&&t.compressedTexSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+F,ge,0,0,_e.width,_e.height,Le,_e.data):t.compressedTexImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+F,ge,nt,_e.width,_e.height,0,_e.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):pt?ut&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+F,ge,0,0,_e.width,_e.height,Le,be,_e.data):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+F,ge,nt,_e.width,_e.height,0,Le,be,_e.data)}}}else{if(V=k.mipmaps,pt&&ct){V.length>0&&tt++;const F=ft(Be[0]);t.texStorage2D(r.TEXTURE_CUBE_MAP,tt,nt,F.width,F.height)}for(let F=0;F<6;F++)if(xe){pt?ut&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+F,0,0,0,Be[F].width,Be[F].height,Le,be,Be[F].data):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+F,0,nt,Be[F].width,Be[F].height,0,Le,be,Be[F].data);for(let ge=0;ge<V.length;ge++){const _e=V[ge].image[F].image;pt?ut&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+F,ge+1,0,0,_e.width,_e.height,Le,be,_e.data):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+F,ge+1,nt,_e.width,_e.height,0,Le,be,_e.data)}}else{pt?ut&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+F,0,0,0,Le,be,Be[F]):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+F,0,nt,Le,be,Be[F]);for(let ge=0;ge<V.length;ge++){const _e=V[ge];pt?ut&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+F,ge+1,0,0,Le,be,_e.image[F]):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+F,ge+1,nt,Le,be,_e.image[F])}}}m(k)&&_(r.TEXTURE_CUBE_MAP),Ee.__version=me.version,k.onUpdate&&k.onUpdate(k)}Y.__version=k.version}function G(Y,k,le,Ae,me,Ee){const Oe=s.convert(le.format,le.colorSpace),Ce=s.convert(le.type),Qe=w(le.internalFormat,Oe,Ce,le.colorSpace);if(!n.get(k).__hasExternalTextures){const ve=Math.max(1,k.width>>Ee),xe=Math.max(1,k.height>>Ee);me===r.TEXTURE_3D||me===r.TEXTURE_2D_ARRAY?t.texImage3D(me,Ee,Qe,ve,xe,k.depth,0,Oe,Ce,null):t.texImage2D(me,Ee,Qe,ve,xe,0,Oe,Ce,null)}t.bindFramebuffer(r.FRAMEBUFFER,Y),ke(k)?c.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,Ae,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,Ae,me,n.get(le).__webglTexture,Ee),t.bindFramebuffer(r.FRAMEBUFFER,null)}function de(Y,k,le){if(r.bindRenderbuffer(r.RENDERBUFFER,Y),k.depthBuffer&&!k.stencilBuffer){let Ae=r.DEPTH_COMPONENT24;if(le||ke(k)){const me=k.depthTexture;me&&me.isDepthTexture&&(me.type===lr?Ae=r.DEPTH_COMPONENT32F:me.type===Ii&&(Ae=r.DEPTH_COMPONENT24));const Ee=et(k);ke(k)?c.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,Ee,Ae,k.width,k.height):r.renderbufferStorageMultisample(r.RENDERBUFFER,Ee,Ae,k.width,k.height)}else r.renderbufferStorage(r.RENDERBUFFER,Ae,k.width,k.height);r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.RENDERBUFFER,Y)}else if(k.depthBuffer&&k.stencilBuffer){const Ae=et(k);le&&ke(k)===!1?r.renderbufferStorageMultisample(r.RENDERBUFFER,Ae,r.DEPTH24_STENCIL8,k.width,k.height):ke(k)?c.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,Ae,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 Ae=k.textures;for(let me=0;me<Ae.length;me++){const Ee=Ae[me],Oe=s.convert(Ee.format,Ee.colorSpace),Ce=s.convert(Ee.type),Qe=w(Ee.internalFormat,Oe,Ce,Ee.colorSpace),ve=et(k);le&&ke(k)===!1?r.renderbufferStorageMultisample(r.RENDERBUFFER,ve,Qe,k.width,k.height):ke(k)?c.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,ve,Qe,k.width,k.height):r.renderbufferStorage(r.RENDERBUFFER,Qe,k.width,k.height)}}r.bindRenderbuffer(r.RENDERBUFFER,null)}function pe(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,Ae=et(k);if(k.depthTexture.format===il)ke(k)?c.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,le,0,Ae):r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,le,0);else if(k.depthTexture.format===eu)ke(k)?c.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.TEXTURE_2D,le,0,Ae):r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.TEXTURE_2D,le,0);else throw new Error("Unknown depthTexture format")}function fe(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");pe(k.__webglFramebuffer,Y)}else if(le){k.__webglDepthbuffer=[];for(let Ae=0;Ae<6;Ae++)t.bindFramebuffer(r.FRAMEBUFFER,k.__webglFramebuffer[Ae]),k.__webglDepthbuffer[Ae]=r.createRenderbuffer(),de(k.__webglDepthbuffer[Ae],Y,!1)}else t.bindFramebuffer(r.FRAMEBUFFER,k.__webglFramebuffer),k.__webglDepthbuffer=r.createRenderbuffer(),de(k.__webglDepthbuffer,Y,!1);t.bindFramebuffer(r.FRAMEBUFFER,null)}function ye(Y,k,le){const Ae=n.get(Y);k!==void 0&&G(Ae.__webglFramebuffer,Y,Y.texture,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,0),le!==void 0&&fe(Y)}function Pe(Y){const k=Y.texture,le=n.get(Y),Ae=n.get(k);Y.addEventListener("dispose",R);const me=Y.textures,Ee=Y.isWebGLCubeRenderTarget===!0,Oe=me.length>1;if(Oe||(Ae.__webglTexture===void 0&&(Ae.__webglTexture=r.createTexture()),Ae.__version=k.version,o.memory.textures++),Ee){le.__webglFramebuffer=[];for(let Ce=0;Ce<6;Ce++)if(k.mipmaps&&k.mipmaps.length>0){le.__webglFramebuffer[Ce]=[];for(let Qe=0;Qe<k.mipmaps.length;Qe++)le.__webglFramebuffer[Ce][Qe]=r.createFramebuffer()}else le.__webglFramebuffer[Ce]=r.createFramebuffer()}else{if(k.mipmaps&&k.mipmaps.length>0){le.__webglFramebuffer=[];for(let Ce=0;Ce<k.mipmaps.length;Ce++)le.__webglFramebuffer[Ce]=r.createFramebuffer()}else le.__webglFramebuffer=r.createFramebuffer();if(Oe)for(let Ce=0,Qe=me.length;Ce<Qe;Ce++){const ve=n.get(me[Ce]);ve.__webglTexture===void 0&&(ve.__webglTexture=r.createTexture(),o.memory.textures++)}if(Y.samples>0&&ke(Y)===!1){le.__webglMultisampledFramebuffer=r.createFramebuffer(),le.__webglColorRenderbuffer=[],t.bindFramebuffer(r.FRAMEBUFFER,le.__webglMultisampledFramebuffer);for(let Ce=0;Ce<me.length;Ce++){const Qe=me[Ce];le.__webglColorRenderbuffer[Ce]=r.createRenderbuffer(),r.bindRenderbuffer(r.RENDERBUFFER,le.__webglColorRenderbuffer[Ce]);const ve=s.convert(Qe.format,Qe.colorSpace),xe=s.convert(Qe.type),Be=w(Qe.internalFormat,ve,xe,Qe.colorSpace,Y.isXRRenderTarget===!0),Ye=et(Y);r.renderbufferStorageMultisample(r.RENDERBUFFER,Ye,Be,Y.width,Y.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+Ce,r.RENDERBUFFER,le.__webglColorRenderbuffer[Ce])}r.bindRenderbuffer(r.RENDERBUFFER,null),Y.depthBuffer&&(le.__webglDepthRenderbuffer=r.createRenderbuffer(),de(le.__webglDepthRenderbuffer,Y,!0)),t.bindFramebuffer(r.FRAMEBUFFER,null)}}if(Ee){t.bindTexture(r.TEXTURE_CUBE_MAP,Ae.__webglTexture),Q(r.TEXTURE_CUBE_MAP,k);for(let Ce=0;Ce<6;Ce++)if(k.mipmaps&&k.mipmaps.length>0)for(let Qe=0;Qe<k.mipmaps.length;Qe++)G(le.__webglFramebuffer[Ce][Qe],Y,k,r.COLOR_ATTACHMENT0,r.TEXTURE_CUBE_MAP_POSITIVE_X+Ce,Qe);else G(le.__webglFramebuffer[Ce],Y,k,r.COLOR_ATTACHMENT0,r.TEXTURE_CUBE_MAP_POSITIVE_X+Ce,0);m(k)&&_(r.TEXTURE_CUBE_MAP),t.unbindTexture()}else if(Oe){for(let Ce=0,Qe=me.length;Ce<Qe;Ce++){const ve=me[Ce],xe=n.get(ve);t.bindTexture(r.TEXTURE_2D,xe.__webglTexture),Q(r.TEXTURE_2D,ve),G(le.__webglFramebuffer,Y,ve,r.COLOR_ATTACHMENT0+Ce,r.TEXTURE_2D,0),m(ve)&&_(r.TEXTURE_2D)}t.unbindTexture()}else{let Ce=r.TEXTURE_2D;if((Y.isWebGL3DRenderTarget||Y.isWebGLArrayRenderTarget)&&(Ce=Y.isWebGL3DRenderTarget?r.TEXTURE_3D:r.TEXTURE_2D_ARRAY),t.bindTexture(Ce,Ae.__webglTexture),Q(Ce,k),k.mipmaps&&k.mipmaps.length>0)for(let Qe=0;Qe<k.mipmaps.length;Qe++)G(le.__webglFramebuffer[Qe],Y,k,r.COLOR_ATTACHMENT0,Ce,Qe);else G(le.__webglFramebuffer,Y,k,r.COLOR_ATTACHMENT0,Ce,0);m(k)&&_(Ce),t.unbindTexture()}Y.depthBuffer&&fe(Y)}function at(Y){const k=Y.textures;for(let le=0,Ae=k.length;le<Ae;le++){const me=k[le];if(m(me)){const Ee=Y.isWebGLCubeRenderTarget?r.TEXTURE_CUBE_MAP:r.TEXTURE_2D,Oe=n.get(me).__webglTexture;t.bindTexture(Ee,Oe),_(Ee),t.unbindTexture()}}}function se(Y){if(Y.samples>0&&ke(Y)===!1){const k=Y.textures,le=Y.width,Ae=Y.height;let me=r.COLOR_BUFFER_BIT;const Ee=[],Oe=Y.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,Ce=n.get(Y),Qe=k.length>1;if(Qe)for(let ve=0;ve<k.length;ve++)t.bindFramebuffer(r.FRAMEBUFFER,Ce.__webglMultisampledFramebuffer),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+ve,r.RENDERBUFFER,null),t.bindFramebuffer(r.FRAMEBUFFER,Ce.__webglFramebuffer),r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0+ve,r.TEXTURE_2D,null,0);t.bindFramebuffer(r.READ_FRAMEBUFFER,Ce.__webglMultisampledFramebuffer),t.bindFramebuffer(r.DRAW_FRAMEBUFFER,Ce.__webglFramebuffer);for(let ve=0;ve<k.length;ve++){Ee.push(r.COLOR_ATTACHMENT0+ve),Y.depthBuffer&&Ee.push(Oe);const xe=Ce.__ignoreDepthValues!==void 0?Ce.__ignoreDepthValues:!1;if(xe===!1&&(Y.depthBuffer&&(me|=r.DEPTH_BUFFER_BIT),Y.stencilBuffer&&Ce.__isTransmissionRenderTarget!==!0&&(me|=r.STENCIL_BUFFER_BIT)),Qe&&r.framebufferRenderbuffer(r.READ_FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.RENDERBUFFER,Ce.__webglColorRenderbuffer[ve]),xe===!0&&(r.invalidateFramebuffer(r.READ_FRAMEBUFFER,[Oe]),r.invalidateFramebuffer(r.DRAW_FRAMEBUFFER,[Oe])),Qe){const Be=n.get(k[ve]).__webglTexture;r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,Be,0)}r.blitFramebuffer(0,0,le,Ae,0,0,le,Ae,me,r.NEAREST),h&&r.invalidateFramebuffer(r.READ_FRAMEBUFFER,Ee)}if(t.bindFramebuffer(r.READ_FRAMEBUFFER,null),t.bindFramebuffer(r.DRAW_FRAMEBUFFER,null),Qe)for(let ve=0;ve<k.length;ve++){t.bindFramebuffer(r.FRAMEBUFFER,Ce.__webglMultisampledFramebuffer),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+ve,r.RENDERBUFFER,Ce.__webglColorRenderbuffer[ve]);const xe=n.get(k[ve]).__webglTexture;t.bindFramebuffer(r.FRAMEBUFFER,Ce.__webglFramebuffer),r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0+ve,r.TEXTURE_2D,xe,0)}t.bindFramebuffer(r.DRAW_FRAMEBUFFER,Ce.__webglMultisampledFramebuffer)}}function et(Y){return Math.min(i.maxSamples,Y.samples)}function ke(Y){const k=n.get(Y);return Y.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&k.__useRenderToTexture!==!1}function dt(Y){const k=o.render.frame;d.get(Y)!==k&&(d.set(Y,k),Y.update())}function Xe(Y,k){const le=Y.colorSpace,Ae=Y.format,me=Y.type;return Y.isCompressedTexture===!0||Y.isVideoTexture===!0||le!==Sr&&le!==As&&(Rt.getTransfer(le)===Ht?(Ae!==gr||me!==Ar)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",le)),k}function ft(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=S,this.setTexture2D=N,this.setTexture2DArray=W,this.setTexture3D=X,this.setTextureCube=K,this.rebindTextures=ye,this.setupRenderTarget=Pe,this.updateRenderTargetMipmap=at,this.updateMultisampleRenderTarget=se,this.setupDepthRenderbuffer=fe,this.setupFrameBufferTexture=G,this.useMultisampledRTT=ke}function bL(r,e){function t(n,i=As){let s;const o=Rt.getTransfer(i);if(n===Ar)return r.UNSIGNED_BYTE;if(n===Wy)return r.UNSIGNED_SHORT_4_4_4_4;if(n===Yy)return r.UNSIGNED_SHORT_5_5_5_1;if(n===ZB)return r.UNSIGNED_INT_5_9_9_9_REV;if(n===hA)return r.BYTE;if(n===jy)return r.SHORT;if(n===dA)return r.UNSIGNED_SHORT;if(n===Zc)return r.INT;if(n===Ii)return r.UNSIGNED_INT;if(n===lr)return r.FLOAT;if(n===yn)return r.HALF_FLOAT;if(n===$B)return r.ALPHA;if(n===eb)return r.RGB;if(n===gr)return r.RGBA;if(n===tb)return r.LUMINANCE;if(n===rb)return r.LUMINANCE_ALPHA;if(n===il)return r.DEPTH_COMPONENT;if(n===eu)return r.DEPTH_STENCIL;if(n===ea)return r.RED;if(n===fA)return r.RED_INTEGER;if(n===io)return r.RG;if(n===Xh)return r.RG_INTEGER;if(n===tu)return r.RGBA_INTEGER;if(n===Kh||n===pA||n===AA||n===Jh)if(o===Ht)if(s=e.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(n===Kh)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===pA)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===AA)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===Jh)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=e.get("WEBGL_compressed_texture_s3tc"),s!==null){if(n===Kh)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===pA)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===AA)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===Jh)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(n===gA||n===qy||n===mA||n===Xy)if(s=e.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(n===gA)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===qy)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===mA)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===Xy)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(n===_A)return s=e.get("WEBGL_compressed_texture_etc1"),s!==null?s.COMPRESSED_RGB_ETC1_WEBGL:null;if(n===vA||n===yA)if(s=e.get("WEBGL_compressed_texture_etc"),s!==null){if(n===vA)return o===Ht?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(n===yA)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(n===EA||n===Ky||n===Jy||n===Zy||n===Zh||n===$y||n===eE||n===tE||n===rE||n===nE||n===iE||n===sE||n===aE||n===oE)if(s=e.get("WEBGL_compressed_texture_astc"),s!==null){if(n===EA)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===Ky)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===Jy)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===Zy)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===Zh)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===$y)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===eE)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===tE)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===rE)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===nE)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===iE)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===sE)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===aE)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===oE)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(n===$h||n===lE||n===cE)if(s=e.get("EXT_texture_compression_bptc"),s!==null){if(n===$h)return o===Ht?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===lE)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===cE)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(n===nb||n===uE||n===hE||n===dE)if(s=e.get("EXT_texture_compression_rgtc"),s!==null){if(n===$h)return s.COMPRESSED_RED_RGTC1_EXT;if(n===uE)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===hE)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===dE)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return n===$c?r.UNSIGNED_INT_24_8:r[n]!==void 0?r[n]:null}return{convert:t}}class RL extends un{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class oa extends Zt{constructor(){super(),this.isGroup=!0,this.type="Group"}}const DL={type:"move"};class tg{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 j,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new j),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 j,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new j),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 c=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),_=this._getHandJoint(u,E);m!==null&&(_.matrix.fromArray(m.transform.matrix),_.matrix.decompose(_.position,_.rotation,_.scale),_.matrixWorldNeedsUpdate=!0,_.jointRadius=m.radius),_.visible=m!==null}const d=u.joints["index-finger-tip"],A=u.joints["thumb-tip"],p=d.position.distanceTo(A.position),g=.02,v=.005;u.inputState.pinching&&p>g+v?(u.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!u.inputState.pinching&&p<=g-v&&(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));c!==null&&(i=t.getPose(e.targetRaySpace,n),i===null&&s!==null&&(i=s),i!==null&&(c.matrix.fromArray(i.transform.matrix),c.matrix.decompose(c.position,c.rotation,c.scale),c.matrixWorldNeedsUpdate=!0,i.linearVelocity?(c.hasLinearVelocity=!0,c.linearVelocity.copy(i.linearVelocity)):c.hasLinearVelocity=!1,i.angularVelocity?(c.hasAngularVelocity=!0,c.angularVelocity.copy(i.angularVelocity)):c.hasAngularVelocity=!1,this.dispatchEvent(DL)))}return c!==null&&(c.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 LL=`
3804
+ }`;function ML(r,e,t){let n=new WA;const i=new Ge,s=new Ge,o=new Ot,c=new M2({depthPacking:ob}),h=new IL,u={},d=t.maxTextureSize,A={[yi]:kr,[kr]:yi,[Ei]:Ei},p=new En({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Ge},radius:{value:4}},vertexShader:CL,fragmentShader:SL}),g=p.clone();g.defines.HORIZONTAL_PASS=1;const v=new Gn;v.setAttribute("position",new Fr(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const E=new Yr(v,p),m=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Dy;let _=this.type;this.render=function(M,T,D){if(m.enabled===!1||m.autoUpdate===!1&&m.needsUpdate===!1||M.length===0)return;const b=r.getRenderTarget(),S=r.getActiveCubeFace(),L=r.getActiveMipmapLevel(),P=r.state;P.setBlending(ps),P.buffers.color.setClear(1,1,1,1),P.buffers.depth.setTest(!0),P.setScissorTest(!1);const N=_!==fs&&this.type===fs,W=_===fs&&this.type!==fs;for(let X=0,K=M.length;X<K;X++){const te=M[X],H=te.shadow;if(H===void 0){console.warn("THREE.WebGLShadowMap:",te,"has no shadow.");continue}if(H.autoUpdate===!1&&H.needsUpdate===!1)continue;i.copy(H.mapSize);const ee=H.getFrameExtents();if(i.multiply(ee),s.copy(H.mapSize),(i.x>d||i.y>d)&&(i.x>d&&(s.x=Math.floor(d/ee.x),i.x=s.x*ee.x,H.mapSize.x=s.x),i.y>d&&(s.y=Math.floor(d/ee.y),i.y=s.y*ee.y,H.mapSize.y=s.y)),H.map===null||N===!0||W===!0){const z=this.type!==fs?{minFilter:fr,magFilter:fr}:{};H.map!==null&&H.map.dispose(),H.map=new Mi(i.x,i.y,z),H.map.texture.name=te.name+".shadowMap",H.camera.updateProjectionMatrix()}r.setRenderTarget(H.map),r.clear();const Q=H.getViewportCount();for(let z=0;z<Q;z++){const Z=H.getViewport(z);o.set(s.x*Z.x,s.y*Z.y,s.x*Z.z,s.y*Z.w),P.viewport(o),H.updateMatrices(te,z),n=H.getFrustum(),I(T,D,H.camera,te,this.type)}H.isPointLightShadow!==!0&&this.type===fs&&w(H,D),H.needsUpdate=!1}_=this.type,m.needsUpdate=!1,r.setRenderTarget(b,S,L)};function w(M,T){const D=e.update(E);p.defines.VSM_SAMPLES!==M.blurSamples&&(p.defines.VSM_SAMPLES=M.blurSamples,g.defines.VSM_SAMPLES=M.blurSamples,p.needsUpdate=!0,g.needsUpdate=!0),M.mapPass===null&&(M.mapPass=new Mi(i.x,i.y)),p.uniforms.shadow_pass.value=M.map.texture,p.uniforms.resolution.value=M.mapSize,p.uniforms.radius.value=M.radius,r.setRenderTarget(M.mapPass),r.clear(),r.renderBufferDirect(T,null,D,p,E,null),g.uniforms.shadow_pass.value=M.mapPass.texture,g.uniforms.resolution.value=M.mapSize,g.uniforms.radius.value=M.radius,r.setRenderTarget(M.map),r.clear(),r.renderBufferDirect(T,null,D,g,E,null)}function x(M,T,D,b){let S=null;const L=D.isPointLight===!0?M.customDistanceMaterial:M.customDepthMaterial;if(L!==void 0)S=L;else if(S=D.isPointLight===!0?h:c,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=S.uuid,N=T.uuid;let W=u[P];W===void 0&&(W={},u[P]=W);let X=W[N];X===void 0&&(X=S.clone(),W[N]=X,T.addEventListener("dispose",R)),S=X}if(S.visible=T.visible,S.wireframe=T.wireframe,b===fs?S.side=T.shadowSide!==null?T.shadowSide:T.side:S.side=T.shadowSide!==null?T.shadowSide:A[T.side],S.alphaMap=T.alphaMap,S.alphaTest=T.alphaTest,S.map=T.map,S.clipShadows=T.clipShadows,S.clippingPlanes=T.clippingPlanes,S.clipIntersection=T.clipIntersection,S.displacementMap=T.displacementMap,S.displacementScale=T.displacementScale,S.displacementBias=T.displacementBias,S.wireframeLinewidth=T.wireframeLinewidth,S.linewidth=T.linewidth,D.isPointLight===!0&&S.isMeshDistanceMaterial===!0){const P=r.properties.get(S);P.light=D}return S}function I(M,T,D,b,S){if(M.visible===!1)return;if(M.layers.test(T.layers)&&(M.isMesh||M.isLine||M.isPoints)&&(M.castShadow||M.receiveShadow&&S===fs)&&(!M.frustumCulled||n.intersectsObject(M))){M.modelViewMatrix.multiplyMatrices(D.matrixWorldInverse,M.matrixWorld);const P=e.update(M),N=M.material;if(Array.isArray(N)){const W=P.groups;for(let X=0,K=W.length;X<K;X++){const te=W[X],H=N[te.materialIndex];if(H&&H.visible){const ee=x(M,H,b,S);M.onBeforeShadow(r,M,T,D,P,ee,te),r.renderBufferDirect(D,null,P,ee,M,te),M.onAfterShadow(r,M,T,D,P,ee,te)}}}else if(N.visible){const W=x(M,N,b,S);M.onBeforeShadow(r,M,T,D,P,W,null),r.renderBufferDirect(D,null,P,W,M,null),M.onAfterShadow(r,M,T,D,P,W,null)}}const L=M.children;for(let P=0,N=L.length;P<N;P++)I(L[P],T,D,b,S)}function R(M){M.target.removeEventListener("dispose",R);for(const T in u){const D=u[T],b=M.target.uuid;b in D&&(D[b].dispose(),delete D[b])}}}function TL(r){function e(){let F=!1;const ge=new Ot;let _e=null;const ze=new Ot(0,0,0,0);return{setMask:function(Ne){_e!==Ne&&!F&&(r.colorMask(Ne,Ne,Ne,Ne),_e=Ne)},setLocked:function(Ne){F=Ne},setClear:function(Ne,_t,Dt,Lt,Mt){Mt===!0&&(Ne*=Lt,_t*=Lt,Dt*=Lt),ge.set(Ne,_t,Dt,Lt),ze.equals(ge)===!1&&(r.clearColor(Ne,_t,Dt,Lt),ze.copy(ge))},reset:function(){F=!1,_e=null,ze.set(-1,0,0,0)}}}function t(){let F=!1,ge=null,_e=null,ze=null;return{setTest:function(Ne){Ne?pe(r.DEPTH_TEST):fe(r.DEPTH_TEST)},setMask:function(Ne){ge!==Ne&&!F&&(r.depthMask(Ne),ge=Ne)},setFunc:function(Ne){if(_e!==Ne){switch(Ne){case OB:r.depthFunc(r.NEVER);break;case zB:r.depthFunc(r.ALWAYS);break;case HB:r.depthFunc(r.LESS);break;case jh:r.depthFunc(r.LEQUAL);break;case GB:r.depthFunc(r.EQUAL);break;case VB:r.depthFunc(r.GEQUAL);break;case jB:r.depthFunc(r.GREATER);break;case WB:r.depthFunc(r.NOTEQUAL);break;default:r.depthFunc(r.LEQUAL)}_e=Ne}},setLocked:function(Ne){F=Ne},setClear:function(Ne){ze!==Ne&&(r.clearDepth(Ne),ze=Ne)},reset:function(){F=!1,ge=null,_e=null,ze=null}}}function n(){let F=!1,ge=null,_e=null,ze=null,Ne=null,_t=null,Dt=null,Lt=null,Mt=null;return{setTest:function(vt){F||(vt?pe(r.STENCIL_TEST):fe(r.STENCIL_TEST))},setMask:function(vt){ge!==vt&&!F&&(r.stencilMask(vt),ge=vt)},setFunc:function(vt,hr,Vt){(_e!==vt||ze!==hr||Ne!==Vt)&&(r.stencilFunc(vt,hr,Vt),_e=vt,ze=hr,Ne=Vt)},setOp:function(vt,hr,Vt){(_t!==vt||Dt!==hr||Lt!==Vt)&&(r.stencilOp(vt,hr,Vt),_t=vt,Dt=hr,Lt=Vt)},setLocked:function(vt){F=vt},setClear:function(vt){Mt!==vt&&(r.clearStencil(vt),Mt=vt)},reset:function(){F=!1,ge=null,_e=null,ze=null,Ne=null,_t=null,Dt=null,Lt=null,Mt=null}}}const i=new e,s=new t,o=new n,c=new WeakMap,h=new WeakMap;let u={},d={},A=new WeakMap,p=[],g=null,v=!1,E=null,m=null,_=null,w=null,x=null,I=null,R=null,M=new Ke(0,0,0),T=0,D=!1,b=null,S=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 H=null,ee={};const Q=r.getParameter(r.SCISSOR_BOX),z=r.getParameter(r.VIEWPORT),Z=new Ot().fromArray(Q),re=new Ot().fromArray(z);function G(F,ge,_e,ze){const Ne=new Uint8Array(4),_t=r.createTexture();r.bindTexture(F,_t),r.texParameteri(F,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(F,r.TEXTURE_MAG_FILTER,r.NEAREST);for(let Dt=0;Dt<_e;Dt++)F===r.TEXTURE_3D||F===r.TEXTURE_2D_ARRAY?r.texImage3D(ge,0,r.RGBA,1,1,ze,0,r.RGBA,r.UNSIGNED_BYTE,Ne):r.texImage2D(ge+Dt,0,r.RGBA,1,1,0,r.RGBA,r.UNSIGNED_BYTE,Ne);return _t}const de={};de[r.TEXTURE_2D]=G(r.TEXTURE_2D,r.TEXTURE_2D,1),de[r.TEXTURE_CUBE_MAP]=G(r.TEXTURE_CUBE_MAP,r.TEXTURE_CUBE_MAP_POSITIVE_X,6),de[r.TEXTURE_2D_ARRAY]=G(r.TEXTURE_2D_ARRAY,r.TEXTURE_2D_ARRAY,1,1),de[r.TEXTURE_3D]=G(r.TEXTURE_3D,r.TEXTURE_3D,1,1),i.setClear(0,0,0,1),s.setClear(1),o.setClear(0),pe(r.DEPTH_TEST),s.setFunc(jh),Xe(!1),ft(Ry),pe(r.CULL_FACE),ke(ps);function pe(F){u[F]!==!0&&(r.enable(F),u[F]=!0)}function fe(F){u[F]!==!1&&(r.disable(F),u[F]=!1)}function ye(F,ge){return d[F]!==ge?(r.bindFramebuffer(F,ge),d[F]=ge,F===r.DRAW_FRAMEBUFFER&&(d[r.FRAMEBUFFER]=ge),F===r.FRAMEBUFFER&&(d[r.DRAW_FRAMEBUFFER]=ge),!0):!1}function Pe(F,ge){let _e=p,ze=!1;if(F){_e=A.get(ge),_e===void 0&&(_e=[],A.set(ge,_e));const Ne=F.textures;if(_e.length!==Ne.length||_e[0]!==r.COLOR_ATTACHMENT0){for(let _t=0,Dt=Ne.length;_t<Dt;_t++)_e[_t]=r.COLOR_ATTACHMENT0+_t;_e.length=Ne.length,ze=!0}}else _e[0]!==r.BACK&&(_e[0]=r.BACK,ze=!0);ze&&r.drawBuffers(_e)}function at(F){return g!==F?(r.useProgram(F),g=F,!0):!1}const se={[ro]:r.FUNC_ADD,[wB]:r.FUNC_SUBTRACT,[IB]:r.FUNC_REVERSE_SUBTRACT};se[CB]=r.MIN,se[SB]=r.MAX;const et={[MB]:r.ZERO,[TB]:r.ONE,[BB]:r.SRC_COLOR,[oA]:r.SRC_ALPHA,[UB]:r.SRC_ALPHA_SATURATE,[LB]:r.DST_COLOR,[RB]:r.DST_ALPHA,[bB]:r.ONE_MINUS_SRC_COLOR,[lA]:r.ONE_MINUS_SRC_ALPHA,[NB]:r.ONE_MINUS_DST_COLOR,[DB]:r.ONE_MINUS_DST_ALPHA,[PB]:r.CONSTANT_COLOR,[kB]:r.ONE_MINUS_CONSTANT_COLOR,[QB]:r.CONSTANT_ALPHA,[FB]:r.ONE_MINUS_CONSTANT_ALPHA};function ke(F,ge,_e,ze,Ne,_t,Dt,Lt,Mt,vt){if(F===ps){v===!0&&(fe(r.BLEND),v=!1);return}if(v===!1&&(pe(r.BLEND),v=!0),F!==xB){if(F!==E||vt!==D){if((m!==ro||x!==ro)&&(r.blendEquation(r.FUNC_ADD),m=ro,x=ro),vt)switch(F){case rl:r.blendFuncSeparate(r.ONE,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA);break;case Ly:r.blendFunc(r.ONE,r.ONE);break;case Ny:r.blendFuncSeparate(r.ZERO,r.ONE_MINUS_SRC_COLOR,r.ZERO,r.ONE);break;case Uy:r.blendFuncSeparate(r.ZERO,r.SRC_COLOR,r.ZERO,r.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",F);break}else switch(F){case rl:r.blendFuncSeparate(r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA);break;case Ly:r.blendFunc(r.SRC_ALPHA,r.ONE);break;case Ny:r.blendFuncSeparate(r.ZERO,r.ONE_MINUS_SRC_COLOR,r.ZERO,r.ONE);break;case Uy:r.blendFunc(r.ZERO,r.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",F);break}_=null,w=null,I=null,R=null,M.set(0,0,0),T=0,E=F,D=vt}return}Ne=Ne||ge,_t=_t||_e,Dt=Dt||ze,(ge!==m||Ne!==x)&&(r.blendEquationSeparate(se[ge],se[Ne]),m=ge,x=Ne),(_e!==_||ze!==w||_t!==I||Dt!==R)&&(r.blendFuncSeparate(et[_e],et[ze],et[_t],et[Dt]),_=_e,w=ze,I=_t,R=Dt),(Lt.equals(M)===!1||Mt!==T)&&(r.blendColor(Lt.r,Lt.g,Lt.b,Mt),M.copy(Lt),T=Mt),E=F,D=!1}function dt(F,ge){F.side===Ei?fe(r.CULL_FACE):pe(r.CULL_FACE);let _e=F.side===kr;ge&&(_e=!_e),Xe(_e),F.blending===rl&&F.transparent===!1?ke(ps):ke(F.blending,F.blendEquation,F.blendSrc,F.blendDst,F.blendEquationAlpha,F.blendSrcAlpha,F.blendDstAlpha,F.blendColor,F.blendAlpha,F.premultipliedAlpha),s.setFunc(F.depthFunc),s.setTest(F.depthTest),s.setMask(F.depthWrite),i.setMask(F.colorWrite);const ze=F.stencilWrite;o.setTest(ze),ze&&(o.setMask(F.stencilWriteMask),o.setFunc(F.stencilFunc,F.stencilRef,F.stencilFuncMask),o.setOp(F.stencilFail,F.stencilZFail,F.stencilZPass)),k(F.polygonOffset,F.polygonOffsetFactor,F.polygonOffsetUnits),F.alphaToCoverage===!0?pe(r.SAMPLE_ALPHA_TO_COVERAGE):fe(r.SAMPLE_ALPHA_TO_COVERAGE)}function Xe(F){b!==F&&(F?r.frontFace(r.CW):r.frontFace(r.CCW),b=F)}function ft(F){F!==vB?(pe(r.CULL_FACE),F!==S&&(F===Ry?r.cullFace(r.BACK):F===yB?r.cullFace(r.FRONT):r.cullFace(r.FRONT_AND_BACK))):fe(r.CULL_FACE),S=F}function Y(F){F!==L&&(X&&r.lineWidth(F),L=F)}function k(F,ge,_e){F?(pe(r.POLYGON_OFFSET_FILL),(P!==ge||N!==_e)&&(r.polygonOffset(ge,_e),P=ge,N=_e)):fe(r.POLYGON_OFFSET_FILL)}function le(F){F?pe(r.SCISSOR_TEST):fe(r.SCISSOR_TEST)}function Ae(F){F===void 0&&(F=r.TEXTURE0+W-1),H!==F&&(r.activeTexture(F),H=F)}function me(F,ge,_e){_e===void 0&&(H===null?_e=r.TEXTURE0+W-1:_e=H);let ze=ee[_e];ze===void 0&&(ze={type:void 0,texture:void 0},ee[_e]=ze),(ze.type!==F||ze.texture!==ge)&&(H!==_e&&(r.activeTexture(_e),H=_e),r.bindTexture(F,ge||de[F]),ze.type=F,ze.texture=ge)}function Ee(){const F=ee[H];F!==void 0&&F.type!==void 0&&(r.bindTexture(F.type,null),F.type=void 0,F.texture=void 0)}function Oe(){try{r.compressedTexImage2D.apply(r,arguments)}catch(F){console.error("THREE.WebGLState:",F)}}function Ce(){try{r.compressedTexImage3D.apply(r,arguments)}catch(F){console.error("THREE.WebGLState:",F)}}function Qe(){try{r.texSubImage2D.apply(r,arguments)}catch(F){console.error("THREE.WebGLState:",F)}}function ve(){try{r.texSubImage3D.apply(r,arguments)}catch(F){console.error("THREE.WebGLState:",F)}}function xe(){try{r.compressedTexSubImage2D.apply(r,arguments)}catch(F){console.error("THREE.WebGLState:",F)}}function Be(){try{r.compressedTexSubImage3D.apply(r,arguments)}catch(F){console.error("THREE.WebGLState:",F)}}function We(){try{r.texStorage2D.apply(r,arguments)}catch(F){console.error("THREE.WebGLState:",F)}}function Le(){try{r.texStorage3D.apply(r,arguments)}catch(F){console.error("THREE.WebGLState:",F)}}function be(){try{r.texImage2D.apply(r,arguments)}catch(F){console.error("THREE.WebGLState:",F)}}function nt(){try{r.texImage3D.apply(r,arguments)}catch(F){console.error("THREE.WebGLState:",F)}}function pt(F){Z.equals(F)===!1&&(r.scissor(F.x,F.y,F.z,F.w),Z.copy(F))}function ct(F){re.equals(F)===!1&&(r.viewport(F.x,F.y,F.z,F.w),re.copy(F))}function ut(F,ge){let _e=h.get(ge);_e===void 0&&(_e=new WeakMap,h.set(ge,_e));let ze=_e.get(F);ze===void 0&&(ze=r.getUniformBlockIndex(ge,F.name),_e.set(F,ze))}function tt(F,ge){const _e=h.get(ge).get(F);c.get(ge)!==_e&&(r.uniformBlockBinding(ge,_e,F.__bindingPointIndex),c.set(ge,_e))}function V(){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={},H=null,ee={},d={},A=new WeakMap,p=[],g=null,v=!1,E=null,m=null,_=null,w=null,x=null,I=null,R=null,M=new Ke(0,0,0),T=0,D=!1,b=null,S=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:pe,disable:fe,bindFramebuffer:ye,drawBuffers:Pe,useProgram:at,setBlending:ke,setMaterial:dt,setFlipSided:Xe,setCullFace:ft,setLineWidth:Y,setPolygonOffset:k,setScissorTest:le,activeTexture:Ae,bindTexture:me,unbindTexture:Ee,compressedTexImage2D:Oe,compressedTexImage3D:Ce,texImage2D:be,texImage3D:nt,updateUBOMapping:ut,uniformBlockBinding:tt,texStorage2D:We,texStorage3D:Le,texSubImage2D:Qe,texSubImage3D:ve,compressedTexSubImage2D:xe,compressedTexSubImage3D:Be,scissor:pt,viewport:ct,reset:V}}function BL(r,e,t,n,i,s,o){const c=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 Ge,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 v(Y,k){return g?new OffscreenCanvas(Y,k):au("canvas")}function E(Y,k,le){let Ae=1;const me=ft(Y);if((me.width>le||me.height>le)&&(Ae=le/Math.max(me.width,me.height)),Ae<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 Ee=Math.floor(Ae*me.width),Oe=Math.floor(Ae*me.height);A===void 0&&(A=v(Ee,Oe));const Ce=k?v(Ee,Oe):A;return Ce.width=Ee,Ce.height=Oe,Ce.getContext("2d").drawImage(Y,0,0,Ee,Oe),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+me.width+"x"+me.height+") to ("+Ee+"x"+Oe+")."),Ce}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!==fr&&Y.minFilter!==pr}function _(Y){r.generateMipmap(Y)}function w(Y,k,le,Ae,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 Ee=k;if(k===r.RED&&(le===r.FLOAT&&(Ee=r.R32F),le===r.HALF_FLOAT&&(Ee=r.R16F),le===r.UNSIGNED_BYTE&&(Ee=r.R8)),k===r.RED_INTEGER&&(le===r.UNSIGNED_BYTE&&(Ee=r.R8UI),le===r.UNSIGNED_SHORT&&(Ee=r.R16UI),le===r.UNSIGNED_INT&&(Ee=r.R32UI),le===r.BYTE&&(Ee=r.R8I),le===r.SHORT&&(Ee=r.R16I),le===r.INT&&(Ee=r.R32I)),k===r.RG&&(le===r.FLOAT&&(Ee=r.RG32F),le===r.HALF_FLOAT&&(Ee=r.RG16F),le===r.UNSIGNED_BYTE&&(Ee=r.RG8)),k===r.RG_INTEGER&&(le===r.UNSIGNED_BYTE&&(Ee=r.RG8UI),le===r.UNSIGNED_SHORT&&(Ee=r.RG16UI),le===r.UNSIGNED_INT&&(Ee=r.RG32UI),le===r.BYTE&&(Ee=r.RG8I),le===r.SHORT&&(Ee=r.RG16I),le===r.INT&&(Ee=r.RG32I)),k===r.RGB&&le===r.UNSIGNED_INT_5_9_9_9_REV&&(Ee=r.RGB9_E5),k===r.RGBA){const Oe=me?td:Rt.getTransfer(Ae);le===r.FLOAT&&(Ee=r.RGBA32F),le===r.HALF_FLOAT&&(Ee=r.RGBA16F),le===r.UNSIGNED_BYTE&&(Ee=Oe===Ht?r.SRGB8_ALPHA8:r.RGBA8),le===r.UNSIGNED_SHORT_4_4_4_4&&(Ee=r.RGBA4),le===r.UNSIGNED_SHORT_5_5_5_1&&(Ee=r.RGB5_A1)}return(Ee===r.R16F||Ee===r.R32F||Ee===r.RG16F||Ee===r.RG32F||Ee===r.RGBA16F||Ee===r.RGBA32F)&&e.get("EXT_color_buffer_float"),Ee}function x(Y,k){return m(Y)===!0||Y.isFramebufferTexture&&Y.minFilter!==fr&&Y.minFilter!==pr?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),M(k),k.isVideoTexture&&d.delete(k)}function R(Y){const k=Y.target;k.removeEventListener("dispose",R),D(k)}function M(Y){const k=n.get(Y);if(k.__webglInit===void 0)return;const le=Y.source,Ae=p.get(le);if(Ae){const me=Ae[k.__cacheKey];me.usedTimes--,me.usedTimes===0&&T(Y),Object.keys(Ae).length===0&&p.delete(le)}n.remove(Y)}function T(Y){const k=n.get(Y);r.deleteTexture(k.__webglTexture);const le=Y.source,Ae=p.get(le);delete Ae[k.__cacheKey],o.memory.textures--}function D(Y){const k=n.get(Y);if(Y.depthTexture&&Y.depthTexture.dispose(),Y.isWebGLCubeRenderTarget)for(let Ae=0;Ae<6;Ae++){if(Array.isArray(k.__webglFramebuffer[Ae]))for(let me=0;me<k.__webglFramebuffer[Ae].length;me++)r.deleteFramebuffer(k.__webglFramebuffer[Ae][me]);else r.deleteFramebuffer(k.__webglFramebuffer[Ae]);k.__webglDepthbuffer&&r.deleteRenderbuffer(k.__webglDepthbuffer[Ae])}else{if(Array.isArray(k.__webglFramebuffer))for(let Ae=0;Ae<k.__webglFramebuffer.length;Ae++)r.deleteFramebuffer(k.__webglFramebuffer[Ae]);else r.deleteFramebuffer(k.__webglFramebuffer);if(k.__webglDepthbuffer&&r.deleteRenderbuffer(k.__webglDepthbuffer),k.__webglMultisampledFramebuffer&&r.deleteFramebuffer(k.__webglMultisampledFramebuffer),k.__webglColorRenderbuffer)for(let Ae=0;Ae<k.__webglColorRenderbuffer.length;Ae++)k.__webglColorRenderbuffer[Ae]&&r.deleteRenderbuffer(k.__webglColorRenderbuffer[Ae]);k.__webglDepthRenderbuffer&&r.deleteRenderbuffer(k.__webglDepthRenderbuffer)}const le=Y.textures;for(let Ae=0,me=le.length;Ae<me;Ae++){const Ee=n.get(le[Ae]);Ee.__webglTexture&&(r.deleteTexture(Ee.__webglTexture),o.memory.textures--),n.remove(le[Ae])}n.remove(Y)}let b=0;function S(){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&&dt(Y),Y.isRenderTargetTexture===!1&&Y.version>0&&le.__version!==Y.version){const Ae=Y.image;if(Ae===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(Ae.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,[xi]:r.CLAMP_TO_EDGE,[Yh]:r.MIRRORED_REPEAT},H={[fr]:r.NEAREST,[Vy]:r.NEAREST_MIPMAP_NEAREST,[Jc]:r.NEAREST_MIPMAP_LINEAR,[pr]:r.LINEAR,[qh]:r.LINEAR_MIPMAP_NEAREST,[wi]:r.LINEAR_MIPMAP_LINEAR},ee={[cb]:r.NEVER,[Ab]:r.ALWAYS,[ub]:r.LESS,[vE]:r.LEQUAL,[hb]:r.EQUAL,[pb]:r.GEQUAL,[db]:r.GREATER,[fb]:r.NOTEQUAL};function Q(Y,k){if(k.type===lr&&e.has("OES_texture_float_linear")===!1&&(k.magFilter===pr||k.magFilter===qh||k.magFilter===Jc||k.magFilter===wi||k.minFilter===pr||k.minFilter===qh||k.minFilter===Jc||k.minFilter===wi)&&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,H[k.magFilter]),r.texParameteri(Y,r.TEXTURE_MIN_FILTER,H[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===fr||k.minFilter!==Jc&&k.minFilter!==wi||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 Ae=k.source;let me=p.get(Ae);me===void 0&&(me={},p.set(Ae,me));const Ee=P(k);if(Ee!==Y.__cacheKey){me[Ee]===void 0&&(me[Ee]={texture:r.createTexture(),usedTimes:0},o.memory.textures++,le=!0),me[Ee].usedTimes++;const Oe=me[Y.__cacheKey];Oe!==void 0&&(me[Y.__cacheKey].usedTimes--,Oe.usedTimes===0&&T(k)),Y.__cacheKey=Ee,Y.__webglTexture=me[Ee].texture}return le}function Z(Y,k,le){let Ae=r.TEXTURE_2D;(k.isDataArrayTexture||k.isCompressedArrayTexture)&&(Ae=r.TEXTURE_2D_ARRAY),k.isData3DTexture&&(Ae=r.TEXTURE_3D);const me=z(Y,k),Ee=k.source;t.bindTexture(Ae,Y.__webglTexture,r.TEXTURE0+le);const Oe=n.get(Ee);if(Ee.version!==Oe.__version||me===!0){t.activeTexture(r.TEXTURE0+le);const Ce=Rt.getPrimaries(Rt.workingColorSpace),Qe=k.colorSpace===As?null:Rt.getPrimaries(k.colorSpace),ve=k.colorSpace===As||Ce===Qe?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,ve);let xe=E(k.image,!1,i.maxTextureSize);xe=Xe(k,xe);const Be=s.convert(k.format,k.colorSpace),We=s.convert(k.type);let Le=w(k.internalFormat,Be,We,k.colorSpace,k.isVideoTexture);Q(Ae,k);let be;const nt=k.mipmaps,pt=k.isVideoTexture!==!0&&Le!==_A,ct=Oe.__version===void 0||me===!0,ut=Ee.dataReady,tt=x(k,xe);if(k.isDepthTexture)Le=r.DEPTH_COMPONENT16,k.type===lr?Le=r.DEPTH_COMPONENT32F:k.type===Ii?Le=r.DEPTH_COMPONENT24:k.type===$c&&(Le=r.DEPTH24_STENCIL8),ct&&(pt?t.texStorage2D(r.TEXTURE_2D,1,Le,xe.width,xe.height):t.texImage2D(r.TEXTURE_2D,0,Le,xe.width,xe.height,0,Be,We,null));else if(k.isDataTexture)if(nt.length>0){pt&&ct&&t.texStorage2D(r.TEXTURE_2D,tt,Le,nt[0].width,nt[0].height);for(let V=0,F=nt.length;V<F;V++)be=nt[V],pt?ut&&t.texSubImage2D(r.TEXTURE_2D,V,0,0,be.width,be.height,Be,We,be.data):t.texImage2D(r.TEXTURE_2D,V,Le,be.width,be.height,0,Be,We,be.data);k.generateMipmaps=!1}else pt?(ct&&t.texStorage2D(r.TEXTURE_2D,tt,Le,xe.width,xe.height),ut&&t.texSubImage2D(r.TEXTURE_2D,0,0,0,xe.width,xe.height,Be,We,xe.data)):t.texImage2D(r.TEXTURE_2D,0,Le,xe.width,xe.height,0,Be,We,xe.data);else if(k.isCompressedTexture)if(k.isCompressedArrayTexture){pt&&ct&&t.texStorage3D(r.TEXTURE_2D_ARRAY,tt,Le,nt[0].width,nt[0].height,xe.depth);for(let V=0,F=nt.length;V<F;V++)be=nt[V],k.format!==gr?Be!==null?pt?ut&&t.compressedTexSubImage3D(r.TEXTURE_2D_ARRAY,V,0,0,0,be.width,be.height,xe.depth,Be,be.data,0,0):t.compressedTexImage3D(r.TEXTURE_2D_ARRAY,V,Le,be.width,be.height,xe.depth,0,be.data,0,0):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):pt?ut&&t.texSubImage3D(r.TEXTURE_2D_ARRAY,V,0,0,0,be.width,be.height,xe.depth,Be,We,be.data):t.texImage3D(r.TEXTURE_2D_ARRAY,V,Le,be.width,be.height,xe.depth,0,Be,We,be.data)}else{pt&&ct&&t.texStorage2D(r.TEXTURE_2D,tt,Le,nt[0].width,nt[0].height);for(let V=0,F=nt.length;V<F;V++)be=nt[V],k.format!==gr?Be!==null?pt?ut&&t.compressedTexSubImage2D(r.TEXTURE_2D,V,0,0,be.width,be.height,Be,be.data):t.compressedTexImage2D(r.TEXTURE_2D,V,Le,be.width,be.height,0,be.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):pt?ut&&t.texSubImage2D(r.TEXTURE_2D,V,0,0,be.width,be.height,Be,We,be.data):t.texImage2D(r.TEXTURE_2D,V,Le,be.width,be.height,0,Be,We,be.data)}else if(k.isDataArrayTexture)pt?(ct&&t.texStorage3D(r.TEXTURE_2D_ARRAY,tt,Le,xe.width,xe.height,xe.depth),ut&&t.texSubImage3D(r.TEXTURE_2D_ARRAY,0,0,0,0,xe.width,xe.height,xe.depth,Be,We,xe.data)):t.texImage3D(r.TEXTURE_2D_ARRAY,0,Le,xe.width,xe.height,xe.depth,0,Be,We,xe.data);else if(k.isData3DTexture)pt?(ct&&t.texStorage3D(r.TEXTURE_3D,tt,Le,xe.width,xe.height,xe.depth),ut&&t.texSubImage3D(r.TEXTURE_3D,0,0,0,0,xe.width,xe.height,xe.depth,Be,We,xe.data)):t.texImage3D(r.TEXTURE_3D,0,Le,xe.width,xe.height,xe.depth,0,Be,We,xe.data);else if(k.isFramebufferTexture){if(ct)if(pt)t.texStorage2D(r.TEXTURE_2D,tt,Le,xe.width,xe.height);else{let V=xe.width,F=xe.height;for(let ge=0;ge<tt;ge++)t.texImage2D(r.TEXTURE_2D,ge,Le,V,F,0,Be,We,null),V>>=1,F>>=1}}else if(nt.length>0){if(pt&&ct){const V=ft(nt[0]);t.texStorage2D(r.TEXTURE_2D,tt,Le,V.width,V.height)}for(let V=0,F=nt.length;V<F;V++)be=nt[V],pt?ut&&t.texSubImage2D(r.TEXTURE_2D,V,0,0,Be,We,be):t.texImage2D(r.TEXTURE_2D,V,Le,Be,We,be);k.generateMipmaps=!1}else if(pt){if(ct){const V=ft(xe);t.texStorage2D(r.TEXTURE_2D,tt,Le,V.width,V.height)}ut&&t.texSubImage2D(r.TEXTURE_2D,0,0,0,Be,We,xe)}else t.texImage2D(r.TEXTURE_2D,0,Le,Be,We,xe);m(k)&&_(Ae),Oe.__version=Ee.version,k.onUpdate&&k.onUpdate(k)}Y.__version=k.version}function re(Y,k,le){if(k.image.length!==6)return;const Ae=z(Y,k),me=k.source;t.bindTexture(r.TEXTURE_CUBE_MAP,Y.__webglTexture,r.TEXTURE0+le);const Ee=n.get(me);if(me.version!==Ee.__version||Ae===!0){t.activeTexture(r.TEXTURE0+le);const Oe=Rt.getPrimaries(Rt.workingColorSpace),Ce=k.colorSpace===As?null:Rt.getPrimaries(k.colorSpace),Qe=k.colorSpace===As||Oe===Ce?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,Qe);const ve=k.isCompressedTexture||k.image[0].isCompressedTexture,xe=k.image[0]&&k.image[0].isDataTexture,Be=[];for(let F=0;F<6;F++)!ve&&!xe?Be[F]=E(k.image[F],!0,i.maxCubemapSize):Be[F]=xe?k.image[F].image:k.image[F],Be[F]=Xe(k,Be[F]);const We=Be[0],Le=s.convert(k.format,k.colorSpace),be=s.convert(k.type),nt=w(k.internalFormat,Le,be,k.colorSpace),pt=k.isVideoTexture!==!0,ct=Ee.__version===void 0||Ae===!0,ut=me.dataReady;let tt=x(k,We);Q(r.TEXTURE_CUBE_MAP,k);let V;if(ve){pt&&ct&&t.texStorage2D(r.TEXTURE_CUBE_MAP,tt,nt,We.width,We.height);for(let F=0;F<6;F++){V=Be[F].mipmaps;for(let ge=0;ge<V.length;ge++){const _e=V[ge];k.format!==gr?Le!==null?pt?ut&&t.compressedTexSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+F,ge,0,0,_e.width,_e.height,Le,_e.data):t.compressedTexImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+F,ge,nt,_e.width,_e.height,0,_e.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):pt?ut&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+F,ge,0,0,_e.width,_e.height,Le,be,_e.data):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+F,ge,nt,_e.width,_e.height,0,Le,be,_e.data)}}}else{if(V=k.mipmaps,pt&&ct){V.length>0&&tt++;const F=ft(Be[0]);t.texStorage2D(r.TEXTURE_CUBE_MAP,tt,nt,F.width,F.height)}for(let F=0;F<6;F++)if(xe){pt?ut&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+F,0,0,0,Be[F].width,Be[F].height,Le,be,Be[F].data):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+F,0,nt,Be[F].width,Be[F].height,0,Le,be,Be[F].data);for(let ge=0;ge<V.length;ge++){const _e=V[ge].image[F].image;pt?ut&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+F,ge+1,0,0,_e.width,_e.height,Le,be,_e.data):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+F,ge+1,nt,_e.width,_e.height,0,Le,be,_e.data)}}else{pt?ut&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+F,0,0,0,Le,be,Be[F]):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+F,0,nt,Le,be,Be[F]);for(let ge=0;ge<V.length;ge++){const _e=V[ge];pt?ut&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+F,ge+1,0,0,Le,be,_e.image[F]):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+F,ge+1,nt,Le,be,_e.image[F])}}}m(k)&&_(r.TEXTURE_CUBE_MAP),Ee.__version=me.version,k.onUpdate&&k.onUpdate(k)}Y.__version=k.version}function G(Y,k,le,Ae,me,Ee){const Oe=s.convert(le.format,le.colorSpace),Ce=s.convert(le.type),Qe=w(le.internalFormat,Oe,Ce,le.colorSpace);if(!n.get(k).__hasExternalTextures){const ve=Math.max(1,k.width>>Ee),xe=Math.max(1,k.height>>Ee);me===r.TEXTURE_3D||me===r.TEXTURE_2D_ARRAY?t.texImage3D(me,Ee,Qe,ve,xe,k.depth,0,Oe,Ce,null):t.texImage2D(me,Ee,Qe,ve,xe,0,Oe,Ce,null)}t.bindFramebuffer(r.FRAMEBUFFER,Y),ke(k)?c.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,Ae,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,Ae,me,n.get(le).__webglTexture,Ee),t.bindFramebuffer(r.FRAMEBUFFER,null)}function de(Y,k,le){if(r.bindRenderbuffer(r.RENDERBUFFER,Y),k.depthBuffer&&!k.stencilBuffer){let Ae=r.DEPTH_COMPONENT24;if(le||ke(k)){const me=k.depthTexture;me&&me.isDepthTexture&&(me.type===lr?Ae=r.DEPTH_COMPONENT32F:me.type===Ii&&(Ae=r.DEPTH_COMPONENT24));const Ee=et(k);ke(k)?c.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,Ee,Ae,k.width,k.height):r.renderbufferStorageMultisample(r.RENDERBUFFER,Ee,Ae,k.width,k.height)}else r.renderbufferStorage(r.RENDERBUFFER,Ae,k.width,k.height);r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.RENDERBUFFER,Y)}else if(k.depthBuffer&&k.stencilBuffer){const Ae=et(k);le&&ke(k)===!1?r.renderbufferStorageMultisample(r.RENDERBUFFER,Ae,r.DEPTH24_STENCIL8,k.width,k.height):ke(k)?c.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,Ae,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 Ae=k.textures;for(let me=0;me<Ae.length;me++){const Ee=Ae[me],Oe=s.convert(Ee.format,Ee.colorSpace),Ce=s.convert(Ee.type),Qe=w(Ee.internalFormat,Oe,Ce,Ee.colorSpace),ve=et(k);le&&ke(k)===!1?r.renderbufferStorageMultisample(r.RENDERBUFFER,ve,Qe,k.width,k.height):ke(k)?c.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,ve,Qe,k.width,k.height):r.renderbufferStorage(r.RENDERBUFFER,Qe,k.width,k.height)}}r.bindRenderbuffer(r.RENDERBUFFER,null)}function pe(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,Ae=et(k);if(k.depthTexture.format===il)ke(k)?c.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,le,0,Ae):r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,le,0);else if(k.depthTexture.format===eu)ke(k)?c.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.TEXTURE_2D,le,0,Ae):r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.TEXTURE_2D,le,0);else throw new Error("Unknown depthTexture format")}function fe(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");pe(k.__webglFramebuffer,Y)}else if(le){k.__webglDepthbuffer=[];for(let Ae=0;Ae<6;Ae++)t.bindFramebuffer(r.FRAMEBUFFER,k.__webglFramebuffer[Ae]),k.__webglDepthbuffer[Ae]=r.createRenderbuffer(),de(k.__webglDepthbuffer[Ae],Y,!1)}else t.bindFramebuffer(r.FRAMEBUFFER,k.__webglFramebuffer),k.__webglDepthbuffer=r.createRenderbuffer(),de(k.__webglDepthbuffer,Y,!1);t.bindFramebuffer(r.FRAMEBUFFER,null)}function ye(Y,k,le){const Ae=n.get(Y);k!==void 0&&G(Ae.__webglFramebuffer,Y,Y.texture,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,0),le!==void 0&&fe(Y)}function Pe(Y){const k=Y.texture,le=n.get(Y),Ae=n.get(k);Y.addEventListener("dispose",R);const me=Y.textures,Ee=Y.isWebGLCubeRenderTarget===!0,Oe=me.length>1;if(Oe||(Ae.__webglTexture===void 0&&(Ae.__webglTexture=r.createTexture()),Ae.__version=k.version,o.memory.textures++),Ee){le.__webglFramebuffer=[];for(let Ce=0;Ce<6;Ce++)if(k.mipmaps&&k.mipmaps.length>0){le.__webglFramebuffer[Ce]=[];for(let Qe=0;Qe<k.mipmaps.length;Qe++)le.__webglFramebuffer[Ce][Qe]=r.createFramebuffer()}else le.__webglFramebuffer[Ce]=r.createFramebuffer()}else{if(k.mipmaps&&k.mipmaps.length>0){le.__webglFramebuffer=[];for(let Ce=0;Ce<k.mipmaps.length;Ce++)le.__webglFramebuffer[Ce]=r.createFramebuffer()}else le.__webglFramebuffer=r.createFramebuffer();if(Oe)for(let Ce=0,Qe=me.length;Ce<Qe;Ce++){const ve=n.get(me[Ce]);ve.__webglTexture===void 0&&(ve.__webglTexture=r.createTexture(),o.memory.textures++)}if(Y.samples>0&&ke(Y)===!1){le.__webglMultisampledFramebuffer=r.createFramebuffer(),le.__webglColorRenderbuffer=[],t.bindFramebuffer(r.FRAMEBUFFER,le.__webglMultisampledFramebuffer);for(let Ce=0;Ce<me.length;Ce++){const Qe=me[Ce];le.__webglColorRenderbuffer[Ce]=r.createRenderbuffer(),r.bindRenderbuffer(r.RENDERBUFFER,le.__webglColorRenderbuffer[Ce]);const ve=s.convert(Qe.format,Qe.colorSpace),xe=s.convert(Qe.type),Be=w(Qe.internalFormat,ve,xe,Qe.colorSpace,Y.isXRRenderTarget===!0),We=et(Y);r.renderbufferStorageMultisample(r.RENDERBUFFER,We,Be,Y.width,Y.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+Ce,r.RENDERBUFFER,le.__webglColorRenderbuffer[Ce])}r.bindRenderbuffer(r.RENDERBUFFER,null),Y.depthBuffer&&(le.__webglDepthRenderbuffer=r.createRenderbuffer(),de(le.__webglDepthRenderbuffer,Y,!0)),t.bindFramebuffer(r.FRAMEBUFFER,null)}}if(Ee){t.bindTexture(r.TEXTURE_CUBE_MAP,Ae.__webglTexture),Q(r.TEXTURE_CUBE_MAP,k);for(let Ce=0;Ce<6;Ce++)if(k.mipmaps&&k.mipmaps.length>0)for(let Qe=0;Qe<k.mipmaps.length;Qe++)G(le.__webglFramebuffer[Ce][Qe],Y,k,r.COLOR_ATTACHMENT0,r.TEXTURE_CUBE_MAP_POSITIVE_X+Ce,Qe);else G(le.__webglFramebuffer[Ce],Y,k,r.COLOR_ATTACHMENT0,r.TEXTURE_CUBE_MAP_POSITIVE_X+Ce,0);m(k)&&_(r.TEXTURE_CUBE_MAP),t.unbindTexture()}else if(Oe){for(let Ce=0,Qe=me.length;Ce<Qe;Ce++){const ve=me[Ce],xe=n.get(ve);t.bindTexture(r.TEXTURE_2D,xe.__webglTexture),Q(r.TEXTURE_2D,ve),G(le.__webglFramebuffer,Y,ve,r.COLOR_ATTACHMENT0+Ce,r.TEXTURE_2D,0),m(ve)&&_(r.TEXTURE_2D)}t.unbindTexture()}else{let Ce=r.TEXTURE_2D;if((Y.isWebGL3DRenderTarget||Y.isWebGLArrayRenderTarget)&&(Ce=Y.isWebGL3DRenderTarget?r.TEXTURE_3D:r.TEXTURE_2D_ARRAY),t.bindTexture(Ce,Ae.__webglTexture),Q(Ce,k),k.mipmaps&&k.mipmaps.length>0)for(let Qe=0;Qe<k.mipmaps.length;Qe++)G(le.__webglFramebuffer[Qe],Y,k,r.COLOR_ATTACHMENT0,Ce,Qe);else G(le.__webglFramebuffer,Y,k,r.COLOR_ATTACHMENT0,Ce,0);m(k)&&_(Ce),t.unbindTexture()}Y.depthBuffer&&fe(Y)}function at(Y){const k=Y.textures;for(let le=0,Ae=k.length;le<Ae;le++){const me=k[le];if(m(me)){const Ee=Y.isWebGLCubeRenderTarget?r.TEXTURE_CUBE_MAP:r.TEXTURE_2D,Oe=n.get(me).__webglTexture;t.bindTexture(Ee,Oe),_(Ee),t.unbindTexture()}}}function se(Y){if(Y.samples>0&&ke(Y)===!1){const k=Y.textures,le=Y.width,Ae=Y.height;let me=r.COLOR_BUFFER_BIT;const Ee=[],Oe=Y.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,Ce=n.get(Y),Qe=k.length>1;if(Qe)for(let ve=0;ve<k.length;ve++)t.bindFramebuffer(r.FRAMEBUFFER,Ce.__webglMultisampledFramebuffer),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+ve,r.RENDERBUFFER,null),t.bindFramebuffer(r.FRAMEBUFFER,Ce.__webglFramebuffer),r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0+ve,r.TEXTURE_2D,null,0);t.bindFramebuffer(r.READ_FRAMEBUFFER,Ce.__webglMultisampledFramebuffer),t.bindFramebuffer(r.DRAW_FRAMEBUFFER,Ce.__webglFramebuffer);for(let ve=0;ve<k.length;ve++){Ee.push(r.COLOR_ATTACHMENT0+ve),Y.depthBuffer&&Ee.push(Oe);const xe=Ce.__ignoreDepthValues!==void 0?Ce.__ignoreDepthValues:!1;if(xe===!1&&(Y.depthBuffer&&(me|=r.DEPTH_BUFFER_BIT),Y.stencilBuffer&&Ce.__isTransmissionRenderTarget!==!0&&(me|=r.STENCIL_BUFFER_BIT)),Qe&&r.framebufferRenderbuffer(r.READ_FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.RENDERBUFFER,Ce.__webglColorRenderbuffer[ve]),xe===!0&&(r.invalidateFramebuffer(r.READ_FRAMEBUFFER,[Oe]),r.invalidateFramebuffer(r.DRAW_FRAMEBUFFER,[Oe])),Qe){const Be=n.get(k[ve]).__webglTexture;r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,Be,0)}r.blitFramebuffer(0,0,le,Ae,0,0,le,Ae,me,r.NEAREST),h&&r.invalidateFramebuffer(r.READ_FRAMEBUFFER,Ee)}if(t.bindFramebuffer(r.READ_FRAMEBUFFER,null),t.bindFramebuffer(r.DRAW_FRAMEBUFFER,null),Qe)for(let ve=0;ve<k.length;ve++){t.bindFramebuffer(r.FRAMEBUFFER,Ce.__webglMultisampledFramebuffer),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+ve,r.RENDERBUFFER,Ce.__webglColorRenderbuffer[ve]);const xe=n.get(k[ve]).__webglTexture;t.bindFramebuffer(r.FRAMEBUFFER,Ce.__webglFramebuffer),r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0+ve,r.TEXTURE_2D,xe,0)}t.bindFramebuffer(r.DRAW_FRAMEBUFFER,Ce.__webglMultisampledFramebuffer)}}function et(Y){return Math.min(i.maxSamples,Y.samples)}function ke(Y){const k=n.get(Y);return Y.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&k.__useRenderToTexture!==!1}function dt(Y){const k=o.render.frame;d.get(Y)!==k&&(d.set(Y,k),Y.update())}function Xe(Y,k){const le=Y.colorSpace,Ae=Y.format,me=Y.type;return Y.isCompressedTexture===!0||Y.isVideoTexture===!0||le!==Sr&&le!==As&&(Rt.getTransfer(le)===Ht?(Ae!==gr||me!==Ar)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",le)),k}function ft(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=S,this.setTexture2D=N,this.setTexture2DArray=W,this.setTexture3D=X,this.setTextureCube=K,this.rebindTextures=ye,this.setupRenderTarget=Pe,this.updateRenderTargetMipmap=at,this.updateMultisampleRenderTarget=se,this.setupDepthRenderbuffer=fe,this.setupFrameBufferTexture=G,this.useMultisampledRTT=ke}function bL(r,e){function t(n,i=As){let s;const o=Rt.getTransfer(i);if(n===Ar)return r.UNSIGNED_BYTE;if(n===Wy)return r.UNSIGNED_SHORT_4_4_4_4;if(n===Yy)return r.UNSIGNED_SHORT_5_5_5_1;if(n===ZB)return r.UNSIGNED_INT_5_9_9_9_REV;if(n===hA)return r.BYTE;if(n===jy)return r.SHORT;if(n===dA)return r.UNSIGNED_SHORT;if(n===Zc)return r.INT;if(n===Ii)return r.UNSIGNED_INT;if(n===lr)return r.FLOAT;if(n===yn)return r.HALF_FLOAT;if(n===$B)return r.ALPHA;if(n===eb)return r.RGB;if(n===gr)return r.RGBA;if(n===tb)return r.LUMINANCE;if(n===rb)return r.LUMINANCE_ALPHA;if(n===il)return r.DEPTH_COMPONENT;if(n===eu)return r.DEPTH_STENCIL;if(n===ea)return r.RED;if(n===fA)return r.RED_INTEGER;if(n===io)return r.RG;if(n===Xh)return r.RG_INTEGER;if(n===tu)return r.RGBA_INTEGER;if(n===Kh||n===pA||n===AA||n===Jh)if(o===Ht)if(s=e.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(n===Kh)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===pA)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===AA)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===Jh)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=e.get("WEBGL_compressed_texture_s3tc"),s!==null){if(n===Kh)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===pA)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===AA)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===Jh)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(n===gA||n===qy||n===mA||n===Xy)if(s=e.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(n===gA)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===qy)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===mA)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===Xy)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(n===_A)return s=e.get("WEBGL_compressed_texture_etc1"),s!==null?s.COMPRESSED_RGB_ETC1_WEBGL:null;if(n===vA||n===yA)if(s=e.get("WEBGL_compressed_texture_etc"),s!==null){if(n===vA)return o===Ht?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(n===yA)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(n===EA||n===Ky||n===Jy||n===Zy||n===Zh||n===$y||n===eE||n===tE||n===rE||n===nE||n===iE||n===sE||n===aE||n===oE)if(s=e.get("WEBGL_compressed_texture_astc"),s!==null){if(n===EA)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===Ky)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===Jy)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===Zy)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===Zh)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===$y)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===eE)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===tE)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===rE)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===nE)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===iE)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===sE)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===aE)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===oE)return o===Ht?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(n===$h||n===lE||n===cE)if(s=e.get("EXT_texture_compression_bptc"),s!==null){if(n===$h)return o===Ht?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===lE)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===cE)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(n===nb||n===uE||n===hE||n===dE)if(s=e.get("EXT_texture_compression_rgtc"),s!==null){if(n===$h)return s.COMPRESSED_RED_RGTC1_EXT;if(n===uE)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===hE)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===dE)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return n===$c?r.UNSIGNED_INT_24_8:r[n]!==void 0?r[n]:null}return{convert:t}}class RL extends un{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class oa extends Zt{constructor(){super(),this.isGroup=!0,this.type="Group"}}const DL={type:"move"};class tg{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 j,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new j),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 j,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new j),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 c=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),_=this._getHandJoint(u,E);m!==null&&(_.matrix.fromArray(m.transform.matrix),_.matrix.decompose(_.position,_.rotation,_.scale),_.matrixWorldNeedsUpdate=!0,_.jointRadius=m.radius),_.visible=m!==null}const d=u.joints["index-finger-tip"],A=u.joints["thumb-tip"],p=d.position.distanceTo(A.position),g=.02,v=.005;u.inputState.pinching&&p>g+v?(u.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!u.inputState.pinching&&p<=g-v&&(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));c!==null&&(i=t.getPose(e.targetRaySpace,n),i===null&&s!==null&&(i=s),i!==null&&(c.matrix.fromArray(i.transform.matrix),c.matrix.decompose(c.position,c.rotation,c.scale),c.matrixWorldNeedsUpdate=!0,i.linearVelocity?(c.hasLinearVelocity=!0,c.linearVelocity.copy(i.linearVelocity)):c.hasLinearVelocity=!1,i.angularVelocity?(c.hasAngularVelocity=!0,c.angularVelocity.copy(i.angularVelocity)):c.hasAngularVelocity=!1,this.dispatchEvent(DL)))}return c!==null&&(c.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 LL=`
3805
3805
  void main() {
3806
3806
 
3807
3807
  gl_Position = vec4( position, 1.0 );
@@ -3825,7 +3825,7 @@ void main() {
3825
3825
 
3826
3826
  }
3827
3827
 
3828
- }`;class UL{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,n){if(this.texture===null){const i=new Tr,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 En({vertexShader:LL,fragmentShader:NL,uniforms:{depthColor:{value:this.texture},depthWidth:{value:n.z},depthHeight:{value:n.w}}});this.mesh=new Yr(new fu(20,20),i)}e.render(this.mesh,t)}}reset(){this.texture=null,this.mesh=null}}class PL extends so{constructor(e,t){super();const n=this;let i=null,s=1,o=null,c="local-floor",h=1,u=null,d=null,A=null,p=null,g=null,v=null;const E=new UL,m=t.getContextAttributes();let _=null,w=null;const x=[],I=[],R=new Ge;let M=null;const T=new un;T.layers.enable(1),T.viewport=new Ot;const D=new un;D.layers.enable(2),D.viewport=new Ot;const b=[T,D],S=new RL;S.layers.enable(1),S.layers.enable(2);let L=null,P=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(G){let de=x[G];return de===void 0&&(de=new tg,x[G]=de),de.getTargetRaySpace()},this.getControllerGrip=function(G){let de=x[G];return de===void 0&&(de=new tg,x[G]=de),de.getGripSpace()},this.getHand=function(G){let de=x[G];return de===void 0&&(de=new tg,x[G]=de),de.getHandSpace()};function N(G){const de=I.indexOf(G.inputSource);if(de===-1)return;const pe=x[de];pe!==void 0&&(pe.update(G.inputSource,G.frame,u||o),pe.dispatchEvent({type:G.type,data:G.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 G=0;G<x.length;G++){const de=I[G];de!==null&&(I[G]=null,x[G].disconnect(de))}L=null,P=null,E.reset(),e.setRenderTarget(_),g=null,p=null,A=null,i=null,w=null,re.stop(),n.isPresenting=!1,e.setPixelRatio(M),e.setSize(R.width,R.height,!1),n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(G){s=G,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(G){c=G,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return u||o},this.setReferenceSpace=function(G){u=G},this.getBaseLayer=function(){return p!==null?p:g},this.getBinding=function(){return A},this.getFrame=function(){return v},this.getSession=function(){return i},this.setSession=async function(G){if(i=G,i!==null){if(_=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(),M=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 Mi(g.framebufferWidth,g.framebufferHeight,{format:gr,type:Ar,colorSpace:e.outputColorSpace,stencilBuffer:m.stencil})}else{let de=null,pe=null,fe=null;m.depth&&(fe=m.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,de=m.stencil?eu:il,pe=m.stencil?$c:Ii);const ye={colorFormat:t.RGBA8,depthFormat:fe,scaleFactor:s};A=new XRWebGLBinding(i,t),p=A.createProjectionLayer(ye),i.updateRenderState({layers:[p]}),e.setPixelRatio(1),e.setSize(p.textureWidth,p.textureHeight,!1),w=new Mi(p.textureWidth,p.textureHeight,{format:gr,type:Ar,depthTexture:new a2(p.textureWidth,p.textureHeight,pe,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 Pe=e.properties.get(w);Pe.__ignoreDepthValues=p.ignoreDepthValues}w.isXRRenderTarget=!0,this.setFoveation(h),u=null,o=await i.requestReferenceSpace(c),re.setContext(i),re.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(i!==null)return i.environmentBlendMode};function X(G){for(let de=0;de<G.removed.length;de++){const pe=G.removed[de],fe=I.indexOf(pe);fe>=0&&(I[fe]=null,x[fe].disconnect(pe))}for(let de=0;de<G.added.length;de++){const pe=G.added[de];let fe=I.indexOf(pe);if(fe===-1){for(let Pe=0;Pe<x.length;Pe++)if(Pe>=I.length){I.push(pe),fe=Pe;break}else if(I[Pe]===null){I[Pe]=pe,fe=Pe;break}if(fe===-1)break}const ye=x[fe];ye&&ye.connect(pe)}}const K=new j,te=new j;function H(G,de,pe){K.setFromMatrixPosition(de.matrixWorld),te.setFromMatrixPosition(pe.matrixWorld);const fe=K.distanceTo(te),ye=de.projectionMatrix.elements,Pe=pe.projectionMatrix.elements,at=ye[14]/(ye[10]-1),se=ye[14]/(ye[10]+1),et=(ye[9]+1)/ye[5],ke=(ye[9]-1)/ye[5],dt=(ye[8]-1)/ye[0],Xe=(Pe[8]+1)/Pe[0],ft=at*dt,Y=at*Xe,k=fe/(-dt+Xe),le=k*-dt;de.matrixWorld.decompose(G.position,G.quaternion,G.scale),G.translateX(le),G.translateZ(k),G.matrixWorld.compose(G.position,G.quaternion,G.scale),G.matrixWorldInverse.copy(G.matrixWorld).invert();const Ae=at+k,me=se+k,Ee=ft-le,Oe=Y+(fe-le),Ce=et*se/me*Ae,Qe=ke*se/me*Ae;G.projectionMatrix.makePerspective(Ee,Oe,Ce,Qe,Ae,me),G.projectionMatrixInverse.copy(G.projectionMatrix).invert()}function ee(G,de){de===null?G.matrixWorld.copy(G.matrix):G.matrixWorld.multiplyMatrices(de.matrixWorld,G.matrix),G.matrixWorldInverse.copy(G.matrixWorld).invert()}this.updateCamera=function(G){if(i===null)return;E.texture!==null&&(G.near=E.depthNear,G.far=E.depthFar),S.near=D.near=T.near=G.near,S.far=D.far=T.far=G.far,(L!==S.near||P!==S.far)&&(i.updateRenderState({depthNear:S.near,depthFar:S.far}),L=S.near,P=S.far,T.near=L,T.far=P,D.near=L,D.far=P,T.updateProjectionMatrix(),D.updateProjectionMatrix(),G.updateProjectionMatrix());const de=G.parent,pe=S.cameras;ee(S,de);for(let fe=0;fe<pe.length;fe++)ee(pe[fe],de);pe.length===2?H(S,T,D):S.projectionMatrix.copy(T.projectionMatrix),Q(G,S,de)};function Q(G,de,pe){pe===null?G.matrix.copy(de.matrixWorld):(G.matrix.copy(pe.matrixWorld),G.matrix.invert(),G.matrix.multiply(de.matrixWorld)),G.matrix.decompose(G.position,G.quaternion,G.scale),G.updateMatrixWorld(!0),G.projectionMatrix.copy(de.projectionMatrix),G.projectionMatrixInverse.copy(de.projectionMatrixInverse),G.isPerspectiveCamera&&(G.fov=ol*2*Math.atan(1/G.projectionMatrix.elements[5]),G.zoom=1)}this.getCamera=function(){return S},this.getFoveation=function(){if(!(p===null&&g===null))return h},this.setFoveation=function(G){h=G,p!==null&&(p.fixedFoveation=G),g!==null&&g.fixedFoveation!==void 0&&(g.fixedFoveation=G)},this.hasDepthSensing=function(){return E.texture!==null};let z=null;function Z(G,de){if(d=de.getViewerPose(u||o),v=de,d!==null){const pe=d.views;g!==null&&(e.setRenderTargetFramebuffer(w,g.framebuffer),e.setRenderTarget(w));let fe=!1;pe.length!==S.cameras.length&&(S.cameras.length=0,fe=!0);for(let Pe=0;Pe<pe.length;Pe++){const at=pe[Pe];let se=null;if(g!==null)se=g.getViewport(at);else{const ke=A.getViewSubImage(p,at);se=ke.viewport,Pe===0&&(e.setRenderTargetTextures(w,ke.colorTexture,p.ignoreDepthValues?void 0:ke.depthStencilTexture),e.setRenderTarget(w))}let et=b[Pe];et===void 0&&(et=new un,et.layers.enable(Pe),et.viewport=new Ot,b[Pe]=et),et.matrix.fromArray(at.transform.matrix),et.matrix.decompose(et.position,et.quaternion,et.scale),et.projectionMatrix.fromArray(at.projectionMatrix),et.projectionMatrixInverse.copy(et.projectionMatrix).invert(),et.viewport.set(se.x,se.y,se.width,se.height),Pe===0&&(S.matrix.copy(et.matrix),S.matrix.decompose(S.position,S.quaternion,S.scale)),fe===!0&&S.cameras.push(et)}const ye=i.enabledFeatures;if(ye&&ye.includes("depth-sensing")){const Pe=A.getDepthInformation(pe[0]);Pe&&Pe.isValid&&Pe.texture&&E.init(e,Pe,i.renderState)}}for(let pe=0;pe<x.length;pe++){const fe=I[pe],ye=x[pe];fe!==null&&ye!==void 0&&ye.update(fe,de,u||o)}E.render(e,S),z&&z(G,de),de.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:de}),v=null}const re=new ZE;re.setAnimationLoop(Z),this.setAnimationLoop=function(G){z=G},this.dispose=function(){}}}const po=new Yi,kL=new st;function QL(r,e){function t(m,_){m.matrixAutoUpdate===!0&&m.updateMatrix(),_.value.copy(m.matrix)}function n(m,_){_.color.getRGB(m.fogColor.value,YE(r)),_.isFog?(m.fogNear.value=_.near,m.fogFar.value=_.far):_.isFogExp2&&(m.fogDensity.value=_.density)}function i(m,_,w,x,I){_.isMeshBasicMaterial||_.isMeshLambertMaterial?s(m,_):_.isMeshToonMaterial?(s(m,_),A(m,_)):_.isMeshPhongMaterial?(s(m,_),d(m,_)):_.isMeshStandardMaterial?(s(m,_),p(m,_),_.isMeshPhysicalMaterial&&g(m,_,I)):_.isMeshMatcapMaterial?(s(m,_),v(m,_)):_.isMeshDepthMaterial?s(m,_):_.isMeshDistanceMaterial?(s(m,_),E(m,_)):_.isMeshNormalMaterial?s(m,_):_.isLineBasicMaterial?(o(m,_),_.isLineDashedMaterial&&c(m,_)):_.isPointsMaterial?h(m,_,w,x):_.isSpriteMaterial?u(m,_):_.isShadowMaterial?(m.color.value.copy(_.color),m.opacity.value=_.opacity):_.isShaderMaterial&&(_.uniformsNeedUpdate=!1)}function s(m,_){m.opacity.value=_.opacity,_.color&&m.diffuse.value.copy(_.color),_.emissive&&m.emissive.value.copy(_.emissive).multiplyScalar(_.emissiveIntensity),_.map&&(m.map.value=_.map,t(_.map,m.mapTransform)),_.alphaMap&&(m.alphaMap.value=_.alphaMap,t(_.alphaMap,m.alphaMapTransform)),_.bumpMap&&(m.bumpMap.value=_.bumpMap,t(_.bumpMap,m.bumpMapTransform),m.bumpScale.value=_.bumpScale,_.side===kr&&(m.bumpScale.value*=-1)),_.normalMap&&(m.normalMap.value=_.normalMap,t(_.normalMap,m.normalMapTransform),m.normalScale.value.copy(_.normalScale),_.side===kr&&m.normalScale.value.negate()),_.displacementMap&&(m.displacementMap.value=_.displacementMap,t(_.displacementMap,m.displacementMapTransform),m.displacementScale.value=_.displacementScale,m.displacementBias.value=_.displacementBias),_.emissiveMap&&(m.emissiveMap.value=_.emissiveMap,t(_.emissiveMap,m.emissiveMapTransform)),_.specularMap&&(m.specularMap.value=_.specularMap,t(_.specularMap,m.specularMapTransform)),_.alphaTest>0&&(m.alphaTest.value=_.alphaTest);const w=e.get(_),x=w.envMap,I=w.envMapRotation;if(x&&(m.envMap.value=x,po.copy(I),po.x*=-1,po.y*=-1,po.z*=-1,x.isCubeTexture&&x.isRenderTargetTexture===!1&&(po.y*=-1,po.z*=-1),m.envMapRotation.value.setFromMatrix4(kL.makeRotationFromEuler(po)),m.flipEnvMap.value=x.isCubeTexture&&x.isRenderTargetTexture===!1?-1:1,m.reflectivity.value=_.reflectivity,m.ior.value=_.ior,m.refractionRatio.value=_.refractionRatio),_.lightMap){m.lightMap.value=_.lightMap;const R=r._useLegacyLights===!0?Math.PI:1;m.lightMapIntensity.value=_.lightMapIntensity*R,t(_.lightMap,m.lightMapTransform)}_.aoMap&&(m.aoMap.value=_.aoMap,m.aoMapIntensity.value=_.aoMapIntensity,t(_.aoMap,m.aoMapTransform))}function o(m,_){m.diffuse.value.copy(_.color),m.opacity.value=_.opacity,_.map&&(m.map.value=_.map,t(_.map,m.mapTransform))}function c(m,_){m.dashSize.value=_.dashSize,m.totalSize.value=_.dashSize+_.gapSize,m.scale.value=_.scale}function h(m,_,w,x){m.diffuse.value.copy(_.color),m.opacity.value=_.opacity,m.size.value=_.size*w,m.scale.value=x*.5,_.map&&(m.map.value=_.map,t(_.map,m.uvTransform)),_.alphaMap&&(m.alphaMap.value=_.alphaMap,t(_.alphaMap,m.alphaMapTransform)),_.alphaTest>0&&(m.alphaTest.value=_.alphaTest)}function u(m,_){m.diffuse.value.copy(_.color),m.opacity.value=_.opacity,m.rotation.value=_.rotation,_.map&&(m.map.value=_.map,t(_.map,m.mapTransform)),_.alphaMap&&(m.alphaMap.value=_.alphaMap,t(_.alphaMap,m.alphaMapTransform)),_.alphaTest>0&&(m.alphaTest.value=_.alphaTest)}function d(m,_){m.specular.value.copy(_.specular),m.shininess.value=Math.max(_.shininess,1e-4)}function A(m,_){_.gradientMap&&(m.gradientMap.value=_.gradientMap)}function p(m,_){m.metalness.value=_.metalness,_.metalnessMap&&(m.metalnessMap.value=_.metalnessMap,t(_.metalnessMap,m.metalnessMapTransform)),m.roughness.value=_.roughness,_.roughnessMap&&(m.roughnessMap.value=_.roughnessMap,t(_.roughnessMap,m.roughnessMapTransform)),_.envMap&&(m.envMapIntensity.value=_.envMapIntensity)}function g(m,_,w){m.ior.value=_.ior,_.sheen>0&&(m.sheenColor.value.copy(_.sheenColor).multiplyScalar(_.sheen),m.sheenRoughness.value=_.sheenRoughness,_.sheenColorMap&&(m.sheenColorMap.value=_.sheenColorMap,t(_.sheenColorMap,m.sheenColorMapTransform)),_.sheenRoughnessMap&&(m.sheenRoughnessMap.value=_.sheenRoughnessMap,t(_.sheenRoughnessMap,m.sheenRoughnessMapTransform))),_.clearcoat>0&&(m.clearcoat.value=_.clearcoat,m.clearcoatRoughness.value=_.clearcoatRoughness,_.clearcoatMap&&(m.clearcoatMap.value=_.clearcoatMap,t(_.clearcoatMap,m.clearcoatMapTransform)),_.clearcoatRoughnessMap&&(m.clearcoatRoughnessMap.value=_.clearcoatRoughnessMap,t(_.clearcoatRoughnessMap,m.clearcoatRoughnessMapTransform)),_.clearcoatNormalMap&&(m.clearcoatNormalMap.value=_.clearcoatNormalMap,t(_.clearcoatNormalMap,m.clearcoatNormalMapTransform),m.clearcoatNormalScale.value.copy(_.clearcoatNormalScale),_.side===kr&&m.clearcoatNormalScale.value.negate())),_.iridescence>0&&(m.iridescence.value=_.iridescence,m.iridescenceIOR.value=_.iridescenceIOR,m.iridescenceThicknessMinimum.value=_.iridescenceThicknessRange[0],m.iridescenceThicknessMaximum.value=_.iridescenceThicknessRange[1],_.iridescenceMap&&(m.iridescenceMap.value=_.iridescenceMap,t(_.iridescenceMap,m.iridescenceMapTransform)),_.iridescenceThicknessMap&&(m.iridescenceThicknessMap.value=_.iridescenceThicknessMap,t(_.iridescenceThicknessMap,m.iridescenceThicknessMapTransform))),_.transmission>0&&(m.transmission.value=_.transmission,m.transmissionSamplerMap.value=w.texture,m.transmissionSamplerSize.value.set(w.width,w.height),_.transmissionMap&&(m.transmissionMap.value=_.transmissionMap,t(_.transmissionMap,m.transmissionMapTransform)),m.thickness.value=_.thickness,_.thicknessMap&&(m.thicknessMap.value=_.thicknessMap,t(_.thicknessMap,m.thicknessMapTransform)),m.attenuationDistance.value=_.attenuationDistance,m.attenuationColor.value.copy(_.attenuationColor)),_.anisotropy>0&&(m.anisotropyVector.value.set(_.anisotropy*Math.cos(_.anisotropyRotation),_.anisotropy*Math.sin(_.anisotropyRotation)),_.anisotropyMap&&(m.anisotropyMap.value=_.anisotropyMap,t(_.anisotropyMap,m.anisotropyMapTransform))),m.specularIntensity.value=_.specularIntensity,m.specularColor.value.copy(_.specularColor),_.specularColorMap&&(m.specularColorMap.value=_.specularColorMap,t(_.specularColorMap,m.specularColorMapTransform)),_.specularIntensityMap&&(m.specularIntensityMap.value=_.specularIntensityMap,t(_.specularIntensityMap,m.specularIntensityMapTransform))}function v(m,_){_.matcap&&(m.matcap.value=_.matcap)}function E(m,_){const w=e.get(_).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 FL(r,e,t,n){let i={},s={},o=[];const c=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&&(v(w),I=d(w),i[w.id]=I,w.addEventListener("dispose",m));const R=x.program;n.updateUBOMapping(w,R);const M=e.render.frame;s[w.id]!==M&&(p(w),s[w.id]=M)}function d(w){const x=A();w.__bindingPointIndex=x;const I=r.createBuffer(),R=w.__size,M=w.usage;return r.bindBuffer(r.UNIFORM_BUFFER,I),r.bufferData(r.UNIFORM_BUFFER,R,M),r.bindBuffer(r.UNIFORM_BUFFER,null),r.bindBufferBase(r.UNIFORM_BUFFER,x,I),I}function A(){for(let w=0;w<c;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 M=0,T=I.length;M<T;M++){const D=Array.isArray(I[M])?I[M]:[I[M]];for(let b=0,S=D.length;b<S;b++){const L=D[b];if(g(L,M,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 M=w.value,T=x+"_"+I;if(R[T]===void 0)return typeof M=="number"||typeof M=="boolean"?R[T]=M:R[T]=M.clone(),!0;{const D=R[T];if(typeof M=="number"||typeof M=="boolean"){if(D!==M)return R[T]=M,!0}else if(D.equals(M)===!1)return D.copy(M),!0}return!1}function v(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 S=0,L=b.length;S<L;S++){const P=b[S],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),H=I%R;H!==0&&R-H<te.boundary&&(I+=R-H),P.__data=new Float32Array(te.storage/Float32Array.BYTES_PER_ELEMENT),P.__offset=I,I+=te.storage}}}const M=I%R;return M>0&&(I+=R-M),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 _(){for(const w in i)r.deleteBuffer(i[w]);o=[],i={},s={}}return{bind:h,update:u,dispose:_}}class OL{constructor(e={}){const{canvas:t=Db(),context:n=null,depth:i=!0,stencil:s=!1,alpha:o=!1,antialias:c=!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),v=new Int32Array(4);let E=null,m=null;const _=[],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=Qr,this._useLegacyLights=!1,this.toneMapping=Zs,this.toneMappingExposure=1;const x=this;let I=!1,R=0,M=0,T=null,D=-1,b=null;const S=new Ot,L=new Ot;let P=null;const N=new Ke(0);let W=0,X=t.width,K=t.height,te=1,H=null,ee=null;const Q=new Ot(0,0,X,K),z=new Ot(0,0,X,K);let Z=!1;const re=new WA;let G=!1,de=!1;const pe=new st,fe=new Ge,ye=new j,Pe={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function at(){return T===null?te:1}let se=n;function et(O,ne){const ue=t.getContext(O,ne);return ue!==null?ue:null}try{const O={alpha:!0,depth:i,stencil:s,antialias:c,premultipliedAlpha:h,preserveDrawingBuffer:u,powerPreference:d,failIfMajorPerformanceCaveat:A};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${Vh}`),t.addEventListener("webglcontextlost",ge,!1),t.addEventListener("webglcontextrestored",_e,!1),t.addEventListener("webglcontextcreationerror",ze,!1),se===null){const ne="webgl2";if(se=et(ne,O),se===null)throw et(ne)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(O){throw console.error("THREE.WebGLRenderer: "+O.message),O}let ke,dt,Xe,ft,Y,k,le,Ae,me,Ee,Oe,Ce,Qe,ve,xe,Be,Ye,Le,be,nt,pt,ct,ut,tt;function V(){ke=new X6(se),ke.init(),dt=new G6(se,ke,e),ct=new bL(se,ke),Xe=new TL(se),ft=new Z6(se),Y=new AL,k=new BL(se,ke,Xe,Y,dt,ct,ft),le=new j6(x),Ae=new q6(x),me=new i5(se),ut=new z6(se,me),Ee=new K6(se,me,ft,ut),Oe=new eD(se,Ee,me,ft),be=new $6(se,dt,k),Be=new V6(Y),Ce=new pL(x,le,Ae,ke,dt,ut,Be),Qe=new QL(x,Y),ve=new mL,xe=new wL(ke),Le=new O6(x,le,Ae,Xe,Oe,p,h),Ye=new ML(x,Oe,dt),tt=new FL(se,ft,dt,Xe),nt=new H6(se,ke,ft),pt=new J6(se,ke,ft),ft.programs=Ce.programs,x.capabilities=dt,x.extensions=ke,x.properties=Y,x.renderLists=ve,x.shadowMap=Ye,x.state=Xe,x.info=ft}V();const F=new PL(x,se);this.xr=F,this.getContext=function(){return se},this.getContextAttributes=function(){return se.getContextAttributes()},this.forceContextLoss=function(){const O=ke.get("WEBGL_lose_context");O&&O.loseContext()},this.forceContextRestore=function(){const O=ke.get("WEBGL_lose_context");O&&O.restoreContext()},this.getPixelRatio=function(){return te},this.setPixelRatio=function(O){O!==void 0&&(te=O,this.setSize(X,K,!1))},this.getSize=function(O){return O.set(X,K)},this.setSize=function(O,ne,ue=!0){if(F.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}X=O,K=ne,t.width=Math.floor(O*te),t.height=Math.floor(ne*te),ue===!0&&(t.style.width=O+"px",t.style.height=ne+"px"),this.setViewport(0,0,O,ne)},this.getDrawingBufferSize=function(O){return O.set(X*te,K*te).floor()},this.setDrawingBufferSize=function(O,ne,ue){X=O,K=ne,te=ue,t.width=Math.floor(O*ue),t.height=Math.floor(ne*ue),this.setViewport(0,0,O,ne)},this.getCurrentViewport=function(O){return O.copy(S)},this.getViewport=function(O){return O.copy(Q)},this.setViewport=function(O,ne,ue,he){O.isVector4?Q.set(O.x,O.y,O.z,O.w):Q.set(O,ne,ue,he),Xe.viewport(S.copy(Q).multiplyScalar(te).round())},this.getScissor=function(O){return O.copy(z)},this.setScissor=function(O,ne,ue,he){O.isVector4?z.set(O.x,O.y,O.z,O.w):z.set(O,ne,ue,he),Xe.scissor(L.copy(z).multiplyScalar(te).round())},this.getScissorTest=function(){return Z},this.setScissorTest=function(O){Xe.setScissorTest(Z=O)},this.setOpaqueSort=function(O){H=O},this.setTransparentSort=function(O){ee=O},this.getClearColor=function(O){return O.copy(Le.getClearColor())},this.setClearColor=function(){Le.setClearColor.apply(Le,arguments)},this.getClearAlpha=function(){return Le.getClearAlpha()},this.setClearAlpha=function(){Le.setClearAlpha.apply(Le,arguments)},this.clear=function(O=!0,ne=!0,ue=!0){let he=0;if(O){let oe=!1;if(T!==null){const Re=T.texture.format;oe=Re===tu||Re===Xh||Re===fA}if(oe){const Re=T.texture.type,Je=Re===Ar||Re===Ii||Re===dA||Re===$c||Re===Wy||Re===Yy,it=Le.getClearColor(),ot=Le.getClearAlpha(),qe=it.r,At=it.g,ht=it.b;Je?(g[0]=qe,g[1]=At,g[2]=ht,g[3]=ot,se.clearBufferuiv(se.COLOR,0,g)):(v[0]=qe,v[1]=At,v[2]=ht,v[3]=ot,se.clearBufferiv(se.COLOR,0,v))}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",_e,!1),t.removeEventListener("webglcontextcreationerror",ze,!1),ve.dispose(),xe.dispose(),Y.dispose(),le.dispose(),Ae.dispose(),Oe.dispose(),ut.dispose(),tt.dispose(),Ce.dispose(),F.dispose(),F.removeEventListener("sessionstart",hr),F.removeEventListener("sessionend",Vt),_r.stop()};function ge(O){O.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),I=!0}function _e(){console.log("THREE.WebGLRenderer: Context Restored."),I=!1;const O=ft.autoReset,ne=Ye.enabled,ue=Ye.autoUpdate,he=Ye.needsUpdate,oe=Ye.type;V(),ft.autoReset=O,Ye.enabled=ne,Ye.autoUpdate=ue,Ye.needsUpdate=he,Ye.type=oe}function ze(O){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",O.statusMessage)}function Ne(O){const ne=O.target;ne.removeEventListener("dispose",Ne),_t(ne)}function _t(O){Dt(O),Y.remove(O)}function Dt(O){const ne=Y.get(O).programs;ne!==void 0&&(ne.forEach(function(ue){Ce.releaseProgram(ue)}),O.isShaderMaterial&&Ce.releaseShaderCache(O))}this.renderBufferDirect=function(O,ne,ue,he,oe,Re){ne===null&&(ne=Pe);const Je=oe.isMesh&&oe.matrixWorld.determinant()<0,it=qm(O,ne,ue,he,oe);Xe.setMaterial(he,Je);let ot=ue.index,qe=1;if(he.wireframe===!0){if(ot=Ee.getWireframeAttribute(ue),ot===void 0)return;qe=2}const At=ue.drawRange,ht=ue.attributes.position;let Dr=At.start*qe,er=(At.start+At.count)*qe;Re!==null&&(Dr=Math.max(Dr,Re.start*qe),er=Math.min(er,(Re.start+Re.count)*qe)),ot!==null?(Dr=Math.max(Dr,0),er=Math.min(er,ot.count)):ht!=null&&(Dr=Math.max(Dr,0),er=Math.min(er,ht.count));const Rn=er-Dr;if(Rn<0||Rn===1/0)return;ut.setup(oe,he,it,ue,ot);let di,jt=nt;if(ot!==null&&(di=me.get(ot),jt=pt,jt.setIndex(di)),oe.isMesh)he.wireframe===!0?(Xe.setLineWidth(he.wireframeLinewidth*at()),jt.setMode(se.LINES)):jt.setMode(se.TRIANGLES);else if(oe.isLine){let rt=he.linewidth;rt===void 0&&(rt=1),Xe.setLineWidth(rt*at()),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(Dr,Rn,oe.count);else if(ue.isInstancedBufferGeometry){const rt=ue._maxInstanceCount!==void 0?ue._maxInstanceCount:1/0,Wu=Math.min(ue.instanceCount,rt);jt.renderInstances(Dr,Rn,Wu)}else jt.render(Dr,Rn)};function Lt(O,ne,ue){O.transparent===!0&&O.side===Ei&&O.forceSinglePass===!1?(O.side=kr,O.needsUpdate=!0,Us(O,ne,ue),O.side=yi,O.needsUpdate=!0,Us(O,ne,ue),O.side=Ei):Us(O,ne,ue)}this.compile=function(O,ne,ue=null){ue===null&&(ue=O),m=xe.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))}),O!==ue&&O.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 O.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];Lt(it,ue,oe),he.add(it)}else Lt(Re,ue,oe),he.add(Re)}),w.pop(),m=null,he},this.compileAsync=function(O,ne,ue=null){const he=this.compile(O,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(O);return}setTimeout(Re,10)}ke.get("KHR_parallel_shader_compile")!==null?Re():setTimeout(Re,10)})};let Mt=null;function vt(O){Mt&&Mt(O)}function hr(){_r.stop()}function Vt(){_r.start()}const _r=new ZE;_r.setAnimationLoop(vt),typeof self<"u"&&_r.setContext(self),this.setAnimationLoop=function(O){Mt=O,F.setAnimationLoop(O),O===null?_r.stop():_r.start()},F.addEventListener("sessionstart",hr),F.addEventListener("sessionend",Vt),this.render=function(O,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;O.matrixWorldAutoUpdate===!0&&O.updateMatrixWorld(),ne.parent===null&&ne.matrixWorldAutoUpdate===!0&&ne.updateMatrixWorld(),F.enabled===!0&&F.isPresenting===!0&&(F.cameraAutoUpdate===!0&&F.updateCamera(ne),ne=F.getCamera()),O.isScene===!0&&O.onBeforeRender(x,O,ne,T),m=xe.get(O,w.length),m.init(),w.push(m),pe.multiplyMatrices(ne.projectionMatrix,ne.matrixWorldInverse),re.setFromProjectionMatrix(pe),de=this.localClippingEnabled,G=Be.init(this.clippingPlanes,de),E=ve.get(O,_.length),E.init(),_.push(E),bn(O,ne,0,x.sortObjects),E.finish(),x.sortObjects===!0&&E.sort(H,ee),this.info.render.frame++,G===!0&&Be.beginShadows();const ue=m.state.shadowsArray;if(Ye.render(ue,O,ne),G===!0&&Be.endShadows(),this.info.autoReset===!0&&this.info.reset(),(F.enabled===!1||F.isPresenting===!1||F.hasDepthSensing()===!1)&&Le.render(E,O),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,O,Je,Je.viewport)}}else qt(E,O,ne);T!==null&&(k.updateMultisampleRenderTarget(T),k.updateRenderTargetMipmap(T)),O.isScene===!0&&O.onAfterRender(x,O,ne),ut.resetDefaultState(),D=-1,b=null,w.pop(),w.length>0?m=w[w.length-1]:m=null,_.pop(),_.length>0?E=_[_.length-1]:E=null};function bn(O,ne,ue,he){if(O.visible===!1)return;if(O.layers.test(ne.layers)){if(O.isGroup)ue=O.renderOrder;else if(O.isLOD)O.autoUpdate===!0&&O.update(ne);else if(O.isLight)m.pushLight(O),O.castShadow&&m.pushShadow(O);else if(O.isSprite){if(!O.frustumCulled||re.intersectsSprite(O)){he&&ye.setFromMatrixPosition(O.matrixWorld).applyMatrix4(pe);const Re=Oe.update(O),Je=O.material;Je.visible&&E.push(O,Re,Je,ue,ye.z,null)}}else if((O.isMesh||O.isLine||O.isPoints)&&(!O.frustumCulled||re.intersectsObject(O))){const Re=Oe.update(O),Je=O.material;if(he&&(O.boundingSphere!==void 0?(O.boundingSphere===null&&O.computeBoundingSphere(),ye.copy(O.boundingSphere.center)):(Re.boundingSphere===null&&Re.computeBoundingSphere(),ye.copy(Re.boundingSphere.center)),ye.applyMatrix4(O.matrixWorld).applyMatrix4(pe)),Array.isArray(Je)){const it=Re.groups;for(let ot=0,qe=it.length;ot<qe;ot++){const At=it[ot],ht=Je[At.materialIndex];ht&&ht.visible&&E.push(O,Re,ht,ue,ye.z,At)}}else Je.visible&&E.push(O,Re,Je,ue,ye.z,null)}}const oe=O.children;for(let Re=0,Je=oe.length;Re<Je;Re++)bn(oe[Re],ne,ue,he)}function qt(O,ne,ue,he){const oe=O.opaque,Re=O.transmissive,Je=O.transparent;m.setupLightsView(ue),G===!0&&Be.setGlobalState(x.clippingPlanes,ue),Re.length>0&&hi(oe,Re,ne,ue),he&&Xe.viewport(S.copy(he)),oe.length>0&&Jn(oe,ne,ue),Re.length>0&&Jn(Re,ne,ue),Je.length>0&&Jn(Je,ne,ue),Xe.buffers.depth.setTest(!0),Xe.buffers.depth.setMask(!0),Xe.buffers.color.setMask(!0),Xe.setPolygonOffset(!1)}function hi(O,ne,ue,he){if((ue.isScene===!0?ue.overrideMaterial:null)!==null)return;if(m.state.transmissionRenderTarget===null){m.state.transmissionRenderTarget=new Mi(1,1,{generateMipmaps:!0,type:ke.has("EXT_color_buffer_half_float")||ke.has("EXT_color_buffer_float")?yn:Ar,minFilter:wi,samples:4,stencilBuffer:s});const ot=Y.get(m.state.transmissionRenderTarget);ot.__isTransmissionRenderTarget=!0}const oe=m.state.transmissionRenderTarget;x.getDrawingBufferSize(fe),oe.setSize(fe.x,fe.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,Jn(O,ue,he),k.updateMultisampleRenderTarget(oe),k.updateRenderTargetMipmap(oe);let it=!1;for(let ot=0,qe=ne.length;ot<qe;ot++){const At=ne[ot],ht=At.object,Dr=At.geometry,er=At.material,Rn=At.group;if(er.side===Ei&&ht.layers.test(he.layers)){const di=er.side;er.side=kr,er.needsUpdate=!0,Ns(ht,ue,he,Dr,er,Rn),er.side=di,er.needsUpdate=!0,it=!0}}it===!0&&(k.updateMultisampleRenderTarget(oe),k.updateRenderTargetMipmap(oe)),x.setRenderTarget(Re),x.setClearColor(N,W),x.toneMapping=Je}function Jn(O,ne,ue){const he=ne.isScene===!0?ne.overrideMaterial:null;for(let oe=0,Re=O.length;oe<Re;oe++){const Je=O[oe],it=Je.object,ot=Je.geometry,qe=he===null?Je.material:he,At=Je.group;it.layers.test(ue.layers)&&Ns(it,ne,ue,ot,qe,At)}}function Ns(O,ne,ue,he,oe,Re){O.onBeforeRender(x,ne,ue,he,oe,Re),O.modelViewMatrix.multiplyMatrices(ue.matrixWorldInverse,O.matrixWorld),O.normalMatrix.getNormalMatrix(O.modelViewMatrix),oe.onBeforeRender(x,ne,ue,he,O,Re),oe.transparent===!0&&oe.side===Ei&&oe.forceSinglePass===!1?(oe.side=kr,oe.needsUpdate=!0,x.renderBufferDirect(ue,ne,he,oe,O,Re),oe.side=yi,oe.needsUpdate=!0,x.renderBufferDirect(ue,ne,he,oe,O,Re),oe.side=Ei):x.renderBufferDirect(ue,ne,he,oe,O,Re),O.onAfterRender(x,ne,ue,he,oe,Re)}function Us(O,ne,ue){ne.isScene!==!0&&(ne=Pe);const he=Y.get(O),oe=m.state.lights,Re=m.state.shadowsArray,Je=oe.state.version,it=Ce.getParameters(O,oe.state,Re,ne,ue),ot=Ce.getProgramCacheKey(it);let qe=he.programs;he.environment=O.isMeshStandardMaterial?ne.environment:null,he.fog=ne.fog,he.envMap=(O.isMeshStandardMaterial?Ae:le).get(O.envMap||he.environment),he.envMapRotation=he.environment!==null&&O.envMap===null?ne.environmentRotation:O.envMapRotation,qe===void 0&&(O.addEventListener("dispose",Ne),qe=new Map,he.programs=qe);let At=qe.get(ot);if(At!==void 0){if(he.currentProgram===At&&he.lightsStateVersion===Je)return wf(O,it),At}else it.uniforms=Ce.getUniforms(O),O.onBuild(ue,it,x),O.onBeforeCompile(it,x),At=Ce.acquireProgram(it,ot),qe.set(ot,At),he.uniforms=it.uniforms;const ht=he.uniforms;return(!O.isShaderMaterial&&!O.isRawShaderMaterial||O.clipping===!0)&&(ht.clippingPlanes=Be.uniform),wf(O,it),he.needsLights=Ps(O),he.lightsStateVersion=Je,he.needsLights&&(ht.ambientLightColor.value=oe.state.ambient,ht.lightProbe.value=oe.state.probe,ht.directionalLights.value=oe.state.directional,ht.directionalLightShadows.value=oe.state.directionalShadow,ht.spotLights.value=oe.state.spot,ht.spotLightShadows.value=oe.state.spotShadow,ht.rectAreaLights.value=oe.state.rectArea,ht.ltc_1.value=oe.state.rectAreaLTC1,ht.ltc_2.value=oe.state.rectAreaLTC2,ht.pointLights.value=oe.state.point,ht.pointLightShadows.value=oe.state.pointShadow,ht.hemisphereLights.value=oe.state.hemi,ht.directionalShadowMap.value=oe.state.directionalShadowMap,ht.directionalShadowMatrix.value=oe.state.directionalShadowMatrix,ht.spotShadowMap.value=oe.state.spotShadowMap,ht.spotLightMatrix.value=oe.state.spotLightMatrix,ht.spotLightMap.value=oe.state.spotLightMap,ht.pointShadowMap.value=oe.state.pointShadowMap,ht.pointShadowMatrix.value=oe.state.pointShadowMatrix),he.currentProgram=At,he.uniformsList=null,At}function ac(O){if(O.uniformsList===null){const ne=O.currentProgram.getUniforms();O.uniformsList=Bd.seqWithValue(ne.seq,O.uniforms)}return O.uniformsList}function wf(O,ne){const ue=Y.get(O);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 qm(O,ne,ue,he,oe){ne.isScene!==!0&&(ne=Pe),k.resetTextureUnits();const Re=ne.fog,Je=he.isMeshStandardMaterial?ne.environment:null,it=T===null?x.outputColorSpace:T.isXRRenderTarget===!0?T.texture.colorSpace:Sr,ot=(he.isMeshStandardMaterial?Ae:le).get(he.envMap||Je),qe=he.vertexColors===!0&&!!ue.attributes.color&&ue.attributes.color.itemSize===4,At=!!ue.attributes.tangent&&(!!he.normalMap||he.anisotropy>0),ht=!!ue.morphAttributes.position,Dr=!!ue.morphAttributes.normal,er=!!ue.morphAttributes.color;let Rn=Zs;he.toneMapped&&(T===null||T.isXRRenderTarget===!0)&&(Rn=x.toneMapping);const di=ue.morphAttributes.position||ue.morphAttributes.normal||ue.morphAttributes.color,jt=di!==void 0?di.length:0,rt=Y.get(he),Wu=m.state.lights;if(G===!0&&(de===!0||O!==b)){const Ln=O===b&&he.id===D;Be.setState(he,O,Ln)}let gn=!1;he.version===rt.__version?(rt.needsLights&&rt.lightsStateVersion!==Wu.state.version||rt.outputColorSpace!==it||oe.isBatchedMesh&&rt.batching===!1||!oe.isBatchedMesh&&rt.batching===!0||oe.isInstancedMesh&&rt.instancing===!1||!oe.isInstancedMesh&&rt.instancing===!0||oe.isSkinnedMesh&&rt.skinning===!1||!oe.isSkinnedMesh&&rt.skinning===!0||oe.isInstancedMesh&&rt.instancingColor===!0&&oe.instanceColor===null||oe.isInstancedMesh&&rt.instancingColor===!1&&oe.instanceColor!==null||oe.isInstancedMesh&&rt.instancingMorph===!0&&oe.morphTexture===null||oe.isInstancedMesh&&rt.instancingMorph===!1&&oe.morphTexture!==null||rt.envMap!==ot||he.fog===!0&&rt.fog!==Re||rt.numClippingPlanes!==void 0&&(rt.numClippingPlanes!==Be.numPlanes||rt.numIntersection!==Be.numIntersection)||rt.vertexAlphas!==qe||rt.vertexTangents!==At||rt.morphTargets!==ht||rt.morphNormals!==Dr||rt.morphColors!==er||rt.toneMapping!==Rn||rt.morphTargetsCount!==jt)&&(gn=!0):(gn=!0,rt.__version=he.version);let ks=rt.currentProgram;gn===!0&&(ks=Us(he,ne,oe));let If=!1,Do=!1,Ia=!1;const vr=ks.getUniforms(),Dn=rt.uniforms;if(Xe.useProgram(ks.program)&&(If=!0,Do=!0,Ia=!0),he.id!==D&&(D=he.id,Do=!0),If||b!==O){vr.setValue(se,"projectionMatrix",O.projectionMatrix),vr.setValue(se,"viewMatrix",O.matrixWorldInverse);const Ln=vr.map.cameraPosition;Ln!==void 0&&Ln.setValue(se,ye.setFromMatrixPosition(O.matrixWorld)),dt.logarithmicDepthBuffer&&vr.setValue(se,"logDepthBufFC",2/(Math.log(O.far+1)/Math.LN2)),(he.isMeshPhongMaterial||he.isMeshToonMaterial||he.isMeshLambertMaterial||he.isMeshBasicMaterial||he.isMeshStandardMaterial||he.isShaderMaterial)&&vr.setValue(se,"isOrthographic",O.isOrthographicCamera===!0),b!==O&&(b=O,Do=!0,Ia=!0)}if(oe.isSkinnedMesh){vr.setOptional(se,oe,"bindMatrix"),vr.setOptional(se,oe,"bindMatrixInverse");const Ln=oe.skeleton;Ln&&(Ln.boneTexture===null&&Ln.computeBoneTexture(),vr.setValue(se,"boneTexture",Ln.boneTexture,k))}oe.isBatchedMesh&&(vr.setOptional(se,oe,"batchingTexture"),vr.setValue(se,"batchingTexture",oe._matricesTexture,k));const Ca=ue.morphAttributes;if((Ca.position!==void 0||Ca.normal!==void 0||Ca.color!==void 0)&&be.update(oe,ue,ks),(Do||rt.receiveShadow!==oe.receiveShadow)&&(rt.receiveShadow=oe.receiveShadow,vr.setValue(se,"receiveShadow",oe.receiveShadow)),he.isMeshGouraudMaterial&&he.envMap!==null&&(Dn.envMap.value=ot,Dn.flipEnvMap.value=ot.isCubeTexture&&ot.isRenderTargetTexture===!1?-1:1),he.isMeshStandardMaterial&&he.envMap===null&&ne.environment!==null&&(Dn.envMapIntensity.value=ne.environmentIntensity),Do&&(vr.setValue(se,"toneMappingExposure",x.toneMappingExposure),rt.needsLights&&Xm(Dn,Ia),Re&&he.fog===!0&&Qe.refreshFogUniforms(Dn,Re),Qe.refreshMaterialUniforms(Dn,he,te,K,m.state.transmissionRenderTarget),Bd.upload(se,ac(rt),Dn,k)),he.isShaderMaterial&&he.uniformsNeedUpdate===!0&&(Bd.upload(se,ac(rt),Dn,k),he.uniformsNeedUpdate=!1),he.isSpriteMaterial&&vr.setValue(se,"center",oe.center),vr.setValue(se,"modelViewMatrix",oe.modelViewMatrix),vr.setValue(se,"normalMatrix",oe.normalMatrix),vr.setValue(se,"modelMatrix",oe.matrixWorld),he.isShaderMaterial||he.isRawShaderMaterial){const Ln=he.uniformsGroups;for(let Yu=0,qu=Ln.length;Yu<qu;Yu++){const Xu=Ln[Yu];tt.update(Xu,ks),tt.bind(Xu,ks)}}return ks}function Xm(O,ne){O.ambientLightColor.needsUpdate=ne,O.lightProbe.needsUpdate=ne,O.directionalLights.needsUpdate=ne,O.directionalLightShadows.needsUpdate=ne,O.pointLights.needsUpdate=ne,O.pointLightShadows.needsUpdate=ne,O.spotLights.needsUpdate=ne,O.spotLightShadows.needsUpdate=ne,O.rectAreaLights.needsUpdate=ne,O.hemisphereLights.needsUpdate=ne}function Ps(O){return O.isMeshLambertMaterial||O.isMeshToonMaterial||O.isMeshPhongMaterial||O.isMeshStandardMaterial||O.isShadowMaterial||O.isShaderMaterial&&O.lights===!0}this.getActiveCubeFace=function(){return R},this.getActiveMipmapLevel=function(){return M},this.getRenderTarget=function(){return T},this.setRenderTargetTextures=function(O,ne,ue){Y.get(O.texture).__webglTexture=ne,Y.get(O.depthTexture).__webglTexture=ue;const he=Y.get(O);he.__hasExternalTextures=!0,he.__autoAllocateDepthBuffer=ue===void 0,he.__autoAllocateDepthBuffer||ke.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(O,ne){const ue=Y.get(O);ue.__webglFramebuffer=ne,ue.__useDefaultFramebuffer=ne===void 0},this.setRenderTarget=function(O,ne=0,ue=0){T=O,R=ne,M=ue;let he=!0,oe=null,Re=!1,Je=!1;if(O){const it=Y.get(O);it.__useDefaultFramebuffer!==void 0?(Xe.bindFramebuffer(se.FRAMEBUFFER,null),he=!1):it.__webglFramebuffer===void 0?k.setupRenderTarget(O):it.__hasExternalTextures&&k.rebindTextures(O,Y.get(O.texture).__webglTexture,Y.get(O.depthTexture).__webglTexture);const ot=O.texture;(ot.isData3DTexture||ot.isDataArrayTexture||ot.isCompressedArrayTexture)&&(Je=!0);const qe=Y.get(O).__webglFramebuffer;O.isWebGLCubeRenderTarget?(Array.isArray(qe[ne])?oe=qe[ne][ue]:oe=qe[ne],Re=!0):O.samples>0&&k.useMultisampledRTT(O)===!1?oe=Y.get(O).__webglMultisampledFramebuffer:Array.isArray(qe)?oe=qe[ue]:oe=qe,S.copy(O.viewport),L.copy(O.scissor),P=O.scissorTest}else S.copy(Q).multiplyScalar(te).floor(),L.copy(z).multiplyScalar(te).floor(),P=Z;if(Xe.bindFramebuffer(se.FRAMEBUFFER,oe)&&he&&Xe.drawBuffers(O,oe),Xe.viewport(S),Xe.scissor(L),Xe.setScissorTest(P),Re){const it=Y.get(O.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(O.texture),ot=ne||0;se.framebufferTextureLayer(se.FRAMEBUFFER,se.COLOR_ATTACHMENT0,it.__webglTexture,ue||0,ot)}D=-1},this.readRenderTargetPixels=function(O,ne,ue,he,oe,Re,Je){if(!(O&&O.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let it=Y.get(O).__webglFramebuffer;if(O.isWebGLCubeRenderTarget&&Je!==void 0&&(it=it[Je]),it){Xe.bindFramebuffer(se.FRAMEBUFFER,it);try{const ot=O.texture,qe=ot.format,At=ot.type;if(qe!==gr&&ct.convert(qe)!==se.getParameter(se.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const ht=At===yn&&(ke.has("EXT_color_buffer_half_float")||ke.has("EXT_color_buffer_float"));if(At!==Ar&&ct.convert(At)!==se.getParameter(se.IMPLEMENTATION_COLOR_READ_TYPE)&&At!==lr&&!ht){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}ne>=0&&ne<=O.width-he&&ue>=0&&ue<=O.height-oe&&se.readPixels(ne,ue,he,oe,ct.convert(qe),ct.convert(At),Re)}finally{const ot=T!==null?Y.get(T).__webglFramebuffer:null;Xe.bindFramebuffer(se.FRAMEBUFFER,ot)}}},this.copyFramebufferToTexture=function(O,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,O.x,O.y,oe,Re),Xe.unbindTexture()},this.copyTextureToTexture=function(O,ne,ue,he=0){const oe=ne.image.width,Re=ne.image.height,Je=ct.convert(ue.format),it=ct.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,O.x,O.y,oe,Re,Je,it,ne.image.data):ne.isCompressedTexture?se.compressedTexSubImage2D(se.TEXTURE_2D,he,O.x,O.y,ne.mipmaps[0].width,ne.mipmaps[0].height,Je,ne.mipmaps[0].data):se.texSubImage2D(se.TEXTURE_2D,he,O.x,O.y,Je,it,ne.image),he===0&&ue.generateMipmaps&&se.generateMipmap(se.TEXTURE_2D),Xe.unbindTexture()},this.copyTextureToTexture3D=function(O,ne,ue,he,oe=0){const Re=Math.round(O.max.x-O.min.x),Je=Math.round(O.max.y-O.min.y),it=O.max.z-O.min.z+1,ot=ct.convert(he.format),qe=ct.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 ht=se.getParameter(se.UNPACK_ROW_LENGTH),Dr=se.getParameter(se.UNPACK_IMAGE_HEIGHT),er=se.getParameter(se.UNPACK_SKIP_PIXELS),Rn=se.getParameter(se.UNPACK_SKIP_ROWS),di=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,O.min.x),se.pixelStorei(se.UNPACK_SKIP_ROWS,O.min.y),se.pixelStorei(se.UNPACK_SKIP_IMAGES,O.min.z),ue.isDataTexture||ue.isData3DTexture?se.texSubImage3D(At,oe,ne.x,ne.y,ne.z,Re,Je,it,ot,qe,jt.data):he.isCompressedArrayTexture?se.compressedTexSubImage3D(At,oe,ne.x,ne.y,ne.z,Re,Je,it,ot,jt.data):se.texSubImage3D(At,oe,ne.x,ne.y,ne.z,Re,Je,it,ot,qe,jt),se.pixelStorei(se.UNPACK_ROW_LENGTH,ht),se.pixelStorei(se.UNPACK_IMAGE_HEIGHT,Dr),se.pixelStorei(se.UNPACK_SKIP_PIXELS,er),se.pixelStorei(se.UNPACK_SKIP_ROWS,Rn),se.pixelStorei(se.UNPACK_SKIP_IMAGES,di),oe===0&&he.generateMipmaps&&se.generateMipmap(At),Xe.unbindTexture()},this.initTexture=function(O){O.isCubeTexture?k.setTextureCube(O,0):O.isData3DTexture?k.setTexture3D(O,0):O.isDataArrayTexture||O.isCompressedArrayTexture?k.setTexture2DArray(O,0):k.setTexture2D(O,0),Xe.unbindTexture()},this.resetState=function(){R=0,M=0,T=null,Xe.reset(),ut.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return gs}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=e===ed?"display-p3":"srgb",t.unpackColorSpace=Rt.workingColorSpace===nu?"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 zL 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 Yi,this.environmentIntensity=1,this.environmentRotation=new Yi,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 HL{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=IA,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=Ci()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return IE("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=Ci()),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=Ci()),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 hn=new j;class rg{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++)hn.fromBufferAttribute(this,t),hn.applyMatrix4(e),this.setXYZ(t,hn.x,hn.y,hn.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)hn.fromBufferAttribute(this,t),hn.applyNormalMatrix(e),this.setXYZ(t,hn.x,hn.y,hn.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)hn.fromBufferAttribute(this,t),hn.transformDirection(e),this.setXYZ(t,hn.x,hn.y,hn.z);return this}getComponent(e,t){let n=this.array[e*this.data.stride+this.offset+t];return this.normalized&&(n=Si(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=Nt(n,this.array)),this.data.array[e*this.data.stride+this.offset+t]=n,this}setX(e,t){return this.normalized&&(t=Nt(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=Nt(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=Nt(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=Nt(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=Si(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=Si(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=Si(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=Si(t,this.array)),t}setXY(e,t,n){return e=e*this.data.stride+this.offset,this.normalized&&(t=Nt(t,this.array),n=Nt(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=Nt(t,this.array),n=Nt(n,this.array),i=Nt(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=Nt(t,this.array),n=Nt(n,this.array),i=Nt(i,this.array),s=Nt(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 Fr(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 rg(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 T2=new j,B2=new Ot,b2=new Ot,GL=new j,R2=new st,bd=new j,ng=new Bi,D2=new st,ig=new cu;class VL extends Yr{constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=Hy,this.bindMatrix=new st,this.bindMatrixInverse=new st,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){const e=this.geometry;this.boundingBox===null&&(this.boundingBox=new Er),this.boundingBox.makeEmpty();const t=e.getAttribute("position");for(let n=0;n<t.count;n++)this.getVertexPosition(n,bd),this.boundingBox.expandByPoint(bd)}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,bd),this.boundingSphere.expandByPoint(bd)}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(),ng.copy(this.boundingSphere),ng.applyMatrix4(i),e.ray.intersectsSphere(ng)!==!1&&(D2.copy(i).invert(),ig.copy(e.ray).applyMatrix4(D2),!(this.boundingBox!==null&&ig.intersectsBox(this.boundingBox)===!1)&&this._computeIntersections(e,t,ig)))}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 Ot,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===Hy?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===KB?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(e,t){const n=this.skeleton,i=this.geometry;B2.fromBufferAttribute(i.attributes.skinIndex,e),b2.fromBufferAttribute(i.attributes.skinWeight,e),T2.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let s=0;s<4;s++){const o=b2.getComponent(s);if(o!==0){const c=B2.getComponent(s);R2.multiplyMatrices(n.bones[c].matrixWorld,n.boneInverses[c]),t.addScaledVector(GL.copy(T2).applyMatrix4(R2),o)}}return t.applyMatrix4(this.bindMatrixInverse)}}class L2 extends Zt{constructor(){super(),this.isBone=!0,this.type="Bone"}}class Ao extends Tr{constructor(e=null,t=1,n=1,i,s,o,c,h,u=fr,d=fr,A,p){super(null,o,c,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 N2=new st,jL=new st;class sg{constructor(e=[],t=[]){this.uuid=Ci(),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 st)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){const n=new st;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 c=e[s]?e[s].matrixWorld:jL;N2.multiplyMatrices(c,t[s]),N2.toArray(n,s*16)}i!==null&&(i.needsUpdate=!0)}clone(){return new sg(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 Ao(t,e,e,gr,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 L2),this.bones.push(o),this.boneInverses.push(new st().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 c=n[i];e.boneInverses.push(c.toArray())}return e}}class ag extends Fr{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 Tl=new st,U2=new st,Rd=[],P2=new Er,WL=new st,gu=new Yr,mu=new Bi;class YL extends Yr{constructor(e,t,n){super(e,t),this.isInstancedMesh=!0,this.instanceMatrix=new ag(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,WL)}computeBoundingBox(){const e=this.geometry,t=this.count;this.boundingBox===null&&(this.boundingBox=new Er),e.boundingBox===null&&e.computeBoundingBox(),this.boundingBox.makeEmpty();for(let n=0;n<t;n++)this.getMatrixAt(n,Tl),P2.copy(e.boundingBox).applyMatrix4(Tl),this.boundingBox.union(P2)}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,Tl),mu.copy(e.boundingSphere).applyMatrix4(Tl),this.boundingSphere.union(mu)}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 c=0;c<n.length;c++)n[c]=i[o+c]}raycast(e,t){const n=this.matrixWorld,i=this.count;if(gu.geometry=this.geometry,gu.material=this.material,gu.material!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),mu.copy(this.boundingSphere),mu.applyMatrix4(n),e.ray.intersectsSphere(mu)!==!1))for(let s=0;s<i;s++){this.getMatrixAt(s,Tl),U2.multiplyMatrices(n,Tl),gu.matrixWorld=U2,gu.raycast(e,Rd);for(let o=0,c=Rd.length;o<c;o++){const h=Rd[o];h.instanceId=s,h.object=this,t.push(h)}Rd.length=0}}setColorAt(e,t){this.instanceColor===null&&(this.instanceColor=new ag(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 Ao(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 c=this.geometry.morphTargetsRelative?1:1-o,h=i*e;s[h]=c,s.set(n,h+1)}updateMorphTargets(){}dispose(){return this.dispatchEvent({type:"dispose"}),this.morphTexture!==null&&(this.morphTexture.dispose(),this.morphTexture=null),this}}class k2 extends qi{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new Ke(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 Q2=new j,F2=new j,O2=new st,og=new cu,Dd=new Bi;class lg extends Zt{constructor(e=new Gn,t=new k2){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++)Q2.fromBufferAttribute(t,i-1),F2.fromBufferAttribute(t,i),n[i]=n[i-1],n[i]+=Q2.distanceTo(F2);e.setAttribute("lineDistance",new Di(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(),Dd.copy(n.boundingSphere),Dd.applyMatrix4(i),Dd.radius+=s,e.ray.intersectsSphere(Dd)===!1)return;O2.copy(i).invert(),og.copy(e.ray).applyMatrix4(O2);const c=s/((this.scale.x+this.scale.y+this.scale.z)/3),h=c*c,u=new j,d=new j,A=new j,p=new j,g=this.isLineSegments?2:1,v=n.index,E=n.attributes.position;if(v!==null){const m=Math.max(0,o.start),_=Math.min(v.count,o.start+o.count);for(let w=m,x=_-1;w<x;w+=g){const I=v.getX(w),R=v.getX(w+1);if(u.fromBufferAttribute(E,I),d.fromBufferAttribute(E,R),og.distanceSqToSegment(u,d,p,A)>h)continue;p.applyMatrix4(this.matrixWorld);const M=e.ray.origin.distanceTo(p);M<e.near||M>e.far||t.push({distance:M,point:A.clone().applyMatrix4(this.matrixWorld),index:w,face:null,faceIndex:null,object:this})}}else{const m=Math.max(0,o.start),_=Math.min(E.count,o.start+o.count);for(let w=m,x=_-1;w<x;w+=g){if(u.fromBufferAttribute(E,w),d.fromBufferAttribute(E,w+1),og.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 z2=new j,H2=new j;class qL extends lg{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)z2.fromBufferAttribute(t,i),H2.fromBufferAttribute(t,i+1),n[i]=i===0?0:n[i-1],n[i+1]=n[i]+z2.distanceTo(H2);e.setAttribute("lineDistance",new Di(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class XL extends lg{constructor(e,t){super(e,t),this.isLineLoop=!0,this.type="LineLoop"}}class G2 extends qi{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new Ke(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 V2=new st,cg=new cu,Ld=new Bi,Nd=new j;class KL extends Zt{constructor(e=new Gn,t=new G2){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(),Ld.copy(n.boundingSphere),Ld.applyMatrix4(i),Ld.radius+=s,e.ray.intersectsSphere(Ld)===!1)return;V2.copy(i).invert(),cg.copy(e.ray).applyMatrix4(V2);const c=s/((this.scale.x+this.scale.y+this.scale.z)/3),h=c*c,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,v=p;g<v;g++){const E=u.getX(g);Nd.fromBufferAttribute(d,E),j2(Nd,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,v=p;g<v;g++)Nd.fromBufferAttribute(d,g),j2(Nd,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 j2(r,e,t,n,i,s,o){const c=cg.distanceSqToPoint(r);if(c<t){const h=new j;cg.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(c),point:h,index:e,face:null,object:o})}}class Ud extends Tr{constructor(e,t,n,i,s,o,c,h,u,d,A,p){super(null,o,c,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 JL extends Ud{constructor(e,t,n,i,s,o){super(e,t,n,s,o),this.isCompressedArrayTexture=!0,this.image.depth=i,this.wrapR=xi}}class ZL extends Ud{constructor(e,t,n){super(void 0,e[0].width,e[0].height,t,n,no),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class $L extends En{constructor(e){super(e),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}class ug extends qi{constructor(e){super(),this.isMeshStandardMaterial=!0,this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new Ke(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 Ke(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=mE,this.normalScale=new Ge(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 Yi,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 Li extends ug{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 Ge(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return Mr(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 Ke(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 Ke(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new Ke(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 Pd(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 e8(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}function t8(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 W2(r,e,t){const n=r.length,i=new r.constructor(n);for(let s=0,o=0;o!==n;++s){const c=t[s]*e;for(let h=0;h!==e;++h)i[o++]=r[c+h]}return i}function Y2(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 _u{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 c=n+2;;){if(i===void 0){if(e<s)break n;return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}if(n===c)break;if(s=i,i=t[++n],e<i)break t}o=t.length;break r}if(!(e>=s)){const c=t[1];e<c&&(n=2,s=c);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 c=n+o>>>1;e<t[c]?o=c:n=c+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 r8 extends _u{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:fE,endingEnd:fE}}intervalChanged_(e,t,n){const i=this.parameterPositions;let s=e-2,o=e+1,c=i[s],h=i[o];if(c===void 0)switch(this.getSettings_().endingStart){case pE:s=e,c=2*t-n;break;case AE:s=i.length-2,c=t+i[s]-i[s+1];break;default:s=e,c=n}if(h===void 0)switch(this.getSettings_().endingEnd){case pE:o=e,h=2*n-t;break;case AE: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-c),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,c=this.valueSize,h=e*c,u=h-c,d=this._offsetPrev,A=this._offsetNext,p=this._weightPrev,g=this._weightNext,v=(n-t)/(i-t),E=v*v,m=E*v,_=-p*m+2*p*E-p*v,w=(1+p)*m+(-1.5-2*p)*E+(-.5+p)*v+1,x=(-1-g)*m+(1.5+g)*E+.5*v,I=g*m-g*E;for(let R=0;R!==c;++R)s[R]=_*o[d+R]+w*o[u+R]+x*o[h+R]+I*o[A+R];return s}}class n8 extends _u{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){const s=this.resultBuffer,o=this.sampleValues,c=this.valueSize,h=e*c,u=h-c,d=(n-t)/(i-t),A=1-d;for(let p=0;p!==c;++p)s[p]=o[u+p]*A+o[h+p]*d;return s}}class i8 extends _u{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e){return this.copySampleValue_(e-1)}}class Ji{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=Pd(t,this.TimeBufferType),this.values=Pd(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:Pd(e.times,Array),values:Pd(e.values,Array)};const i=e.getInterpolation();i!==e.DefaultInterpolation&&(n.interpolation=i)}return n.type=e.ValueTypeName,n}InterpolantFactoryMethodDiscrete(e){return new i8(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new n8(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new r8(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case ru:t=this.InterpolantFactoryMethodDiscrete;break;case sl:t=this.InterpolantFactoryMethodLinear;break;case xA: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 ru;case this.InterpolantFactoryMethodLinear:return sl;case this.InterpolantFactoryMethodSmooth:return xA}}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 c=this.getValueSize();this.times=n.slice(s,o),this.values=this.values.slice(s*c,o*c)}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 c=0;c!==s;c++){const h=n[c];if(typeof h=="number"&&isNaN(h)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,c,h),e=!1;break}if(o!==null&&o>h){console.error("THREE.KeyframeTrack: Out of order keys.",this,c,h,o),e=!1;break}o=h}if(i!==void 0&&e8(i))for(let c=0,h=i.length;c!==h;++c){const u=i[c];if(isNaN(u)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,c,u),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),n=this.getValueSize(),i=this.getInterpolation()===xA,s=e.length-1;let o=1;for(let c=1;c<s;++c){let h=!1;const u=e[c],d=e[c+1];if(u!==d&&(c!==1||u!==e[0]))if(i)h=!0;else{const A=c*n,p=A-n,g=A+n;for(let v=0;v!==n;++v){const E=t[A+v];if(E!==t[p+v]||E!==t[g+v]){h=!0;break}}}if(h){if(c!==o){e[o]=e[c];const A=c*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 c=s*n,h=o*n,u=0;u!==n;++u)t[h+u]=t[c+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}}Ji.prototype.TimeBufferType=Float32Array,Ji.prototype.ValueBufferType=Float32Array,Ji.prototype.DefaultInterpolation=sl;class Bl extends Ji{}Bl.prototype.ValueTypeName="bool",Bl.prototype.ValueBufferType=Array,Bl.prototype.DefaultInterpolation=ru,Bl.prototype.InterpolantFactoryMethodLinear=void 0,Bl.prototype.InterpolantFactoryMethodSmooth=void 0;class q2 extends Ji{}q2.prototype.ValueTypeName="color";class bl extends Ji{}bl.prototype.ValueTypeName="number";class s8 extends _u{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){const s=this.resultBuffer,o=this.sampleValues,c=this.valueSize,h=(n-t)/(i-t);let u=e*c;for(let d=u+c;u!==d;u+=4)Wi.slerpFlat(s,0,o,u-c,o,u,h);return s}}class go extends Ji{InterpolantFactoryMethodLinear(e){return new s8(this.times,this.values,this.getValueSize(),e)}}go.prototype.ValueTypeName="quaternion",go.prototype.DefaultInterpolation=sl,go.prototype.InterpolantFactoryMethodSmooth=void 0;class Rl extends Ji{}Rl.prototype.ValueTypeName="string",Rl.prototype.ValueBufferType=Array,Rl.prototype.DefaultInterpolation=ru,Rl.prototype.InterpolantFactoryMethodLinear=void 0,Rl.prototype.InterpolantFactoryMethodSmooth=void 0;class Dl extends Ji{}Dl.prototype.ValueTypeName="vector";class a8{constructor(e="",t=-1,n=[],i=ib){this.name=e,this.tracks=n,this.duration=t,this.blendMode=i,this.uuid=Ci(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],n=e.tracks,i=1/(e.fps||1);for(let o=0,c=n.length;o!==c;++o)t.push(l8(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(Ji.toJSON(n[s]));return i}static CreateFromMorphTargetSequence(e,t,n,i){const s=t.length,o=[];for(let c=0;c<s;c++){let h=[],u=[];h.push((c+s-1)%s,c,(c+1)%s),u.push(0,1,0);const d=t8(h);h=W2(h,1,d),u=W2(u,1,d),!i&&h[0]===0&&(h.push(s),u.push(u[0])),o.push(new bl(".morphTargetInfluences["+t[c].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 c=0,h=e.length;c<h;c++){const u=e[c],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 c in i)o.push(this.CreateFromMorphTargetSequence(c,i[c],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,v){if(p.length!==0){const E=[],m=[];Y2(p,E,m,g),E.length!==0&&v.push(new d(A,E,m))}},i=[],s=e.name||"default",o=e.fps||30,c=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 v=0;v<A[g].morphTargets.length;v++)p[A[g].morphTargets[v]]=-1;for(const v in p){const E=[],m=[];for(let _=0;_!==A[g].morphTargets.length;++_){const w=A[g];E.push(w.time),m.push(w.morphTarget===v?1:0)}i.push(new bl(".morphTargetInfluence["+v+"]",E,m))}h=p.length*o}else{const p=".bones["+t[d].name+"]";n(Dl,p+".position",A,"pos",i),n(go,p+".quaternion",A,"rot",i),n(Dl,p+".scale",A,"scl",i)}}return i.length===0?null:new this(s,h,i,c)}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 o8(r){switch(r.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return bl;case"vector":case"vector2":case"vector3":case"vector4":return Dl;case"color":return q2;case"quaternion":return go;case"bool":case"boolean":return Bl;case"string":return Rl}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+r)}function l8(r){if(r.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const e=o8(r.type);if(r.times===void 0){const t=[],n=[];Y2(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 X2{constructor(e,t,n){const i=this;let s=!1,o=0,c=0,h;const u=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this.itemStart=function(d){c++,s===!1&&i.onStart!==void 0&&i.onStart(d,o,c),s=!0},this.itemEnd=function(d){o++,i.onProgress!==void 0&&i.onProgress(d,o,c),o===c&&(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],v=u[A+1];if(g.global&&(g.lastIndex=0),g.test(d))return v}return null}}}const c8=new X2;class ca{constructor(e){this.manager=e!==void 0?e:c8,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 Is={};class u8 extends Error{constructor(e,t){super(e),this.response=t}}class Ll 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(Is[e]!==void 0){Is[e].push({onLoad:t,onProgress:n,onError:i});return}Is[e]=[],Is[e].push({onLoad:t,onProgress:n,onError:i});const o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),c=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=Is[e],A=u.body.getReader(),p=u.headers.get("Content-Length")||u.headers.get("X-File-Size"),g=p?parseInt(p):0,v=g!==0;let E=0;const m=new ReadableStream({start(_){w();function w(){A.read().then(({done:x,value:I})=>{if(x)_.close();else{E+=I.byteLength;const R=new ProgressEvent("progress",{lengthComputable:v,loaded:E,total:g});for(let M=0,T=d.length;M<T;M++){const D=d[M];D.onProgress&&D.onProgress(R)}_.enqueue(I),w()}})}}});return new Response(m)}else throw new u8(`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,c));case"json":return u.json();default:if(c===void 0)return u.text();{const d=/charset="?([^;"\s]*)"?/i.exec(c),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=Is[e];delete Is[e];for(let A=0,p=d.length;A<p;A++){const g=d[A];g.onLoad&&g.onLoad(u)}}).catch(u=>{const d=Is[e];if(d===void 0)throw this.manager.itemError(e),u;delete Is[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 h8 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 c=au("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(){c.removeEventListener("load",h,!1),c.removeEventListener("error",u,!1)}return c.addEventListener("load",h,!1),c.addEventListener("error",u,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(c.crossOrigin=this.crossOrigin),s.manager.itemStart(e),c.src=e,c}}class d8 extends ca{constructor(e){super(e)}load(e,t,n,i){const s=this,o=new Ao,c=new Ll(this.manager);return c.setResponseType("arraybuffer"),c.setRequestHeader(this.requestHeader),c.setPath(this.path),c.setWithCredentials(s.withCredentials),c.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:xi,o.wrapT=u.wrapT!==void 0?u.wrapT:xi,o.magFilter=u.magFilter!==void 0?u.magFilter:pr,o.minFilter=u.minFilter!==void 0?u.minFilter:pr,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=wi),u.mipmapCount===1&&(o.minFilter=pr),u.generateMipmaps!==void 0&&(o.generateMipmaps=u.generateMipmaps),o.needsUpdate=!0,t&&t(o,u)},n,i),o}}class K2 extends ca{constructor(e){super(e)}load(e,t,n,i){const s=new Tr,o=new h8(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(e,function(c){s.image=c,s.needsUpdate=!0,t!==void 0&&t(s)},n,i),s}}class kd extends Zt{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new Ke(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 f8 extends kd{constructor(e,t,n){super(e,n),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(Zt.DEFAULT_UP),this.updateMatrix(),this.groundColor=new Ke(t)}copy(e,t){return super.copy(e,t),this.groundColor.copy(e.groundColor),this}}const hg=new st,J2=new j,Z2=new j;class dg{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Ge(512,512),this.map=null,this.mapPass=null,this.matrix=new st,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new WA,this._frameExtents=new Ge(1,1),this._viewportCount=1,this._viewports=[new Ot(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,n=this.matrix;J2.setFromMatrixPosition(e.matrixWorld),t.position.copy(J2),Z2.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(Z2),t.updateMatrixWorld(),hg.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(hg),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(hg)}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 p8 extends dg{constructor(){super(new un(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(e){const t=this.camera,n=ol*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 A8 extends kd{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 p8}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 $2=new st,vu=new j,fg=new j;class g8 extends dg{constructor(){super(new un(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new Ge(4,2),this._viewportCount=6,this._viewports=[new Ot(2,1,1,1),new Ot(0,1,1,1),new Ot(3,1,1,1),new Ot(1,1,1,1),new Ot(3,0,1,1),new Ot(1,0,1,1)],this._cubeDirections=[new j(1,0,0),new j(-1,0,0),new j(0,0,1),new j(0,0,-1),new j(0,1,0),new j(0,-1,0)],this._cubeUps=[new j(0,1,0),new j(0,1,0),new j(0,1,0),new j(0,1,0),new j(0,0,1),new j(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()),vu.setFromMatrixPosition(e.matrixWorld),n.position.copy(vu),fg.copy(n.position),fg.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt(fg),n.updateMatrixWorld(),i.makeTranslation(-vu.x,-vu.y,-vu.z),$2.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix($2)}}class m8 extends kd{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 g8}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 _8 extends dg{constructor(){super(new pu(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class ex extends kd{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 _8}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class yu{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 v8 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 c={};c.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",c.headers=this.requestHeader;const h=fetch(e,c).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 y8{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=tx(),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=tx();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function tx(){return(typeof performance>"u"?Date:performance).now()}const pg="\\[\\]\\.:\\/",E8=new RegExp("["+pg+"]","g"),Ag="[^"+pg+"]",x8="[^"+pg.replace("\\.","")+"]",w8=/((?:WC+[\/:])*)/.source.replace("WC",Ag),I8=/(WCOD+)?/.source.replace("WCOD",x8),C8=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Ag),S8=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Ag),M8=new RegExp("^"+w8+I8+C8+S8+"$"),T8=["material","materials","bones","map"];class B8{constructor(e,t,n){const i=n||Ut.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 Ut{constructor(e,t,n){this.path=t,this.parsedPath=n||Ut.parseTrackName(t),this.node=Ut.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 Ut.Composite(e,t,n):new Ut(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(E8,"")}static parseTrackName(e){const t=M8.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);T8.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 c=s[o];if(c.name===t||c.uuid===t)return c;const h=n(c.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=Ut.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 c=this.Versioning.None;this.targetObject=e,e.needsUpdate!==void 0?c=this.Versioning.NeedsUpdate:e.matrixWorldNeedsUpdate!==void 0&&(c=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][c]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}Ut.Composite=B8,Ut.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Ut.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},Ut.prototype.GetterByBindingType=[Ut.prototype._getValue_direct,Ut.prototype._getValue_array,Ut.prototype._getValue_arrayElement,Ut.prototype._getValue_toArray],Ut.prototype.SetterByBindingTypeAndVersioning=[[Ut.prototype._setValue_direct,Ut.prototype._setValue_direct_setNeedsUpdate,Ut.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[Ut.prototype._setValue_array,Ut.prototype._setValue_array_setNeedsUpdate,Ut.prototype._setValue_array_setMatrixWorldNeedsUpdate],[Ut.prototype._setValue_arrayElement,Ut.prototype._setValue_arrayElement_setNeedsUpdate,Ut.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[Ut.prototype._setValue_fromArray,Ut.prototype._setValue_fromArray_setNeedsUpdate,Ut.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class rx{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(Mr(t/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}const nx=new j,Qd=new j;class Cs{constructor(e=new j,t=new j){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){nx.subVectors(e,this.start),Qd.subVectors(this.end,this.start);const n=Qd.dot(Qd);let i=Qd.dot(nx)/n;return t&&(i=Mr(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:Vh}})),typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=Vh);const ix={type:"change"},gg={type:"start"},sx={type:"end"},Fd=new cu,ax=new Xi,b8=Math.cos(70*SA.DEG2RAD);class R8 extends so{constructor(e,t){super(),this.object=e,this.domElement=t,this.domElement.style.touchAction="none",this.enabled=!0,this.target=new j,this.cursor=new j,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:el.ROTATE,MIDDLE:el.DOLLY,RIGHT:el.PAN},this.touches={ONE:tl.ROTATE,TWO:tl.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 c.phi},this.getAzimuthalAngle=function(){return c.theta},this.getDistance=function(){return this.object.position.distanceTo(this.target)},this.listenToKeyEvents=function(V){V.addEventListener("keydown",Be),this._domElementKeyEvents=V},this.stopListenToKeyEvents=function(){this._domElementKeyEvents.removeEventListener("keydown",Be),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(ix),n.update(),s=i.NONE},this.update=function(){const V=new j,F=new Wi().setFromUnitVectors(e.up,new j(0,1,0)),ge=F.clone().invert(),_e=new j,ze=new Wi,Ne=new j,_t=2*Math.PI;return function(Dt=null){const Lt=n.object.position;V.copy(Lt).sub(n.target),V.applyQuaternion(F),c.setFromVector3(V),n.autoRotate&&s===i.NONE&&P(S(Dt)),n.enableDamping?(c.theta+=h.theta*n.dampingFactor,c.phi+=h.phi*n.dampingFactor):(c.theta+=h.theta,c.phi+=h.phi);let Mt=n.minAzimuthAngle,vt=n.maxAzimuthAngle;isFinite(Mt)&&isFinite(vt)&&(Mt<-Math.PI?Mt+=_t:Mt>Math.PI&&(Mt-=_t),vt<-Math.PI?vt+=_t:vt>Math.PI&&(vt-=_t),Mt<=vt?c.theta=Math.max(Mt,Math.min(vt,c.theta)):c.theta=c.theta>(Mt+vt)/2?Math.max(Mt,c.theta):Math.min(vt,c.theta)),c.phi=Math.max(n.minPolarAngle,Math.min(n.maxPolarAngle,c.phi)),c.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 hr=!1;if(n.zoomToCursor&&M||n.object.isOrthographicCamera)c.radius=Q(c.radius);else{const Vt=c.radius;c.radius=Q(c.radius*u),hr=Vt!=c.radius}if(V.setFromSpherical(c),V.applyQuaternion(ge),Lt.copy(n.target).add(V),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&&M){let Vt=null;if(n.object.isPerspectiveCamera){const _r=V.length();Vt=Q(_r*u);const bn=_r-Vt;n.object.position.addScaledVector(I,bn),n.object.updateMatrixWorld(),hr=!!bn}else if(n.object.isOrthographicCamera){const _r=new j(R.x,R.y,0);_r.unproject(n.object);const bn=n.object.zoom;n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/u)),n.object.updateProjectionMatrix(),hr=bn!==n.object.zoom;const qt=new j(R.x,R.y,0);qt.unproject(n.object),n.object.position.sub(qt).add(_r),n.object.updateMatrixWorld(),Vt=V.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):(Fd.origin.copy(n.object.position),Fd.direction.set(0,0,-1).transformDirection(n.object.matrix),Math.abs(n.object.up.dot(Fd.direction))<b8?e.lookAt(n.target):(ax.setFromNormalAndCoplanarPoint(n.object.up,n.target),Fd.intersectPlane(ax,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(),hr=!0)}return u=1,M=!1,hr||_e.distanceToSquared(n.object.position)>o||8*(1-ze.dot(n.object.quaternion))>o||Ne.distanceToSquared(n.target)>o?(n.dispatchEvent(ix),_e.copy(n.object.position),ze.copy(n.object.quaternion),Ne.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",Ce),n.domElement.removeEventListener("pointermove",Ae),n.domElement.removeEventListener("pointerup",me),n.domElement.getRootNode().removeEventListener("keydown",ve,{capture:!0}),n._domElementKeyEvents!==null&&(n._domElementKeyEvents.removeEventListener("keydown",Be),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,c=new rx,h=new rx;let u=1;const d=new j,A=new Ge,p=new Ge,g=new Ge,v=new Ge,E=new Ge,m=new Ge,_=new Ge,w=new Ge,x=new Ge,I=new j,R=new Ge;let M=!1;const T=[],D={};let b=!1;function S(V){return V!==null?2*Math.PI/60*n.autoRotateSpeed*V:2*Math.PI/60/60*n.autoRotateSpeed}function L(V){const F=Math.abs(V*.01);return Math.pow(.95,n.zoomSpeed*F)}function P(V){h.theta-=V}function N(V){h.phi-=V}const W=function(){const V=new j;return function(F,ge){V.setFromMatrixColumn(ge,0),V.multiplyScalar(-F),d.add(V)}}(),X=function(){const V=new j;return function(F,ge){n.screenSpacePanning===!0?V.setFromMatrixColumn(ge,1):(V.setFromMatrixColumn(ge,0),V.crossVectors(n.object.up,V)),V.multiplyScalar(F),d.add(V)}}(),K=function(){const V=new j;return function(F,ge){const _e=n.domElement;if(n.object.isPerspectiveCamera){const ze=n.object.position;V.copy(ze).sub(n.target);let Ne=V.length();Ne*=Math.tan(n.object.fov/2*Math.PI/180),W(2*F*Ne/_e.clientHeight,n.object.matrix),X(2*ge*Ne/_e.clientHeight,n.object.matrix)}else n.object.isOrthographicCamera?(W(F*(n.object.right-n.object.left)/n.object.zoom/_e.clientWidth,n.object.matrix),X(ge*(n.object.top-n.object.bottom)/n.object.zoom/_e.clientHeight,n.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),n.enablePan=!1)}}();function te(V){n.object.isPerspectiveCamera||n.object.isOrthographicCamera?u/=V:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function H(V){n.object.isPerspectiveCamera||n.object.isOrthographicCamera?u*=V:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function ee(V,F){if(!n.zoomToCursor)return;M=!0;const ge=n.domElement.getBoundingClientRect(),_e=V-ge.left,ze=F-ge.top,Ne=ge.width,_t=ge.height;R.x=_e/Ne*2-1,R.y=-(ze/_t)*2+1,I.set(R.x,R.y,1).unproject(n.object).sub(n.object.position).normalize()}function Q(V){return Math.max(n.minDistance,Math.min(n.maxDistance,V))}function z(V){A.set(V.clientX,V.clientY)}function Z(V){ee(V.clientX,V.clientX),_.set(V.clientX,V.clientY)}function re(V){v.set(V.clientX,V.clientY)}function G(V){p.set(V.clientX,V.clientY),g.subVectors(p,A).multiplyScalar(n.rotateSpeed);const F=n.domElement;P(2*Math.PI*g.x/F.clientHeight),N(2*Math.PI*g.y/F.clientHeight),A.copy(p),n.update()}function de(V){w.set(V.clientX,V.clientY),x.subVectors(w,_),x.y>0?te(L(x.y)):x.y<0&&H(L(x.y)),_.copy(w),n.update()}function pe(V){E.set(V.clientX,V.clientY),m.subVectors(E,v).multiplyScalar(n.panSpeed),K(m.x,m.y),v.copy(E),n.update()}function fe(V){ee(V.clientX,V.clientY),V.deltaY<0?H(L(V.deltaY)):V.deltaY>0&&te(L(V.deltaY)),n.update()}function ye(V){let F=!1;switch(V.code){case n.keys.UP:V.ctrlKey||V.metaKey||V.shiftKey?N(2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):K(0,n.keyPanSpeed),F=!0;break;case n.keys.BOTTOM:V.ctrlKey||V.metaKey||V.shiftKey?N(-2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):K(0,-n.keyPanSpeed),F=!0;break;case n.keys.LEFT:V.ctrlKey||V.metaKey||V.shiftKey?P(2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):K(n.keyPanSpeed,0),F=!0;break;case n.keys.RIGHT:V.ctrlKey||V.metaKey||V.shiftKey?P(-2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):K(-n.keyPanSpeed,0),F=!0;break}F&&(V.preventDefault(),n.update())}function Pe(V){if(T.length===1)A.set(V.pageX,V.pageY);else{const F=tt(V),ge=.5*(V.pageX+F.x),_e=.5*(V.pageY+F.y);A.set(ge,_e)}}function at(V){if(T.length===1)v.set(V.pageX,V.pageY);else{const F=tt(V),ge=.5*(V.pageX+F.x),_e=.5*(V.pageY+F.y);v.set(ge,_e)}}function se(V){const F=tt(V),ge=V.pageX-F.x,_e=V.pageY-F.y,ze=Math.sqrt(ge*ge+_e*_e);_.set(0,ze)}function et(V){n.enableZoom&&se(V),n.enablePan&&at(V)}function ke(V){n.enableZoom&&se(V),n.enableRotate&&Pe(V)}function dt(V){if(T.length==1)p.set(V.pageX,V.pageY);else{const ge=tt(V),_e=.5*(V.pageX+ge.x),ze=.5*(V.pageY+ge.y);p.set(_e,ze)}g.subVectors(p,A).multiplyScalar(n.rotateSpeed);const F=n.domElement;P(2*Math.PI*g.x/F.clientHeight),N(2*Math.PI*g.y/F.clientHeight),A.copy(p)}function Xe(V){if(T.length===1)E.set(V.pageX,V.pageY);else{const F=tt(V),ge=.5*(V.pageX+F.x),_e=.5*(V.pageY+F.y);E.set(ge,_e)}m.subVectors(E,v).multiplyScalar(n.panSpeed),K(m.x,m.y),v.copy(E)}function ft(V){const F=tt(V),ge=V.pageX-F.x,_e=V.pageY-F.y,ze=Math.sqrt(ge*ge+_e*_e);w.set(0,ze),x.set(0,Math.pow(w.y/_.y,n.zoomSpeed)),te(x.y),_.copy(w);const Ne=(V.pageX+F.x)*.5,_t=(V.pageY+F.y)*.5;ee(Ne,_t)}function Y(V){n.enableZoom&&ft(V),n.enablePan&&Xe(V)}function k(V){n.enableZoom&&ft(V),n.enableRotate&&dt(V)}function le(V){n.enabled!==!1&&(T.length===0&&(n.domElement.setPointerCapture(V.pointerId),n.domElement.addEventListener("pointermove",Ae),n.domElement.addEventListener("pointerup",me)),!ct(V)&&(nt(V),V.pointerType==="touch"?Ye(V):Ee(V)))}function Ae(V){n.enabled!==!1&&(V.pointerType==="touch"?Le(V):Oe(V))}function me(V){switch(pt(V),T.length){case 0:n.domElement.releasePointerCapture(V.pointerId),n.domElement.removeEventListener("pointermove",Ae),n.domElement.removeEventListener("pointerup",me),n.dispatchEvent(sx),s=i.NONE;break;case 1:const F=T[0],ge=D[F];Ye({pointerId:F,pageX:ge.x,pageY:ge.y});break}}function Ee(V){let F;switch(V.button){case 0:F=n.mouseButtons.LEFT;break;case 1:F=n.mouseButtons.MIDDLE;break;case 2:F=n.mouseButtons.RIGHT;break;default:F=-1}switch(F){case el.DOLLY:if(n.enableZoom===!1)return;Z(V),s=i.DOLLY;break;case el.ROTATE:if(V.ctrlKey||V.metaKey||V.shiftKey){if(n.enablePan===!1)return;re(V),s=i.PAN}else{if(n.enableRotate===!1)return;z(V),s=i.ROTATE}break;case el.PAN:if(V.ctrlKey||V.metaKey||V.shiftKey){if(n.enableRotate===!1)return;z(V),s=i.ROTATE}else{if(n.enablePan===!1)return;re(V),s=i.PAN}break;default:s=i.NONE}s!==i.NONE&&n.dispatchEvent(gg)}function Oe(V){switch(s){case i.ROTATE:if(n.enableRotate===!1)return;G(V);break;case i.DOLLY:if(n.enableZoom===!1)return;de(V);break;case i.PAN:if(n.enablePan===!1)return;pe(V);break}}function Ce(V){n.enabled===!1||n.enableZoom===!1||s!==i.NONE||(V.preventDefault(),n.dispatchEvent(gg),fe(Qe(V)),n.dispatchEvent(sx))}function Qe(V){const F=V.deltaMode,ge={clientX:V.clientX,clientY:V.clientY,deltaY:V.deltaY};switch(F){case 1:ge.deltaY*=16;break;case 2:ge.deltaY*=100;break}return V.ctrlKey&&!b&&(ge.deltaY*=10),ge}function ve(V){V.key==="Control"&&(b=!0,n.domElement.getRootNode().addEventListener("keyup",xe,{passive:!0,capture:!0}))}function xe(V){V.key==="Control"&&(b=!1,n.domElement.getRootNode().removeEventListener("keyup",xe,{passive:!0,capture:!0}))}function Be(V){n.enabled===!1||n.enablePan===!1||ye(V)}function Ye(V){switch(ut(V),T.length){case 1:switch(n.touches.ONE){case tl.ROTATE:if(n.enableRotate===!1)return;Pe(V),s=i.TOUCH_ROTATE;break;case tl.PAN:if(n.enablePan===!1)return;at(V),s=i.TOUCH_PAN;break;default:s=i.NONE}break;case 2:switch(n.touches.TWO){case tl.DOLLY_PAN:if(n.enableZoom===!1&&n.enablePan===!1)return;et(V),s=i.TOUCH_DOLLY_PAN;break;case tl.DOLLY_ROTATE:if(n.enableZoom===!1&&n.enableRotate===!1)return;ke(V),s=i.TOUCH_DOLLY_ROTATE;break;default:s=i.NONE}break;default:s=i.NONE}s!==i.NONE&&n.dispatchEvent(gg)}function Le(V){switch(ut(V),s){case i.TOUCH_ROTATE:if(n.enableRotate===!1)return;dt(V),n.update();break;case i.TOUCH_PAN:if(n.enablePan===!1)return;Xe(V),n.update();break;case i.TOUCH_DOLLY_PAN:if(n.enableZoom===!1&&n.enablePan===!1)return;Y(V),n.update();break;case i.TOUCH_DOLLY_ROTATE:if(n.enableZoom===!1&&n.enableRotate===!1)return;k(V),n.update();break;default:s=i.NONE}}function be(V){n.enabled!==!1&&V.preventDefault()}function nt(V){T.push(V.pointerId)}function pt(V){delete D[V.pointerId];for(let F=0;F<T.length;F++)if(T[F]==V.pointerId){T.splice(F,1);return}}function ct(V){for(let F=0;F<T.length;F++)if(T[F]==V.pointerId)return!0;return!1}function ut(V){let F=D[V.pointerId];F===void 0&&(F=new Ge,D[V.pointerId]=F),F.set(V.pageX,V.pageY)}function tt(V){const F=V.pointerId===T[0]?T[1]:T[0];return D[F]}n.domElement.addEventListener("contextmenu",be),n.domElement.addEventListener("pointerdown",le),n.domElement.addEventListener("pointercancel",me),n.domElement.addEventListener("wheel",Ce,{passive:!1}),n.domElement.getRootNode().addEventListener("keydown",ve,{passive:!0,capture:!0}),this.update()}}function ox(r,e){if(e===sb)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),r;if(e===wA||e===gE){let t=r.getIndex();if(t===null){const o=[],c=r.getAttribute("position");if(c!==void 0){for(let h=0;h<c.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===wA)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 D8 extends ca{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new k8(t)}),this.register(function(t){return new W8(t)}),this.register(function(t){return new Y8(t)}),this.register(function(t){return new q8(t)}),this.register(function(t){return new F8(t)}),this.register(function(t){return new O8(t)}),this.register(function(t){return new z8(t)}),this.register(function(t){return new H8(t)}),this.register(function(t){return new P8(t)}),this.register(function(t){return new G8(t)}),this.register(function(t){return new Q8(t)}),this.register(function(t){return new j8(t)}),this.register(function(t){return new V8(t)}),this.register(function(t){return new N8(t)}),this.register(function(t){return new X8(t)}),this.register(function(t){return new K8(t)})}load(e,t,n,i){const s=this;let o;if(this.resourcePath!=="")o=this.resourcePath;else if(this.path!==""){const u=yu.extractUrlBase(e);o=yu.resolveURL(u,this.path)}else o=yu.extractUrlBase(e);this.manager.itemStart(e);const c=function(u){i?i(u):console.error(u),s.manager.itemError(e),s.manager.itemEnd(e)},h=new Ll(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)},c)}catch(d){c(d)}},n,c)}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={},c={},h=new TextDecoder;if(typeof e=="string")s=JSON.parse(e);else if(e instanceof ArrayBuffer)if(h.decode(new Uint8Array(e,0,4))===lx){try{o[xt.KHR_BINARY_GLTF]=new J8(e)}catch(d){i&&i(d);return}s=JSON.parse(o[xt.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 uN(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"),c[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 xt.KHR_MATERIALS_UNLIT:o[A]=new U8;break;case xt.KHR_DRACO_MESH_COMPRESSION:o[A]=new Z8(s,this.dracoLoader);break;case xt.KHR_TEXTURE_TRANSFORM:o[A]=new $8;break;case xt.KHR_MESH_QUANTIZATION:o[A]=new eN;break;default:p.indexOf(A)>=0&&c[A]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+A+'".')}}u.setExtensions(o),u.setPlugins(c),u.parse(n,i)}parseAsync(e,t){const n=this;return new Promise(function(i,s){n.parse(e,t,i,s)})}}function L8(){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 xt={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 N8{constructor(e){this.parser=e,this.name=xt.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 c;const h=new Ke(16777215);o.color!==void 0&&h.setRGB(o.color[0],o.color[1],o.color[2],Sr);const u=o.range!==void 0?o.range:0;switch(o.type){case"directional":c=new ex(h),c.target.position.set(0,0,-1),c.add(c.target);break;case"point":c=new m8(h),c.distance=u;break;case"spot":c=new A8(h),c.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,c.angle=o.spot.outerConeAngle,c.penumbra=1-o.spot.innerConeAngle/o.spot.outerConeAngle,c.target.position.set(0,0,-1),c.add(c.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+o.type)}return c.position.set(0,0,0),c.decay=2,ha(c,o),o.intensity!==void 0&&(c.intensity=o.intensity),c.name=t.createUniqueName(o.name||"light_"+e),i=Promise.resolve(c),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 U8{constructor(){this.name=xt.KHR_MATERIALS_UNLIT}getMaterialType(){return xs}extendParams(e,t,n){const i=[];e.color=new Ke(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],Sr),e.opacity=o[3]}s.baseColorTexture!==void 0&&i.push(n.assignTexture(e,"map",s.baseColorTexture,Qr))}return Promise.all(i)}}class P8{constructor(e){this.parser=e,this.name=xt.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 k8{constructor(e){this.parser=e,this.name=xt.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:Li}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 c=o.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new Ge(c,c)}return Promise.all(s)}}class Q8{constructor(e){this.parser=e,this.name=xt.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:Li}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 F8{constructor(e){this.parser=e,this.name=xt.KHR_MATERIALS_SHEEN}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:Li}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 Ke(0,0,0),t.sheenRoughness=0,t.sheen=1;const o=i.extensions[this.name];if(o.sheenColorFactor!==void 0){const c=o.sheenColorFactor;t.sheenColor.setRGB(c[0],c[1],c[2],Sr)}return o.sheenRoughnessFactor!==void 0&&(t.sheenRoughness=o.sheenRoughnessFactor),o.sheenColorTexture!==void 0&&s.push(n.assignTexture(t,"sheenColorMap",o.sheenColorTexture,Qr)),o.sheenRoughnessTexture!==void 0&&s.push(n.assignTexture(t,"sheenRoughnessMap",o.sheenRoughnessTexture)),Promise.all(s)}}class O8{constructor(e){this.parser=e,this.name=xt.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:Li}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 z8{constructor(e){this.parser=e,this.name=xt.KHR_MATERIALS_VOLUME}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:Li}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 c=o.attenuationColor||[1,1,1];return t.attenuationColor=new Ke().setRGB(c[0],c[1],c[2],Sr),Promise.all(s)}}class H8{constructor(e){this.parser=e,this.name=xt.KHR_MATERIALS_IOR}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:Li}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 G8{constructor(e){this.parser=e,this.name=xt.KHR_MATERIALS_SPECULAR}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:Li}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 c=o.specularColorFactor||[1,1,1];return t.specularColor=new Ke().setRGB(c[0],c[1],c[2],Sr),o.specularColorTexture!==void 0&&s.push(n.assignTexture(t,"specularColorMap",o.specularColorTexture,Qr)),Promise.all(s)}}class V8{constructor(e){this.parser=e,this.name=xt.EXT_MATERIALS_BUMP}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:Li}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 j8{constructor(e){this.parser=e,this.name=xt.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:Li}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 W8{constructor(e){this.parser=e,this.name=xt.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 Y8{constructor(e){this.parser=e,this.name=xt.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],c=i.images[o.source];let h=n.textureLoader;if(c.uri){const u=n.options.manager.getHandler(c.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 q8{constructor(e){this.parser=e,this.name=xt.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],c=i.images[o.source];let h=n.textureLoader;if(c.uri){const u=n.options.manager.getHandler(c.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 X8{constructor(e){this.name=xt.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(c){const h=i.byteOffset||0,u=i.byteLength||0,d=i.count,A=i.byteStride,p=new Uint8Array(c,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 K8{constructor(e){this.name=xt.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!==ii.TRIANGLES&&h.mode!==ii.TRIANGLE_STRIP&&h.mode!==ii.TRIANGLE_FAN&&h.mode!==void 0)return null;const s=n.extensions[this.name].attributes,o=[],c={};for(const h in s)o.push(this.parser.getDependency("accessor",s[h]).then(u=>(c[h]=u,c[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 v=new st,E=new j,m=new Wi,_=new j(1,1,1),w=new YL(g.geometry,g.material,A);for(let x=0;x<A;x++)c.TRANSLATION&&E.fromBufferAttribute(c.TRANSLATION,x),c.ROTATION&&m.fromBufferAttribute(c.ROTATION,x),c.SCALE&&_.fromBufferAttribute(c.SCALE,x),w.setMatrixAt(x,v.compose(E,m,_));for(const x in c)if(x==="_COLOR_0"){const I=c[x];w.instanceColor=new ag(I.array,I.itemSize,I.normalized)}else x!=="TRANSLATION"&&x!=="ROTATION"&&x!=="SCALE"&&g.geometry.setAttribute(x,c[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 lx="glTF",Eu=12,cx={JSON:1313821514,BIN:5130562};class J8{constructor(e){this.name=xt.KHR_BINARY_GLTF,this.content=null,this.body=null;const t=new DataView(e,0,Eu),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!==lx)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-Eu,s=new DataView(e,Eu);let o=0;for(;o<i;){const c=s.getUint32(o,!0);o+=4;const h=s.getUint32(o,!0);if(o+=4,h===cx.JSON){const u=new Uint8Array(e,Eu+o,c);this.content=n.decode(u)}else if(h===cx.BIN){const u=Eu+o;this.body=e.slice(u,u+c)}o+=c}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class Z8{constructor(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=xt.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,c={},h={},u={};for(const d in o){const A=_g[d]||d.toLowerCase();c[A]=o[d]}for(const d in e.attributes){const A=_g[d]||d.toLowerCase();if(o[d]!==void 0){const p=n.accessors[e.attributes[d]],g=Nl[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 v in g.attributes){const E=g.attributes[v],m=h[v];m!==void 0&&(E.normalized=m)}A(g)},c,u,Sr,p)})})}}class $8{constructor(){this.name=xt.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 eN{constructor(){this.name=xt.KHR_MESH_QUANTIZATION}}class ux extends _u{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,c=this.valueSize,h=c*2,u=c*3,d=i-t,A=(n-t)/d,p=A*A,g=p*A,v=e*u,E=v-u,m=-2*g+3*p,_=g-p,w=1-m,x=_-p+A;for(let I=0;I!==c;I++){const R=o[E+I+c],M=o[E+I+h]*d,T=o[v+I+c],D=o[v+I]*d;s[I]=w*R+x*M+m*T+_*D}return s}}const tN=new Wi;class rN extends ux{interpolate_(e,t,n,i){const s=super.interpolate_(e,t,n,i);return tN.fromArray(s).normalize().toArray(s),s}}const ii={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},Nl={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},hx={9728:fr,9729:pr,9984:Vy,9985:qh,9986:Jc,9987:wi},dx={33071:xi,33648:Yh,10497:$s},mg={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},_g={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"},nN={CUBICSPLINE:void 0,LINEAR:sl,STEP:ru},vg={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function iN(r){return r.DefaultMaterial===void 0&&(r.DefaultMaterial=new ug({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:yi})),r.DefaultMaterial}function mo(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 sN(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=[],c=[],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;c.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(c),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 aN(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 oN(r){let e;const t=r.extensions&&r.extensions[xt.KHR_DRACO_MESH_COMPRESSION];if(t?e="draco:"+t.bufferView+":"+t.indices+":"+yg(t.attributes):e=r.indices+":"+yg(r.attributes)+":"+r.mode,r.targets!==void 0)for(let n=0,i=r.targets.length;n<i;n++)e+=":"+yg(r.targets[n]);return e}function yg(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 Eg(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 lN(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 cN=new st;class uN{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new L8,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 K2(this.options.manager):this.textureLoader=new v8(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new Ll(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 c={scene:o[0][i.scene||0],scenes:o[0],animations:o[1],cameras:o[2],asset:i.asset,parser:n,userData:{}};return mo(s,c,i),ha(c,i),Promise.all(n._invokeAll(function(h){return h.afterRoot&&h.afterRoot(c)})).then(function(){for(const h of c.scenes)h.updateMatrixWorld();e(c)})}).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 c=0,h=o.length;c<h;c++)e[o[c]].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,c)=>{const h=this.associations.get(o);h!=null&&this.associations.set(c,h);for(const[u,d]of o.children.entries())s(d,c.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[xt.KHR_BINARY_GLTF].body);const i=this.options;return new Promise(function(s,o){n.load(yu.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],c=Nl[i.componentType],h=i.normalized===!0,u=new c(i.count*o);return Promise.resolve(new Fr(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 c=o[0],h=mg[i.type],u=Nl[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,v=i.normalized===!0;let E,m;if(g&&g!==A){const _=Math.floor(p/g),w="InterleavedBuffer:"+i.bufferView+":"+i.componentType+":"+_+":"+i.count;let x=t.cache.get(w);x||(E=new u(c,_*g,i.count*g/d),x=new HL(E,g/d),t.cache.add(w,x)),m=new rg(x,h,p%g/d,v)}else c===null?E=new u(i.count*h):E=new u(c,p,i.count*h),m=new Fr(E,h,v);if(i.sparse!==void 0){const _=mg.SCALAR,w=Nl[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*_),M=new u(o[2],I,i.sparse.count*h);c!==null&&(m=new Fr(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,M[T*h]),h>=2&&m.setY(b,M[T*h+1]),h>=3&&m.setZ(b,M[T*h+2]),h>=4&&m.setW(b,M[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 c=n.manager.getHandler(s.uri);c!==null&&(o=c)}return this.loadTextureImage(e,i,o)}loadTextureImage(e,t,n){const i=this,s=this.json,o=s.textures[e],c=s.images[t],h=(c.uri||c.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||c.name||"",d.name===""&&typeof c.uri=="string"&&c.uri.startsWith("data:image/")===!1&&(d.name=c.uri);const A=(s.samplers||{})[o.sampler]||{};return d.magFilter=hx[A.magFilter]||pr,d.minFilter=hx[A.minFilter]||wi,d.wrapS=dx[A.wrapS]||$s,d.wrapT=dx[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],c=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=c.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 v=p;t.isImageBitmapLoader===!0&&(v=function(E){const m=new Tr(E);m.needsUpdate=!0,p(m)}),t.load(yu.resolveURL(A,s.path),v,void 0,g)})}).then(function(A){return u===!0&&c.revokeObjectURL(h),A.userData.mimeType=o.mimeType||lN(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[xt.KHR_TEXTURE_TRANSFORM]){const c=n.extensions!==void 0?n.extensions[xt.KHR_TEXTURE_TRANSFORM]:void 0;if(c){const h=s.associations.get(o);o=s.extensions[xt.KHR_TEXTURE_TRANSFORM].extendTexture(o,c),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 c="PointsMaterial:"+n.uuid;let h=this.cache.get(c);h||(h=new G2,qi.prototype.copy.call(h,n),h.color.copy(n.color),h.map=n.map,h.sizeAttenuation=!1,this.cache.add(c,h)),n=h}else if(e.isLine){const c="LineBasicMaterial:"+n.uuid;let h=this.cache.get(c);h||(h=new k2,qi.prototype.copy.call(h,n),h.color.copy(n.color),h.map=n.map,this.cache.add(c,h)),n=h}if(i||s||o){let c="ClonedMaterial:"+n.uuid+":";i&&(c+="derivative-tangents:"),s&&(c+="vertex-colors:"),o&&(c+="flat-shading:");let h=this.cache.get(c);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(c,h),this.associations.set(h,this.associations.get(n))),n=h}e.material=n}getMaterialType(){return ug}loadMaterial(e){const t=this,n=this.json,i=this.extensions,s=n.materials[e];let o;const c={},h=s.extensions||{},u=[];if(h[xt.KHR_MATERIALS_UNLIT]){const A=i[xt.KHR_MATERIALS_UNLIT];o=A.getMaterialType(),u.push(A.extendParams(c,s,t))}else{const A=s.pbrMetallicRoughness||{};if(c.color=new Ke(1,1,1),c.opacity=1,Array.isArray(A.baseColorFactor)){const p=A.baseColorFactor;c.color.setRGB(p[0],p[1],p[2],Sr),c.opacity=p[3]}A.baseColorTexture!==void 0&&u.push(t.assignTexture(c,"map",A.baseColorTexture,Qr)),c.metalness=A.metallicFactor!==void 0?A.metallicFactor:1,c.roughness=A.roughnessFactor!==void 0?A.roughnessFactor:1,A.metallicRoughnessTexture!==void 0&&(u.push(t.assignTexture(c,"metalnessMap",A.metallicRoughnessTexture)),u.push(t.assignTexture(c,"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,c)})))}s.doubleSided===!0&&(c.side=Ei);const d=s.alphaMode||vg.OPAQUE;if(d===vg.BLEND?(c.transparent=!0,c.depthWrite=!1):(c.transparent=!1,d===vg.MASK&&(c.alphaTest=s.alphaCutoff!==void 0?s.alphaCutoff:.5)),s.normalTexture!==void 0&&o!==xs&&(u.push(t.assignTexture(c,"normalMap",s.normalTexture)),c.normalScale=new Ge(1,1),s.normalTexture.scale!==void 0)){const A=s.normalTexture.scale;c.normalScale.set(A,A)}if(s.occlusionTexture!==void 0&&o!==xs&&(u.push(t.assignTexture(c,"aoMap",s.occlusionTexture)),s.occlusionTexture.strength!==void 0&&(c.aoMapIntensity=s.occlusionTexture.strength)),s.emissiveFactor!==void 0&&o!==xs){const A=s.emissiveFactor;c.emissive=new Ke().setRGB(A[0],A[1],A[2],Sr)}return s.emissiveTexture!==void 0&&o!==xs&&u.push(t.assignTexture(c,"emissiveMap",s.emissiveTexture,Qr)),Promise.all(u).then(function(){const A=new o(c);return s.name&&(A.name=s.name),ha(A,s),t.associations.set(A,{materials:e}),s.extensions&&mo(i,A,s),A})}createUniqueName(e){const t=Ut.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(c){return n[xt.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(c,t).then(function(h){return fx(h,c,t)})}const o=[];for(let c=0,h=e.length;c<h;c++){const u=e[c],d=oN(u),A=i[d];if(A)o.push(A.promise);else{let p;u.extensions&&u.extensions[xt.KHR_DRACO_MESH_COMPRESSION]?p=s(u):p=fx(new Gn,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,c=[];for(let h=0,u=o.length;h<u;h++){const d=o[h].material===void 0?iN(this.cache):this.getDependency("material",o[h].material);c.push(d)}return c.push(t.loadGeometries(o)),Promise.all(c).then(function(h){const u=h.slice(0,h.length-1),d=h[h.length-1],A=[];for(let g=0,v=d.length;g<v;g++){const E=d[g],m=o[g];let _;const w=u[g];if(m.mode===ii.TRIANGLES||m.mode===ii.TRIANGLE_STRIP||m.mode===ii.TRIANGLE_FAN||m.mode===void 0)_=s.isSkinnedMesh===!0?new VL(E,w):new Yr(E,w),_.isSkinnedMesh===!0&&_.normalizeSkinWeights(),m.mode===ii.TRIANGLE_STRIP?_.geometry=ox(_.geometry,gE):m.mode===ii.TRIANGLE_FAN&&(_.geometry=ox(_.geometry,wA));else if(m.mode===ii.LINES)_=new qL(E,w);else if(m.mode===ii.LINE_STRIP)_=new lg(E,w);else if(m.mode===ii.LINE_LOOP)_=new XL(E,w);else if(m.mode===ii.POINTS)_=new KL(E,w);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+m.mode);Object.keys(_.geometry.morphAttributes).length>0&&aN(_,s),_.name=t.createUniqueName(s.name||"mesh_"+e),ha(_,s),m.extensions&&mo(i,_,m),t.assignFinalMaterial(_),A.push(_)}for(let g=0,v=A.length;g<v;g++)t.associations.set(A[g],{meshes:e,primitives:g});if(A.length===1)return s.extensions&&mo(i,A[0],s),A[0];const p=new oa;s.extensions&&mo(i,p,s),t.associations.set(p,{meshes:e});for(let g=0,v=A.length;g<v;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 un(SA.radToDeg(i.yfov),i.aspectRatio||1,i.znear||1,i.zfar||2e6):n.type==="orthographic"&&(t=new pu(-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,c=[],h=[];for(let u=0,d=o.length;u<d;u++){const A=o[u];if(A){c.push(A);const p=new st;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 sg(c,h)})}loadAnimation(e){const t=this.json,n=this,i=t.animations[e],s=i.name?i.name:"animation_"+e,o=[],c=[],h=[],u=[],d=[];for(let A=0,p=i.channels.length;A<p;A++){const g=i.channels[A],v=i.samplers[g.sampler],E=g.target,m=E.node,_=i.parameters!==void 0?i.parameters[v.input]:v.input,w=i.parameters!==void 0?i.parameters[v.output]:v.output;E.node!==void 0&&(o.push(this.getDependency("node",m)),c.push(this.getDependency("accessor",_)),h.push(this.getDependency("accessor",w)),u.push(v),d.push(E))}return Promise.all([Promise.all(o),Promise.all(c),Promise.all(h),Promise.all(u),Promise.all(d)]).then(function(A){const p=A[0],g=A[1],v=A[2],E=A[3],m=A[4],_=[];for(let w=0,x=p.length;w<x;w++){const I=p[w],R=g[w],M=v[w],T=E[w],D=m[w];if(I===void 0)continue;I.updateMatrix&&I.updateMatrix();const b=n._createAnimationTracks(I,R,M,T,D);if(b)for(let S=0;S<b.length;S++)_.push(b[S])}return new a8(s,void 0,_)})}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(c){if(c.isMesh)for(let h=0,u=i.weights.length;h<u;h++)c.morphTargetInfluences[h]=i.weights[h]}),o})}loadNode(e){const t=this.json,n=this,i=t.nodes[e],s=n._loadNodeShallow(e),o=[],c=i.children||[];for(let u=0,d=c.length;u<d;u++)o.push(n.getDependency("node",c[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,cN)});for(let g=0,v=A.length;g<v;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):"",c=[],h=i._invokeOne(function(u){return u.createNodeMesh&&u.createNodeMesh(e)});return h&&c.push(h),s.camera!==void 0&&c.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){c.push(u)}),this.nodeCache[e]=Promise.all(c).then(function(u){let d;if(s.isBone===!0?d=new L2: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&&mo(n,d,s),s.matrix!==void 0){const A=new st;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&&mo(t,s,n);const o=n.nodes||[],c=[];for(let h=0,u=o.length;h<u;h++)c.push(i.getDependency("node",o[h]));return Promise.all(c).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 qi||p instanceof Tr)&&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=[],c=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(c);let u;switch(ua[s.path]){case ua.weights:u=bl;break;case ua.rotation:u=go;break;case ua.position:case ua.scale:u=Dl;break;default:switch(n.itemSize){case 1:u=bl;break;case 2:case 3:default:u=Dl;break}break}const d=i.interpolation!==void 0?nN[i.interpolation]:sl,A=this._getArrayFromAccessor(n);for(let p=0,g=h.length;p<g;p++){const v=new u(h[p]+"."+ua[s.path],t.array,A,d);i.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(v),o.push(v)}return o}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){const n=Eg(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 go?rN:ux;return new n(this.times,this.values,this.getValueSize()/3,t)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function hN(r,e,t){const n=e.attributes,i=new Er;if(n.POSITION!==void 0){const c=t.json.accessors[n.POSITION],h=c.min,u=c.max;if(h!==void 0&&u!==void 0){if(i.set(new j(h[0],h[1],h[2]),new j(u[0],u[1],u[2])),c.normalized){const d=Eg(Nl[c.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 c=new j,h=new j;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,v=p.max;if(g!==void 0&&v!==void 0){if(h.setX(Math.max(Math.abs(g[0]),Math.abs(v[0]))),h.setY(Math.max(Math.abs(g[1]),Math.abs(v[1]))),h.setZ(Math.max(Math.abs(g[2]),Math.abs(v[2]))),p.normalized){const E=Eg(Nl[p.componentType]);h.multiplyScalar(E)}c.max(h)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}i.expandByVector(c)}r.boundingBox=i;const o=new Bi;i.getCenter(o.center),o.radius=i.min.distanceTo(i.max)/2,r.boundingSphere=o}function fx(r,e,t){const n=e.attributes,i=[];function s(o,c){return t.getDependency("accessor",o).then(function(h){r.setAttribute(c,h)})}for(const o in n){const c=_g[o]||o.toLowerCase();c in r.attributes||i.push(s(n[o],c))}if(e.indices!==void 0&&!r.index){const o=t.getDependency("accessor",e.indices).then(function(c){r.setIndex(c)});i.push(o)}return Rt.workingColorSpace!==Sr&&"COLOR_0"in n&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${Rt.workingColorSpace}" not supported.`),ha(r,e),hN(r,e,t),Promise.all(i).then(function(){return e.targets!==void 0?sN(r,e.targets,t):r})}class dN{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,px=2,pN=1,Ax=2,AN=0,gN=1,mN=10,_N=0,gx=9,mx=15,_x=16,vx=22,yx=37,Ex=43,xx=76,wx=83,Ix=97,Cx=100,Sx=103,Mx=109,Tx=165,Bx=166;class vN{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 xu{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 dn=[171,75,84,88,32,50,48,187,13,10,26,10];function bx(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,dn.length);if(e[0]!==dn[0]||e[1]!==dn[1]||e[2]!==dn[2]||e[3]!==dn[3]||e[4]!==dn[4]||e[5]!==dn[5]||e[6]!==dn[6]||e[7]!==dn[7]||e[8]!==dn[8]||e[9]!==dn[9]||e[10]!==dn[10]||e[11]!==dn[11])throw new Error("Missing KTX 2.0 identifier.");const t=new vN,n=17*Uint32Array.BYTES_PER_ELEMENT,i=new xu(r,dn.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(),c=i._nextUint32(),h=i._nextUint32(),u=i._nextUint32(),d=i._nextUint64(),A=i._nextUint64(),p=new xu(r,dn.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 xu(r,o,c,!0),v={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=(v.descriptorBlockSize/4-6)/4;for(let te=0;te<E;te++){const H={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&H.channelType?(H.sampleLower=g._nextInt32(),H.sampleUpper=g._nextInt32()):(H.sampleLower=g._nextUint32(),H.sampleUpper=g._nextUint32()),v.samples[te]=H}t.dataFormatDescriptor.length=0,t.dataFormatDescriptor.push(v);const m=new xu(r,h,u,!0);for(;m._offset<u;){const te=m._nextUint32(),H=m._scan(te),ee=bx(H),Q=m._scan(te-H.byteLength);t.keyValue[ee]=ee.match(/^ktx/i)?bx(Q):Q,m._offset%4&&m._skip(4-m._offset%4)}if(A<=0)return t;const _=new xu(r,d,A,!0),w=_._nextUint16(),x=_._nextUint16(),I=_._nextUint32(),R=_._nextUint32(),M=_._nextUint32(),T=_._nextUint32(),D=[];for(let te=0;te<s;te++)D.push({imageFlags:_._nextUint32(),rgbSliceByteOffset:_._nextUint32(),rgbSliceByteLength:_._nextUint32(),alphaSliceByteOffset:_._nextUint32(),alphaSliceByteLength:_._nextUint32()});const b=d+_._offset,S=b+I,L=S+R,P=L+M,N=new Uint8Array(r.buffer,r.byteOffset+b,I),W=new Uint8Array(r.buffer,r.byteOffset+S,R),X=new Uint8Array(r.buffer,r.byteOffset+L,M),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 xg,Ss,wg;const Ig={env:{emscripten_notify_memory_growth:function(r){wg=new Uint8Array(Ss.exports.memory.buffer)}}};class EN{init(){return xg||(xg=typeof fetch<"u"?fetch("data:application/wasm;base64,"+Rx).then(e=>e.arrayBuffer()).then(e=>WebAssembly.instantiate(e,Ig)).then(this._init):WebAssembly.instantiate(Buffer.from(Rx,"base64"),Ig).then(this._init),xg)}_init(e){Ss=e.instance,Ig.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);wg.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),c=wg.slice(s,s+o);return Ss.exports.free(i),Ss.exports.free(s),c}}const Rx="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/AX4CJwEDZW52H2Vtc2NyaXB0ZW5fbm90aWZ5X21lbW9yeV9ncm93dGgABANpaAEFAAAFAgEFCwACAQABAgIFBQcAAwABDgsBAQcAEhMHAAUBDAQEAAANBwQCAgYCBAgDAwMDBgEACQkHBgICAAYGAgQUBwYGAwIGAAMCAQgBBwUGCgoEEQAEBAEIAwgDBQgDEA8IAAcABAUBcAECAgUEAQCAAgYJAX8BQaCgwAILB2AHBm1lbW9yeQIABm1hbGxvYwAoBGZyZWUAJgxaU1REX2lzRXJyb3IAaBlaU1REX2ZpbmREZWNvbXByZXNzZWRTaXplAFQPWlNURF9kZWNvbXByZXNzAEoGX3N0YXJ0ACQJBwEAQQELASQKussBaA8AIAAgACgCBCABajYCBAsZACAAKAIAIAAoAgRBH3F0QQAgAWtBH3F2CwgAIABBiH9LC34BBH9BAyEBIAAoAgQiA0EgTQRAIAAoAggiASA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gBE8NAQNAIAIgASgCADYCACABQQRqIQEgAkEEaiICIARJDQALDAELIANBBEkEQCAAIQIMAQsgA0F8aiIEIABJBEAgACECDAELIAAhAgNAIAIgAS0AADoAACACIAEtAAE6AAEgAiABLQACOgACIAIgAS0AAzoAAyABQQRqIQEgAkEEaiICIARNDQALCyACIANJBEADQCACIAEtAAA6AAAgAUEBaiEBIAJBAWoiAiADRw0ACwsgAAsMACAAIAEpAAA3AAALQQECfyAAKAIIIgEgACgCEEkEQEEDDwsgACAAKAIEIgJBB3E2AgQgACABIAJBA3ZrIgE2AgggACABKAAANgIAQQALDAAgACABKAIANgAAC/cCAQJ/AkAgACABRg0AAkAgASACaiAASwRAIAAgAmoiBCABSw0BCyAAIAEgAhALDwsgACABc0EDcSEDAkACQCAAIAFJBEAgAwRAIAAhAwwDCyAAQQNxRQRAIAAhAwwCCyAAIQMDQCACRQ0EIAMgAS0AADoAACABQQFqIQEgAkF/aiECIANBAWoiA0EDcQ0ACwwBCwJAIAMNACAEQQNxBEADQCACRQ0FIAAgAkF/aiICaiIDIAEgAmotAAA6AAAgA0EDcQ0ACwsgAkEDTQ0AA0AgACACQXxqIgJqIAEgAmooAgA2AgAgAkEDSw0ACwsgAkUNAgNAIAAgAkF/aiICaiABIAJqLQAAOgAAIAINAAsMAgsgAkEDTQ0AIAIhBANAIAMgASgCADYCACABQQRqIQEgA0EEaiEDIARBfGoiBEEDSw0ACyACQQNxIQILIAJFDQADQCADIAEtAAA6AAAgA0EBaiEDIAFBAWohASACQX9qIgINAAsLIAAL8wICAn8BfgJAIAJFDQAgACACaiIDQX9qIAE6AAAgACABOgAAIAJBA0kNACADQX5qIAE6AAAgACABOgABIANBfWogAToAACAAIAE6AAIgAkEHSQ0AIANBfGogAToAACAAIAE6AAMgAkEJSQ0AIABBACAAa0EDcSIEaiIDIAFB/wFxQYGChAhsIgE2AgAgAyACIARrQXxxIgRqIgJBfGogATYCACAEQQlJDQAgAyABNgIIIAMgATYCBCACQXhqIAE2Ag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DgiAA0AAkACQEGEICgCACIARQ0AIAAoAgAiA0EBcQ0AIAAgA0EBcjYCACADQQF2QXhqIgFBCCABQQhLG2dBH3NBAnRBgB9qIgEoAgAgAEEIakYEQCABIAAoAgw2AgALIAAoAggiAQRAIAEgACgCDDYCBAsgACgCDCIBBEAgASAAKAIINgIACyACECchAkEAIQFBhCAoAgAhACACDQEgACAAKAIAQX5xNgIAQQAPCyACQQ9qQXhxIgMQHSICQX9GDQIgAkEHakF4cSIAIAJHBEAgACACaxAdQX9GDQMLAkBBhCAoAgAiAUUEQEGAICAANgIADAELIAAgATYCBAtBhCAgADYCACAAIANBAXRBAXI2AgAMAQsgAEUNAQsgAEEIaiEBCyABC7kDAQJ/IAAgA2ohBQJAIANBB0wEQANAIAAgBU8NAiAAIAItAAA6AAAgAEEBaiEAIAJBAWohAgwAAAsACyAEQQFGBEACQCAAIAJrIgZBB00EQCAAIAItAAA6AAAgACACLQABOgABIAAgAi0AAjoAAiAAIAItAAM6AAMgAEEEaiACIAZBAnQiBkHAHmooAgBqIgIQFyACIAZB4B5qKAIAayECDAELIAAgAhAMCyACQQhqIQIgAEEIaiEACwJAAkACQAJAIAUgAU0EQCAAIANqIQEgBEEBRyAAIAJrQQ9Kcg0BA0AgACACEAwgAkEIaiECIABBCGoiACABSQ0ACwwFCyAAIAFLBEAgACEBDAQLIARBAUcgACACa0EPSnINASAAIQMgAiEEA0AgAyAEEAwgBEEIaiEEIANBCGoiAyABSQ0ACwwCCwNAIAAgAhAHIAJBEGohAiAAQRBqIgAgAUkNAAsMAwsgACEDIAIhBANAIAMgBBAHIARBEGohBCADQRBqIgMgAUkNAAsLIAIgASAAa2ohAgsDQCABIAVPDQEgASACLQAAOgAAIAFBAWohASACQQFqIQIMAAALAAsLQQECfyAAIAAoArjgASIDNgLE4AEgACgCvOABIQQgACABNgK84AEgACABIAJqNgK44AEgACABIAQgA2tqNgLA4AELpgEBAX8gACAAKALs4QEQFjYCyOABIABCADcD+OABIABCADcDuOABIABB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VBfWohBgJAIAMvAQIEQCAEQRhqIAEgAhAGIgIQAw0BIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahASOgAAIAMgBEEIaiAEQRhqEBI6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0FIAEgBEEQaiAEQRhqEBI6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBSABIARBCGogBEEYahASOgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEjoAACABIAJqIABrIQIMAwsgAyAEQRBqIARBGGoQEjoAAiADIARBCGogBEEYahASOgADIANBBGohAwwAAAsACyAEQRhqIAEgAhAGIgIQAw0AIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahAROgAAIAMgBEEIaiAEQRhqEBE6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0EIAEgBEEQaiAEQRhqEBE6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBCABIARBCGogBEEYahAROgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEToAACABIAJqIABrIQIMAgsgAyAEQRBqIARBGGoQEToAAiADIARBCGogBEEYahAROgADIANBBGohAwwAAAsACyAEQTBqJAAgAgtpAQF/An8CQAJAIAJBB00NACABKAAAQbfIwuF+Rw0AIAAgASgABDYCmOIBQWIgAEEQaiABIAIQPiIDEAMNAhogAEKBgICAEDcDiOEBIAAgASADaiACIANrECoMAQsgACABIAIQKgtBAAsLrQMBBn8jAEGAAWsiAyQAQWIhCAJAIAJBCUkNACAAQZjQAGogAUEIaiIEIAJBeGogAEGY0AAQMyIFEAMiBg0AIANBHzYC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iAhADRQ0BQn4PCyAAIAEQVSIEQn1WDQMgBCAFfCIFIARUIQJCfiEEIAINAyAAIAEQUiICEAMNAwsgASACayEBIAAgAmohAAwBCwtCfiAFIAEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQQh2QQFxIQIgAEEANgLg4gEgACACNgKM4gEgAUEgaiQAC3YBA38jAEEwayIBJAAgAARAIAEgAEHE0AFqIgIoAgA2AiggASAAKQK80AE3AyAgACgCACEDIAEgAigCADYCGCABIAApArzQATcDECADIAFBEGoQGyABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALzAEBAX8gACABKAK00AE2ApjiASAAIAEoAgQiAjYCwOABIAAgAjYCvOABIAAgAiABKAIIaiICNgK44AEgACACNgLE4AEgASgCuN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AAAAGDgAAAAAAAAYRAAAAAAAABhQAAAAAAAAGFwAAAAAAAAYaAAAAAAAABh0AAAAAAAAGIAAAAAAAEAYDAAEAAAAPBgOAAAAAAA4GA0AAAAAADQYDIAAAAAAMBgMQAAAAAAsGAwgAAAAACgYDBABBpB0L2QEBAAAAAwAAAAcAAAAPAAAAHwAAAD8AAAB/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",Cg=new WeakMap;let Sg=0,Mg;class Zi extends ca{constructor(e){super(e),this.transcoderPath="",this.transcoderBinary=null,this.transcoderPending=null,this.workerPool=new dN,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 Ll(this.manager);e.setPath(this.transcoderPath),e.setWithCredentials(this.withCredentials);const t=e.loadAsync("basis_transcoder.js"),n=new Ll(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 c=Zi.BasisWorker.toString(),h=["/* constants */","let _EngineFormat = "+JSON.stringify(Zi.EngineFormat),"let _TranscoderFormat = "+JSON.stringify(Zi.TranscoderFormat),"let _BasisFormat = "+JSON.stringify(Zi.BasisFormat),"/* basis_transcoder.js */",s,"/* worker */",c.substring(c.indexOf("{")+1,c.lastIndexOf("}"))].join(`
3828
+ }`;class UL{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,n){if(this.texture===null){const i=new Tr,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 En({vertexShader:LL,fragmentShader:NL,uniforms:{depthColor:{value:this.texture},depthWidth:{value:n.z},depthHeight:{value:n.w}}});this.mesh=new Yr(new fu(20,20),i)}e.render(this.mesh,t)}}reset(){this.texture=null,this.mesh=null}}class PL extends so{constructor(e,t){super();const n=this;let i=null,s=1,o=null,c="local-floor",h=1,u=null,d=null,A=null,p=null,g=null,v=null;const E=new UL,m=t.getContextAttributes();let _=null,w=null;const x=[],I=[],R=new Ge;let M=null;const T=new un;T.layers.enable(1),T.viewport=new Ot;const D=new un;D.layers.enable(2),D.viewport=new Ot;const b=[T,D],S=new RL;S.layers.enable(1),S.layers.enable(2);let L=null,P=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(G){let de=x[G];return de===void 0&&(de=new tg,x[G]=de),de.getTargetRaySpace()},this.getControllerGrip=function(G){let de=x[G];return de===void 0&&(de=new tg,x[G]=de),de.getGripSpace()},this.getHand=function(G){let de=x[G];return de===void 0&&(de=new tg,x[G]=de),de.getHandSpace()};function N(G){const de=I.indexOf(G.inputSource);if(de===-1)return;const pe=x[de];pe!==void 0&&(pe.update(G.inputSource,G.frame,u||o),pe.dispatchEvent({type:G.type,data:G.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 G=0;G<x.length;G++){const de=I[G];de!==null&&(I[G]=null,x[G].disconnect(de))}L=null,P=null,E.reset(),e.setRenderTarget(_),g=null,p=null,A=null,i=null,w=null,re.stop(),n.isPresenting=!1,e.setPixelRatio(M),e.setSize(R.width,R.height,!1),n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(G){s=G,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(G){c=G,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return u||o},this.setReferenceSpace=function(G){u=G},this.getBaseLayer=function(){return p!==null?p:g},this.getBinding=function(){return A},this.getFrame=function(){return v},this.getSession=function(){return i},this.setSession=async function(G){if(i=G,i!==null){if(_=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(),M=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 Mi(g.framebufferWidth,g.framebufferHeight,{format:gr,type:Ar,colorSpace:e.outputColorSpace,stencilBuffer:m.stencil})}else{let de=null,pe=null,fe=null;m.depth&&(fe=m.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,de=m.stencil?eu:il,pe=m.stencil?$c:Ii);const ye={colorFormat:t.RGBA8,depthFormat:fe,scaleFactor:s};A=new XRWebGLBinding(i,t),p=A.createProjectionLayer(ye),i.updateRenderState({layers:[p]}),e.setPixelRatio(1),e.setSize(p.textureWidth,p.textureHeight,!1),w=new Mi(p.textureWidth,p.textureHeight,{format:gr,type:Ar,depthTexture:new a2(p.textureWidth,p.textureHeight,pe,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 Pe=e.properties.get(w);Pe.__ignoreDepthValues=p.ignoreDepthValues}w.isXRRenderTarget=!0,this.setFoveation(h),u=null,o=await i.requestReferenceSpace(c),re.setContext(i),re.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(i!==null)return i.environmentBlendMode};function X(G){for(let de=0;de<G.removed.length;de++){const pe=G.removed[de],fe=I.indexOf(pe);fe>=0&&(I[fe]=null,x[fe].disconnect(pe))}for(let de=0;de<G.added.length;de++){const pe=G.added[de];let fe=I.indexOf(pe);if(fe===-1){for(let Pe=0;Pe<x.length;Pe++)if(Pe>=I.length){I.push(pe),fe=Pe;break}else if(I[Pe]===null){I[Pe]=pe,fe=Pe;break}if(fe===-1)break}const ye=x[fe];ye&&ye.connect(pe)}}const K=new j,te=new j;function H(G,de,pe){K.setFromMatrixPosition(de.matrixWorld),te.setFromMatrixPosition(pe.matrixWorld);const fe=K.distanceTo(te),ye=de.projectionMatrix.elements,Pe=pe.projectionMatrix.elements,at=ye[14]/(ye[10]-1),se=ye[14]/(ye[10]+1),et=(ye[9]+1)/ye[5],ke=(ye[9]-1)/ye[5],dt=(ye[8]-1)/ye[0],Xe=(Pe[8]+1)/Pe[0],ft=at*dt,Y=at*Xe,k=fe/(-dt+Xe),le=k*-dt;de.matrixWorld.decompose(G.position,G.quaternion,G.scale),G.translateX(le),G.translateZ(k),G.matrixWorld.compose(G.position,G.quaternion,G.scale),G.matrixWorldInverse.copy(G.matrixWorld).invert();const Ae=at+k,me=se+k,Ee=ft-le,Oe=Y+(fe-le),Ce=et*se/me*Ae,Qe=ke*se/me*Ae;G.projectionMatrix.makePerspective(Ee,Oe,Ce,Qe,Ae,me),G.projectionMatrixInverse.copy(G.projectionMatrix).invert()}function ee(G,de){de===null?G.matrixWorld.copy(G.matrix):G.matrixWorld.multiplyMatrices(de.matrixWorld,G.matrix),G.matrixWorldInverse.copy(G.matrixWorld).invert()}this.updateCamera=function(G){if(i===null)return;E.texture!==null&&(G.near=E.depthNear,G.far=E.depthFar),S.near=D.near=T.near=G.near,S.far=D.far=T.far=G.far,(L!==S.near||P!==S.far)&&(i.updateRenderState({depthNear:S.near,depthFar:S.far}),L=S.near,P=S.far,T.near=L,T.far=P,D.near=L,D.far=P,T.updateProjectionMatrix(),D.updateProjectionMatrix(),G.updateProjectionMatrix());const de=G.parent,pe=S.cameras;ee(S,de);for(let fe=0;fe<pe.length;fe++)ee(pe[fe],de);pe.length===2?H(S,T,D):S.projectionMatrix.copy(T.projectionMatrix),Q(G,S,de)};function Q(G,de,pe){pe===null?G.matrix.copy(de.matrixWorld):(G.matrix.copy(pe.matrixWorld),G.matrix.invert(),G.matrix.multiply(de.matrixWorld)),G.matrix.decompose(G.position,G.quaternion,G.scale),G.updateMatrixWorld(!0),G.projectionMatrix.copy(de.projectionMatrix),G.projectionMatrixInverse.copy(de.projectionMatrixInverse),G.isPerspectiveCamera&&(G.fov=ol*2*Math.atan(1/G.projectionMatrix.elements[5]),G.zoom=1)}this.getCamera=function(){return S},this.getFoveation=function(){if(!(p===null&&g===null))return h},this.setFoveation=function(G){h=G,p!==null&&(p.fixedFoveation=G),g!==null&&g.fixedFoveation!==void 0&&(g.fixedFoveation=G)},this.hasDepthSensing=function(){return E.texture!==null};let z=null;function Z(G,de){if(d=de.getViewerPose(u||o),v=de,d!==null){const pe=d.views;g!==null&&(e.setRenderTargetFramebuffer(w,g.framebuffer),e.setRenderTarget(w));let fe=!1;pe.length!==S.cameras.length&&(S.cameras.length=0,fe=!0);for(let Pe=0;Pe<pe.length;Pe++){const at=pe[Pe];let se=null;if(g!==null)se=g.getViewport(at);else{const ke=A.getViewSubImage(p,at);se=ke.viewport,Pe===0&&(e.setRenderTargetTextures(w,ke.colorTexture,p.ignoreDepthValues?void 0:ke.depthStencilTexture),e.setRenderTarget(w))}let et=b[Pe];et===void 0&&(et=new un,et.layers.enable(Pe),et.viewport=new Ot,b[Pe]=et),et.matrix.fromArray(at.transform.matrix),et.matrix.decompose(et.position,et.quaternion,et.scale),et.projectionMatrix.fromArray(at.projectionMatrix),et.projectionMatrixInverse.copy(et.projectionMatrix).invert(),et.viewport.set(se.x,se.y,se.width,se.height),Pe===0&&(S.matrix.copy(et.matrix),S.matrix.decompose(S.position,S.quaternion,S.scale)),fe===!0&&S.cameras.push(et)}const ye=i.enabledFeatures;if(ye&&ye.includes("depth-sensing")){const Pe=A.getDepthInformation(pe[0]);Pe&&Pe.isValid&&Pe.texture&&E.init(e,Pe,i.renderState)}}for(let pe=0;pe<x.length;pe++){const fe=I[pe],ye=x[pe];fe!==null&&ye!==void 0&&ye.update(fe,de,u||o)}E.render(e,S),z&&z(G,de),de.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:de}),v=null}const re=new ZE;re.setAnimationLoop(Z),this.setAnimationLoop=function(G){z=G},this.dispose=function(){}}}const po=new Yi,kL=new st;function QL(r,e){function t(m,_){m.matrixAutoUpdate===!0&&m.updateMatrix(),_.value.copy(m.matrix)}function n(m,_){_.color.getRGB(m.fogColor.value,YE(r)),_.isFog?(m.fogNear.value=_.near,m.fogFar.value=_.far):_.isFogExp2&&(m.fogDensity.value=_.density)}function i(m,_,w,x,I){_.isMeshBasicMaterial||_.isMeshLambertMaterial?s(m,_):_.isMeshToonMaterial?(s(m,_),A(m,_)):_.isMeshPhongMaterial?(s(m,_),d(m,_)):_.isMeshStandardMaterial?(s(m,_),p(m,_),_.isMeshPhysicalMaterial&&g(m,_,I)):_.isMeshMatcapMaterial?(s(m,_),v(m,_)):_.isMeshDepthMaterial?s(m,_):_.isMeshDistanceMaterial?(s(m,_),E(m,_)):_.isMeshNormalMaterial?s(m,_):_.isLineBasicMaterial?(o(m,_),_.isLineDashedMaterial&&c(m,_)):_.isPointsMaterial?h(m,_,w,x):_.isSpriteMaterial?u(m,_):_.isShadowMaterial?(m.color.value.copy(_.color),m.opacity.value=_.opacity):_.isShaderMaterial&&(_.uniformsNeedUpdate=!1)}function s(m,_){m.opacity.value=_.opacity,_.color&&m.diffuse.value.copy(_.color),_.emissive&&m.emissive.value.copy(_.emissive).multiplyScalar(_.emissiveIntensity),_.map&&(m.map.value=_.map,t(_.map,m.mapTransform)),_.alphaMap&&(m.alphaMap.value=_.alphaMap,t(_.alphaMap,m.alphaMapTransform)),_.bumpMap&&(m.bumpMap.value=_.bumpMap,t(_.bumpMap,m.bumpMapTransform),m.bumpScale.value=_.bumpScale,_.side===kr&&(m.bumpScale.value*=-1)),_.normalMap&&(m.normalMap.value=_.normalMap,t(_.normalMap,m.normalMapTransform),m.normalScale.value.copy(_.normalScale),_.side===kr&&m.normalScale.value.negate()),_.displacementMap&&(m.displacementMap.value=_.displacementMap,t(_.displacementMap,m.displacementMapTransform),m.displacementScale.value=_.displacementScale,m.displacementBias.value=_.displacementBias),_.emissiveMap&&(m.emissiveMap.value=_.emissiveMap,t(_.emissiveMap,m.emissiveMapTransform)),_.specularMap&&(m.specularMap.value=_.specularMap,t(_.specularMap,m.specularMapTransform)),_.alphaTest>0&&(m.alphaTest.value=_.alphaTest);const w=e.get(_),x=w.envMap,I=w.envMapRotation;if(x&&(m.envMap.value=x,po.copy(I),po.x*=-1,po.y*=-1,po.z*=-1,x.isCubeTexture&&x.isRenderTargetTexture===!1&&(po.y*=-1,po.z*=-1),m.envMapRotation.value.setFromMatrix4(kL.makeRotationFromEuler(po)),m.flipEnvMap.value=x.isCubeTexture&&x.isRenderTargetTexture===!1?-1:1,m.reflectivity.value=_.reflectivity,m.ior.value=_.ior,m.refractionRatio.value=_.refractionRatio),_.lightMap){m.lightMap.value=_.lightMap;const R=r._useLegacyLights===!0?Math.PI:1;m.lightMapIntensity.value=_.lightMapIntensity*R,t(_.lightMap,m.lightMapTransform)}_.aoMap&&(m.aoMap.value=_.aoMap,m.aoMapIntensity.value=_.aoMapIntensity,t(_.aoMap,m.aoMapTransform))}function o(m,_){m.diffuse.value.copy(_.color),m.opacity.value=_.opacity,_.map&&(m.map.value=_.map,t(_.map,m.mapTransform))}function c(m,_){m.dashSize.value=_.dashSize,m.totalSize.value=_.dashSize+_.gapSize,m.scale.value=_.scale}function h(m,_,w,x){m.diffuse.value.copy(_.color),m.opacity.value=_.opacity,m.size.value=_.size*w,m.scale.value=x*.5,_.map&&(m.map.value=_.map,t(_.map,m.uvTransform)),_.alphaMap&&(m.alphaMap.value=_.alphaMap,t(_.alphaMap,m.alphaMapTransform)),_.alphaTest>0&&(m.alphaTest.value=_.alphaTest)}function u(m,_){m.diffuse.value.copy(_.color),m.opacity.value=_.opacity,m.rotation.value=_.rotation,_.map&&(m.map.value=_.map,t(_.map,m.mapTransform)),_.alphaMap&&(m.alphaMap.value=_.alphaMap,t(_.alphaMap,m.alphaMapTransform)),_.alphaTest>0&&(m.alphaTest.value=_.alphaTest)}function d(m,_){m.specular.value.copy(_.specular),m.shininess.value=Math.max(_.shininess,1e-4)}function A(m,_){_.gradientMap&&(m.gradientMap.value=_.gradientMap)}function p(m,_){m.metalness.value=_.metalness,_.metalnessMap&&(m.metalnessMap.value=_.metalnessMap,t(_.metalnessMap,m.metalnessMapTransform)),m.roughness.value=_.roughness,_.roughnessMap&&(m.roughnessMap.value=_.roughnessMap,t(_.roughnessMap,m.roughnessMapTransform)),_.envMap&&(m.envMapIntensity.value=_.envMapIntensity)}function g(m,_,w){m.ior.value=_.ior,_.sheen>0&&(m.sheenColor.value.copy(_.sheenColor).multiplyScalar(_.sheen),m.sheenRoughness.value=_.sheenRoughness,_.sheenColorMap&&(m.sheenColorMap.value=_.sheenColorMap,t(_.sheenColorMap,m.sheenColorMapTransform)),_.sheenRoughnessMap&&(m.sheenRoughnessMap.value=_.sheenRoughnessMap,t(_.sheenRoughnessMap,m.sheenRoughnessMapTransform))),_.clearcoat>0&&(m.clearcoat.value=_.clearcoat,m.clearcoatRoughness.value=_.clearcoatRoughness,_.clearcoatMap&&(m.clearcoatMap.value=_.clearcoatMap,t(_.clearcoatMap,m.clearcoatMapTransform)),_.clearcoatRoughnessMap&&(m.clearcoatRoughnessMap.value=_.clearcoatRoughnessMap,t(_.clearcoatRoughnessMap,m.clearcoatRoughnessMapTransform)),_.clearcoatNormalMap&&(m.clearcoatNormalMap.value=_.clearcoatNormalMap,t(_.clearcoatNormalMap,m.clearcoatNormalMapTransform),m.clearcoatNormalScale.value.copy(_.clearcoatNormalScale),_.side===kr&&m.clearcoatNormalScale.value.negate())),_.iridescence>0&&(m.iridescence.value=_.iridescence,m.iridescenceIOR.value=_.iridescenceIOR,m.iridescenceThicknessMinimum.value=_.iridescenceThicknessRange[0],m.iridescenceThicknessMaximum.value=_.iridescenceThicknessRange[1],_.iridescenceMap&&(m.iridescenceMap.value=_.iridescenceMap,t(_.iridescenceMap,m.iridescenceMapTransform)),_.iridescenceThicknessMap&&(m.iridescenceThicknessMap.value=_.iridescenceThicknessMap,t(_.iridescenceThicknessMap,m.iridescenceThicknessMapTransform))),_.transmission>0&&(m.transmission.value=_.transmission,m.transmissionSamplerMap.value=w.texture,m.transmissionSamplerSize.value.set(w.width,w.height),_.transmissionMap&&(m.transmissionMap.value=_.transmissionMap,t(_.transmissionMap,m.transmissionMapTransform)),m.thickness.value=_.thickness,_.thicknessMap&&(m.thicknessMap.value=_.thicknessMap,t(_.thicknessMap,m.thicknessMapTransform)),m.attenuationDistance.value=_.attenuationDistance,m.attenuationColor.value.copy(_.attenuationColor)),_.anisotropy>0&&(m.anisotropyVector.value.set(_.anisotropy*Math.cos(_.anisotropyRotation),_.anisotropy*Math.sin(_.anisotropyRotation)),_.anisotropyMap&&(m.anisotropyMap.value=_.anisotropyMap,t(_.anisotropyMap,m.anisotropyMapTransform))),m.specularIntensity.value=_.specularIntensity,m.specularColor.value.copy(_.specularColor),_.specularColorMap&&(m.specularColorMap.value=_.specularColorMap,t(_.specularColorMap,m.specularColorMapTransform)),_.specularIntensityMap&&(m.specularIntensityMap.value=_.specularIntensityMap,t(_.specularIntensityMap,m.specularIntensityMapTransform))}function v(m,_){_.matcap&&(m.matcap.value=_.matcap)}function E(m,_){const w=e.get(_).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 FL(r,e,t,n){let i={},s={},o=[];const c=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&&(v(w),I=d(w),i[w.id]=I,w.addEventListener("dispose",m));const R=x.program;n.updateUBOMapping(w,R);const M=e.render.frame;s[w.id]!==M&&(p(w),s[w.id]=M)}function d(w){const x=A();w.__bindingPointIndex=x;const I=r.createBuffer(),R=w.__size,M=w.usage;return r.bindBuffer(r.UNIFORM_BUFFER,I),r.bufferData(r.UNIFORM_BUFFER,R,M),r.bindBuffer(r.UNIFORM_BUFFER,null),r.bindBufferBase(r.UNIFORM_BUFFER,x,I),I}function A(){for(let w=0;w<c;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 M=0,T=I.length;M<T;M++){const D=Array.isArray(I[M])?I[M]:[I[M]];for(let b=0,S=D.length;b<S;b++){const L=D[b];if(g(L,M,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 M=w.value,T=x+"_"+I;if(R[T]===void 0)return typeof M=="number"||typeof M=="boolean"?R[T]=M:R[T]=M.clone(),!0;{const D=R[T];if(typeof M=="number"||typeof M=="boolean"){if(D!==M)return R[T]=M,!0}else if(D.equals(M)===!1)return D.copy(M),!0}return!1}function v(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 S=0,L=b.length;S<L;S++){const P=b[S],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),H=I%R;H!==0&&R-H<te.boundary&&(I+=R-H),P.__data=new Float32Array(te.storage/Float32Array.BYTES_PER_ELEMENT),P.__offset=I,I+=te.storage}}}const M=I%R;return M>0&&(I+=R-M),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 _(){for(const w in i)r.deleteBuffer(i[w]);o=[],i={},s={}}return{bind:h,update:u,dispose:_}}class OL{constructor(e={}){const{canvas:t=Db(),context:n=null,depth:i=!0,stencil:s=!1,alpha:o=!1,antialias:c=!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),v=new Int32Array(4);let E=null,m=null;const _=[],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=Qr,this._useLegacyLights=!1,this.toneMapping=Zs,this.toneMappingExposure=1;const x=this;let I=!1,R=0,M=0,T=null,D=-1,b=null;const S=new Ot,L=new Ot;let P=null;const N=new Ke(0);let W=0,X=t.width,K=t.height,te=1,H=null,ee=null;const Q=new Ot(0,0,X,K),z=new Ot(0,0,X,K);let Z=!1;const re=new WA;let G=!1,de=!1;const pe=new st,fe=new Ge,ye=new j,Pe={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function at(){return T===null?te:1}let se=n;function et(O,ne){const ue=t.getContext(O,ne);return ue!==null?ue:null}try{const O={alpha:!0,depth:i,stencil:s,antialias:c,premultipliedAlpha:h,preserveDrawingBuffer:u,powerPreference:d,failIfMajorPerformanceCaveat:A};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${Vh}`),t.addEventListener("webglcontextlost",ge,!1),t.addEventListener("webglcontextrestored",_e,!1),t.addEventListener("webglcontextcreationerror",ze,!1),se===null){const ne="webgl2";if(se=et(ne,O),se===null)throw et(ne)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(O){throw console.error("THREE.WebGLRenderer: "+O.message),O}let ke,dt,Xe,ft,Y,k,le,Ae,me,Ee,Oe,Ce,Qe,ve,xe,Be,We,Le,be,nt,pt,ct,ut,tt;function V(){ke=new X6(se),ke.init(),dt=new G6(se,ke,e),ct=new bL(se,ke),Xe=new TL(se),ft=new Z6(se),Y=new AL,k=new BL(se,ke,Xe,Y,dt,ct,ft),le=new j6(x),Ae=new q6(x),me=new i5(se),ut=new z6(se,me),Ee=new K6(se,me,ft,ut),Oe=new eD(se,Ee,me,ft),be=new $6(se,dt,k),Be=new V6(Y),Ce=new pL(x,le,Ae,ke,dt,ut,Be),Qe=new QL(x,Y),ve=new mL,xe=new wL(ke),Le=new O6(x,le,Ae,Xe,Oe,p,h),We=new ML(x,Oe,dt),tt=new FL(se,ft,dt,Xe),nt=new H6(se,ke,ft),pt=new J6(se,ke,ft),ft.programs=Ce.programs,x.capabilities=dt,x.extensions=ke,x.properties=Y,x.renderLists=ve,x.shadowMap=We,x.state=Xe,x.info=ft}V();const F=new PL(x,se);this.xr=F,this.getContext=function(){return se},this.getContextAttributes=function(){return se.getContextAttributes()},this.forceContextLoss=function(){const O=ke.get("WEBGL_lose_context");O&&O.loseContext()},this.forceContextRestore=function(){const O=ke.get("WEBGL_lose_context");O&&O.restoreContext()},this.getPixelRatio=function(){return te},this.setPixelRatio=function(O){O!==void 0&&(te=O,this.setSize(X,K,!1))},this.getSize=function(O){return O.set(X,K)},this.setSize=function(O,ne,ue=!0){if(F.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}X=O,K=ne,t.width=Math.floor(O*te),t.height=Math.floor(ne*te),ue===!0&&(t.style.width=O+"px",t.style.height=ne+"px"),this.setViewport(0,0,O,ne)},this.getDrawingBufferSize=function(O){return O.set(X*te,K*te).floor()},this.setDrawingBufferSize=function(O,ne,ue){X=O,K=ne,te=ue,t.width=Math.floor(O*ue),t.height=Math.floor(ne*ue),this.setViewport(0,0,O,ne)},this.getCurrentViewport=function(O){return O.copy(S)},this.getViewport=function(O){return O.copy(Q)},this.setViewport=function(O,ne,ue,he){O.isVector4?Q.set(O.x,O.y,O.z,O.w):Q.set(O,ne,ue,he),Xe.viewport(S.copy(Q).multiplyScalar(te).round())},this.getScissor=function(O){return O.copy(z)},this.setScissor=function(O,ne,ue,he){O.isVector4?z.set(O.x,O.y,O.z,O.w):z.set(O,ne,ue,he),Xe.scissor(L.copy(z).multiplyScalar(te).round())},this.getScissorTest=function(){return Z},this.setScissorTest=function(O){Xe.setScissorTest(Z=O)},this.setOpaqueSort=function(O){H=O},this.setTransparentSort=function(O){ee=O},this.getClearColor=function(O){return O.copy(Le.getClearColor())},this.setClearColor=function(){Le.setClearColor.apply(Le,arguments)},this.getClearAlpha=function(){return Le.getClearAlpha()},this.setClearAlpha=function(){Le.setClearAlpha.apply(Le,arguments)},this.clear=function(O=!0,ne=!0,ue=!0){let he=0;if(O){let oe=!1;if(T!==null){const Re=T.texture.format;oe=Re===tu||Re===Xh||Re===fA}if(oe){const Re=T.texture.type,Je=Re===Ar||Re===Ii||Re===dA||Re===$c||Re===Wy||Re===Yy,it=Le.getClearColor(),ot=Le.getClearAlpha(),qe=it.r,At=it.g,ht=it.b;Je?(g[0]=qe,g[1]=At,g[2]=ht,g[3]=ot,se.clearBufferuiv(se.COLOR,0,g)):(v[0]=qe,v[1]=At,v[2]=ht,v[3]=ot,se.clearBufferiv(se.COLOR,0,v))}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",_e,!1),t.removeEventListener("webglcontextcreationerror",ze,!1),ve.dispose(),xe.dispose(),Y.dispose(),le.dispose(),Ae.dispose(),Oe.dispose(),ut.dispose(),tt.dispose(),Ce.dispose(),F.dispose(),F.removeEventListener("sessionstart",hr),F.removeEventListener("sessionend",Vt),_r.stop()};function ge(O){O.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),I=!0}function _e(){console.log("THREE.WebGLRenderer: Context Restored."),I=!1;const O=ft.autoReset,ne=We.enabled,ue=We.autoUpdate,he=We.needsUpdate,oe=We.type;V(),ft.autoReset=O,We.enabled=ne,We.autoUpdate=ue,We.needsUpdate=he,We.type=oe}function ze(O){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",O.statusMessage)}function Ne(O){const ne=O.target;ne.removeEventListener("dispose",Ne),_t(ne)}function _t(O){Dt(O),Y.remove(O)}function Dt(O){const ne=Y.get(O).programs;ne!==void 0&&(ne.forEach(function(ue){Ce.releaseProgram(ue)}),O.isShaderMaterial&&Ce.releaseShaderCache(O))}this.renderBufferDirect=function(O,ne,ue,he,oe,Re){ne===null&&(ne=Pe);const Je=oe.isMesh&&oe.matrixWorld.determinant()<0,it=qm(O,ne,ue,he,oe);Xe.setMaterial(he,Je);let ot=ue.index,qe=1;if(he.wireframe===!0){if(ot=Ee.getWireframeAttribute(ue),ot===void 0)return;qe=2}const At=ue.drawRange,ht=ue.attributes.position;let Dr=At.start*qe,er=(At.start+At.count)*qe;Re!==null&&(Dr=Math.max(Dr,Re.start*qe),er=Math.min(er,(Re.start+Re.count)*qe)),ot!==null?(Dr=Math.max(Dr,0),er=Math.min(er,ot.count)):ht!=null&&(Dr=Math.max(Dr,0),er=Math.min(er,ht.count));const Rn=er-Dr;if(Rn<0||Rn===1/0)return;ut.setup(oe,he,it,ue,ot);let di,jt=nt;if(ot!==null&&(di=me.get(ot),jt=pt,jt.setIndex(di)),oe.isMesh)he.wireframe===!0?(Xe.setLineWidth(he.wireframeLinewidth*at()),jt.setMode(se.LINES)):jt.setMode(se.TRIANGLES);else if(oe.isLine){let rt=he.linewidth;rt===void 0&&(rt=1),Xe.setLineWidth(rt*at()),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(Dr,Rn,oe.count);else if(ue.isInstancedBufferGeometry){const rt=ue._maxInstanceCount!==void 0?ue._maxInstanceCount:1/0,Wu=Math.min(ue.instanceCount,rt);jt.renderInstances(Dr,Rn,Wu)}else jt.render(Dr,Rn)};function Lt(O,ne,ue){O.transparent===!0&&O.side===Ei&&O.forceSinglePass===!1?(O.side=kr,O.needsUpdate=!0,Us(O,ne,ue),O.side=yi,O.needsUpdate=!0,Us(O,ne,ue),O.side=Ei):Us(O,ne,ue)}this.compile=function(O,ne,ue=null){ue===null&&(ue=O),m=xe.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))}),O!==ue&&O.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 O.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];Lt(it,ue,oe),he.add(it)}else Lt(Re,ue,oe),he.add(Re)}),w.pop(),m=null,he},this.compileAsync=function(O,ne,ue=null){const he=this.compile(O,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(O);return}setTimeout(Re,10)}ke.get("KHR_parallel_shader_compile")!==null?Re():setTimeout(Re,10)})};let Mt=null;function vt(O){Mt&&Mt(O)}function hr(){_r.stop()}function Vt(){_r.start()}const _r=new ZE;_r.setAnimationLoop(vt),typeof self<"u"&&_r.setContext(self),this.setAnimationLoop=function(O){Mt=O,F.setAnimationLoop(O),O===null?_r.stop():_r.start()},F.addEventListener("sessionstart",hr),F.addEventListener("sessionend",Vt),this.render=function(O,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;O.matrixWorldAutoUpdate===!0&&O.updateMatrixWorld(),ne.parent===null&&ne.matrixWorldAutoUpdate===!0&&ne.updateMatrixWorld(),F.enabled===!0&&F.isPresenting===!0&&(F.cameraAutoUpdate===!0&&F.updateCamera(ne),ne=F.getCamera()),O.isScene===!0&&O.onBeforeRender(x,O,ne,T),m=xe.get(O,w.length),m.init(),w.push(m),pe.multiplyMatrices(ne.projectionMatrix,ne.matrixWorldInverse),re.setFromProjectionMatrix(pe),de=this.localClippingEnabled,G=Be.init(this.clippingPlanes,de),E=ve.get(O,_.length),E.init(),_.push(E),bn(O,ne,0,x.sortObjects),E.finish(),x.sortObjects===!0&&E.sort(H,ee),this.info.render.frame++,G===!0&&Be.beginShadows();const ue=m.state.shadowsArray;if(We.render(ue,O,ne),G===!0&&Be.endShadows(),this.info.autoReset===!0&&this.info.reset(),(F.enabled===!1||F.isPresenting===!1||F.hasDepthSensing()===!1)&&Le.render(E,O),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,O,Je,Je.viewport)}}else qt(E,O,ne);T!==null&&(k.updateMultisampleRenderTarget(T),k.updateRenderTargetMipmap(T)),O.isScene===!0&&O.onAfterRender(x,O,ne),ut.resetDefaultState(),D=-1,b=null,w.pop(),w.length>0?m=w[w.length-1]:m=null,_.pop(),_.length>0?E=_[_.length-1]:E=null};function bn(O,ne,ue,he){if(O.visible===!1)return;if(O.layers.test(ne.layers)){if(O.isGroup)ue=O.renderOrder;else if(O.isLOD)O.autoUpdate===!0&&O.update(ne);else if(O.isLight)m.pushLight(O),O.castShadow&&m.pushShadow(O);else if(O.isSprite){if(!O.frustumCulled||re.intersectsSprite(O)){he&&ye.setFromMatrixPosition(O.matrixWorld).applyMatrix4(pe);const Re=Oe.update(O),Je=O.material;Je.visible&&E.push(O,Re,Je,ue,ye.z,null)}}else if((O.isMesh||O.isLine||O.isPoints)&&(!O.frustumCulled||re.intersectsObject(O))){const Re=Oe.update(O),Je=O.material;if(he&&(O.boundingSphere!==void 0?(O.boundingSphere===null&&O.computeBoundingSphere(),ye.copy(O.boundingSphere.center)):(Re.boundingSphere===null&&Re.computeBoundingSphere(),ye.copy(Re.boundingSphere.center)),ye.applyMatrix4(O.matrixWorld).applyMatrix4(pe)),Array.isArray(Je)){const it=Re.groups;for(let ot=0,qe=it.length;ot<qe;ot++){const At=it[ot],ht=Je[At.materialIndex];ht&&ht.visible&&E.push(O,Re,ht,ue,ye.z,At)}}else Je.visible&&E.push(O,Re,Je,ue,ye.z,null)}}const oe=O.children;for(let Re=0,Je=oe.length;Re<Je;Re++)bn(oe[Re],ne,ue,he)}function qt(O,ne,ue,he){const oe=O.opaque,Re=O.transmissive,Je=O.transparent;m.setupLightsView(ue),G===!0&&Be.setGlobalState(x.clippingPlanes,ue),Re.length>0&&hi(oe,Re,ne,ue),he&&Xe.viewport(S.copy(he)),oe.length>0&&Jn(oe,ne,ue),Re.length>0&&Jn(Re,ne,ue),Je.length>0&&Jn(Je,ne,ue),Xe.buffers.depth.setTest(!0),Xe.buffers.depth.setMask(!0),Xe.buffers.color.setMask(!0),Xe.setPolygonOffset(!1)}function hi(O,ne,ue,he){if((ue.isScene===!0?ue.overrideMaterial:null)!==null)return;if(m.state.transmissionRenderTarget===null){m.state.transmissionRenderTarget=new Mi(1,1,{generateMipmaps:!0,type:ke.has("EXT_color_buffer_half_float")||ke.has("EXT_color_buffer_float")?yn:Ar,minFilter:wi,samples:4,stencilBuffer:s});const ot=Y.get(m.state.transmissionRenderTarget);ot.__isTransmissionRenderTarget=!0}const oe=m.state.transmissionRenderTarget;x.getDrawingBufferSize(fe),oe.setSize(fe.x,fe.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,Jn(O,ue,he),k.updateMultisampleRenderTarget(oe),k.updateRenderTargetMipmap(oe);let it=!1;for(let ot=0,qe=ne.length;ot<qe;ot++){const At=ne[ot],ht=At.object,Dr=At.geometry,er=At.material,Rn=At.group;if(er.side===Ei&&ht.layers.test(he.layers)){const di=er.side;er.side=kr,er.needsUpdate=!0,Ns(ht,ue,he,Dr,er,Rn),er.side=di,er.needsUpdate=!0,it=!0}}it===!0&&(k.updateMultisampleRenderTarget(oe),k.updateRenderTargetMipmap(oe)),x.setRenderTarget(Re),x.setClearColor(N,W),x.toneMapping=Je}function Jn(O,ne,ue){const he=ne.isScene===!0?ne.overrideMaterial:null;for(let oe=0,Re=O.length;oe<Re;oe++){const Je=O[oe],it=Je.object,ot=Je.geometry,qe=he===null?Je.material:he,At=Je.group;it.layers.test(ue.layers)&&Ns(it,ne,ue,ot,qe,At)}}function Ns(O,ne,ue,he,oe,Re){O.onBeforeRender(x,ne,ue,he,oe,Re),O.modelViewMatrix.multiplyMatrices(ue.matrixWorldInverse,O.matrixWorld),O.normalMatrix.getNormalMatrix(O.modelViewMatrix),oe.onBeforeRender(x,ne,ue,he,O,Re),oe.transparent===!0&&oe.side===Ei&&oe.forceSinglePass===!1?(oe.side=kr,oe.needsUpdate=!0,x.renderBufferDirect(ue,ne,he,oe,O,Re),oe.side=yi,oe.needsUpdate=!0,x.renderBufferDirect(ue,ne,he,oe,O,Re),oe.side=Ei):x.renderBufferDirect(ue,ne,he,oe,O,Re),O.onAfterRender(x,ne,ue,he,oe,Re)}function Us(O,ne,ue){ne.isScene!==!0&&(ne=Pe);const he=Y.get(O),oe=m.state.lights,Re=m.state.shadowsArray,Je=oe.state.version,it=Ce.getParameters(O,oe.state,Re,ne,ue),ot=Ce.getProgramCacheKey(it);let qe=he.programs;he.environment=O.isMeshStandardMaterial?ne.environment:null,he.fog=ne.fog,he.envMap=(O.isMeshStandardMaterial?Ae:le).get(O.envMap||he.environment),he.envMapRotation=he.environment!==null&&O.envMap===null?ne.environmentRotation:O.envMapRotation,qe===void 0&&(O.addEventListener("dispose",Ne),qe=new Map,he.programs=qe);let At=qe.get(ot);if(At!==void 0){if(he.currentProgram===At&&he.lightsStateVersion===Je)return wf(O,it),At}else it.uniforms=Ce.getUniforms(O),O.onBuild(ue,it,x),O.onBeforeCompile(it,x),At=Ce.acquireProgram(it,ot),qe.set(ot,At),he.uniforms=it.uniforms;const ht=he.uniforms;return(!O.isShaderMaterial&&!O.isRawShaderMaterial||O.clipping===!0)&&(ht.clippingPlanes=Be.uniform),wf(O,it),he.needsLights=Ps(O),he.lightsStateVersion=Je,he.needsLights&&(ht.ambientLightColor.value=oe.state.ambient,ht.lightProbe.value=oe.state.probe,ht.directionalLights.value=oe.state.directional,ht.directionalLightShadows.value=oe.state.directionalShadow,ht.spotLights.value=oe.state.spot,ht.spotLightShadows.value=oe.state.spotShadow,ht.rectAreaLights.value=oe.state.rectArea,ht.ltc_1.value=oe.state.rectAreaLTC1,ht.ltc_2.value=oe.state.rectAreaLTC2,ht.pointLights.value=oe.state.point,ht.pointLightShadows.value=oe.state.pointShadow,ht.hemisphereLights.value=oe.state.hemi,ht.directionalShadowMap.value=oe.state.directionalShadowMap,ht.directionalShadowMatrix.value=oe.state.directionalShadowMatrix,ht.spotShadowMap.value=oe.state.spotShadowMap,ht.spotLightMatrix.value=oe.state.spotLightMatrix,ht.spotLightMap.value=oe.state.spotLightMap,ht.pointShadowMap.value=oe.state.pointShadowMap,ht.pointShadowMatrix.value=oe.state.pointShadowMatrix),he.currentProgram=At,he.uniformsList=null,At}function ac(O){if(O.uniformsList===null){const ne=O.currentProgram.getUniforms();O.uniformsList=Bd.seqWithValue(ne.seq,O.uniforms)}return O.uniformsList}function wf(O,ne){const ue=Y.get(O);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 qm(O,ne,ue,he,oe){ne.isScene!==!0&&(ne=Pe),k.resetTextureUnits();const Re=ne.fog,Je=he.isMeshStandardMaterial?ne.environment:null,it=T===null?x.outputColorSpace:T.isXRRenderTarget===!0?T.texture.colorSpace:Sr,ot=(he.isMeshStandardMaterial?Ae:le).get(he.envMap||Je),qe=he.vertexColors===!0&&!!ue.attributes.color&&ue.attributes.color.itemSize===4,At=!!ue.attributes.tangent&&(!!he.normalMap||he.anisotropy>0),ht=!!ue.morphAttributes.position,Dr=!!ue.morphAttributes.normal,er=!!ue.morphAttributes.color;let Rn=Zs;he.toneMapped&&(T===null||T.isXRRenderTarget===!0)&&(Rn=x.toneMapping);const di=ue.morphAttributes.position||ue.morphAttributes.normal||ue.morphAttributes.color,jt=di!==void 0?di.length:0,rt=Y.get(he),Wu=m.state.lights;if(G===!0&&(de===!0||O!==b)){const Ln=O===b&&he.id===D;Be.setState(he,O,Ln)}let gn=!1;he.version===rt.__version?(rt.needsLights&&rt.lightsStateVersion!==Wu.state.version||rt.outputColorSpace!==it||oe.isBatchedMesh&&rt.batching===!1||!oe.isBatchedMesh&&rt.batching===!0||oe.isInstancedMesh&&rt.instancing===!1||!oe.isInstancedMesh&&rt.instancing===!0||oe.isSkinnedMesh&&rt.skinning===!1||!oe.isSkinnedMesh&&rt.skinning===!0||oe.isInstancedMesh&&rt.instancingColor===!0&&oe.instanceColor===null||oe.isInstancedMesh&&rt.instancingColor===!1&&oe.instanceColor!==null||oe.isInstancedMesh&&rt.instancingMorph===!0&&oe.morphTexture===null||oe.isInstancedMesh&&rt.instancingMorph===!1&&oe.morphTexture!==null||rt.envMap!==ot||he.fog===!0&&rt.fog!==Re||rt.numClippingPlanes!==void 0&&(rt.numClippingPlanes!==Be.numPlanes||rt.numIntersection!==Be.numIntersection)||rt.vertexAlphas!==qe||rt.vertexTangents!==At||rt.morphTargets!==ht||rt.morphNormals!==Dr||rt.morphColors!==er||rt.toneMapping!==Rn||rt.morphTargetsCount!==jt)&&(gn=!0):(gn=!0,rt.__version=he.version);let ks=rt.currentProgram;gn===!0&&(ks=Us(he,ne,oe));let If=!1,Do=!1,Ia=!1;const vr=ks.getUniforms(),Dn=rt.uniforms;if(Xe.useProgram(ks.program)&&(If=!0,Do=!0,Ia=!0),he.id!==D&&(D=he.id,Do=!0),If||b!==O){vr.setValue(se,"projectionMatrix",O.projectionMatrix),vr.setValue(se,"viewMatrix",O.matrixWorldInverse);const Ln=vr.map.cameraPosition;Ln!==void 0&&Ln.setValue(se,ye.setFromMatrixPosition(O.matrixWorld)),dt.logarithmicDepthBuffer&&vr.setValue(se,"logDepthBufFC",2/(Math.log(O.far+1)/Math.LN2)),(he.isMeshPhongMaterial||he.isMeshToonMaterial||he.isMeshLambertMaterial||he.isMeshBasicMaterial||he.isMeshStandardMaterial||he.isShaderMaterial)&&vr.setValue(se,"isOrthographic",O.isOrthographicCamera===!0),b!==O&&(b=O,Do=!0,Ia=!0)}if(oe.isSkinnedMesh){vr.setOptional(se,oe,"bindMatrix"),vr.setOptional(se,oe,"bindMatrixInverse");const Ln=oe.skeleton;Ln&&(Ln.boneTexture===null&&Ln.computeBoneTexture(),vr.setValue(se,"boneTexture",Ln.boneTexture,k))}oe.isBatchedMesh&&(vr.setOptional(se,oe,"batchingTexture"),vr.setValue(se,"batchingTexture",oe._matricesTexture,k));const Ca=ue.morphAttributes;if((Ca.position!==void 0||Ca.normal!==void 0||Ca.color!==void 0)&&be.update(oe,ue,ks),(Do||rt.receiveShadow!==oe.receiveShadow)&&(rt.receiveShadow=oe.receiveShadow,vr.setValue(se,"receiveShadow",oe.receiveShadow)),he.isMeshGouraudMaterial&&he.envMap!==null&&(Dn.envMap.value=ot,Dn.flipEnvMap.value=ot.isCubeTexture&&ot.isRenderTargetTexture===!1?-1:1),he.isMeshStandardMaterial&&he.envMap===null&&ne.environment!==null&&(Dn.envMapIntensity.value=ne.environmentIntensity),Do&&(vr.setValue(se,"toneMappingExposure",x.toneMappingExposure),rt.needsLights&&Xm(Dn,Ia),Re&&he.fog===!0&&Qe.refreshFogUniforms(Dn,Re),Qe.refreshMaterialUniforms(Dn,he,te,K,m.state.transmissionRenderTarget),Bd.upload(se,ac(rt),Dn,k)),he.isShaderMaterial&&he.uniformsNeedUpdate===!0&&(Bd.upload(se,ac(rt),Dn,k),he.uniformsNeedUpdate=!1),he.isSpriteMaterial&&vr.setValue(se,"center",oe.center),vr.setValue(se,"modelViewMatrix",oe.modelViewMatrix),vr.setValue(se,"normalMatrix",oe.normalMatrix),vr.setValue(se,"modelMatrix",oe.matrixWorld),he.isShaderMaterial||he.isRawShaderMaterial){const Ln=he.uniformsGroups;for(let Yu=0,qu=Ln.length;Yu<qu;Yu++){const Xu=Ln[Yu];tt.update(Xu,ks),tt.bind(Xu,ks)}}return ks}function Xm(O,ne){O.ambientLightColor.needsUpdate=ne,O.lightProbe.needsUpdate=ne,O.directionalLights.needsUpdate=ne,O.directionalLightShadows.needsUpdate=ne,O.pointLights.needsUpdate=ne,O.pointLightShadows.needsUpdate=ne,O.spotLights.needsUpdate=ne,O.spotLightShadows.needsUpdate=ne,O.rectAreaLights.needsUpdate=ne,O.hemisphereLights.needsUpdate=ne}function Ps(O){return O.isMeshLambertMaterial||O.isMeshToonMaterial||O.isMeshPhongMaterial||O.isMeshStandardMaterial||O.isShadowMaterial||O.isShaderMaterial&&O.lights===!0}this.getActiveCubeFace=function(){return R},this.getActiveMipmapLevel=function(){return M},this.getRenderTarget=function(){return T},this.setRenderTargetTextures=function(O,ne,ue){Y.get(O.texture).__webglTexture=ne,Y.get(O.depthTexture).__webglTexture=ue;const he=Y.get(O);he.__hasExternalTextures=!0,he.__autoAllocateDepthBuffer=ue===void 0,he.__autoAllocateDepthBuffer||ke.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(O,ne){const ue=Y.get(O);ue.__webglFramebuffer=ne,ue.__useDefaultFramebuffer=ne===void 0},this.setRenderTarget=function(O,ne=0,ue=0){T=O,R=ne,M=ue;let he=!0,oe=null,Re=!1,Je=!1;if(O){const it=Y.get(O);it.__useDefaultFramebuffer!==void 0?(Xe.bindFramebuffer(se.FRAMEBUFFER,null),he=!1):it.__webglFramebuffer===void 0?k.setupRenderTarget(O):it.__hasExternalTextures&&k.rebindTextures(O,Y.get(O.texture).__webglTexture,Y.get(O.depthTexture).__webglTexture);const ot=O.texture;(ot.isData3DTexture||ot.isDataArrayTexture||ot.isCompressedArrayTexture)&&(Je=!0);const qe=Y.get(O).__webglFramebuffer;O.isWebGLCubeRenderTarget?(Array.isArray(qe[ne])?oe=qe[ne][ue]:oe=qe[ne],Re=!0):O.samples>0&&k.useMultisampledRTT(O)===!1?oe=Y.get(O).__webglMultisampledFramebuffer:Array.isArray(qe)?oe=qe[ue]:oe=qe,S.copy(O.viewport),L.copy(O.scissor),P=O.scissorTest}else S.copy(Q).multiplyScalar(te).floor(),L.copy(z).multiplyScalar(te).floor(),P=Z;if(Xe.bindFramebuffer(se.FRAMEBUFFER,oe)&&he&&Xe.drawBuffers(O,oe),Xe.viewport(S),Xe.scissor(L),Xe.setScissorTest(P),Re){const it=Y.get(O.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(O.texture),ot=ne||0;se.framebufferTextureLayer(se.FRAMEBUFFER,se.COLOR_ATTACHMENT0,it.__webglTexture,ue||0,ot)}D=-1},this.readRenderTargetPixels=function(O,ne,ue,he,oe,Re,Je){if(!(O&&O.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let it=Y.get(O).__webglFramebuffer;if(O.isWebGLCubeRenderTarget&&Je!==void 0&&(it=it[Je]),it){Xe.bindFramebuffer(se.FRAMEBUFFER,it);try{const ot=O.texture,qe=ot.format,At=ot.type;if(qe!==gr&&ct.convert(qe)!==se.getParameter(se.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const ht=At===yn&&(ke.has("EXT_color_buffer_half_float")||ke.has("EXT_color_buffer_float"));if(At!==Ar&&ct.convert(At)!==se.getParameter(se.IMPLEMENTATION_COLOR_READ_TYPE)&&At!==lr&&!ht){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}ne>=0&&ne<=O.width-he&&ue>=0&&ue<=O.height-oe&&se.readPixels(ne,ue,he,oe,ct.convert(qe),ct.convert(At),Re)}finally{const ot=T!==null?Y.get(T).__webglFramebuffer:null;Xe.bindFramebuffer(se.FRAMEBUFFER,ot)}}},this.copyFramebufferToTexture=function(O,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,O.x,O.y,oe,Re),Xe.unbindTexture()},this.copyTextureToTexture=function(O,ne,ue,he=0){const oe=ne.image.width,Re=ne.image.height,Je=ct.convert(ue.format),it=ct.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,O.x,O.y,oe,Re,Je,it,ne.image.data):ne.isCompressedTexture?se.compressedTexSubImage2D(se.TEXTURE_2D,he,O.x,O.y,ne.mipmaps[0].width,ne.mipmaps[0].height,Je,ne.mipmaps[0].data):se.texSubImage2D(se.TEXTURE_2D,he,O.x,O.y,Je,it,ne.image),he===0&&ue.generateMipmaps&&se.generateMipmap(se.TEXTURE_2D),Xe.unbindTexture()},this.copyTextureToTexture3D=function(O,ne,ue,he,oe=0){const Re=Math.round(O.max.x-O.min.x),Je=Math.round(O.max.y-O.min.y),it=O.max.z-O.min.z+1,ot=ct.convert(he.format),qe=ct.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 ht=se.getParameter(se.UNPACK_ROW_LENGTH),Dr=se.getParameter(se.UNPACK_IMAGE_HEIGHT),er=se.getParameter(se.UNPACK_SKIP_PIXELS),Rn=se.getParameter(se.UNPACK_SKIP_ROWS),di=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,O.min.x),se.pixelStorei(se.UNPACK_SKIP_ROWS,O.min.y),se.pixelStorei(se.UNPACK_SKIP_IMAGES,O.min.z),ue.isDataTexture||ue.isData3DTexture?se.texSubImage3D(At,oe,ne.x,ne.y,ne.z,Re,Je,it,ot,qe,jt.data):he.isCompressedArrayTexture?se.compressedTexSubImage3D(At,oe,ne.x,ne.y,ne.z,Re,Je,it,ot,jt.data):se.texSubImage3D(At,oe,ne.x,ne.y,ne.z,Re,Je,it,ot,qe,jt),se.pixelStorei(se.UNPACK_ROW_LENGTH,ht),se.pixelStorei(se.UNPACK_IMAGE_HEIGHT,Dr),se.pixelStorei(se.UNPACK_SKIP_PIXELS,er),se.pixelStorei(se.UNPACK_SKIP_ROWS,Rn),se.pixelStorei(se.UNPACK_SKIP_IMAGES,di),oe===0&&he.generateMipmaps&&se.generateMipmap(At),Xe.unbindTexture()},this.initTexture=function(O){O.isCubeTexture?k.setTextureCube(O,0):O.isData3DTexture?k.setTexture3D(O,0):O.isDataArrayTexture||O.isCompressedArrayTexture?k.setTexture2DArray(O,0):k.setTexture2D(O,0),Xe.unbindTexture()},this.resetState=function(){R=0,M=0,T=null,Xe.reset(),ut.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return gs}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=e===ed?"display-p3":"srgb",t.unpackColorSpace=Rt.workingColorSpace===nu?"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 zL 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 Yi,this.environmentIntensity=1,this.environmentRotation=new Yi,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 HL{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=IA,this._updateRange={offset:0,count:-1},this.updateRanges=[],this.version=0,this.uuid=Ci()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}get updateRange(){return IE("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=Ci()),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=Ci()),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 hn=new j;class rg{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++)hn.fromBufferAttribute(this,t),hn.applyMatrix4(e),this.setXYZ(t,hn.x,hn.y,hn.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)hn.fromBufferAttribute(this,t),hn.applyNormalMatrix(e),this.setXYZ(t,hn.x,hn.y,hn.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)hn.fromBufferAttribute(this,t),hn.transformDirection(e),this.setXYZ(t,hn.x,hn.y,hn.z);return this}getComponent(e,t){let n=this.array[e*this.data.stride+this.offset+t];return this.normalized&&(n=Si(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=Nt(n,this.array)),this.data.array[e*this.data.stride+this.offset+t]=n,this}setX(e,t){return this.normalized&&(t=Nt(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=Nt(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=Nt(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=Nt(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=Si(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=Si(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=Si(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=Si(t,this.array)),t}setXY(e,t,n){return e=e*this.data.stride+this.offset,this.normalized&&(t=Nt(t,this.array),n=Nt(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=Nt(t,this.array),n=Nt(n,this.array),i=Nt(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=Nt(t,this.array),n=Nt(n,this.array),i=Nt(i,this.array),s=Nt(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 Fr(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 rg(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 T2=new j,B2=new Ot,b2=new Ot,GL=new j,R2=new st,bd=new j,ng=new Bi,D2=new st,ig=new cu;class VL extends Yr{constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=Hy,this.bindMatrix=new st,this.bindMatrixInverse=new st,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){const e=this.geometry;this.boundingBox===null&&(this.boundingBox=new Er),this.boundingBox.makeEmpty();const t=e.getAttribute("position");for(let n=0;n<t.count;n++)this.getVertexPosition(n,bd),this.boundingBox.expandByPoint(bd)}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,bd),this.boundingSphere.expandByPoint(bd)}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(),ng.copy(this.boundingSphere),ng.applyMatrix4(i),e.ray.intersectsSphere(ng)!==!1&&(D2.copy(i).invert(),ig.copy(e.ray).applyMatrix4(D2),!(this.boundingBox!==null&&ig.intersectsBox(this.boundingBox)===!1)&&this._computeIntersections(e,t,ig)))}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 Ot,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===Hy?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===KB?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(e,t){const n=this.skeleton,i=this.geometry;B2.fromBufferAttribute(i.attributes.skinIndex,e),b2.fromBufferAttribute(i.attributes.skinWeight,e),T2.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let s=0;s<4;s++){const o=b2.getComponent(s);if(o!==0){const c=B2.getComponent(s);R2.multiplyMatrices(n.bones[c].matrixWorld,n.boneInverses[c]),t.addScaledVector(GL.copy(T2).applyMatrix4(R2),o)}}return t.applyMatrix4(this.bindMatrixInverse)}}class L2 extends Zt{constructor(){super(),this.isBone=!0,this.type="Bone"}}class Ao extends Tr{constructor(e=null,t=1,n=1,i,s,o,c,h,u=fr,d=fr,A,p){super(null,o,c,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 N2=new st,jL=new st;class sg{constructor(e=[],t=[]){this.uuid=Ci(),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 st)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){const n=new st;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 c=e[s]?e[s].matrixWorld:jL;N2.multiplyMatrices(c,t[s]),N2.toArray(n,s*16)}i!==null&&(i.needsUpdate=!0)}clone(){return new sg(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 Ao(t,e,e,gr,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 L2),this.bones.push(o),this.boneInverses.push(new st().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 c=n[i];e.boneInverses.push(c.toArray())}return e}}class ag extends Fr{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 Tl=new st,U2=new st,Rd=[],P2=new Er,WL=new st,gu=new Yr,mu=new Bi;class YL extends Yr{constructor(e,t,n){super(e,t),this.isInstancedMesh=!0,this.instanceMatrix=new ag(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,WL)}computeBoundingBox(){const e=this.geometry,t=this.count;this.boundingBox===null&&(this.boundingBox=new Er),e.boundingBox===null&&e.computeBoundingBox(),this.boundingBox.makeEmpty();for(let n=0;n<t;n++)this.getMatrixAt(n,Tl),P2.copy(e.boundingBox).applyMatrix4(Tl),this.boundingBox.union(P2)}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,Tl),mu.copy(e.boundingSphere).applyMatrix4(Tl),this.boundingSphere.union(mu)}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 c=0;c<n.length;c++)n[c]=i[o+c]}raycast(e,t){const n=this.matrixWorld,i=this.count;if(gu.geometry=this.geometry,gu.material=this.material,gu.material!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),mu.copy(this.boundingSphere),mu.applyMatrix4(n),e.ray.intersectsSphere(mu)!==!1))for(let s=0;s<i;s++){this.getMatrixAt(s,Tl),U2.multiplyMatrices(n,Tl),gu.matrixWorld=U2,gu.raycast(e,Rd);for(let o=0,c=Rd.length;o<c;o++){const h=Rd[o];h.instanceId=s,h.object=this,t.push(h)}Rd.length=0}}setColorAt(e,t){this.instanceColor===null&&(this.instanceColor=new ag(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 Ao(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 c=this.geometry.morphTargetsRelative?1:1-o,h=i*e;s[h]=c,s.set(n,h+1)}updateMorphTargets(){}dispose(){return this.dispatchEvent({type:"dispose"}),this.morphTexture!==null&&(this.morphTexture.dispose(),this.morphTexture=null),this}}class k2 extends qi{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new Ke(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 Q2=new j,F2=new j,O2=new st,og=new cu,Dd=new Bi;class lg extends Zt{constructor(e=new Gn,t=new k2){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++)Q2.fromBufferAttribute(t,i-1),F2.fromBufferAttribute(t,i),n[i]=n[i-1],n[i]+=Q2.distanceTo(F2);e.setAttribute("lineDistance",new Di(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(),Dd.copy(n.boundingSphere),Dd.applyMatrix4(i),Dd.radius+=s,e.ray.intersectsSphere(Dd)===!1)return;O2.copy(i).invert(),og.copy(e.ray).applyMatrix4(O2);const c=s/((this.scale.x+this.scale.y+this.scale.z)/3),h=c*c,u=new j,d=new j,A=new j,p=new j,g=this.isLineSegments?2:1,v=n.index,E=n.attributes.position;if(v!==null){const m=Math.max(0,o.start),_=Math.min(v.count,o.start+o.count);for(let w=m,x=_-1;w<x;w+=g){const I=v.getX(w),R=v.getX(w+1);if(u.fromBufferAttribute(E,I),d.fromBufferAttribute(E,R),og.distanceSqToSegment(u,d,p,A)>h)continue;p.applyMatrix4(this.matrixWorld);const M=e.ray.origin.distanceTo(p);M<e.near||M>e.far||t.push({distance:M,point:A.clone().applyMatrix4(this.matrixWorld),index:w,face:null,faceIndex:null,object:this})}}else{const m=Math.max(0,o.start),_=Math.min(E.count,o.start+o.count);for(let w=m,x=_-1;w<x;w+=g){if(u.fromBufferAttribute(E,w),d.fromBufferAttribute(E,w+1),og.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 z2=new j,H2=new j;class qL extends lg{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)z2.fromBufferAttribute(t,i),H2.fromBufferAttribute(t,i+1),n[i]=i===0?0:n[i-1],n[i+1]=n[i]+z2.distanceTo(H2);e.setAttribute("lineDistance",new Di(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class XL extends lg{constructor(e,t){super(e,t),this.isLineLoop=!0,this.type="LineLoop"}}class G2 extends qi{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new Ke(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 V2=new st,cg=new cu,Ld=new Bi,Nd=new j;class KL extends Zt{constructor(e=new Gn,t=new G2){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(),Ld.copy(n.boundingSphere),Ld.applyMatrix4(i),Ld.radius+=s,e.ray.intersectsSphere(Ld)===!1)return;V2.copy(i).invert(),cg.copy(e.ray).applyMatrix4(V2);const c=s/((this.scale.x+this.scale.y+this.scale.z)/3),h=c*c,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,v=p;g<v;g++){const E=u.getX(g);Nd.fromBufferAttribute(d,E),j2(Nd,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,v=p;g<v;g++)Nd.fromBufferAttribute(d,g),j2(Nd,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 j2(r,e,t,n,i,s,o){const c=cg.distanceSqToPoint(r);if(c<t){const h=new j;cg.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(c),point:h,index:e,face:null,object:o})}}class Ud extends Tr{constructor(e,t,n,i,s,o,c,h,u,d,A,p){super(null,o,c,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 JL extends Ud{constructor(e,t,n,i,s,o){super(e,t,n,s,o),this.isCompressedArrayTexture=!0,this.image.depth=i,this.wrapR=xi}}class ZL extends Ud{constructor(e,t,n){super(void 0,e[0].width,e[0].height,t,n,no),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class $L extends En{constructor(e){super(e),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}class ug extends qi{constructor(e){super(),this.isMeshStandardMaterial=!0,this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new Ke(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 Ke(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=mE,this.normalScale=new Ge(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 Yi,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 Li extends ug{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 Ge(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return Mr(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 Ke(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 Ke(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new Ke(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 Pd(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 e8(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}function t8(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 W2(r,e,t){const n=r.length,i=new r.constructor(n);for(let s=0,o=0;o!==n;++s){const c=t[s]*e;for(let h=0;h!==e;++h)i[o++]=r[c+h]}return i}function Y2(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 _u{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 c=n+2;;){if(i===void 0){if(e<s)break n;return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}if(n===c)break;if(s=i,i=t[++n],e<i)break t}o=t.length;break r}if(!(e>=s)){const c=t[1];e<c&&(n=2,s=c);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 c=n+o>>>1;e<t[c]?o=c:n=c+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 r8 extends _u{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:fE,endingEnd:fE}}intervalChanged_(e,t,n){const i=this.parameterPositions;let s=e-2,o=e+1,c=i[s],h=i[o];if(c===void 0)switch(this.getSettings_().endingStart){case pE:s=e,c=2*t-n;break;case AE:s=i.length-2,c=t+i[s]-i[s+1];break;default:s=e,c=n}if(h===void 0)switch(this.getSettings_().endingEnd){case pE:o=e,h=2*n-t;break;case AE: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-c),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,c=this.valueSize,h=e*c,u=h-c,d=this._offsetPrev,A=this._offsetNext,p=this._weightPrev,g=this._weightNext,v=(n-t)/(i-t),E=v*v,m=E*v,_=-p*m+2*p*E-p*v,w=(1+p)*m+(-1.5-2*p)*E+(-.5+p)*v+1,x=(-1-g)*m+(1.5+g)*E+.5*v,I=g*m-g*E;for(let R=0;R!==c;++R)s[R]=_*o[d+R]+w*o[u+R]+x*o[h+R]+I*o[A+R];return s}}class n8 extends _u{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){const s=this.resultBuffer,o=this.sampleValues,c=this.valueSize,h=e*c,u=h-c,d=(n-t)/(i-t),A=1-d;for(let p=0;p!==c;++p)s[p]=o[u+p]*A+o[h+p]*d;return s}}class i8 extends _u{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e){return this.copySampleValue_(e-1)}}class Ji{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=Pd(t,this.TimeBufferType),this.values=Pd(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:Pd(e.times,Array),values:Pd(e.values,Array)};const i=e.getInterpolation();i!==e.DefaultInterpolation&&(n.interpolation=i)}return n.type=e.ValueTypeName,n}InterpolantFactoryMethodDiscrete(e){return new i8(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new n8(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new r8(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case ru:t=this.InterpolantFactoryMethodDiscrete;break;case sl:t=this.InterpolantFactoryMethodLinear;break;case xA: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 ru;case this.InterpolantFactoryMethodLinear:return sl;case this.InterpolantFactoryMethodSmooth:return xA}}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 c=this.getValueSize();this.times=n.slice(s,o),this.values=this.values.slice(s*c,o*c)}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 c=0;c!==s;c++){const h=n[c];if(typeof h=="number"&&isNaN(h)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,c,h),e=!1;break}if(o!==null&&o>h){console.error("THREE.KeyframeTrack: Out of order keys.",this,c,h,o),e=!1;break}o=h}if(i!==void 0&&e8(i))for(let c=0,h=i.length;c!==h;++c){const u=i[c];if(isNaN(u)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,c,u),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),n=this.getValueSize(),i=this.getInterpolation()===xA,s=e.length-1;let o=1;for(let c=1;c<s;++c){let h=!1;const u=e[c],d=e[c+1];if(u!==d&&(c!==1||u!==e[0]))if(i)h=!0;else{const A=c*n,p=A-n,g=A+n;for(let v=0;v!==n;++v){const E=t[A+v];if(E!==t[p+v]||E!==t[g+v]){h=!0;break}}}if(h){if(c!==o){e[o]=e[c];const A=c*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 c=s*n,h=o*n,u=0;u!==n;++u)t[h+u]=t[c+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}}Ji.prototype.TimeBufferType=Float32Array,Ji.prototype.ValueBufferType=Float32Array,Ji.prototype.DefaultInterpolation=sl;class Bl extends Ji{}Bl.prototype.ValueTypeName="bool",Bl.prototype.ValueBufferType=Array,Bl.prototype.DefaultInterpolation=ru,Bl.prototype.InterpolantFactoryMethodLinear=void 0,Bl.prototype.InterpolantFactoryMethodSmooth=void 0;class q2 extends Ji{}q2.prototype.ValueTypeName="color";class bl extends Ji{}bl.prototype.ValueTypeName="number";class s8 extends _u{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){const s=this.resultBuffer,o=this.sampleValues,c=this.valueSize,h=(n-t)/(i-t);let u=e*c;for(let d=u+c;u!==d;u+=4)Wi.slerpFlat(s,0,o,u-c,o,u,h);return s}}class go extends Ji{InterpolantFactoryMethodLinear(e){return new s8(this.times,this.values,this.getValueSize(),e)}}go.prototype.ValueTypeName="quaternion",go.prototype.DefaultInterpolation=sl,go.prototype.InterpolantFactoryMethodSmooth=void 0;class Rl extends Ji{}Rl.prototype.ValueTypeName="string",Rl.prototype.ValueBufferType=Array,Rl.prototype.DefaultInterpolation=ru,Rl.prototype.InterpolantFactoryMethodLinear=void 0,Rl.prototype.InterpolantFactoryMethodSmooth=void 0;class Dl extends Ji{}Dl.prototype.ValueTypeName="vector";class a8{constructor(e="",t=-1,n=[],i=ib){this.name=e,this.tracks=n,this.duration=t,this.blendMode=i,this.uuid=Ci(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],n=e.tracks,i=1/(e.fps||1);for(let o=0,c=n.length;o!==c;++o)t.push(l8(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(Ji.toJSON(n[s]));return i}static CreateFromMorphTargetSequence(e,t,n,i){const s=t.length,o=[];for(let c=0;c<s;c++){let h=[],u=[];h.push((c+s-1)%s,c,(c+1)%s),u.push(0,1,0);const d=t8(h);h=W2(h,1,d),u=W2(u,1,d),!i&&h[0]===0&&(h.push(s),u.push(u[0])),o.push(new bl(".morphTargetInfluences["+t[c].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 c=0,h=e.length;c<h;c++){const u=e[c],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 c in i)o.push(this.CreateFromMorphTargetSequence(c,i[c],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,v){if(p.length!==0){const E=[],m=[];Y2(p,E,m,g),E.length!==0&&v.push(new d(A,E,m))}},i=[],s=e.name||"default",o=e.fps||30,c=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 v=0;v<A[g].morphTargets.length;v++)p[A[g].morphTargets[v]]=-1;for(const v in p){const E=[],m=[];for(let _=0;_!==A[g].morphTargets.length;++_){const w=A[g];E.push(w.time),m.push(w.morphTarget===v?1:0)}i.push(new bl(".morphTargetInfluence["+v+"]",E,m))}h=p.length*o}else{const p=".bones["+t[d].name+"]";n(Dl,p+".position",A,"pos",i),n(go,p+".quaternion",A,"rot",i),n(Dl,p+".scale",A,"scl",i)}}return i.length===0?null:new this(s,h,i,c)}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 o8(r){switch(r.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return bl;case"vector":case"vector2":case"vector3":case"vector4":return Dl;case"color":return q2;case"quaternion":return go;case"bool":case"boolean":return Bl;case"string":return Rl}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+r)}function l8(r){if(r.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const e=o8(r.type);if(r.times===void 0){const t=[],n=[];Y2(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 X2{constructor(e,t,n){const i=this;let s=!1,o=0,c=0,h;const u=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this.itemStart=function(d){c++,s===!1&&i.onStart!==void 0&&i.onStart(d,o,c),s=!0},this.itemEnd=function(d){o++,i.onProgress!==void 0&&i.onProgress(d,o,c),o===c&&(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],v=u[A+1];if(g.global&&(g.lastIndex=0),g.test(d))return v}return null}}}const c8=new X2;class ca{constructor(e){this.manager=e!==void 0?e:c8,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 Is={};class u8 extends Error{constructor(e,t){super(e),this.response=t}}class Ll 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(Is[e]!==void 0){Is[e].push({onLoad:t,onProgress:n,onError:i});return}Is[e]=[],Is[e].push({onLoad:t,onProgress:n,onError:i});const o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),c=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=Is[e],A=u.body.getReader(),p=u.headers.get("Content-Length")||u.headers.get("X-File-Size"),g=p?parseInt(p):0,v=g!==0;let E=0;const m=new ReadableStream({start(_){w();function w(){A.read().then(({done:x,value:I})=>{if(x)_.close();else{E+=I.byteLength;const R=new ProgressEvent("progress",{lengthComputable:v,loaded:E,total:g});for(let M=0,T=d.length;M<T;M++){const D=d[M];D.onProgress&&D.onProgress(R)}_.enqueue(I),w()}})}}});return new Response(m)}else throw new u8(`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,c));case"json":return u.json();default:if(c===void 0)return u.text();{const d=/charset="?([^;"\s]*)"?/i.exec(c),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=Is[e];delete Is[e];for(let A=0,p=d.length;A<p;A++){const g=d[A];g.onLoad&&g.onLoad(u)}}).catch(u=>{const d=Is[e];if(d===void 0)throw this.manager.itemError(e),u;delete Is[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 h8 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 c=au("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(){c.removeEventListener("load",h,!1),c.removeEventListener("error",u,!1)}return c.addEventListener("load",h,!1),c.addEventListener("error",u,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(c.crossOrigin=this.crossOrigin),s.manager.itemStart(e),c.src=e,c}}class d8 extends ca{constructor(e){super(e)}load(e,t,n,i){const s=this,o=new Ao,c=new Ll(this.manager);return c.setResponseType("arraybuffer"),c.setRequestHeader(this.requestHeader),c.setPath(this.path),c.setWithCredentials(s.withCredentials),c.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:xi,o.wrapT=u.wrapT!==void 0?u.wrapT:xi,o.magFilter=u.magFilter!==void 0?u.magFilter:pr,o.minFilter=u.minFilter!==void 0?u.minFilter:pr,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=wi),u.mipmapCount===1&&(o.minFilter=pr),u.generateMipmaps!==void 0&&(o.generateMipmaps=u.generateMipmaps),o.needsUpdate=!0,t&&t(o,u)},n,i),o}}class K2 extends ca{constructor(e){super(e)}load(e,t,n,i){const s=new Tr,o=new h8(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(e,function(c){s.image=c,s.needsUpdate=!0,t!==void 0&&t(s)},n,i),s}}class kd extends Zt{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new Ke(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 f8 extends kd{constructor(e,t,n){super(e,n),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(Zt.DEFAULT_UP),this.updateMatrix(),this.groundColor=new Ke(t)}copy(e,t){return super.copy(e,t),this.groundColor.copy(e.groundColor),this}}const hg=new st,J2=new j,Z2=new j;class dg{constructor(e){this.camera=e,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Ge(512,512),this.map=null,this.mapPass=null,this.matrix=new st,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new WA,this._frameExtents=new Ge(1,1),this._viewportCount=1,this._viewports=[new Ot(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,n=this.matrix;J2.setFromMatrixPosition(e.matrixWorld),t.position.copy(J2),Z2.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(Z2),t.updateMatrixWorld(),hg.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(hg),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(hg)}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 p8 extends dg{constructor(){super(new un(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(e){const t=this.camera,n=ol*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 A8 extends kd{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 p8}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 $2=new st,vu=new j,fg=new j;class g8 extends dg{constructor(){super(new un(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new Ge(4,2),this._viewportCount=6,this._viewports=[new Ot(2,1,1,1),new Ot(0,1,1,1),new Ot(3,1,1,1),new Ot(1,1,1,1),new Ot(3,0,1,1),new Ot(1,0,1,1)],this._cubeDirections=[new j(1,0,0),new j(-1,0,0),new j(0,0,1),new j(0,0,-1),new j(0,1,0),new j(0,-1,0)],this._cubeUps=[new j(0,1,0),new j(0,1,0),new j(0,1,0),new j(0,1,0),new j(0,0,1),new j(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()),vu.setFromMatrixPosition(e.matrixWorld),n.position.copy(vu),fg.copy(n.position),fg.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt(fg),n.updateMatrixWorld(),i.makeTranslation(-vu.x,-vu.y,-vu.z),$2.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix($2)}}class m8 extends kd{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 g8}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 _8 extends dg{constructor(){super(new pu(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class ex extends kd{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 _8}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class yu{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 v8 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 c={};c.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",c.headers=this.requestHeader;const h=fetch(e,c).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 y8{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=tx(),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=tx();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function tx(){return(typeof performance>"u"?Date:performance).now()}const pg="\\[\\]\\.:\\/",E8=new RegExp("["+pg+"]","g"),Ag="[^"+pg+"]",x8="[^"+pg.replace("\\.","")+"]",w8=/((?:WC+[\/:])*)/.source.replace("WC",Ag),I8=/(WCOD+)?/.source.replace("WCOD",x8),C8=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Ag),S8=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Ag),M8=new RegExp("^"+w8+I8+C8+S8+"$"),T8=["material","materials","bones","map"];class B8{constructor(e,t,n){const i=n||Ut.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 Ut{constructor(e,t,n){this.path=t,this.parsedPath=n||Ut.parseTrackName(t),this.node=Ut.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 Ut.Composite(e,t,n):new Ut(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(E8,"")}static parseTrackName(e){const t=M8.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);T8.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 c=s[o];if(c.name===t||c.uuid===t)return c;const h=n(c.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=Ut.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 c=this.Versioning.None;this.targetObject=e,e.needsUpdate!==void 0?c=this.Versioning.NeedsUpdate:e.matrixWorldNeedsUpdate!==void 0&&(c=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][c]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}Ut.Composite=B8,Ut.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Ut.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},Ut.prototype.GetterByBindingType=[Ut.prototype._getValue_direct,Ut.prototype._getValue_array,Ut.prototype._getValue_arrayElement,Ut.prototype._getValue_toArray],Ut.prototype.SetterByBindingTypeAndVersioning=[[Ut.prototype._setValue_direct,Ut.prototype._setValue_direct_setNeedsUpdate,Ut.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[Ut.prototype._setValue_array,Ut.prototype._setValue_array_setNeedsUpdate,Ut.prototype._setValue_array_setMatrixWorldNeedsUpdate],[Ut.prototype._setValue_arrayElement,Ut.prototype._setValue_arrayElement_setNeedsUpdate,Ut.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[Ut.prototype._setValue_fromArray,Ut.prototype._setValue_fromArray_setNeedsUpdate,Ut.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class rx{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(Mr(t/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}const nx=new j,Qd=new j;class Cs{constructor(e=new j,t=new j){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){nx.subVectors(e,this.start),Qd.subVectors(this.end,this.start);const n=Qd.dot(Qd);let i=Qd.dot(nx)/n;return t&&(i=Mr(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:Vh}})),typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=Vh);const ix={type:"change"},gg={type:"start"},sx={type:"end"},Fd=new cu,ax=new Xi,b8=Math.cos(70*SA.DEG2RAD);class R8 extends so{constructor(e,t){super(),this.object=e,this.domElement=t,this.domElement.style.touchAction="none",this.enabled=!0,this.target=new j,this.cursor=new j,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:el.ROTATE,MIDDLE:el.DOLLY,RIGHT:el.PAN},this.touches={ONE:tl.ROTATE,TWO:tl.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 c.phi},this.getAzimuthalAngle=function(){return c.theta},this.getDistance=function(){return this.object.position.distanceTo(this.target)},this.listenToKeyEvents=function(V){V.addEventListener("keydown",Be),this._domElementKeyEvents=V},this.stopListenToKeyEvents=function(){this._domElementKeyEvents.removeEventListener("keydown",Be),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(ix),n.update(),s=i.NONE},this.update=function(){const V=new j,F=new Wi().setFromUnitVectors(e.up,new j(0,1,0)),ge=F.clone().invert(),_e=new j,ze=new Wi,Ne=new j,_t=2*Math.PI;return function(Dt=null){const Lt=n.object.position;V.copy(Lt).sub(n.target),V.applyQuaternion(F),c.setFromVector3(V),n.autoRotate&&s===i.NONE&&P(S(Dt)),n.enableDamping?(c.theta+=h.theta*n.dampingFactor,c.phi+=h.phi*n.dampingFactor):(c.theta+=h.theta,c.phi+=h.phi);let Mt=n.minAzimuthAngle,vt=n.maxAzimuthAngle;isFinite(Mt)&&isFinite(vt)&&(Mt<-Math.PI?Mt+=_t:Mt>Math.PI&&(Mt-=_t),vt<-Math.PI?vt+=_t:vt>Math.PI&&(vt-=_t),Mt<=vt?c.theta=Math.max(Mt,Math.min(vt,c.theta)):c.theta=c.theta>(Mt+vt)/2?Math.max(Mt,c.theta):Math.min(vt,c.theta)),c.phi=Math.max(n.minPolarAngle,Math.min(n.maxPolarAngle,c.phi)),c.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 hr=!1;if(n.zoomToCursor&&M||n.object.isOrthographicCamera)c.radius=Q(c.radius);else{const Vt=c.radius;c.radius=Q(c.radius*u),hr=Vt!=c.radius}if(V.setFromSpherical(c),V.applyQuaternion(ge),Lt.copy(n.target).add(V),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&&M){let Vt=null;if(n.object.isPerspectiveCamera){const _r=V.length();Vt=Q(_r*u);const bn=_r-Vt;n.object.position.addScaledVector(I,bn),n.object.updateMatrixWorld(),hr=!!bn}else if(n.object.isOrthographicCamera){const _r=new j(R.x,R.y,0);_r.unproject(n.object);const bn=n.object.zoom;n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/u)),n.object.updateProjectionMatrix(),hr=bn!==n.object.zoom;const qt=new j(R.x,R.y,0);qt.unproject(n.object),n.object.position.sub(qt).add(_r),n.object.updateMatrixWorld(),Vt=V.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):(Fd.origin.copy(n.object.position),Fd.direction.set(0,0,-1).transformDirection(n.object.matrix),Math.abs(n.object.up.dot(Fd.direction))<b8?e.lookAt(n.target):(ax.setFromNormalAndCoplanarPoint(n.object.up,n.target),Fd.intersectPlane(ax,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(),hr=!0)}return u=1,M=!1,hr||_e.distanceToSquared(n.object.position)>o||8*(1-ze.dot(n.object.quaternion))>o||Ne.distanceToSquared(n.target)>o?(n.dispatchEvent(ix),_e.copy(n.object.position),ze.copy(n.object.quaternion),Ne.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",Ce),n.domElement.removeEventListener("pointermove",Ae),n.domElement.removeEventListener("pointerup",me),n.domElement.getRootNode().removeEventListener("keydown",ve,{capture:!0}),n._domElementKeyEvents!==null&&(n._domElementKeyEvents.removeEventListener("keydown",Be),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,c=new rx,h=new rx;let u=1;const d=new j,A=new Ge,p=new Ge,g=new Ge,v=new Ge,E=new Ge,m=new Ge,_=new Ge,w=new Ge,x=new Ge,I=new j,R=new Ge;let M=!1;const T=[],D={};let b=!1;function S(V){return V!==null?2*Math.PI/60*n.autoRotateSpeed*V:2*Math.PI/60/60*n.autoRotateSpeed}function L(V){const F=Math.abs(V*.01);return Math.pow(.95,n.zoomSpeed*F)}function P(V){h.theta-=V}function N(V){h.phi-=V}const W=function(){const V=new j;return function(F,ge){V.setFromMatrixColumn(ge,0),V.multiplyScalar(-F),d.add(V)}}(),X=function(){const V=new j;return function(F,ge){n.screenSpacePanning===!0?V.setFromMatrixColumn(ge,1):(V.setFromMatrixColumn(ge,0),V.crossVectors(n.object.up,V)),V.multiplyScalar(F),d.add(V)}}(),K=function(){const V=new j;return function(F,ge){const _e=n.domElement;if(n.object.isPerspectiveCamera){const ze=n.object.position;V.copy(ze).sub(n.target);let Ne=V.length();Ne*=Math.tan(n.object.fov/2*Math.PI/180),W(2*F*Ne/_e.clientHeight,n.object.matrix),X(2*ge*Ne/_e.clientHeight,n.object.matrix)}else n.object.isOrthographicCamera?(W(F*(n.object.right-n.object.left)/n.object.zoom/_e.clientWidth,n.object.matrix),X(ge*(n.object.top-n.object.bottom)/n.object.zoom/_e.clientHeight,n.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),n.enablePan=!1)}}();function te(V){n.object.isPerspectiveCamera||n.object.isOrthographicCamera?u/=V:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function H(V){n.object.isPerspectiveCamera||n.object.isOrthographicCamera?u*=V:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function ee(V,F){if(!n.zoomToCursor)return;M=!0;const ge=n.domElement.getBoundingClientRect(),_e=V-ge.left,ze=F-ge.top,Ne=ge.width,_t=ge.height;R.x=_e/Ne*2-1,R.y=-(ze/_t)*2+1,I.set(R.x,R.y,1).unproject(n.object).sub(n.object.position).normalize()}function Q(V){return Math.max(n.minDistance,Math.min(n.maxDistance,V))}function z(V){A.set(V.clientX,V.clientY)}function Z(V){ee(V.clientX,V.clientX),_.set(V.clientX,V.clientY)}function re(V){v.set(V.clientX,V.clientY)}function G(V){p.set(V.clientX,V.clientY),g.subVectors(p,A).multiplyScalar(n.rotateSpeed);const F=n.domElement;P(2*Math.PI*g.x/F.clientHeight),N(2*Math.PI*g.y/F.clientHeight),A.copy(p),n.update()}function de(V){w.set(V.clientX,V.clientY),x.subVectors(w,_),x.y>0?te(L(x.y)):x.y<0&&H(L(x.y)),_.copy(w),n.update()}function pe(V){E.set(V.clientX,V.clientY),m.subVectors(E,v).multiplyScalar(n.panSpeed),K(m.x,m.y),v.copy(E),n.update()}function fe(V){ee(V.clientX,V.clientY),V.deltaY<0?H(L(V.deltaY)):V.deltaY>0&&te(L(V.deltaY)),n.update()}function ye(V){let F=!1;switch(V.code){case n.keys.UP:V.ctrlKey||V.metaKey||V.shiftKey?N(2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):K(0,n.keyPanSpeed),F=!0;break;case n.keys.BOTTOM:V.ctrlKey||V.metaKey||V.shiftKey?N(-2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):K(0,-n.keyPanSpeed),F=!0;break;case n.keys.LEFT:V.ctrlKey||V.metaKey||V.shiftKey?P(2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):K(n.keyPanSpeed,0),F=!0;break;case n.keys.RIGHT:V.ctrlKey||V.metaKey||V.shiftKey?P(-2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):K(-n.keyPanSpeed,0),F=!0;break}F&&(V.preventDefault(),n.update())}function Pe(V){if(T.length===1)A.set(V.pageX,V.pageY);else{const F=tt(V),ge=.5*(V.pageX+F.x),_e=.5*(V.pageY+F.y);A.set(ge,_e)}}function at(V){if(T.length===1)v.set(V.pageX,V.pageY);else{const F=tt(V),ge=.5*(V.pageX+F.x),_e=.5*(V.pageY+F.y);v.set(ge,_e)}}function se(V){const F=tt(V),ge=V.pageX-F.x,_e=V.pageY-F.y,ze=Math.sqrt(ge*ge+_e*_e);_.set(0,ze)}function et(V){n.enableZoom&&se(V),n.enablePan&&at(V)}function ke(V){n.enableZoom&&se(V),n.enableRotate&&Pe(V)}function dt(V){if(T.length==1)p.set(V.pageX,V.pageY);else{const ge=tt(V),_e=.5*(V.pageX+ge.x),ze=.5*(V.pageY+ge.y);p.set(_e,ze)}g.subVectors(p,A).multiplyScalar(n.rotateSpeed);const F=n.domElement;P(2*Math.PI*g.x/F.clientHeight),N(2*Math.PI*g.y/F.clientHeight),A.copy(p)}function Xe(V){if(T.length===1)E.set(V.pageX,V.pageY);else{const F=tt(V),ge=.5*(V.pageX+F.x),_e=.5*(V.pageY+F.y);E.set(ge,_e)}m.subVectors(E,v).multiplyScalar(n.panSpeed),K(m.x,m.y),v.copy(E)}function ft(V){const F=tt(V),ge=V.pageX-F.x,_e=V.pageY-F.y,ze=Math.sqrt(ge*ge+_e*_e);w.set(0,ze),x.set(0,Math.pow(w.y/_.y,n.zoomSpeed)),te(x.y),_.copy(w);const Ne=(V.pageX+F.x)*.5,_t=(V.pageY+F.y)*.5;ee(Ne,_t)}function Y(V){n.enableZoom&&ft(V),n.enablePan&&Xe(V)}function k(V){n.enableZoom&&ft(V),n.enableRotate&&dt(V)}function le(V){n.enabled!==!1&&(T.length===0&&(n.domElement.setPointerCapture(V.pointerId),n.domElement.addEventListener("pointermove",Ae),n.domElement.addEventListener("pointerup",me)),!ct(V)&&(nt(V),V.pointerType==="touch"?We(V):Ee(V)))}function Ae(V){n.enabled!==!1&&(V.pointerType==="touch"?Le(V):Oe(V))}function me(V){switch(pt(V),T.length){case 0:n.domElement.releasePointerCapture(V.pointerId),n.domElement.removeEventListener("pointermove",Ae),n.domElement.removeEventListener("pointerup",me),n.dispatchEvent(sx),s=i.NONE;break;case 1:const F=T[0],ge=D[F];We({pointerId:F,pageX:ge.x,pageY:ge.y});break}}function Ee(V){let F;switch(V.button){case 0:F=n.mouseButtons.LEFT;break;case 1:F=n.mouseButtons.MIDDLE;break;case 2:F=n.mouseButtons.RIGHT;break;default:F=-1}switch(F){case el.DOLLY:if(n.enableZoom===!1)return;Z(V),s=i.DOLLY;break;case el.ROTATE:if(V.ctrlKey||V.metaKey||V.shiftKey){if(n.enablePan===!1)return;re(V),s=i.PAN}else{if(n.enableRotate===!1)return;z(V),s=i.ROTATE}break;case el.PAN:if(V.ctrlKey||V.metaKey||V.shiftKey){if(n.enableRotate===!1)return;z(V),s=i.ROTATE}else{if(n.enablePan===!1)return;re(V),s=i.PAN}break;default:s=i.NONE}s!==i.NONE&&n.dispatchEvent(gg)}function Oe(V){switch(s){case i.ROTATE:if(n.enableRotate===!1)return;G(V);break;case i.DOLLY:if(n.enableZoom===!1)return;de(V);break;case i.PAN:if(n.enablePan===!1)return;pe(V);break}}function Ce(V){n.enabled===!1||n.enableZoom===!1||s!==i.NONE||(V.preventDefault(),n.dispatchEvent(gg),fe(Qe(V)),n.dispatchEvent(sx))}function Qe(V){const F=V.deltaMode,ge={clientX:V.clientX,clientY:V.clientY,deltaY:V.deltaY};switch(F){case 1:ge.deltaY*=16;break;case 2:ge.deltaY*=100;break}return V.ctrlKey&&!b&&(ge.deltaY*=10),ge}function ve(V){V.key==="Control"&&(b=!0,n.domElement.getRootNode().addEventListener("keyup",xe,{passive:!0,capture:!0}))}function xe(V){V.key==="Control"&&(b=!1,n.domElement.getRootNode().removeEventListener("keyup",xe,{passive:!0,capture:!0}))}function Be(V){n.enabled===!1||n.enablePan===!1||ye(V)}function We(V){switch(ut(V),T.length){case 1:switch(n.touches.ONE){case tl.ROTATE:if(n.enableRotate===!1)return;Pe(V),s=i.TOUCH_ROTATE;break;case tl.PAN:if(n.enablePan===!1)return;at(V),s=i.TOUCH_PAN;break;default:s=i.NONE}break;case 2:switch(n.touches.TWO){case tl.DOLLY_PAN:if(n.enableZoom===!1&&n.enablePan===!1)return;et(V),s=i.TOUCH_DOLLY_PAN;break;case tl.DOLLY_ROTATE:if(n.enableZoom===!1&&n.enableRotate===!1)return;ke(V),s=i.TOUCH_DOLLY_ROTATE;break;default:s=i.NONE}break;default:s=i.NONE}s!==i.NONE&&n.dispatchEvent(gg)}function Le(V){switch(ut(V),s){case i.TOUCH_ROTATE:if(n.enableRotate===!1)return;dt(V),n.update();break;case i.TOUCH_PAN:if(n.enablePan===!1)return;Xe(V),n.update();break;case i.TOUCH_DOLLY_PAN:if(n.enableZoom===!1&&n.enablePan===!1)return;Y(V),n.update();break;case i.TOUCH_DOLLY_ROTATE:if(n.enableZoom===!1&&n.enableRotate===!1)return;k(V),n.update();break;default:s=i.NONE}}function be(V){n.enabled!==!1&&V.preventDefault()}function nt(V){T.push(V.pointerId)}function pt(V){delete D[V.pointerId];for(let F=0;F<T.length;F++)if(T[F]==V.pointerId){T.splice(F,1);return}}function ct(V){for(let F=0;F<T.length;F++)if(T[F]==V.pointerId)return!0;return!1}function ut(V){let F=D[V.pointerId];F===void 0&&(F=new Ge,D[V.pointerId]=F),F.set(V.pageX,V.pageY)}function tt(V){const F=V.pointerId===T[0]?T[1]:T[0];return D[F]}n.domElement.addEventListener("contextmenu",be),n.domElement.addEventListener("pointerdown",le),n.domElement.addEventListener("pointercancel",me),n.domElement.addEventListener("wheel",Ce,{passive:!1}),n.domElement.getRootNode().addEventListener("keydown",ve,{passive:!0,capture:!0}),this.update()}}function ox(r,e){if(e===sb)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),r;if(e===wA||e===gE){let t=r.getIndex();if(t===null){const o=[],c=r.getAttribute("position");if(c!==void 0){for(let h=0;h<c.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===wA)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 D8 extends ca{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new k8(t)}),this.register(function(t){return new W8(t)}),this.register(function(t){return new Y8(t)}),this.register(function(t){return new q8(t)}),this.register(function(t){return new F8(t)}),this.register(function(t){return new O8(t)}),this.register(function(t){return new z8(t)}),this.register(function(t){return new H8(t)}),this.register(function(t){return new P8(t)}),this.register(function(t){return new G8(t)}),this.register(function(t){return new Q8(t)}),this.register(function(t){return new j8(t)}),this.register(function(t){return new V8(t)}),this.register(function(t){return new N8(t)}),this.register(function(t){return new X8(t)}),this.register(function(t){return new K8(t)})}load(e,t,n,i){const s=this;let o;if(this.resourcePath!=="")o=this.resourcePath;else if(this.path!==""){const u=yu.extractUrlBase(e);o=yu.resolveURL(u,this.path)}else o=yu.extractUrlBase(e);this.manager.itemStart(e);const c=function(u){i?i(u):console.error(u),s.manager.itemError(e),s.manager.itemEnd(e)},h=new Ll(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)},c)}catch(d){c(d)}},n,c)}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={},c={},h=new TextDecoder;if(typeof e=="string")s=JSON.parse(e);else if(e instanceof ArrayBuffer)if(h.decode(new Uint8Array(e,0,4))===lx){try{o[xt.KHR_BINARY_GLTF]=new J8(e)}catch(d){i&&i(d);return}s=JSON.parse(o[xt.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 uN(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"),c[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 xt.KHR_MATERIALS_UNLIT:o[A]=new U8;break;case xt.KHR_DRACO_MESH_COMPRESSION:o[A]=new Z8(s,this.dracoLoader);break;case xt.KHR_TEXTURE_TRANSFORM:o[A]=new $8;break;case xt.KHR_MESH_QUANTIZATION:o[A]=new eN;break;default:p.indexOf(A)>=0&&c[A]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+A+'".')}}u.setExtensions(o),u.setPlugins(c),u.parse(n,i)}parseAsync(e,t){const n=this;return new Promise(function(i,s){n.parse(e,t,i,s)})}}function L8(){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 xt={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 N8{constructor(e){this.parser=e,this.name=xt.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 c;const h=new Ke(16777215);o.color!==void 0&&h.setRGB(o.color[0],o.color[1],o.color[2],Sr);const u=o.range!==void 0?o.range:0;switch(o.type){case"directional":c=new ex(h),c.target.position.set(0,0,-1),c.add(c.target);break;case"point":c=new m8(h),c.distance=u;break;case"spot":c=new A8(h),c.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,c.angle=o.spot.outerConeAngle,c.penumbra=1-o.spot.innerConeAngle/o.spot.outerConeAngle,c.target.position.set(0,0,-1),c.add(c.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+o.type)}return c.position.set(0,0,0),c.decay=2,ha(c,o),o.intensity!==void 0&&(c.intensity=o.intensity),c.name=t.createUniqueName(o.name||"light_"+e),i=Promise.resolve(c),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 U8{constructor(){this.name=xt.KHR_MATERIALS_UNLIT}getMaterialType(){return xs}extendParams(e,t,n){const i=[];e.color=new Ke(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],Sr),e.opacity=o[3]}s.baseColorTexture!==void 0&&i.push(n.assignTexture(e,"map",s.baseColorTexture,Qr))}return Promise.all(i)}}class P8{constructor(e){this.parser=e,this.name=xt.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 k8{constructor(e){this.parser=e,this.name=xt.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:Li}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 c=o.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new Ge(c,c)}return Promise.all(s)}}class Q8{constructor(e){this.parser=e,this.name=xt.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:Li}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 F8{constructor(e){this.parser=e,this.name=xt.KHR_MATERIALS_SHEEN}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:Li}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 Ke(0,0,0),t.sheenRoughness=0,t.sheen=1;const o=i.extensions[this.name];if(o.sheenColorFactor!==void 0){const c=o.sheenColorFactor;t.sheenColor.setRGB(c[0],c[1],c[2],Sr)}return o.sheenRoughnessFactor!==void 0&&(t.sheenRoughness=o.sheenRoughnessFactor),o.sheenColorTexture!==void 0&&s.push(n.assignTexture(t,"sheenColorMap",o.sheenColorTexture,Qr)),o.sheenRoughnessTexture!==void 0&&s.push(n.assignTexture(t,"sheenRoughnessMap",o.sheenRoughnessTexture)),Promise.all(s)}}class O8{constructor(e){this.parser=e,this.name=xt.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:Li}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 z8{constructor(e){this.parser=e,this.name=xt.KHR_MATERIALS_VOLUME}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:Li}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 c=o.attenuationColor||[1,1,1];return t.attenuationColor=new Ke().setRGB(c[0],c[1],c[2],Sr),Promise.all(s)}}class H8{constructor(e){this.parser=e,this.name=xt.KHR_MATERIALS_IOR}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:Li}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 G8{constructor(e){this.parser=e,this.name=xt.KHR_MATERIALS_SPECULAR}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:Li}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 c=o.specularColorFactor||[1,1,1];return t.specularColor=new Ke().setRGB(c[0],c[1],c[2],Sr),o.specularColorTexture!==void 0&&s.push(n.assignTexture(t,"specularColorMap",o.specularColorTexture,Qr)),Promise.all(s)}}class V8{constructor(e){this.parser=e,this.name=xt.EXT_MATERIALS_BUMP}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:Li}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 j8{constructor(e){this.parser=e,this.name=xt.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){const t=this.parser.json.materials[e];return!t.extensions||!t.extensions[this.name]?null:Li}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 W8{constructor(e){this.parser=e,this.name=xt.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 Y8{constructor(e){this.parser=e,this.name=xt.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],c=i.images[o.source];let h=n.textureLoader;if(c.uri){const u=n.options.manager.getHandler(c.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 q8{constructor(e){this.parser=e,this.name=xt.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],c=i.images[o.source];let h=n.textureLoader;if(c.uri){const u=n.options.manager.getHandler(c.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 X8{constructor(e){this.name=xt.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(c){const h=i.byteOffset||0,u=i.byteLength||0,d=i.count,A=i.byteStride,p=new Uint8Array(c,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 K8{constructor(e){this.name=xt.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!==ii.TRIANGLES&&h.mode!==ii.TRIANGLE_STRIP&&h.mode!==ii.TRIANGLE_FAN&&h.mode!==void 0)return null;const s=n.extensions[this.name].attributes,o=[],c={};for(const h in s)o.push(this.parser.getDependency("accessor",s[h]).then(u=>(c[h]=u,c[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 v=new st,E=new j,m=new Wi,_=new j(1,1,1),w=new YL(g.geometry,g.material,A);for(let x=0;x<A;x++)c.TRANSLATION&&E.fromBufferAttribute(c.TRANSLATION,x),c.ROTATION&&m.fromBufferAttribute(c.ROTATION,x),c.SCALE&&_.fromBufferAttribute(c.SCALE,x),w.setMatrixAt(x,v.compose(E,m,_));for(const x in c)if(x==="_COLOR_0"){const I=c[x];w.instanceColor=new ag(I.array,I.itemSize,I.normalized)}else x!=="TRANSLATION"&&x!=="ROTATION"&&x!=="SCALE"&&g.geometry.setAttribute(x,c[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 lx="glTF",Eu=12,cx={JSON:1313821514,BIN:5130562};class J8{constructor(e){this.name=xt.KHR_BINARY_GLTF,this.content=null,this.body=null;const t=new DataView(e,0,Eu),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!==lx)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-Eu,s=new DataView(e,Eu);let o=0;for(;o<i;){const c=s.getUint32(o,!0);o+=4;const h=s.getUint32(o,!0);if(o+=4,h===cx.JSON){const u=new Uint8Array(e,Eu+o,c);this.content=n.decode(u)}else if(h===cx.BIN){const u=Eu+o;this.body=e.slice(u,u+c)}o+=c}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class Z8{constructor(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=xt.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,c={},h={},u={};for(const d in o){const A=_g[d]||d.toLowerCase();c[A]=o[d]}for(const d in e.attributes){const A=_g[d]||d.toLowerCase();if(o[d]!==void 0){const p=n.accessors[e.attributes[d]],g=Nl[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 v in g.attributes){const E=g.attributes[v],m=h[v];m!==void 0&&(E.normalized=m)}A(g)},c,u,Sr,p)})})}}class $8{constructor(){this.name=xt.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 eN{constructor(){this.name=xt.KHR_MESH_QUANTIZATION}}class ux extends _u{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,c=this.valueSize,h=c*2,u=c*3,d=i-t,A=(n-t)/d,p=A*A,g=p*A,v=e*u,E=v-u,m=-2*g+3*p,_=g-p,w=1-m,x=_-p+A;for(let I=0;I!==c;I++){const R=o[E+I+c],M=o[E+I+h]*d,T=o[v+I+c],D=o[v+I]*d;s[I]=w*R+x*M+m*T+_*D}return s}}const tN=new Wi;class rN extends ux{interpolate_(e,t,n,i){const s=super.interpolate_(e,t,n,i);return tN.fromArray(s).normalize().toArray(s),s}}const ii={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},Nl={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},hx={9728:fr,9729:pr,9984:Vy,9985:qh,9986:Jc,9987:wi},dx={33071:xi,33648:Yh,10497:$s},mg={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},_g={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"},nN={CUBICSPLINE:void 0,LINEAR:sl,STEP:ru},vg={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function iN(r){return r.DefaultMaterial===void 0&&(r.DefaultMaterial=new ug({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:yi})),r.DefaultMaterial}function mo(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 sN(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=[],c=[],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;c.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(c),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 aN(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 oN(r){let e;const t=r.extensions&&r.extensions[xt.KHR_DRACO_MESH_COMPRESSION];if(t?e="draco:"+t.bufferView+":"+t.indices+":"+yg(t.attributes):e=r.indices+":"+yg(r.attributes)+":"+r.mode,r.targets!==void 0)for(let n=0,i=r.targets.length;n<i;n++)e+=":"+yg(r.targets[n]);return e}function yg(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 Eg(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 lN(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 cN=new st;class uN{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new L8,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 K2(this.options.manager):this.textureLoader=new v8(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new Ll(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 c={scene:o[0][i.scene||0],scenes:o[0],animations:o[1],cameras:o[2],asset:i.asset,parser:n,userData:{}};return mo(s,c,i),ha(c,i),Promise.all(n._invokeAll(function(h){return h.afterRoot&&h.afterRoot(c)})).then(function(){for(const h of c.scenes)h.updateMatrixWorld();e(c)})}).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 c=0,h=o.length;c<h;c++)e[o[c]].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,c)=>{const h=this.associations.get(o);h!=null&&this.associations.set(c,h);for(const[u,d]of o.children.entries())s(d,c.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[xt.KHR_BINARY_GLTF].body);const i=this.options;return new Promise(function(s,o){n.load(yu.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],c=Nl[i.componentType],h=i.normalized===!0,u=new c(i.count*o);return Promise.resolve(new Fr(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 c=o[0],h=mg[i.type],u=Nl[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,v=i.normalized===!0;let E,m;if(g&&g!==A){const _=Math.floor(p/g),w="InterleavedBuffer:"+i.bufferView+":"+i.componentType+":"+_+":"+i.count;let x=t.cache.get(w);x||(E=new u(c,_*g,i.count*g/d),x=new HL(E,g/d),t.cache.add(w,x)),m=new rg(x,h,p%g/d,v)}else c===null?E=new u(i.count*h):E=new u(c,p,i.count*h),m=new Fr(E,h,v);if(i.sparse!==void 0){const _=mg.SCALAR,w=Nl[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*_),M=new u(o[2],I,i.sparse.count*h);c!==null&&(m=new Fr(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,M[T*h]),h>=2&&m.setY(b,M[T*h+1]),h>=3&&m.setZ(b,M[T*h+2]),h>=4&&m.setW(b,M[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 c=n.manager.getHandler(s.uri);c!==null&&(o=c)}return this.loadTextureImage(e,i,o)}loadTextureImage(e,t,n){const i=this,s=this.json,o=s.textures[e],c=s.images[t],h=(c.uri||c.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||c.name||"",d.name===""&&typeof c.uri=="string"&&c.uri.startsWith("data:image/")===!1&&(d.name=c.uri);const A=(s.samplers||{})[o.sampler]||{};return d.magFilter=hx[A.magFilter]||pr,d.minFilter=hx[A.minFilter]||wi,d.wrapS=dx[A.wrapS]||$s,d.wrapT=dx[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],c=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=c.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 v=p;t.isImageBitmapLoader===!0&&(v=function(E){const m=new Tr(E);m.needsUpdate=!0,p(m)}),t.load(yu.resolveURL(A,s.path),v,void 0,g)})}).then(function(A){return u===!0&&c.revokeObjectURL(h),A.userData.mimeType=o.mimeType||lN(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[xt.KHR_TEXTURE_TRANSFORM]){const c=n.extensions!==void 0?n.extensions[xt.KHR_TEXTURE_TRANSFORM]:void 0;if(c){const h=s.associations.get(o);o=s.extensions[xt.KHR_TEXTURE_TRANSFORM].extendTexture(o,c),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 c="PointsMaterial:"+n.uuid;let h=this.cache.get(c);h||(h=new G2,qi.prototype.copy.call(h,n),h.color.copy(n.color),h.map=n.map,h.sizeAttenuation=!1,this.cache.add(c,h)),n=h}else if(e.isLine){const c="LineBasicMaterial:"+n.uuid;let h=this.cache.get(c);h||(h=new k2,qi.prototype.copy.call(h,n),h.color.copy(n.color),h.map=n.map,this.cache.add(c,h)),n=h}if(i||s||o){let c="ClonedMaterial:"+n.uuid+":";i&&(c+="derivative-tangents:"),s&&(c+="vertex-colors:"),o&&(c+="flat-shading:");let h=this.cache.get(c);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(c,h),this.associations.set(h,this.associations.get(n))),n=h}e.material=n}getMaterialType(){return ug}loadMaterial(e){const t=this,n=this.json,i=this.extensions,s=n.materials[e];let o;const c={},h=s.extensions||{},u=[];if(h[xt.KHR_MATERIALS_UNLIT]){const A=i[xt.KHR_MATERIALS_UNLIT];o=A.getMaterialType(),u.push(A.extendParams(c,s,t))}else{const A=s.pbrMetallicRoughness||{};if(c.color=new Ke(1,1,1),c.opacity=1,Array.isArray(A.baseColorFactor)){const p=A.baseColorFactor;c.color.setRGB(p[0],p[1],p[2],Sr),c.opacity=p[3]}A.baseColorTexture!==void 0&&u.push(t.assignTexture(c,"map",A.baseColorTexture,Qr)),c.metalness=A.metallicFactor!==void 0?A.metallicFactor:1,c.roughness=A.roughnessFactor!==void 0?A.roughnessFactor:1,A.metallicRoughnessTexture!==void 0&&(u.push(t.assignTexture(c,"metalnessMap",A.metallicRoughnessTexture)),u.push(t.assignTexture(c,"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,c)})))}s.doubleSided===!0&&(c.side=Ei);const d=s.alphaMode||vg.OPAQUE;if(d===vg.BLEND?(c.transparent=!0,c.depthWrite=!1):(c.transparent=!1,d===vg.MASK&&(c.alphaTest=s.alphaCutoff!==void 0?s.alphaCutoff:.5)),s.normalTexture!==void 0&&o!==xs&&(u.push(t.assignTexture(c,"normalMap",s.normalTexture)),c.normalScale=new Ge(1,1),s.normalTexture.scale!==void 0)){const A=s.normalTexture.scale;c.normalScale.set(A,A)}if(s.occlusionTexture!==void 0&&o!==xs&&(u.push(t.assignTexture(c,"aoMap",s.occlusionTexture)),s.occlusionTexture.strength!==void 0&&(c.aoMapIntensity=s.occlusionTexture.strength)),s.emissiveFactor!==void 0&&o!==xs){const A=s.emissiveFactor;c.emissive=new Ke().setRGB(A[0],A[1],A[2],Sr)}return s.emissiveTexture!==void 0&&o!==xs&&u.push(t.assignTexture(c,"emissiveMap",s.emissiveTexture,Qr)),Promise.all(u).then(function(){const A=new o(c);return s.name&&(A.name=s.name),ha(A,s),t.associations.set(A,{materials:e}),s.extensions&&mo(i,A,s),A})}createUniqueName(e){const t=Ut.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(c){return n[xt.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(c,t).then(function(h){return fx(h,c,t)})}const o=[];for(let c=0,h=e.length;c<h;c++){const u=e[c],d=oN(u),A=i[d];if(A)o.push(A.promise);else{let p;u.extensions&&u.extensions[xt.KHR_DRACO_MESH_COMPRESSION]?p=s(u):p=fx(new Gn,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,c=[];for(let h=0,u=o.length;h<u;h++){const d=o[h].material===void 0?iN(this.cache):this.getDependency("material",o[h].material);c.push(d)}return c.push(t.loadGeometries(o)),Promise.all(c).then(function(h){const u=h.slice(0,h.length-1),d=h[h.length-1],A=[];for(let g=0,v=d.length;g<v;g++){const E=d[g],m=o[g];let _;const w=u[g];if(m.mode===ii.TRIANGLES||m.mode===ii.TRIANGLE_STRIP||m.mode===ii.TRIANGLE_FAN||m.mode===void 0)_=s.isSkinnedMesh===!0?new VL(E,w):new Yr(E,w),_.isSkinnedMesh===!0&&_.normalizeSkinWeights(),m.mode===ii.TRIANGLE_STRIP?_.geometry=ox(_.geometry,gE):m.mode===ii.TRIANGLE_FAN&&(_.geometry=ox(_.geometry,wA));else if(m.mode===ii.LINES)_=new qL(E,w);else if(m.mode===ii.LINE_STRIP)_=new lg(E,w);else if(m.mode===ii.LINE_LOOP)_=new XL(E,w);else if(m.mode===ii.POINTS)_=new KL(E,w);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+m.mode);Object.keys(_.geometry.morphAttributes).length>0&&aN(_,s),_.name=t.createUniqueName(s.name||"mesh_"+e),ha(_,s),m.extensions&&mo(i,_,m),t.assignFinalMaterial(_),A.push(_)}for(let g=0,v=A.length;g<v;g++)t.associations.set(A[g],{meshes:e,primitives:g});if(A.length===1)return s.extensions&&mo(i,A[0],s),A[0];const p=new oa;s.extensions&&mo(i,p,s),t.associations.set(p,{meshes:e});for(let g=0,v=A.length;g<v;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 un(SA.radToDeg(i.yfov),i.aspectRatio||1,i.znear||1,i.zfar||2e6):n.type==="orthographic"&&(t=new pu(-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,c=[],h=[];for(let u=0,d=o.length;u<d;u++){const A=o[u];if(A){c.push(A);const p=new st;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 sg(c,h)})}loadAnimation(e){const t=this.json,n=this,i=t.animations[e],s=i.name?i.name:"animation_"+e,o=[],c=[],h=[],u=[],d=[];for(let A=0,p=i.channels.length;A<p;A++){const g=i.channels[A],v=i.samplers[g.sampler],E=g.target,m=E.node,_=i.parameters!==void 0?i.parameters[v.input]:v.input,w=i.parameters!==void 0?i.parameters[v.output]:v.output;E.node!==void 0&&(o.push(this.getDependency("node",m)),c.push(this.getDependency("accessor",_)),h.push(this.getDependency("accessor",w)),u.push(v),d.push(E))}return Promise.all([Promise.all(o),Promise.all(c),Promise.all(h),Promise.all(u),Promise.all(d)]).then(function(A){const p=A[0],g=A[1],v=A[2],E=A[3],m=A[4],_=[];for(let w=0,x=p.length;w<x;w++){const I=p[w],R=g[w],M=v[w],T=E[w],D=m[w];if(I===void 0)continue;I.updateMatrix&&I.updateMatrix();const b=n._createAnimationTracks(I,R,M,T,D);if(b)for(let S=0;S<b.length;S++)_.push(b[S])}return new a8(s,void 0,_)})}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(c){if(c.isMesh)for(let h=0,u=i.weights.length;h<u;h++)c.morphTargetInfluences[h]=i.weights[h]}),o})}loadNode(e){const t=this.json,n=this,i=t.nodes[e],s=n._loadNodeShallow(e),o=[],c=i.children||[];for(let u=0,d=c.length;u<d;u++)o.push(n.getDependency("node",c[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,cN)});for(let g=0,v=A.length;g<v;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):"",c=[],h=i._invokeOne(function(u){return u.createNodeMesh&&u.createNodeMesh(e)});return h&&c.push(h),s.camera!==void 0&&c.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){c.push(u)}),this.nodeCache[e]=Promise.all(c).then(function(u){let d;if(s.isBone===!0?d=new L2: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&&mo(n,d,s),s.matrix!==void 0){const A=new st;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&&mo(t,s,n);const o=n.nodes||[],c=[];for(let h=0,u=o.length;h<u;h++)c.push(i.getDependency("node",o[h]));return Promise.all(c).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 qi||p instanceof Tr)&&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=[],c=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(c);let u;switch(ua[s.path]){case ua.weights:u=bl;break;case ua.rotation:u=go;break;case ua.position:case ua.scale:u=Dl;break;default:switch(n.itemSize){case 1:u=bl;break;case 2:case 3:default:u=Dl;break}break}const d=i.interpolation!==void 0?nN[i.interpolation]:sl,A=this._getArrayFromAccessor(n);for(let p=0,g=h.length;p<g;p++){const v=new u(h[p]+"."+ua[s.path],t.array,A,d);i.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(v),o.push(v)}return o}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){const n=Eg(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 go?rN:ux;return new n(this.times,this.values,this.getValueSize()/3,t)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function hN(r,e,t){const n=e.attributes,i=new Er;if(n.POSITION!==void 0){const c=t.json.accessors[n.POSITION],h=c.min,u=c.max;if(h!==void 0&&u!==void 0){if(i.set(new j(h[0],h[1],h[2]),new j(u[0],u[1],u[2])),c.normalized){const d=Eg(Nl[c.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 c=new j,h=new j;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,v=p.max;if(g!==void 0&&v!==void 0){if(h.setX(Math.max(Math.abs(g[0]),Math.abs(v[0]))),h.setY(Math.max(Math.abs(g[1]),Math.abs(v[1]))),h.setZ(Math.max(Math.abs(g[2]),Math.abs(v[2]))),p.normalized){const E=Eg(Nl[p.componentType]);h.multiplyScalar(E)}c.max(h)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}i.expandByVector(c)}r.boundingBox=i;const o=new Bi;i.getCenter(o.center),o.radius=i.min.distanceTo(i.max)/2,r.boundingSphere=o}function fx(r,e,t){const n=e.attributes,i=[];function s(o,c){return t.getDependency("accessor",o).then(function(h){r.setAttribute(c,h)})}for(const o in n){const c=_g[o]||o.toLowerCase();c in r.attributes||i.push(s(n[o],c))}if(e.indices!==void 0&&!r.index){const o=t.getDependency("accessor",e.indices).then(function(c){r.setIndex(c)});i.push(o)}return Rt.workingColorSpace!==Sr&&"COLOR_0"in n&&console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${Rt.workingColorSpace}" not supported.`),ha(r,e),hN(r,e,t),Promise.all(i).then(function(){return e.targets!==void 0?sN(r,e.targets,t):r})}class dN{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,px=2,pN=1,Ax=2,AN=0,gN=1,mN=10,_N=0,gx=9,mx=15,_x=16,vx=22,yx=37,Ex=43,xx=76,wx=83,Ix=97,Cx=100,Sx=103,Mx=109,Tx=165,Bx=166;class vN{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 xu{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 dn=[171,75,84,88,32,50,48,187,13,10,26,10];function bx(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,dn.length);if(e[0]!==dn[0]||e[1]!==dn[1]||e[2]!==dn[2]||e[3]!==dn[3]||e[4]!==dn[4]||e[5]!==dn[5]||e[6]!==dn[6]||e[7]!==dn[7]||e[8]!==dn[8]||e[9]!==dn[9]||e[10]!==dn[10]||e[11]!==dn[11])throw new Error("Missing KTX 2.0 identifier.");const t=new vN,n=17*Uint32Array.BYTES_PER_ELEMENT,i=new xu(r,dn.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(),c=i._nextUint32(),h=i._nextUint32(),u=i._nextUint32(),d=i._nextUint64(),A=i._nextUint64(),p=new xu(r,dn.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 xu(r,o,c,!0),v={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=(v.descriptorBlockSize/4-6)/4;for(let te=0;te<E;te++){const H={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&H.channelType?(H.sampleLower=g._nextInt32(),H.sampleUpper=g._nextInt32()):(H.sampleLower=g._nextUint32(),H.sampleUpper=g._nextUint32()),v.samples[te]=H}t.dataFormatDescriptor.length=0,t.dataFormatDescriptor.push(v);const m=new xu(r,h,u,!0);for(;m._offset<u;){const te=m._nextUint32(),H=m._scan(te),ee=bx(H),Q=m._scan(te-H.byteLength);t.keyValue[ee]=ee.match(/^ktx/i)?bx(Q):Q,m._offset%4&&m._skip(4-m._offset%4)}if(A<=0)return t;const _=new xu(r,d,A,!0),w=_._nextUint16(),x=_._nextUint16(),I=_._nextUint32(),R=_._nextUint32(),M=_._nextUint32(),T=_._nextUint32(),D=[];for(let te=0;te<s;te++)D.push({imageFlags:_._nextUint32(),rgbSliceByteOffset:_._nextUint32(),rgbSliceByteLength:_._nextUint32(),alphaSliceByteOffset:_._nextUint32(),alphaSliceByteLength:_._nextUint32()});const b=d+_._offset,S=b+I,L=S+R,P=L+M,N=new Uint8Array(r.buffer,r.byteOffset+b,I),W=new Uint8Array(r.buffer,r.byteOffset+S,R),X=new Uint8Array(r.buffer,r.byteOffset+L,M),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 xg,Ss,wg;const Ig={env:{emscripten_notify_memory_growth:function(r){wg=new Uint8Array(Ss.exports.memory.buffer)}}};class EN{init(){return xg||(xg=typeof fetch<"u"?fetch("data:application/wasm;base64,"+Rx).then(e=>e.arrayBuffer()).then(e=>WebAssembly.instantiate(e,Ig)).then(this._init):WebAssembly.instantiate(Buffer.from(Rx,"base64"),Ig).then(this._init),xg)}_init(e){Ss=e.instance,Ig.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);wg.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),c=wg.slice(s,s+o);return Ss.exports.free(i),Ss.exports.free(s),c}}const Rx="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/AX4CJwEDZW52H2Vtc2NyaXB0ZW5fbm90aWZ5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ooAgA2AgAgAkEDSw0ACwsgAkUNAgNAIAAgAkF/aiICaiABIAJqLQAAOgAAIAINAAsMAgsgAkEDTQ0AIAIhBANAIAMgASgCADYCACABQQRqIQEgA0EEaiEDIARBfGoiBEEDSw0ACyACQQNxIQILIAJFDQADQCADIAEtAAA6AAAgA0EBaiEDIAFBAWohASACQX9qIgINAAsLIAAL8wICAn8BfgJAIAJFDQAgACACaiIDQX9qIAE6AAAgACABOgAAIAJBA0kNACADQX5qIAE6AAAgACABOgABIANBfWogAToAACAAIAE6AAIgAkEHSQ0AIANBfGogAToAACAAIAE6AAMgAkEJSQ0AIABBACAAa0EDcSIEaiIDIAFB/wFxQYGChAhsIgE2AgAgAyACIARrQXxxIgRqIgJBfGogATYCACAEQQlJDQAgAyABNgIIIAMgATYCBCACQXhqIAE2AgAgAkF0aiABNgIAIARBGUkNACADIAE2AhggAyABNgIUIAMgATYCECADIAE2AgwgAkFwaiABNgIAIAJBbGogATYCACACQWhqIAE2AgAgAkFkaiABNgIAIAQgA0EEcUEYciIEayICQSBJDQAgAa0iBUIghiAFhCEFIAMgBGohAQNAIAEgBTcDGCABIAU3AxAgASAFNwMIIAEgBTcDACABQSBqIQEgAkFgaiICQR9LDQALCyAACy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAIajYCACADCy8BAn8gACgCBCAAKAIAQQJ0aiICLQACIQMgACACLwEAIAEgAi0AAxAFajYCACADCx8AIAAgASACKAIEEAg2AgAgARAEGiAAIAJBCGo2AgQLCAAgAGdBH3MLugUBDX8jAEEQayIKJAACfyAEQQNNBEAgCkEANgIMIApBDGogAyAEEAsaIAAgASACIApBDGpBBBAVIgBBbCAAEAMbIAAgACAESxsMAQsgAEEAIAEoAgBBAXRBAmoQECENQVQgAygAACIGQQ9xIgBBCksNABogAiAAQQVqNgIAIAMgBGoiAkF8aiEMIAJBeWohDiACQXtqIRAgAEEGaiELQQQhBSAGQQR2IQRBICAAdCIAQQFyIQkgASgC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NAUG4fwsQGgwCCyAGQQFqIQYgAiAFayECIAMgBWohAyAEKAIMRQ0ACyAEKAI4BEAgAkEDTQRAIABBuH8QGgwCCyADQQRqIQMLIAQoAighAiAEKQMYIQcgAEEANgIEIAAgAyABazYCACAAIAIgBmytIAcgB0J/URs3AwgLIARBQGskAAslAQF/IwBBEGsiAiQAIAIgACABEFEgAigCACEAIAJBEGokACAAC30BBH8jAEGQBGsiBCQAIARB/wE2AggCQCAEQRBqIARBCGogBEEMaiABIAIQFSIGEAMEQCAGIQUMAQtBVCEFIAQoAgwiB0EGSw0AIAMgBEEQaiAEKAIIIAcQQSIFEAMNACAAIAEgBmogAiAGayADEDwhBQsgBEGQBGokACAFC4cBAgJ/An5BABAWIQMCQANAIAEgA08EQAJAIAAoAABBcHFB0NS0wgFGBEAgACABECIiAhADRQ0BQn4PCyAAIAEQVSIEQn1WDQMgBCAFfCIFIARUIQJCfiEEIAINAyAAIAEQUiICEAMNAwsgASACayEBIAAgAmohAAwBCwtCfiAFIAEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQQh2QQFxIQIgAEEANgLg4gEgACACNgKM4gEgAUEgaiQAC3YBA38jAEEwayIBJAAgAARAIAEgAEHE0AFqIgIoAgA2AiggASAAKQK80AE3AyAgACgCACEDIAEgAigCADYCGCABIAApArzQATcDECADIAFBEGoQGyABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALzAEBAX8gACABKAK00AE2ApjiASAAIAEoAgQiAjYCwOABIAAgAjYCvOABIAAgAiABKAIIaiICNgK44AEgACACNgLE4AEgASgCuNABBEAgAEKBgICAEDcDiOEBIAAgAUGk0ABqNgIMIAAgAUGUIGo2AgggACABQZwwajYCBCAAIAFBDGo2AgAgAEGs0AFqIAFBqNABaigCADYCACAAQbDQAWogAUGs0AFqKAIANgIAIABBtNABaiABQbDQAWooAgA2AgAPCyAAQgA3A4jhAQs7ACACRQRAQbp/DwsgBEUEQEFsDwsgAiAEEGAEQCAAIAEgAiADIAQgBRBhDwsgACABIAIgAyAEIAUQZQtGAQF/IwBBEGsiBSQAIAVBCGogBBAOAn8gBS0ACQRAIAAgASACIAMgBBAyDAELIAAgASACIAMgBBA0CyEAIAVBEGokACAACzQAIAAgAyAEIAUQNiIFEAMEQCAFDwsgBSAESQR/IAEgAiADIAVqIAQgBWsgABA1BUG4fwsLRgEBfyMAQRBrIgUkACAFQQhqIAQQDgJ/IAUtAAkEQCAAIAEgAiADIAQQYgwBCyAAIAEgAiADIAQQNQshACAFQRBqJAAgAAtZAQF/QQ8hAiABIABJBEAgAUEEdCAAbiECCyAAQQh2IgEgAkEYbCIAQYwIaigCAGwgAEGICGooAgBqIgJBA3YgAmogAEGACGooAgAgAEGECGooAgAgAWxqSQs3ACAAIAMgBCAF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AAAAAAYTAAAAAAAABhYAAAAAAAAGGQAAAAAAAAYcAAAAAAAABh8AAAAAAAAGIgAAAAAAAQYlAAAAAAABBikAAAAAAAIGLwAAAAAAAwY7AAAAAAAEBlMAAAAAAAcGgwAAAAAACQYDAgAAEAAABAQAAAAAAAAEBQAAACAAAAUGAAAAAAAABQcAAAAgAAAFCQAAAAAAAAUKAAAAAAAABgwAAAAAAAAGDwAAAAAAAAYSAAAAAAAABhUAAAAAAAAGGAAAAAAAAAYbAAAAAAAABh4AAAAAAAAGIQAAAAAAAQYjAAAAAAABBicAAAAAAAIGKwAAAAAAAwYzAAAAAAAEBkMAAAAAAAUGYwAAAAAACAYDAQAAIAAABAQAAAAwAAAEBAAAABAAAAQFAAAAIAAABQcAAAAgAAAFCAAAACAAAAUKAAAAIAAABQsAAAAAAAAGDgAAAAAAAAYRAAAAAAAABhQAAAAAAAAGFwAAAAAAAAYaAAAAAAAABh0AAAAAAAAGIAAAAAAAEAYDAAEAAAAPBgOAAAAAAA4GA0AAAAAADQYDIAAAAAAMBgMQAAAAAAsGAwgAAAAACgYDBABBpB0L2QEBAAAAAwAAAAcAAAAPAAAAHwAAAD8AAAB/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",Cg=new WeakMap;let Sg=0,Mg;class Zi extends ca{constructor(e){super(e),this.transcoderPath="",this.transcoderBinary=null,this.transcoderPending=null,this.workerPool=new dN,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 Ll(this.manager);e.setPath(this.transcoderPath),e.setWithCredentials(this.withCredentials);const t=e.loadAsync("basis_transcoder.js"),n=new Ll(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 c=Zi.BasisWorker.toString(),h=["/* constants */","let _EngineFormat = "+JSON.stringify(Zi.EngineFormat),"let _TranscoderFormat = "+JSON.stringify(Zi.TranscoderFormat),"let _BasisFormat = "+JSON.stringify(Zi.BasisFormat),"/* basis_transcoder.js */",s,"/* worker */",c.substring(c.indexOf("{")+1,c.lastIndexOf("}"))].join(`
3829
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})}),Sg>0&&console.warn("THREE.KTX2Loader: Multiple active KTX2 loaders may cause performance issues. Use a single KTX2Loader instance, or call .dispose() on old instances."),Sg++}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 Ll(this.manager);s.setResponseType("arraybuffer"),s.setWithCredentials(this.withCredentials),s.load(e,o=>{if(Cg.has(o))return Cg.get(o).promise.then(t).catch(i);this._createTexture(o).then(c=>t?t(c):null).catch(i)},n,i)}_createTextureFrom(e,t){const{faces:n,width:i,height:s,format:o,type:c,error:h,dfdFlags:u}=e;if(c==="error")return Promise.reject(h);let d;if(t.faceCount===6)d=new ZL(n,o,Ar);else{const A=n[0].mipmaps;d=t.layerCount>1?new JL(A,i,s,t.layerCount,o,Ar):new Ud(A,i,s,o,Ar)}return d.minFilter=n[0].mipmaps.length===1?pr:wi,d.magFilter=pr,d.generateMipmaps=!1,d.needsUpdate=!0,d.colorSpace=Dx(t),d.premultiplyAlpha=!!(u&pN),d}async _createTexture(e,t={}){const n=yN(new Uint8Array(e));if(n.vkFormat!==_N)return wN(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 Cg.set(e,{promise:s}),s}dispose(){return this.workerPool.dispose(),this.workerSourceURL&&URL.revokeObjectURL(this.workerSourceURL),Sg--,this}}Zi.BasisFormat={ETC1S:0,UASTC_4x4:1},Zi.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},Zi.EngineFormat={RGBAFormat:gr,RGBA_ASTC_4x4_Format:EA,RGBA_BPTC_Format:$h,RGBA_ETC2_EAC_Format:yA,RGBA_PVRTC_4BPPV1_Format:mA,RGBA_S3TC_DXT5_Format:Jh,RGB_ETC1_Format:_A,RGB_ETC2_Format:vA,RGB_PVRTC_4BPPV1_Format:gA,RGB_S3TC_DXT1_Format:Kh},Zi.BasisWorker=function(){let r,e,t;const n=_EngineFormat,i=_TranscoderFormat,s=_BasisFormat;self.addEventListener("message",function(v){const E=v.data;switch(E.type){case"init":r=E.config,o(E.transcoderBinary);break;case"transcode":e.then(()=>{try{const{faces:m,buffers:_,width:w,height:x,hasAlpha:I,format:R,dfdFlags:M}=c(E.buffer);self.postMessage({type:"transcode",id:E.id,faces:m,width:w,height:x,hasAlpha:I,format:R,dfdFlags:M},_)}catch(m){console.error(m),self.postMessage({type:"error",id:E.id,error:m.message})}});break}});function o(v){e=new Promise(E=>{t={wasmBinary:v,onRuntimeInitialized:E},BASIS(t)}).then(()=>{t.initializeBasis(),t.KTX2File===void 0&&console.warn("THREE.KTX2Loader: Please update Basis Universal transcoder.")})}function c(v){const E=new t.KTX2File(new Uint8Array(v));function m(){E.close(),E.delete()}if(!E.isValid())throw m(),new Error("THREE.KTX2Loader: Invalid or unsupported .ktx2 file");const _=E.isUASTC()?s.UASTC_4x4:s.ETC1S,w=E.getWidth(),x=E.getHeight(),I=E.getLayers()||1,R=E.getLevels(),M=E.getFaces(),T=E.getHasAlpha(),D=E.getDFDFlags(),{transcoderFormat:b,engineFormat:S}=A(_,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<M;N++){const W=[];for(let X=0;X<R;X++){const K=[];let te,H;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,H=z.origHeight):(te=z.width,H=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:H}),P.push(ee.buffer)}L.push({mipmaps:W,width:w,height:x,format:S})}return m(),{faces:L,buffers:P,width:w,height:x,hasAlpha:T,format:S,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(v,E){return v.priorityETC1S-E.priorityETC1S}),d=h.sort(function(v,E){return v.priorityUASTC-E.priorityUASTC});function A(v,E,m,_){let w,x;const I=v===s.ETC1S?u:d;for(let R=0;R<I.length;R++){const M=I[R];if(r[M.if]&&M.basisFormat.includes(v)&&!(_&&M.transcoderFormat.length<2)&&!(M.needsPowerOfTwo&&!(p(E)&&p(m))))return w=M.transcoderFormat[_?1:0],x=M.engineFormat[_?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(v){return v<=2?!0:(v&v-1)===0&&v!==0}function g(v){if(v.length===1)return v[0];let E=0;for(let w=0;w<v.length;w++){const x=v[w];E+=x.byteLength}const m=new Uint8Array(E);let _=0;for(let w=0;w<v.length;w++){const x=v[w];m.set(x,_),_+=x.byteLength}return m}};const xN=new Set([gr,io,ea]),Tg={[Mx]:gr,[Ix]:gr,[yx]:gr,[Ex]:gr,[Sx]:io,[wx]:io,[_x]:io,[vx]:io,[Cx]:ea,[xx]:ea,[mx]:ea,[gx]:ea,[Bx]:Zh,[Tx]:Zh},Bg={[Mx]:lr,[Ix]:yn,[yx]:Ar,[Ex]:Ar,[Sx]:lr,[wx]:yn,[_x]:Ar,[vx]:Ar,[Cx]:lr,[xx]:yn,[mx]:Ar,[gx]:Ar,[Bx]:Ar,[Tx]:Ar};async function wN(r){const{vkFormat:e}=r;if(Tg[e]===void 0)throw new Error("THREE.KTX2Loader: Unsupported vkFormat.");let t;r.supercompressionScheme===px&&(Mg||(Mg=new Promise(async s=>{const o=new EN;await o.init(),s(o)})),t=await Mg);const n=[];for(let s=0;s<r.levels.length;s++){const o=Math.max(1,r.pixelWidth>>s),c=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===px)d=t.decode(u.levelData,u.uncompressedByteLength);else throw new Error("THREE.KTX2Loader: Unsupported supercompressionScheme.");let A;Bg[e]===lr?A=new Float32Array(d.buffer,d.byteOffset,d.byteLength/Float32Array.BYTES_PER_ELEMENT):Bg[e]===yn?A=new Uint16Array(d.buffer,d.byteOffset,d.byteLength/Uint16Array.BYTES_PER_ELEMENT):A=d,n.push({data:A,width:o,height:c,depth:h})}let i;if(xN.has(Tg[e]))i=r.pixelDepth===0?new Ao(n[0].data,r.pixelWidth,r.pixelHeight):new BE(n[0].data,r.pixelWidth,r.pixelHeight,r.pixelDepth);else{if(r.pixelDepth>0)throw new Error("THREE.KTX2Loader: Unsupported pixelDepth.");i=new Ud(n,r.pixelWidth,r.pixelHeight)}return i.mipmaps=n,i.type=Bg[e],i.format=Tg[e],i.colorSpace=Dx(r),i.needsUpdate=!0,Promise.resolve(i)}function Dx(r){const e=r.dataFormatDescriptor[0];return e.colorPrimaries===gN?e.transferFunction===Ax?Qr:Sr:e.colorPrimaries===mN?e.transferFunction===Ax?ed:nu:(e.colorPrimaries===AN||console.warn(`THREE.KTX2Loader: Unsupported color primaries, "${e.colorPrimaries}"`),As)}class IN extends d8{constructor(e){super(e),this.type=yn}parse(e){const t=function(_,w){switch(_){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(_,w,x){w=w||1024;let I=_.pos,R=-1,M=0,T="",D=String.fromCharCode.apply(null,new Uint16Array(_.subarray(I,I+128)));for(;0>(R=D.indexOf(n))&&M<w&&I<_.byteLength;)T+=D,M+=D.length,I+=128,D+=String.fromCharCode.apply(null,new Uint16Array(_.subarray(I,I+128)));return-1<R?(x!==!1&&(_.pos+=M+R+1),T+D.slice(0,R)):!1},s=function(_){const w=/^#\?(\S+)/,x=/^\s*GAMMA\s*=\s*(\d+(\.\d+)?)\s*$/,I=/^\s*EXPOSURE\s*=\s*(\d+(\.\d+)?)\s*$/,R=/^\s*FORMAT=(\S+)\s*$/,M=/^\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((_.pos>=_.byteLength||!(D=i(_)))&&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(_),D!==!1;){if(T.string+=D+`
@@ -4462,9 +4462,9 @@ bool bvhIntersectFirstHit(
4462
4462
  `)},tn.needsUpdate=!0,Ro&&(t.visible=Qm)))}setupOrbitalMaterial(e){Ro&&e.material&&e.material.name.toLowerCase()=="frame-stems"&&(zm=e,ur=lk,ur.envMap=this.scene.environment,e.material=ur,ur.needsUpdate=!0,e.visible=Fm)}setupGemstoneMaterial(e){e.material&&e.name.toLowerCase().includes("diamond")&&(this.initGemstoneDependencies(),Ls.uniforms.bvh.value=new sw,Ls.uniforms.bvh.value.updateFrom(new Kg(e.geometry.clone().toNonIndexed(),{strategy:Px})),e.material=Ls)}async loadEyewearFromGLTF(e,t,n,i){const s=new X2,o=new Zi(s).setTranscoderPath("https://unpkg.com/three@0.146.0/examples/js/libs/basis/");e.setKTX2Loader(o.detectSupport(n));const c=i,h=t.includes(".glb");let u;return h?u=await e.loadAsync(t):u=await this.LoadEncryptedGlb(e,t,c).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(A,g),this.setupOrbitalMaterial(g),this.setupGemstoneMaterial(g),g.matrixAutoUpdate=!0)}),this.adjustSceneHeight(A,p),this.loadModelInsideScene(d.result.scene)}),u==null?void 0:u.scene}updateLensMaterial(e){if(tn){if(e.direction=="u")tn.color=new Ke(e.color),tn.opacity=e.opacity,Rr.uAlpha.value=!1;else if(e.direction=="tb"){const t=e.gradientColors;Rr.uAlpha.value=!0;let n=0;t.forEach(()=>{Rr.colors.value[n]=new Ke(t[n].color),Rr.positions.value[n]=t[n].position,Rr.opacities.value[n]=t[n].alpha,n++})}e.finish=="MIRBLKHMC"?(tn.clearcoat=1,tn.clearcoatRoughness=0):e.finish=="HMCCR"?(tn.clearcoat=0,tn.clearcoatRoughness=1):e.finish=="MIRSILHMC"&&(tn.clearcoat=1,tn.clearcoatRoughness=0),tn.roughness=e.roughness,tn.metalness=e.metalness}}async downloadTexture(e){return await this.textureLoader.loadAsync(e).then(t=>(t.colorSpace=Qr,t.flipY=!1,t.magFilter=pr,t.minFilter=JB,t.wrapS=$s,t.wrapT=$s,t))}async updateOrbitalMaterial(e){Ro&&ur&&e&&(e.texture&&(e.texture.baseColor&&await this.downloadTexture(e.texture.baseColor).then(t=>{ur.map=t}),e.texture.opacity&&await this.downloadTexture(e.texture.opacity).then(t=>{ur.transmissionMap=t}),e.texture.orm&&await this.downloadTexture(e.texture.orm).then(t=>{ur.aoMap=t,ur.roughnessMap=t,ur.metalnessMap=t})),e.ior>1?(ur.ior=1.45,ur.thickness=.0035):(ur.ior=1,ur.thickness=0),ur.opacity=1,ur.transmission=1,ur.transparent=!1,ur.clearcoat=0,ur.roughness=1,ur.metalness=e.metalness,ur.shadowSide=kr,ur.depthWrite=!0)}snapCamToPos(e){var t;if(!this.camera||!this.renderer)return;const n=(t=ok[e])==null?void 0:t.value;EI.to(this.camera.position,{duration:1,ease:"sine.inOut",x:n.x,y:n.y,z:n.z})}setupAndRenderScene(){if(!this.camera||!this.renderer)return;this.scene.add(this.camera);const e=new f8(16777215,16777215,2);e.color.setHSL(.6,1,.6),e.groundColor.setHSL(.095,1,.75),e.position.set(0,50,0),this.scene.add(e);const t=new ex(16777215,1.5);t.color.setHSL(.1,1,.95),t.position.set(-1,1.75,1),t.position.multiplyScalar(30),this.scene.add(t);const n=new R8(this.camera,this.canvas);n.target.set(.003059340956040225,-.13425621157020154,-.2564218846390263),this.renderer.getSize(new Ge),bo?(this.camera.position.set(4.7,1.9,7.5),n.minDistance=2.5,n.maxDistance=11,n.rotateSpeed=.8):(this.camera.position.set(1.8,.65,2.5),n.minDistance=1.5,n.maxDistance=5,n.rotateSpeed=.5),n.enableDamping=!0,n.dampingFactor=.2,n.enablePan=!0,n.minPolarAngle=-Math.PI*5/36,n.maxPolarAngle=Math.PI*3/5,n.update(),this.renderer.toneMapping=cA,this.renderer.toneMappingExposure=1.2,this.renderer.setClearColor(15724527),this.renderer.outputColorSpace=Qr;const i=2.5,s=2.5,o=.4,c={shadow:{blur:.6,darkness:1,opacity:.6},plane:{color:"#ffffff",opacity:1},showWireframe:!1},h=new oa;h.position.y=-.315,this.scene.add(h);const u=new Mi(256,256);u.texture.generateMipmaps=!1;const d=new Mi(256,256);d.texture.generateMipmaps=!1;const A=new fu(i,s).rotateX(Math.PI/2),p=new xs({map:u.texture,opacity:c.shadow.opacity,transparent:!0,depthWrite:!1}),g=new Yr(A,p);g.renderOrder=1,h.add(g),g.scale.y=-1;const v=new Yr(A);v.visible=!1,h.add(v);const E=new pu(-i/2,i/2,s/2,-s/2,0,o);E.rotation.x=Math.PI/2,h.add(E);const m=new M2;m.userData.darkness={value:c.shadow.darkness},m.onBeforeCompile=L=>{const P=L;P.uniforms.darkness=m.userData.darkness,P.fragmentShader=`
4463
4463
  uniform float darkness;
4464
4464
  ${L.fragmentShader.replace("gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );","gl_FragColor = vec4( vec3( 0.0 ), ( 1.0 - fragCoordZ ) * darkness );")}
4465
- `},m.depthTest=!1,m.depthWrite=!1;const _=new En(UN);_.depthTest=!1;const w=new En(PN);w.depthTest=!1;function x(L,P){v.visible=!0,v.material=_,v.material.uniforms.tDiffuse.value=u.texture,_.uniforms.h.value=L*1/256,P.setRenderTarget(d),P.render(v,E),v.material=w,v.material.uniforms.tDiffuse.value=d.texture,w.uniforms.v.value=L*1/256,P.setRenderTarget(u),P.render(v,E),v.visible=!1}E.far=.125,I();function I(){E.updateProjectionMatrix()}const R=new LN,M=new NN(this.scene,this.camera);M.clearAlpha=0;const T=this.renderer.getDrawingBufferSize(new Ge),D=new Mi(T.width,T.height,{samples:4,type:yn}),b=new RN(this.renderer,D);b.addPass(M),b.addPass(R);const S=()=>{var L;n.update(),this.resizeRenderer()&&(this.camera.aspect=this.canvas.clientWidth/this.canvas.clientHeight,(L=this.camera)==null||L.updateProjectionMatrix());const P=this.scene.background;if(this.scene.background=null,this.scene.overrideMaterial=m,!this.renderer||!this.camera)return;const N=this.renderer.getClearAlpha();this.renderer.setClearAlpha(0),this.renderer.clear(),this.renderer.setRenderTarget(u),this.renderer.render(this.scene,E),this.scene.overrideMaterial=null,x(c.shadow.blur,this.renderer),x(c.shadow.blur*.4,this.renderer),this.renderer.setRenderTarget(null),this.renderer.setClearAlpha(N),this.scene.background=P,Ls.uniforms.viewMatrixInverse.value=this.camera.matrixWorld,Ls.uniforms.projectionMatrixInverse.value=this.camera.projectionMatrixInverse,requestAnimationFrame(S),b.render()};S()}loadModelInsideScene(e){this.scene.traverse(t=>{t.name=="Scene"&&(this.scene.remove(t),t.traverse(n=>{n instanceof Yr&&(n.geometry.dispose(),n.material.dispose())}))}),this.scene.add(e)}}class hk{constructor(){kt(this,"customRenderer"),this.customRenderer=new uk}async Init(){this.customRenderer.isInitialised||(await this.customRenderer.intialize(),this.customRenderer.setupAndRenderScene())}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)}snapCamToPos(e){this.customRenderer.snapCamToPos(e)}}class CI{constructor(e){kt(this,"orgId"),kt(this,"rendererService"),kt(this,"isLoading",!1),kt(this,"userContainerId"),kt(this,"containerElement",null),kt(this,"defaultSelectorId","dita-3dconfig-element"),kt(this,"defaultCanvasStyle",{width:"100%",height:"100%"}),kt(this,"customisationArr",[]),kt(this,"assetDetails",null),this.userContainerId=e.userContainerId,this.rendererService=new hk,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){this.rendererService.snapCamToPos(e)}async loadFrame(e){return this.assetDetails=e.data.assetDetails,this.customisationArr=e.data.customisation,this.prepareDOM(),await this.rendererService.Init(),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)}unmount(){this.containerElement&&(this.containerElement.innerHTML="",this.containerElement.style.height="0px",this.containerElement.style.width="auto")}}class SI{constructor(){kt(this,"events"),kt(this,"authService"),kt(this,"instanceArr"),this.authService=new bS,this.events=new OS,this.instanceArr=[]}async Init(e){await this.authService.Init(e),bc.setJWT(this.authService.authPayload.JWT)}async loadBySKU(e){const t=await Sp.FetchAssetBySKUOrBarcode({sku:e.SKU,barcode:null});return await this.renderAsset({data:{assetDetails:t,customisation:t.customisation}})}async renderAsset(e){return new CI({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 CI({orgId:this.authService.authPayload.ORGID,userContainerId:e.containerId})}}window.ThreeDConfigurator=SI;const DQ="",sr=/iPhone|iPad|iPod|Android/i.test(navigator.userAgent),LQ="";var yf=(r=>(r.Front="Front",r.Back="Back",r.Left="Left",r.Right="Right",r.Top="Top",r.Bottom="Bottom",r))(yf||{}),An=(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))(An||{});function dk({frameList:r,selectedFrame:e,modelLoading:t,isSelected:n,paletteEntered:i,onChangeFrame:s}){const o=We.useRef(null),c=We.useRef(null),h=()=>{o.current&&(o.current.textContent=An.EnteredFramesListSection)};return We.useEffect(()=>{i&&c.current&&c.current.querySelectorAll(".sprie-config-palette-img-box")[0].firstChild.focus()},[i]),Me.jsxs("div",{className:"sprie-config-palette",ref:c,style:{gap:sr?"3rem":"5rem",display:n?"flex":"none",padding:"0 3rem"},children:[Me.jsx("span",{className:"sprie-config-sr-only","aria-live":"assertive",ref:o}),r==null?void 0:r.map(u=>Me.jsxs("div",{className:"sprie-config-palette-img-box",children:[Me.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:Me.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"}})}),Me.jsxs("p",{className:"sprie-config-palette-img-text",children:[Me.jsx("span",{className:"sprie-config-palette-imgName",children:u.name}),Me.jsx("span",{id:"sprie-config-frameName",className:"sprie-config-sr-only",children:`Selected frame ${u.name}`})]})]},u._id))]})}function fk({lensList:r,selectedLens:e,selectedDitaLens:t,modelLoading:n,isSelected:i,paletteEntered:s,onChangeLens:o}){const c=We.useRef(null),h=We.useRef(null),u=()=>{c.current&&(c.current.textContent=An.EnteredLensListSection)};return We.useEffect(()=>{s&&h.current&&h.current.querySelectorAll(".sprie-config-palette-img-box")[0].firstChild.focus()},[s]),Me.jsxs("div",{className:"sprie-config-palette",ref:h,style:{display:i?"flex":"none",padding:"0 3rem",gap:sr?"3rem":"5rem"},children:[Me.jsx("span",{className:"sprie-config-sr-only","aria-live":"assertive",ref:c}),r==null?void 0:r.map(d=>Me.jsxs("div",{className:"sprie-config-palette-img-box",children:[Me.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:Me.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"}})}),Me.jsxs("p",{className:"sprie-config-palette-img-text",style:{bottom:"-1.2rem",textAlign:"center"},children:[Me.jsx("span",{className:"sprie-config-palette-imgName",children:`${d.name}`}),Me.jsx("br",{}),(e==null?void 0:e._id)===d._id&&Me.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})`}),Me.jsxs("span",{id:"sprie-config-lensName",className:"sprie-config-sr-only",children:[" ",`Selected lens ${d.name}`]})]})]},d._id))]})}const NQ="";function pk({heading:r,isSelected:e,onEngravingLinkClicked:t,onChecked:n,onTextAdded:i,paletteEntered:s}){const[o,c]=We.useState(""),[h,u]=We.useState(!1),[d,A]=We.useState(!1),[p,g]=We.useState(!1),v=We.useRef(null),E=We.useRef(null),m=We.useRef(null);We.useEffect(()=>{n(h),h&&v.current?(v.current.style.backgroundColor="#ffffff",m.current&&(m.current.textContent=An.EngravingInputAvailable)):!h&&v.current&&(v.current.style.backgroundColor="transparent",m.current&&(m.current.textContent=An.EngravingInputHidden),c(""))}),We.useEffect(()=>{d&&o!=""&&(g(!1),i(o))},[d]),We.useEffect(()=>{p&&A(!1)},[p]),We.useEffect(()=>{var x;s&&((x=E.current)==null||x.focus())},[s]);const _=()=>{m.current&&(m.current.textContent=An.EnteredEngravingSection)},w=x=>{var I;x.key==="Enter"&&(i(o),(I=v.current)==null||I.blur(),m.current&&(m.current.textContent=An.AddedEngravingText+o))};return Me.jsxs("div",{className:"sprie-config-engraving-block",style:{display:e?"flex":"none",marginTop:".5rem"},children:[Me.jsx("span",{className:"sprie-config-sr-only","aria-live":"assertive",ref:m}),Me.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".8rem"},children:[Me.jsx("input",{type:"checkbox",ref:E,className:"sprie-config-engraving-checkbox",onChange:x=>{u(x.target.checked)},onFocus:_,checked:h}),Me.jsxs("p",{style:{fontSize:".9rem",color:"#4d4d4d",fontWeight:"500",margin:"0"},children:["Add ","Laser Engraving"," ",Me.jsx("span",{style:{fontWeight:"400"},children:"(OPTIONAL)"})]})]}),Me.jsxs("div",{className:"sprie-config-engraving-inputField-block",children:[Me.jsx("input",{"aria-label":An.EnteredEngravingTextInput,type:"text",ref:v,className:"sprie-config-engraving-inputField",placeholder:"ADD CUSTOM TEXT",value:o,onChange:x=>c(x.target.value),maxLength:15,style:{padding:"0.7rem"},disabled:!h,onKeyDown:x=>w(x)}),Me.jsx("span",{className:"sprie-config-engraving-inputInfo",children:`${o.length}/15 characters`})]})]})}const UQ="";function Ak({totalSteps:r,currentStep:e}){return Me.jsx("div",{className:"step-tracker-block",style:{margin:sr?"auto":""}})}function gk({nextSlide:r,previousSlide:e,currentIndex:t,stepsName:n,isLastStep:i}){const s=()=>{e()},o=()=>{r()};return Me.jsxs("div",{className:"carousel-header",children:[Me.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:Me.jsx("i",{className:"arrow left-arrow",style:{padding:".25rem"}})}),Me.jsxs("p",{children:[Me.jsx("span",{className:"step-syntax",children:`STEP ${t+1} of ${n.length} : `}),Me.jsx("span",{className:"select-syntax",children:n[t]})]}),Me.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:Me.jsx("i",{className:"arrow right-arrow",style:{padding:".25rem"}})})]})}function mk({setShowAddToCart:r,setSelectedChild:e,setSectionEntered:t,children:n}){var g;const[i,s]=We.useState(0),o=Th.Children.toArray(n),c=i===o.length-1,h=We.useRef(null),u=(g=o.map(v=>v))==null?void 0:g.map(v=>v.props.heading),d=()=>{s(v=>v===0?Th.Children.count(n)-1:v-1),h.current&&h.current.focus()},A=()=>{s(v=>v===Th.Children.count(n)-1?0:v+1),h.current&&h.current.focus()};We.useEffect(()=>{r(!!c)},[c]),We.useEffect(()=>{e(i)},[i]);const p=v=>{(v.key==="Enter"||v.key===" ")&&v.target===h.current&&t(i)};return Me.jsxs("div",{className:"carousel",children:[Me.jsx("span",{className:"sprie-config-sr-only",id:"sprie-config-step-selector",children:`Customisation Step Selector. ${c?"This is an optional":""} Step ${i+1} -
4465
+ `},m.depthTest=!1,m.depthWrite=!1;const _=new En(UN);_.depthTest=!1;const w=new En(PN);w.depthTest=!1;function x(L,P){v.visible=!0,v.material=_,v.material.uniforms.tDiffuse.value=u.texture,_.uniforms.h.value=L*1/256,P.setRenderTarget(d),P.render(v,E),v.material=w,v.material.uniforms.tDiffuse.value=d.texture,w.uniforms.v.value=L*1/256,P.setRenderTarget(u),P.render(v,E),v.visible=!1}E.far=.125,I();function I(){E.updateProjectionMatrix()}const R=new LN,M=new NN(this.scene,this.camera);M.clearAlpha=0;const T=this.renderer.getDrawingBufferSize(new Ge),D=new Mi(T.width,T.height,{samples:4,type:yn}),b=new RN(this.renderer,D);b.addPass(M),b.addPass(R);const S=()=>{var L;n.update(),this.resizeRenderer()&&(this.camera.aspect=this.canvas.clientWidth/this.canvas.clientHeight,(L=this.camera)==null||L.updateProjectionMatrix());const P=this.scene.background;if(this.scene.background=null,this.scene.overrideMaterial=m,!this.renderer||!this.camera)return;const N=this.renderer.getClearAlpha();this.renderer.setClearAlpha(0),this.renderer.clear(),this.renderer.setRenderTarget(u),this.renderer.render(this.scene,E),this.scene.overrideMaterial=null,x(c.shadow.blur,this.renderer),x(c.shadow.blur*.4,this.renderer),this.renderer.setRenderTarget(null),this.renderer.setClearAlpha(N),this.scene.background=P,Ls.uniforms.viewMatrixInverse.value=this.camera.matrixWorld,Ls.uniforms.projectionMatrixInverse.value=this.camera.projectionMatrixInverse,requestAnimationFrame(S),b.render()};S()}loadModelInsideScene(e){this.scene.traverse(t=>{t.name=="Scene"&&(this.scene.remove(t),t.traverse(n=>{n instanceof Yr&&(n.geometry.dispose(),n.material.dispose())}))}),this.scene.add(e)}}class hk{constructor(){kt(this,"customRenderer"),this.customRenderer=new uk}async Init(){this.customRenderer.isInitialised||(await this.customRenderer.intialize(),this.customRenderer.setupAndRenderScene())}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)}snapCamToPos(e){this.customRenderer.snapCamToPos(e)}}class CI{constructor(e){kt(this,"orgId"),kt(this,"rendererService"),kt(this,"isLoading",!1),kt(this,"userContainerId"),kt(this,"containerElement",null),kt(this,"defaultSelectorId","dita-3dconfig-element"),kt(this,"defaultCanvasStyle",{width:"100%",height:"100%"}),kt(this,"customisationArr",[]),kt(this,"assetDetails",null),this.userContainerId=e.userContainerId,this.rendererService=new hk,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){this.rendererService.snapCamToPos(e)}async loadFrame(e){return this.assetDetails=e.data.assetDetails,this.customisationArr=e.data.customisation,this.prepareDOM(),await this.rendererService.Init(),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)}unmount(){this.containerElement&&(this.containerElement.innerHTML="",this.containerElement.style.height="0px",this.containerElement.style.width="auto")}}class SI{constructor(){kt(this,"events"),kt(this,"authService"),kt(this,"instanceArr"),this.authService=new bS,this.events=new OS,this.instanceArr=[]}async Init(e){await this.authService.Init(e),bc.setJWT(this.authService.authPayload.JWT)}async loadBySKU(e){const t=await Sp.FetchAssetBySKUOrBarcode({sku:e.SKU,barcode:null});return await this.renderAsset({data:{assetDetails:t,customisation:t.customisation}})}async renderAsset(e){return new CI({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 CI({orgId:this.authService.authPayload.ORGID,userContainerId:e.containerId})}}window.ThreeDConfigurator=SI;const DQ="",sr=/iPhone|iPad|iPod|Android/i.test(navigator.userAgent),LQ="";var yf=(r=>(r.Front="Front",r.Back="Back",r.Left="Left",r.Right="Right",r.Top="Top",r.Bottom="Bottom",r))(yf||{}),An=(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))(An||{});function dk({frameList:r,selectedFrame:e,modelLoading:t,isSelected:n,paletteEntered:i,onChangeFrame:s}){const o=Ye.useRef(null),c=Ye.useRef(null),h=()=>{o.current&&(o.current.textContent=An.EnteredFramesListSection)};return Ye.useEffect(()=>{i&&c.current&&c.current.querySelectorAll(".sprie-config-palette-img-box")[0].firstChild.focus()},[i]),Me.jsxs("div",{className:"sprie-config-palette",ref:c,style:{gap:sr?"3rem":"5rem",display:n?"flex":"none",padding:"0 3rem"},children:[Me.jsx("span",{className:"sprie-config-sr-only","aria-live":"assertive",ref:o}),r==null?void 0:r.map(u=>Me.jsxs("div",{className:"sprie-config-palette-img-box",children:[Me.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:Me.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"}})}),Me.jsxs("p",{className:"sprie-config-palette-img-text",children:[Me.jsx("span",{className:"sprie-config-palette-imgName",children:u.name}),Me.jsx("span",{id:"sprie-config-frameName",className:"sprie-config-sr-only",children:`Selected frame ${u.name}`})]})]},u._id))]})}function fk({lensList:r,selectedLens:e,selectedDitaLens:t,modelLoading:n,isSelected:i,paletteEntered:s,onChangeLens:o}){const c=Ye.useRef(null),h=Ye.useRef(null),u=()=>{c.current&&(c.current.textContent=An.EnteredLensListSection)};return Ye.useEffect(()=>{s&&h.current&&h.current.querySelectorAll(".sprie-config-palette-img-box")[0].firstChild.focus()},[s]),Me.jsxs("div",{className:"sprie-config-palette",ref:h,style:{display:i?"flex":"none",padding:"0 3rem",gap:sr?"3rem":"5rem"},children:[Me.jsx("span",{className:"sprie-config-sr-only","aria-live":"assertive",ref:c}),r==null?void 0:r.map(d=>Me.jsxs("div",{className:"sprie-config-palette-img-box",children:[Me.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:Me.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"}})}),Me.jsxs("p",{className:"sprie-config-palette-img-text",style:{bottom:"-1.2rem",textAlign:"center"},children:[Me.jsx("span",{className:"sprie-config-palette-imgName",children:`${d.name}`}),Me.jsx("br",{}),(e==null?void 0:e._id)===d._id&&Me.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})`}),Me.jsxs("span",{id:"sprie-config-lensName",className:"sprie-config-sr-only",children:[" ",`Selected lens ${d.name}`]})]})]},d._id))]})}const NQ="";function pk({heading:r,isSelected:e,onEngravingLinkClicked:t,onChecked:n,onTextAdded:i,paletteEntered:s}){const[o,c]=Ye.useState(""),[h,u]=Ye.useState(!1),[d,A]=Ye.useState(!1);Ye.useState(!1);const p=Ye.useRef(null),g=Ye.useRef(null),v=Ye.useRef(null);Ye.useEffect(()=>{n(h),h&&p.current?(p.current.style.backgroundColor="#ffffff",v.current&&(v.current.textContent=An.EngravingInputAvailable)):!h&&p.current&&(p.current.style.backgroundColor="transparent",v.current&&(v.current.textContent=An.EngravingInputHidden),c(""))}),Ye.useEffect(()=>{d&&o!=""&&i(o)},[d]),Ye.useEffect(()=>{var _;s&&((_=g.current)==null||_.focus())},[s]);const E=()=>{v.current&&(v.current.textContent=An.EnteredEngravingSection)},m=_=>{var w;_.key==="Enter"&&(i(o),(w=p.current)==null||w.blur(),v.current&&(v.current.textContent=An.AddedEngravingText+o))};return Me.jsxs("div",{className:"sprie-config-engraving-block",style:{display:e?"flex":"none",marginTop:".5rem"},children:[Me.jsx("span",{className:"sprie-config-sr-only","aria-live":"assertive",ref:v}),Me.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".8rem"},children:[Me.jsx("input",{type:"checkbox",ref:g,className:"sprie-config-engraving-checkbox",onChange:_=>{u(_.target.checked)},onFocus:E,checked:h}),Me.jsxs("p",{style:{fontSize:".9rem",color:"#4d4d4d",fontWeight:"500",margin:"0"},children:["Add ","Laser Engraving"," ",Me.jsx("span",{style:{fontWeight:"400"},children:"(OPTIONAL)"})]})]}),Me.jsxs("div",{className:"sprie-config-engraving-inputField-block",children:[Me.jsx("input",{"aria-label":An.EnteredEngravingTextInput,type:"text",ref:p,className:"sprie-config-engraving-inputField",placeholder:"ADD CUSTOM TEXT",value:o,onChange:_=>c(_.target.value),maxLength:15,style:{padding:"0.7rem"},disabled:!h,onBlur:()=>A(!0),onFocus:()=>A(!1),onKeyDown:_=>m(_)}),Me.jsx("span",{className:"sprie-config-engraving-inputInfo",children:`${o.length}/15 characters`})]})]})}const UQ="";function Ak({totalSteps:r,currentStep:e}){return Me.jsx("div",{className:"step-tracker-block",style:{margin:sr?"auto":""}})}function gk({nextSlide:r,previousSlide:e,currentIndex:t,stepsName:n,isLastStep:i}){const s=()=>{e()},o=()=>{r()};return Me.jsxs("div",{className:"carousel-header",children:[Me.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:Me.jsx("i",{className:"arrow left-arrow",style:{padding:".25rem"}})}),Me.jsxs("p",{children:[Me.jsx("span",{className:"step-syntax",children:`STEP ${t+1} of ${n.length} : `}),Me.jsx("span",{className:"select-syntax",children:n[t]})]}),Me.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:Me.jsx("i",{className:"arrow right-arrow",style:{padding:".25rem"}})})]})}function mk({setShowAddToCart:r,setSelectedChild:e,setSectionEntered:t,children:n}){var g;const[i,s]=Ye.useState(0),o=Th.Children.toArray(n),c=i===o.length-1,h=Ye.useRef(null),u=(g=o.map(v=>v))==null?void 0:g.map(v=>v.props.heading),d=()=>{s(v=>v===0?Th.Children.count(n)-1:v-1),h.current&&h.current.focus()},A=()=>{s(v=>v===Th.Children.count(n)-1?0:v+1),h.current&&h.current.focus()};Ye.useEffect(()=>{r(!!c)},[c]),Ye.useEffect(()=>{e(i)},[i]);const p=v=>{(v.key==="Enter"||v.key===" ")&&v.target===h.current&&t(i)};return Me.jsxs("div",{className:"carousel",children:[Me.jsx("span",{className:"sprie-config-sr-only",id:"sprie-config-step-selector",children:`Customisation Step Selector. ${c?"This is an optional":""} Step ${i+1} -
4466
4466
  ${o[i].props.heading}.
4467
- Press enter to `+(c?"configure your optional custom engraving. Add to cart button is now present at the end of this section.":"select or press tab for next.")}),Me.jsxs("div",{tabIndex:0,style:{height:"30%",alignContent:"center"},"aria-labelledby":"sprie-config-step-selector",onKeyDown:p,ref:h,children:[Me.jsx(gk,{nextSlide:A,previousSlide:d,currentIndex:i,stepsName:u,isLastStep:c}),Me.jsx(Ak,{totalSteps:u==null?void 0:u.length,currentStep:i+1})]}),Me.jsx("div",{className:"carousel-container",style:{paddingTop:sr?"":"1rem"},children:o.map((v,E)=>Me.jsx("div",{className:"carousel-item",style:{transform:`translateX(-${i*100}%)`},children:v},E))})]})}const PQ="";function MI({conditionRequired:r,onButtonClick:e}){const[t,n]=We.useState(!1),i=We.useRef(null),s=We.useRef(null);return We.useEffect(()=>{s.current&&(s.current.disabled=!t)},[t]),We.useEffect(()=>{i.current&&(i.current.style.display=r?"flex":"none"),s.current&&(s.current.disabled=r)},[r]),Me.jsxs("div",{className:"sprie-config-add-to-cart-block",children:[Me.jsxs("label",{htmlFor:"Sprie-Config-return-policy-checkbox",id:"Sprie-Config-return-policy-label",ref:i,style:{display:"none"},children:[Me.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}),Me.jsx("p",{id:"sprie-config-return-policy-desc",children:"I agree this customized Item cannot be returned or exchanged."})]}),Me.jsx("button",{className:"sprie-config-add-to-cart-btn",ref:s,onClick:e,children:"ADD TO CART"})]})}function _k({orbitalList:r,selectedOrbital:e,modelLoading:t,isSelected:n,paletteEntered:i,onChangeOrbital:s}){const o=We.useRef(null),c=We.useRef(null),h=()=>{o.current&&(o.current.textContent=An.EnteredOrbitalsListSection)};return We.useEffect(()=>{i&&c.current&&c.current.querySelectorAll(".sprie-config-palette-img-box")[0].firstChild.focus()},[i]),Me.jsxs("div",{className:"sprie-config-palette",ref:c,style:{display:n?"flex":"none",padding:"0 3rem",gap:sr?"3rem":"5rem"},children:[Me.jsx("span",{className:"sprie-config-sr-only","aria-live":"assertive",ref:o}),r==null?void 0:r.map(u=>Me.jsxs("div",{className:"sprie-config-palette-img-box",children:[Me.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:Me.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"}})}),Me.jsxs("p",{className:"sprie-config-palette-img-text",style:{bottom:"-1.5rem"},children:[Me.jsx("span",{className:"sprie-config-palette-imgName",children:u.name}),Me.jsx("span",{id:"sprie-config-orbitalName",className:"sprie-config-sr-only",children:`Selected orbital ${u.name}`})]})]},u._id))]})}const vk="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/Pgo8IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDIwMDEwOTA0Ly9FTiIKICJodHRwOi8vd3d3LnczLm9yZy9UUi8yMDAxL1JFQy1TVkctMjAwMTA5MDQ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};return Me.jsx("div",{className:"sprie-3d-snap-button-block",children:e.map((s,o)=>Me.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(yf[s.label])},children:s.label},o))})}function wk({frameName:r,customEvent:e,apiService:t,frameList:n,lensList:i,orbitalList:s,showOrbitalList:o,viewerOnly:c,domService:h,ThreeDConfigurator:u,dataVariants:d,dataLenses:A,dataOrbitals:p,firstDitaVariant:g}){const[v,E]=We.useState(0),[m,_]=We.useState(),[w,x]=We.useState(),[I,R]=We.useState(),[M,T]=We.useState(),[D,b]=We.useState(!1),[S,L]=We.useState(!1);We.useState(!1),We.useState(!1);const[P,N]=We.useState(sr?S?35:30:S?28:25),[W,X]=We.useState(sr?10:8),[K,te]=We.useState(),[H,ee]=We.useState(),[Q,z]=We.useState(),[Z,re]=We.useState(!1),[G,de]=We.useState("placeholder"),pe=We.useRef(null),fe=We.useRef(),ye=We.useRef(null);fe.current=h;const Pe={variantId:0,variantName:"defaultName",variantPrice:0,priceCurrency:"defaultCurrency",varinatSku:"lens-default"};let at,se,et;const ke=ve=>{fe.current&&(fe.current.snapCameraToPos(ve),Qe(An[`ChangedView${ve}`]))},dt=async(ve,xe)=>{ve._id===(w==null?void 0:w._id)&&!xe||fe.current&&(b(!0),fe.current.changeFrame(ve,[I,M]).then(()=>{b(!1)}),x(ve),te(d==null?void 0:d.find(Be=>Be.varinatSku==ve.sku)),Qe(`${An.ChangedFrame}${ve.name}`))},Xe=ve=>ve==null?void 0:ve.customisation.find(Be=>Be.type=="Lens"),ft=async ve=>{if(!fe.current||ve==I)return;const xe=ve.sku=="lens-default",Be=Xe(w),Ye=le();!Be&&xe?(b(!0),fe.current.changeLens([ve,M],!0,w).then(()=>{b(!1)})):!Be&&!xe?(I==null?void 0:I.sku)=="lens-default"?(b(!0),fe.current.changeLens([ve,M],!0,w).then(()=>{b(!1)})):fe.current.changeLens([ve,M],!1,w):Be&&xe?fe.current.changeLens([Be,M],!1,w):fe.current.changeLens([ve,M],!1,w),ve.sku=="lens-default"?(ee(Pe),Qe(`${An.ChangedLens}${Pe.variantName}`)):(ee(A==null?void 0:A.find(Le=>{var be;return Le.variantId==Number((be=ve.metadata.find(nt=>nt.key==Ye))==null?void 0:be.value)?Le:null})),Qe(`${An.ChangedLens}${ve.name}. Price will increase by ${H==null?void 0:H.variantPrice} ${H==null?void 0:H.priceCurrency}`)),R(ve)},Y=async ve=>{fe.current&&ve!=M&&(b(!0),await fe.current.changeOrbital(ve).then(()=>{z(p==null?void 0:p.find(xe=>xe.variantId==Number(ve.sku))),b(!1)}),T(ve),Qe(`${An.ChangedOrbital}${ve.name}`))},k=()=>(K==null?void 0:K.variantPrice)+((H==null?void 0:H.varinatSku)!=="lens-default"?H==null?void 0:H.variantPrice:0),le=()=>{var Be;if(!w)return;const ve=(Be=w.metadata.find(Ye=>Ye.key=="baseCurve"))==null?void 0:Be.value;let xe="variantId";return ve=="2B"?xe="2bVariantId":ve=="6B"&&(xe="6bVariantId"),xe},Ae=ve=>{re(ve)},me=ve=>{de(ve)},Ee=()=>{var ve,xe;console.log("about engraving link opened"),sr?(ve=document.querySelector('[id$="main-laser-etch-popover"]'))==null||ve.setAttribute("open",""):(xe=document.querySelector('[id$="main-laser-etch-drawer"]'))==null||xe.setAttribute("open","")},Oe=()=>{if(o&&!Q||!(w&&I)||w.name.toLowerCase().includes("default")||I.name.toLowerCase().includes("default"))return;const ve=w.metadata.find(tt=>tt.key=="variantId"),xe=w.metadata.find(tt=>tt.key=="baseCurve");let Be="variantId";xe&&xe.value=="2B"?Be="2bVariantId":xe&&xe.value=="6B"&&(Be="6bVariantId");const Ye=I.metadata.find(tt=>tt.key==Be),Le=ve?Number(ve.value):null,be=Ye?Number(Ye.value):null,nt=Q!=null&&Q.variantId?Number(Q.variantId):null,pt={frameIdentifier:Le,lensIdentifier:be,orbitalIdentifier:nt};e.emitEvent("onAddToCart",pt);const ct=new Date().getTime(),ut=[];if(be&&Ye){const tt={id:be,quantity:1,properties:{_uniqueTimestamp:ct}};ut.push(tt)}if(nt&&(Q!=null&&Q.variantId)){const tt={id:nt,quantity:1,properties:{_uniqueTimestamp:ct}};ut.push(tt)}if(Z){const tt={id:44745490890985,quantity:1,properties:{_uniqueTimestamp:ct}};ut.push(tt)}if(ve){const tt={id:Le,quantity:1,properties:Z?{_uniqueTimestamp:ct,customText:G}:{_uniqueTimestamp:ct}};ut.push(tt)}t.HandleShopifyAddToCart(ut,ct)},Ce=()=>{var ve,xe;sr?(ve=document.querySelector(".popover.hidden-lap-and-up.popover-full"))==null||ve.removeAttribute("open"):(xe=document.querySelector(".drawer.drawer--full.hidden-phone.lens-customizer"))==null||xe.removeAttribute("open")};We.useEffect(()=>{N(sr?S?35:30:S?28:25)},[S]),We.useEffect(()=>{o?(n&&!at&&(at=n.find(ve=>ve._id=="660c23a0d1d8f617271918f3"),x(at)),i&&!se&&(se=i.find(ve=>ve._id=="65111d718d4c652ece493034"),ft(se)),s&&!et&&(et=s.find(ve=>ve._id=="660c1c0231c23bd36b188fd4"),Y(et))):n&&x(n[0])},[n]),We.useEffect(()=>{te(g),ee(Pe)},[g]),We.useEffect(()=>{},[Z,G]);const Qe=ve=>{ye.current&&(ye.current.textContent=ve)};return Me.jsxs("section",{id:"sprie-config-main-container",ref:pe,children:[!c&&Me.jsxs("header",{id:"sprie-config-main-header",style:{height:`${W}%`},children:[Me.jsxs("div",{id:"sprie-config-header-content",children:[Me.jsx("img",{src:vk,alt:"dita-logo",width:97,height:20}),Me.jsxs("p",{style:{margin:"0"},className:"sprie-config-mainHeader-frameName",children:[r," CUSTOMIZER"]})]}),Me.jsx("button",{className:"sprie-config-main-header-close",onClick:Ce,"aria-label":"close frame customizer",children:Me.jsx("img",{src:Ek,alt:"close",style:{width:"2rem",height:"2rem"}})})]}),Me.jsx("span",{className:"sprie-config-sr-only",ref:ye,"aria-live":"assertive"}),Me.jsxs("section",{tabIndex:0,"aria-label":"3D viewer",onFocus:()=>Qe(An.EnteredViewer),id:"sprie-config-viewer-container",style:{height:`${c?100:100-(P+W+(sr?8.5:0))}%`},children:[!c&&Me.jsx("img",{src:yk,alt:"360deg-logo",width:44,height:34}),!c&&Me.jsx(xk,{snapCameraTo:ke}),D&&Me.jsx("div",{className:"sprie-config-loadingFrame",children:Me.jsx("div",{className:"sprie-config-loader"})}),Me.jsx("div",{style:{width:"100%",height:"100%"},id:"holder-canvas"})]}),!c&&Me.jsxs("section",{id:"Sprie-config-Cust-block",style:{height:`${P}%`},children:[Me.jsxs(mk,{setShowAddToCart:L,setSelectedChild:E,setSectionEntered:_,children:[Me.jsx(dk,{modelLoading:D,frameList:n,selectedFrame:w,isSelected:v===0,onChangeFrame:dt,heading:"SELECT FRAME",paletteEntered:m===0}),o&&Me.jsx(_k,{orbitalList:s,selectedOrbital:M,modelLoading:D,isSelected:v===1,onChangeOrbital:Y,heading:"SELECT ORBITAL",paletteEntered:m===1}),Me.jsx(fk,{modelLoading:D,lensList:i,selectedLens:I,selectedDitaLens:H,isSelected:v===(o?2:1),paletteEntered:m===(o?2:1),onChangeLens:ft,heading:"SELECT LENS COLOR"}),Me.jsx(pk,{heading:"LASER ENGRAVING",isSelected:v===(o?3:2),paletteEntered:m===(o?3:2),onEngravingLinkClicked:Ee,onChecked:Ae,onTextAdded:me})]}),Me.jsxs("div",{className:"sprie-config-price-block",children:[Me.jsx("p",{id:"sprie-config-price-text",style:{bottom:sr?"100%":"",margin:"0 0.8rem 0.5rem 0"},children:`${k()}.00 ${K==null?void 0:K.priceCurrency} `}),!sr&&S&&Me.jsx(MI,{conditionRequired:!0,onButtonClick:Oe}),S&&Me.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&&S&&Me.jsx("div",{style:{position:"absolute",bottom:"0%",width:"100%"},children:Me.jsx(MI,{conditionRequired:!0,onButtonClick:Oe})})]})]})}function Ik({apiService:r,sku:e,events:t,viewerOnly:n=!1}){var A;const i=We.useRef(),[s,o]=We.useState(null),c=(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,We.useEffect(()=>((async()=>{var _,w;i.current=new SI,await((_=i.current)==null?void 0:_.Init(r.apiKey));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,v=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:v==null?void 0:v.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]),Me.jsxs(Me.Fragment,{children:[(!h||!u)&&Me.jsxs("div",{children:[Me.jsx("span",{id:"sprie-config-loader-srtext",className:"sprie-config-sr-only",children:"Loading frame customiser"}),Me.jsx("div",{className:"sprie-config-loadingBox","aria-labelledby":"sprie-config-loader-srtext",children:"Loading..."})]}),Me.jsx(wk,{customEvent:t,frameName:c,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 Gm={},TI={exports:{}},Bn={},Vm={exports:{}},jm={};/**
4467
+ Press enter to `+(c?"configure your optional custom engraving. Add to cart button is now present at the end of this section.":"select or press tab for next.")}),Me.jsxs("div",{tabIndex:0,style:{height:"30%",alignContent:"center"},"aria-labelledby":"sprie-config-step-selector",onKeyDown:p,ref:h,children:[Me.jsx(gk,{nextSlide:A,previousSlide:d,currentIndex:i,stepsName:u,isLastStep:c}),Me.jsx(Ak,{totalSteps:u==null?void 0:u.length,currentStep:i+1})]}),Me.jsx("div",{className:"carousel-container",style:{paddingTop:sr?"":"1rem"},children:o.map((v,E)=>Me.jsx("div",{className:"carousel-item",style:{transform:`translateX(-${i*100}%)`},children:v},E))})]})}const PQ="";function MI({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]),Me.jsxs("div",{className:"sprie-config-add-to-cart-block",children:[Me.jsxs("label",{htmlFor:"Sprie-Config-return-policy-checkbox",id:"Sprie-Config-return-policy-label",ref:i,style:{display:"none"},children:[Me.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}),Me.jsx("p",{id:"sprie-config-return-policy-desc",children:"I agree this customized Item cannot be returned or exchanged."})]}),Me.jsx("button",{className:"sprie-config-add-to-cart-btn",ref:s,onClick:e,children:"ADD TO CART"})]})}function _k({orbitalList:r,selectedOrbital:e,modelLoading:t,isSelected:n,paletteEntered:i,onChangeOrbital:s}){const o=Ye.useRef(null),c=Ye.useRef(null),h=()=>{o.current&&(o.current.textContent=An.EnteredOrbitalsListSection)};return Ye.useEffect(()=>{i&&c.current&&c.current.querySelectorAll(".sprie-config-palette-img-box")[0].firstChild.focus()},[i]),Me.jsxs("div",{className:"sprie-config-palette",ref:c,style:{display:n?"flex":"none",padding:"0 3rem",gap:sr?"3rem":"5rem"},children:[Me.jsx("span",{className:"sprie-config-sr-only","aria-live":"assertive",ref:o}),r==null?void 0:r.map(u=>Me.jsxs("div",{className:"sprie-config-palette-img-box",children:[Me.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:Me.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"}})}),Me.jsxs("p",{className:"sprie-config-palette-img-text",style:{bottom:"-1.5rem"},children:[Me.jsx("span",{className:"sprie-config-palette-imgName",children:u.name}),Me.jsx("span",{id:"sprie-config-orbitalName",className:"sprie-config-sr-only",children:`Selected orbital ${u.name}`})]})]},u._id))]})}const vk="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/Pgo8IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDIwMDEwOTA0Ly9FTiIKICJodHRwOi8vd3d3LnczLm9yZy9UUi8yMDAxL1JFQy1TVkctMjAwMTA5MDQvRFREL3N2ZzEwLmR0ZCI+CjxzdmcgdmVyc2lvbj0iMS4wIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiB3aWR0aD0iMzIwLjAwMDAwMHB0IiBoZWlnaHQ9IjY2LjAwMDAwMHB0IiB2aWV3Qm94PSIwIDAgMzIwLjAwMDAwMCA2Ni4wMDAwMDAiCiBwcmVzZXJ2ZUFzcGVjdFJhdG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3LjM2NjkzOCAxMy44MDQ5MzcgNDguNjMzMDYzIDE0LjU4NTkzOCA0OS40MTQwNjIgQyAxNC45NzY5MzcgNDkuODA1MDYyIDE1LjQ4OCA1MCAxNiA1MCBDIDE2LjUxMiA1MCAxNy4wMjMwNjIgNDkuODA1MDYyIDE3LjQxNDA2MiA0OS40MTQwNjIgTCAzMiAzNC44MjgxMjUgTCA0Ni41ODU5MzggNDkuNDE0MDYyIEMgNDcuMzY2OTM4IDUwLjE5NTA2MyA0OC42MzMwNjMgNTAuMTk1MDYyIDQ5LjQxNDA2MiA0OS40MTQwNjIgQyA1MC4xOTUwNjMgNDguNjMzMDYyIDUwLjE5NTA2MiA0Ny4zNjY5MzcgNDkuNDE0MDYyIDQ2LjU4NTkzOCBMIDM0LjgyODEyNSAzMiBMIDQ5LjQxNDA2MiAxNy40MTQwNjIgQyA1MC4xOTUwNjMgMTYuNjMzMDYzIDUwLjE5NTA2MiAxNS4zNjY5MzggNDkuNDE0MDYyIDE0LjU4NTkzOCBDIDQ4LjYzMzA2MiAxMy44MDQ5MzggNDcuMzY2OTM3IDEzLjgwNDkzOCA0Ni41ODU5MzggMTQuNTg1OTM4IEwgMzIgMjkuMTcxODc1IEwgMTcuNDE0MDYyIDE0LjU4NTkzOCBDIDE3LjAyMzA2MiAxNC4xOTQ5MzggMTYuNTEyIDE0IDE2IDE0IHoiLz48L3N2Zz4=",kQ="";function xk({snapCameraTo:r}){const e=Object.keys(yf).map(s=>({label:yf[s],isDisabled:!0})),[t,n]=Ye.useState(),i=s=>{n(s),r(s)};return Me.jsx("div",{className:"sprie-3d-snap-button-block",children:e.map((s,o)=>Me.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(yf[s.label])},children:s.label},o))})}function wk({frameName:r,customEvent:e,apiService:t,frameList:n,lensList:i,orbitalList:s,showOrbitalList:o,viewerOnly:c,domService:h,ThreeDConfigurator:u,dataVariants:d,dataLenses:A,dataOrbitals:p,firstDitaVariant:g}){const[v,E]=Ye.useState(0),[m,_]=Ye.useState(),[w,x]=Ye.useState(),[I,R]=Ye.useState(),[M,T]=Ye.useState(),[D,b]=Ye.useState(!1),[S,L]=Ye.useState(!1);Ye.useState(!1),Ye.useState(!1);const[P,N]=Ye.useState(sr?S?35:30:S?28:25),[W,X]=Ye.useState(sr?10:8),[K,te]=Ye.useState(),[H,ee]=Ye.useState(),[Q,z]=Ye.useState(),[Z,re]=Ye.useState(!1),[G,de]=Ye.useState("placeholder"),pe=Ye.useRef(null),fe=Ye.useRef(),ye=Ye.useRef(null);fe.current=h;const Pe={variantId:0,variantName:"defaultName",variantPrice:0,priceCurrency:"defaultCurrency",varinatSku:"lens-default"};let at,se,et;const ke=ve=>{fe.current&&(fe.current.snapCameraToPos(ve),Qe(An[`ChangedView${ve}`]))},dt=async(ve,xe)=>{ve._id===(w==null?void 0:w._id)&&!xe||fe.current&&(b(!0),fe.current.changeFrame(ve,[I,M]).then(()=>{b(!1)}),x(ve),te(d==null?void 0:d.find(Be=>Be.varinatSku==ve.sku)),Qe(`${An.ChangedFrame}${ve.name}`))},Xe=ve=>ve==null?void 0:ve.customisation.find(Be=>Be.type=="Lens"),ft=async ve=>{if(!fe.current||ve==I)return;const xe=ve.sku=="lens-default",Be=Xe(w),We=le();!Be&&xe?(b(!0),fe.current.changeLens([ve,M],!0,w).then(()=>{b(!1)})):!Be&&!xe?(I==null?void 0:I.sku)=="lens-default"?(b(!0),fe.current.changeLens([ve,M],!0,w).then(()=>{b(!1)})):fe.current.changeLens([ve,M],!1,w):Be&&xe?fe.current.changeLens([Be,M],!1,w):fe.current.changeLens([ve,M],!1,w),ve.sku=="lens-default"?(ee(Pe),Qe(`${An.ChangedLens}${Pe.variantName}`)):(ee(A==null?void 0:A.find(Le=>{var be;return Le.variantId==Number((be=ve.metadata.find(nt=>nt.key==We))==null?void 0:be.value)?Le:null})),Qe(`${An.ChangedLens}${ve.name}. Price will increase by ${H==null?void 0:H.variantPrice} ${H==null?void 0:H.priceCurrency}`)),R(ve)},Y=async ve=>{fe.current&&ve!=M&&(b(!0),await fe.current.changeOrbital(ve).then(()=>{z(p==null?void 0:p.find(xe=>xe.variantId==Number(ve.sku))),b(!1)}),T(ve),Qe(`${An.ChangedOrbital}${ve.name}`))},k=()=>(K==null?void 0:K.variantPrice)+((H==null?void 0:H.varinatSku)!=="lens-default"?H==null?void 0:H.variantPrice:0),le=()=>{var Be;if(!w)return;const ve=(Be=w.metadata.find(We=>We.key=="baseCurve"))==null?void 0:Be.value;let xe="variantId";return ve=="2B"?xe="2bVariantId":ve=="6B"&&(xe="6bVariantId"),xe},Ae=ve=>{re(ve)},me=ve=>{de(ve)},Ee=()=>{var ve,xe;sr?(ve=document.querySelector('[id$="main-laser-etch-popover"]'))==null||ve.setAttribute("open",""):(xe=document.querySelector('[id$="main-laser-etch-drawer"]'))==null||xe.setAttribute("open","")},Oe=()=>{if(o&&!Q||!(w&&I)||w.name.toLowerCase().includes("default")||I.name.toLowerCase().includes("default"))return;const ve=w.metadata.find(tt=>tt.key=="variantId"),xe=w.metadata.find(tt=>tt.key=="baseCurve");let Be="variantId";xe&&xe.value=="2B"?Be="2bVariantId":xe&&xe.value=="6B"&&(Be="6bVariantId");const We=I.metadata.find(tt=>tt.key==Be),Le=ve?Number(ve.value):null,be=We?Number(We.value):null,nt=Q!=null&&Q.variantId?Number(Q.variantId):null,pt={frameIdentifier:Le,lensIdentifier:be,orbitalIdentifier:nt};e.emitEvent("onAddToCart",pt);const ct=new Date().getTime(),ut=[];if(be&&We){const tt={id:be,quantity:1,properties:{_uniqueTimestamp:ct}};ut.push(tt)}if(nt&&(Q!=null&&Q.variantId)){const tt={id:nt,quantity:1,properties:{_uniqueTimestamp:ct}};ut.push(tt)}if(Z){const tt={id:44745490890985,quantity:1,properties:{_uniqueTimestamp:ct}};ut.push(tt)}if(ve){const tt={id:Le,quantity:1,properties:Z?{_uniqueTimestamp:ct,customText:G}:{_uniqueTimestamp:ct}};ut.push(tt)}t.HandleShopifyAddToCart(ut,ct)},Ce=()=>{var ve,xe;sr?(ve=document.querySelector(".popover.hidden-lap-and-up.popover-full"))==null||ve.removeAttribute("open"):(xe=document.querySelector(".drawer.drawer--full.hidden-phone.lens-customizer"))==null||xe.removeAttribute("open")};Ye.useEffect(()=>{N(sr?S?35:30:S?28:25)},[S]),Ye.useEffect(()=>{n&&(o?(n&&!at&&(at=n.find(ve=>ve._id=="660c23a0d1d8f617271918f3"),x(at)),i&&!se&&(se=i.find(ve=>ve._id=="65111d718d4c652ece493034"),ft(se)),s&&!et&&(et=s.find(ve=>ve._id=="660c1c0231c23bd36b188fd4"),Y(et))):x(n[0]))},[n]),Ye.useEffect(()=>{te(g),ee(Pe)},[g]),Ye.useEffect(()=>{},[Z,G]);const Qe=ve=>{ye.current&&(ye.current.textContent=ve)};return Me.jsxs("section",{id:"sprie-config-main-container",ref:pe,children:[!c&&Me.jsxs("header",{id:"sprie-config-main-header",style:{height:`${W}%`},children:[Me.jsxs("div",{id:"sprie-config-header-content",children:[Me.jsx("img",{src:vk,alt:"dita-logo",width:97,height:20}),Me.jsxs("p",{style:{margin:"0"},className:"sprie-config-mainHeader-frameName",children:[r," CUSTOMIZER"]})]}),Me.jsx("button",{className:"sprie-config-main-header-close",onClick:Ce,"aria-label":"close frame customizer",children:Me.jsx("img",{src:Ek,alt:"close",style:{width:"2rem",height:"2rem"}})})]}),Me.jsx("span",{className:"sprie-config-sr-only",ref:ye,"aria-live":"assertive"}),Me.jsxs("section",{tabIndex:0,"aria-label":"3D viewer",onFocus:()=>Qe(An.EnteredViewer),id:"sprie-config-viewer-container",style:{height:`${c?100:100-(P+W+(sr?8.5:0))}%`},children:[!c&&Me.jsx("img",{src:yk,alt:"360deg-logo",width:44,height:34}),!c&&Me.jsx(xk,{snapCameraTo:ke}),D&&Me.jsx("div",{className:"sprie-config-loadingFrame",children:Me.jsx("div",{className:"sprie-config-loader"})}),Me.jsx("div",{style:{width:"100%",height:"100%"},id:"holder-canvas"})]}),!c&&Me.jsxs("section",{id:"Sprie-config-Cust-block",style:{height:`${P}%`},children:[Me.jsxs(mk,{setShowAddToCart:L,setSelectedChild:E,setSectionEntered:_,children:[Me.jsx(dk,{modelLoading:D,frameList:n,selectedFrame:w,isSelected:v===0,onChangeFrame:dt,heading:"SELECT FRAME",paletteEntered:m===0}),o&&Me.jsx(_k,{orbitalList:s,selectedOrbital:M,modelLoading:D,isSelected:v===1,onChangeOrbital:Y,heading:"SELECT ORBITAL",paletteEntered:m===1}),Me.jsx(fk,{modelLoading:D,lensList:i,selectedLens:I,selectedDitaLens:H,isSelected:v===(o?2:1),paletteEntered:m===(o?2:1),onChangeLens:ft,heading:"SELECT LENS COLOR"}),Me.jsx(pk,{heading:"LASER ENGRAVING",isSelected:v===(o?3:2),paletteEntered:m===(o?3:2),onEngravingLinkClicked:Ee,onChecked:Ae,onTextAdded:me})]}),Me.jsxs("div",{className:"sprie-config-price-block",children:[Me.jsx("p",{id:"sprie-config-price-text",style:{bottom:sr?"100%":"",margin:"0 0.8rem 0.5rem 0"},children:`${k()}.00 ${K==null?void 0:K.priceCurrency} `}),!sr&&S&&Me.jsx(MI,{conditionRequired:!0,onButtonClick:Oe}),S&&Me.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&&S&&Me.jsx("div",{style:{position:"absolute",bottom:"0%",width:"100%"},children:Me.jsx(MI,{conditionRequired:!0,onButtonClick:Oe})})]})]})}function Ik({apiService:r,sku:e,events:t,viewerOnly:n=!1}){var A;const i=Ye.useRef(),[s,o]=Ye.useState(null),c=(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 _,w;i.current=new SI,await((_=i.current)==null?void 0:_.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,v=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:v==null?void 0:v.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]),Me.jsxs(Me.Fragment,{children:[(!h||!u)&&Me.jsxs("div",{children:[Me.jsx("span",{id:"sprie-config-loader-srtext",className:"sprie-config-sr-only",children:"Loading frame customiser"}),Me.jsx("div",{className:"sprie-config-loadingBox","aria-labelledby":"sprie-config-loader-srtext",children:"Loading..."})]}),Me.jsx(wk,{customEvent:t,frameName:c,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 Gm={},TI={exports:{}},Bn={},Vm={exports:{}},jm={};/**
4468
4468
  * @license React
4469
4469
  * scheduler.production.min.js
4470
4470
  *
@@ -4480,11 +4480,11 @@ bool bvhIntersectFirstHit(
4480
4480
  *
4481
4481
  * This source code is licensed under the MIT license found in the
4482
4482
  * LICENSE file in the root directory of this source tree.
4483
- */var RI;function Mk(){if(RI)return Bn;RI=1;var r=We,e=Sk();function t(a){for(var l="https://reactjs.org/docs/error-decoder.html?invariant="+a,f=1;f<arguments.length;f++)l+="&args[]="+encodeURIComponent(arguments[f]);return"Minified React error #"+a+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var n=new Set,i={};function s(a,l){o(a,l),o(a+"Capture",l)}function o(a,l){for(i[a]=l,a=0;a<l.length;a++)n.add(l[a])}var c=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),h=Object.prototype.hasOwnProperty,u=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,d={},A={};function p(a){return h.call(A,a)?!0:h.call(d,a)?!1:u.test(a)?A[a]=!0:(d[a]=!0,!1)}function g(a,l,f,y){if(f!==null&&f.type===0)return!1;switch(typeof l){case"function":case"symbol":return!0;case"boolean":return y?!1:f!==null?!f.acceptsBooleans:(a=a.toLowerCase().slice(0,5),a!=="data-"&&a!=="aria-");default:return!1}}function v(a,l,f,y){if(l===null||typeof l>"u"||g(a,l,f,y))return!0;if(y)return!1;if(f!==null)switch(f.type){case 3:return!l;case 4:return l===!1;case 5:return isNaN(l);case 6:return isNaN(l)||1>l}return!1}function E(a,l,f,y,C,B,U){this.acceptsBooleans=l===2||l===3||l===4,this.attributeName=y,this.attributeNamespace=C,this.mustUseProperty=f,this.propertyName=a,this.type=l,this.sanitizeURL=B,this.removeEmptyString=U}var m={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){m[a]=new E(a,0,!1,a,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var l=a[0];m[l]=new E(l,1,!1,a[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(a){m[a]=new E(a,2,!1,a.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){m[a]=new E(a,2,!1,a,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(a){m[a]=new E(a,3,!1,a.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(a){m[a]=new E(a,3,!0,a,null,!1,!1)}),["capture","download"].forEach(function(a){m[a]=new E(a,4,!1,a,null,!1,!1)}),["cols","rows","size","span"].forEach(function(a){m[a]=new E(a,6,!1,a,null,!1,!1)}),["rowSpan","start"].forEach(function(a){m[a]=new E(a,5,!1,a.toLowerCase(),null,!1,!1)});var _=/[\-:]([a-z])/g;function w(a){return a[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(a){var l=a.replace(_,w);m[l]=new E(l,1,!1,a,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a){var l=a.replace(_,w);m[l]=new E(l,1,!1,a,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(a){var l=a.replace(_,w);m[l]=new E(l,1,!1,a,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(a){m[a]=new E(a,1,!1,a.toLowerCase(),null,!1,!1)}),m.xlinkHref=new E("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(a){m[a]=new E(a,1,!1,a.toLowerCase(),null,!0,!0)});function x(a,l,f,y){var C=m.hasOwnProperty(l)?m[l]:null;(C!==null?C.type!==0:y||!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(v(l,f,C,y)&&(f=null),y||C===null?p(l)&&(f===null?a.removeAttribute(l):a.setAttribute(l,""+f)):C.mustUseProperty?a[C.propertyName]=f===null?C.type===3?!1:"":f:(l=C.attributeName,y=C.attributeNamespace,f===null?a.removeAttribute(l):(C=C.type,f=C===3||C===4&&f===!0?"":""+f,y?a.setAttributeNS(y,l,f):a.setAttribute(l,f))))}var I=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,R=Symbol.for("react.element"),M=Symbol.for("react.portal"),T=Symbol.for("react.fragment"),D=Symbol.for("react.strict_mode"),b=Symbol.for("react.profiler"),S=Symbol.for("react.provider"),L=Symbol.for("react.context"),P=Symbol.for("react.forward_ref"),N=Symbol.for("react.suspense"),W=Symbol.for("react.suspense_list"),X=Symbol.for("react.memo"),K=Symbol.for("react.lazy"),te=Symbol.for("react.offscreen"),H=Symbol.iterator;function ee(a){return a===null||typeof a!="object"?null:(a=H&&a[H]||a["@@iterator"],typeof a=="function"?a:null)}var Q=Object.assign,z;function Z(a){if(z===void 0)try{throw Error()}catch(f){var l=f.stack.trim().match(/\n( *(at )?)/);z=l&&l[1]||""}return`
4483
+ */var RI;function Mk(){if(RI)return Bn;RI=1;var r=Ye,e=Sk();function t(a){for(var l="https://reactjs.org/docs/error-decoder.html?invariant="+a,f=1;f<arguments.length;f++)l+="&args[]="+encodeURIComponent(arguments[f]);return"Minified React error #"+a+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var n=new Set,i={};function s(a,l){o(a,l),o(a+"Capture",l)}function o(a,l){for(i[a]=l,a=0;a<l.length;a++)n.add(l[a])}var c=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),h=Object.prototype.hasOwnProperty,u=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,d={},A={};function p(a){return h.call(A,a)?!0:h.call(d,a)?!1:u.test(a)?A[a]=!0:(d[a]=!0,!1)}function g(a,l,f,y){if(f!==null&&f.type===0)return!1;switch(typeof l){case"function":case"symbol":return!0;case"boolean":return y?!1:f!==null?!f.acceptsBooleans:(a=a.toLowerCase().slice(0,5),a!=="data-"&&a!=="aria-");default:return!1}}function v(a,l,f,y){if(l===null||typeof l>"u"||g(a,l,f,y))return!0;if(y)return!1;if(f!==null)switch(f.type){case 3:return!l;case 4:return l===!1;case 5:return isNaN(l);case 6:return isNaN(l)||1>l}return!1}function E(a,l,f,y,C,B,U){this.acceptsBooleans=l===2||l===3||l===4,this.attributeName=y,this.attributeNamespace=C,this.mustUseProperty=f,this.propertyName=a,this.type=l,this.sanitizeURL=B,this.removeEmptyString=U}var m={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){m[a]=new E(a,0,!1,a,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var l=a[0];m[l]=new E(l,1,!1,a[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(a){m[a]=new E(a,2,!1,a.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){m[a]=new E(a,2,!1,a,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(a){m[a]=new E(a,3,!1,a.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(a){m[a]=new E(a,3,!0,a,null,!1,!1)}),["capture","download"].forEach(function(a){m[a]=new E(a,4,!1,a,null,!1,!1)}),["cols","rows","size","span"].forEach(function(a){m[a]=new E(a,6,!1,a,null,!1,!1)}),["rowSpan","start"].forEach(function(a){m[a]=new E(a,5,!1,a.toLowerCase(),null,!1,!1)});var _=/[\-:]([a-z])/g;function w(a){return a[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(a){var l=a.replace(_,w);m[l]=new E(l,1,!1,a,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a){var l=a.replace(_,w);m[l]=new E(l,1,!1,a,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(a){var l=a.replace(_,w);m[l]=new E(l,1,!1,a,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(a){m[a]=new E(a,1,!1,a.toLowerCase(),null,!1,!1)}),m.xlinkHref=new E("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(a){m[a]=new E(a,1,!1,a.toLowerCase(),null,!0,!0)});function x(a,l,f,y){var C=m.hasOwnProperty(l)?m[l]:null;(C!==null?C.type!==0:y||!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(v(l,f,C,y)&&(f=null),y||C===null?p(l)&&(f===null?a.removeAttribute(l):a.setAttribute(l,""+f)):C.mustUseProperty?a[C.propertyName]=f===null?C.type===3?!1:"":f:(l=C.attributeName,y=C.attributeNamespace,f===null?a.removeAttribute(l):(C=C.type,f=C===3||C===4&&f===!0?"":""+f,y?a.setAttributeNS(y,l,f):a.setAttribute(l,f))))}var I=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,R=Symbol.for("react.element"),M=Symbol.for("react.portal"),T=Symbol.for("react.fragment"),D=Symbol.for("react.strict_mode"),b=Symbol.for("react.profiler"),S=Symbol.for("react.provider"),L=Symbol.for("react.context"),P=Symbol.for("react.forward_ref"),N=Symbol.for("react.suspense"),W=Symbol.for("react.suspense_list"),X=Symbol.for("react.memo"),K=Symbol.for("react.lazy"),te=Symbol.for("react.offscreen"),H=Symbol.iterator;function ee(a){return a===null||typeof a!="object"?null:(a=H&&a[H]||a["@@iterator"],typeof a=="function"?a:null)}var Q=Object.assign,z;function Z(a){if(z===void 0)try{throw Error()}catch(f){var l=f.stack.trim().match(/\n( *(at )?)/);z=l&&l[1]||""}return`
4484
4484
  `+z+a}var re=!1;function G(a,l){if(!a||re)return"";re=!0;var f=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(l)if(l=function(){throw Error()},Object.defineProperty(l.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(l,[])}catch(ce){var y=ce}Reflect.construct(a,[],l)}else{try{l.call()}catch(ce){y=ce}a.call(l.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(`
4485
4485
  `),B=y.stack.split(`
4486
4486
  `),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=`
4487
- `+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=G(a.type,!1),a;case 11:return a=G(a.type.render,!1),a;case 1:return a=G(a.type,!0),a;default:return""}}function pe(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 M: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 S:return(a._context.displayName||"Context")+".Provider";case P:var l=a.render;return a=a.displayName,a||(a=l.displayName||l.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case X:return l=a.displayName||null,l!==null?l:pe(a.type)||"Memo";case K:l=a._payload,a=a._init;try{return pe(a(l))}catch{}}return null}function fe(a){var l=a.type;switch(a.tag){case 24:return"Cache";case 9:return(l.displayName||"Context")+".Consumer";case 10:return(l._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return a=l.render,a=a.displayName||a.name||"",l.displayName||(a!==""?"ForwardRef("+a+")":"ForwardRef");case 7:return"Fragment";case 5:return l;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return pe(l);case 8:return l===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 l=="function")return l.displayName||l.name||null;if(typeof l=="string")return l}return null}function ye(a){switch(typeof a){case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function Pe(a){var l=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function at(a){var l=Pe(a)?"checked":"value",f=Object.getOwnPropertyDescriptor(a.constructor.prototype,l),y=""+a[l];if(!a.hasOwnProperty(l)&&typeof f<"u"&&typeof f.get=="function"&&typeof f.set=="function"){var C=f.get,B=f.set;return Object.defineProperty(a,l,{configurable:!0,get:function(){return C.call(this)},set:function(U){y=""+U,B.call(this,U)}}),Object.defineProperty(a,l,{enumerable:f.enumerable}),{getValue:function(){return y},setValue:function(U){y=""+U},stopTracking:function(){a._valueTracker=null,delete a[l]}}}}function se(a){a._valueTracker||(a._valueTracker=at(a))}function et(a){if(!a)return!1;var l=a._valueTracker;if(!l)return!0;var f=l.getValue(),y="";return a&&(y=Pe(a)?a.checked?"true":"false":a.value),a=y,a!==f?(l.setValue(a),!0):!1}function ke(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 dt(a,l){var f=l.checked;return Q({},l,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:f??a._wrapperState.initialChecked})}function Xe(a,l){var f=l.defaultValue==null?"":l.defaultValue,y=l.checked!=null?l.checked:l.defaultChecked;f=ye(l.value!=null?l.value:f),a._wrapperState={initialChecked:y,initialValue:f,controlled:l.type==="checkbox"||l.type==="radio"?l.checked!=null:l.value!=null}}function ft(a,l){l=l.checked,l!=null&&x(a,"checked",l,!1)}function Y(a,l){ft(a,l);var f=ye(l.value),y=l.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}l.hasOwnProperty("value")?le(a,l.type,f):l.hasOwnProperty("defaultValue")&&le(a,l.type,ye(l.defaultValue)),l.checked==null&&l.defaultChecked!=null&&(a.defaultChecked=!!l.defaultChecked)}function k(a,l,f){if(l.hasOwnProperty("value")||l.hasOwnProperty("defaultValue")){var y=l.type;if(!(y!=="submit"&&y!=="reset"||l.value!==void 0&&l.value!==null))return;l=""+a._wrapperState.initialValue,f||l===a.value||(a.value=l),a.defaultValue=l}f=a.name,f!==""&&(a.name=""),a.defaultChecked=!!a._wrapperState.initialChecked,f!==""&&(a.name=f)}function le(a,l,f){(l!=="number"||ke(a.ownerDocument)!==a)&&(f==null?a.defaultValue=""+a._wrapperState.initialValue:a.defaultValue!==""+f&&(a.defaultValue=""+f))}var Ae=Array.isArray;function me(a,l,f,y){if(a=a.options,l){l={};for(var C=0;C<f.length;C++)l["$"+f[C]]=!0;for(f=0;f<a.length;f++)C=l.hasOwnProperty("$"+a[f].value),a[f].selected!==C&&(a[f].selected=C),C&&y&&(a[f].defaultSelected=!0)}else{for(f=""+ye(f),l=null,C=0;C<a.length;C++){if(a[C].value===f){a[C].selected=!0,y&&(a[C].defaultSelected=!0);return}l!==null||a[C].disabled||(l=a[C])}l!==null&&(l.selected=!0)}}function Ee(a,l){if(l.dangerouslySetInnerHTML!=null)throw Error(t(91));return Q({},l,{value:void 0,defaultValue:void 0,children:""+a._wrapperState.initialValue})}function Oe(a,l){var f=l.value;if(f==null){if(f=l.children,l=l.defaultValue,f!=null){if(l!=null)throw Error(t(92));if(Ae(f)){if(1<f.length)throw Error(t(93));f=f[0]}l=f}l==null&&(l=""),f=l}a._wrapperState={initialValue:ye(f)}}function Ce(a,l){var f=ye(l.value),y=ye(l.defaultValue);f!=null&&(f=""+f,f!==a.value&&(a.value=f),l.defaultValue==null&&a.defaultValue!==f&&(a.defaultValue=f)),y!=null&&(a.defaultValue=""+y)}function Qe(a){var l=a.textContent;l===a._wrapperState.initialValue&&l!==""&&l!==null&&(a.value=l)}function ve(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 xe(a,l){return a==null||a==="http://www.w3.org/1999/xhtml"?ve(l):a==="http://www.w3.org/2000/svg"&&l==="foreignObject"?"http://www.w3.org/1999/xhtml":a}var Be,Ye=function(a){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(l,f,y,C){MSApp.execUnsafeLocalFunction(function(){return a(l,f,y,C)})}:a}(function(a,l){if(a.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in a)a.innerHTML=l;else{for(Be=Be||document.createElement("div"),Be.innerHTML="<svg>"+l.valueOf().toString()+"</svg>",l=Be.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;l.firstChild;)a.appendChild(l.firstChild)}});function Le(a,l){if(l){var f=a.firstChild;if(f&&f===a.lastChild&&f.nodeType===3){f.nodeValue=l;return}}a.textContent=l}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(l){l=l+a.charAt(0).toUpperCase()+a.substring(1),be[l]=be[a]})});function pt(a,l,f){return l==null||typeof l=="boolean"||l===""?"":f||typeof l!="number"||l===0||be.hasOwnProperty(a)&&be[a]?(""+l).trim():l+"px"}function ct(a,l){a=a.style;for(var f in l)if(l.hasOwnProperty(f)){var y=f.indexOf("--")===0,C=pt(f,l[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 tt(a,l){if(l){if(ut[a]&&(l.children!=null||l.dangerouslySetInnerHTML!=null))throw Error(t(137,a));if(l.dangerouslySetInnerHTML!=null){if(l.children!=null)throw Error(t(60));if(typeof l.dangerouslySetInnerHTML!="object"||!("__html"in l.dangerouslySetInnerHTML))throw Error(t(61))}if(l.style!=null&&typeof l.style!="object")throw Error(t(62))}}function V(a,l){if(a.indexOf("-")===-1)return typeof l.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 F=null;function ge(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var _e=null,ze=null,Ne=null;function _t(a){if(a=fh(a)){if(typeof _e!="function")throw Error(t(280));var l=a.stateNode;l&&(l=Of(l),_e(a.stateNode,a.type,l))}}function Dt(a){ze?Ne?Ne.push(a):Ne=[a]:ze=a}function Lt(){if(ze){var a=ze,l=Ne;if(Ne=ze=null,_t(a),l)for(a=0;a<l.length;a++)_t(l[a])}}function Mt(a,l){return a(l)}function vt(){}var hr=!1;function Vt(a,l,f){if(hr)return a(l,f);hr=!0;try{return Mt(a,l,f)}finally{hr=!1,(ze!==null||Ne!==null)&&(vt(),Lt())}}function _r(a,l){var f=a.stateNode;if(f===null)return null;var y=Of(f);if(y===null)return null;f=y[l];e:switch(l){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,l,typeof f));return f}var bn=!1;if(c)try{var qt={};Object.defineProperty(qt,"passive",{get:function(){bn=!0}}),window.addEventListener("test",qt,qt),window.removeEventListener("test",qt,qt)}catch{bn=!1}function hi(a,l,f,y,C,B,U,q,J){var ce=Array.prototype.slice.call(arguments,3);try{l.apply(f,ce)}catch(Ie){this.onError(Ie)}}var Jn=!1,Ns=null,Us=!1,ac=null,wf={onError:function(a){Jn=!0,Ns=a}};function qm(a,l,f,y,C,B,U,q,J){Jn=!1,Ns=null,hi.apply(wf,arguments)}function Xm(a,l,f,y,C,B,U,q,J){if(qm.apply(this,arguments),Jn){if(Jn){var ce=Ns;Jn=!1,Ns=null}else throw Error(t(198));Us||(Us=!0,ac=ce)}}function Ps(a){var l=a,f=a;if(a.alternate)for(;l.return;)l=l.return;else{a=l;do l=a,l.flags&4098&&(f=l.return),a=l.return;while(a)}return l.tag===3?f:null}function O(a){if(a.tag===13){var l=a.memoizedState;if(l===null&&(a=a.alternate,a!==null&&(l=a.memoizedState)),l!==null)return l.dehydrated}return null}function ne(a){if(Ps(a)!==a)throw Error(t(188))}function ue(a){var l=a.alternate;if(!l){if(l=Ps(a),l===null)throw Error(t(188));return l!==a?null:a}for(var f=a,y=l;;){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),l;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:l}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 l=oe(a);if(l!==null)return l;a=a.sibling}return null}var Re=e.unstable_scheduleCallback,Je=e.unstable_cancelCallback,it=e.unstable_shouldYield,ot=e.unstable_requestPaint,qe=e.unstable_now,At=e.unstable_getCurrentPriorityLevel,ht=e.unstable_ImmediatePriority,Dr=e.unstable_UserBlockingPriority,er=e.unstable_NormalPriority,Rn=e.unstable_LowPriority,di=e.unstable_IdlePriority,jt=null,rt=null;function Wu(a){if(rt&&typeof rt.onCommitFiberRoot=="function")try{rt.onCommitFiberRoot(jt,a,void 0,(a.current.flags&128)===128)}catch{}}var gn=Math.clz32?Math.clz32:Do,ks=Math.log,If=Math.LN2;function Do(a){return a>>>=0,a===0?32:31-(ks(a)/If|0)|0}var Ia=64,vr=4194304;function Dn(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 Ca(a,l){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=Dn(q):(B&=U,B!==0&&(y=Dn(B)))}else U=f&~C,U!==0?y=Dn(U):B!==0&&(y=Dn(B));if(y===0)return 0;if(l!==0&&l!==y&&!(l&C)&&(C=y&-y,B=l&-l,C>=B||C===16&&(B&4194240)!==0))return l;if(y&4&&(y|=f&16),l=a.entangledLanes,l!==0)for(a=a.entanglements,l&=y;0<l;)f=31-gn(l),C=1<<f,y|=a[f],l&=~C;return y}function Ln(a,l){switch(a){case 1:case 2:case 4:return l+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 l+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 Yu(a,l){for(var f=a.suspendedLanes,y=a.pingedLanes,C=a.expirationTimes,B=a.pendingLanes;0<B;){var U=31-gn(B),q=1<<U,J=C[U];J===-1?(!(q&f)||q&y)&&(C[U]=Ln(q,l)):J<=l&&(a.expiredLanes|=q),B&=~q}}function qu(a){return a=a.pendingLanes&-1073741825,a!==0?a:a&1073741824?1073741824:0}function Xu(){var a=Ia;return Ia<<=1,!(Ia&4194240)&&(Ia=64),a}function Km(a){for(var l=[],f=0;31>f;f++)l.push(a);return l}function Ku(a,l,f){a.pendingLanes|=l,l!==536870912&&(a.suspendedLanes=0,a.pingedLanes=0),a=a.eventTimes,l=31-gn(l),a[l]=f}function Wk(a,l){var f=a.pendingLanes&~l;a.pendingLanes=l,a.suspendedLanes=0,a.pingedLanes=0,a.expiredLanes&=l,a.mutableReadLanes&=l,a.entangledLanes&=l,l=a.entanglements;var y=a.eventTimes;for(a=a.expirationTimes;0<f;){var C=31-gn(f),B=1<<C;l[C]=0,y[C]=-1,a[C]=-1,f&=~B}}function Jm(a,l){var f=a.entangledLanes|=l;for(a=a.entanglements;f;){var y=31-gn(f),C=1<<y;C&l|a[y]&l&&(a[y]|=l),f&=~C}}var Pt=0;function YI(a){return a&=-a,1<a?4<a?a&268435455?16:536870912:4:1}var qI,Zm,XI,KI,JI,$m=!1,Cf=[],Sa=null,Ma=null,Ta=null,Ju=new Map,Zu=new Map,Ba=[],Yk="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 ZI(a,l){switch(a){case"focusin":case"focusout":Sa=null;break;case"dragenter":case"dragleave":Ma=null;break;case"mouseover":case"mouseout":Ta=null;break;case"pointerover":case"pointerout":Ju.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":Zu.delete(l.pointerId)}}function $u(a,l,f,y,C,B){return a===null||a.nativeEvent!==B?(a={blockedOn:l,domEventName:f,eventSystemFlags:y,nativeEvent:B,targetContainers:[C]},l!==null&&(l=fh(l),l!==null&&Zm(l)),a):(a.eventSystemFlags|=y,l=a.targetContainers,C!==null&&l.indexOf(C)===-1&&l.push(C),a)}function qk(a,l,f,y,C){switch(l){case"focusin":return Sa=$u(Sa,a,l,f,y,C),!0;case"dragenter":return Ma=$u(Ma,a,l,f,y,C),!0;case"mouseover":return Ta=$u(Ta,a,l,f,y,C),!0;case"pointerover":var B=C.pointerId;return Ju.set(B,$u(Ju.get(B)||null,a,l,f,y,C)),!0;case"gotpointercapture":return B=C.pointerId,Zu.set(B,$u(Zu.get(B)||null,a,l,f,y,C)),!0}return!1}function $I(a){var l=Lo(a.target);if(l!==null){var f=Ps(l);if(f!==null){if(l=f.tag,l===13){if(l=O(f),l!==null){a.blockedOn=l,JI(a.priority,function(){XI(f)});return}}else if(l===3&&f.stateNode.current.memoizedState.isDehydrated){a.blockedOn=f.tag===3?f.stateNode.containerInfo:null;return}}}a.blockedOn=null}function Sf(a){if(a.blockedOn!==null)return!1;for(var l=a.targetContainers;0<l.length;){var f=t0(a.domEventName,a.eventSystemFlags,l[0],a.nativeEvent);if(f===null){f=a.nativeEvent;var y=new f.constructor(f.type,f);F=y,f.target.dispatchEvent(y),F=null}else return l=fh(f),l!==null&&Zm(l),a.blockedOn=f,!1;l.shift()}return!0}function eC(a,l,f){Sf(a)&&f.delete(l)}function Xk(){$m=!1,Sa!==null&&Sf(Sa)&&(Sa=null),Ma!==null&&Sf(Ma)&&(Ma=null),Ta!==null&&Sf(Ta)&&(Ta=null),Ju.forEach(eC),Zu.forEach(eC)}function eh(a,l){a.blockedOn===l&&(a.blockedOn=null,$m||($m=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,Xk)))}function th(a){function l(C){return eh(C,a)}if(0<Cf.length){eh(Cf[0],a);for(var f=1;f<Cf.length;f++){var y=Cf[f];y.blockedOn===a&&(y.blockedOn=null)}}for(Sa!==null&&eh(Sa,a),Ma!==null&&eh(Ma,a),Ta!==null&&eh(Ta,a),Ju.forEach(l),Zu.forEach(l),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);)$I(f),f.blockedOn===null&&Ba.shift()}var oc=I.ReactCurrentBatchConfig,Mf=!0;function Kk(a,l,f,y){var C=Pt,B=oc.transition;oc.transition=null;try{Pt=1,e0(a,l,f,y)}finally{Pt=C,oc.transition=B}}function Jk(a,l,f,y){var C=Pt,B=oc.transition;oc.transition=null;try{Pt=4,e0(a,l,f,y)}finally{Pt=C,oc.transition=B}}function e0(a,l,f,y){if(Mf){var C=t0(a,l,f,y);if(C===null)_0(a,l,y,Tf,f),ZI(a,y);else if(qk(C,a,l,f,y))y.stopPropagation();else if(ZI(a,y),l&4&&-1<Yk.indexOf(a)){for(;C!==null;){var B=fh(C);if(B!==null&&qI(B),B=t0(a,l,f,y),B===null&&_0(a,l,y,Tf,f),B===C)break;C=B}C!==null&&y.stopPropagation()}else _0(a,l,y,null,f)}}var Tf=null;function t0(a,l,f,y){if(Tf=null,a=ge(y),a=Lo(a),a!==null)if(l=Ps(a),l===null)a=null;else if(f=l.tag,f===13){if(a=O(l),a!==null)return a;a=null}else if(f===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;a=null}else l!==a&&(a=null);return Tf=a,null}function tC(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 ht:return 1;case Dr:return 4;case er:case Rn:return 16;case di:return 536870912;default:return 16}default:return 16}}var ba=null,r0=null,Bf=null;function rC(){if(Bf)return Bf;var a,l=r0,f=l.length,y,C="value"in ba?ba.value:ba.textContent,B=C.length;for(a=0;a<f&&l[a]===C[a];a++);var U=f-a;for(y=1;y<=U&&l[f-y]===C[B-y];y++);return Bf=C.slice(a,1<y?1-y:void 0)}function bf(a){var l=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&l===13&&(a=13)):a=l,a===10&&(a=13),32<=a||a===13?a:0}function Rf(){return!0}function nC(){return!1}function Zn(a){function l(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)?Rf:nC,this.isPropagationStopped=nC,this}return Q(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var f=this.nativeEvent;f&&(f.preventDefault?f.preventDefault():typeof f.returnValue!="unknown"&&(f.returnValue=!1),this.isDefaultPrevented=Rf)},stopPropagation:function(){var f=this.nativeEvent;f&&(f.stopPropagation?f.stopPropagation():typeof f.cancelBubble!="unknown"&&(f.cancelBubble=!0),this.isPropagationStopped=Rf)},persist:function(){},isPersistent:Rf}),l}var lc={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},n0=Zn(lc),rh=Q({},lc,{view:0,detail:0}),Zk=Zn(rh),i0,s0,nh,Df=Q({},rh,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:o0,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!==nh&&(nh&&a.type==="mousemove"?(i0=a.screenX-nh.screenX,s0=a.screenY-nh.screenY):s0=i0=0,nh=a),i0)},movementY:function(a){return"movementY"in a?a.movementY:s0}}),iC=Zn(Df),$k=Q({},Df,{dataTransfer:0}),e7=Zn($k),t7=Q({},rh,{relatedTarget:0}),a0=Zn(t7),r7=Q({},lc,{animationName:0,elapsedTime:0,pseudoElement:0}),n7=Zn(r7),i7=Q({},lc,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),s7=Zn(i7),a7=Q({},lc,{data:0}),sC=Zn(a7),o7={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},l7={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"},c7={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function u7(a){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(a):(a=c7[a])?!!l[a]:!1}function o0(){return u7}var h7=Q({},rh,{key:function(a){if(a.key){var l=o7[a.key]||a.key;if(l!=="Unidentified")return l}return a.type==="keypress"?(a=bf(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?l7[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:o0,charCode:function(a){return a.type==="keypress"?bf(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?bf(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),d7=Zn(h7),f7=Q({},Df,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),aC=Zn(f7),p7=Q({},rh,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:o0}),A7=Zn(p7),g7=Q({},lc,{propertyName:0,elapsedTime:0,pseudoElement:0}),m7=Zn(g7),_7=Q({},Df,{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}),v7=Zn(_7),y7=[9,13,27,32],l0=c&&"CompositionEvent"in window,ih=null;c&&"documentMode"in document&&(ih=document.documentMode);var E7=c&&"TextEvent"in window&&!ih,oC=c&&(!l0||ih&&8<ih&&11>=ih),lC=String.fromCharCode(32),cC=!1;function uC(a,l){switch(a){case"keyup":return y7.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function hC(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var cc=!1;function x7(a,l){switch(a){case"compositionend":return hC(l);case"keypress":return l.which!==32?null:(cC=!0,lC);case"textInput":return a=l.data,a===lC&&cC?null:a;default:return null}}function w7(a,l){if(cc)return a==="compositionend"||!l0&&uC(a,l)?(a=rC(),Bf=r0=ba=null,cc=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1<l.char.length)return l.char;if(l.which)return String.fromCharCode(l.which)}return null;case"compositionend":return oC&&l.locale!=="ko"?null:l.data;default:return null}}var I7={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 dC(a){var l=a&&a.nodeName&&a.nodeName.toLowerCase();return l==="input"?!!I7[a.type]:l==="textarea"}function fC(a,l,f,y){Dt(y),l=kf(l,"onChange"),0<l.length&&(f=new n0("onChange","change",null,f,y),a.push({event:f,listeners:l}))}var sh=null,ah=null;function C7(a){RC(a,0)}function Lf(a){var l=pc(a);if(et(l))return a}function S7(a,l){if(a==="change")return l}var pC=!1;if(c){var c0;if(c){var u0="oninput"in document;if(!u0){var AC=document.createElement("div");AC.setAttribute("oninput","return;"),u0=typeof AC.oninput=="function"}c0=u0}else c0=!1;pC=c0&&(!document.documentMode||9<document.documentMode)}function gC(){sh&&(sh.detachEvent("onpropertychange",mC),ah=sh=null)}function mC(a){if(a.propertyName==="value"&&Lf(ah)){var l=[];fC(l,ah,a,ge(a)),Vt(C7,l)}}function M7(a,l,f){a==="focusin"?(gC(),sh=l,ah=f,sh.attachEvent("onpropertychange",mC)):a==="focusout"&&gC()}function T7(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return Lf(ah)}function B7(a,l){if(a==="click")return Lf(l)}function b7(a,l){if(a==="input"||a==="change")return Lf(l)}function R7(a,l){return a===l&&(a!==0||1/a===1/l)||a!==a&&l!==l}var Pi=typeof Object.is=="function"?Object.is:R7;function oh(a,l){if(Pi(a,l))return!0;if(typeof a!="object"||a===null||typeof l!="object"||l===null)return!1;var f=Object.keys(a),y=Object.keys(l);if(f.length!==y.length)return!1;for(y=0;y<f.length;y++){var C=f[y];if(!h.call(l,C)||!Pi(a[C],l[C]))return!1}return!0}function _C(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function vC(a,l){var f=_C(a);a=0;for(var y;f;){if(f.nodeType===3){if(y=a+f.textContent.length,a<=l&&y>=l)return{node:f,offset:l-a};a=y}e:{for(;f;){if(f.nextSibling){f=f.nextSibling;break e}f=f.parentNode}f=void 0}f=_C(f)}}function yC(a,l){return a&&l?a===l?!0:a&&a.nodeType===3?!1:l&&l.nodeType===3?yC(a,l.parentNode):"contains"in a?a.contains(l):a.compareDocumentPosition?!!(a.compareDocumentPosition(l)&16):!1:!1}function EC(){for(var a=window,l=ke();l instanceof a.HTMLIFrameElement;){try{var f=typeof l.contentWindow.location.href=="string"}catch{f=!1}if(f)a=l.contentWindow;else break;l=ke(a.document)}return l}function h0(a){var l=a&&a.nodeName&&a.nodeName.toLowerCase();return l&&(l==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||l==="textarea"||a.contentEditable==="true")}function D7(a){var l=EC(),f=a.focusedElem,y=a.selectionRange;if(l!==f&&f&&f.ownerDocument&&yC(f.ownerDocument.documentElement,f)){if(y!==null&&h0(f)){if(l=y.start,a=y.end,a===void 0&&(a=l),"selectionStart"in f)f.selectionStart=l,f.selectionEnd=Math.min(a,f.value.length);else if(a=(l=f.ownerDocument||document)&&l.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=vC(f,B);var U=vC(f,y);C&&U&&(a.rangeCount!==1||a.anchorNode!==C.node||a.anchorOffset!==C.offset||a.focusNode!==U.node||a.focusOffset!==U.offset)&&(l=l.createRange(),l.setStart(C.node,C.offset),a.removeAllRanges(),B>y?(a.addRange(l),a.extend(U.node,U.offset)):(l.setEnd(U.node,U.offset),a.addRange(l)))}}for(l=[],a=f;a=a.parentNode;)a.nodeType===1&&l.push({element:a,left:a.scrollLeft,top:a.scrollTop});for(typeof f.focus=="function"&&f.focus(),f=0;f<l.length;f++)a=l[f],a.element.scrollLeft=a.left,a.element.scrollTop=a.top}}var L7=c&&"documentMode"in document&&11>=document.documentMode,uc=null,d0=null,lh=null,f0=!1;function xC(a,l,f){var y=f.window===f?f.document:f.nodeType===9?f:f.ownerDocument;f0||uc==null||uc!==ke(y)||(y=uc,"selectionStart"in y&&h0(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}),lh&&oh(lh,y)||(lh=y,y=kf(d0,"onSelect"),0<y.length&&(l=new n0("onSelect","select",null,l,f),a.push({event:l,listeners:y}),l.target=uc)))}function Nf(a,l){var f={};return f[a.toLowerCase()]=l.toLowerCase(),f["Webkit"+a]="webkit"+l,f["Moz"+a]="moz"+l,f}var hc={animationend:Nf("Animation","AnimationEnd"),animationiteration:Nf("Animation","AnimationIteration"),animationstart:Nf("Animation","AnimationStart"),transitionend:Nf("Transition","TransitionEnd")},p0={},wC={};c&&(wC=document.createElement("div").style,"AnimationEvent"in window||(delete hc.animationend.animation,delete hc.animationiteration.animation,delete hc.animationstart.animation),"TransitionEvent"in window||delete hc.transitionend.transition);function Uf(a){if(p0[a])return p0[a];if(!hc[a])return a;var l=hc[a],f;for(f in l)if(l.hasOwnProperty(f)&&f in wC)return p0[a]=l[f];return a}var IC=Uf("animationend"),CC=Uf("animationiteration"),SC=Uf("animationstart"),MC=Uf("transitionend"),TC=new Map,BC="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 Ra(a,l){TC.set(a,l),s(l,[a])}for(var A0=0;A0<BC.length;A0++){var g0=BC[A0],N7=g0.toLowerCase(),U7=g0[0].toUpperCase()+g0.slice(1);Ra(N7,"on"+U7)}Ra(IC,"onAnimationEnd"),Ra(CC,"onAnimationIteration"),Ra(SC,"onAnimationStart"),Ra("dblclick","onDoubleClick"),Ra("focusin","onFocus"),Ra("focusout","onBlur"),Ra(MC,"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 ch="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(" "),P7=new Set("cancel close invalid load scroll toggle".split(" ").concat(ch));function bC(a,l,f){var y=a.type||"unknown-event";a.currentTarget=f,Xm(y,l,void 0,a),a.currentTarget=null}function RC(a,l){l=(l&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(l)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;bC(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;bC(C,q,ce),B=J}}}if(Us)throw a=ac,Us=!1,ac=null,a}function Xt(a,l){var f=l[I0];f===void 0&&(f=l[I0]=new Set);var y=a+"__bubble";f.has(y)||(DC(l,a,2,!1),f.add(y))}function m0(a,l,f){var y=0;l&&(y|=4),DC(f,a,y,l)}var Pf="_reactListening"+Math.random().toString(36).slice(2);function uh(a){if(!a[Pf]){a[Pf]=!0,n.forEach(function(f){f!=="selectionchange"&&(P7.has(f)||m0(f,!1,a),m0(f,!0,a))});var l=a.nodeType===9?a:a.ownerDocument;l===null||l[Pf]||(l[Pf]=!0,m0("selectionchange",!1,l))}}function DC(a,l,f,y){switch(tC(l)){case 1:var C=Kk;break;case 4:C=Jk;break;default:C=e0}f=C.bind(null,l,f,a),C=void 0,!bn||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(C=!0),y?C!==void 0?a.addEventListener(l,f,{capture:!0,passive:C}):a.addEventListener(l,f,!0):C!==void 0?a.addEventListener(l,f,{passive:C}):a.addEventListener(l,f,!1)}function _0(a,l,f,y,C){var B=y;if(!(l&1)&&!(l&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=Lo(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,Ie=ge(f),Se=[];e:{var we=TC.get(a);if(we!==void 0){var Ue=n0,He=a;switch(a){case"keypress":if(bf(f)===0)break e;case"keydown":case"keyup":Ue=d7;break;case"focusin":He="focus",Ue=a0;break;case"focusout":He="blur",Ue=a0;break;case"beforeblur":case"afterblur":Ue=a0;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":Ue=iC;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Ue=e7;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Ue=A7;break;case IC:case CC:case SC:Ue=n7;break;case MC:Ue=m7;break;case"scroll":Ue=Zk;break;case"wheel":Ue=v7;break;case"copy":case"cut":case"paste":Ue=s7;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Ue=aC}var Ve=(l&4)!==0,yr=!Ve&&a==="scroll",ie=Ve?we!==null?we+"Capture":null:we;Ve=[];for(var $=ce,ae;$!==null;){ae=$;var Te=ae.stateNode;if(ae.tag===5&&Te!==null&&(ae=Te,ie!==null&&(Te=_r($,ie),Te!=null&&Ve.push(hh($,Te,ae)))),yr)break;$=$.return}0<Ve.length&&(we=new Ue(we,He,null,f,Ie),Se.push({event:we,listeners:Ve}))}}if(!(l&7)){e:{if(we=a==="mouseover"||a==="pointerover",Ue=a==="mouseout"||a==="pointerout",we&&f!==F&&(He=f.relatedTarget||f.fromElement)&&(Lo(He)||He[Qs]))break e;if((Ue||we)&&(we=Ie.window===Ie?Ie:(we=Ie.ownerDocument)?we.defaultView||we.parentWindow:window,Ue?(He=f.relatedTarget||f.toElement,Ue=ce,He=He?Lo(He):null,He!==null&&(yr=Ps(He),He!==yr||He.tag!==5&&He.tag!==6)&&(He=null)):(Ue=null,He=ce),Ue!==He)){if(Ve=iC,Te="onMouseLeave",ie="onMouseEnter",$="mouse",(a==="pointerout"||a==="pointerover")&&(Ve=aC,Te="onPointerLeave",ie="onPointerEnter",$="pointer"),yr=Ue==null?we:pc(Ue),ae=He==null?we:pc(He),we=new Ve(Te,$+"leave",Ue,f,Ie),we.target=yr,we.relatedTarget=ae,Te=null,Lo(Ie)===ce&&(Ve=new Ve(ie,$+"enter",He,f,Ie),Ve.target=ae,Ve.relatedTarget=yr,Te=Ve),yr=Te,Ue&&He)t:{for(Ve=Ue,ie=He,$=0,ae=Ve;ae;ae=dc(ae))$++;for(ae=0,Te=ie;Te;Te=dc(Te))ae++;for(;0<$-ae;)Ve=dc(Ve),$--;for(;0<ae-$;)ie=dc(ie),ae--;for(;$--;){if(Ve===ie||ie!==null&&Ve===ie.alternate)break t;Ve=dc(Ve),ie=dc(ie)}Ve=null}else Ve=null;Ue!==null&&LC(Se,we,Ue,Ve,!1),He!==null&&yr!==null&&LC(Se,yr,He,Ve,!0)}}e:{if(we=ce?pc(ce):window,Ue=we.nodeName&&we.nodeName.toLowerCase(),Ue==="select"||Ue==="input"&&we.type==="file")var je=S7;else if(dC(we))if(pC)je=b7;else{je=T7;var Ze=M7}else(Ue=we.nodeName)&&Ue.toLowerCase()==="input"&&(we.type==="checkbox"||we.type==="radio")&&(je=B7);if(je&&(je=je(a,ce))){fC(Se,je,f,Ie);break e}Ze&&Ze(a,we,ce),a==="focusout"&&(Ze=we._wrapperState)&&Ze.controlled&&we.type==="number"&&le(we,"number",we.value)}switch(Ze=ce?pc(ce):window,a){case"focusin":(dC(Ze)||Ze.contentEditable==="true")&&(uc=Ze,d0=ce,lh=null);break;case"focusout":lh=d0=uc=null;break;case"mousedown":f0=!0;break;case"contextmenu":case"mouseup":case"dragend":f0=!1,xC(Se,f,Ie);break;case"selectionchange":if(L7)break;case"keydown":case"keyup":xC(Se,f,Ie)}var $e;if(l0)e:{switch(a){case"compositionstart":var lt="onCompositionStart";break e;case"compositionend":lt="onCompositionEnd";break e;case"compositionupdate":lt="onCompositionUpdate";break e}lt=void 0}else cc?uC(a,f)&&(lt="onCompositionEnd"):a==="keydown"&&f.keyCode===229&&(lt="onCompositionStart");lt&&(oC&&f.locale!=="ko"&&(cc||lt!=="onCompositionStart"?lt==="onCompositionEnd"&&cc&&($e=rC()):(ba=Ie,r0="value"in ba?ba.value:ba.textContent,cc=!0)),Ze=kf(ce,lt),0<Ze.length&&(lt=new sC(lt,a,null,f,Ie),Se.push({event:lt,listeners:Ze}),$e?lt.data=$e:($e=hC(f),$e!==null&&(lt.data=$e)))),($e=E7?x7(a,f):w7(a,f))&&(ce=kf(ce,"onBeforeInput"),0<ce.length&&(Ie=new sC("onBeforeInput","beforeinput",null,f,Ie),Se.push({event:Ie,listeners:ce}),Ie.data=$e))}RC(Se,l)})}function hh(a,l,f){return{instance:a,listener:l,currentTarget:f}}function kf(a,l){for(var f=l+"Capture",y=[];a!==null;){var C=a,B=C.stateNode;C.tag===5&&B!==null&&(C=B,B=_r(a,f),B!=null&&y.unshift(hh(a,B,C)),B=_r(a,l),B!=null&&y.push(hh(a,B,C))),a=a.return}return y}function dc(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5);return a||null}function LC(a,l,f,y,C){for(var B=l._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=_r(f,B),J!=null&&U.unshift(hh(f,J,q))):C||(J=_r(f,B),J!=null&&U.push(hh(f,J,q)))),f=f.return}U.length!==0&&a.push({event:l,listeners:U})}var k7=/\r\n?/g,Q7=/\u0000|\uFFFD/g;function NC(a){return(typeof a=="string"?a:""+a).replace(k7,`
4487
+ `+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=G(a.type,!1),a;case 11:return a=G(a.type.render,!1),a;case 1:return a=G(a.type,!0),a;default:return""}}function pe(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 M: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 S:return(a._context.displayName||"Context")+".Provider";case P:var l=a.render;return a=a.displayName,a||(a=l.displayName||l.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case X:return l=a.displayName||null,l!==null?l:pe(a.type)||"Memo";case K:l=a._payload,a=a._init;try{return pe(a(l))}catch{}}return null}function fe(a){var l=a.type;switch(a.tag){case 24:return"Cache";case 9:return(l.displayName||"Context")+".Consumer";case 10:return(l._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return a=l.render,a=a.displayName||a.name||"",l.displayName||(a!==""?"ForwardRef("+a+")":"ForwardRef");case 7:return"Fragment";case 5:return l;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return pe(l);case 8:return l===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 l=="function")return l.displayName||l.name||null;if(typeof l=="string")return l}return null}function ye(a){switch(typeof a){case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function Pe(a){var l=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function at(a){var l=Pe(a)?"checked":"value",f=Object.getOwnPropertyDescriptor(a.constructor.prototype,l),y=""+a[l];if(!a.hasOwnProperty(l)&&typeof f<"u"&&typeof f.get=="function"&&typeof f.set=="function"){var C=f.get,B=f.set;return Object.defineProperty(a,l,{configurable:!0,get:function(){return C.call(this)},set:function(U){y=""+U,B.call(this,U)}}),Object.defineProperty(a,l,{enumerable:f.enumerable}),{getValue:function(){return y},setValue:function(U){y=""+U},stopTracking:function(){a._valueTracker=null,delete a[l]}}}}function se(a){a._valueTracker||(a._valueTracker=at(a))}function et(a){if(!a)return!1;var l=a._valueTracker;if(!l)return!0;var f=l.getValue(),y="";return a&&(y=Pe(a)?a.checked?"true":"false":a.value),a=y,a!==f?(l.setValue(a),!0):!1}function ke(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 dt(a,l){var f=l.checked;return Q({},l,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:f??a._wrapperState.initialChecked})}function Xe(a,l){var f=l.defaultValue==null?"":l.defaultValue,y=l.checked!=null?l.checked:l.defaultChecked;f=ye(l.value!=null?l.value:f),a._wrapperState={initialChecked:y,initialValue:f,controlled:l.type==="checkbox"||l.type==="radio"?l.checked!=null:l.value!=null}}function ft(a,l){l=l.checked,l!=null&&x(a,"checked",l,!1)}function Y(a,l){ft(a,l);var f=ye(l.value),y=l.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}l.hasOwnProperty("value")?le(a,l.type,f):l.hasOwnProperty("defaultValue")&&le(a,l.type,ye(l.defaultValue)),l.checked==null&&l.defaultChecked!=null&&(a.defaultChecked=!!l.defaultChecked)}function k(a,l,f){if(l.hasOwnProperty("value")||l.hasOwnProperty("defaultValue")){var y=l.type;if(!(y!=="submit"&&y!=="reset"||l.value!==void 0&&l.value!==null))return;l=""+a._wrapperState.initialValue,f||l===a.value||(a.value=l),a.defaultValue=l}f=a.name,f!==""&&(a.name=""),a.defaultChecked=!!a._wrapperState.initialChecked,f!==""&&(a.name=f)}function le(a,l,f){(l!=="number"||ke(a.ownerDocument)!==a)&&(f==null?a.defaultValue=""+a._wrapperState.initialValue:a.defaultValue!==""+f&&(a.defaultValue=""+f))}var Ae=Array.isArray;function me(a,l,f,y){if(a=a.options,l){l={};for(var C=0;C<f.length;C++)l["$"+f[C]]=!0;for(f=0;f<a.length;f++)C=l.hasOwnProperty("$"+a[f].value),a[f].selected!==C&&(a[f].selected=C),C&&y&&(a[f].defaultSelected=!0)}else{for(f=""+ye(f),l=null,C=0;C<a.length;C++){if(a[C].value===f){a[C].selected=!0,y&&(a[C].defaultSelected=!0);return}l!==null||a[C].disabled||(l=a[C])}l!==null&&(l.selected=!0)}}function Ee(a,l){if(l.dangerouslySetInnerHTML!=null)throw Error(t(91));return Q({},l,{value:void 0,defaultValue:void 0,children:""+a._wrapperState.initialValue})}function Oe(a,l){var f=l.value;if(f==null){if(f=l.children,l=l.defaultValue,f!=null){if(l!=null)throw Error(t(92));if(Ae(f)){if(1<f.length)throw Error(t(93));f=f[0]}l=f}l==null&&(l=""),f=l}a._wrapperState={initialValue:ye(f)}}function Ce(a,l){var f=ye(l.value),y=ye(l.defaultValue);f!=null&&(f=""+f,f!==a.value&&(a.value=f),l.defaultValue==null&&a.defaultValue!==f&&(a.defaultValue=f)),y!=null&&(a.defaultValue=""+y)}function Qe(a){var l=a.textContent;l===a._wrapperState.initialValue&&l!==""&&l!==null&&(a.value=l)}function ve(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 xe(a,l){return a==null||a==="http://www.w3.org/1999/xhtml"?ve(l):a==="http://www.w3.org/2000/svg"&&l==="foreignObject"?"http://www.w3.org/1999/xhtml":a}var Be,We=function(a){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(l,f,y,C){MSApp.execUnsafeLocalFunction(function(){return a(l,f,y,C)})}:a}(function(a,l){if(a.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in a)a.innerHTML=l;else{for(Be=Be||document.createElement("div"),Be.innerHTML="<svg>"+l.valueOf().toString()+"</svg>",l=Be.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;l.firstChild;)a.appendChild(l.firstChild)}});function Le(a,l){if(l){var f=a.firstChild;if(f&&f===a.lastChild&&f.nodeType===3){f.nodeValue=l;return}}a.textContent=l}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(l){l=l+a.charAt(0).toUpperCase()+a.substring(1),be[l]=be[a]})});function pt(a,l,f){return l==null||typeof l=="boolean"||l===""?"":f||typeof l!="number"||l===0||be.hasOwnProperty(a)&&be[a]?(""+l).trim():l+"px"}function ct(a,l){a=a.style;for(var f in l)if(l.hasOwnProperty(f)){var y=f.indexOf("--")===0,C=pt(f,l[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 tt(a,l){if(l){if(ut[a]&&(l.children!=null||l.dangerouslySetInnerHTML!=null))throw Error(t(137,a));if(l.dangerouslySetInnerHTML!=null){if(l.children!=null)throw Error(t(60));if(typeof l.dangerouslySetInnerHTML!="object"||!("__html"in l.dangerouslySetInnerHTML))throw Error(t(61))}if(l.style!=null&&typeof l.style!="object")throw Error(t(62))}}function V(a,l){if(a.indexOf("-")===-1)return typeof l.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 F=null;function ge(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var _e=null,ze=null,Ne=null;function _t(a){if(a=fh(a)){if(typeof _e!="function")throw Error(t(280));var l=a.stateNode;l&&(l=Of(l),_e(a.stateNode,a.type,l))}}function Dt(a){ze?Ne?Ne.push(a):Ne=[a]:ze=a}function Lt(){if(ze){var a=ze,l=Ne;if(Ne=ze=null,_t(a),l)for(a=0;a<l.length;a++)_t(l[a])}}function Mt(a,l){return a(l)}function vt(){}var hr=!1;function Vt(a,l,f){if(hr)return a(l,f);hr=!0;try{return Mt(a,l,f)}finally{hr=!1,(ze!==null||Ne!==null)&&(vt(),Lt())}}function _r(a,l){var f=a.stateNode;if(f===null)return null;var y=Of(f);if(y===null)return null;f=y[l];e:switch(l){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,l,typeof f));return f}var bn=!1;if(c)try{var qt={};Object.defineProperty(qt,"passive",{get:function(){bn=!0}}),window.addEventListener("test",qt,qt),window.removeEventListener("test",qt,qt)}catch{bn=!1}function hi(a,l,f,y,C,B,U,q,J){var ce=Array.prototype.slice.call(arguments,3);try{l.apply(f,ce)}catch(Ie){this.onError(Ie)}}var Jn=!1,Ns=null,Us=!1,ac=null,wf={onError:function(a){Jn=!0,Ns=a}};function qm(a,l,f,y,C,B,U,q,J){Jn=!1,Ns=null,hi.apply(wf,arguments)}function Xm(a,l,f,y,C,B,U,q,J){if(qm.apply(this,arguments),Jn){if(Jn){var ce=Ns;Jn=!1,Ns=null}else throw Error(t(198));Us||(Us=!0,ac=ce)}}function Ps(a){var l=a,f=a;if(a.alternate)for(;l.return;)l=l.return;else{a=l;do l=a,l.flags&4098&&(f=l.return),a=l.return;while(a)}return l.tag===3?f:null}function O(a){if(a.tag===13){var l=a.memoizedState;if(l===null&&(a=a.alternate,a!==null&&(l=a.memoizedState)),l!==null)return l.dehydrated}return null}function ne(a){if(Ps(a)!==a)throw Error(t(188))}function ue(a){var l=a.alternate;if(!l){if(l=Ps(a),l===null)throw Error(t(188));return l!==a?null:a}for(var f=a,y=l;;){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),l;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:l}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 l=oe(a);if(l!==null)return l;a=a.sibling}return null}var Re=e.unstable_scheduleCallback,Je=e.unstable_cancelCallback,it=e.unstable_shouldYield,ot=e.unstable_requestPaint,qe=e.unstable_now,At=e.unstable_getCurrentPriorityLevel,ht=e.unstable_ImmediatePriority,Dr=e.unstable_UserBlockingPriority,er=e.unstable_NormalPriority,Rn=e.unstable_LowPriority,di=e.unstable_IdlePriority,jt=null,rt=null;function Wu(a){if(rt&&typeof rt.onCommitFiberRoot=="function")try{rt.onCommitFiberRoot(jt,a,void 0,(a.current.flags&128)===128)}catch{}}var gn=Math.clz32?Math.clz32:Do,ks=Math.log,If=Math.LN2;function Do(a){return a>>>=0,a===0?32:31-(ks(a)/If|0)|0}var Ia=64,vr=4194304;function Dn(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 Ca(a,l){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=Dn(q):(B&=U,B!==0&&(y=Dn(B)))}else U=f&~C,U!==0?y=Dn(U):B!==0&&(y=Dn(B));if(y===0)return 0;if(l!==0&&l!==y&&!(l&C)&&(C=y&-y,B=l&-l,C>=B||C===16&&(B&4194240)!==0))return l;if(y&4&&(y|=f&16),l=a.entangledLanes,l!==0)for(a=a.entanglements,l&=y;0<l;)f=31-gn(l),C=1<<f,y|=a[f],l&=~C;return y}function Ln(a,l){switch(a){case 1:case 2:case 4:return l+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 l+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 Yu(a,l){for(var f=a.suspendedLanes,y=a.pingedLanes,C=a.expirationTimes,B=a.pendingLanes;0<B;){var U=31-gn(B),q=1<<U,J=C[U];J===-1?(!(q&f)||q&y)&&(C[U]=Ln(q,l)):J<=l&&(a.expiredLanes|=q),B&=~q}}function qu(a){return a=a.pendingLanes&-1073741825,a!==0?a:a&1073741824?1073741824:0}function Xu(){var a=Ia;return Ia<<=1,!(Ia&4194240)&&(Ia=64),a}function Km(a){for(var l=[],f=0;31>f;f++)l.push(a);return l}function Ku(a,l,f){a.pendingLanes|=l,l!==536870912&&(a.suspendedLanes=0,a.pingedLanes=0),a=a.eventTimes,l=31-gn(l),a[l]=f}function Wk(a,l){var f=a.pendingLanes&~l;a.pendingLanes=l,a.suspendedLanes=0,a.pingedLanes=0,a.expiredLanes&=l,a.mutableReadLanes&=l,a.entangledLanes&=l,l=a.entanglements;var y=a.eventTimes;for(a=a.expirationTimes;0<f;){var C=31-gn(f),B=1<<C;l[C]=0,y[C]=-1,a[C]=-1,f&=~B}}function Jm(a,l){var f=a.entangledLanes|=l;for(a=a.entanglements;f;){var y=31-gn(f),C=1<<y;C&l|a[y]&l&&(a[y]|=l),f&=~C}}var Pt=0;function YI(a){return a&=-a,1<a?4<a?a&268435455?16:536870912:4:1}var qI,Zm,XI,KI,JI,$m=!1,Cf=[],Sa=null,Ma=null,Ta=null,Ju=new Map,Zu=new Map,Ba=[],Yk="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 ZI(a,l){switch(a){case"focusin":case"focusout":Sa=null;break;case"dragenter":case"dragleave":Ma=null;break;case"mouseover":case"mouseout":Ta=null;break;case"pointerover":case"pointerout":Ju.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":Zu.delete(l.pointerId)}}function $u(a,l,f,y,C,B){return a===null||a.nativeEvent!==B?(a={blockedOn:l,domEventName:f,eventSystemFlags:y,nativeEvent:B,targetContainers:[C]},l!==null&&(l=fh(l),l!==null&&Zm(l)),a):(a.eventSystemFlags|=y,l=a.targetContainers,C!==null&&l.indexOf(C)===-1&&l.push(C),a)}function qk(a,l,f,y,C){switch(l){case"focusin":return Sa=$u(Sa,a,l,f,y,C),!0;case"dragenter":return Ma=$u(Ma,a,l,f,y,C),!0;case"mouseover":return Ta=$u(Ta,a,l,f,y,C),!0;case"pointerover":var B=C.pointerId;return Ju.set(B,$u(Ju.get(B)||null,a,l,f,y,C)),!0;case"gotpointercapture":return B=C.pointerId,Zu.set(B,$u(Zu.get(B)||null,a,l,f,y,C)),!0}return!1}function $I(a){var l=Lo(a.target);if(l!==null){var f=Ps(l);if(f!==null){if(l=f.tag,l===13){if(l=O(f),l!==null){a.blockedOn=l,JI(a.priority,function(){XI(f)});return}}else if(l===3&&f.stateNode.current.memoizedState.isDehydrated){a.blockedOn=f.tag===3?f.stateNode.containerInfo:null;return}}}a.blockedOn=null}function Sf(a){if(a.blockedOn!==null)return!1;for(var l=a.targetContainers;0<l.length;){var f=t0(a.domEventName,a.eventSystemFlags,l[0],a.nativeEvent);if(f===null){f=a.nativeEvent;var y=new f.constructor(f.type,f);F=y,f.target.dispatchEvent(y),F=null}else return l=fh(f),l!==null&&Zm(l),a.blockedOn=f,!1;l.shift()}return!0}function eC(a,l,f){Sf(a)&&f.delete(l)}function Xk(){$m=!1,Sa!==null&&Sf(Sa)&&(Sa=null),Ma!==null&&Sf(Ma)&&(Ma=null),Ta!==null&&Sf(Ta)&&(Ta=null),Ju.forEach(eC),Zu.forEach(eC)}function eh(a,l){a.blockedOn===l&&(a.blockedOn=null,$m||($m=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,Xk)))}function th(a){function l(C){return eh(C,a)}if(0<Cf.length){eh(Cf[0],a);for(var f=1;f<Cf.length;f++){var y=Cf[f];y.blockedOn===a&&(y.blockedOn=null)}}for(Sa!==null&&eh(Sa,a),Ma!==null&&eh(Ma,a),Ta!==null&&eh(Ta,a),Ju.forEach(l),Zu.forEach(l),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);)$I(f),f.blockedOn===null&&Ba.shift()}var oc=I.ReactCurrentBatchConfig,Mf=!0;function Kk(a,l,f,y){var C=Pt,B=oc.transition;oc.transition=null;try{Pt=1,e0(a,l,f,y)}finally{Pt=C,oc.transition=B}}function Jk(a,l,f,y){var C=Pt,B=oc.transition;oc.transition=null;try{Pt=4,e0(a,l,f,y)}finally{Pt=C,oc.transition=B}}function e0(a,l,f,y){if(Mf){var C=t0(a,l,f,y);if(C===null)_0(a,l,y,Tf,f),ZI(a,y);else if(qk(C,a,l,f,y))y.stopPropagation();else if(ZI(a,y),l&4&&-1<Yk.indexOf(a)){for(;C!==null;){var B=fh(C);if(B!==null&&qI(B),B=t0(a,l,f,y),B===null&&_0(a,l,y,Tf,f),B===C)break;C=B}C!==null&&y.stopPropagation()}else _0(a,l,y,null,f)}}var Tf=null;function t0(a,l,f,y){if(Tf=null,a=ge(y),a=Lo(a),a!==null)if(l=Ps(a),l===null)a=null;else if(f=l.tag,f===13){if(a=O(l),a!==null)return a;a=null}else if(f===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;a=null}else l!==a&&(a=null);return Tf=a,null}function tC(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 ht:return 1;case Dr:return 4;case er:case Rn:return 16;case di:return 536870912;default:return 16}default:return 16}}var ba=null,r0=null,Bf=null;function rC(){if(Bf)return Bf;var a,l=r0,f=l.length,y,C="value"in ba?ba.value:ba.textContent,B=C.length;for(a=0;a<f&&l[a]===C[a];a++);var U=f-a;for(y=1;y<=U&&l[f-y]===C[B-y];y++);return Bf=C.slice(a,1<y?1-y:void 0)}function bf(a){var l=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&l===13&&(a=13)):a=l,a===10&&(a=13),32<=a||a===13?a:0}function Rf(){return!0}function nC(){return!1}function Zn(a){function l(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)?Rf:nC,this.isPropagationStopped=nC,this}return Q(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var f=this.nativeEvent;f&&(f.preventDefault?f.preventDefault():typeof f.returnValue!="unknown"&&(f.returnValue=!1),this.isDefaultPrevented=Rf)},stopPropagation:function(){var f=this.nativeEvent;f&&(f.stopPropagation?f.stopPropagation():typeof f.cancelBubble!="unknown"&&(f.cancelBubble=!0),this.isPropagationStopped=Rf)},persist:function(){},isPersistent:Rf}),l}var lc={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},n0=Zn(lc),rh=Q({},lc,{view:0,detail:0}),Zk=Zn(rh),i0,s0,nh,Df=Q({},rh,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:o0,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!==nh&&(nh&&a.type==="mousemove"?(i0=a.screenX-nh.screenX,s0=a.screenY-nh.screenY):s0=i0=0,nh=a),i0)},movementY:function(a){return"movementY"in a?a.movementY:s0}}),iC=Zn(Df),$k=Q({},Df,{dataTransfer:0}),e7=Zn($k),t7=Q({},rh,{relatedTarget:0}),a0=Zn(t7),r7=Q({},lc,{animationName:0,elapsedTime:0,pseudoElement:0}),n7=Zn(r7),i7=Q({},lc,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),s7=Zn(i7),a7=Q({},lc,{data:0}),sC=Zn(a7),o7={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},l7={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"},c7={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function u7(a){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(a):(a=c7[a])?!!l[a]:!1}function o0(){return u7}var h7=Q({},rh,{key:function(a){if(a.key){var l=o7[a.key]||a.key;if(l!=="Unidentified")return l}return a.type==="keypress"?(a=bf(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?l7[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:o0,charCode:function(a){return a.type==="keypress"?bf(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?bf(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),d7=Zn(h7),f7=Q({},Df,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),aC=Zn(f7),p7=Q({},rh,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:o0}),A7=Zn(p7),g7=Q({},lc,{propertyName:0,elapsedTime:0,pseudoElement:0}),m7=Zn(g7),_7=Q({},Df,{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}),v7=Zn(_7),y7=[9,13,27,32],l0=c&&"CompositionEvent"in window,ih=null;c&&"documentMode"in document&&(ih=document.documentMode);var E7=c&&"TextEvent"in window&&!ih,oC=c&&(!l0||ih&&8<ih&&11>=ih),lC=String.fromCharCode(32),cC=!1;function uC(a,l){switch(a){case"keyup":return y7.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function hC(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var cc=!1;function x7(a,l){switch(a){case"compositionend":return hC(l);case"keypress":return l.which!==32?null:(cC=!0,lC);case"textInput":return a=l.data,a===lC&&cC?null:a;default:return null}}function w7(a,l){if(cc)return a==="compositionend"||!l0&&uC(a,l)?(a=rC(),Bf=r0=ba=null,cc=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1<l.char.length)return l.char;if(l.which)return String.fromCharCode(l.which)}return null;case"compositionend":return oC&&l.locale!=="ko"?null:l.data;default:return null}}var I7={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 dC(a){var l=a&&a.nodeName&&a.nodeName.toLowerCase();return l==="input"?!!I7[a.type]:l==="textarea"}function fC(a,l,f,y){Dt(y),l=kf(l,"onChange"),0<l.length&&(f=new n0("onChange","change",null,f,y),a.push({event:f,listeners:l}))}var sh=null,ah=null;function C7(a){RC(a,0)}function Lf(a){var l=pc(a);if(et(l))return a}function S7(a,l){if(a==="change")return l}var pC=!1;if(c){var c0;if(c){var u0="oninput"in document;if(!u0){var AC=document.createElement("div");AC.setAttribute("oninput","return;"),u0=typeof AC.oninput=="function"}c0=u0}else c0=!1;pC=c0&&(!document.documentMode||9<document.documentMode)}function gC(){sh&&(sh.detachEvent("onpropertychange",mC),ah=sh=null)}function mC(a){if(a.propertyName==="value"&&Lf(ah)){var l=[];fC(l,ah,a,ge(a)),Vt(C7,l)}}function M7(a,l,f){a==="focusin"?(gC(),sh=l,ah=f,sh.attachEvent("onpropertychange",mC)):a==="focusout"&&gC()}function T7(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return Lf(ah)}function B7(a,l){if(a==="click")return Lf(l)}function b7(a,l){if(a==="input"||a==="change")return Lf(l)}function R7(a,l){return a===l&&(a!==0||1/a===1/l)||a!==a&&l!==l}var Pi=typeof Object.is=="function"?Object.is:R7;function oh(a,l){if(Pi(a,l))return!0;if(typeof a!="object"||a===null||typeof l!="object"||l===null)return!1;var f=Object.keys(a),y=Object.keys(l);if(f.length!==y.length)return!1;for(y=0;y<f.length;y++){var C=f[y];if(!h.call(l,C)||!Pi(a[C],l[C]))return!1}return!0}function _C(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function vC(a,l){var f=_C(a);a=0;for(var y;f;){if(f.nodeType===3){if(y=a+f.textContent.length,a<=l&&y>=l)return{node:f,offset:l-a};a=y}e:{for(;f;){if(f.nextSibling){f=f.nextSibling;break e}f=f.parentNode}f=void 0}f=_C(f)}}function yC(a,l){return a&&l?a===l?!0:a&&a.nodeType===3?!1:l&&l.nodeType===3?yC(a,l.parentNode):"contains"in a?a.contains(l):a.compareDocumentPosition?!!(a.compareDocumentPosition(l)&16):!1:!1}function EC(){for(var a=window,l=ke();l instanceof a.HTMLIFrameElement;){try{var f=typeof l.contentWindow.location.href=="string"}catch{f=!1}if(f)a=l.contentWindow;else break;l=ke(a.document)}return l}function h0(a){var l=a&&a.nodeName&&a.nodeName.toLowerCase();return l&&(l==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||l==="textarea"||a.contentEditable==="true")}function D7(a){var l=EC(),f=a.focusedElem,y=a.selectionRange;if(l!==f&&f&&f.ownerDocument&&yC(f.ownerDocument.documentElement,f)){if(y!==null&&h0(f)){if(l=y.start,a=y.end,a===void 0&&(a=l),"selectionStart"in f)f.selectionStart=l,f.selectionEnd=Math.min(a,f.value.length);else if(a=(l=f.ownerDocument||document)&&l.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=vC(f,B);var U=vC(f,y);C&&U&&(a.rangeCount!==1||a.anchorNode!==C.node||a.anchorOffset!==C.offset||a.focusNode!==U.node||a.focusOffset!==U.offset)&&(l=l.createRange(),l.setStart(C.node,C.offset),a.removeAllRanges(),B>y?(a.addRange(l),a.extend(U.node,U.offset)):(l.setEnd(U.node,U.offset),a.addRange(l)))}}for(l=[],a=f;a=a.parentNode;)a.nodeType===1&&l.push({element:a,left:a.scrollLeft,top:a.scrollTop});for(typeof f.focus=="function"&&f.focus(),f=0;f<l.length;f++)a=l[f],a.element.scrollLeft=a.left,a.element.scrollTop=a.top}}var L7=c&&"documentMode"in document&&11>=document.documentMode,uc=null,d0=null,lh=null,f0=!1;function xC(a,l,f){var y=f.window===f?f.document:f.nodeType===9?f:f.ownerDocument;f0||uc==null||uc!==ke(y)||(y=uc,"selectionStart"in y&&h0(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}),lh&&oh(lh,y)||(lh=y,y=kf(d0,"onSelect"),0<y.length&&(l=new n0("onSelect","select",null,l,f),a.push({event:l,listeners:y}),l.target=uc)))}function Nf(a,l){var f={};return f[a.toLowerCase()]=l.toLowerCase(),f["Webkit"+a]="webkit"+l,f["Moz"+a]="moz"+l,f}var hc={animationend:Nf("Animation","AnimationEnd"),animationiteration:Nf("Animation","AnimationIteration"),animationstart:Nf("Animation","AnimationStart"),transitionend:Nf("Transition","TransitionEnd")},p0={},wC={};c&&(wC=document.createElement("div").style,"AnimationEvent"in window||(delete hc.animationend.animation,delete hc.animationiteration.animation,delete hc.animationstart.animation),"TransitionEvent"in window||delete hc.transitionend.transition);function Uf(a){if(p0[a])return p0[a];if(!hc[a])return a;var l=hc[a],f;for(f in l)if(l.hasOwnProperty(f)&&f in wC)return p0[a]=l[f];return a}var IC=Uf("animationend"),CC=Uf("animationiteration"),SC=Uf("animationstart"),MC=Uf("transitionend"),TC=new Map,BC="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 Ra(a,l){TC.set(a,l),s(l,[a])}for(var A0=0;A0<BC.length;A0++){var g0=BC[A0],N7=g0.toLowerCase(),U7=g0[0].toUpperCase()+g0.slice(1);Ra(N7,"on"+U7)}Ra(IC,"onAnimationEnd"),Ra(CC,"onAnimationIteration"),Ra(SC,"onAnimationStart"),Ra("dblclick","onDoubleClick"),Ra("focusin","onFocus"),Ra("focusout","onBlur"),Ra(MC,"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 ch="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(" "),P7=new Set("cancel close invalid load scroll toggle".split(" ").concat(ch));function bC(a,l,f){var y=a.type||"unknown-event";a.currentTarget=f,Xm(y,l,void 0,a),a.currentTarget=null}function RC(a,l){l=(l&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(l)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;bC(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;bC(C,q,ce),B=J}}}if(Us)throw a=ac,Us=!1,ac=null,a}function Xt(a,l){var f=l[I0];f===void 0&&(f=l[I0]=new Set);var y=a+"__bubble";f.has(y)||(DC(l,a,2,!1),f.add(y))}function m0(a,l,f){var y=0;l&&(y|=4),DC(f,a,y,l)}var Pf="_reactListening"+Math.random().toString(36).slice(2);function uh(a){if(!a[Pf]){a[Pf]=!0,n.forEach(function(f){f!=="selectionchange"&&(P7.has(f)||m0(f,!1,a),m0(f,!0,a))});var l=a.nodeType===9?a:a.ownerDocument;l===null||l[Pf]||(l[Pf]=!0,m0("selectionchange",!1,l))}}function DC(a,l,f,y){switch(tC(l)){case 1:var C=Kk;break;case 4:C=Jk;break;default:C=e0}f=C.bind(null,l,f,a),C=void 0,!bn||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(C=!0),y?C!==void 0?a.addEventListener(l,f,{capture:!0,passive:C}):a.addEventListener(l,f,!0):C!==void 0?a.addEventListener(l,f,{passive:C}):a.addEventListener(l,f,!1)}function _0(a,l,f,y,C){var B=y;if(!(l&1)&&!(l&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=Lo(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,Ie=ge(f),Se=[];e:{var we=TC.get(a);if(we!==void 0){var Ue=n0,He=a;switch(a){case"keypress":if(bf(f)===0)break e;case"keydown":case"keyup":Ue=d7;break;case"focusin":He="focus",Ue=a0;break;case"focusout":He="blur",Ue=a0;break;case"beforeblur":case"afterblur":Ue=a0;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":Ue=iC;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Ue=e7;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Ue=A7;break;case IC:case CC:case SC:Ue=n7;break;case MC:Ue=m7;break;case"scroll":Ue=Zk;break;case"wheel":Ue=v7;break;case"copy":case"cut":case"paste":Ue=s7;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Ue=aC}var Ve=(l&4)!==0,yr=!Ve&&a==="scroll",ie=Ve?we!==null?we+"Capture":null:we;Ve=[];for(var $=ce,ae;$!==null;){ae=$;var Te=ae.stateNode;if(ae.tag===5&&Te!==null&&(ae=Te,ie!==null&&(Te=_r($,ie),Te!=null&&Ve.push(hh($,Te,ae)))),yr)break;$=$.return}0<Ve.length&&(we=new Ue(we,He,null,f,Ie),Se.push({event:we,listeners:Ve}))}}if(!(l&7)){e:{if(we=a==="mouseover"||a==="pointerover",Ue=a==="mouseout"||a==="pointerout",we&&f!==F&&(He=f.relatedTarget||f.fromElement)&&(Lo(He)||He[Qs]))break e;if((Ue||we)&&(we=Ie.window===Ie?Ie:(we=Ie.ownerDocument)?we.defaultView||we.parentWindow:window,Ue?(He=f.relatedTarget||f.toElement,Ue=ce,He=He?Lo(He):null,He!==null&&(yr=Ps(He),He!==yr||He.tag!==5&&He.tag!==6)&&(He=null)):(Ue=null,He=ce),Ue!==He)){if(Ve=iC,Te="onMouseLeave",ie="onMouseEnter",$="mouse",(a==="pointerout"||a==="pointerover")&&(Ve=aC,Te="onPointerLeave",ie="onPointerEnter",$="pointer"),yr=Ue==null?we:pc(Ue),ae=He==null?we:pc(He),we=new Ve(Te,$+"leave",Ue,f,Ie),we.target=yr,we.relatedTarget=ae,Te=null,Lo(Ie)===ce&&(Ve=new Ve(ie,$+"enter",He,f,Ie),Ve.target=ae,Ve.relatedTarget=yr,Te=Ve),yr=Te,Ue&&He)t:{for(Ve=Ue,ie=He,$=0,ae=Ve;ae;ae=dc(ae))$++;for(ae=0,Te=ie;Te;Te=dc(Te))ae++;for(;0<$-ae;)Ve=dc(Ve),$--;for(;0<ae-$;)ie=dc(ie),ae--;for(;$--;){if(Ve===ie||ie!==null&&Ve===ie.alternate)break t;Ve=dc(Ve),ie=dc(ie)}Ve=null}else Ve=null;Ue!==null&&LC(Se,we,Ue,Ve,!1),He!==null&&yr!==null&&LC(Se,yr,He,Ve,!0)}}e:{if(we=ce?pc(ce):window,Ue=we.nodeName&&we.nodeName.toLowerCase(),Ue==="select"||Ue==="input"&&we.type==="file")var je=S7;else if(dC(we))if(pC)je=b7;else{je=T7;var Ze=M7}else(Ue=we.nodeName)&&Ue.toLowerCase()==="input"&&(we.type==="checkbox"||we.type==="radio")&&(je=B7);if(je&&(je=je(a,ce))){fC(Se,je,f,Ie);break e}Ze&&Ze(a,we,ce),a==="focusout"&&(Ze=we._wrapperState)&&Ze.controlled&&we.type==="number"&&le(we,"number",we.value)}switch(Ze=ce?pc(ce):window,a){case"focusin":(dC(Ze)||Ze.contentEditable==="true")&&(uc=Ze,d0=ce,lh=null);break;case"focusout":lh=d0=uc=null;break;case"mousedown":f0=!0;break;case"contextmenu":case"mouseup":case"dragend":f0=!1,xC(Se,f,Ie);break;case"selectionchange":if(L7)break;case"keydown":case"keyup":xC(Se,f,Ie)}var $e;if(l0)e:{switch(a){case"compositionstart":var lt="onCompositionStart";break e;case"compositionend":lt="onCompositionEnd";break e;case"compositionupdate":lt="onCompositionUpdate";break e}lt=void 0}else cc?uC(a,f)&&(lt="onCompositionEnd"):a==="keydown"&&f.keyCode===229&&(lt="onCompositionStart");lt&&(oC&&f.locale!=="ko"&&(cc||lt!=="onCompositionStart"?lt==="onCompositionEnd"&&cc&&($e=rC()):(ba=Ie,r0="value"in ba?ba.value:ba.textContent,cc=!0)),Ze=kf(ce,lt),0<Ze.length&&(lt=new sC(lt,a,null,f,Ie),Se.push({event:lt,listeners:Ze}),$e?lt.data=$e:($e=hC(f),$e!==null&&(lt.data=$e)))),($e=E7?x7(a,f):w7(a,f))&&(ce=kf(ce,"onBeforeInput"),0<ce.length&&(Ie=new sC("onBeforeInput","beforeinput",null,f,Ie),Se.push({event:Ie,listeners:ce}),Ie.data=$e))}RC(Se,l)})}function hh(a,l,f){return{instance:a,listener:l,currentTarget:f}}function kf(a,l){for(var f=l+"Capture",y=[];a!==null;){var C=a,B=C.stateNode;C.tag===5&&B!==null&&(C=B,B=_r(a,f),B!=null&&y.unshift(hh(a,B,C)),B=_r(a,l),B!=null&&y.push(hh(a,B,C))),a=a.return}return y}function dc(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5);return a||null}function LC(a,l,f,y,C){for(var B=l._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=_r(f,B),J!=null&&U.unshift(hh(f,J,q))):C||(J=_r(f,B),J!=null&&U.push(hh(f,J,q)))),f=f.return}U.length!==0&&a.push({event:l,listeners:U})}var k7=/\r\n?/g,Q7=/\u0000|\uFFFD/g;function NC(a){return(typeof a=="string"?a:""+a).replace(k7,`
4488
4488
  `).replace(Q7,"")}function Qf(a,l,f){if(l=NC(l),NC(a)!==l&&f)throw Error(t(425))}function Ff(){}var v0=null,y0=null;function E0(a,l){return a==="textarea"||a==="noscript"||typeof l.children=="string"||typeof l.children=="number"||typeof l.dangerouslySetInnerHTML=="object"&&l.dangerouslySetInnerHTML!==null&&l.dangerouslySetInnerHTML.__html!=null}var x0=typeof setTimeout=="function"?setTimeout:void 0,F7=typeof clearTimeout=="function"?clearTimeout:void 0,UC=typeof Promise=="function"?Promise:void 0,O7=typeof queueMicrotask=="function"?queueMicrotask:typeof UC<"u"?function(a){return UC.resolve(null).then(a).catch(z7)}:x0;function z7(a){setTimeout(function(){throw a})}function w0(a,l){var f=l,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),th(l);return}y--}else f!=="$"&&f!=="$?"&&f!=="$!"||y++;f=C}while(f);th(l)}function Da(a){for(;a!=null;a=a.nextSibling){var l=a.nodeType;if(l===1||l===3)break;if(l===8){if(l=a.data,l==="$"||l==="$!"||l==="$?")break;if(l==="/$")return null}}return a}function PC(a){a=a.previousSibling;for(var l=0;a;){if(a.nodeType===8){var f=a.data;if(f==="$"||f==="$!"||f==="$?"){if(l===0)return a;l--}else f==="/$"&&l++}a=a.previousSibling}return null}var fc=Math.random().toString(36).slice(2),is="__reactFiber$"+fc,dh="__reactProps$"+fc,Qs="__reactContainer$"+fc,I0="__reactEvents$"+fc,H7="__reactListeners$"+fc,G7="__reactHandles$"+fc;function Lo(a){var l=a[is];if(l)return l;for(var f=a.parentNode;f;){if(l=f[Qs]||f[is]){if(f=l.alternate,l.child!==null||f!==null&&f.child!==null)for(a=PC(a);a!==null;){if(f=a[is])return f;a=PC(a)}return l}a=f,f=a.parentNode}return null}function fh(a){return a=a[is]||a[Qs],!a||a.tag!==5&&a.tag!==6&&a.tag!==13&&a.tag!==3?null:a}function pc(a){if(a.tag===5||a.tag===6)return a.stateNode;throw Error(t(33))}function Of(a){return a[dh]||null}var C0=[],Ac=-1;function La(a){return{current:a}}function Kt(a){0>Ac||(a.current=C0[Ac],C0[Ac]=null,Ac--)}function Wt(a,l){Ac++,C0[Ac]=a.current,a.current=l}var Na={},rn=La(Na),Nn=La(!1),No=Na;function gc(a,l){var f=a.type.contextTypes;if(!f)return Na;var y=a.stateNode;if(y&&y.__reactInternalMemoizedUnmaskedChildContext===l)return y.__reactInternalMemoizedMaskedChildContext;var C={},B;for(B in f)C[B]=l[B];return y&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=l,a.__reactInternalMemoizedMaskedChildContext=C),C}function Un(a){return a=a.childContextTypes,a!=null}function zf(){Kt(Nn),Kt(rn)}function kC(a,l,f){if(rn.current!==Na)throw Error(t(168));Wt(rn,l),Wt(Nn,f)}function QC(a,l,f){var y=a.stateNode;if(l=l.childContextTypes,typeof y.getChildContext!="function")return f;y=y.getChildContext();for(var C in y)if(!(C in l))throw Error(t(108,fe(a)||"Unknown",C));return Q({},f,y)}function Hf(a){return a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||Na,No=rn.current,Wt(rn,a),Wt(Nn,Nn.current),!0}function FC(a,l,f){var y=a.stateNode;if(!y)throw Error(t(169));f?(a=QC(a,l,No),y.__reactInternalMemoizedMergedChildContext=a,Kt(Nn),Kt(rn),Wt(rn,a)):Kt(Nn),Wt(Nn,f)}var Fs=null,Gf=!1,S0=!1;function OC(a){Fs===null?Fs=[a]:Fs.push(a)}function V7(a){Gf=!0,OC(a)}function Ua(){if(!S0&&Fs!==null){S0=!0;var a=0,l=Pt;try{var f=Fs;for(Pt=1;a<f.length;a++){var y=f[a];do y=y(!0);while(y!==null)}Fs=null,Gf=!1}catch(C){throw Fs!==null&&(Fs=Fs.slice(a+1)),Re(ht,Ua),C}finally{Pt=l,S0=!1}}return null}var mc=[],_c=0,Vf=null,jf=0,fi=[],pi=0,Uo=null,Os=1,zs="";function Po(a,l){mc[_c++]=jf,mc[_c++]=Vf,Vf=a,jf=l}function zC(a,l,f){fi[pi++]=Os,fi[pi++]=zs,fi[pi++]=Uo,Uo=a;var y=Os;a=zs;var C=32-gn(y)-1;y&=~(1<<C),f+=1;var B=32-gn(l)+C;if(30<B){var U=C-C%5;B=(y&(1<<U)-1).toString(32),y>>=U,C-=U,Os=1<<32-gn(l)+C|f<<C|y,zs=B+a}else Os=1<<B|f<<C|y,zs=a}function M0(a){a.return!==null&&(Po(a,1),zC(a,1,0))}function T0(a){for(;a===Vf;)Vf=mc[--_c],mc[_c]=null,jf=mc[--_c],mc[_c]=null;for(;a===Uo;)Uo=fi[--pi],fi[pi]=null,zs=fi[--pi],fi[pi]=null,Os=fi[--pi],fi[pi]=null}var $n=null,ei=null,tr=!1,ki=null;function HC(a,l){var f=_i(5,null,null,0);f.elementType="DELETED",f.stateNode=l,f.return=a,l=a.deletions,l===null?(a.deletions=[f],a.flags|=16):l.push(f)}function GC(a,l){switch(a.tag){case 5:var f=a.type;return l=l.nodeType!==1||f.toLowerCase()!==l.nodeName.toLowerCase()?null:l,l!==null?(a.stateNode=l,$n=a,ei=Da(l.firstChild),!0):!1;case 6:return l=a.pendingProps===""||l.nodeType!==3?null:l,l!==null?(a.stateNode=l,$n=a,ei=null,!0):!1;case 13:return l=l.nodeType!==8?null:l,l!==null?(f=Uo!==null?{id:Os,overflow:zs}:null,a.memoizedState={dehydrated:l,treeContext:f,retryLane:1073741824},f=_i(18,null,null,0),f.stateNode=l,f.return=a,a.child=f,$n=a,ei=null,!0):!1;default:return!1}}function B0(a){return(a.mode&1)!==0&&(a.flags&128)===0}function b0(a){if(tr){var l=ei;if(l){var f=l;if(!GC(a,l)){if(B0(a))throw Error(t(418));l=Da(f.nextSibling);var y=$n;l&&GC(a,l)?HC(y,f):(a.flags=a.flags&-4097|2,tr=!1,$n=a)}}else{if(B0(a))throw Error(t(418));a.flags=a.flags&-4097|2,tr=!1,$n=a}}}function VC(a){for(a=a.return;a!==null&&a.tag!==5&&a.tag!==3&&a.tag!==13;)a=a.return;$n=a}function Wf(a){if(a!==$n)return!1;if(!tr)return VC(a),tr=!0,!1;var l;if((l=a.tag!==3)&&!(l=a.tag!==5)&&(l=a.type,l=l!=="head"&&l!=="body"&&!E0(a.type,a.memoizedProps)),l&&(l=ei)){if(B0(a))throw jC(),Error(t(418));for(;l;)HC(a,l),l=Da(l.nextSibling)}if(VC(a),a.tag===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(t(317));e:{for(a=a.nextSibling,l=0;a;){if(a.nodeType===8){var f=a.data;if(f==="/$"){if(l===0){ei=Da(a.nextSibling);break e}l--}else f!=="$"&&f!=="$!"&&f!=="$?"||l++}a=a.nextSibling}ei=null}}else ei=$n?Da(a.stateNode.nextSibling):null;return!0}function jC(){for(var a=ei;a;)a=Da(a.nextSibling)}function vc(){ei=$n=null,tr=!1}function R0(a){ki===null?ki=[a]:ki.push(a)}var j7=I.ReactCurrentBatchConfig;function Qi(a,l){if(a&&a.defaultProps){l=Q({},l),a=a.defaultProps;for(var f in a)l[f]===void 0&&(l[f]=a[f]);return l}return l}var Yf=La(null),qf=null,yc=null,D0=null;function L0(){D0=yc=qf=null}function N0(a){var l=Yf.current;Kt(Yf),a._currentValue=l}function U0(a,l,f){for(;a!==null;){var y=a.alternate;if((a.childLanes&l)!==l?(a.childLanes|=l,y!==null&&(y.childLanes|=l)):y!==null&&(y.childLanes&l)!==l&&(y.childLanes|=l),a===f)break;a=a.return}}function Ec(a,l){qf=a,D0=yc=null,a=a.dependencies,a!==null&&a.firstContext!==null&&(a.lanes&l&&(Pn=!0),a.firstContext=null)}function Ai(a){var l=a._currentValue;if(D0!==a)if(a={context:a,memoizedValue:l,next:null},yc===null){if(qf===null)throw Error(t(308));yc=a,qf.dependencies={lanes:0,firstContext:a}}else yc=yc.next=a;return l}var ko=null;function P0(a){ko===null?ko=[a]:ko.push(a)}function WC(a,l,f,y){var C=l.interleaved;return C===null?(f.next=f,P0(l)):(f.next=C.next,C.next=f),l.interleaved=f,Hs(a,y)}function Hs(a,l){a.lanes|=l;var f=a.alternate;for(f!==null&&(f.lanes|=l),f=a,a=a.return;a!==null;)a.childLanes|=l,f=a.alternate,f!==null&&(f.childLanes|=l),f=a,a=a.return;return f.tag===3?f.stateNode:null}var Pa=!1;function k0(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function YC(a,l){a=a.updateQueue,l.updateQueue===a&&(l.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,effects:a.effects})}function Gs(a,l){return{eventTime:a,lane:l,tag:0,payload:null,callback:null,next:null}}function ka(a,l,f){var y=a.updateQueue;if(y===null)return null;if(y=y.shared,St&2){var C=y.pending;return C===null?l.next=l:(l.next=C.next,C.next=l),y.pending=l,Hs(a,f)}return C=y.interleaved,C===null?(l.next=l,P0(y)):(l.next=C.next,C.next=l),y.interleaved=l,Hs(a,f)}function Xf(a,l,f){if(l=l.updateQueue,l!==null&&(l=l.shared,(f&4194240)!==0)){var y=l.lanes;y&=a.pendingLanes,f|=y,l.lanes=f,Jm(a,f)}}function qC(a,l){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=l:B=B.next=l}else C=B=l;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=l:a.next=l,f.lastBaseUpdate=l}function Kf(a,l,f,y){var C=a.updateQueue;Pa=!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 Ie=a.alternate;Ie!==null&&(Ie=Ie.updateQueue,q=Ie.lastBaseUpdate,q!==U&&(q===null?Ie.firstBaseUpdate=ce:q.next=ce,Ie.lastBaseUpdate=J))}if(B!==null){var Se=C.baseState;U=0,Ie=ce=J=null,q=B;do{var we=q.lane,Ue=q.eventTime;if((y&we)===we){Ie!==null&&(Ie=Ie.next={eventTime:Ue,lane:0,tag:q.tag,payload:q.payload,callback:q.callback,next:null});e:{var He=a,Ve=q;switch(we=l,Ue=f,Ve.tag){case 1:if(He=Ve.payload,typeof He=="function"){Se=He.call(Ue,Se,we);break e}Se=He;break e;case 3:He.flags=He.flags&-65537|128;case 0:if(He=Ve.payload,we=typeof He=="function"?He.call(Ue,Se,we):He,we==null)break e;Se=Q({},Se,we);break e;case 2:Pa=!0}}q.callback!==null&&q.lane!==0&&(a.flags|=64,we=C.effects,we===null?C.effects=[q]:we.push(q))}else Ue={eventTime:Ue,lane:we,tag:q.tag,payload:q.payload,callback:q.callback,next:null},Ie===null?(ce=Ie=Ue,J=Se):Ie=Ie.next=Ue,U|=we;if(q=q.next,q===null){if(q=C.shared.pending,q===null)break;we=q,q=we.next,we.next=null,C.lastBaseUpdate=we,C.shared.pending=null}}while(1);if(Ie===null&&(J=Se),C.baseState=J,C.firstBaseUpdate=ce,C.lastBaseUpdate=Ie,l=C.shared.interleaved,l!==null){C=l;do U|=C.lane,C=C.next;while(C!==l)}else B===null&&(C.shared.lanes=0);Oo|=U,a.lanes=U,a.memoizedState=Se}}function XC(a,l,f){if(a=l.effects,l.effects=null,a!==null)for(l=0;l<a.length;l++){var y=a[l],C=y.callback;if(C!==null){if(y.callback=null,y=f,typeof C!="function")throw Error(t(191,C));C.call(y)}}}var KC=new r.Component().refs;function Q0(a,l,f,y){l=a.memoizedState,f=f(y,l),f=f==null?l:Q({},l,f),a.memoizedState=f,a.lanes===0&&(a.updateQueue.baseState=f)}var Jf={isMounted:function(a){return(a=a._reactInternals)?Ps(a)===a:!1},enqueueSetState:function(a,l,f){a=a._reactInternals;var y=_n(),C=za(a),B=Gs(y,C);B.payload=l,f!=null&&(B.callback=f),l=ka(a,B,C),l!==null&&(zi(l,a,C,y),Xf(l,a,C))},enqueueReplaceState:function(a,l,f){a=a._reactInternals;var y=_n(),C=za(a),B=Gs(y,C);B.tag=1,B.payload=l,f!=null&&(B.callback=f),l=ka(a,B,C),l!==null&&(zi(l,a,C,y),Xf(l,a,C))},enqueueForceUpdate:function(a,l){a=a._reactInternals;var f=_n(),y=za(a),C=Gs(f,y);C.tag=2,l!=null&&(C.callback=l),l=ka(a,C,y),l!==null&&(zi(l,a,y,f),Xf(l,a,y))}};function JC(a,l,f,y,C,B,U){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(y,B,U):l.prototype&&l.prototype.isPureReactComponent?!oh(f,y)||!oh(C,B):!0}function ZC(a,l,f){var y=!1,C=Na,B=l.contextType;return typeof B=="object"&&B!==null?B=Ai(B):(C=Un(l)?No:rn.current,y=l.contextTypes,B=(y=y!=null)?gc(a,C):Na),l=new l(f,B),a.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,l.updater=Jf,a.stateNode=l,l._reactInternals=a,y&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=C,a.__reactInternalMemoizedMaskedChildContext=B),l}function $C(a,l,f,y){a=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(f,y),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(f,y),l.state!==a&&Jf.enqueueReplaceState(l,l.state,null)}function F0(a,l,f,y){var C=a.stateNode;C.props=f,C.state=a.memoizedState,C.refs=KC,k0(a);var B=l.contextType;typeof B=="object"&&B!==null?C.context=Ai(B):(B=Un(l)?No:rn.current,C.context=gc(a,B)),C.state=a.memoizedState,B=l.getDerivedStateFromProps,typeof B=="function"&&(Q0(a,l,B,f),C.state=a.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof C.getSnapshotBeforeUpdate=="function"||typeof C.UNSAFE_componentWillMount!="function"&&typeof C.componentWillMount!="function"||(l=C.state,typeof C.componentWillMount=="function"&&C.componentWillMount(),typeof C.UNSAFE_componentWillMount=="function"&&C.UNSAFE_componentWillMount(),l!==C.state&&Jf.enqueueReplaceState(C,C.state,null),Kf(a,f,C,y),C.state=a.memoizedState),typeof C.componentDidMount=="function"&&(a.flags|=4194308)}function ph(a,l,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 l!==null&&l.ref!==null&&typeof l.ref=="function"&&l.ref._stringRef===B?l.ref:(l=function(U){var q=C.refs;q===KC&&(q=C.refs={}),U===null?delete q[B]:q[B]=U},l._stringRef=B,l)}if(typeof a!="string")throw Error(t(284));if(!f._owner)throw Error(t(290,a))}return a}function Zf(a,l){throw a=Object.prototype.toString.call(l),Error(t(31,a==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":a))}function e3(a){var l=a._init;return l(a._payload)}function t3(a){function l(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;)l(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=Ga(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?($=x1(ae,ie.mode,Te),$.return=ie,$):($=C($,ae),$.return=ie,$)}function J(ie,$,ae,Te){var je=ae.type;return je===T?Ie(ie,$,ae.props.children,Te,ae.key):$!==null&&($.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===K&&e3(je)===$.type)?(Te=C($,ae.props),Te.ref=ph(ie,$,ae),Te.return=ie,Te):(Te=mp(ae.type,ae.key,ae.props,null,ie.mode,Te),Te.ref=ph(ie,$,ae),Te.return=ie,Te)}function ce(ie,$,ae,Te){return $===null||$.tag!==4||$.stateNode.containerInfo!==ae.containerInfo||$.stateNode.implementation!==ae.implementation?($=w1(ae,ie.mode,Te),$.return=ie,$):($=C($,ae.children||[]),$.return=ie,$)}function Ie(ie,$,ae,Te,je){return $===null||$.tag!==7?($=Vo(ae,ie.mode,Te,je),$.return=ie,$):($=C($,ae),$.return=ie,$)}function Se(ie,$,ae){if(typeof $=="string"&&$!==""||typeof $=="number")return $=x1(""+$,ie.mode,ae),$.return=ie,$;if(typeof $=="object"&&$!==null){switch($.$$typeof){case R:return ae=mp($.type,$.key,$.props,null,ie.mode,ae),ae.ref=ph(ie,null,$),ae.return=ie,ae;case M:return $=w1($,ie.mode,ae),$.return=ie,$;case K:var Te=$._init;return Se(ie,Te($._payload),ae)}if(Ae($)||ee($))return $=Vo($,ie.mode,ae,null),$.return=ie,$;Zf(ie,$)}return null}function we(ie,$,ae,Te){var je=$!==null?$.key:null;if(typeof ae=="string"&&ae!==""||typeof ae=="number")return je!==null?null:q(ie,$,""+ae,Te);if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case R:return ae.key===je?J(ie,$,ae,Te):null;case M:return ae.key===je?ce(ie,$,ae,Te):null;case K:return je=ae._init,we(ie,$,je(ae._payload),Te)}if(Ae(ae)||ee(ae))return je!==null?null:Ie(ie,$,ae,Te,null);Zf(ie,ae)}return null}function Ue(ie,$,ae,Te,je){if(typeof Te=="string"&&Te!==""||typeof Te=="number")return ie=ie.get(ae)||null,q($,ie,""+Te,je);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,je);case M:return ie=ie.get(Te.key===null?ae:Te.key)||null,ce($,ie,Te,je);case K:var Ze=Te._init;return Ue(ie,$,ae,Ze(Te._payload),je)}if(Ae(Te)||ee(Te))return ie=ie.get(ae)||null,Ie($,ie,Te,je,null);Zf($,Te)}return null}function He(ie,$,ae,Te){for(var je=null,Ze=null,$e=$,lt=$=0,jr=null;$e!==null&&lt<ae.length;lt++){$e.index>lt?(jr=$e,$e=null):jr=$e.sibling;var Tt=we(ie,$e,ae[lt],Te);if(Tt===null){$e===null&&($e=jr);break}a&&$e&&Tt.alternate===null&&l(ie,$e),$=B(Tt,$,lt),Ze===null?je=Tt:Ze.sibling=Tt,Ze=Tt,$e=jr}if(lt===ae.length)return f(ie,$e),tr&&Po(ie,lt),je;if($e===null){for(;lt<ae.length;lt++)$e=Se(ie,ae[lt],Te),$e!==null&&($=B($e,$,lt),Ze===null?je=$e:Ze.sibling=$e,Ze=$e);return tr&&Po(ie,lt),je}for($e=y(ie,$e);lt<ae.length;lt++)jr=Ue($e,ie,lt,ae[lt],Te),jr!==null&&(a&&jr.alternate!==null&&$e.delete(jr.key===null?lt:jr.key),$=B(jr,$,lt),Ze===null?je=jr:Ze.sibling=jr,Ze=jr);return a&&$e.forEach(function(Va){return l(ie,Va)}),tr&&Po(ie,lt),je}function Ve(ie,$,ae,Te){var je=ee(ae);if(typeof je!="function")throw Error(t(150));if(ae=je.call(ae),ae==null)throw Error(t(151));for(var Ze=je=null,$e=$,lt=$=0,jr=null,Tt=ae.next();$e!==null&&!Tt.done;lt++,Tt=ae.next()){$e.index>lt?(jr=$e,$e=null):jr=$e.sibling;var Va=we(ie,$e,Tt.value,Te);if(Va===null){$e===null&&($e=jr);break}a&&$e&&Va.alternate===null&&l(ie,$e),$=B(Va,$,lt),Ze===null?je=Va:Ze.sibling=Va,Ze=Va,$e=jr}if(Tt.done)return f(ie,$e),tr&&Po(ie,lt),je;if($e===null){for(;!Tt.done;lt++,Tt=ae.next())Tt=Se(ie,Tt.value,Te),Tt!==null&&($=B(Tt,$,lt),Ze===null?je=Tt:Ze.sibling=Tt,Ze=Tt);return tr&&Po(ie,lt),je}for($e=y(ie,$e);!Tt.done;lt++,Tt=ae.next())Tt=Ue($e,ie,lt,Tt.value,Te),Tt!==null&&(a&&Tt.alternate!==null&&$e.delete(Tt.key===null?lt:Tt.key),$=B(Tt,$,lt),Ze===null?je=Tt:Ze.sibling=Tt,Ze=Tt);return a&&$e.forEach(function(IQ){return l(ie,IQ)}),tr&&Po(ie,lt),je}function yr(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 je=ae.key,Ze=$;Ze!==null;){if(Ze.key===je){if(je=ae.type,je===T){if(Ze.tag===7){f(ie,Ze.sibling),$=C(Ze,ae.props.children),$.return=ie,ie=$;break e}}else if(Ze.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===K&&e3(je)===Ze.type){f(ie,Ze.sibling),$=C(Ze,ae.props),$.ref=ph(ie,Ze,ae),$.return=ie,ie=$;break e}f(ie,Ze);break}else l(ie,Ze);Ze=Ze.sibling}ae.type===T?($=Vo(ae.props.children,ie.mode,Te,ae.key),$.return=ie,ie=$):(Te=mp(ae.type,ae.key,ae.props,null,ie.mode,Te),Te.ref=ph(ie,$,ae),Te.return=ie,ie=Te)}return U(ie);case M: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 l(ie,$);$=$.sibling}$=w1(ae,ie.mode,Te),$.return=ie,ie=$}return U(ie);case K:return Ze=ae._init,yr(ie,$,Ze(ae._payload),Te)}if(Ae(ae))return He(ie,$,ae,Te);if(ee(ae))return Ve(ie,$,ae,Te);Zf(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,$),$=x1(ae,ie.mode,Te),$.return=ie,ie=$),U(ie)):f(ie,$)}return yr}var xc=t3(!0),r3=t3(!1),Ah={},ss=La(Ah),gh=La(Ah),mh=La(Ah);function Qo(a){if(a===Ah)throw Error(t(174));return a}function O0(a,l){switch(Wt(mh,l),Wt(gh,a),Wt(ss,Ah),a=l.nodeType,a){case 9:case 11:l=(l=l.documentElement)?l.namespaceURI:xe(null,"");break;default:a=a===8?l.parentNode:l,l=a.namespaceURI||null,a=a.tagName,l=xe(l,a)}Kt(ss),Wt(ss,l)}function wc(){Kt(ss),Kt(gh),Kt(mh)}function n3(a){Qo(mh.current);var l=Qo(ss.current),f=xe(l,a.type);l!==f&&(Wt(gh,a),Wt(ss,f))}function z0(a){gh.current===a&&(Kt(ss),Kt(gh))}var ar=La(0);function $f(a){for(var l=a;l!==null;){if(l.tag===13){var f=l.memoizedState;if(f!==null&&(f=f.dehydrated,f===null||f.data==="$?"||f.data==="$!"))return l}else if(l.tag===19&&l.memoizedProps.revealOrder!==void 0){if(l.flags&128)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===a)break;for(;l.sibling===null;){if(l.return===null||l.return===a)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var H0=[];function G0(){for(var a=0;a<H0.length;a++)H0[a]._workInProgressVersionPrimary=null;H0.length=0}var ep=I.ReactCurrentDispatcher,V0=I.ReactCurrentBatchConfig,Fo=0,or=null,Lr=null,Gr=null,tp=!1,_h=!1,vh=0,W7=0;function nn(){throw Error(t(321))}function j0(a,l){if(l===null)return!1;for(var f=0;f<l.length&&f<a.length;f++)if(!Pi(a[f],l[f]))return!1;return!0}function W0(a,l,f,y,C,B){if(Fo=B,or=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,ep.current=a===null||a.memoizedState===null?K7:J7,a=f(y,C),_h){B=0;do{if(_h=!1,vh=0,25<=B)throw Error(t(301));B+=1,Gr=Lr=null,l.updateQueue=null,ep.current=Z7,a=f(y,C)}while(_h)}if(ep.current=ip,l=Lr!==null&&Lr.next!==null,Fo=0,Gr=Lr=or=null,tp=!1,l)throw Error(t(300));return a}function Y0(){var a=vh!==0;return vh=0,a}function as(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Gr===null?or.memoizedState=Gr=a:Gr=Gr.next=a,Gr}function gi(){if(Lr===null){var a=or.alternate;a=a!==null?a.memoizedState:null}else a=Lr.next;var l=Gr===null?or.memoizedState:Gr.next;if(l!==null)Gr=l,Lr=a;else{if(a===null)throw Error(t(310));Lr=a,a={memoizedState:Lr.memoizedState,baseState:Lr.baseState,baseQueue:Lr.baseQueue,queue:Lr.queue,next:null},Gr===null?or.memoizedState=Gr=a:Gr=Gr.next=a}return Gr}function yh(a,l){return typeof l=="function"?l(a):l}function q0(a){var l=gi(),f=l.queue;if(f===null)throw Error(t(311));f.lastRenderedReducer=a;var y=Lr,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 Ie=ce.lane;if((Fo&Ie)===Ie)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 Se={lane:Ie,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null};J===null?(q=J=Se,U=y):J=J.next=Se,or.lanes|=Ie,Oo|=Ie}ce=ce.next}while(ce!==null&&ce!==B);J===null?U=y:J.next=q,Pi(y,l.memoizedState)||(Pn=!0),l.memoizedState=y,l.baseState=U,l.baseQueue=J,f.lastRenderedState=y}if(a=f.interleaved,a!==null){C=a;do B=C.lane,or.lanes|=B,Oo|=B,C=C.next;while(C!==a)}else C===null&&(f.lanes=0);return[l.memoizedState,f.dispatch]}function X0(a){var l=gi(),f=l.queue;if(f===null)throw Error(t(311));f.lastRenderedReducer=a;var y=f.dispatch,C=f.pending,B=l.memoizedState;if(C!==null){f.pending=null;var U=C=C.next;do B=a(B,U.action),U=U.next;while(U!==C);Pi(B,l.memoizedState)||(Pn=!0),l.memoizedState=B,l.baseQueue===null&&(l.baseState=B),f.lastRenderedState=B}return[B,y]}function i3(){}function s3(a,l){var f=or,y=gi(),C=l(),B=!Pi(y.memoizedState,C);if(B&&(y.memoizedState=C,Pn=!0),y=y.queue,K0(l3.bind(null,f,y,a),[a]),y.getSnapshot!==l||B||Gr!==null&&Gr.memoizedState.tag&1){if(f.flags|=2048,Eh(9,o3.bind(null,f,y,C,l),void 0,null),Vr===null)throw Error(t(349));Fo&30||a3(f,l,C)}return C}function a3(a,l,f){a.flags|=16384,a={getSnapshot:l,value:f},l=or.updateQueue,l===null?(l={lastEffect:null,stores:null},or.updateQueue=l,l.stores=[a]):(f=l.stores,f===null?l.stores=[a]:f.push(a))}function o3(a,l,f,y){l.value=f,l.getSnapshot=y,c3(l)&&u3(a)}function l3(a,l,f){return f(function(){c3(l)&&u3(a)})}function c3(a){var l=a.getSnapshot;a=a.value;try{var f=l();return!Pi(a,f)}catch{return!0}}function u3(a){var l=Hs(a,1);l!==null&&zi(l,a,1,-1)}function h3(a){var l=as();return typeof a=="function"&&(a=a()),l.memoizedState=l.baseState=a,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:yh,lastRenderedState:a},l.queue=a,a=a.dispatch=X7.bind(null,or,a),[l.memoizedState,a]}function Eh(a,l,f,y){return a={tag:a,create:l,destroy:f,deps:y,next:null},l=or.updateQueue,l===null?(l={lastEffect:null,stores:null},or.updateQueue=l,l.lastEffect=a.next=a):(f=l.lastEffect,f===null?l.lastEffect=a.next=a:(y=f.next,f.next=a,a.next=y,l.lastEffect=a)),a}function d3(){return gi().memoizedState}function rp(a,l,f,y){var C=as();or.flags|=a,C.memoizedState=Eh(1|l,f,void 0,y===void 0?null:y)}function np(a,l,f,y){var C=gi();y=y===void 0?null:y;var B=void 0;if(Lr!==null){var U=Lr.memoizedState;if(B=U.destroy,y!==null&&j0(y,U.deps)){C.memoizedState=Eh(l,f,B,y);return}}or.flags|=a,C.memoizedState=Eh(1|l,f,B,y)}function f3(a,l){return rp(8390656,8,a,l)}function K0(a,l){return np(2048,8,a,l)}function p3(a,l){return np(4,2,a,l)}function A3(a,l){return np(4,4,a,l)}function g3(a,l){if(typeof l=="function")return a=a(),l(a),function(){l(null)};if(l!=null)return a=a(),l.current=a,function(){l.current=null}}function m3(a,l,f){return f=f!=null?f.concat([a]):null,np(4,4,g3.bind(null,l,a),f)}function J0(){}function _3(a,l){var f=gi();l=l===void 0?null:l;var y=f.memoizedState;return y!==null&&l!==null&&j0(l,y[1])?y[0]:(f.memoizedState=[a,l],a)}function v3(a,l){var f=gi();l=l===void 0?null:l;var y=f.memoizedState;return y!==null&&l!==null&&j0(l,y[1])?y[0]:(a=a(),f.memoizedState=[a,l],a)}function y3(a,l,f){return Fo&21?(Pi(f,l)||(f=Xu(),or.lanes|=f,Oo|=f,a.baseState=!0),l):(a.baseState&&(a.baseState=!1,Pn=!0),a.memoizedState=f)}function Y7(a,l){var f=Pt;Pt=f!==0&&4>f?f:4,a(!0);var y=V0.transition;V0.transition={};try{a(!1),l()}finally{Pt=f,V0.transition=y}}function E3(){return gi().memoizedState}function q7(a,l,f){var y=za(a);if(f={lane:y,action:f,hasEagerState:!1,eagerState:null,next:null},x3(a))w3(l,f);else if(f=WC(a,l,f,y),f!==null){var C=_n();zi(f,a,y,C),I3(f,l,y)}}function X7(a,l,f){var y=za(a),C={lane:y,action:f,hasEagerState:!1,eagerState:null,next:null};if(x3(a))w3(l,C);else{var B=a.alternate;if(a.lanes===0&&(B===null||B.lanes===0)&&(B=l.lastRenderedReducer,B!==null))try{var U=l.lastRenderedState,q=B(U,f);if(C.hasEagerState=!0,C.eagerState=q,Pi(q,U)){var J=l.interleaved;J===null?(C.next=C,P0(l)):(C.next=J.next,J.next=C),l.interleaved=C;return}}catch{}finally{}f=WC(a,l,C,y),f!==null&&(C=_n(),zi(f,a,y,C),I3(f,l,y))}}function x3(a){var l=a.alternate;return a===or||l!==null&&l===or}function w3(a,l){_h=tp=!0;var f=a.pending;f===null?l.next=l:(l.next=f.next,f.next=l),a.pending=l}function I3(a,l,f){if(f&4194240){var y=l.lanes;y&=a.pendingLanes,f|=y,l.lanes=f,Jm(a,f)}}var ip={readContext:Ai,useCallback:nn,useContext:nn,useEffect:nn,useImperativeHandle:nn,useInsertionEffect:nn,useLayoutEffect:nn,useMemo:nn,useReducer:nn,useRef:nn,useState:nn,useDebugValue:nn,useDeferredValue:nn,useTransition:nn,useMutableSource:nn,useSyncExternalStore:nn,useId:nn,unstable_isNewReconciler:!1},K7={readContext:Ai,useCallback:function(a,l){return as().memoizedState=[a,l===void 0?null:l],a},useContext:Ai,useEffect:f3,useImperativeHandle:function(a,l,f){return f=f!=null?f.concat([a]):null,rp(4194308,4,g3.bind(null,l,a),f)},useLayoutEffect:function(a,l){return rp(4194308,4,a,l)},useInsertionEffect:function(a,l){return rp(4,2,a,l)},useMemo:function(a,l){var f=as();return l=l===void 0?null:l,a=a(),f.memoizedState=[a,l],a},useReducer:function(a,l,f){var y=as();return l=f!==void 0?f(l):l,y.memoizedState=y.baseState=l,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:l},y.queue=a,a=a.dispatch=q7.bind(null,or,a),[y.memoizedState,a]},useRef:function(a){var l=as();return a={current:a},l.memoizedState=a},useState:h3,useDebugValue:J0,useDeferredValue:function(a){return as().memoizedState=a},useTransition:function(){var a=h3(!1),l=a[0];return a=Y7.bind(null,a[1]),as().memoizedState=a,[l,a]},useMutableSource:function(){},useSyncExternalStore:function(a,l,f){var y=or,C=as();if(tr){if(f===void 0)throw Error(t(407));f=f()}else{if(f=l(),Vr===null)throw Error(t(349));Fo&30||a3(y,l,f)}C.memoizedState=f;var B={value:f,getSnapshot:l};return C.queue=B,f3(l3.bind(null,y,B,a),[a]),y.flags|=2048,Eh(9,o3.bind(null,y,B,f,l),void 0,null),f},useId:function(){var a=as(),l=Vr.identifierPrefix;if(tr){var f=zs,y=Os;f=(y&~(1<<32-gn(y)-1)).toString(32)+f,l=":"+l+"R"+f,f=vh++,0<f&&(l+="H"+f.toString(32)),l+=":"}else f=W7++,l=":"+l+"r"+f.toString(32)+":";return a.memoizedState=l},unstable_isNewReconciler:!1},J7={readContext:Ai,useCallback:_3,useContext:Ai,useEffect:K0,useImperativeHandle:m3,useInsertionEffect:p3,useLayoutEffect:A3,useMemo:v3,useReducer:q0,useRef:d3,useState:function(){return q0(yh)},useDebugValue:J0,useDeferredValue:function(a){var l=gi();return y3(l,Lr.memoizedState,a)},useTransition:function(){var a=q0(yh)[0],l=gi().memoizedState;return[a,l]},useMutableSource:i3,useSyncExternalStore:s3,useId:E3,unstable_isNewReconciler:!1},Z7={readContext:Ai,useCallback:_3,useContext:Ai,useEffect:K0,useImperativeHandle:m3,useInsertionEffect:p3,useLayoutEffect:A3,useMemo:v3,useReducer:X0,useRef:d3,useState:function(){return X0(yh)},useDebugValue:J0,useDeferredValue:function(a){var l=gi();return Lr===null?l.memoizedState=a:y3(l,Lr.memoizedState,a)},useTransition:function(){var a=X0(yh)[0],l=gi().memoizedState;return[a,l]},useMutableSource:i3,useSyncExternalStore:s3,useId:E3,unstable_isNewReconciler:!1};function Ic(a,l){try{var f="",y=l;do f+=de(y),y=y.return;while(y);var C=f}catch(B){C=`
4489
4489
  Error generating stack: `+B.message+`
4490
- `+B.stack}return{value:a,source:l,stack:C,digest:null}}function Z0(a,l,f){return{value:a,source:null,stack:f??null,digest:l??null}}function $0(a,l){try{console.error(l.value)}catch(f){setTimeout(function(){throw f})}}var $7=typeof WeakMap=="function"?WeakMap:Map;function C3(a,l,f){f=Gs(-1,f),f.tag=3,f.payload={element:null};var y=l.value;return f.callback=function(){hp||(hp=!0,p1=y),$0(a,l)},f}function S3(a,l,f){f=Gs(-1,f),f.tag=3;var y=a.type.getDerivedStateFromError;if(typeof y=="function"){var C=l.value;f.payload=function(){return y(C)},f.callback=function(){$0(a,l)}}var B=a.stateNode;return B!==null&&typeof B.componentDidCatch=="function"&&(f.callback=function(){$0(a,l),typeof y!="function"&&(Fa===null?Fa=new Set([this]):Fa.add(this));var U=l.stack;this.componentDidCatch(l.value,{componentStack:U!==null?U:""})}),f}function M3(a,l,f){var y=a.pingCache;if(y===null){y=a.pingCache=new $7;var C=new Set;y.set(l,C)}else C=y.get(l),C===void 0&&(C=new Set,y.set(l,C));C.has(f)||(C.add(f),a=fQ.bind(null,a,l,f),l.then(a,a))}function T3(a){do{var l;if((l=a.tag===13)&&(l=a.memoizedState,l=l!==null?l.dehydrated!==null:!0),l)return a;a=a.return}while(a!==null);return null}function B3(a,l,f,y,C){return a.mode&1?(a.flags|=65536,a.lanes=C,a):(a===l?a.flags|=65536:(a.flags|=128,f.flags|=131072,f.flags&=-52805,f.tag===1&&(f.alternate===null?f.tag=17:(l=Gs(-1,1),l.tag=2,ka(f,l,1))),f.lanes|=1),a)}var eQ=I.ReactCurrentOwner,Pn=!1;function mn(a,l,f,y){l.child=a===null?r3(l,null,f,y):xc(l,a.child,f,y)}function b3(a,l,f,y,C){f=f.render;var B=l.ref;return Ec(l,C),y=W0(a,l,f,y,B,C),f=Y0(),a!==null&&!Pn?(l.updateQueue=a.updateQueue,l.flags&=-2053,a.lanes&=~C,Vs(a,l,C)):(tr&&f&&M0(l),l.flags|=1,mn(a,l,y,C),l.child)}function R3(a,l,f,y,C){if(a===null){var B=f.type;return typeof B=="function"&&!E1(B)&&B.defaultProps===void 0&&f.compare===null&&f.defaultProps===void 0?(l.tag=15,l.type=B,D3(a,l,B,y,C)):(a=mp(f.type,null,y,l,l.mode,C),a.ref=l.ref,a.return=l,l.child=a)}if(B=a.child,!(a.lanes&C)){var U=B.memoizedProps;if(f=f.compare,f=f!==null?f:oh,f(U,y)&&a.ref===l.ref)return Vs(a,l,C)}return l.flags|=1,a=Ga(B,y),a.ref=l.ref,a.return=l,l.child=a}function D3(a,l,f,y,C){if(a!==null){var B=a.memoizedProps;if(oh(B,y)&&a.ref===l.ref)if(Pn=!1,l.pendingProps=y=B,(a.lanes&C)!==0)a.flags&131072&&(Pn=!0);else return l.lanes=a.lanes,Vs(a,l,C)}return e1(a,l,f,y,C)}function L3(a,l,f){var y=l.pendingProps,C=y.children,B=a!==null?a.memoizedState:null;if(y.mode==="hidden")if(!(l.mode&1))l.memoizedState={baseLanes:0,cachePool:null,transitions:null},Wt(Sc,ti),ti|=f;else{if(!(f&1073741824))return a=B!==null?B.baseLanes|f:f,l.lanes=l.childLanes=1073741824,l.memoizedState={baseLanes:a,cachePool:null,transitions:null},l.updateQueue=null,Wt(Sc,ti),ti|=a,null;l.memoizedState={baseLanes:0,cachePool:null,transitions:null},y=B!==null?B.baseLanes:f,Wt(Sc,ti),ti|=y}else B!==null?(y=B.baseLanes|f,l.memoizedState=null):y=f,Wt(Sc,ti),ti|=y;return mn(a,l,C,f),l.child}function N3(a,l){var f=l.ref;(a===null&&f!==null||a!==null&&a.ref!==f)&&(l.flags|=512,l.flags|=2097152)}function e1(a,l,f,y,C){var B=Un(f)?No:rn.current;return B=gc(l,B),Ec(l,C),f=W0(a,l,f,y,B,C),y=Y0(),a!==null&&!Pn?(l.updateQueue=a.updateQueue,l.flags&=-2053,a.lanes&=~C,Vs(a,l,C)):(tr&&y&&M0(l),l.flags|=1,mn(a,l,f,C),l.child)}function U3(a,l,f,y,C){if(Un(f)){var B=!0;Hf(l)}else B=!1;if(Ec(l,C),l.stateNode===null)ap(a,l),ZC(l,f,y),F0(l,f,y,C),y=!0;else if(a===null){var U=l.stateNode,q=l.memoizedProps;U.props=q;var J=U.context,ce=f.contextType;typeof ce=="object"&&ce!==null?ce=Ai(ce):(ce=Un(f)?No:rn.current,ce=gc(l,ce));var Ie=f.getDerivedStateFromProps,Se=typeof Ie=="function"||typeof U.getSnapshotBeforeUpdate=="function";Se||typeof U.UNSAFE_componentWillReceiveProps!="function"&&typeof U.componentWillReceiveProps!="function"||(q!==y||J!==ce)&&$C(l,U,y,ce),Pa=!1;var we=l.memoizedState;U.state=we,Kf(l,y,U,C),J=l.memoizedState,q!==y||we!==J||Nn.current||Pa?(typeof Ie=="function"&&(Q0(l,f,Ie,y),J=l.memoizedState),(q=Pa||JC(l,f,q,y,we,J,ce))?(Se||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"&&(l.flags|=4194308)):(typeof U.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=y,l.memoizedState=J),U.props=y,U.state=J,U.context=ce,y=q):(typeof U.componentDidMount=="function"&&(l.flags|=4194308),y=!1)}else{U=l.stateNode,YC(a,l),q=l.memoizedProps,ce=l.type===l.elementType?q:Qi(l.type,q),U.props=ce,Se=l.pendingProps,we=U.context,J=f.contextType,typeof J=="object"&&J!==null?J=Ai(J):(J=Un(f)?No:rn.current,J=gc(l,J));var Ue=f.getDerivedStateFromProps;(Ie=typeof Ue=="function"||typeof U.getSnapshotBeforeUpdate=="function")||typeof U.UNSAFE_componentWillReceiveProps!="function"&&typeof U.componentWillReceiveProps!="function"||(q!==Se||we!==J)&&$C(l,U,y,J),Pa=!1,we=l.memoizedState,U.state=we,Kf(l,y,U,C);var He=l.memoizedState;q!==Se||we!==He||Nn.current||Pa?(typeof Ue=="function"&&(Q0(l,f,Ue,y),He=l.memoizedState),(ce=Pa||JC(l,f,ce,y,we,He,J)||!1)?(Ie||typeof U.UNSAFE_componentWillUpdate!="function"&&typeof U.componentWillUpdate!="function"||(typeof U.componentWillUpdate=="function"&&U.componentWillUpdate(y,He,J),typeof U.UNSAFE_componentWillUpdate=="function"&&U.UNSAFE_componentWillUpdate(y,He,J)),typeof U.componentDidUpdate=="function"&&(l.flags|=4),typeof U.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof U.componentDidUpdate!="function"||q===a.memoizedProps&&we===a.memoizedState||(l.flags|=4),typeof U.getSnapshotBeforeUpdate!="function"||q===a.memoizedProps&&we===a.memoizedState||(l.flags|=1024),l.memoizedProps=y,l.memoizedState=He),U.props=y,U.state=He,U.context=J,y=ce):(typeof U.componentDidUpdate!="function"||q===a.memoizedProps&&we===a.memoizedState||(l.flags|=4),typeof U.getSnapshotBeforeUpdate!="function"||q===a.memoizedProps&&we===a.memoizedState||(l.flags|=1024),y=!1)}return t1(a,l,f,y,B,C)}function t1(a,l,f,y,C,B){N3(a,l);var U=(l.flags&128)!==0;if(!y&&!U)return C&&FC(l,f,!1),Vs(a,l,B);y=l.stateNode,eQ.current=l;var q=U&&typeof f.getDerivedStateFromError!="function"?null:y.render();return l.flags|=1,a!==null&&U?(l.child=xc(l,a.child,null,B),l.child=xc(l,null,q,B)):mn(a,l,q,B),l.memoizedState=y.state,C&&FC(l,f,!0),l.child}function P3(a){var l=a.stateNode;l.pendingContext?kC(a,l.pendingContext,l.pendingContext!==l.context):l.context&&kC(a,l.context,!1),O0(a,l.containerInfo)}function k3(a,l,f,y,C){return vc(),R0(C),l.flags|=256,mn(a,l,f,y),l.child}var r1={dehydrated:null,treeContext:null,retryLane:0};function n1(a){return{baseLanes:a,cachePool:null,transitions:null}}function Q3(a,l,f){var y=l.pendingProps,C=ar.current,B=!1,U=(l.flags&128)!==0,q;if((q=U)||(q=a!==null&&a.memoizedState===null?!1:(C&2)!==0),q?(B=!0,l.flags&=-129):(a===null||a.memoizedState!==null)&&(C|=1),Wt(ar,C&1),a===null)return b0(l),a=l.memoizedState,a!==null&&(a=a.dehydrated,a!==null)?(l.mode&1?a.data==="$!"?l.lanes=8:l.lanes=1073741824:l.lanes=1,null):(U=y.children,a=y.fallback,B?(y=l.mode,B=l.child,U={mode:"hidden",children:U},!(y&1)&&B!==null?(B.childLanes=0,B.pendingProps=U):B=_p(U,y,0,null),a=Vo(a,y,f,null),B.return=l,a.return=l,B.sibling=a,l.child=B,l.child.memoizedState=n1(f),l.memoizedState=r1,a):i1(l,U));if(C=a.memoizedState,C!==null&&(q=C.dehydrated,q!==null))return tQ(a,l,U,y,q,C,f);if(B){B=y.fallback,U=l.mode,C=a.child,q=C.sibling;var J={mode:"hidden",children:y.children};return!(U&1)&&l.child!==C?(y=l.child,y.childLanes=0,y.pendingProps=J,l.deletions=null):(y=Ga(C,J),y.subtreeFlags=C.subtreeFlags&14680064),q!==null?B=Ga(q,B):(B=Vo(B,U,f,null),B.flags|=2),B.return=l,y.return=l,y.sibling=B,l.child=y,y=B,B=l.child,U=a.child.memoizedState,U=U===null?n1(f):{baseLanes:U.baseLanes|f,cachePool:null,transitions:U.transitions},B.memoizedState=U,B.childLanes=a.childLanes&~f,l.memoizedState=r1,y}return B=a.child,a=B.sibling,y=Ga(B,{mode:"visible",children:y.children}),!(l.mode&1)&&(y.lanes=f),y.return=l,y.sibling=null,a!==null&&(f=l.deletions,f===null?(l.deletions=[a],l.flags|=16):f.push(a)),l.child=y,l.memoizedState=null,y}function i1(a,l){return l=_p({mode:"visible",children:l},a.mode,0,null),l.return=a,a.child=l}function sp(a,l,f,y){return y!==null&&R0(y),xc(l,a.child,null,f),a=i1(l,l.pendingProps.children),a.flags|=2,l.memoizedState=null,a}function tQ(a,l,f,y,C,B,U){if(f)return l.flags&256?(l.flags&=-257,y=Z0(Error(t(422))),sp(a,l,U,y)):l.memoizedState!==null?(l.child=a.child,l.flags|=128,null):(B=y.fallback,C=l.mode,y=_p({mode:"visible",children:y.children},C,0,null),B=Vo(B,C,U,null),B.flags|=2,y.return=l,B.return=l,y.sibling=B,l.child=y,l.mode&1&&xc(l,a.child,null,U),l.child.memoizedState=n1(U),l.memoizedState=r1,B);if(!(l.mode&1))return sp(a,l,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=Z0(B,y,void 0),sp(a,l,U,y)}if(q=(U&a.childLanes)!==0,Pn||q){if(y=Vr,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),zi(y,a,C,-1))}return y1(),y=Z0(Error(t(421))),sp(a,l,U,y)}return C.data==="$?"?(l.flags|=128,l.child=a.child,l=pQ.bind(null,a),C._reactRetry=l,null):(a=B.treeContext,ei=Da(C.nextSibling),$n=l,tr=!0,ki=null,a!==null&&(fi[pi++]=Os,fi[pi++]=zs,fi[pi++]=Uo,Os=a.id,zs=a.overflow,Uo=l),l=i1(l,y.children),l.flags|=4096,l)}function F3(a,l,f){a.lanes|=l;var y=a.alternate;y!==null&&(y.lanes|=l),U0(a.return,l,f)}function s1(a,l,f,y,C){var B=a.memoizedState;B===null?a.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:y,tail:f,tailMode:C}:(B.isBackwards=l,B.rendering=null,B.renderingStartTime=0,B.last=y,B.tail=f,B.tailMode=C)}function O3(a,l,f){var y=l.pendingProps,C=y.revealOrder,B=y.tail;if(mn(a,l,y.children,f),y=ar.current,y&2)y=y&1|2,l.flags|=128;else{if(a!==null&&a.flags&128)e:for(a=l.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&F3(a,f,l);else if(a.tag===19)F3(a,f,l);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===l)break e;for(;a.sibling===null;){if(a.return===null||a.return===l)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}y&=1}if(Wt(ar,y),!(l.mode&1))l.memoizedState=null;else switch(C){case"forwards":for(f=l.child,C=null;f!==null;)a=f.alternate,a!==null&&$f(a)===null&&(C=f),f=f.sibling;f=C,f===null?(C=l.child,l.child=null):(C=f.sibling,f.sibling=null),s1(l,!1,C,f,B);break;case"backwards":for(f=null,C=l.child,l.child=null;C!==null;){if(a=C.alternate,a!==null&&$f(a)===null){l.child=C;break}a=C.sibling,C.sibling=f,f=C,C=a}s1(l,!0,f,null,B);break;case"together":s1(l,!1,null,null,void 0);break;default:l.memoizedState=null}return l.child}function ap(a,l){!(l.mode&1)&&a!==null&&(a.alternate=null,l.alternate=null,l.flags|=2)}function Vs(a,l,f){if(a!==null&&(l.dependencies=a.dependencies),Oo|=l.lanes,!(f&l.childLanes))return null;if(a!==null&&l.child!==a.child)throw Error(t(153));if(l.child!==null){for(a=l.child,f=Ga(a,a.pendingProps),l.child=f,f.return=l;a.sibling!==null;)a=a.sibling,f=f.sibling=Ga(a,a.pendingProps),f.return=l;f.sibling=null}return l.child}function rQ(a,l,f){switch(l.tag){case 3:P3(l),vc();break;case 5:n3(l);break;case 1:Un(l.type)&&Hf(l);break;case 4:O0(l,l.stateNode.containerInfo);break;case 10:var y=l.type._context,C=l.memoizedProps.value;Wt(Yf,y._currentValue),y._currentValue=C;break;case 13:if(y=l.memoizedState,y!==null)return y.dehydrated!==null?(Wt(ar,ar.current&1),l.flags|=128,null):f&l.child.childLanes?Q3(a,l,f):(Wt(ar,ar.current&1),a=Vs(a,l,f),a!==null?a.sibling:null);Wt(ar,ar.current&1);break;case 19:if(y=(f&l.childLanes)!==0,a.flags&128){if(y)return O3(a,l,f);l.flags|=128}if(C=l.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 l.lanes=0,L3(a,l,f)}return Vs(a,l,f)}var z3,a1,H3,G3;z3=function(a,l){for(var f=l.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===l)break;for(;f.sibling===null;){if(f.return===null||f.return===l)return;f=f.return}f.sibling.return=f.return,f=f.sibling}},a1=function(){},H3=function(a,l,f,y){var C=a.memoizedProps;if(C!==y){a=l.stateNode,Qo(ss.current);var B=null;switch(f){case"input":C=dt(a,C),y=dt(a,y),B=[];break;case"select":C=Q({},C,{value:void 0}),y=Q({},y,{value:void 0}),B=[];break;case"textarea":C=Ee(a,C),y=Ee(a,y),B=[];break;default:typeof C.onClick!="function"&&typeof y.onClick=="function"&&(a.onclick=Ff)}tt(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;(l.updateQueue=ce)&&(l.flags|=4)}},G3=function(a,l,f,y){f!==y&&(l.flags|=4)};function xh(a,l){if(!tr)switch(a.tailMode){case"hidden":l=a.tail;for(var f=null;l!==null;)l.alternate!==null&&(f=l),l=l.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?l||a.tail===null?a.tail=null:a.tail.sibling=null:y.sibling=null}}function sn(a){var l=a.alternate!==null&&a.alternate.child===a.child,f=0,y=0;if(l)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,l}function nQ(a,l,f){var y=l.pendingProps;switch(T0(l),l.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return sn(l),null;case 1:return Un(l.type)&&zf(),sn(l),null;case 3:return y=l.stateNode,wc(),Kt(Nn),Kt(rn),G0(),y.pendingContext&&(y.context=y.pendingContext,y.pendingContext=null),(a===null||a.child===null)&&(Wf(l)?l.flags|=4:a===null||a.memoizedState.isDehydrated&&!(l.flags&256)||(l.flags|=1024,ki!==null&&(m1(ki),ki=null))),a1(a,l),sn(l),null;case 5:z0(l);var C=Qo(mh.current);if(f=l.type,a!==null&&l.stateNode!=null)H3(a,l,f,y,C),a.ref!==l.ref&&(l.flags|=512,l.flags|=2097152);else{if(!y){if(l.stateNode===null)throw Error(t(166));return sn(l),null}if(a=Qo(ss.current),Wf(l)){y=l.stateNode,f=l.type;var B=l.memoizedProps;switch(y[is]=l,y[dh]=B,a=(l.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<ch.length;C++)Xt(ch[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":Xe(y,B),Xt("invalid",y);break;case"select":y._wrapperState={wasMultiple:!!B.multiple},Xt("invalid",y);break;case"textarea":Oe(y,B),Xt("invalid",y)}tt(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&&Qf(y.textContent,q,a),C=["children",q]):typeof q=="number"&&y.textContent!==""+q&&(B.suppressHydrationWarning!==!0&&Qf(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),Qe(y);break;case"select":case"option":break;default:typeof B.onClick=="function"&&(y.onclick=Ff)}y=C,l.updateQueue=y,y!==null&&(l.flags|=4)}else{U=C.nodeType===9?C:C.ownerDocument,a==="http://www.w3.org/1999/xhtml"&&(a=ve(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[is]=l,a[dh]=y,z3(a,l,!1,!1),l.stateNode=a;e:{switch(U=V(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<ch.length;C++)Xt(ch[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":Xe(a,y),C=dt(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":Oe(a,y),C=Ee(a,y),Xt("invalid",a);break;default:C=y}tt(f,C),q=C;for(B in q)if(q.hasOwnProperty(B)){var J=q[B];B==="style"?ct(a,J):B==="dangerouslySetInnerHTML"?(J=J?J.__html:void 0,J!=null&&Ye(a,J)):B==="children"?typeof J=="string"?(f!=="textarea"||J!=="")&&Le(a,J):typeof J=="number"&&Le(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),Qe(a);break;case"option":y.value!=null&&a.setAttribute("value",""+ye(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=Ff)}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&&(l.flags|=4)}l.ref!==null&&(l.flags|=512,l.flags|=2097152)}return sn(l),null;case 6:if(a&&l.stateNode!=null)G3(a,l,a.memoizedProps,y);else{if(typeof y!="string"&&l.stateNode===null)throw Error(t(166));if(f=Qo(mh.current),Qo(ss.current),Wf(l)){if(y=l.stateNode,f=l.memoizedProps,y[is]=l,(B=y.nodeValue!==f)&&(a=$n,a!==null))switch(a.tag){case 3:Qf(y.nodeValue,f,(a.mode&1)!==0);break;case 5:a.memoizedProps.suppressHydrationWarning!==!0&&Qf(y.nodeValue,f,(a.mode&1)!==0)}B&&(l.flags|=4)}else y=(f.nodeType===9?f:f.ownerDocument).createTextNode(y),y[is]=l,l.stateNode=y}return sn(l),null;case 13:if(Kt(ar),y=l.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(tr&&ei!==null&&l.mode&1&&!(l.flags&128))jC(),vc(),l.flags|=98560,B=!1;else if(B=Wf(l),y!==null&&y.dehydrated!==null){if(a===null){if(!B)throw Error(t(318));if(B=l.memoizedState,B=B!==null?B.dehydrated:null,!B)throw Error(t(317));B[is]=l}else vc(),!(l.flags&128)&&(l.memoizedState=null),l.flags|=4;sn(l),B=!1}else ki!==null&&(m1(ki),ki=null),B=!0;if(!B)return l.flags&65536?l:null}return l.flags&128?(l.lanes=f,l):(y=y!==null,y!==(a!==null&&a.memoizedState!==null)&&y&&(l.child.flags|=8192,l.mode&1&&(a===null||ar.current&1?Nr===0&&(Nr=3):y1())),l.updateQueue!==null&&(l.flags|=4),sn(l),null);case 4:return wc(),a1(a,l),a===null&&uh(l.stateNode.containerInfo),sn(l),null;case 10:return N0(l.type._context),sn(l),null;case 17:return Un(l.type)&&zf(),sn(l),null;case 19:if(Kt(ar),B=l.memoizedState,B===null)return sn(l),null;if(y=(l.flags&128)!==0,U=B.rendering,U===null)if(y)xh(B,!1);else{if(Nr!==0||a!==null&&a.flags&128)for(a=l.child;a!==null;){if(U=$f(a),U!==null){for(l.flags|=128,xh(B,!1),y=U.updateQueue,y!==null&&(l.updateQueue=y,l.flags|=4),l.subtreeFlags=0,y=f,f=l.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),l.child}a=a.sibling}B.tail!==null&&qe()>Mc&&(l.flags|=128,y=!0,xh(B,!1),l.lanes=4194304)}else{if(!y)if(a=$f(U),a!==null){if(l.flags|=128,y=!0,f=a.updateQueue,f!==null&&(l.updateQueue=f,l.flags|=4),xh(B,!0),B.tail===null&&B.tailMode==="hidden"&&!U.alternate&&!tr)return sn(l),null}else 2*qe()-B.renderingStartTime>Mc&&f!==1073741824&&(l.flags|=128,y=!0,xh(B,!1),l.lanes=4194304);B.isBackwards?(U.sibling=l.child,l.child=U):(f=B.last,f!==null?f.sibling=U:l.child=U,B.last=U)}return B.tail!==null?(l=B.tail,B.rendering=l,B.tail=l.sibling,B.renderingStartTime=qe(),l.sibling=null,f=ar.current,Wt(ar,y?f&1|2:f&1),l):(sn(l),null);case 22:case 23:return v1(),y=l.memoizedState!==null,a!==null&&a.memoizedState!==null!==y&&(l.flags|=8192),y&&l.mode&1?ti&1073741824&&(sn(l),l.subtreeFlags&6&&(l.flags|=8192)):sn(l),null;case 24:return null;case 25:return null}throw Error(t(156,l.tag))}function iQ(a,l){switch(T0(l),l.tag){case 1:return Un(l.type)&&zf(),a=l.flags,a&65536?(l.flags=a&-65537|128,l):null;case 3:return wc(),Kt(Nn),Kt(rn),G0(),a=l.flags,a&65536&&!(a&128)?(l.flags=a&-65537|128,l):null;case 5:return z0(l),null;case 13:if(Kt(ar),a=l.memoizedState,a!==null&&a.dehydrated!==null){if(l.alternate===null)throw Error(t(340));vc()}return a=l.flags,a&65536?(l.flags=a&-65537|128,l):null;case 19:return Kt(ar),null;case 4:return wc(),null;case 10:return N0(l.type._context),null;case 22:case 23:return v1(),null;case 24:return null;default:return null}}var op=!1,an=!1,sQ=typeof WeakSet=="function"?WeakSet:Set,Fe=null;function Cc(a,l){var f=a.ref;if(f!==null)if(typeof f=="function")try{f(null)}catch(y){dr(a,l,y)}else f.current=null}function o1(a,l,f){try{f()}catch(y){dr(a,l,y)}}var V3=!1;function aQ(a,l){if(v0=Mf,a=EC(),h0(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,Ie=0,Se=a,we=null;t:for(;;){for(var Ue;Se!==f||C!==0&&Se.nodeType!==3||(q=U+C),Se!==B||y!==0&&Se.nodeType!==3||(J=U+y),Se.nodeType===3&&(U+=Se.nodeValue.length),(Ue=Se.firstChild)!==null;)we=Se,Se=Ue;for(;;){if(Se===a)break t;if(we===f&&++ce===C&&(q=U),we===B&&++Ie===y&&(J=U),(Ue=Se.nextSibling)!==null)break;Se=we,we=Se.parentNode}Se=Ue}f=q===-1||J===-1?null:{start:q,end:J}}else f=null}f=f||{start:0,end:0}}else f=null;for(y0={focusedElem:a,selectionRange:f},Mf=!1,Fe=l;Fe!==null;)if(l=Fe,a=l.child,(l.subtreeFlags&1028)!==0&&a!==null)a.return=l,Fe=a;else for(;Fe!==null;){l=Fe;try{var He=l.alternate;if(l.flags&1024)switch(l.tag){case 0:case 11:case 15:break;case 1:if(He!==null){var Ve=He.memoizedProps,yr=He.memoizedState,ie=l.stateNode,$=ie.getSnapshotBeforeUpdate(l.elementType===l.type?Ve:Qi(l.type,Ve),yr);ie.__reactInternalSnapshotBeforeUpdate=$}break;case 3:var ae=l.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){dr(l,l.return,Te)}if(a=l.sibling,a!==null){a.return=l.return,Fe=a;break}Fe=l.return}return He=V3,V3=!1,He}function wh(a,l,f){var y=l.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&&o1(l,f,B)}C=C.next}while(C!==y)}}function lp(a,l){if(l=l.updateQueue,l=l!==null?l.lastEffect:null,l!==null){var f=l=l.next;do{if((f.tag&a)===a){var y=f.create;f.destroy=y()}f=f.next}while(f!==l)}}function l1(a){var l=a.ref;if(l!==null){var f=a.stateNode;switch(a.tag){case 5:a=f;break;default:a=f}typeof l=="function"?l(a):l.current=a}}function j3(a){var l=a.alternate;l!==null&&(a.alternate=null,j3(l)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(l=a.stateNode,l!==null&&(delete l[is],delete l[dh],delete l[I0],delete l[H7],delete l[G7])),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 W3(a){return a.tag===5||a.tag===3||a.tag===4}function Y3(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||W3(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 c1(a,l,f){var y=a.tag;if(y===5||y===6)a=a.stateNode,l?f.nodeType===8?f.parentNode.insertBefore(a,l):f.insertBefore(a,l):(f.nodeType===8?(l=f.parentNode,l.insertBefore(a,f)):(l=f,l.appendChild(a)),f=f._reactRootContainer,f!=null||l.onclick!==null||(l.onclick=Ff));else if(y!==4&&(a=a.child,a!==null))for(c1(a,l,f),a=a.sibling;a!==null;)c1(a,l,f),a=a.sibling}function u1(a,l,f){var y=a.tag;if(y===5||y===6)a=a.stateNode,l?f.insertBefore(a,l):f.appendChild(a);else if(y!==4&&(a=a.child,a!==null))for(u1(a,l,f),a=a.sibling;a!==null;)u1(a,l,f),a=a.sibling}var qr=null,Fi=!1;function Qa(a,l,f){for(f=f.child;f!==null;)q3(a,l,f),f=f.sibling}function q3(a,l,f){if(rt&&typeof rt.onCommitFiberUnmount=="function")try{rt.onCommitFiberUnmount(jt,f)}catch{}switch(f.tag){case 5:an||Cc(f,l);case 6:var y=qr,C=Fi;qr=null,Qa(a,l,f),qr=y,Fi=C,qr!==null&&(Fi?(a=qr,f=f.stateNode,a.nodeType===8?a.parentNode.removeChild(f):a.removeChild(f)):qr.removeChild(f.stateNode));break;case 18:qr!==null&&(Fi?(a=qr,f=f.stateNode,a.nodeType===8?w0(a.parentNode,f):a.nodeType===1&&w0(a,f),th(a)):w0(qr,f.stateNode));break;case 4:y=qr,C=Fi,qr=f.stateNode.containerInfo,Fi=!0,Qa(a,l,f),qr=y,Fi=C;break;case 0:case 11:case 14:case 15:if(!an&&(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)&&o1(f,l,U),C=C.next}while(C!==y)}Qa(a,l,f);break;case 1:if(!an&&(Cc(f,l),y=f.stateNode,typeof y.componentWillUnmount=="function"))try{y.props=f.memoizedProps,y.state=f.memoizedState,y.componentWillUnmount()}catch(q){dr(f,l,q)}Qa(a,l,f);break;case 21:Qa(a,l,f);break;case 22:f.mode&1?(an=(y=an)||f.memoizedState!==null,Qa(a,l,f),an=y):Qa(a,l,f);break;default:Qa(a,l,f)}}function X3(a){var l=a.updateQueue;if(l!==null){a.updateQueue=null;var f=a.stateNode;f===null&&(f=a.stateNode=new sQ),l.forEach(function(y){var C=AQ.bind(null,a,y);f.has(y)||(f.add(y),y.then(C,C))})}}function Oi(a,l){var f=l.deletions;if(f!==null)for(var y=0;y<f.length;y++){var C=f[y];try{var B=a,U=l,q=U;e:for(;q!==null;){switch(q.tag){case 5:qr=q.stateNode,Fi=!1;break e;case 3:qr=q.stateNode.containerInfo,Fi=!0;break e;case 4:qr=q.stateNode.containerInfo,Fi=!0;break e}q=q.return}if(qr===null)throw Error(t(160));q3(B,U,C),qr=null,Fi=!1;var J=C.alternate;J!==null&&(J.return=null),C.return=null}catch(ce){dr(C,l,ce)}}if(l.subtreeFlags&12854)for(l=l.child;l!==null;)K3(l,a),l=l.sibling}function K3(a,l){var f=a.alternate,y=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:if(Oi(l,a),os(a),y&4){try{wh(3,a,a.return),lp(3,a)}catch(Ve){dr(a,a.return,Ve)}try{wh(5,a,a.return)}catch(Ve){dr(a,a.return,Ve)}}break;case 1:Oi(l,a),os(a),y&512&&f!==null&&Cc(f,f.return);break;case 5:if(Oi(l,a),os(a),y&512&&f!==null&&Cc(f,f.return),a.flags&32){var C=a.stateNode;try{Le(C,"")}catch(Ve){dr(a,a.return,Ve)}}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&&ft(C,B),V(q,U);var ce=V(q,B);for(U=0;U<J.length;U+=2){var Ie=J[U],Se=J[U+1];Ie==="style"?ct(C,Se):Ie==="dangerouslySetInnerHTML"?Ye(C,Se):Ie==="children"?Le(C,Se):x(C,Ie,Se,ce)}switch(q){case"input":Y(C,B);break;case"textarea":Ce(C,B);break;case"select":var we=C._wrapperState.wasMultiple;C._wrapperState.wasMultiple=!!B.multiple;var Ue=B.value;Ue!=null?me(C,!!B.multiple,Ue,!1):we!==!!B.multiple&&(B.defaultValue!=null?me(C,!!B.multiple,B.defaultValue,!0):me(C,!!B.multiple,B.multiple?[]:"",!1))}C[dh]=B}catch(Ve){dr(a,a.return,Ve)}}break;case 6:if(Oi(l,a),os(a),y&4){if(a.stateNode===null)throw Error(t(162));C=a.stateNode,B=a.memoizedProps;try{C.nodeValue=B}catch(Ve){dr(a,a.return,Ve)}}break;case 3:if(Oi(l,a),os(a),y&4&&f!==null&&f.memoizedState.isDehydrated)try{th(l.containerInfo)}catch(Ve){dr(a,a.return,Ve)}break;case 4:Oi(l,a),os(a);break;case 13:Oi(l,a),os(a),C=a.child,C.flags&8192&&(B=C.memoizedState!==null,C.stateNode.isHidden=B,!B||C.alternate!==null&&C.alternate.memoizedState!==null||(f1=qe())),y&4&&X3(a);break;case 22:if(Ie=f!==null&&f.memoizedState!==null,a.mode&1?(an=(ce=an)||Ie,Oi(l,a),an=ce):Oi(l,a),os(a),y&8192){if(ce=a.memoizedState!==null,(a.stateNode.isHidden=ce)&&!Ie&&a.mode&1)for(Fe=a,Ie=a.child;Ie!==null;){for(Se=Fe=Ie;Fe!==null;){switch(we=Fe,Ue=we.child,we.tag){case 0:case 11:case 14:case 15:wh(4,we,we.return);break;case 1:Cc(we,we.return);var He=we.stateNode;if(typeof He.componentWillUnmount=="function"){y=we,f=we.return;try{l=y,He.props=l.memoizedProps,He.state=l.memoizedState,He.componentWillUnmount()}catch(Ve){dr(y,f,Ve)}}break;case 5:Cc(we,we.return);break;case 22:if(we.memoizedState!==null){$3(Se);continue}}Ue!==null?(Ue.return=we,Fe=Ue):$3(Se)}Ie=Ie.sibling}e:for(Ie=null,Se=a;;){if(Se.tag===5){if(Ie===null){Ie=Se;try{C=Se.stateNode,ce?(B=C.style,typeof B.setProperty=="function"?B.setProperty("display","none","important"):B.display="none"):(q=Se.stateNode,J=Se.memoizedProps.style,U=J!=null&&J.hasOwnProperty("display")?J.display:null,q.style.display=pt("display",U))}catch(Ve){dr(a,a.return,Ve)}}}else if(Se.tag===6){if(Ie===null)try{Se.stateNode.nodeValue=ce?"":Se.memoizedProps}catch(Ve){dr(a,a.return,Ve)}}else if((Se.tag!==22&&Se.tag!==23||Se.memoizedState===null||Se===a)&&Se.child!==null){Se.child.return=Se,Se=Se.child;continue}if(Se===a)break e;for(;Se.sibling===null;){if(Se.return===null||Se.return===a)break e;Ie===Se&&(Ie=null),Se=Se.return}Ie===Se&&(Ie=null),Se.sibling.return=Se.return,Se=Se.sibling}}break;case 19:Oi(l,a),os(a),y&4&&X3(a);break;case 21:break;default:Oi(l,a),os(a)}}function os(a){var l=a.flags;if(l&2){try{e:{for(var f=a.return;f!==null;){if(W3(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&&(Le(C,""),y.flags&=-33);var B=Y3(a);u1(a,B,C);break;case 3:case 4:var U=y.stateNode.containerInfo,q=Y3(a);c1(a,q,U);break;default:throw Error(t(161))}}catch(J){dr(a,a.return,J)}a.flags&=-3}l&4096&&(a.flags&=-4097)}function oQ(a,l,f){Fe=a,J3(a)}function J3(a,l,f){for(var y=(a.mode&1)!==0;Fe!==null;){var C=Fe,B=C.child;if(C.tag===22&&y){var U=C.memoizedState!==null||op;if(!U){var q=C.alternate,J=q!==null&&q.memoizedState!==null||an;q=op;var ce=an;if(op=U,(an=J)&&!ce)for(Fe=C;Fe!==null;)U=Fe,J=U.child,U.tag===22&&U.memoizedState!==null?eS(C):J!==null?(J.return=U,Fe=J):eS(C);for(;B!==null;)Fe=B,J3(B),B=B.sibling;Fe=C,op=q,an=ce}Z3(a)}else C.subtreeFlags&8772&&B!==null?(B.return=C,Fe=B):Z3(a)}}function Z3(a){for(;Fe!==null;){var l=Fe;if(l.flags&8772){var f=l.alternate;try{if(l.flags&8772)switch(l.tag){case 0:case 11:case 15:an||lp(5,l);break;case 1:var y=l.stateNode;if(l.flags&4&&!an)if(f===null)y.componentDidMount();else{var C=l.elementType===l.type?f.memoizedProps:Qi(l.type,f.memoizedProps);y.componentDidUpdate(C,f.memoizedState,y.__reactInternalSnapshotBeforeUpdate)}var B=l.updateQueue;B!==null&&XC(l,B,y);break;case 3:var U=l.updateQueue;if(U!==null){if(f=null,l.child!==null)switch(l.child.tag){case 5:f=l.child.stateNode;break;case 1:f=l.child.stateNode}XC(l,U,f)}break;case 5:var q=l.stateNode;if(f===null&&l.flags&4){f=q;var J=l.memoizedProps;switch(l.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(l.memoizedState===null){var ce=l.alternate;if(ce!==null){var Ie=ce.memoizedState;if(Ie!==null){var Se=Ie.dehydrated;Se!==null&&th(Se)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(t(163))}an||l.flags&512&&l1(l)}catch(we){dr(l,l.return,we)}}if(l===a){Fe=null;break}if(f=l.sibling,f!==null){f.return=l.return,Fe=f;break}Fe=l.return}}function $3(a){for(;Fe!==null;){var l=Fe;if(l===a){Fe=null;break}var f=l.sibling;if(f!==null){f.return=l.return,Fe=f;break}Fe=l.return}}function eS(a){for(;Fe!==null;){var l=Fe;try{switch(l.tag){case 0:case 11:case 15:var f=l.return;try{lp(4,l)}catch(J){dr(l,f,J)}break;case 1:var y=l.stateNode;if(typeof y.componentDidMount=="function"){var C=l.return;try{y.componentDidMount()}catch(J){dr(l,C,J)}}var B=l.return;try{l1(l)}catch(J){dr(l,B,J)}break;case 5:var U=l.return;try{l1(l)}catch(J){dr(l,U,J)}}}catch(J){dr(l,l.return,J)}if(l===a){Fe=null;break}var q=l.sibling;if(q!==null){q.return=l.return,Fe=q;break}Fe=l.return}}var lQ=Math.ceil,cp=I.ReactCurrentDispatcher,h1=I.ReactCurrentOwner,mi=I.ReactCurrentBatchConfig,St=0,Vr=null,Cr=null,Xr=0,ti=0,Sc=La(0),Nr=0,Ih=null,Oo=0,up=0,d1=0,Ch=null,kn=null,f1=0,Mc=1/0,js=null,hp=!1,p1=null,Fa=null,dp=!1,Oa=null,fp=0,Sh=0,A1=null,pp=-1,Ap=0;function _n(){return St&6?qe():pp!==-1?pp:pp=qe()}function za(a){return a.mode&1?St&2&&Xr!==0?Xr&-Xr:j7.transition!==null?(Ap===0&&(Ap=Xu()),Ap):(a=Pt,a!==0||(a=window.event,a=a===void 0?16:tC(a.type)),a):1}function zi(a,l,f,y){if(50<Sh)throw Sh=0,A1=null,Error(t(185));Ku(a,f,y),(!(St&2)||a!==Vr)&&(a===Vr&&(!(St&2)&&(up|=f),Nr===4&&Ha(a,Xr)),Qn(a,y),f===1&&St===0&&!(l.mode&1)&&(Mc=qe()+500,Gf&&Ua()))}function Qn(a,l){var f=a.callbackNode;Yu(a,l);var y=Ca(a,a===Vr?Xr:0);if(y===0)f!==null&&Je(f),a.callbackNode=null,a.callbackPriority=0;else if(l=y&-y,a.callbackPriority!==l){if(f!=null&&Je(f),l===1)a.tag===0?V7(rS.bind(null,a)):OC(rS.bind(null,a)),O7(function(){!(St&6)&&Ua()}),f=null;else{switch(YI(y)){case 1:f=ht;break;case 4:f=Dr;break;case 16:f=er;break;case 536870912:f=di;break;default:f=er}f=uS(f,tS.bind(null,a))}a.callbackPriority=l,a.callbackNode=f}}function tS(a,l){if(pp=-1,Ap=0,St&6)throw Error(t(327));var f=a.callbackNode;if(Tc()&&a.callbackNode!==f)return null;var y=Ca(a,a===Vr?Xr:0);if(y===0)return null;if(y&30||y&a.expiredLanes||l)l=gp(a,y);else{l=y;var C=St;St|=2;var B=iS();(Vr!==a||Xr!==l)&&(js=null,Mc=qe()+500,Ho(a,l));do try{hQ();break}catch(q){nS(a,q)}while(1);L0(),cp.current=B,St=C,Cr!==null?l=0:(Vr=null,Xr=0,l=Nr)}if(l!==0){if(l===2&&(C=qu(a),C!==0&&(y=C,l=g1(a,C))),l===1)throw f=Ih,Ho(a,0),Ha(a,y),Qn(a,qe()),f;if(l===6)Ha(a,y);else{if(C=a.current.alternate,!(y&30)&&!cQ(C)&&(l=gp(a,y),l===2&&(B=qu(a),B!==0&&(y=B,l=g1(a,B))),l===1))throw f=Ih,Ho(a,0),Ha(a,y),Qn(a,qe()),f;switch(a.finishedWork=C,a.finishedLanes=y,l){case 0:case 1:throw Error(t(345));case 2:Go(a,kn,js);break;case 3:if(Ha(a,y),(y&130023424)===y&&(l=f1+500-qe(),10<l)){if(Ca(a,0)!==0)break;if(C=a.suspendedLanes,(C&y)!==y){_n(),a.pingedLanes|=a.suspendedLanes&C;break}a.timeoutHandle=x0(Go.bind(null,a,kn,js),l);break}Go(a,kn,js);break;case 4:if(Ha(a,y),(y&4194240)===y)break;for(l=a.eventTimes,C=-1;0<y;){var U=31-gn(y);B=1<<U,U=l[U],U>C&&(C=U),y&=~B}if(y=C,y=qe()-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=x0(Go.bind(null,a,kn,js),y);break}Go(a,kn,js);break;case 5:Go(a,kn,js);break;default:throw Error(t(329))}}}return Qn(a,qe()),a.callbackNode===f?tS.bind(null,a):null}function g1(a,l){var f=Ch;return a.current.memoizedState.isDehydrated&&(Ho(a,l).flags|=256),a=gp(a,l),a!==2&&(l=kn,kn=f,l!==null&&m1(l)),a}function m1(a){kn===null?kn=a:kn.push.apply(kn,a)}function cQ(a){for(var l=a;;){if(l.flags&16384){var f=l.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(!Pi(B(),C))return!1}catch{return!1}}}if(f=l.child,l.subtreeFlags&16384&&f!==null)f.return=l,l=f;else{if(l===a)break;for(;l.sibling===null;){if(l.return===null||l.return===a)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function Ha(a,l){for(l&=~d1,l&=~up,a.suspendedLanes|=l,a.pingedLanes&=~l,a=a.expirationTimes;0<l;){var f=31-gn(l),y=1<<f;a[f]=-1,l&=~y}}function rS(a){if(St&6)throw Error(t(327));Tc();var l=Ca(a,0);if(!(l&1))return Qn(a,qe()),null;var f=gp(a,l);if(a.tag!==0&&f===2){var y=qu(a);y!==0&&(l=y,f=g1(a,y))}if(f===1)throw f=Ih,Ho(a,0),Ha(a,l),Qn(a,qe()),f;if(f===6)throw Error(t(345));return a.finishedWork=a.current.alternate,a.finishedLanes=l,Go(a,kn,js),Qn(a,qe()),null}function _1(a,l){var f=St;St|=1;try{return a(l)}finally{St=f,St===0&&(Mc=qe()+500,Gf&&Ua())}}function zo(a){Oa!==null&&Oa.tag===0&&!(St&6)&&Tc();var l=St;St|=1;var f=mi.transition,y=Pt;try{if(mi.transition=null,Pt=1,a)return a()}finally{Pt=y,mi.transition=f,St=l,!(St&6)&&Ua()}}function v1(){ti=Sc.current,Kt(Sc)}function Ho(a,l){a.finishedWork=null,a.finishedLanes=0;var f=a.timeoutHandle;if(f!==-1&&(a.timeoutHandle=-1,F7(f)),Cr!==null)for(f=Cr.return;f!==null;){var y=f;switch(T0(y),y.tag){case 1:y=y.type.childContextTypes,y!=null&&zf();break;case 3:wc(),Kt(Nn),Kt(rn),G0();break;case 5:z0(y);break;case 4:wc();break;case 13:Kt(ar);break;case 19:Kt(ar);break;case 10:N0(y.type._context);break;case 22:case 23:v1()}f=f.return}if(Vr=a,Cr=a=Ga(a.current,null),Xr=ti=l,Nr=0,Ih=null,d1=up=Oo=0,kn=Ch=null,ko!==null){for(l=0;l<ko.length;l++)if(f=ko[l],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}ko=null}return a}function nS(a,l){do{var f=Cr;try{if(L0(),ep.current=ip,tp){for(var y=or.memoizedState;y!==null;){var C=y.queue;C!==null&&(C.pending=null),y=y.next}tp=!1}if(Fo=0,Gr=Lr=or=null,_h=!1,vh=0,h1.current=null,f===null||f.return===null){Nr=1,Ih=l,Cr=null;break}e:{var B=a,U=f.return,q=f,J=l;if(l=Xr,q.flags|=32768,J!==null&&typeof J=="object"&&typeof J.then=="function"){var ce=J,Ie=q,Se=Ie.tag;if(!(Ie.mode&1)&&(Se===0||Se===11||Se===15)){var we=Ie.alternate;we?(Ie.updateQueue=we.updateQueue,Ie.memoizedState=we.memoizedState,Ie.lanes=we.lanes):(Ie.updateQueue=null,Ie.memoizedState=null)}var Ue=T3(U);if(Ue!==null){Ue.flags&=-257,B3(Ue,U,q,B,l),Ue.mode&1&&M3(B,ce,l),l=Ue,J=ce;var He=l.updateQueue;if(He===null){var Ve=new Set;Ve.add(J),l.updateQueue=Ve}else He.add(J);break e}else{if(!(l&1)){M3(B,ce,l),y1();break e}J=Error(t(426))}}else if(tr&&q.mode&1){var yr=T3(U);if(yr!==null){!(yr.flags&65536)&&(yr.flags|=256),B3(yr,U,q,B,l),R0(Ic(J,q));break e}}B=J=Ic(J,q),Nr!==4&&(Nr=2),Ch===null?Ch=[B]:Ch.push(B),B=U;do{switch(B.tag){case 3:B.flags|=65536,l&=-l,B.lanes|=l;var ie=C3(B,J,l);qC(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,l&=-l,B.lanes|=l;var Te=S3(B,q,l);qC(B,Te);break e}}B=B.return}while(B!==null)}aS(f)}catch(je){l=je,Cr===f&&f!==null&&(Cr=f=f.return);continue}break}while(1)}function iS(){var a=cp.current;return cp.current=ip,a===null?ip:a}function y1(){(Nr===0||Nr===3||Nr===2)&&(Nr=4),Vr===null||!(Oo&268435455)&&!(up&268435455)||Ha(Vr,Xr)}function gp(a,l){var f=St;St|=2;var y=iS();(Vr!==a||Xr!==l)&&(js=null,Ho(a,l));do try{uQ();break}catch(C){nS(a,C)}while(1);if(L0(),St=f,cp.current=y,Cr!==null)throw Error(t(261));return Vr=null,Xr=0,Nr}function uQ(){for(;Cr!==null;)sS(Cr)}function hQ(){for(;Cr!==null&&!it();)sS(Cr)}function sS(a){var l=cS(a.alternate,a,ti);a.memoizedProps=a.pendingProps,l===null?aS(a):Cr=l,h1.current=null}function aS(a){var l=a;do{var f=l.alternate;if(a=l.return,l.flags&32768){if(f=iQ(f,l),f!==null){f.flags&=32767,Cr=f;return}if(a!==null)a.flags|=32768,a.subtreeFlags=0,a.deletions=null;else{Nr=6,Cr=null;return}}else if(f=nQ(f,l,ti),f!==null){Cr=f;return}if(l=l.sibling,l!==null){Cr=l;return}Cr=l=a}while(l!==null);Nr===0&&(Nr=5)}function Go(a,l,f){var y=Pt,C=mi.transition;try{mi.transition=null,Pt=1,dQ(a,l,f,y)}finally{mi.transition=C,Pt=y}return null}function dQ(a,l,f,y){do Tc();while(Oa!==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(Wk(a,B),a===Vr&&(Cr=Vr=null,Xr=0),!(f.subtreeFlags&2064)&&!(f.flags&2064)||dp||(dp=!0,uS(er,function(){return Tc(),null})),B=(f.flags&15990)!==0,f.subtreeFlags&15990||B){B=mi.transition,mi.transition=null;var U=Pt;Pt=1;var q=St;St|=4,h1.current=null,aQ(a,f),K3(f,a),D7(y0),Mf=!!v0,y0=v0=null,a.current=f,oQ(f),ot(),St=q,Pt=U,mi.transition=B}else a.current=f;if(dp&&(dp=!1,Oa=a,fp=C),B=a.pendingLanes,B===0&&(Fa=null),Wu(f.stateNode),Qn(a,qe()),l!==null)for(y=a.onRecoverableError,f=0;f<l.length;f++)C=l[f],y(C.value,{componentStack:C.stack,digest:C.digest});if(hp)throw hp=!1,a=p1,p1=null,a;return fp&1&&a.tag!==0&&Tc(),B=a.pendingLanes,B&1?a===A1?Sh++:(Sh=0,A1=a):Sh=0,Ua(),null}function Tc(){if(Oa!==null){var a=YI(fp),l=mi.transition,f=Pt;try{if(mi.transition=null,Pt=16>a?16:a,Oa===null)var y=!1;else{if(a=Oa,Oa=null,fp=0,St&6)throw Error(t(331));var C=St;for(St|=4,Fe=a.current;Fe!==null;){var B=Fe,U=B.child;if(Fe.flags&16){var q=B.deletions;if(q!==null){for(var J=0;J<q.length;J++){var ce=q[J];for(Fe=ce;Fe!==null;){var Ie=Fe;switch(Ie.tag){case 0:case 11:case 15:wh(8,Ie,B)}var Se=Ie.child;if(Se!==null)Se.return=Ie,Fe=Se;else for(;Fe!==null;){Ie=Fe;var we=Ie.sibling,Ue=Ie.return;if(j3(Ie),Ie===ce){Fe=null;break}if(we!==null){we.return=Ue,Fe=we;break}Fe=Ue}}}var He=B.alternate;if(He!==null){var Ve=He.child;if(Ve!==null){He.child=null;do{var yr=Ve.sibling;Ve.sibling=null,Ve=yr}while(Ve!==null)}}Fe=B}}if(B.subtreeFlags&2064&&U!==null)U.return=B,Fe=U;else e:for(;Fe!==null;){if(B=Fe,B.flags&2048)switch(B.tag){case 0:case 11:case 15:wh(9,B,B.return)}var ie=B.sibling;if(ie!==null){ie.return=B.return,Fe=ie;break e}Fe=B.return}}var $=a.current;for(Fe=$;Fe!==null;){U=Fe;var ae=U.child;if(U.subtreeFlags&2064&&ae!==null)ae.return=U,Fe=ae;else e:for(U=$;Fe!==null;){if(q=Fe,q.flags&2048)try{switch(q.tag){case 0:case 11:case 15:lp(9,q)}}catch(je){dr(q,q.return,je)}if(q===U){Fe=null;break e}var Te=q.sibling;if(Te!==null){Te.return=q.return,Fe=Te;break e}Fe=q.return}}if(St=C,Ua(),rt&&typeof rt.onPostCommitFiberRoot=="function")try{rt.onPostCommitFiberRoot(jt,a)}catch{}y=!0}return y}finally{Pt=f,mi.transition=l}}return!1}function oS(a,l,f){l=Ic(f,l),l=C3(a,l,1),a=ka(a,l,1),l=_n(),a!==null&&(Ku(a,1,l),Qn(a,l))}function dr(a,l,f){if(a.tag===3)oS(a,a,f);else for(;l!==null;){if(l.tag===3){oS(l,a,f);break}else if(l.tag===1){var y=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof y.componentDidCatch=="function"&&(Fa===null||!Fa.has(y))){a=Ic(f,a),a=S3(l,a,1),l=ka(l,a,1),a=_n(),l!==null&&(Ku(l,1,a),Qn(l,a));break}}l=l.return}}function fQ(a,l,f){var y=a.pingCache;y!==null&&y.delete(l),l=_n(),a.pingedLanes|=a.suspendedLanes&f,Vr===a&&(Xr&f)===f&&(Nr===4||Nr===3&&(Xr&130023424)===Xr&&500>qe()-f1?Ho(a,0):d1|=f),Qn(a,l)}function lS(a,l){l===0&&(a.mode&1?(l=vr,vr<<=1,!(vr&130023424)&&(vr=4194304)):l=1);var f=_n();a=Hs(a,l),a!==null&&(Ku(a,l,f),Qn(a,f))}function pQ(a){var l=a.memoizedState,f=0;l!==null&&(f=l.retryLane),lS(a,f)}function AQ(a,l){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(l),lS(a,f)}var cS;cS=function(a,l,f){if(a!==null)if(a.memoizedProps!==l.pendingProps||Nn.current)Pn=!0;else{if(!(a.lanes&f)&&!(l.flags&128))return Pn=!1,rQ(a,l,f);Pn=!!(a.flags&131072)}else Pn=!1,tr&&l.flags&1048576&&zC(l,jf,l.index);switch(l.lanes=0,l.tag){case 2:var y=l.type;ap(a,l),a=l.pendingProps;var C=gc(l,rn.current);Ec(l,f),C=W0(null,l,y,a,C,f);var B=Y0();return l.flags|=1,typeof C=="object"&&C!==null&&typeof C.render=="function"&&C.$$typeof===void 0?(l.tag=1,l.memoizedState=null,l.updateQueue=null,Un(y)?(B=!0,Hf(l)):B=!1,l.memoizedState=C.state!==null&&C.state!==void 0?C.state:null,k0(l),C.updater=Jf,l.stateNode=C,C._reactInternals=l,F0(l,y,a,f),l=t1(null,l,y,!0,B,f)):(l.tag=0,tr&&B&&M0(l),mn(null,l,C,f),l=l.child),l;case 16:y=l.elementType;e:{switch(ap(a,l),a=l.pendingProps,C=y._init,y=C(y._payload),l.type=y,C=l.tag=mQ(y),a=Qi(y,a),C){case 0:l=e1(null,l,y,a,f);break e;case 1:l=U3(null,l,y,a,f);break e;case 11:l=b3(null,l,y,a,f);break e;case 14:l=R3(null,l,y,Qi(y.type,a),f);break e}throw Error(t(306,y,""))}return l;case 0:return y=l.type,C=l.pendingProps,C=l.elementType===y?C:Qi(y,C),e1(a,l,y,C,f);case 1:return y=l.type,C=l.pendingProps,C=l.elementType===y?C:Qi(y,C),U3(a,l,y,C,f);case 3:e:{if(P3(l),a===null)throw Error(t(387));y=l.pendingProps,B=l.memoizedState,C=B.element,YC(a,l),Kf(l,y,null,f);var U=l.memoizedState;if(y=U.element,B.isDehydrated)if(B={element:y,isDehydrated:!1,cache:U.cache,pendingSuspenseBoundaries:U.pendingSuspenseBoundaries,transitions:U.transitions},l.updateQueue.baseState=B,l.memoizedState=B,l.flags&256){C=Ic(Error(t(423)),l),l=k3(a,l,y,f,C);break e}else if(y!==C){C=Ic(Error(t(424)),l),l=k3(a,l,y,f,C);break e}else for(ei=Da(l.stateNode.containerInfo.firstChild),$n=l,tr=!0,ki=null,f=r3(l,null,y,f),l.child=f;f;)f.flags=f.flags&-3|4096,f=f.sibling;else{if(vc(),y===C){l=Vs(a,l,f);break e}mn(a,l,y,f)}l=l.child}return l;case 5:return n3(l),a===null&&b0(l),y=l.type,C=l.pendingProps,B=a!==null?a.memoizedProps:null,U=C.children,E0(y,C)?U=null:B!==null&&E0(y,B)&&(l.flags|=32),N3(a,l),mn(a,l,U,f),l.child;case 6:return a===null&&b0(l),null;case 13:return Q3(a,l,f);case 4:return O0(l,l.stateNode.containerInfo),y=l.pendingProps,a===null?l.child=xc(l,null,y,f):mn(a,l,y,f),l.child;case 11:return y=l.type,C=l.pendingProps,C=l.elementType===y?C:Qi(y,C),b3(a,l,y,C,f);case 7:return mn(a,l,l.pendingProps,f),l.child;case 8:return mn(a,l,l.pendingProps.children,f),l.child;case 12:return mn(a,l,l.pendingProps.children,f),l.child;case 10:e:{if(y=l.type._context,C=l.pendingProps,B=l.memoizedProps,U=C.value,Wt(Yf,y._currentValue),y._currentValue=U,B!==null)if(Pi(B.value,U)){if(B.children===C.children&&!Nn.current){l=Vs(a,l,f);break e}}else for(B=l.child,B!==null&&(B.return=l);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 Ie=ce.pending;Ie===null?J.next=J:(J.next=Ie.next,Ie.next=J),ce.pending=J}}B.lanes|=f,J=B.alternate,J!==null&&(J.lanes|=f),U0(B.return,f,l),q.lanes|=f;break}J=J.next}}else if(B.tag===10)U=B.type===l.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),U0(U,f,l),U=B.sibling}else U=B.child;if(U!==null)U.return=B;else for(U=B;U!==null;){if(U===l){U=null;break}if(B=U.sibling,B!==null){B.return=U.return,U=B;break}U=U.return}B=U}mn(a,l,C.children,f),l=l.child}return l;case 9:return C=l.type,y=l.pendingProps.children,Ec(l,f),C=Ai(C),y=y(C),l.flags|=1,mn(a,l,y,f),l.child;case 14:return y=l.type,C=Qi(y,l.pendingProps),C=Qi(y.type,C),R3(a,l,y,C,f);case 15:return D3(a,l,l.type,l.pendingProps,f);case 17:return y=l.type,C=l.pendingProps,C=l.elementType===y?C:Qi(y,C),ap(a,l),l.tag=1,Un(y)?(a=!0,Hf(l)):a=!1,Ec(l,f),ZC(l,y,C),F0(l,y,C,f),t1(null,l,y,!0,a,f);case 19:return O3(a,l,f);case 22:return L3(a,l,f)}throw Error(t(156,l.tag))};function uS(a,l){return Re(a,l)}function gQ(a,l,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=l,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 _i(a,l,f,y){return new gQ(a,l,f,y)}function E1(a){return a=a.prototype,!(!a||!a.isReactComponent)}function mQ(a){if(typeof a=="function")return E1(a)?1:0;if(a!=null){if(a=a.$$typeof,a===P)return 11;if(a===X)return 14}return 2}function Ga(a,l){var f=a.alternate;return f===null?(f=_i(a.tag,l,a.key,a.mode),f.elementType=a.elementType,f.type=a.type,f.stateNode=a.stateNode,f.alternate=a,a.alternate=f):(f.pendingProps=l,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,l=a.dependencies,f.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},f.sibling=a.sibling,f.index=a.index,f.ref=a.ref,f}function mp(a,l,f,y,C,B){var U=2;if(y=a,typeof a=="function")E1(a)&&(U=1);else if(typeof a=="string")U=5;else e:switch(a){case T:return Vo(f.children,C,B,l);case D:U=8,C|=8;break;case b:return a=_i(12,f,l,C|2),a.elementType=b,a.lanes=B,a;case N:return a=_i(13,f,l,C),a.elementType=N,a.lanes=B,a;case W:return a=_i(19,f,l,C),a.elementType=W,a.lanes=B,a;case te:return _p(f,C,B,l);default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case S: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 l=_i(U,f,l,C),l.elementType=a,l.type=y,l.lanes=B,l}function Vo(a,l,f,y){return a=_i(7,a,y,l),a.lanes=f,a}function _p(a,l,f,y){return a=_i(22,a,y,l),a.elementType=te,a.lanes=f,a.stateNode={isHidden:!1},a}function x1(a,l,f){return a=_i(6,a,null,l),a.lanes=f,a}function w1(a,l,f){return l=_i(4,a.children!==null?a.children:[],a.key,l),l.lanes=f,l.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},l}function _Q(a,l,f,y,C){this.tag=l,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=Km(0),this.expirationTimes=Km(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Km(0),this.identifierPrefix=y,this.onRecoverableError=C,this.mutableSourceEagerHydrationData=null}function I1(a,l,f,y,C,B,U,q,J){return a=new _Q(a,l,f,q,J),l===1?(l=1,B===!0&&(l|=8)):l=0,B=_i(3,null,null,l),a.current=B,B.stateNode=a,B.memoizedState={element:y,isDehydrated:f,cache:null,transitions:null,pendingSuspenseBoundaries:null},k0(B),a}function vQ(a,l,f){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:M,key:y==null?null:""+y,children:a,containerInfo:l,implementation:f}}function hS(a){if(!a)return Na;a=a._reactInternals;e:{if(Ps(a)!==a||a.tag!==1)throw Error(t(170));var l=a;do{switch(l.tag){case 3:l=l.stateNode.context;break e;case 1:if(Un(l.type)){l=l.stateNode.__reactInternalMemoizedMergedChildContext;break e}}l=l.return}while(l!==null);throw Error(t(171))}if(a.tag===1){var f=a.type;if(Un(f))return QC(a,f,l)}return l}function dS(a,l,f,y,C,B,U,q,J){return a=I1(f,y,!0,a,C,B,U,q,J),a.context=hS(null),f=a.current,y=_n(),C=za(f),B=Gs(y,C),B.callback=l??null,ka(f,B,C),a.current.lanes=C,Ku(a,C,y),Qn(a,y),a}function vp(a,l,f,y){var C=l.current,B=_n(),U=za(C);return f=hS(f),l.context===null?l.context=f:l.pendingContext=f,l=Gs(B,U),l.payload={element:a},y=y===void 0?null:y,y!==null&&(l.callback=y),a=ka(C,l,U),a!==null&&(zi(a,C,U,B),Xf(a,C,U)),U}function yp(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 fS(a,l){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var f=a.retryLane;a.retryLane=f!==0&&f<l?f:l}}function C1(a,l){fS(a,l),(a=a.alternate)&&fS(a,l)}function yQ(){return null}var pS=typeof reportError=="function"?reportError:function(a){console.error(a)};function S1(a){this._internalRoot=a}Ep.prototype.render=S1.prototype.render=function(a){var l=this._internalRoot;if(l===null)throw Error(t(409));vp(a,l,null,null)},Ep.prototype.unmount=S1.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var l=a.containerInfo;zo(function(){vp(null,a,null,null)}),l[Qs]=null}};function Ep(a){this._internalRoot=a}Ep.prototype.unstable_scheduleHydration=function(a){if(a){var l=KI();a={blockedOn:null,target:a,priority:l};for(var f=0;f<Ba.length&&l!==0&&l<Ba[f].priority;f++);Ba.splice(f,0,a),f===0&&$I(a)}};function M1(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function xp(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11&&(a.nodeType!==8||a.nodeValue!==" react-mount-point-unstable "))}function AS(){}function EQ(a,l,f,y,C){if(C){if(typeof y=="function"){var B=y;y=function(){var ce=yp(U);B.call(ce)}}var U=dS(l,y,a,0,null,!1,!1,"",AS);return a._reactRootContainer=U,a[Qs]=U.current,uh(a.nodeType===8?a.parentNode:a),zo(),U}for(;C=a.lastChild;)a.removeChild(C);if(typeof y=="function"){var q=y;y=function(){var ce=yp(J);q.call(ce)}}var J=I1(a,0,!1,null,null,!1,!1,"",AS);return a._reactRootContainer=J,a[Qs]=J.current,uh(a.nodeType===8?a.parentNode:a),zo(function(){vp(l,J,f,y)}),J}function wp(a,l,f,y,C){var B=f._reactRootContainer;if(B){var U=B;if(typeof C=="function"){var q=C;C=function(){var J=yp(U);q.call(J)}}vp(l,U,a,C)}else U=EQ(f,l,a,C,y);return yp(U)}qI=function(a){switch(a.tag){case 3:var l=a.stateNode;if(l.current.memoizedState.isDehydrated){var f=Dn(l.pendingLanes);f!==0&&(Jm(l,f|1),Qn(l,qe()),!(St&6)&&(Mc=qe()+500,Ua()))}break;case 13:zo(function(){var y=Hs(a,1);if(y!==null){var C=_n();zi(y,a,1,C)}}),C1(a,1)}},Zm=function(a){if(a.tag===13){var l=Hs(a,134217728);if(l!==null){var f=_n();zi(l,a,134217728,f)}C1(a,134217728)}},XI=function(a){if(a.tag===13){var l=za(a),f=Hs(a,l);if(f!==null){var y=_n();zi(f,a,l,y)}C1(a,l)}},KI=function(){return Pt},JI=function(a,l){var f=Pt;try{return Pt=a,l()}finally{Pt=f}},_e=function(a,l,f){switch(l){case"input":if(Y(a,f),l=f.name,f.type==="radio"&&l!=null){for(f=a;f.parentNode;)f=f.parentNode;for(f=f.querySelectorAll("input[name="+JSON.stringify(""+l)+'][type="radio"]'),l=0;l<f.length;l++){var y=f[l];if(y!==a&&y.form===a.form){var C=Of(y);if(!C)throw Error(t(90));et(y),Y(y,C)}}}break;case"textarea":Ce(a,f);break;case"select":l=f.value,l!=null&&me(a,!!f.multiple,l,!1)}},Mt=_1,vt=zo;var xQ={usingClientEntryPoint:!1,Events:[fh,pc,Of,Dt,Lt,_1]},Mh={findFiberByHostInstance:Lo,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},wQ={bundleType:Mh.bundleType,version:Mh.version,rendererPackageName:Mh.rendererPackageName,rendererConfig:Mh.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:Mh.findFiberByHostInstance||yQ,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 Ip=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ip.isDisabled&&Ip.supportsFiber)try{jt=Ip.inject(wQ),rt=Ip}catch{}}return Bn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=xQ,Bn.createPortal=function(a,l){var f=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!M1(l))throw Error(t(200));return vQ(a,l,null,f)},Bn.createRoot=function(a,l){if(!M1(a))throw Error(t(299));var f=!1,y="",C=pS;return l!=null&&(l.unstable_strictMode===!0&&(f=!0),l.identifierPrefix!==void 0&&(y=l.identifierPrefix),l.onRecoverableError!==void 0&&(C=l.onRecoverableError)),l=I1(a,1,!1,null,null,f,!1,y,C),a[Qs]=l.current,uh(a.nodeType===8?a.parentNode:a),new S1(l)},Bn.findDOMNode=function(a){if(a==null)return null;if(a.nodeType===1)return a;var l=a._reactInternals;if(l===void 0)throw typeof a.render=="function"?Error(t(188)):(a=Object.keys(a).join(","),Error(t(268,a)));return a=he(l),a=a===null?null:a.stateNode,a},Bn.flushSync=function(a){return zo(a)},Bn.hydrate=function(a,l,f){if(!xp(l))throw Error(t(200));return wp(null,a,l,!0,f)},Bn.hydrateRoot=function(a,l,f){if(!M1(a))throw Error(t(405));var y=f!=null&&f.hydratedSources||null,C=!1,B="",U=pS;if(f!=null&&(f.unstable_strictMode===!0&&(C=!0),f.identifierPrefix!==void 0&&(B=f.identifierPrefix),f.onRecoverableError!==void 0&&(U=f.onRecoverableError)),l=dS(l,null,a,1,f??null,C,!1,B,U),a[Qs]=l.current,uh(a),y)for(a=0;a<y.length;a++)f=y[a],C=f._getVersion,C=C(f._source),l.mutableSourceEagerHydrationData==null?l.mutableSourceEagerHydrationData=[f,C]:l.mutableSourceEagerHydrationData.push(f,C);return new Ep(l)},Bn.render=function(a,l,f){if(!xp(l))throw Error(t(200));return wp(null,a,l,!1,f)},Bn.unmountComponentAtNode=function(a){if(!xp(a))throw Error(t(40));return a._reactRootContainer?(zo(function(){wp(null,null,a,!1,function(){a._reactRootContainer=null,a[Qs]=null})}),!0):!1},Bn.unstable_batchedUpdates=_1,Bn.unstable_renderSubtreeIntoContainer=function(a,l,f,y){if(!xp(f))throw Error(t(200));if(a==null||a._reactInternals===void 0)throw Error(t(38));return wp(a,l,f,!1,y)},Bn.version="18.2.0-next-9e3b772b8-20220608",Bn}function DI(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(DI)}catch(r){console.error(r)}}DI(),TI.exports=Mk();var Tk=TI.exports,LI=Tk;Gm.createRoot=LI.createRoot,Gm.hydrateRoot=LI.hydrateRoot;class Bk{constructor({apiService:e,events:t}){Bt(this,"targetElement");Bt(this,"apiService");Bt(this,"events");Bt(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=Gm.createRoot(document.getElementById(n))}this.targetElement.render(Th.createElement(Ik,{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 Wm={exports:{}},sc=typeof Reflect=="object"?Reflect:null,NI=sc&&typeof sc.apply=="function"?sc.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)},Ef;sc&&typeof sc.ownKeys=="function"?Ef=sc.ownKeys:Object.getOwnPropertySymbols?Ef=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Ef=function(e){return Object.getOwnPropertyNames(e)};function bk(r){console&&console.warn&&console.warn(r)}var UI=Number.isNaN||function(e){return e!==e};function Ft(){Ft.init.call(this)}Wm.exports=Ft,Wm.exports.once=Nk,Ft.EventEmitter=Ft,Ft.prototype._events=void 0,Ft.prototype._eventsCount=0,Ft.prototype._maxListeners=void 0;var PI=10;function xf(r){if(typeof r!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r)}Object.defineProperty(Ft,"defaultMaxListeners",{enumerable:!0,get:function(){return PI},set:function(r){if(typeof r!="number"||r<0||UI(r))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+r+".");PI=r}}),Ft.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},Ft.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||UI(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 kI(r){return r._maxListeners===void 0?Ft.defaultMaxListeners:r._maxListeners}Ft.prototype.getMaxListeners=function(){return kI(this)},Ft.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 c=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw c.context=o,c}var h=s[e];if(h===void 0)return!1;if(typeof h=="function")NI(h,this,t);else for(var u=h.length,d=HI(h,u),n=0;n<u;++n)NI(d[n],this,t);return!0};function QI(r,e,t,n){var i,s,o;if(xf(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=kI(r),i>0&&o.length>i&&!o.warned){o.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=r,c.type=e,c.count=o.length,bk(c)}return r}Ft.prototype.addListener=function(e,t){return QI(this,e,t,!1)},Ft.prototype.on=Ft.prototype.addListener,Ft.prototype.prependListener=function(e,t){return QI(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 FI(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}Ft.prototype.once=function(e,t){return xf(t),this.on(e,FI(this,e,t)),this},Ft.prototype.prependOnceListener=function(e,t){return xf(t),this.prependListener(e,FI(this,e,t)),this},Ft.prototype.removeListener=function(e,t){var n,i,s,o,c;if(xf(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){c=n[o].listener,s=o;break}if(s<0)return this;s===0?n.shift():Dk(n,s),n.length===1&&(i[e]=n[0]),i.removeListener!==void 0&&this.emit("removeListener",e,c||t)}return this},Ft.prototype.off=Ft.prototype.removeListener,Ft.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 OI(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?Lk(i):HI(i,i.length)}Ft.prototype.listeners=function(e){return OI(this,e,!0)},Ft.prototype.rawListeners=function(e){return OI(this,e,!1)},Ft.listenerCount=function(r,e){return typeof r.listenerCount=="function"?r.listenerCount(e):zI.call(r,e)},Ft.prototype.listenerCount=zI;function zI(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}Ft.prototype.eventNames=function(){return this._eventsCount>0?Ef(this._events):[]};function HI(r,e){for(var t=new Array(e),n=0;n<e;++n)t[n]=r[n];return t}function Dk(r,e){for(;e+1<r.length;e++)r[e]=r[e+1];r.pop()}function Lk(r){for(var e=new Array(r.length),t=0;t<e.length;++t)e[t]=r[t].listener||r[t];return e}function Nk(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))}GI(r,e,s,{once:!0}),e!=="error"&&Uk(r,i,{once:!0})})}function Uk(r,e,t){typeof r.on=="function"&&GI(r,"error",e,t)}function GI(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 Pk=Wm.exports;const ju=class ju extends Pk.EventEmitter{emitEvent(e,t){Object.keys(ju.EVENTS).includes(e)&&this.emit(ju.EVENTS[e],t)}};Bt(ju,"EVENTS",{onAddToCart:"add-to-cart"});let Ym=ju;const kk={getCartUrl:((jI=window.Shopify)==null?void 0:jI.routes.root)+"cart.js",addToCartUrl:((WI=window.Shopify)==null?void 0:WI.routes.root)+"cart/add.js"},VI=Object.freeze(kk);class Qk{constructor(e){Bt(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:Fk,error:Ok}=console,zk=(...r)=>{Ok("❌ Sprie Error:",...r)},Hk="&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&",Gk={HOST:cs.host,STORE_PREFIX:cs.storePrefix},Vk={addToCartUrl:VI.addToCartUrl,getCartUrl:VI.getCartUrl};class jk{constructor(){Bt(this,"sdkService");Bt(this,"apiService");Bt(this,"uiService");Bt(this,"events");this.events=new Ym,this.apiService=new _S(new ja(Gk),new Qk(Vk)),this.uiService=new Bk({apiService:this.apiService,events:this.events});const e={apiService:this.apiService,config:cs,log:Fk,logErr:zk,metaData:{appVersion:gS,previewUrlPrams:Hk,targetClassName:"sprie-embed-element"}};this.sdkService=new vS(e),this.sdkService.Init()}load(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()}}window.ditaConfigurator=new jk})();
4490
+ `+B.stack}return{value:a,source:l,stack:C,digest:null}}function Z0(a,l,f){return{value:a,source:null,stack:f??null,digest:l??null}}function $0(a,l){try{console.error(l.value)}catch(f){setTimeout(function(){throw f})}}var $7=typeof WeakMap=="function"?WeakMap:Map;function C3(a,l,f){f=Gs(-1,f),f.tag=3,f.payload={element:null};var y=l.value;return f.callback=function(){hp||(hp=!0,p1=y),$0(a,l)},f}function S3(a,l,f){f=Gs(-1,f),f.tag=3;var y=a.type.getDerivedStateFromError;if(typeof y=="function"){var C=l.value;f.payload=function(){return y(C)},f.callback=function(){$0(a,l)}}var B=a.stateNode;return B!==null&&typeof B.componentDidCatch=="function"&&(f.callback=function(){$0(a,l),typeof y!="function"&&(Fa===null?Fa=new Set([this]):Fa.add(this));var U=l.stack;this.componentDidCatch(l.value,{componentStack:U!==null?U:""})}),f}function M3(a,l,f){var y=a.pingCache;if(y===null){y=a.pingCache=new $7;var C=new Set;y.set(l,C)}else C=y.get(l),C===void 0&&(C=new Set,y.set(l,C));C.has(f)||(C.add(f),a=fQ.bind(null,a,l,f),l.then(a,a))}function T3(a){do{var l;if((l=a.tag===13)&&(l=a.memoizedState,l=l!==null?l.dehydrated!==null:!0),l)return a;a=a.return}while(a!==null);return null}function B3(a,l,f,y,C){return a.mode&1?(a.flags|=65536,a.lanes=C,a):(a===l?a.flags|=65536:(a.flags|=128,f.flags|=131072,f.flags&=-52805,f.tag===1&&(f.alternate===null?f.tag=17:(l=Gs(-1,1),l.tag=2,ka(f,l,1))),f.lanes|=1),a)}var eQ=I.ReactCurrentOwner,Pn=!1;function mn(a,l,f,y){l.child=a===null?r3(l,null,f,y):xc(l,a.child,f,y)}function b3(a,l,f,y,C){f=f.render;var B=l.ref;return Ec(l,C),y=W0(a,l,f,y,B,C),f=Y0(),a!==null&&!Pn?(l.updateQueue=a.updateQueue,l.flags&=-2053,a.lanes&=~C,Vs(a,l,C)):(tr&&f&&M0(l),l.flags|=1,mn(a,l,y,C),l.child)}function R3(a,l,f,y,C){if(a===null){var B=f.type;return typeof B=="function"&&!E1(B)&&B.defaultProps===void 0&&f.compare===null&&f.defaultProps===void 0?(l.tag=15,l.type=B,D3(a,l,B,y,C)):(a=mp(f.type,null,y,l,l.mode,C),a.ref=l.ref,a.return=l,l.child=a)}if(B=a.child,!(a.lanes&C)){var U=B.memoizedProps;if(f=f.compare,f=f!==null?f:oh,f(U,y)&&a.ref===l.ref)return Vs(a,l,C)}return l.flags|=1,a=Ga(B,y),a.ref=l.ref,a.return=l,l.child=a}function D3(a,l,f,y,C){if(a!==null){var B=a.memoizedProps;if(oh(B,y)&&a.ref===l.ref)if(Pn=!1,l.pendingProps=y=B,(a.lanes&C)!==0)a.flags&131072&&(Pn=!0);else return l.lanes=a.lanes,Vs(a,l,C)}return e1(a,l,f,y,C)}function L3(a,l,f){var y=l.pendingProps,C=y.children,B=a!==null?a.memoizedState:null;if(y.mode==="hidden")if(!(l.mode&1))l.memoizedState={baseLanes:0,cachePool:null,transitions:null},Wt(Sc,ti),ti|=f;else{if(!(f&1073741824))return a=B!==null?B.baseLanes|f:f,l.lanes=l.childLanes=1073741824,l.memoizedState={baseLanes:a,cachePool:null,transitions:null},l.updateQueue=null,Wt(Sc,ti),ti|=a,null;l.memoizedState={baseLanes:0,cachePool:null,transitions:null},y=B!==null?B.baseLanes:f,Wt(Sc,ti),ti|=y}else B!==null?(y=B.baseLanes|f,l.memoizedState=null):y=f,Wt(Sc,ti),ti|=y;return mn(a,l,C,f),l.child}function N3(a,l){var f=l.ref;(a===null&&f!==null||a!==null&&a.ref!==f)&&(l.flags|=512,l.flags|=2097152)}function e1(a,l,f,y,C){var B=Un(f)?No:rn.current;return B=gc(l,B),Ec(l,C),f=W0(a,l,f,y,B,C),y=Y0(),a!==null&&!Pn?(l.updateQueue=a.updateQueue,l.flags&=-2053,a.lanes&=~C,Vs(a,l,C)):(tr&&y&&M0(l),l.flags|=1,mn(a,l,f,C),l.child)}function U3(a,l,f,y,C){if(Un(f)){var B=!0;Hf(l)}else B=!1;if(Ec(l,C),l.stateNode===null)ap(a,l),ZC(l,f,y),F0(l,f,y,C),y=!0;else if(a===null){var U=l.stateNode,q=l.memoizedProps;U.props=q;var J=U.context,ce=f.contextType;typeof ce=="object"&&ce!==null?ce=Ai(ce):(ce=Un(f)?No:rn.current,ce=gc(l,ce));var Ie=f.getDerivedStateFromProps,Se=typeof Ie=="function"||typeof U.getSnapshotBeforeUpdate=="function";Se||typeof U.UNSAFE_componentWillReceiveProps!="function"&&typeof U.componentWillReceiveProps!="function"||(q!==y||J!==ce)&&$C(l,U,y,ce),Pa=!1;var we=l.memoizedState;U.state=we,Kf(l,y,U,C),J=l.memoizedState,q!==y||we!==J||Nn.current||Pa?(typeof Ie=="function"&&(Q0(l,f,Ie,y),J=l.memoizedState),(q=Pa||JC(l,f,q,y,we,J,ce))?(Se||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"&&(l.flags|=4194308)):(typeof U.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=y,l.memoizedState=J),U.props=y,U.state=J,U.context=ce,y=q):(typeof U.componentDidMount=="function"&&(l.flags|=4194308),y=!1)}else{U=l.stateNode,YC(a,l),q=l.memoizedProps,ce=l.type===l.elementType?q:Qi(l.type,q),U.props=ce,Se=l.pendingProps,we=U.context,J=f.contextType,typeof J=="object"&&J!==null?J=Ai(J):(J=Un(f)?No:rn.current,J=gc(l,J));var Ue=f.getDerivedStateFromProps;(Ie=typeof Ue=="function"||typeof U.getSnapshotBeforeUpdate=="function")||typeof U.UNSAFE_componentWillReceiveProps!="function"&&typeof U.componentWillReceiveProps!="function"||(q!==Se||we!==J)&&$C(l,U,y,J),Pa=!1,we=l.memoizedState,U.state=we,Kf(l,y,U,C);var He=l.memoizedState;q!==Se||we!==He||Nn.current||Pa?(typeof Ue=="function"&&(Q0(l,f,Ue,y),He=l.memoizedState),(ce=Pa||JC(l,f,ce,y,we,He,J)||!1)?(Ie||typeof U.UNSAFE_componentWillUpdate!="function"&&typeof U.componentWillUpdate!="function"||(typeof U.componentWillUpdate=="function"&&U.componentWillUpdate(y,He,J),typeof U.UNSAFE_componentWillUpdate=="function"&&U.UNSAFE_componentWillUpdate(y,He,J)),typeof U.componentDidUpdate=="function"&&(l.flags|=4),typeof U.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof U.componentDidUpdate!="function"||q===a.memoizedProps&&we===a.memoizedState||(l.flags|=4),typeof U.getSnapshotBeforeUpdate!="function"||q===a.memoizedProps&&we===a.memoizedState||(l.flags|=1024),l.memoizedProps=y,l.memoizedState=He),U.props=y,U.state=He,U.context=J,y=ce):(typeof U.componentDidUpdate!="function"||q===a.memoizedProps&&we===a.memoizedState||(l.flags|=4),typeof U.getSnapshotBeforeUpdate!="function"||q===a.memoizedProps&&we===a.memoizedState||(l.flags|=1024),y=!1)}return t1(a,l,f,y,B,C)}function t1(a,l,f,y,C,B){N3(a,l);var U=(l.flags&128)!==0;if(!y&&!U)return C&&FC(l,f,!1),Vs(a,l,B);y=l.stateNode,eQ.current=l;var q=U&&typeof f.getDerivedStateFromError!="function"?null:y.render();return l.flags|=1,a!==null&&U?(l.child=xc(l,a.child,null,B),l.child=xc(l,null,q,B)):mn(a,l,q,B),l.memoizedState=y.state,C&&FC(l,f,!0),l.child}function P3(a){var l=a.stateNode;l.pendingContext?kC(a,l.pendingContext,l.pendingContext!==l.context):l.context&&kC(a,l.context,!1),O0(a,l.containerInfo)}function k3(a,l,f,y,C){return vc(),R0(C),l.flags|=256,mn(a,l,f,y),l.child}var r1={dehydrated:null,treeContext:null,retryLane:0};function n1(a){return{baseLanes:a,cachePool:null,transitions:null}}function Q3(a,l,f){var y=l.pendingProps,C=ar.current,B=!1,U=(l.flags&128)!==0,q;if((q=U)||(q=a!==null&&a.memoizedState===null?!1:(C&2)!==0),q?(B=!0,l.flags&=-129):(a===null||a.memoizedState!==null)&&(C|=1),Wt(ar,C&1),a===null)return b0(l),a=l.memoizedState,a!==null&&(a=a.dehydrated,a!==null)?(l.mode&1?a.data==="$!"?l.lanes=8:l.lanes=1073741824:l.lanes=1,null):(U=y.children,a=y.fallback,B?(y=l.mode,B=l.child,U={mode:"hidden",children:U},!(y&1)&&B!==null?(B.childLanes=0,B.pendingProps=U):B=_p(U,y,0,null),a=Vo(a,y,f,null),B.return=l,a.return=l,B.sibling=a,l.child=B,l.child.memoizedState=n1(f),l.memoizedState=r1,a):i1(l,U));if(C=a.memoizedState,C!==null&&(q=C.dehydrated,q!==null))return tQ(a,l,U,y,q,C,f);if(B){B=y.fallback,U=l.mode,C=a.child,q=C.sibling;var J={mode:"hidden",children:y.children};return!(U&1)&&l.child!==C?(y=l.child,y.childLanes=0,y.pendingProps=J,l.deletions=null):(y=Ga(C,J),y.subtreeFlags=C.subtreeFlags&14680064),q!==null?B=Ga(q,B):(B=Vo(B,U,f,null),B.flags|=2),B.return=l,y.return=l,y.sibling=B,l.child=y,y=B,B=l.child,U=a.child.memoizedState,U=U===null?n1(f):{baseLanes:U.baseLanes|f,cachePool:null,transitions:U.transitions},B.memoizedState=U,B.childLanes=a.childLanes&~f,l.memoizedState=r1,y}return B=a.child,a=B.sibling,y=Ga(B,{mode:"visible",children:y.children}),!(l.mode&1)&&(y.lanes=f),y.return=l,y.sibling=null,a!==null&&(f=l.deletions,f===null?(l.deletions=[a],l.flags|=16):f.push(a)),l.child=y,l.memoizedState=null,y}function i1(a,l){return l=_p({mode:"visible",children:l},a.mode,0,null),l.return=a,a.child=l}function sp(a,l,f,y){return y!==null&&R0(y),xc(l,a.child,null,f),a=i1(l,l.pendingProps.children),a.flags|=2,l.memoizedState=null,a}function tQ(a,l,f,y,C,B,U){if(f)return l.flags&256?(l.flags&=-257,y=Z0(Error(t(422))),sp(a,l,U,y)):l.memoizedState!==null?(l.child=a.child,l.flags|=128,null):(B=y.fallback,C=l.mode,y=_p({mode:"visible",children:y.children},C,0,null),B=Vo(B,C,U,null),B.flags|=2,y.return=l,B.return=l,y.sibling=B,l.child=y,l.mode&1&&xc(l,a.child,null,U),l.child.memoizedState=n1(U),l.memoizedState=r1,B);if(!(l.mode&1))return sp(a,l,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=Z0(B,y,void 0),sp(a,l,U,y)}if(q=(U&a.childLanes)!==0,Pn||q){if(y=Vr,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),zi(y,a,C,-1))}return y1(),y=Z0(Error(t(421))),sp(a,l,U,y)}return C.data==="$?"?(l.flags|=128,l.child=a.child,l=pQ.bind(null,a),C._reactRetry=l,null):(a=B.treeContext,ei=Da(C.nextSibling),$n=l,tr=!0,ki=null,a!==null&&(fi[pi++]=Os,fi[pi++]=zs,fi[pi++]=Uo,Os=a.id,zs=a.overflow,Uo=l),l=i1(l,y.children),l.flags|=4096,l)}function F3(a,l,f){a.lanes|=l;var y=a.alternate;y!==null&&(y.lanes|=l),U0(a.return,l,f)}function s1(a,l,f,y,C){var B=a.memoizedState;B===null?a.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:y,tail:f,tailMode:C}:(B.isBackwards=l,B.rendering=null,B.renderingStartTime=0,B.last=y,B.tail=f,B.tailMode=C)}function O3(a,l,f){var y=l.pendingProps,C=y.revealOrder,B=y.tail;if(mn(a,l,y.children,f),y=ar.current,y&2)y=y&1|2,l.flags|=128;else{if(a!==null&&a.flags&128)e:for(a=l.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&F3(a,f,l);else if(a.tag===19)F3(a,f,l);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===l)break e;for(;a.sibling===null;){if(a.return===null||a.return===l)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}y&=1}if(Wt(ar,y),!(l.mode&1))l.memoizedState=null;else switch(C){case"forwards":for(f=l.child,C=null;f!==null;)a=f.alternate,a!==null&&$f(a)===null&&(C=f),f=f.sibling;f=C,f===null?(C=l.child,l.child=null):(C=f.sibling,f.sibling=null),s1(l,!1,C,f,B);break;case"backwards":for(f=null,C=l.child,l.child=null;C!==null;){if(a=C.alternate,a!==null&&$f(a)===null){l.child=C;break}a=C.sibling,C.sibling=f,f=C,C=a}s1(l,!0,f,null,B);break;case"together":s1(l,!1,null,null,void 0);break;default:l.memoizedState=null}return l.child}function ap(a,l){!(l.mode&1)&&a!==null&&(a.alternate=null,l.alternate=null,l.flags|=2)}function Vs(a,l,f){if(a!==null&&(l.dependencies=a.dependencies),Oo|=l.lanes,!(f&l.childLanes))return null;if(a!==null&&l.child!==a.child)throw Error(t(153));if(l.child!==null){for(a=l.child,f=Ga(a,a.pendingProps),l.child=f,f.return=l;a.sibling!==null;)a=a.sibling,f=f.sibling=Ga(a,a.pendingProps),f.return=l;f.sibling=null}return l.child}function rQ(a,l,f){switch(l.tag){case 3:P3(l),vc();break;case 5:n3(l);break;case 1:Un(l.type)&&Hf(l);break;case 4:O0(l,l.stateNode.containerInfo);break;case 10:var y=l.type._context,C=l.memoizedProps.value;Wt(Yf,y._currentValue),y._currentValue=C;break;case 13:if(y=l.memoizedState,y!==null)return y.dehydrated!==null?(Wt(ar,ar.current&1),l.flags|=128,null):f&l.child.childLanes?Q3(a,l,f):(Wt(ar,ar.current&1),a=Vs(a,l,f),a!==null?a.sibling:null);Wt(ar,ar.current&1);break;case 19:if(y=(f&l.childLanes)!==0,a.flags&128){if(y)return O3(a,l,f);l.flags|=128}if(C=l.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 l.lanes=0,L3(a,l,f)}return Vs(a,l,f)}var z3,a1,H3,G3;z3=function(a,l){for(var f=l.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===l)break;for(;f.sibling===null;){if(f.return===null||f.return===l)return;f=f.return}f.sibling.return=f.return,f=f.sibling}},a1=function(){},H3=function(a,l,f,y){var C=a.memoizedProps;if(C!==y){a=l.stateNode,Qo(ss.current);var B=null;switch(f){case"input":C=dt(a,C),y=dt(a,y),B=[];break;case"select":C=Q({},C,{value:void 0}),y=Q({},y,{value:void 0}),B=[];break;case"textarea":C=Ee(a,C),y=Ee(a,y),B=[];break;default:typeof C.onClick!="function"&&typeof y.onClick=="function"&&(a.onclick=Ff)}tt(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;(l.updateQueue=ce)&&(l.flags|=4)}},G3=function(a,l,f,y){f!==y&&(l.flags|=4)};function xh(a,l){if(!tr)switch(a.tailMode){case"hidden":l=a.tail;for(var f=null;l!==null;)l.alternate!==null&&(f=l),l=l.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?l||a.tail===null?a.tail=null:a.tail.sibling=null:y.sibling=null}}function sn(a){var l=a.alternate!==null&&a.alternate.child===a.child,f=0,y=0;if(l)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,l}function nQ(a,l,f){var y=l.pendingProps;switch(T0(l),l.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return sn(l),null;case 1:return Un(l.type)&&zf(),sn(l),null;case 3:return y=l.stateNode,wc(),Kt(Nn),Kt(rn),G0(),y.pendingContext&&(y.context=y.pendingContext,y.pendingContext=null),(a===null||a.child===null)&&(Wf(l)?l.flags|=4:a===null||a.memoizedState.isDehydrated&&!(l.flags&256)||(l.flags|=1024,ki!==null&&(m1(ki),ki=null))),a1(a,l),sn(l),null;case 5:z0(l);var C=Qo(mh.current);if(f=l.type,a!==null&&l.stateNode!=null)H3(a,l,f,y,C),a.ref!==l.ref&&(l.flags|=512,l.flags|=2097152);else{if(!y){if(l.stateNode===null)throw Error(t(166));return sn(l),null}if(a=Qo(ss.current),Wf(l)){y=l.stateNode,f=l.type;var B=l.memoizedProps;switch(y[is]=l,y[dh]=B,a=(l.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<ch.length;C++)Xt(ch[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":Xe(y,B),Xt("invalid",y);break;case"select":y._wrapperState={wasMultiple:!!B.multiple},Xt("invalid",y);break;case"textarea":Oe(y,B),Xt("invalid",y)}tt(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&&Qf(y.textContent,q,a),C=["children",q]):typeof q=="number"&&y.textContent!==""+q&&(B.suppressHydrationWarning!==!0&&Qf(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),Qe(y);break;case"select":case"option":break;default:typeof B.onClick=="function"&&(y.onclick=Ff)}y=C,l.updateQueue=y,y!==null&&(l.flags|=4)}else{U=C.nodeType===9?C:C.ownerDocument,a==="http://www.w3.org/1999/xhtml"&&(a=ve(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[is]=l,a[dh]=y,z3(a,l,!1,!1),l.stateNode=a;e:{switch(U=V(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<ch.length;C++)Xt(ch[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":Xe(a,y),C=dt(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":Oe(a,y),C=Ee(a,y),Xt("invalid",a);break;default:C=y}tt(f,C),q=C;for(B in q)if(q.hasOwnProperty(B)){var J=q[B];B==="style"?ct(a,J):B==="dangerouslySetInnerHTML"?(J=J?J.__html:void 0,J!=null&&We(a,J)):B==="children"?typeof J=="string"?(f!=="textarea"||J!=="")&&Le(a,J):typeof J=="number"&&Le(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),Qe(a);break;case"option":y.value!=null&&a.setAttribute("value",""+ye(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=Ff)}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&&(l.flags|=4)}l.ref!==null&&(l.flags|=512,l.flags|=2097152)}return sn(l),null;case 6:if(a&&l.stateNode!=null)G3(a,l,a.memoizedProps,y);else{if(typeof y!="string"&&l.stateNode===null)throw Error(t(166));if(f=Qo(mh.current),Qo(ss.current),Wf(l)){if(y=l.stateNode,f=l.memoizedProps,y[is]=l,(B=y.nodeValue!==f)&&(a=$n,a!==null))switch(a.tag){case 3:Qf(y.nodeValue,f,(a.mode&1)!==0);break;case 5:a.memoizedProps.suppressHydrationWarning!==!0&&Qf(y.nodeValue,f,(a.mode&1)!==0)}B&&(l.flags|=4)}else y=(f.nodeType===9?f:f.ownerDocument).createTextNode(y),y[is]=l,l.stateNode=y}return sn(l),null;case 13:if(Kt(ar),y=l.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(tr&&ei!==null&&l.mode&1&&!(l.flags&128))jC(),vc(),l.flags|=98560,B=!1;else if(B=Wf(l),y!==null&&y.dehydrated!==null){if(a===null){if(!B)throw Error(t(318));if(B=l.memoizedState,B=B!==null?B.dehydrated:null,!B)throw Error(t(317));B[is]=l}else vc(),!(l.flags&128)&&(l.memoizedState=null),l.flags|=4;sn(l),B=!1}else ki!==null&&(m1(ki),ki=null),B=!0;if(!B)return l.flags&65536?l:null}return l.flags&128?(l.lanes=f,l):(y=y!==null,y!==(a!==null&&a.memoizedState!==null)&&y&&(l.child.flags|=8192,l.mode&1&&(a===null||ar.current&1?Nr===0&&(Nr=3):y1())),l.updateQueue!==null&&(l.flags|=4),sn(l),null);case 4:return wc(),a1(a,l),a===null&&uh(l.stateNode.containerInfo),sn(l),null;case 10:return N0(l.type._context),sn(l),null;case 17:return Un(l.type)&&zf(),sn(l),null;case 19:if(Kt(ar),B=l.memoizedState,B===null)return sn(l),null;if(y=(l.flags&128)!==0,U=B.rendering,U===null)if(y)xh(B,!1);else{if(Nr!==0||a!==null&&a.flags&128)for(a=l.child;a!==null;){if(U=$f(a),U!==null){for(l.flags|=128,xh(B,!1),y=U.updateQueue,y!==null&&(l.updateQueue=y,l.flags|=4),l.subtreeFlags=0,y=f,f=l.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),l.child}a=a.sibling}B.tail!==null&&qe()>Mc&&(l.flags|=128,y=!0,xh(B,!1),l.lanes=4194304)}else{if(!y)if(a=$f(U),a!==null){if(l.flags|=128,y=!0,f=a.updateQueue,f!==null&&(l.updateQueue=f,l.flags|=4),xh(B,!0),B.tail===null&&B.tailMode==="hidden"&&!U.alternate&&!tr)return sn(l),null}else 2*qe()-B.renderingStartTime>Mc&&f!==1073741824&&(l.flags|=128,y=!0,xh(B,!1),l.lanes=4194304);B.isBackwards?(U.sibling=l.child,l.child=U):(f=B.last,f!==null?f.sibling=U:l.child=U,B.last=U)}return B.tail!==null?(l=B.tail,B.rendering=l,B.tail=l.sibling,B.renderingStartTime=qe(),l.sibling=null,f=ar.current,Wt(ar,y?f&1|2:f&1),l):(sn(l),null);case 22:case 23:return v1(),y=l.memoizedState!==null,a!==null&&a.memoizedState!==null!==y&&(l.flags|=8192),y&&l.mode&1?ti&1073741824&&(sn(l),l.subtreeFlags&6&&(l.flags|=8192)):sn(l),null;case 24:return null;case 25:return null}throw Error(t(156,l.tag))}function iQ(a,l){switch(T0(l),l.tag){case 1:return Un(l.type)&&zf(),a=l.flags,a&65536?(l.flags=a&-65537|128,l):null;case 3:return wc(),Kt(Nn),Kt(rn),G0(),a=l.flags,a&65536&&!(a&128)?(l.flags=a&-65537|128,l):null;case 5:return z0(l),null;case 13:if(Kt(ar),a=l.memoizedState,a!==null&&a.dehydrated!==null){if(l.alternate===null)throw Error(t(340));vc()}return a=l.flags,a&65536?(l.flags=a&-65537|128,l):null;case 19:return Kt(ar),null;case 4:return wc(),null;case 10:return N0(l.type._context),null;case 22:case 23:return v1(),null;case 24:return null;default:return null}}var op=!1,an=!1,sQ=typeof WeakSet=="function"?WeakSet:Set,Fe=null;function Cc(a,l){var f=a.ref;if(f!==null)if(typeof f=="function")try{f(null)}catch(y){dr(a,l,y)}else f.current=null}function o1(a,l,f){try{f()}catch(y){dr(a,l,y)}}var V3=!1;function aQ(a,l){if(v0=Mf,a=EC(),h0(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,Ie=0,Se=a,we=null;t:for(;;){for(var Ue;Se!==f||C!==0&&Se.nodeType!==3||(q=U+C),Se!==B||y!==0&&Se.nodeType!==3||(J=U+y),Se.nodeType===3&&(U+=Se.nodeValue.length),(Ue=Se.firstChild)!==null;)we=Se,Se=Ue;for(;;){if(Se===a)break t;if(we===f&&++ce===C&&(q=U),we===B&&++Ie===y&&(J=U),(Ue=Se.nextSibling)!==null)break;Se=we,we=Se.parentNode}Se=Ue}f=q===-1||J===-1?null:{start:q,end:J}}else f=null}f=f||{start:0,end:0}}else f=null;for(y0={focusedElem:a,selectionRange:f},Mf=!1,Fe=l;Fe!==null;)if(l=Fe,a=l.child,(l.subtreeFlags&1028)!==0&&a!==null)a.return=l,Fe=a;else for(;Fe!==null;){l=Fe;try{var He=l.alternate;if(l.flags&1024)switch(l.tag){case 0:case 11:case 15:break;case 1:if(He!==null){var Ve=He.memoizedProps,yr=He.memoizedState,ie=l.stateNode,$=ie.getSnapshotBeforeUpdate(l.elementType===l.type?Ve:Qi(l.type,Ve),yr);ie.__reactInternalSnapshotBeforeUpdate=$}break;case 3:var ae=l.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){dr(l,l.return,Te)}if(a=l.sibling,a!==null){a.return=l.return,Fe=a;break}Fe=l.return}return He=V3,V3=!1,He}function wh(a,l,f){var y=l.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&&o1(l,f,B)}C=C.next}while(C!==y)}}function lp(a,l){if(l=l.updateQueue,l=l!==null?l.lastEffect:null,l!==null){var f=l=l.next;do{if((f.tag&a)===a){var y=f.create;f.destroy=y()}f=f.next}while(f!==l)}}function l1(a){var l=a.ref;if(l!==null){var f=a.stateNode;switch(a.tag){case 5:a=f;break;default:a=f}typeof l=="function"?l(a):l.current=a}}function j3(a){var l=a.alternate;l!==null&&(a.alternate=null,j3(l)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(l=a.stateNode,l!==null&&(delete l[is],delete l[dh],delete l[I0],delete l[H7],delete l[G7])),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 W3(a){return a.tag===5||a.tag===3||a.tag===4}function Y3(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||W3(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 c1(a,l,f){var y=a.tag;if(y===5||y===6)a=a.stateNode,l?f.nodeType===8?f.parentNode.insertBefore(a,l):f.insertBefore(a,l):(f.nodeType===8?(l=f.parentNode,l.insertBefore(a,f)):(l=f,l.appendChild(a)),f=f._reactRootContainer,f!=null||l.onclick!==null||(l.onclick=Ff));else if(y!==4&&(a=a.child,a!==null))for(c1(a,l,f),a=a.sibling;a!==null;)c1(a,l,f),a=a.sibling}function u1(a,l,f){var y=a.tag;if(y===5||y===6)a=a.stateNode,l?f.insertBefore(a,l):f.appendChild(a);else if(y!==4&&(a=a.child,a!==null))for(u1(a,l,f),a=a.sibling;a!==null;)u1(a,l,f),a=a.sibling}var qr=null,Fi=!1;function Qa(a,l,f){for(f=f.child;f!==null;)q3(a,l,f),f=f.sibling}function q3(a,l,f){if(rt&&typeof rt.onCommitFiberUnmount=="function")try{rt.onCommitFiberUnmount(jt,f)}catch{}switch(f.tag){case 5:an||Cc(f,l);case 6:var y=qr,C=Fi;qr=null,Qa(a,l,f),qr=y,Fi=C,qr!==null&&(Fi?(a=qr,f=f.stateNode,a.nodeType===8?a.parentNode.removeChild(f):a.removeChild(f)):qr.removeChild(f.stateNode));break;case 18:qr!==null&&(Fi?(a=qr,f=f.stateNode,a.nodeType===8?w0(a.parentNode,f):a.nodeType===1&&w0(a,f),th(a)):w0(qr,f.stateNode));break;case 4:y=qr,C=Fi,qr=f.stateNode.containerInfo,Fi=!0,Qa(a,l,f),qr=y,Fi=C;break;case 0:case 11:case 14:case 15:if(!an&&(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)&&o1(f,l,U),C=C.next}while(C!==y)}Qa(a,l,f);break;case 1:if(!an&&(Cc(f,l),y=f.stateNode,typeof y.componentWillUnmount=="function"))try{y.props=f.memoizedProps,y.state=f.memoizedState,y.componentWillUnmount()}catch(q){dr(f,l,q)}Qa(a,l,f);break;case 21:Qa(a,l,f);break;case 22:f.mode&1?(an=(y=an)||f.memoizedState!==null,Qa(a,l,f),an=y):Qa(a,l,f);break;default:Qa(a,l,f)}}function X3(a){var l=a.updateQueue;if(l!==null){a.updateQueue=null;var f=a.stateNode;f===null&&(f=a.stateNode=new sQ),l.forEach(function(y){var C=AQ.bind(null,a,y);f.has(y)||(f.add(y),y.then(C,C))})}}function Oi(a,l){var f=l.deletions;if(f!==null)for(var y=0;y<f.length;y++){var C=f[y];try{var B=a,U=l,q=U;e:for(;q!==null;){switch(q.tag){case 5:qr=q.stateNode,Fi=!1;break e;case 3:qr=q.stateNode.containerInfo,Fi=!0;break e;case 4:qr=q.stateNode.containerInfo,Fi=!0;break e}q=q.return}if(qr===null)throw Error(t(160));q3(B,U,C),qr=null,Fi=!1;var J=C.alternate;J!==null&&(J.return=null),C.return=null}catch(ce){dr(C,l,ce)}}if(l.subtreeFlags&12854)for(l=l.child;l!==null;)K3(l,a),l=l.sibling}function K3(a,l){var f=a.alternate,y=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:if(Oi(l,a),os(a),y&4){try{wh(3,a,a.return),lp(3,a)}catch(Ve){dr(a,a.return,Ve)}try{wh(5,a,a.return)}catch(Ve){dr(a,a.return,Ve)}}break;case 1:Oi(l,a),os(a),y&512&&f!==null&&Cc(f,f.return);break;case 5:if(Oi(l,a),os(a),y&512&&f!==null&&Cc(f,f.return),a.flags&32){var C=a.stateNode;try{Le(C,"")}catch(Ve){dr(a,a.return,Ve)}}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&&ft(C,B),V(q,U);var ce=V(q,B);for(U=0;U<J.length;U+=2){var Ie=J[U],Se=J[U+1];Ie==="style"?ct(C,Se):Ie==="dangerouslySetInnerHTML"?We(C,Se):Ie==="children"?Le(C,Se):x(C,Ie,Se,ce)}switch(q){case"input":Y(C,B);break;case"textarea":Ce(C,B);break;case"select":var we=C._wrapperState.wasMultiple;C._wrapperState.wasMultiple=!!B.multiple;var Ue=B.value;Ue!=null?me(C,!!B.multiple,Ue,!1):we!==!!B.multiple&&(B.defaultValue!=null?me(C,!!B.multiple,B.defaultValue,!0):me(C,!!B.multiple,B.multiple?[]:"",!1))}C[dh]=B}catch(Ve){dr(a,a.return,Ve)}}break;case 6:if(Oi(l,a),os(a),y&4){if(a.stateNode===null)throw Error(t(162));C=a.stateNode,B=a.memoizedProps;try{C.nodeValue=B}catch(Ve){dr(a,a.return,Ve)}}break;case 3:if(Oi(l,a),os(a),y&4&&f!==null&&f.memoizedState.isDehydrated)try{th(l.containerInfo)}catch(Ve){dr(a,a.return,Ve)}break;case 4:Oi(l,a),os(a);break;case 13:Oi(l,a),os(a),C=a.child,C.flags&8192&&(B=C.memoizedState!==null,C.stateNode.isHidden=B,!B||C.alternate!==null&&C.alternate.memoizedState!==null||(f1=qe())),y&4&&X3(a);break;case 22:if(Ie=f!==null&&f.memoizedState!==null,a.mode&1?(an=(ce=an)||Ie,Oi(l,a),an=ce):Oi(l,a),os(a),y&8192){if(ce=a.memoizedState!==null,(a.stateNode.isHidden=ce)&&!Ie&&a.mode&1)for(Fe=a,Ie=a.child;Ie!==null;){for(Se=Fe=Ie;Fe!==null;){switch(we=Fe,Ue=we.child,we.tag){case 0:case 11:case 14:case 15:wh(4,we,we.return);break;case 1:Cc(we,we.return);var He=we.stateNode;if(typeof He.componentWillUnmount=="function"){y=we,f=we.return;try{l=y,He.props=l.memoizedProps,He.state=l.memoizedState,He.componentWillUnmount()}catch(Ve){dr(y,f,Ve)}}break;case 5:Cc(we,we.return);break;case 22:if(we.memoizedState!==null){$3(Se);continue}}Ue!==null?(Ue.return=we,Fe=Ue):$3(Se)}Ie=Ie.sibling}e:for(Ie=null,Se=a;;){if(Se.tag===5){if(Ie===null){Ie=Se;try{C=Se.stateNode,ce?(B=C.style,typeof B.setProperty=="function"?B.setProperty("display","none","important"):B.display="none"):(q=Se.stateNode,J=Se.memoizedProps.style,U=J!=null&&J.hasOwnProperty("display")?J.display:null,q.style.display=pt("display",U))}catch(Ve){dr(a,a.return,Ve)}}}else if(Se.tag===6){if(Ie===null)try{Se.stateNode.nodeValue=ce?"":Se.memoizedProps}catch(Ve){dr(a,a.return,Ve)}}else if((Se.tag!==22&&Se.tag!==23||Se.memoizedState===null||Se===a)&&Se.child!==null){Se.child.return=Se,Se=Se.child;continue}if(Se===a)break e;for(;Se.sibling===null;){if(Se.return===null||Se.return===a)break e;Ie===Se&&(Ie=null),Se=Se.return}Ie===Se&&(Ie=null),Se.sibling.return=Se.return,Se=Se.sibling}}break;case 19:Oi(l,a),os(a),y&4&&X3(a);break;case 21:break;default:Oi(l,a),os(a)}}function os(a){var l=a.flags;if(l&2){try{e:{for(var f=a.return;f!==null;){if(W3(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&&(Le(C,""),y.flags&=-33);var B=Y3(a);u1(a,B,C);break;case 3:case 4:var U=y.stateNode.containerInfo,q=Y3(a);c1(a,q,U);break;default:throw Error(t(161))}}catch(J){dr(a,a.return,J)}a.flags&=-3}l&4096&&(a.flags&=-4097)}function oQ(a,l,f){Fe=a,J3(a)}function J3(a,l,f){for(var y=(a.mode&1)!==0;Fe!==null;){var C=Fe,B=C.child;if(C.tag===22&&y){var U=C.memoizedState!==null||op;if(!U){var q=C.alternate,J=q!==null&&q.memoizedState!==null||an;q=op;var ce=an;if(op=U,(an=J)&&!ce)for(Fe=C;Fe!==null;)U=Fe,J=U.child,U.tag===22&&U.memoizedState!==null?eS(C):J!==null?(J.return=U,Fe=J):eS(C);for(;B!==null;)Fe=B,J3(B),B=B.sibling;Fe=C,op=q,an=ce}Z3(a)}else C.subtreeFlags&8772&&B!==null?(B.return=C,Fe=B):Z3(a)}}function Z3(a){for(;Fe!==null;){var l=Fe;if(l.flags&8772){var f=l.alternate;try{if(l.flags&8772)switch(l.tag){case 0:case 11:case 15:an||lp(5,l);break;case 1:var y=l.stateNode;if(l.flags&4&&!an)if(f===null)y.componentDidMount();else{var C=l.elementType===l.type?f.memoizedProps:Qi(l.type,f.memoizedProps);y.componentDidUpdate(C,f.memoizedState,y.__reactInternalSnapshotBeforeUpdate)}var B=l.updateQueue;B!==null&&XC(l,B,y);break;case 3:var U=l.updateQueue;if(U!==null){if(f=null,l.child!==null)switch(l.child.tag){case 5:f=l.child.stateNode;break;case 1:f=l.child.stateNode}XC(l,U,f)}break;case 5:var q=l.stateNode;if(f===null&&l.flags&4){f=q;var J=l.memoizedProps;switch(l.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(l.memoizedState===null){var ce=l.alternate;if(ce!==null){var Ie=ce.memoizedState;if(Ie!==null){var Se=Ie.dehydrated;Se!==null&&th(Se)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(t(163))}an||l.flags&512&&l1(l)}catch(we){dr(l,l.return,we)}}if(l===a){Fe=null;break}if(f=l.sibling,f!==null){f.return=l.return,Fe=f;break}Fe=l.return}}function $3(a){for(;Fe!==null;){var l=Fe;if(l===a){Fe=null;break}var f=l.sibling;if(f!==null){f.return=l.return,Fe=f;break}Fe=l.return}}function eS(a){for(;Fe!==null;){var l=Fe;try{switch(l.tag){case 0:case 11:case 15:var f=l.return;try{lp(4,l)}catch(J){dr(l,f,J)}break;case 1:var y=l.stateNode;if(typeof y.componentDidMount=="function"){var C=l.return;try{y.componentDidMount()}catch(J){dr(l,C,J)}}var B=l.return;try{l1(l)}catch(J){dr(l,B,J)}break;case 5:var U=l.return;try{l1(l)}catch(J){dr(l,U,J)}}}catch(J){dr(l,l.return,J)}if(l===a){Fe=null;break}var q=l.sibling;if(q!==null){q.return=l.return,Fe=q;break}Fe=l.return}}var lQ=Math.ceil,cp=I.ReactCurrentDispatcher,h1=I.ReactCurrentOwner,mi=I.ReactCurrentBatchConfig,St=0,Vr=null,Cr=null,Xr=0,ti=0,Sc=La(0),Nr=0,Ih=null,Oo=0,up=0,d1=0,Ch=null,kn=null,f1=0,Mc=1/0,js=null,hp=!1,p1=null,Fa=null,dp=!1,Oa=null,fp=0,Sh=0,A1=null,pp=-1,Ap=0;function _n(){return St&6?qe():pp!==-1?pp:pp=qe()}function za(a){return a.mode&1?St&2&&Xr!==0?Xr&-Xr:j7.transition!==null?(Ap===0&&(Ap=Xu()),Ap):(a=Pt,a!==0||(a=window.event,a=a===void 0?16:tC(a.type)),a):1}function zi(a,l,f,y){if(50<Sh)throw Sh=0,A1=null,Error(t(185));Ku(a,f,y),(!(St&2)||a!==Vr)&&(a===Vr&&(!(St&2)&&(up|=f),Nr===4&&Ha(a,Xr)),Qn(a,y),f===1&&St===0&&!(l.mode&1)&&(Mc=qe()+500,Gf&&Ua()))}function Qn(a,l){var f=a.callbackNode;Yu(a,l);var y=Ca(a,a===Vr?Xr:0);if(y===0)f!==null&&Je(f),a.callbackNode=null,a.callbackPriority=0;else if(l=y&-y,a.callbackPriority!==l){if(f!=null&&Je(f),l===1)a.tag===0?V7(rS.bind(null,a)):OC(rS.bind(null,a)),O7(function(){!(St&6)&&Ua()}),f=null;else{switch(YI(y)){case 1:f=ht;break;case 4:f=Dr;break;case 16:f=er;break;case 536870912:f=di;break;default:f=er}f=uS(f,tS.bind(null,a))}a.callbackPriority=l,a.callbackNode=f}}function tS(a,l){if(pp=-1,Ap=0,St&6)throw Error(t(327));var f=a.callbackNode;if(Tc()&&a.callbackNode!==f)return null;var y=Ca(a,a===Vr?Xr:0);if(y===0)return null;if(y&30||y&a.expiredLanes||l)l=gp(a,y);else{l=y;var C=St;St|=2;var B=iS();(Vr!==a||Xr!==l)&&(js=null,Mc=qe()+500,Ho(a,l));do try{hQ();break}catch(q){nS(a,q)}while(1);L0(),cp.current=B,St=C,Cr!==null?l=0:(Vr=null,Xr=0,l=Nr)}if(l!==0){if(l===2&&(C=qu(a),C!==0&&(y=C,l=g1(a,C))),l===1)throw f=Ih,Ho(a,0),Ha(a,y),Qn(a,qe()),f;if(l===6)Ha(a,y);else{if(C=a.current.alternate,!(y&30)&&!cQ(C)&&(l=gp(a,y),l===2&&(B=qu(a),B!==0&&(y=B,l=g1(a,B))),l===1))throw f=Ih,Ho(a,0),Ha(a,y),Qn(a,qe()),f;switch(a.finishedWork=C,a.finishedLanes=y,l){case 0:case 1:throw Error(t(345));case 2:Go(a,kn,js);break;case 3:if(Ha(a,y),(y&130023424)===y&&(l=f1+500-qe(),10<l)){if(Ca(a,0)!==0)break;if(C=a.suspendedLanes,(C&y)!==y){_n(),a.pingedLanes|=a.suspendedLanes&C;break}a.timeoutHandle=x0(Go.bind(null,a,kn,js),l);break}Go(a,kn,js);break;case 4:if(Ha(a,y),(y&4194240)===y)break;for(l=a.eventTimes,C=-1;0<y;){var U=31-gn(y);B=1<<U,U=l[U],U>C&&(C=U),y&=~B}if(y=C,y=qe()-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=x0(Go.bind(null,a,kn,js),y);break}Go(a,kn,js);break;case 5:Go(a,kn,js);break;default:throw Error(t(329))}}}return Qn(a,qe()),a.callbackNode===f?tS.bind(null,a):null}function g1(a,l){var f=Ch;return a.current.memoizedState.isDehydrated&&(Ho(a,l).flags|=256),a=gp(a,l),a!==2&&(l=kn,kn=f,l!==null&&m1(l)),a}function m1(a){kn===null?kn=a:kn.push.apply(kn,a)}function cQ(a){for(var l=a;;){if(l.flags&16384){var f=l.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(!Pi(B(),C))return!1}catch{return!1}}}if(f=l.child,l.subtreeFlags&16384&&f!==null)f.return=l,l=f;else{if(l===a)break;for(;l.sibling===null;){if(l.return===null||l.return===a)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function Ha(a,l){for(l&=~d1,l&=~up,a.suspendedLanes|=l,a.pingedLanes&=~l,a=a.expirationTimes;0<l;){var f=31-gn(l),y=1<<f;a[f]=-1,l&=~y}}function rS(a){if(St&6)throw Error(t(327));Tc();var l=Ca(a,0);if(!(l&1))return Qn(a,qe()),null;var f=gp(a,l);if(a.tag!==0&&f===2){var y=qu(a);y!==0&&(l=y,f=g1(a,y))}if(f===1)throw f=Ih,Ho(a,0),Ha(a,l),Qn(a,qe()),f;if(f===6)throw Error(t(345));return a.finishedWork=a.current.alternate,a.finishedLanes=l,Go(a,kn,js),Qn(a,qe()),null}function _1(a,l){var f=St;St|=1;try{return a(l)}finally{St=f,St===0&&(Mc=qe()+500,Gf&&Ua())}}function zo(a){Oa!==null&&Oa.tag===0&&!(St&6)&&Tc();var l=St;St|=1;var f=mi.transition,y=Pt;try{if(mi.transition=null,Pt=1,a)return a()}finally{Pt=y,mi.transition=f,St=l,!(St&6)&&Ua()}}function v1(){ti=Sc.current,Kt(Sc)}function Ho(a,l){a.finishedWork=null,a.finishedLanes=0;var f=a.timeoutHandle;if(f!==-1&&(a.timeoutHandle=-1,F7(f)),Cr!==null)for(f=Cr.return;f!==null;){var y=f;switch(T0(y),y.tag){case 1:y=y.type.childContextTypes,y!=null&&zf();break;case 3:wc(),Kt(Nn),Kt(rn),G0();break;case 5:z0(y);break;case 4:wc();break;case 13:Kt(ar);break;case 19:Kt(ar);break;case 10:N0(y.type._context);break;case 22:case 23:v1()}f=f.return}if(Vr=a,Cr=a=Ga(a.current,null),Xr=ti=l,Nr=0,Ih=null,d1=up=Oo=0,kn=Ch=null,ko!==null){for(l=0;l<ko.length;l++)if(f=ko[l],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}ko=null}return a}function nS(a,l){do{var f=Cr;try{if(L0(),ep.current=ip,tp){for(var y=or.memoizedState;y!==null;){var C=y.queue;C!==null&&(C.pending=null),y=y.next}tp=!1}if(Fo=0,Gr=Lr=or=null,_h=!1,vh=0,h1.current=null,f===null||f.return===null){Nr=1,Ih=l,Cr=null;break}e:{var B=a,U=f.return,q=f,J=l;if(l=Xr,q.flags|=32768,J!==null&&typeof J=="object"&&typeof J.then=="function"){var ce=J,Ie=q,Se=Ie.tag;if(!(Ie.mode&1)&&(Se===0||Se===11||Se===15)){var we=Ie.alternate;we?(Ie.updateQueue=we.updateQueue,Ie.memoizedState=we.memoizedState,Ie.lanes=we.lanes):(Ie.updateQueue=null,Ie.memoizedState=null)}var Ue=T3(U);if(Ue!==null){Ue.flags&=-257,B3(Ue,U,q,B,l),Ue.mode&1&&M3(B,ce,l),l=Ue,J=ce;var He=l.updateQueue;if(He===null){var Ve=new Set;Ve.add(J),l.updateQueue=Ve}else He.add(J);break e}else{if(!(l&1)){M3(B,ce,l),y1();break e}J=Error(t(426))}}else if(tr&&q.mode&1){var yr=T3(U);if(yr!==null){!(yr.flags&65536)&&(yr.flags|=256),B3(yr,U,q,B,l),R0(Ic(J,q));break e}}B=J=Ic(J,q),Nr!==4&&(Nr=2),Ch===null?Ch=[B]:Ch.push(B),B=U;do{switch(B.tag){case 3:B.flags|=65536,l&=-l,B.lanes|=l;var ie=C3(B,J,l);qC(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,l&=-l,B.lanes|=l;var Te=S3(B,q,l);qC(B,Te);break e}}B=B.return}while(B!==null)}aS(f)}catch(je){l=je,Cr===f&&f!==null&&(Cr=f=f.return);continue}break}while(1)}function iS(){var a=cp.current;return cp.current=ip,a===null?ip:a}function y1(){(Nr===0||Nr===3||Nr===2)&&(Nr=4),Vr===null||!(Oo&268435455)&&!(up&268435455)||Ha(Vr,Xr)}function gp(a,l){var f=St;St|=2;var y=iS();(Vr!==a||Xr!==l)&&(js=null,Ho(a,l));do try{uQ();break}catch(C){nS(a,C)}while(1);if(L0(),St=f,cp.current=y,Cr!==null)throw Error(t(261));return Vr=null,Xr=0,Nr}function uQ(){for(;Cr!==null;)sS(Cr)}function hQ(){for(;Cr!==null&&!it();)sS(Cr)}function sS(a){var l=cS(a.alternate,a,ti);a.memoizedProps=a.pendingProps,l===null?aS(a):Cr=l,h1.current=null}function aS(a){var l=a;do{var f=l.alternate;if(a=l.return,l.flags&32768){if(f=iQ(f,l),f!==null){f.flags&=32767,Cr=f;return}if(a!==null)a.flags|=32768,a.subtreeFlags=0,a.deletions=null;else{Nr=6,Cr=null;return}}else if(f=nQ(f,l,ti),f!==null){Cr=f;return}if(l=l.sibling,l!==null){Cr=l;return}Cr=l=a}while(l!==null);Nr===0&&(Nr=5)}function Go(a,l,f){var y=Pt,C=mi.transition;try{mi.transition=null,Pt=1,dQ(a,l,f,y)}finally{mi.transition=C,Pt=y}return null}function dQ(a,l,f,y){do Tc();while(Oa!==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(Wk(a,B),a===Vr&&(Cr=Vr=null,Xr=0),!(f.subtreeFlags&2064)&&!(f.flags&2064)||dp||(dp=!0,uS(er,function(){return Tc(),null})),B=(f.flags&15990)!==0,f.subtreeFlags&15990||B){B=mi.transition,mi.transition=null;var U=Pt;Pt=1;var q=St;St|=4,h1.current=null,aQ(a,f),K3(f,a),D7(y0),Mf=!!v0,y0=v0=null,a.current=f,oQ(f),ot(),St=q,Pt=U,mi.transition=B}else a.current=f;if(dp&&(dp=!1,Oa=a,fp=C),B=a.pendingLanes,B===0&&(Fa=null),Wu(f.stateNode),Qn(a,qe()),l!==null)for(y=a.onRecoverableError,f=0;f<l.length;f++)C=l[f],y(C.value,{componentStack:C.stack,digest:C.digest});if(hp)throw hp=!1,a=p1,p1=null,a;return fp&1&&a.tag!==0&&Tc(),B=a.pendingLanes,B&1?a===A1?Sh++:(Sh=0,A1=a):Sh=0,Ua(),null}function Tc(){if(Oa!==null){var a=YI(fp),l=mi.transition,f=Pt;try{if(mi.transition=null,Pt=16>a?16:a,Oa===null)var y=!1;else{if(a=Oa,Oa=null,fp=0,St&6)throw Error(t(331));var C=St;for(St|=4,Fe=a.current;Fe!==null;){var B=Fe,U=B.child;if(Fe.flags&16){var q=B.deletions;if(q!==null){for(var J=0;J<q.length;J++){var ce=q[J];for(Fe=ce;Fe!==null;){var Ie=Fe;switch(Ie.tag){case 0:case 11:case 15:wh(8,Ie,B)}var Se=Ie.child;if(Se!==null)Se.return=Ie,Fe=Se;else for(;Fe!==null;){Ie=Fe;var we=Ie.sibling,Ue=Ie.return;if(j3(Ie),Ie===ce){Fe=null;break}if(we!==null){we.return=Ue,Fe=we;break}Fe=Ue}}}var He=B.alternate;if(He!==null){var Ve=He.child;if(Ve!==null){He.child=null;do{var yr=Ve.sibling;Ve.sibling=null,Ve=yr}while(Ve!==null)}}Fe=B}}if(B.subtreeFlags&2064&&U!==null)U.return=B,Fe=U;else e:for(;Fe!==null;){if(B=Fe,B.flags&2048)switch(B.tag){case 0:case 11:case 15:wh(9,B,B.return)}var ie=B.sibling;if(ie!==null){ie.return=B.return,Fe=ie;break e}Fe=B.return}}var $=a.current;for(Fe=$;Fe!==null;){U=Fe;var ae=U.child;if(U.subtreeFlags&2064&&ae!==null)ae.return=U,Fe=ae;else e:for(U=$;Fe!==null;){if(q=Fe,q.flags&2048)try{switch(q.tag){case 0:case 11:case 15:lp(9,q)}}catch(je){dr(q,q.return,je)}if(q===U){Fe=null;break e}var Te=q.sibling;if(Te!==null){Te.return=q.return,Fe=Te;break e}Fe=q.return}}if(St=C,Ua(),rt&&typeof rt.onPostCommitFiberRoot=="function")try{rt.onPostCommitFiberRoot(jt,a)}catch{}y=!0}return y}finally{Pt=f,mi.transition=l}}return!1}function oS(a,l,f){l=Ic(f,l),l=C3(a,l,1),a=ka(a,l,1),l=_n(),a!==null&&(Ku(a,1,l),Qn(a,l))}function dr(a,l,f){if(a.tag===3)oS(a,a,f);else for(;l!==null;){if(l.tag===3){oS(l,a,f);break}else if(l.tag===1){var y=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof y.componentDidCatch=="function"&&(Fa===null||!Fa.has(y))){a=Ic(f,a),a=S3(l,a,1),l=ka(l,a,1),a=_n(),l!==null&&(Ku(l,1,a),Qn(l,a));break}}l=l.return}}function fQ(a,l,f){var y=a.pingCache;y!==null&&y.delete(l),l=_n(),a.pingedLanes|=a.suspendedLanes&f,Vr===a&&(Xr&f)===f&&(Nr===4||Nr===3&&(Xr&130023424)===Xr&&500>qe()-f1?Ho(a,0):d1|=f),Qn(a,l)}function lS(a,l){l===0&&(a.mode&1?(l=vr,vr<<=1,!(vr&130023424)&&(vr=4194304)):l=1);var f=_n();a=Hs(a,l),a!==null&&(Ku(a,l,f),Qn(a,f))}function pQ(a){var l=a.memoizedState,f=0;l!==null&&(f=l.retryLane),lS(a,f)}function AQ(a,l){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(l),lS(a,f)}var cS;cS=function(a,l,f){if(a!==null)if(a.memoizedProps!==l.pendingProps||Nn.current)Pn=!0;else{if(!(a.lanes&f)&&!(l.flags&128))return Pn=!1,rQ(a,l,f);Pn=!!(a.flags&131072)}else Pn=!1,tr&&l.flags&1048576&&zC(l,jf,l.index);switch(l.lanes=0,l.tag){case 2:var y=l.type;ap(a,l),a=l.pendingProps;var C=gc(l,rn.current);Ec(l,f),C=W0(null,l,y,a,C,f);var B=Y0();return l.flags|=1,typeof C=="object"&&C!==null&&typeof C.render=="function"&&C.$$typeof===void 0?(l.tag=1,l.memoizedState=null,l.updateQueue=null,Un(y)?(B=!0,Hf(l)):B=!1,l.memoizedState=C.state!==null&&C.state!==void 0?C.state:null,k0(l),C.updater=Jf,l.stateNode=C,C._reactInternals=l,F0(l,y,a,f),l=t1(null,l,y,!0,B,f)):(l.tag=0,tr&&B&&M0(l),mn(null,l,C,f),l=l.child),l;case 16:y=l.elementType;e:{switch(ap(a,l),a=l.pendingProps,C=y._init,y=C(y._payload),l.type=y,C=l.tag=mQ(y),a=Qi(y,a),C){case 0:l=e1(null,l,y,a,f);break e;case 1:l=U3(null,l,y,a,f);break e;case 11:l=b3(null,l,y,a,f);break e;case 14:l=R3(null,l,y,Qi(y.type,a),f);break e}throw Error(t(306,y,""))}return l;case 0:return y=l.type,C=l.pendingProps,C=l.elementType===y?C:Qi(y,C),e1(a,l,y,C,f);case 1:return y=l.type,C=l.pendingProps,C=l.elementType===y?C:Qi(y,C),U3(a,l,y,C,f);case 3:e:{if(P3(l),a===null)throw Error(t(387));y=l.pendingProps,B=l.memoizedState,C=B.element,YC(a,l),Kf(l,y,null,f);var U=l.memoizedState;if(y=U.element,B.isDehydrated)if(B={element:y,isDehydrated:!1,cache:U.cache,pendingSuspenseBoundaries:U.pendingSuspenseBoundaries,transitions:U.transitions},l.updateQueue.baseState=B,l.memoizedState=B,l.flags&256){C=Ic(Error(t(423)),l),l=k3(a,l,y,f,C);break e}else if(y!==C){C=Ic(Error(t(424)),l),l=k3(a,l,y,f,C);break e}else for(ei=Da(l.stateNode.containerInfo.firstChild),$n=l,tr=!0,ki=null,f=r3(l,null,y,f),l.child=f;f;)f.flags=f.flags&-3|4096,f=f.sibling;else{if(vc(),y===C){l=Vs(a,l,f);break e}mn(a,l,y,f)}l=l.child}return l;case 5:return n3(l),a===null&&b0(l),y=l.type,C=l.pendingProps,B=a!==null?a.memoizedProps:null,U=C.children,E0(y,C)?U=null:B!==null&&E0(y,B)&&(l.flags|=32),N3(a,l),mn(a,l,U,f),l.child;case 6:return a===null&&b0(l),null;case 13:return Q3(a,l,f);case 4:return O0(l,l.stateNode.containerInfo),y=l.pendingProps,a===null?l.child=xc(l,null,y,f):mn(a,l,y,f),l.child;case 11:return y=l.type,C=l.pendingProps,C=l.elementType===y?C:Qi(y,C),b3(a,l,y,C,f);case 7:return mn(a,l,l.pendingProps,f),l.child;case 8:return mn(a,l,l.pendingProps.children,f),l.child;case 12:return mn(a,l,l.pendingProps.children,f),l.child;case 10:e:{if(y=l.type._context,C=l.pendingProps,B=l.memoizedProps,U=C.value,Wt(Yf,y._currentValue),y._currentValue=U,B!==null)if(Pi(B.value,U)){if(B.children===C.children&&!Nn.current){l=Vs(a,l,f);break e}}else for(B=l.child,B!==null&&(B.return=l);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 Ie=ce.pending;Ie===null?J.next=J:(J.next=Ie.next,Ie.next=J),ce.pending=J}}B.lanes|=f,J=B.alternate,J!==null&&(J.lanes|=f),U0(B.return,f,l),q.lanes|=f;break}J=J.next}}else if(B.tag===10)U=B.type===l.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),U0(U,f,l),U=B.sibling}else U=B.child;if(U!==null)U.return=B;else for(U=B;U!==null;){if(U===l){U=null;break}if(B=U.sibling,B!==null){B.return=U.return,U=B;break}U=U.return}B=U}mn(a,l,C.children,f),l=l.child}return l;case 9:return C=l.type,y=l.pendingProps.children,Ec(l,f),C=Ai(C),y=y(C),l.flags|=1,mn(a,l,y,f),l.child;case 14:return y=l.type,C=Qi(y,l.pendingProps),C=Qi(y.type,C),R3(a,l,y,C,f);case 15:return D3(a,l,l.type,l.pendingProps,f);case 17:return y=l.type,C=l.pendingProps,C=l.elementType===y?C:Qi(y,C),ap(a,l),l.tag=1,Un(y)?(a=!0,Hf(l)):a=!1,Ec(l,f),ZC(l,y,C),F0(l,y,C,f),t1(null,l,y,!0,a,f);case 19:return O3(a,l,f);case 22:return L3(a,l,f)}throw Error(t(156,l.tag))};function uS(a,l){return Re(a,l)}function gQ(a,l,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=l,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 _i(a,l,f,y){return new gQ(a,l,f,y)}function E1(a){return a=a.prototype,!(!a||!a.isReactComponent)}function mQ(a){if(typeof a=="function")return E1(a)?1:0;if(a!=null){if(a=a.$$typeof,a===P)return 11;if(a===X)return 14}return 2}function Ga(a,l){var f=a.alternate;return f===null?(f=_i(a.tag,l,a.key,a.mode),f.elementType=a.elementType,f.type=a.type,f.stateNode=a.stateNode,f.alternate=a,a.alternate=f):(f.pendingProps=l,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,l=a.dependencies,f.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},f.sibling=a.sibling,f.index=a.index,f.ref=a.ref,f}function mp(a,l,f,y,C,B){var U=2;if(y=a,typeof a=="function")E1(a)&&(U=1);else if(typeof a=="string")U=5;else e:switch(a){case T:return Vo(f.children,C,B,l);case D:U=8,C|=8;break;case b:return a=_i(12,f,l,C|2),a.elementType=b,a.lanes=B,a;case N:return a=_i(13,f,l,C),a.elementType=N,a.lanes=B,a;case W:return a=_i(19,f,l,C),a.elementType=W,a.lanes=B,a;case te:return _p(f,C,B,l);default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case S: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 l=_i(U,f,l,C),l.elementType=a,l.type=y,l.lanes=B,l}function Vo(a,l,f,y){return a=_i(7,a,y,l),a.lanes=f,a}function _p(a,l,f,y){return a=_i(22,a,y,l),a.elementType=te,a.lanes=f,a.stateNode={isHidden:!1},a}function x1(a,l,f){return a=_i(6,a,null,l),a.lanes=f,a}function w1(a,l,f){return l=_i(4,a.children!==null?a.children:[],a.key,l),l.lanes=f,l.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},l}function _Q(a,l,f,y,C){this.tag=l,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=Km(0),this.expirationTimes=Km(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Km(0),this.identifierPrefix=y,this.onRecoverableError=C,this.mutableSourceEagerHydrationData=null}function I1(a,l,f,y,C,B,U,q,J){return a=new _Q(a,l,f,q,J),l===1?(l=1,B===!0&&(l|=8)):l=0,B=_i(3,null,null,l),a.current=B,B.stateNode=a,B.memoizedState={element:y,isDehydrated:f,cache:null,transitions:null,pendingSuspenseBoundaries:null},k0(B),a}function vQ(a,l,f){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:M,key:y==null?null:""+y,children:a,containerInfo:l,implementation:f}}function hS(a){if(!a)return Na;a=a._reactInternals;e:{if(Ps(a)!==a||a.tag!==1)throw Error(t(170));var l=a;do{switch(l.tag){case 3:l=l.stateNode.context;break e;case 1:if(Un(l.type)){l=l.stateNode.__reactInternalMemoizedMergedChildContext;break e}}l=l.return}while(l!==null);throw Error(t(171))}if(a.tag===1){var f=a.type;if(Un(f))return QC(a,f,l)}return l}function dS(a,l,f,y,C,B,U,q,J){return a=I1(f,y,!0,a,C,B,U,q,J),a.context=hS(null),f=a.current,y=_n(),C=za(f),B=Gs(y,C),B.callback=l??null,ka(f,B,C),a.current.lanes=C,Ku(a,C,y),Qn(a,y),a}function vp(a,l,f,y){var C=l.current,B=_n(),U=za(C);return f=hS(f),l.context===null?l.context=f:l.pendingContext=f,l=Gs(B,U),l.payload={element:a},y=y===void 0?null:y,y!==null&&(l.callback=y),a=ka(C,l,U),a!==null&&(zi(a,C,U,B),Xf(a,C,U)),U}function yp(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 fS(a,l){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var f=a.retryLane;a.retryLane=f!==0&&f<l?f:l}}function C1(a,l){fS(a,l),(a=a.alternate)&&fS(a,l)}function yQ(){return null}var pS=typeof reportError=="function"?reportError:function(a){console.error(a)};function S1(a){this._internalRoot=a}Ep.prototype.render=S1.prototype.render=function(a){var l=this._internalRoot;if(l===null)throw Error(t(409));vp(a,l,null,null)},Ep.prototype.unmount=S1.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var l=a.containerInfo;zo(function(){vp(null,a,null,null)}),l[Qs]=null}};function Ep(a){this._internalRoot=a}Ep.prototype.unstable_scheduleHydration=function(a){if(a){var l=KI();a={blockedOn:null,target:a,priority:l};for(var f=0;f<Ba.length&&l!==0&&l<Ba[f].priority;f++);Ba.splice(f,0,a),f===0&&$I(a)}};function M1(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function xp(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11&&(a.nodeType!==8||a.nodeValue!==" react-mount-point-unstable "))}function AS(){}function EQ(a,l,f,y,C){if(C){if(typeof y=="function"){var B=y;y=function(){var ce=yp(U);B.call(ce)}}var U=dS(l,y,a,0,null,!1,!1,"",AS);return a._reactRootContainer=U,a[Qs]=U.current,uh(a.nodeType===8?a.parentNode:a),zo(),U}for(;C=a.lastChild;)a.removeChild(C);if(typeof y=="function"){var q=y;y=function(){var ce=yp(J);q.call(ce)}}var J=I1(a,0,!1,null,null,!1,!1,"",AS);return a._reactRootContainer=J,a[Qs]=J.current,uh(a.nodeType===8?a.parentNode:a),zo(function(){vp(l,J,f,y)}),J}function wp(a,l,f,y,C){var B=f._reactRootContainer;if(B){var U=B;if(typeof C=="function"){var q=C;C=function(){var J=yp(U);q.call(J)}}vp(l,U,a,C)}else U=EQ(f,l,a,C,y);return yp(U)}qI=function(a){switch(a.tag){case 3:var l=a.stateNode;if(l.current.memoizedState.isDehydrated){var f=Dn(l.pendingLanes);f!==0&&(Jm(l,f|1),Qn(l,qe()),!(St&6)&&(Mc=qe()+500,Ua()))}break;case 13:zo(function(){var y=Hs(a,1);if(y!==null){var C=_n();zi(y,a,1,C)}}),C1(a,1)}},Zm=function(a){if(a.tag===13){var l=Hs(a,134217728);if(l!==null){var f=_n();zi(l,a,134217728,f)}C1(a,134217728)}},XI=function(a){if(a.tag===13){var l=za(a),f=Hs(a,l);if(f!==null){var y=_n();zi(f,a,l,y)}C1(a,l)}},KI=function(){return Pt},JI=function(a,l){var f=Pt;try{return Pt=a,l()}finally{Pt=f}},_e=function(a,l,f){switch(l){case"input":if(Y(a,f),l=f.name,f.type==="radio"&&l!=null){for(f=a;f.parentNode;)f=f.parentNode;for(f=f.querySelectorAll("input[name="+JSON.stringify(""+l)+'][type="radio"]'),l=0;l<f.length;l++){var y=f[l];if(y!==a&&y.form===a.form){var C=Of(y);if(!C)throw Error(t(90));et(y),Y(y,C)}}}break;case"textarea":Ce(a,f);break;case"select":l=f.value,l!=null&&me(a,!!f.multiple,l,!1)}},Mt=_1,vt=zo;var xQ={usingClientEntryPoint:!1,Events:[fh,pc,Of,Dt,Lt,_1]},Mh={findFiberByHostInstance:Lo,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},wQ={bundleType:Mh.bundleType,version:Mh.version,rendererPackageName:Mh.rendererPackageName,rendererConfig:Mh.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:Mh.findFiberByHostInstance||yQ,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 Ip=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ip.isDisabled&&Ip.supportsFiber)try{jt=Ip.inject(wQ),rt=Ip}catch{}}return Bn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=xQ,Bn.createPortal=function(a,l){var f=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!M1(l))throw Error(t(200));return vQ(a,l,null,f)},Bn.createRoot=function(a,l){if(!M1(a))throw Error(t(299));var f=!1,y="",C=pS;return l!=null&&(l.unstable_strictMode===!0&&(f=!0),l.identifierPrefix!==void 0&&(y=l.identifierPrefix),l.onRecoverableError!==void 0&&(C=l.onRecoverableError)),l=I1(a,1,!1,null,null,f,!1,y,C),a[Qs]=l.current,uh(a.nodeType===8?a.parentNode:a),new S1(l)},Bn.findDOMNode=function(a){if(a==null)return null;if(a.nodeType===1)return a;var l=a._reactInternals;if(l===void 0)throw typeof a.render=="function"?Error(t(188)):(a=Object.keys(a).join(","),Error(t(268,a)));return a=he(l),a=a===null?null:a.stateNode,a},Bn.flushSync=function(a){return zo(a)},Bn.hydrate=function(a,l,f){if(!xp(l))throw Error(t(200));return wp(null,a,l,!0,f)},Bn.hydrateRoot=function(a,l,f){if(!M1(a))throw Error(t(405));var y=f!=null&&f.hydratedSources||null,C=!1,B="",U=pS;if(f!=null&&(f.unstable_strictMode===!0&&(C=!0),f.identifierPrefix!==void 0&&(B=f.identifierPrefix),f.onRecoverableError!==void 0&&(U=f.onRecoverableError)),l=dS(l,null,a,1,f??null,C,!1,B,U),a[Qs]=l.current,uh(a),y)for(a=0;a<y.length;a++)f=y[a],C=f._getVersion,C=C(f._source),l.mutableSourceEagerHydrationData==null?l.mutableSourceEagerHydrationData=[f,C]:l.mutableSourceEagerHydrationData.push(f,C);return new Ep(l)},Bn.render=function(a,l,f){if(!xp(l))throw Error(t(200));return wp(null,a,l,!1,f)},Bn.unmountComponentAtNode=function(a){if(!xp(a))throw Error(t(40));return a._reactRootContainer?(zo(function(){wp(null,null,a,!1,function(){a._reactRootContainer=null,a[Qs]=null})}),!0):!1},Bn.unstable_batchedUpdates=_1,Bn.unstable_renderSubtreeIntoContainer=function(a,l,f,y){if(!xp(f))throw Error(t(200));if(a==null||a._reactInternals===void 0)throw Error(t(38));return wp(a,l,f,!1,y)},Bn.version="18.2.0-next-9e3b772b8-20220608",Bn}function DI(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(DI)}catch(r){console.error(r)}}DI(),TI.exports=Mk();var Tk=TI.exports,LI=Tk;Gm.createRoot=LI.createRoot,Gm.hydrateRoot=LI.hydrateRoot;class Bk{constructor({apiService:e,events:t}){Bt(this,"targetElement");Bt(this,"apiService");Bt(this,"events");Bt(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=Gm.createRoot(document.getElementById(n))}this.targetElement.render(Th.createElement(Ik,{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 Wm={exports:{}},sc=typeof Reflect=="object"?Reflect:null,NI=sc&&typeof sc.apply=="function"?sc.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)},Ef;sc&&typeof sc.ownKeys=="function"?Ef=sc.ownKeys:Object.getOwnPropertySymbols?Ef=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Ef=function(e){return Object.getOwnPropertyNames(e)};function bk(r){console&&console.warn&&console.warn(r)}var UI=Number.isNaN||function(e){return e!==e};function Ft(){Ft.init.call(this)}Wm.exports=Ft,Wm.exports.once=Nk,Ft.EventEmitter=Ft,Ft.prototype._events=void 0,Ft.prototype._eventsCount=0,Ft.prototype._maxListeners=void 0;var PI=10;function xf(r){if(typeof r!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r)}Object.defineProperty(Ft,"defaultMaxListeners",{enumerable:!0,get:function(){return PI},set:function(r){if(typeof r!="number"||r<0||UI(r))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+r+".");PI=r}}),Ft.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},Ft.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||UI(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 kI(r){return r._maxListeners===void 0?Ft.defaultMaxListeners:r._maxListeners}Ft.prototype.getMaxListeners=function(){return kI(this)},Ft.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 c=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw c.context=o,c}var h=s[e];if(h===void 0)return!1;if(typeof h=="function")NI(h,this,t);else for(var u=h.length,d=HI(h,u),n=0;n<u;++n)NI(d[n],this,t);return!0};function QI(r,e,t,n){var i,s,o;if(xf(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=kI(r),i>0&&o.length>i&&!o.warned){o.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=r,c.type=e,c.count=o.length,bk(c)}return r}Ft.prototype.addListener=function(e,t){return QI(this,e,t,!1)},Ft.prototype.on=Ft.prototype.addListener,Ft.prototype.prependListener=function(e,t){return QI(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 FI(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}Ft.prototype.once=function(e,t){return xf(t),this.on(e,FI(this,e,t)),this},Ft.prototype.prependOnceListener=function(e,t){return xf(t),this.prependListener(e,FI(this,e,t)),this},Ft.prototype.removeListener=function(e,t){var n,i,s,o,c;if(xf(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){c=n[o].listener,s=o;break}if(s<0)return this;s===0?n.shift():Dk(n,s),n.length===1&&(i[e]=n[0]),i.removeListener!==void 0&&this.emit("removeListener",e,c||t)}return this},Ft.prototype.off=Ft.prototype.removeListener,Ft.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 OI(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?Lk(i):HI(i,i.length)}Ft.prototype.listeners=function(e){return OI(this,e,!0)},Ft.prototype.rawListeners=function(e){return OI(this,e,!1)},Ft.listenerCount=function(r,e){return typeof r.listenerCount=="function"?r.listenerCount(e):zI.call(r,e)},Ft.prototype.listenerCount=zI;function zI(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}Ft.prototype.eventNames=function(){return this._eventsCount>0?Ef(this._events):[]};function HI(r,e){for(var t=new Array(e),n=0;n<e;++n)t[n]=r[n];return t}function Dk(r,e){for(;e+1<r.length;e++)r[e]=r[e+1];r.pop()}function Lk(r){for(var e=new Array(r.length),t=0;t<e.length;++t)e[t]=r[t].listener||r[t];return e}function Nk(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))}GI(r,e,s,{once:!0}),e!=="error"&&Uk(r,i,{once:!0})})}function Uk(r,e,t){typeof r.on=="function"&&GI(r,"error",e,t)}function GI(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 Pk=Wm.exports;const ju=class ju extends Pk.EventEmitter{emitEvent(e,t){Object.keys(ju.EVENTS).includes(e)&&this.emit(ju.EVENTS[e],t)}};Bt(ju,"EVENTS",{onAddToCart:"add-to-cart"});let Ym=ju;const kk={getCartUrl:((jI=window.Shopify)==null?void 0:jI.routes.root)+"cart.js",addToCartUrl:((WI=window.Shopify)==null?void 0:WI.routes.root)+"cart/add.js"},VI=Object.freeze(kk);class Qk{constructor(e){Bt(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:Fk,error:Ok}=console,zk=(...r)=>{Ok("❌ Sprie Error:",...r)},Hk="&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&",Gk={HOST:cs.host,STORE_PREFIX:cs.storePrefix},Vk={addToCartUrl:VI.addToCartUrl,getCartUrl:VI.getCartUrl};class jk{constructor(){Bt(this,"sdkService");Bt(this,"apiService");Bt(this,"uiService");Bt(this,"events");this.events=new Ym,this.apiService=new _S(new ja(Gk),new Qk(Vk)),this.uiService=new Bk({apiService:this.apiService,events:this.events});const e={apiService:this.apiService,config:cs,log:Fk,logErr:zk,metaData:{appVersion:gS,previewUrlPrams:Hk,targetClassName:"sprie-embed-element"}};this.sdkService=new vS(e),this.sdkService.Init()}load(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()}}window.ditaConfigurator=new jk})();