@perceptimagery/dita-configurator-staging 1.3.23 → 1.3.24

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 +14 -14
  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;top:0;left:0;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-loadingFrame--viewerOverlay{z-index:10000}.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--frame .sprie-config-palette-img-text{width:200%}.sprie-config-palette-img-text{top:90%;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}@media (min-width: 577px){.sprie-config-palette-img-text{line-height:1.2}.sprie-config-palette-img-text .sprie-config-palette-imgName{line-height:inherit}}.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 YF=Object.defineProperty;var qF=(la,Pn,as)=>Pn in la?YF(la,Pn,{enumerable:!0,configurable:!0,writable:!0,value:as}):la[Pn]=as;var wt=(la,Pn,as)=>(qF(la,typeof Pn!="symbol"?Pn+"":Pn,as),as);(function(){var Iv,Mv;"use strict";const la={storePrefix:{NODE_ENV:"production"}.STORE_PREFIX||"sprie-embed-",host:"https://api.sprie.io"},Pn=Object.freeze(la),as={baseUrl:"https://api.sprie.io",setBaseUrl(r){this.baseUrl=r}},Y2="sprie-widget-auth: ",qy=(...r)=>{console.error(Y2,...r)},B6=(...r)=>{console.log(Y2,...r)},b6=(...r)=>{console.warn(Y2,...r)};class R6 extends Error{constructor(e){super(`${Y2} ${e}`),this.name="SprieAuthError"}}class q1 extends Error{}q1.prototype.name="InvalidTokenError";function Xy(r){return decodeURIComponent(atob(r).replace(/(.)/g,(e,t)=>{let n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n}))}function Jy(r){let e=r.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return Xy(e)}catch{return atob(e)}}function Ky(r,e){if(typeof r!="string")throw new q1("Invalid token specified: must be a string");e||(e={});const t=e.header===!0?0:1,n=r.split(".")[t];if(typeof n!="string")throw new q1(`Invalid token specified: missing part #${t+1}`);let i;try{i=Jy(n)}catch(s){throw new q1(`Invalid token specified: invalid base64 for part #${t+1} (${s.message})`)}try{return JSON.parse(i)}catch(s){throw new q1(`Invalid token specified: invalid json for part #${t+1} (${s.message})`)}}function Zy(r){if(!r)return!1;try{const e=Ky(r),t=Math.floor(Date.now()/1e3);return Date.parse(e.expires)/1e3>t}catch(e){return qy("Invalid JWT token:",e),!1}}class $y{async authenticate(e){const t=`${as.baseUrl}/v2/widget/auth?api=${e}`;return(await fetch(t)).json()}}const $n={token:"token",orgId:"org_id",authResponse:"auth_response",apiKey:"key"};let eE=class{constructor(){wt(this,"PREFIX","sprie_widget_auth_");wt(this,"validKeys",Object.values($n))}reset(){for(const e of this.validKeys)localStorage.removeItem(this.PREFIX+e)}getItem(e){return localStorage.getItem(this.PREFIX+e)}setItem(e,t){if(!Object.values($n).includes(e))throw new R6("Invalid storage key");localStorage.setItem(this.PREFIX+e,t)}};class tE{constructor(){wt(this,"apiService");wt(this,"storageService");this.apiService=new $y,this.storageService=new eE}async _authenticate(e){try{const t=await this.apiService.authenticate(e);this.storageService.setItem($n.token,t.access),this.storageService.setItem($n.orgId,t.orgId),this.storageService.setItem($n.authResponse,JSON.stringify(t)),this.storageService.setItem($n.apiKey,btoa(e))}catch(t){throw this.storageService.reset(),t}}async init(e){this.isAuthenticated(e)||await this._authenticate(e)}reset(){B6("Resetting authentication data"),this.storageService.reset()}isAuthenticated(e){return this.token?Zy(this.token)?e&&this.apiKey!==e?(this.reset(),!1):!0:(this.reset(),!1):!1}get token(){return this.storageService.getItem($n.token)}get orgId(){return this.storageService.getItem($n.orgId)}get response(){const e=this.storageService.getItem($n.authResponse);return e?JSON.parse(e):null}get apiKey(){const e=this.storageService.getItem($n.apiKey);return e?atob(e):null}}class rE{constructor(){wt(this,"authService",new tE);wt(this,"initPromise",null);wt(this,"initApiKey",null);B6("Hello from SprieWidgetAuth:"),this.setupDOMListener()}setupDOMListener(){document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>{this.authService.isAuthenticated()}):this.authService.isAuthenticated()}configure({baseUrl:e}){if(!e){b6("called without baseUrl, skipping configuration");return}as.setBaseUrl(e)}async init({apiKey:e}){if(!e)throw new R6("API Key is required for initialization");return this.authService.isAuthenticated(e)?!0:this.initPromise?(this.initApiKey!==e&&b6("Already initializing with a different key, ignoring new key"),this.initPromise):(this.initApiKey=e,this.initPromise=this.authService.init(e).then(()=>!0).catch(t=>{throw this.initPromise=null,this.initApiKey=null,t}),this.initPromise)}isAuthenticated(){return this.authService.isAuthenticated()}reset(){this.initPromise=null,this.initApiKey=null,this.authService.reset()}get token(){return this.authService.token}get orgId(){return this.authService.orgId}get response(){return this.authService.response}get apiKey(){return this.authService.apiKey}}const r3="__sprie_widget_auth__";window[r3]||(window[r3]=new rE);const nE=window[r3];class iE{constructor(){wt(this,"authPkg",nE)}async init({apiKey:e,baseUrl:t}){this.authPkg.configure({baseUrl:t}),await this.authPkg.init({apiKey:e})}isAuthenticated(){return this.authPkg.isAuthenticated()}reset(){this.authPkg.reset()}get apiKey(){return this.authPkg.apiKey}get token(){return this.authPkg.token}get orgId(){return this.authPkg.orgId}get response(){return this.authPkg.response}}const os=new iE;class sE{RequestOptions(e,t){return{method:e,headers:{...{Accept:"application/json","Content-Type":"application/json"},...os.token&&{Authorization:os.token}},...e==="POST"&&{body:JSON.stringify(t)}}}async Get(e){return await(await fetch(Pn.host+e,this.RequestOptions("GET"))).json()}async Post(e,t){return await(await fetch(Pn.host+e,this.RequestOptions("POST",t||{}))).json()}}const aE="1.3.23";function oE(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 lE{constructor(e,t){wt(this,"fetcher");wt(this,"shopifyAPI");wt(this,"dataVariants");this.fetcher=e,this.shopifyAPI=t,this.dataVariants=[]}async FetchAssetBySKUOrBarcode(e){let t="/v2/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,n){const i=`/v2/widget/list-customisation?search=type:${e},org:${os.orgId},usage:${n}&limit=200`,s=await this.fetcher.Get(i),o=s.data.findIndex(u=>u.sku.includes(`${e.toLowerCase()}-default`)),l=s.data[o];return!t&&o>-1&&s.data.splice(o,1),{...s,data:t&&l?oE(s.data,l):s.data}}async DownloadMA(e){try{const t=`/v2/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(!os.isAuthenticated()||!e)return;const t={org:os.orgId,asset:e,timestamp:new Date().toISOString()},n="/v2/analytics/trigger";await this.fetcher.Post(n,t)}async PopulateDataList(e){var n;const t=(n=document.querySelector(`#${e}`))==null?void 0:n.textContent;if(t){const i=await JSON.parse(t);return Object.values(i)[0]}return null}async HandleShopifyAddToCart(e,t){e.forEach(s=>{var l;const o=(l=s.properties)==null?void 0:l.customText;o&&(delete s.properties.customText,Object.assign(s.properties,{"custom-laser-etching":"Add Laser Engraving"}),Object.assign(s.properties,{"custom-text":o}),Object.assign(s.properties,{"This customized item cannot be returned or exchanged":"I agree"}),Object.assign(s.properties,{_uniqueTimestamp:t}))});const n={items:e,sections:"mini-cart"},i=await this.shopifyAPI.Post(n);if(i){const s=await this.shopifyAPI.Get();document.querySelector("#shopify-section-mini-cart").outerHTML=i.sections["mini-cart"],document.querySelector(".header__cart-count").textContent=s.item_count;const o=document.querySelector(".drawer.drawer--full");o&&o.hasAttribute("open")&&o.removeAttribute("open");const l=document.querySelector(".popover.hidden-lap-and-up.popover-full");l&&l.hasAttribute("open")&&l.removeAttribute("open"),document.querySelector(".mini-cart.drawer.drawer--large").setAttribute("open","")}}}var n3=(r=>(r.Init="init",r.Preparing="preparing",r.Authenticating="authenticating",r.Fetching="fetching",r.Loading="loading",r.Done="done",r))(n3||{}),ls=(r=>(r.Customizer="customizer",r.Lancier="lancier",r.RxViewer="rxviewer",r))(ls||{});class cE{constructor({log:e,logErr:t,metaData:n,config:i}){wt(this,"log");wt(this,"logErr");wt(this,"metaData");wt(this,"loaderName");wt(this,"apiKey");wt(this,"scriptStreamEncoderId");wt(this,"rawNodeList");wt(this,"targetNodeList");wt(this,"status");wt(this,"isLoaded");wt(this,"loadCount");wt(this,"mutationObserver");wt(this,"config");this.config=i,this.metaData=n,this.apiKey=null,this.scriptStreamEncoderId=`sprie-embed🔴${Date.now().toString()}`,this.rawNodeList=document.getElementsByClassName(this.metaData.targetClassName),this.targetNodeList=[],this.status=n3.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,this.scanApiKeyFromCurrentScriptTag()}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=n3.Authenticating,!os.isAuthenticated()){if(!this.apiKey)throw new Error("Sprie: Unable to authenticate. Need APIKey.");await os.init({apiKey:this.apiKey,baseUrl:this.config.host}),os.isAuthenticated()||this.logErr("Authentication failed! Check apikey and/or expiration.")}}async Init(){try{return await this.authenticate(),!0}catch(e){return this.log("SprieEmbed Loading failed."),this.logErr(e),this.isLoaded=!1,!1}}}function uE(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var D6={exports:{}},X1={},L6={exports:{}},Ct={};/**
3
+ var YF=Object.defineProperty;var qF=(la,Pn,as)=>Pn in la?YF(la,Pn,{enumerable:!0,configurable:!0,writable:!0,value:as}):la[Pn]=as;var wt=(la,Pn,as)=>(qF(la,typeof Pn!="symbol"?Pn+"":Pn,as),as);(function(){var Iv,Mv;"use strict";const la={storePrefix:{NODE_ENV:"production"}.STORE_PREFIX||"sprie-embed-",host:"https://api.sprie.io"},Pn=Object.freeze(la),as={baseUrl:"https://api.sprie.io",setBaseUrl(r){this.baseUrl=r}},Y2="sprie-widget-auth: ",qy=(...r)=>{console.error(Y2,...r)},B6=(...r)=>{console.log(Y2,...r)},b6=(...r)=>{console.warn(Y2,...r)};class R6 extends Error{constructor(e){super(`${Y2} ${e}`),this.name="SprieAuthError"}}class q1 extends Error{}q1.prototype.name="InvalidTokenError";function Xy(r){return decodeURIComponent(atob(r).replace(/(.)/g,(e,t)=>{let n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n}))}function Jy(r){let e=r.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return Xy(e)}catch{return atob(e)}}function Ky(r,e){if(typeof r!="string")throw new q1("Invalid token specified: must be a string");e||(e={});const t=e.header===!0?0:1,n=r.split(".")[t];if(typeof n!="string")throw new q1(`Invalid token specified: missing part #${t+1}`);let i;try{i=Jy(n)}catch(s){throw new q1(`Invalid token specified: invalid base64 for part #${t+1} (${s.message})`)}try{return JSON.parse(i)}catch(s){throw new q1(`Invalid token specified: invalid json for part #${t+1} (${s.message})`)}}function Zy(r){if(!r)return!1;try{const e=Ky(r),t=Math.floor(Date.now()/1e3);return Date.parse(e.expires)/1e3>t}catch(e){return qy("Invalid JWT token:",e),!1}}class $y{async authenticate(e){const t=`${as.baseUrl}/v2/widget/auth?api=${e}`;return(await fetch(t)).json()}}const $n={token:"token",orgId:"org_id",authResponse:"auth_response",apiKey:"key"};let eE=class{constructor(){wt(this,"PREFIX","sprie_widget_auth_");wt(this,"validKeys",Object.values($n))}reset(){for(const e of this.validKeys)localStorage.removeItem(this.PREFIX+e)}getItem(e){return localStorage.getItem(this.PREFIX+e)}setItem(e,t){if(!Object.values($n).includes(e))throw new R6("Invalid storage key");localStorage.setItem(this.PREFIX+e,t)}};class tE{constructor(){wt(this,"apiService");wt(this,"storageService");this.apiService=new $y,this.storageService=new eE}async _authenticate(e){try{const t=await this.apiService.authenticate(e);this.storageService.setItem($n.token,t.access),this.storageService.setItem($n.orgId,t.orgId),this.storageService.setItem($n.authResponse,JSON.stringify(t)),this.storageService.setItem($n.apiKey,btoa(e))}catch(t){throw this.storageService.reset(),t}}async init(e){this.isAuthenticated(e)||await this._authenticate(e)}reset(){B6("Resetting authentication data"),this.storageService.reset()}isAuthenticated(e){return this.token?Zy(this.token)?e&&this.apiKey!==e?(this.reset(),!1):!0:(this.reset(),!1):!1}get token(){return this.storageService.getItem($n.token)}get orgId(){return this.storageService.getItem($n.orgId)}get response(){const e=this.storageService.getItem($n.authResponse);return e?JSON.parse(e):null}get apiKey(){const e=this.storageService.getItem($n.apiKey);return e?atob(e):null}}class rE{constructor(){wt(this,"authService",new tE);wt(this,"initPromise",null);wt(this,"initApiKey",null);B6("Hello from SprieWidgetAuth:"),this.setupDOMListener()}setupDOMListener(){document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>{this.authService.isAuthenticated()}):this.authService.isAuthenticated()}configure({baseUrl:e}){if(!e){b6("called without baseUrl, skipping configuration");return}as.setBaseUrl(e)}async init({apiKey:e}){if(!e)throw new R6("API Key is required for initialization");return this.authService.isAuthenticated(e)?!0:this.initPromise?(this.initApiKey!==e&&b6("Already initializing with a different key, ignoring new key"),this.initPromise):(this.initApiKey=e,this.initPromise=this.authService.init(e).then(()=>!0).catch(t=>{throw this.initPromise=null,this.initApiKey=null,t}),this.initPromise)}isAuthenticated(){return this.authService.isAuthenticated()}reset(){this.initPromise=null,this.initApiKey=null,this.authService.reset()}get token(){return this.authService.token}get orgId(){return this.authService.orgId}get response(){return this.authService.response}get apiKey(){return this.authService.apiKey}}const r3="__sprie_widget_auth__";window[r3]||(window[r3]=new rE);const nE=window[r3];class iE{constructor(){wt(this,"authPkg",nE)}async init({apiKey:e,baseUrl:t}){this.authPkg.configure({baseUrl:t}),await this.authPkg.init({apiKey:e})}isAuthenticated(){return this.authPkg.isAuthenticated()}reset(){this.authPkg.reset()}get apiKey(){return this.authPkg.apiKey}get token(){return this.authPkg.token}get orgId(){return this.authPkg.orgId}get response(){return this.authPkg.response}}const os=new iE;class sE{RequestOptions(e,t){return{method:e,headers:{...{Accept:"application/json","Content-Type":"application/json"},...os.token&&{Authorization:os.token}},...e==="POST"&&{body:JSON.stringify(t)}}}async Get(e){return await(await fetch(Pn.host+e,this.RequestOptions("GET"))).json()}async Post(e,t){return await(await fetch(Pn.host+e,this.RequestOptions("POST",t||{}))).json()}}const aE="1.3.24";function oE(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 lE{constructor(e,t){wt(this,"fetcher");wt(this,"shopifyAPI");wt(this,"dataVariants");this.fetcher=e,this.shopifyAPI=t,this.dataVariants=[]}async FetchAssetBySKUOrBarcode(e){let t="/v2/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,n){const i=`/v2/widget/list-customisation?search=type:${e},org:${os.orgId},usage:${n}&limit=200`,s=await this.fetcher.Get(i),o=s.data.findIndex(u=>u.sku.includes(`${e.toLowerCase()}-default`)),l=s.data[o];return!t&&o>-1&&s.data.splice(o,1),{...s,data:t&&l?oE(s.data,l):s.data}}async DownloadMA(e){try{const t=`/v2/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(!os.isAuthenticated()||!e)return;const t={org:os.orgId,asset:e,timestamp:new Date().toISOString()},n="/v2/analytics/trigger";await this.fetcher.Post(n,t)}async PopulateDataList(e){var n;const t=(n=document.querySelector(`#${e}`))==null?void 0:n.textContent;if(t){const i=await JSON.parse(t);return Object.values(i)[0]}return null}async HandleShopifyAddToCart(e,t){e.forEach(s=>{var l;const o=(l=s.properties)==null?void 0:l.customText;o&&(delete s.properties.customText,Object.assign(s.properties,{"custom-laser-etching":"Add Laser Engraving"}),Object.assign(s.properties,{"custom-text":o}),Object.assign(s.properties,{"This customized item cannot be returned or exchanged":"I agree"}),Object.assign(s.properties,{_uniqueTimestamp:t}))});const n={items:e,sections:"mini-cart"},i=await this.shopifyAPI.Post(n);if(i){const s=await this.shopifyAPI.Get();document.querySelector("#shopify-section-mini-cart").outerHTML=i.sections["mini-cart"],document.querySelector(".header__cart-count").textContent=s.item_count;const o=document.querySelector(".drawer.drawer--full");o&&o.hasAttribute("open")&&o.removeAttribute("open");const l=document.querySelector(".popover.hidden-lap-and-up.popover-full");l&&l.hasAttribute("open")&&l.removeAttribute("open"),document.querySelector(".mini-cart.drawer.drawer--large").setAttribute("open","")}}}var n3=(r=>(r.Init="init",r.Preparing="preparing",r.Authenticating="authenticating",r.Fetching="fetching",r.Loading="loading",r.Done="done",r))(n3||{}),ls=(r=>(r.Customizer="customizer",r.Lancier="lancier",r.RxViewer="rxviewer",r))(ls||{});class cE{constructor({log:e,logErr:t,metaData:n,config:i}){wt(this,"log");wt(this,"logErr");wt(this,"metaData");wt(this,"loaderName");wt(this,"apiKey");wt(this,"scriptStreamEncoderId");wt(this,"rawNodeList");wt(this,"targetNodeList");wt(this,"status");wt(this,"isLoaded");wt(this,"loadCount");wt(this,"mutationObserver");wt(this,"config");this.config=i,this.metaData=n,this.apiKey=null,this.scriptStreamEncoderId=`sprie-embed🔴${Date.now().toString()}`,this.rawNodeList=document.getElementsByClassName(this.metaData.targetClassName),this.targetNodeList=[],this.status=n3.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,this.scanApiKeyFromCurrentScriptTag()}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=n3.Authenticating,!os.isAuthenticated()){if(!this.apiKey)throw new Error("Sprie: Unable to authenticate. Need APIKey.");await os.init({apiKey:this.apiKey,baseUrl:this.config.host}),os.isAuthenticated()||this.logErr("Authentication failed! Check apikey and/or expiration.")}}async Init(){try{return await this.authenticate(),!0}catch(e){return this.log("SprieEmbed Loading failed."),this.logErr(e),this.isLoaded=!1,!1}}}function uE(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var D6={exports:{}},X1={},L6={exports:{}},Ct={};/**
4
4
  * @license React
5
5
  * react.production.min.js
6
6
  *
@@ -8,7 +8,7 @@ var YF=Object.defineProperty;var qF=(la,Pn,as)=>Pn in la?YF(la,Pn,{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 N6;function hE(){if(N6)return Ct;N6=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"),l=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(U){return U===null||typeof U!="object"?null:(U=A&&U[A]||U["@@iterator"],typeof U=="function"?U:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},m=Object.assign,E={};function _(U,H,Z){this.props=U,this.context=H,this.refs=E,this.updater=Z||g}_.prototype.isReactComponent={},_.prototype.setState=function(U,H){if(typeof U!="object"&&typeof U!="function"&&U!=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,U,H,"setState")},_.prototype.forceUpdate=function(U){this.updater.enqueueForceUpdate(this,U,"forceUpdate")};function v(){}v.prototype=_.prototype;function C(U,H,Z){this.props=U,this.context=H,this.refs=E,this.updater=Z||g}var x=C.prototype=new v;x.constructor=C,m(x,_.prototype),x.isPureReactComponent=!0;var w=Array.isArray,B=Object.prototype.hasOwnProperty,T={current:null},S={key:!0,ref:!0,__self:!0,__source:!0};function D(U,H,Z){var G,oe={},pe=null,Ae=null;if(H!=null)for(G in H.ref!==void 0&&(Ae=H.ref),H.key!==void 0&&(pe=""+H.key),H)B.call(H,G)&&!S.hasOwnProperty(G)&&(oe[G]=H[G]);var ge=arguments.length-2;if(ge===1)oe.children=Z;else if(1<ge){for(var Re=Array(ge),Fe=0;Fe<ge;Fe++)Re[Fe]=arguments[Fe+2];oe.children=Re}if(U&&U.defaultProps)for(G in ge=U.defaultProps,ge)oe[G]===void 0&&(oe[G]=ge[G]);return{$$typeof:r,type:U,key:pe,ref:Ae,props:oe,_owner:T.current}}function R(U,H){return{$$typeof:r,type:U.type,key:H,ref:U.ref,props:U.props,_owner:U._owner}}function M(U){return typeof U=="object"&&U!==null&&U.$$typeof===r}function L(U){var H={"=":"=0",":":"=2"};return"$"+U.replace(/[=:]/g,function(Z){return H[Z]})}var P=/\/+/g;function F(U,H){return typeof U=="object"&&U!==null&&U.key!=null?L(""+U.key):H.toString(36)}function z(U,H,Z,G,oe){var pe=typeof U;(pe==="undefined"||pe==="boolean")&&(U=null);var Ae=!1;if(U===null)Ae=!0;else switch(pe){case"string":case"number":Ae=!0;break;case"object":switch(U.$$typeof){case r:case e:Ae=!0}}if(Ae)return Ae=U,oe=oe(Ae),U=G===""?"."+F(Ae,0):G,w(oe)?(Z="",U!=null&&(Z=U.replace(P,"$&/")+"/"),z(oe,H,Z,"",function(Fe){return Fe})):oe!=null&&(M(oe)&&(oe=R(oe,Z+(!oe.key||Ae&&Ae.key===oe.key?"":(""+oe.key).replace(P,"$&/")+"/")+U)),H.push(oe)),1;if(Ae=0,G=G===""?".":G+":",w(U))for(var ge=0;ge<U.length;ge++){pe=U[ge];var Re=G+F(pe,ge);Ae+=z(pe,H,Z,Re,oe)}else if(Re=p(U),typeof Re=="function")for(U=Re.call(U),ge=0;!(pe=U.next()).done;)pe=pe.value,Re=G+F(pe,ge++),Ae+=z(pe,H,Z,Re,oe);else if(pe==="object")throw H=String(U),Error("Objects are not valid as a React child (found: "+(H==="[object Object]"?"object with keys {"+Object.keys(U).join(", ")+"}":H)+"). If you meant to render a collection of children, use an array instead.");return Ae}function J(U,H,Z){if(U==null)return U;var G=[],oe=0;return z(U,G,"","",function(pe){return H.call(Z,pe,oe++)}),G}function q(U){if(U._status===-1){var H=U._result;H=H(),H.then(function(Z){(U._status===0||U._status===-1)&&(U._status=1,U._result=Z)},function(Z){(U._status===0||U._status===-1)&&(U._status=2,U._result=Z)}),U._status===-1&&(U._status=0,U._result=H)}if(U._status===1)return U._result.default;throw U._result}var ne={current:null},j={transition:null},te={ReactCurrentDispatcher:ne,ReactCurrentBatchConfig:j,ReactCurrentOwner:T};function W(){throw Error("act(...) is not supported in production builds of React.")}return Ct.Children={map:J,forEach:function(U,H,Z){J(U,function(){H.apply(this,arguments)},Z)},count:function(U){var H=0;return J(U,function(){H++}),H},toArray:function(U){return J(U,function(H){return H})||[]},only:function(U){if(!M(U))throw Error("React.Children.only expected to receive a single React element child.");return U}},Ct.Component=_,Ct.Fragment=t,Ct.Profiler=i,Ct.PureComponent=C,Ct.StrictMode=n,Ct.Suspense=h,Ct.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=te,Ct.act=W,Ct.cloneElement=function(U,H,Z){if(U==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+U+".");var G=m({},U.props),oe=U.key,pe=U.ref,Ae=U._owner;if(H!=null){if(H.ref!==void 0&&(pe=H.ref,Ae=T.current),H.key!==void 0&&(oe=""+H.key),U.type&&U.type.defaultProps)var ge=U.type.defaultProps;for(Re in H)B.call(H,Re)&&!S.hasOwnProperty(Re)&&(G[Re]=H[Re]===void 0&&ge!==void 0?ge[Re]:H[Re])}var Re=arguments.length-2;if(Re===1)G.children=Z;else if(1<Re){ge=Array(Re);for(var Fe=0;Fe<Re;Fe++)ge[Fe]=arguments[Fe+2];G.children=ge}return{$$typeof:r,type:U.type,key:oe,ref:pe,props:G,_owner:Ae}},Ct.createContext=function(U){return U={$$typeof:o,_currentValue:U,_currentValue2:U,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},U.Provider={$$typeof:s,_context:U},U.Consumer=U},Ct.createElement=D,Ct.createFactory=function(U){var H=D.bind(null,U);return H.type=U,H},Ct.createRef=function(){return{current:null}},Ct.forwardRef=function(U){return{$$typeof:l,render:U}},Ct.isValidElement=M,Ct.lazy=function(U){return{$$typeof:d,_payload:{_status:-1,_result:U},_init:q}},Ct.memo=function(U,H){return{$$typeof:u,type:U,compare:H===void 0?null:H}},Ct.startTransition=function(U){var H=j.transition;j.transition={};try{U()}finally{j.transition=H}},Ct.unstable_act=W,Ct.useCallback=function(U,H){return ne.current.useCallback(U,H)},Ct.useContext=function(U){return ne.current.useContext(U)},Ct.useDebugValue=function(){},Ct.useDeferredValue=function(U){return ne.current.useDeferredValue(U)},Ct.useEffect=function(U,H){return ne.current.useEffect(U,H)},Ct.useId=function(){return ne.current.useId()},Ct.useImperativeHandle=function(U,H,Z){return ne.current.useImperativeHandle(U,H,Z)},Ct.useInsertionEffect=function(U,H){return ne.current.useInsertionEffect(U,H)},Ct.useLayoutEffect=function(U,H){return ne.current.useLayoutEffect(U,H)},Ct.useMemo=function(U,H){return ne.current.useMemo(U,H)},Ct.useReducer=function(U,H,Z){return ne.current.useReducer(U,H,Z)},Ct.useRef=function(U){return ne.current.useRef(U)},Ct.useState=function(U){return ne.current.useState(U)},Ct.useSyncExternalStore=function(U,H,Z){return ne.current.useSyncExternalStore(U,H,Z)},Ct.useTransition=function(){return ne.current.useTransition()},Ct.version="18.3.1",Ct}L6.exports=hE();var Ue=L6.exports;const q2=uE(Ue);/**
11
+ */var N6;function hE(){if(N6)return Ct;N6=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"),l=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(U){return U===null||typeof U!="object"?null:(U=A&&U[A]||U["@@iterator"],typeof U=="function"?U:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},m=Object.assign,E={};function _(U,H,Z){this.props=U,this.context=H,this.refs=E,this.updater=Z||g}_.prototype.isReactComponent={},_.prototype.setState=function(U,H){if(typeof U!="object"&&typeof U!="function"&&U!=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,U,H,"setState")},_.prototype.forceUpdate=function(U){this.updater.enqueueForceUpdate(this,U,"forceUpdate")};function v(){}v.prototype=_.prototype;function C(U,H,Z){this.props=U,this.context=H,this.refs=E,this.updater=Z||g}var x=C.prototype=new v;x.constructor=C,m(x,_.prototype),x.isPureReactComponent=!0;var w=Array.isArray,B=Object.prototype.hasOwnProperty,T={current:null},S={key:!0,ref:!0,__self:!0,__source:!0};function D(U,H,Z){var G,oe={},pe=null,Ae=null;if(H!=null)for(G in H.ref!==void 0&&(Ae=H.ref),H.key!==void 0&&(pe=""+H.key),H)B.call(H,G)&&!S.hasOwnProperty(G)&&(oe[G]=H[G]);var ge=arguments.length-2;if(ge===1)oe.children=Z;else if(1<ge){for(var Re=Array(ge),Oe=0;Oe<ge;Oe++)Re[Oe]=arguments[Oe+2];oe.children=Re}if(U&&U.defaultProps)for(G in ge=U.defaultProps,ge)oe[G]===void 0&&(oe[G]=ge[G]);return{$$typeof:r,type:U,key:pe,ref:Ae,props:oe,_owner:T.current}}function R(U,H){return{$$typeof:r,type:U.type,key:H,ref:U.ref,props:U.props,_owner:U._owner}}function M(U){return typeof U=="object"&&U!==null&&U.$$typeof===r}function L(U){var H={"=":"=0",":":"=2"};return"$"+U.replace(/[=:]/g,function(Z){return H[Z]})}var P=/\/+/g;function F(U,H){return typeof U=="object"&&U!==null&&U.key!=null?L(""+U.key):H.toString(36)}function z(U,H,Z,G,oe){var pe=typeof U;(pe==="undefined"||pe==="boolean")&&(U=null);var Ae=!1;if(U===null)Ae=!0;else switch(pe){case"string":case"number":Ae=!0;break;case"object":switch(U.$$typeof){case r:case e:Ae=!0}}if(Ae)return Ae=U,oe=oe(Ae),U=G===""?"."+F(Ae,0):G,w(oe)?(Z="",U!=null&&(Z=U.replace(P,"$&/")+"/"),z(oe,H,Z,"",function(Oe){return Oe})):oe!=null&&(M(oe)&&(oe=R(oe,Z+(!oe.key||Ae&&Ae.key===oe.key?"":(""+oe.key).replace(P,"$&/")+"/")+U)),H.push(oe)),1;if(Ae=0,G=G===""?".":G+":",w(U))for(var ge=0;ge<U.length;ge++){pe=U[ge];var Re=G+F(pe,ge);Ae+=z(pe,H,Z,Re,oe)}else if(Re=p(U),typeof Re=="function")for(U=Re.call(U),ge=0;!(pe=U.next()).done;)pe=pe.value,Re=G+F(pe,ge++),Ae+=z(pe,H,Z,Re,oe);else if(pe==="object")throw H=String(U),Error("Objects are not valid as a React child (found: "+(H==="[object Object]"?"object with keys {"+Object.keys(U).join(", ")+"}":H)+"). If you meant to render a collection of children, use an array instead.");return Ae}function J(U,H,Z){if(U==null)return U;var G=[],oe=0;return z(U,G,"","",function(pe){return H.call(Z,pe,oe++)}),G}function q(U){if(U._status===-1){var H=U._result;H=H(),H.then(function(Z){(U._status===0||U._status===-1)&&(U._status=1,U._result=Z)},function(Z){(U._status===0||U._status===-1)&&(U._status=2,U._result=Z)}),U._status===-1&&(U._status=0,U._result=H)}if(U._status===1)return U._result.default;throw U._result}var ne={current:null},j={transition:null},te={ReactCurrentDispatcher:ne,ReactCurrentBatchConfig:j,ReactCurrentOwner:T};function W(){throw Error("act(...) is not supported in production builds of React.")}return Ct.Children={map:J,forEach:function(U,H,Z){J(U,function(){H.apply(this,arguments)},Z)},count:function(U){var H=0;return J(U,function(){H++}),H},toArray:function(U){return J(U,function(H){return H})||[]},only:function(U){if(!M(U))throw Error("React.Children.only expected to receive a single React element child.");return U}},Ct.Component=_,Ct.Fragment=t,Ct.Profiler=i,Ct.PureComponent=C,Ct.StrictMode=n,Ct.Suspense=h,Ct.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=te,Ct.act=W,Ct.cloneElement=function(U,H,Z){if(U==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+U+".");var G=m({},U.props),oe=U.key,pe=U.ref,Ae=U._owner;if(H!=null){if(H.ref!==void 0&&(pe=H.ref,Ae=T.current),H.key!==void 0&&(oe=""+H.key),U.type&&U.type.defaultProps)var ge=U.type.defaultProps;for(Re in H)B.call(H,Re)&&!S.hasOwnProperty(Re)&&(G[Re]=H[Re]===void 0&&ge!==void 0?ge[Re]:H[Re])}var Re=arguments.length-2;if(Re===1)G.children=Z;else if(1<Re){ge=Array(Re);for(var Oe=0;Oe<Re;Oe++)ge[Oe]=arguments[Oe+2];G.children=ge}return{$$typeof:r,type:U.type,key:oe,ref:pe,props:G,_owner:Ae}},Ct.createContext=function(U){return U={$$typeof:o,_currentValue:U,_currentValue2:U,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},U.Provider={$$typeof:s,_context:U},U.Consumer=U},Ct.createElement=D,Ct.createFactory=function(U){var H=D.bind(null,U);return H.type=U,H},Ct.createRef=function(){return{current:null}},Ct.forwardRef=function(U){return{$$typeof:l,render:U}},Ct.isValidElement=M,Ct.lazy=function(U){return{$$typeof:d,_payload:{_status:-1,_result:U},_init:q}},Ct.memo=function(U,H){return{$$typeof:u,type:U,compare:H===void 0?null:H}},Ct.startTransition=function(U){var H=j.transition;j.transition={};try{U()}finally{j.transition=H}},Ct.unstable_act=W,Ct.useCallback=function(U,H){return ne.current.useCallback(U,H)},Ct.useContext=function(U){return ne.current.useContext(U)},Ct.useDebugValue=function(){},Ct.useDeferredValue=function(U){return ne.current.useDeferredValue(U)},Ct.useEffect=function(U,H){return ne.current.useEffect(U,H)},Ct.useId=function(){return ne.current.useId()},Ct.useImperativeHandle=function(U,H,Z){return ne.current.useImperativeHandle(U,H,Z)},Ct.useInsertionEffect=function(U,H){return ne.current.useInsertionEffect(U,H)},Ct.useLayoutEffect=function(U,H){return ne.current.useLayoutEffect(U,H)},Ct.useMemo=function(U,H){return ne.current.useMemo(U,H)},Ct.useReducer=function(U,H,Z){return ne.current.useReducer(U,H,Z)},Ct.useRef=function(U){return ne.current.useRef(U)},Ct.useState=function(U){return ne.current.useState(U)},Ct.useSyncExternalStore=function(U,H,Z){return ne.current.useSyncExternalStore(U,H,Z)},Ct.useTransition=function(){return ne.current.useTransition()},Ct.version="18.3.1",Ct}L6.exports=hE();var ke=L6.exports;const q2=uE(ke);/**
12
12
  * @license React
13
13
  * react-jsx-runtime.production.min.js
14
14
  *
@@ -16,7 +16,7 @@ var YF=Object.defineProperty;var qF=(la,Pn,as)=>Pn in la?YF(la,Pn,{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 P6;function dE(){if(P6)return X1;P6=1;var r=Ue,e=Symbol.for("react.element"),t=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,i=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function o(l,h,u){var d,A={},p=null,g=null;u!==void 0&&(p=""+u),h.key!==void 0&&(p=""+h.key),h.ref!==void 0&&(g=h.ref);for(d in h)n.call(h,d)&&!s.hasOwnProperty(d)&&(A[d]=h[d]);if(l&&l.defaultProps)for(d in h=l.defaultProps,h)A[d]===void 0&&(A[d]=h[d]);return{$$typeof:e,type:l,key:p,ref:g,props:A,_owner:i.current}}return X1.Fragment=t,X1.jsx=o,X1.jsxs=o,X1}D6.exports=dE();var Te=D6.exports;const XF="";var fE=Object.defineProperty,pE=(r,e,t)=>e in r?fE(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,me=(r,e,t)=>(pE(r,typeof e!="symbol"?e+"":e,t),t);const AE={storePrefix:{NODE_ENV:"production"}.STORE_PREFIX||"3d-configurator-",host:{}.VITE_API_HOST||"https://api.sprie.io"},U6=Object.freeze(AE),k6={baseUrl:"https://api.sprie.io",setBaseUrl(r){this.baseUrl=r}},X2="sprie-widget-auth: ",gE=(...r)=>{console.error(X2,...r)},F6=(...r)=>{console.log(X2,...r)},O6=(...r)=>{console.warn(X2,...r)};class Q6 extends Error{constructor(e){super(`${X2} ${e}`),this.name="SprieAuthError"}}let J1=class extends Error{};J1.prototype.name="InvalidTokenError";function mE(r){return decodeURIComponent(atob(r).replace(/(.)/g,(e,t)=>{let n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n}))}function vE(r){let e=r.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return mE(e)}catch{return atob(e)}}function _E(r,e){if(typeof r!="string")throw new J1("Invalid token specified: must be a string");e||(e={});const t=e.header===!0?0:1,n=r.split(".")[t];if(typeof n!="string")throw new J1(`Invalid token specified: missing part #${t+1}`);let i;try{i=vE(n)}catch(s){throw new J1(`Invalid token specified: invalid base64 for part #${t+1} (${s.message})`)}try{return JSON.parse(i)}catch(s){throw new J1(`Invalid token specified: invalid json for part #${t+1} (${s.message})`)}}function yE(r){if(!r)return!1;try{const e=_E(r),t=Math.floor(Date.now()/1e3);return Date.parse(e.expires)/1e3>t}catch(e){return gE("Invalid JWT token:",e),!1}}let EE=class{async authenticate(r){const e=`${k6.baseUrl}/v2/widget/auth?api=${r}`;return(await fetch(e)).json()}};const ei={token:"token",orgId:"org_id",authResponse:"auth_response",apiKey:"key"};let xE=class{constructor(){me(this,"PREFIX","sprie_widget_auth_"),me(this,"validKeys",Object.values(ei))}reset(){for(const r of this.validKeys)localStorage.removeItem(this.PREFIX+r)}getItem(r){return localStorage.getItem(this.PREFIX+r)}setItem(r,e){if(!Object.values(ei).includes(r))throw new Q6("Invalid storage key");localStorage.setItem(this.PREFIX+r,e)}};class wE{constructor(){me(this,"apiService"),me(this,"storageService"),this.apiService=new EE,this.storageService=new xE}async _authenticate(e){try{const t=await this.apiService.authenticate(e);this.storageService.setItem(ei.token,t.access),this.storageService.setItem(ei.orgId,t.orgId),this.storageService.setItem(ei.authResponse,JSON.stringify(t)),this.storageService.setItem(ei.apiKey,btoa(e))}catch(t){throw this.storageService.reset(),t}}async init(e){this.isAuthenticated(e)||await this._authenticate(e)}reset(){F6("Resetting authentication data"),this.storageService.reset()}isAuthenticated(e){return this.token?yE(this.token)?e&&this.apiKey!==e?(this.reset(),!1):!0:(this.reset(),!1):!1}get token(){return this.storageService.getItem(ei.token)}get orgId(){return this.storageService.getItem(ei.orgId)}get response(){const e=this.storageService.getItem(ei.authResponse);return e?JSON.parse(e):null}get apiKey(){const e=this.storageService.getItem(ei.apiKey);return e?atob(e):null}}class CE{constructor(){me(this,"authService",new wE),me(this,"initPromise",null),me(this,"initApiKey",null),F6("Hello from SprieWidgetAuth:"),this.setupDOMListener()}setupDOMListener(){document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>{this.authService.isAuthenticated()}):this.authService.isAuthenticated()}configure({baseUrl:e}){if(!e){O6("called without baseUrl, skipping configuration");return}k6.setBaseUrl(e)}async init({apiKey:e}){if(!e)throw new Q6("API Key is required for initialization");return this.authService.isAuthenticated(e)?!0:this.initPromise?(this.initApiKey!==e&&O6("Already initializing with a different key, ignoring new key"),this.initPromise):(this.initApiKey=e,this.initPromise=this.authService.init(e).then(()=>!0).catch(t=>{throw this.initPromise=null,this.initApiKey=null,t}),this.initPromise)}isAuthenticated(){return this.authService.isAuthenticated()}reset(){this.initPromise=null,this.initApiKey=null,this.authService.reset()}get token(){return this.authService.token}get orgId(){return this.authService.orgId}get response(){return this.authService.response}get apiKey(){return this.authService.apiKey}}const i3="__sprie_widget_auth__";window[i3]||(window[i3]=new CE);const IE=window[i3];class ME{constructor(){me(this,"authPkg",IE)}async init({apiKey:e,baseUrl:t}){this.authPkg.configure({baseUrl:t}),await this.authPkg.init({apiKey:e})}isAuthenticated(){return this.authPkg.isAuthenticated()}reset(){this.authPkg.reset()}get apiKey(){return this.authPkg.apiKey}get token(){return this.authPkg.token}get orgId(){return this.authPkg.orgId}get response(){return this.authPkg.response}}const ti=new ME;class SE{constructor(e){me(this,"baseURL"),me(this,"JWT"),this.baseURL=e.baseURL}RequestOptions(e,t){return{method:e,headers:{Accept:"application/json","Content-Type":"application/json",...ti.token&&{Authorization:ti.token}},...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 J2=new SE({baseURL:U6.host});function TE(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 BE{async FetchAssetBySKUOrBarcode(e){let t="/v2/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 J2.Get(t)}async FetchCustomisationList(){const e="/v2/widget/list-customisation?search=type:Lens,usage:customizer&limit=50",t=await J2.Get(e),n=t.data.find(i=>i.sku==="lens-default");return{...t,data:TE(t.data,n)}}async DownloadMA(e){try{const t=`/v2/widget/org/${e.orgId}/asset/${e.assetsId}/universal-full-encrypted`,n=await J2.Get(t);if(!n||!n.fileUrl)throw new Error("Failed to download ,response or fileUrl missing.");const i=n.fileUrl;return{asset:n,decryptionKey:i}}catch{throw new Error("Failed to download model asset.")}}async triggerUsageEvent(e,t){try{const n={org:e,asset:t,timestamp:new Date().toISOString()},i="/v2/analytics/trigger";await J2.Post(i,n)}catch{throw new Error("Failed to trigger usage event.")}}}const s3=new BE;/**
19
+ */var P6;function dE(){if(P6)return X1;P6=1;var r=ke,e=Symbol.for("react.element"),t=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,i=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function o(l,h,u){var d,A={},p=null,g=null;u!==void 0&&(p=""+u),h.key!==void 0&&(p=""+h.key),h.ref!==void 0&&(g=h.ref);for(d in h)n.call(h,d)&&!s.hasOwnProperty(d)&&(A[d]=h[d]);if(l&&l.defaultProps)for(d in h=l.defaultProps,h)A[d]===void 0&&(A[d]=h[d]);return{$$typeof:e,type:l,key:p,ref:g,props:A,_owner:i.current}}return X1.Fragment=t,X1.jsx=o,X1.jsxs=o,X1}D6.exports=dE();var Te=D6.exports;const XF="";var fE=Object.defineProperty,pE=(r,e,t)=>e in r?fE(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,me=(r,e,t)=>(pE(r,typeof e!="symbol"?e+"":e,t),t);const AE={storePrefix:{NODE_ENV:"production"}.STORE_PREFIX||"3d-configurator-",host:{}.VITE_API_HOST||"https://api.sprie.io"},U6=Object.freeze(AE),k6={baseUrl:"https://api.sprie.io",setBaseUrl(r){this.baseUrl=r}},X2="sprie-widget-auth: ",gE=(...r)=>{console.error(X2,...r)},F6=(...r)=>{console.log(X2,...r)},O6=(...r)=>{console.warn(X2,...r)};class Q6 extends Error{constructor(e){super(`${X2} ${e}`),this.name="SprieAuthError"}}let J1=class extends Error{};J1.prototype.name="InvalidTokenError";function mE(r){return decodeURIComponent(atob(r).replace(/(.)/g,(e,t)=>{let n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n}))}function vE(r){let e=r.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return mE(e)}catch{return atob(e)}}function _E(r,e){if(typeof r!="string")throw new J1("Invalid token specified: must be a string");e||(e={});const t=e.header===!0?0:1,n=r.split(".")[t];if(typeof n!="string")throw new J1(`Invalid token specified: missing part #${t+1}`);let i;try{i=vE(n)}catch(s){throw new J1(`Invalid token specified: invalid base64 for part #${t+1} (${s.message})`)}try{return JSON.parse(i)}catch(s){throw new J1(`Invalid token specified: invalid json for part #${t+1} (${s.message})`)}}function yE(r){if(!r)return!1;try{const e=_E(r),t=Math.floor(Date.now()/1e3);return Date.parse(e.expires)/1e3>t}catch(e){return gE("Invalid JWT token:",e),!1}}let EE=class{async authenticate(r){const e=`${k6.baseUrl}/v2/widget/auth?api=${r}`;return(await fetch(e)).json()}};const ei={token:"token",orgId:"org_id",authResponse:"auth_response",apiKey:"key"};let xE=class{constructor(){me(this,"PREFIX","sprie_widget_auth_"),me(this,"validKeys",Object.values(ei))}reset(){for(const r of this.validKeys)localStorage.removeItem(this.PREFIX+r)}getItem(r){return localStorage.getItem(this.PREFIX+r)}setItem(r,e){if(!Object.values(ei).includes(r))throw new Q6("Invalid storage key");localStorage.setItem(this.PREFIX+r,e)}};class wE{constructor(){me(this,"apiService"),me(this,"storageService"),this.apiService=new EE,this.storageService=new xE}async _authenticate(e){try{const t=await this.apiService.authenticate(e);this.storageService.setItem(ei.token,t.access),this.storageService.setItem(ei.orgId,t.orgId),this.storageService.setItem(ei.authResponse,JSON.stringify(t)),this.storageService.setItem(ei.apiKey,btoa(e))}catch(t){throw this.storageService.reset(),t}}async init(e){this.isAuthenticated(e)||await this._authenticate(e)}reset(){F6("Resetting authentication data"),this.storageService.reset()}isAuthenticated(e){return this.token?yE(this.token)?e&&this.apiKey!==e?(this.reset(),!1):!0:(this.reset(),!1):!1}get token(){return this.storageService.getItem(ei.token)}get orgId(){return this.storageService.getItem(ei.orgId)}get response(){const e=this.storageService.getItem(ei.authResponse);return e?JSON.parse(e):null}get apiKey(){const e=this.storageService.getItem(ei.apiKey);return e?atob(e):null}}class CE{constructor(){me(this,"authService",new wE),me(this,"initPromise",null),me(this,"initApiKey",null),F6("Hello from SprieWidgetAuth:"),this.setupDOMListener()}setupDOMListener(){document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>{this.authService.isAuthenticated()}):this.authService.isAuthenticated()}configure({baseUrl:e}){if(!e){O6("called without baseUrl, skipping configuration");return}k6.setBaseUrl(e)}async init({apiKey:e}){if(!e)throw new Q6("API Key is required for initialization");return this.authService.isAuthenticated(e)?!0:this.initPromise?(this.initApiKey!==e&&O6("Already initializing with a different key, ignoring new key"),this.initPromise):(this.initApiKey=e,this.initPromise=this.authService.init(e).then(()=>!0).catch(t=>{throw this.initPromise=null,this.initApiKey=null,t}),this.initPromise)}isAuthenticated(){return this.authService.isAuthenticated()}reset(){this.initPromise=null,this.initApiKey=null,this.authService.reset()}get token(){return this.authService.token}get orgId(){return this.authService.orgId}get response(){return this.authService.response}get apiKey(){return this.authService.apiKey}}const i3="__sprie_widget_auth__";window[i3]||(window[i3]=new CE);const IE=window[i3];class ME{constructor(){me(this,"authPkg",IE)}async init({apiKey:e,baseUrl:t}){this.authPkg.configure({baseUrl:t}),await this.authPkg.init({apiKey:e})}isAuthenticated(){return this.authPkg.isAuthenticated()}reset(){this.authPkg.reset()}get apiKey(){return this.authPkg.apiKey}get token(){return this.authPkg.token}get orgId(){return this.authPkg.orgId}get response(){return this.authPkg.response}}const ti=new ME;class SE{constructor(e){me(this,"baseURL"),me(this,"JWT"),this.baseURL=e.baseURL}RequestOptions(e,t){return{method:e,headers:{Accept:"application/json","Content-Type":"application/json",...ti.token&&{Authorization:ti.token}},...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 J2=new SE({baseURL:U6.host});function TE(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 BE{async FetchAssetBySKUOrBarcode(e){let t="/v2/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 J2.Get(t)}async FetchCustomisationList(){const e="/v2/widget/list-customisation?search=type:Lens,usage:customizer&limit=50",t=await J2.Get(e),n=t.data.find(i=>i.sku==="lens-default");return{...t,data:TE(t.data,n)}}async DownloadMA(e){try{const t=`/v2/widget/org/${e.orgId}/asset/${e.assetsId}/universal-full-encrypted`,n=await J2.Get(t);if(!n||!n.fileUrl)throw new Error("Failed to download ,response or fileUrl missing.");const i=n.fileUrl;return{asset:n,decryptionKey:i}}catch{throw new Error("Failed to download model asset.")}}async triggerUsageEvent(e,t){try{const n={org:e,asset:t,timestamp:new Date().toISOString()},i="/v2/analytics/trigger";await J2.Post(i,n)}catch{throw new Error("Failed to trigger usage event.")}}}const s3=new BE;/**
20
20
  * @license
21
21
  * Copyright 2010-2025 Three.js Authors
22
22
  * SPDX-License-Identifier: MIT
@@ -3589,7 +3589,7 @@ void main() {
3589
3589
  #include <tonemapping_fragment>
3590
3590
  #include <colorspace_fragment>
3591
3591
  #include <fog_fragment>
3592
- }`,yt={alphahash_fragment:rC,alphahash_pars_fragment:nC,alphamap_fragment:iC,alphamap_pars_fragment:sC,alphatest_fragment:aC,alphatest_pars_fragment:oC,aomap_fragment:lC,aomap_pars_fragment:cC,batching_pars_vertex:uC,batching_vertex:hC,begin_vertex:dC,beginnormal_vertex:fC,bsdfs:pC,iridescence_fragment:AC,bumpmap_pars_fragment:gC,clipping_planes_fragment:mC,clipping_planes_pars_fragment:vC,clipping_planes_pars_vertex:_C,clipping_planes_vertex:yC,color_fragment:EC,color_pars_fragment:xC,color_pars_vertex:wC,color_vertex:CC,common:IC,cube_uv_reflection_fragment:MC,defaultnormal_vertex:SC,displacementmap_pars_vertex:TC,displacementmap_vertex:BC,emissivemap_fragment:bC,emissivemap_pars_fragment:RC,colorspace_fragment:DC,colorspace_pars_fragment:LC,envmap_fragment:NC,envmap_common_pars_fragment:PC,envmap_pars_fragment:UC,envmap_pars_vertex:kC,envmap_physical_pars_fragment:qC,envmap_vertex:FC,fog_vertex:OC,fog_pars_vertex:QC,fog_fragment:zC,fog_pars_fragment:GC,gradientmap_pars_fragment:HC,lightmap_pars_fragment:VC,lights_lambert_fragment:jC,lights_lambert_pars_fragment:WC,lights_pars_begin:YC,lights_toon_fragment:XC,lights_toon_pars_fragment:JC,lights_phong_fragment:KC,lights_phong_pars_fragment:ZC,lights_physical_fragment:$C,lights_physical_pars_fragment:eI,lights_fragment_begin:tI,lights_fragment_maps:rI,lights_fragment_end:nI,logdepthbuf_fragment:iI,logdepthbuf_pars_fragment:sI,logdepthbuf_pars_vertex:aI,logdepthbuf_vertex:oI,map_fragment:lI,map_pars_fragment:cI,map_particle_fragment:uI,map_particle_pars_fragment:hI,metalnessmap_fragment:dI,metalnessmap_pars_fragment:fI,morphinstance_vertex:pI,morphcolor_vertex:AI,morphnormal_vertex:gI,morphtarget_pars_vertex:mI,morphtarget_vertex:vI,normal_fragment_begin:_I,normal_fragment_maps:yI,normal_pars_fragment:EI,normal_pars_vertex:xI,normal_vertex:wI,normalmap_pars_fragment:CI,clearcoat_normal_fragment_begin:II,clearcoat_normal_fragment_maps:MI,clearcoat_pars_fragment:SI,iridescence_pars_fragment:TI,opaque_fragment:BI,packing:bI,premultiplied_alpha_fragment:RI,project_vertex:DI,dithering_fragment:LI,dithering_pars_fragment:NI,roughnessmap_fragment:PI,roughnessmap_pars_fragment:UI,shadowmap_pars_fragment:kI,shadowmap_pars_vertex:FI,shadowmap_vertex:OI,shadowmask_pars_fragment:QI,skinbase_vertex:zI,skinning_pars_vertex:GI,skinning_vertex:HI,skinnormal_vertex:VI,specularmap_fragment:jI,specularmap_pars_fragment:WI,tonemapping_fragment:YI,tonemapping_pars_fragment:qI,transmission_fragment:XI,transmission_pars_fragment:JI,uv_pars_fragment:KI,uv_pars_vertex:ZI,uv_vertex:$I,worldpos_vertex:eM,background_vert:tM,background_frag:rM,backgroundCube_vert:nM,backgroundCube_frag:iM,cube_vert:sM,cube_frag:aM,depth_vert:oM,depth_frag:lM,distanceRGBA_vert:cM,distanceRGBA_frag:uM,equirect_vert:hM,equirect_frag:dM,linedashed_vert:fM,linedashed_frag:pM,meshbasic_vert:AM,meshbasic_frag:gM,meshlambert_vert:mM,meshlambert_frag:vM,meshmatcap_vert:_M,meshmatcap_frag:yM,meshnormal_vert:EM,meshnormal_frag:xM,meshphong_vert:wM,meshphong_frag:CM,meshphysical_vert:IM,meshphysical_frag:MM,meshtoon_vert:SM,meshtoon_frag:TM,points_vert:BM,points_frag:bM,shadow_vert:RM,shadow_frag:DM,sprite_vert:LM,sprite_frag:NM},Ne={common:{diffuse:{value:new We(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new _t},alphaMap:{value:null},alphaMapTransform:{value:new _t},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new _t}},envmap:{envMap:{value:null},envMapRotation:{value:new _t},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new _t}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new _t}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new _t},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new _t},normalScale:{value:new ze(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new _t},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new _t}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new _t}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new _t}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new We(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new We(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new _t},alphaTest:{value:0},uvTransform:{value:new _t}},sprite:{diffuse:{value:new We(16777215)},opacity:{value:1},center:{value:new ze(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new _t},alphaMap:{value:null},alphaMapTransform:{value:new _t},alphaTest:{value:0}}},li={basic:{uniforms:Cr([Ne.common,Ne.specularmap,Ne.envmap,Ne.aomap,Ne.lightmap,Ne.fog]),vertexShader:yt.meshbasic_vert,fragmentShader:yt.meshbasic_frag},lambert:{uniforms:Cr([Ne.common,Ne.specularmap,Ne.envmap,Ne.aomap,Ne.lightmap,Ne.emissivemap,Ne.bumpmap,Ne.normalmap,Ne.displacementmap,Ne.fog,Ne.lights,{emissive:{value:new We(0)}}]),vertexShader:yt.meshlambert_vert,fragmentShader:yt.meshlambert_frag},phong:{uniforms:Cr([Ne.common,Ne.specularmap,Ne.envmap,Ne.aomap,Ne.lightmap,Ne.emissivemap,Ne.bumpmap,Ne.normalmap,Ne.displacementmap,Ne.fog,Ne.lights,{emissive:{value:new We(0)},specular:{value:new We(1118481)},shininess:{value:30}}]),vertexShader:yt.meshphong_vert,fragmentShader:yt.meshphong_frag},standard:{uniforms:Cr([Ne.common,Ne.envmap,Ne.aomap,Ne.lightmap,Ne.emissivemap,Ne.bumpmap,Ne.normalmap,Ne.displacementmap,Ne.roughnessmap,Ne.metalnessmap,Ne.fog,Ne.lights,{emissive:{value:new We(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:yt.meshphysical_vert,fragmentShader:yt.meshphysical_frag},toon:{uniforms:Cr([Ne.common,Ne.aomap,Ne.lightmap,Ne.emissivemap,Ne.bumpmap,Ne.normalmap,Ne.displacementmap,Ne.gradientmap,Ne.fog,Ne.lights,{emissive:{value:new We(0)}}]),vertexShader:yt.meshtoon_vert,fragmentShader:yt.meshtoon_frag},matcap:{uniforms:Cr([Ne.common,Ne.bumpmap,Ne.normalmap,Ne.displacementmap,Ne.fog,{matcap:{value:null}}]),vertexShader:yt.meshmatcap_vert,fragmentShader:yt.meshmatcap_frag},points:{uniforms:Cr([Ne.points,Ne.fog]),vertexShader:yt.points_vert,fragmentShader:yt.points_frag},dashed:{uniforms:Cr([Ne.common,Ne.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:yt.linedashed_vert,fragmentShader:yt.linedashed_frag},depth:{uniforms:Cr([Ne.common,Ne.displacementmap]),vertexShader:yt.depth_vert,fragmentShader:yt.depth_frag},normal:{uniforms:Cr([Ne.common,Ne.bumpmap,Ne.normalmap,Ne.displacementmap,{opacity:{value:1}}]),vertexShader:yt.meshnormal_vert,fragmentShader:yt.meshnormal_frag},sprite:{uniforms:Cr([Ne.sprite,Ne.fog]),vertexShader:yt.sprite_vert,fragmentShader:yt.sprite_frag},background:{uniforms:{uvTransform:{value:new _t},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:yt.background_vert,fragmentShader:yt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new _t}},vertexShader:yt.backgroundCube_vert,fragmentShader:yt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:yt.cube_vert,fragmentShader:yt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:yt.equirect_vert,fragmentShader:yt.equirect_frag},distanceRGBA:{uniforms:Cr([Ne.common,Ne.displacementmap,{referencePosition:{value:new V},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:yt.distanceRGBA_vert,fragmentShader:yt.distanceRGBA_frag},shadow:{uniforms:Cr([Ne.lights,Ne.fog,{color:{value:new We(0)},opacity:{value:1}}]),vertexShader:yt.shadow_vert,fragmentShader:yt.shadow_frag}};li.physical={uniforms:Cr([li.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new _t},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new _t},clearcoatNormalScale:{value:new ze(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new _t},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new _t},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new _t},sheen:{value:0},sheenColor:{value:new We(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new _t},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new _t},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new _t},transmissionSamplerSize:{value:new ze},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new _t},attenuationDistance:{value:0},attenuationColor:{value:new We(0)},specularColor:{value:new We(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new _t},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new _t},anisotropyVector:{value:new ze},anisotropyMap:{value:null},anisotropyMapTransform:{value:new _t}}]),vertexShader:yt.meshphysical_vert,fragmentShader:yt.meshphysical_frag};const G9={r:0,b:0,g:0},va=new ni,PM=new lt;function UM(r,e,t,n,i,s,o){const l=new We(0);let h=s===!0?0:1,u,d,A=null,p=0,g=null;function m(x){let w=x.isScene===!0?x.background:null;return w&&w.isTexture&&(w=(x.backgroundBlurriness>0?t:e).get(w)),w}function E(x){let w=!1;const B=m(x);B===null?v(l,h):B&&B.isColor&&(v(B,1),w=!0);const T=r.xr.getEnvironmentBlendMode();T==="additive"?n.buffers.color.setClear(0,0,0,1,o):T==="alpha-blend"&&n.buffers.color.setClear(0,0,0,0,o),(r.autoClear||w)&&(n.buffers.depth.setTest(!0),n.buffers.depth.setMask(!0),n.buffers.color.setMask(!0),r.clear(r.autoClearColor,r.autoClearDepth,r.autoClearStencil))}function _(x,w){const B=m(w);B&&(B.isCubeTexture||B.mapping===Z2)?(d===void 0&&(d=new T0(new pl(1,1,1),new B0({name:"BackgroundCubeMaterial",uniforms:Do(li.backgroundCube.uniforms),vertexShader:li.backgroundCube.vertexShader,fragmentShader:li.backgroundCube.fragmentShader,side:V0,depthTest:!1,depthWrite:!1,fog:!1})),d.geometry.deleteAttribute("normal"),d.geometry.deleteAttribute("uv"),d.onBeforeRender=function(T,S,D){this.matrixWorld.copyPosition(D.matrixWorld)},Object.defineProperty(d.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(d)),va.copy(w.backgroundRotation),va.x*=-1,va.y*=-1,va.z*=-1,B.isCubeTexture&&B.isRenderTargetTexture===!1&&(va.y*=-1,va.z*=-1),d.material.uniforms.envMap.value=B,d.material.uniforms.flipEnvMap.value=B.isCubeTexture&&B.isRenderTargetTexture===!1?-1:1,d.material.uniforms.backgroundBlurriness.value=w.backgroundBlurriness,d.material.uniforms.backgroundIntensity.value=w.backgroundIntensity,d.material.uniforms.backgroundRotation.value.setFromMatrix4(PM.makeRotationFromEuler(va)),d.material.toneMapped=St.getTransfer(B.colorSpace)!==Ot,(A!==B||p!==B.version||g!==r.toneMapping)&&(d.material.needsUpdate=!0,A=B,p=B.version,g=r.toneMapping),d.layers.enableAll(),x.unshift(d,d.geometry,d.material,0,0,null)):B&&B.isTexture&&(u===void 0&&(u=new T0(new _l(2,2),new B0({name:"BackgroundMaterial",uniforms:Do(li.background.uniforms),vertexShader:li.background.vertexShader,fragmentShader:li.background.fragmentShader,side:Un,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),Object.defineProperty(u.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(u)),u.material.uniforms.t2D.value=B,u.material.uniforms.backgroundIntensity.value=w.backgroundIntensity,u.material.toneMapped=St.getTransfer(B.colorSpace)!==Ot,B.matrixAutoUpdate===!0&&B.updateMatrix(),u.material.uniforms.uvTransform.value.copy(B.matrix),(A!==B||p!==B.version||g!==r.toneMapping)&&(u.material.needsUpdate=!0,A=B,p=B.version,g=r.toneMapping),u.layers.enableAll(),x.unshift(u,u.geometry,u.material,0,0,null))}function v(x,w){x.getRGB(G9,Ud(r)),n.buffers.color.setClear(G9.r,G9.g,G9.b,w,o)}function C(){d!==void 0&&(d.geometry.dispose(),d.material.dispose(),d=void 0),u!==void 0&&(u.geometry.dispose(),u.material.dispose(),u=void 0)}return{getClearColor:function(){return l},setClearColor:function(x,w=1){l.set(x),h=w,v(l,h)},getClearAlpha:function(){return h},setClearAlpha:function(x){h=x,v(l,h)},render:E,addToRenderList:_,dispose:C}}function kM(r,e){const t=r.getParameter(r.MAX_VERTEX_ATTRIBS),n={},i=p(null);let s=i,o=!1;function l(M,L,P,F,z){let J=!1;const q=A(F,P,L);s!==q&&(s=q,u(s.object)),J=g(M,F,P,z),J&&m(M,F,P,z),z!==null&&e.update(z,r.ELEMENT_ARRAY_BUFFER),(J||o)&&(o=!1,w(M,L,P,F),z!==null&&r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,e.get(z).buffer))}function h(){return r.createVertexArray()}function u(M){return r.bindVertexArray(M)}function d(M){return r.deleteVertexArray(M)}function A(M,L,P){const F=P.wireframe===!0;let z=n[M.id];z===void 0&&(z={},n[M.id]=z);let J=z[L.id];J===void 0&&(J={},z[L.id]=J);let q=J[F];return q===void 0&&(q=p(h()),J[F]=q),q}function p(M){const L=[],P=[],F=[];for(let z=0;z<t;z++)L[z]=0,P[z]=0,F[z]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:L,enabledAttributes:P,attributeDivisors:F,object:M,attributes:{},index:null}}function g(M,L,P,F){const z=s.attributes,J=L.attributes;let q=0;const ne=P.getAttributes();for(const j in ne)if(ne[j].location>=0){const te=z[j];let W=J[j];if(W===void 0&&(j==="instanceMatrix"&&M.instanceMatrix&&(W=M.instanceMatrix),j==="instanceColor"&&M.instanceColor&&(W=M.instanceColor)),te===void 0||te.attribute!==W||W&&te.data!==W.data)return!0;q++}return s.attributesNum!==q||s.index!==F}function m(M,L,P,F){const z={},J=L.attributes;let q=0;const ne=P.getAttributes();for(const j in ne)if(ne[j].location>=0){let te=J[j];te===void 0&&(j==="instanceMatrix"&&M.instanceMatrix&&(te=M.instanceMatrix),j==="instanceColor"&&M.instanceColor&&(te=M.instanceColor));const W={};W.attribute=te,te&&te.data&&(W.data=te.data),z[j]=W,q++}s.attributes=z,s.attributesNum=q,s.index=F}function E(){const M=s.newAttributes;for(let L=0,P=M.length;L<P;L++)M[L]=0}function _(M){v(M,0)}function v(M,L){const P=s.newAttributes,F=s.enabledAttributes,z=s.attributeDivisors;P[M]=1,F[M]===0&&(r.enableVertexAttribArray(M),F[M]=1),z[M]!==L&&(r.vertexAttribDivisor(M,L),z[M]=L)}function C(){const M=s.newAttributes,L=s.enabledAttributes;for(let P=0,F=L.length;P<F;P++)L[P]!==M[P]&&(r.disableVertexAttribArray(P),L[P]=0)}function x(M,L,P,F,z,J,q){q===!0?r.vertexAttribIPointer(M,L,P,z,J):r.vertexAttribPointer(M,L,P,F,z,J)}function w(M,L,P,F){E();const z=F.attributes,J=P.getAttributes(),q=L.defaultAttributeValues;for(const ne in J){const j=J[ne];if(j.location>=0){let te=z[ne];if(te===void 0&&(ne==="instanceMatrix"&&M.instanceMatrix&&(te=M.instanceMatrix),ne==="instanceColor"&&M.instanceColor&&(te=M.instanceColor)),te!==void 0){const W=te.normalized,U=te.itemSize,H=e.get(te);if(H===void 0)continue;const Z=H.buffer,G=H.type,oe=H.bytesPerElement,pe=G===r.INT||G===r.UNSIGNED_INT||te.gpuType===fo;if(te.isInterleavedBufferAttribute){const Ae=te.data,ge=Ae.stride,Re=te.offset;if(Ae.isInstancedInterleavedBuffer){for(let Fe=0;Fe<j.locationSize;Fe++)v(j.location+Fe,Ae.meshPerAttribute);M.isInstancedMesh!==!0&&F._maxInstanceCount===void 0&&(F._maxInstanceCount=Ae.meshPerAttribute*Ae.count)}else for(let Fe=0;Fe<j.locationSize;Fe++)_(j.location+Fe);r.bindBuffer(r.ARRAY_BUFFER,Z);for(let Fe=0;Fe<j.locationSize;Fe++)x(j.location+Fe,U/j.locationSize,G,W,ge*oe,(Re+U/j.locationSize*Fe)*oe,pe)}else{if(te.isInstancedBufferAttribute){for(let Ae=0;Ae<j.locationSize;Ae++)v(j.location+Ae,te.meshPerAttribute);M.isInstancedMesh!==!0&&F._maxInstanceCount===void 0&&(F._maxInstanceCount=te.meshPerAttribute*te.count)}else for(let Ae=0;Ae<j.locationSize;Ae++)_(j.location+Ae);r.bindBuffer(r.ARRAY_BUFFER,Z);for(let Ae=0;Ae<j.locationSize;Ae++)x(j.location+Ae,U/j.locationSize,G,W,U*oe,U/j.locationSize*Ae*oe,pe)}}else if(q!==void 0){const W=q[ne];if(W!==void 0)switch(W.length){case 2:r.vertexAttrib2fv(j.location,W);break;case 3:r.vertexAttrib3fv(j.location,W);break;case 4:r.vertexAttrib4fv(j.location,W);break;default:r.vertexAttrib1fv(j.location,W)}}}}C()}function B(){D();for(const M in n){const L=n[M];for(const P in L){const F=L[P];for(const z in F)d(F[z].object),delete F[z];delete L[P]}delete n[M]}}function T(M){if(n[M.id]===void 0)return;const L=n[M.id];for(const P in L){const F=L[P];for(const z in F)d(F[z].object),delete F[z];delete L[P]}delete n[M.id]}function S(M){for(const L in n){const P=n[L];if(P[M.id]===void 0)continue;const F=P[M.id];for(const z in F)d(F[z].object),delete F[z];delete P[M.id]}}function D(){R(),o=!0,s!==i&&(s=i,u(s.object))}function R(){i.geometry=null,i.program=null,i.wireframe=!1}return{setup:l,reset:D,resetDefaultState:R,dispose:B,releaseStatesOfGeometry:T,releaseStatesOfProgram:S,initAttributes:E,enableAttribute:_,disableUnusedAttributes:C}}function FM(r,e,t){let n;function i(u){n=u}function s(u,d){r.drawArrays(n,u,d),t.update(d,n,1)}function o(u,d,A){A!==0&&(r.drawArraysInstanced(n,u,d,A),t.update(d,n,A))}function l(u,d,A){if(A===0)return;e.get("WEBGL_multi_draw").multiDrawArraysWEBGL(n,u,0,d,0,A);let p=0;for(let g=0;g<A;g++)p+=d[g];t.update(p,n,1)}function h(u,d,A,p){if(A===0)return;const g=e.get("WEBGL_multi_draw");if(g===null)for(let m=0;m<u.length;m++)o(u[m],d[m],p[m]);else{g.multiDrawArraysInstancedWEBGL(n,u,0,d,0,p,0,A);let m=0;for(let E=0;E<A;E++)m+=d[E]*p[E];t.update(m,n,1)}}this.setMode=i,this.render=s,this.renderInstances=o,this.renderMultiDraw=l,this.renderMultiDrawInstances=h}function OM(r,e,t,n){let i;function s(){if(i!==void 0)return i;if(e.has("EXT_texture_filter_anisotropic")===!0){const S=e.get("EXT_texture_filter_anisotropic");i=r.getParameter(S.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i}function o(S){return!(S!==Kt&&n.convert(S)!==r.getParameter(r.IMPLEMENTATION_COLOR_READ_FORMAT))}function l(S){const D=S===p0&&(e.has("EXT_color_buffer_half_float")||e.has("EXT_color_buffer_float"));return!(S!==w0&&n.convert(S)!==r.getParameter(r.IMPLEMENTATION_COLOR_READ_TYPE)&&S!==Jt&&!D)}function h(S){if(S==="highp"){if(r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.HIGH_FLOAT).precision>0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT).precision>0)return"highp";S="mediump"}return S==="mediump"&&r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.MEDIUM_FLOAT).precision>0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let u=t.precision!==void 0?t.precision:"highp";const d=h(u);d!==u&&(console.warn("THREE.WebGLRenderer:",u,"not supported, using",d,"instead."),u=d);const A=t.logarithmicDepthBuffer===!0,p=t.reverseDepthBuffer===!0&&e.has("EXT_clip_control"),g=r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS),m=r.getParameter(r.MAX_VERTEX_TEXTURE_IMAGE_UNITS),E=r.getParameter(r.MAX_TEXTURE_SIZE),_=r.getParameter(r.MAX_CUBE_MAP_TEXTURE_SIZE),v=r.getParameter(r.MAX_VERTEX_ATTRIBS),C=r.getParameter(r.MAX_VERTEX_UNIFORM_VECTORS),x=r.getParameter(r.MAX_VARYING_VECTORS),w=r.getParameter(r.MAX_FRAGMENT_UNIFORM_VECTORS),B=m>0,T=r.getParameter(r.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:s,getMaxPrecision:h,textureFormatReadable:o,textureTypeReadable:l,precision:u,logarithmicDepthBuffer:A,reverseDepthBuffer:p,maxTextures:g,maxVertexTextures:m,maxTextureSize:E,maxCubemapSize:_,maxAttributes:v,maxVertexUniforms:C,maxVaryings:x,maxFragmentUniforms:w,vertexTextures:B,maxSamples:T}}function QM(r){const e=this;let t=null,n=0,i=!1,s=!1;const o=new ai,l=new _t,h={value:null,needsUpdate:!1};this.uniform=h,this.numPlanes=0,this.numIntersection=0,this.init=function(A,p){const g=A.length!==0||p||n!==0||i;return i=p,n=A.length,g},this.beginShadows=function(){s=!0,d(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(A,p){t=d(A,p,0)},this.setState=function(A,p,g){const m=A.clippingPlanes,E=A.clipIntersection,_=A.clipShadows,v=r.get(A);if(!i||m===null||m.length===0||s&&!_)s?d(null):u();else{const C=s?0:n,x=C*4;let w=v.clippingState||null;h.value=w,w=d(m,p,x,g);for(let B=0;B!==x;++B)w[B]=t[B];v.clippingState=w,this.numIntersection=E?this.numPlanes:0,this.numPlanes+=C}};function u(){h.value!==t&&(h.value=t,h.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function d(A,p,g,m){const E=A!==null?A.length:0;let _=null;if(E!==0){if(_=h.value,m!==!0||_===null){const v=g+E*4,C=p.matrixWorldInverse;l.getNormalMatrix(C),(_===null||_.length<v)&&(_=new Float32Array(v));for(let x=0,w=g;x!==E;++x,w+=4)o.copy(A[x]).applyMatrix4(C,l),o.normal.toArray(_,w),_[w+3]=o.constant}h.value=_,h.needsUpdate=!0}return e.numPlanes=E,e.numIntersection=0,_}}function zM(r){let e=new WeakMap;function t(o,l){return l===K2?o.mapping=ua:l===v3&&(o.mapping=uo),o}function n(o){if(o&&o.isTexture){const l=o.mapping;if(l===K2||l===v3)if(e.has(o)){const h=e.get(o).texture;return t(h,o.mapping)}else{const h=o.image;if(h&&h.height>0){const u=new rw(h.height);return u.fromEquirectangularTexture(r,o),e.set(o,u),o.addEventListener("dispose",i),t(u.texture,o.mapping)}else return null}}return o}function i(o){const l=o.target;l.removeEventListener("dispose",i);const h=e.get(l);h!==void 0&&(e.delete(l),h.dispose())}function s(){e=new WeakMap}return{get:n,dispose:s}}const Go=4,x7=[.125,.215,.35,.446,.526,.582],_a=20,T4=new wl,w7=new We;let B4=null,b4=0,R4=0,D4=!1;const ya=(1+Math.sqrt(5))/2,Ho=1/ya,C7=[new V(-ya,Ho,0),new V(ya,Ho,0),new V(-Ho,0,ya),new V(Ho,0,ya),new V(0,ya,-Ho),new V(0,ya,Ho),new V(-1,1,-1),new V(1,1,-1),new V(-1,1,1),new V(1,1,1)],GM=new V;class I7{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,n=.1,i=100,s={}){const{size:o=256,position:l=GM}=s;B4=this._renderer.getRenderTarget(),b4=this._renderer.getActiveCubeFace(),R4=this._renderer.getActiveMipmapLevel(),D4=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(o);const h=this._allocateTargets();return h.depthBuffer=!0,this._sceneToCubeUV(e,n,i,h,l),t>0&&this._blur(h,0,0,t),this._applyPMREM(h),this._cleanup(h),h}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=T7(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=S7(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodPlanes.length;e++)this._lodPlanes[e].dispose()}_cleanup(e){this._renderer.setRenderTarget(B4,b4,R4),this._renderer.xr.enabled=D4,e.scissorTest=!1,H9(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===ua||e.mapping===uo?this._setSize(e.image.length===0?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),B4=this._renderer.getRenderTarget(),b4=this._renderer.getActiveCubeFace(),R4=this._renderer.getActiveMipmapLevel(),D4=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;const n=t||this._allocateTargets();return this._textureToCubeUV(e,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){const e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,n={magFilter:Gt,minFilter:Gt,generateMipmaps:!1,type:p0,format:Kt,colorSpace:j0,depthBuffer:!1},i=M7(e,t,n);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=M7(e,t,n);const{_lodMax:s}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=HM(s)),this._blurMaterial=VM(s,e,t)}return i}_compileMaterial(e){const t=new T0(this._lodPlanes[0],e);this._renderer.compile(t,T4)}_sceneToCubeUV(e,t,n,i,s){const o=new pr(90,1,t,n),l=[1,-1,1,1,1,1],h=[1,1,1,-1,-1,-1],u=this._renderer,d=u.autoClear,A=u.toneMapping;u.getClearColor(w7),u.toneMapping=cs,u.autoClear=!1;const p=new si({name:"PMREM.Background",side:V0,depthWrite:!1,depthTest:!1}),g=new T0(new pl,p);let m=!1;const E=e.background;E?E.isColor&&(p.color.copy(E),e.background=null,m=!0):(p.color.copy(w7),m=!0);for(let _=0;_<6;_++){const v=_%3;v===0?(o.up.set(0,l[_],0),o.position.set(s.x,s.y,s.z),o.lookAt(s.x+h[_],s.y,s.z)):v===1?(o.up.set(0,0,l[_]),o.position.set(s.x,s.y,s.z),o.lookAt(s.x,s.y+h[_],s.z)):(o.up.set(0,l[_],0),o.position.set(s.x,s.y,s.z),o.lookAt(s.x,s.y,s.z+h[_]));const C=this._cubeSize;H9(i,v*C,_>2?C:0,C,C),u.setRenderTarget(i),m&&u.render(g,o),u.render(e,o)}g.geometry.dispose(),g.material.dispose(),u.toneMapping=A,u.autoClear=d,e.background=E}_textureToCubeUV(e,t){const n=this._renderer,i=e.mapping===ua||e.mapping===uo;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=T7()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=S7());const s=i?this._cubemapMaterial:this._equirectMaterial,o=new T0(this._lodPlanes[0],s),l=s.uniforms;l.envMap.value=e;const h=this._cubeSize;H9(t,0,0,3*h,2*h),n.setRenderTarget(t),n.render(o,T4)}_applyPMREM(e){const t=this._renderer,n=t.autoClear;t.autoClear=!1;const i=this._lodPlanes.length;for(let s=1;s<i;s++){const o=Math.sqrt(this._sigmas[s]*this._sigmas[s]-this._sigmas[s-1]*this._sigmas[s-1]),l=C7[(i-s-1)%C7.length];this._blur(e,s-1,s,o,l)}t.autoClear=n}_blur(e,t,n,i,s){const o=this._pingPongRenderTarget;this._halfBlur(e,o,t,n,i,"latitudinal",s),this._halfBlur(o,e,n,n,i,"longitudinal",s)}_halfBlur(e,t,n,i,s,o,l){const h=this._renderer,u=this._blurMaterial;o!=="latitudinal"&&o!=="longitudinal"&&console.error("blur direction must be either latitudinal or longitudinal!");const d=3,A=new T0(this._lodPlanes[i],u),p=u.uniforms,g=this._sizeLods[n]-1,m=isFinite(s)?Math.PI/(2*g):2*Math.PI/(2*_a-1),E=s/m,_=isFinite(s)?1+Math.floor(d*E):_a;_>_a&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${_} samples when the maximum is set to ${_a}`);const v=[];let C=0;for(let S=0;S<_a;++S){const D=S/E,R=Math.exp(-D*D/2);v.push(R),S===0?C+=R:S<_&&(C+=2*R)}for(let S=0;S<v.length;S++)v[S]=v[S]/C;p.envMap.value=e.texture,p.samples.value=_,p.weights.value=v,p.latitudinal.value=o==="latitudinal",l&&(p.poleAxis.value=l);const{_lodMax:x}=this;p.dTheta.value=m,p.mipInt.value=x-n;const w=this._sizeLods[i],B=3*w*(i>x-Go?i-x+Go:0),T=4*(this._cubeSize-w);H9(t,B,T,3*w,2*w),h.setRenderTarget(t),h.render(A,T4)}}function HM(r){const e=[],t=[],n=[];let i=r;const s=r-Go+1+x7.length;for(let o=0;o<s;o++){const l=Math.pow(2,i);t.push(l);let h=1/l;o>r-Go?h=x7[o-r+Go-1]:o===0&&(h=0),n.push(h);const u=1/(l-2),d=-u,A=1+u,p=[d,d,A,d,A,A,d,d,A,A,d,A],g=6,m=6,E=3,_=2,v=1,C=new Float32Array(E*m*g),x=new Float32Array(_*m*g),w=new Float32Array(v*m*g);for(let T=0;T<g;T++){const S=T%3*2/3-1,D=T>2?0:-1,R=[S,D,0,S+2/3,D,0,S+2/3,D+1,0,S,D,0,S+2/3,D+1,0,S,D+1,0];C.set(R,E*m*T),x.set(p,_*m*T);const M=[T,T,T,T,T,T];w.set(M,v*m*T)}const B=new vn;B.setAttribute("position",new S0(C,E)),B.setAttribute("uv",new S0(x,_)),B.setAttribute("faceIndex",new S0(w,v)),e.push(B),i>Go&&i--}return{lodPlanes:e,sizeLods:t,sigmas:n}}function M7(r,e,t){const n=new Nr(r,e,t);return n.texture.mapping=Z2,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function H9(r,e,t,n,i){r.viewport.set(e,t,n,i),r.scissor.set(e,t,n,i)}function VM(r,e,t){const n=new Float32Array(_a),i=new V(0,1,0);return new B0({name:"SphericalGaussianBlur",defines:{n:_a,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${r}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:L4(),fragmentShader:`
3592
+ }`,yt={alphahash_fragment:rC,alphahash_pars_fragment:nC,alphamap_fragment:iC,alphamap_pars_fragment:sC,alphatest_fragment:aC,alphatest_pars_fragment:oC,aomap_fragment:lC,aomap_pars_fragment:cC,batching_pars_vertex:uC,batching_vertex:hC,begin_vertex:dC,beginnormal_vertex:fC,bsdfs:pC,iridescence_fragment:AC,bumpmap_pars_fragment:gC,clipping_planes_fragment:mC,clipping_planes_pars_fragment:vC,clipping_planes_pars_vertex:_C,clipping_planes_vertex:yC,color_fragment:EC,color_pars_fragment:xC,color_pars_vertex:wC,color_vertex:CC,common:IC,cube_uv_reflection_fragment:MC,defaultnormal_vertex:SC,displacementmap_pars_vertex:TC,displacementmap_vertex:BC,emissivemap_fragment:bC,emissivemap_pars_fragment:RC,colorspace_fragment:DC,colorspace_pars_fragment:LC,envmap_fragment:NC,envmap_common_pars_fragment:PC,envmap_pars_fragment:UC,envmap_pars_vertex:kC,envmap_physical_pars_fragment:qC,envmap_vertex:FC,fog_vertex:OC,fog_pars_vertex:QC,fog_fragment:zC,fog_pars_fragment:GC,gradientmap_pars_fragment:HC,lightmap_pars_fragment:VC,lights_lambert_fragment:jC,lights_lambert_pars_fragment:WC,lights_pars_begin:YC,lights_toon_fragment:XC,lights_toon_pars_fragment:JC,lights_phong_fragment:KC,lights_phong_pars_fragment:ZC,lights_physical_fragment:$C,lights_physical_pars_fragment:eI,lights_fragment_begin:tI,lights_fragment_maps:rI,lights_fragment_end:nI,logdepthbuf_fragment:iI,logdepthbuf_pars_fragment:sI,logdepthbuf_pars_vertex:aI,logdepthbuf_vertex:oI,map_fragment:lI,map_pars_fragment:cI,map_particle_fragment:uI,map_particle_pars_fragment:hI,metalnessmap_fragment:dI,metalnessmap_pars_fragment:fI,morphinstance_vertex:pI,morphcolor_vertex:AI,morphnormal_vertex:gI,morphtarget_pars_vertex:mI,morphtarget_vertex:vI,normal_fragment_begin:_I,normal_fragment_maps:yI,normal_pars_fragment:EI,normal_pars_vertex:xI,normal_vertex:wI,normalmap_pars_fragment:CI,clearcoat_normal_fragment_begin:II,clearcoat_normal_fragment_maps:MI,clearcoat_pars_fragment:SI,iridescence_pars_fragment:TI,opaque_fragment:BI,packing:bI,premultiplied_alpha_fragment:RI,project_vertex:DI,dithering_fragment:LI,dithering_pars_fragment:NI,roughnessmap_fragment:PI,roughnessmap_pars_fragment:UI,shadowmap_pars_fragment:kI,shadowmap_pars_vertex:FI,shadowmap_vertex:OI,shadowmask_pars_fragment:QI,skinbase_vertex:zI,skinning_pars_vertex:GI,skinning_vertex:HI,skinnormal_vertex:VI,specularmap_fragment:jI,specularmap_pars_fragment:WI,tonemapping_fragment:YI,tonemapping_pars_fragment:qI,transmission_fragment:XI,transmission_pars_fragment:JI,uv_pars_fragment:KI,uv_pars_vertex:ZI,uv_vertex:$I,worldpos_vertex:eM,background_vert:tM,background_frag:rM,backgroundCube_vert:nM,backgroundCube_frag:iM,cube_vert:sM,cube_frag:aM,depth_vert:oM,depth_frag:lM,distanceRGBA_vert:cM,distanceRGBA_frag:uM,equirect_vert:hM,equirect_frag:dM,linedashed_vert:fM,linedashed_frag:pM,meshbasic_vert:AM,meshbasic_frag:gM,meshlambert_vert:mM,meshlambert_frag:vM,meshmatcap_vert:_M,meshmatcap_frag:yM,meshnormal_vert:EM,meshnormal_frag:xM,meshphong_vert:wM,meshphong_frag:CM,meshphysical_vert:IM,meshphysical_frag:MM,meshtoon_vert:SM,meshtoon_frag:TM,points_vert:BM,points_frag:bM,shadow_vert:RM,shadow_frag:DM,sprite_vert:LM,sprite_frag:NM},Ne={common:{diffuse:{value:new We(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new _t},alphaMap:{value:null},alphaMapTransform:{value:new _t},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new _t}},envmap:{envMap:{value:null},envMapRotation:{value:new _t},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new _t}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new _t}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new _t},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new _t},normalScale:{value:new ze(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new _t},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new _t}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new _t}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new _t}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new We(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new We(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new _t},alphaTest:{value:0},uvTransform:{value:new _t}},sprite:{diffuse:{value:new We(16777215)},opacity:{value:1},center:{value:new ze(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new _t},alphaMap:{value:null},alphaMapTransform:{value:new _t},alphaTest:{value:0}}},li={basic:{uniforms:Cr([Ne.common,Ne.specularmap,Ne.envmap,Ne.aomap,Ne.lightmap,Ne.fog]),vertexShader:yt.meshbasic_vert,fragmentShader:yt.meshbasic_frag},lambert:{uniforms:Cr([Ne.common,Ne.specularmap,Ne.envmap,Ne.aomap,Ne.lightmap,Ne.emissivemap,Ne.bumpmap,Ne.normalmap,Ne.displacementmap,Ne.fog,Ne.lights,{emissive:{value:new We(0)}}]),vertexShader:yt.meshlambert_vert,fragmentShader:yt.meshlambert_frag},phong:{uniforms:Cr([Ne.common,Ne.specularmap,Ne.envmap,Ne.aomap,Ne.lightmap,Ne.emissivemap,Ne.bumpmap,Ne.normalmap,Ne.displacementmap,Ne.fog,Ne.lights,{emissive:{value:new We(0)},specular:{value:new We(1118481)},shininess:{value:30}}]),vertexShader:yt.meshphong_vert,fragmentShader:yt.meshphong_frag},standard:{uniforms:Cr([Ne.common,Ne.envmap,Ne.aomap,Ne.lightmap,Ne.emissivemap,Ne.bumpmap,Ne.normalmap,Ne.displacementmap,Ne.roughnessmap,Ne.metalnessmap,Ne.fog,Ne.lights,{emissive:{value:new We(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:yt.meshphysical_vert,fragmentShader:yt.meshphysical_frag},toon:{uniforms:Cr([Ne.common,Ne.aomap,Ne.lightmap,Ne.emissivemap,Ne.bumpmap,Ne.normalmap,Ne.displacementmap,Ne.gradientmap,Ne.fog,Ne.lights,{emissive:{value:new We(0)}}]),vertexShader:yt.meshtoon_vert,fragmentShader:yt.meshtoon_frag},matcap:{uniforms:Cr([Ne.common,Ne.bumpmap,Ne.normalmap,Ne.displacementmap,Ne.fog,{matcap:{value:null}}]),vertexShader:yt.meshmatcap_vert,fragmentShader:yt.meshmatcap_frag},points:{uniforms:Cr([Ne.points,Ne.fog]),vertexShader:yt.points_vert,fragmentShader:yt.points_frag},dashed:{uniforms:Cr([Ne.common,Ne.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:yt.linedashed_vert,fragmentShader:yt.linedashed_frag},depth:{uniforms:Cr([Ne.common,Ne.displacementmap]),vertexShader:yt.depth_vert,fragmentShader:yt.depth_frag},normal:{uniforms:Cr([Ne.common,Ne.bumpmap,Ne.normalmap,Ne.displacementmap,{opacity:{value:1}}]),vertexShader:yt.meshnormal_vert,fragmentShader:yt.meshnormal_frag},sprite:{uniforms:Cr([Ne.sprite,Ne.fog]),vertexShader:yt.sprite_vert,fragmentShader:yt.sprite_frag},background:{uniforms:{uvTransform:{value:new _t},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:yt.background_vert,fragmentShader:yt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new _t}},vertexShader:yt.backgroundCube_vert,fragmentShader:yt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:yt.cube_vert,fragmentShader:yt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:yt.equirect_vert,fragmentShader:yt.equirect_frag},distanceRGBA:{uniforms:Cr([Ne.common,Ne.displacementmap,{referencePosition:{value:new V},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:yt.distanceRGBA_vert,fragmentShader:yt.distanceRGBA_frag},shadow:{uniforms:Cr([Ne.lights,Ne.fog,{color:{value:new We(0)},opacity:{value:1}}]),vertexShader:yt.shadow_vert,fragmentShader:yt.shadow_frag}};li.physical={uniforms:Cr([li.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new _t},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new _t},clearcoatNormalScale:{value:new ze(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new _t},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new _t},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new _t},sheen:{value:0},sheenColor:{value:new We(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new _t},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new _t},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new _t},transmissionSamplerSize:{value:new ze},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new _t},attenuationDistance:{value:0},attenuationColor:{value:new We(0)},specularColor:{value:new We(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new _t},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new _t},anisotropyVector:{value:new ze},anisotropyMap:{value:null},anisotropyMapTransform:{value:new _t}}]),vertexShader:yt.meshphysical_vert,fragmentShader:yt.meshphysical_frag};const G9={r:0,b:0,g:0},va=new ni,PM=new lt;function UM(r,e,t,n,i,s,o){const l=new We(0);let h=s===!0?0:1,u,d,A=null,p=0,g=null;function m(x){let w=x.isScene===!0?x.background:null;return w&&w.isTexture&&(w=(x.backgroundBlurriness>0?t:e).get(w)),w}function E(x){let w=!1;const B=m(x);B===null?v(l,h):B&&B.isColor&&(v(B,1),w=!0);const T=r.xr.getEnvironmentBlendMode();T==="additive"?n.buffers.color.setClear(0,0,0,1,o):T==="alpha-blend"&&n.buffers.color.setClear(0,0,0,0,o),(r.autoClear||w)&&(n.buffers.depth.setTest(!0),n.buffers.depth.setMask(!0),n.buffers.color.setMask(!0),r.clear(r.autoClearColor,r.autoClearDepth,r.autoClearStencil))}function _(x,w){const B=m(w);B&&(B.isCubeTexture||B.mapping===Z2)?(d===void 0&&(d=new T0(new pl(1,1,1),new B0({name:"BackgroundCubeMaterial",uniforms:Do(li.backgroundCube.uniforms),vertexShader:li.backgroundCube.vertexShader,fragmentShader:li.backgroundCube.fragmentShader,side:V0,depthTest:!1,depthWrite:!1,fog:!1})),d.geometry.deleteAttribute("normal"),d.geometry.deleteAttribute("uv"),d.onBeforeRender=function(T,S,D){this.matrixWorld.copyPosition(D.matrixWorld)},Object.defineProperty(d.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(d)),va.copy(w.backgroundRotation),va.x*=-1,va.y*=-1,va.z*=-1,B.isCubeTexture&&B.isRenderTargetTexture===!1&&(va.y*=-1,va.z*=-1),d.material.uniforms.envMap.value=B,d.material.uniforms.flipEnvMap.value=B.isCubeTexture&&B.isRenderTargetTexture===!1?-1:1,d.material.uniforms.backgroundBlurriness.value=w.backgroundBlurriness,d.material.uniforms.backgroundIntensity.value=w.backgroundIntensity,d.material.uniforms.backgroundRotation.value.setFromMatrix4(PM.makeRotationFromEuler(va)),d.material.toneMapped=St.getTransfer(B.colorSpace)!==Ot,(A!==B||p!==B.version||g!==r.toneMapping)&&(d.material.needsUpdate=!0,A=B,p=B.version,g=r.toneMapping),d.layers.enableAll(),x.unshift(d,d.geometry,d.material,0,0,null)):B&&B.isTexture&&(u===void 0&&(u=new T0(new _l(2,2),new B0({name:"BackgroundMaterial",uniforms:Do(li.background.uniforms),vertexShader:li.background.vertexShader,fragmentShader:li.background.fragmentShader,side:Un,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),Object.defineProperty(u.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(u)),u.material.uniforms.t2D.value=B,u.material.uniforms.backgroundIntensity.value=w.backgroundIntensity,u.material.toneMapped=St.getTransfer(B.colorSpace)!==Ot,B.matrixAutoUpdate===!0&&B.updateMatrix(),u.material.uniforms.uvTransform.value.copy(B.matrix),(A!==B||p!==B.version||g!==r.toneMapping)&&(u.material.needsUpdate=!0,A=B,p=B.version,g=r.toneMapping),u.layers.enableAll(),x.unshift(u,u.geometry,u.material,0,0,null))}function v(x,w){x.getRGB(G9,Ud(r)),n.buffers.color.setClear(G9.r,G9.g,G9.b,w,o)}function C(){d!==void 0&&(d.geometry.dispose(),d.material.dispose(),d=void 0),u!==void 0&&(u.geometry.dispose(),u.material.dispose(),u=void 0)}return{getClearColor:function(){return l},setClearColor:function(x,w=1){l.set(x),h=w,v(l,h)},getClearAlpha:function(){return h},setClearAlpha:function(x){h=x,v(l,h)},render:E,addToRenderList:_,dispose:C}}function kM(r,e){const t=r.getParameter(r.MAX_VERTEX_ATTRIBS),n={},i=p(null);let s=i,o=!1;function l(M,L,P,F,z){let J=!1;const q=A(F,P,L);s!==q&&(s=q,u(s.object)),J=g(M,F,P,z),J&&m(M,F,P,z),z!==null&&e.update(z,r.ELEMENT_ARRAY_BUFFER),(J||o)&&(o=!1,w(M,L,P,F),z!==null&&r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,e.get(z).buffer))}function h(){return r.createVertexArray()}function u(M){return r.bindVertexArray(M)}function d(M){return r.deleteVertexArray(M)}function A(M,L,P){const F=P.wireframe===!0;let z=n[M.id];z===void 0&&(z={},n[M.id]=z);let J=z[L.id];J===void 0&&(J={},z[L.id]=J);let q=J[F];return q===void 0&&(q=p(h()),J[F]=q),q}function p(M){const L=[],P=[],F=[];for(let z=0;z<t;z++)L[z]=0,P[z]=0,F[z]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:L,enabledAttributes:P,attributeDivisors:F,object:M,attributes:{},index:null}}function g(M,L,P,F){const z=s.attributes,J=L.attributes;let q=0;const ne=P.getAttributes();for(const j in ne)if(ne[j].location>=0){const te=z[j];let W=J[j];if(W===void 0&&(j==="instanceMatrix"&&M.instanceMatrix&&(W=M.instanceMatrix),j==="instanceColor"&&M.instanceColor&&(W=M.instanceColor)),te===void 0||te.attribute!==W||W&&te.data!==W.data)return!0;q++}return s.attributesNum!==q||s.index!==F}function m(M,L,P,F){const z={},J=L.attributes;let q=0;const ne=P.getAttributes();for(const j in ne)if(ne[j].location>=0){let te=J[j];te===void 0&&(j==="instanceMatrix"&&M.instanceMatrix&&(te=M.instanceMatrix),j==="instanceColor"&&M.instanceColor&&(te=M.instanceColor));const W={};W.attribute=te,te&&te.data&&(W.data=te.data),z[j]=W,q++}s.attributes=z,s.attributesNum=q,s.index=F}function E(){const M=s.newAttributes;for(let L=0,P=M.length;L<P;L++)M[L]=0}function _(M){v(M,0)}function v(M,L){const P=s.newAttributes,F=s.enabledAttributes,z=s.attributeDivisors;P[M]=1,F[M]===0&&(r.enableVertexAttribArray(M),F[M]=1),z[M]!==L&&(r.vertexAttribDivisor(M,L),z[M]=L)}function C(){const M=s.newAttributes,L=s.enabledAttributes;for(let P=0,F=L.length;P<F;P++)L[P]!==M[P]&&(r.disableVertexAttribArray(P),L[P]=0)}function x(M,L,P,F,z,J,q){q===!0?r.vertexAttribIPointer(M,L,P,z,J):r.vertexAttribPointer(M,L,P,F,z,J)}function w(M,L,P,F){E();const z=F.attributes,J=P.getAttributes(),q=L.defaultAttributeValues;for(const ne in J){const j=J[ne];if(j.location>=0){let te=z[ne];if(te===void 0&&(ne==="instanceMatrix"&&M.instanceMatrix&&(te=M.instanceMatrix),ne==="instanceColor"&&M.instanceColor&&(te=M.instanceColor)),te!==void 0){const W=te.normalized,U=te.itemSize,H=e.get(te);if(H===void 0)continue;const Z=H.buffer,G=H.type,oe=H.bytesPerElement,pe=G===r.INT||G===r.UNSIGNED_INT||te.gpuType===fo;if(te.isInterleavedBufferAttribute){const Ae=te.data,ge=Ae.stride,Re=te.offset;if(Ae.isInstancedInterleavedBuffer){for(let Oe=0;Oe<j.locationSize;Oe++)v(j.location+Oe,Ae.meshPerAttribute);M.isInstancedMesh!==!0&&F._maxInstanceCount===void 0&&(F._maxInstanceCount=Ae.meshPerAttribute*Ae.count)}else for(let Oe=0;Oe<j.locationSize;Oe++)_(j.location+Oe);r.bindBuffer(r.ARRAY_BUFFER,Z);for(let Oe=0;Oe<j.locationSize;Oe++)x(j.location+Oe,U/j.locationSize,G,W,ge*oe,(Re+U/j.locationSize*Oe)*oe,pe)}else{if(te.isInstancedBufferAttribute){for(let Ae=0;Ae<j.locationSize;Ae++)v(j.location+Ae,te.meshPerAttribute);M.isInstancedMesh!==!0&&F._maxInstanceCount===void 0&&(F._maxInstanceCount=te.meshPerAttribute*te.count)}else for(let Ae=0;Ae<j.locationSize;Ae++)_(j.location+Ae);r.bindBuffer(r.ARRAY_BUFFER,Z);for(let Ae=0;Ae<j.locationSize;Ae++)x(j.location+Ae,U/j.locationSize,G,W,U*oe,U/j.locationSize*Ae*oe,pe)}}else if(q!==void 0){const W=q[ne];if(W!==void 0)switch(W.length){case 2:r.vertexAttrib2fv(j.location,W);break;case 3:r.vertexAttrib3fv(j.location,W);break;case 4:r.vertexAttrib4fv(j.location,W);break;default:r.vertexAttrib1fv(j.location,W)}}}}C()}function B(){D();for(const M in n){const L=n[M];for(const P in L){const F=L[P];for(const z in F)d(F[z].object),delete F[z];delete L[P]}delete n[M]}}function T(M){if(n[M.id]===void 0)return;const L=n[M.id];for(const P in L){const F=L[P];for(const z in F)d(F[z].object),delete F[z];delete L[P]}delete n[M.id]}function S(M){for(const L in n){const P=n[L];if(P[M.id]===void 0)continue;const F=P[M.id];for(const z in F)d(F[z].object),delete F[z];delete P[M.id]}}function D(){R(),o=!0,s!==i&&(s=i,u(s.object))}function R(){i.geometry=null,i.program=null,i.wireframe=!1}return{setup:l,reset:D,resetDefaultState:R,dispose:B,releaseStatesOfGeometry:T,releaseStatesOfProgram:S,initAttributes:E,enableAttribute:_,disableUnusedAttributes:C}}function FM(r,e,t){let n;function i(u){n=u}function s(u,d){r.drawArrays(n,u,d),t.update(d,n,1)}function o(u,d,A){A!==0&&(r.drawArraysInstanced(n,u,d,A),t.update(d,n,A))}function l(u,d,A){if(A===0)return;e.get("WEBGL_multi_draw").multiDrawArraysWEBGL(n,u,0,d,0,A);let p=0;for(let g=0;g<A;g++)p+=d[g];t.update(p,n,1)}function h(u,d,A,p){if(A===0)return;const g=e.get("WEBGL_multi_draw");if(g===null)for(let m=0;m<u.length;m++)o(u[m],d[m],p[m]);else{g.multiDrawArraysInstancedWEBGL(n,u,0,d,0,p,0,A);let m=0;for(let E=0;E<A;E++)m+=d[E]*p[E];t.update(m,n,1)}}this.setMode=i,this.render=s,this.renderInstances=o,this.renderMultiDraw=l,this.renderMultiDrawInstances=h}function OM(r,e,t,n){let i;function s(){if(i!==void 0)return i;if(e.has("EXT_texture_filter_anisotropic")===!0){const S=e.get("EXT_texture_filter_anisotropic");i=r.getParameter(S.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i}function o(S){return!(S!==Kt&&n.convert(S)!==r.getParameter(r.IMPLEMENTATION_COLOR_READ_FORMAT))}function l(S){const D=S===p0&&(e.has("EXT_color_buffer_half_float")||e.has("EXT_color_buffer_float"));return!(S!==w0&&n.convert(S)!==r.getParameter(r.IMPLEMENTATION_COLOR_READ_TYPE)&&S!==Jt&&!D)}function h(S){if(S==="highp"){if(r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.HIGH_FLOAT).precision>0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT).precision>0)return"highp";S="mediump"}return S==="mediump"&&r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.MEDIUM_FLOAT).precision>0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let u=t.precision!==void 0?t.precision:"highp";const d=h(u);d!==u&&(console.warn("THREE.WebGLRenderer:",u,"not supported, using",d,"instead."),u=d);const A=t.logarithmicDepthBuffer===!0,p=t.reverseDepthBuffer===!0&&e.has("EXT_clip_control"),g=r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS),m=r.getParameter(r.MAX_VERTEX_TEXTURE_IMAGE_UNITS),E=r.getParameter(r.MAX_TEXTURE_SIZE),_=r.getParameter(r.MAX_CUBE_MAP_TEXTURE_SIZE),v=r.getParameter(r.MAX_VERTEX_ATTRIBS),C=r.getParameter(r.MAX_VERTEX_UNIFORM_VECTORS),x=r.getParameter(r.MAX_VARYING_VECTORS),w=r.getParameter(r.MAX_FRAGMENT_UNIFORM_VECTORS),B=m>0,T=r.getParameter(r.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:s,getMaxPrecision:h,textureFormatReadable:o,textureTypeReadable:l,precision:u,logarithmicDepthBuffer:A,reverseDepthBuffer:p,maxTextures:g,maxVertexTextures:m,maxTextureSize:E,maxCubemapSize:_,maxAttributes:v,maxVertexUniforms:C,maxVaryings:x,maxFragmentUniforms:w,vertexTextures:B,maxSamples:T}}function QM(r){const e=this;let t=null,n=0,i=!1,s=!1;const o=new ai,l=new _t,h={value:null,needsUpdate:!1};this.uniform=h,this.numPlanes=0,this.numIntersection=0,this.init=function(A,p){const g=A.length!==0||p||n!==0||i;return i=p,n=A.length,g},this.beginShadows=function(){s=!0,d(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(A,p){t=d(A,p,0)},this.setState=function(A,p,g){const m=A.clippingPlanes,E=A.clipIntersection,_=A.clipShadows,v=r.get(A);if(!i||m===null||m.length===0||s&&!_)s?d(null):u();else{const C=s?0:n,x=C*4;let w=v.clippingState||null;h.value=w,w=d(m,p,x,g);for(let B=0;B!==x;++B)w[B]=t[B];v.clippingState=w,this.numIntersection=E?this.numPlanes:0,this.numPlanes+=C}};function u(){h.value!==t&&(h.value=t,h.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function d(A,p,g,m){const E=A!==null?A.length:0;let _=null;if(E!==0){if(_=h.value,m!==!0||_===null){const v=g+E*4,C=p.matrixWorldInverse;l.getNormalMatrix(C),(_===null||_.length<v)&&(_=new Float32Array(v));for(let x=0,w=g;x!==E;++x,w+=4)o.copy(A[x]).applyMatrix4(C,l),o.normal.toArray(_,w),_[w+3]=o.constant}h.value=_,h.needsUpdate=!0}return e.numPlanes=E,e.numIntersection=0,_}}function zM(r){let e=new WeakMap;function t(o,l){return l===K2?o.mapping=ua:l===v3&&(o.mapping=uo),o}function n(o){if(o&&o.isTexture){const l=o.mapping;if(l===K2||l===v3)if(e.has(o)){const h=e.get(o).texture;return t(h,o.mapping)}else{const h=o.image;if(h&&h.height>0){const u=new rw(h.height);return u.fromEquirectangularTexture(r,o),e.set(o,u),o.addEventListener("dispose",i),t(u.texture,o.mapping)}else return null}}return o}function i(o){const l=o.target;l.removeEventListener("dispose",i);const h=e.get(l);h!==void 0&&(e.delete(l),h.dispose())}function s(){e=new WeakMap}return{get:n,dispose:s}}const Go=4,x7=[.125,.215,.35,.446,.526,.582],_a=20,T4=new wl,w7=new We;let B4=null,b4=0,R4=0,D4=!1;const ya=(1+Math.sqrt(5))/2,Ho=1/ya,C7=[new V(-ya,Ho,0),new V(ya,Ho,0),new V(-Ho,0,ya),new V(Ho,0,ya),new V(0,ya,-Ho),new V(0,ya,Ho),new V(-1,1,-1),new V(1,1,-1),new V(-1,1,1),new V(1,1,1)],GM=new V;class I7{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,n=.1,i=100,s={}){const{size:o=256,position:l=GM}=s;B4=this._renderer.getRenderTarget(),b4=this._renderer.getActiveCubeFace(),R4=this._renderer.getActiveMipmapLevel(),D4=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(o);const h=this._allocateTargets();return h.depthBuffer=!0,this._sceneToCubeUV(e,n,i,h,l),t>0&&this._blur(h,0,0,t),this._applyPMREM(h),this._cleanup(h),h}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=T7(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=S7(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodPlanes.length;e++)this._lodPlanes[e].dispose()}_cleanup(e){this._renderer.setRenderTarget(B4,b4,R4),this._renderer.xr.enabled=D4,e.scissorTest=!1,H9(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===ua||e.mapping===uo?this._setSize(e.image.length===0?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),B4=this._renderer.getRenderTarget(),b4=this._renderer.getActiveCubeFace(),R4=this._renderer.getActiveMipmapLevel(),D4=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;const n=t||this._allocateTargets();return this._textureToCubeUV(e,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){const e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,n={magFilter:Gt,minFilter:Gt,generateMipmaps:!1,type:p0,format:Kt,colorSpace:j0,depthBuffer:!1},i=M7(e,t,n);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=M7(e,t,n);const{_lodMax:s}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=HM(s)),this._blurMaterial=VM(s,e,t)}return i}_compileMaterial(e){const t=new T0(this._lodPlanes[0],e);this._renderer.compile(t,T4)}_sceneToCubeUV(e,t,n,i,s){const o=new pr(90,1,t,n),l=[1,-1,1,1,1,1],h=[1,1,1,-1,-1,-1],u=this._renderer,d=u.autoClear,A=u.toneMapping;u.getClearColor(w7),u.toneMapping=cs,u.autoClear=!1;const p=new si({name:"PMREM.Background",side:V0,depthWrite:!1,depthTest:!1}),g=new T0(new pl,p);let m=!1;const E=e.background;E?E.isColor&&(p.color.copy(E),e.background=null,m=!0):(p.color.copy(w7),m=!0);for(let _=0;_<6;_++){const v=_%3;v===0?(o.up.set(0,l[_],0),o.position.set(s.x,s.y,s.z),o.lookAt(s.x+h[_],s.y,s.z)):v===1?(o.up.set(0,0,l[_]),o.position.set(s.x,s.y,s.z),o.lookAt(s.x,s.y+h[_],s.z)):(o.up.set(0,l[_],0),o.position.set(s.x,s.y,s.z),o.lookAt(s.x,s.y,s.z+h[_]));const C=this._cubeSize;H9(i,v*C,_>2?C:0,C,C),u.setRenderTarget(i),m&&u.render(g,o),u.render(e,o)}g.geometry.dispose(),g.material.dispose(),u.toneMapping=A,u.autoClear=d,e.background=E}_textureToCubeUV(e,t){const n=this._renderer,i=e.mapping===ua||e.mapping===uo;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=T7()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=S7());const s=i?this._cubemapMaterial:this._equirectMaterial,o=new T0(this._lodPlanes[0],s),l=s.uniforms;l.envMap.value=e;const h=this._cubeSize;H9(t,0,0,3*h,2*h),n.setRenderTarget(t),n.render(o,T4)}_applyPMREM(e){const t=this._renderer,n=t.autoClear;t.autoClear=!1;const i=this._lodPlanes.length;for(let s=1;s<i;s++){const o=Math.sqrt(this._sigmas[s]*this._sigmas[s]-this._sigmas[s-1]*this._sigmas[s-1]),l=C7[(i-s-1)%C7.length];this._blur(e,s-1,s,o,l)}t.autoClear=n}_blur(e,t,n,i,s){const o=this._pingPongRenderTarget;this._halfBlur(e,o,t,n,i,"latitudinal",s),this._halfBlur(o,e,n,n,i,"longitudinal",s)}_halfBlur(e,t,n,i,s,o,l){const h=this._renderer,u=this._blurMaterial;o!=="latitudinal"&&o!=="longitudinal"&&console.error("blur direction must be either latitudinal or longitudinal!");const d=3,A=new T0(this._lodPlanes[i],u),p=u.uniforms,g=this._sizeLods[n]-1,m=isFinite(s)?Math.PI/(2*g):2*Math.PI/(2*_a-1),E=s/m,_=isFinite(s)?1+Math.floor(d*E):_a;_>_a&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${_} samples when the maximum is set to ${_a}`);const v=[];let C=0;for(let S=0;S<_a;++S){const D=S/E,R=Math.exp(-D*D/2);v.push(R),S===0?C+=R:S<_&&(C+=2*R)}for(let S=0;S<v.length;S++)v[S]=v[S]/C;p.envMap.value=e.texture,p.samples.value=_,p.weights.value=v,p.latitudinal.value=o==="latitudinal",l&&(p.poleAxis.value=l);const{_lodMax:x}=this;p.dTheta.value=m,p.mipInt.value=x-n;const w=this._sizeLods[i],B=3*w*(i>x-Go?i-x+Go:0),T=4*(this._cubeSize-w);H9(t,B,T,3*w,2*w),h.setRenderTarget(t),h.render(A,T4)}}function HM(r){const e=[],t=[],n=[];let i=r;const s=r-Go+1+x7.length;for(let o=0;o<s;o++){const l=Math.pow(2,i);t.push(l);let h=1/l;o>r-Go?h=x7[o-r+Go-1]:o===0&&(h=0),n.push(h);const u=1/(l-2),d=-u,A=1+u,p=[d,d,A,d,A,A,d,d,A,A,d,A],g=6,m=6,E=3,_=2,v=1,C=new Float32Array(E*m*g),x=new Float32Array(_*m*g),w=new Float32Array(v*m*g);for(let T=0;T<g;T++){const S=T%3*2/3-1,D=T>2?0:-1,R=[S,D,0,S+2/3,D,0,S+2/3,D+1,0,S,D,0,S+2/3,D+1,0,S,D+1,0];C.set(R,E*m*T),x.set(p,_*m*T);const M=[T,T,T,T,T,T];w.set(M,v*m*T)}const B=new vn;B.setAttribute("position",new S0(C,E)),B.setAttribute("uv",new S0(x,_)),B.setAttribute("faceIndex",new S0(w,v)),e.push(B),i>Go&&i--}return{lodPlanes:e,sizeLods:t,sigmas:n}}function M7(r,e,t){const n=new Nr(r,e,t);return n.texture.mapping=Z2,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function H9(r,e,t,n,i){r.viewport.set(e,t,n,i),r.scissor.set(e,t,n,i)}function VM(r,e,t){const n=new Float32Array(_a),i=new V(0,1,0);return new B0({name:"SphericalGaussianBlur",defines:{n:_a,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${r}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:L4(),fragmentShader:`
3593
3593
 
3594
3594
  precision mediump float;
3595
3595
  precision mediump int;
@@ -3790,7 +3790,7 @@ Material Type: `+L.type+`
3790
3790
 
3791
3791
  Program Info Log: `+P+`
3792
3792
  `+ne+`
3793
- `+j)}else P!==""?console.warn("THREE.WebGLProgram: Program Info Log:",P):(F===""||z==="")&&(q=!1);q&&(L.diagnostics={runnable:J,programLog:P,vertexShader:{log:F,prefix:_},fragmentShader:{log:z,prefix:v}})}i.deleteShader(B),i.deleteShader(T),D=new j9(i,E),R=KS(i,E)}let D;this.getUniforms=function(){return D===void 0&&S(this),D};let R;this.getAttributes=function(){return R===void 0&&S(this),R};let M=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return M===!1&&(M=i.getProgramParameter(E,GS)),M},this.destroy=function(){n.releaseStatesOfProgram(this),i.deleteProgram(E),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=HS++,this.cacheKey=e,this.usedTimes=1,this.program=E,this.vertexShader=B,this.fragmentShader=T,this}let cT=0;class uT{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 hT(e),t.set(e,n)),n}}class hT{constructor(e){this.id=cT++,this.code=e,this.usedTimes=0}}function dT(r,e,t,n,i,s,o){const l=new _9,h=new uT,u=new Set,d=[],A=i.logarithmicDepthBuffer,p=i.vertexTextures;let g=i.precision;const m={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(R){return u.add(R),R===0?"uv":`uv${R}`}function _(R,M,L,P,F){const z=P.fog,J=F.geometry,q=R.isMeshStandardMaterial?P.environment:null,ne=(R.isMeshStandardMaterial?t:e).get(R.envMap||q),j=ne&&ne.mapping===Z2?ne.image.height:null,te=m[R.type];R.precision!==null&&(g=i.getMaxPrecision(R.precision),g!==R.precision&&console.warn("THREE.WebGLProgram.getParameters:",R.precision,"not supported, using",g,"instead."));const W=J.morphAttributes.position||J.morphAttributes.normal||J.morphAttributes.color,U=W!==void 0?W.length:0;let H=0;J.morphAttributes.position!==void 0&&(H=1),J.morphAttributes.normal!==void 0&&(H=2),J.morphAttributes.color!==void 0&&(H=3);let Z,G,oe,pe;if(te){const Rt=li[te];Z=Rt.vertexShader,G=Rt.fragmentShader}else Z=R.vertexShader,G=R.fragmentShader,h.update(R),oe=h.getVertexShaderID(R),pe=h.getFragmentShaderID(R);const Ae=r.getRenderTarget(),ge=r.state.buffers.depth.getReversed(),Re=F.isInstancedMesh===!0,Fe=F.isBatchedMesh===!0,st=!!R.map,ut=!!R.matcap,mt=!!ne,X=!!R.aoMap,h0=!!R.lightMap,pt=!!R.bumpMap,At=!!R.normalMap,qe=!!R.displacementMap,Mt=!!R.emissiveMap,Ye=!!R.metalnessMap,Q=!!R.roughnessMap,k=R.anisotropy>0,se=R.clearcoat>0,ye=R.dispersion>0,Ee=R.iridescence>0,_e=R.sheen>0,Ge=R.transmission>0,Le=k&&!!R.anisotropyMap,Ve=se&&!!R.clearcoatMap,gt=se&&!!R.clearcoatNormalMap,we=se&&!!R.clearcoatRoughnessMap,Pe=Ee&&!!R.iridescenceMap,nt=Ee&&!!R.iridescenceThicknessMap,et=_e&&!!R.sheenColorMap,he=_e&&!!R.sheenRoughnessMap,Oe=!!R.specularMap,ke=!!R.specularColorMap,ht=!!R.specularIntensityMap,$=Ge&&!!R.transmissionMap,Se=Ge&&!!R.thicknessMap,ue=!!R.gradientMap,ve=!!R.alphaMap,De=R.alphaTest>0,Be=!!R.alphaHash,it=!!R.extensions;let jt=cs;R.toneMapped&&(Ae===null||Ae.isXRRenderTarget===!0)&&(jt=r.toneMapping);const y0={shaderID:te,shaderType:R.type,shaderName:R.name,vertexShader:Z,fragmentShader:G,defines:R.defines,customVertexShaderID:oe,customFragmentShaderID:pe,isRawShaderMaterial:R.isRawShaderMaterial===!0,glslVersion:R.glslVersion,precision:g,batching:Fe,batchingColor:Fe&&F._colorsTexture!==null,instancing:Re,instancingColor:Re&&F.instanceColor!==null,instancingMorph:Re&&F.morphTexture!==null,supportsVertexTextures:p,outputColorSpace:Ae===null?r.outputColorSpace:Ae.isXRRenderTarget===!0?Ae.texture.colorSpace:j0,alphaToCoverage:!!R.alphaToCoverage,map:st,matcap:ut,envMap:mt,envMapMode:mt&&ne.mapping,envMapCubeUVHeight:j,aoMap:X,lightMap:h0,bumpMap:pt,normalMap:At,displacementMap:p&&qe,emissiveMap:Mt,normalMapObjectSpace:At&&R.normalMapType===sx,normalMapTangentSpace:At&&R.normalMapType===cd,metalnessMap:Ye,roughnessMap:Q,anisotropy:k,anisotropyMap:Le,clearcoat:se,clearcoatMap:Ve,clearcoatNormalMap:gt,clearcoatRoughnessMap:we,dispersion:ye,iridescence:Ee,iridescenceMap:Pe,iridescenceThicknessMap:nt,sheen:_e,sheenColorMap:et,sheenRoughnessMap:he,specularMap:Oe,specularColorMap:ke,specularIntensityMap:ht,transmission:Ge,transmissionMap:$,thicknessMap:Se,gradientMap:ue,opaque:R.transparent===!1&&R.blending===oo&&R.alphaToCoverage===!1,alphaMap:ve,alphaTest:De,alphaHash:Be,combine:R.combine,mapUv:st&&E(R.map.channel),aoMapUv:X&&E(R.aoMap.channel),lightMapUv:h0&&E(R.lightMap.channel),bumpMapUv:pt&&E(R.bumpMap.channel),normalMapUv:At&&E(R.normalMap.channel),displacementMapUv:qe&&E(R.displacementMap.channel),emissiveMapUv:Mt&&E(R.emissiveMap.channel),metalnessMapUv:Ye&&E(R.metalnessMap.channel),roughnessMapUv:Q&&E(R.roughnessMap.channel),anisotropyMapUv:Le&&E(R.anisotropyMap.channel),clearcoatMapUv:Ve&&E(R.clearcoatMap.channel),clearcoatNormalMapUv:gt&&E(R.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:we&&E(R.clearcoatRoughnessMap.channel),iridescenceMapUv:Pe&&E(R.iridescenceMap.channel),iridescenceThicknessMapUv:nt&&E(R.iridescenceThicknessMap.channel),sheenColorMapUv:et&&E(R.sheenColorMap.channel),sheenRoughnessMapUv:he&&E(R.sheenRoughnessMap.channel),specularMapUv:Oe&&E(R.specularMap.channel),specularColorMapUv:ke&&E(R.specularColorMap.channel),specularIntensityMapUv:ht&&E(R.specularIntensityMap.channel),transmissionMapUv:$&&E(R.transmissionMap.channel),thicknessMapUv:Se&&E(R.thicknessMap.channel),alphaMapUv:ve&&E(R.alphaMap.channel),vertexTangents:!!J.attributes.tangent&&(At||k),vertexColors:R.vertexColors,vertexAlphas:R.vertexColors===!0&&!!J.attributes.color&&J.attributes.color.itemSize===4,pointsUvs:F.isPoints===!0&&!!J.attributes.uv&&(st||ve),fog:!!z,useFog:R.fog===!0,fogExp2:!!z&&z.isFogExp2,flatShading:R.flatShading===!0,sizeAttenuation:R.sizeAttenuation===!0,logarithmicDepthBuffer:A,reverseDepthBuffer:ge,skinning:F.isSkinnedMesh===!0,morphTargets:J.morphAttributes.position!==void 0,morphNormals:J.morphAttributes.normal!==void 0,morphColors:J.morphAttributes.color!==void 0,morphTargetsCount:U,morphTextureStride:H,numDirLights:M.directional.length,numPointLights:M.point.length,numSpotLights:M.spot.length,numSpotLightMaps:M.spotLightMap.length,numRectAreaLights:M.rectArea.length,numHemiLights:M.hemi.length,numDirLightShadows:M.directionalShadowMap.length,numPointLightShadows:M.pointShadowMap.length,numSpotLightShadows:M.spotShadowMap.length,numSpotLightShadowsWithMaps:M.numSpotLightShadowsWithMaps,numLightProbes:M.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:R.dithering,shadowMapEnabled:r.shadowMap.enabled&&L.length>0,shadowMapType:r.shadowMap.type,toneMapping:jt,decodeVideoTexture:st&&R.map.isVideoTexture===!0&&St.getTransfer(R.map.colorSpace)===Ot,decodeVideoTextureEmissive:Mt&&R.emissiveMap.isVideoTexture===!0&&St.getTransfer(R.emissiveMap.colorSpace)===Ot,premultipliedAlpha:R.premultipliedAlpha,doubleSided:R.side===pn,flipSided:R.side===V0,useDepthPacking:R.depthPacking>=0,depthPacking:R.depthPacking||0,index0AttributeName:R.index0AttributeName,extensionClipCullDistance:it&&R.extensions.clipCullDistance===!0&&n.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(it&&R.extensions.multiDraw===!0||Fe)&&n.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:n.has("KHR_parallel_shader_compile"),customProgramCacheKey:R.customProgramCacheKey()};return y0.vertexUv1s=u.has(1),y0.vertexUv2s=u.has(2),y0.vertexUv3s=u.has(3),u.clear(),y0}function v(R){const M=[];if(R.shaderID?M.push(R.shaderID):(M.push(R.customVertexShaderID),M.push(R.customFragmentShaderID)),R.defines!==void 0)for(const L in R.defines)M.push(L),M.push(R.defines[L]);return R.isRawShaderMaterial===!1&&(C(M,R),x(M,R),M.push(r.outputColorSpace)),M.push(R.customProgramCacheKey),M.join()}function C(R,M){R.push(M.precision),R.push(M.outputColorSpace),R.push(M.envMapMode),R.push(M.envMapCubeUVHeight),R.push(M.mapUv),R.push(M.alphaMapUv),R.push(M.lightMapUv),R.push(M.aoMapUv),R.push(M.bumpMapUv),R.push(M.normalMapUv),R.push(M.displacementMapUv),R.push(M.emissiveMapUv),R.push(M.metalnessMapUv),R.push(M.roughnessMapUv),R.push(M.anisotropyMapUv),R.push(M.clearcoatMapUv),R.push(M.clearcoatNormalMapUv),R.push(M.clearcoatRoughnessMapUv),R.push(M.iridescenceMapUv),R.push(M.iridescenceThicknessMapUv),R.push(M.sheenColorMapUv),R.push(M.sheenRoughnessMapUv),R.push(M.specularMapUv),R.push(M.specularColorMapUv),R.push(M.specularIntensityMapUv),R.push(M.transmissionMapUv),R.push(M.thicknessMapUv),R.push(M.combine),R.push(M.fogExp2),R.push(M.sizeAttenuation),R.push(M.morphTargetsCount),R.push(M.morphAttributeCount),R.push(M.numDirLights),R.push(M.numPointLights),R.push(M.numSpotLights),R.push(M.numSpotLightMaps),R.push(M.numHemiLights),R.push(M.numRectAreaLights),R.push(M.numDirLightShadows),R.push(M.numPointLightShadows),R.push(M.numSpotLightShadows),R.push(M.numSpotLightShadowsWithMaps),R.push(M.numLightProbes),R.push(M.shadowMapType),R.push(M.toneMapping),R.push(M.numClippingPlanes),R.push(M.numClipIntersection),R.push(M.depthPacking)}function x(R,M){l.disableAll(),M.supportsVertexTextures&&l.enable(0),M.instancing&&l.enable(1),M.instancingColor&&l.enable(2),M.instancingMorph&&l.enable(3),M.matcap&&l.enable(4),M.envMap&&l.enable(5),M.normalMapObjectSpace&&l.enable(6),M.normalMapTangentSpace&&l.enable(7),M.clearcoat&&l.enable(8),M.iridescence&&l.enable(9),M.alphaTest&&l.enable(10),M.vertexColors&&l.enable(11),M.vertexAlphas&&l.enable(12),M.vertexUv1s&&l.enable(13),M.vertexUv2s&&l.enable(14),M.vertexUv3s&&l.enable(15),M.vertexTangents&&l.enable(16),M.anisotropy&&l.enable(17),M.alphaHash&&l.enable(18),M.batching&&l.enable(19),M.dispersion&&l.enable(20),M.batchingColor&&l.enable(21),R.push(l.mask),l.disableAll(),M.fog&&l.enable(0),M.useFog&&l.enable(1),M.flatShading&&l.enable(2),M.logarithmicDepthBuffer&&l.enable(3),M.reverseDepthBuffer&&l.enable(4),M.skinning&&l.enable(5),M.morphTargets&&l.enable(6),M.morphNormals&&l.enable(7),M.morphColors&&l.enable(8),M.premultipliedAlpha&&l.enable(9),M.shadowMapEnabled&&l.enable(10),M.doubleSided&&l.enable(11),M.flipSided&&l.enable(12),M.useDepthPacking&&l.enable(13),M.dithering&&l.enable(14),M.transmission&&l.enable(15),M.sheen&&l.enable(16),M.opaque&&l.enable(17),M.pointsUvs&&l.enable(18),M.decodeVideoTexture&&l.enable(19),M.decodeVideoTextureEmissive&&l.enable(20),M.alphaToCoverage&&l.enable(21),R.push(l.mask)}function w(R){const M=m[R.type];let L;if(M){const P=li[M];L=Al.clone(P.uniforms)}else L=R.uniforms;return L}function B(R,M){let L;for(let P=0,F=d.length;P<F;P++){const z=d[P];if(z.cacheKey===M){L=z,++L.usedTimes;break}}return L===void 0&&(L=new lT(r,M,R,s),d.push(L)),L}function T(R){if(--R.usedTimes===0){const M=d.indexOf(R);d[M]=d[d.length-1],d.pop(),R.destroy()}}function S(R){h.remove(R)}function D(){h.dispose()}return{getParameters:_,getProgramCacheKey:v,getUniforms:w,acquireProgram:B,releaseProgram:T,releaseShaderCache:S,programs:d,dispose:D}}function fT(){let r=new WeakMap;function e(o){return r.has(o)}function t(o){let l=r.get(o);return l===void 0&&(l={},r.set(o,l)),l}function n(o){r.delete(o)}function i(o,l,h){r.get(o)[l]=h}function s(){r=new WeakMap}return{has:e,get:t,remove:n,update:i,dispose:s}}function pT(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 Y7(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 q7(){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,m,E,_){let v=r[e];return v===void 0?(v={id:A.id,object:A,geometry:p,material:g,groupOrder:m,renderOrder:A.renderOrder,z:E,group:_},r[e]=v):(v.id=A.id,v.object=A,v.geometry=p,v.material=g,v.groupOrder=m,v.renderOrder=A.renderOrder,v.z=E,v.group=_),e++,v}function l(A,p,g,m,E,_){const v=o(A,p,g,m,E,_);g.transmission>0?n.push(v):g.transparent===!0?i.push(v):t.push(v)}function h(A,p,g,m,E,_){const v=o(A,p,g,m,E,_);g.transmission>0?n.unshift(v):g.transparent===!0?i.unshift(v):t.unshift(v)}function u(A,p){t.length>1&&t.sort(A||pT),n.length>1&&n.sort(p||Y7),i.length>1&&i.sort(p||Y7)}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:l,unshift:h,finish:d,sort:u}}function AT(){let r=new WeakMap;function e(n,i){const s=r.get(n);let o;return s===void 0?(o=new q7,r.set(n,[o])):i>=s.length?(o=new q7,s.push(o)):o=s[i],o}function t(){r=new WeakMap}return{get:e,dispose:t}}function gT(){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 V,color:new We};break;case"SpotLight":t={position:new V,direction:new V,color:new We,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new V,color:new We,distance:0,decay:0};break;case"HemisphereLight":t={direction:new V,skyColor:new We,groundColor:new We};break;case"RectAreaLight":t={color:new We,position:new V,halfWidth:new V,halfHeight:new V};break}return r[e.id]=t,t}}}function mT(){const r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ze};break;case"SpotLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ze};break;case"PointLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ze,shadowCameraNear:1,shadowCameraFar:1e3};break}return r[e.id]=t,t}}}let vT=0;function _T(r,e){return(e.castShadow?2:0)-(r.castShadow?2:0)+(e.map?1:0)-(r.map?1:0)}function yT(r){const e=new gT,t=mT(),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 V);const i=new V,s=new lt,o=new lt;function l(u){let d=0,A=0,p=0;for(let R=0;R<9;R++)n.probe[R].set(0,0,0);let g=0,m=0,E=0,_=0,v=0,C=0,x=0,w=0,B=0,T=0,S=0;u.sort(_T);for(let R=0,M=u.length;R<M;R++){const L=u[R],P=L.color,F=L.intensity,z=L.distance,J=L.shadow&&L.shadow.map?L.shadow.map.texture:null;if(L.isAmbientLight)d+=P.r*F,A+=P.g*F,p+=P.b*F;else if(L.isLightProbe){for(let q=0;q<9;q++)n.probe[q].addScaledVector(L.sh.coefficients[q],F);S++}else if(L.isDirectionalLight){const q=e.get(L);if(q.color.copy(L.color).multiplyScalar(L.intensity),L.castShadow){const ne=L.shadow,j=t.get(L);j.shadowIntensity=ne.intensity,j.shadowBias=ne.bias,j.shadowNormalBias=ne.normalBias,j.shadowRadius=ne.radius,j.shadowMapSize=ne.mapSize,n.directionalShadow[g]=j,n.directionalShadowMap[g]=J,n.directionalShadowMatrix[g]=L.shadow.matrix,C++}n.directional[g]=q,g++}else if(L.isSpotLight){const q=e.get(L);q.position.setFromMatrixPosition(L.matrixWorld),q.color.copy(P).multiplyScalar(F),q.distance=z,q.coneCos=Math.cos(L.angle),q.penumbraCos=Math.cos(L.angle*(1-L.penumbra)),q.decay=L.decay,n.spot[E]=q;const ne=L.shadow;if(L.map&&(n.spotLightMap[B]=L.map,B++,ne.updateMatrices(L),L.castShadow&&T++),n.spotLightMatrix[E]=ne.matrix,L.castShadow){const j=t.get(L);j.shadowIntensity=ne.intensity,j.shadowBias=ne.bias,j.shadowNormalBias=ne.normalBias,j.shadowRadius=ne.radius,j.shadowMapSize=ne.mapSize,n.spotShadow[E]=j,n.spotShadowMap[E]=J,w++}E++}else if(L.isRectAreaLight){const q=e.get(L);q.color.copy(P).multiplyScalar(F),q.halfWidth.set(L.width*.5,0,0),q.halfHeight.set(0,L.height*.5,0),n.rectArea[_]=q,_++}else if(L.isPointLight){const q=e.get(L);if(q.color.copy(L.color).multiplyScalar(L.intensity),q.distance=L.distance,q.decay=L.decay,L.castShadow){const ne=L.shadow,j=t.get(L);j.shadowIntensity=ne.intensity,j.shadowBias=ne.bias,j.shadowNormalBias=ne.normalBias,j.shadowRadius=ne.radius,j.shadowMapSize=ne.mapSize,j.shadowCameraNear=ne.camera.near,j.shadowCameraFar=ne.camera.far,n.pointShadow[m]=j,n.pointShadowMap[m]=J,n.pointShadowMatrix[m]=L.shadow.matrix,x++}n.point[m]=q,m++}else if(L.isHemisphereLight){const q=e.get(L);q.skyColor.copy(L.color).multiplyScalar(F),q.groundColor.copy(L.groundColor).multiplyScalar(F),n.hemi[v]=q,v++}}_>0&&(r.has("OES_texture_float_linear")===!0?(n.rectAreaLTC1=Ne.LTC_FLOAT_1,n.rectAreaLTC2=Ne.LTC_FLOAT_2):(n.rectAreaLTC1=Ne.LTC_HALF_1,n.rectAreaLTC2=Ne.LTC_HALF_2)),n.ambient[0]=d,n.ambient[1]=A,n.ambient[2]=p;const D=n.hash;(D.directionalLength!==g||D.pointLength!==m||D.spotLength!==E||D.rectAreaLength!==_||D.hemiLength!==v||D.numDirectionalShadows!==C||D.numPointShadows!==x||D.numSpotShadows!==w||D.numSpotMaps!==B||D.numLightProbes!==S)&&(n.directional.length=g,n.spot.length=E,n.rectArea.length=_,n.point.length=m,n.hemi.length=v,n.directionalShadow.length=C,n.directionalShadowMap.length=C,n.pointShadow.length=x,n.pointShadowMap.length=x,n.spotShadow.length=w,n.spotShadowMap.length=w,n.directionalShadowMatrix.length=C,n.pointShadowMatrix.length=x,n.spotLightMatrix.length=w+B-T,n.spotLightMap.length=B,n.numSpotLightShadowsWithMaps=T,n.numLightProbes=S,D.directionalLength=g,D.pointLength=m,D.spotLength=E,D.rectAreaLength=_,D.hemiLength=v,D.numDirectionalShadows=C,D.numPointShadows=x,D.numSpotShadows=w,D.numSpotMaps=B,D.numLightProbes=S,n.version=vT++)}function h(u,d){let A=0,p=0,g=0,m=0,E=0;const _=d.matrixWorldInverse;for(let v=0,C=u.length;v<C;v++){const x=u[v];if(x.isDirectionalLight){const w=n.directional[A];w.direction.setFromMatrixPosition(x.matrixWorld),i.setFromMatrixPosition(x.target.matrixWorld),w.direction.sub(i),w.direction.transformDirection(_),A++}else if(x.isSpotLight){const w=n.spot[g];w.position.setFromMatrixPosition(x.matrixWorld),w.position.applyMatrix4(_),w.direction.setFromMatrixPosition(x.matrixWorld),i.setFromMatrixPosition(x.target.matrixWorld),w.direction.sub(i),w.direction.transformDirection(_),g++}else if(x.isRectAreaLight){const w=n.rectArea[m];w.position.setFromMatrixPosition(x.matrixWorld),w.position.applyMatrix4(_),o.identity(),s.copy(x.matrixWorld),s.premultiply(_),o.extractRotation(s),w.halfWidth.set(x.width*.5,0,0),w.halfHeight.set(0,x.height*.5,0),w.halfWidth.applyMatrix4(o),w.halfHeight.applyMatrix4(o),m++}else if(x.isPointLight){const w=n.point[p];w.position.setFromMatrixPosition(x.matrixWorld),w.position.applyMatrix4(_),p++}else if(x.isHemisphereLight){const w=n.hemi[E];w.direction.setFromMatrixPosition(x.matrixWorld),w.direction.transformDirection(_),E++}}}return{setup:l,setupView:h,state:n}}function X7(r){const e=new yT(r),t=[],n=[];function i(d){u.camera=d,t.length=0,n.length=0}function s(d){t.push(d)}function o(d){n.push(d)}function l(){e.setup(t)}function h(d){e.setupView(t,d)}const u={lightsArray:t,shadowsArray:n,camera:null,lights:e,transmissionRenderTarget:{}};return{init:i,state:u,setupLights:l,setupLightsView:h,pushLight:s,pushShadow:o}}function ET(r){let e=new WeakMap;function t(i,s=0){const o=e.get(i);let l;return o===void 0?(l=new X7(r),e.set(i,[l])):s>=o.length?(l=new X7(r),o.push(l)):l=o[s],l}function n(){e=new WeakMap}return{get:t,dispose:n}}const xT=`void main() {
3793
+ `+j)}else P!==""?console.warn("THREE.WebGLProgram: Program Info Log:",P):(F===""||z==="")&&(q=!1);q&&(L.diagnostics={runnable:J,programLog:P,vertexShader:{log:F,prefix:_},fragmentShader:{log:z,prefix:v}})}i.deleteShader(B),i.deleteShader(T),D=new j9(i,E),R=KS(i,E)}let D;this.getUniforms=function(){return D===void 0&&S(this),D};let R;this.getAttributes=function(){return R===void 0&&S(this),R};let M=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return M===!1&&(M=i.getProgramParameter(E,GS)),M},this.destroy=function(){n.releaseStatesOfProgram(this),i.deleteProgram(E),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=HS++,this.cacheKey=e,this.usedTimes=1,this.program=E,this.vertexShader=B,this.fragmentShader=T,this}let cT=0;class uT{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 hT(e),t.set(e,n)),n}}class hT{constructor(e){this.id=cT++,this.code=e,this.usedTimes=0}}function dT(r,e,t,n,i,s,o){const l=new _9,h=new uT,u=new Set,d=[],A=i.logarithmicDepthBuffer,p=i.vertexTextures;let g=i.precision;const m={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(R){return u.add(R),R===0?"uv":`uv${R}`}function _(R,M,L,P,F){const z=P.fog,J=F.geometry,q=R.isMeshStandardMaterial?P.environment:null,ne=(R.isMeshStandardMaterial?t:e).get(R.envMap||q),j=ne&&ne.mapping===Z2?ne.image.height:null,te=m[R.type];R.precision!==null&&(g=i.getMaxPrecision(R.precision),g!==R.precision&&console.warn("THREE.WebGLProgram.getParameters:",R.precision,"not supported, using",g,"instead."));const W=J.morphAttributes.position||J.morphAttributes.normal||J.morphAttributes.color,U=W!==void 0?W.length:0;let H=0;J.morphAttributes.position!==void 0&&(H=1),J.morphAttributes.normal!==void 0&&(H=2),J.morphAttributes.color!==void 0&&(H=3);let Z,G,oe,pe;if(te){const Rt=li[te];Z=Rt.vertexShader,G=Rt.fragmentShader}else Z=R.vertexShader,G=R.fragmentShader,h.update(R),oe=h.getVertexShaderID(R),pe=h.getFragmentShaderID(R);const Ae=r.getRenderTarget(),ge=r.state.buffers.depth.getReversed(),Re=F.isInstancedMesh===!0,Oe=F.isBatchedMesh===!0,st=!!R.map,ut=!!R.matcap,mt=!!ne,X=!!R.aoMap,h0=!!R.lightMap,pt=!!R.bumpMap,At=!!R.normalMap,qe=!!R.displacementMap,Mt=!!R.emissiveMap,Ye=!!R.metalnessMap,Q=!!R.roughnessMap,k=R.anisotropy>0,se=R.clearcoat>0,ye=R.dispersion>0,Ee=R.iridescence>0,_e=R.sheen>0,Ge=R.transmission>0,Le=k&&!!R.anisotropyMap,Ve=se&&!!R.clearcoatMap,gt=se&&!!R.clearcoatNormalMap,we=se&&!!R.clearcoatRoughnessMap,Ue=Ee&&!!R.iridescenceMap,nt=Ee&&!!R.iridescenceThicknessMap,et=_e&&!!R.sheenColorMap,he=_e&&!!R.sheenRoughnessMap,Pe=!!R.specularMap,Fe=!!R.specularColorMap,ht=!!R.specularIntensityMap,$=Ge&&!!R.transmissionMap,Se=Ge&&!!R.thicknessMap,ue=!!R.gradientMap,ve=!!R.alphaMap,De=R.alphaTest>0,Be=!!R.alphaHash,it=!!R.extensions;let jt=cs;R.toneMapped&&(Ae===null||Ae.isXRRenderTarget===!0)&&(jt=r.toneMapping);const y0={shaderID:te,shaderType:R.type,shaderName:R.name,vertexShader:Z,fragmentShader:G,defines:R.defines,customVertexShaderID:oe,customFragmentShaderID:pe,isRawShaderMaterial:R.isRawShaderMaterial===!0,glslVersion:R.glslVersion,precision:g,batching:Oe,batchingColor:Oe&&F._colorsTexture!==null,instancing:Re,instancingColor:Re&&F.instanceColor!==null,instancingMorph:Re&&F.morphTexture!==null,supportsVertexTextures:p,outputColorSpace:Ae===null?r.outputColorSpace:Ae.isXRRenderTarget===!0?Ae.texture.colorSpace:j0,alphaToCoverage:!!R.alphaToCoverage,map:st,matcap:ut,envMap:mt,envMapMode:mt&&ne.mapping,envMapCubeUVHeight:j,aoMap:X,lightMap:h0,bumpMap:pt,normalMap:At,displacementMap:p&&qe,emissiveMap:Mt,normalMapObjectSpace:At&&R.normalMapType===sx,normalMapTangentSpace:At&&R.normalMapType===cd,metalnessMap:Ye,roughnessMap:Q,anisotropy:k,anisotropyMap:Le,clearcoat:se,clearcoatMap:Ve,clearcoatNormalMap:gt,clearcoatRoughnessMap:we,dispersion:ye,iridescence:Ee,iridescenceMap:Ue,iridescenceThicknessMap:nt,sheen:_e,sheenColorMap:et,sheenRoughnessMap:he,specularMap:Pe,specularColorMap:Fe,specularIntensityMap:ht,transmission:Ge,transmissionMap:$,thicknessMap:Se,gradientMap:ue,opaque:R.transparent===!1&&R.blending===oo&&R.alphaToCoverage===!1,alphaMap:ve,alphaTest:De,alphaHash:Be,combine:R.combine,mapUv:st&&E(R.map.channel),aoMapUv:X&&E(R.aoMap.channel),lightMapUv:h0&&E(R.lightMap.channel),bumpMapUv:pt&&E(R.bumpMap.channel),normalMapUv:At&&E(R.normalMap.channel),displacementMapUv:qe&&E(R.displacementMap.channel),emissiveMapUv:Mt&&E(R.emissiveMap.channel),metalnessMapUv:Ye&&E(R.metalnessMap.channel),roughnessMapUv:Q&&E(R.roughnessMap.channel),anisotropyMapUv:Le&&E(R.anisotropyMap.channel),clearcoatMapUv:Ve&&E(R.clearcoatMap.channel),clearcoatNormalMapUv:gt&&E(R.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:we&&E(R.clearcoatRoughnessMap.channel),iridescenceMapUv:Ue&&E(R.iridescenceMap.channel),iridescenceThicknessMapUv:nt&&E(R.iridescenceThicknessMap.channel),sheenColorMapUv:et&&E(R.sheenColorMap.channel),sheenRoughnessMapUv:he&&E(R.sheenRoughnessMap.channel),specularMapUv:Pe&&E(R.specularMap.channel),specularColorMapUv:Fe&&E(R.specularColorMap.channel),specularIntensityMapUv:ht&&E(R.specularIntensityMap.channel),transmissionMapUv:$&&E(R.transmissionMap.channel),thicknessMapUv:Se&&E(R.thicknessMap.channel),alphaMapUv:ve&&E(R.alphaMap.channel),vertexTangents:!!J.attributes.tangent&&(At||k),vertexColors:R.vertexColors,vertexAlphas:R.vertexColors===!0&&!!J.attributes.color&&J.attributes.color.itemSize===4,pointsUvs:F.isPoints===!0&&!!J.attributes.uv&&(st||ve),fog:!!z,useFog:R.fog===!0,fogExp2:!!z&&z.isFogExp2,flatShading:R.flatShading===!0,sizeAttenuation:R.sizeAttenuation===!0,logarithmicDepthBuffer:A,reverseDepthBuffer:ge,skinning:F.isSkinnedMesh===!0,morphTargets:J.morphAttributes.position!==void 0,morphNormals:J.morphAttributes.normal!==void 0,morphColors:J.morphAttributes.color!==void 0,morphTargetsCount:U,morphTextureStride:H,numDirLights:M.directional.length,numPointLights:M.point.length,numSpotLights:M.spot.length,numSpotLightMaps:M.spotLightMap.length,numRectAreaLights:M.rectArea.length,numHemiLights:M.hemi.length,numDirLightShadows:M.directionalShadowMap.length,numPointLightShadows:M.pointShadowMap.length,numSpotLightShadows:M.spotShadowMap.length,numSpotLightShadowsWithMaps:M.numSpotLightShadowsWithMaps,numLightProbes:M.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:R.dithering,shadowMapEnabled:r.shadowMap.enabled&&L.length>0,shadowMapType:r.shadowMap.type,toneMapping:jt,decodeVideoTexture:st&&R.map.isVideoTexture===!0&&St.getTransfer(R.map.colorSpace)===Ot,decodeVideoTextureEmissive:Mt&&R.emissiveMap.isVideoTexture===!0&&St.getTransfer(R.emissiveMap.colorSpace)===Ot,premultipliedAlpha:R.premultipliedAlpha,doubleSided:R.side===pn,flipSided:R.side===V0,useDepthPacking:R.depthPacking>=0,depthPacking:R.depthPacking||0,index0AttributeName:R.index0AttributeName,extensionClipCullDistance:it&&R.extensions.clipCullDistance===!0&&n.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(it&&R.extensions.multiDraw===!0||Oe)&&n.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:n.has("KHR_parallel_shader_compile"),customProgramCacheKey:R.customProgramCacheKey()};return y0.vertexUv1s=u.has(1),y0.vertexUv2s=u.has(2),y0.vertexUv3s=u.has(3),u.clear(),y0}function v(R){const M=[];if(R.shaderID?M.push(R.shaderID):(M.push(R.customVertexShaderID),M.push(R.customFragmentShaderID)),R.defines!==void 0)for(const L in R.defines)M.push(L),M.push(R.defines[L]);return R.isRawShaderMaterial===!1&&(C(M,R),x(M,R),M.push(r.outputColorSpace)),M.push(R.customProgramCacheKey),M.join()}function C(R,M){R.push(M.precision),R.push(M.outputColorSpace),R.push(M.envMapMode),R.push(M.envMapCubeUVHeight),R.push(M.mapUv),R.push(M.alphaMapUv),R.push(M.lightMapUv),R.push(M.aoMapUv),R.push(M.bumpMapUv),R.push(M.normalMapUv),R.push(M.displacementMapUv),R.push(M.emissiveMapUv),R.push(M.metalnessMapUv),R.push(M.roughnessMapUv),R.push(M.anisotropyMapUv),R.push(M.clearcoatMapUv),R.push(M.clearcoatNormalMapUv),R.push(M.clearcoatRoughnessMapUv),R.push(M.iridescenceMapUv),R.push(M.iridescenceThicknessMapUv),R.push(M.sheenColorMapUv),R.push(M.sheenRoughnessMapUv),R.push(M.specularMapUv),R.push(M.specularColorMapUv),R.push(M.specularIntensityMapUv),R.push(M.transmissionMapUv),R.push(M.thicknessMapUv),R.push(M.combine),R.push(M.fogExp2),R.push(M.sizeAttenuation),R.push(M.morphTargetsCount),R.push(M.morphAttributeCount),R.push(M.numDirLights),R.push(M.numPointLights),R.push(M.numSpotLights),R.push(M.numSpotLightMaps),R.push(M.numHemiLights),R.push(M.numRectAreaLights),R.push(M.numDirLightShadows),R.push(M.numPointLightShadows),R.push(M.numSpotLightShadows),R.push(M.numSpotLightShadowsWithMaps),R.push(M.numLightProbes),R.push(M.shadowMapType),R.push(M.toneMapping),R.push(M.numClippingPlanes),R.push(M.numClipIntersection),R.push(M.depthPacking)}function x(R,M){l.disableAll(),M.supportsVertexTextures&&l.enable(0),M.instancing&&l.enable(1),M.instancingColor&&l.enable(2),M.instancingMorph&&l.enable(3),M.matcap&&l.enable(4),M.envMap&&l.enable(5),M.normalMapObjectSpace&&l.enable(6),M.normalMapTangentSpace&&l.enable(7),M.clearcoat&&l.enable(8),M.iridescence&&l.enable(9),M.alphaTest&&l.enable(10),M.vertexColors&&l.enable(11),M.vertexAlphas&&l.enable(12),M.vertexUv1s&&l.enable(13),M.vertexUv2s&&l.enable(14),M.vertexUv3s&&l.enable(15),M.vertexTangents&&l.enable(16),M.anisotropy&&l.enable(17),M.alphaHash&&l.enable(18),M.batching&&l.enable(19),M.dispersion&&l.enable(20),M.batchingColor&&l.enable(21),R.push(l.mask),l.disableAll(),M.fog&&l.enable(0),M.useFog&&l.enable(1),M.flatShading&&l.enable(2),M.logarithmicDepthBuffer&&l.enable(3),M.reverseDepthBuffer&&l.enable(4),M.skinning&&l.enable(5),M.morphTargets&&l.enable(6),M.morphNormals&&l.enable(7),M.morphColors&&l.enable(8),M.premultipliedAlpha&&l.enable(9),M.shadowMapEnabled&&l.enable(10),M.doubleSided&&l.enable(11),M.flipSided&&l.enable(12),M.useDepthPacking&&l.enable(13),M.dithering&&l.enable(14),M.transmission&&l.enable(15),M.sheen&&l.enable(16),M.opaque&&l.enable(17),M.pointsUvs&&l.enable(18),M.decodeVideoTexture&&l.enable(19),M.decodeVideoTextureEmissive&&l.enable(20),M.alphaToCoverage&&l.enable(21),R.push(l.mask)}function w(R){const M=m[R.type];let L;if(M){const P=li[M];L=Al.clone(P.uniforms)}else L=R.uniforms;return L}function B(R,M){let L;for(let P=0,F=d.length;P<F;P++){const z=d[P];if(z.cacheKey===M){L=z,++L.usedTimes;break}}return L===void 0&&(L=new lT(r,M,R,s),d.push(L)),L}function T(R){if(--R.usedTimes===0){const M=d.indexOf(R);d[M]=d[d.length-1],d.pop(),R.destroy()}}function S(R){h.remove(R)}function D(){h.dispose()}return{getParameters:_,getProgramCacheKey:v,getUniforms:w,acquireProgram:B,releaseProgram:T,releaseShaderCache:S,programs:d,dispose:D}}function fT(){let r=new WeakMap;function e(o){return r.has(o)}function t(o){let l=r.get(o);return l===void 0&&(l={},r.set(o,l)),l}function n(o){r.delete(o)}function i(o,l,h){r.get(o)[l]=h}function s(){r=new WeakMap}return{has:e,get:t,remove:n,update:i,dispose:s}}function pT(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 Y7(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 q7(){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,m,E,_){let v=r[e];return v===void 0?(v={id:A.id,object:A,geometry:p,material:g,groupOrder:m,renderOrder:A.renderOrder,z:E,group:_},r[e]=v):(v.id=A.id,v.object=A,v.geometry=p,v.material=g,v.groupOrder=m,v.renderOrder=A.renderOrder,v.z=E,v.group=_),e++,v}function l(A,p,g,m,E,_){const v=o(A,p,g,m,E,_);g.transmission>0?n.push(v):g.transparent===!0?i.push(v):t.push(v)}function h(A,p,g,m,E,_){const v=o(A,p,g,m,E,_);g.transmission>0?n.unshift(v):g.transparent===!0?i.unshift(v):t.unshift(v)}function u(A,p){t.length>1&&t.sort(A||pT),n.length>1&&n.sort(p||Y7),i.length>1&&i.sort(p||Y7)}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:l,unshift:h,finish:d,sort:u}}function AT(){let r=new WeakMap;function e(n,i){const s=r.get(n);let o;return s===void 0?(o=new q7,r.set(n,[o])):i>=s.length?(o=new q7,s.push(o)):o=s[i],o}function t(){r=new WeakMap}return{get:e,dispose:t}}function gT(){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 V,color:new We};break;case"SpotLight":t={position:new V,direction:new V,color:new We,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new V,color:new We,distance:0,decay:0};break;case"HemisphereLight":t={direction:new V,skyColor:new We,groundColor:new We};break;case"RectAreaLight":t={color:new We,position:new V,halfWidth:new V,halfHeight:new V};break}return r[e.id]=t,t}}}function mT(){const r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ze};break;case"SpotLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ze};break;case"PointLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new ze,shadowCameraNear:1,shadowCameraFar:1e3};break}return r[e.id]=t,t}}}let vT=0;function _T(r,e){return(e.castShadow?2:0)-(r.castShadow?2:0)+(e.map?1:0)-(r.map?1:0)}function yT(r){const e=new gT,t=mT(),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 V);const i=new V,s=new lt,o=new lt;function l(u){let d=0,A=0,p=0;for(let R=0;R<9;R++)n.probe[R].set(0,0,0);let g=0,m=0,E=0,_=0,v=0,C=0,x=0,w=0,B=0,T=0,S=0;u.sort(_T);for(let R=0,M=u.length;R<M;R++){const L=u[R],P=L.color,F=L.intensity,z=L.distance,J=L.shadow&&L.shadow.map?L.shadow.map.texture:null;if(L.isAmbientLight)d+=P.r*F,A+=P.g*F,p+=P.b*F;else if(L.isLightProbe){for(let q=0;q<9;q++)n.probe[q].addScaledVector(L.sh.coefficients[q],F);S++}else if(L.isDirectionalLight){const q=e.get(L);if(q.color.copy(L.color).multiplyScalar(L.intensity),L.castShadow){const ne=L.shadow,j=t.get(L);j.shadowIntensity=ne.intensity,j.shadowBias=ne.bias,j.shadowNormalBias=ne.normalBias,j.shadowRadius=ne.radius,j.shadowMapSize=ne.mapSize,n.directionalShadow[g]=j,n.directionalShadowMap[g]=J,n.directionalShadowMatrix[g]=L.shadow.matrix,C++}n.directional[g]=q,g++}else if(L.isSpotLight){const q=e.get(L);q.position.setFromMatrixPosition(L.matrixWorld),q.color.copy(P).multiplyScalar(F),q.distance=z,q.coneCos=Math.cos(L.angle),q.penumbraCos=Math.cos(L.angle*(1-L.penumbra)),q.decay=L.decay,n.spot[E]=q;const ne=L.shadow;if(L.map&&(n.spotLightMap[B]=L.map,B++,ne.updateMatrices(L),L.castShadow&&T++),n.spotLightMatrix[E]=ne.matrix,L.castShadow){const j=t.get(L);j.shadowIntensity=ne.intensity,j.shadowBias=ne.bias,j.shadowNormalBias=ne.normalBias,j.shadowRadius=ne.radius,j.shadowMapSize=ne.mapSize,n.spotShadow[E]=j,n.spotShadowMap[E]=J,w++}E++}else if(L.isRectAreaLight){const q=e.get(L);q.color.copy(P).multiplyScalar(F),q.halfWidth.set(L.width*.5,0,0),q.halfHeight.set(0,L.height*.5,0),n.rectArea[_]=q,_++}else if(L.isPointLight){const q=e.get(L);if(q.color.copy(L.color).multiplyScalar(L.intensity),q.distance=L.distance,q.decay=L.decay,L.castShadow){const ne=L.shadow,j=t.get(L);j.shadowIntensity=ne.intensity,j.shadowBias=ne.bias,j.shadowNormalBias=ne.normalBias,j.shadowRadius=ne.radius,j.shadowMapSize=ne.mapSize,j.shadowCameraNear=ne.camera.near,j.shadowCameraFar=ne.camera.far,n.pointShadow[m]=j,n.pointShadowMap[m]=J,n.pointShadowMatrix[m]=L.shadow.matrix,x++}n.point[m]=q,m++}else if(L.isHemisphereLight){const q=e.get(L);q.skyColor.copy(L.color).multiplyScalar(F),q.groundColor.copy(L.groundColor).multiplyScalar(F),n.hemi[v]=q,v++}}_>0&&(r.has("OES_texture_float_linear")===!0?(n.rectAreaLTC1=Ne.LTC_FLOAT_1,n.rectAreaLTC2=Ne.LTC_FLOAT_2):(n.rectAreaLTC1=Ne.LTC_HALF_1,n.rectAreaLTC2=Ne.LTC_HALF_2)),n.ambient[0]=d,n.ambient[1]=A,n.ambient[2]=p;const D=n.hash;(D.directionalLength!==g||D.pointLength!==m||D.spotLength!==E||D.rectAreaLength!==_||D.hemiLength!==v||D.numDirectionalShadows!==C||D.numPointShadows!==x||D.numSpotShadows!==w||D.numSpotMaps!==B||D.numLightProbes!==S)&&(n.directional.length=g,n.spot.length=E,n.rectArea.length=_,n.point.length=m,n.hemi.length=v,n.directionalShadow.length=C,n.directionalShadowMap.length=C,n.pointShadow.length=x,n.pointShadowMap.length=x,n.spotShadow.length=w,n.spotShadowMap.length=w,n.directionalShadowMatrix.length=C,n.pointShadowMatrix.length=x,n.spotLightMatrix.length=w+B-T,n.spotLightMap.length=B,n.numSpotLightShadowsWithMaps=T,n.numLightProbes=S,D.directionalLength=g,D.pointLength=m,D.spotLength=E,D.rectAreaLength=_,D.hemiLength=v,D.numDirectionalShadows=C,D.numPointShadows=x,D.numSpotShadows=w,D.numSpotMaps=B,D.numLightProbes=S,n.version=vT++)}function h(u,d){let A=0,p=0,g=0,m=0,E=0;const _=d.matrixWorldInverse;for(let v=0,C=u.length;v<C;v++){const x=u[v];if(x.isDirectionalLight){const w=n.directional[A];w.direction.setFromMatrixPosition(x.matrixWorld),i.setFromMatrixPosition(x.target.matrixWorld),w.direction.sub(i),w.direction.transformDirection(_),A++}else if(x.isSpotLight){const w=n.spot[g];w.position.setFromMatrixPosition(x.matrixWorld),w.position.applyMatrix4(_),w.direction.setFromMatrixPosition(x.matrixWorld),i.setFromMatrixPosition(x.target.matrixWorld),w.direction.sub(i),w.direction.transformDirection(_),g++}else if(x.isRectAreaLight){const w=n.rectArea[m];w.position.setFromMatrixPosition(x.matrixWorld),w.position.applyMatrix4(_),o.identity(),s.copy(x.matrixWorld),s.premultiply(_),o.extractRotation(s),w.halfWidth.set(x.width*.5,0,0),w.halfHeight.set(0,x.height*.5,0),w.halfWidth.applyMatrix4(o),w.halfHeight.applyMatrix4(o),m++}else if(x.isPointLight){const w=n.point[p];w.position.setFromMatrixPosition(x.matrixWorld),w.position.applyMatrix4(_),p++}else if(x.isHemisphereLight){const w=n.hemi[E];w.direction.setFromMatrixPosition(x.matrixWorld),w.direction.transformDirection(_),E++}}}return{setup:l,setupView:h,state:n}}function X7(r){const e=new yT(r),t=[],n=[];function i(d){u.camera=d,t.length=0,n.length=0}function s(d){t.push(d)}function o(d){n.push(d)}function l(){e.setup(t)}function h(d){e.setupView(t,d)}const u={lightsArray:t,shadowsArray:n,camera:null,lights:e,transmissionRenderTarget:{}};return{init:i,state:u,setupLights:l,setupLightsView:h,pushLight:s,pushShadow:o}}function ET(r){let e=new WeakMap;function t(i,s=0){const o=e.get(i);let l;return o===void 0?(l=new X7(r),e.set(i,[l])):s>=o.length?(l=new X7(r),o.push(l)):l=o[s],l}function n(){e=new WeakMap}return{get:t,dispose:n}}const xT=`void main() {
3794
3794
  gl_Position = vec4( position, 1.0 );
3795
3795
  }`,wT=`uniform sampler2D shadow_pass;
3796
3796
  uniform vec2 resolution;
@@ -3818,7 +3818,7 @@ void main() {
3818
3818
  squared_mean = squared_mean / samples;
3819
3819
  float std_dev = sqrt( squared_mean - mean * mean );
3820
3820
  gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );
3821
- }`;function CT(r,e,t){let n=new m4;const i=new ze,s=new ze,o=new Ut,l=new s7({depthPacking:ix}),h=new _w,u={},d=t.maxTextureSize,A={[Un]:V0,[V0]:Un,[pn]:pn},p=new B0({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new ze},radius:{value:4}},vertexShader:xT,fragmentShader:wT}),g=p.clone();g.defines.HORIZONTAL_PASS=1;const m=new vn;m.setAttribute("position",new S0(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const E=new T0(m,p),_=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=G6;let v=this.type;this.render=function(T,S,D){if(_.enabled===!1||_.autoUpdate===!1&&_.needsUpdate===!1||T.length===0)return;const R=r.getRenderTarget(),M=r.getActiveCubeFace(),L=r.getActiveMipmapLevel(),P=r.state;P.setBlending(Ci),P.buffers.color.setClear(1,1,1,1),P.buffers.depth.setTest(!0),P.setScissorTest(!1);const F=v!==wi&&this.type===wi,z=v===wi&&this.type!==wi;for(let J=0,q=T.length;J<q;J++){const ne=T[J],j=ne.shadow;if(j===void 0){console.warn("THREE.WebGLShadowMap:",ne,"has no shadow.");continue}if(j.autoUpdate===!1&&j.needsUpdate===!1)continue;i.copy(j.mapSize);const te=j.getFrameExtents();if(i.multiply(te),s.copy(j.mapSize),(i.x>d||i.y>d)&&(i.x>d&&(s.x=Math.floor(d/te.x),i.x=s.x*te.x,j.mapSize.x=s.x),i.y>d&&(s.y=Math.floor(d/te.y),i.y=s.y*te.y,j.mapSize.y=s.y)),j.map===null||F===!0||z===!0){const U=this.type!==wi?{minFilter:$t,magFilter:$t}:{};j.map!==null&&j.map.dispose(),j.map=new Nr(i.x,i.y,U),j.map.texture.name=ne.name+".shadowMap",j.camera.updateProjectionMatrix()}r.setRenderTarget(j.map),r.clear();const W=j.getViewportCount();for(let U=0;U<W;U++){const H=j.getViewport(U);o.set(s.x*H.x,s.y*H.y,s.x*H.z,s.y*H.w),P.viewport(o),j.updateMatrices(ne,U),n=j.getFrustum(),w(S,D,j.camera,ne,this.type)}j.isPointLightShadow!==!0&&this.type===wi&&C(j,D),j.needsUpdate=!1}v=this.type,_.needsUpdate=!1,r.setRenderTarget(R,M,L)};function C(T,S){const D=e.update(E);p.defines.VSM_SAMPLES!==T.blurSamples&&(p.defines.VSM_SAMPLES=T.blurSamples,g.defines.VSM_SAMPLES=T.blurSamples,p.needsUpdate=!0,g.needsUpdate=!0),T.mapPass===null&&(T.mapPass=new Nr(i.x,i.y)),p.uniforms.shadow_pass.value=T.map.texture,p.uniforms.resolution.value=T.mapSize,p.uniforms.radius.value=T.radius,r.setRenderTarget(T.mapPass),r.clear(),r.renderBufferDirect(S,null,D,p,E,null),g.uniforms.shadow_pass.value=T.mapPass.texture,g.uniforms.resolution.value=T.mapSize,g.uniforms.radius.value=T.radius,r.setRenderTarget(T.map),r.clear(),r.renderBufferDirect(S,null,D,g,E,null)}function x(T,S,D,R){let M=null;const L=D.isPointLight===!0?T.customDistanceMaterial:T.customDepthMaterial;if(L!==void 0)M=L;else if(M=D.isPointLight===!0?h:l,r.localClippingEnabled&&S.clipShadows===!0&&Array.isArray(S.clippingPlanes)&&S.clippingPlanes.length!==0||S.displacementMap&&S.displacementScale!==0||S.alphaMap&&S.alphaTest>0||S.map&&S.alphaTest>0){const P=M.uuid,F=S.uuid;let z=u[P];z===void 0&&(z={},u[P]=z);let J=z[F];J===void 0&&(J=M.clone(),z[F]=J,S.addEventListener("dispose",B)),M=J}if(M.visible=S.visible,M.wireframe=S.wireframe,R===wi?M.side=S.shadowSide!==null?S.shadowSide:S.side:M.side=S.shadowSide!==null?S.shadowSide:A[S.side],M.alphaMap=S.alphaMap,M.alphaTest=S.alphaTest,M.map=S.map,M.clipShadows=S.clipShadows,M.clippingPlanes=S.clippingPlanes,M.clipIntersection=S.clipIntersection,M.displacementMap=S.displacementMap,M.displacementScale=S.displacementScale,M.displacementBias=S.displacementBias,M.wireframeLinewidth=S.wireframeLinewidth,M.linewidth=S.linewidth,D.isPointLight===!0&&M.isMeshDistanceMaterial===!0){const P=r.properties.get(M);P.light=D}return M}function w(T,S,D,R,M){if(T.visible===!1)return;if(T.layers.test(S.layers)&&(T.isMesh||T.isLine||T.isPoints)&&(T.castShadow||T.receiveShadow&&M===wi)&&(!T.frustumCulled||n.intersectsObject(T))){T.modelViewMatrix.multiplyMatrices(D.matrixWorldInverse,T.matrixWorld);const P=e.update(T),F=T.material;if(Array.isArray(F)){const z=P.groups;for(let J=0,q=z.length;J<q;J++){const ne=z[J],j=F[ne.materialIndex];if(j&&j.visible){const te=x(T,j,R,M);T.onBeforeShadow(r,T,S,D,P,te,ne),r.renderBufferDirect(D,null,P,te,T,ne),T.onAfterShadow(r,T,S,D,P,te,ne)}}}else if(F.visible){const z=x(T,F,R,M);T.onBeforeShadow(r,T,S,D,P,z,null),r.renderBufferDirect(D,null,P,z,T,null),T.onAfterShadow(r,T,S,D,P,z,null)}}const L=T.children;for(let P=0,F=L.length;P<F;P++)w(L[P],S,D,R,M)}function B(T){T.target.removeEventListener("dispose",B);for(const S in u){const D=u[S],R=T.target.uuid;R in D&&(D[R].dispose(),delete D[R])}}}const IT={[u3]:h3,[d3]:A3,[f3]:g3,[lo]:p3,[h3]:u3,[A3]:d3,[g3]:f3,[p3]:lo};function MT(r,e){function t(){let $=!1;const Se=new Ut;let ue=null;const ve=new Ut(0,0,0,0);return{setMask:function(De){ue!==De&&!$&&(r.colorMask(De,De,De,De),ue=De)},setLocked:function(De){$=De},setClear:function(De,Be,it,jt,y0){y0===!0&&(De*=jt,Be*=jt,it*=jt),Se.set(De,Be,it,jt),ve.equals(Se)===!1&&(r.clearColor(De,Be,it,jt),ve.copy(Se))},reset:function(){$=!1,ue=null,ve.set(-1,0,0,0)}}}function n(){let $=!1,Se=!1,ue=null,ve=null,De=null;return{setReversed:function(Be){if(Se!==Be){const it=e.get("EXT_clip_control");Se?it.clipControlEXT(it.LOWER_LEFT_EXT,it.ZERO_TO_ONE_EXT):it.clipControlEXT(it.LOWER_LEFT_EXT,it.NEGATIVE_ONE_TO_ONE_EXT);const jt=De;De=null,this.setClear(jt)}Se=Be},getReversed:function(){return Se},setTest:function(Be){Be?Ae(r.DEPTH_TEST):ge(r.DEPTH_TEST)},setMask:function(Be){ue!==Be&&!$&&(r.depthMask(Be),ue=Be)},setFunc:function(Be){if(Se&&(Be=IT[Be]),ve!==Be){switch(Be){case u3:r.depthFunc(r.NEVER);break;case h3:r.depthFunc(r.ALWAYS);break;case d3:r.depthFunc(r.LESS);break;case lo:r.depthFunc(r.LEQUAL);break;case f3:r.depthFunc(r.EQUAL);break;case p3:r.depthFunc(r.GEQUAL);break;case A3:r.depthFunc(r.GREATER);break;case g3:r.depthFunc(r.NOTEQUAL);break;default:r.depthFunc(r.LEQUAL)}ve=Be}},setLocked:function(Be){$=Be},setClear:function(Be){De!==Be&&(Se&&(Be=1-Be),r.clearDepth(Be),De=Be)},reset:function(){$=!1,ue=null,ve=null,De=null,Se=!1}}}function i(){let $=!1,Se=null,ue=null,ve=null,De=null,Be=null,it=null,jt=null,y0=null;return{setTest:function(Rt){$||(Rt?Ae(r.STENCIL_TEST):ge(r.STENCIL_TEST))},setMask:function(Rt){Se!==Rt&&!$&&(r.stencilMask(Rt),Se=Rt)},setFunc:function(Rt,lr,cr){(ue!==Rt||ve!==lr||De!==cr)&&(r.stencilFunc(Rt,lr,cr),ue=Rt,ve=lr,De=cr)},setOp:function(Rt,lr,cr){(Be!==Rt||it!==lr||jt!==cr)&&(r.stencilOp(Rt,lr,cr),Be=Rt,it=lr,jt=cr)},setLocked:function(Rt){$=Rt},setClear:function(Rt){y0!==Rt&&(r.clearStencil(Rt),y0=Rt)},reset:function(){$=!1,Se=null,ue=null,ve=null,De=null,Be=null,it=null,jt=null,y0=null}}}const s=new t,o=new n,l=new i,h=new WeakMap,u=new WeakMap;let d={},A={},p=new WeakMap,g=[],m=null,E=!1,_=null,v=null,C=null,x=null,w=null,B=null,T=null,S=new We(0,0,0),D=0,R=!1,M=null,L=null,P=null,F=null,z=null;const J=r.getParameter(r.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let q=!1,ne=0;const j=r.getParameter(r.VERSION);j.indexOf("WebGL")!==-1?(ne=parseFloat(/^WebGL (\d)/.exec(j)[1]),q=ne>=1):j.indexOf("OpenGL ES")!==-1&&(ne=parseFloat(/^OpenGL ES (\d)/.exec(j)[1]),q=ne>=2);let te=null,W={};const U=r.getParameter(r.SCISSOR_BOX),H=r.getParameter(r.VIEWPORT),Z=new Ut().fromArray(U),G=new Ut().fromArray(H);function oe($,Se,ue,ve){const De=new Uint8Array(4),Be=r.createTexture();r.bindTexture($,Be),r.texParameteri($,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri($,r.TEXTURE_MAG_FILTER,r.NEAREST);for(let it=0;it<ue;it++)$===r.TEXTURE_3D||$===r.TEXTURE_2D_ARRAY?r.texImage3D(Se,0,r.RGBA,1,1,ve,0,r.RGBA,r.UNSIGNED_BYTE,De):r.texImage2D(Se+it,0,r.RGBA,1,1,0,r.RGBA,r.UNSIGNED_BYTE,De);return Be}const pe={};pe[r.TEXTURE_2D]=oe(r.TEXTURE_2D,r.TEXTURE_2D,1),pe[r.TEXTURE_CUBE_MAP]=oe(r.TEXTURE_CUBE_MAP,r.TEXTURE_CUBE_MAP_POSITIVE_X,6),pe[r.TEXTURE_2D_ARRAY]=oe(r.TEXTURE_2D_ARRAY,r.TEXTURE_2D_ARRAY,1,1),pe[r.TEXTURE_3D]=oe(r.TEXTURE_3D,r.TEXTURE_3D,1,1),s.setClear(0,0,0,1),o.setClear(1),l.setClear(0),Ae(r.DEPTH_TEST),o.setFunc(lo),pt(!1),At(z6),Ae(r.CULL_FACE),X(Ci);function Ae($){d[$]!==!0&&(r.enable($),d[$]=!0)}function ge($){d[$]!==!1&&(r.disable($),d[$]=!1)}function Re($,Se){return A[$]!==Se?(r.bindFramebuffer($,Se),A[$]=Se,$===r.DRAW_FRAMEBUFFER&&(A[r.FRAMEBUFFER]=Se),$===r.FRAMEBUFFER&&(A[r.DRAW_FRAMEBUFFER]=Se),!0):!1}function Fe($,Se){let ue=g,ve=!1;if($){ue=p.get(Se),ue===void 0&&(ue=[],p.set(Se,ue));const De=$.textures;if(ue.length!==De.length||ue[0]!==r.COLOR_ATTACHMENT0){for(let Be=0,it=De.length;Be<it;Be++)ue[Be]=r.COLOR_ATTACHMENT0+Be;ue.length=De.length,ve=!0}}else ue[0]!==r.BACK&&(ue[0]=r.BACK,ve=!0);ve&&r.drawBuffers(ue)}function st($){return m!==$?(r.useProgram($),m=$,!0):!1}const ut={[ca]:r.FUNC_ADD,[NE]:r.FUNC_SUBTRACT,[PE]:r.FUNC_REVERSE_SUBTRACT};ut[UE]=r.MIN,ut[kE]=r.MAX;const mt={[FE]:r.ZERO,[OE]:r.ONE,[QE]:r.SRC_COLOR,[l3]:r.SRC_ALPHA,[WE]:r.SRC_ALPHA_SATURATE,[VE]:r.DST_COLOR,[GE]:r.DST_ALPHA,[zE]:r.ONE_MINUS_SRC_COLOR,[c3]:r.ONE_MINUS_SRC_ALPHA,[jE]:r.ONE_MINUS_DST_COLOR,[HE]:r.ONE_MINUS_DST_ALPHA,[YE]:r.CONSTANT_COLOR,[qE]:r.ONE_MINUS_CONSTANT_COLOR,[XE]:r.CONSTANT_ALPHA,[JE]:r.ONE_MINUS_CONSTANT_ALPHA};function X($,Se,ue,ve,De,Be,it,jt,y0,Rt){if($===Ci){E===!0&&(ge(r.BLEND),E=!1);return}if(E===!1&&(Ae(r.BLEND),E=!0),$!==LE){if($!==_||Rt!==R){if((v!==ca||w!==ca)&&(r.blendEquation(r.FUNC_ADD),v=ca,w=ca),Rt)switch($){case oo:r.blendFuncSeparate(r.ONE,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA);break;case a3:r.blendFunc(r.ONE,r.ONE);break;case H6:r.blendFuncSeparate(r.ZERO,r.ONE_MINUS_SRC_COLOR,r.ZERO,r.ONE);break;case o3:r.blendFuncSeparate(r.ZERO,r.SRC_COLOR,r.ZERO,r.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",$);break}else switch($){case oo:r.blendFuncSeparate(r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA);break;case a3:r.blendFunc(r.SRC_ALPHA,r.ONE);break;case H6:r.blendFuncSeparate(r.ZERO,r.ONE_MINUS_SRC_COLOR,r.ZERO,r.ONE);break;case o3:r.blendFunc(r.ZERO,r.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",$);break}C=null,x=null,B=null,T=null,S.set(0,0,0),D=0,_=$,R=Rt}return}De=De||Se,Be=Be||ue,it=it||ve,(Se!==v||De!==w)&&(r.blendEquationSeparate(ut[Se],ut[De]),v=Se,w=De),(ue!==C||ve!==x||Be!==B||it!==T)&&(r.blendFuncSeparate(mt[ue],mt[ve],mt[Be],mt[it]),C=ue,x=ve,B=Be,T=it),(jt.equals(S)===!1||y0!==D)&&(r.blendColor(jt.r,jt.g,jt.b,y0),S.copy(jt),D=y0),_=$,R=!1}function h0($,Se){$.side===pn?ge(r.CULL_FACE):Ae(r.CULL_FACE);let ue=$.side===V0;Se&&(ue=!ue),pt(ue),$.blending===oo&&$.transparent===!1?X(Ci):X($.blending,$.blendEquation,$.blendSrc,$.blendDst,$.blendEquationAlpha,$.blendSrcAlpha,$.blendDstAlpha,$.blendColor,$.blendAlpha,$.premultipliedAlpha),o.setFunc($.depthFunc),o.setTest($.depthTest),o.setMask($.depthWrite),s.setMask($.colorWrite);const ve=$.stencilWrite;l.setTest(ve),ve&&(l.setMask($.stencilWriteMask),l.setFunc($.stencilFunc,$.stencilRef,$.stencilFuncMask),l.setOp($.stencilFail,$.stencilZFail,$.stencilZPass)),Mt($.polygonOffset,$.polygonOffsetFactor,$.polygonOffsetUnits),$.alphaToCoverage===!0?Ae(r.SAMPLE_ALPHA_TO_COVERAGE):ge(r.SAMPLE_ALPHA_TO_COVERAGE)}function pt($){M!==$&&($?r.frontFace(r.CW):r.frontFace(r.CCW),M=$)}function At($){$!==bE?(Ae(r.CULL_FACE),$!==L&&($===z6?r.cullFace(r.BACK):$===RE?r.cullFace(r.FRONT):r.cullFace(r.FRONT_AND_BACK))):ge(r.CULL_FACE),L=$}function qe($){$!==P&&(q&&r.lineWidth($),P=$)}function Mt($,Se,ue){$?(Ae(r.POLYGON_OFFSET_FILL),(F!==Se||z!==ue)&&(r.polygonOffset(Se,ue),F=Se,z=ue)):ge(r.POLYGON_OFFSET_FILL)}function Ye($){$?Ae(r.SCISSOR_TEST):ge(r.SCISSOR_TEST)}function Q($){$===void 0&&($=r.TEXTURE0+J-1),te!==$&&(r.activeTexture($),te=$)}function k($,Se,ue){ue===void 0&&(te===null?ue=r.TEXTURE0+J-1:ue=te);let ve=W[ue];ve===void 0&&(ve={type:void 0,texture:void 0},W[ue]=ve),(ve.type!==$||ve.texture!==Se)&&(te!==ue&&(r.activeTexture(ue),te=ue),r.bindTexture($,Se||pe[$]),ve.type=$,ve.texture=Se)}function se(){const $=W[te];$!==void 0&&$.type!==void 0&&(r.bindTexture($.type,null),$.type=void 0,$.texture=void 0)}function ye(){try{r.compressedTexImage2D(...arguments)}catch($){console.error("THREE.WebGLState:",$)}}function Ee(){try{r.compressedTexImage3D(...arguments)}catch($){console.error("THREE.WebGLState:",$)}}function _e(){try{r.texSubImage2D(...arguments)}catch($){console.error("THREE.WebGLState:",$)}}function Ge(){try{r.texSubImage3D(...arguments)}catch($){console.error("THREE.WebGLState:",$)}}function Le(){try{r.compressedTexSubImage2D(...arguments)}catch($){console.error("THREE.WebGLState:",$)}}function Ve(){try{r.compressedTexSubImage3D(...arguments)}catch($){console.error("THREE.WebGLState:",$)}}function gt(){try{r.texStorage2D(...arguments)}catch($){console.error("THREE.WebGLState:",$)}}function we(){try{r.texStorage3D(...arguments)}catch($){console.error("THREE.WebGLState:",$)}}function Pe(){try{r.texImage2D(...arguments)}catch($){console.error("THREE.WebGLState:",$)}}function nt(){try{r.texImage3D(...arguments)}catch($){console.error("THREE.WebGLState:",$)}}function et($){Z.equals($)===!1&&(r.scissor($.x,$.y,$.z,$.w),Z.copy($))}function he($){G.equals($)===!1&&(r.viewport($.x,$.y,$.z,$.w),G.copy($))}function Oe($,Se){let ue=u.get(Se);ue===void 0&&(ue=new WeakMap,u.set(Se,ue));let ve=ue.get($);ve===void 0&&(ve=r.getUniformBlockIndex(Se,$.name),ue.set($,ve))}function ke($,Se){const ue=u.get(Se).get($);h.get(Se)!==ue&&(r.uniformBlockBinding(Se,ue,$.__bindingPointIndex),h.set(Se,ue))}function ht(){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),o.setReversed(!1),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),d={},te=null,W={},A={},p=new WeakMap,g=[],m=null,E=!1,_=null,v=null,C=null,x=null,w=null,B=null,T=null,S=new We(0,0,0),D=0,R=!1,M=null,L=null,P=null,F=null,z=null,Z.set(0,0,r.canvas.width,r.canvas.height),G.set(0,0,r.canvas.width,r.canvas.height),s.reset(),o.reset(),l.reset()}return{buffers:{color:s,depth:o,stencil:l},enable:Ae,disable:ge,bindFramebuffer:Re,drawBuffers:Fe,useProgram:st,setBlending:X,setMaterial:h0,setFlipSided:pt,setCullFace:At,setLineWidth:qe,setPolygonOffset:Mt,setScissorTest:Ye,activeTexture:Q,bindTexture:k,unbindTexture:se,compressedTexImage2D:ye,compressedTexImage3D:Ee,texImage2D:Pe,texImage3D:nt,updateUBOMapping:Oe,uniformBlockBinding:ke,texStorage2D:gt,texStorage3D:we,texSubImage2D:_e,texSubImage3D:Ge,compressedTexSubImage2D:Le,compressedTexSubImage3D:Ve,scissor:et,viewport:he,reset:ht}}function ST(r,e,t,n,i,s,o){const l=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,h=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),u=new ze,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 m(Q,k){return g?new OffscreenCanvas(Q,k):cl("canvas")}function E(Q,k,se){let ye=1;const Ee=Ye(Q);if((Ee.width>se||Ee.height>se)&&(ye=se/Math.max(Ee.width,Ee.height)),ye<1)if(typeof HTMLImageElement<"u"&&Q instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&Q instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&Q instanceof ImageBitmap||typeof VideoFrame<"u"&&Q instanceof VideoFrame){const _e=Math.floor(ye*Ee.width),Ge=Math.floor(ye*Ee.height);A===void 0&&(A=m(_e,Ge));const Le=k?m(_e,Ge):A;return Le.width=_e,Le.height=Ge,Le.getContext("2d").drawImage(Q,0,0,_e,Ge),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+Ee.width+"x"+Ee.height+") to ("+_e+"x"+Ge+")."),Le}else return"data"in Q&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+Ee.width+"x"+Ee.height+")."),Q;return Q}function _(Q){return Q.generateMipmaps}function v(Q){r.generateMipmap(Q)}function C(Q){return Q.isWebGLCubeRenderTarget?r.TEXTURE_CUBE_MAP:Q.isWebGL3DRenderTarget?r.TEXTURE_3D:Q.isWebGLArrayRenderTarget||Q.isCompressedArrayTexture?r.TEXTURE_2D_ARRAY:r.TEXTURE_2D}function x(Q,k,se,ye,Ee=!1){if(Q!==null){if(r[Q]!==void 0)return r[Q];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+Q+"'")}let _e=k;if(k===r.RED&&(se===r.FLOAT&&(_e=r.R32F),se===r.HALF_FLOAT&&(_e=r.R16F),se===r.UNSIGNED_BYTE&&(_e=r.R8)),k===r.RED_INTEGER&&(se===r.UNSIGNED_BYTE&&(_e=r.R8UI),se===r.UNSIGNED_SHORT&&(_e=r.R16UI),se===r.UNSIGNED_INT&&(_e=r.R32UI),se===r.BYTE&&(_e=r.R8I),se===r.SHORT&&(_e=r.R16I),se===r.INT&&(_e=r.R32I)),k===r.RG&&(se===r.FLOAT&&(_e=r.RG32F),se===r.HALF_FLOAT&&(_e=r.RG16F),se===r.UNSIGNED_BYTE&&(_e=r.RG8)),k===r.RG_INTEGER&&(se===r.UNSIGNED_BYTE&&(_e=r.RG8UI),se===r.UNSIGNED_SHORT&&(_e=r.RG16UI),se===r.UNSIGNED_INT&&(_e=r.RG32UI),se===r.BYTE&&(_e=r.RG8I),se===r.SHORT&&(_e=r.RG16I),se===r.INT&&(_e=r.RG32I)),k===r.RGB_INTEGER&&(se===r.UNSIGNED_BYTE&&(_e=r.RGB8UI),se===r.UNSIGNED_SHORT&&(_e=r.RGB16UI),se===r.UNSIGNED_INT&&(_e=r.RGB32UI),se===r.BYTE&&(_e=r.RGB8I),se===r.SHORT&&(_e=r.RGB16I),se===r.INT&&(_e=r.RGB32I)),k===r.RGBA_INTEGER&&(se===r.UNSIGNED_BYTE&&(_e=r.RGBA8UI),se===r.UNSIGNED_SHORT&&(_e=r.RGBA16UI),se===r.UNSIGNED_INT&&(_e=r.RGBA32UI),se===r.BYTE&&(_e=r.RGBA8I),se===r.SHORT&&(_e=r.RGBA16I),se===r.INT&&(_e=r.RGBA32I)),k===r.RGB&&se===r.UNSIGNED_INT_5_9_9_9_REV&&(_e=r.RGB9_E5),k===r.RGBA){const Ge=Ee?h9:St.getTransfer(ye);se===r.FLOAT&&(_e=r.RGBA32F),se===r.HALF_FLOAT&&(_e=r.RGBA16F),se===r.UNSIGNED_BYTE&&(_e=Ge===Ot?r.SRGB8_ALPHA8:r.RGBA8),se===r.UNSIGNED_SHORT_4_4_4_4&&(_e=r.RGBA4),se===r.UNSIGNED_SHORT_5_5_5_1&&(_e=r.RGB5_A1)}return(_e===r.R16F||_e===r.R32F||_e===r.RG16F||_e===r.RG32F||_e===r.RGBA16F||_e===r.RGBA32F)&&e.get("EXT_color_buffer_float"),_e}function w(Q,k){let se;return Q?k===null||k===An||k===po?se=r.DEPTH24_STENCIL8:k===Jt?se=r.DEPTH32F_STENCIL8:k===ho&&(se=r.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):k===null||k===An||k===po?se=r.DEPTH_COMPONENT24:k===Jt?se=r.DEPTH_COMPONENT32F:k===ho&&(se=r.DEPTH_COMPONENT16),se}function B(Q,k){return _(Q)===!0||Q.isFramebufferTexture&&Q.minFilter!==$t&&Q.minFilter!==Gt?Math.log2(Math.max(k.width,k.height))+1:Q.mipmaps!==void 0&&Q.mipmaps.length>0?Q.mipmaps.length:Q.isCompressedTexture&&Array.isArray(Q.image)?k.mipmaps.length:1}function T(Q){const k=Q.target;k.removeEventListener("dispose",T),D(k),k.isVideoTexture&&d.delete(k)}function S(Q){const k=Q.target;k.removeEventListener("dispose",S),M(k)}function D(Q){const k=n.get(Q);if(k.__webglInit===void 0)return;const se=Q.source,ye=p.get(se);if(ye){const Ee=ye[k.__cacheKey];Ee.usedTimes--,Ee.usedTimes===0&&R(Q),Object.keys(ye).length===0&&p.delete(se)}n.remove(Q)}function R(Q){const k=n.get(Q);r.deleteTexture(k.__webglTexture);const se=Q.source,ye=p.get(se);delete ye[k.__cacheKey],o.memory.textures--}function M(Q){const k=n.get(Q);if(Q.depthTexture&&(Q.depthTexture.dispose(),n.remove(Q.depthTexture)),Q.isWebGLCubeRenderTarget)for(let ye=0;ye<6;ye++){if(Array.isArray(k.__webglFramebuffer[ye]))for(let Ee=0;Ee<k.__webglFramebuffer[ye].length;Ee++)r.deleteFramebuffer(k.__webglFramebuffer[ye][Ee]);else r.deleteFramebuffer(k.__webglFramebuffer[ye]);k.__webglDepthbuffer&&r.deleteRenderbuffer(k.__webglDepthbuffer[ye])}else{if(Array.isArray(k.__webglFramebuffer))for(let ye=0;ye<k.__webglFramebuffer.length;ye++)r.deleteFramebuffer(k.__webglFramebuffer[ye]);else r.deleteFramebuffer(k.__webglFramebuffer);if(k.__webglDepthbuffer&&r.deleteRenderbuffer(k.__webglDepthbuffer),k.__webglMultisampledFramebuffer&&r.deleteFramebuffer(k.__webglMultisampledFramebuffer),k.__webglColorRenderbuffer)for(let ye=0;ye<k.__webglColorRenderbuffer.length;ye++)k.__webglColorRenderbuffer[ye]&&r.deleteRenderbuffer(k.__webglColorRenderbuffer[ye]);k.__webglDepthRenderbuffer&&r.deleteRenderbuffer(k.__webglDepthRenderbuffer)}const se=Q.textures;for(let ye=0,Ee=se.length;ye<Ee;ye++){const _e=n.get(se[ye]);_e.__webglTexture&&(r.deleteTexture(_e.__webglTexture),o.memory.textures--),n.remove(se[ye])}n.remove(Q)}let L=0;function P(){L=0}function F(){const Q=L;return Q>=i.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+Q+" texture units while this GPU supports only "+i.maxTextures),L+=1,Q}function z(Q){const k=[];return k.push(Q.wrapS),k.push(Q.wrapT),k.push(Q.wrapR||0),k.push(Q.magFilter),k.push(Q.minFilter),k.push(Q.anisotropy),k.push(Q.internalFormat),k.push(Q.format),k.push(Q.type),k.push(Q.generateMipmaps),k.push(Q.premultiplyAlpha),k.push(Q.flipY),k.push(Q.unpackAlignment),k.push(Q.colorSpace),k.join()}function J(Q,k){const se=n.get(Q);if(Q.isVideoTexture&&qe(Q),Q.isRenderTargetTexture===!1&&Q.version>0&&se.__version!==Q.version){const ye=Q.image;if(ye===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(ye.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{G(se,Q,k);return}}t.bindTexture(r.TEXTURE_2D,se.__webglTexture,r.TEXTURE0+k)}function q(Q,k){const se=n.get(Q);if(Q.version>0&&se.__version!==Q.version){G(se,Q,k);return}t.bindTexture(r.TEXTURE_2D_ARRAY,se.__webglTexture,r.TEXTURE0+k)}function ne(Q,k){const se=n.get(Q);if(Q.version>0&&se.__version!==Q.version){G(se,Q,k);return}t.bindTexture(r.TEXTURE_3D,se.__webglTexture,r.TEXTURE0+k)}function j(Q,k){const se=n.get(Q);if(Q.version>0&&se.__version!==Q.version){oe(se,Q,k);return}t.bindTexture(r.TEXTURE_CUBE_MAP,se.__webglTexture,r.TEXTURE0+k)}const te={[us]:r.REPEAT,[P0]:r.CLAMP_TO_EDGE,[$2]:r.MIRRORED_REPEAT},W={[$t]:r.NEAREST,[Z6]:r.NEAREST_MIPMAP_NEAREST,[Z1]:r.NEAREST_MIPMAP_LINEAR,[Gt]:r.LINEAR,[e9]:r.LINEAR_MIPMAP_NEAREST,[Jr]:r.LINEAR_MIPMAP_LINEAR},U={[ax]:r.NEVER,[dx]:r.ALWAYS,[ox]:r.LESS,[hd]:r.LEQUAL,[lx]:r.EQUAL,[hx]:r.GEQUAL,[cx]:r.GREATER,[ux]:r.NOTEQUAL};function H(Q,k){if(k.type===Jt&&e.has("OES_texture_float_linear")===!1&&(k.magFilter===Gt||k.magFilter===e9||k.magFilter===Z1||k.magFilter===Jr||k.minFilter===Gt||k.minFilter===e9||k.minFilter===Z1||k.minFilter===Jr)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),r.texParameteri(Q,r.TEXTURE_WRAP_S,te[k.wrapS]),r.texParameteri(Q,r.TEXTURE_WRAP_T,te[k.wrapT]),(Q===r.TEXTURE_3D||Q===r.TEXTURE_2D_ARRAY)&&r.texParameteri(Q,r.TEXTURE_WRAP_R,te[k.wrapR]),r.texParameteri(Q,r.TEXTURE_MAG_FILTER,W[k.magFilter]),r.texParameteri(Q,r.TEXTURE_MIN_FILTER,W[k.minFilter]),k.compareFunction&&(r.texParameteri(Q,r.TEXTURE_COMPARE_MODE,r.COMPARE_REF_TO_TEXTURE),r.texParameteri(Q,r.TEXTURE_COMPARE_FUNC,U[k.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(k.magFilter===$t||k.minFilter!==Z1&&k.minFilter!==Jr||k.type===Jt&&e.has("OES_texture_float_linear")===!1)return;if(k.anisotropy>1||n.get(k).__currentAnisotropy){const se=e.get("EXT_texture_filter_anisotropic");r.texParameterf(Q,se.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(k.anisotropy,i.getMaxAnisotropy())),n.get(k).__currentAnisotropy=k.anisotropy}}}function Z(Q,k){let se=!1;Q.__webglInit===void 0&&(Q.__webglInit=!0,k.addEventListener("dispose",T));const ye=k.source;let Ee=p.get(ye);Ee===void 0&&(Ee={},p.set(ye,Ee));const _e=z(k);if(_e!==Q.__cacheKey){Ee[_e]===void 0&&(Ee[_e]={texture:r.createTexture(),usedTimes:0},o.memory.textures++,se=!0),Ee[_e].usedTimes++;const Ge=Ee[Q.__cacheKey];Ge!==void 0&&(Ee[Q.__cacheKey].usedTimes--,Ge.usedTimes===0&&R(k)),Q.__cacheKey=_e,Q.__webglTexture=Ee[_e].texture}return se}function G(Q,k,se){let ye=r.TEXTURE_2D;(k.isDataArrayTexture||k.isCompressedArrayTexture)&&(ye=r.TEXTURE_2D_ARRAY),k.isData3DTexture&&(ye=r.TEXTURE_3D);const Ee=Z(Q,k),_e=k.source;t.bindTexture(ye,Q.__webglTexture,r.TEXTURE0+se);const Ge=n.get(_e);if(_e.version!==Ge.__version||Ee===!0){t.activeTexture(r.TEXTURE0+se);const Le=St.getPrimaries(St.workingColorSpace),Ve=k.colorSpace===Mi?null:St.getPrimaries(k.colorSpace),gt=k.colorSpace===Mi||Le===Ve?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,gt);let we=E(k.image,!1,i.maxTextureSize);we=Mt(k,we);const Pe=s.convert(k.format,k.colorSpace),nt=s.convert(k.type);let et=x(k.internalFormat,Pe,nt,k.colorSpace,k.isVideoTexture);H(ye,k);let he;const Oe=k.mipmaps,ke=k.isVideoTexture!==!0,ht=Ge.__version===void 0||Ee===!0,$=_e.dataReady,Se=B(k,we);if(k.isDepthTexture)et=w(k.format===go,k.type),ht&&(ke?t.texStorage2D(r.TEXTURE_2D,1,et,we.width,we.height):t.texImage2D(r.TEXTURE_2D,0,et,we.width,we.height,0,Pe,nt,null));else if(k.isDataTexture)if(Oe.length>0){ke&&ht&&t.texStorage2D(r.TEXTURE_2D,Se,et,Oe[0].width,Oe[0].height);for(let ue=0,ve=Oe.length;ue<ve;ue++)he=Oe[ue],ke?$&&t.texSubImage2D(r.TEXTURE_2D,ue,0,0,he.width,he.height,Pe,nt,he.data):t.texImage2D(r.TEXTURE_2D,ue,et,he.width,he.height,0,Pe,nt,he.data);k.generateMipmaps=!1}else ke?(ht&&t.texStorage2D(r.TEXTURE_2D,Se,et,we.width,we.height),$&&t.texSubImage2D(r.TEXTURE_2D,0,0,0,we.width,we.height,Pe,nt,we.data)):t.texImage2D(r.TEXTURE_2D,0,et,we.width,we.height,0,Pe,nt,we.data);else if(k.isCompressedTexture)if(k.isCompressedArrayTexture){ke&&ht&&t.texStorage3D(r.TEXTURE_2D_ARRAY,Se,et,Oe[0].width,Oe[0].height,we.depth);for(let ue=0,ve=Oe.length;ue<ve;ue++)if(he=Oe[ue],k.format!==Kt)if(Pe!==null)if(ke){if($)if(k.layerUpdates.size>0){const De=y7(he.width,he.height,k.format,k.type);for(const Be of k.layerUpdates){const it=he.data.subarray(Be*De/he.data.BYTES_PER_ELEMENT,(Be+1)*De/he.data.BYTES_PER_ELEMENT);t.compressedTexSubImage3D(r.TEXTURE_2D_ARRAY,ue,0,0,Be,he.width,he.height,1,Pe,it)}k.clearLayerUpdates()}else t.compressedTexSubImage3D(r.TEXTURE_2D_ARRAY,ue,0,0,0,he.width,he.height,we.depth,Pe,he.data)}else t.compressedTexImage3D(r.TEXTURE_2D_ARRAY,ue,et,he.width,he.height,we.depth,0,he.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else ke?$&&t.texSubImage3D(r.TEXTURE_2D_ARRAY,ue,0,0,0,he.width,he.height,we.depth,Pe,nt,he.data):t.texImage3D(r.TEXTURE_2D_ARRAY,ue,et,he.width,he.height,we.depth,0,Pe,nt,he.data)}else{ke&&ht&&t.texStorage2D(r.TEXTURE_2D,Se,et,Oe[0].width,Oe[0].height);for(let ue=0,ve=Oe.length;ue<ve;ue++)he=Oe[ue],k.format!==Kt?Pe!==null?ke?$&&t.compressedTexSubImage2D(r.TEXTURE_2D,ue,0,0,he.width,he.height,Pe,he.data):t.compressedTexImage2D(r.TEXTURE_2D,ue,et,he.width,he.height,0,he.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):ke?$&&t.texSubImage2D(r.TEXTURE_2D,ue,0,0,he.width,he.height,Pe,nt,he.data):t.texImage2D(r.TEXTURE_2D,ue,et,he.width,he.height,0,Pe,nt,he.data)}else if(k.isDataArrayTexture)if(ke){if(ht&&t.texStorage3D(r.TEXTURE_2D_ARRAY,Se,et,we.width,we.height,we.depth),$)if(k.layerUpdates.size>0){const ue=y7(we.width,we.height,k.format,k.type);for(const ve of k.layerUpdates){const De=we.data.subarray(ve*ue/we.data.BYTES_PER_ELEMENT,(ve+1)*ue/we.data.BYTES_PER_ELEMENT);t.texSubImage3D(r.TEXTURE_2D_ARRAY,0,0,0,ve,we.width,we.height,1,Pe,nt,De)}k.clearLayerUpdates()}else t.texSubImage3D(r.TEXTURE_2D_ARRAY,0,0,0,0,we.width,we.height,we.depth,Pe,nt,we.data)}else t.texImage3D(r.TEXTURE_2D_ARRAY,0,et,we.width,we.height,we.depth,0,Pe,nt,we.data);else if(k.isData3DTexture)ke?(ht&&t.texStorage3D(r.TEXTURE_3D,Se,et,we.width,we.height,we.depth),$&&t.texSubImage3D(r.TEXTURE_3D,0,0,0,0,we.width,we.height,we.depth,Pe,nt,we.data)):t.texImage3D(r.TEXTURE_3D,0,et,we.width,we.height,we.depth,0,Pe,nt,we.data);else if(k.isFramebufferTexture){if(ht)if(ke)t.texStorage2D(r.TEXTURE_2D,Se,et,we.width,we.height);else{let ue=we.width,ve=we.height;for(let De=0;De<Se;De++)t.texImage2D(r.TEXTURE_2D,De,et,ue,ve,0,Pe,nt,null),ue>>=1,ve>>=1}}else if(Oe.length>0){if(ke&&ht){const ue=Ye(Oe[0]);t.texStorage2D(r.TEXTURE_2D,Se,et,ue.width,ue.height)}for(let ue=0,ve=Oe.length;ue<ve;ue++)he=Oe[ue],ke?$&&t.texSubImage2D(r.TEXTURE_2D,ue,0,0,Pe,nt,he):t.texImage2D(r.TEXTURE_2D,ue,et,Pe,nt,he);k.generateMipmaps=!1}else if(ke){if(ht){const ue=Ye(we);t.texStorage2D(r.TEXTURE_2D,Se,et,ue.width,ue.height)}$&&t.texSubImage2D(r.TEXTURE_2D,0,0,0,Pe,nt,we)}else t.texImage2D(r.TEXTURE_2D,0,et,Pe,nt,we);_(k)&&v(ye),Ge.__version=_e.version,k.onUpdate&&k.onUpdate(k)}Q.__version=k.version}function oe(Q,k,se){if(k.image.length!==6)return;const ye=Z(Q,k),Ee=k.source;t.bindTexture(r.TEXTURE_CUBE_MAP,Q.__webglTexture,r.TEXTURE0+se);const _e=n.get(Ee);if(Ee.version!==_e.__version||ye===!0){t.activeTexture(r.TEXTURE0+se);const Ge=St.getPrimaries(St.workingColorSpace),Le=k.colorSpace===Mi?null:St.getPrimaries(k.colorSpace),Ve=k.colorSpace===Mi||Ge===Le?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);const gt=k.isCompressedTexture||k.image[0].isCompressedTexture,we=k.image[0]&&k.image[0].isDataTexture,Pe=[];for(let ve=0;ve<6;ve++)!gt&&!we?Pe[ve]=E(k.image[ve],!0,i.maxCubemapSize):Pe[ve]=we?k.image[ve].image:k.image[ve],Pe[ve]=Mt(k,Pe[ve]);const nt=Pe[0],et=s.convert(k.format,k.colorSpace),he=s.convert(k.type),Oe=x(k.internalFormat,et,he,k.colorSpace),ke=k.isVideoTexture!==!0,ht=_e.__version===void 0||ye===!0,$=Ee.dataReady;let Se=B(k,nt);H(r.TEXTURE_CUBE_MAP,k);let ue;if(gt){ke&&ht&&t.texStorage2D(r.TEXTURE_CUBE_MAP,Se,Oe,nt.width,nt.height);for(let ve=0;ve<6;ve++){ue=Pe[ve].mipmaps;for(let De=0;De<ue.length;De++){const Be=ue[De];k.format!==Kt?et!==null?ke?$&&t.compressedTexSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ve,De,0,0,Be.width,Be.height,et,Be.data):t.compressedTexImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ve,De,Oe,Be.width,Be.height,0,Be.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):ke?$&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ve,De,0,0,Be.width,Be.height,et,he,Be.data):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ve,De,Oe,Be.width,Be.height,0,et,he,Be.data)}}}else{if(ue=k.mipmaps,ke&&ht){ue.length>0&&Se++;const ve=Ye(Pe[0]);t.texStorage2D(r.TEXTURE_CUBE_MAP,Se,Oe,ve.width,ve.height)}for(let ve=0;ve<6;ve++)if(we){ke?$&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ve,0,0,0,Pe[ve].width,Pe[ve].height,et,he,Pe[ve].data):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ve,0,Oe,Pe[ve].width,Pe[ve].height,0,et,he,Pe[ve].data);for(let De=0;De<ue.length;De++){const Be=ue[De].image[ve].image;ke?$&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ve,De+1,0,0,Be.width,Be.height,et,he,Be.data):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ve,De+1,Oe,Be.width,Be.height,0,et,he,Be.data)}}else{ke?$&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ve,0,0,0,et,he,Pe[ve]):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ve,0,Oe,et,he,Pe[ve]);for(let De=0;De<ue.length;De++){const Be=ue[De];ke?$&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ve,De+1,0,0,et,he,Be.image[ve]):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ve,De+1,Oe,et,he,Be.image[ve])}}}_(k)&&v(r.TEXTURE_CUBE_MAP),_e.__version=Ee.version,k.onUpdate&&k.onUpdate(k)}Q.__version=k.version}function pe(Q,k,se,ye,Ee,_e){const Ge=s.convert(se.format,se.colorSpace),Le=s.convert(se.type),Ve=x(se.internalFormat,Ge,Le,se.colorSpace),gt=n.get(k),we=n.get(se);if(we.__renderTarget=k,!gt.__hasExternalTextures){const Pe=Math.max(1,k.width>>_e),nt=Math.max(1,k.height>>_e);Ee===r.TEXTURE_3D||Ee===r.TEXTURE_2D_ARRAY?t.texImage3D(Ee,_e,Ve,Pe,nt,k.depth,0,Ge,Le,null):t.texImage2D(Ee,_e,Ve,Pe,nt,0,Ge,Le,null)}t.bindFramebuffer(r.FRAMEBUFFER,Q),At(k)?l.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,ye,Ee,we.__webglTexture,0,pt(k)):(Ee===r.TEXTURE_2D||Ee>=r.TEXTURE_CUBE_MAP_POSITIVE_X&&Ee<=r.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&r.framebufferTexture2D(r.FRAMEBUFFER,ye,Ee,we.__webglTexture,_e),t.bindFramebuffer(r.FRAMEBUFFER,null)}function Ae(Q,k,se){if(r.bindRenderbuffer(r.RENDERBUFFER,Q),k.depthBuffer){const ye=k.depthTexture,Ee=ye&&ye.isDepthTexture?ye.type:null,_e=w(k.stencilBuffer,Ee),Ge=k.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,Le=pt(k);At(k)?l.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,Le,_e,k.width,k.height):se?r.renderbufferStorageMultisample(r.RENDERBUFFER,Le,_e,k.width,k.height):r.renderbufferStorage(r.RENDERBUFFER,_e,k.width,k.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,Ge,r.RENDERBUFFER,Q)}else{const ye=k.textures;for(let Ee=0;Ee<ye.length;Ee++){const _e=ye[Ee],Ge=s.convert(_e.format,_e.colorSpace),Le=s.convert(_e.type),Ve=x(_e.internalFormat,Ge,Le,_e.colorSpace),gt=pt(k);se&&At(k)===!1?r.renderbufferStorageMultisample(r.RENDERBUFFER,gt,Ve,k.width,k.height):At(k)?l.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,gt,Ve,k.width,k.height):r.renderbufferStorage(r.RENDERBUFFER,Ve,k.width,k.height)}}r.bindRenderbuffer(r.RENDERBUFFER,null)}function ge(Q,k){if(k&&k.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(r.FRAMEBUFFER,Q),!(k.depthTexture&&k.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");const se=n.get(k.depthTexture);se.__renderTarget=k,(!se.__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),J(k.depthTexture,0);const ye=se.__webglTexture,Ee=pt(k);if(k.depthTexture.format===Ao)At(k)?l.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,ye,0,Ee):r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,ye,0);else if(k.depthTexture.format===go)At(k)?l.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.TEXTURE_2D,ye,0,Ee):r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.TEXTURE_2D,ye,0);else throw new Error("Unknown depthTexture format")}function Re(Q){const k=n.get(Q),se=Q.isWebGLCubeRenderTarget===!0;if(k.__boundDepthTexture!==Q.depthTexture){const ye=Q.depthTexture;if(k.__depthDisposeCallback&&k.__depthDisposeCallback(),ye){const Ee=()=>{delete k.__boundDepthTexture,delete k.__depthDisposeCallback,ye.removeEventListener("dispose",Ee)};ye.addEventListener("dispose",Ee),k.__depthDisposeCallback=Ee}k.__boundDepthTexture=ye}if(Q.depthTexture&&!k.__autoAllocateDepthBuffer){if(se)throw new Error("target.depthTexture not supported in Cube render targets");ge(k.__webglFramebuffer,Q)}else if(se){k.__webglDepthbuffer=[];for(let ye=0;ye<6;ye++)if(t.bindFramebuffer(r.FRAMEBUFFER,k.__webglFramebuffer[ye]),k.__webglDepthbuffer[ye]===void 0)k.__webglDepthbuffer[ye]=r.createRenderbuffer(),Ae(k.__webglDepthbuffer[ye],Q,!1);else{const Ee=Q.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,_e=k.__webglDepthbuffer[ye];r.bindRenderbuffer(r.RENDERBUFFER,_e),r.framebufferRenderbuffer(r.FRAMEBUFFER,Ee,r.RENDERBUFFER,_e)}}else if(t.bindFramebuffer(r.FRAMEBUFFER,k.__webglFramebuffer),k.__webglDepthbuffer===void 0)k.__webglDepthbuffer=r.createRenderbuffer(),Ae(k.__webglDepthbuffer,Q,!1);else{const ye=Q.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,Ee=k.__webglDepthbuffer;r.bindRenderbuffer(r.RENDERBUFFER,Ee),r.framebufferRenderbuffer(r.FRAMEBUFFER,ye,r.RENDERBUFFER,Ee)}t.bindFramebuffer(r.FRAMEBUFFER,null)}function Fe(Q,k,se){const ye=n.get(Q);k!==void 0&&pe(ye.__webglFramebuffer,Q,Q.texture,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,0),se!==void 0&&Re(Q)}function st(Q){const k=Q.texture,se=n.get(Q),ye=n.get(k);Q.addEventListener("dispose",S);const Ee=Q.textures,_e=Q.isWebGLCubeRenderTarget===!0,Ge=Ee.length>1;if(Ge||(ye.__webglTexture===void 0&&(ye.__webglTexture=r.createTexture()),ye.__version=k.version,o.memory.textures++),_e){se.__webglFramebuffer=[];for(let Le=0;Le<6;Le++)if(k.mipmaps&&k.mipmaps.length>0){se.__webglFramebuffer[Le]=[];for(let Ve=0;Ve<k.mipmaps.length;Ve++)se.__webglFramebuffer[Le][Ve]=r.createFramebuffer()}else se.__webglFramebuffer[Le]=r.createFramebuffer()}else{if(k.mipmaps&&k.mipmaps.length>0){se.__webglFramebuffer=[];for(let Le=0;Le<k.mipmaps.length;Le++)se.__webglFramebuffer[Le]=r.createFramebuffer()}else se.__webglFramebuffer=r.createFramebuffer();if(Ge)for(let Le=0,Ve=Ee.length;Le<Ve;Le++){const gt=n.get(Ee[Le]);gt.__webglTexture===void 0&&(gt.__webglTexture=r.createTexture(),o.memory.textures++)}if(Q.samples>0&&At(Q)===!1){se.__webglMultisampledFramebuffer=r.createFramebuffer(),se.__webglColorRenderbuffer=[],t.bindFramebuffer(r.FRAMEBUFFER,se.__webglMultisampledFramebuffer);for(let Le=0;Le<Ee.length;Le++){const Ve=Ee[Le];se.__webglColorRenderbuffer[Le]=r.createRenderbuffer(),r.bindRenderbuffer(r.RENDERBUFFER,se.__webglColorRenderbuffer[Le]);const gt=s.convert(Ve.format,Ve.colorSpace),we=s.convert(Ve.type),Pe=x(Ve.internalFormat,gt,we,Ve.colorSpace,Q.isXRRenderTarget===!0),nt=pt(Q);r.renderbufferStorageMultisample(r.RENDERBUFFER,nt,Pe,Q.width,Q.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+Le,r.RENDERBUFFER,se.__webglColorRenderbuffer[Le])}r.bindRenderbuffer(r.RENDERBUFFER,null),Q.depthBuffer&&(se.__webglDepthRenderbuffer=r.createRenderbuffer(),Ae(se.__webglDepthRenderbuffer,Q,!0)),t.bindFramebuffer(r.FRAMEBUFFER,null)}}if(_e){t.bindTexture(r.TEXTURE_CUBE_MAP,ye.__webglTexture),H(r.TEXTURE_CUBE_MAP,k);for(let Le=0;Le<6;Le++)if(k.mipmaps&&k.mipmaps.length>0)for(let Ve=0;Ve<k.mipmaps.length;Ve++)pe(se.__webglFramebuffer[Le][Ve],Q,k,r.COLOR_ATTACHMENT0,r.TEXTURE_CUBE_MAP_POSITIVE_X+Le,Ve);else pe(se.__webglFramebuffer[Le],Q,k,r.COLOR_ATTACHMENT0,r.TEXTURE_CUBE_MAP_POSITIVE_X+Le,0);_(k)&&v(r.TEXTURE_CUBE_MAP),t.unbindTexture()}else if(Ge){for(let Le=0,Ve=Ee.length;Le<Ve;Le++){const gt=Ee[Le],we=n.get(gt);t.bindTexture(r.TEXTURE_2D,we.__webglTexture),H(r.TEXTURE_2D,gt),pe(se.__webglFramebuffer,Q,gt,r.COLOR_ATTACHMENT0+Le,r.TEXTURE_2D,0),_(gt)&&v(r.TEXTURE_2D)}t.unbindTexture()}else{let Le=r.TEXTURE_2D;if((Q.isWebGL3DRenderTarget||Q.isWebGLArrayRenderTarget)&&(Le=Q.isWebGL3DRenderTarget?r.TEXTURE_3D:r.TEXTURE_2D_ARRAY),t.bindTexture(Le,ye.__webglTexture),H(Le,k),k.mipmaps&&k.mipmaps.length>0)for(let Ve=0;Ve<k.mipmaps.length;Ve++)pe(se.__webglFramebuffer[Ve],Q,k,r.COLOR_ATTACHMENT0,Le,Ve);else pe(se.__webglFramebuffer,Q,k,r.COLOR_ATTACHMENT0,Le,0);_(k)&&v(Le),t.unbindTexture()}Q.depthBuffer&&Re(Q)}function ut(Q){const k=Q.textures;for(let se=0,ye=k.length;se<ye;se++){const Ee=k[se];if(_(Ee)){const _e=C(Q),Ge=n.get(Ee).__webglTexture;t.bindTexture(_e,Ge),v(_e),t.unbindTexture()}}}const mt=[],X=[];function h0(Q){if(Q.samples>0){if(At(Q)===!1){const k=Q.textures,se=Q.width,ye=Q.height;let Ee=r.COLOR_BUFFER_BIT;const _e=Q.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,Ge=n.get(Q),Le=k.length>1;if(Le)for(let Ve=0;Ve<k.length;Ve++)t.bindFramebuffer(r.FRAMEBUFFER,Ge.__webglMultisampledFramebuffer),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+Ve,r.RENDERBUFFER,null),t.bindFramebuffer(r.FRAMEBUFFER,Ge.__webglFramebuffer),r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0+Ve,r.TEXTURE_2D,null,0);t.bindFramebuffer(r.READ_FRAMEBUFFER,Ge.__webglMultisampledFramebuffer),t.bindFramebuffer(r.DRAW_FRAMEBUFFER,Ge.__webglFramebuffer);for(let Ve=0;Ve<k.length;Ve++){if(Q.resolveDepthBuffer&&(Q.depthBuffer&&(Ee|=r.DEPTH_BUFFER_BIT),Q.stencilBuffer&&Q.resolveStencilBuffer&&(Ee|=r.STENCIL_BUFFER_BIT)),Le){r.framebufferRenderbuffer(r.READ_FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.RENDERBUFFER,Ge.__webglColorRenderbuffer[Ve]);const gt=n.get(k[Ve]).__webglTexture;r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,gt,0)}r.blitFramebuffer(0,0,se,ye,0,0,se,ye,Ee,r.NEAREST),h===!0&&(mt.length=0,X.length=0,mt.push(r.COLOR_ATTACHMENT0+Ve),Q.depthBuffer&&Q.resolveDepthBuffer===!1&&(mt.push(_e),X.push(_e),r.invalidateFramebuffer(r.DRAW_FRAMEBUFFER,X)),r.invalidateFramebuffer(r.READ_FRAMEBUFFER,mt))}if(t.bindFramebuffer(r.READ_FRAMEBUFFER,null),t.bindFramebuffer(r.DRAW_FRAMEBUFFER,null),Le)for(let Ve=0;Ve<k.length;Ve++){t.bindFramebuffer(r.FRAMEBUFFER,Ge.__webglMultisampledFramebuffer),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+Ve,r.RENDERBUFFER,Ge.__webglColorRenderbuffer[Ve]);const gt=n.get(k[Ve]).__webglTexture;t.bindFramebuffer(r.FRAMEBUFFER,Ge.__webglFramebuffer),r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0+Ve,r.TEXTURE_2D,gt,0)}t.bindFramebuffer(r.DRAW_FRAMEBUFFER,Ge.__webglMultisampledFramebuffer)}else if(Q.depthBuffer&&Q.resolveDepthBuffer===!1&&h){const k=Q.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT;r.invalidateFramebuffer(r.DRAW_FRAMEBUFFER,[k])}}}function pt(Q){return Math.min(i.maxSamples,Q.samples)}function At(Q){const k=n.get(Q);return Q.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&k.__useRenderToTexture!==!1}function qe(Q){const k=o.render.frame;d.get(Q)!==k&&(d.set(Q,k),Q.update())}function Mt(Q,k){const se=Q.colorSpace,ye=Q.format,Ee=Q.type;return Q.isCompressedTexture===!0||Q.isVideoTexture===!0||se!==j0&&se!==Mi&&(St.getTransfer(se)===Ot?(ye!==Kt||Ee!==w0)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",se)),k}function Ye(Q){return typeof HTMLImageElement<"u"&&Q instanceof HTMLImageElement?(u.width=Q.naturalWidth||Q.width,u.height=Q.naturalHeight||Q.height):typeof VideoFrame<"u"&&Q instanceof VideoFrame?(u.width=Q.displayWidth,u.height=Q.displayHeight):(u.width=Q.width,u.height=Q.height),u}this.allocateTextureUnit=F,this.resetTextureUnits=P,this.setTexture2D=J,this.setTexture2DArray=q,this.setTexture3D=ne,this.setTextureCube=j,this.rebindTextures=Fe,this.setupRenderTarget=st,this.updateRenderTargetMipmap=ut,this.updateMultisampleRenderTarget=h0,this.setupDepthRenderbuffer=Re,this.setupFrameBufferTexture=pe,this.useMultisampledRTT=At}function TT(r,e){function t(n,i=Mi){let s;const o=St.getTransfer(i);if(n===w0)return r.UNSIGNED_BYTE;if(n===y3)return r.UNSIGNED_SHORT_4_4_4_4;if(n===E3)return r.UNSIGNED_SHORT_5_5_5_1;if(n===$6)return r.UNSIGNED_INT_5_9_9_9_REV;if(n===t9)return r.BYTE;if(n===_3)return r.SHORT;if(n===ho)return r.UNSIGNED_SHORT;if(n===fo)return r.INT;if(n===An)return r.UNSIGNED_INT;if(n===Jt)return r.FLOAT;if(n===p0)return r.HALF_FLOAT;if(n===ed)return r.ALPHA;if(n===td)return r.RGB;if(n===Kt)return r.RGBA;if(n===rd)return r.LUMINANCE;if(n===nd)return r.LUMINANCE_ALPHA;if(n===Ao)return r.DEPTH_COMPONENT;if(n===go)return r.DEPTH_STENCIL;if(n===Ii)return r.RED;if(n===r9)return r.RED_INTEGER;if(n===hs)return r.RG;if(n===$1)return r.RG_INTEGER;if(n===mo)return r.RGBA_INTEGER;if(n===n9||n===el||n===i9||n===tl)if(o===Ot)if(s=e.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(n===n9)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===el)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===i9)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===tl)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=e.get("WEBGL_compressed_texture_s3tc"),s!==null){if(n===n9)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===el)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===i9)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===tl)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(n===s9||n===x3||n===a9||n===w3)if(s=e.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(n===s9)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===x3)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===a9)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===w3)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(n===o9||n===l9||n===c9)if(s=e.get("WEBGL_compressed_texture_etc"),s!==null){if(n===o9||n===l9)return o===Ot?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(n===c9)return o===Ot?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(n===rl||n===C3||n===I3||n===M3||n===nl||n===S3||n===T3||n===B3||n===b3||n===R3||n===D3||n===L3||n===N3||n===P3)if(s=e.get("WEBGL_compressed_texture_astc"),s!==null){if(n===rl)return o===Ot?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===C3)return o===Ot?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===I3)return o===Ot?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===M3)return o===Ot?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===nl)return o===Ot?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===S3)return o===Ot?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===T3)return o===Ot?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===B3)return o===Ot?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===b3)return o===Ot?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===R3)return o===Ot?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===D3)return o===Ot?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===L3)return o===Ot?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===N3)return o===Ot?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===P3)return o===Ot?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(n===il||n===U3||n===u9)if(s=e.get("EXT_texture_compression_bptc"),s!==null){if(n===il)return o===Ot?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===U3)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===u9)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(n===id||n===k3||n===F3||n===O3)if(s=e.get("EXT_texture_compression_rgtc"),s!==null){if(n===il)return s.COMPRESSED_RED_RGTC1_EXT;if(n===k3)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===F3)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===O3)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return n===po?r.UNSIGNED_INT_24_8:r[n]!==void 0?r[n]:null}return{convert:t}}const BT=`
3821
+ }`;function CT(r,e,t){let n=new m4;const i=new ze,s=new ze,o=new Ut,l=new s7({depthPacking:ix}),h=new _w,u={},d=t.maxTextureSize,A={[Un]:V0,[V0]:Un,[pn]:pn},p=new B0({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new ze},radius:{value:4}},vertexShader:xT,fragmentShader:wT}),g=p.clone();g.defines.HORIZONTAL_PASS=1;const m=new vn;m.setAttribute("position",new S0(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const E=new T0(m,p),_=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=G6;let v=this.type;this.render=function(T,S,D){if(_.enabled===!1||_.autoUpdate===!1&&_.needsUpdate===!1||T.length===0)return;const R=r.getRenderTarget(),M=r.getActiveCubeFace(),L=r.getActiveMipmapLevel(),P=r.state;P.setBlending(Ci),P.buffers.color.setClear(1,1,1,1),P.buffers.depth.setTest(!0),P.setScissorTest(!1);const F=v!==wi&&this.type===wi,z=v===wi&&this.type!==wi;for(let J=0,q=T.length;J<q;J++){const ne=T[J],j=ne.shadow;if(j===void 0){console.warn("THREE.WebGLShadowMap:",ne,"has no shadow.");continue}if(j.autoUpdate===!1&&j.needsUpdate===!1)continue;i.copy(j.mapSize);const te=j.getFrameExtents();if(i.multiply(te),s.copy(j.mapSize),(i.x>d||i.y>d)&&(i.x>d&&(s.x=Math.floor(d/te.x),i.x=s.x*te.x,j.mapSize.x=s.x),i.y>d&&(s.y=Math.floor(d/te.y),i.y=s.y*te.y,j.mapSize.y=s.y)),j.map===null||F===!0||z===!0){const U=this.type!==wi?{minFilter:$t,magFilter:$t}:{};j.map!==null&&j.map.dispose(),j.map=new Nr(i.x,i.y,U),j.map.texture.name=ne.name+".shadowMap",j.camera.updateProjectionMatrix()}r.setRenderTarget(j.map),r.clear();const W=j.getViewportCount();for(let U=0;U<W;U++){const H=j.getViewport(U);o.set(s.x*H.x,s.y*H.y,s.x*H.z,s.y*H.w),P.viewport(o),j.updateMatrices(ne,U),n=j.getFrustum(),w(S,D,j.camera,ne,this.type)}j.isPointLightShadow!==!0&&this.type===wi&&C(j,D),j.needsUpdate=!1}v=this.type,_.needsUpdate=!1,r.setRenderTarget(R,M,L)};function C(T,S){const D=e.update(E);p.defines.VSM_SAMPLES!==T.blurSamples&&(p.defines.VSM_SAMPLES=T.blurSamples,g.defines.VSM_SAMPLES=T.blurSamples,p.needsUpdate=!0,g.needsUpdate=!0),T.mapPass===null&&(T.mapPass=new Nr(i.x,i.y)),p.uniforms.shadow_pass.value=T.map.texture,p.uniforms.resolution.value=T.mapSize,p.uniforms.radius.value=T.radius,r.setRenderTarget(T.mapPass),r.clear(),r.renderBufferDirect(S,null,D,p,E,null),g.uniforms.shadow_pass.value=T.mapPass.texture,g.uniforms.resolution.value=T.mapSize,g.uniforms.radius.value=T.radius,r.setRenderTarget(T.map),r.clear(),r.renderBufferDirect(S,null,D,g,E,null)}function x(T,S,D,R){let M=null;const L=D.isPointLight===!0?T.customDistanceMaterial:T.customDepthMaterial;if(L!==void 0)M=L;else if(M=D.isPointLight===!0?h:l,r.localClippingEnabled&&S.clipShadows===!0&&Array.isArray(S.clippingPlanes)&&S.clippingPlanes.length!==0||S.displacementMap&&S.displacementScale!==0||S.alphaMap&&S.alphaTest>0||S.map&&S.alphaTest>0){const P=M.uuid,F=S.uuid;let z=u[P];z===void 0&&(z={},u[P]=z);let J=z[F];J===void 0&&(J=M.clone(),z[F]=J,S.addEventListener("dispose",B)),M=J}if(M.visible=S.visible,M.wireframe=S.wireframe,R===wi?M.side=S.shadowSide!==null?S.shadowSide:S.side:M.side=S.shadowSide!==null?S.shadowSide:A[S.side],M.alphaMap=S.alphaMap,M.alphaTest=S.alphaTest,M.map=S.map,M.clipShadows=S.clipShadows,M.clippingPlanes=S.clippingPlanes,M.clipIntersection=S.clipIntersection,M.displacementMap=S.displacementMap,M.displacementScale=S.displacementScale,M.displacementBias=S.displacementBias,M.wireframeLinewidth=S.wireframeLinewidth,M.linewidth=S.linewidth,D.isPointLight===!0&&M.isMeshDistanceMaterial===!0){const P=r.properties.get(M);P.light=D}return M}function w(T,S,D,R,M){if(T.visible===!1)return;if(T.layers.test(S.layers)&&(T.isMesh||T.isLine||T.isPoints)&&(T.castShadow||T.receiveShadow&&M===wi)&&(!T.frustumCulled||n.intersectsObject(T))){T.modelViewMatrix.multiplyMatrices(D.matrixWorldInverse,T.matrixWorld);const P=e.update(T),F=T.material;if(Array.isArray(F)){const z=P.groups;for(let J=0,q=z.length;J<q;J++){const ne=z[J],j=F[ne.materialIndex];if(j&&j.visible){const te=x(T,j,R,M);T.onBeforeShadow(r,T,S,D,P,te,ne),r.renderBufferDirect(D,null,P,te,T,ne),T.onAfterShadow(r,T,S,D,P,te,ne)}}}else if(F.visible){const z=x(T,F,R,M);T.onBeforeShadow(r,T,S,D,P,z,null),r.renderBufferDirect(D,null,P,z,T,null),T.onAfterShadow(r,T,S,D,P,z,null)}}const L=T.children;for(let P=0,F=L.length;P<F;P++)w(L[P],S,D,R,M)}function B(T){T.target.removeEventListener("dispose",B);for(const S in u){const D=u[S],R=T.target.uuid;R in D&&(D[R].dispose(),delete D[R])}}}const IT={[u3]:h3,[d3]:A3,[f3]:g3,[lo]:p3,[h3]:u3,[A3]:d3,[g3]:f3,[p3]:lo};function MT(r,e){function t(){let $=!1;const Se=new Ut;let ue=null;const ve=new Ut(0,0,0,0);return{setMask:function(De){ue!==De&&!$&&(r.colorMask(De,De,De,De),ue=De)},setLocked:function(De){$=De},setClear:function(De,Be,it,jt,y0){y0===!0&&(De*=jt,Be*=jt,it*=jt),Se.set(De,Be,it,jt),ve.equals(Se)===!1&&(r.clearColor(De,Be,it,jt),ve.copy(Se))},reset:function(){$=!1,ue=null,ve.set(-1,0,0,0)}}}function n(){let $=!1,Se=!1,ue=null,ve=null,De=null;return{setReversed:function(Be){if(Se!==Be){const it=e.get("EXT_clip_control");Se?it.clipControlEXT(it.LOWER_LEFT_EXT,it.ZERO_TO_ONE_EXT):it.clipControlEXT(it.LOWER_LEFT_EXT,it.NEGATIVE_ONE_TO_ONE_EXT);const jt=De;De=null,this.setClear(jt)}Se=Be},getReversed:function(){return Se},setTest:function(Be){Be?Ae(r.DEPTH_TEST):ge(r.DEPTH_TEST)},setMask:function(Be){ue!==Be&&!$&&(r.depthMask(Be),ue=Be)},setFunc:function(Be){if(Se&&(Be=IT[Be]),ve!==Be){switch(Be){case u3:r.depthFunc(r.NEVER);break;case h3:r.depthFunc(r.ALWAYS);break;case d3:r.depthFunc(r.LESS);break;case lo:r.depthFunc(r.LEQUAL);break;case f3:r.depthFunc(r.EQUAL);break;case p3:r.depthFunc(r.GEQUAL);break;case A3:r.depthFunc(r.GREATER);break;case g3:r.depthFunc(r.NOTEQUAL);break;default:r.depthFunc(r.LEQUAL)}ve=Be}},setLocked:function(Be){$=Be},setClear:function(Be){De!==Be&&(Se&&(Be=1-Be),r.clearDepth(Be),De=Be)},reset:function(){$=!1,ue=null,ve=null,De=null,Se=!1}}}function i(){let $=!1,Se=null,ue=null,ve=null,De=null,Be=null,it=null,jt=null,y0=null;return{setTest:function(Rt){$||(Rt?Ae(r.STENCIL_TEST):ge(r.STENCIL_TEST))},setMask:function(Rt){Se!==Rt&&!$&&(r.stencilMask(Rt),Se=Rt)},setFunc:function(Rt,lr,cr){(ue!==Rt||ve!==lr||De!==cr)&&(r.stencilFunc(Rt,lr,cr),ue=Rt,ve=lr,De=cr)},setOp:function(Rt,lr,cr){(Be!==Rt||it!==lr||jt!==cr)&&(r.stencilOp(Rt,lr,cr),Be=Rt,it=lr,jt=cr)},setLocked:function(Rt){$=Rt},setClear:function(Rt){y0!==Rt&&(r.clearStencil(Rt),y0=Rt)},reset:function(){$=!1,Se=null,ue=null,ve=null,De=null,Be=null,it=null,jt=null,y0=null}}}const s=new t,o=new n,l=new i,h=new WeakMap,u=new WeakMap;let d={},A={},p=new WeakMap,g=[],m=null,E=!1,_=null,v=null,C=null,x=null,w=null,B=null,T=null,S=new We(0,0,0),D=0,R=!1,M=null,L=null,P=null,F=null,z=null;const J=r.getParameter(r.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let q=!1,ne=0;const j=r.getParameter(r.VERSION);j.indexOf("WebGL")!==-1?(ne=parseFloat(/^WebGL (\d)/.exec(j)[1]),q=ne>=1):j.indexOf("OpenGL ES")!==-1&&(ne=parseFloat(/^OpenGL ES (\d)/.exec(j)[1]),q=ne>=2);let te=null,W={};const U=r.getParameter(r.SCISSOR_BOX),H=r.getParameter(r.VIEWPORT),Z=new Ut().fromArray(U),G=new Ut().fromArray(H);function oe($,Se,ue,ve){const De=new Uint8Array(4),Be=r.createTexture();r.bindTexture($,Be),r.texParameteri($,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri($,r.TEXTURE_MAG_FILTER,r.NEAREST);for(let it=0;it<ue;it++)$===r.TEXTURE_3D||$===r.TEXTURE_2D_ARRAY?r.texImage3D(Se,0,r.RGBA,1,1,ve,0,r.RGBA,r.UNSIGNED_BYTE,De):r.texImage2D(Se+it,0,r.RGBA,1,1,0,r.RGBA,r.UNSIGNED_BYTE,De);return Be}const pe={};pe[r.TEXTURE_2D]=oe(r.TEXTURE_2D,r.TEXTURE_2D,1),pe[r.TEXTURE_CUBE_MAP]=oe(r.TEXTURE_CUBE_MAP,r.TEXTURE_CUBE_MAP_POSITIVE_X,6),pe[r.TEXTURE_2D_ARRAY]=oe(r.TEXTURE_2D_ARRAY,r.TEXTURE_2D_ARRAY,1,1),pe[r.TEXTURE_3D]=oe(r.TEXTURE_3D,r.TEXTURE_3D,1,1),s.setClear(0,0,0,1),o.setClear(1),l.setClear(0),Ae(r.DEPTH_TEST),o.setFunc(lo),pt(!1),At(z6),Ae(r.CULL_FACE),X(Ci);function Ae($){d[$]!==!0&&(r.enable($),d[$]=!0)}function ge($){d[$]!==!1&&(r.disable($),d[$]=!1)}function Re($,Se){return A[$]!==Se?(r.bindFramebuffer($,Se),A[$]=Se,$===r.DRAW_FRAMEBUFFER&&(A[r.FRAMEBUFFER]=Se),$===r.FRAMEBUFFER&&(A[r.DRAW_FRAMEBUFFER]=Se),!0):!1}function Oe($,Se){let ue=g,ve=!1;if($){ue=p.get(Se),ue===void 0&&(ue=[],p.set(Se,ue));const De=$.textures;if(ue.length!==De.length||ue[0]!==r.COLOR_ATTACHMENT0){for(let Be=0,it=De.length;Be<it;Be++)ue[Be]=r.COLOR_ATTACHMENT0+Be;ue.length=De.length,ve=!0}}else ue[0]!==r.BACK&&(ue[0]=r.BACK,ve=!0);ve&&r.drawBuffers(ue)}function st($){return m!==$?(r.useProgram($),m=$,!0):!1}const ut={[ca]:r.FUNC_ADD,[NE]:r.FUNC_SUBTRACT,[PE]:r.FUNC_REVERSE_SUBTRACT};ut[UE]=r.MIN,ut[kE]=r.MAX;const mt={[FE]:r.ZERO,[OE]:r.ONE,[QE]:r.SRC_COLOR,[l3]:r.SRC_ALPHA,[WE]:r.SRC_ALPHA_SATURATE,[VE]:r.DST_COLOR,[GE]:r.DST_ALPHA,[zE]:r.ONE_MINUS_SRC_COLOR,[c3]:r.ONE_MINUS_SRC_ALPHA,[jE]:r.ONE_MINUS_DST_COLOR,[HE]:r.ONE_MINUS_DST_ALPHA,[YE]:r.CONSTANT_COLOR,[qE]:r.ONE_MINUS_CONSTANT_COLOR,[XE]:r.CONSTANT_ALPHA,[JE]:r.ONE_MINUS_CONSTANT_ALPHA};function X($,Se,ue,ve,De,Be,it,jt,y0,Rt){if($===Ci){E===!0&&(ge(r.BLEND),E=!1);return}if(E===!1&&(Ae(r.BLEND),E=!0),$!==LE){if($!==_||Rt!==R){if((v!==ca||w!==ca)&&(r.blendEquation(r.FUNC_ADD),v=ca,w=ca),Rt)switch($){case oo:r.blendFuncSeparate(r.ONE,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA);break;case a3:r.blendFunc(r.ONE,r.ONE);break;case H6:r.blendFuncSeparate(r.ZERO,r.ONE_MINUS_SRC_COLOR,r.ZERO,r.ONE);break;case o3:r.blendFuncSeparate(r.ZERO,r.SRC_COLOR,r.ZERO,r.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",$);break}else switch($){case oo:r.blendFuncSeparate(r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA);break;case a3:r.blendFunc(r.SRC_ALPHA,r.ONE);break;case H6:r.blendFuncSeparate(r.ZERO,r.ONE_MINUS_SRC_COLOR,r.ZERO,r.ONE);break;case o3:r.blendFunc(r.ZERO,r.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",$);break}C=null,x=null,B=null,T=null,S.set(0,0,0),D=0,_=$,R=Rt}return}De=De||Se,Be=Be||ue,it=it||ve,(Se!==v||De!==w)&&(r.blendEquationSeparate(ut[Se],ut[De]),v=Se,w=De),(ue!==C||ve!==x||Be!==B||it!==T)&&(r.blendFuncSeparate(mt[ue],mt[ve],mt[Be],mt[it]),C=ue,x=ve,B=Be,T=it),(jt.equals(S)===!1||y0!==D)&&(r.blendColor(jt.r,jt.g,jt.b,y0),S.copy(jt),D=y0),_=$,R=!1}function h0($,Se){$.side===pn?ge(r.CULL_FACE):Ae(r.CULL_FACE);let ue=$.side===V0;Se&&(ue=!ue),pt(ue),$.blending===oo&&$.transparent===!1?X(Ci):X($.blending,$.blendEquation,$.blendSrc,$.blendDst,$.blendEquationAlpha,$.blendSrcAlpha,$.blendDstAlpha,$.blendColor,$.blendAlpha,$.premultipliedAlpha),o.setFunc($.depthFunc),o.setTest($.depthTest),o.setMask($.depthWrite),s.setMask($.colorWrite);const ve=$.stencilWrite;l.setTest(ve),ve&&(l.setMask($.stencilWriteMask),l.setFunc($.stencilFunc,$.stencilRef,$.stencilFuncMask),l.setOp($.stencilFail,$.stencilZFail,$.stencilZPass)),Mt($.polygonOffset,$.polygonOffsetFactor,$.polygonOffsetUnits),$.alphaToCoverage===!0?Ae(r.SAMPLE_ALPHA_TO_COVERAGE):ge(r.SAMPLE_ALPHA_TO_COVERAGE)}function pt($){M!==$&&($?r.frontFace(r.CW):r.frontFace(r.CCW),M=$)}function At($){$!==bE?(Ae(r.CULL_FACE),$!==L&&($===z6?r.cullFace(r.BACK):$===RE?r.cullFace(r.FRONT):r.cullFace(r.FRONT_AND_BACK))):ge(r.CULL_FACE),L=$}function qe($){$!==P&&(q&&r.lineWidth($),P=$)}function Mt($,Se,ue){$?(Ae(r.POLYGON_OFFSET_FILL),(F!==Se||z!==ue)&&(r.polygonOffset(Se,ue),F=Se,z=ue)):ge(r.POLYGON_OFFSET_FILL)}function Ye($){$?Ae(r.SCISSOR_TEST):ge(r.SCISSOR_TEST)}function Q($){$===void 0&&($=r.TEXTURE0+J-1),te!==$&&(r.activeTexture($),te=$)}function k($,Se,ue){ue===void 0&&(te===null?ue=r.TEXTURE0+J-1:ue=te);let ve=W[ue];ve===void 0&&(ve={type:void 0,texture:void 0},W[ue]=ve),(ve.type!==$||ve.texture!==Se)&&(te!==ue&&(r.activeTexture(ue),te=ue),r.bindTexture($,Se||pe[$]),ve.type=$,ve.texture=Se)}function se(){const $=W[te];$!==void 0&&$.type!==void 0&&(r.bindTexture($.type,null),$.type=void 0,$.texture=void 0)}function ye(){try{r.compressedTexImage2D(...arguments)}catch($){console.error("THREE.WebGLState:",$)}}function Ee(){try{r.compressedTexImage3D(...arguments)}catch($){console.error("THREE.WebGLState:",$)}}function _e(){try{r.texSubImage2D(...arguments)}catch($){console.error("THREE.WebGLState:",$)}}function Ge(){try{r.texSubImage3D(...arguments)}catch($){console.error("THREE.WebGLState:",$)}}function Le(){try{r.compressedTexSubImage2D(...arguments)}catch($){console.error("THREE.WebGLState:",$)}}function Ve(){try{r.compressedTexSubImage3D(...arguments)}catch($){console.error("THREE.WebGLState:",$)}}function gt(){try{r.texStorage2D(...arguments)}catch($){console.error("THREE.WebGLState:",$)}}function we(){try{r.texStorage3D(...arguments)}catch($){console.error("THREE.WebGLState:",$)}}function Ue(){try{r.texImage2D(...arguments)}catch($){console.error("THREE.WebGLState:",$)}}function nt(){try{r.texImage3D(...arguments)}catch($){console.error("THREE.WebGLState:",$)}}function et($){Z.equals($)===!1&&(r.scissor($.x,$.y,$.z,$.w),Z.copy($))}function he($){G.equals($)===!1&&(r.viewport($.x,$.y,$.z,$.w),G.copy($))}function Pe($,Se){let ue=u.get(Se);ue===void 0&&(ue=new WeakMap,u.set(Se,ue));let ve=ue.get($);ve===void 0&&(ve=r.getUniformBlockIndex(Se,$.name),ue.set($,ve))}function Fe($,Se){const ue=u.get(Se).get($);h.get(Se)!==ue&&(r.uniformBlockBinding(Se,ue,$.__bindingPointIndex),h.set(Se,ue))}function ht(){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),o.setReversed(!1),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),d={},te=null,W={},A={},p=new WeakMap,g=[],m=null,E=!1,_=null,v=null,C=null,x=null,w=null,B=null,T=null,S=new We(0,0,0),D=0,R=!1,M=null,L=null,P=null,F=null,z=null,Z.set(0,0,r.canvas.width,r.canvas.height),G.set(0,0,r.canvas.width,r.canvas.height),s.reset(),o.reset(),l.reset()}return{buffers:{color:s,depth:o,stencil:l},enable:Ae,disable:ge,bindFramebuffer:Re,drawBuffers:Oe,useProgram:st,setBlending:X,setMaterial:h0,setFlipSided:pt,setCullFace:At,setLineWidth:qe,setPolygonOffset:Mt,setScissorTest:Ye,activeTexture:Q,bindTexture:k,unbindTexture:se,compressedTexImage2D:ye,compressedTexImage3D:Ee,texImage2D:Ue,texImage3D:nt,updateUBOMapping:Pe,uniformBlockBinding:Fe,texStorage2D:gt,texStorage3D:we,texSubImage2D:_e,texSubImage3D:Ge,compressedTexSubImage2D:Le,compressedTexSubImage3D:Ve,scissor:et,viewport:he,reset:ht}}function ST(r,e,t,n,i,s,o){const l=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,h=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),u=new ze,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 m(Q,k){return g?new OffscreenCanvas(Q,k):cl("canvas")}function E(Q,k,se){let ye=1;const Ee=Ye(Q);if((Ee.width>se||Ee.height>se)&&(ye=se/Math.max(Ee.width,Ee.height)),ye<1)if(typeof HTMLImageElement<"u"&&Q instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&Q instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&Q instanceof ImageBitmap||typeof VideoFrame<"u"&&Q instanceof VideoFrame){const _e=Math.floor(ye*Ee.width),Ge=Math.floor(ye*Ee.height);A===void 0&&(A=m(_e,Ge));const Le=k?m(_e,Ge):A;return Le.width=_e,Le.height=Ge,Le.getContext("2d").drawImage(Q,0,0,_e,Ge),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+Ee.width+"x"+Ee.height+") to ("+_e+"x"+Ge+")."),Le}else return"data"in Q&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+Ee.width+"x"+Ee.height+")."),Q;return Q}function _(Q){return Q.generateMipmaps}function v(Q){r.generateMipmap(Q)}function C(Q){return Q.isWebGLCubeRenderTarget?r.TEXTURE_CUBE_MAP:Q.isWebGL3DRenderTarget?r.TEXTURE_3D:Q.isWebGLArrayRenderTarget||Q.isCompressedArrayTexture?r.TEXTURE_2D_ARRAY:r.TEXTURE_2D}function x(Q,k,se,ye,Ee=!1){if(Q!==null){if(r[Q]!==void 0)return r[Q];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+Q+"'")}let _e=k;if(k===r.RED&&(se===r.FLOAT&&(_e=r.R32F),se===r.HALF_FLOAT&&(_e=r.R16F),se===r.UNSIGNED_BYTE&&(_e=r.R8)),k===r.RED_INTEGER&&(se===r.UNSIGNED_BYTE&&(_e=r.R8UI),se===r.UNSIGNED_SHORT&&(_e=r.R16UI),se===r.UNSIGNED_INT&&(_e=r.R32UI),se===r.BYTE&&(_e=r.R8I),se===r.SHORT&&(_e=r.R16I),se===r.INT&&(_e=r.R32I)),k===r.RG&&(se===r.FLOAT&&(_e=r.RG32F),se===r.HALF_FLOAT&&(_e=r.RG16F),se===r.UNSIGNED_BYTE&&(_e=r.RG8)),k===r.RG_INTEGER&&(se===r.UNSIGNED_BYTE&&(_e=r.RG8UI),se===r.UNSIGNED_SHORT&&(_e=r.RG16UI),se===r.UNSIGNED_INT&&(_e=r.RG32UI),se===r.BYTE&&(_e=r.RG8I),se===r.SHORT&&(_e=r.RG16I),se===r.INT&&(_e=r.RG32I)),k===r.RGB_INTEGER&&(se===r.UNSIGNED_BYTE&&(_e=r.RGB8UI),se===r.UNSIGNED_SHORT&&(_e=r.RGB16UI),se===r.UNSIGNED_INT&&(_e=r.RGB32UI),se===r.BYTE&&(_e=r.RGB8I),se===r.SHORT&&(_e=r.RGB16I),se===r.INT&&(_e=r.RGB32I)),k===r.RGBA_INTEGER&&(se===r.UNSIGNED_BYTE&&(_e=r.RGBA8UI),se===r.UNSIGNED_SHORT&&(_e=r.RGBA16UI),se===r.UNSIGNED_INT&&(_e=r.RGBA32UI),se===r.BYTE&&(_e=r.RGBA8I),se===r.SHORT&&(_e=r.RGBA16I),se===r.INT&&(_e=r.RGBA32I)),k===r.RGB&&se===r.UNSIGNED_INT_5_9_9_9_REV&&(_e=r.RGB9_E5),k===r.RGBA){const Ge=Ee?h9:St.getTransfer(ye);se===r.FLOAT&&(_e=r.RGBA32F),se===r.HALF_FLOAT&&(_e=r.RGBA16F),se===r.UNSIGNED_BYTE&&(_e=Ge===Ot?r.SRGB8_ALPHA8:r.RGBA8),se===r.UNSIGNED_SHORT_4_4_4_4&&(_e=r.RGBA4),se===r.UNSIGNED_SHORT_5_5_5_1&&(_e=r.RGB5_A1)}return(_e===r.R16F||_e===r.R32F||_e===r.RG16F||_e===r.RG32F||_e===r.RGBA16F||_e===r.RGBA32F)&&e.get("EXT_color_buffer_float"),_e}function w(Q,k){let se;return Q?k===null||k===An||k===po?se=r.DEPTH24_STENCIL8:k===Jt?se=r.DEPTH32F_STENCIL8:k===ho&&(se=r.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):k===null||k===An||k===po?se=r.DEPTH_COMPONENT24:k===Jt?se=r.DEPTH_COMPONENT32F:k===ho&&(se=r.DEPTH_COMPONENT16),se}function B(Q,k){return _(Q)===!0||Q.isFramebufferTexture&&Q.minFilter!==$t&&Q.minFilter!==Gt?Math.log2(Math.max(k.width,k.height))+1:Q.mipmaps!==void 0&&Q.mipmaps.length>0?Q.mipmaps.length:Q.isCompressedTexture&&Array.isArray(Q.image)?k.mipmaps.length:1}function T(Q){const k=Q.target;k.removeEventListener("dispose",T),D(k),k.isVideoTexture&&d.delete(k)}function S(Q){const k=Q.target;k.removeEventListener("dispose",S),M(k)}function D(Q){const k=n.get(Q);if(k.__webglInit===void 0)return;const se=Q.source,ye=p.get(se);if(ye){const Ee=ye[k.__cacheKey];Ee.usedTimes--,Ee.usedTimes===0&&R(Q),Object.keys(ye).length===0&&p.delete(se)}n.remove(Q)}function R(Q){const k=n.get(Q);r.deleteTexture(k.__webglTexture);const se=Q.source,ye=p.get(se);delete ye[k.__cacheKey],o.memory.textures--}function M(Q){const k=n.get(Q);if(Q.depthTexture&&(Q.depthTexture.dispose(),n.remove(Q.depthTexture)),Q.isWebGLCubeRenderTarget)for(let ye=0;ye<6;ye++){if(Array.isArray(k.__webglFramebuffer[ye]))for(let Ee=0;Ee<k.__webglFramebuffer[ye].length;Ee++)r.deleteFramebuffer(k.__webglFramebuffer[ye][Ee]);else r.deleteFramebuffer(k.__webglFramebuffer[ye]);k.__webglDepthbuffer&&r.deleteRenderbuffer(k.__webglDepthbuffer[ye])}else{if(Array.isArray(k.__webglFramebuffer))for(let ye=0;ye<k.__webglFramebuffer.length;ye++)r.deleteFramebuffer(k.__webglFramebuffer[ye]);else r.deleteFramebuffer(k.__webglFramebuffer);if(k.__webglDepthbuffer&&r.deleteRenderbuffer(k.__webglDepthbuffer),k.__webglMultisampledFramebuffer&&r.deleteFramebuffer(k.__webglMultisampledFramebuffer),k.__webglColorRenderbuffer)for(let ye=0;ye<k.__webglColorRenderbuffer.length;ye++)k.__webglColorRenderbuffer[ye]&&r.deleteRenderbuffer(k.__webglColorRenderbuffer[ye]);k.__webglDepthRenderbuffer&&r.deleteRenderbuffer(k.__webglDepthRenderbuffer)}const se=Q.textures;for(let ye=0,Ee=se.length;ye<Ee;ye++){const _e=n.get(se[ye]);_e.__webglTexture&&(r.deleteTexture(_e.__webglTexture),o.memory.textures--),n.remove(se[ye])}n.remove(Q)}let L=0;function P(){L=0}function F(){const Q=L;return Q>=i.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+Q+" texture units while this GPU supports only "+i.maxTextures),L+=1,Q}function z(Q){const k=[];return k.push(Q.wrapS),k.push(Q.wrapT),k.push(Q.wrapR||0),k.push(Q.magFilter),k.push(Q.minFilter),k.push(Q.anisotropy),k.push(Q.internalFormat),k.push(Q.format),k.push(Q.type),k.push(Q.generateMipmaps),k.push(Q.premultiplyAlpha),k.push(Q.flipY),k.push(Q.unpackAlignment),k.push(Q.colorSpace),k.join()}function J(Q,k){const se=n.get(Q);if(Q.isVideoTexture&&qe(Q),Q.isRenderTargetTexture===!1&&Q.version>0&&se.__version!==Q.version){const ye=Q.image;if(ye===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(ye.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{G(se,Q,k);return}}t.bindTexture(r.TEXTURE_2D,se.__webglTexture,r.TEXTURE0+k)}function q(Q,k){const se=n.get(Q);if(Q.version>0&&se.__version!==Q.version){G(se,Q,k);return}t.bindTexture(r.TEXTURE_2D_ARRAY,se.__webglTexture,r.TEXTURE0+k)}function ne(Q,k){const se=n.get(Q);if(Q.version>0&&se.__version!==Q.version){G(se,Q,k);return}t.bindTexture(r.TEXTURE_3D,se.__webglTexture,r.TEXTURE0+k)}function j(Q,k){const se=n.get(Q);if(Q.version>0&&se.__version!==Q.version){oe(se,Q,k);return}t.bindTexture(r.TEXTURE_CUBE_MAP,se.__webglTexture,r.TEXTURE0+k)}const te={[us]:r.REPEAT,[P0]:r.CLAMP_TO_EDGE,[$2]:r.MIRRORED_REPEAT},W={[$t]:r.NEAREST,[Z6]:r.NEAREST_MIPMAP_NEAREST,[Z1]:r.NEAREST_MIPMAP_LINEAR,[Gt]:r.LINEAR,[e9]:r.LINEAR_MIPMAP_NEAREST,[Jr]:r.LINEAR_MIPMAP_LINEAR},U={[ax]:r.NEVER,[dx]:r.ALWAYS,[ox]:r.LESS,[hd]:r.LEQUAL,[lx]:r.EQUAL,[hx]:r.GEQUAL,[cx]:r.GREATER,[ux]:r.NOTEQUAL};function H(Q,k){if(k.type===Jt&&e.has("OES_texture_float_linear")===!1&&(k.magFilter===Gt||k.magFilter===e9||k.magFilter===Z1||k.magFilter===Jr||k.minFilter===Gt||k.minFilter===e9||k.minFilter===Z1||k.minFilter===Jr)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),r.texParameteri(Q,r.TEXTURE_WRAP_S,te[k.wrapS]),r.texParameteri(Q,r.TEXTURE_WRAP_T,te[k.wrapT]),(Q===r.TEXTURE_3D||Q===r.TEXTURE_2D_ARRAY)&&r.texParameteri(Q,r.TEXTURE_WRAP_R,te[k.wrapR]),r.texParameteri(Q,r.TEXTURE_MAG_FILTER,W[k.magFilter]),r.texParameteri(Q,r.TEXTURE_MIN_FILTER,W[k.minFilter]),k.compareFunction&&(r.texParameteri(Q,r.TEXTURE_COMPARE_MODE,r.COMPARE_REF_TO_TEXTURE),r.texParameteri(Q,r.TEXTURE_COMPARE_FUNC,U[k.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(k.magFilter===$t||k.minFilter!==Z1&&k.minFilter!==Jr||k.type===Jt&&e.has("OES_texture_float_linear")===!1)return;if(k.anisotropy>1||n.get(k).__currentAnisotropy){const se=e.get("EXT_texture_filter_anisotropic");r.texParameterf(Q,se.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(k.anisotropy,i.getMaxAnisotropy())),n.get(k).__currentAnisotropy=k.anisotropy}}}function Z(Q,k){let se=!1;Q.__webglInit===void 0&&(Q.__webglInit=!0,k.addEventListener("dispose",T));const ye=k.source;let Ee=p.get(ye);Ee===void 0&&(Ee={},p.set(ye,Ee));const _e=z(k);if(_e!==Q.__cacheKey){Ee[_e]===void 0&&(Ee[_e]={texture:r.createTexture(),usedTimes:0},o.memory.textures++,se=!0),Ee[_e].usedTimes++;const Ge=Ee[Q.__cacheKey];Ge!==void 0&&(Ee[Q.__cacheKey].usedTimes--,Ge.usedTimes===0&&R(k)),Q.__cacheKey=_e,Q.__webglTexture=Ee[_e].texture}return se}function G(Q,k,se){let ye=r.TEXTURE_2D;(k.isDataArrayTexture||k.isCompressedArrayTexture)&&(ye=r.TEXTURE_2D_ARRAY),k.isData3DTexture&&(ye=r.TEXTURE_3D);const Ee=Z(Q,k),_e=k.source;t.bindTexture(ye,Q.__webglTexture,r.TEXTURE0+se);const Ge=n.get(_e);if(_e.version!==Ge.__version||Ee===!0){t.activeTexture(r.TEXTURE0+se);const Le=St.getPrimaries(St.workingColorSpace),Ve=k.colorSpace===Mi?null:St.getPrimaries(k.colorSpace),gt=k.colorSpace===Mi||Le===Ve?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,gt);let we=E(k.image,!1,i.maxTextureSize);we=Mt(k,we);const Ue=s.convert(k.format,k.colorSpace),nt=s.convert(k.type);let et=x(k.internalFormat,Ue,nt,k.colorSpace,k.isVideoTexture);H(ye,k);let he;const Pe=k.mipmaps,Fe=k.isVideoTexture!==!0,ht=Ge.__version===void 0||Ee===!0,$=_e.dataReady,Se=B(k,we);if(k.isDepthTexture)et=w(k.format===go,k.type),ht&&(Fe?t.texStorage2D(r.TEXTURE_2D,1,et,we.width,we.height):t.texImage2D(r.TEXTURE_2D,0,et,we.width,we.height,0,Ue,nt,null));else if(k.isDataTexture)if(Pe.length>0){Fe&&ht&&t.texStorage2D(r.TEXTURE_2D,Se,et,Pe[0].width,Pe[0].height);for(let ue=0,ve=Pe.length;ue<ve;ue++)he=Pe[ue],Fe?$&&t.texSubImage2D(r.TEXTURE_2D,ue,0,0,he.width,he.height,Ue,nt,he.data):t.texImage2D(r.TEXTURE_2D,ue,et,he.width,he.height,0,Ue,nt,he.data);k.generateMipmaps=!1}else Fe?(ht&&t.texStorage2D(r.TEXTURE_2D,Se,et,we.width,we.height),$&&t.texSubImage2D(r.TEXTURE_2D,0,0,0,we.width,we.height,Ue,nt,we.data)):t.texImage2D(r.TEXTURE_2D,0,et,we.width,we.height,0,Ue,nt,we.data);else if(k.isCompressedTexture)if(k.isCompressedArrayTexture){Fe&&ht&&t.texStorage3D(r.TEXTURE_2D_ARRAY,Se,et,Pe[0].width,Pe[0].height,we.depth);for(let ue=0,ve=Pe.length;ue<ve;ue++)if(he=Pe[ue],k.format!==Kt)if(Ue!==null)if(Fe){if($)if(k.layerUpdates.size>0){const De=y7(he.width,he.height,k.format,k.type);for(const Be of k.layerUpdates){const it=he.data.subarray(Be*De/he.data.BYTES_PER_ELEMENT,(Be+1)*De/he.data.BYTES_PER_ELEMENT);t.compressedTexSubImage3D(r.TEXTURE_2D_ARRAY,ue,0,0,Be,he.width,he.height,1,Ue,it)}k.clearLayerUpdates()}else t.compressedTexSubImage3D(r.TEXTURE_2D_ARRAY,ue,0,0,0,he.width,he.height,we.depth,Ue,he.data)}else t.compressedTexImage3D(r.TEXTURE_2D_ARRAY,ue,et,he.width,he.height,we.depth,0,he.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else Fe?$&&t.texSubImage3D(r.TEXTURE_2D_ARRAY,ue,0,0,0,he.width,he.height,we.depth,Ue,nt,he.data):t.texImage3D(r.TEXTURE_2D_ARRAY,ue,et,he.width,he.height,we.depth,0,Ue,nt,he.data)}else{Fe&&ht&&t.texStorage2D(r.TEXTURE_2D,Se,et,Pe[0].width,Pe[0].height);for(let ue=0,ve=Pe.length;ue<ve;ue++)he=Pe[ue],k.format!==Kt?Ue!==null?Fe?$&&t.compressedTexSubImage2D(r.TEXTURE_2D,ue,0,0,he.width,he.height,Ue,he.data):t.compressedTexImage2D(r.TEXTURE_2D,ue,et,he.width,he.height,0,he.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):Fe?$&&t.texSubImage2D(r.TEXTURE_2D,ue,0,0,he.width,he.height,Ue,nt,he.data):t.texImage2D(r.TEXTURE_2D,ue,et,he.width,he.height,0,Ue,nt,he.data)}else if(k.isDataArrayTexture)if(Fe){if(ht&&t.texStorage3D(r.TEXTURE_2D_ARRAY,Se,et,we.width,we.height,we.depth),$)if(k.layerUpdates.size>0){const ue=y7(we.width,we.height,k.format,k.type);for(const ve of k.layerUpdates){const De=we.data.subarray(ve*ue/we.data.BYTES_PER_ELEMENT,(ve+1)*ue/we.data.BYTES_PER_ELEMENT);t.texSubImage3D(r.TEXTURE_2D_ARRAY,0,0,0,ve,we.width,we.height,1,Ue,nt,De)}k.clearLayerUpdates()}else t.texSubImage3D(r.TEXTURE_2D_ARRAY,0,0,0,0,we.width,we.height,we.depth,Ue,nt,we.data)}else t.texImage3D(r.TEXTURE_2D_ARRAY,0,et,we.width,we.height,we.depth,0,Ue,nt,we.data);else if(k.isData3DTexture)Fe?(ht&&t.texStorage3D(r.TEXTURE_3D,Se,et,we.width,we.height,we.depth),$&&t.texSubImage3D(r.TEXTURE_3D,0,0,0,0,we.width,we.height,we.depth,Ue,nt,we.data)):t.texImage3D(r.TEXTURE_3D,0,et,we.width,we.height,we.depth,0,Ue,nt,we.data);else if(k.isFramebufferTexture){if(ht)if(Fe)t.texStorage2D(r.TEXTURE_2D,Se,et,we.width,we.height);else{let ue=we.width,ve=we.height;for(let De=0;De<Se;De++)t.texImage2D(r.TEXTURE_2D,De,et,ue,ve,0,Ue,nt,null),ue>>=1,ve>>=1}}else if(Pe.length>0){if(Fe&&ht){const ue=Ye(Pe[0]);t.texStorage2D(r.TEXTURE_2D,Se,et,ue.width,ue.height)}for(let ue=0,ve=Pe.length;ue<ve;ue++)he=Pe[ue],Fe?$&&t.texSubImage2D(r.TEXTURE_2D,ue,0,0,Ue,nt,he):t.texImage2D(r.TEXTURE_2D,ue,et,Ue,nt,he);k.generateMipmaps=!1}else if(Fe){if(ht){const ue=Ye(we);t.texStorage2D(r.TEXTURE_2D,Se,et,ue.width,ue.height)}$&&t.texSubImage2D(r.TEXTURE_2D,0,0,0,Ue,nt,we)}else t.texImage2D(r.TEXTURE_2D,0,et,Ue,nt,we);_(k)&&v(ye),Ge.__version=_e.version,k.onUpdate&&k.onUpdate(k)}Q.__version=k.version}function oe(Q,k,se){if(k.image.length!==6)return;const ye=Z(Q,k),Ee=k.source;t.bindTexture(r.TEXTURE_CUBE_MAP,Q.__webglTexture,r.TEXTURE0+se);const _e=n.get(Ee);if(Ee.version!==_e.__version||ye===!0){t.activeTexture(r.TEXTURE0+se);const Ge=St.getPrimaries(St.workingColorSpace),Le=k.colorSpace===Mi?null:St.getPrimaries(k.colorSpace),Ve=k.colorSpace===Mi||Ge===Le?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);const gt=k.isCompressedTexture||k.image[0].isCompressedTexture,we=k.image[0]&&k.image[0].isDataTexture,Ue=[];for(let ve=0;ve<6;ve++)!gt&&!we?Ue[ve]=E(k.image[ve],!0,i.maxCubemapSize):Ue[ve]=we?k.image[ve].image:k.image[ve],Ue[ve]=Mt(k,Ue[ve]);const nt=Ue[0],et=s.convert(k.format,k.colorSpace),he=s.convert(k.type),Pe=x(k.internalFormat,et,he,k.colorSpace),Fe=k.isVideoTexture!==!0,ht=_e.__version===void 0||ye===!0,$=Ee.dataReady;let Se=B(k,nt);H(r.TEXTURE_CUBE_MAP,k);let ue;if(gt){Fe&&ht&&t.texStorage2D(r.TEXTURE_CUBE_MAP,Se,Pe,nt.width,nt.height);for(let ve=0;ve<6;ve++){ue=Ue[ve].mipmaps;for(let De=0;De<ue.length;De++){const Be=ue[De];k.format!==Kt?et!==null?Fe?$&&t.compressedTexSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ve,De,0,0,Be.width,Be.height,et,Be.data):t.compressedTexImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ve,De,Pe,Be.width,Be.height,0,Be.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):Fe?$&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ve,De,0,0,Be.width,Be.height,et,he,Be.data):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ve,De,Pe,Be.width,Be.height,0,et,he,Be.data)}}}else{if(ue=k.mipmaps,Fe&&ht){ue.length>0&&Se++;const ve=Ye(Ue[0]);t.texStorage2D(r.TEXTURE_CUBE_MAP,Se,Pe,ve.width,ve.height)}for(let ve=0;ve<6;ve++)if(we){Fe?$&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ve,0,0,0,Ue[ve].width,Ue[ve].height,et,he,Ue[ve].data):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ve,0,Pe,Ue[ve].width,Ue[ve].height,0,et,he,Ue[ve].data);for(let De=0;De<ue.length;De++){const Be=ue[De].image[ve].image;Fe?$&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ve,De+1,0,0,Be.width,Be.height,et,he,Be.data):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ve,De+1,Pe,Be.width,Be.height,0,et,he,Be.data)}}else{Fe?$&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ve,0,0,0,et,he,Ue[ve]):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ve,0,Pe,et,he,Ue[ve]);for(let De=0;De<ue.length;De++){const Be=ue[De];Fe?$&&t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ve,De+1,0,0,et,he,Be.image[ve]):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ve,De+1,Pe,et,he,Be.image[ve])}}}_(k)&&v(r.TEXTURE_CUBE_MAP),_e.__version=Ee.version,k.onUpdate&&k.onUpdate(k)}Q.__version=k.version}function pe(Q,k,se,ye,Ee,_e){const Ge=s.convert(se.format,se.colorSpace),Le=s.convert(se.type),Ve=x(se.internalFormat,Ge,Le,se.colorSpace),gt=n.get(k),we=n.get(se);if(we.__renderTarget=k,!gt.__hasExternalTextures){const Ue=Math.max(1,k.width>>_e),nt=Math.max(1,k.height>>_e);Ee===r.TEXTURE_3D||Ee===r.TEXTURE_2D_ARRAY?t.texImage3D(Ee,_e,Ve,Ue,nt,k.depth,0,Ge,Le,null):t.texImage2D(Ee,_e,Ve,Ue,nt,0,Ge,Le,null)}t.bindFramebuffer(r.FRAMEBUFFER,Q),At(k)?l.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,ye,Ee,we.__webglTexture,0,pt(k)):(Ee===r.TEXTURE_2D||Ee>=r.TEXTURE_CUBE_MAP_POSITIVE_X&&Ee<=r.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&r.framebufferTexture2D(r.FRAMEBUFFER,ye,Ee,we.__webglTexture,_e),t.bindFramebuffer(r.FRAMEBUFFER,null)}function Ae(Q,k,se){if(r.bindRenderbuffer(r.RENDERBUFFER,Q),k.depthBuffer){const ye=k.depthTexture,Ee=ye&&ye.isDepthTexture?ye.type:null,_e=w(k.stencilBuffer,Ee),Ge=k.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,Le=pt(k);At(k)?l.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,Le,_e,k.width,k.height):se?r.renderbufferStorageMultisample(r.RENDERBUFFER,Le,_e,k.width,k.height):r.renderbufferStorage(r.RENDERBUFFER,_e,k.width,k.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,Ge,r.RENDERBUFFER,Q)}else{const ye=k.textures;for(let Ee=0;Ee<ye.length;Ee++){const _e=ye[Ee],Ge=s.convert(_e.format,_e.colorSpace),Le=s.convert(_e.type),Ve=x(_e.internalFormat,Ge,Le,_e.colorSpace),gt=pt(k);se&&At(k)===!1?r.renderbufferStorageMultisample(r.RENDERBUFFER,gt,Ve,k.width,k.height):At(k)?l.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,gt,Ve,k.width,k.height):r.renderbufferStorage(r.RENDERBUFFER,Ve,k.width,k.height)}}r.bindRenderbuffer(r.RENDERBUFFER,null)}function ge(Q,k){if(k&&k.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(r.FRAMEBUFFER,Q),!(k.depthTexture&&k.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");const se=n.get(k.depthTexture);se.__renderTarget=k,(!se.__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),J(k.depthTexture,0);const ye=se.__webglTexture,Ee=pt(k);if(k.depthTexture.format===Ao)At(k)?l.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,ye,0,Ee):r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.TEXTURE_2D,ye,0);else if(k.depthTexture.format===go)At(k)?l.framebufferTexture2DMultisampleEXT(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.TEXTURE_2D,ye,0,Ee):r.framebufferTexture2D(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.TEXTURE_2D,ye,0);else throw new Error("Unknown depthTexture format")}function Re(Q){const k=n.get(Q),se=Q.isWebGLCubeRenderTarget===!0;if(k.__boundDepthTexture!==Q.depthTexture){const ye=Q.depthTexture;if(k.__depthDisposeCallback&&k.__depthDisposeCallback(),ye){const Ee=()=>{delete k.__boundDepthTexture,delete k.__depthDisposeCallback,ye.removeEventListener("dispose",Ee)};ye.addEventListener("dispose",Ee),k.__depthDisposeCallback=Ee}k.__boundDepthTexture=ye}if(Q.depthTexture&&!k.__autoAllocateDepthBuffer){if(se)throw new Error("target.depthTexture not supported in Cube render targets");ge(k.__webglFramebuffer,Q)}else if(se){k.__webglDepthbuffer=[];for(let ye=0;ye<6;ye++)if(t.bindFramebuffer(r.FRAMEBUFFER,k.__webglFramebuffer[ye]),k.__webglDepthbuffer[ye]===void 0)k.__webglDepthbuffer[ye]=r.createRenderbuffer(),Ae(k.__webglDepthbuffer[ye],Q,!1);else{const Ee=Q.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,_e=k.__webglDepthbuffer[ye];r.bindRenderbuffer(r.RENDERBUFFER,_e),r.framebufferRenderbuffer(r.FRAMEBUFFER,Ee,r.RENDERBUFFER,_e)}}else if(t.bindFramebuffer(r.FRAMEBUFFER,k.__webglFramebuffer),k.__webglDepthbuffer===void 0)k.__webglDepthbuffer=r.createRenderbuffer(),Ae(k.__webglDepthbuffer,Q,!1);else{const ye=Q.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,Ee=k.__webglDepthbuffer;r.bindRenderbuffer(r.RENDERBUFFER,Ee),r.framebufferRenderbuffer(r.FRAMEBUFFER,ye,r.RENDERBUFFER,Ee)}t.bindFramebuffer(r.FRAMEBUFFER,null)}function Oe(Q,k,se){const ye=n.get(Q);k!==void 0&&pe(ye.__webglFramebuffer,Q,Q.texture,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,0),se!==void 0&&Re(Q)}function st(Q){const k=Q.texture,se=n.get(Q),ye=n.get(k);Q.addEventListener("dispose",S);const Ee=Q.textures,_e=Q.isWebGLCubeRenderTarget===!0,Ge=Ee.length>1;if(Ge||(ye.__webglTexture===void 0&&(ye.__webglTexture=r.createTexture()),ye.__version=k.version,o.memory.textures++),_e){se.__webglFramebuffer=[];for(let Le=0;Le<6;Le++)if(k.mipmaps&&k.mipmaps.length>0){se.__webglFramebuffer[Le]=[];for(let Ve=0;Ve<k.mipmaps.length;Ve++)se.__webglFramebuffer[Le][Ve]=r.createFramebuffer()}else se.__webglFramebuffer[Le]=r.createFramebuffer()}else{if(k.mipmaps&&k.mipmaps.length>0){se.__webglFramebuffer=[];for(let Le=0;Le<k.mipmaps.length;Le++)se.__webglFramebuffer[Le]=r.createFramebuffer()}else se.__webglFramebuffer=r.createFramebuffer();if(Ge)for(let Le=0,Ve=Ee.length;Le<Ve;Le++){const gt=n.get(Ee[Le]);gt.__webglTexture===void 0&&(gt.__webglTexture=r.createTexture(),o.memory.textures++)}if(Q.samples>0&&At(Q)===!1){se.__webglMultisampledFramebuffer=r.createFramebuffer(),se.__webglColorRenderbuffer=[],t.bindFramebuffer(r.FRAMEBUFFER,se.__webglMultisampledFramebuffer);for(let Le=0;Le<Ee.length;Le++){const Ve=Ee[Le];se.__webglColorRenderbuffer[Le]=r.createRenderbuffer(),r.bindRenderbuffer(r.RENDERBUFFER,se.__webglColorRenderbuffer[Le]);const gt=s.convert(Ve.format,Ve.colorSpace),we=s.convert(Ve.type),Ue=x(Ve.internalFormat,gt,we,Ve.colorSpace,Q.isXRRenderTarget===!0),nt=pt(Q);r.renderbufferStorageMultisample(r.RENDERBUFFER,nt,Ue,Q.width,Q.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+Le,r.RENDERBUFFER,se.__webglColorRenderbuffer[Le])}r.bindRenderbuffer(r.RENDERBUFFER,null),Q.depthBuffer&&(se.__webglDepthRenderbuffer=r.createRenderbuffer(),Ae(se.__webglDepthRenderbuffer,Q,!0)),t.bindFramebuffer(r.FRAMEBUFFER,null)}}if(_e){t.bindTexture(r.TEXTURE_CUBE_MAP,ye.__webglTexture),H(r.TEXTURE_CUBE_MAP,k);for(let Le=0;Le<6;Le++)if(k.mipmaps&&k.mipmaps.length>0)for(let Ve=0;Ve<k.mipmaps.length;Ve++)pe(se.__webglFramebuffer[Le][Ve],Q,k,r.COLOR_ATTACHMENT0,r.TEXTURE_CUBE_MAP_POSITIVE_X+Le,Ve);else pe(se.__webglFramebuffer[Le],Q,k,r.COLOR_ATTACHMENT0,r.TEXTURE_CUBE_MAP_POSITIVE_X+Le,0);_(k)&&v(r.TEXTURE_CUBE_MAP),t.unbindTexture()}else if(Ge){for(let Le=0,Ve=Ee.length;Le<Ve;Le++){const gt=Ee[Le],we=n.get(gt);t.bindTexture(r.TEXTURE_2D,we.__webglTexture),H(r.TEXTURE_2D,gt),pe(se.__webglFramebuffer,Q,gt,r.COLOR_ATTACHMENT0+Le,r.TEXTURE_2D,0),_(gt)&&v(r.TEXTURE_2D)}t.unbindTexture()}else{let Le=r.TEXTURE_2D;if((Q.isWebGL3DRenderTarget||Q.isWebGLArrayRenderTarget)&&(Le=Q.isWebGL3DRenderTarget?r.TEXTURE_3D:r.TEXTURE_2D_ARRAY),t.bindTexture(Le,ye.__webglTexture),H(Le,k),k.mipmaps&&k.mipmaps.length>0)for(let Ve=0;Ve<k.mipmaps.length;Ve++)pe(se.__webglFramebuffer[Ve],Q,k,r.COLOR_ATTACHMENT0,Le,Ve);else pe(se.__webglFramebuffer,Q,k,r.COLOR_ATTACHMENT0,Le,0);_(k)&&v(Le),t.unbindTexture()}Q.depthBuffer&&Re(Q)}function ut(Q){const k=Q.textures;for(let se=0,ye=k.length;se<ye;se++){const Ee=k[se];if(_(Ee)){const _e=C(Q),Ge=n.get(Ee).__webglTexture;t.bindTexture(_e,Ge),v(_e),t.unbindTexture()}}}const mt=[],X=[];function h0(Q){if(Q.samples>0){if(At(Q)===!1){const k=Q.textures,se=Q.width,ye=Q.height;let Ee=r.COLOR_BUFFER_BIT;const _e=Q.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,Ge=n.get(Q),Le=k.length>1;if(Le)for(let Ve=0;Ve<k.length;Ve++)t.bindFramebuffer(r.FRAMEBUFFER,Ge.__webglMultisampledFramebuffer),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+Ve,r.RENDERBUFFER,null),t.bindFramebuffer(r.FRAMEBUFFER,Ge.__webglFramebuffer),r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0+Ve,r.TEXTURE_2D,null,0);t.bindFramebuffer(r.READ_FRAMEBUFFER,Ge.__webglMultisampledFramebuffer),t.bindFramebuffer(r.DRAW_FRAMEBUFFER,Ge.__webglFramebuffer);for(let Ve=0;Ve<k.length;Ve++){if(Q.resolveDepthBuffer&&(Q.depthBuffer&&(Ee|=r.DEPTH_BUFFER_BIT),Q.stencilBuffer&&Q.resolveStencilBuffer&&(Ee|=r.STENCIL_BUFFER_BIT)),Le){r.framebufferRenderbuffer(r.READ_FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.RENDERBUFFER,Ge.__webglColorRenderbuffer[Ve]);const gt=n.get(k[Ve]).__webglTexture;r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,gt,0)}r.blitFramebuffer(0,0,se,ye,0,0,se,ye,Ee,r.NEAREST),h===!0&&(mt.length=0,X.length=0,mt.push(r.COLOR_ATTACHMENT0+Ve),Q.depthBuffer&&Q.resolveDepthBuffer===!1&&(mt.push(_e),X.push(_e),r.invalidateFramebuffer(r.DRAW_FRAMEBUFFER,X)),r.invalidateFramebuffer(r.READ_FRAMEBUFFER,mt))}if(t.bindFramebuffer(r.READ_FRAMEBUFFER,null),t.bindFramebuffer(r.DRAW_FRAMEBUFFER,null),Le)for(let Ve=0;Ve<k.length;Ve++){t.bindFramebuffer(r.FRAMEBUFFER,Ge.__webglMultisampledFramebuffer),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+Ve,r.RENDERBUFFER,Ge.__webglColorRenderbuffer[Ve]);const gt=n.get(k[Ve]).__webglTexture;t.bindFramebuffer(r.FRAMEBUFFER,Ge.__webglFramebuffer),r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,r.COLOR_ATTACHMENT0+Ve,r.TEXTURE_2D,gt,0)}t.bindFramebuffer(r.DRAW_FRAMEBUFFER,Ge.__webglMultisampledFramebuffer)}else if(Q.depthBuffer&&Q.resolveDepthBuffer===!1&&h){const k=Q.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT;r.invalidateFramebuffer(r.DRAW_FRAMEBUFFER,[k])}}}function pt(Q){return Math.min(i.maxSamples,Q.samples)}function At(Q){const k=n.get(Q);return Q.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&k.__useRenderToTexture!==!1}function qe(Q){const k=o.render.frame;d.get(Q)!==k&&(d.set(Q,k),Q.update())}function Mt(Q,k){const se=Q.colorSpace,ye=Q.format,Ee=Q.type;return Q.isCompressedTexture===!0||Q.isVideoTexture===!0||se!==j0&&se!==Mi&&(St.getTransfer(se)===Ot?(ye!==Kt||Ee!==w0)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",se)),k}function Ye(Q){return typeof HTMLImageElement<"u"&&Q instanceof HTMLImageElement?(u.width=Q.naturalWidth||Q.width,u.height=Q.naturalHeight||Q.height):typeof VideoFrame<"u"&&Q instanceof VideoFrame?(u.width=Q.displayWidth,u.height=Q.displayHeight):(u.width=Q.width,u.height=Q.height),u}this.allocateTextureUnit=F,this.resetTextureUnits=P,this.setTexture2D=J,this.setTexture2DArray=q,this.setTexture3D=ne,this.setTextureCube=j,this.rebindTextures=Oe,this.setupRenderTarget=st,this.updateRenderTargetMipmap=ut,this.updateMultisampleRenderTarget=h0,this.setupDepthRenderbuffer=Re,this.setupFrameBufferTexture=pe,this.useMultisampledRTT=At}function TT(r,e){function t(n,i=Mi){let s;const o=St.getTransfer(i);if(n===w0)return r.UNSIGNED_BYTE;if(n===y3)return r.UNSIGNED_SHORT_4_4_4_4;if(n===E3)return r.UNSIGNED_SHORT_5_5_5_1;if(n===$6)return r.UNSIGNED_INT_5_9_9_9_REV;if(n===t9)return r.BYTE;if(n===_3)return r.SHORT;if(n===ho)return r.UNSIGNED_SHORT;if(n===fo)return r.INT;if(n===An)return r.UNSIGNED_INT;if(n===Jt)return r.FLOAT;if(n===p0)return r.HALF_FLOAT;if(n===ed)return r.ALPHA;if(n===td)return r.RGB;if(n===Kt)return r.RGBA;if(n===rd)return r.LUMINANCE;if(n===nd)return r.LUMINANCE_ALPHA;if(n===Ao)return r.DEPTH_COMPONENT;if(n===go)return r.DEPTH_STENCIL;if(n===Ii)return r.RED;if(n===r9)return r.RED_INTEGER;if(n===hs)return r.RG;if(n===$1)return r.RG_INTEGER;if(n===mo)return r.RGBA_INTEGER;if(n===n9||n===el||n===i9||n===tl)if(o===Ot)if(s=e.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(n===n9)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===el)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===i9)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===tl)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=e.get("WEBGL_compressed_texture_s3tc"),s!==null){if(n===n9)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===el)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===i9)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===tl)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(n===s9||n===x3||n===a9||n===w3)if(s=e.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(n===s9)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===x3)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===a9)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===w3)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(n===o9||n===l9||n===c9)if(s=e.get("WEBGL_compressed_texture_etc"),s!==null){if(n===o9||n===l9)return o===Ot?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(n===c9)return o===Ot?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(n===rl||n===C3||n===I3||n===M3||n===nl||n===S3||n===T3||n===B3||n===b3||n===R3||n===D3||n===L3||n===N3||n===P3)if(s=e.get("WEBGL_compressed_texture_astc"),s!==null){if(n===rl)return o===Ot?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===C3)return o===Ot?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===I3)return o===Ot?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===M3)return o===Ot?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===nl)return o===Ot?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===S3)return o===Ot?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===T3)return o===Ot?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===B3)return o===Ot?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===b3)return o===Ot?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===R3)return o===Ot?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===D3)return o===Ot?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===L3)return o===Ot?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===N3)return o===Ot?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===P3)return o===Ot?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(n===il||n===U3||n===u9)if(s=e.get("EXT_texture_compression_bptc"),s!==null){if(n===il)return o===Ot?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===U3)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===u9)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(n===id||n===k3||n===F3||n===O3)if(s=e.get("EXT_texture_compression_rgtc"),s!==null){if(n===il)return s.COMPRESSED_RED_RGTC1_EXT;if(n===k3)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===F3)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===O3)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return n===po?r.UNSIGNED_INT_24_8:r[n]!==void 0?r[n]:null}return{convert:t}}const BT=`
3822
3822
  void main() {
3823
3823
 
3824
3824
  gl_Position = vec4( position, 1.0 );
@@ -3842,7 +3842,7 @@ void main() {
3842
3842
 
3843
3843
  }
3844
3844
 
3845
- }`;class RT{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,n){if(this.texture===null){const i=new U0,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}}getMesh(e){if(this.texture!==null&&this.mesh===null){const t=e.cameras[0].viewport,n=new B0({vertexShader:BT,fragmentShader:bT,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new T0(new _l(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class DT extends ha{constructor(e,t){super();const n=this;let i=null,s=1,o=null,l="local-floor",h=1,u=null,d=null,A=null,p=null,g=null,m=null;const E=new RT,_=t.getContextAttributes();let v=null,C=null;const x=[],w=[],B=new ze;let T=null;const S=new pr;S.viewport=new Ut;const D=new pr;D.viewport=new Ut;const R=[S,D],M=new zw;let L=null,P=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(G){let oe=x[G];return oe===void 0&&(oe=new u4,x[G]=oe),oe.getTargetRaySpace()},this.getControllerGrip=function(G){let oe=x[G];return oe===void 0&&(oe=new u4,x[G]=oe),oe.getGripSpace()},this.getHand=function(G){let oe=x[G];return oe===void 0&&(oe=new u4,x[G]=oe),oe.getHandSpace()};function F(G){const oe=w.indexOf(G.inputSource);if(oe===-1)return;const pe=x[oe];pe!==void 0&&(pe.update(G.inputSource,G.frame,u||o),pe.dispatchEvent({type:G.type,data:G.inputSource}))}function z(){i.removeEventListener("select",F),i.removeEventListener("selectstart",F),i.removeEventListener("selectend",F),i.removeEventListener("squeeze",F),i.removeEventListener("squeezestart",F),i.removeEventListener("squeezeend",F),i.removeEventListener("end",z),i.removeEventListener("inputsourceschange",J);for(let G=0;G<x.length;G++){const oe=w[G];oe!==null&&(w[G]=null,x[G].disconnect(oe))}L=null,P=null,E.reset(),e.setRenderTarget(v),g=null,p=null,A=null,i=null,C=null,Z.stop(),n.isPresenting=!1,e.setPixelRatio(T),e.setSize(B.width,B.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){l=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 m},this.getSession=function(){return i},this.setSession=async function(G){if(i=G,i!==null){if(v=e.getRenderTarget(),i.addEventListener("select",F),i.addEventListener("selectstart",F),i.addEventListener("selectend",F),i.addEventListener("squeeze",F),i.addEventListener("squeezestart",F),i.addEventListener("squeezeend",F),i.addEventListener("end",z),i.addEventListener("inputsourceschange",J),_.xrCompatible!==!0&&await t.makeXRCompatible(),T=e.getPixelRatio(),e.getSize(B),typeof XRWebGLBinding<"u"&&"createProjectionLayer"in XRWebGLBinding.prototype){let oe=null,pe=null,Ae=null;_.depth&&(Ae=_.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,oe=_.stencil?go:Ao,pe=_.stencil?po:An);const ge={colorFormat:t.RGBA8,depthFormat:Ae,scaleFactor:s};A=new XRWebGLBinding(i,t),p=A.createProjectionLayer(ge),i.updateRenderState({layers:[p]}),e.setPixelRatio(1),e.setSize(p.textureWidth,p.textureHeight,!1),C=new Nr(p.textureWidth,p.textureHeight,{format:Kt,type:w0,depthTexture:new i7(p.textureWidth,p.textureHeight,pe,void 0,void 0,void 0,void 0,void 0,void 0,oe),stencilBuffer:_.stencil,colorSpace:e.outputColorSpace,samples:_.antialias?4:0,resolveDepthBuffer:p.ignoreDepthValues===!1,resolveStencilBuffer:p.ignoreDepthValues===!1})}else{const oe={antialias:_.antialias,alpha:!0,depth:_.depth,stencil:_.stencil,framebufferScaleFactor:s};g=new XRWebGLLayer(i,t,oe),i.updateRenderState({baseLayer:g}),e.setPixelRatio(1),e.setSize(g.framebufferWidth,g.framebufferHeight,!1),C=new Nr(g.framebufferWidth,g.framebufferHeight,{format:Kt,type:w0,colorSpace:e.outputColorSpace,stencilBuffer:_.stencil,resolveDepthBuffer:g.ignoreDepthValues===!1,resolveStencilBuffer:g.ignoreDepthValues===!1})}C.isXRRenderTarget=!0,this.setFoveation(h),u=null,o=await i.requestReferenceSpace(l),Z.setContext(i),Z.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(i!==null)return i.environmentBlendMode},this.getDepthTexture=function(){return E.getDepthTexture()};function J(G){for(let oe=0;oe<G.removed.length;oe++){const pe=G.removed[oe],Ae=w.indexOf(pe);Ae>=0&&(w[Ae]=null,x[Ae].disconnect(pe))}for(let oe=0;oe<G.added.length;oe++){const pe=G.added[oe];let Ae=w.indexOf(pe);if(Ae===-1){for(let Re=0;Re<x.length;Re++)if(Re>=w.length){w.push(pe),Ae=Re;break}else if(w[Re]===null){w[Re]=pe,Ae=Re;break}if(Ae===-1)break}const ge=x[Ae];ge&&ge.connect(pe)}}const q=new V,ne=new V;function j(G,oe,pe){q.setFromMatrixPosition(oe.matrixWorld),ne.setFromMatrixPosition(pe.matrixWorld);const Ae=q.distanceTo(ne),ge=oe.projectionMatrix.elements,Re=pe.projectionMatrix.elements,Fe=ge[14]/(ge[10]-1),st=ge[14]/(ge[10]+1),ut=(ge[9]+1)/ge[5],mt=(ge[9]-1)/ge[5],X=(ge[8]-1)/ge[0],h0=(Re[8]+1)/Re[0],pt=Fe*X,At=Fe*h0,qe=Ae/(-X+h0),Mt=qe*-X;if(oe.matrixWorld.decompose(G.position,G.quaternion,G.scale),G.translateX(Mt),G.translateZ(qe),G.matrixWorld.compose(G.position,G.quaternion,G.scale),G.matrixWorldInverse.copy(G.matrixWorld).invert(),ge[10]===-1)G.projectionMatrix.copy(oe.projectionMatrix),G.projectionMatrixInverse.copy(oe.projectionMatrixInverse);else{const Ye=Fe+qe,Q=st+qe,k=pt-Mt,se=At+(Ae-Mt),ye=ut*st/Q*Ye,Ee=mt*st/Q*Ye;G.projectionMatrix.makePerspective(k,se,ye,Ee,Ye,Q),G.projectionMatrixInverse.copy(G.projectionMatrix).invert()}}function te(G,oe){oe===null?G.matrixWorld.copy(G.matrix):G.matrixWorld.multiplyMatrices(oe.matrixWorld,G.matrix),G.matrixWorldInverse.copy(G.matrixWorld).invert()}this.updateCamera=function(G){if(i===null)return;let oe=G.near,pe=G.far;E.texture!==null&&(E.depthNear>0&&(oe=E.depthNear),E.depthFar>0&&(pe=E.depthFar)),M.near=D.near=S.near=oe,M.far=D.far=S.far=pe,(L!==M.near||P!==M.far)&&(i.updateRenderState({depthNear:M.near,depthFar:M.far}),L=M.near,P=M.far),S.layers.mask=G.layers.mask|2,D.layers.mask=G.layers.mask|4,M.layers.mask=S.layers.mask|D.layers.mask;const Ae=G.parent,ge=M.cameras;te(M,Ae);for(let Re=0;Re<ge.length;Re++)te(ge[Re],Ae);ge.length===2?j(M,S,D):M.projectionMatrix.copy(S.projectionMatrix),W(G,M,Ae)};function W(G,oe,pe){pe===null?G.matrix.copy(oe.matrixWorld):(G.matrix.copy(pe.matrixWorld),G.matrix.invert(),G.matrix.multiply(oe.matrixWorld)),G.matrix.decompose(G.position,G.quaternion,G.scale),G.updateMatrixWorld(!0),G.projectionMatrix.copy(oe.projectionMatrix),G.projectionMatrixInverse.copy(oe.projectionMatrixInverse),G.isPerspectiveCamera&&(G.fov=_o*2*Math.atan(1/G.projectionMatrix.elements[5]),G.zoom=1)}this.getCamera=function(){return M},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},this.getDepthSensingMesh=function(){return E.getMesh(M)};let U=null;function H(G,oe){if(d=oe.getViewerPose(u||o),m=oe,d!==null){const pe=d.views;g!==null&&(e.setRenderTargetFramebuffer(C,g.framebuffer),e.setRenderTarget(C));let Ae=!1;pe.length!==M.cameras.length&&(M.cameras.length=0,Ae=!0);for(let Re=0;Re<pe.length;Re++){const Fe=pe[Re];let st=null;if(g!==null)st=g.getViewport(Fe);else{const mt=A.getViewSubImage(p,Fe);st=mt.viewport,Re===0&&(e.setRenderTargetTextures(C,mt.colorTexture,p.ignoreDepthValues?void 0:mt.depthStencilTexture),e.setRenderTarget(C))}let ut=R[Re];ut===void 0&&(ut=new pr,ut.layers.enable(Re),ut.viewport=new Ut,R[Re]=ut),ut.matrix.fromArray(Fe.transform.matrix),ut.matrix.decompose(ut.position,ut.quaternion,ut.scale),ut.projectionMatrix.fromArray(Fe.projectionMatrix),ut.projectionMatrixInverse.copy(ut.projectionMatrix).invert(),ut.viewport.set(st.x,st.y,st.width,st.height),Re===0&&(M.matrix.copy(ut.matrix),M.matrix.decompose(M.position,M.quaternion,M.scale)),Ae===!0&&M.cameras.push(ut)}const ge=i.enabledFeatures;if(ge&&ge.includes("depth-sensing")&&i.depthUsage=="gpu-optimized"&&A){const Re=A.getDepthInformation(pe[0]);Re&&Re.isValid&&Re.texture&&E.init(e,Re,i.renderState)}}for(let pe=0;pe<x.length;pe++){const Ae=w[pe],ge=x[pe];Ae!==null&&ge!==void 0&&ge.update(Ae,oe,u||o)}U&&U(G,oe),oe.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:oe}),m=null}const Z=new E7;Z.setAnimationLoop(H),this.setAnimationLoop=function(G){U=G},this.dispose=function(){}}}const Ea=new ni,LT=new lt;function NT(r,e){function t(_,v){_.matrixAutoUpdate===!0&&_.updateMatrix(),v.value.copy(_.matrix)}function n(_,v){v.color.getRGB(_.fogColor.value,Ud(r)),v.isFog?(_.fogNear.value=v.near,_.fogFar.value=v.far):v.isFogExp2&&(_.fogDensity.value=v.density)}function i(_,v,C,x,w){v.isMeshBasicMaterial||v.isMeshLambertMaterial?s(_,v):v.isMeshToonMaterial?(s(_,v),A(_,v)):v.isMeshPhongMaterial?(s(_,v),d(_,v)):v.isMeshStandardMaterial?(s(_,v),p(_,v),v.isMeshPhysicalMaterial&&g(_,v,w)):v.isMeshMatcapMaterial?(s(_,v),m(_,v)):v.isMeshDepthMaterial?s(_,v):v.isMeshDistanceMaterial?(s(_,v),E(_,v)):v.isMeshNormalMaterial?s(_,v):v.isLineBasicMaterial?(o(_,v),v.isLineDashedMaterial&&l(_,v)):v.isPointsMaterial?h(_,v,C,x):v.isSpriteMaterial?u(_,v):v.isShadowMaterial?(_.color.value.copy(v.color),_.opacity.value=v.opacity):v.isShaderMaterial&&(v.uniformsNeedUpdate=!1)}function s(_,v){_.opacity.value=v.opacity,v.color&&_.diffuse.value.copy(v.color),v.emissive&&_.emissive.value.copy(v.emissive).multiplyScalar(v.emissiveIntensity),v.map&&(_.map.value=v.map,t(v.map,_.mapTransform)),v.alphaMap&&(_.alphaMap.value=v.alphaMap,t(v.alphaMap,_.alphaMapTransform)),v.bumpMap&&(_.bumpMap.value=v.bumpMap,t(v.bumpMap,_.bumpMapTransform),_.bumpScale.value=v.bumpScale,v.side===V0&&(_.bumpScale.value*=-1)),v.normalMap&&(_.normalMap.value=v.normalMap,t(v.normalMap,_.normalMapTransform),_.normalScale.value.copy(v.normalScale),v.side===V0&&_.normalScale.value.negate()),v.displacementMap&&(_.displacementMap.value=v.displacementMap,t(v.displacementMap,_.displacementMapTransform),_.displacementScale.value=v.displacementScale,_.displacementBias.value=v.displacementBias),v.emissiveMap&&(_.emissiveMap.value=v.emissiveMap,t(v.emissiveMap,_.emissiveMapTransform)),v.specularMap&&(_.specularMap.value=v.specularMap,t(v.specularMap,_.specularMapTransform)),v.alphaTest>0&&(_.alphaTest.value=v.alphaTest);const C=e.get(v),x=C.envMap,w=C.envMapRotation;x&&(_.envMap.value=x,Ea.copy(w),Ea.x*=-1,Ea.y*=-1,Ea.z*=-1,x.isCubeTexture&&x.isRenderTargetTexture===!1&&(Ea.y*=-1,Ea.z*=-1),_.envMapRotation.value.setFromMatrix4(LT.makeRotationFromEuler(Ea)),_.flipEnvMap.value=x.isCubeTexture&&x.isRenderTargetTexture===!1?-1:1,_.reflectivity.value=v.reflectivity,_.ior.value=v.ior,_.refractionRatio.value=v.refractionRatio),v.lightMap&&(_.lightMap.value=v.lightMap,_.lightMapIntensity.value=v.lightMapIntensity,t(v.lightMap,_.lightMapTransform)),v.aoMap&&(_.aoMap.value=v.aoMap,_.aoMapIntensity.value=v.aoMapIntensity,t(v.aoMap,_.aoMapTransform))}function o(_,v){_.diffuse.value.copy(v.color),_.opacity.value=v.opacity,v.map&&(_.map.value=v.map,t(v.map,_.mapTransform))}function l(_,v){_.dashSize.value=v.dashSize,_.totalSize.value=v.dashSize+v.gapSize,_.scale.value=v.scale}function h(_,v,C,x){_.diffuse.value.copy(v.color),_.opacity.value=v.opacity,_.size.value=v.size*C,_.scale.value=x*.5,v.map&&(_.map.value=v.map,t(v.map,_.uvTransform)),v.alphaMap&&(_.alphaMap.value=v.alphaMap,t(v.alphaMap,_.alphaMapTransform)),v.alphaTest>0&&(_.alphaTest.value=v.alphaTest)}function u(_,v){_.diffuse.value.copy(v.color),_.opacity.value=v.opacity,_.rotation.value=v.rotation,v.map&&(_.map.value=v.map,t(v.map,_.mapTransform)),v.alphaMap&&(_.alphaMap.value=v.alphaMap,t(v.alphaMap,_.alphaMapTransform)),v.alphaTest>0&&(_.alphaTest.value=v.alphaTest)}function d(_,v){_.specular.value.copy(v.specular),_.shininess.value=Math.max(v.shininess,1e-4)}function A(_,v){v.gradientMap&&(_.gradientMap.value=v.gradientMap)}function p(_,v){_.metalness.value=v.metalness,v.metalnessMap&&(_.metalnessMap.value=v.metalnessMap,t(v.metalnessMap,_.metalnessMapTransform)),_.roughness.value=v.roughness,v.roughnessMap&&(_.roughnessMap.value=v.roughnessMap,t(v.roughnessMap,_.roughnessMapTransform)),v.envMap&&(_.envMapIntensity.value=v.envMapIntensity)}function g(_,v,C){_.ior.value=v.ior,v.sheen>0&&(_.sheenColor.value.copy(v.sheenColor).multiplyScalar(v.sheen),_.sheenRoughness.value=v.sheenRoughness,v.sheenColorMap&&(_.sheenColorMap.value=v.sheenColorMap,t(v.sheenColorMap,_.sheenColorMapTransform)),v.sheenRoughnessMap&&(_.sheenRoughnessMap.value=v.sheenRoughnessMap,t(v.sheenRoughnessMap,_.sheenRoughnessMapTransform))),v.clearcoat>0&&(_.clearcoat.value=v.clearcoat,_.clearcoatRoughness.value=v.clearcoatRoughness,v.clearcoatMap&&(_.clearcoatMap.value=v.clearcoatMap,t(v.clearcoatMap,_.clearcoatMapTransform)),v.clearcoatRoughnessMap&&(_.clearcoatRoughnessMap.value=v.clearcoatRoughnessMap,t(v.clearcoatRoughnessMap,_.clearcoatRoughnessMapTransform)),v.clearcoatNormalMap&&(_.clearcoatNormalMap.value=v.clearcoatNormalMap,t(v.clearcoatNormalMap,_.clearcoatNormalMapTransform),_.clearcoatNormalScale.value.copy(v.clearcoatNormalScale),v.side===V0&&_.clearcoatNormalScale.value.negate())),v.dispersion>0&&(_.dispersion.value=v.dispersion),v.iridescence>0&&(_.iridescence.value=v.iridescence,_.iridescenceIOR.value=v.iridescenceIOR,_.iridescenceThicknessMinimum.value=v.iridescenceThicknessRange[0],_.iridescenceThicknessMaximum.value=v.iridescenceThicknessRange[1],v.iridescenceMap&&(_.iridescenceMap.value=v.iridescenceMap,t(v.iridescenceMap,_.iridescenceMapTransform)),v.iridescenceThicknessMap&&(_.iridescenceThicknessMap.value=v.iridescenceThicknessMap,t(v.iridescenceThicknessMap,_.iridescenceThicknessMapTransform))),v.transmission>0&&(_.transmission.value=v.transmission,_.transmissionSamplerMap.value=C.texture,_.transmissionSamplerSize.value.set(C.width,C.height),v.transmissionMap&&(_.transmissionMap.value=v.transmissionMap,t(v.transmissionMap,_.transmissionMapTransform)),_.thickness.value=v.thickness,v.thicknessMap&&(_.thicknessMap.value=v.thicknessMap,t(v.thicknessMap,_.thicknessMapTransform)),_.attenuationDistance.value=v.attenuationDistance,_.attenuationColor.value.copy(v.attenuationColor)),v.anisotropy>0&&(_.anisotropyVector.value.set(v.anisotropy*Math.cos(v.anisotropyRotation),v.anisotropy*Math.sin(v.anisotropyRotation)),v.anisotropyMap&&(_.anisotropyMap.value=v.anisotropyMap,t(v.anisotropyMap,_.anisotropyMapTransform))),_.specularIntensity.value=v.specularIntensity,_.specularColor.value.copy(v.specularColor),v.specularColorMap&&(_.specularColorMap.value=v.specularColorMap,t(v.specularColorMap,_.specularColorMapTransform)),v.specularIntensityMap&&(_.specularIntensityMap.value=v.specularIntensityMap,t(v.specularIntensityMap,_.specularIntensityMapTransform))}function m(_,v){v.matcap&&(_.matcap.value=v.matcap)}function E(_,v){const C=e.get(v).light;_.referencePosition.value.setFromMatrixPosition(C.matrixWorld),_.nearDistance.value=C.shadow.camera.near,_.farDistance.value=C.shadow.camera.far}return{refreshFogUniforms:n,refreshMaterialUniforms:i}}function PT(r,e,t,n){let i={},s={},o=[];const l=r.getParameter(r.MAX_UNIFORM_BUFFER_BINDINGS);function h(C,x){const w=x.program;n.uniformBlockBinding(C,w)}function u(C,x){let w=i[C.id];w===void 0&&(m(C),w=d(C),i[C.id]=w,C.addEventListener("dispose",_));const B=x.program;n.updateUBOMapping(C,B);const T=e.render.frame;s[C.id]!==T&&(p(C),s[C.id]=T)}function d(C){const x=A();C.__bindingPointIndex=x;const w=r.createBuffer(),B=C.__size,T=C.usage;return r.bindBuffer(r.UNIFORM_BUFFER,w),r.bufferData(r.UNIFORM_BUFFER,B,T),r.bindBuffer(r.UNIFORM_BUFFER,null),r.bindBufferBase(r.UNIFORM_BUFFER,x,w),w}function A(){for(let C=0;C<l;C++)if(o.indexOf(C)===-1)return o.push(C),C;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function p(C){const x=i[C.id],w=C.uniforms,B=C.__cache;r.bindBuffer(r.UNIFORM_BUFFER,x);for(let T=0,S=w.length;T<S;T++){const D=Array.isArray(w[T])?w[T]:[w[T]];for(let R=0,M=D.length;R<M;R++){const L=D[R];if(g(L,T,R,B)===!0){const P=L.__offset,F=Array.isArray(L.value)?L.value:[L.value];let z=0;for(let J=0;J<F.length;J++){const q=F[J],ne=E(q);typeof q=="number"||typeof q=="boolean"?(L.__data[0]=q,r.bufferSubData(r.UNIFORM_BUFFER,P+z,L.__data)):q.isMatrix3?(L.__data[0]=q.elements[0],L.__data[1]=q.elements[1],L.__data[2]=q.elements[2],L.__data[3]=0,L.__data[4]=q.elements[3],L.__data[5]=q.elements[4],L.__data[6]=q.elements[5],L.__data[7]=0,L.__data[8]=q.elements[6],L.__data[9]=q.elements[7],L.__data[10]=q.elements[8],L.__data[11]=0):(q.toArray(L.__data,z),z+=ne.storage/Float32Array.BYTES_PER_ELEMENT)}r.bufferSubData(r.UNIFORM_BUFFER,P,L.__data)}}}r.bindBuffer(r.UNIFORM_BUFFER,null)}function g(C,x,w,B){const T=C.value,S=x+"_"+w;if(B[S]===void 0)return typeof T=="number"||typeof T=="boolean"?B[S]=T:B[S]=T.clone(),!0;{const D=B[S];if(typeof T=="number"||typeof T=="boolean"){if(D!==T)return B[S]=T,!0}else if(D.equals(T)===!1)return D.copy(T),!0}return!1}function m(C){const x=C.uniforms;let w=0;const B=16;for(let S=0,D=x.length;S<D;S++){const R=Array.isArray(x[S])?x[S]:[x[S]];for(let M=0,L=R.length;M<L;M++){const P=R[M],F=Array.isArray(P.value)?P.value:[P.value];for(let z=0,J=F.length;z<J;z++){const q=F[z],ne=E(q),j=w%B,te=j%ne.boundary,W=j+te;w+=te,W!==0&&B-W<ne.storage&&(w+=B-W),P.__data=new Float32Array(ne.storage/Float32Array.BYTES_PER_ELEMENT),P.__offset=w,w+=ne.storage}}}const T=w%B;return T>0&&(w+=B-T),C.__size=w,C.__cache={},this}function E(C){const x={boundary:0,storage:0};return typeof C=="number"||typeof C=="boolean"?(x.boundary=4,x.storage=4):C.isVector2?(x.boundary=8,x.storage=8):C.isVector3||C.isColor?(x.boundary=16,x.storage=12):C.isVector4?(x.boundary=16,x.storage=16):C.isMatrix3?(x.boundary=48,x.storage=48):C.isMatrix4?(x.boundary=64,x.storage=64):C.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",C),x}function _(C){const x=C.target;x.removeEventListener("dispose",_);const w=o.indexOf(x.__bindingPointIndex);o.splice(w,1),r.deleteBuffer(i[x.id]),delete i[x.id],delete s[x.id]}function v(){for(const C in i)r.deleteBuffer(i[C]);o=[],i={},s={}}return{bind:h,update:u,dispose:v}}class UT{constructor(e={}){const{canvas:t=Bx(),context:n=null,depth:i=!0,stencil:s=!1,alpha:o=!1,antialias:l=!1,premultipliedAlpha:h=!0,preserveDrawingBuffer:u=!1,powerPreference:d="default",failIfMajorPerformanceCaveat:A=!1,reverseDepthBuffer:p=!1}=e;this.isWebGLRenderer=!0;let g;if(n!==null){if(typeof WebGLRenderingContext<"u"&&n instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");g=n.getContextAttributes().alpha}else g=o;const m=new Uint32Array(4),E=new Int32Array(4);let _=null,v=null;const C=[],x=[];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=C0,this.toneMapping=cs,this.toneMappingExposure=1;const w=this;let B=!1,T=0,S=0,D=null,R=-1,M=null;const L=new Ut,P=new Ut;let F=null;const z=new We(0);let J=0,q=t.width,ne=t.height,j=1,te=null,W=null;const U=new Ut(0,0,q,ne),H=new Ut(0,0,q,ne);let Z=!1;const G=new m4;let oe=!1,pe=!1;this.transmissionResolutionScale=1;const Ae=new lt,ge=new lt,Re=new V,Fe=new Ut,st={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let ut=!1;function mt(){return D===null?j:1}let X=n;function h0(O,ie){return t.getContext(O,ie)}try{const O={alpha:!0,depth:i,stencil:s,antialias:l,premultipliedAlpha:h,preserveDrawingBuffer:u,powerPreference:d,failIfMajorPerformanceCaveat:A};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${K1}`),t.addEventListener("webglcontextlost",ve,!1),t.addEventListener("webglcontextrestored",De,!1),t.addEventListener("webglcontextcreationerror",Be,!1),X===null){const ie="webgl2";if(X=h0(ie,O),X===null)throw h0(ie)?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 pt,At,qe,Mt,Ye,Q,k,se,ye,Ee,_e,Ge,Le,Ve,gt,we,Pe,nt,et,he,Oe,ke,ht,$;function Se(){pt=new WM(X),pt.init(),ke=new TT(X,pt),At=new OM(X,pt,e,ke),qe=new MT(X,pt),At.reverseDepthBuffer&&p&&qe.buffers.depth.setReversed(!0),Mt=new XM(X),Ye=new fT,Q=new ST(X,pt,qe,Ye,At,ke,Mt),k=new zM(w),se=new jM(w),ye=new tC(X),ht=new kM(X,ye),Ee=new YM(X,ye,Mt,ht),_e=new KM(X,Ee,ye,Mt),et=new JM(X,At,Q),we=new QM(Ye),Ge=new dT(w,k,se,pt,At,ht,we),Le=new NT(w,Ye),Ve=new AT,gt=new ET(pt),nt=new UM(w,k,se,qe,_e,g,h),Pe=new CT(w,_e,At),$=new PT(X,Mt,At,qe),he=new FM(X,pt,Mt),Oe=new qM(X,pt,Mt),Mt.programs=Ge.programs,w.capabilities=At,w.extensions=pt,w.properties=Ye,w.renderLists=Ve,w.shadowMap=Pe,w.state=qe,w.info=Mt}Se();const ue=new DT(w,X);this.xr=ue,this.getContext=function(){return X},this.getContextAttributes=function(){return X.getContextAttributes()},this.forceContextLoss=function(){const O=pt.get("WEBGL_lose_context");O&&O.loseContext()},this.forceContextRestore=function(){const O=pt.get("WEBGL_lose_context");O&&O.restoreContext()},this.getPixelRatio=function(){return j},this.setPixelRatio=function(O){O!==void 0&&(j=O,this.setSize(q,ne,!1))},this.getSize=function(O){return O.set(q,ne)},this.setSize=function(O,ie,de=!0){if(ue.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}q=O,ne=ie,t.width=Math.floor(O*j),t.height=Math.floor(ie*j),de===!0&&(t.style.width=O+"px",t.style.height=ie+"px"),this.setViewport(0,0,O,ie)},this.getDrawingBufferSize=function(O){return O.set(q*j,ne*j).floor()},this.setDrawingBufferSize=function(O,ie,de){q=O,ne=ie,j=de,t.width=Math.floor(O*de),t.height=Math.floor(ie*de),this.setViewport(0,0,O,ie)},this.getCurrentViewport=function(O){return O.copy(L)},this.getViewport=function(O){return O.copy(U)},this.setViewport=function(O,ie,de,le){O.isVector4?U.set(O.x,O.y,O.z,O.w):U.set(O,ie,de,le),qe.viewport(L.copy(U).multiplyScalar(j).round())},this.getScissor=function(O){return O.copy(H)},this.setScissor=function(O,ie,de,le){O.isVector4?H.set(O.x,O.y,O.z,O.w):H.set(O,ie,de,le),qe.scissor(P.copy(H).multiplyScalar(j).round())},this.getScissorTest=function(){return Z},this.setScissorTest=function(O){qe.setScissorTest(Z=O)},this.setOpaqueSort=function(O){te=O},this.setTransparentSort=function(O){W=O},this.getClearColor=function(O){return O.copy(nt.getClearColor())},this.setClearColor=function(){nt.setClearColor(...arguments)},this.getClearAlpha=function(){return nt.getClearAlpha()},this.setClearAlpha=function(){nt.setClearAlpha(...arguments)},this.clear=function(O=!0,ie=!0,de=!0){let le=0;if(O){let re=!1;if(D!==null){const Ce=D.texture.format;re=Ce===mo||Ce===$1||Ce===r9}if(re){const Ce=D.texture.type,He=Ce===w0||Ce===An||Ce===ho||Ce===po||Ce===y3||Ce===E3,Qe=nt.getClearColor(),Ze=nt.getClearAlpha(),dt=Qe.r,ct=Qe.g,rt=Qe.b;He?(m[0]=dt,m[1]=ct,m[2]=rt,m[3]=Ze,X.clearBufferuiv(X.COLOR,0,m)):(E[0]=dt,E[1]=ct,E[2]=rt,E[3]=Ze,X.clearBufferiv(X.COLOR,0,E))}else le|=X.COLOR_BUFFER_BIT}ie&&(le|=X.DEPTH_BUFFER_BIT),de&&(le|=X.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),X.clear(le)},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",ve,!1),t.removeEventListener("webglcontextrestored",De,!1),t.removeEventListener("webglcontextcreationerror",Be,!1),nt.dispose(),Ve.dispose(),gt.dispose(),Ye.dispose(),k.dispose(),se.dispose(),_e.dispose(),ht.dispose(),$.dispose(),Ge.dispose(),ue.dispose(),ue.removeEventListener("sessionstart",Xi),ue.removeEventListener("sessionend",m0),$0.stop()};function ve(O){O.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),B=!0}function De(){console.log("THREE.WebGLRenderer: Context Restored."),B=!1;const O=Mt.autoReset,ie=Pe.enabled,de=Pe.autoUpdate,le=Pe.needsUpdate,re=Pe.type;Se(),Mt.autoReset=O,Pe.enabled=ie,Pe.autoUpdate=de,Pe.needsUpdate=le,Pe.type=re}function Be(O){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",O.statusMessage)}function it(O){const ie=O.target;ie.removeEventListener("dispose",it),jt(ie)}function jt(O){y0(O),Ye.remove(O)}function y0(O){const ie=Ye.get(O).programs;ie!==void 0&&(ie.forEach(function(de){Ge.releaseProgram(de)}),O.isShaderMaterial&&Ge.releaseShaderCache(O))}this.renderBufferDirect=function(O,ie,de,le,re,Ce){ie===null&&(ie=st);const He=re.isMesh&&re.matrixWorld.determinant()<0,Qe=Kc(O,ie,de,le,re);qe.setMaterial(le,He);let Ze=de.index,dt=1;if(le.wireframe===!0){if(Ze=Ee.getWireframeAttribute(de),Ze===void 0)return;dt=2}const ct=de.drawRange,rt=de.attributes.position;let Dt=ct.start*dt,Et=(ct.start+ct.count)*dt;Ce!==null&&(Dt=Math.max(Dt,Ce.start*dt),Et=Math.min(Et,(Ce.start+Ce.count)*dt)),Ze!==null?(Dt=Math.max(Dt,0),Et=Math.min(Et,Ze.count)):rt!=null&&(Dt=Math.max(Dt,0),Et=Math.min(Et,rt.count));const E0=Et-Dt;if(E0<0||E0===1/0)return;ht.setup(re,le,Qe,de,Ze);let Ft,Wt=he;if(Ze!==null&&(Ft=ye.get(Ze),Wt=Oe,Wt.setIndex(Ft)),re.isMesh)le.wireframe===!0?(qe.setLineWidth(le.wireframeLinewidth*mt()),Wt.setMode(X.LINES)):Wt.setMode(X.TRIANGLES);else if(re.isLine){let tt=le.linewidth;tt===void 0&&(tt=1),qe.setLineWidth(tt*mt()),re.isLineSegments?Wt.setMode(X.LINES):re.isLineLoop?Wt.setMode(X.LINE_LOOP):Wt.setMode(X.LINE_STRIP)}else re.isPoints?Wt.setMode(X.POINTS):re.isSprite&&Wt.setMode(X.TRIANGLES);if(re.isBatchedMesh)if(re._multiDrawInstances!==null)da("THREE.WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),Wt.renderMultiDrawInstances(re._multiDrawStarts,re._multiDrawCounts,re._multiDrawCount,re._multiDrawInstances);else if(pt.get("WEBGL_multi_draw"))Wt.renderMultiDraw(re._multiDrawStarts,re._multiDrawCounts,re._multiDrawCount);else{const tt=re._multiDrawStarts,L0=re._multiDrawCounts,cn=re._multiDrawCount,vr=Ze?ye.get(Ze).bytesPerElement:1,Gs=Ye.get(le).currentProgram.getUniforms();for(let br=0;br<cn;br++)Gs.setValue(X,"_gl_DrawID",br),Wt.render(tt[br]/vr,L0[br])}else if(re.isInstancedMesh)Wt.renderInstances(Dt,E0,re.count);else if(de.isInstancedBufferGeometry){const tt=de._maxInstanceCount!==void 0?de._maxInstanceCount:1/0,L0=Math.min(de.instanceCount,tt);Wt.renderInstances(Dt,E0,L0)}else Wt.render(Dt,E0)};function Rt(O,ie,de){O.transparent===!0&&O.side===pn&&O.forceSinglePass===!1?(O.side=V0,O.needsUpdate=!0,I1(O,ie,de),O.side=Un,O.needsUpdate=!0,I1(O,ie,de),O.side=pn):I1(O,ie,de)}this.compile=function(O,ie,de=null){de===null&&(de=O),v=gt.get(de),v.init(ie),x.push(v),de.traverseVisible(function(re){re.isLight&&re.layers.test(ie.layers)&&(v.pushLight(re),re.castShadow&&v.pushShadow(re))}),O!==de&&O.traverseVisible(function(re){re.isLight&&re.layers.test(ie.layers)&&(v.pushLight(re),re.castShadow&&v.pushShadow(re))}),v.setupLights();const le=new Set;return O.traverse(function(re){if(!(re.isMesh||re.isPoints||re.isLine||re.isSprite))return;const Ce=re.material;if(Ce)if(Array.isArray(Ce))for(let He=0;He<Ce.length;He++){const Qe=Ce[He];Rt(Qe,de,re),le.add(Qe)}else Rt(Ce,de,re),le.add(Ce)}),v=x.pop(),le},this.compileAsync=function(O,ie,de=null){const le=this.compile(O,ie,de);return new Promise(re=>{function Ce(){if(le.forEach(function(He){Ye.get(He).currentProgram.isReady()&&le.delete(He)}),le.size===0){re(O);return}setTimeout(Ce,10)}pt.get("KHR_parallel_shader_compile")!==null?Ce():setTimeout(Ce,10)})};let lr=null;function cr(O){lr&&lr(O)}function Xi(){$0.stop()}function m0(){$0.start()}const $0=new E7;$0.setAnimationLoop(cr),typeof self<"u"&&$0.setContext(self),this.setAnimationLoop=function(O){lr=O,ue.setAnimationLoop(O),O===null?$0.stop():$0.start()},ue.addEventListener("sessionstart",Xi),ue.addEventListener("sessionend",m0),this.render=function(O,ie){if(ie!==void 0&&ie.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(B===!0)return;if(O.matrixWorldAutoUpdate===!0&&O.updateMatrixWorld(),ie.parent===null&&ie.matrixWorldAutoUpdate===!0&&ie.updateMatrixWorld(),ue.enabled===!0&&ue.isPresenting===!0&&(ue.cameraAutoUpdate===!0&&ue.updateCamera(ie),ie=ue.getCamera()),O.isScene===!0&&O.onBeforeRender(w,O,ie,D),v=gt.get(O,x.length),v.init(ie),x.push(v),ge.multiplyMatrices(ie.projectionMatrix,ie.matrixWorldInverse),G.setFromProjectionMatrix(ge),pe=this.localClippingEnabled,oe=we.init(this.clippingPlanes,pe),_=Ve.get(O,C.length),_.init(),C.push(_),ue.enabled===!0&&ue.isPresenting===!0){const Ce=w.xr.getDepthSensingMesh();Ce!==null&&Tn(Ce,ie,-1/0,w.sortObjects)}Tn(O,ie,0,w.sortObjects),_.finish(),w.sortObjects===!0&&_.sort(te,W),ut=ue.enabled===!1||ue.isPresenting===!1||ue.hasDepthSensing()===!1,ut&&nt.addToRenderList(_,O),this.info.render.frame++,oe===!0&&we.beginShadows();const de=v.state.shadowsArray;Pe.render(de,O,ie),oe===!0&&we.endShadows(),this.info.autoReset===!0&&this.info.reset();const le=_.opaque,re=_.transmissive;if(v.setupLights(),ie.isArrayCamera){const Ce=ie.cameras;if(re.length>0)for(let He=0,Qe=Ce.length;He<Qe;He++){const Ze=Ce[He];Wa(le,re,O,Ze)}ut&&nt.render(O);for(let He=0,Qe=Ce.length;He<Qe;He++){const Ze=Ce[He];Ji(_,O,Ze,Ze.viewport)}}else re.length>0&&Wa(le,re,O,ie),ut&&nt.render(O),Ji(_,O,ie);D!==null&&S===0&&(Q.updateMultisampleRenderTarget(D),Q.updateRenderTargetMipmap(D)),O.isScene===!0&&O.onAfterRender(w,O,ie),ht.resetDefaultState(),R=-1,M=null,x.pop(),x.length>0?(v=x[x.length-1],oe===!0&&we.setGlobalState(w.clippingPlanes,v.state.camera)):v=null,C.pop(),C.length>0?_=C[C.length-1]:_=null};function Tn(O,ie,de,le){if(O.visible===!1)return;if(O.layers.test(ie.layers)){if(O.isGroup)de=O.renderOrder;else if(O.isLOD)O.autoUpdate===!0&&O.update(ie);else if(O.isLight)v.pushLight(O),O.castShadow&&v.pushShadow(O);else if(O.isSprite){if(!O.frustumCulled||G.intersectsSprite(O)){le&&Fe.setFromMatrixPosition(O.matrixWorld).applyMatrix4(ge);const Ce=_e.update(O),He=O.material;He.visible&&_.push(O,Ce,He,de,Fe.z,null)}}else if((O.isMesh||O.isLine||O.isPoints)&&(!O.frustumCulled||G.intersectsObject(O))){const Ce=_e.update(O),He=O.material;if(le&&(O.boundingSphere!==void 0?(O.boundingSphere===null&&O.computeBoundingSphere(),Fe.copy(O.boundingSphere.center)):(Ce.boundingSphere===null&&Ce.computeBoundingSphere(),Fe.copy(Ce.boundingSphere.center)),Fe.applyMatrix4(O.matrixWorld).applyMatrix4(ge)),Array.isArray(He)){const Qe=Ce.groups;for(let Ze=0,dt=Qe.length;Ze<dt;Ze++){const ct=Qe[Ze],rt=He[ct.materialIndex];rt&&rt.visible&&_.push(O,Ce,rt,de,Fe.z,ct)}}else He.visible&&_.push(O,Ce,He,de,Fe.z,null)}}const re=O.children;for(let Ce=0,He=re.length;Ce<He;Ce++)Tn(re[Ce],ie,de,le)}function Ji(O,ie,de,le){const re=O.opaque,Ce=O.transmissive,He=O.transparent;v.setupLightsView(de),oe===!0&&we.setGlobalState(w.clippingPlanes,de),le&&qe.viewport(L.copy(le)),re.length>0&&zs(re,ie,de),Ce.length>0&&zs(Ce,ie,de),He.length>0&&zs(He,ie,de),qe.buffers.depth.setTest(!0),qe.buffers.depth.setMask(!0),qe.buffers.color.setMask(!0),qe.setPolygonOffset(!1)}function Wa(O,ie,de,le){if((de.isScene===!0?de.overrideMaterial:null)!==null)return;v.state.transmissionRenderTarget[le.id]===void 0&&(v.state.transmissionRenderTarget[le.id]=new Nr(1,1,{generateMipmaps:!0,type:pt.has("EXT_color_buffer_half_float")||pt.has("EXT_color_buffer_float")?p0:w0,minFilter:Jr,samples:4,stencilBuffer:s,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:St.workingColorSpace}));const re=v.state.transmissionRenderTarget[le.id],Ce=le.viewport||L;re.setSize(Ce.z*w.transmissionResolutionScale,Ce.w*w.transmissionResolutionScale);const He=w.getRenderTarget();w.setRenderTarget(re),w.getClearColor(z),J=w.getClearAlpha(),J<1&&w.setClearColor(16777215,.5),w.clear(),ut&&nt.render(de);const Qe=w.toneMapping;w.toneMapping=cs;const Ze=le.viewport;if(le.viewport!==void 0&&(le.viewport=void 0),v.setupLightsView(le),oe===!0&&we.setGlobalState(w.clippingPlanes,le),zs(O,de,le),Q.updateMultisampleRenderTarget(re),Q.updateRenderTargetMipmap(re),pt.has("WEBGL_multisampled_render_to_texture")===!1){let dt=!1;for(let ct=0,rt=ie.length;ct<rt;ct++){const Dt=ie[ct],Et=Dt.object,E0=Dt.geometry,Ft=Dt.material,Wt=Dt.group;if(Ft.side===pn&&Et.layers.test(le.layers)){const tt=Ft.side;Ft.side=V0,Ft.needsUpdate=!0,Xc(Et,de,le,E0,Ft,Wt),Ft.side=tt,Ft.needsUpdate=!0,dt=!0}}dt===!0&&(Q.updateMultisampleRenderTarget(re),Q.updateRenderTargetMipmap(re))}w.setRenderTarget(He),w.setClearColor(z,J),Ze!==void 0&&(le.viewport=Ze),w.toneMapping=Qe}function zs(O,ie,de){const le=ie.isScene===!0?ie.overrideMaterial:null;for(let re=0,Ce=O.length;re<Ce;re++){const He=O[re],Qe=He.object,Ze=He.geometry,dt=le===null?He.material:le,ct=He.group;Qe.layers.test(de.layers)&&Xc(Qe,ie,de,Ze,dt,ct)}}function Xc(O,ie,de,le,re,Ce){O.onBeforeRender(w,ie,de,le,re,Ce),O.modelViewMatrix.multiplyMatrices(de.matrixWorldInverse,O.matrixWorld),O.normalMatrix.getNormalMatrix(O.modelViewMatrix),re.onBeforeRender(w,ie,de,le,O,Ce),re.transparent===!0&&re.side===pn&&re.forceSinglePass===!1?(re.side=V0,re.needsUpdate=!0,w.renderBufferDirect(de,ie,le,re,O,Ce),re.side=Un,re.needsUpdate=!0,w.renderBufferDirect(de,ie,le,re,O,Ce),re.side=pn):w.renderBufferDirect(de,ie,le,re,O,Ce),O.onAfterRender(w,ie,de,le,re,Ce)}function I1(O,ie,de){ie.isScene!==!0&&(ie=st);const le=Ye.get(O),re=v.state.lights,Ce=v.state.shadowsArray,He=re.state.version,Qe=Ge.getParameters(O,re.state,Ce,ie,de),Ze=Ge.getProgramCacheKey(Qe);let dt=le.programs;le.environment=O.isMeshStandardMaterial?ie.environment:null,le.fog=ie.fog,le.envMap=(O.isMeshStandardMaterial?se:k).get(O.envMap||le.environment),le.envMapRotation=le.environment!==null&&O.envMap===null?ie.environmentRotation:O.envMapRotation,dt===void 0&&(O.addEventListener("dispose",it),dt=new Map,le.programs=dt);let ct=dt.get(Ze);if(ct!==void 0){if(le.currentProgram===ct&&le.lightsStateVersion===He)return mi(O,Qe),ct}else Qe.uniforms=Ge.getUniforms(O),O.onBeforeCompile(Qe,w),ct=Ge.acquireProgram(Qe,Ze),dt.set(Ze,ct),le.uniforms=Qe.uniforms;const rt=le.uniforms;return(!O.isShaderMaterial&&!O.isRawShaderMaterial||O.clipping===!0)&&(rt.clippingPlanes=we.uniform),mi(O,Qe),le.needsLights=Zh(O),le.lightsStateVersion=He,le.needsLights&&(rt.ambientLightColor.value=re.state.ambient,rt.lightProbe.value=re.state.probe,rt.directionalLights.value=re.state.directional,rt.directionalLightShadows.value=re.state.directionalShadow,rt.spotLights.value=re.state.spot,rt.spotLightShadows.value=re.state.spotShadow,rt.rectAreaLights.value=re.state.rectArea,rt.ltc_1.value=re.state.rectAreaLTC1,rt.ltc_2.value=re.state.rectAreaLTC2,rt.pointLights.value=re.state.point,rt.pointLightShadows.value=re.state.pointShadow,rt.hemisphereLights.value=re.state.hemi,rt.directionalShadowMap.value=re.state.directionalShadowMap,rt.directionalShadowMatrix.value=re.state.directionalShadowMatrix,rt.spotShadowMap.value=re.state.spotShadowMap,rt.spotLightMatrix.value=re.state.spotLightMatrix,rt.spotLightMap.value=re.state.spotLightMap,rt.pointShadowMap.value=re.state.pointShadowMap,rt.pointShadowMatrix.value=re.state.pointShadowMatrix),le.currentProgram=ct,le.uniformsList=null,ct}function Jc(O){if(O.uniformsList===null){const ie=O.currentProgram.getUniforms();O.uniformsList=j9.seqWithValue(ie.seq,O.uniforms)}return O.uniformsList}function mi(O,ie){const de=Ye.get(O);de.outputColorSpace=ie.outputColorSpace,de.batching=ie.batching,de.batchingColor=ie.batchingColor,de.instancing=ie.instancing,de.instancingColor=ie.instancingColor,de.instancingMorph=ie.instancingMorph,de.skinning=ie.skinning,de.morphTargets=ie.morphTargets,de.morphNormals=ie.morphNormals,de.morphColors=ie.morphColors,de.morphTargetsCount=ie.morphTargetsCount,de.numClippingPlanes=ie.numClippingPlanes,de.numIntersection=ie.numClipIntersection,de.vertexAlphas=ie.vertexAlphas,de.vertexTangents=ie.vertexTangents,de.toneMapping=ie.toneMapping}function Kc(O,ie,de,le,re){ie.isScene!==!0&&(ie=st),Q.resetTextureUnits();const Ce=ie.fog,He=le.isMeshStandardMaterial?ie.environment:null,Qe=D===null?w.outputColorSpace:D.isXRRenderTarget===!0?D.texture.colorSpace:j0,Ze=(le.isMeshStandardMaterial?se:k).get(le.envMap||He),dt=le.vertexColors===!0&&!!de.attributes.color&&de.attributes.color.itemSize===4,ct=!!de.attributes.tangent&&(!!le.normalMap||le.anisotropy>0),rt=!!de.morphAttributes.position,Dt=!!de.morphAttributes.normal,Et=!!de.morphAttributes.color;let E0=cs;le.toneMapped&&(D===null||D.isXRRenderTarget===!0)&&(E0=w.toneMapping);const Ft=de.morphAttributes.position||de.morphAttributes.normal||de.morphAttributes.color,Wt=Ft!==void 0?Ft.length:0,tt=Ye.get(le),L0=v.state.lights;if(oe===!0&&(pe===!0||O!==M)){const z0=O===M&&le.id===R;we.setState(le,O,z0)}let cn=!1;le.version===tt.__version?(tt.needsLights&&tt.lightsStateVersion!==L0.state.version||tt.outputColorSpace!==Qe||re.isBatchedMesh&&tt.batching===!1||!re.isBatchedMesh&&tt.batching===!0||re.isBatchedMesh&&tt.batchingColor===!0&&re.colorTexture===null||re.isBatchedMesh&&tt.batchingColor===!1&&re.colorTexture!==null||re.isInstancedMesh&&tt.instancing===!1||!re.isInstancedMesh&&tt.instancing===!0||re.isSkinnedMesh&&tt.skinning===!1||!re.isSkinnedMesh&&tt.skinning===!0||re.isInstancedMesh&&tt.instancingColor===!0&&re.instanceColor===null||re.isInstancedMesh&&tt.instancingColor===!1&&re.instanceColor!==null||re.isInstancedMesh&&tt.instancingMorph===!0&&re.morphTexture===null||re.isInstancedMesh&&tt.instancingMorph===!1&&re.morphTexture!==null||tt.envMap!==Ze||le.fog===!0&&tt.fog!==Ce||tt.numClippingPlanes!==void 0&&(tt.numClippingPlanes!==we.numPlanes||tt.numIntersection!==we.numIntersection)||tt.vertexAlphas!==dt||tt.vertexTangents!==ct||tt.morphTargets!==rt||tt.morphNormals!==Dt||tt.morphColors!==Et||tt.toneMapping!==E0||tt.morphTargetsCount!==Wt)&&(cn=!0):(cn=!0,tt.__version=le.version);let vr=tt.currentProgram;cn===!0&&(vr=I1(le,ie,re));let Gs=!1,br=!1,Ki=!1;const Xt=vr.getUniforms(),_r=tt.uniforms;if(qe.useProgram(vr.program)&&(Gs=!0,br=!0,Ki=!0),le.id!==R&&(R=le.id,br=!0),Gs||M!==O){qe.buffers.depth.getReversed()?(Ae.copy(O.projectionMatrix),Rx(Ae),Dx(Ae),Xt.setValue(X,"projectionMatrix",Ae)):Xt.setValue(X,"projectionMatrix",O.projectionMatrix),Xt.setValue(X,"viewMatrix",O.matrixWorldInverse);const z0=Xt.map.cameraPosition;z0!==void 0&&z0.setValue(X,Re.setFromMatrixPosition(O.matrixWorld)),At.logarithmicDepthBuffer&&Xt.setValue(X,"logDepthBufFC",2/(Math.log(O.far+1)/Math.LN2)),(le.isMeshPhongMaterial||le.isMeshToonMaterial||le.isMeshLambertMaterial||le.isMeshBasicMaterial||le.isMeshStandardMaterial||le.isShaderMaterial)&&Xt.setValue(X,"isOrthographic",O.isOrthographicCamera===!0),M!==O&&(M=O,br=!0,Ki=!0)}if(re.isSkinnedMesh){Xt.setOptional(X,re,"bindMatrix"),Xt.setOptional(X,re,"bindMatrixInverse");const z0=re.skeleton;z0&&(z0.boneTexture===null&&z0.computeBoneTexture(),Xt.setValue(X,"boneTexture",z0.boneTexture,Q))}re.isBatchedMesh&&(Xt.setOptional(X,re,"batchingTexture"),Xt.setValue(X,"batchingTexture",re._matricesTexture,Q),Xt.setOptional(X,re,"batchingIdTexture"),Xt.setValue(X,"batchingIdTexture",re._indirectTexture,Q),Xt.setOptional(X,re,"batchingColorTexture"),re._colorsTexture!==null&&Xt.setValue(X,"batchingColorTexture",re._colorsTexture,Q));const er=de.morphAttributes;if((er.position!==void 0||er.normal!==void 0||er.color!==void 0)&&et.update(re,de,vr),(br||tt.receiveShadow!==re.receiveShadow)&&(tt.receiveShadow=re.receiveShadow,Xt.setValue(X,"receiveShadow",re.receiveShadow)),le.isMeshGouraudMaterial&&le.envMap!==null&&(_r.envMap.value=Ze,_r.flipEnvMap.value=Ze.isCubeTexture&&Ze.isRenderTargetTexture===!1?-1:1),le.isMeshStandardMaterial&&le.envMap===null&&ie.environment!==null&&(_r.envMapIntensity.value=ie.environmentIntensity),br&&(Xt.setValue(X,"toneMappingExposure",w.toneMappingExposure),tt.needsLights&&Zc(_r,Ki),Ce&&le.fog===!0&&Le.refreshFogUniforms(_r,Ce),Le.refreshMaterialUniforms(_r,le,j,ne,v.state.transmissionRenderTarget[O.id]),j9.upload(X,Jc(tt),_r,Q)),le.isShaderMaterial&&le.uniformsNeedUpdate===!0&&(j9.upload(X,Jc(tt),_r,Q),le.uniformsNeedUpdate=!1),le.isSpriteMaterial&&Xt.setValue(X,"center",re.center),Xt.setValue(X,"modelViewMatrix",re.modelViewMatrix),Xt.setValue(X,"normalMatrix",re.normalMatrix),Xt.setValue(X,"modelMatrix",re.matrixWorld),le.isShaderMaterial||le.isRawShaderMaterial){const z0=le.uniformsGroups;for(let Rr=0,Lt=z0.length;Rr<Lt;Rr++){const vi=z0[Rr];$.update(vi,vr),$.bind(vi,vr)}}return vr}function Zc(O,ie){O.ambientLightColor.needsUpdate=ie,O.lightProbe.needsUpdate=ie,O.directionalLights.needsUpdate=ie,O.directionalLightShadows.needsUpdate=ie,O.pointLights.needsUpdate=ie,O.pointLightShadows.needsUpdate=ie,O.spotLights.needsUpdate=ie,O.spotLightShadows.needsUpdate=ie,O.rectAreaLights.needsUpdate=ie,O.hemisphereLights.needsUpdate=ie}function Zh(O){return O.isMeshLambertMaterial||O.isMeshToonMaterial||O.isMeshPhongMaterial||O.isMeshStandardMaterial||O.isShadowMaterial||O.isShaderMaterial&&O.lights===!0}this.getActiveCubeFace=function(){return T},this.getActiveMipmapLevel=function(){return S},this.getRenderTarget=function(){return D},this.setRenderTargetTextures=function(O,ie,de){Ye.get(O.texture).__webglTexture=ie,Ye.get(O.depthTexture).__webglTexture=de;const le=Ye.get(O);le.__hasExternalTextures=!0,le.__autoAllocateDepthBuffer=de===void 0,le.__autoAllocateDepthBuffer||pt.has("WEBGL_multisampled_render_to_texture")===!0&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),le.__useRenderToTexture=!1)},this.setRenderTargetFramebuffer=function(O,ie){const de=Ye.get(O);de.__webglFramebuffer=ie,de.__useDefaultFramebuffer=ie===void 0};const $c=X.createFramebuffer();this.setRenderTarget=function(O,ie=0,de=0){D=O,T=ie,S=de;let le=!0,re=null,Ce=!1,He=!1;if(O){const Qe=Ye.get(O);if(Qe.__useDefaultFramebuffer!==void 0)qe.bindFramebuffer(X.FRAMEBUFFER,null),le=!1;else if(Qe.__webglFramebuffer===void 0)Q.setupRenderTarget(O);else if(Qe.__hasExternalTextures)Q.rebindTextures(O,Ye.get(O.texture).__webglTexture,Ye.get(O.depthTexture).__webglTexture);else if(O.depthBuffer){const ct=O.depthTexture;if(Qe.__boundDepthTexture!==ct){if(ct!==null&&Ye.has(ct)&&(O.width!==ct.image.width||O.height!==ct.image.height))throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");Q.setupDepthRenderbuffer(O)}}const Ze=O.texture;(Ze.isData3DTexture||Ze.isDataArrayTexture||Ze.isCompressedArrayTexture)&&(He=!0);const dt=Ye.get(O).__webglFramebuffer;O.isWebGLCubeRenderTarget?(Array.isArray(dt[ie])?re=dt[ie][de]:re=dt[ie],Ce=!0):O.samples>0&&Q.useMultisampledRTT(O)===!1?re=Ye.get(O).__webglMultisampledFramebuffer:Array.isArray(dt)?re=dt[de]:re=dt,L.copy(O.viewport),P.copy(O.scissor),F=O.scissorTest}else L.copy(U).multiplyScalar(j).floor(),P.copy(H).multiplyScalar(j).floor(),F=Z;if(de!==0&&(re=$c),qe.bindFramebuffer(X.FRAMEBUFFER,re)&&le&&qe.drawBuffers(O,re),qe.viewport(L),qe.scissor(P),qe.setScissorTest(F),Ce){const Qe=Ye.get(O.texture);X.framebufferTexture2D(X.FRAMEBUFFER,X.COLOR_ATTACHMENT0,X.TEXTURE_CUBE_MAP_POSITIVE_X+ie,Qe.__webglTexture,de)}else if(He){const Qe=Ye.get(O.texture),Ze=ie;X.framebufferTextureLayer(X.FRAMEBUFFER,X.COLOR_ATTACHMENT0,Qe.__webglTexture,de,Ze)}else if(O!==null&&de!==0){const Qe=Ye.get(O.texture);X.framebufferTexture2D(X.FRAMEBUFFER,X.COLOR_ATTACHMENT0,X.TEXTURE_2D,Qe.__webglTexture,de)}R=-1},this.readRenderTargetPixels=function(O,ie,de,le,re,Ce,He){if(!(O&&O.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let Qe=Ye.get(O).__webglFramebuffer;if(O.isWebGLCubeRenderTarget&&He!==void 0&&(Qe=Qe[He]),Qe){qe.bindFramebuffer(X.FRAMEBUFFER,Qe);try{const Ze=O.texture,dt=Ze.format,ct=Ze.type;if(!At.textureFormatReadable(dt)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!At.textureTypeReadable(ct)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}ie>=0&&ie<=O.width-le&&de>=0&&de<=O.height-re&&X.readPixels(ie,de,le,re,ke.convert(dt),ke.convert(ct),Ce)}finally{const Ze=D!==null?Ye.get(D).__webglFramebuffer:null;qe.bindFramebuffer(X.FRAMEBUFFER,Ze)}}},this.readRenderTargetPixelsAsync=async function(O,ie,de,le,re,Ce,He){if(!(O&&O.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let Qe=Ye.get(O).__webglFramebuffer;if(O.isWebGLCubeRenderTarget&&He!==void 0&&(Qe=Qe[He]),Qe){const Ze=O.texture,dt=Ze.format,ct=Ze.type;if(!At.textureFormatReadable(dt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!At.textureTypeReadable(ct))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");if(ie>=0&&ie<=O.width-le&&de>=0&&de<=O.height-re){qe.bindFramebuffer(X.FRAMEBUFFER,Qe);const rt=X.createBuffer();X.bindBuffer(X.PIXEL_PACK_BUFFER,rt),X.bufferData(X.PIXEL_PACK_BUFFER,Ce.byteLength,X.STREAM_READ),X.readPixels(ie,de,le,re,ke.convert(dt),ke.convert(ct),0);const Dt=D!==null?Ye.get(D).__webglFramebuffer:null;qe.bindFramebuffer(X.FRAMEBUFFER,Dt);const Et=X.fenceSync(X.SYNC_GPU_COMMANDS_COMPLETE,0);return X.flush(),await bx(X,Et,4),X.bindBuffer(X.PIXEL_PACK_BUFFER,rt),X.getBufferSubData(X.PIXEL_PACK_BUFFER,0,Ce),X.deleteBuffer(rt),X.deleteSync(Et),Ce}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")}},this.copyFramebufferToTexture=function(O,ie=null,de=0){O.isTexture!==!0&&(da("WebGLRenderer: copyFramebufferToTexture function signature has changed."),ie=arguments[0]||null,O=arguments[1]);const le=Math.pow(2,-de),re=Math.floor(O.image.width*le),Ce=Math.floor(O.image.height*le),He=ie!==null?ie.x:0,Qe=ie!==null?ie.y:0;Q.setTexture2D(O,0),X.copyTexSubImage2D(X.TEXTURE_2D,de,0,0,He,Qe,re,Ce),qe.unbindTexture()};const eu=X.createFramebuffer(),tu=X.createFramebuffer();this.copyTextureToTexture=function(O,ie,de=null,le=null,re=0,Ce=null){O.isTexture!==!0&&(da("WebGLRenderer: copyTextureToTexture function signature has changed."),le=arguments[0]||null,O=arguments[1],ie=arguments[2],Ce=arguments[3]||0,de=null),Ce===null&&(re!==0?(da("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),Ce=re,re=0):Ce=0);let He,Qe,Ze,dt,ct,rt,Dt,Et,E0;const Ft=O.isCompressedTexture?O.mipmaps[Ce]:O.image;if(de!==null)He=de.max.x-de.min.x,Qe=de.max.y-de.min.y,Ze=de.isBox3?de.max.z-de.min.z:1,dt=de.min.x,ct=de.min.y,rt=de.isBox3?de.min.z:0;else{const er=Math.pow(2,-re);He=Math.floor(Ft.width*er),Qe=Math.floor(Ft.height*er),O.isDataArrayTexture?Ze=Ft.depth:O.isData3DTexture?Ze=Math.floor(Ft.depth*er):Ze=1,dt=0,ct=0,rt=0}le!==null?(Dt=le.x,Et=le.y,E0=le.z):(Dt=0,Et=0,E0=0);const Wt=ke.convert(ie.format),tt=ke.convert(ie.type);let L0;ie.isData3DTexture?(Q.setTexture3D(ie,0),L0=X.TEXTURE_3D):ie.isDataArrayTexture||ie.isCompressedArrayTexture?(Q.setTexture2DArray(ie,0),L0=X.TEXTURE_2D_ARRAY):(Q.setTexture2D(ie,0),L0=X.TEXTURE_2D),X.pixelStorei(X.UNPACK_FLIP_Y_WEBGL,ie.flipY),X.pixelStorei(X.UNPACK_PREMULTIPLY_ALPHA_WEBGL,ie.premultiplyAlpha),X.pixelStorei(X.UNPACK_ALIGNMENT,ie.unpackAlignment);const cn=X.getParameter(X.UNPACK_ROW_LENGTH),vr=X.getParameter(X.UNPACK_IMAGE_HEIGHT),Gs=X.getParameter(X.UNPACK_SKIP_PIXELS),br=X.getParameter(X.UNPACK_SKIP_ROWS),Ki=X.getParameter(X.UNPACK_SKIP_IMAGES);X.pixelStorei(X.UNPACK_ROW_LENGTH,Ft.width),X.pixelStorei(X.UNPACK_IMAGE_HEIGHT,Ft.height),X.pixelStorei(X.UNPACK_SKIP_PIXELS,dt),X.pixelStorei(X.UNPACK_SKIP_ROWS,ct),X.pixelStorei(X.UNPACK_SKIP_IMAGES,rt);const Xt=O.isDataArrayTexture||O.isData3DTexture,_r=ie.isDataArrayTexture||ie.isData3DTexture;if(O.isDepthTexture){const er=Ye.get(O),z0=Ye.get(ie),Rr=Ye.get(er.__renderTarget),Lt=Ye.get(z0.__renderTarget);qe.bindFramebuffer(X.READ_FRAMEBUFFER,Rr.__webglFramebuffer),qe.bindFramebuffer(X.DRAW_FRAMEBUFFER,Lt.__webglFramebuffer);for(let vi=0;vi<Ze;vi++)Xt&&(X.framebufferTextureLayer(X.READ_FRAMEBUFFER,X.COLOR_ATTACHMENT0,Ye.get(O).__webglTexture,re,rt+vi),X.framebufferTextureLayer(X.DRAW_FRAMEBUFFER,X.COLOR_ATTACHMENT0,Ye.get(ie).__webglTexture,Ce,E0+vi)),X.blitFramebuffer(dt,ct,He,Qe,Dt,Et,He,Qe,X.DEPTH_BUFFER_BIT,X.NEAREST);qe.bindFramebuffer(X.READ_FRAMEBUFFER,null),qe.bindFramebuffer(X.DRAW_FRAMEBUFFER,null)}else if(re!==0||O.isRenderTargetTexture||Ye.has(O)){const er=Ye.get(O),z0=Ye.get(ie);qe.bindFramebuffer(X.READ_FRAMEBUFFER,eu),qe.bindFramebuffer(X.DRAW_FRAMEBUFFER,tu);for(let Rr=0;Rr<Ze;Rr++)Xt?X.framebufferTextureLayer(X.READ_FRAMEBUFFER,X.COLOR_ATTACHMENT0,er.__webglTexture,re,rt+Rr):X.framebufferTexture2D(X.READ_FRAMEBUFFER,X.COLOR_ATTACHMENT0,X.TEXTURE_2D,er.__webglTexture,re),_r?X.framebufferTextureLayer(X.DRAW_FRAMEBUFFER,X.COLOR_ATTACHMENT0,z0.__webglTexture,Ce,E0+Rr):X.framebufferTexture2D(X.DRAW_FRAMEBUFFER,X.COLOR_ATTACHMENT0,X.TEXTURE_2D,z0.__webglTexture,Ce),re!==0?X.blitFramebuffer(dt,ct,He,Qe,Dt,Et,He,Qe,X.COLOR_BUFFER_BIT,X.NEAREST):_r?X.copyTexSubImage3D(L0,Ce,Dt,Et,E0+Rr,dt,ct,He,Qe):X.copyTexSubImage2D(L0,Ce,Dt,Et,dt,ct,He,Qe);qe.bindFramebuffer(X.READ_FRAMEBUFFER,null),qe.bindFramebuffer(X.DRAW_FRAMEBUFFER,null)}else _r?O.isDataTexture||O.isData3DTexture?X.texSubImage3D(L0,Ce,Dt,Et,E0,He,Qe,Ze,Wt,tt,Ft.data):ie.isCompressedArrayTexture?X.compressedTexSubImage3D(L0,Ce,Dt,Et,E0,He,Qe,Ze,Wt,Ft.data):X.texSubImage3D(L0,Ce,Dt,Et,E0,He,Qe,Ze,Wt,tt,Ft):O.isDataTexture?X.texSubImage2D(X.TEXTURE_2D,Ce,Dt,Et,He,Qe,Wt,tt,Ft.data):O.isCompressedTexture?X.compressedTexSubImage2D(X.TEXTURE_2D,Ce,Dt,Et,Ft.width,Ft.height,Wt,Ft.data):X.texSubImage2D(X.TEXTURE_2D,Ce,Dt,Et,He,Qe,Wt,tt,Ft);X.pixelStorei(X.UNPACK_ROW_LENGTH,cn),X.pixelStorei(X.UNPACK_IMAGE_HEIGHT,vr),X.pixelStorei(X.UNPACK_SKIP_PIXELS,Gs),X.pixelStorei(X.UNPACK_SKIP_ROWS,br),X.pixelStorei(X.UNPACK_SKIP_IMAGES,Ki),Ce===0&&ie.generateMipmaps&&X.generateMipmap(L0),qe.unbindTexture()},this.copyTextureToTexture3D=function(O,ie,de=null,le=null,re=0){return O.isTexture!==!0&&(da("WebGLRenderer: copyTextureToTexture3D function signature has changed."),de=arguments[0]||null,le=arguments[1]||null,O=arguments[2],ie=arguments[3],re=arguments[4]||0),da('WebGLRenderer: copyTextureToTexture3D function has been deprecated. Use "copyTextureToTexture" instead.'),this.copyTextureToTexture(O,ie,de,le,re)},this.initRenderTarget=function(O){Ye.get(O).__webglFramebuffer===void 0&&Q.setupRenderTarget(O)},this.initTexture=function(O){O.isCubeTexture?Q.setTextureCube(O,0):O.isData3DTexture?Q.setTexture3D(O,0):O.isDataArrayTexture||O.isCompressedArrayTexture?Q.setTexture2DArray(O,0):Q.setTexture2D(O,0),qe.unbindTexture()},this.resetState=function(){T=0,S=0,D=null,qe.reset(),ht.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Si}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorspace=St._getDrawingBufferColorSpace(e),t.unpackColorSpace=St._getUnpackColorSpace()}}const J7={name:"CopyShader",uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:`
3845
+ }`;class RT{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,n){if(this.texture===null){const i=new U0,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}}getMesh(e){if(this.texture!==null&&this.mesh===null){const t=e.cameras[0].viewport,n=new B0({vertexShader:BT,fragmentShader:bT,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new T0(new _l(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class DT extends ha{constructor(e,t){super();const n=this;let i=null,s=1,o=null,l="local-floor",h=1,u=null,d=null,A=null,p=null,g=null,m=null;const E=new RT,_=t.getContextAttributes();let v=null,C=null;const x=[],w=[],B=new ze;let T=null;const S=new pr;S.viewport=new Ut;const D=new pr;D.viewport=new Ut;const R=[S,D],M=new zw;let L=null,P=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(G){let oe=x[G];return oe===void 0&&(oe=new u4,x[G]=oe),oe.getTargetRaySpace()},this.getControllerGrip=function(G){let oe=x[G];return oe===void 0&&(oe=new u4,x[G]=oe),oe.getGripSpace()},this.getHand=function(G){let oe=x[G];return oe===void 0&&(oe=new u4,x[G]=oe),oe.getHandSpace()};function F(G){const oe=w.indexOf(G.inputSource);if(oe===-1)return;const pe=x[oe];pe!==void 0&&(pe.update(G.inputSource,G.frame,u||o),pe.dispatchEvent({type:G.type,data:G.inputSource}))}function z(){i.removeEventListener("select",F),i.removeEventListener("selectstart",F),i.removeEventListener("selectend",F),i.removeEventListener("squeeze",F),i.removeEventListener("squeezestart",F),i.removeEventListener("squeezeend",F),i.removeEventListener("end",z),i.removeEventListener("inputsourceschange",J);for(let G=0;G<x.length;G++){const oe=w[G];oe!==null&&(w[G]=null,x[G].disconnect(oe))}L=null,P=null,E.reset(),e.setRenderTarget(v),g=null,p=null,A=null,i=null,C=null,Z.stop(),n.isPresenting=!1,e.setPixelRatio(T),e.setSize(B.width,B.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){l=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 m},this.getSession=function(){return i},this.setSession=async function(G){if(i=G,i!==null){if(v=e.getRenderTarget(),i.addEventListener("select",F),i.addEventListener("selectstart",F),i.addEventListener("selectend",F),i.addEventListener("squeeze",F),i.addEventListener("squeezestart",F),i.addEventListener("squeezeend",F),i.addEventListener("end",z),i.addEventListener("inputsourceschange",J),_.xrCompatible!==!0&&await t.makeXRCompatible(),T=e.getPixelRatio(),e.getSize(B),typeof XRWebGLBinding<"u"&&"createProjectionLayer"in XRWebGLBinding.prototype){let oe=null,pe=null,Ae=null;_.depth&&(Ae=_.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,oe=_.stencil?go:Ao,pe=_.stencil?po:An);const ge={colorFormat:t.RGBA8,depthFormat:Ae,scaleFactor:s};A=new XRWebGLBinding(i,t),p=A.createProjectionLayer(ge),i.updateRenderState({layers:[p]}),e.setPixelRatio(1),e.setSize(p.textureWidth,p.textureHeight,!1),C=new Nr(p.textureWidth,p.textureHeight,{format:Kt,type:w0,depthTexture:new i7(p.textureWidth,p.textureHeight,pe,void 0,void 0,void 0,void 0,void 0,void 0,oe),stencilBuffer:_.stencil,colorSpace:e.outputColorSpace,samples:_.antialias?4:0,resolveDepthBuffer:p.ignoreDepthValues===!1,resolveStencilBuffer:p.ignoreDepthValues===!1})}else{const oe={antialias:_.antialias,alpha:!0,depth:_.depth,stencil:_.stencil,framebufferScaleFactor:s};g=new XRWebGLLayer(i,t,oe),i.updateRenderState({baseLayer:g}),e.setPixelRatio(1),e.setSize(g.framebufferWidth,g.framebufferHeight,!1),C=new Nr(g.framebufferWidth,g.framebufferHeight,{format:Kt,type:w0,colorSpace:e.outputColorSpace,stencilBuffer:_.stencil,resolveDepthBuffer:g.ignoreDepthValues===!1,resolveStencilBuffer:g.ignoreDepthValues===!1})}C.isXRRenderTarget=!0,this.setFoveation(h),u=null,o=await i.requestReferenceSpace(l),Z.setContext(i),Z.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(i!==null)return i.environmentBlendMode},this.getDepthTexture=function(){return E.getDepthTexture()};function J(G){for(let oe=0;oe<G.removed.length;oe++){const pe=G.removed[oe],Ae=w.indexOf(pe);Ae>=0&&(w[Ae]=null,x[Ae].disconnect(pe))}for(let oe=0;oe<G.added.length;oe++){const pe=G.added[oe];let Ae=w.indexOf(pe);if(Ae===-1){for(let Re=0;Re<x.length;Re++)if(Re>=w.length){w.push(pe),Ae=Re;break}else if(w[Re]===null){w[Re]=pe,Ae=Re;break}if(Ae===-1)break}const ge=x[Ae];ge&&ge.connect(pe)}}const q=new V,ne=new V;function j(G,oe,pe){q.setFromMatrixPosition(oe.matrixWorld),ne.setFromMatrixPosition(pe.matrixWorld);const Ae=q.distanceTo(ne),ge=oe.projectionMatrix.elements,Re=pe.projectionMatrix.elements,Oe=ge[14]/(ge[10]-1),st=ge[14]/(ge[10]+1),ut=(ge[9]+1)/ge[5],mt=(ge[9]-1)/ge[5],X=(ge[8]-1)/ge[0],h0=(Re[8]+1)/Re[0],pt=Oe*X,At=Oe*h0,qe=Ae/(-X+h0),Mt=qe*-X;if(oe.matrixWorld.decompose(G.position,G.quaternion,G.scale),G.translateX(Mt),G.translateZ(qe),G.matrixWorld.compose(G.position,G.quaternion,G.scale),G.matrixWorldInverse.copy(G.matrixWorld).invert(),ge[10]===-1)G.projectionMatrix.copy(oe.projectionMatrix),G.projectionMatrixInverse.copy(oe.projectionMatrixInverse);else{const Ye=Oe+qe,Q=st+qe,k=pt-Mt,se=At+(Ae-Mt),ye=ut*st/Q*Ye,Ee=mt*st/Q*Ye;G.projectionMatrix.makePerspective(k,se,ye,Ee,Ye,Q),G.projectionMatrixInverse.copy(G.projectionMatrix).invert()}}function te(G,oe){oe===null?G.matrixWorld.copy(G.matrix):G.matrixWorld.multiplyMatrices(oe.matrixWorld,G.matrix),G.matrixWorldInverse.copy(G.matrixWorld).invert()}this.updateCamera=function(G){if(i===null)return;let oe=G.near,pe=G.far;E.texture!==null&&(E.depthNear>0&&(oe=E.depthNear),E.depthFar>0&&(pe=E.depthFar)),M.near=D.near=S.near=oe,M.far=D.far=S.far=pe,(L!==M.near||P!==M.far)&&(i.updateRenderState({depthNear:M.near,depthFar:M.far}),L=M.near,P=M.far),S.layers.mask=G.layers.mask|2,D.layers.mask=G.layers.mask|4,M.layers.mask=S.layers.mask|D.layers.mask;const Ae=G.parent,ge=M.cameras;te(M,Ae);for(let Re=0;Re<ge.length;Re++)te(ge[Re],Ae);ge.length===2?j(M,S,D):M.projectionMatrix.copy(S.projectionMatrix),W(G,M,Ae)};function W(G,oe,pe){pe===null?G.matrix.copy(oe.matrixWorld):(G.matrix.copy(pe.matrixWorld),G.matrix.invert(),G.matrix.multiply(oe.matrixWorld)),G.matrix.decompose(G.position,G.quaternion,G.scale),G.updateMatrixWorld(!0),G.projectionMatrix.copy(oe.projectionMatrix),G.projectionMatrixInverse.copy(oe.projectionMatrixInverse),G.isPerspectiveCamera&&(G.fov=_o*2*Math.atan(1/G.projectionMatrix.elements[5]),G.zoom=1)}this.getCamera=function(){return M},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},this.getDepthSensingMesh=function(){return E.getMesh(M)};let U=null;function H(G,oe){if(d=oe.getViewerPose(u||o),m=oe,d!==null){const pe=d.views;g!==null&&(e.setRenderTargetFramebuffer(C,g.framebuffer),e.setRenderTarget(C));let Ae=!1;pe.length!==M.cameras.length&&(M.cameras.length=0,Ae=!0);for(let Re=0;Re<pe.length;Re++){const Oe=pe[Re];let st=null;if(g!==null)st=g.getViewport(Oe);else{const mt=A.getViewSubImage(p,Oe);st=mt.viewport,Re===0&&(e.setRenderTargetTextures(C,mt.colorTexture,p.ignoreDepthValues?void 0:mt.depthStencilTexture),e.setRenderTarget(C))}let ut=R[Re];ut===void 0&&(ut=new pr,ut.layers.enable(Re),ut.viewport=new Ut,R[Re]=ut),ut.matrix.fromArray(Oe.transform.matrix),ut.matrix.decompose(ut.position,ut.quaternion,ut.scale),ut.projectionMatrix.fromArray(Oe.projectionMatrix),ut.projectionMatrixInverse.copy(ut.projectionMatrix).invert(),ut.viewport.set(st.x,st.y,st.width,st.height),Re===0&&(M.matrix.copy(ut.matrix),M.matrix.decompose(M.position,M.quaternion,M.scale)),Ae===!0&&M.cameras.push(ut)}const ge=i.enabledFeatures;if(ge&&ge.includes("depth-sensing")&&i.depthUsage=="gpu-optimized"&&A){const Re=A.getDepthInformation(pe[0]);Re&&Re.isValid&&Re.texture&&E.init(e,Re,i.renderState)}}for(let pe=0;pe<x.length;pe++){const Ae=w[pe],ge=x[pe];Ae!==null&&ge!==void 0&&ge.update(Ae,oe,u||o)}U&&U(G,oe),oe.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:oe}),m=null}const Z=new E7;Z.setAnimationLoop(H),this.setAnimationLoop=function(G){U=G},this.dispose=function(){}}}const Ea=new ni,LT=new lt;function NT(r,e){function t(_,v){_.matrixAutoUpdate===!0&&_.updateMatrix(),v.value.copy(_.matrix)}function n(_,v){v.color.getRGB(_.fogColor.value,Ud(r)),v.isFog?(_.fogNear.value=v.near,_.fogFar.value=v.far):v.isFogExp2&&(_.fogDensity.value=v.density)}function i(_,v,C,x,w){v.isMeshBasicMaterial||v.isMeshLambertMaterial?s(_,v):v.isMeshToonMaterial?(s(_,v),A(_,v)):v.isMeshPhongMaterial?(s(_,v),d(_,v)):v.isMeshStandardMaterial?(s(_,v),p(_,v),v.isMeshPhysicalMaterial&&g(_,v,w)):v.isMeshMatcapMaterial?(s(_,v),m(_,v)):v.isMeshDepthMaterial?s(_,v):v.isMeshDistanceMaterial?(s(_,v),E(_,v)):v.isMeshNormalMaterial?s(_,v):v.isLineBasicMaterial?(o(_,v),v.isLineDashedMaterial&&l(_,v)):v.isPointsMaterial?h(_,v,C,x):v.isSpriteMaterial?u(_,v):v.isShadowMaterial?(_.color.value.copy(v.color),_.opacity.value=v.opacity):v.isShaderMaterial&&(v.uniformsNeedUpdate=!1)}function s(_,v){_.opacity.value=v.opacity,v.color&&_.diffuse.value.copy(v.color),v.emissive&&_.emissive.value.copy(v.emissive).multiplyScalar(v.emissiveIntensity),v.map&&(_.map.value=v.map,t(v.map,_.mapTransform)),v.alphaMap&&(_.alphaMap.value=v.alphaMap,t(v.alphaMap,_.alphaMapTransform)),v.bumpMap&&(_.bumpMap.value=v.bumpMap,t(v.bumpMap,_.bumpMapTransform),_.bumpScale.value=v.bumpScale,v.side===V0&&(_.bumpScale.value*=-1)),v.normalMap&&(_.normalMap.value=v.normalMap,t(v.normalMap,_.normalMapTransform),_.normalScale.value.copy(v.normalScale),v.side===V0&&_.normalScale.value.negate()),v.displacementMap&&(_.displacementMap.value=v.displacementMap,t(v.displacementMap,_.displacementMapTransform),_.displacementScale.value=v.displacementScale,_.displacementBias.value=v.displacementBias),v.emissiveMap&&(_.emissiveMap.value=v.emissiveMap,t(v.emissiveMap,_.emissiveMapTransform)),v.specularMap&&(_.specularMap.value=v.specularMap,t(v.specularMap,_.specularMapTransform)),v.alphaTest>0&&(_.alphaTest.value=v.alphaTest);const C=e.get(v),x=C.envMap,w=C.envMapRotation;x&&(_.envMap.value=x,Ea.copy(w),Ea.x*=-1,Ea.y*=-1,Ea.z*=-1,x.isCubeTexture&&x.isRenderTargetTexture===!1&&(Ea.y*=-1,Ea.z*=-1),_.envMapRotation.value.setFromMatrix4(LT.makeRotationFromEuler(Ea)),_.flipEnvMap.value=x.isCubeTexture&&x.isRenderTargetTexture===!1?-1:1,_.reflectivity.value=v.reflectivity,_.ior.value=v.ior,_.refractionRatio.value=v.refractionRatio),v.lightMap&&(_.lightMap.value=v.lightMap,_.lightMapIntensity.value=v.lightMapIntensity,t(v.lightMap,_.lightMapTransform)),v.aoMap&&(_.aoMap.value=v.aoMap,_.aoMapIntensity.value=v.aoMapIntensity,t(v.aoMap,_.aoMapTransform))}function o(_,v){_.diffuse.value.copy(v.color),_.opacity.value=v.opacity,v.map&&(_.map.value=v.map,t(v.map,_.mapTransform))}function l(_,v){_.dashSize.value=v.dashSize,_.totalSize.value=v.dashSize+v.gapSize,_.scale.value=v.scale}function h(_,v,C,x){_.diffuse.value.copy(v.color),_.opacity.value=v.opacity,_.size.value=v.size*C,_.scale.value=x*.5,v.map&&(_.map.value=v.map,t(v.map,_.uvTransform)),v.alphaMap&&(_.alphaMap.value=v.alphaMap,t(v.alphaMap,_.alphaMapTransform)),v.alphaTest>0&&(_.alphaTest.value=v.alphaTest)}function u(_,v){_.diffuse.value.copy(v.color),_.opacity.value=v.opacity,_.rotation.value=v.rotation,v.map&&(_.map.value=v.map,t(v.map,_.mapTransform)),v.alphaMap&&(_.alphaMap.value=v.alphaMap,t(v.alphaMap,_.alphaMapTransform)),v.alphaTest>0&&(_.alphaTest.value=v.alphaTest)}function d(_,v){_.specular.value.copy(v.specular),_.shininess.value=Math.max(v.shininess,1e-4)}function A(_,v){v.gradientMap&&(_.gradientMap.value=v.gradientMap)}function p(_,v){_.metalness.value=v.metalness,v.metalnessMap&&(_.metalnessMap.value=v.metalnessMap,t(v.metalnessMap,_.metalnessMapTransform)),_.roughness.value=v.roughness,v.roughnessMap&&(_.roughnessMap.value=v.roughnessMap,t(v.roughnessMap,_.roughnessMapTransform)),v.envMap&&(_.envMapIntensity.value=v.envMapIntensity)}function g(_,v,C){_.ior.value=v.ior,v.sheen>0&&(_.sheenColor.value.copy(v.sheenColor).multiplyScalar(v.sheen),_.sheenRoughness.value=v.sheenRoughness,v.sheenColorMap&&(_.sheenColorMap.value=v.sheenColorMap,t(v.sheenColorMap,_.sheenColorMapTransform)),v.sheenRoughnessMap&&(_.sheenRoughnessMap.value=v.sheenRoughnessMap,t(v.sheenRoughnessMap,_.sheenRoughnessMapTransform))),v.clearcoat>0&&(_.clearcoat.value=v.clearcoat,_.clearcoatRoughness.value=v.clearcoatRoughness,v.clearcoatMap&&(_.clearcoatMap.value=v.clearcoatMap,t(v.clearcoatMap,_.clearcoatMapTransform)),v.clearcoatRoughnessMap&&(_.clearcoatRoughnessMap.value=v.clearcoatRoughnessMap,t(v.clearcoatRoughnessMap,_.clearcoatRoughnessMapTransform)),v.clearcoatNormalMap&&(_.clearcoatNormalMap.value=v.clearcoatNormalMap,t(v.clearcoatNormalMap,_.clearcoatNormalMapTransform),_.clearcoatNormalScale.value.copy(v.clearcoatNormalScale),v.side===V0&&_.clearcoatNormalScale.value.negate())),v.dispersion>0&&(_.dispersion.value=v.dispersion),v.iridescence>0&&(_.iridescence.value=v.iridescence,_.iridescenceIOR.value=v.iridescenceIOR,_.iridescenceThicknessMinimum.value=v.iridescenceThicknessRange[0],_.iridescenceThicknessMaximum.value=v.iridescenceThicknessRange[1],v.iridescenceMap&&(_.iridescenceMap.value=v.iridescenceMap,t(v.iridescenceMap,_.iridescenceMapTransform)),v.iridescenceThicknessMap&&(_.iridescenceThicknessMap.value=v.iridescenceThicknessMap,t(v.iridescenceThicknessMap,_.iridescenceThicknessMapTransform))),v.transmission>0&&(_.transmission.value=v.transmission,_.transmissionSamplerMap.value=C.texture,_.transmissionSamplerSize.value.set(C.width,C.height),v.transmissionMap&&(_.transmissionMap.value=v.transmissionMap,t(v.transmissionMap,_.transmissionMapTransform)),_.thickness.value=v.thickness,v.thicknessMap&&(_.thicknessMap.value=v.thicknessMap,t(v.thicknessMap,_.thicknessMapTransform)),_.attenuationDistance.value=v.attenuationDistance,_.attenuationColor.value.copy(v.attenuationColor)),v.anisotropy>0&&(_.anisotropyVector.value.set(v.anisotropy*Math.cos(v.anisotropyRotation),v.anisotropy*Math.sin(v.anisotropyRotation)),v.anisotropyMap&&(_.anisotropyMap.value=v.anisotropyMap,t(v.anisotropyMap,_.anisotropyMapTransform))),_.specularIntensity.value=v.specularIntensity,_.specularColor.value.copy(v.specularColor),v.specularColorMap&&(_.specularColorMap.value=v.specularColorMap,t(v.specularColorMap,_.specularColorMapTransform)),v.specularIntensityMap&&(_.specularIntensityMap.value=v.specularIntensityMap,t(v.specularIntensityMap,_.specularIntensityMapTransform))}function m(_,v){v.matcap&&(_.matcap.value=v.matcap)}function E(_,v){const C=e.get(v).light;_.referencePosition.value.setFromMatrixPosition(C.matrixWorld),_.nearDistance.value=C.shadow.camera.near,_.farDistance.value=C.shadow.camera.far}return{refreshFogUniforms:n,refreshMaterialUniforms:i}}function PT(r,e,t,n){let i={},s={},o=[];const l=r.getParameter(r.MAX_UNIFORM_BUFFER_BINDINGS);function h(C,x){const w=x.program;n.uniformBlockBinding(C,w)}function u(C,x){let w=i[C.id];w===void 0&&(m(C),w=d(C),i[C.id]=w,C.addEventListener("dispose",_));const B=x.program;n.updateUBOMapping(C,B);const T=e.render.frame;s[C.id]!==T&&(p(C),s[C.id]=T)}function d(C){const x=A();C.__bindingPointIndex=x;const w=r.createBuffer(),B=C.__size,T=C.usage;return r.bindBuffer(r.UNIFORM_BUFFER,w),r.bufferData(r.UNIFORM_BUFFER,B,T),r.bindBuffer(r.UNIFORM_BUFFER,null),r.bindBufferBase(r.UNIFORM_BUFFER,x,w),w}function A(){for(let C=0;C<l;C++)if(o.indexOf(C)===-1)return o.push(C),C;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function p(C){const x=i[C.id],w=C.uniforms,B=C.__cache;r.bindBuffer(r.UNIFORM_BUFFER,x);for(let T=0,S=w.length;T<S;T++){const D=Array.isArray(w[T])?w[T]:[w[T]];for(let R=0,M=D.length;R<M;R++){const L=D[R];if(g(L,T,R,B)===!0){const P=L.__offset,F=Array.isArray(L.value)?L.value:[L.value];let z=0;for(let J=0;J<F.length;J++){const q=F[J],ne=E(q);typeof q=="number"||typeof q=="boolean"?(L.__data[0]=q,r.bufferSubData(r.UNIFORM_BUFFER,P+z,L.__data)):q.isMatrix3?(L.__data[0]=q.elements[0],L.__data[1]=q.elements[1],L.__data[2]=q.elements[2],L.__data[3]=0,L.__data[4]=q.elements[3],L.__data[5]=q.elements[4],L.__data[6]=q.elements[5],L.__data[7]=0,L.__data[8]=q.elements[6],L.__data[9]=q.elements[7],L.__data[10]=q.elements[8],L.__data[11]=0):(q.toArray(L.__data,z),z+=ne.storage/Float32Array.BYTES_PER_ELEMENT)}r.bufferSubData(r.UNIFORM_BUFFER,P,L.__data)}}}r.bindBuffer(r.UNIFORM_BUFFER,null)}function g(C,x,w,B){const T=C.value,S=x+"_"+w;if(B[S]===void 0)return typeof T=="number"||typeof T=="boolean"?B[S]=T:B[S]=T.clone(),!0;{const D=B[S];if(typeof T=="number"||typeof T=="boolean"){if(D!==T)return B[S]=T,!0}else if(D.equals(T)===!1)return D.copy(T),!0}return!1}function m(C){const x=C.uniforms;let w=0;const B=16;for(let S=0,D=x.length;S<D;S++){const R=Array.isArray(x[S])?x[S]:[x[S]];for(let M=0,L=R.length;M<L;M++){const P=R[M],F=Array.isArray(P.value)?P.value:[P.value];for(let z=0,J=F.length;z<J;z++){const q=F[z],ne=E(q),j=w%B,te=j%ne.boundary,W=j+te;w+=te,W!==0&&B-W<ne.storage&&(w+=B-W),P.__data=new Float32Array(ne.storage/Float32Array.BYTES_PER_ELEMENT),P.__offset=w,w+=ne.storage}}}const T=w%B;return T>0&&(w+=B-T),C.__size=w,C.__cache={},this}function E(C){const x={boundary:0,storage:0};return typeof C=="number"||typeof C=="boolean"?(x.boundary=4,x.storage=4):C.isVector2?(x.boundary=8,x.storage=8):C.isVector3||C.isColor?(x.boundary=16,x.storage=12):C.isVector4?(x.boundary=16,x.storage=16):C.isMatrix3?(x.boundary=48,x.storage=48):C.isMatrix4?(x.boundary=64,x.storage=64):C.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",C),x}function _(C){const x=C.target;x.removeEventListener("dispose",_);const w=o.indexOf(x.__bindingPointIndex);o.splice(w,1),r.deleteBuffer(i[x.id]),delete i[x.id],delete s[x.id]}function v(){for(const C in i)r.deleteBuffer(i[C]);o=[],i={},s={}}return{bind:h,update:u,dispose:v}}class UT{constructor(e={}){const{canvas:t=Bx(),context:n=null,depth:i=!0,stencil:s=!1,alpha:o=!1,antialias:l=!1,premultipliedAlpha:h=!0,preserveDrawingBuffer:u=!1,powerPreference:d="default",failIfMajorPerformanceCaveat:A=!1,reverseDepthBuffer:p=!1}=e;this.isWebGLRenderer=!0;let g;if(n!==null){if(typeof WebGLRenderingContext<"u"&&n instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");g=n.getContextAttributes().alpha}else g=o;const m=new Uint32Array(4),E=new Int32Array(4);let _=null,v=null;const C=[],x=[];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=C0,this.toneMapping=cs,this.toneMappingExposure=1;const w=this;let B=!1,T=0,S=0,D=null,R=-1,M=null;const L=new Ut,P=new Ut;let F=null;const z=new We(0);let J=0,q=t.width,ne=t.height,j=1,te=null,W=null;const U=new Ut(0,0,q,ne),H=new Ut(0,0,q,ne);let Z=!1;const G=new m4;let oe=!1,pe=!1;this.transmissionResolutionScale=1;const Ae=new lt,ge=new lt,Re=new V,Oe=new Ut,st={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let ut=!1;function mt(){return D===null?j:1}let X=n;function h0(O,ie){return t.getContext(O,ie)}try{const O={alpha:!0,depth:i,stencil:s,antialias:l,premultipliedAlpha:h,preserveDrawingBuffer:u,powerPreference:d,failIfMajorPerformanceCaveat:A};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${K1}`),t.addEventListener("webglcontextlost",ve,!1),t.addEventListener("webglcontextrestored",De,!1),t.addEventListener("webglcontextcreationerror",Be,!1),X===null){const ie="webgl2";if(X=h0(ie,O),X===null)throw h0(ie)?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 pt,At,qe,Mt,Ye,Q,k,se,ye,Ee,_e,Ge,Le,Ve,gt,we,Ue,nt,et,he,Pe,Fe,ht,$;function Se(){pt=new WM(X),pt.init(),Fe=new TT(X,pt),At=new OM(X,pt,e,Fe),qe=new MT(X,pt),At.reverseDepthBuffer&&p&&qe.buffers.depth.setReversed(!0),Mt=new XM(X),Ye=new fT,Q=new ST(X,pt,qe,Ye,At,Fe,Mt),k=new zM(w),se=new jM(w),ye=new tC(X),ht=new kM(X,ye),Ee=new YM(X,ye,Mt,ht),_e=new KM(X,Ee,ye,Mt),et=new JM(X,At,Q),we=new QM(Ye),Ge=new dT(w,k,se,pt,At,ht,we),Le=new NT(w,Ye),Ve=new AT,gt=new ET(pt),nt=new UM(w,k,se,qe,_e,g,h),Ue=new CT(w,_e,At),$=new PT(X,Mt,At,qe),he=new FM(X,pt,Mt),Pe=new qM(X,pt,Mt),Mt.programs=Ge.programs,w.capabilities=At,w.extensions=pt,w.properties=Ye,w.renderLists=Ve,w.shadowMap=Ue,w.state=qe,w.info=Mt}Se();const ue=new DT(w,X);this.xr=ue,this.getContext=function(){return X},this.getContextAttributes=function(){return X.getContextAttributes()},this.forceContextLoss=function(){const O=pt.get("WEBGL_lose_context");O&&O.loseContext()},this.forceContextRestore=function(){const O=pt.get("WEBGL_lose_context");O&&O.restoreContext()},this.getPixelRatio=function(){return j},this.setPixelRatio=function(O){O!==void 0&&(j=O,this.setSize(q,ne,!1))},this.getSize=function(O){return O.set(q,ne)},this.setSize=function(O,ie,de=!0){if(ue.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}q=O,ne=ie,t.width=Math.floor(O*j),t.height=Math.floor(ie*j),de===!0&&(t.style.width=O+"px",t.style.height=ie+"px"),this.setViewport(0,0,O,ie)},this.getDrawingBufferSize=function(O){return O.set(q*j,ne*j).floor()},this.setDrawingBufferSize=function(O,ie,de){q=O,ne=ie,j=de,t.width=Math.floor(O*de),t.height=Math.floor(ie*de),this.setViewport(0,0,O,ie)},this.getCurrentViewport=function(O){return O.copy(L)},this.getViewport=function(O){return O.copy(U)},this.setViewport=function(O,ie,de,le){O.isVector4?U.set(O.x,O.y,O.z,O.w):U.set(O,ie,de,le),qe.viewport(L.copy(U).multiplyScalar(j).round())},this.getScissor=function(O){return O.copy(H)},this.setScissor=function(O,ie,de,le){O.isVector4?H.set(O.x,O.y,O.z,O.w):H.set(O,ie,de,le),qe.scissor(P.copy(H).multiplyScalar(j).round())},this.getScissorTest=function(){return Z},this.setScissorTest=function(O){qe.setScissorTest(Z=O)},this.setOpaqueSort=function(O){te=O},this.setTransparentSort=function(O){W=O},this.getClearColor=function(O){return O.copy(nt.getClearColor())},this.setClearColor=function(){nt.setClearColor(...arguments)},this.getClearAlpha=function(){return nt.getClearAlpha()},this.setClearAlpha=function(){nt.setClearAlpha(...arguments)},this.clear=function(O=!0,ie=!0,de=!0){let le=0;if(O){let re=!1;if(D!==null){const Ce=D.texture.format;re=Ce===mo||Ce===$1||Ce===r9}if(re){const Ce=D.texture.type,He=Ce===w0||Ce===An||Ce===ho||Ce===po||Ce===y3||Ce===E3,Qe=nt.getClearColor(),Ze=nt.getClearAlpha(),dt=Qe.r,ct=Qe.g,rt=Qe.b;He?(m[0]=dt,m[1]=ct,m[2]=rt,m[3]=Ze,X.clearBufferuiv(X.COLOR,0,m)):(E[0]=dt,E[1]=ct,E[2]=rt,E[3]=Ze,X.clearBufferiv(X.COLOR,0,E))}else le|=X.COLOR_BUFFER_BIT}ie&&(le|=X.DEPTH_BUFFER_BIT),de&&(le|=X.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),X.clear(le)},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",ve,!1),t.removeEventListener("webglcontextrestored",De,!1),t.removeEventListener("webglcontextcreationerror",Be,!1),nt.dispose(),Ve.dispose(),gt.dispose(),Ye.dispose(),k.dispose(),se.dispose(),_e.dispose(),ht.dispose(),$.dispose(),Ge.dispose(),ue.dispose(),ue.removeEventListener("sessionstart",Xi),ue.removeEventListener("sessionend",m0),$0.stop()};function ve(O){O.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),B=!0}function De(){console.log("THREE.WebGLRenderer: Context Restored."),B=!1;const O=Mt.autoReset,ie=Ue.enabled,de=Ue.autoUpdate,le=Ue.needsUpdate,re=Ue.type;Se(),Mt.autoReset=O,Ue.enabled=ie,Ue.autoUpdate=de,Ue.needsUpdate=le,Ue.type=re}function Be(O){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",O.statusMessage)}function it(O){const ie=O.target;ie.removeEventListener("dispose",it),jt(ie)}function jt(O){y0(O),Ye.remove(O)}function y0(O){const ie=Ye.get(O).programs;ie!==void 0&&(ie.forEach(function(de){Ge.releaseProgram(de)}),O.isShaderMaterial&&Ge.releaseShaderCache(O))}this.renderBufferDirect=function(O,ie,de,le,re,Ce){ie===null&&(ie=st);const He=re.isMesh&&re.matrixWorld.determinant()<0,Qe=Kc(O,ie,de,le,re);qe.setMaterial(le,He);let Ze=de.index,dt=1;if(le.wireframe===!0){if(Ze=Ee.getWireframeAttribute(de),Ze===void 0)return;dt=2}const ct=de.drawRange,rt=de.attributes.position;let Dt=ct.start*dt,Et=(ct.start+ct.count)*dt;Ce!==null&&(Dt=Math.max(Dt,Ce.start*dt),Et=Math.min(Et,(Ce.start+Ce.count)*dt)),Ze!==null?(Dt=Math.max(Dt,0),Et=Math.min(Et,Ze.count)):rt!=null&&(Dt=Math.max(Dt,0),Et=Math.min(Et,rt.count));const E0=Et-Dt;if(E0<0||E0===1/0)return;ht.setup(re,le,Qe,de,Ze);let Ft,Wt=he;if(Ze!==null&&(Ft=ye.get(Ze),Wt=Pe,Wt.setIndex(Ft)),re.isMesh)le.wireframe===!0?(qe.setLineWidth(le.wireframeLinewidth*mt()),Wt.setMode(X.LINES)):Wt.setMode(X.TRIANGLES);else if(re.isLine){let tt=le.linewidth;tt===void 0&&(tt=1),qe.setLineWidth(tt*mt()),re.isLineSegments?Wt.setMode(X.LINES):re.isLineLoop?Wt.setMode(X.LINE_LOOP):Wt.setMode(X.LINE_STRIP)}else re.isPoints?Wt.setMode(X.POINTS):re.isSprite&&Wt.setMode(X.TRIANGLES);if(re.isBatchedMesh)if(re._multiDrawInstances!==null)da("THREE.WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),Wt.renderMultiDrawInstances(re._multiDrawStarts,re._multiDrawCounts,re._multiDrawCount,re._multiDrawInstances);else if(pt.get("WEBGL_multi_draw"))Wt.renderMultiDraw(re._multiDrawStarts,re._multiDrawCounts,re._multiDrawCount);else{const tt=re._multiDrawStarts,L0=re._multiDrawCounts,cn=re._multiDrawCount,vr=Ze?ye.get(Ze).bytesPerElement:1,Gs=Ye.get(le).currentProgram.getUniforms();for(let br=0;br<cn;br++)Gs.setValue(X,"_gl_DrawID",br),Wt.render(tt[br]/vr,L0[br])}else if(re.isInstancedMesh)Wt.renderInstances(Dt,E0,re.count);else if(de.isInstancedBufferGeometry){const tt=de._maxInstanceCount!==void 0?de._maxInstanceCount:1/0,L0=Math.min(de.instanceCount,tt);Wt.renderInstances(Dt,E0,L0)}else Wt.render(Dt,E0)};function Rt(O,ie,de){O.transparent===!0&&O.side===pn&&O.forceSinglePass===!1?(O.side=V0,O.needsUpdate=!0,I1(O,ie,de),O.side=Un,O.needsUpdate=!0,I1(O,ie,de),O.side=pn):I1(O,ie,de)}this.compile=function(O,ie,de=null){de===null&&(de=O),v=gt.get(de),v.init(ie),x.push(v),de.traverseVisible(function(re){re.isLight&&re.layers.test(ie.layers)&&(v.pushLight(re),re.castShadow&&v.pushShadow(re))}),O!==de&&O.traverseVisible(function(re){re.isLight&&re.layers.test(ie.layers)&&(v.pushLight(re),re.castShadow&&v.pushShadow(re))}),v.setupLights();const le=new Set;return O.traverse(function(re){if(!(re.isMesh||re.isPoints||re.isLine||re.isSprite))return;const Ce=re.material;if(Ce)if(Array.isArray(Ce))for(let He=0;He<Ce.length;He++){const Qe=Ce[He];Rt(Qe,de,re),le.add(Qe)}else Rt(Ce,de,re),le.add(Ce)}),v=x.pop(),le},this.compileAsync=function(O,ie,de=null){const le=this.compile(O,ie,de);return new Promise(re=>{function Ce(){if(le.forEach(function(He){Ye.get(He).currentProgram.isReady()&&le.delete(He)}),le.size===0){re(O);return}setTimeout(Ce,10)}pt.get("KHR_parallel_shader_compile")!==null?Ce():setTimeout(Ce,10)})};let lr=null;function cr(O){lr&&lr(O)}function Xi(){$0.stop()}function m0(){$0.start()}const $0=new E7;$0.setAnimationLoop(cr),typeof self<"u"&&$0.setContext(self),this.setAnimationLoop=function(O){lr=O,ue.setAnimationLoop(O),O===null?$0.stop():$0.start()},ue.addEventListener("sessionstart",Xi),ue.addEventListener("sessionend",m0),this.render=function(O,ie){if(ie!==void 0&&ie.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(B===!0)return;if(O.matrixWorldAutoUpdate===!0&&O.updateMatrixWorld(),ie.parent===null&&ie.matrixWorldAutoUpdate===!0&&ie.updateMatrixWorld(),ue.enabled===!0&&ue.isPresenting===!0&&(ue.cameraAutoUpdate===!0&&ue.updateCamera(ie),ie=ue.getCamera()),O.isScene===!0&&O.onBeforeRender(w,O,ie,D),v=gt.get(O,x.length),v.init(ie),x.push(v),ge.multiplyMatrices(ie.projectionMatrix,ie.matrixWorldInverse),G.setFromProjectionMatrix(ge),pe=this.localClippingEnabled,oe=we.init(this.clippingPlanes,pe),_=Ve.get(O,C.length),_.init(),C.push(_),ue.enabled===!0&&ue.isPresenting===!0){const Ce=w.xr.getDepthSensingMesh();Ce!==null&&Tn(Ce,ie,-1/0,w.sortObjects)}Tn(O,ie,0,w.sortObjects),_.finish(),w.sortObjects===!0&&_.sort(te,W),ut=ue.enabled===!1||ue.isPresenting===!1||ue.hasDepthSensing()===!1,ut&&nt.addToRenderList(_,O),this.info.render.frame++,oe===!0&&we.beginShadows();const de=v.state.shadowsArray;Ue.render(de,O,ie),oe===!0&&we.endShadows(),this.info.autoReset===!0&&this.info.reset();const le=_.opaque,re=_.transmissive;if(v.setupLights(),ie.isArrayCamera){const Ce=ie.cameras;if(re.length>0)for(let He=0,Qe=Ce.length;He<Qe;He++){const Ze=Ce[He];Wa(le,re,O,Ze)}ut&&nt.render(O);for(let He=0,Qe=Ce.length;He<Qe;He++){const Ze=Ce[He];Ji(_,O,Ze,Ze.viewport)}}else re.length>0&&Wa(le,re,O,ie),ut&&nt.render(O),Ji(_,O,ie);D!==null&&S===0&&(Q.updateMultisampleRenderTarget(D),Q.updateRenderTargetMipmap(D)),O.isScene===!0&&O.onAfterRender(w,O,ie),ht.resetDefaultState(),R=-1,M=null,x.pop(),x.length>0?(v=x[x.length-1],oe===!0&&we.setGlobalState(w.clippingPlanes,v.state.camera)):v=null,C.pop(),C.length>0?_=C[C.length-1]:_=null};function Tn(O,ie,de,le){if(O.visible===!1)return;if(O.layers.test(ie.layers)){if(O.isGroup)de=O.renderOrder;else if(O.isLOD)O.autoUpdate===!0&&O.update(ie);else if(O.isLight)v.pushLight(O),O.castShadow&&v.pushShadow(O);else if(O.isSprite){if(!O.frustumCulled||G.intersectsSprite(O)){le&&Oe.setFromMatrixPosition(O.matrixWorld).applyMatrix4(ge);const Ce=_e.update(O),He=O.material;He.visible&&_.push(O,Ce,He,de,Oe.z,null)}}else if((O.isMesh||O.isLine||O.isPoints)&&(!O.frustumCulled||G.intersectsObject(O))){const Ce=_e.update(O),He=O.material;if(le&&(O.boundingSphere!==void 0?(O.boundingSphere===null&&O.computeBoundingSphere(),Oe.copy(O.boundingSphere.center)):(Ce.boundingSphere===null&&Ce.computeBoundingSphere(),Oe.copy(Ce.boundingSphere.center)),Oe.applyMatrix4(O.matrixWorld).applyMatrix4(ge)),Array.isArray(He)){const Qe=Ce.groups;for(let Ze=0,dt=Qe.length;Ze<dt;Ze++){const ct=Qe[Ze],rt=He[ct.materialIndex];rt&&rt.visible&&_.push(O,Ce,rt,de,Oe.z,ct)}}else He.visible&&_.push(O,Ce,He,de,Oe.z,null)}}const re=O.children;for(let Ce=0,He=re.length;Ce<He;Ce++)Tn(re[Ce],ie,de,le)}function Ji(O,ie,de,le){const re=O.opaque,Ce=O.transmissive,He=O.transparent;v.setupLightsView(de),oe===!0&&we.setGlobalState(w.clippingPlanes,de),le&&qe.viewport(L.copy(le)),re.length>0&&zs(re,ie,de),Ce.length>0&&zs(Ce,ie,de),He.length>0&&zs(He,ie,de),qe.buffers.depth.setTest(!0),qe.buffers.depth.setMask(!0),qe.buffers.color.setMask(!0),qe.setPolygonOffset(!1)}function Wa(O,ie,de,le){if((de.isScene===!0?de.overrideMaterial:null)!==null)return;v.state.transmissionRenderTarget[le.id]===void 0&&(v.state.transmissionRenderTarget[le.id]=new Nr(1,1,{generateMipmaps:!0,type:pt.has("EXT_color_buffer_half_float")||pt.has("EXT_color_buffer_float")?p0:w0,minFilter:Jr,samples:4,stencilBuffer:s,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:St.workingColorSpace}));const re=v.state.transmissionRenderTarget[le.id],Ce=le.viewport||L;re.setSize(Ce.z*w.transmissionResolutionScale,Ce.w*w.transmissionResolutionScale);const He=w.getRenderTarget();w.setRenderTarget(re),w.getClearColor(z),J=w.getClearAlpha(),J<1&&w.setClearColor(16777215,.5),w.clear(),ut&&nt.render(de);const Qe=w.toneMapping;w.toneMapping=cs;const Ze=le.viewport;if(le.viewport!==void 0&&(le.viewport=void 0),v.setupLightsView(le),oe===!0&&we.setGlobalState(w.clippingPlanes,le),zs(O,de,le),Q.updateMultisampleRenderTarget(re),Q.updateRenderTargetMipmap(re),pt.has("WEBGL_multisampled_render_to_texture")===!1){let dt=!1;for(let ct=0,rt=ie.length;ct<rt;ct++){const Dt=ie[ct],Et=Dt.object,E0=Dt.geometry,Ft=Dt.material,Wt=Dt.group;if(Ft.side===pn&&Et.layers.test(le.layers)){const tt=Ft.side;Ft.side=V0,Ft.needsUpdate=!0,Xc(Et,de,le,E0,Ft,Wt),Ft.side=tt,Ft.needsUpdate=!0,dt=!0}}dt===!0&&(Q.updateMultisampleRenderTarget(re),Q.updateRenderTargetMipmap(re))}w.setRenderTarget(He),w.setClearColor(z,J),Ze!==void 0&&(le.viewport=Ze),w.toneMapping=Qe}function zs(O,ie,de){const le=ie.isScene===!0?ie.overrideMaterial:null;for(let re=0,Ce=O.length;re<Ce;re++){const He=O[re],Qe=He.object,Ze=He.geometry,dt=le===null?He.material:le,ct=He.group;Qe.layers.test(de.layers)&&Xc(Qe,ie,de,Ze,dt,ct)}}function Xc(O,ie,de,le,re,Ce){O.onBeforeRender(w,ie,de,le,re,Ce),O.modelViewMatrix.multiplyMatrices(de.matrixWorldInverse,O.matrixWorld),O.normalMatrix.getNormalMatrix(O.modelViewMatrix),re.onBeforeRender(w,ie,de,le,O,Ce),re.transparent===!0&&re.side===pn&&re.forceSinglePass===!1?(re.side=V0,re.needsUpdate=!0,w.renderBufferDirect(de,ie,le,re,O,Ce),re.side=Un,re.needsUpdate=!0,w.renderBufferDirect(de,ie,le,re,O,Ce),re.side=pn):w.renderBufferDirect(de,ie,le,re,O,Ce),O.onAfterRender(w,ie,de,le,re,Ce)}function I1(O,ie,de){ie.isScene!==!0&&(ie=st);const le=Ye.get(O),re=v.state.lights,Ce=v.state.shadowsArray,He=re.state.version,Qe=Ge.getParameters(O,re.state,Ce,ie,de),Ze=Ge.getProgramCacheKey(Qe);let dt=le.programs;le.environment=O.isMeshStandardMaterial?ie.environment:null,le.fog=ie.fog,le.envMap=(O.isMeshStandardMaterial?se:k).get(O.envMap||le.environment),le.envMapRotation=le.environment!==null&&O.envMap===null?ie.environmentRotation:O.envMapRotation,dt===void 0&&(O.addEventListener("dispose",it),dt=new Map,le.programs=dt);let ct=dt.get(Ze);if(ct!==void 0){if(le.currentProgram===ct&&le.lightsStateVersion===He)return mi(O,Qe),ct}else Qe.uniforms=Ge.getUniforms(O),O.onBeforeCompile(Qe,w),ct=Ge.acquireProgram(Qe,Ze),dt.set(Ze,ct),le.uniforms=Qe.uniforms;const rt=le.uniforms;return(!O.isShaderMaterial&&!O.isRawShaderMaterial||O.clipping===!0)&&(rt.clippingPlanes=we.uniform),mi(O,Qe),le.needsLights=Zh(O),le.lightsStateVersion=He,le.needsLights&&(rt.ambientLightColor.value=re.state.ambient,rt.lightProbe.value=re.state.probe,rt.directionalLights.value=re.state.directional,rt.directionalLightShadows.value=re.state.directionalShadow,rt.spotLights.value=re.state.spot,rt.spotLightShadows.value=re.state.spotShadow,rt.rectAreaLights.value=re.state.rectArea,rt.ltc_1.value=re.state.rectAreaLTC1,rt.ltc_2.value=re.state.rectAreaLTC2,rt.pointLights.value=re.state.point,rt.pointLightShadows.value=re.state.pointShadow,rt.hemisphereLights.value=re.state.hemi,rt.directionalShadowMap.value=re.state.directionalShadowMap,rt.directionalShadowMatrix.value=re.state.directionalShadowMatrix,rt.spotShadowMap.value=re.state.spotShadowMap,rt.spotLightMatrix.value=re.state.spotLightMatrix,rt.spotLightMap.value=re.state.spotLightMap,rt.pointShadowMap.value=re.state.pointShadowMap,rt.pointShadowMatrix.value=re.state.pointShadowMatrix),le.currentProgram=ct,le.uniformsList=null,ct}function Jc(O){if(O.uniformsList===null){const ie=O.currentProgram.getUniforms();O.uniformsList=j9.seqWithValue(ie.seq,O.uniforms)}return O.uniformsList}function mi(O,ie){const de=Ye.get(O);de.outputColorSpace=ie.outputColorSpace,de.batching=ie.batching,de.batchingColor=ie.batchingColor,de.instancing=ie.instancing,de.instancingColor=ie.instancingColor,de.instancingMorph=ie.instancingMorph,de.skinning=ie.skinning,de.morphTargets=ie.morphTargets,de.morphNormals=ie.morphNormals,de.morphColors=ie.morphColors,de.morphTargetsCount=ie.morphTargetsCount,de.numClippingPlanes=ie.numClippingPlanes,de.numIntersection=ie.numClipIntersection,de.vertexAlphas=ie.vertexAlphas,de.vertexTangents=ie.vertexTangents,de.toneMapping=ie.toneMapping}function Kc(O,ie,de,le,re){ie.isScene!==!0&&(ie=st),Q.resetTextureUnits();const Ce=ie.fog,He=le.isMeshStandardMaterial?ie.environment:null,Qe=D===null?w.outputColorSpace:D.isXRRenderTarget===!0?D.texture.colorSpace:j0,Ze=(le.isMeshStandardMaterial?se:k).get(le.envMap||He),dt=le.vertexColors===!0&&!!de.attributes.color&&de.attributes.color.itemSize===4,ct=!!de.attributes.tangent&&(!!le.normalMap||le.anisotropy>0),rt=!!de.morphAttributes.position,Dt=!!de.morphAttributes.normal,Et=!!de.morphAttributes.color;let E0=cs;le.toneMapped&&(D===null||D.isXRRenderTarget===!0)&&(E0=w.toneMapping);const Ft=de.morphAttributes.position||de.morphAttributes.normal||de.morphAttributes.color,Wt=Ft!==void 0?Ft.length:0,tt=Ye.get(le),L0=v.state.lights;if(oe===!0&&(pe===!0||O!==M)){const z0=O===M&&le.id===R;we.setState(le,O,z0)}let cn=!1;le.version===tt.__version?(tt.needsLights&&tt.lightsStateVersion!==L0.state.version||tt.outputColorSpace!==Qe||re.isBatchedMesh&&tt.batching===!1||!re.isBatchedMesh&&tt.batching===!0||re.isBatchedMesh&&tt.batchingColor===!0&&re.colorTexture===null||re.isBatchedMesh&&tt.batchingColor===!1&&re.colorTexture!==null||re.isInstancedMesh&&tt.instancing===!1||!re.isInstancedMesh&&tt.instancing===!0||re.isSkinnedMesh&&tt.skinning===!1||!re.isSkinnedMesh&&tt.skinning===!0||re.isInstancedMesh&&tt.instancingColor===!0&&re.instanceColor===null||re.isInstancedMesh&&tt.instancingColor===!1&&re.instanceColor!==null||re.isInstancedMesh&&tt.instancingMorph===!0&&re.morphTexture===null||re.isInstancedMesh&&tt.instancingMorph===!1&&re.morphTexture!==null||tt.envMap!==Ze||le.fog===!0&&tt.fog!==Ce||tt.numClippingPlanes!==void 0&&(tt.numClippingPlanes!==we.numPlanes||tt.numIntersection!==we.numIntersection)||tt.vertexAlphas!==dt||tt.vertexTangents!==ct||tt.morphTargets!==rt||tt.morphNormals!==Dt||tt.morphColors!==Et||tt.toneMapping!==E0||tt.morphTargetsCount!==Wt)&&(cn=!0):(cn=!0,tt.__version=le.version);let vr=tt.currentProgram;cn===!0&&(vr=I1(le,ie,re));let Gs=!1,br=!1,Ki=!1;const Xt=vr.getUniforms(),_r=tt.uniforms;if(qe.useProgram(vr.program)&&(Gs=!0,br=!0,Ki=!0),le.id!==R&&(R=le.id,br=!0),Gs||M!==O){qe.buffers.depth.getReversed()?(Ae.copy(O.projectionMatrix),Rx(Ae),Dx(Ae),Xt.setValue(X,"projectionMatrix",Ae)):Xt.setValue(X,"projectionMatrix",O.projectionMatrix),Xt.setValue(X,"viewMatrix",O.matrixWorldInverse);const z0=Xt.map.cameraPosition;z0!==void 0&&z0.setValue(X,Re.setFromMatrixPosition(O.matrixWorld)),At.logarithmicDepthBuffer&&Xt.setValue(X,"logDepthBufFC",2/(Math.log(O.far+1)/Math.LN2)),(le.isMeshPhongMaterial||le.isMeshToonMaterial||le.isMeshLambertMaterial||le.isMeshBasicMaterial||le.isMeshStandardMaterial||le.isShaderMaterial)&&Xt.setValue(X,"isOrthographic",O.isOrthographicCamera===!0),M!==O&&(M=O,br=!0,Ki=!0)}if(re.isSkinnedMesh){Xt.setOptional(X,re,"bindMatrix"),Xt.setOptional(X,re,"bindMatrixInverse");const z0=re.skeleton;z0&&(z0.boneTexture===null&&z0.computeBoneTexture(),Xt.setValue(X,"boneTexture",z0.boneTexture,Q))}re.isBatchedMesh&&(Xt.setOptional(X,re,"batchingTexture"),Xt.setValue(X,"batchingTexture",re._matricesTexture,Q),Xt.setOptional(X,re,"batchingIdTexture"),Xt.setValue(X,"batchingIdTexture",re._indirectTexture,Q),Xt.setOptional(X,re,"batchingColorTexture"),re._colorsTexture!==null&&Xt.setValue(X,"batchingColorTexture",re._colorsTexture,Q));const er=de.morphAttributes;if((er.position!==void 0||er.normal!==void 0||er.color!==void 0)&&et.update(re,de,vr),(br||tt.receiveShadow!==re.receiveShadow)&&(tt.receiveShadow=re.receiveShadow,Xt.setValue(X,"receiveShadow",re.receiveShadow)),le.isMeshGouraudMaterial&&le.envMap!==null&&(_r.envMap.value=Ze,_r.flipEnvMap.value=Ze.isCubeTexture&&Ze.isRenderTargetTexture===!1?-1:1),le.isMeshStandardMaterial&&le.envMap===null&&ie.environment!==null&&(_r.envMapIntensity.value=ie.environmentIntensity),br&&(Xt.setValue(X,"toneMappingExposure",w.toneMappingExposure),tt.needsLights&&Zc(_r,Ki),Ce&&le.fog===!0&&Le.refreshFogUniforms(_r,Ce),Le.refreshMaterialUniforms(_r,le,j,ne,v.state.transmissionRenderTarget[O.id]),j9.upload(X,Jc(tt),_r,Q)),le.isShaderMaterial&&le.uniformsNeedUpdate===!0&&(j9.upload(X,Jc(tt),_r,Q),le.uniformsNeedUpdate=!1),le.isSpriteMaterial&&Xt.setValue(X,"center",re.center),Xt.setValue(X,"modelViewMatrix",re.modelViewMatrix),Xt.setValue(X,"normalMatrix",re.normalMatrix),Xt.setValue(X,"modelMatrix",re.matrixWorld),le.isShaderMaterial||le.isRawShaderMaterial){const z0=le.uniformsGroups;for(let Rr=0,Lt=z0.length;Rr<Lt;Rr++){const vi=z0[Rr];$.update(vi,vr),$.bind(vi,vr)}}return vr}function Zc(O,ie){O.ambientLightColor.needsUpdate=ie,O.lightProbe.needsUpdate=ie,O.directionalLights.needsUpdate=ie,O.directionalLightShadows.needsUpdate=ie,O.pointLights.needsUpdate=ie,O.pointLightShadows.needsUpdate=ie,O.spotLights.needsUpdate=ie,O.spotLightShadows.needsUpdate=ie,O.rectAreaLights.needsUpdate=ie,O.hemisphereLights.needsUpdate=ie}function Zh(O){return O.isMeshLambertMaterial||O.isMeshToonMaterial||O.isMeshPhongMaterial||O.isMeshStandardMaterial||O.isShadowMaterial||O.isShaderMaterial&&O.lights===!0}this.getActiveCubeFace=function(){return T},this.getActiveMipmapLevel=function(){return S},this.getRenderTarget=function(){return D},this.setRenderTargetTextures=function(O,ie,de){Ye.get(O.texture).__webglTexture=ie,Ye.get(O.depthTexture).__webglTexture=de;const le=Ye.get(O);le.__hasExternalTextures=!0,le.__autoAllocateDepthBuffer=de===void 0,le.__autoAllocateDepthBuffer||pt.has("WEBGL_multisampled_render_to_texture")===!0&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),le.__useRenderToTexture=!1)},this.setRenderTargetFramebuffer=function(O,ie){const de=Ye.get(O);de.__webglFramebuffer=ie,de.__useDefaultFramebuffer=ie===void 0};const $c=X.createFramebuffer();this.setRenderTarget=function(O,ie=0,de=0){D=O,T=ie,S=de;let le=!0,re=null,Ce=!1,He=!1;if(O){const Qe=Ye.get(O);if(Qe.__useDefaultFramebuffer!==void 0)qe.bindFramebuffer(X.FRAMEBUFFER,null),le=!1;else if(Qe.__webglFramebuffer===void 0)Q.setupRenderTarget(O);else if(Qe.__hasExternalTextures)Q.rebindTextures(O,Ye.get(O.texture).__webglTexture,Ye.get(O.depthTexture).__webglTexture);else if(O.depthBuffer){const ct=O.depthTexture;if(Qe.__boundDepthTexture!==ct){if(ct!==null&&Ye.has(ct)&&(O.width!==ct.image.width||O.height!==ct.image.height))throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");Q.setupDepthRenderbuffer(O)}}const Ze=O.texture;(Ze.isData3DTexture||Ze.isDataArrayTexture||Ze.isCompressedArrayTexture)&&(He=!0);const dt=Ye.get(O).__webglFramebuffer;O.isWebGLCubeRenderTarget?(Array.isArray(dt[ie])?re=dt[ie][de]:re=dt[ie],Ce=!0):O.samples>0&&Q.useMultisampledRTT(O)===!1?re=Ye.get(O).__webglMultisampledFramebuffer:Array.isArray(dt)?re=dt[de]:re=dt,L.copy(O.viewport),P.copy(O.scissor),F=O.scissorTest}else L.copy(U).multiplyScalar(j).floor(),P.copy(H).multiplyScalar(j).floor(),F=Z;if(de!==0&&(re=$c),qe.bindFramebuffer(X.FRAMEBUFFER,re)&&le&&qe.drawBuffers(O,re),qe.viewport(L),qe.scissor(P),qe.setScissorTest(F),Ce){const Qe=Ye.get(O.texture);X.framebufferTexture2D(X.FRAMEBUFFER,X.COLOR_ATTACHMENT0,X.TEXTURE_CUBE_MAP_POSITIVE_X+ie,Qe.__webglTexture,de)}else if(He){const Qe=Ye.get(O.texture),Ze=ie;X.framebufferTextureLayer(X.FRAMEBUFFER,X.COLOR_ATTACHMENT0,Qe.__webglTexture,de,Ze)}else if(O!==null&&de!==0){const Qe=Ye.get(O.texture);X.framebufferTexture2D(X.FRAMEBUFFER,X.COLOR_ATTACHMENT0,X.TEXTURE_2D,Qe.__webglTexture,de)}R=-1},this.readRenderTargetPixels=function(O,ie,de,le,re,Ce,He){if(!(O&&O.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let Qe=Ye.get(O).__webglFramebuffer;if(O.isWebGLCubeRenderTarget&&He!==void 0&&(Qe=Qe[He]),Qe){qe.bindFramebuffer(X.FRAMEBUFFER,Qe);try{const Ze=O.texture,dt=Ze.format,ct=Ze.type;if(!At.textureFormatReadable(dt)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!At.textureTypeReadable(ct)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}ie>=0&&ie<=O.width-le&&de>=0&&de<=O.height-re&&X.readPixels(ie,de,le,re,Fe.convert(dt),Fe.convert(ct),Ce)}finally{const Ze=D!==null?Ye.get(D).__webglFramebuffer:null;qe.bindFramebuffer(X.FRAMEBUFFER,Ze)}}},this.readRenderTargetPixelsAsync=async function(O,ie,de,le,re,Ce,He){if(!(O&&O.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let Qe=Ye.get(O).__webglFramebuffer;if(O.isWebGLCubeRenderTarget&&He!==void 0&&(Qe=Qe[He]),Qe){const Ze=O.texture,dt=Ze.format,ct=Ze.type;if(!At.textureFormatReadable(dt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!At.textureTypeReadable(ct))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");if(ie>=0&&ie<=O.width-le&&de>=0&&de<=O.height-re){qe.bindFramebuffer(X.FRAMEBUFFER,Qe);const rt=X.createBuffer();X.bindBuffer(X.PIXEL_PACK_BUFFER,rt),X.bufferData(X.PIXEL_PACK_BUFFER,Ce.byteLength,X.STREAM_READ),X.readPixels(ie,de,le,re,Fe.convert(dt),Fe.convert(ct),0);const Dt=D!==null?Ye.get(D).__webglFramebuffer:null;qe.bindFramebuffer(X.FRAMEBUFFER,Dt);const Et=X.fenceSync(X.SYNC_GPU_COMMANDS_COMPLETE,0);return X.flush(),await bx(X,Et,4),X.bindBuffer(X.PIXEL_PACK_BUFFER,rt),X.getBufferSubData(X.PIXEL_PACK_BUFFER,0,Ce),X.deleteBuffer(rt),X.deleteSync(Et),Ce}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")}},this.copyFramebufferToTexture=function(O,ie=null,de=0){O.isTexture!==!0&&(da("WebGLRenderer: copyFramebufferToTexture function signature has changed."),ie=arguments[0]||null,O=arguments[1]);const le=Math.pow(2,-de),re=Math.floor(O.image.width*le),Ce=Math.floor(O.image.height*le),He=ie!==null?ie.x:0,Qe=ie!==null?ie.y:0;Q.setTexture2D(O,0),X.copyTexSubImage2D(X.TEXTURE_2D,de,0,0,He,Qe,re,Ce),qe.unbindTexture()};const eu=X.createFramebuffer(),tu=X.createFramebuffer();this.copyTextureToTexture=function(O,ie,de=null,le=null,re=0,Ce=null){O.isTexture!==!0&&(da("WebGLRenderer: copyTextureToTexture function signature has changed."),le=arguments[0]||null,O=arguments[1],ie=arguments[2],Ce=arguments[3]||0,de=null),Ce===null&&(re!==0?(da("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),Ce=re,re=0):Ce=0);let He,Qe,Ze,dt,ct,rt,Dt,Et,E0;const Ft=O.isCompressedTexture?O.mipmaps[Ce]:O.image;if(de!==null)He=de.max.x-de.min.x,Qe=de.max.y-de.min.y,Ze=de.isBox3?de.max.z-de.min.z:1,dt=de.min.x,ct=de.min.y,rt=de.isBox3?de.min.z:0;else{const er=Math.pow(2,-re);He=Math.floor(Ft.width*er),Qe=Math.floor(Ft.height*er),O.isDataArrayTexture?Ze=Ft.depth:O.isData3DTexture?Ze=Math.floor(Ft.depth*er):Ze=1,dt=0,ct=0,rt=0}le!==null?(Dt=le.x,Et=le.y,E0=le.z):(Dt=0,Et=0,E0=0);const Wt=Fe.convert(ie.format),tt=Fe.convert(ie.type);let L0;ie.isData3DTexture?(Q.setTexture3D(ie,0),L0=X.TEXTURE_3D):ie.isDataArrayTexture||ie.isCompressedArrayTexture?(Q.setTexture2DArray(ie,0),L0=X.TEXTURE_2D_ARRAY):(Q.setTexture2D(ie,0),L0=X.TEXTURE_2D),X.pixelStorei(X.UNPACK_FLIP_Y_WEBGL,ie.flipY),X.pixelStorei(X.UNPACK_PREMULTIPLY_ALPHA_WEBGL,ie.premultiplyAlpha),X.pixelStorei(X.UNPACK_ALIGNMENT,ie.unpackAlignment);const cn=X.getParameter(X.UNPACK_ROW_LENGTH),vr=X.getParameter(X.UNPACK_IMAGE_HEIGHT),Gs=X.getParameter(X.UNPACK_SKIP_PIXELS),br=X.getParameter(X.UNPACK_SKIP_ROWS),Ki=X.getParameter(X.UNPACK_SKIP_IMAGES);X.pixelStorei(X.UNPACK_ROW_LENGTH,Ft.width),X.pixelStorei(X.UNPACK_IMAGE_HEIGHT,Ft.height),X.pixelStorei(X.UNPACK_SKIP_PIXELS,dt),X.pixelStorei(X.UNPACK_SKIP_ROWS,ct),X.pixelStorei(X.UNPACK_SKIP_IMAGES,rt);const Xt=O.isDataArrayTexture||O.isData3DTexture,_r=ie.isDataArrayTexture||ie.isData3DTexture;if(O.isDepthTexture){const er=Ye.get(O),z0=Ye.get(ie),Rr=Ye.get(er.__renderTarget),Lt=Ye.get(z0.__renderTarget);qe.bindFramebuffer(X.READ_FRAMEBUFFER,Rr.__webglFramebuffer),qe.bindFramebuffer(X.DRAW_FRAMEBUFFER,Lt.__webglFramebuffer);for(let vi=0;vi<Ze;vi++)Xt&&(X.framebufferTextureLayer(X.READ_FRAMEBUFFER,X.COLOR_ATTACHMENT0,Ye.get(O).__webglTexture,re,rt+vi),X.framebufferTextureLayer(X.DRAW_FRAMEBUFFER,X.COLOR_ATTACHMENT0,Ye.get(ie).__webglTexture,Ce,E0+vi)),X.blitFramebuffer(dt,ct,He,Qe,Dt,Et,He,Qe,X.DEPTH_BUFFER_BIT,X.NEAREST);qe.bindFramebuffer(X.READ_FRAMEBUFFER,null),qe.bindFramebuffer(X.DRAW_FRAMEBUFFER,null)}else if(re!==0||O.isRenderTargetTexture||Ye.has(O)){const er=Ye.get(O),z0=Ye.get(ie);qe.bindFramebuffer(X.READ_FRAMEBUFFER,eu),qe.bindFramebuffer(X.DRAW_FRAMEBUFFER,tu);for(let Rr=0;Rr<Ze;Rr++)Xt?X.framebufferTextureLayer(X.READ_FRAMEBUFFER,X.COLOR_ATTACHMENT0,er.__webglTexture,re,rt+Rr):X.framebufferTexture2D(X.READ_FRAMEBUFFER,X.COLOR_ATTACHMENT0,X.TEXTURE_2D,er.__webglTexture,re),_r?X.framebufferTextureLayer(X.DRAW_FRAMEBUFFER,X.COLOR_ATTACHMENT0,z0.__webglTexture,Ce,E0+Rr):X.framebufferTexture2D(X.DRAW_FRAMEBUFFER,X.COLOR_ATTACHMENT0,X.TEXTURE_2D,z0.__webglTexture,Ce),re!==0?X.blitFramebuffer(dt,ct,He,Qe,Dt,Et,He,Qe,X.COLOR_BUFFER_BIT,X.NEAREST):_r?X.copyTexSubImage3D(L0,Ce,Dt,Et,E0+Rr,dt,ct,He,Qe):X.copyTexSubImage2D(L0,Ce,Dt,Et,dt,ct,He,Qe);qe.bindFramebuffer(X.READ_FRAMEBUFFER,null),qe.bindFramebuffer(X.DRAW_FRAMEBUFFER,null)}else _r?O.isDataTexture||O.isData3DTexture?X.texSubImage3D(L0,Ce,Dt,Et,E0,He,Qe,Ze,Wt,tt,Ft.data):ie.isCompressedArrayTexture?X.compressedTexSubImage3D(L0,Ce,Dt,Et,E0,He,Qe,Ze,Wt,Ft.data):X.texSubImage3D(L0,Ce,Dt,Et,E0,He,Qe,Ze,Wt,tt,Ft):O.isDataTexture?X.texSubImage2D(X.TEXTURE_2D,Ce,Dt,Et,He,Qe,Wt,tt,Ft.data):O.isCompressedTexture?X.compressedTexSubImage2D(X.TEXTURE_2D,Ce,Dt,Et,Ft.width,Ft.height,Wt,Ft.data):X.texSubImage2D(X.TEXTURE_2D,Ce,Dt,Et,He,Qe,Wt,tt,Ft);X.pixelStorei(X.UNPACK_ROW_LENGTH,cn),X.pixelStorei(X.UNPACK_IMAGE_HEIGHT,vr),X.pixelStorei(X.UNPACK_SKIP_PIXELS,Gs),X.pixelStorei(X.UNPACK_SKIP_ROWS,br),X.pixelStorei(X.UNPACK_SKIP_IMAGES,Ki),Ce===0&&ie.generateMipmaps&&X.generateMipmap(L0),qe.unbindTexture()},this.copyTextureToTexture3D=function(O,ie,de=null,le=null,re=0){return O.isTexture!==!0&&(da("WebGLRenderer: copyTextureToTexture3D function signature has changed."),de=arguments[0]||null,le=arguments[1]||null,O=arguments[2],ie=arguments[3],re=arguments[4]||0),da('WebGLRenderer: copyTextureToTexture3D function has been deprecated. Use "copyTextureToTexture" instead.'),this.copyTextureToTexture(O,ie,de,le,re)},this.initRenderTarget=function(O){Ye.get(O).__webglFramebuffer===void 0&&Q.setupRenderTarget(O)},this.initTexture=function(O){O.isCubeTexture?Q.setTextureCube(O,0):O.isData3DTexture?Q.setTexture3D(O,0):O.isDataArrayTexture||O.isCompressedArrayTexture?Q.setTexture2DArray(O,0):Q.setTexture2D(O,0),qe.unbindTexture()},this.resetState=function(){T=0,S=0,D=null,qe.reset(),ht.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Si}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorspace=St._getDrawingBufferColorSpace(e),t.unpackColorSpace=St._getUnpackColorSpace()}}const J7={name:"CopyShader",uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:`
3846
3846
 
3847
3847
  varying vec2 vUv;
3848
3848
 
@@ -3955,7 +3955,7 @@ void main() {
3955
3955
  `,i=function(v,C,x){C=C||1024;let w=v.pos,B=-1,T=0,S="",D=String.fromCharCode.apply(null,new Uint16Array(v.subarray(w,w+128)));for(;0>(B=D.indexOf(n))&&T<C&&w<v.byteLength;)S+=D,T+=D.length,w+=128,D+=String.fromCharCode.apply(null,new Uint16Array(v.subarray(w,w+128)));return-1<B?(x!==!1&&(v.pos+=T+B+1),S+D.slice(0,B)):!1},s=function(v){const C=/^#\?(\S+)/,x=/^\s*GAMMA\s*=\s*(\d+(\.\d+)?)\s*$/,w=/^\s*EXPOSURE\s*=\s*(\d+(\.\d+)?)\s*$/,B=/^\s*FORMAT=(\S+)\s*$/,T=/^\s*\-Y\s+(\d+)\s+\+X\s+(\d+)\s*$/,S={valid:0,string:"",comments:"",programtype:"RGBE",format:"",gamma:1,exposure:1,width:0,height:0};let D,R;for((v.pos>=v.byteLength||!(D=i(v)))&&t(1,"no header found"),(R=D.match(C))||t(3,"bad initial token"),S.valid|=1,S.programtype=R[1],S.string+=D+`
3956
3956
  `;D=i(v),D!==!1;){if(S.string+=D+`
3957
3957
  `,D.charAt(0)==="#"){S.comments+=D+`
3958
- `;continue}if((R=D.match(x))&&(S.gamma=parseFloat(R[1])),(R=D.match(w))&&(S.exposure=parseFloat(R[1])),(R=D.match(B))&&(S.valid|=2,S.format=R[1]),(R=D.match(T))&&(S.valid|=4,S.height=parseInt(R[1],10),S.width=parseInt(R[2],10)),S.valid&2&&S.valid&4)break}return S.valid&2||t(3,"missing format specifier"),S.valid&4||t(3,"missing image size specifier"),S},o=function(v,C,x){const w=C;if(w<8||w>32767||v[0]!==2||v[1]!==2||v[2]&128)return new Uint8Array(v);w!==(v[2]<<8|v[3])&&t(3,"wrong scanline width");const B=new Uint8Array(4*C*x);B.length||t(4,"unable to allocate buffer space");let T=0,S=0;const D=4*w,R=new Uint8Array(4),M=new Uint8Array(D);let L=x;for(;L>0&&S<v.byteLength;){S+4>v.byteLength&&t(1),R[0]=v[S++],R[1]=v[S++],R[2]=v[S++],R[3]=v[S++],(R[0]!=2||R[1]!=2||(R[2]<<8|R[3])!=w)&&t(3,"bad rgbe scanline format");let P=0,F;for(;P<D&&S<v.byteLength;){F=v[S++];const J=F>128;if(J&&(F-=128),(F===0||P+F>D)&&t(3,"bad scanline data"),J){const q=v[S++];for(let ne=0;ne<F;ne++)M[P++]=q}else M.set(v.subarray(S,S+F),P),P+=F,S+=F}const z=w;for(let J=0;J<z;J++){let q=0;B[T]=M[J+q],q+=w,B[T+1]=M[J+q],q+=w,B[T+2]=M[J+q],q+=w,B[T+3]=M[J+q],T+=4}L--}return B},l=function(v,C,x,w){const B=v[C+3],T=Math.pow(2,B-128)/255;x[w+0]=v[C+0]*T,x[w+1]=v[C+1]*T,x[w+2]=v[C+2]*T,x[w+3]=1},h=function(v,C,x,w){const B=v[C+3],T=Math.pow(2,B-128)/255;x[w+0]=bo.toHalfFloat(Math.min(v[C+0]*T,65504)),x[w+1]=bo.toHalfFloat(Math.min(v[C+1]*T,65504)),x[w+2]=bo.toHalfFloat(Math.min(v[C+2]*T,65504)),x[w+3]=bo.toHalfFloat(1)},u=new Uint8Array(e);u.pos=0;const d=s(u),A=d.width,p=d.height,g=o(u.subarray(u.pos),A,p);let m,E,_;switch(this.type){case Jt:_=g.length/4;const v=new Float32Array(_*4);for(let x=0;x<_;x++)l(g,x*4,v,x*4);m=v,E=Jt;break;case p0:_=g.length/4;const C=new Uint16Array(_*4);for(let x=0;x<_;x++)h(g,x*4,C,x*4);m=C,E=p0;break;default:throw new Error("THREE.RGBELoader: Unsupported type: "+this.type)}return{width:A,height:p,data:m,header:d.string,gamma:d.gamma,exposure:d.exposure,type:E}}setDataType(e){return this.type=e,this}load(e,t,n,i){function s(o,l){switch(o.type){case Jt:case p0:o.colorSpace=j0,o.minFilter=Gt,o.magFilter=Gt,o.generateMipmaps=!1,o.flipY=!0;break}t&&t(o,l)}return super.load(e,s,n,i)}}var xt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function yR(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function ER(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 Hp={exports:{}};function xR(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 Vp={exports:{}};const wR={},CR=Object.freeze(Object.defineProperty({__proto__:null,default:wR},Symbol.toStringTag,{value:"Module"})),IR=ER(CR);var jp;function Bt(){return jp||(jp=1,function(r,e){(function(t,n){r.exports=n()})(xt,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 xt<"u"&&xt.crypto&&(s=xt.crypto),!s&&typeof xR=="function")try{s=IR}catch{}var o=function(){if(s){if(typeof s.getRandomValues=="function")try{return s.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof s.randomBytes=="function")try{return s.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},l=Object.create||function(){function C(){}return function(x){var w;return C.prototype=x,w=new C,C.prototype=null,w}}(),h={},u=h.lib={},d=u.Base=function(){return{extend:function(C){var x=l(this);return C&&x.mixIn(C),(!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 C=this.extend();return C.init.apply(C,arguments),C},init:function(){},mixIn:function(C){for(var x in C)C.hasOwnProperty(x)&&(this[x]=C[x]);C.hasOwnProperty("toString")&&(this.toString=C.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),A=u.WordArray=d.extend({init:function(C,x){C=this.words=C||[],x!=i?this.sigBytes=x:this.sigBytes=C.length*4},toString:function(C){return(C||g).stringify(this)},concat:function(C){var x=this.words,w=C.words,B=this.sigBytes,T=C.sigBytes;if(this.clamp(),B%4)for(var S=0;S<T;S++){var D=w[S>>>2]>>>24-S%4*8&255;x[B+S>>>2]|=D<<24-(B+S)%4*8}else for(var R=0;R<T;R+=4)x[B+R>>>2]=w[R>>>2];return this.sigBytes+=T,this},clamp:function(){var C=this.words,x=this.sigBytes;C[x>>>2]&=4294967295<<32-x%4*8,C.length=n.ceil(x/4)},clone:function(){var C=d.clone.call(this);return C.words=this.words.slice(0),C},random:function(C){for(var x=[],w=0;w<C;w+=4)x.push(o());return new A.init(x,C)}}),p=h.enc={},g=p.Hex={stringify:function(C){for(var x=C.words,w=C.sigBytes,B=[],T=0;T<w;T++){var S=x[T>>>2]>>>24-T%4*8&255;B.push((S>>>4).toString(16)),B.push((S&15).toString(16))}return B.join("")},parse:function(C){for(var x=C.length,w=[],B=0;B<x;B+=2)w[B>>>3]|=parseInt(C.substr(B,2),16)<<24-B%8*4;return new A.init(w,x/2)}},m=p.Latin1={stringify:function(C){for(var x=C.words,w=C.sigBytes,B=[],T=0;T<w;T++){var S=x[T>>>2]>>>24-T%4*8&255;B.push(String.fromCharCode(S))}return B.join("")},parse:function(C){for(var x=C.length,w=[],B=0;B<x;B++)w[B>>>2]|=(C.charCodeAt(B)&255)<<24-B%4*8;return new A.init(w,x)}},E=p.Utf8={stringify:function(C){try{return decodeURIComponent(escape(m.stringify(C)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(C){return m.parse(unescape(encodeURIComponent(C)))}},_=u.BufferedBlockAlgorithm=d.extend({reset:function(){this._data=new A.init,this._nDataBytes=0},_append:function(C){typeof C=="string"&&(C=E.parse(C)),this._data.concat(C),this._nDataBytes+=C.sigBytes},_process:function(C){var x,w=this._data,B=w.words,T=w.sigBytes,S=this.blockSize,D=S*4,R=T/D;C?R=n.ceil(R):R=n.max((R|0)-this._minBufferSize,0);var M=R*S,L=n.min(M*4,T);if(M){for(var P=0;P<M;P+=S)this._doProcessBlock(B,P);x=B.splice(0,M),w.sigBytes-=L}return new A.init(x,L)},clone:function(){var C=d.clone.call(this);return C._data=this._data.clone(),C},_minBufferSize:0});u.Hasher=_.extend({cfg:d.extend(),init:function(C){this.cfg=this.cfg.extend(C),this.reset()},reset:function(){_.reset.call(this),this._doReset()},update:function(C){return this._append(C),this._process(),this},finalize:function(C){C&&this._append(C);var x=this._doFinalize();return x},blockSize:16,_createHelper:function(C){return function(x,w){return new C.init(w).finalize(x)}},_createHmacHelper:function(C){return function(x,w){return new v.HMAC.init(C,w).finalize(x)}}});var v=h.algo={};return h}(Math);return t})}(Vp)),Vp.exports}var Wp={exports:{}},Yp;function cc(){return Yp||(Yp=1,function(r,e){(function(t,n){r.exports=n(Bt())})(xt,function(t){return function(n){var i=t,s=i.lib,o=s.Base,l=s.WordArray,h=i.x64={};h.Word=o.extend({init:function(u,d){this.high=u,this.low=d}}),h.WordArray=o.extend({init:function(u,d){u=this.words=u||[],d!=n?this.sigBytes=d:this.sigBytes=u.length*8},toX32:function(){for(var u=this.words,d=u.length,A=[],p=0;p<d;p++){var g=u[p];A.push(g.high),A.push(g.low)}return l.create(A,this.sigBytes)},clone:function(){for(var u=o.clone.call(this),d=u.words=this.words.slice(0),A=d.length,p=0;p<A;p++)d[p]=d[p].clone();return u}})}(),t})}(Wp)),Wp.exports}var qp={exports:{}},Xp;function MR(){return Xp||(Xp=1,function(r,e){(function(t,n){r.exports=n(Bt())})(xt,function(t){return function(){if(typeof ArrayBuffer=="function"){var n=t,i=n.lib,s=i.WordArray,o=s.init,l=s.init=function(h){if(h instanceof ArrayBuffer&&(h=new Uint8Array(h)),(h instanceof Int8Array||typeof Uint8ClampedArray<"u"&&h instanceof Uint8ClampedArray||h instanceof Int16Array||h instanceof Uint16Array||h instanceof Int32Array||h instanceof Uint32Array||h instanceof Float32Array||h instanceof Float64Array)&&(h=new Uint8Array(h.buffer,h.byteOffset,h.byteLength)),h instanceof Uint8Array){for(var u=h.byteLength,d=[],A=0;A<u;A++)d[A>>>2]|=h[A]<<24-A%4*8;o.call(this,d,u)}else o.apply(this,arguments)};l.prototype=s}}(),t.lib.WordArray})}(qp)),qp.exports}var Jp={exports:{}},Kp;function SR(){return Kp||(Kp=1,function(r,e){(function(t,n){r.exports=n(Bt())})(xt,function(t){return function(){var n=t,i=n.lib,s=i.WordArray,o=n.enc;o.Utf16=o.Utf16BE={stringify:function(h){for(var u=h.words,d=h.sigBytes,A=[],p=0;p<d;p+=2){var g=u[p>>>2]>>>16-p%4*8&65535;A.push(String.fromCharCode(g))}return A.join("")},parse:function(h){for(var u=h.length,d=[],A=0;A<u;A++)d[A>>>1]|=h.charCodeAt(A)<<16-A%2*16;return s.create(d,u*2)}},o.Utf16LE={stringify:function(h){for(var u=h.words,d=h.sigBytes,A=[],p=0;p<d;p+=2){var g=l(u[p>>>2]>>>16-p%4*8&65535);A.push(String.fromCharCode(g))}return A.join("")},parse:function(h){for(var u=h.length,d=[],A=0;A<u;A++)d[A>>>1]|=l(h.charCodeAt(A)<<16-A%2*16);return s.create(d,u*2)}};function l(h){return h<<8&4278255360|h>>>8&16711935}}(),t.enc.Utf16})}(Jp)),Jp.exports}var Zp={exports:{}},$p;function Da(){return $p||($p=1,function(r,e){(function(t,n){r.exports=n(Bt())})(xt,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 m=u[g>>>2]>>>24-g%4*8&255,E=u[g+1>>>2]>>>24-(g+1)%4*8&255,_=u[g+2>>>2]>>>24-(g+2)%4*8&255,v=m<<16|E<<8|_,C=0;C<4&&g+C*.75<d;C++)p.push(A.charAt(v>>>6*(3-C)&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 m=h.indexOf(g);m!==-1&&(u=m)}return l(h,u,A)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function l(h,u,d){for(var A=[],p=0,g=0;g<u;g++)if(g%4){var m=d[h.charCodeAt(g-1)]<<g%4*2,E=d[h.charCodeAt(g)]>>>6-g%4*2,_=m|E;A[p>>>2]|=_<<24-p%4*8,p++}return s.create(A,p)}}(),t.enc.Base64})}(Zp)),Zp.exports}var eA={exports:{}},tA;function TR(){return tA||(tA=1,function(r,e){(function(t,n){r.exports=n(Bt())})(xt,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=[],m=0;m<A;m+=3)for(var E=d[m>>>2]>>>24-m%4*8&255,_=d[m+1>>>2]>>>24-(m+1)%4*8&255,v=d[m+2>>>2]>>>24-(m+2)%4*8&255,C=E<<16|_<<8|v,x=0;x<4&&m+x*.75<A;x++)g.push(p.charAt(C>>>6*(3-x)&63));var w=p.charAt(64);if(w)for(;g.length%4;)g.push(w);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 m=A.charAt(64);if(m){var E=h.indexOf(m);E!==-1&&(d=E)}return l(h,d,p)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"};function l(h,u,d){for(var A=[],p=0,g=0;g<u;g++)if(g%4){var m=d[h.charCodeAt(g-1)]<<g%4*2,E=d[h.charCodeAt(g)]>>>6-g%4*2,_=m|E;A[p>>>2]|=_<<24-p%4*8,p++}return s.create(A,p)}}(),t.enc.Base64url})}(eA)),eA.exports}var rA={exports:{}},nA;function La(){return nA||(nA=1,function(r,e){(function(t,n){r.exports=n(Bt())})(xt,function(t){return function(n){var i=t,s=i.lib,o=s.WordArray,l=s.Hasher,h=i.algo,u=[];(function(){for(var E=0;E<64;E++)u[E]=n.abs(n.sin(E+1))*4294967296|0})();var d=h.MD5=l.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(E,_){for(var v=0;v<16;v++){var C=_+v,x=E[C];E[C]=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360}var w=this._hash.words,B=E[_+0],T=E[_+1],S=E[_+2],D=E[_+3],R=E[_+4],M=E[_+5],L=E[_+6],P=E[_+7],F=E[_+8],z=E[_+9],J=E[_+10],q=E[_+11],ne=E[_+12],j=E[_+13],te=E[_+14],W=E[_+15],U=w[0],H=w[1],Z=w[2],G=w[3];U=A(U,H,Z,G,B,7,u[0]),G=A(G,U,H,Z,T,12,u[1]),Z=A(Z,G,U,H,S,17,u[2]),H=A(H,Z,G,U,D,22,u[3]),U=A(U,H,Z,G,R,7,u[4]),G=A(G,U,H,Z,M,12,u[5]),Z=A(Z,G,U,H,L,17,u[6]),H=A(H,Z,G,U,P,22,u[7]),U=A(U,H,Z,G,F,7,u[8]),G=A(G,U,H,Z,z,12,u[9]),Z=A(Z,G,U,H,J,17,u[10]),H=A(H,Z,G,U,q,22,u[11]),U=A(U,H,Z,G,ne,7,u[12]),G=A(G,U,H,Z,j,12,u[13]),Z=A(Z,G,U,H,te,17,u[14]),H=A(H,Z,G,U,W,22,u[15]),U=p(U,H,Z,G,T,5,u[16]),G=p(G,U,H,Z,L,9,u[17]),Z=p(Z,G,U,H,q,14,u[18]),H=p(H,Z,G,U,B,20,u[19]),U=p(U,H,Z,G,M,5,u[20]),G=p(G,U,H,Z,J,9,u[21]),Z=p(Z,G,U,H,W,14,u[22]),H=p(H,Z,G,U,R,20,u[23]),U=p(U,H,Z,G,z,5,u[24]),G=p(G,U,H,Z,te,9,u[25]),Z=p(Z,G,U,H,D,14,u[26]),H=p(H,Z,G,U,F,20,u[27]),U=p(U,H,Z,G,j,5,u[28]),G=p(G,U,H,Z,S,9,u[29]),Z=p(Z,G,U,H,P,14,u[30]),H=p(H,Z,G,U,ne,20,u[31]),U=g(U,H,Z,G,M,4,u[32]),G=g(G,U,H,Z,F,11,u[33]),Z=g(Z,G,U,H,q,16,u[34]),H=g(H,Z,G,U,te,23,u[35]),U=g(U,H,Z,G,T,4,u[36]),G=g(G,U,H,Z,R,11,u[37]),Z=g(Z,G,U,H,P,16,u[38]),H=g(H,Z,G,U,J,23,u[39]),U=g(U,H,Z,G,j,4,u[40]),G=g(G,U,H,Z,B,11,u[41]),Z=g(Z,G,U,H,D,16,u[42]),H=g(H,Z,G,U,L,23,u[43]),U=g(U,H,Z,G,z,4,u[44]),G=g(G,U,H,Z,ne,11,u[45]),Z=g(Z,G,U,H,W,16,u[46]),H=g(H,Z,G,U,S,23,u[47]),U=m(U,H,Z,G,B,6,u[48]),G=m(G,U,H,Z,P,10,u[49]),Z=m(Z,G,U,H,te,15,u[50]),H=m(H,Z,G,U,M,21,u[51]),U=m(U,H,Z,G,ne,6,u[52]),G=m(G,U,H,Z,D,10,u[53]),Z=m(Z,G,U,H,J,15,u[54]),H=m(H,Z,G,U,T,21,u[55]),U=m(U,H,Z,G,F,6,u[56]),G=m(G,U,H,Z,W,10,u[57]),Z=m(Z,G,U,H,L,15,u[58]),H=m(H,Z,G,U,j,21,u[59]),U=m(U,H,Z,G,R,6,u[60]),G=m(G,U,H,Z,q,10,u[61]),Z=m(Z,G,U,H,S,15,u[62]),H=m(H,Z,G,U,z,21,u[63]),w[0]=w[0]+U|0,w[1]=w[1]+H|0,w[2]=w[2]+Z|0,w[3]=w[3]+G|0},_doFinalize:function(){var E=this._data,_=E.words,v=this._nDataBytes*8,C=E.sigBytes*8;_[C>>>5]|=128<<24-C%32;var x=n.floor(v/4294967296),w=v;_[(C+64>>>9<<4)+15]=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360,_[(C+64>>>9<<4)+14]=(w<<8|w>>>24)&16711935|(w<<24|w>>>8)&4278255360,E.sigBytes=(_.length+1)*4,this._process();for(var B=this._hash,T=B.words,S=0;S<4;S++){var D=T[S];T[S]=(D<<8|D>>>24)&16711935|(D<<24|D>>>8)&4278255360}return B},clone:function(){var E=l.clone.call(this);return E._hash=this._hash.clone(),E}});function A(E,_,v,C,x,w,B){var T=E+(_&v|~_&C)+x+B;return(T<<w|T>>>32-w)+_}function p(E,_,v,C,x,w,B){var T=E+(_&C|v&~C)+x+B;return(T<<w|T>>>32-w)+_}function g(E,_,v,C,x,w,B){var T=E+(_^v^C)+x+B;return(T<<w|T>>>32-w)+_}function m(E,_,v,C,x,w,B){var T=E+(v^(_|~C))+x+B;return(T<<w|T>>>32-w)+_}i.MD5=l._createHelper(d),i.HmacMD5=l._createHmacHelper(d)}(Math),t.MD5})}(rA)),rA.exports}var iA={exports:{}},sA;function aA(){return sA||(sA=1,function(r,e){(function(t,n){r.exports=n(Bt())})(xt,function(t){return function(){var n=t,i=n.lib,s=i.WordArray,o=i.Hasher,l=n.algo,h=[],u=l.SHA1=o.extend({_doReset:function(){this._hash=new s.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(d,A){for(var p=this._hash.words,g=p[0],m=p[1],E=p[2],_=p[3],v=p[4],C=0;C<80;C++){if(C<16)h[C]=d[A+C]|0;else{var x=h[C-3]^h[C-8]^h[C-14]^h[C-16];h[C]=x<<1|x>>>31}var w=(g<<5|g>>>27)+v+h[C];C<20?w+=(m&E|~m&_)+1518500249:C<40?w+=(m^E^_)+1859775393:C<60?w+=(m&E|m&_|E&_)-1894007588:w+=(m^E^_)-899497514,v=_,_=E,E=m<<30|m>>>2,m=g,g=w}p[0]=p[0]+g|0,p[1]=p[1]+m|0,p[2]=p[2]+E|0,p[3]=p[3]+_|0,p[4]=p[4]+v|0},_doFinalize:function(){var d=this._data,A=d.words,p=this._nDataBytes*8,g=d.sigBytes*8;return A[g>>>5]|=128<<24-g%32,A[(g+64>>>9<<4)+14]=Math.floor(p/4294967296),A[(g+64>>>9<<4)+15]=p,d.sigBytes=A.length*4,this._process(),this._hash},clone:function(){var d=o.clone.call(this);return d._hash=this._hash.clone(),d}});n.SHA1=o._createHelper(u),n.HmacSHA1=o._createHmacHelper(u)}(),t.SHA1})}(iA)),iA.exports}var oA={exports:{}},lA;function G8(){return lA||(lA=1,function(r,e){(function(t,n){r.exports=n(Bt())})(xt,function(t){return function(n){var i=t,s=i.lib,o=s.WordArray,l=s.Hasher,h=i.algo,u=[],d=[];(function(){function g(v){for(var C=n.sqrt(v),x=2;x<=C;x++)if(!(v%x))return!1;return!0}function m(v){return(v-(v|0))*4294967296|0}for(var E=2,_=0;_<64;)g(E)&&(_<8&&(u[_]=m(n.pow(E,1/2))),d[_]=m(n.pow(E,1/3)),_++),E++})();var A=[],p=h.SHA256=l.extend({_doReset:function(){this._hash=new o.init(u.slice(0))},_doProcessBlock:function(g,m){for(var E=this._hash.words,_=E[0],v=E[1],C=E[2],x=E[3],w=E[4],B=E[5],T=E[6],S=E[7],D=0;D<64;D++){if(D<16)A[D]=g[m+D]|0;else{var R=A[D-15],M=(R<<25|R>>>7)^(R<<14|R>>>18)^R>>>3,L=A[D-2],P=(L<<15|L>>>17)^(L<<13|L>>>19)^L>>>10;A[D]=M+A[D-7]+P+A[D-16]}var F=w&B^~w&T,z=_&v^_&C^v&C,J=(_<<30|_>>>2)^(_<<19|_>>>13)^(_<<10|_>>>22),q=(w<<26|w>>>6)^(w<<21|w>>>11)^(w<<7|w>>>25),ne=S+q+F+d[D]+A[D],j=J+z;S=T,T=B,B=w,w=x+ne|0,x=C,C=v,v=_,_=ne+j|0}E[0]=E[0]+_|0,E[1]=E[1]+v|0,E[2]=E[2]+C|0,E[3]=E[3]+x|0,E[4]=E[4]+w|0,E[5]=E[5]+B|0,E[6]=E[6]+T|0,E[7]=E[7]+S|0},_doFinalize:function(){var g=this._data,m=g.words,E=this._nDataBytes*8,_=g.sigBytes*8;return m[_>>>5]|=128<<24-_%32,m[(_+64>>>9<<4)+14]=n.floor(E/4294967296),m[(_+64>>>9<<4)+15]=E,g.sigBytes=m.length*4,this._process(),this._hash},clone:function(){var g=l.clone.call(this);return g._hash=this._hash.clone(),g}});i.SHA256=l._createHelper(p),i.HmacSHA256=l._createHmacHelper(p)}(Math),t.SHA256})}(oA)),oA.exports}var cA={exports:{}},uA;function BR(){return uA||(uA=1,function(r,e){(function(t,n,i){r.exports=n(Bt(),G8())})(xt,function(t){return function(){var n=t,i=n.lib,s=i.WordArray,o=n.algo,l=o.SHA256,h=o.SHA224=l.extend({_doReset:function(){this._hash=new s.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var u=l._doFinalize.call(this);return u.sigBytes-=4,u}});n.SHA224=l._createHelper(h),n.HmacSHA224=l._createHmacHelper(h)}(),t.SHA224})}(cA)),cA.exports}var hA={exports:{}},dA;function fA(){return dA||(dA=1,function(r,e){(function(t,n,i){r.exports=n(Bt(),cc())})(xt,function(t){return function(){var n=t,i=n.lib,s=i.Hasher,o=n.x64,l=o.Word,h=o.WordArray,u=n.algo;function d(){return l.create.apply(l,arguments)}var A=[d(1116352408,3609767458),d(1899447441,602891725),d(3049323471,3964484399),d(3921009573,2173295548),d(961987163,4081628472),d(1508970993,3053834265),d(2453635748,2937671579),d(2870763221,3664609560),d(3624381080,2734883394),d(310598401,1164996542),d(607225278,1323610764),d(1426881987,3590304994),d(1925078388,4068182383),d(2162078206,991336113),d(2614888103,633803317),d(3248222580,3479774868),d(3835390401,2666613458),d(4022224774,944711139),d(264347078,2341262773),d(604807628,2007800933),d(770255983,1495990901),d(1249150122,1856431235),d(1555081692,3175218132),d(1996064986,2198950837),d(2554220882,3999719339),d(2821834349,766784016),d(2952996808,2566594879),d(3210313671,3203337956),d(3336571891,1034457026),d(3584528711,2466948901),d(113926993,3758326383),d(338241895,168717936),d(666307205,1188179964),d(773529912,1546045734),d(1294757372,1522805485),d(1396182291,2643833823),d(1695183700,2343527390),d(1986661051,1014477480),d(2177026350,1206759142),d(2456956037,344077627),d(2730485921,1290863460),d(2820302411,3158454273),d(3259730800,3505952657),d(3345764771,106217008),d(3516065817,3606008344),d(3600352804,1432725776),d(4094571909,1467031594),d(275423344,851169720),d(430227734,3100823752),d(506948616,1363258195),d(659060556,3750685593),d(883997877,3785050280),d(958139571,3318307427),d(1322822218,3812723403),d(1537002063,2003034995),d(1747873779,3602036899),d(1955562222,1575990012),d(2024104815,1125592928),d(2227730452,2716904306),d(2361852424,442776044),d(2428436474,593698344),d(2756734187,3733110249),d(3204031479,2999351573),d(3329325298,3815920427),d(3391569614,3928383900),d(3515267271,566280711),d(3940187606,3454069534),d(4118630271,4000239992),d(116418474,1914138554),d(174292421,2731055270),d(289380356,3203993006),d(460393269,320620315),d(685471733,587496836),d(852142971,1086792851),d(1017036298,365543100),d(1126000580,2618297676),d(1288033470,3409855158),d(1501505948,4234509866),d(1607167915,987167468),d(1816402316,1246189591)],p=[];(function(){for(var m=0;m<80;m++)p[m]=d()})();var g=u.SHA512=s.extend({_doReset:function(){this._hash=new h.init([new l.init(1779033703,4089235720),new l.init(3144134277,2227873595),new l.init(1013904242,4271175723),new l.init(2773480762,1595750129),new l.init(1359893119,2917565137),new l.init(2600822924,725511199),new l.init(528734635,4215389547),new l.init(1541459225,327033209)])},_doProcessBlock:function(m,E){for(var _=this._hash.words,v=_[0],C=_[1],x=_[2],w=_[3],B=_[4],T=_[5],S=_[6],D=_[7],R=v.high,M=v.low,L=C.high,P=C.low,F=x.high,z=x.low,J=w.high,q=w.low,ne=B.high,j=B.low,te=T.high,W=T.low,U=S.high,H=S.low,Z=D.high,G=D.low,oe=R,pe=M,Ae=L,ge=P,Re=F,Fe=z,st=J,ut=q,mt=ne,X=j,h0=te,pt=W,At=U,qe=H,Mt=Z,Ye=G,Q=0;Q<80;Q++){var k,se,ye=p[Q];if(Q<16)se=ye.high=m[E+Q*2]|0,k=ye.low=m[E+Q*2+1]|0;else{var Ee=p[Q-15],_e=Ee.high,Ge=Ee.low,Le=(_e>>>1|Ge<<31)^(_e>>>8|Ge<<24)^_e>>>7,Ve=(Ge>>>1|_e<<31)^(Ge>>>8|_e<<24)^(Ge>>>7|_e<<25),gt=p[Q-2],we=gt.high,Pe=gt.low,nt=(we>>>19|Pe<<13)^(we<<3|Pe>>>29)^we>>>6,et=(Pe>>>19|we<<13)^(Pe<<3|we>>>29)^(Pe>>>6|we<<26),he=p[Q-7],Oe=he.high,ke=he.low,ht=p[Q-16],$=ht.high,Se=ht.low;k=Ve+ke,se=Le+Oe+(k>>>0<Ve>>>0?1:0),k=k+et,se=se+nt+(k>>>0<et>>>0?1:0),k=k+Se,se=se+$+(k>>>0<Se>>>0?1:0),ye.high=se,ye.low=k}var ue=mt&h0^~mt&At,ve=X&pt^~X&qe,De=oe&Ae^oe&Re^Ae&Re,Be=pe&ge^pe&Fe^ge&Fe,it=(oe>>>28|pe<<4)^(oe<<30|pe>>>2)^(oe<<25|pe>>>7),jt=(pe>>>28|oe<<4)^(pe<<30|oe>>>2)^(pe<<25|oe>>>7),y0=(mt>>>14|X<<18)^(mt>>>18|X<<14)^(mt<<23|X>>>9),Rt=(X>>>14|mt<<18)^(X>>>18|mt<<14)^(X<<23|mt>>>9),lr=A[Q],cr=lr.high,Xi=lr.low,m0=Ye+Rt,$0=Mt+y0+(m0>>>0<Ye>>>0?1:0),m0=m0+ve,$0=$0+ue+(m0>>>0<ve>>>0?1:0),m0=m0+Xi,$0=$0+cr+(m0>>>0<Xi>>>0?1:0),m0=m0+k,$0=$0+se+(m0>>>0<k>>>0?1:0),Tn=jt+Be,Ji=it+De+(Tn>>>0<jt>>>0?1:0);Mt=At,Ye=qe,At=h0,qe=pt,h0=mt,pt=X,X=ut+m0|0,mt=st+$0+(X>>>0<ut>>>0?1:0)|0,st=Re,ut=Fe,Re=Ae,Fe=ge,Ae=oe,ge=pe,pe=m0+Tn|0,oe=$0+Ji+(pe>>>0<m0>>>0?1:0)|0}M=v.low=M+pe,v.high=R+oe+(M>>>0<pe>>>0?1:0),P=C.low=P+ge,C.high=L+Ae+(P>>>0<ge>>>0?1:0),z=x.low=z+Fe,x.high=F+Re+(z>>>0<Fe>>>0?1:0),q=w.low=q+ut,w.high=J+st+(q>>>0<ut>>>0?1:0),j=B.low=j+X,B.high=ne+mt+(j>>>0<X>>>0?1:0),W=T.low=W+pt,T.high=te+h0+(W>>>0<pt>>>0?1:0),H=S.low=H+qe,S.high=U+At+(H>>>0<qe>>>0?1:0),G=D.low=G+Ye,D.high=Z+Mt+(G>>>0<Ye>>>0?1:0)},_doFinalize:function(){var m=this._data,E=m.words,_=this._nDataBytes*8,v=m.sigBytes*8;E[v>>>5]|=128<<24-v%32,E[(v+128>>>10<<5)+30]=Math.floor(_/4294967296),E[(v+128>>>10<<5)+31]=_,m.sigBytes=E.length*4,this._process();var C=this._hash.toX32();return C},clone:function(){var m=s.clone.call(this);return m._hash=this._hash.clone(),m},blockSize:1024/32});n.SHA512=s._createHelper(g),n.HmacSHA512=s._createHmacHelper(g)}(),t.SHA512})}(hA)),hA.exports}var pA={exports:{}},AA;function bR(){return AA||(AA=1,function(r,e){(function(t,n,i){r.exports=n(Bt(),cc(),fA())})(xt,function(t){return function(){var n=t,i=n.x64,s=i.Word,o=i.WordArray,l=n.algo,h=l.SHA512,u=l.SHA384=h.extend({_doReset:function(){this._hash=new o.init([new s.init(3418070365,3238371032),new s.init(1654270250,914150663),new s.init(2438529370,812702999),new s.init(355462360,4144912697),new s.init(1731405415,4290775857),new s.init(2394180231,1750603025),new s.init(3675008525,1694076839),new s.init(1203062813,3204075428)])},_doFinalize:function(){var d=h._doFinalize.call(this);return d.sigBytes-=16,d}});n.SHA384=h._createHelper(u),n.HmacSHA384=h._createHmacHelper(u)}(),t.SHA384})}(pA)),pA.exports}var gA={exports:{}},mA;function RR(){return mA||(mA=1,function(r,e){(function(t,n,i){r.exports=n(Bt(),cc())})(xt,function(t){return function(n){var i=t,s=i.lib,o=s.WordArray,l=s.Hasher,h=i.x64,u=h.Word,d=i.algo,A=[],p=[],g=[];(function(){for(var _=1,v=0,C=0;C<24;C++){A[_+5*v]=(C+1)*(C+2)/2%64;var x=v%5,w=(2*_+3*v)%5;_=x,v=w}for(var _=0;_<5;_++)for(var v=0;v<5;v++)p[_+5*v]=v+(2*_+3*v)%5*5;for(var B=1,T=0;T<24;T++){for(var S=0,D=0,R=0;R<7;R++){if(B&1){var M=(1<<R)-1;M<32?D^=1<<M:S^=1<<M-32}B&128?B=B<<1^113:B<<=1}g[T]=u.create(S,D)}})();var m=[];(function(){for(var _=0;_<25;_++)m[_]=u.create()})();var E=d.SHA3=l.extend({cfg:l.cfg.extend({outputLength:512}),_doReset:function(){for(var _=this._state=[],v=0;v<25;v++)_[v]=new u.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(_,v){for(var C=this._state,x=this.blockSize/2,w=0;w<x;w++){var B=_[v+2*w],T=_[v+2*w+1];B=(B<<8|B>>>24)&16711935|(B<<24|B>>>8)&4278255360,T=(T<<8|T>>>24)&16711935|(T<<24|T>>>8)&4278255360;var S=C[w];S.high^=T,S.low^=B}for(var D=0;D<24;D++){for(var R=0;R<5;R++){for(var M=0,L=0,P=0;P<5;P++){var S=C[R+5*P];M^=S.high,L^=S.low}var F=m[R];F.high=M,F.low=L}for(var R=0;R<5;R++)for(var z=m[(R+4)%5],J=m[(R+1)%5],q=J.high,ne=J.low,M=z.high^(q<<1|ne>>>31),L=z.low^(ne<<1|q>>>31),P=0;P<5;P++){var S=C[R+5*P];S.high^=M,S.low^=L}for(var j=1;j<25;j++){var M,L,S=C[j],te=S.high,W=S.low,U=A[j];U<32?(M=te<<U|W>>>32-U,L=W<<U|te>>>32-U):(M=W<<U-32|te>>>64-U,L=te<<U-32|W>>>64-U);var H=m[p[j]];H.high=M,H.low=L}var Z=m[0],G=C[0];Z.high=G.high,Z.low=G.low;for(var R=0;R<5;R++)for(var P=0;P<5;P++){var j=R+5*P,S=C[j],oe=m[j],pe=m[(R+1)%5+5*P],Ae=m[(R+2)%5+5*P];S.high=oe.high^~pe.high&Ae.high,S.low=oe.low^~pe.low&Ae.low}var S=C[0],ge=g[D];S.high^=ge.high,S.low^=ge.low}},_doFinalize:function(){var _=this._data,v=_.words;this._nDataBytes*8;var C=_.sigBytes*8,x=this.blockSize*32;v[C>>>5]|=1<<24-C%32,v[(n.ceil((C+1)/x)*x>>>5)-1]|=128,_.sigBytes=v.length*4,this._process();for(var w=this._state,B=this.cfg.outputLength/8,T=B/8,S=[],D=0;D<T;D++){var R=w[D],M=R.high,L=R.low;M=(M<<8|M>>>24)&16711935|(M<<24|M>>>8)&4278255360,L=(L<<8|L>>>24)&16711935|(L<<24|L>>>8)&4278255360,S.push(L),S.push(M)}return new o.init(S,B)},clone:function(){for(var _=l.clone.call(this),v=_._state=this._state.slice(0),C=0;C<25;C++)v[C]=v[C].clone();return _}});i.SHA3=l._createHelper(E),i.HmacSHA3=l._createHmacHelper(E)}(Math),t.SHA3})}(gA)),gA.exports}var vA={exports:{}},_A;function DR(){return _A||(_A=1,function(r,e){(function(t,n){r.exports=n(Bt())})(xt,function(t){/** @preserve
3958
+ `;continue}if((R=D.match(x))&&(S.gamma=parseFloat(R[1])),(R=D.match(w))&&(S.exposure=parseFloat(R[1])),(R=D.match(B))&&(S.valid|=2,S.format=R[1]),(R=D.match(T))&&(S.valid|=4,S.height=parseInt(R[1],10),S.width=parseInt(R[2],10)),S.valid&2&&S.valid&4)break}return S.valid&2||t(3,"missing format specifier"),S.valid&4||t(3,"missing image size specifier"),S},o=function(v,C,x){const w=C;if(w<8||w>32767||v[0]!==2||v[1]!==2||v[2]&128)return new Uint8Array(v);w!==(v[2]<<8|v[3])&&t(3,"wrong scanline width");const B=new Uint8Array(4*C*x);B.length||t(4,"unable to allocate buffer space");let T=0,S=0;const D=4*w,R=new Uint8Array(4),M=new Uint8Array(D);let L=x;for(;L>0&&S<v.byteLength;){S+4>v.byteLength&&t(1),R[0]=v[S++],R[1]=v[S++],R[2]=v[S++],R[3]=v[S++],(R[0]!=2||R[1]!=2||(R[2]<<8|R[3])!=w)&&t(3,"bad rgbe scanline format");let P=0,F;for(;P<D&&S<v.byteLength;){F=v[S++];const J=F>128;if(J&&(F-=128),(F===0||P+F>D)&&t(3,"bad scanline data"),J){const q=v[S++];for(let ne=0;ne<F;ne++)M[P++]=q}else M.set(v.subarray(S,S+F),P),P+=F,S+=F}const z=w;for(let J=0;J<z;J++){let q=0;B[T]=M[J+q],q+=w,B[T+1]=M[J+q],q+=w,B[T+2]=M[J+q],q+=w,B[T+3]=M[J+q],T+=4}L--}return B},l=function(v,C,x,w){const B=v[C+3],T=Math.pow(2,B-128)/255;x[w+0]=v[C+0]*T,x[w+1]=v[C+1]*T,x[w+2]=v[C+2]*T,x[w+3]=1},h=function(v,C,x,w){const B=v[C+3],T=Math.pow(2,B-128)/255;x[w+0]=bo.toHalfFloat(Math.min(v[C+0]*T,65504)),x[w+1]=bo.toHalfFloat(Math.min(v[C+1]*T,65504)),x[w+2]=bo.toHalfFloat(Math.min(v[C+2]*T,65504)),x[w+3]=bo.toHalfFloat(1)},u=new Uint8Array(e);u.pos=0;const d=s(u),A=d.width,p=d.height,g=o(u.subarray(u.pos),A,p);let m,E,_;switch(this.type){case Jt:_=g.length/4;const v=new Float32Array(_*4);for(let x=0;x<_;x++)l(g,x*4,v,x*4);m=v,E=Jt;break;case p0:_=g.length/4;const C=new Uint16Array(_*4);for(let x=0;x<_;x++)h(g,x*4,C,x*4);m=C,E=p0;break;default:throw new Error("THREE.RGBELoader: Unsupported type: "+this.type)}return{width:A,height:p,data:m,header:d.string,gamma:d.gamma,exposure:d.exposure,type:E}}setDataType(e){return this.type=e,this}load(e,t,n,i){function s(o,l){switch(o.type){case Jt:case p0:o.colorSpace=j0,o.minFilter=Gt,o.magFilter=Gt,o.generateMipmaps=!1,o.flipY=!0;break}t&&t(o,l)}return super.load(e,s,n,i)}}var xt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function yR(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function ER(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 Hp={exports:{}};function xR(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 Vp={exports:{}};const wR={},CR=Object.freeze(Object.defineProperty({__proto__:null,default:wR},Symbol.toStringTag,{value:"Module"})),IR=ER(CR);var jp;function Bt(){return jp||(jp=1,function(r,e){(function(t,n){r.exports=n()})(xt,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 xt<"u"&&xt.crypto&&(s=xt.crypto),!s&&typeof xR=="function")try{s=IR}catch{}var o=function(){if(s){if(typeof s.getRandomValues=="function")try{return s.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof s.randomBytes=="function")try{return s.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},l=Object.create||function(){function C(){}return function(x){var w;return C.prototype=x,w=new C,C.prototype=null,w}}(),h={},u=h.lib={},d=u.Base=function(){return{extend:function(C){var x=l(this);return C&&x.mixIn(C),(!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 C=this.extend();return C.init.apply(C,arguments),C},init:function(){},mixIn:function(C){for(var x in C)C.hasOwnProperty(x)&&(this[x]=C[x]);C.hasOwnProperty("toString")&&(this.toString=C.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),A=u.WordArray=d.extend({init:function(C,x){C=this.words=C||[],x!=i?this.sigBytes=x:this.sigBytes=C.length*4},toString:function(C){return(C||g).stringify(this)},concat:function(C){var x=this.words,w=C.words,B=this.sigBytes,T=C.sigBytes;if(this.clamp(),B%4)for(var S=0;S<T;S++){var D=w[S>>>2]>>>24-S%4*8&255;x[B+S>>>2]|=D<<24-(B+S)%4*8}else for(var R=0;R<T;R+=4)x[B+R>>>2]=w[R>>>2];return this.sigBytes+=T,this},clamp:function(){var C=this.words,x=this.sigBytes;C[x>>>2]&=4294967295<<32-x%4*8,C.length=n.ceil(x/4)},clone:function(){var C=d.clone.call(this);return C.words=this.words.slice(0),C},random:function(C){for(var x=[],w=0;w<C;w+=4)x.push(o());return new A.init(x,C)}}),p=h.enc={},g=p.Hex={stringify:function(C){for(var x=C.words,w=C.sigBytes,B=[],T=0;T<w;T++){var S=x[T>>>2]>>>24-T%4*8&255;B.push((S>>>4).toString(16)),B.push((S&15).toString(16))}return B.join("")},parse:function(C){for(var x=C.length,w=[],B=0;B<x;B+=2)w[B>>>3]|=parseInt(C.substr(B,2),16)<<24-B%8*4;return new A.init(w,x/2)}},m=p.Latin1={stringify:function(C){for(var x=C.words,w=C.sigBytes,B=[],T=0;T<w;T++){var S=x[T>>>2]>>>24-T%4*8&255;B.push(String.fromCharCode(S))}return B.join("")},parse:function(C){for(var x=C.length,w=[],B=0;B<x;B++)w[B>>>2]|=(C.charCodeAt(B)&255)<<24-B%4*8;return new A.init(w,x)}},E=p.Utf8={stringify:function(C){try{return decodeURIComponent(escape(m.stringify(C)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(C){return m.parse(unescape(encodeURIComponent(C)))}},_=u.BufferedBlockAlgorithm=d.extend({reset:function(){this._data=new A.init,this._nDataBytes=0},_append:function(C){typeof C=="string"&&(C=E.parse(C)),this._data.concat(C),this._nDataBytes+=C.sigBytes},_process:function(C){var x,w=this._data,B=w.words,T=w.sigBytes,S=this.blockSize,D=S*4,R=T/D;C?R=n.ceil(R):R=n.max((R|0)-this._minBufferSize,0);var M=R*S,L=n.min(M*4,T);if(M){for(var P=0;P<M;P+=S)this._doProcessBlock(B,P);x=B.splice(0,M),w.sigBytes-=L}return new A.init(x,L)},clone:function(){var C=d.clone.call(this);return C._data=this._data.clone(),C},_minBufferSize:0});u.Hasher=_.extend({cfg:d.extend(),init:function(C){this.cfg=this.cfg.extend(C),this.reset()},reset:function(){_.reset.call(this),this._doReset()},update:function(C){return this._append(C),this._process(),this},finalize:function(C){C&&this._append(C);var x=this._doFinalize();return x},blockSize:16,_createHelper:function(C){return function(x,w){return new C.init(w).finalize(x)}},_createHmacHelper:function(C){return function(x,w){return new v.HMAC.init(C,w).finalize(x)}}});var v=h.algo={};return h}(Math);return t})}(Vp)),Vp.exports}var Wp={exports:{}},Yp;function cc(){return Yp||(Yp=1,function(r,e){(function(t,n){r.exports=n(Bt())})(xt,function(t){return function(n){var i=t,s=i.lib,o=s.Base,l=s.WordArray,h=i.x64={};h.Word=o.extend({init:function(u,d){this.high=u,this.low=d}}),h.WordArray=o.extend({init:function(u,d){u=this.words=u||[],d!=n?this.sigBytes=d:this.sigBytes=u.length*8},toX32:function(){for(var u=this.words,d=u.length,A=[],p=0;p<d;p++){var g=u[p];A.push(g.high),A.push(g.low)}return l.create(A,this.sigBytes)},clone:function(){for(var u=o.clone.call(this),d=u.words=this.words.slice(0),A=d.length,p=0;p<A;p++)d[p]=d[p].clone();return u}})}(),t})}(Wp)),Wp.exports}var qp={exports:{}},Xp;function MR(){return Xp||(Xp=1,function(r,e){(function(t,n){r.exports=n(Bt())})(xt,function(t){return function(){if(typeof ArrayBuffer=="function"){var n=t,i=n.lib,s=i.WordArray,o=s.init,l=s.init=function(h){if(h instanceof ArrayBuffer&&(h=new Uint8Array(h)),(h instanceof Int8Array||typeof Uint8ClampedArray<"u"&&h instanceof Uint8ClampedArray||h instanceof Int16Array||h instanceof Uint16Array||h instanceof Int32Array||h instanceof Uint32Array||h instanceof Float32Array||h instanceof Float64Array)&&(h=new Uint8Array(h.buffer,h.byteOffset,h.byteLength)),h instanceof Uint8Array){for(var u=h.byteLength,d=[],A=0;A<u;A++)d[A>>>2]|=h[A]<<24-A%4*8;o.call(this,d,u)}else o.apply(this,arguments)};l.prototype=s}}(),t.lib.WordArray})}(qp)),qp.exports}var Jp={exports:{}},Kp;function SR(){return Kp||(Kp=1,function(r,e){(function(t,n){r.exports=n(Bt())})(xt,function(t){return function(){var n=t,i=n.lib,s=i.WordArray,o=n.enc;o.Utf16=o.Utf16BE={stringify:function(h){for(var u=h.words,d=h.sigBytes,A=[],p=0;p<d;p+=2){var g=u[p>>>2]>>>16-p%4*8&65535;A.push(String.fromCharCode(g))}return A.join("")},parse:function(h){for(var u=h.length,d=[],A=0;A<u;A++)d[A>>>1]|=h.charCodeAt(A)<<16-A%2*16;return s.create(d,u*2)}},o.Utf16LE={stringify:function(h){for(var u=h.words,d=h.sigBytes,A=[],p=0;p<d;p+=2){var g=l(u[p>>>2]>>>16-p%4*8&65535);A.push(String.fromCharCode(g))}return A.join("")},parse:function(h){for(var u=h.length,d=[],A=0;A<u;A++)d[A>>>1]|=l(h.charCodeAt(A)<<16-A%2*16);return s.create(d,u*2)}};function l(h){return h<<8&4278255360|h>>>8&16711935}}(),t.enc.Utf16})}(Jp)),Jp.exports}var Zp={exports:{}},$p;function Da(){return $p||($p=1,function(r,e){(function(t,n){r.exports=n(Bt())})(xt,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 m=u[g>>>2]>>>24-g%4*8&255,E=u[g+1>>>2]>>>24-(g+1)%4*8&255,_=u[g+2>>>2]>>>24-(g+2)%4*8&255,v=m<<16|E<<8|_,C=0;C<4&&g+C*.75<d;C++)p.push(A.charAt(v>>>6*(3-C)&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 m=h.indexOf(g);m!==-1&&(u=m)}return l(h,u,A)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function l(h,u,d){for(var A=[],p=0,g=0;g<u;g++)if(g%4){var m=d[h.charCodeAt(g-1)]<<g%4*2,E=d[h.charCodeAt(g)]>>>6-g%4*2,_=m|E;A[p>>>2]|=_<<24-p%4*8,p++}return s.create(A,p)}}(),t.enc.Base64})}(Zp)),Zp.exports}var eA={exports:{}},tA;function TR(){return tA||(tA=1,function(r,e){(function(t,n){r.exports=n(Bt())})(xt,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=[],m=0;m<A;m+=3)for(var E=d[m>>>2]>>>24-m%4*8&255,_=d[m+1>>>2]>>>24-(m+1)%4*8&255,v=d[m+2>>>2]>>>24-(m+2)%4*8&255,C=E<<16|_<<8|v,x=0;x<4&&m+x*.75<A;x++)g.push(p.charAt(C>>>6*(3-x)&63));var w=p.charAt(64);if(w)for(;g.length%4;)g.push(w);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 m=A.charAt(64);if(m){var E=h.indexOf(m);E!==-1&&(d=E)}return l(h,d,p)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"};function l(h,u,d){for(var A=[],p=0,g=0;g<u;g++)if(g%4){var m=d[h.charCodeAt(g-1)]<<g%4*2,E=d[h.charCodeAt(g)]>>>6-g%4*2,_=m|E;A[p>>>2]|=_<<24-p%4*8,p++}return s.create(A,p)}}(),t.enc.Base64url})}(eA)),eA.exports}var rA={exports:{}},nA;function La(){return nA||(nA=1,function(r,e){(function(t,n){r.exports=n(Bt())})(xt,function(t){return function(n){var i=t,s=i.lib,o=s.WordArray,l=s.Hasher,h=i.algo,u=[];(function(){for(var E=0;E<64;E++)u[E]=n.abs(n.sin(E+1))*4294967296|0})();var d=h.MD5=l.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(E,_){for(var v=0;v<16;v++){var C=_+v,x=E[C];E[C]=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360}var w=this._hash.words,B=E[_+0],T=E[_+1],S=E[_+2],D=E[_+3],R=E[_+4],M=E[_+5],L=E[_+6],P=E[_+7],F=E[_+8],z=E[_+9],J=E[_+10],q=E[_+11],ne=E[_+12],j=E[_+13],te=E[_+14],W=E[_+15],U=w[0],H=w[1],Z=w[2],G=w[3];U=A(U,H,Z,G,B,7,u[0]),G=A(G,U,H,Z,T,12,u[1]),Z=A(Z,G,U,H,S,17,u[2]),H=A(H,Z,G,U,D,22,u[3]),U=A(U,H,Z,G,R,7,u[4]),G=A(G,U,H,Z,M,12,u[5]),Z=A(Z,G,U,H,L,17,u[6]),H=A(H,Z,G,U,P,22,u[7]),U=A(U,H,Z,G,F,7,u[8]),G=A(G,U,H,Z,z,12,u[9]),Z=A(Z,G,U,H,J,17,u[10]),H=A(H,Z,G,U,q,22,u[11]),U=A(U,H,Z,G,ne,7,u[12]),G=A(G,U,H,Z,j,12,u[13]),Z=A(Z,G,U,H,te,17,u[14]),H=A(H,Z,G,U,W,22,u[15]),U=p(U,H,Z,G,T,5,u[16]),G=p(G,U,H,Z,L,9,u[17]),Z=p(Z,G,U,H,q,14,u[18]),H=p(H,Z,G,U,B,20,u[19]),U=p(U,H,Z,G,M,5,u[20]),G=p(G,U,H,Z,J,9,u[21]),Z=p(Z,G,U,H,W,14,u[22]),H=p(H,Z,G,U,R,20,u[23]),U=p(U,H,Z,G,z,5,u[24]),G=p(G,U,H,Z,te,9,u[25]),Z=p(Z,G,U,H,D,14,u[26]),H=p(H,Z,G,U,F,20,u[27]),U=p(U,H,Z,G,j,5,u[28]),G=p(G,U,H,Z,S,9,u[29]),Z=p(Z,G,U,H,P,14,u[30]),H=p(H,Z,G,U,ne,20,u[31]),U=g(U,H,Z,G,M,4,u[32]),G=g(G,U,H,Z,F,11,u[33]),Z=g(Z,G,U,H,q,16,u[34]),H=g(H,Z,G,U,te,23,u[35]),U=g(U,H,Z,G,T,4,u[36]),G=g(G,U,H,Z,R,11,u[37]),Z=g(Z,G,U,H,P,16,u[38]),H=g(H,Z,G,U,J,23,u[39]),U=g(U,H,Z,G,j,4,u[40]),G=g(G,U,H,Z,B,11,u[41]),Z=g(Z,G,U,H,D,16,u[42]),H=g(H,Z,G,U,L,23,u[43]),U=g(U,H,Z,G,z,4,u[44]),G=g(G,U,H,Z,ne,11,u[45]),Z=g(Z,G,U,H,W,16,u[46]),H=g(H,Z,G,U,S,23,u[47]),U=m(U,H,Z,G,B,6,u[48]),G=m(G,U,H,Z,P,10,u[49]),Z=m(Z,G,U,H,te,15,u[50]),H=m(H,Z,G,U,M,21,u[51]),U=m(U,H,Z,G,ne,6,u[52]),G=m(G,U,H,Z,D,10,u[53]),Z=m(Z,G,U,H,J,15,u[54]),H=m(H,Z,G,U,T,21,u[55]),U=m(U,H,Z,G,F,6,u[56]),G=m(G,U,H,Z,W,10,u[57]),Z=m(Z,G,U,H,L,15,u[58]),H=m(H,Z,G,U,j,21,u[59]),U=m(U,H,Z,G,R,6,u[60]),G=m(G,U,H,Z,q,10,u[61]),Z=m(Z,G,U,H,S,15,u[62]),H=m(H,Z,G,U,z,21,u[63]),w[0]=w[0]+U|0,w[1]=w[1]+H|0,w[2]=w[2]+Z|0,w[3]=w[3]+G|0},_doFinalize:function(){var E=this._data,_=E.words,v=this._nDataBytes*8,C=E.sigBytes*8;_[C>>>5]|=128<<24-C%32;var x=n.floor(v/4294967296),w=v;_[(C+64>>>9<<4)+15]=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360,_[(C+64>>>9<<4)+14]=(w<<8|w>>>24)&16711935|(w<<24|w>>>8)&4278255360,E.sigBytes=(_.length+1)*4,this._process();for(var B=this._hash,T=B.words,S=0;S<4;S++){var D=T[S];T[S]=(D<<8|D>>>24)&16711935|(D<<24|D>>>8)&4278255360}return B},clone:function(){var E=l.clone.call(this);return E._hash=this._hash.clone(),E}});function A(E,_,v,C,x,w,B){var T=E+(_&v|~_&C)+x+B;return(T<<w|T>>>32-w)+_}function p(E,_,v,C,x,w,B){var T=E+(_&C|v&~C)+x+B;return(T<<w|T>>>32-w)+_}function g(E,_,v,C,x,w,B){var T=E+(_^v^C)+x+B;return(T<<w|T>>>32-w)+_}function m(E,_,v,C,x,w,B){var T=E+(v^(_|~C))+x+B;return(T<<w|T>>>32-w)+_}i.MD5=l._createHelper(d),i.HmacMD5=l._createHmacHelper(d)}(Math),t.MD5})}(rA)),rA.exports}var iA={exports:{}},sA;function aA(){return sA||(sA=1,function(r,e){(function(t,n){r.exports=n(Bt())})(xt,function(t){return function(){var n=t,i=n.lib,s=i.WordArray,o=i.Hasher,l=n.algo,h=[],u=l.SHA1=o.extend({_doReset:function(){this._hash=new s.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(d,A){for(var p=this._hash.words,g=p[0],m=p[1],E=p[2],_=p[3],v=p[4],C=0;C<80;C++){if(C<16)h[C]=d[A+C]|0;else{var x=h[C-3]^h[C-8]^h[C-14]^h[C-16];h[C]=x<<1|x>>>31}var w=(g<<5|g>>>27)+v+h[C];C<20?w+=(m&E|~m&_)+1518500249:C<40?w+=(m^E^_)+1859775393:C<60?w+=(m&E|m&_|E&_)-1894007588:w+=(m^E^_)-899497514,v=_,_=E,E=m<<30|m>>>2,m=g,g=w}p[0]=p[0]+g|0,p[1]=p[1]+m|0,p[2]=p[2]+E|0,p[3]=p[3]+_|0,p[4]=p[4]+v|0},_doFinalize:function(){var d=this._data,A=d.words,p=this._nDataBytes*8,g=d.sigBytes*8;return A[g>>>5]|=128<<24-g%32,A[(g+64>>>9<<4)+14]=Math.floor(p/4294967296),A[(g+64>>>9<<4)+15]=p,d.sigBytes=A.length*4,this._process(),this._hash},clone:function(){var d=o.clone.call(this);return d._hash=this._hash.clone(),d}});n.SHA1=o._createHelper(u),n.HmacSHA1=o._createHmacHelper(u)}(),t.SHA1})}(iA)),iA.exports}var oA={exports:{}},lA;function G8(){return lA||(lA=1,function(r,e){(function(t,n){r.exports=n(Bt())})(xt,function(t){return function(n){var i=t,s=i.lib,o=s.WordArray,l=s.Hasher,h=i.algo,u=[],d=[];(function(){function g(v){for(var C=n.sqrt(v),x=2;x<=C;x++)if(!(v%x))return!1;return!0}function m(v){return(v-(v|0))*4294967296|0}for(var E=2,_=0;_<64;)g(E)&&(_<8&&(u[_]=m(n.pow(E,1/2))),d[_]=m(n.pow(E,1/3)),_++),E++})();var A=[],p=h.SHA256=l.extend({_doReset:function(){this._hash=new o.init(u.slice(0))},_doProcessBlock:function(g,m){for(var E=this._hash.words,_=E[0],v=E[1],C=E[2],x=E[3],w=E[4],B=E[5],T=E[6],S=E[7],D=0;D<64;D++){if(D<16)A[D]=g[m+D]|0;else{var R=A[D-15],M=(R<<25|R>>>7)^(R<<14|R>>>18)^R>>>3,L=A[D-2],P=(L<<15|L>>>17)^(L<<13|L>>>19)^L>>>10;A[D]=M+A[D-7]+P+A[D-16]}var F=w&B^~w&T,z=_&v^_&C^v&C,J=(_<<30|_>>>2)^(_<<19|_>>>13)^(_<<10|_>>>22),q=(w<<26|w>>>6)^(w<<21|w>>>11)^(w<<7|w>>>25),ne=S+q+F+d[D]+A[D],j=J+z;S=T,T=B,B=w,w=x+ne|0,x=C,C=v,v=_,_=ne+j|0}E[0]=E[0]+_|0,E[1]=E[1]+v|0,E[2]=E[2]+C|0,E[3]=E[3]+x|0,E[4]=E[4]+w|0,E[5]=E[5]+B|0,E[6]=E[6]+T|0,E[7]=E[7]+S|0},_doFinalize:function(){var g=this._data,m=g.words,E=this._nDataBytes*8,_=g.sigBytes*8;return m[_>>>5]|=128<<24-_%32,m[(_+64>>>9<<4)+14]=n.floor(E/4294967296),m[(_+64>>>9<<4)+15]=E,g.sigBytes=m.length*4,this._process(),this._hash},clone:function(){var g=l.clone.call(this);return g._hash=this._hash.clone(),g}});i.SHA256=l._createHelper(p),i.HmacSHA256=l._createHmacHelper(p)}(Math),t.SHA256})}(oA)),oA.exports}var cA={exports:{}},uA;function BR(){return uA||(uA=1,function(r,e){(function(t,n,i){r.exports=n(Bt(),G8())})(xt,function(t){return function(){var n=t,i=n.lib,s=i.WordArray,o=n.algo,l=o.SHA256,h=o.SHA224=l.extend({_doReset:function(){this._hash=new s.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var u=l._doFinalize.call(this);return u.sigBytes-=4,u}});n.SHA224=l._createHelper(h),n.HmacSHA224=l._createHmacHelper(h)}(),t.SHA224})}(cA)),cA.exports}var hA={exports:{}},dA;function fA(){return dA||(dA=1,function(r,e){(function(t,n,i){r.exports=n(Bt(),cc())})(xt,function(t){return function(){var n=t,i=n.lib,s=i.Hasher,o=n.x64,l=o.Word,h=o.WordArray,u=n.algo;function d(){return l.create.apply(l,arguments)}var A=[d(1116352408,3609767458),d(1899447441,602891725),d(3049323471,3964484399),d(3921009573,2173295548),d(961987163,4081628472),d(1508970993,3053834265),d(2453635748,2937671579),d(2870763221,3664609560),d(3624381080,2734883394),d(310598401,1164996542),d(607225278,1323610764),d(1426881987,3590304994),d(1925078388,4068182383),d(2162078206,991336113),d(2614888103,633803317),d(3248222580,3479774868),d(3835390401,2666613458),d(4022224774,944711139),d(264347078,2341262773),d(604807628,2007800933),d(770255983,1495990901),d(1249150122,1856431235),d(1555081692,3175218132),d(1996064986,2198950837),d(2554220882,3999719339),d(2821834349,766784016),d(2952996808,2566594879),d(3210313671,3203337956),d(3336571891,1034457026),d(3584528711,2466948901),d(113926993,3758326383),d(338241895,168717936),d(666307205,1188179964),d(773529912,1546045734),d(1294757372,1522805485),d(1396182291,2643833823),d(1695183700,2343527390),d(1986661051,1014477480),d(2177026350,1206759142),d(2456956037,344077627),d(2730485921,1290863460),d(2820302411,3158454273),d(3259730800,3505952657),d(3345764771,106217008),d(3516065817,3606008344),d(3600352804,1432725776),d(4094571909,1467031594),d(275423344,851169720),d(430227734,3100823752),d(506948616,1363258195),d(659060556,3750685593),d(883997877,3785050280),d(958139571,3318307427),d(1322822218,3812723403),d(1537002063,2003034995),d(1747873779,3602036899),d(1955562222,1575990012),d(2024104815,1125592928),d(2227730452,2716904306),d(2361852424,442776044),d(2428436474,593698344),d(2756734187,3733110249),d(3204031479,2999351573),d(3329325298,3815920427),d(3391569614,3928383900),d(3515267271,566280711),d(3940187606,3454069534),d(4118630271,4000239992),d(116418474,1914138554),d(174292421,2731055270),d(289380356,3203993006),d(460393269,320620315),d(685471733,587496836),d(852142971,1086792851),d(1017036298,365543100),d(1126000580,2618297676),d(1288033470,3409855158),d(1501505948,4234509866),d(1607167915,987167468),d(1816402316,1246189591)],p=[];(function(){for(var m=0;m<80;m++)p[m]=d()})();var g=u.SHA512=s.extend({_doReset:function(){this._hash=new h.init([new l.init(1779033703,4089235720),new l.init(3144134277,2227873595),new l.init(1013904242,4271175723),new l.init(2773480762,1595750129),new l.init(1359893119,2917565137),new l.init(2600822924,725511199),new l.init(528734635,4215389547),new l.init(1541459225,327033209)])},_doProcessBlock:function(m,E){for(var _=this._hash.words,v=_[0],C=_[1],x=_[2],w=_[3],B=_[4],T=_[5],S=_[6],D=_[7],R=v.high,M=v.low,L=C.high,P=C.low,F=x.high,z=x.low,J=w.high,q=w.low,ne=B.high,j=B.low,te=T.high,W=T.low,U=S.high,H=S.low,Z=D.high,G=D.low,oe=R,pe=M,Ae=L,ge=P,Re=F,Oe=z,st=J,ut=q,mt=ne,X=j,h0=te,pt=W,At=U,qe=H,Mt=Z,Ye=G,Q=0;Q<80;Q++){var k,se,ye=p[Q];if(Q<16)se=ye.high=m[E+Q*2]|0,k=ye.low=m[E+Q*2+1]|0;else{var Ee=p[Q-15],_e=Ee.high,Ge=Ee.low,Le=(_e>>>1|Ge<<31)^(_e>>>8|Ge<<24)^_e>>>7,Ve=(Ge>>>1|_e<<31)^(Ge>>>8|_e<<24)^(Ge>>>7|_e<<25),gt=p[Q-2],we=gt.high,Ue=gt.low,nt=(we>>>19|Ue<<13)^(we<<3|Ue>>>29)^we>>>6,et=(Ue>>>19|we<<13)^(Ue<<3|we>>>29)^(Ue>>>6|we<<26),he=p[Q-7],Pe=he.high,Fe=he.low,ht=p[Q-16],$=ht.high,Se=ht.low;k=Ve+Fe,se=Le+Pe+(k>>>0<Ve>>>0?1:0),k=k+et,se=se+nt+(k>>>0<et>>>0?1:0),k=k+Se,se=se+$+(k>>>0<Se>>>0?1:0),ye.high=se,ye.low=k}var ue=mt&h0^~mt&At,ve=X&pt^~X&qe,De=oe&Ae^oe&Re^Ae&Re,Be=pe&ge^pe&Oe^ge&Oe,it=(oe>>>28|pe<<4)^(oe<<30|pe>>>2)^(oe<<25|pe>>>7),jt=(pe>>>28|oe<<4)^(pe<<30|oe>>>2)^(pe<<25|oe>>>7),y0=(mt>>>14|X<<18)^(mt>>>18|X<<14)^(mt<<23|X>>>9),Rt=(X>>>14|mt<<18)^(X>>>18|mt<<14)^(X<<23|mt>>>9),lr=A[Q],cr=lr.high,Xi=lr.low,m0=Ye+Rt,$0=Mt+y0+(m0>>>0<Ye>>>0?1:0),m0=m0+ve,$0=$0+ue+(m0>>>0<ve>>>0?1:0),m0=m0+Xi,$0=$0+cr+(m0>>>0<Xi>>>0?1:0),m0=m0+k,$0=$0+se+(m0>>>0<k>>>0?1:0),Tn=jt+Be,Ji=it+De+(Tn>>>0<jt>>>0?1:0);Mt=At,Ye=qe,At=h0,qe=pt,h0=mt,pt=X,X=ut+m0|0,mt=st+$0+(X>>>0<ut>>>0?1:0)|0,st=Re,ut=Oe,Re=Ae,Oe=ge,Ae=oe,ge=pe,pe=m0+Tn|0,oe=$0+Ji+(pe>>>0<m0>>>0?1:0)|0}M=v.low=M+pe,v.high=R+oe+(M>>>0<pe>>>0?1:0),P=C.low=P+ge,C.high=L+Ae+(P>>>0<ge>>>0?1:0),z=x.low=z+Oe,x.high=F+Re+(z>>>0<Oe>>>0?1:0),q=w.low=q+ut,w.high=J+st+(q>>>0<ut>>>0?1:0),j=B.low=j+X,B.high=ne+mt+(j>>>0<X>>>0?1:0),W=T.low=W+pt,T.high=te+h0+(W>>>0<pt>>>0?1:0),H=S.low=H+qe,S.high=U+At+(H>>>0<qe>>>0?1:0),G=D.low=G+Ye,D.high=Z+Mt+(G>>>0<Ye>>>0?1:0)},_doFinalize:function(){var m=this._data,E=m.words,_=this._nDataBytes*8,v=m.sigBytes*8;E[v>>>5]|=128<<24-v%32,E[(v+128>>>10<<5)+30]=Math.floor(_/4294967296),E[(v+128>>>10<<5)+31]=_,m.sigBytes=E.length*4,this._process();var C=this._hash.toX32();return C},clone:function(){var m=s.clone.call(this);return m._hash=this._hash.clone(),m},blockSize:1024/32});n.SHA512=s._createHelper(g),n.HmacSHA512=s._createHmacHelper(g)}(),t.SHA512})}(hA)),hA.exports}var pA={exports:{}},AA;function bR(){return AA||(AA=1,function(r,e){(function(t,n,i){r.exports=n(Bt(),cc(),fA())})(xt,function(t){return function(){var n=t,i=n.x64,s=i.Word,o=i.WordArray,l=n.algo,h=l.SHA512,u=l.SHA384=h.extend({_doReset:function(){this._hash=new o.init([new s.init(3418070365,3238371032),new s.init(1654270250,914150663),new s.init(2438529370,812702999),new s.init(355462360,4144912697),new s.init(1731405415,4290775857),new s.init(2394180231,1750603025),new s.init(3675008525,1694076839),new s.init(1203062813,3204075428)])},_doFinalize:function(){var d=h._doFinalize.call(this);return d.sigBytes-=16,d}});n.SHA384=h._createHelper(u),n.HmacSHA384=h._createHmacHelper(u)}(),t.SHA384})}(pA)),pA.exports}var gA={exports:{}},mA;function RR(){return mA||(mA=1,function(r,e){(function(t,n,i){r.exports=n(Bt(),cc())})(xt,function(t){return function(n){var i=t,s=i.lib,o=s.WordArray,l=s.Hasher,h=i.x64,u=h.Word,d=i.algo,A=[],p=[],g=[];(function(){for(var _=1,v=0,C=0;C<24;C++){A[_+5*v]=(C+1)*(C+2)/2%64;var x=v%5,w=(2*_+3*v)%5;_=x,v=w}for(var _=0;_<5;_++)for(var v=0;v<5;v++)p[_+5*v]=v+(2*_+3*v)%5*5;for(var B=1,T=0;T<24;T++){for(var S=0,D=0,R=0;R<7;R++){if(B&1){var M=(1<<R)-1;M<32?D^=1<<M:S^=1<<M-32}B&128?B=B<<1^113:B<<=1}g[T]=u.create(S,D)}})();var m=[];(function(){for(var _=0;_<25;_++)m[_]=u.create()})();var E=d.SHA3=l.extend({cfg:l.cfg.extend({outputLength:512}),_doReset:function(){for(var _=this._state=[],v=0;v<25;v++)_[v]=new u.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(_,v){for(var C=this._state,x=this.blockSize/2,w=0;w<x;w++){var B=_[v+2*w],T=_[v+2*w+1];B=(B<<8|B>>>24)&16711935|(B<<24|B>>>8)&4278255360,T=(T<<8|T>>>24)&16711935|(T<<24|T>>>8)&4278255360;var S=C[w];S.high^=T,S.low^=B}for(var D=0;D<24;D++){for(var R=0;R<5;R++){for(var M=0,L=0,P=0;P<5;P++){var S=C[R+5*P];M^=S.high,L^=S.low}var F=m[R];F.high=M,F.low=L}for(var R=0;R<5;R++)for(var z=m[(R+4)%5],J=m[(R+1)%5],q=J.high,ne=J.low,M=z.high^(q<<1|ne>>>31),L=z.low^(ne<<1|q>>>31),P=0;P<5;P++){var S=C[R+5*P];S.high^=M,S.low^=L}for(var j=1;j<25;j++){var M,L,S=C[j],te=S.high,W=S.low,U=A[j];U<32?(M=te<<U|W>>>32-U,L=W<<U|te>>>32-U):(M=W<<U-32|te>>>64-U,L=te<<U-32|W>>>64-U);var H=m[p[j]];H.high=M,H.low=L}var Z=m[0],G=C[0];Z.high=G.high,Z.low=G.low;for(var R=0;R<5;R++)for(var P=0;P<5;P++){var j=R+5*P,S=C[j],oe=m[j],pe=m[(R+1)%5+5*P],Ae=m[(R+2)%5+5*P];S.high=oe.high^~pe.high&Ae.high,S.low=oe.low^~pe.low&Ae.low}var S=C[0],ge=g[D];S.high^=ge.high,S.low^=ge.low}},_doFinalize:function(){var _=this._data,v=_.words;this._nDataBytes*8;var C=_.sigBytes*8,x=this.blockSize*32;v[C>>>5]|=1<<24-C%32,v[(n.ceil((C+1)/x)*x>>>5)-1]|=128,_.sigBytes=v.length*4,this._process();for(var w=this._state,B=this.cfg.outputLength/8,T=B/8,S=[],D=0;D<T;D++){var R=w[D],M=R.high,L=R.low;M=(M<<8|M>>>24)&16711935|(M<<24|M>>>8)&4278255360,L=(L<<8|L>>>24)&16711935|(L<<24|L>>>8)&4278255360,S.push(L),S.push(M)}return new o.init(S,B)},clone:function(){for(var _=l.clone.call(this),v=_._state=this._state.slice(0),C=0;C<25;C++)v[C]=v[C].clone();return _}});i.SHA3=l._createHelper(E),i.HmacSHA3=l._createHmacHelper(E)}(Math),t.SHA3})}(gA)),gA.exports}var vA={exports:{}},_A;function DR(){return _A||(_A=1,function(r,e){(function(t,n){r.exports=n(Bt())})(xt,function(t){/** @preserve
3959
3959
  (c) 2012 by Cédric Mesnil. All rights reserved.
3960
3960
 
3961
3961
  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
@@ -4082,7 +4082,7 @@ void main() {
4082
4082
  edgeColor = mix(edgeColor, vec3(1.0), lightenAmount);
4083
4083
  diffuseColor.rgb = mix(vec3(1.0), edgeColor, colorIntensity);
4084
4084
  `)}
4085
- `}setLensExtentOffsets(e){this.uniforms.minY.value+=e,this.uniforms.maxY.value+=e}getMaterial(){return this.material}getEdgeMaterial(){return this.edgeMaterial}}class aP{constructor(){me(this,"loader"),this.loader=new u7}async load(e){return new Promise((t,n)=>{this.loader.load(e,i=>{i.colorSpace=C0,i.flipY=!1,i.magFilter=Gt,i.minFilter=ex,i.wrapS=us,i.wrapT=us,t(i)},void 0,n)})}}const Lm=0,oP=1,Nm=2,Pm=2,xh=1.25,Um=1,J0=6*4+4+4,Q0=J0/4,wh=65535,lP=wh<<16,xc=Math.pow(2,-24),Ch=Symbol("SKIP_GENERATION"),km={strategy:Lm,maxDepth:40,maxLeafSize:10,useSharedArrayBuffer:!1,setBoundingBox:!0,onProgress:null,indirect:!1,verbose:!0,range:null,[Ch]:!1};function g0(r,e,t){return t.min.x=e[r],t.min.y=e[r+1],t.min.z=e[r+2],t.max.x=e[r+3],t.max.y=e[r+4],t.max.z=e[r+5],t}function Fm(r){let e=-1,t=-1/0;for(let n=0;n<3;n++){const i=r[n+3]-r[n];i>t&&(t=i,e=n)}return e}function Om(r,e){e.set(r)}function Qm(r,e,t){let n,i;for(let s=0;s<3;s++){const o=s+3;n=r[s],i=e[s],t[s]=n<i?n:i,n=r[o],i=e[o],t[o]=n>i?n:i}}function wc(r,e,t){for(let n=0;n<3;n++){const i=e[r+2*n],s=e[r+2*n+1],o=i-s,l=i+s;o<t[n]&&(t[n]=o),l>t[n+3]&&(t[n+3]=l)}}function o2(r){const e=r[3]-r[0],t=r[4]-r[1],n=r[5]-r[2];return 2*(e*t+t*n+n*e)}function R0(r,e){return e[r+15]===wh}function or(r,e){return e[r+6]}function mr(r,e){return e[r+14]}function K0(r){return r+Q0}function Z0(r,e){const t=e[r+6];return r+t*Q0}function Cc(r,e){return e[r+7]}function Ih(r,e,t,n,i){let s=1/0,o=1/0,l=1/0,h=-1/0,u=-1/0,d=-1/0,A=1/0,p=1/0,g=1/0,m=-1/0,E=-1/0,_=-1/0;const v=r.offset||0;for(let C=(e-v)*6,x=(e+t-v)*6;C<x;C+=6){const w=r[C+0],B=r[C+1],T=w-B,S=w+B;T<s&&(s=T),S>h&&(h=S),w<A&&(A=w),w>m&&(m=w);const D=r[C+2],R=r[C+3],M=D-R,L=D+R;M<o&&(o=M),L>u&&(u=L),D<p&&(p=D),D>E&&(E=D);const P=r[C+4],F=r[C+5],z=P-F,J=P+F;z<l&&(l=z),J>d&&(d=J),P<g&&(g=P),P>_&&(_=P)}n[0]=s,n[1]=o,n[2]=l,n[3]=h,n[4]=u,n[5]=d,i[0]=A,i[1]=p,i[2]=g,i[3]=m,i[4]=E,i[5]=_}const Wi=32,cP=(r,e)=>r.candidate-e.candidate,ks=new Array(Wi).fill().map(()=>({count:0,bounds:new Float32Array(6),rightCacheBounds:new Float32Array(6),leftCacheBounds:new Float32Array(6),candidate:0})),Ic=new Float32Array(6);function uP(r,e,t,n,i,s){let o=-1,l=0;if(s===Lm)o=Fm(e),o!==-1&&(l=(e[o]+e[o+3])/2);else if(s===oP)o=Fm(r),o!==-1&&(l=hP(t,n,i,o));else if(s===Nm){const h=o2(r);let u=xh*i;const d=t.offset||0,A=(n-d)*6,p=(n+i-d)*6;for(let g=0;g<3;g++){const m=e[g],E=(e[g+3]-m)/Wi;if(i<Wi/4){const _=[...ks];_.length=i;let v=0;for(let x=A;x<p;x+=6,v++){const w=_[v];w.candidate=t[x+2*g],w.count=0;const{bounds:B,leftCacheBounds:T,rightCacheBounds:S}=w;for(let D=0;D<3;D++)S[D]=1/0,S[D+3]=-1/0,T[D]=1/0,T[D+3]=-1/0,B[D]=1/0,B[D+3]=-1/0;wc(x,t,B)}_.sort(cP);let C=i;for(let x=0;x<C;x++){const w=_[x];for(;x+1<C&&_[x+1].candidate===w.candidate;)_.splice(x+1,1),C--}for(let x=A;x<p;x+=6){const w=t[x+2*g];for(let B=0;B<C;B++){const T=_[B];w>=T.candidate?wc(x,t,T.rightCacheBounds):(wc(x,t,T.leftCacheBounds),T.count++)}}for(let x=0;x<C;x++){const w=_[x],B=w.count,T=i-w.count,S=w.leftCacheBounds,D=w.rightCacheBounds;let R=0;B!==0&&(R=o2(S)/h);let M=0;T!==0&&(M=o2(D)/h);const L=Um+xh*(R*B+M*T);L<u&&(o=g,u=L,l=w.candidate)}}else{for(let C=0;C<Wi;C++){const x=ks[C];x.count=0,x.candidate=m+E+C*E;const w=x.bounds;for(let B=0;B<3;B++)w[B]=1/0,w[B+3]=-1/0}for(let C=A;C<p;C+=6){let x=~~((t[C+2*g]-m)/E);x>=Wi&&(x=Wi-1);const w=ks[x];w.count++,wc(C,t,w.bounds)}const _=ks[Wi-1];Om(_.bounds,_.rightCacheBounds);for(let C=Wi-2;C>=0;C--){const x=ks[C],w=ks[C+1];Qm(x.bounds,w.rightCacheBounds,x.rightCacheBounds)}let v=0;for(let C=0;C<Wi-1;C++){const x=ks[C],w=x.count,B=x.bounds,T=ks[C+1].rightCacheBounds;w!==0&&(v===0?Om(B,Ic):Qm(B,Ic,Ic)),v+=w;let S=0,D=0;v!==0&&(S=o2(Ic)/h);const R=i-v;R!==0&&(D=o2(T)/h);const M=Um+xh*(S*v+D*R);M<u&&(o=g,u=M,l=x.candidate)}}}}else console.warn(`BVH: Invalid build strategy value ${s} used.`);return{axis:o,pos:l}}function hP(r,e,t,n){let i=0;const s=r.offset;for(let o=e,l=e+t;o<l;o++)i+=r[(o-s)*6+n*2];return i/t}class Mh{constructor(){this.boundingData=new Float32Array(6)}}function dP(r,e,t,n,i,s){let o=n,l=n+i-1;const h=s.pos,u=s.axis*2,d=t.offset||0;for(;;){for(;o<=l&&t[(o-d)*6+u]<h;)o++;for(;o<=l&&t[(l-d)*6+u]>=h;)l--;if(o<l){for(let A=0;A<e;A++){let p=r[o*e+A];r[o*e+A]=r[l*e+A],r[l*e+A]=p}for(let A=0;A<6;A++){const p=o-d,g=l-d,m=t[p*6+A];t[p*6+A]=t[g*6+A],t[g*6+A]=m}o++,l--}else return o}}let zm,Mc,Sh,Gm;const fP=Math.pow(2,32);function Th(r){return"count"in r?1:1+Th(r.left)+Th(r.right)}function pP(r,e,t){return zm=new Float32Array(t),Mc=new Uint32Array(t),Sh=new Uint16Array(t),Gm=new Uint8Array(t),Bh(r,e)}function Bh(r,e){const t=r/4,n=r/2,i="count"in e,s=e.boundingData;for(let o=0;o<6;o++)zm[t+o]=s[o];if(i)return e.buffer?(Gm.set(new Uint8Array(e.buffer),r),r+e.buffer.byteLength):(Mc[t+6]=e.offset,Sh[n+14]=e.count,Sh[n+15]=wh,r+J0);{const{left:o,right:l,splitAxis:h}=e,u=r+J0;let d=Bh(u,o);const A=r/J0,p=d/J0-A;if(p>fP)throw new Error("MeshBVH: Cannot store relative child node offset greater than 32 bits.");return Mc[t+6]=p,Mc[t+7]=h,Bh(d,l)}}function AP(r,e,t,n,i,s){const{maxDepth:o,verbose:l,maxLeafSize:h,strategy:u,onProgress:d}=i,A=r.primitiveBuffer,p=r.primitiveBufferStride,g=new Float32Array(6);let m=!1;const E=new Mh;return Ih(e,t,n,E.boundingData,g),v(E,t,n,g),E;function _(C){d&&d((C-s.offset)/s.count)}function v(C,x,w,B=null,T=0){if(!m&&T>=o&&(m=!0,l&&console.warn(`BVH: Max depth of ${o} reached when generating BVH. Consider increasing maxDepth.`)),w<=h||T>=o)return _(x+w),C.offset=x,C.count=w,C;const S=uP(C.boundingData,B,e,x,w,u);if(S.axis===-1)return _(x+w),C.offset=x,C.count=w,C;const D=dP(A,p,e,x,w,S);if(D===x||D===x+w)_(x+w),C.offset=x,C.count=w;else{C.splitAxis=S.axis;const R=new Mh,M=x,L=D-x;C.left=R,Ih(e,M,L,R.boundingData,g),v(R,M,L,g,T+1);const P=new Mh,F=D,z=w-L;C.right=P,Ih(e,F,z,P.boundingData,g),v(P,F,z,g,T+1)}return C}}function gP(r,e){const t=e.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer,n=r.getRootRanges(e.range),i=n[0],s=n[n.length-1],o={offset:i.offset,count:s.offset+s.count-i.offset},l=new Float32Array(6*o.count);l.offset=o.offset,r.computePrimitiveBounds(o.offset,o.count,l),r._roots=n.map(h=>{const u=AP(r,l,h.offset,h.count,e,o),d=Th(u),A=new t(J0*d);return pP(0,u,A),A})}class bh{constructor(e){this._getNewPrimitive=e,this._primitives=[]}getPrimitive(){const e=this._primitives;return e.length===0?this._getNewPrimitive():e.pop()}releasePrimitive(e){this._primitives.push(e)}}class mP{constructor(){this.float32Array=null,this.uint16Array=null,this.uint32Array=null;const e=[];let t=null;this.setBuffer=n=>{t&&e.push(t),t=n,this.float32Array=new Float32Array(n),this.uint16Array=new Uint16Array(n),this.uint32Array=new Uint32Array(n)},this.clearBuffer=()=>{t=null,this.float32Array=null,this.uint16Array=null,this.uint32Array=null,e.length!==0&&this.setBuffer(e.pop())}}}const e0=new mP;let Fs,A1;const g1=[],Sc=new bh(()=>new I0);function vP(r,e,t,n,i,s){Fs=Sc.getPrimitive(),A1=Sc.getPrimitive(),g1.push(Fs,A1),e0.setBuffer(r._roots[e]);const o=Rh(0,r.geometry,t,n,i,s);e0.clearBuffer(),Sc.releasePrimitive(Fs),Sc.releasePrimitive(A1),g1.pop(),g1.pop();const l=g1.length;return l>0&&(A1=g1[l-1],Fs=g1[l-2]),o}function Rh(r,e,t,n,i=null,s=0,o=0){const{float32Array:l,uint16Array:h,uint32Array:u}=e0;let d=r*2;if(R0(d,h)){const A=or(r,u),p=mr(d,h);return g0(r,l,Fs),n(A,p,!1,o,s+r/Q0,Fs)}else{let A=function(L){const{uint16Array:P,uint32Array:F}=e0;let z=L*2;for(;!R0(z,P);)L=K0(L),z=L*2;return or(L,F)},p=function(L){const{uint16Array:P,uint32Array:F}=e0;let z=L*2;for(;!R0(z,P);)L=Z0(L,F),z=L*2;return or(L,F)+mr(z,P)};const g=K0(r),m=Z0(r,u);let E=g,_=m,v,C,x,w;if(i&&(x=Fs,w=A1,g0(E,l,x),g0(_,l,w),v=i(x),C=i(w),C<v)){E=m,_=g;const L=v;v=C,C=L,x=w}x||(x=Fs,g0(E,l,x));const B=R0(E*2,h),T=t(x,B,v,o+1,s+E/Q0);let S;if(T===Pm){const L=A(E),P=p(E)-L;S=n(L,P,!0,o+1,s+E/Q0,x)}else S=T&&Rh(E,e,t,n,i,s,o+1);if(S)return!0;w=A1,g0(_,l,w);const D=R0(_*2,h),R=t(w,D,C,o+1,s+_/Q0);let M;if(R===Pm){const L=A(_),P=p(_)-L;M=n(L,P,!0,o+1,s+_/Q0,w)}else M=R&&Rh(_,e,t,n,i,s,o+1);return!!M}}const l2=new e0.constructor,Tc=new e0.constructor,Os=new bh(()=>new I0),m1=new I0,v1=new I0,Dh=new I0,Lh=new I0;let Nh=!1;function _P(r,e,t,n){if(Nh)throw new Error("MeshBVH: Recursive calls to bvhcast not supported.");Nh=!0;const i=r._roots,s=e._roots;let o,l=0,h=0;const u=new lt().copy(t).invert();for(let d=0,A=i.length;d<A;d++){l2.setBuffer(i[d]),h=0;const p=Os.getPrimitive();g0(0,l2.float32Array,p),p.applyMatrix4(u);for(let g=0,m=s.length;g<m&&(Tc.setBuffer(s[g]),o=jn(0,0,t,u,n,l,h,0,0,p),Tc.clearBuffer(),h+=s[g].byteLength/J0,!o);g++);if(Os.releasePrimitive(p),l2.clearBuffer(),l+=i[d].byteLength/J0,o)break}return Nh=!1,o}function jn(r,e,t,n,i,s=0,o=0,l=0,h=0,u=null,d=!1){let A,p;d?(A=Tc,p=l2):(A=l2,p=Tc);const g=A.float32Array,m=A.uint32Array,E=A.uint16Array,_=p.float32Array,v=p.uint32Array,C=p.uint16Array,x=r*2,w=e*2,B=R0(x,E),T=R0(w,C);let S=!1;if(T&&B)d?S=i(or(e,v),mr(e*2,C),or(r,m),mr(r*2,E),h,o+e/Q0,l,s+r/Q0):S=i(or(r,m),mr(r*2,E),or(e,v),mr(e*2,C),l,s+r/Q0,h,o+e/Q0);else if(T){const D=Os.getPrimitive();g0(e,_,D),D.applyMatrix4(t);const R=K0(r),M=Z0(r,m);g0(R,g,m1),g0(M,g,v1);const L=D.intersectsBox(m1),P=D.intersectsBox(v1);S=L&&jn(e,R,n,t,i,o,s,h,l+1,D,!d)||P&&jn(e,M,n,t,i,o,s,h,l+1,D,!d),Os.releasePrimitive(D)}else{const D=K0(e),R=Z0(e,v);g0(D,_,Dh),g0(R,_,Lh);const M=u.intersectsBox(Dh),L=u.intersectsBox(Lh);if(M&&L)S=jn(r,D,t,n,i,s,o,l,h+1,u,d)||jn(r,R,t,n,i,s,o,l,h+1,u,d);else if(M)if(B)S=jn(r,D,t,n,i,s,o,l,h+1,u,d);else{const P=Os.getPrimitive();P.copy(Dh).applyMatrix4(t);const F=K0(r),z=Z0(r,m);g0(F,g,m1),g0(z,g,v1);const J=P.intersectsBox(m1),q=P.intersectsBox(v1);S=J&&jn(D,F,n,t,i,o,s,h,l+1,P,!d)||q&&jn(D,z,n,t,i,o,s,h,l+1,P,!d),Os.releasePrimitive(P)}else if(L)if(B)S=jn(r,R,t,n,i,s,o,l,h+1,u,d);else{const P=Os.getPrimitive();P.copy(Lh).applyMatrix4(t);const F=K0(r),z=Z0(r,m);g0(F,g,m1),g0(z,g,v1);const J=P.intersectsBox(m1),q=P.intersectsBox(v1);S=J&&jn(R,F,n,t,i,o,s,h,l+1,P,!d)||q&&jn(R,z,n,t,i,o,s,h,l+1,P,!d),Os.releasePrimitive(P)}}return S}const Hm=new I0,_1=new Float32Array(6);class yP{constructor(){this._roots=null,this.primitiveBuffer=null,this.primitiveBufferStride=null}init(e){e={...km,...e},gP(this,e)}getRootRanges(){throw new Error("BVH: getRootRanges() not implemented")}writePrimitiveBounds(){throw new Error("BVH: writePrimitiveBounds() not implemented")}writePrimitiveRangeBounds(e,t,n,i){let s=1/0,o=1/0,l=1/0,h=-1/0,u=-1/0,d=-1/0;for(let A=e,p=e+t;A<p;A++){this.writePrimitiveBounds(A,_1,0);const[g,m,E,_,v,C]=_1;g<s&&(s=g),_>h&&(h=_),m<o&&(o=m),v>u&&(u=v),E<l&&(l=E),C>d&&(d=C)}return n[i+0]=s,n[i+1]=o,n[i+2]=l,n[i+3]=h,n[i+4]=u,n[i+5]=d,n}computePrimitiveBounds(e,t,n){const i=n.offset||0;for(let s=e,o=e+t;s<o;s++){this.writePrimitiveBounds(s,_1,0);const[l,h,u,d,A,p]=_1,g=(l+d)/2,m=(h+A)/2,E=(u+p)/2,_=(d-l)/2,v=(A-h)/2,C=(p-u)/2,x=(s-i)*6;n[x+0]=g,n[x+1]=_+(Math.abs(g)+_)*xc,n[x+2]=m,n[x+3]=v+(Math.abs(m)+v)*xc,n[x+4]=E,n[x+5]=C+(Math.abs(E)+C)*xc}return n}shiftPrimitiveOffsets(e){const t=this._indirectBuffer;if(t)for(let n=0,i=t.length;n<i;n++)t[n]+=e;else{const n=this._roots;for(let i=0;i<n.length;i++){const s=n[i],o=new Uint32Array(s),l=new Uint16Array(s),h=s.byteLength/J0;for(let u=0;u<h;u++){const d=Q0*u,A=2*d;R0(A,l)&&(o[d+6]+=e)}}}}traverse(e,t=0){const n=this._roots[t],i=new Uint32Array(n),s=new Uint16Array(n);o(0);function o(l,h=0){const u=l*2,d=R0(u,s);if(d){const A=i[l+6],p=s[u+14];e(h,d,new Float32Array(n,l*4,6),A,p)}else{const A=K0(l),p=Z0(l,i),g=Cc(l,i);e(h,d,new Float32Array(n,l*4,6),g)||(o(A,h+1),o(p,h+1))}}}refit(){const e=this._roots;for(let t=0,n=e.length;t<n;t++){const i=e[t],s=new Uint32Array(i),o=new Uint16Array(i),l=new Float32Array(i),h=i.byteLength/J0;for(let u=h-1;u>=0;u--){const d=u*Q0,A=d*2;if(R0(A,o)){const p=or(d,s),g=mr(A,o);this.writePrimitiveRangeBounds(p,g,_1,0),l.set(_1,d)}else{const p=K0(d),g=Z0(d,s);for(let m=0;m<3;m++){const E=l[p+m],_=l[p+m+3],v=l[g+m],C=l[g+m+3];l[d+m]=E<v?E:v,l[d+m+3]=_>C?_:C}}}}}getBoundingBox(e){return e.makeEmpty(),this._roots.forEach(t=>{g0(0,new Float32Array(t),Hm),e.union(Hm)}),e}shapecast(e){let{boundsTraverseOrder:t,intersectsBounds:n,intersectsRange:i,intersectsPrimitive:s,scratchPrimitive:o,iterate:l}=e;if(i&&s){const A=i;i=(p,g,m,E,_)=>A(p,g,m,E,_)?!0:l(p,g,this,s,m,E,o)}else i||(s?i=(A,p,g,m)=>l(A,p,this,s,g,m,o):i=(A,p,g)=>g);let h=!1,u=0;const d=this._roots;for(let A=0,p=d.length;A<p;A++){const g=d[A];if(h=vP(this,A,n,i,t,u),h)break;u+=g.byteLength/J0}return h}bvhcast(e,t,n){let{intersectsRanges:i}=n;return _P(this,e,t,i)}}function EP(){return typeof SharedArrayBuffer<"u"}function Bc(r){return r.index?r.index.count:r.attributes.position.count}function bc(r){return Bc(r)/3}function Vm(r,e=ArrayBuffer){return r>65535?new Uint32Array(new e(4*r)):new Uint16Array(new e(2*r))}function xP(r,e){if(!r.index){const t=r.attributes.position.count,n=e.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer,i=Vm(t,n);r.setIndex(new S0(i,1));for(let s=0;s<t;s++)i[s]=s}}function wP(r,e,t){const n=Bc(r)/t,i=e||r.drawRange,s=i.start/t,o=(i.start+i.count)/t,l=Math.max(0,s),h=Math.min(n,o)-l;return{offset:Math.floor(l),count:Math.floor(h)}}function CP(r,e){return r.groups.map(t=>({offset:t.start/e,count:t.count/e}))}function jm(r,e,t){const n=wP(r,e,t),i=CP(r,t);if(!i.length)return[n];const s=[],o=n.offset,l=n.offset+n.count,h=Bc(r)/t,u=[];for(const p of i){const{offset:g,count:m}=p,E=g,_=isFinite(m)?m:h-g,v=g+_;E<l&&v>o&&(u.push({pos:Math.max(o,E),isStart:!0}),u.push({pos:Math.min(l,v),isStart:!1}))}u.sort((p,g)=>p.pos!==g.pos?p.pos-g.pos:p.type==="end"?-1:1);let d=0,A=null;for(const p of u){const g=p.pos;d!==0&&g!==A&&s.push({offset:A,count:g-A}),d+=p.isStart?1:-1,A=g}return s}function IP(r,e){const t=r[r.length-1],n=t.offset+t.count>2**16,i=r.reduce((u,d)=>u+d.count,0),s=n?4:2,o=e?new SharedArrayBuffer(i*s):new ArrayBuffer(i*s),l=n?new Uint32Array(o):new Uint16Array(o);let h=0;for(let u=0;u<r.length;u++){const{offset:d,count:A}=r[u];for(let p=0;p<A;p++)l[h+p]=d+p;h+=A}return l}class MP extends yP{get indirect(){return!!this._indirectBuffer}get primitiveStride(){return null}get primitiveBufferStride(){return this.indirect?1:this.primitiveStride}set primitiveBufferStride(e){}get primitiveBuffer(){return this.indirect?this._indirectBuffer:this.geometry.index.array}set primitiveBuffer(e){}constructor(e,t={}){if(e.isBufferGeometry){if(e.index&&e.index.isInterleavedBufferAttribute)throw new Error("BVH: InterleavedBufferAttribute is not supported for the index attribute.")}else throw new Error("BVH: Only BufferGeometries are supported.");if(t.useSharedArrayBuffer&&!EP())throw new Error("BVH: SharedArrayBuffer is not available.");super(),this.geometry=e,this.resolvePrimitiveIndex=t.indirect?n=>this._indirectBuffer[n]:n=>n,this.primitiveBuffer=null,this.primitiveBufferStride=null,this._indirectBuffer=null,t={...km,...t},t[Ch]||this.init(t)}init(e){const{geometry:t,primitiveStride:n}=this;if(e.indirect){const i=jm(t,e.range,n),s=IP(i,e.useSharedArrayBuffer);this._indirectBuffer=s}else xP(t,e);super.init(e),!t.boundingBox&&e.setBoundingBox&&(t.boundingBox=this.getBoundingBox(new I0))}getRootRanges(e){return this.indirect?[{offset:0,count:this._indirectBuffer.length}]:jm(this.geometry,e,this.primitiveStride)}raycastObject3D(){throw new Error("BVH: raycastObject3D() not implemented")}}class Yi{constructor(){this.min=1/0,this.max=-1/0}setFromPointsField(e,t){let n=1/0,i=-1/0;for(let s=0,o=e.length;s<o;s++){const l=e[s][t];n=l<n?l:n,i=l>i?l:i}this.min=n,this.max=i}setFromPoints(e,t){let n=1/0,i=-1/0;for(let s=0,o=t.length;s<o;s++){const l=t[s],h=e.dot(l);n=h<n?h:n,i=h>i?h:i}this.min=n,this.max=i}isSeparated(e){return this.min>e.max||e.min>this.max}}Yi.prototype.setFromBox=function(){const r=new V;return function(e,t){const n=t.min,i=t.max;let s=1/0,o=-1/0;for(let l=0;l<=1;l++)for(let h=0;h<=1;h++)for(let u=0;u<=1;u++){r.x=n.x*l+i.x*(1-l),r.y=n.y*h+i.y*(1-h),r.z=n.z*u+i.z*(1-u);const d=e.dot(r);s=Math.min(d,s),o=Math.max(d,o)}this.min=s,this.max=o}}();const SP=function(){const r=new V,e=new V,t=new V;return function(n,i,s){const o=n.start,l=r,h=i.start,u=e;t.subVectors(o,h),r.subVectors(n.end,n.start),e.subVectors(i.end,i.start);const d=t.dot(u),A=u.dot(l),p=u.dot(u),g=t.dot(l),m=l.dot(l)*p-A*A;let E,_;m!==0?E=(d*A-g*p)/m:E=0,_=(d+E*A)/p,s.x=E,s.y=_}}(),Ph=function(){const r=new ze,e=new V,t=new V;return function(n,i,s,o){SP(n,i,r);let l=r.x,h=r.y;if(l>=0&&l<=1&&h>=0&&h<=1){n.at(l,s),i.at(h,o);return}else if(l>=0&&l<=1){h<0?i.at(0,o):i.at(1,o),n.closestPointToPoint(o,!0,s);return}else if(h>=0&&h<=1){l<0?n.at(0,s):n.at(1,s),i.closestPointToPoint(s,!0,o);return}else{let u;l<0?u=n.start:u=n.end;let d;h<0?d=i.start:d=i.end;const A=e,p=t;if(n.closestPointToPoint(d,!0,e),i.closestPointToPoint(u,!0,t),A.distanceToSquared(d)<=p.distanceToSquared(u)){s.copy(A),o.copy(d);return}else{s.copy(u),o.copy(p);return}}}}(),TP=function(){const r=new V,e=new V,t=new ai,n=new Ui;return function(i,s){const{radius:o,center:l}=i,{a:h,b:u,c:d}=s;if(n.start=h,n.end=u,n.closestPointToPoint(l,!0,r).distanceTo(l)<=o||(n.start=h,n.end=d,n.closestPointToPoint(l,!0,r).distanceTo(l)<=o)||(n.start=u,n.end=d,n.closestPointToPoint(l,!0,r).distanceTo(l)<=o))return!0;const A=s.getPlane(t);if(Math.abs(A.distanceToPoint(l))<=o){const p=A.projectPoint(l,e);if(s.containsPoint(p))return!0}return!1}}(),BP=["x","y","z"],qi=1e-15,Wm=qi*qi;function Mn(r){return Math.abs(r)<qi}class Wn extends ir{constructor(...e){super(...e),this.isExtendedTriangle=!0,this.satAxes=new Array(4).fill().map(()=>new V),this.satBounds=new Array(4).fill().map(()=>new Yi),this.points=[this.a,this.b,this.c],this.plane=new ai,this.isDegenerateIntoSegment=!1,this.isDegenerateIntoPoint=!1,this.degenerateSegment=new Ui,this.needsUpdate=!0}intersectsSphere(e){return TP(e,this)}update(){const e=this.a,t=this.b,n=this.c,i=this.points,s=this.satAxes,o=this.satBounds,l=s[0],h=o[0];this.getNormal(l),h.setFromPoints(l,i);const u=s[1],d=o[1];u.subVectors(e,t),d.setFromPoints(u,i);const A=s[2],p=o[2];A.subVectors(t,n),p.setFromPoints(A,i);const g=s[3],m=o[3];g.subVectors(n,e),m.setFromPoints(g,i);const E=u.length(),_=A.length(),v=g.length();this.isDegenerateIntoPoint=!1,this.isDegenerateIntoSegment=!1,E<qi?_<qi||v<qi?this.isDegenerateIntoPoint=!0:(this.isDegenerateIntoSegment=!0,this.degenerateSegment.start.copy(e),this.degenerateSegment.end.copy(n)):_<qi?v<qi?this.isDegenerateIntoPoint=!0:(this.isDegenerateIntoSegment=!0,this.degenerateSegment.start.copy(t),this.degenerateSegment.end.copy(e)):v<qi&&(this.isDegenerateIntoSegment=!0,this.degenerateSegment.start.copy(n),this.degenerateSegment.end.copy(t)),this.plane.setFromNormalAndCoplanarPoint(l,e),this.needsUpdate=!1}}Wn.prototype.closestPointToSegment=function(){const r=new V,e=new V,t=new Ui;return function(n,i=null,s=null){const{start:o,end:l}=n,h=this.points;let u,d=1/0;for(let A=0;A<3;A++){const p=(A+1)%3;t.start.copy(h[A]),t.end.copy(h[p]),Ph(t,n,r,e),u=r.distanceToSquared(e),u<d&&(d=u,i&&i.copy(r),s&&s.copy(e))}return this.closestPointToPoint(o,r),u=o.distanceToSquared(r),u<d&&(d=u,i&&i.copy(r),s&&s.copy(o)),this.closestPointToPoint(l,r),u=l.distanceToSquared(r),u<d&&(d=u,i&&i.copy(r),s&&s.copy(l)),Math.sqrt(d)}}(),Wn.prototype.intersectsTriangle=function(){const r=new Wn,e=new Yi,t=new Yi,n=new V,i=new V,s=new V,o=new V,l=new Ui,h=new Ui,u=new V,d=new ze,A=new ze;function p(x,w,B,T){const S=n;!x.isDegenerateIntoPoint&&!x.isDegenerateIntoSegment?S.copy(x.plane.normal):S.copy(w.plane.normal);const D=x.satBounds,R=x.satAxes;for(let P=1;P<4;P++){const F=D[P],z=R[P];if(e.setFromPoints(z,w.points),F.isSeparated(e)||(o.copy(S).cross(z),e.setFromPoints(o,x.points),t.setFromPoints(o,w.points),e.isSeparated(t)))return!1}const M=w.satBounds,L=w.satAxes;for(let P=1;P<4;P++){const F=M[P],z=L[P];if(e.setFromPoints(z,x.points),F.isSeparated(e)||(o.crossVectors(S,z),e.setFromPoints(o,x.points),t.setFromPoints(o,w.points),e.isSeparated(t)))return!1}return B&&(T||console.warn("ExtendedTriangle.intersectsTriangle: Triangles are coplanar which does not support an output edge. Setting edge to 0, 0, 0."),B.start.set(0,0,0),B.end.set(0,0,0)),!0}function g(x,w,B,T,S,D,R,M,L,P,F){let z=R/(R-M);P.x=T+(S-T)*z,F.start.subVectors(w,x).multiplyScalar(z).add(x),z=R/(R-L),P.y=T+(D-T)*z,F.end.subVectors(B,x).multiplyScalar(z).add(x)}function m(x,w,B,T,S,D,R,M,L,P,F){if(S>0)g(x.c,x.a,x.b,T,w,B,L,R,M,P,F);else if(D>0)g(x.b,x.a,x.c,B,w,T,M,R,L,P,F);else if(M*L>0||R!=0)g(x.a,x.b,x.c,w,B,T,R,M,L,P,F);else if(M!=0)g(x.b,x.a,x.c,B,w,T,M,R,L,P,F);else if(L!=0)g(x.c,x.a,x.b,T,w,B,L,R,M,P,F);else return!0;return!1}function E(x,w,B,T){const S=w.degenerateSegment,D=x.plane.distanceToPoint(S.start),R=x.plane.distanceToPoint(S.end);return Mn(D)?Mn(R)?p(x,w,B,T):(B&&(B.start.copy(S.start),B.end.copy(S.start)),x.containsPoint(S.start)):Mn(R)?(B&&(B.start.copy(S.end),B.end.copy(S.end)),x.containsPoint(S.end)):x.plane.intersectLine(S,n)!=null?(B&&(B.start.copy(n),B.end.copy(n)),x.containsPoint(n)):!1}function _(x,w,B){const T=w.a;return Mn(x.plane.distanceToPoint(T))&&x.containsPoint(T)?(B&&(B.start.copy(T),B.end.copy(T)),!0):!1}function v(x,w,B){const T=x.degenerateSegment,S=w.a;return T.closestPointToPoint(S,!0,n),S.distanceToSquared(n)<Wm?(B&&(B.start.copy(S),B.end.copy(S)),!0):!1}function C(x,w,B,T){if(x.isDegenerateIntoSegment)if(w.isDegenerateIntoSegment){const S=x.degenerateSegment,D=w.degenerateSegment,R=i,M=s;S.delta(R),D.delta(M);const L=n.subVectors(D.start,S.start),P=R.x*M.y-R.y*M.x;if(Mn(P))return!1;const F=(L.x*M.y-L.y*M.x)/P,z=-(R.x*L.y-R.y*L.x)/P;if(F<0||F>1||z<0||z>1)return!1;const J=S.start.z+R.z*F,q=D.start.z+M.z*z;return Mn(J-q)?(B&&(B.start.copy(S.start).addScaledVector(R,F),B.end.copy(S.start).addScaledVector(R,F)),!0):!1}else return w.isDegenerateIntoPoint?v(x,w,B):E(w,x,B,T);else{if(x.isDegenerateIntoPoint)return w.isDegenerateIntoPoint?w.a.distanceToSquared(x.a)<Wm?(B&&(B.start.copy(x.a),B.end.copy(x.a)),!0):!1:w.isDegenerateIntoSegment?v(w,x,B):_(w,x,B);if(w.isDegenerateIntoPoint)return _(x,w,B);if(w.isDegenerateIntoSegment)return E(x,w,B,T)}}return function(x,w=null,B=!1){this.needsUpdate&&this.update(),x.isExtendedTriangle?x.needsUpdate&&x.update():(r.copy(x),r.update(),x=r);const T=C(this,x,w,B);if(T!==void 0)return T;const S=this.plane,D=x.plane;let R=D.distanceToPoint(this.a),M=D.distanceToPoint(this.b),L=D.distanceToPoint(this.c);Mn(R)&&(R=0),Mn(M)&&(M=0),Mn(L)&&(L=0);const P=R*M,F=R*L;if(P>0&&F>0)return!1;let z=S.distanceToPoint(x.a),J=S.distanceToPoint(x.b),q=S.distanceToPoint(x.c);Mn(z)&&(z=0),Mn(J)&&(J=0),Mn(q)&&(q=0);const ne=z*J,j=z*q;if(ne>0&&j>0)return!1;i.copy(S.normal),s.copy(D.normal);const te=i.cross(s);let W=0,U=Math.abs(te.x);const H=Math.abs(te.y);H>U&&(U=H,W=1),Math.abs(te.z)>U&&(W=2);const Z=BP[W],G=this.a[Z],oe=this.b[Z],pe=this.c[Z],Ae=x.a[Z],ge=x.b[Z],Re=x.c[Z];if(m(this,G,oe,pe,P,F,R,M,L,d,l))return p(this,x,w,B);if(m(x,Ae,ge,Re,ne,j,z,J,q,A,h))return p(this,x,w,B);if(d.y<d.x){const Fe=d.y;d.y=d.x,d.x=Fe,u.copy(l.start),l.start.copy(l.end),l.end.copy(u)}if(A.y<A.x){const Fe=A.y;A.y=A.x,A.x=Fe,u.copy(h.start),h.start.copy(h.end),h.end.copy(u)}return d.y<A.x||A.y<d.x?!1:(w&&(A.x>d.x?w.start.copy(h.start):w.start.copy(l.start),A.y<d.y?w.end.copy(h.end):w.end.copy(l.end)),!0)}}(),Wn.prototype.distanceToPoint=function(){const r=new V;return function(e){return this.closestPointToPoint(e,r),e.distanceTo(r)}}(),Wn.prototype.distanceToTriangle=function(){const r=new V,e=new V,t=["a","b","c"],n=new Ui,i=new Ui;return function(s,o=null,l=null){const h=o||l?n:null;if(this.intersectsTriangle(s,h,!0))return(o||l)&&(o&&h.getCenter(o),l&&h.getCenter(l)),0;let u=1/0;for(let d=0;d<3;d++){let A;const p=t[d],g=s[p];this.closestPointToPoint(g,r),A=g.distanceToSquared(r),A<u&&(u=A,o&&o.copy(r),l&&l.copy(g));const m=this[p];s.closestPointToPoint(m,r),A=m.distanceToSquared(r),A<u&&(u=A,o&&o.copy(m),l&&l.copy(r))}for(let d=0;d<3;d++){const A=t[d],p=t[(d+1)%3];n.set(this[A],this[p]);for(let g=0;g<3;g++){const m=t[g],E=t[(g+1)%3];i.set(s[m],s[E]),Ph(n,i,r,e);const _=r.distanceToSquared(e);_<u&&(u=_,o&&o.copy(r),l&&l.copy(e))}}return Math.sqrt(u)}}();class Tr{constructor(e,t,n){this.isOrientedBox=!0,this.min=new V,this.max=new V,this.matrix=new lt,this.invMatrix=new lt,this.points=new Array(8).fill().map(()=>new V),this.satAxes=new Array(3).fill().map(()=>new V),this.satBounds=new Array(3).fill().map(()=>new Yi),this.alignedSatBounds=new Array(3).fill().map(()=>new Yi),this.needsUpdate=!1,e&&this.min.copy(e),t&&this.max.copy(t),n&&this.matrix.copy(n)}set(e,t,n){this.min.copy(e),this.max.copy(t),this.matrix.copy(n),this.needsUpdate=!0}copy(e){this.min.copy(e.min),this.max.copy(e.max),this.matrix.copy(e.matrix),this.needsUpdate=!0}}Tr.prototype.update=function(){return function(){const r=this.matrix,e=this.min,t=this.max,n=this.points;for(let h=0;h<=1;h++)for(let u=0;u<=1;u++)for(let d=0;d<=1;d++){const A=1*h|2*u|4*d,p=n[A];p.x=h?t.x:e.x,p.y=u?t.y:e.y,p.z=d?t.z:e.z,p.applyMatrix4(r)}const i=this.satBounds,s=this.satAxes,o=n[0];for(let h=0;h<3;h++){const u=s[h],d=i[h],A=1<<h,p=n[A];u.subVectors(o,p),d.setFromPoints(u,n)}const l=this.alignedSatBounds;l[0].setFromPointsField(n,"x"),l[1].setFromPointsField(n,"y"),l[2].setFromPointsField(n,"z"),this.invMatrix.copy(this.matrix).invert(),this.needsUpdate=!1}}(),Tr.prototype.intersectsBox=function(){const r=new Yi;return function(e){this.needsUpdate&&this.update();const t=e.min,n=e.max,i=this.satBounds,s=this.satAxes,o=this.alignedSatBounds;if(r.min=t.x,r.max=n.x,o[0].isSeparated(r)||(r.min=t.y,r.max=n.y,o[1].isSeparated(r))||(r.min=t.z,r.max=n.z,o[2].isSeparated(r)))return!1;for(let l=0;l<3;l++){const h=s[l],u=i[l];if(r.setFromBox(h,e),u.isSeparated(r))return!1}return!0}}(),Tr.prototype.intersectsTriangle=function(){const r=new Wn,e=new Array(3),t=new Yi,n=new Yi,i=new V;return function(s){this.needsUpdate&&this.update(),s.isExtendedTriangle?s.needsUpdate&&s.update():(r.copy(s),r.update(),s=r);const o=this.satBounds,l=this.satAxes;e[0]=s.a,e[1]=s.b,e[2]=s.c;for(let A=0;A<3;A++){const p=o[A],g=l[A];if(t.setFromPoints(g,e),p.isSeparated(t))return!1}const h=s.satBounds,u=s.satAxes,d=this.points;for(let A=0;A<3;A++){const p=h[A],g=u[A];if(t.setFromPoints(g,d),p.isSeparated(t))return!1}for(let A=0;A<3;A++){const p=l[A];for(let g=0;g<4;g++){const m=u[g];if(i.crossVectors(p,m),t.setFromPoints(i,e),n.setFromPoints(i,d),t.isSeparated(n))return!1}}return!0}}(),Tr.prototype.closestPointToPoint=function(){return function(r,e){return this.needsUpdate&&this.update(),e.copy(r).applyMatrix4(this.invMatrix).clamp(this.min,this.max).applyMatrix4(this.matrix),e}}(),Tr.prototype.distanceToPoint=function(){const r=new V;return function(e){return this.closestPointToPoint(e,r),e.distanceTo(r)}}(),Tr.prototype.distanceToBox=function(){const r=["x","y","z"],e=new Array(12).fill().map(()=>new Ui),t=new Array(12).fill().map(()=>new Ui),n=new V,i=new V;return function(s,o=0,l=null,h=null){if(this.needsUpdate&&this.update(),this.intersectsBox(s))return(l||h)&&(s.getCenter(i),this.closestPointToPoint(i,n),s.closestPointToPoint(n,i),l&&l.copy(n),h&&h.copy(i)),0;const u=o*o,d=s.min,A=s.max,p=this.points;let g=1/0;for(let E=0;E<8;E++){const _=p[E];i.copy(_).clamp(d,A);const v=_.distanceToSquared(i);if(v<g&&(g=v,l&&l.copy(_),h&&h.copy(i),v<u))return Math.sqrt(v)}let m=0;for(let E=0;E<3;E++)for(let _=0;_<=1;_++)for(let v=0;v<=1;v++){const C=(E+1)%3,x=(E+2)%3,w=_<<C|v<<x,B=1<<E|_<<C|v<<x,T=p[w],S=p[B];e[m].set(T,S);const D=r[E],R=r[C],M=r[x],L=t[m],P=L.start,F=L.end;P[D]=d[D],P[R]=_?d[R]:A[R],P[M]=v?d[M]:A[R],F[D]=A[D],F[R]=_?d[R]:A[R],F[M]=v?d[M]:A[R],m++}for(let E=0;E<=1;E++)for(let _=0;_<=1;_++)for(let v=0;v<=1;v++){i.x=E?A.x:d.x,i.y=_?A.y:d.y,i.z=v?A.z:d.z,this.closestPointToPoint(i,n);const C=i.distanceToSquared(n);if(C<g&&(g=C,l&&l.copy(n),h&&h.copy(i),C<u))return Math.sqrt(C)}for(let E=0;E<12;E++){const _=e[E];for(let v=0;v<12;v++){const C=t[v];Ph(_,C,n,i);const x=n.distanceToSquared(i);if(x<g&&(g=x,l&&l.copy(n),h&&h.copy(i),x<u))return Math.sqrt(x)}}return Math.sqrt(g)}}();class bP extends bh{constructor(){super(()=>new Wn)}}const Sn=new bP,c2=new V,Uh=new V;function RP(r,e,t={},n=0,i=1/0){const s=n*n,o=i*i;let l=1/0,h=null;if(r.shapecast({boundsTraverseOrder:d=>(c2.copy(e).clamp(d.min,d.max),c2.distanceToSquared(e)),intersectsBounds:(d,A,p)=>p<l&&p<o,intersectsTriangle:(d,A)=>{d.closestPointToPoint(e,c2);const p=e.distanceToSquared(c2);return p<l&&(Uh.copy(c2),l=p,h=A),p<s}}),l===1/0)return null;const u=Math.sqrt(l);return t.point?t.point.copy(Uh):t.point=Uh.clone(),t.distance=u,t.faceIndex=h,t}const Rc=parseInt(K1)>=169,DP=parseInt(K1)<=161,Ga=new V,Ha=new V,Va=new V,Dc=new ze,Lc=new ze,Nc=new ze,Ym=new V,qm=new V,Xm=new V,u2=new V;function LP(r,e,t,n,i,s,o,l){let h;if(s===V0?h=r.intersectTriangle(n,t,e,!0,i):h=r.intersectTriangle(e,t,n,s!==pn,i),h===null)return null;const u=r.origin.distanceTo(i);return u<o||u>l?null:{distance:u,point:i.clone()}}function Jm(r,e,t,n,i,s,o,l,h,u,d){Ga.fromBufferAttribute(e,s),Ha.fromBufferAttribute(e,o),Va.fromBufferAttribute(e,l);const A=LP(r,Ga,Ha,Va,u2,h,u,d);if(A){if(n){Dc.fromBufferAttribute(n,s),Lc.fromBufferAttribute(n,o),Nc.fromBufferAttribute(n,l),A.uv=new ze;const g=ir.getInterpolation(u2,Ga,Ha,Va,Dc,Lc,Nc,A.uv);Rc||(A.uv=g)}if(i){Dc.fromBufferAttribute(i,s),Lc.fromBufferAttribute(i,o),Nc.fromBufferAttribute(i,l),A.uv1=new ze;const g=ir.getInterpolation(u2,Ga,Ha,Va,Dc,Lc,Nc,A.uv1);Rc||(A.uv1=g),DP&&(A.uv2=A.uv1)}if(t){Ym.fromBufferAttribute(t,s),qm.fromBufferAttribute(t,o),Xm.fromBufferAttribute(t,l),A.normal=new V;const g=ir.getInterpolation(u2,Ga,Ha,Va,Ym,qm,Xm,A.normal);A.normal.dot(r.direction)>0&&A.normal.multiplyScalar(-1),Rc||(A.normal=g)}const p={a:s,b:o,c:l,normal:new V,materialIndex:0};if(ir.getNormal(Ga,Ha,Va,p.normal),A.face=p,A.faceIndex=s,Rc){const g=new V;ir.getBarycoord(u2,Ga,Ha,Va,g),A.barycoord=g}}return A}function Km(r){return r&&r.isMaterial?r.side:r}function Pc(r,e,t,n,i,s,o){const l=n*3;let h=l+0,u=l+1,d=l+2;const{index:A,groups:p}=r;r.index&&(h=A.getX(h),u=A.getX(u),d=A.getX(d));const{position:g,normal:m,uv:E,uv1:_}=r.attributes;if(Array.isArray(e)){const v=n*3;for(let C=0,x=p.length;C<x;C++){const{start:w,count:B,materialIndex:T}=p[C];if(v>=w&&v<w+B){const S=Km(e[T]),D=Jm(t,g,m,E,_,h,u,d,S,s,o);if(D)if(D.faceIndex=n,D.face.materialIndex=T,i)i.push(D);else return D}}}else{const v=Km(e),C=Jm(t,g,m,E,_,h,u,d,v,s,o);if(C)if(C.faceIndex=n,C.face.materialIndex=0,i)i.push(C);else return C}return null}function D0(r,e,t,n){const i=r.a,s=r.b,o=r.c;let l=e,h=e+1,u=e+2;t&&(l=t.getX(l),h=t.getX(h),u=t.getX(u)),i.x=n.getX(l),i.y=n.getY(l),i.z=n.getZ(l),s.x=n.getX(h),s.y=n.getY(h),s.z=n.getZ(h),o.x=n.getX(u),o.y=n.getY(u),o.z=n.getZ(u)}function NP(r,e,t,n,i,s,o,l){const{geometry:h,_indirectBuffer:u}=r;for(let d=n,A=n+i;d<A;d++)Pc(h,e,t,d,s,o,l)}function PP(r,e,t,n,i,s,o){const{geometry:l,_indirectBuffer:h}=r;let u=1/0,d=null;for(let A=n,p=n+i;A<p;A++){let g;g=Pc(l,e,t,A,null,s,o),g&&g.distance<u&&(d=g,u=g.distance)}return d}function UP(r,e,t,n,i,s,o){const{geometry:l}=t,{index:h}=l,u=l.attributes.position;for(let d=r,A=e+r;d<A;d++){let p;if(p=d,D0(o,p*3,h,u),o.needsUpdate=!0,n(o,p,i,s))return!0}return!1}function kP(r,e=null){e&&Array.isArray(e)&&(e=new Set(e));const t=r.geometry,n=t.index?t.index.array:null,i=t.attributes.position;let s,o,l,h,u=0;const d=r._roots;for(let p=0,g=d.length;p<g;p++)s=d[p],o=new Uint32Array(s),l=new Uint16Array(s),h=new Float32Array(s),A(0,u),u+=s.byteLength;function A(p,g,m=!1){const E=p*2;if(R0(E,l)){const _=or(p,o),v=mr(E,l);let C=1/0,x=1/0,w=1/0,B=-1/0,T=-1/0,S=-1/0;for(let D=3*_,R=3*(_+v);D<R;D++){let M=n[D];const L=i.getX(M),P=i.getY(M),F=i.getZ(M);L<C&&(C=L),L>B&&(B=L),P<x&&(x=P),P>T&&(T=P),F<w&&(w=F),F>S&&(S=F)}return h[p+0]!==C||h[p+1]!==x||h[p+2]!==w||h[p+3]!==B||h[p+4]!==T||h[p+5]!==S?(h[p+0]=C,h[p+1]=x,h[p+2]=w,h[p+3]=B,h[p+4]=T,h[p+5]=S,!0):!1}else{const _=K0(p),v=Z0(p,o);let C=m,x=!1,w=!1;if(e){if(!C){const M=_/Q0+g/J0,L=v/Q0+g/J0;x=e.has(M),w=e.has(L),C=!x&&!w}}else x=!0,w=!0;const B=C||x,T=C||w;let S=!1;B&&(S=A(_,g,C));let D=!1;T&&(D=A(v,g,C));const R=S||D;if(R)for(let M=0;M<3;M++){const L=_+M,P=v+M,F=h[L],z=h[L+3],J=h[P],q=h[P+3];h[p+M]=F<J?F:J,h[p+M+3]=z>q?z:q}return R}}}function Qs(r,e,t,n,i){let s,o,l,h,u,d;const A=1/t.direction.x,p=1/t.direction.y,g=1/t.direction.z,m=t.origin.x,E=t.origin.y,_=t.origin.z;let v=e[r],C=e[r+3],x=e[r+1],w=e[r+3+1],B=e[r+2],T=e[r+3+2];return A>=0?(s=(v-m)*A,o=(C-m)*A):(s=(C-m)*A,o=(v-m)*A),p>=0?(l=(x-E)*p,h=(w-E)*p):(l=(w-E)*p,h=(x-E)*p),s>h||l>o||((l>s||isNaN(s))&&(s=l),(h<o||isNaN(o))&&(o=h),g>=0?(u=(B-_)*g,d=(T-_)*g):(u=(T-_)*g,d=(B-_)*g),s>d||u>o)?!1:((u>s||s!==s)&&(s=u),(d<o||o!==o)&&(o=d),s<=i&&o>=n)}function FP(r,e,t,n,i,s,o,l){const{geometry:h,_indirectBuffer:u}=r;for(let d=n,A=n+i;d<A;d++){let p=u?u[d]:d;Pc(h,e,t,p,s,o,l)}}function OP(r,e,t,n,i,s,o){const{geometry:l,_indirectBuffer:h}=r;let u=1/0,d=null;for(let A=n,p=n+i;A<p;A++){let g;g=Pc(l,e,t,h?h[A]:A,null,s,o),g&&g.distance<u&&(d=g,u=g.distance)}return d}function QP(r,e,t,n,i,s,o){const{geometry:l}=t,{index:h}=l,u=l.attributes.position;for(let d=r,A=e+r;d<A;d++){let p;if(p=t.resolveTriangleIndex(d),D0(o,p*3,h,u),o.needsUpdate=!0,n(o,p,i,s))return!0}return!1}function zP(r,e,t,n,i,s,o){e0.setBuffer(r._roots[e]),kh(0,r,t,n,i,s,o),e0.clearBuffer()}function kh(r,e,t,n,i,s,o){const{float32Array:l,uint16Array:h,uint32Array:u}=e0,d=r*2;if(R0(d,h)){const A=or(r,u),p=mr(d,h);NP(e,t,n,A,p,i,s,o)}else{const A=K0(r);Qs(A,l,n,s,o)&&kh(A,e,t,n,i,s,o);const p=Z0(r,u);Qs(p,l,n,s,o)&&kh(p,e,t,n,i,s,o)}}const GP=["x","y","z"];function HP(r,e,t,n,i,s){e0.setBuffer(r._roots[e]);const o=Fh(0,r,t,n,i,s);return e0.clearBuffer(),o}function Fh(r,e,t,n,i,s){const{float32Array:o,uint16Array:l,uint32Array:h}=e0;let u=r*2;if(R0(u,l)){const d=or(r,h),A=mr(u,l);return PP(e,t,n,d,A,i,s)}else{const d=Cc(r,h),A=GP[d],p=n.direction[A]>=0;let g,m;p?(g=K0(r),m=Z0(r,h)):(g=Z0(r,h),m=K0(r));const E=Qs(g,o,n,i,s)?Fh(g,e,t,n,i,s):null;if(E){const v=E.point[A];if(p?v<=o[m+d]:v>=o[m+d+3])return E}const _=Qs(m,o,n,i,s)?Fh(m,e,t,n,i,s):null;return E&&_?E.distance<=_.distance?E:_:E||_||null}}const Uc=new I0,y1=new Wn,E1=new Wn,h2=new lt,Zm=new Tr,kc=new Tr;function VP(r,e,t,n){e0.setBuffer(r._roots[e]);const i=Oh(0,r,t,n);return e0.clearBuffer(),i}function Oh(r,e,t,n,i=null){const{float32Array:s,uint16Array:o,uint32Array:l}=e0;let h=r*2;if(i===null&&(t.boundingBox||t.computeBoundingBox(),Zm.set(t.boundingBox.min,t.boundingBox.max,n),i=Zm),R0(h,o)){const u=e.geometry,d=u.index,A=u.attributes.position,p=t.index,g=t.attributes.position,m=or(r,l),E=mr(h,o);if(h2.copy(n).invert(),t.boundsTree)return g0(r,s,kc),kc.matrix.copy(h2),kc.needsUpdate=!0,t.boundsTree.shapecast({intersectsBounds:_=>kc.intersectsBox(_),intersectsTriangle:_=>{_.a.applyMatrix4(n),_.b.applyMatrix4(n),_.c.applyMatrix4(n),_.needsUpdate=!0;for(let v=m*3,C=(E+m)*3;v<C;v+=3)if(D0(E1,v,d,A),E1.needsUpdate=!0,_.intersectsTriangle(E1))return!0;return!1}});{const _=bc(t);for(let v=m*3,C=(E+m)*3;v<C;v+=3){D0(y1,v,d,A),y1.a.applyMatrix4(h2),y1.b.applyMatrix4(h2),y1.c.applyMatrix4(h2),y1.needsUpdate=!0;for(let x=0,w=_*3;x<w;x+=3)if(D0(E1,x,p,g),E1.needsUpdate=!0,y1.intersectsTriangle(E1))return!0}}}else{const u=K0(r),d=Z0(r,l);return g0(u,s,Uc),!!(i.intersectsBox(Uc)&&Oh(u,e,t,n,i)||(g0(d,s,Uc),i.intersectsBox(Uc)&&Oh(d,e,t,n,i)))}}const Fc=new lt,Qh=new Tr,d2=new Tr,jP=new V,WP=new V,YP=new V,qP=new V;function XP(r,e,t,n={},i={},s=0,o=1/0){e.boundingBox||e.computeBoundingBox(),Qh.set(e.boundingBox.min,e.boundingBox.max,t),Qh.needsUpdate=!0;const l=r.geometry,h=l.attributes.position,u=l.index,d=e.attributes.position,A=e.index,p=Sn.getPrimitive(),g=Sn.getPrimitive();let m=jP,E=WP,_=null,v=null;i&&(_=YP,v=qP);let C=1/0,x=null,w=null;return Fc.copy(t).invert(),d2.matrix.copy(Fc),r.shapecast({boundsTraverseOrder:B=>Qh.distanceToBox(B),intersectsBounds:(B,T,S)=>S<C&&S<o?(T&&(d2.min.copy(B.min),d2.max.copy(B.max),d2.needsUpdate=!0),!0):!1,intersectsRange:(B,T)=>{if(e.boundsTree)return e.boundsTree.shapecast({boundsTraverseOrder:S=>d2.distanceToBox(S),intersectsBounds:(S,D,R)=>R<C&&R<o,intersectsRange:(S,D)=>{for(let R=S,M=S+D;R<M;R++){D0(g,3*R,A,d),g.a.applyMatrix4(t),g.b.applyMatrix4(t),g.c.applyMatrix4(t),g.needsUpdate=!0;for(let L=B,P=B+T;L<P;L++){D0(p,3*L,u,h),p.needsUpdate=!0;const F=p.distanceToTriangle(g,m,_);if(F<C&&(E.copy(m),v&&v.copy(_),C=F,x=L,w=R),F<s)return!0}}}});{const S=bc(e);for(let D=0,R=S;D<R;D++){D0(g,3*D,A,d),g.a.applyMatrix4(t),g.b.applyMatrix4(t),g.c.applyMatrix4(t),g.needsUpdate=!0;for(let M=B,L=B+T;M<L;M++){D0(p,3*M,u,h),p.needsUpdate=!0;const P=p.distanceToTriangle(g,m,_);if(P<C&&(E.copy(m),v&&v.copy(_),C=P,x=M,w=D),P<s)return!0}}}}}),Sn.releasePrimitive(p),Sn.releasePrimitive(g),C===1/0?null:(n.point?n.point.copy(E):n.point=E.clone(),n.distance=C,n.faceIndex=x,i&&(i.point?i.point.copy(v):i.point=v.clone(),i.point.applyMatrix4(Fc),E.applyMatrix4(Fc),i.distance=E.sub(i.point).length(),i.faceIndex=w),n)}function JP(r,e=null){e&&Array.isArray(e)&&(e=new Set(e));const t=r.geometry,n=t.index?t.index.array:null,i=t.attributes.position;let s,o,l,h,u=0;const d=r._roots;for(let p=0,g=d.length;p<g;p++)s=d[p],o=new Uint32Array(s),l=new Uint16Array(s),h=new Float32Array(s),A(0,u),u+=s.byteLength;function A(p,g,m=!1){const E=p*2;if(R0(E,l)){const _=or(p,o),v=mr(E,l);let C=1/0,x=1/0,w=1/0,B=-1/0,T=-1/0,S=-1/0;for(let D=_,R=_+v;D<R;D++){const M=3*r.resolveTriangleIndex(D);for(let L=0;L<3;L++){let P=M+L;P=n?n[P]:P;const F=i.getX(P),z=i.getY(P),J=i.getZ(P);F<C&&(C=F),F>B&&(B=F),z<x&&(x=z),z>T&&(T=z),J<w&&(w=J),J>S&&(S=J)}}return h[p+0]!==C||h[p+1]!==x||h[p+2]!==w||h[p+3]!==B||h[p+4]!==T||h[p+5]!==S?(h[p+0]=C,h[p+1]=x,h[p+2]=w,h[p+3]=B,h[p+4]=T,h[p+5]=S,!0):!1}else{const _=K0(p),v=Z0(p,o);let C=m,x=!1,w=!1;if(e){if(!C){const M=_/Q0+g/J0,L=v/Q0+g/J0;x=e.has(M),w=e.has(L),C=!x&&!w}}else x=!0,w=!0;const B=C||x,T=C||w;let S=!1;B&&(S=A(_,g,C));let D=!1;T&&(D=A(v,g,C));const R=S||D;if(R)for(let M=0;M<3;M++){const L=_+M,P=v+M,F=h[L],z=h[L+3],J=h[P],q=h[P+3];h[p+M]=F<J?F:J,h[p+M+3]=z>q?z:q}return R}}}function KP(r,e,t,n,i,s,o){e0.setBuffer(r._roots[e]),zh(0,r,t,n,i,s,o),e0.clearBuffer()}function zh(r,e,t,n,i,s,o){const{float32Array:l,uint16Array:h,uint32Array:u}=e0,d=r*2;if(R0(d,h)){const A=or(r,u),p=mr(d,h);FP(e,t,n,A,p,i,s,o)}else{const A=K0(r);Qs(A,l,n,s,o)&&zh(A,e,t,n,i,s,o);const p=Z0(r,u);Qs(p,l,n,s,o)&&zh(p,e,t,n,i,s,o)}}const ZP=["x","y","z"];function $P(r,e,t,n,i,s){e0.setBuffer(r._roots[e]);const o=Gh(0,r,t,n,i,s);return e0.clearBuffer(),o}function Gh(r,e,t,n,i,s){const{float32Array:o,uint16Array:l,uint32Array:h}=e0;let u=r*2;if(R0(u,l)){const d=or(r,h),A=mr(u,l);return OP(e,t,n,d,A,i,s)}else{const d=Cc(r,h),A=ZP[d],p=n.direction[A]>=0;let g,m;p?(g=K0(r),m=Z0(r,h)):(g=Z0(r,h),m=K0(r));const E=Qs(g,o,n,i,s)?Gh(g,e,t,n,i,s):null;if(E){const v=E.point[A];if(p?v<=o[m+d]:v>=o[m+d+3])return E}const _=Qs(m,o,n,i,s)?Gh(m,e,t,n,i,s):null;return E&&_?E.distance<=_.distance?E:_:E||_||null}}const Oc=new I0,x1=new Wn,w1=new Wn,f2=new lt,$m=new Tr,Qc=new Tr;function eU(r,e,t,n){e0.setBuffer(r._roots[e]);const i=Hh(0,r,t,n);return e0.clearBuffer(),i}function Hh(r,e,t,n,i=null){const{float32Array:s,uint16Array:o,uint32Array:l}=e0;let h=r*2;if(i===null&&(t.boundingBox||t.computeBoundingBox(),$m.set(t.boundingBox.min,t.boundingBox.max,n),i=$m),R0(h,o)){const u=e.geometry,d=u.index,A=u.attributes.position,p=t.index,g=t.attributes.position,m=or(r,l),E=mr(h,o);if(f2.copy(n).invert(),t.boundsTree)return g0(r,s,Qc),Qc.matrix.copy(f2),Qc.needsUpdate=!0,t.boundsTree.shapecast({intersectsBounds:_=>Qc.intersectsBox(_),intersectsTriangle:_=>{_.a.applyMatrix4(n),_.b.applyMatrix4(n),_.c.applyMatrix4(n),_.needsUpdate=!0;for(let v=m,C=E+m;v<C;v++)if(D0(w1,3*e.resolveTriangleIndex(v),d,A),w1.needsUpdate=!0,_.intersectsTriangle(w1))return!0;return!1}});{const _=bc(t);for(let v=m,C=E+m;v<C;v++){const x=e.resolveTriangleIndex(v);D0(x1,3*x,d,A),x1.a.applyMatrix4(f2),x1.b.applyMatrix4(f2),x1.c.applyMatrix4(f2),x1.needsUpdate=!0;for(let w=0,B=_*3;w<B;w+=3)if(D0(w1,w,p,g),w1.needsUpdate=!0,x1.intersectsTriangle(w1))return!0}}}else{const u=K0(r),d=Z0(r,l);return g0(u,s,Oc),!!(i.intersectsBox(Oc)&&Hh(u,e,t,n,i)||(g0(d,s,Oc),i.intersectsBox(Oc)&&Hh(d,e,t,n,i)))}}const zc=new lt,Vh=new Tr,p2=new Tr,tU=new V,rU=new V,nU=new V,iU=new V;function sU(r,e,t,n={},i={},s=0,o=1/0){e.boundingBox||e.computeBoundingBox(),Vh.set(e.boundingBox.min,e.boundingBox.max,t),Vh.needsUpdate=!0;const l=r.geometry,h=l.attributes.position,u=l.index,d=e.attributes.position,A=e.index,p=Sn.getPrimitive(),g=Sn.getPrimitive();let m=tU,E=rU,_=null,v=null;i&&(_=nU,v=iU);let C=1/0,x=null,w=null;return zc.copy(t).invert(),p2.matrix.copy(zc),r.shapecast({boundsTraverseOrder:B=>Vh.distanceToBox(B),intersectsBounds:(B,T,S)=>S<C&&S<o?(T&&(p2.min.copy(B.min),p2.max.copy(B.max),p2.needsUpdate=!0),!0):!1,intersectsRange:(B,T)=>{if(e.boundsTree){const S=e.boundsTree;return S.shapecast({boundsTraverseOrder:D=>p2.distanceToBox(D),intersectsBounds:(D,R,M)=>M<C&&M<o,intersectsRange:(D,R)=>{for(let M=D,L=D+R;M<L;M++){const P=S.resolveTriangleIndex(M);D0(g,3*P,A,d),g.a.applyMatrix4(t),g.b.applyMatrix4(t),g.c.applyMatrix4(t),g.needsUpdate=!0;for(let F=B,z=B+T;F<z;F++){const J=r.resolveTriangleIndex(F);D0(p,3*J,u,h),p.needsUpdate=!0;const q=p.distanceToTriangle(g,m,_);if(q<C&&(E.copy(m),v&&v.copy(_),C=q,x=F,w=M),q<s)return!0}}}})}else{const S=bc(e);for(let D=0,R=S;D<R;D++){D0(g,3*D,A,d),g.a.applyMatrix4(t),g.b.applyMatrix4(t),g.c.applyMatrix4(t),g.needsUpdate=!0;for(let M=B,L=B+T;M<L;M++){const P=r.resolveTriangleIndex(M);D0(p,3*P,u,h),p.needsUpdate=!0;const F=p.distanceToTriangle(g,m,_);if(F<C&&(E.copy(m),v&&v.copy(_),C=F,x=M,w=D),F<s)return!0}}}}}),Sn.releasePrimitive(p),Sn.releasePrimitive(g),C===1/0?null:(n.point?n.point.copy(E):n.point=E.clone(),n.distance=C,n.faceIndex=x,i&&(i.point?i.point.copy(v):i.point=v.clone(),i.point.applyMatrix4(zc),E.applyMatrix4(zc),i.distance=E.sub(i.point).length(),i.faceIndex=w),n)}function ev(r,e,t){return r===null?null:(r.point.applyMatrix4(e.matrixWorld),r.distance=r.point.distanceTo(t.ray.origin),r.object=e,r)}const Gc=new Tr,Hc=new Aa,tv=new V,rv=new lt,nv=new V,jh=["getX","getY","getZ"];class Vc extends MP{static serialize(e,t={}){t={cloneBuffers:!0,...t};const n=e.geometry,i=e._roots,s=e._indirectBuffer,o=n.getIndex(),l={version:1,roots:null,index:null,indirectBuffer:null};return t.cloneBuffers?(l.roots=i.map(h=>h.slice()),l.index=o?o.array.slice():null,l.indirectBuffer=s?s.slice():null):(l.roots=i,l.index=o?o.array:null,l.indirectBuffer=s),l}static deserialize(e,t,n={}){n={setIndex:!0,indirect:!!e.indirectBuffer,...n};const{index:i,roots:s,indirectBuffer:o}=e;e.version||(console.warn("MeshBVH.deserialize: Serialization format has been changed and will be fixed up. It is recommended to regenerate any stored serialized data."),h(s));const l=new Vc(t,{...n,[Ch]:!0});if(l._roots=s,l._indirectBuffer=o||null,n.setIndex){const u=t.getIndex();if(u===null){const d=new S0(e.index,1,!1);t.setIndex(d)}else u.array!==i&&(u.array.set(i),u.needsUpdate=!0)}return l;function h(u){for(let d=0;d<u.length;d++){const A=u[d],p=new Uint32Array(A),g=new Uint16Array(A);for(let m=0,E=A.byteLength/J0;m<E;m++){const _=Q0*m,v=2*_;R0(v,g)||(p[_+6]=p[_+6]/Q0-m)}}}}get primitiveStride(){return 3}get resolveTriangleIndex(){return this.resolvePrimitiveIndex}constructor(e,t={}){t.maxLeafTris&&(console.warn('MeshBVH: "maxLeafTris" option has been deprecated. Use maxLeafSize, instead.'),t={...t,maxLeafSize:t.maxLeafTris}),super(e,t)}shiftTriangleOffsets(e){return super.shiftPrimitiveOffsets(e)}writePrimitiveBounds(e,t,n){const i=this.geometry,s=this._indirectBuffer,o=i.attributes.position,l=i.index?i.index.array:null,h=(s?s[e]:e)*3;let u=h+0,d=h+1,A=h+2;l&&(u=l[u],d=l[d],A=l[A]);for(let p=0;p<3;p++){const g=o[jh[p]](u),m=o[jh[p]](d),E=o[jh[p]](A);let _=g;m<_&&(_=m),E<_&&(_=E);let v=g;m>v&&(v=m),E>v&&(v=E),t[n+p]=_,t[n+p+3]=v}return t}computePrimitiveBounds(e,t,n){const i=this.geometry,s=this._indirectBuffer,o=i.attributes.position,l=i.index?i.index.array:null,h=o.normalized;if(e<0||t+e-n.offset>n.length/6)throw new Error("MeshBVH: compute triangle bounds range is invalid.");const u=o.array,d=o.offset||0;let A=3;o.isInterleavedBufferAttribute&&(A=o.data.stride);const p=["getX","getY","getZ"],g=n.offset;for(let m=e,E=e+t;m<E;m++){const _=(s?s[m]:m)*3,v=(m-g)*6;let C=_+0,x=_+1,w=_+2;l&&(C=l[C],x=l[x],w=l[w]),h||(C=C*A+d,x=x*A+d,w=w*A+d);for(let B=0;B<3;B++){let T,S,D;h?(T=o[p[B]](C),S=o[p[B]](x),D=o[p[B]](w)):(T=u[C+B],S=u[x+B],D=u[w+B]);let R=T;S<R&&(R=S),D<R&&(R=D);let M=T;S>M&&(M=S),D>M&&(M=D);const L=(M-R)/2,P=B*2;n[v+P+0]=R+L,n[v+P+1]=L+(Math.abs(R)+L)*xc}}return n}raycastObject3D(e,t,n=[]){const{material:i}=e;if(i===void 0)return;rv.copy(e.matrixWorld).invert(),Hc.copy(t.ray).applyMatrix4(rv),nv.setFromMatrixScale(e.matrixWorld),tv.copy(Hc.direction).multiply(nv);const s=tv.length(),o=t.near/s,l=t.far/s;if(t.firstHitOnly===!0){let h=this.raycastFirst(Hc,i,o,l);h=ev(h,e,t),h&&n.push(h)}else{const h=this.raycast(Hc,i,o,l);for(let u=0,d=h.length;u<d;u++){const A=ev(h[u],e,t);A&&n.push(A)}}return n}refit(e=null){return(this.indirect?JP:kP)(this,e)}raycast(e,t=Un,n=0,i=1/0){const s=this._roots,o=[],l=this.indirect?KP:zP;for(let h=0,u=s.length;h<u;h++)l(this,h,t,e,o,n,i);return o}raycastFirst(e,t=Un,n=0,i=1/0){const s=this._roots;let o=null;const l=this.indirect?$P:HP;for(let h=0,u=s.length;h<u;h++){const d=l(this,h,t,e,n,i);d!=null&&(o==null||d.distance<o.distance)&&(o=d)}return o}intersectsGeometry(e,t){let n=!1;const i=this._roots,s=this.indirect?eU:VP;for(let o=0,l=i.length;o<l&&(n=s(this,o,e,t),!n);o++);return n}shapecast(e){const t=Sn.getPrimitive(),n=super.shapecast({...e,intersectsPrimitive:e.intersectsTriangle,scratchPrimitive:t,iterate:this.indirect?QP:UP});return Sn.releasePrimitive(t),n}bvhcast(e,t,n){let{intersectsRanges:i,intersectsTriangles:s}=n;const o=Sn.getPrimitive(),l=this.geometry.index,h=this.geometry.attributes.position,u=this.indirect?m=>{const E=this.resolveTriangleIndex(m);D0(o,E*3,l,h)}:m=>{D0(o,m*3,l,h)},d=Sn.getPrimitive(),A=e.geometry.index,p=e.geometry.attributes.position,g=e.indirect?m=>{const E=e.resolveTriangleIndex(m);D0(d,E*3,A,p)}:m=>{D0(d,m*3,A,p)};if(s){if(!(e instanceof Vc))throw new Error('MeshBVH: "intersectsTriangles" callback can only be used with another MeshBVH.');const m=(E,_,v,C,x,w,B,T)=>{for(let S=v,D=v+C;S<D;S++){g(S),d.a.applyMatrix4(t),d.b.applyMatrix4(t),d.c.applyMatrix4(t),d.needsUpdate=!0;for(let R=E,M=E+_;R<M;R++)if(u(R),o.needsUpdate=!0,s(o,d,R,S,x,w,B,T))return!0}return!1};if(i){const E=i;i=function(_,v,C,x,w,B,T,S){return E(_,v,C,x,w,B,T,S)?!0:m(_,v,C,x,w,B,T,S)}}else i=m}return super.bvhcast(e,t,{intersectsRanges:i})}intersectsBox(e,t){return Gc.set(e.min,e.max,t),Gc.needsUpdate=!0,this.shapecast({intersectsBounds:n=>Gc.intersectsBox(n),intersectsTriangle:n=>Gc.intersectsTriangle(n)})}intersectsSphere(e){return this.shapecast({intersectsBounds:t=>e.intersectsBox(t),intersectsTriangle:t=>t.intersectsSphere(e)})}closestPointToGeometry(e,t,n={},i={},s=0,o=1/0){return(this.indirect?sU:XP)(this,e,t,n,i,s,o)}closestPointToPoint(e,t={},n=0,i=1/0){return RP(this,e,t,n,i)}}function aU(r){switch(r){case 1:return"R";case 2:return"RG";case 3:return"RGBA";case 4:return"RGBA"}throw new Error}function oU(r){switch(r){case 1:return Ii;case 2:return hs;case 3:return Kt;case 4:return Kt}}function iv(r){switch(r){case 1:return r9;case 2:return $1;case 3:return mo;case 4:return mo}}class sv extends Hn{constructor(){super(),this.minFilter=$t,this.magFilter=$t,this.generateMipmaps=!1,this.overrideItemSize=null,this._forcedType=null}updateFrom(e){const t=this.overrideItemSize,n=e.itemSize,i=e.count;if(t!==null){if(n*i%t!==0)throw new Error("VertexAttributeTexture: overrideItemSize must divide evenly into buffer length.");e.itemSize=t,e.count=i*n/t}const s=e.itemSize,o=e.count,l=e.normalized,h=e.array.constructor,u=h.BYTES_PER_ELEMENT;let d=this._forcedType,A=s;if(d===null)switch(h){case Float32Array:d=Jt;break;case Uint8Array:case Uint16Array:case Uint32Array:d=An;break;case Int8Array:case Int16Array:case Int32Array:d=fo;break}let p,g,m,E,_=aU(s);switch(d){case Jt:m=1,g=oU(s),l&&u===1?(E=h,_+="8",h===Uint8Array?p=w0:(p=t9,_+="_SNORM")):(E=Float32Array,_+="32F",p=Jt);break;case fo:_+=u*8+"I",m=l?Math.pow(2,h.BYTES_PER_ELEMENT*8-1):1,g=iv(s),u===1?(E=Int8Array,p=t9):u===2?(E=Int16Array,p=_3):(E=Int32Array,p=fo);break;case An:_+=u*8+"UI",m=l?Math.pow(2,h.BYTES_PER_ELEMENT*8-1):1,g=iv(s),u===1?(E=Uint8Array,p=w0):u===2?(E=Uint16Array,p=ho):(E=Uint32Array,p=An);break}A===3&&(g===Kt||g===mo)&&(A=4);const v=Math.ceil(Math.sqrt(o))||1,C=A*v*v,x=new E(C),w=e.normalized;e.normalized=!1;for(let B=0;B<o;B++){const T=A*B;x[T]=e.getX(B)/m,s>=2&&(x[T+1]=e.getY(B)/m),s>=3&&(x[T+2]=e.getZ(B)/m,A===4&&(x[T+3]=1)),s>=4&&(x[T+3]=e.getW(B)/m)}e.normalized=w,this.internalFormat=_,this.format=g,this.type=p,this.image.width=v,this.image.height=v,this.image.data=x,this.needsUpdate=!0,this.dispose(),e.itemSize=n,e.count=i}}class lU extends sv{constructor(){super(),this._forcedType=An}}class cU extends sv{constructor(){super(),this._forcedType=Jt}}class uU{constructor(){this.index=new lU,this.position=new cU,this.bvhBounds=new Hn,this.bvhContents=new Hn,this._cachedIndexAttr=null,this.index.overrideItemSize=3}updateFrom(e){const{geometry:t}=e;if(dU(e,this.bvhBounds,this.bvhContents),this.position.updateFrom(t.attributes.position),e.indirect){const n=e._indirectBuffer;if(this._cachedIndexAttr===null||this._cachedIndexAttr.count!==n.length)if(t.index)this._cachedIndexAttr=t.index.clone();else{const i=Vm(Bc(t));this._cachedIndexAttr=new S0(i,1,!1)}hU(t,n,this._cachedIndexAttr),this.index.updateFrom(this._cachedIndexAttr)}else this.index.updateFrom(t.index)}dispose(){const{index:e,position:t,bvhBounds:n,bvhContents:i}=this;e&&e.dispose(),t&&t.dispose(),n&&n.dispose(),i&&i.dispose()}}function hU(r,e,t){const n=t.array,i=r.index?r.index.array:null;for(let s=0,o=e.length;s<o;s++){const l=3*s,h=3*e[s];for(let u=0;u<3;u++)n[l+u]=i?i[h+u]:h+u}}function dU(r,e,t){const n=r._roots;if(n.length!==1)throw new Error("MeshBVHUniformStruct: Multi-root BVHs not supported.");const i=n[0],s=new Uint16Array(i),o=new Uint32Array(i),l=new Float32Array(i),h=i.byteLength/J0,u=2*Math.ceil(Math.sqrt(h/2)),d=new Float32Array(4*u*u),A=Math.ceil(Math.sqrt(h)),p=new Uint32Array(2*A*A);for(let g=0;g<h;g++){const m=g*J0/4,E=m*2,_=m;for(let v=0;v<3;v++)d[8*g+0+v]=l[_+0+v],d[8*g+4+v]=l[_+3+v];if(R0(E,s)){const v=mr(E,s),C=or(m,o),x=lP|v;p[g*2+0]=x,p[g*2+1]=C}else{const v=o[m+6],C=Cc(m,o);p[g*2+0]=C,p[g*2+1]=v}}e.image.data=d,e.image.width=u,e.image.height=u,e.format=Kt,e.type=Jt,e.internalFormat="RGBA32F",e.minFilter=$t,e.magFilter=$t,e.generateMipmaps=!1,e.needsUpdate=!0,e.dispose(),t.image.data=p,t.image.width=A,t.image.height=A,t.format=$1,t.type=An,t.internalFormat="RG32UI",t.minFilter=$t,t.magFilter=$t,t.generateMipmaps=!1,t.needsUpdate=!0,t.dispose()}const fU=`
4085
+ `}setLensExtentOffsets(e){this.uniforms.minY.value+=e,this.uniforms.maxY.value+=e}getMaterial(){return this.material}getEdgeMaterial(){return this.edgeMaterial}}class aP{constructor(){me(this,"loader"),this.loader=new u7}async load(e){return new Promise((t,n)=>{this.loader.load(e,i=>{i.colorSpace=C0,i.flipY=!1,i.magFilter=Gt,i.minFilter=ex,i.wrapS=us,i.wrapT=us,t(i)},void 0,n)})}}const Lm=0,oP=1,Nm=2,Pm=2,xh=1.25,Um=1,J0=6*4+4+4,Q0=J0/4,wh=65535,lP=wh<<16,xc=Math.pow(2,-24),Ch=Symbol("SKIP_GENERATION"),km={strategy:Lm,maxDepth:40,maxLeafSize:10,useSharedArrayBuffer:!1,setBoundingBox:!0,onProgress:null,indirect:!1,verbose:!0,range:null,[Ch]:!1};function g0(r,e,t){return t.min.x=e[r],t.min.y=e[r+1],t.min.z=e[r+2],t.max.x=e[r+3],t.max.y=e[r+4],t.max.z=e[r+5],t}function Fm(r){let e=-1,t=-1/0;for(let n=0;n<3;n++){const i=r[n+3]-r[n];i>t&&(t=i,e=n)}return e}function Om(r,e){e.set(r)}function Qm(r,e,t){let n,i;for(let s=0;s<3;s++){const o=s+3;n=r[s],i=e[s],t[s]=n<i?n:i,n=r[o],i=e[o],t[o]=n>i?n:i}}function wc(r,e,t){for(let n=0;n<3;n++){const i=e[r+2*n],s=e[r+2*n+1],o=i-s,l=i+s;o<t[n]&&(t[n]=o),l>t[n+3]&&(t[n+3]=l)}}function o2(r){const e=r[3]-r[0],t=r[4]-r[1],n=r[5]-r[2];return 2*(e*t+t*n+n*e)}function R0(r,e){return e[r+15]===wh}function or(r,e){return e[r+6]}function mr(r,e){return e[r+14]}function K0(r){return r+Q0}function Z0(r,e){const t=e[r+6];return r+t*Q0}function Cc(r,e){return e[r+7]}function Ih(r,e,t,n,i){let s=1/0,o=1/0,l=1/0,h=-1/0,u=-1/0,d=-1/0,A=1/0,p=1/0,g=1/0,m=-1/0,E=-1/0,_=-1/0;const v=r.offset||0;for(let C=(e-v)*6,x=(e+t-v)*6;C<x;C+=6){const w=r[C+0],B=r[C+1],T=w-B,S=w+B;T<s&&(s=T),S>h&&(h=S),w<A&&(A=w),w>m&&(m=w);const D=r[C+2],R=r[C+3],M=D-R,L=D+R;M<o&&(o=M),L>u&&(u=L),D<p&&(p=D),D>E&&(E=D);const P=r[C+4],F=r[C+5],z=P-F,J=P+F;z<l&&(l=z),J>d&&(d=J),P<g&&(g=P),P>_&&(_=P)}n[0]=s,n[1]=o,n[2]=l,n[3]=h,n[4]=u,n[5]=d,i[0]=A,i[1]=p,i[2]=g,i[3]=m,i[4]=E,i[5]=_}const Wi=32,cP=(r,e)=>r.candidate-e.candidate,ks=new Array(Wi).fill().map(()=>({count:0,bounds:new Float32Array(6),rightCacheBounds:new Float32Array(6),leftCacheBounds:new Float32Array(6),candidate:0})),Ic=new Float32Array(6);function uP(r,e,t,n,i,s){let o=-1,l=0;if(s===Lm)o=Fm(e),o!==-1&&(l=(e[o]+e[o+3])/2);else if(s===oP)o=Fm(r),o!==-1&&(l=hP(t,n,i,o));else if(s===Nm){const h=o2(r);let u=xh*i;const d=t.offset||0,A=(n-d)*6,p=(n+i-d)*6;for(let g=0;g<3;g++){const m=e[g],E=(e[g+3]-m)/Wi;if(i<Wi/4){const _=[...ks];_.length=i;let v=0;for(let x=A;x<p;x+=6,v++){const w=_[v];w.candidate=t[x+2*g],w.count=0;const{bounds:B,leftCacheBounds:T,rightCacheBounds:S}=w;for(let D=0;D<3;D++)S[D]=1/0,S[D+3]=-1/0,T[D]=1/0,T[D+3]=-1/0,B[D]=1/0,B[D+3]=-1/0;wc(x,t,B)}_.sort(cP);let C=i;for(let x=0;x<C;x++){const w=_[x];for(;x+1<C&&_[x+1].candidate===w.candidate;)_.splice(x+1,1),C--}for(let x=A;x<p;x+=6){const w=t[x+2*g];for(let B=0;B<C;B++){const T=_[B];w>=T.candidate?wc(x,t,T.rightCacheBounds):(wc(x,t,T.leftCacheBounds),T.count++)}}for(let x=0;x<C;x++){const w=_[x],B=w.count,T=i-w.count,S=w.leftCacheBounds,D=w.rightCacheBounds;let R=0;B!==0&&(R=o2(S)/h);let M=0;T!==0&&(M=o2(D)/h);const L=Um+xh*(R*B+M*T);L<u&&(o=g,u=L,l=w.candidate)}}else{for(let C=0;C<Wi;C++){const x=ks[C];x.count=0,x.candidate=m+E+C*E;const w=x.bounds;for(let B=0;B<3;B++)w[B]=1/0,w[B+3]=-1/0}for(let C=A;C<p;C+=6){let x=~~((t[C+2*g]-m)/E);x>=Wi&&(x=Wi-1);const w=ks[x];w.count++,wc(C,t,w.bounds)}const _=ks[Wi-1];Om(_.bounds,_.rightCacheBounds);for(let C=Wi-2;C>=0;C--){const x=ks[C],w=ks[C+1];Qm(x.bounds,w.rightCacheBounds,x.rightCacheBounds)}let v=0;for(let C=0;C<Wi-1;C++){const x=ks[C],w=x.count,B=x.bounds,T=ks[C+1].rightCacheBounds;w!==0&&(v===0?Om(B,Ic):Qm(B,Ic,Ic)),v+=w;let S=0,D=0;v!==0&&(S=o2(Ic)/h);const R=i-v;R!==0&&(D=o2(T)/h);const M=Um+xh*(S*v+D*R);M<u&&(o=g,u=M,l=x.candidate)}}}}else console.warn(`BVH: Invalid build strategy value ${s} used.`);return{axis:o,pos:l}}function hP(r,e,t,n){let i=0;const s=r.offset;for(let o=e,l=e+t;o<l;o++)i+=r[(o-s)*6+n*2];return i/t}class Mh{constructor(){this.boundingData=new Float32Array(6)}}function dP(r,e,t,n,i,s){let o=n,l=n+i-1;const h=s.pos,u=s.axis*2,d=t.offset||0;for(;;){for(;o<=l&&t[(o-d)*6+u]<h;)o++;for(;o<=l&&t[(l-d)*6+u]>=h;)l--;if(o<l){for(let A=0;A<e;A++){let p=r[o*e+A];r[o*e+A]=r[l*e+A],r[l*e+A]=p}for(let A=0;A<6;A++){const p=o-d,g=l-d,m=t[p*6+A];t[p*6+A]=t[g*6+A],t[g*6+A]=m}o++,l--}else return o}}let zm,Mc,Sh,Gm;const fP=Math.pow(2,32);function Th(r){return"count"in r?1:1+Th(r.left)+Th(r.right)}function pP(r,e,t){return zm=new Float32Array(t),Mc=new Uint32Array(t),Sh=new Uint16Array(t),Gm=new Uint8Array(t),Bh(r,e)}function Bh(r,e){const t=r/4,n=r/2,i="count"in e,s=e.boundingData;for(let o=0;o<6;o++)zm[t+o]=s[o];if(i)return e.buffer?(Gm.set(new Uint8Array(e.buffer),r),r+e.buffer.byteLength):(Mc[t+6]=e.offset,Sh[n+14]=e.count,Sh[n+15]=wh,r+J0);{const{left:o,right:l,splitAxis:h}=e,u=r+J0;let d=Bh(u,o);const A=r/J0,p=d/J0-A;if(p>fP)throw new Error("MeshBVH: Cannot store relative child node offset greater than 32 bits.");return Mc[t+6]=p,Mc[t+7]=h,Bh(d,l)}}function AP(r,e,t,n,i,s){const{maxDepth:o,verbose:l,maxLeafSize:h,strategy:u,onProgress:d}=i,A=r.primitiveBuffer,p=r.primitiveBufferStride,g=new Float32Array(6);let m=!1;const E=new Mh;return Ih(e,t,n,E.boundingData,g),v(E,t,n,g),E;function _(C){d&&d((C-s.offset)/s.count)}function v(C,x,w,B=null,T=0){if(!m&&T>=o&&(m=!0,l&&console.warn(`BVH: Max depth of ${o} reached when generating BVH. Consider increasing maxDepth.`)),w<=h||T>=o)return _(x+w),C.offset=x,C.count=w,C;const S=uP(C.boundingData,B,e,x,w,u);if(S.axis===-1)return _(x+w),C.offset=x,C.count=w,C;const D=dP(A,p,e,x,w,S);if(D===x||D===x+w)_(x+w),C.offset=x,C.count=w;else{C.splitAxis=S.axis;const R=new Mh,M=x,L=D-x;C.left=R,Ih(e,M,L,R.boundingData,g),v(R,M,L,g,T+1);const P=new Mh,F=D,z=w-L;C.right=P,Ih(e,F,z,P.boundingData,g),v(P,F,z,g,T+1)}return C}}function gP(r,e){const t=e.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer,n=r.getRootRanges(e.range),i=n[0],s=n[n.length-1],o={offset:i.offset,count:s.offset+s.count-i.offset},l=new Float32Array(6*o.count);l.offset=o.offset,r.computePrimitiveBounds(o.offset,o.count,l),r._roots=n.map(h=>{const u=AP(r,l,h.offset,h.count,e,o),d=Th(u),A=new t(J0*d);return pP(0,u,A),A})}class bh{constructor(e){this._getNewPrimitive=e,this._primitives=[]}getPrimitive(){const e=this._primitives;return e.length===0?this._getNewPrimitive():e.pop()}releasePrimitive(e){this._primitives.push(e)}}class mP{constructor(){this.float32Array=null,this.uint16Array=null,this.uint32Array=null;const e=[];let t=null;this.setBuffer=n=>{t&&e.push(t),t=n,this.float32Array=new Float32Array(n),this.uint16Array=new Uint16Array(n),this.uint32Array=new Uint32Array(n)},this.clearBuffer=()=>{t=null,this.float32Array=null,this.uint16Array=null,this.uint32Array=null,e.length!==0&&this.setBuffer(e.pop())}}}const e0=new mP;let Fs,A1;const g1=[],Sc=new bh(()=>new I0);function vP(r,e,t,n,i,s){Fs=Sc.getPrimitive(),A1=Sc.getPrimitive(),g1.push(Fs,A1),e0.setBuffer(r._roots[e]);const o=Rh(0,r.geometry,t,n,i,s);e0.clearBuffer(),Sc.releasePrimitive(Fs),Sc.releasePrimitive(A1),g1.pop(),g1.pop();const l=g1.length;return l>0&&(A1=g1[l-1],Fs=g1[l-2]),o}function Rh(r,e,t,n,i=null,s=0,o=0){const{float32Array:l,uint16Array:h,uint32Array:u}=e0;let d=r*2;if(R0(d,h)){const A=or(r,u),p=mr(d,h);return g0(r,l,Fs),n(A,p,!1,o,s+r/Q0,Fs)}else{let A=function(L){const{uint16Array:P,uint32Array:F}=e0;let z=L*2;for(;!R0(z,P);)L=K0(L),z=L*2;return or(L,F)},p=function(L){const{uint16Array:P,uint32Array:F}=e0;let z=L*2;for(;!R0(z,P);)L=Z0(L,F),z=L*2;return or(L,F)+mr(z,P)};const g=K0(r),m=Z0(r,u);let E=g,_=m,v,C,x,w;if(i&&(x=Fs,w=A1,g0(E,l,x),g0(_,l,w),v=i(x),C=i(w),C<v)){E=m,_=g;const L=v;v=C,C=L,x=w}x||(x=Fs,g0(E,l,x));const B=R0(E*2,h),T=t(x,B,v,o+1,s+E/Q0);let S;if(T===Pm){const L=A(E),P=p(E)-L;S=n(L,P,!0,o+1,s+E/Q0,x)}else S=T&&Rh(E,e,t,n,i,s,o+1);if(S)return!0;w=A1,g0(_,l,w);const D=R0(_*2,h),R=t(w,D,C,o+1,s+_/Q0);let M;if(R===Pm){const L=A(_),P=p(_)-L;M=n(L,P,!0,o+1,s+_/Q0,w)}else M=R&&Rh(_,e,t,n,i,s,o+1);return!!M}}const l2=new e0.constructor,Tc=new e0.constructor,Os=new bh(()=>new I0),m1=new I0,v1=new I0,Dh=new I0,Lh=new I0;let Nh=!1;function _P(r,e,t,n){if(Nh)throw new Error("MeshBVH: Recursive calls to bvhcast not supported.");Nh=!0;const i=r._roots,s=e._roots;let o,l=0,h=0;const u=new lt().copy(t).invert();for(let d=0,A=i.length;d<A;d++){l2.setBuffer(i[d]),h=0;const p=Os.getPrimitive();g0(0,l2.float32Array,p),p.applyMatrix4(u);for(let g=0,m=s.length;g<m&&(Tc.setBuffer(s[g]),o=jn(0,0,t,u,n,l,h,0,0,p),Tc.clearBuffer(),h+=s[g].byteLength/J0,!o);g++);if(Os.releasePrimitive(p),l2.clearBuffer(),l+=i[d].byteLength/J0,o)break}return Nh=!1,o}function jn(r,e,t,n,i,s=0,o=0,l=0,h=0,u=null,d=!1){let A,p;d?(A=Tc,p=l2):(A=l2,p=Tc);const g=A.float32Array,m=A.uint32Array,E=A.uint16Array,_=p.float32Array,v=p.uint32Array,C=p.uint16Array,x=r*2,w=e*2,B=R0(x,E),T=R0(w,C);let S=!1;if(T&&B)d?S=i(or(e,v),mr(e*2,C),or(r,m),mr(r*2,E),h,o+e/Q0,l,s+r/Q0):S=i(or(r,m),mr(r*2,E),or(e,v),mr(e*2,C),l,s+r/Q0,h,o+e/Q0);else if(T){const D=Os.getPrimitive();g0(e,_,D),D.applyMatrix4(t);const R=K0(r),M=Z0(r,m);g0(R,g,m1),g0(M,g,v1);const L=D.intersectsBox(m1),P=D.intersectsBox(v1);S=L&&jn(e,R,n,t,i,o,s,h,l+1,D,!d)||P&&jn(e,M,n,t,i,o,s,h,l+1,D,!d),Os.releasePrimitive(D)}else{const D=K0(e),R=Z0(e,v);g0(D,_,Dh),g0(R,_,Lh);const M=u.intersectsBox(Dh),L=u.intersectsBox(Lh);if(M&&L)S=jn(r,D,t,n,i,s,o,l,h+1,u,d)||jn(r,R,t,n,i,s,o,l,h+1,u,d);else if(M)if(B)S=jn(r,D,t,n,i,s,o,l,h+1,u,d);else{const P=Os.getPrimitive();P.copy(Dh).applyMatrix4(t);const F=K0(r),z=Z0(r,m);g0(F,g,m1),g0(z,g,v1);const J=P.intersectsBox(m1),q=P.intersectsBox(v1);S=J&&jn(D,F,n,t,i,o,s,h,l+1,P,!d)||q&&jn(D,z,n,t,i,o,s,h,l+1,P,!d),Os.releasePrimitive(P)}else if(L)if(B)S=jn(r,R,t,n,i,s,o,l,h+1,u,d);else{const P=Os.getPrimitive();P.copy(Lh).applyMatrix4(t);const F=K0(r),z=Z0(r,m);g0(F,g,m1),g0(z,g,v1);const J=P.intersectsBox(m1),q=P.intersectsBox(v1);S=J&&jn(R,F,n,t,i,o,s,h,l+1,P,!d)||q&&jn(R,z,n,t,i,o,s,h,l+1,P,!d),Os.releasePrimitive(P)}}return S}const Hm=new I0,_1=new Float32Array(6);class yP{constructor(){this._roots=null,this.primitiveBuffer=null,this.primitiveBufferStride=null}init(e){e={...km,...e},gP(this,e)}getRootRanges(){throw new Error("BVH: getRootRanges() not implemented")}writePrimitiveBounds(){throw new Error("BVH: writePrimitiveBounds() not implemented")}writePrimitiveRangeBounds(e,t,n,i){let s=1/0,o=1/0,l=1/0,h=-1/0,u=-1/0,d=-1/0;for(let A=e,p=e+t;A<p;A++){this.writePrimitiveBounds(A,_1,0);const[g,m,E,_,v,C]=_1;g<s&&(s=g),_>h&&(h=_),m<o&&(o=m),v>u&&(u=v),E<l&&(l=E),C>d&&(d=C)}return n[i+0]=s,n[i+1]=o,n[i+2]=l,n[i+3]=h,n[i+4]=u,n[i+5]=d,n}computePrimitiveBounds(e,t,n){const i=n.offset||0;for(let s=e,o=e+t;s<o;s++){this.writePrimitiveBounds(s,_1,0);const[l,h,u,d,A,p]=_1,g=(l+d)/2,m=(h+A)/2,E=(u+p)/2,_=(d-l)/2,v=(A-h)/2,C=(p-u)/2,x=(s-i)*6;n[x+0]=g,n[x+1]=_+(Math.abs(g)+_)*xc,n[x+2]=m,n[x+3]=v+(Math.abs(m)+v)*xc,n[x+4]=E,n[x+5]=C+(Math.abs(E)+C)*xc}return n}shiftPrimitiveOffsets(e){const t=this._indirectBuffer;if(t)for(let n=0,i=t.length;n<i;n++)t[n]+=e;else{const n=this._roots;for(let i=0;i<n.length;i++){const s=n[i],o=new Uint32Array(s),l=new Uint16Array(s),h=s.byteLength/J0;for(let u=0;u<h;u++){const d=Q0*u,A=2*d;R0(A,l)&&(o[d+6]+=e)}}}}traverse(e,t=0){const n=this._roots[t],i=new Uint32Array(n),s=new Uint16Array(n);o(0);function o(l,h=0){const u=l*2,d=R0(u,s);if(d){const A=i[l+6],p=s[u+14];e(h,d,new Float32Array(n,l*4,6),A,p)}else{const A=K0(l),p=Z0(l,i),g=Cc(l,i);e(h,d,new Float32Array(n,l*4,6),g)||(o(A,h+1),o(p,h+1))}}}refit(){const e=this._roots;for(let t=0,n=e.length;t<n;t++){const i=e[t],s=new Uint32Array(i),o=new Uint16Array(i),l=new Float32Array(i),h=i.byteLength/J0;for(let u=h-1;u>=0;u--){const d=u*Q0,A=d*2;if(R0(A,o)){const p=or(d,s),g=mr(A,o);this.writePrimitiveRangeBounds(p,g,_1,0),l.set(_1,d)}else{const p=K0(d),g=Z0(d,s);for(let m=0;m<3;m++){const E=l[p+m],_=l[p+m+3],v=l[g+m],C=l[g+m+3];l[d+m]=E<v?E:v,l[d+m+3]=_>C?_:C}}}}}getBoundingBox(e){return e.makeEmpty(),this._roots.forEach(t=>{g0(0,new Float32Array(t),Hm),e.union(Hm)}),e}shapecast(e){let{boundsTraverseOrder:t,intersectsBounds:n,intersectsRange:i,intersectsPrimitive:s,scratchPrimitive:o,iterate:l}=e;if(i&&s){const A=i;i=(p,g,m,E,_)=>A(p,g,m,E,_)?!0:l(p,g,this,s,m,E,o)}else i||(s?i=(A,p,g,m)=>l(A,p,this,s,g,m,o):i=(A,p,g)=>g);let h=!1,u=0;const d=this._roots;for(let A=0,p=d.length;A<p;A++){const g=d[A];if(h=vP(this,A,n,i,t,u),h)break;u+=g.byteLength/J0}return h}bvhcast(e,t,n){let{intersectsRanges:i}=n;return _P(this,e,t,i)}}function EP(){return typeof SharedArrayBuffer<"u"}function Bc(r){return r.index?r.index.count:r.attributes.position.count}function bc(r){return Bc(r)/3}function Vm(r,e=ArrayBuffer){return r>65535?new Uint32Array(new e(4*r)):new Uint16Array(new e(2*r))}function xP(r,e){if(!r.index){const t=r.attributes.position.count,n=e.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer,i=Vm(t,n);r.setIndex(new S0(i,1));for(let s=0;s<t;s++)i[s]=s}}function wP(r,e,t){const n=Bc(r)/t,i=e||r.drawRange,s=i.start/t,o=(i.start+i.count)/t,l=Math.max(0,s),h=Math.min(n,o)-l;return{offset:Math.floor(l),count:Math.floor(h)}}function CP(r,e){return r.groups.map(t=>({offset:t.start/e,count:t.count/e}))}function jm(r,e,t){const n=wP(r,e,t),i=CP(r,t);if(!i.length)return[n];const s=[],o=n.offset,l=n.offset+n.count,h=Bc(r)/t,u=[];for(const p of i){const{offset:g,count:m}=p,E=g,_=isFinite(m)?m:h-g,v=g+_;E<l&&v>o&&(u.push({pos:Math.max(o,E),isStart:!0}),u.push({pos:Math.min(l,v),isStart:!1}))}u.sort((p,g)=>p.pos!==g.pos?p.pos-g.pos:p.type==="end"?-1:1);let d=0,A=null;for(const p of u){const g=p.pos;d!==0&&g!==A&&s.push({offset:A,count:g-A}),d+=p.isStart?1:-1,A=g}return s}function IP(r,e){const t=r[r.length-1],n=t.offset+t.count>2**16,i=r.reduce((u,d)=>u+d.count,0),s=n?4:2,o=e?new SharedArrayBuffer(i*s):new ArrayBuffer(i*s),l=n?new Uint32Array(o):new Uint16Array(o);let h=0;for(let u=0;u<r.length;u++){const{offset:d,count:A}=r[u];for(let p=0;p<A;p++)l[h+p]=d+p;h+=A}return l}class MP extends yP{get indirect(){return!!this._indirectBuffer}get primitiveStride(){return null}get primitiveBufferStride(){return this.indirect?1:this.primitiveStride}set primitiveBufferStride(e){}get primitiveBuffer(){return this.indirect?this._indirectBuffer:this.geometry.index.array}set primitiveBuffer(e){}constructor(e,t={}){if(e.isBufferGeometry){if(e.index&&e.index.isInterleavedBufferAttribute)throw new Error("BVH: InterleavedBufferAttribute is not supported for the index attribute.")}else throw new Error("BVH: Only BufferGeometries are supported.");if(t.useSharedArrayBuffer&&!EP())throw new Error("BVH: SharedArrayBuffer is not available.");super(),this.geometry=e,this.resolvePrimitiveIndex=t.indirect?n=>this._indirectBuffer[n]:n=>n,this.primitiveBuffer=null,this.primitiveBufferStride=null,this._indirectBuffer=null,t={...km,...t},t[Ch]||this.init(t)}init(e){const{geometry:t,primitiveStride:n}=this;if(e.indirect){const i=jm(t,e.range,n),s=IP(i,e.useSharedArrayBuffer);this._indirectBuffer=s}else xP(t,e);super.init(e),!t.boundingBox&&e.setBoundingBox&&(t.boundingBox=this.getBoundingBox(new I0))}getRootRanges(e){return this.indirect?[{offset:0,count:this._indirectBuffer.length}]:jm(this.geometry,e,this.primitiveStride)}raycastObject3D(){throw new Error("BVH: raycastObject3D() not implemented")}}class Yi{constructor(){this.min=1/0,this.max=-1/0}setFromPointsField(e,t){let n=1/0,i=-1/0;for(let s=0,o=e.length;s<o;s++){const l=e[s][t];n=l<n?l:n,i=l>i?l:i}this.min=n,this.max=i}setFromPoints(e,t){let n=1/0,i=-1/0;for(let s=0,o=t.length;s<o;s++){const l=t[s],h=e.dot(l);n=h<n?h:n,i=h>i?h:i}this.min=n,this.max=i}isSeparated(e){return this.min>e.max||e.min>this.max}}Yi.prototype.setFromBox=function(){const r=new V;return function(e,t){const n=t.min,i=t.max;let s=1/0,o=-1/0;for(let l=0;l<=1;l++)for(let h=0;h<=1;h++)for(let u=0;u<=1;u++){r.x=n.x*l+i.x*(1-l),r.y=n.y*h+i.y*(1-h),r.z=n.z*u+i.z*(1-u);const d=e.dot(r);s=Math.min(d,s),o=Math.max(d,o)}this.min=s,this.max=o}}();const SP=function(){const r=new V,e=new V,t=new V;return function(n,i,s){const o=n.start,l=r,h=i.start,u=e;t.subVectors(o,h),r.subVectors(n.end,n.start),e.subVectors(i.end,i.start);const d=t.dot(u),A=u.dot(l),p=u.dot(u),g=t.dot(l),m=l.dot(l)*p-A*A;let E,_;m!==0?E=(d*A-g*p)/m:E=0,_=(d+E*A)/p,s.x=E,s.y=_}}(),Ph=function(){const r=new ze,e=new V,t=new V;return function(n,i,s,o){SP(n,i,r);let l=r.x,h=r.y;if(l>=0&&l<=1&&h>=0&&h<=1){n.at(l,s),i.at(h,o);return}else if(l>=0&&l<=1){h<0?i.at(0,o):i.at(1,o),n.closestPointToPoint(o,!0,s);return}else if(h>=0&&h<=1){l<0?n.at(0,s):n.at(1,s),i.closestPointToPoint(s,!0,o);return}else{let u;l<0?u=n.start:u=n.end;let d;h<0?d=i.start:d=i.end;const A=e,p=t;if(n.closestPointToPoint(d,!0,e),i.closestPointToPoint(u,!0,t),A.distanceToSquared(d)<=p.distanceToSquared(u)){s.copy(A),o.copy(d);return}else{s.copy(u),o.copy(p);return}}}}(),TP=function(){const r=new V,e=new V,t=new ai,n=new Ui;return function(i,s){const{radius:o,center:l}=i,{a:h,b:u,c:d}=s;if(n.start=h,n.end=u,n.closestPointToPoint(l,!0,r).distanceTo(l)<=o||(n.start=h,n.end=d,n.closestPointToPoint(l,!0,r).distanceTo(l)<=o)||(n.start=u,n.end=d,n.closestPointToPoint(l,!0,r).distanceTo(l)<=o))return!0;const A=s.getPlane(t);if(Math.abs(A.distanceToPoint(l))<=o){const p=A.projectPoint(l,e);if(s.containsPoint(p))return!0}return!1}}(),BP=["x","y","z"],qi=1e-15,Wm=qi*qi;function Mn(r){return Math.abs(r)<qi}class Wn extends ir{constructor(...e){super(...e),this.isExtendedTriangle=!0,this.satAxes=new Array(4).fill().map(()=>new V),this.satBounds=new Array(4).fill().map(()=>new Yi),this.points=[this.a,this.b,this.c],this.plane=new ai,this.isDegenerateIntoSegment=!1,this.isDegenerateIntoPoint=!1,this.degenerateSegment=new Ui,this.needsUpdate=!0}intersectsSphere(e){return TP(e,this)}update(){const e=this.a,t=this.b,n=this.c,i=this.points,s=this.satAxes,o=this.satBounds,l=s[0],h=o[0];this.getNormal(l),h.setFromPoints(l,i);const u=s[1],d=o[1];u.subVectors(e,t),d.setFromPoints(u,i);const A=s[2],p=o[2];A.subVectors(t,n),p.setFromPoints(A,i);const g=s[3],m=o[3];g.subVectors(n,e),m.setFromPoints(g,i);const E=u.length(),_=A.length(),v=g.length();this.isDegenerateIntoPoint=!1,this.isDegenerateIntoSegment=!1,E<qi?_<qi||v<qi?this.isDegenerateIntoPoint=!0:(this.isDegenerateIntoSegment=!0,this.degenerateSegment.start.copy(e),this.degenerateSegment.end.copy(n)):_<qi?v<qi?this.isDegenerateIntoPoint=!0:(this.isDegenerateIntoSegment=!0,this.degenerateSegment.start.copy(t),this.degenerateSegment.end.copy(e)):v<qi&&(this.isDegenerateIntoSegment=!0,this.degenerateSegment.start.copy(n),this.degenerateSegment.end.copy(t)),this.plane.setFromNormalAndCoplanarPoint(l,e),this.needsUpdate=!1}}Wn.prototype.closestPointToSegment=function(){const r=new V,e=new V,t=new Ui;return function(n,i=null,s=null){const{start:o,end:l}=n,h=this.points;let u,d=1/0;for(let A=0;A<3;A++){const p=(A+1)%3;t.start.copy(h[A]),t.end.copy(h[p]),Ph(t,n,r,e),u=r.distanceToSquared(e),u<d&&(d=u,i&&i.copy(r),s&&s.copy(e))}return this.closestPointToPoint(o,r),u=o.distanceToSquared(r),u<d&&(d=u,i&&i.copy(r),s&&s.copy(o)),this.closestPointToPoint(l,r),u=l.distanceToSquared(r),u<d&&(d=u,i&&i.copy(r),s&&s.copy(l)),Math.sqrt(d)}}(),Wn.prototype.intersectsTriangle=function(){const r=new Wn,e=new Yi,t=new Yi,n=new V,i=new V,s=new V,o=new V,l=new Ui,h=new Ui,u=new V,d=new ze,A=new ze;function p(x,w,B,T){const S=n;!x.isDegenerateIntoPoint&&!x.isDegenerateIntoSegment?S.copy(x.plane.normal):S.copy(w.plane.normal);const D=x.satBounds,R=x.satAxes;for(let P=1;P<4;P++){const F=D[P],z=R[P];if(e.setFromPoints(z,w.points),F.isSeparated(e)||(o.copy(S).cross(z),e.setFromPoints(o,x.points),t.setFromPoints(o,w.points),e.isSeparated(t)))return!1}const M=w.satBounds,L=w.satAxes;for(let P=1;P<4;P++){const F=M[P],z=L[P];if(e.setFromPoints(z,x.points),F.isSeparated(e)||(o.crossVectors(S,z),e.setFromPoints(o,x.points),t.setFromPoints(o,w.points),e.isSeparated(t)))return!1}return B&&(T||console.warn("ExtendedTriangle.intersectsTriangle: Triangles are coplanar which does not support an output edge. Setting edge to 0, 0, 0."),B.start.set(0,0,0),B.end.set(0,0,0)),!0}function g(x,w,B,T,S,D,R,M,L,P,F){let z=R/(R-M);P.x=T+(S-T)*z,F.start.subVectors(w,x).multiplyScalar(z).add(x),z=R/(R-L),P.y=T+(D-T)*z,F.end.subVectors(B,x).multiplyScalar(z).add(x)}function m(x,w,B,T,S,D,R,M,L,P,F){if(S>0)g(x.c,x.a,x.b,T,w,B,L,R,M,P,F);else if(D>0)g(x.b,x.a,x.c,B,w,T,M,R,L,P,F);else if(M*L>0||R!=0)g(x.a,x.b,x.c,w,B,T,R,M,L,P,F);else if(M!=0)g(x.b,x.a,x.c,B,w,T,M,R,L,P,F);else if(L!=0)g(x.c,x.a,x.b,T,w,B,L,R,M,P,F);else return!0;return!1}function E(x,w,B,T){const S=w.degenerateSegment,D=x.plane.distanceToPoint(S.start),R=x.plane.distanceToPoint(S.end);return Mn(D)?Mn(R)?p(x,w,B,T):(B&&(B.start.copy(S.start),B.end.copy(S.start)),x.containsPoint(S.start)):Mn(R)?(B&&(B.start.copy(S.end),B.end.copy(S.end)),x.containsPoint(S.end)):x.plane.intersectLine(S,n)!=null?(B&&(B.start.copy(n),B.end.copy(n)),x.containsPoint(n)):!1}function _(x,w,B){const T=w.a;return Mn(x.plane.distanceToPoint(T))&&x.containsPoint(T)?(B&&(B.start.copy(T),B.end.copy(T)),!0):!1}function v(x,w,B){const T=x.degenerateSegment,S=w.a;return T.closestPointToPoint(S,!0,n),S.distanceToSquared(n)<Wm?(B&&(B.start.copy(S),B.end.copy(S)),!0):!1}function C(x,w,B,T){if(x.isDegenerateIntoSegment)if(w.isDegenerateIntoSegment){const S=x.degenerateSegment,D=w.degenerateSegment,R=i,M=s;S.delta(R),D.delta(M);const L=n.subVectors(D.start,S.start),P=R.x*M.y-R.y*M.x;if(Mn(P))return!1;const F=(L.x*M.y-L.y*M.x)/P,z=-(R.x*L.y-R.y*L.x)/P;if(F<0||F>1||z<0||z>1)return!1;const J=S.start.z+R.z*F,q=D.start.z+M.z*z;return Mn(J-q)?(B&&(B.start.copy(S.start).addScaledVector(R,F),B.end.copy(S.start).addScaledVector(R,F)),!0):!1}else return w.isDegenerateIntoPoint?v(x,w,B):E(w,x,B,T);else{if(x.isDegenerateIntoPoint)return w.isDegenerateIntoPoint?w.a.distanceToSquared(x.a)<Wm?(B&&(B.start.copy(x.a),B.end.copy(x.a)),!0):!1:w.isDegenerateIntoSegment?v(w,x,B):_(w,x,B);if(w.isDegenerateIntoPoint)return _(x,w,B);if(w.isDegenerateIntoSegment)return E(x,w,B,T)}}return function(x,w=null,B=!1){this.needsUpdate&&this.update(),x.isExtendedTriangle?x.needsUpdate&&x.update():(r.copy(x),r.update(),x=r);const T=C(this,x,w,B);if(T!==void 0)return T;const S=this.plane,D=x.plane;let R=D.distanceToPoint(this.a),M=D.distanceToPoint(this.b),L=D.distanceToPoint(this.c);Mn(R)&&(R=0),Mn(M)&&(M=0),Mn(L)&&(L=0);const P=R*M,F=R*L;if(P>0&&F>0)return!1;let z=S.distanceToPoint(x.a),J=S.distanceToPoint(x.b),q=S.distanceToPoint(x.c);Mn(z)&&(z=0),Mn(J)&&(J=0),Mn(q)&&(q=0);const ne=z*J,j=z*q;if(ne>0&&j>0)return!1;i.copy(S.normal),s.copy(D.normal);const te=i.cross(s);let W=0,U=Math.abs(te.x);const H=Math.abs(te.y);H>U&&(U=H,W=1),Math.abs(te.z)>U&&(W=2);const Z=BP[W],G=this.a[Z],oe=this.b[Z],pe=this.c[Z],Ae=x.a[Z],ge=x.b[Z],Re=x.c[Z];if(m(this,G,oe,pe,P,F,R,M,L,d,l))return p(this,x,w,B);if(m(x,Ae,ge,Re,ne,j,z,J,q,A,h))return p(this,x,w,B);if(d.y<d.x){const Oe=d.y;d.y=d.x,d.x=Oe,u.copy(l.start),l.start.copy(l.end),l.end.copy(u)}if(A.y<A.x){const Oe=A.y;A.y=A.x,A.x=Oe,u.copy(h.start),h.start.copy(h.end),h.end.copy(u)}return d.y<A.x||A.y<d.x?!1:(w&&(A.x>d.x?w.start.copy(h.start):w.start.copy(l.start),A.y<d.y?w.end.copy(h.end):w.end.copy(l.end)),!0)}}(),Wn.prototype.distanceToPoint=function(){const r=new V;return function(e){return this.closestPointToPoint(e,r),e.distanceTo(r)}}(),Wn.prototype.distanceToTriangle=function(){const r=new V,e=new V,t=["a","b","c"],n=new Ui,i=new Ui;return function(s,o=null,l=null){const h=o||l?n:null;if(this.intersectsTriangle(s,h,!0))return(o||l)&&(o&&h.getCenter(o),l&&h.getCenter(l)),0;let u=1/0;for(let d=0;d<3;d++){let A;const p=t[d],g=s[p];this.closestPointToPoint(g,r),A=g.distanceToSquared(r),A<u&&(u=A,o&&o.copy(r),l&&l.copy(g));const m=this[p];s.closestPointToPoint(m,r),A=m.distanceToSquared(r),A<u&&(u=A,o&&o.copy(m),l&&l.copy(r))}for(let d=0;d<3;d++){const A=t[d],p=t[(d+1)%3];n.set(this[A],this[p]);for(let g=0;g<3;g++){const m=t[g],E=t[(g+1)%3];i.set(s[m],s[E]),Ph(n,i,r,e);const _=r.distanceToSquared(e);_<u&&(u=_,o&&o.copy(r),l&&l.copy(e))}}return Math.sqrt(u)}}();class Tr{constructor(e,t,n){this.isOrientedBox=!0,this.min=new V,this.max=new V,this.matrix=new lt,this.invMatrix=new lt,this.points=new Array(8).fill().map(()=>new V),this.satAxes=new Array(3).fill().map(()=>new V),this.satBounds=new Array(3).fill().map(()=>new Yi),this.alignedSatBounds=new Array(3).fill().map(()=>new Yi),this.needsUpdate=!1,e&&this.min.copy(e),t&&this.max.copy(t),n&&this.matrix.copy(n)}set(e,t,n){this.min.copy(e),this.max.copy(t),this.matrix.copy(n),this.needsUpdate=!0}copy(e){this.min.copy(e.min),this.max.copy(e.max),this.matrix.copy(e.matrix),this.needsUpdate=!0}}Tr.prototype.update=function(){return function(){const r=this.matrix,e=this.min,t=this.max,n=this.points;for(let h=0;h<=1;h++)for(let u=0;u<=1;u++)for(let d=0;d<=1;d++){const A=1*h|2*u|4*d,p=n[A];p.x=h?t.x:e.x,p.y=u?t.y:e.y,p.z=d?t.z:e.z,p.applyMatrix4(r)}const i=this.satBounds,s=this.satAxes,o=n[0];for(let h=0;h<3;h++){const u=s[h],d=i[h],A=1<<h,p=n[A];u.subVectors(o,p),d.setFromPoints(u,n)}const l=this.alignedSatBounds;l[0].setFromPointsField(n,"x"),l[1].setFromPointsField(n,"y"),l[2].setFromPointsField(n,"z"),this.invMatrix.copy(this.matrix).invert(),this.needsUpdate=!1}}(),Tr.prototype.intersectsBox=function(){const r=new Yi;return function(e){this.needsUpdate&&this.update();const t=e.min,n=e.max,i=this.satBounds,s=this.satAxes,o=this.alignedSatBounds;if(r.min=t.x,r.max=n.x,o[0].isSeparated(r)||(r.min=t.y,r.max=n.y,o[1].isSeparated(r))||(r.min=t.z,r.max=n.z,o[2].isSeparated(r)))return!1;for(let l=0;l<3;l++){const h=s[l],u=i[l];if(r.setFromBox(h,e),u.isSeparated(r))return!1}return!0}}(),Tr.prototype.intersectsTriangle=function(){const r=new Wn,e=new Array(3),t=new Yi,n=new Yi,i=new V;return function(s){this.needsUpdate&&this.update(),s.isExtendedTriangle?s.needsUpdate&&s.update():(r.copy(s),r.update(),s=r);const o=this.satBounds,l=this.satAxes;e[0]=s.a,e[1]=s.b,e[2]=s.c;for(let A=0;A<3;A++){const p=o[A],g=l[A];if(t.setFromPoints(g,e),p.isSeparated(t))return!1}const h=s.satBounds,u=s.satAxes,d=this.points;for(let A=0;A<3;A++){const p=h[A],g=u[A];if(t.setFromPoints(g,d),p.isSeparated(t))return!1}for(let A=0;A<3;A++){const p=l[A];for(let g=0;g<4;g++){const m=u[g];if(i.crossVectors(p,m),t.setFromPoints(i,e),n.setFromPoints(i,d),t.isSeparated(n))return!1}}return!0}}(),Tr.prototype.closestPointToPoint=function(){return function(r,e){return this.needsUpdate&&this.update(),e.copy(r).applyMatrix4(this.invMatrix).clamp(this.min,this.max).applyMatrix4(this.matrix),e}}(),Tr.prototype.distanceToPoint=function(){const r=new V;return function(e){return this.closestPointToPoint(e,r),e.distanceTo(r)}}(),Tr.prototype.distanceToBox=function(){const r=["x","y","z"],e=new Array(12).fill().map(()=>new Ui),t=new Array(12).fill().map(()=>new Ui),n=new V,i=new V;return function(s,o=0,l=null,h=null){if(this.needsUpdate&&this.update(),this.intersectsBox(s))return(l||h)&&(s.getCenter(i),this.closestPointToPoint(i,n),s.closestPointToPoint(n,i),l&&l.copy(n),h&&h.copy(i)),0;const u=o*o,d=s.min,A=s.max,p=this.points;let g=1/0;for(let E=0;E<8;E++){const _=p[E];i.copy(_).clamp(d,A);const v=_.distanceToSquared(i);if(v<g&&(g=v,l&&l.copy(_),h&&h.copy(i),v<u))return Math.sqrt(v)}let m=0;for(let E=0;E<3;E++)for(let _=0;_<=1;_++)for(let v=0;v<=1;v++){const C=(E+1)%3,x=(E+2)%3,w=_<<C|v<<x,B=1<<E|_<<C|v<<x,T=p[w],S=p[B];e[m].set(T,S);const D=r[E],R=r[C],M=r[x],L=t[m],P=L.start,F=L.end;P[D]=d[D],P[R]=_?d[R]:A[R],P[M]=v?d[M]:A[R],F[D]=A[D],F[R]=_?d[R]:A[R],F[M]=v?d[M]:A[R],m++}for(let E=0;E<=1;E++)for(let _=0;_<=1;_++)for(let v=0;v<=1;v++){i.x=E?A.x:d.x,i.y=_?A.y:d.y,i.z=v?A.z:d.z,this.closestPointToPoint(i,n);const C=i.distanceToSquared(n);if(C<g&&(g=C,l&&l.copy(n),h&&h.copy(i),C<u))return Math.sqrt(C)}for(let E=0;E<12;E++){const _=e[E];for(let v=0;v<12;v++){const C=t[v];Ph(_,C,n,i);const x=n.distanceToSquared(i);if(x<g&&(g=x,l&&l.copy(n),h&&h.copy(i),x<u))return Math.sqrt(x)}}return Math.sqrt(g)}}();class bP extends bh{constructor(){super(()=>new Wn)}}const Sn=new bP,c2=new V,Uh=new V;function RP(r,e,t={},n=0,i=1/0){const s=n*n,o=i*i;let l=1/0,h=null;if(r.shapecast({boundsTraverseOrder:d=>(c2.copy(e).clamp(d.min,d.max),c2.distanceToSquared(e)),intersectsBounds:(d,A,p)=>p<l&&p<o,intersectsTriangle:(d,A)=>{d.closestPointToPoint(e,c2);const p=e.distanceToSquared(c2);return p<l&&(Uh.copy(c2),l=p,h=A),p<s}}),l===1/0)return null;const u=Math.sqrt(l);return t.point?t.point.copy(Uh):t.point=Uh.clone(),t.distance=u,t.faceIndex=h,t}const Rc=parseInt(K1)>=169,DP=parseInt(K1)<=161,Ga=new V,Ha=new V,Va=new V,Dc=new ze,Lc=new ze,Nc=new ze,Ym=new V,qm=new V,Xm=new V,u2=new V;function LP(r,e,t,n,i,s,o,l){let h;if(s===V0?h=r.intersectTriangle(n,t,e,!0,i):h=r.intersectTriangle(e,t,n,s!==pn,i),h===null)return null;const u=r.origin.distanceTo(i);return u<o||u>l?null:{distance:u,point:i.clone()}}function Jm(r,e,t,n,i,s,o,l,h,u,d){Ga.fromBufferAttribute(e,s),Ha.fromBufferAttribute(e,o),Va.fromBufferAttribute(e,l);const A=LP(r,Ga,Ha,Va,u2,h,u,d);if(A){if(n){Dc.fromBufferAttribute(n,s),Lc.fromBufferAttribute(n,o),Nc.fromBufferAttribute(n,l),A.uv=new ze;const g=ir.getInterpolation(u2,Ga,Ha,Va,Dc,Lc,Nc,A.uv);Rc||(A.uv=g)}if(i){Dc.fromBufferAttribute(i,s),Lc.fromBufferAttribute(i,o),Nc.fromBufferAttribute(i,l),A.uv1=new ze;const g=ir.getInterpolation(u2,Ga,Ha,Va,Dc,Lc,Nc,A.uv1);Rc||(A.uv1=g),DP&&(A.uv2=A.uv1)}if(t){Ym.fromBufferAttribute(t,s),qm.fromBufferAttribute(t,o),Xm.fromBufferAttribute(t,l),A.normal=new V;const g=ir.getInterpolation(u2,Ga,Ha,Va,Ym,qm,Xm,A.normal);A.normal.dot(r.direction)>0&&A.normal.multiplyScalar(-1),Rc||(A.normal=g)}const p={a:s,b:o,c:l,normal:new V,materialIndex:0};if(ir.getNormal(Ga,Ha,Va,p.normal),A.face=p,A.faceIndex=s,Rc){const g=new V;ir.getBarycoord(u2,Ga,Ha,Va,g),A.barycoord=g}}return A}function Km(r){return r&&r.isMaterial?r.side:r}function Pc(r,e,t,n,i,s,o){const l=n*3;let h=l+0,u=l+1,d=l+2;const{index:A,groups:p}=r;r.index&&(h=A.getX(h),u=A.getX(u),d=A.getX(d));const{position:g,normal:m,uv:E,uv1:_}=r.attributes;if(Array.isArray(e)){const v=n*3;for(let C=0,x=p.length;C<x;C++){const{start:w,count:B,materialIndex:T}=p[C];if(v>=w&&v<w+B){const S=Km(e[T]),D=Jm(t,g,m,E,_,h,u,d,S,s,o);if(D)if(D.faceIndex=n,D.face.materialIndex=T,i)i.push(D);else return D}}}else{const v=Km(e),C=Jm(t,g,m,E,_,h,u,d,v,s,o);if(C)if(C.faceIndex=n,C.face.materialIndex=0,i)i.push(C);else return C}return null}function D0(r,e,t,n){const i=r.a,s=r.b,o=r.c;let l=e,h=e+1,u=e+2;t&&(l=t.getX(l),h=t.getX(h),u=t.getX(u)),i.x=n.getX(l),i.y=n.getY(l),i.z=n.getZ(l),s.x=n.getX(h),s.y=n.getY(h),s.z=n.getZ(h),o.x=n.getX(u),o.y=n.getY(u),o.z=n.getZ(u)}function NP(r,e,t,n,i,s,o,l){const{geometry:h,_indirectBuffer:u}=r;for(let d=n,A=n+i;d<A;d++)Pc(h,e,t,d,s,o,l)}function PP(r,e,t,n,i,s,o){const{geometry:l,_indirectBuffer:h}=r;let u=1/0,d=null;for(let A=n,p=n+i;A<p;A++){let g;g=Pc(l,e,t,A,null,s,o),g&&g.distance<u&&(d=g,u=g.distance)}return d}function UP(r,e,t,n,i,s,o){const{geometry:l}=t,{index:h}=l,u=l.attributes.position;for(let d=r,A=e+r;d<A;d++){let p;if(p=d,D0(o,p*3,h,u),o.needsUpdate=!0,n(o,p,i,s))return!0}return!1}function kP(r,e=null){e&&Array.isArray(e)&&(e=new Set(e));const t=r.geometry,n=t.index?t.index.array:null,i=t.attributes.position;let s,o,l,h,u=0;const d=r._roots;for(let p=0,g=d.length;p<g;p++)s=d[p],o=new Uint32Array(s),l=new Uint16Array(s),h=new Float32Array(s),A(0,u),u+=s.byteLength;function A(p,g,m=!1){const E=p*2;if(R0(E,l)){const _=or(p,o),v=mr(E,l);let C=1/0,x=1/0,w=1/0,B=-1/0,T=-1/0,S=-1/0;for(let D=3*_,R=3*(_+v);D<R;D++){let M=n[D];const L=i.getX(M),P=i.getY(M),F=i.getZ(M);L<C&&(C=L),L>B&&(B=L),P<x&&(x=P),P>T&&(T=P),F<w&&(w=F),F>S&&(S=F)}return h[p+0]!==C||h[p+1]!==x||h[p+2]!==w||h[p+3]!==B||h[p+4]!==T||h[p+5]!==S?(h[p+0]=C,h[p+1]=x,h[p+2]=w,h[p+3]=B,h[p+4]=T,h[p+5]=S,!0):!1}else{const _=K0(p),v=Z0(p,o);let C=m,x=!1,w=!1;if(e){if(!C){const M=_/Q0+g/J0,L=v/Q0+g/J0;x=e.has(M),w=e.has(L),C=!x&&!w}}else x=!0,w=!0;const B=C||x,T=C||w;let S=!1;B&&(S=A(_,g,C));let D=!1;T&&(D=A(v,g,C));const R=S||D;if(R)for(let M=0;M<3;M++){const L=_+M,P=v+M,F=h[L],z=h[L+3],J=h[P],q=h[P+3];h[p+M]=F<J?F:J,h[p+M+3]=z>q?z:q}return R}}}function Qs(r,e,t,n,i){let s,o,l,h,u,d;const A=1/t.direction.x,p=1/t.direction.y,g=1/t.direction.z,m=t.origin.x,E=t.origin.y,_=t.origin.z;let v=e[r],C=e[r+3],x=e[r+1],w=e[r+3+1],B=e[r+2],T=e[r+3+2];return A>=0?(s=(v-m)*A,o=(C-m)*A):(s=(C-m)*A,o=(v-m)*A),p>=0?(l=(x-E)*p,h=(w-E)*p):(l=(w-E)*p,h=(x-E)*p),s>h||l>o||((l>s||isNaN(s))&&(s=l),(h<o||isNaN(o))&&(o=h),g>=0?(u=(B-_)*g,d=(T-_)*g):(u=(T-_)*g,d=(B-_)*g),s>d||u>o)?!1:((u>s||s!==s)&&(s=u),(d<o||o!==o)&&(o=d),s<=i&&o>=n)}function FP(r,e,t,n,i,s,o,l){const{geometry:h,_indirectBuffer:u}=r;for(let d=n,A=n+i;d<A;d++){let p=u?u[d]:d;Pc(h,e,t,p,s,o,l)}}function OP(r,e,t,n,i,s,o){const{geometry:l,_indirectBuffer:h}=r;let u=1/0,d=null;for(let A=n,p=n+i;A<p;A++){let g;g=Pc(l,e,t,h?h[A]:A,null,s,o),g&&g.distance<u&&(d=g,u=g.distance)}return d}function QP(r,e,t,n,i,s,o){const{geometry:l}=t,{index:h}=l,u=l.attributes.position;for(let d=r,A=e+r;d<A;d++){let p;if(p=t.resolveTriangleIndex(d),D0(o,p*3,h,u),o.needsUpdate=!0,n(o,p,i,s))return!0}return!1}function zP(r,e,t,n,i,s,o){e0.setBuffer(r._roots[e]),kh(0,r,t,n,i,s,o),e0.clearBuffer()}function kh(r,e,t,n,i,s,o){const{float32Array:l,uint16Array:h,uint32Array:u}=e0,d=r*2;if(R0(d,h)){const A=or(r,u),p=mr(d,h);NP(e,t,n,A,p,i,s,o)}else{const A=K0(r);Qs(A,l,n,s,o)&&kh(A,e,t,n,i,s,o);const p=Z0(r,u);Qs(p,l,n,s,o)&&kh(p,e,t,n,i,s,o)}}const GP=["x","y","z"];function HP(r,e,t,n,i,s){e0.setBuffer(r._roots[e]);const o=Fh(0,r,t,n,i,s);return e0.clearBuffer(),o}function Fh(r,e,t,n,i,s){const{float32Array:o,uint16Array:l,uint32Array:h}=e0;let u=r*2;if(R0(u,l)){const d=or(r,h),A=mr(u,l);return PP(e,t,n,d,A,i,s)}else{const d=Cc(r,h),A=GP[d],p=n.direction[A]>=0;let g,m;p?(g=K0(r),m=Z0(r,h)):(g=Z0(r,h),m=K0(r));const E=Qs(g,o,n,i,s)?Fh(g,e,t,n,i,s):null;if(E){const v=E.point[A];if(p?v<=o[m+d]:v>=o[m+d+3])return E}const _=Qs(m,o,n,i,s)?Fh(m,e,t,n,i,s):null;return E&&_?E.distance<=_.distance?E:_:E||_||null}}const Uc=new I0,y1=new Wn,E1=new Wn,h2=new lt,Zm=new Tr,kc=new Tr;function VP(r,e,t,n){e0.setBuffer(r._roots[e]);const i=Oh(0,r,t,n);return e0.clearBuffer(),i}function Oh(r,e,t,n,i=null){const{float32Array:s,uint16Array:o,uint32Array:l}=e0;let h=r*2;if(i===null&&(t.boundingBox||t.computeBoundingBox(),Zm.set(t.boundingBox.min,t.boundingBox.max,n),i=Zm),R0(h,o)){const u=e.geometry,d=u.index,A=u.attributes.position,p=t.index,g=t.attributes.position,m=or(r,l),E=mr(h,o);if(h2.copy(n).invert(),t.boundsTree)return g0(r,s,kc),kc.matrix.copy(h2),kc.needsUpdate=!0,t.boundsTree.shapecast({intersectsBounds:_=>kc.intersectsBox(_),intersectsTriangle:_=>{_.a.applyMatrix4(n),_.b.applyMatrix4(n),_.c.applyMatrix4(n),_.needsUpdate=!0;for(let v=m*3,C=(E+m)*3;v<C;v+=3)if(D0(E1,v,d,A),E1.needsUpdate=!0,_.intersectsTriangle(E1))return!0;return!1}});{const _=bc(t);for(let v=m*3,C=(E+m)*3;v<C;v+=3){D0(y1,v,d,A),y1.a.applyMatrix4(h2),y1.b.applyMatrix4(h2),y1.c.applyMatrix4(h2),y1.needsUpdate=!0;for(let x=0,w=_*3;x<w;x+=3)if(D0(E1,x,p,g),E1.needsUpdate=!0,y1.intersectsTriangle(E1))return!0}}}else{const u=K0(r),d=Z0(r,l);return g0(u,s,Uc),!!(i.intersectsBox(Uc)&&Oh(u,e,t,n,i)||(g0(d,s,Uc),i.intersectsBox(Uc)&&Oh(d,e,t,n,i)))}}const Fc=new lt,Qh=new Tr,d2=new Tr,jP=new V,WP=new V,YP=new V,qP=new V;function XP(r,e,t,n={},i={},s=0,o=1/0){e.boundingBox||e.computeBoundingBox(),Qh.set(e.boundingBox.min,e.boundingBox.max,t),Qh.needsUpdate=!0;const l=r.geometry,h=l.attributes.position,u=l.index,d=e.attributes.position,A=e.index,p=Sn.getPrimitive(),g=Sn.getPrimitive();let m=jP,E=WP,_=null,v=null;i&&(_=YP,v=qP);let C=1/0,x=null,w=null;return Fc.copy(t).invert(),d2.matrix.copy(Fc),r.shapecast({boundsTraverseOrder:B=>Qh.distanceToBox(B),intersectsBounds:(B,T,S)=>S<C&&S<o?(T&&(d2.min.copy(B.min),d2.max.copy(B.max),d2.needsUpdate=!0),!0):!1,intersectsRange:(B,T)=>{if(e.boundsTree)return e.boundsTree.shapecast({boundsTraverseOrder:S=>d2.distanceToBox(S),intersectsBounds:(S,D,R)=>R<C&&R<o,intersectsRange:(S,D)=>{for(let R=S,M=S+D;R<M;R++){D0(g,3*R,A,d),g.a.applyMatrix4(t),g.b.applyMatrix4(t),g.c.applyMatrix4(t),g.needsUpdate=!0;for(let L=B,P=B+T;L<P;L++){D0(p,3*L,u,h),p.needsUpdate=!0;const F=p.distanceToTriangle(g,m,_);if(F<C&&(E.copy(m),v&&v.copy(_),C=F,x=L,w=R),F<s)return!0}}}});{const S=bc(e);for(let D=0,R=S;D<R;D++){D0(g,3*D,A,d),g.a.applyMatrix4(t),g.b.applyMatrix4(t),g.c.applyMatrix4(t),g.needsUpdate=!0;for(let M=B,L=B+T;M<L;M++){D0(p,3*M,u,h),p.needsUpdate=!0;const P=p.distanceToTriangle(g,m,_);if(P<C&&(E.copy(m),v&&v.copy(_),C=P,x=M,w=D),P<s)return!0}}}}}),Sn.releasePrimitive(p),Sn.releasePrimitive(g),C===1/0?null:(n.point?n.point.copy(E):n.point=E.clone(),n.distance=C,n.faceIndex=x,i&&(i.point?i.point.copy(v):i.point=v.clone(),i.point.applyMatrix4(Fc),E.applyMatrix4(Fc),i.distance=E.sub(i.point).length(),i.faceIndex=w),n)}function JP(r,e=null){e&&Array.isArray(e)&&(e=new Set(e));const t=r.geometry,n=t.index?t.index.array:null,i=t.attributes.position;let s,o,l,h,u=0;const d=r._roots;for(let p=0,g=d.length;p<g;p++)s=d[p],o=new Uint32Array(s),l=new Uint16Array(s),h=new Float32Array(s),A(0,u),u+=s.byteLength;function A(p,g,m=!1){const E=p*2;if(R0(E,l)){const _=or(p,o),v=mr(E,l);let C=1/0,x=1/0,w=1/0,B=-1/0,T=-1/0,S=-1/0;for(let D=_,R=_+v;D<R;D++){const M=3*r.resolveTriangleIndex(D);for(let L=0;L<3;L++){let P=M+L;P=n?n[P]:P;const F=i.getX(P),z=i.getY(P),J=i.getZ(P);F<C&&(C=F),F>B&&(B=F),z<x&&(x=z),z>T&&(T=z),J<w&&(w=J),J>S&&(S=J)}}return h[p+0]!==C||h[p+1]!==x||h[p+2]!==w||h[p+3]!==B||h[p+4]!==T||h[p+5]!==S?(h[p+0]=C,h[p+1]=x,h[p+2]=w,h[p+3]=B,h[p+4]=T,h[p+5]=S,!0):!1}else{const _=K0(p),v=Z0(p,o);let C=m,x=!1,w=!1;if(e){if(!C){const M=_/Q0+g/J0,L=v/Q0+g/J0;x=e.has(M),w=e.has(L),C=!x&&!w}}else x=!0,w=!0;const B=C||x,T=C||w;let S=!1;B&&(S=A(_,g,C));let D=!1;T&&(D=A(v,g,C));const R=S||D;if(R)for(let M=0;M<3;M++){const L=_+M,P=v+M,F=h[L],z=h[L+3],J=h[P],q=h[P+3];h[p+M]=F<J?F:J,h[p+M+3]=z>q?z:q}return R}}}function KP(r,e,t,n,i,s,o){e0.setBuffer(r._roots[e]),zh(0,r,t,n,i,s,o),e0.clearBuffer()}function zh(r,e,t,n,i,s,o){const{float32Array:l,uint16Array:h,uint32Array:u}=e0,d=r*2;if(R0(d,h)){const A=or(r,u),p=mr(d,h);FP(e,t,n,A,p,i,s,o)}else{const A=K0(r);Qs(A,l,n,s,o)&&zh(A,e,t,n,i,s,o);const p=Z0(r,u);Qs(p,l,n,s,o)&&zh(p,e,t,n,i,s,o)}}const ZP=["x","y","z"];function $P(r,e,t,n,i,s){e0.setBuffer(r._roots[e]);const o=Gh(0,r,t,n,i,s);return e0.clearBuffer(),o}function Gh(r,e,t,n,i,s){const{float32Array:o,uint16Array:l,uint32Array:h}=e0;let u=r*2;if(R0(u,l)){const d=or(r,h),A=mr(u,l);return OP(e,t,n,d,A,i,s)}else{const d=Cc(r,h),A=ZP[d],p=n.direction[A]>=0;let g,m;p?(g=K0(r),m=Z0(r,h)):(g=Z0(r,h),m=K0(r));const E=Qs(g,o,n,i,s)?Gh(g,e,t,n,i,s):null;if(E){const v=E.point[A];if(p?v<=o[m+d]:v>=o[m+d+3])return E}const _=Qs(m,o,n,i,s)?Gh(m,e,t,n,i,s):null;return E&&_?E.distance<=_.distance?E:_:E||_||null}}const Oc=new I0,x1=new Wn,w1=new Wn,f2=new lt,$m=new Tr,Qc=new Tr;function eU(r,e,t,n){e0.setBuffer(r._roots[e]);const i=Hh(0,r,t,n);return e0.clearBuffer(),i}function Hh(r,e,t,n,i=null){const{float32Array:s,uint16Array:o,uint32Array:l}=e0;let h=r*2;if(i===null&&(t.boundingBox||t.computeBoundingBox(),$m.set(t.boundingBox.min,t.boundingBox.max,n),i=$m),R0(h,o)){const u=e.geometry,d=u.index,A=u.attributes.position,p=t.index,g=t.attributes.position,m=or(r,l),E=mr(h,o);if(f2.copy(n).invert(),t.boundsTree)return g0(r,s,Qc),Qc.matrix.copy(f2),Qc.needsUpdate=!0,t.boundsTree.shapecast({intersectsBounds:_=>Qc.intersectsBox(_),intersectsTriangle:_=>{_.a.applyMatrix4(n),_.b.applyMatrix4(n),_.c.applyMatrix4(n),_.needsUpdate=!0;for(let v=m,C=E+m;v<C;v++)if(D0(w1,3*e.resolveTriangleIndex(v),d,A),w1.needsUpdate=!0,_.intersectsTriangle(w1))return!0;return!1}});{const _=bc(t);for(let v=m,C=E+m;v<C;v++){const x=e.resolveTriangleIndex(v);D0(x1,3*x,d,A),x1.a.applyMatrix4(f2),x1.b.applyMatrix4(f2),x1.c.applyMatrix4(f2),x1.needsUpdate=!0;for(let w=0,B=_*3;w<B;w+=3)if(D0(w1,w,p,g),w1.needsUpdate=!0,x1.intersectsTriangle(w1))return!0}}}else{const u=K0(r),d=Z0(r,l);return g0(u,s,Oc),!!(i.intersectsBox(Oc)&&Hh(u,e,t,n,i)||(g0(d,s,Oc),i.intersectsBox(Oc)&&Hh(d,e,t,n,i)))}}const zc=new lt,Vh=new Tr,p2=new Tr,tU=new V,rU=new V,nU=new V,iU=new V;function sU(r,e,t,n={},i={},s=0,o=1/0){e.boundingBox||e.computeBoundingBox(),Vh.set(e.boundingBox.min,e.boundingBox.max,t),Vh.needsUpdate=!0;const l=r.geometry,h=l.attributes.position,u=l.index,d=e.attributes.position,A=e.index,p=Sn.getPrimitive(),g=Sn.getPrimitive();let m=tU,E=rU,_=null,v=null;i&&(_=nU,v=iU);let C=1/0,x=null,w=null;return zc.copy(t).invert(),p2.matrix.copy(zc),r.shapecast({boundsTraverseOrder:B=>Vh.distanceToBox(B),intersectsBounds:(B,T,S)=>S<C&&S<o?(T&&(p2.min.copy(B.min),p2.max.copy(B.max),p2.needsUpdate=!0),!0):!1,intersectsRange:(B,T)=>{if(e.boundsTree){const S=e.boundsTree;return S.shapecast({boundsTraverseOrder:D=>p2.distanceToBox(D),intersectsBounds:(D,R,M)=>M<C&&M<o,intersectsRange:(D,R)=>{for(let M=D,L=D+R;M<L;M++){const P=S.resolveTriangleIndex(M);D0(g,3*P,A,d),g.a.applyMatrix4(t),g.b.applyMatrix4(t),g.c.applyMatrix4(t),g.needsUpdate=!0;for(let F=B,z=B+T;F<z;F++){const J=r.resolveTriangleIndex(F);D0(p,3*J,u,h),p.needsUpdate=!0;const q=p.distanceToTriangle(g,m,_);if(q<C&&(E.copy(m),v&&v.copy(_),C=q,x=F,w=M),q<s)return!0}}}})}else{const S=bc(e);for(let D=0,R=S;D<R;D++){D0(g,3*D,A,d),g.a.applyMatrix4(t),g.b.applyMatrix4(t),g.c.applyMatrix4(t),g.needsUpdate=!0;for(let M=B,L=B+T;M<L;M++){const P=r.resolveTriangleIndex(M);D0(p,3*P,u,h),p.needsUpdate=!0;const F=p.distanceToTriangle(g,m,_);if(F<C&&(E.copy(m),v&&v.copy(_),C=F,x=M,w=D),F<s)return!0}}}}}),Sn.releasePrimitive(p),Sn.releasePrimitive(g),C===1/0?null:(n.point?n.point.copy(E):n.point=E.clone(),n.distance=C,n.faceIndex=x,i&&(i.point?i.point.copy(v):i.point=v.clone(),i.point.applyMatrix4(zc),E.applyMatrix4(zc),i.distance=E.sub(i.point).length(),i.faceIndex=w),n)}function ev(r,e,t){return r===null?null:(r.point.applyMatrix4(e.matrixWorld),r.distance=r.point.distanceTo(t.ray.origin),r.object=e,r)}const Gc=new Tr,Hc=new Aa,tv=new V,rv=new lt,nv=new V,jh=["getX","getY","getZ"];class Vc extends MP{static serialize(e,t={}){t={cloneBuffers:!0,...t};const n=e.geometry,i=e._roots,s=e._indirectBuffer,o=n.getIndex(),l={version:1,roots:null,index:null,indirectBuffer:null};return t.cloneBuffers?(l.roots=i.map(h=>h.slice()),l.index=o?o.array.slice():null,l.indirectBuffer=s?s.slice():null):(l.roots=i,l.index=o?o.array:null,l.indirectBuffer=s),l}static deserialize(e,t,n={}){n={setIndex:!0,indirect:!!e.indirectBuffer,...n};const{index:i,roots:s,indirectBuffer:o}=e;e.version||(console.warn("MeshBVH.deserialize: Serialization format has been changed and will be fixed up. It is recommended to regenerate any stored serialized data."),h(s));const l=new Vc(t,{...n,[Ch]:!0});if(l._roots=s,l._indirectBuffer=o||null,n.setIndex){const u=t.getIndex();if(u===null){const d=new S0(e.index,1,!1);t.setIndex(d)}else u.array!==i&&(u.array.set(i),u.needsUpdate=!0)}return l;function h(u){for(let d=0;d<u.length;d++){const A=u[d],p=new Uint32Array(A),g=new Uint16Array(A);for(let m=0,E=A.byteLength/J0;m<E;m++){const _=Q0*m,v=2*_;R0(v,g)||(p[_+6]=p[_+6]/Q0-m)}}}}get primitiveStride(){return 3}get resolveTriangleIndex(){return this.resolvePrimitiveIndex}constructor(e,t={}){t.maxLeafTris&&(console.warn('MeshBVH: "maxLeafTris" option has been deprecated. Use maxLeafSize, instead.'),t={...t,maxLeafSize:t.maxLeafTris}),super(e,t)}shiftTriangleOffsets(e){return super.shiftPrimitiveOffsets(e)}writePrimitiveBounds(e,t,n){const i=this.geometry,s=this._indirectBuffer,o=i.attributes.position,l=i.index?i.index.array:null,h=(s?s[e]:e)*3;let u=h+0,d=h+1,A=h+2;l&&(u=l[u],d=l[d],A=l[A]);for(let p=0;p<3;p++){const g=o[jh[p]](u),m=o[jh[p]](d),E=o[jh[p]](A);let _=g;m<_&&(_=m),E<_&&(_=E);let v=g;m>v&&(v=m),E>v&&(v=E),t[n+p]=_,t[n+p+3]=v}return t}computePrimitiveBounds(e,t,n){const i=this.geometry,s=this._indirectBuffer,o=i.attributes.position,l=i.index?i.index.array:null,h=o.normalized;if(e<0||t+e-n.offset>n.length/6)throw new Error("MeshBVH: compute triangle bounds range is invalid.");const u=o.array,d=o.offset||0;let A=3;o.isInterleavedBufferAttribute&&(A=o.data.stride);const p=["getX","getY","getZ"],g=n.offset;for(let m=e,E=e+t;m<E;m++){const _=(s?s[m]:m)*3,v=(m-g)*6;let C=_+0,x=_+1,w=_+2;l&&(C=l[C],x=l[x],w=l[w]),h||(C=C*A+d,x=x*A+d,w=w*A+d);for(let B=0;B<3;B++){let T,S,D;h?(T=o[p[B]](C),S=o[p[B]](x),D=o[p[B]](w)):(T=u[C+B],S=u[x+B],D=u[w+B]);let R=T;S<R&&(R=S),D<R&&(R=D);let M=T;S>M&&(M=S),D>M&&(M=D);const L=(M-R)/2,P=B*2;n[v+P+0]=R+L,n[v+P+1]=L+(Math.abs(R)+L)*xc}}return n}raycastObject3D(e,t,n=[]){const{material:i}=e;if(i===void 0)return;rv.copy(e.matrixWorld).invert(),Hc.copy(t.ray).applyMatrix4(rv),nv.setFromMatrixScale(e.matrixWorld),tv.copy(Hc.direction).multiply(nv);const s=tv.length(),o=t.near/s,l=t.far/s;if(t.firstHitOnly===!0){let h=this.raycastFirst(Hc,i,o,l);h=ev(h,e,t),h&&n.push(h)}else{const h=this.raycast(Hc,i,o,l);for(let u=0,d=h.length;u<d;u++){const A=ev(h[u],e,t);A&&n.push(A)}}return n}refit(e=null){return(this.indirect?JP:kP)(this,e)}raycast(e,t=Un,n=0,i=1/0){const s=this._roots,o=[],l=this.indirect?KP:zP;for(let h=0,u=s.length;h<u;h++)l(this,h,t,e,o,n,i);return o}raycastFirst(e,t=Un,n=0,i=1/0){const s=this._roots;let o=null;const l=this.indirect?$P:HP;for(let h=0,u=s.length;h<u;h++){const d=l(this,h,t,e,n,i);d!=null&&(o==null||d.distance<o.distance)&&(o=d)}return o}intersectsGeometry(e,t){let n=!1;const i=this._roots,s=this.indirect?eU:VP;for(let o=0,l=i.length;o<l&&(n=s(this,o,e,t),!n);o++);return n}shapecast(e){const t=Sn.getPrimitive(),n=super.shapecast({...e,intersectsPrimitive:e.intersectsTriangle,scratchPrimitive:t,iterate:this.indirect?QP:UP});return Sn.releasePrimitive(t),n}bvhcast(e,t,n){let{intersectsRanges:i,intersectsTriangles:s}=n;const o=Sn.getPrimitive(),l=this.geometry.index,h=this.geometry.attributes.position,u=this.indirect?m=>{const E=this.resolveTriangleIndex(m);D0(o,E*3,l,h)}:m=>{D0(o,m*3,l,h)},d=Sn.getPrimitive(),A=e.geometry.index,p=e.geometry.attributes.position,g=e.indirect?m=>{const E=e.resolveTriangleIndex(m);D0(d,E*3,A,p)}:m=>{D0(d,m*3,A,p)};if(s){if(!(e instanceof Vc))throw new Error('MeshBVH: "intersectsTriangles" callback can only be used with another MeshBVH.');const m=(E,_,v,C,x,w,B,T)=>{for(let S=v,D=v+C;S<D;S++){g(S),d.a.applyMatrix4(t),d.b.applyMatrix4(t),d.c.applyMatrix4(t),d.needsUpdate=!0;for(let R=E,M=E+_;R<M;R++)if(u(R),o.needsUpdate=!0,s(o,d,R,S,x,w,B,T))return!0}return!1};if(i){const E=i;i=function(_,v,C,x,w,B,T,S){return E(_,v,C,x,w,B,T,S)?!0:m(_,v,C,x,w,B,T,S)}}else i=m}return super.bvhcast(e,t,{intersectsRanges:i})}intersectsBox(e,t){return Gc.set(e.min,e.max,t),Gc.needsUpdate=!0,this.shapecast({intersectsBounds:n=>Gc.intersectsBox(n),intersectsTriangle:n=>Gc.intersectsTriangle(n)})}intersectsSphere(e){return this.shapecast({intersectsBounds:t=>e.intersectsBox(t),intersectsTriangle:t=>t.intersectsSphere(e)})}closestPointToGeometry(e,t,n={},i={},s=0,o=1/0){return(this.indirect?sU:XP)(this,e,t,n,i,s,o)}closestPointToPoint(e,t={},n=0,i=1/0){return RP(this,e,t,n,i)}}function aU(r){switch(r){case 1:return"R";case 2:return"RG";case 3:return"RGBA";case 4:return"RGBA"}throw new Error}function oU(r){switch(r){case 1:return Ii;case 2:return hs;case 3:return Kt;case 4:return Kt}}function iv(r){switch(r){case 1:return r9;case 2:return $1;case 3:return mo;case 4:return mo}}class sv extends Hn{constructor(){super(),this.minFilter=$t,this.magFilter=$t,this.generateMipmaps=!1,this.overrideItemSize=null,this._forcedType=null}updateFrom(e){const t=this.overrideItemSize,n=e.itemSize,i=e.count;if(t!==null){if(n*i%t!==0)throw new Error("VertexAttributeTexture: overrideItemSize must divide evenly into buffer length.");e.itemSize=t,e.count=i*n/t}const s=e.itemSize,o=e.count,l=e.normalized,h=e.array.constructor,u=h.BYTES_PER_ELEMENT;let d=this._forcedType,A=s;if(d===null)switch(h){case Float32Array:d=Jt;break;case Uint8Array:case Uint16Array:case Uint32Array:d=An;break;case Int8Array:case Int16Array:case Int32Array:d=fo;break}let p,g,m,E,_=aU(s);switch(d){case Jt:m=1,g=oU(s),l&&u===1?(E=h,_+="8",h===Uint8Array?p=w0:(p=t9,_+="_SNORM")):(E=Float32Array,_+="32F",p=Jt);break;case fo:_+=u*8+"I",m=l?Math.pow(2,h.BYTES_PER_ELEMENT*8-1):1,g=iv(s),u===1?(E=Int8Array,p=t9):u===2?(E=Int16Array,p=_3):(E=Int32Array,p=fo);break;case An:_+=u*8+"UI",m=l?Math.pow(2,h.BYTES_PER_ELEMENT*8-1):1,g=iv(s),u===1?(E=Uint8Array,p=w0):u===2?(E=Uint16Array,p=ho):(E=Uint32Array,p=An);break}A===3&&(g===Kt||g===mo)&&(A=4);const v=Math.ceil(Math.sqrt(o))||1,C=A*v*v,x=new E(C),w=e.normalized;e.normalized=!1;for(let B=0;B<o;B++){const T=A*B;x[T]=e.getX(B)/m,s>=2&&(x[T+1]=e.getY(B)/m),s>=3&&(x[T+2]=e.getZ(B)/m,A===4&&(x[T+3]=1)),s>=4&&(x[T+3]=e.getW(B)/m)}e.normalized=w,this.internalFormat=_,this.format=g,this.type=p,this.image.width=v,this.image.height=v,this.image.data=x,this.needsUpdate=!0,this.dispose(),e.itemSize=n,e.count=i}}class lU extends sv{constructor(){super(),this._forcedType=An}}class cU extends sv{constructor(){super(),this._forcedType=Jt}}class uU{constructor(){this.index=new lU,this.position=new cU,this.bvhBounds=new Hn,this.bvhContents=new Hn,this._cachedIndexAttr=null,this.index.overrideItemSize=3}updateFrom(e){const{geometry:t}=e;if(dU(e,this.bvhBounds,this.bvhContents),this.position.updateFrom(t.attributes.position),e.indirect){const n=e._indirectBuffer;if(this._cachedIndexAttr===null||this._cachedIndexAttr.count!==n.length)if(t.index)this._cachedIndexAttr=t.index.clone();else{const i=Vm(Bc(t));this._cachedIndexAttr=new S0(i,1,!1)}hU(t,n,this._cachedIndexAttr),this.index.updateFrom(this._cachedIndexAttr)}else this.index.updateFrom(t.index)}dispose(){const{index:e,position:t,bvhBounds:n,bvhContents:i}=this;e&&e.dispose(),t&&t.dispose(),n&&n.dispose(),i&&i.dispose()}}function hU(r,e,t){const n=t.array,i=r.index?r.index.array:null;for(let s=0,o=e.length;s<o;s++){const l=3*s,h=3*e[s];for(let u=0;u<3;u++)n[l+u]=i?i[h+u]:h+u}}function dU(r,e,t){const n=r._roots;if(n.length!==1)throw new Error("MeshBVHUniformStruct: Multi-root BVHs not supported.");const i=n[0],s=new Uint16Array(i),o=new Uint32Array(i),l=new Float32Array(i),h=i.byteLength/J0,u=2*Math.ceil(Math.sqrt(h/2)),d=new Float32Array(4*u*u),A=Math.ceil(Math.sqrt(h)),p=new Uint32Array(2*A*A);for(let g=0;g<h;g++){const m=g*J0/4,E=m*2,_=m;for(let v=0;v<3;v++)d[8*g+0+v]=l[_+0+v],d[8*g+4+v]=l[_+3+v];if(R0(E,s)){const v=mr(E,s),C=or(m,o),x=lP|v;p[g*2+0]=x,p[g*2+1]=C}else{const v=o[m+6],C=Cc(m,o);p[g*2+0]=C,p[g*2+1]=v}}e.image.data=d,e.image.width=u,e.image.height=u,e.format=Kt,e.type=Jt,e.internalFormat="RGBA32F",e.minFilter=$t,e.magFilter=$t,e.generateMipmaps=!1,e.needsUpdate=!0,e.dispose(),t.image.data=p,t.image.width=A,t.image.height=A,t.format=$1,t.type=An,t.internalFormat="RG32UI",t.minFilter=$t,t.magFilter=$t,t.generateMipmaps=!1,t.needsUpdate=!0,t.dispose()}const fU=`
4086
4086
 
4087
4087
  // A stack of uint32 indices can can store the indices for
4088
4088
  // a perfectly balanced tree with a depth up to 31. Lower stack
@@ -4696,9 +4696,9 @@ struct BVH {
4696
4696
  }`};class MU{constructor(e,t){me(this,"scene"),me(this,"renderer"),me(this,"shadowGroup"),me(this,"shadowCamera"),me(this,"renderTarget"),me(this,"renderTargetBlur"),me(this,"depthMaterial"),me(this,"horizontalBlurMaterial"),me(this,"verticalBlurMaterial"),me(this,"debugGroup"),me(this,"gridHelper"),me(this,"planeWireframe"),me(this,"debugEnabled",!0),me(this,"PLANE_WIDTH",2.5),me(this,"PLANE_HEIGHT",2.5),me(this,"CAMERA_HEIGHT",.4),this.scene=e,this.renderer=t,this.initialiseComponents()}initialiseComponents(){this.setupShadowGroup(),this.setupRenderTargets(),this.createShadowPlanes(),this.setupShadowCamera(),this.setupMaterials(),this.updateShadowCamera()}setupShadowGroup(){var e;this.shadowGroup=new vs,this.shadowGroup.position.y=-.315,(e=this.scene)==null||e.add(this.shadowGroup)}setupRenderTargets(){this.renderTarget=new Nr(256,256),this.renderTarget.texture.generateMipmaps=!1,this.renderTargetBlur=new Nr(256,256),this.renderTargetBlur.texture.generateMipmaps=!1}createShadowPlanes(){var e,t,n;const i=new _l(this.PLANE_WIDTH,this.PLANE_HEIGHT).rotateX(Math.PI/2),s=new si({map:(e=this.renderTarget)==null?void 0:e.texture,opacity:Y9.shadow.opacity,transparent:!0,depthWrite:!1}),o=new T0(i,s);o.renderOrder=1,o.scale.y=-1,o.name="shadowPlane",(t=this.shadowGroup)==null||t.add(o);const l=new T0(i);l.visible=!1,l.name="blurPlane",(n=this.shadowGroup)==null||n.add(l)}setupShadowCamera(){var e;this.shadowCamera=new wl(-this.PLANE_WIDTH/2,this.PLANE_WIDTH/2,this.PLANE_HEIGHT/2,-this.PLANE_HEIGHT/2,0,this.CAMERA_HEIGHT),this.shadowCamera.rotation.x=Math.PI/2,this.shadowCamera.name="shadowCamera",(e=this.shadowGroup)==null||e.add(this.shadowCamera)}setupMaterials(){this.setupDepthMaterial(),this.setupBlurMaterials()}setupDepthMaterial(){this.depthMaterial=new s7;const e={value:Y9.shadow.darkness};this.depthMaterial.userData.darkness=e,this.depthMaterial.onBeforeCompile=t=>{t.uniforms.darkness=e,t.fragmentShader=`
4697
4697
  uniform float darkness;
4698
4698
  ${t.fragmentShader.replace("gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );","gl_FragColor = vec4( vec3( 0.0 ), ( 1.0 - fragCoordZ ) * darkness );")}
4699
- `},this.depthMaterial.depthTest=!1,this.depthMaterial.depthWrite=!1}setupBlurMaterials(){this.horizontalBlurMaterial=new B0(CU),this.verticalBlurMaterial=new B0(IU),this.horizontalBlurMaterial.depthTest=!1,this.verticalBlurMaterial.depthTest=!1}updateShadowCamera(){this.shadowCamera&&(this.shadowCamera.far=.125,this.shadowCamera.updateProjectionMatrix())}blurShadow(e){var t,n,i,s,o,l,h;const u=(t=this.shadowGroup)==null?void 0:t.getObjectByName("blurPlane");u.visible=!0,u.material=this.horizontalBlurMaterial,u.material.uniforms.tDiffuse.value=(n=this.renderTarget)==null?void 0:n.texture,this.horizontalBlurMaterial&&(this.horizontalBlurMaterial.uniforms.h.value=e*1/256),(i=this.renderer)==null||i.setRenderTarget(this.renderTargetBlur),(s=this.renderer)==null||s.render(u,this.shadowCamera),u.material=this.verticalBlurMaterial,u.material.uniforms.tDiffuse.value=(o=this.renderTargetBlur)==null?void 0:o.texture,this.verticalBlurMaterial&&(this.verticalBlurMaterial.uniforms.v.value=e*1/256),(l=this.renderer)==null||l.setRenderTarget(this.renderTarget),(h=this.renderer)==null||h.render(u,this.shadowCamera),u.visible=!1}render(){if(!this.scene||!this.renderer)return;const e=this.scene.background;if(this.scene.background=null,this.scene.overrideMaterial=this.depthMaterial,!this.renderer||!this.shadowCamera)return;const t=this.renderer.getClearAlpha();this.renderer.setClearAlpha(0),this.renderer.clear(),this.renderer.setRenderTarget(this.renderTarget),this.renderer.render(this.scene,this.shadowCamera),this.scene.overrideMaterial=null,this.blurShadow(Y9.shadow.blur),this.blurShadow(Y9.shadow.blur*.4),this.renderer.setRenderTarget(null),this.renderer.setClearAlpha(t),this.scene.background=e}dispose(){var e,t,n,i,s,o;(e=this.renderTarget)==null||e.dispose(),(t=this.renderTargetBlur)==null||t.dispose(),(n=this.depthMaterial)==null||n.dispose(),(i=this.horizontalBlurMaterial)==null||i.dispose(),(s=this.verticalBlurMaterial)==null||s.dispose(),this.debugGroup&&((o=this.scene)==null||o.remove(this.debugGroup))}}class SU extends jo{constructor(e,t,n=null,i=null,s=null){super(),this.scene=e,this.camera=t,this.overrideMaterial=n,this.clearColor=i,this.clearAlpha=s,this.clear=!0,this.clearDepth=!1,this.needsSwap=!1,this._oldClearColor=new We}render(e,t,n){const i=e.autoClear;e.autoClear=!1;let s,o;this.overrideMaterial!==null&&(o=this.scene.overrideMaterial,this.scene.overrideMaterial=this.overrideMaterial),this.clearColor!==null&&(e.getClearColor(this._oldClearColor),e.setClearColor(this.clearColor,e.getClearAlpha())),this.clearAlpha!==null&&(s=e.getClearAlpha(),e.setClearAlpha(this.clearAlpha)),this.clearDepth==!0&&e.clearDepth(),e.setRenderTarget(this.renderToScreen?null:n),this.clear===!0&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),e.render(this.scene,this.camera),this.clearColor!==null&&e.setClearColor(this._oldClearColor),this.clearAlpha!==null&&e.setClearAlpha(s),this.overrideMaterial!==null&&(this.scene.overrideMaterial=o),e.autoClear=i}}class TU{constructor(){me(this,"rendererCore"),me(this,"sceneManager"),me(this,"bloomEffect"),me(this,"shadowEffect"),me(this,"pointerEvents"),me(this,"isInitialised",!1),me(this,"isInovati",!1),me(this,"viewerOnly",!1),me(this,"handleResize",()=>{var e;this.isInitialised&&(this.rendererCore.resizeRenderer(),(e=this.sceneManager)==null||e.handleResize())}),this.rendererCore=new VT}async initialise(e,t,n,i){if(this.isInitialised)return;this.isInovati=n??!1,this.viewerOnly=i??!1;const s=this.rendererCore.initialiseRenderer(e);this.sceneManager=new yU(this.rendererCore.getRenderer(),s,this.isInovati),await this.sceneManager.initialiseScene(t).then(([o,l])=>{o&&l&&(this.initEffects(o,l),this.pointerEvents=new EU(l,o,s),this.setupEventHandlers(),this.isInitialised=!0)}),this.sceneManager.handleResize()}initEffects(e,t){const n=new SU(e,t);if(this.isInovati){this.bloomEffect=new wU(this.rendererCore.getRenderer(),n,e);const i=this.bloomEffect.getBloomMixPass();this.rendererCore.SetupComposerWithBloom(n,i)}else this.rendererCore.setupMSAA(n);this.shadowEffect=new MU(e,this.rendererCore.getRenderer())}async startRendering(){this.startRenderLoop()}setupEventHandlers(){window.addEventListener("resize",this.handleResize),!(!this.pointerEvents||this.viewerOnly)&&this.pointerEvents.initialiseEventListeners()}startRenderLoop(){const e=()=>{this.sceneManager&&(this.sceneManager.updateControls(),this.rendererCore.resizeRenderer()&&this.sceneManager.handleResize()),this.shadowEffect&&this.shadowEffect.render(),this.isInovati&&this.bloomEffect&&this.bloomEffect.render(),this.rendererCore.render(),requestAnimationFrame(e)};e()}loadFirstFrame(e,t,n){var i;return((i=this.sceneManager)==null?void 0:i.loadFirstFrame(e,t,n))??Promise.reject(new Error("Scene manager not initialised"))}loadLocalFrame(e){var t;return((t=this.sceneManager)==null?void 0:t.loadLocalFrame(e))??Promise.reject(new Error("Scene manager not initialised"))}changeFrame(e,t,n){var i;return((i=this.sceneManager)==null?void 0:i.changeFrame(e,t,n))??Promise.reject(new Error("Scene manager not initialised"))}changeLens(e,t,n,i){var s;return((s=this.sceneManager)==null?void 0:s.changeLens(e,t,n,i))??Promise.reject(new Error("Scene manager not initialised"))}changeLensShape(e){var t;return((t=this.sceneManager)==null?void 0:t.changeLensShape(e))??Promise.reject(new Error("Scene manager not initialised"))}changeOrbital(e){var t;return((t=this.sceneManager)==null?void 0:t.changeOrbital(e))??Promise.reject(new Error("Scene manager not initialised"))}async changeGemType(e,t,n){var i;await((i=this.sceneManager)==null?void 0:i.changeGemType(e,t,n).then(s=>{this.bloomEffect&&s&&this.bloomEffect.updateComposers(this.rendererCore.getFinalComposer())}))}changeStudType(e,t){var n;return((n=this.sceneManager)==null?void 0:n.changeStudType(e,t))??Promise.reject(new Error("Scene manager not initialised"))}async flashFocusOnZone(e,t,n){var i;await((i=this.sceneManager)==null?void 0:i.flashFocusOnZone(e,t,n).then(s=>{this.bloomEffect&&s&&this.bloomEffect.updateComposers(this.rendererCore.getFinalComposer())}))}snapCameraToPosition(e){var t;return((t=this.sceneManager)==null?void 0:t.snapCameraToPosition(e))??Promise.reject(new Error("Scene manager not initialised"))}cleanUp(){var e,t,n,i;window.removeEventListener("resize",this.handleResize),(e=this.pointerEvents)==null||e.dispose(),this.rendererCore.dispose(),(t=this.sceneManager)==null||t.dispose(),(n=this.bloomEffect)==null||n.dispose(),(i=this.shadowEffect)==null||i.dispose()}}class BU{constructor(){me(this,"customRenderer"),this.customRenderer=new TU}async Init(e,t,n,i){this.customRenderer.isInitialised||await this.customRenderer.initialise(e,t,n,i).then(()=>{this.customRenderer.startRendering()})}loadFirstFrame(e,t,n){try{return this.customRenderer.loadFirstFrame(e,t,n)}catch(i){return console.error(i),Promise.reject(i)}}loadLocalFrame(e){try{return this.customRenderer.loadLocalFrame(e)}catch(t){return console.error(t),Promise.reject(t)}}changeFrame(e,t,n){try{return this.customRenderer.changeFrame(e,t,n)}catch(i){return console.error(i),Promise.reject(i)}}changeLens(e,t,n,i){try{return this.customRenderer.changeLens(e,t,n,i)}catch(s){return console.error(s),Promise.reject(s)}}changeLensShape(e){try{return this.customRenderer.changeLensShape(e)}catch(t){return console.error(t),Promise.reject(t)}}changeOrbital(e){try{return this.customRenderer.changeOrbital(e)}catch(t){return console.error(t),Promise.reject(t)}}changeGemType(e,t,n){try{return this.customRenderer.changeGemType(e,t,n)}catch(i){return console.error(i),Promise.reject(i)}}changeStudType(e,t){try{return this.customRenderer.changeStudType(e,t)}catch(n){return console.error(n),Promise.reject(n)}}flashFocusOnZone(e,t,n){try{return this.customRenderer.flashFocusOnZone(e,t,n)}catch(i){return console.error(i),Promise.reject(i)}}snapCamToPos(e){try{return this.customRenderer.snapCameraToPosition(e)}catch(t){return console.error(t),Promise.reject(t)}}}class jc{constructor(e){me(this,"orgId"),me(this,"rendererService"),me(this,"isLoading",!1),me(this,"userContainerId"),me(this,"containerElement",null),me(this,"defaultSelectorId","dita-3dconfig-element"),me(this,"defaultCanvasStyle",{width:"100%",height:"100%"}),me(this,"customisationArr",[]),me(this,"assetDetails",null),me(this,"viewerOnly",!1),this.userContainerId=e.userContainerId,this.rendererService=new BU,this.orgId=e.orgId??""}async loadLocalFrame(e){try{return await this.rendererService.Init(this.userContainerId??this.defaultSelectorId,e.autoRotateSpeed),await this.rendererService.loadLocalFrame(e.glbFile),this}catch(t){return console.error(t),this}}async changeLocalFrame(e){try{return this.rendererService.loadLocalFrame(e.glbFile)}catch(t){console.error(t)}}async loadFrame(e){this.assetDetails=e.data.assetDetails,this.customisationArr=e.data.customisation,this.viewerOnly=e.data.viewerOnly;try{return await this.rendererService.Init(this.userContainerId??this.defaultSelectorId,e.autoRotateSpeed,e.forInovati,e.data.viewerOnly??!1),await this.rendererService.loadFirstFrame(this.orgId,this.assetDetails,this.customisationArr),this}catch(t){return console.error(t),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)}changeLensShape(e){return this.rendererService.changeLensShape(e)}changeOrbital(e){return this.rendererService.changeOrbital(e)}changeGemType(e,t,n){return this.rendererService.changeGemType(e,t,n)}changeStudType(e,t){return this.rendererService.changeStudType(e,t)}snapCameraToPos(e){return this.rendererService.snapCamToPos(e)}focusOnZone(e,t,n,i){return this.rendererService.flashFocusOnZone(e,t,i)}unmount(){this.containerElement&&(this.containerElement.innerHTML="",this.containerElement.style.height="0px",this.containerElement.style.width="auto")}}class av{constructor(e,t){me(this,"localDOMService"),e&&(this.localDOMService=new jc({userContainerId:t}))}async Init(e){if(await ti.init({apiKey:e,baseUrl:U6.host}),!ti.isAuthenticated())throw new Error("Sprie Error: Authentication failed. Please check your API key and try again.")}async getDOMServiceInstance(e){return this.localDOMService?this.localDOMService:new jc({userContainerId:e})}async loadBySKU(e){const t=await s3.FetchAssetBySKUOrBarcode({sku:e.SKU,barcode:null});return await this.renderAsset({data:{assetDetails:t,customisation:t.customisation}})}async renderAsset(e){if(!ti.isAuthenticated()||!ti.orgId)throw new Error("Sprie Error: User not authenticatd.");return new jc({orgId:ti.orgId,userContainerId:e.containerId}).loadFrame({containerId:e.containerId,data:{assetDetails:e.data.assetDetails,customisation:e.data.customisation}})}async getInstance(e){if(!ti.isAuthenticated()||!ti.orgId)throw new Error("Sprie Error: User not authenticatd.");return new jc({orgId:ti.orgId,userContainerId:e.containerId})}}window.ThreeDConfigurator=av;const $F="",a0=/iPhone|iPad|iPod|Android/i.test(navigator.userAgent),eO="";var Wc=(r=>(r.Front="Front",r.Back="Back",r.Left="Left",r.Right="Right",r.Top="Top",r.Bottom="Bottom",r))(Wc||{}),Br=(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))(Br||{});const bU="data:image/png;base64,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",RU={position:"absolute",left:"-8%",top:"15%",height:"70px",width:"70px",borderRadius:"50%",backgroundColor:"rgba(0, 0, 0, 0.5)",cursor:"default",zIndex:1e3},DU={position:"absolute",left:"-10%",top:"22%",height:"55px",width:"55px",borderRadius:"50%",backgroundColor:"rgba(0, 0, 0, 0.5)",cursor:"default",zIndex:1e3};function LU(r){return r.replace(/\s*\/\s*/g," / ")}function NU({frameList:r,selectedFrame:e,modelLoading:t,isSelected:n,paletteEntered:i,onChangeFrame:s}){const o=Ue.useRef(null),l=Ue.useRef(null),h=()=>{o.current&&(o.current.textContent=Br.EnteredFramesListSection)};return Ue.useEffect(()=>{i&&l.current&&l.current.querySelectorAll(".sprie-config-palette-img-box")[0].firstChild.focus()},[i]),Te.jsxs("div",{className:"sprie-config-palette sprie-config-palette--frame",ref:l,style:{gap:a0?"4rem":"6rem",display:n?"flex":"none",padding:"0 3rem"},children:[Te.jsx("span",{className:"sprie-config-sr-only","aria-live":"assertive",ref:o}),r==null?void 0:r.map(u=>{const d=LU(u.name);return Te.jsxs("div",{className:"sprie-config-palette-img-box",children:[Te.jsxs("button",{"aria-labelledby":(e==null?void 0:e._id)===u._id?"sprie-config-frameName":"",style:{border:"0",cursor:t?"default":"pointer",width:a0?45:60,height:a0?45:60},onClick:()=>u.available&&s(u),onFocus:()=>h(),disabled:t,children:[Te.jsx("img",{"aria-label":`Select frame ${d}`,src:u.variantImage,alt:`${d} image`,className:`sprie-config-image ${a0?"mobile-view":""}`,style:{border:(e==null?void 0:e._id)===u._id?"2px solid #9d9b9c":"0",borderRadius:"50%",padding:"1px"}}),!u.available&&Te.jsx("img",{src:bU,style:a0?DU:RU})]}),Te.jsxs("p",{className:"sprie-config-palette-img-text",children:[Te.jsx("span",{className:"sprie-config-palette-imgName",children:d}),Te.jsx("span",{id:"sprie-config-frameName",className:"sprie-config-sr-only",children:`Selected frame ${d}`})]})]},u._id)})]})}function PU({lensList:r,selectedLens:e,selectedDitaLens:t,modelLoading:n,isSelected:i,paletteEntered:s,onChangeLens:o}){const l=Ue.useRef(null),h=Ue.useRef(null),u=()=>{l.current&&(l.current.textContent=Br.EnteredLensListSection)};return Ue.useEffect(()=>{s&&h.current&&h.current.querySelectorAll(".sprie-config-palette-img-box")[0].firstChild.focus()},[s]),Te.jsxs("div",{className:"sprie-config-palette",ref:h,style:{display:i?"flex":"none",padding:"0 3rem",gap:a0?"3rem":"5rem"},children:[Te.jsx("span",{className:"sprie-config-sr-only","aria-live":"assertive",ref:l}),r==null?void 0:r.map(d=>Te.jsxs("div",{className:"sprie-config-palette-img-box",children:[Te.jsx("button",{"aria-labelledby":(e==null?void 0:e._id)===d._id?"sprie-config-lensName":"",style:{border:"0",cursor:n?"default":"pointer",width:a0?45:60,height:a0?45:60},onClick:()=>o(d),onFocus:u,disabled:n,children:Te.jsx("img",{"aria-label":`Select lens ${d.name}`,src:d.thumbnail,alt:d.name+"image",className:`sprie-config-image ${a0?"mobile-view":""}`,style:{border:(e==null?void 0:e._id)===d._id?"2px solid #9d9b9c":"0",borderRadius:"50%",padding:"1px"}})}),Te.jsxs("p",{className:"sprie-config-palette-img-text",style:{bottom:"-1.2rem",textAlign:"center"},children:[Te.jsx("span",{className:"sprie-config-palette-imgName",children:`${d.name}`}),Te.jsx("br",{}),(e==null?void 0:e._id)===d._id&&Te.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})`}),Te.jsxs("span",{id:"sprie-config-lensName",className:"sprie-config-sr-only",children:[" ",`Selected lens ${d.name}`]})]})]},d._id))]})}const tO="";function UU({heading:r,isSelected:e,onEngravingLinkClicked:t,onChecked:n,onTextAdded:i,paletteEntered:s}){const[o,l]=Ue.useState(""),[h,u]=Ue.useState(!1),[d,A]=Ue.useState(!1);Ue.useState(!1);const p=Ue.useRef(null),g=Ue.useRef(null),m=Ue.useRef(null);Ue.useEffect(()=>{n(h),h&&p.current?(p.current.style.backgroundColor="#ffffff",m.current&&(m.current.textContent=Br.EngravingInputAvailable)):!h&&p.current&&(p.current.style.backgroundColor="transparent",m.current&&(m.current.textContent=Br.EngravingInputHidden),l(""))},[h]),Ue.useEffect(()=>{d&&o!=""&&i(o)},[d]),Ue.useEffect(()=>{var v;s&&((v=g.current)==null||v.focus())},[s]);const E=()=>{m.current&&(m.current.textContent=Br.EnteredEngravingSection)},_=v=>{var C;v.key==="Enter"&&(i(o),(C=p.current)==null||C.blur(),m.current&&(m.current.textContent=Br.AddedEngravingText+o))};return Te.jsxs("div",{className:"sprie-config-engraving-block",style:{display:e?"flex":"none",marginTop:".5rem"},children:[Te.jsx("span",{className:"sprie-config-sr-only","aria-live":"assertive",ref:m}),Te.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".8rem"},children:[Te.jsx("input",{type:"checkbox",ref:g,className:"sprie-config-engraving-checkbox",onChange:v=>{u(v.target.checked)},onFocus:E,checked:h}),Te.jsxs("p",{style:{fontSize:".9rem",color:"#4d4d4d",fontWeight:"500",margin:"0"},children:["Add ",r?r.toLowerCase():"Laser Engraving"," ",Te.jsx("span",{style:{fontWeight:"400"},children:"(OPTIONAL)"})]})]}),Te.jsxs("div",{className:"sprie-config-engraving-inputField-block",children:[Te.jsx("input",{"aria-label":Br.EnteredEngravingTextInput,type:"text",ref:p,className:"sprie-config-engraving-inputField",placeholder:"ADD CUSTOM TEXT",value:o,onChange:v=>l(v.target.value),maxLength:15,style:{padding:"0.7rem"},disabled:!h,onBlur:()=>A(!0),onFocus:()=>A(!1),onKeyDown:v=>_(v)}),Te.jsx("span",{className:"sprie-config-engraving-inputInfo",children:`${o.length}/15 characters`})]})]})}const rO="";function kU({totalSteps:r,currentStep:e}){return Te.jsx("div",{className:"step-tracker-block",style:{margin:a0?"auto":""}})}function FU({nextSlide:r,previousSlide:e,currentIndex:t,stepsName:n,isLastStep:i}){const s=()=>{e()},o=()=>{r()};return Te.jsxs("div",{className:"carousel-header",children:[Te.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:Te.jsx("i",{className:"arrow left-arrow",style:{padding:".25rem"}})}),Te.jsxs("p",{children:[Te.jsx("span",{className:"step-syntax",children:`STEP ${t+1} of ${n.length} : `}),Te.jsx("span",{className:"select-syntax",children:n[t]})]}),Te.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:Te.jsx("i",{className:"arrow right-arrow",style:{padding:".25rem"}})})]})}function OU({setShowAddToCart:r,setSelectedChild:e,setSectionEntered:t,children:n}){var g;const[i,s]=Ue.useState(0),o=q2.Children.toArray(n),l=i===o.length-1,h=Ue.useRef(null),u=(g=o.map(m=>m))==null?void 0:g.map(m=>m.props.heading),d=()=>{s(m=>m===0?q2.Children.count(n)-1:m-1),h.current&&h.current.focus()},A=()=>{s(m=>m===q2.Children.count(n)-1?0:m+1),h.current&&h.current.focus()};Ue.useEffect(()=>{r(!!l)},[l]),Ue.useEffect(()=>{e(i)},[i]);const p=m=>{(m.key==="Enter"||m.key===" ")&&m.target===h.current&&t(i)};return Te.jsxs("div",{className:"carousel",children:[Te.jsx("span",{className:"sprie-config-sr-only",id:"sprie-config-step-selector",children:`Customisation Step Selector. ${l?"This is an optional":""} Step ${i+1} -
4699
+ `},this.depthMaterial.depthTest=!1,this.depthMaterial.depthWrite=!1}setupBlurMaterials(){this.horizontalBlurMaterial=new B0(CU),this.verticalBlurMaterial=new B0(IU),this.horizontalBlurMaterial.depthTest=!1,this.verticalBlurMaterial.depthTest=!1}updateShadowCamera(){this.shadowCamera&&(this.shadowCamera.far=.125,this.shadowCamera.updateProjectionMatrix())}blurShadow(e){var t,n,i,s,o,l,h;const u=(t=this.shadowGroup)==null?void 0:t.getObjectByName("blurPlane");u.visible=!0,u.material=this.horizontalBlurMaterial,u.material.uniforms.tDiffuse.value=(n=this.renderTarget)==null?void 0:n.texture,this.horizontalBlurMaterial&&(this.horizontalBlurMaterial.uniforms.h.value=e*1/256),(i=this.renderer)==null||i.setRenderTarget(this.renderTargetBlur),(s=this.renderer)==null||s.render(u,this.shadowCamera),u.material=this.verticalBlurMaterial,u.material.uniforms.tDiffuse.value=(o=this.renderTargetBlur)==null?void 0:o.texture,this.verticalBlurMaterial&&(this.verticalBlurMaterial.uniforms.v.value=e*1/256),(l=this.renderer)==null||l.setRenderTarget(this.renderTarget),(h=this.renderer)==null||h.render(u,this.shadowCamera),u.visible=!1}render(){if(!this.scene||!this.renderer)return;const e=this.scene.background;if(this.scene.background=null,this.scene.overrideMaterial=this.depthMaterial,!this.renderer||!this.shadowCamera)return;const t=this.renderer.getClearAlpha();this.renderer.setClearAlpha(0),this.renderer.clear(),this.renderer.setRenderTarget(this.renderTarget),this.renderer.render(this.scene,this.shadowCamera),this.scene.overrideMaterial=null,this.blurShadow(Y9.shadow.blur),this.blurShadow(Y9.shadow.blur*.4),this.renderer.setRenderTarget(null),this.renderer.setClearAlpha(t),this.scene.background=e}dispose(){var e,t,n,i,s,o;(e=this.renderTarget)==null||e.dispose(),(t=this.renderTargetBlur)==null||t.dispose(),(n=this.depthMaterial)==null||n.dispose(),(i=this.horizontalBlurMaterial)==null||i.dispose(),(s=this.verticalBlurMaterial)==null||s.dispose(),this.debugGroup&&((o=this.scene)==null||o.remove(this.debugGroup))}}class SU extends jo{constructor(e,t,n=null,i=null,s=null){super(),this.scene=e,this.camera=t,this.overrideMaterial=n,this.clearColor=i,this.clearAlpha=s,this.clear=!0,this.clearDepth=!1,this.needsSwap=!1,this._oldClearColor=new We}render(e,t,n){const i=e.autoClear;e.autoClear=!1;let s,o;this.overrideMaterial!==null&&(o=this.scene.overrideMaterial,this.scene.overrideMaterial=this.overrideMaterial),this.clearColor!==null&&(e.getClearColor(this._oldClearColor),e.setClearColor(this.clearColor,e.getClearAlpha())),this.clearAlpha!==null&&(s=e.getClearAlpha(),e.setClearAlpha(this.clearAlpha)),this.clearDepth==!0&&e.clearDepth(),e.setRenderTarget(this.renderToScreen?null:n),this.clear===!0&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),e.render(this.scene,this.camera),this.clearColor!==null&&e.setClearColor(this._oldClearColor),this.clearAlpha!==null&&e.setClearAlpha(s),this.overrideMaterial!==null&&(this.scene.overrideMaterial=o),e.autoClear=i}}class TU{constructor(){me(this,"rendererCore"),me(this,"sceneManager"),me(this,"bloomEffect"),me(this,"shadowEffect"),me(this,"pointerEvents"),me(this,"isInitialised",!1),me(this,"isInovati",!1),me(this,"viewerOnly",!1),me(this,"handleResize",()=>{var e;this.isInitialised&&(this.rendererCore.resizeRenderer(),(e=this.sceneManager)==null||e.handleResize())}),this.rendererCore=new VT}async initialise(e,t,n,i){if(this.isInitialised)return;this.isInovati=n??!1,this.viewerOnly=i??!1;const s=this.rendererCore.initialiseRenderer(e);this.sceneManager=new yU(this.rendererCore.getRenderer(),s,this.isInovati),await this.sceneManager.initialiseScene(t).then(([o,l])=>{o&&l&&(this.initEffects(o,l),this.pointerEvents=new EU(l,o,s),this.setupEventHandlers(),this.isInitialised=!0)}),this.sceneManager.handleResize()}initEffects(e,t){const n=new SU(e,t);if(this.isInovati){this.bloomEffect=new wU(this.rendererCore.getRenderer(),n,e);const i=this.bloomEffect.getBloomMixPass();this.rendererCore.SetupComposerWithBloom(n,i)}else this.rendererCore.setupMSAA(n);this.shadowEffect=new MU(e,this.rendererCore.getRenderer())}async startRendering(){this.startRenderLoop()}setupEventHandlers(){window.addEventListener("resize",this.handleResize),!(!this.pointerEvents||this.viewerOnly)&&this.pointerEvents.initialiseEventListeners()}startRenderLoop(){const e=()=>{this.sceneManager&&(this.sceneManager.updateControls(),this.rendererCore.resizeRenderer()&&this.sceneManager.handleResize()),this.shadowEffect&&this.shadowEffect.render(),this.isInovati&&this.bloomEffect&&this.bloomEffect.render(),this.rendererCore.render(),requestAnimationFrame(e)};e()}loadFirstFrame(e,t,n){var i;return((i=this.sceneManager)==null?void 0:i.loadFirstFrame(e,t,n))??Promise.reject(new Error("Scene manager not initialised"))}loadLocalFrame(e){var t;return((t=this.sceneManager)==null?void 0:t.loadLocalFrame(e))??Promise.reject(new Error("Scene manager not initialised"))}changeFrame(e,t,n){var i;return((i=this.sceneManager)==null?void 0:i.changeFrame(e,t,n))??Promise.reject(new Error("Scene manager not initialised"))}changeLens(e,t,n,i){var s;return((s=this.sceneManager)==null?void 0:s.changeLens(e,t,n,i))??Promise.reject(new Error("Scene manager not initialised"))}changeLensShape(e){var t;return((t=this.sceneManager)==null?void 0:t.changeLensShape(e))??Promise.reject(new Error("Scene manager not initialised"))}changeOrbital(e){var t;return((t=this.sceneManager)==null?void 0:t.changeOrbital(e))??Promise.reject(new Error("Scene manager not initialised"))}async changeGemType(e,t,n){var i;await((i=this.sceneManager)==null?void 0:i.changeGemType(e,t,n).then(s=>{this.bloomEffect&&s&&this.bloomEffect.updateComposers(this.rendererCore.getFinalComposer())}))}changeStudType(e,t){var n;return((n=this.sceneManager)==null?void 0:n.changeStudType(e,t))??Promise.reject(new Error("Scene manager not initialised"))}async flashFocusOnZone(e,t,n){var i;await((i=this.sceneManager)==null?void 0:i.flashFocusOnZone(e,t,n).then(s=>{this.bloomEffect&&s&&this.bloomEffect.updateComposers(this.rendererCore.getFinalComposer())}))}snapCameraToPosition(e){var t;return((t=this.sceneManager)==null?void 0:t.snapCameraToPosition(e))??Promise.reject(new Error("Scene manager not initialised"))}cleanUp(){var e,t,n,i;window.removeEventListener("resize",this.handleResize),(e=this.pointerEvents)==null||e.dispose(),this.rendererCore.dispose(),(t=this.sceneManager)==null||t.dispose(),(n=this.bloomEffect)==null||n.dispose(),(i=this.shadowEffect)==null||i.dispose()}}class BU{constructor(){me(this,"customRenderer"),this.customRenderer=new TU}async Init(e,t,n,i){this.customRenderer.isInitialised||await this.customRenderer.initialise(e,t,n,i).then(()=>{this.customRenderer.startRendering()})}loadFirstFrame(e,t,n){try{return this.customRenderer.loadFirstFrame(e,t,n)}catch(i){return console.error(i),Promise.reject(i)}}loadLocalFrame(e){try{return this.customRenderer.loadLocalFrame(e)}catch(t){return console.error(t),Promise.reject(t)}}changeFrame(e,t,n){try{return this.customRenderer.changeFrame(e,t,n)}catch(i){return console.error(i),Promise.reject(i)}}changeLens(e,t,n,i){try{return this.customRenderer.changeLens(e,t,n,i)}catch(s){return console.error(s),Promise.reject(s)}}changeLensShape(e){try{return this.customRenderer.changeLensShape(e)}catch(t){return console.error(t),Promise.reject(t)}}changeOrbital(e){try{return this.customRenderer.changeOrbital(e)}catch(t){return console.error(t),Promise.reject(t)}}changeGemType(e,t,n){try{return this.customRenderer.changeGemType(e,t,n)}catch(i){return console.error(i),Promise.reject(i)}}changeStudType(e,t){try{return this.customRenderer.changeStudType(e,t)}catch(n){return console.error(n),Promise.reject(n)}}flashFocusOnZone(e,t,n){try{return this.customRenderer.flashFocusOnZone(e,t,n)}catch(i){return console.error(i),Promise.reject(i)}}snapCamToPos(e){try{return this.customRenderer.snapCameraToPosition(e)}catch(t){return console.error(t),Promise.reject(t)}}}class jc{constructor(e){me(this,"orgId"),me(this,"rendererService"),me(this,"isLoading",!1),me(this,"userContainerId"),me(this,"containerElement",null),me(this,"defaultSelectorId","dita-3dconfig-element"),me(this,"defaultCanvasStyle",{width:"100%",height:"100%"}),me(this,"customisationArr",[]),me(this,"assetDetails",null),me(this,"viewerOnly",!1),this.userContainerId=e.userContainerId,this.rendererService=new BU,this.orgId=e.orgId??""}async loadLocalFrame(e){try{return await this.rendererService.Init(this.userContainerId??this.defaultSelectorId,e.autoRotateSpeed),await this.rendererService.loadLocalFrame(e.glbFile),this}catch(t){return console.error(t),this}}async changeLocalFrame(e){try{return this.rendererService.loadLocalFrame(e.glbFile)}catch(t){console.error(t)}}async loadFrame(e){this.assetDetails=e.data.assetDetails,this.customisationArr=e.data.customisation,this.viewerOnly=e.data.viewerOnly;try{return await this.rendererService.Init(this.userContainerId??this.defaultSelectorId,e.autoRotateSpeed,e.forInovati,e.data.viewerOnly??!1),await this.rendererService.loadFirstFrame(this.orgId,this.assetDetails,this.customisationArr),this}catch(t){return console.error(t),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)}changeLensShape(e){return this.rendererService.changeLensShape(e)}changeOrbital(e){return this.rendererService.changeOrbital(e)}changeGemType(e,t,n){return this.rendererService.changeGemType(e,t,n)}changeStudType(e,t){return this.rendererService.changeStudType(e,t)}snapCameraToPos(e){return this.rendererService.snapCamToPos(e)}focusOnZone(e,t,n,i){return this.rendererService.flashFocusOnZone(e,t,i)}unmount(){this.containerElement&&(this.containerElement.innerHTML="",this.containerElement.style.height="0px",this.containerElement.style.width="auto")}}class av{constructor(e,t){me(this,"localDOMService"),e&&(this.localDOMService=new jc({userContainerId:t}))}async Init(e){if(await ti.init({apiKey:e,baseUrl:U6.host}),!ti.isAuthenticated())throw new Error("Sprie Error: Authentication failed. Please check your API key and try again.")}async getDOMServiceInstance(e){return this.localDOMService?this.localDOMService:new jc({userContainerId:e})}async loadBySKU(e){const t=await s3.FetchAssetBySKUOrBarcode({sku:e.SKU,barcode:null});return await this.renderAsset({data:{assetDetails:t,customisation:t.customisation}})}async renderAsset(e){if(!ti.isAuthenticated()||!ti.orgId)throw new Error("Sprie Error: User not authenticatd.");return new jc({orgId:ti.orgId,userContainerId:e.containerId}).loadFrame({containerId:e.containerId,data:{assetDetails:e.data.assetDetails,customisation:e.data.customisation}})}async getInstance(e){if(!ti.isAuthenticated()||!ti.orgId)throw new Error("Sprie Error: User not authenticatd.");return new jc({orgId:ti.orgId,userContainerId:e.containerId})}}window.ThreeDConfigurator=av;const $F="",a0=/iPhone|iPad|iPod|Android/i.test(navigator.userAgent),eO="";var Wc=(r=>(r.Front="Front",r.Back="Back",r.Left="Left",r.Right="Right",r.Top="Top",r.Bottom="Bottom",r))(Wc||{}),Br=(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))(Br||{});const bU="data:image/png;base64,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",RU={position:"absolute",left:"-8%",top:"15%",height:"70px",width:"70px",borderRadius:"50%",backgroundColor:"rgba(0, 0, 0, 0.5)",cursor:"default",zIndex:1e3},DU={position:"absolute",left:"-10%",top:"22%",height:"55px",width:"55px",borderRadius:"50%",backgroundColor:"rgba(0, 0, 0, 0.5)",cursor:"default",zIndex:1e3};function LU(r){return r.replace(/\s*\/\s*/g," / ")}function NU({frameList:r,selectedFrame:e,modelLoading:t,isSelected:n,paletteEntered:i,onChangeFrame:s}){const o=ke.useRef(null),l=ke.useRef(null),h=()=>{o.current&&(o.current.textContent=Br.EnteredFramesListSection)};return ke.useEffect(()=>{i&&l.current&&l.current.querySelectorAll(".sprie-config-palette-img-box")[0].firstChild.focus()},[i]),Te.jsxs("div",{className:"sprie-config-palette sprie-config-palette--frame",ref:l,style:{gap:a0?"4rem":"6rem",display:n?"flex":"none",padding:"0 3rem"},children:[Te.jsx("span",{className:"sprie-config-sr-only","aria-live":"assertive",ref:o}),r==null?void 0:r.map(u=>{const d=LU(u.name);return Te.jsxs("div",{className:"sprie-config-palette-img-box",children:[Te.jsxs("button",{"aria-labelledby":(e==null?void 0:e._id)===u._id?"sprie-config-frameName":"",style:{border:"0",cursor:t?"default":"pointer",width:a0?45:60,height:a0?45:60},onClick:()=>u.available&&s(u),onFocus:()=>h(),disabled:t,children:[Te.jsx("img",{"aria-label":`Select frame ${d}`,src:u.variantImage,alt:`${d} image`,className:`sprie-config-image ${a0?"mobile-view":""}`,style:{border:(e==null?void 0:e._id)===u._id?"2px solid #9d9b9c":"0",borderRadius:"50%",padding:"1px"}}),!u.available&&Te.jsx("img",{src:bU,style:a0?DU:RU})]}),Te.jsxs("p",{className:"sprie-config-palette-img-text",children:[Te.jsx("span",{className:"sprie-config-palette-imgName",children:d}),Te.jsx("span",{id:"sprie-config-frameName",className:"sprie-config-sr-only",children:`Selected frame ${d}`})]})]},u._id)})]})}function PU({lensList:r,selectedLens:e,selectedDitaLens:t,modelLoading:n,isSelected:i,paletteEntered:s,onChangeLens:o}){const l=ke.useRef(null),h=ke.useRef(null),u=()=>{l.current&&(l.current.textContent=Br.EnteredLensListSection)};return ke.useEffect(()=>{s&&h.current&&h.current.querySelectorAll(".sprie-config-palette-img-box")[0].firstChild.focus()},[s]),Te.jsxs("div",{className:"sprie-config-palette",ref:h,style:{display:i?"flex":"none",padding:"0 3rem",gap:a0?"3rem":"5rem"},children:[Te.jsx("span",{className:"sprie-config-sr-only","aria-live":"assertive",ref:l}),r==null?void 0:r.map(d=>Te.jsxs("div",{className:"sprie-config-palette-img-box",children:[Te.jsx("button",{"aria-labelledby":(e==null?void 0:e._id)===d._id?"sprie-config-lensName":"",style:{border:"0",cursor:n?"default":"pointer",width:a0?45:60,height:a0?45:60},onClick:()=>o(d),onFocus:u,disabled:n,children:Te.jsx("img",{"aria-label":`Select lens ${d.name}`,src:d.thumbnail,alt:d.name+"image",className:`sprie-config-image ${a0?"mobile-view":""}`,style:{border:(e==null?void 0:e._id)===d._id?"2px solid #9d9b9c":"0",borderRadius:"50%",padding:"1px"}})}),Te.jsxs("p",{className:"sprie-config-palette-img-text",style:{bottom:"-1.2rem",textAlign:"center"},children:[Te.jsx("span",{className:"sprie-config-palette-imgName",children:`${d.name}`}),Te.jsx("br",{}),(e==null?void 0:e._id)===d._id&&Te.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})`}),Te.jsxs("span",{id:"sprie-config-lensName",className:"sprie-config-sr-only",children:[" ",`Selected lens ${d.name}`]})]})]},d._id))]})}const tO="";function UU({heading:r,isSelected:e,onEngravingLinkClicked:t,onChecked:n,onTextAdded:i,paletteEntered:s}){const[o,l]=ke.useState(""),[h,u]=ke.useState(!1),[d,A]=ke.useState(!1);ke.useState(!1);const p=ke.useRef(null),g=ke.useRef(null),m=ke.useRef(null);ke.useEffect(()=>{n(h),h&&p.current?(p.current.style.backgroundColor="#ffffff",m.current&&(m.current.textContent=Br.EngravingInputAvailable)):!h&&p.current&&(p.current.style.backgroundColor="transparent",m.current&&(m.current.textContent=Br.EngravingInputHidden),l(""))},[h]),ke.useEffect(()=>{d&&o!=""&&i(o)},[d]),ke.useEffect(()=>{var v;s&&((v=g.current)==null||v.focus())},[s]);const E=()=>{m.current&&(m.current.textContent=Br.EnteredEngravingSection)},_=v=>{var C;v.key==="Enter"&&(i(o),(C=p.current)==null||C.blur(),m.current&&(m.current.textContent=Br.AddedEngravingText+o))};return Te.jsxs("div",{className:"sprie-config-engraving-block",style:{display:e?"flex":"none",marginTop:".5rem"},children:[Te.jsx("span",{className:"sprie-config-sr-only","aria-live":"assertive",ref:m}),Te.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".8rem"},children:[Te.jsx("input",{type:"checkbox",ref:g,className:"sprie-config-engraving-checkbox",onChange:v=>{u(v.target.checked)},onFocus:E,checked:h}),Te.jsxs("p",{style:{fontSize:".9rem",color:"#4d4d4d",fontWeight:"500",margin:"0"},children:["Add ",r?r.toLowerCase():"Laser Engraving"," ",Te.jsx("span",{style:{fontWeight:"400"},children:"(OPTIONAL)"})]})]}),Te.jsxs("div",{className:"sprie-config-engraving-inputField-block",children:[Te.jsx("input",{"aria-label":Br.EnteredEngravingTextInput,type:"text",ref:p,className:"sprie-config-engraving-inputField",placeholder:"ADD CUSTOM TEXT",value:o,onChange:v=>l(v.target.value),maxLength:15,style:{padding:"0.7rem"},disabled:!h,onBlur:()=>A(!0),onFocus:()=>A(!1),onKeyDown:v=>_(v)}),Te.jsx("span",{className:"sprie-config-engraving-inputInfo",children:`${o.length}/15 characters`})]})]})}const rO="";function kU({totalSteps:r,currentStep:e}){return Te.jsx("div",{className:"step-tracker-block",style:{margin:a0?"auto":""}})}function FU({nextSlide:r,previousSlide:e,currentIndex:t,stepsName:n,isLastStep:i}){const s=()=>{e()},o=()=>{r()};return Te.jsxs("div",{className:"carousel-header",children:[Te.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:Te.jsx("i",{className:"arrow left-arrow",style:{padding:".25rem"}})}),Te.jsxs("p",{children:[Te.jsx("span",{className:"step-syntax",children:`STEP ${t+1} of ${n.length} : `}),Te.jsx("span",{className:"select-syntax",children:n[t]})]}),Te.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:Te.jsx("i",{className:"arrow right-arrow",style:{padding:".25rem"}})})]})}function OU({setShowAddToCart:r,setSelectedChild:e,setSectionEntered:t,children:n}){var g;const[i,s]=ke.useState(0),o=q2.Children.toArray(n),l=i===o.length-1,h=ke.useRef(null),u=(g=o.map(m=>m))==null?void 0:g.map(m=>m.props.heading),d=()=>{s(m=>m===0?q2.Children.count(n)-1:m-1),h.current&&h.current.focus()},A=()=>{s(m=>m===q2.Children.count(n)-1?0:m+1),h.current&&h.current.focus()};ke.useEffect(()=>{r(!!l)},[l]),ke.useEffect(()=>{e(i)},[i]);const p=m=>{(m.key==="Enter"||m.key===" ")&&m.target===h.current&&t(i)};return Te.jsxs("div",{className:"carousel",children:[Te.jsx("span",{className:"sprie-config-sr-only",id:"sprie-config-step-selector",children:`Customisation Step Selector. ${l?"This is an optional":""} Step ${i+1} -
4700
4700
  ${o[i].props.heading}.
4701
- Press enter to `+(l?"configure your optional custom engraving. Add to cart button is now present at the end of this section.":"select or press tab for next.")}),Te.jsxs("div",{tabIndex:0,style:{height:"30%",alignContent:"center"},"aria-labelledby":"sprie-config-step-selector",onKeyDown:p,ref:h,children:[Te.jsx(FU,{nextSlide:A,previousSlide:d,currentIndex:i,stepsName:u,isLastStep:l}),Te.jsx(kU,{totalSteps:u==null?void 0:u.length,currentStep:i+1})]}),Te.jsx("div",{className:"carousel-container",style:{paddingTop:a0?"":"1rem"},children:o.map((m,E)=>Te.jsx("div",{className:"carousel-item",style:{transform:`translateX(-${i*100}%)`},children:m},E))})]})}const nO="";function ov({conditionRequired:r,onButtonClick:e}){const[t,n]=Ue.useState(!1),i=Ue.useRef(null),s=Ue.useRef(null);return Ue.useEffect(()=>{s.current&&(s.current.disabled=!t)},[t]),Ue.useEffect(()=>{i.current&&(i.current.style.display=r?"flex":"none"),s.current&&(s.current.disabled=r)},[r]),Te.jsxs("div",{className:"sprie-config-add-to-cart-block",children:[Te.jsxs("label",{htmlFor:"Sprie-Config-return-policy-checkbox",id:"Sprie-Config-return-policy-label",ref:i,style:{display:"none"},children:[Te.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}),Te.jsx("p",{id:"sprie-config-return-policy-desc",children:"I agree this customized Item cannot be returned or exchanged."})]}),Te.jsx("button",{className:"sprie-config-add-to-cart-btn",ref:s,onClick:e,children:"ADD TO CART"})]})}function QU({orbitalList:r,selectedOrbital:e,modelLoading:t,isSelected:n,paletteEntered:i,onChangeOrbital:s}){const o=Ue.useRef(null),l=Ue.useRef(null),h=()=>{o.current&&(o.current.textContent=Br.EnteredOrbitalsListSection)};return Ue.useEffect(()=>{i&&l.current&&l.current.querySelectorAll(".sprie-config-palette-img-box")[0].firstChild.focus()},[i]),Te.jsxs("div",{className:"sprie-config-palette",ref:l,style:{display:n?"flex":"none",padding:"0 3rem",gap:a0?"3rem":"5rem"},children:[Te.jsx("span",{className:"sprie-config-sr-only","aria-live":"assertive",ref:o}),r==null?void 0:r.map(u=>Te.jsxs("div",{className:"sprie-config-palette-img-box",children:[Te.jsx("button",{"aria-labelledby":(e==null?void 0:e._id)===u._id?"sprie-config-orbitalName":"",style:{border:"0",cursor:t?"default":"pointer",width:a0?45:60,height:a0?45:60},onClick:()=>s(u),onFocus:h,disabled:t,children:Te.jsx("img",{"aria-label":`Select orbital ${u.name}`,src:u.thumbnail,alt:u.name+"image",className:`sprie-config-image ${a0?"mobile-view":""}`,style:{border:(e==null?void 0:e._id)===u._id?"2px solid #9d9b9c":"0",borderRadius:"50%",padding:"1px"}})}),Te.jsxs("p",{className:"sprie-config-palette-img-text",style:{bottom:"-1.5rem"},children:[Te.jsx("span",{className:"sprie-config-palette-imgName",children:u.name}),Te.jsx("span",{id:"sprie-config-orbitalName",className:"sprie-config-sr-only",children:`Selected orbital ${u.name}`})]})]},u._id))]})}const zU="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/Pgo8IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDIwMDEwOTA0Ly9FTiIKICJodHRwOi8vd3d3LnczLm9yZy9UUi8yMDAxL1JFQy1TVkctMjAwMTA5MDQvRFREL3N2ZzEwLmR0ZCI+CjxzdmcgdmVyc2lvbj0iMS4wIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiB3aWR0aD0iMzIwLjAwMDAwMHB0IiBoZWlnaHQ9IjY2LjAwMDAwMHB0IiB2aWV3Qm94PSIwIDAgMzIwLjAwMDAwMCA2Ni4wMDAwMDAiCiBwcmVzZXJ2ZUFzcGVjdFJhdGlvPSJ4TWlkWU1pZCBtZWV0Ij4KCjxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAuMDAwMDAwLDY2LjAwMDAwMCkgc2NhbGUoMC4xMDAwMDAsLTAuMTAwMDAwKSIKZmlsbD0iIzAwMDAwMCIgc3Ryb2tlPSJub25lIj4KPHBhdGggZD0iTTAgNjUxIGMwIC02IDkgLTExIDIxIC0xMSAxMSAwIDI5IC01IDQwIC0xMCAxOCAtMTAgMTkgLTI0IDE5IC0zMDAKMCAtMjc2IC0xIC0yOTAgLTE5IC0zMDAgLTExIC01IC0yOSAtMTAgLTQwIC0xMCAtMTIgMCAtMjEgLTQgLTIxIC0xMCAwIC0xNAo0NDUgLTEzIDUxMiAxIDEwNyAyMyAxOTAgODUgMjM5IDE3OSAyMCAzNyAyNCA2MCAyNCAxMzUgMCA3OCAtNCA5NyAtMjggMTQ3Ci0zNCA3MCAtMTAwIDEzMCAtMTc2IDE2MCAtNTIgMjEgLTc1IDIzIC0zMTMgMjYgLTE4MCAyIC0yNTggMCAtMjU4IC03eiBtNDcwCi0zNiBjMTUgLTggMzggLTI3IDQ5IC00MSAyMCAtMjUgMjEgLTM5IDIxIC0yMzggMCAtMTk0IC0yIC0yMTQgLTIwIC0yNDQgLTExCi0xOCAtMzYgLTQwIC01NSAtNDggLTQ2IC0xOSAtMTM1IC0xOCAtMTYzIDIgLTIyIDE1IC0yMiAxNyAtMjIgMzAwIGwwIDI4NCA4MAowIGM1MiAwIDkxIC01IDExMCAtMTV6Ii8+CjxwYXRoIGQ9Ik05ODAgNjUwIGMwIC01IDExIC0xMCAyNCAtMTAgNTUgMCA1NiAtNyA1NiAtMzEwIDAgLTMwMyAtMSAtMzEwIC01NgotMzEwIC0xMyAwIC0yNCAtNCAtMjQgLTEwIDAgLTYgNjcgLTEwIDE4MCAtMTAgMTEzIDAgMTgwIDQgMTgwIDEwIDAgNiAtMTEgMTAKLTIzIDEwIC0xMyAwIC0zMSA4IC00MCAxOCAtMTUgMTYgLTE3IDUyIC0xNyAyOTQgMCAyNTQgMSAyNzYgMTggMjkxIDEwIDEwIDI4CjE3IDQwIDE3IDEyIDAgMjIgNSAyMiAxMCAwIDYgLTY3IDEwIC0xODAgMTAgLTExMyAwIC0xODAgLTQgLTE4MCAtMTB6Ii8+CjxwYXRoIGQ9Ik0xNTI2IDYwMSBjLTI1IC0zMyAtNDYgLTY0IC00NiAtNzAgMCAtNiAyNCA1IDU0IDI0IDUzIDM0IDE1OSA3NQoxOTQgNzUgMTAgMCAyOCAtMTAgNDAgLTIzIDIxIC0yMyAyMiAtMzAgMjIgLTI4OSAwIC0yODkgLTIgLTI5OCAtNTYgLTI5OCAtMTMKMCAtMjQgLTQgLTI0IC0xMCAwIC02IDY3IC0xMCAxODAgLTEwIDExMyAwIDE4MCA0IDE4MCAxMCAwIDYgLTExIDEwIC0yNCAxMAotNTQgMCAtNTYgOSAtNTYgMjk0IDAgMjUxIDEgMjY1IDIxIDI5MCAxMSAxNCAzMCAyNiA0MiAyNiAzNyAtMSAxNTMgLTQ2IDIwMQotNzggMjUgLTE3IDQ2IC0yNyA0NiAtMjEgMCA2IC0yMSAzNyAtNDYgNzAgbC00NyA1OSAtMzE3IDAgLTMxNyAwIC00NyAtNTl6Ii8+CjxwYXRoIGQ9Ik0yNDU1IDY1MCBjMyAtNSAxNSAtMTAgMjYgLTEwIDMwIDAgNjUgLTI3IDk3IC03NiBsMjkgLTQzIC05MCAtMTc4CmMtMTM2IC0yNzAgLTE2MyAtMzEzIC0xOTggLTMyMCAtNTkgLTExIC0yNiAtMjMgNjYgLTIzIDg5IDAgMTIxIDExIDc1IDI1IC0yOQo5IC0yNiA1NSAxMCAxMjYgbDMxIDYwIDE1MSAtMyAxNTEgLTMgMzkgLTczIGMzMCAtNTkgMzYgLTc3IDI4IC05MyAtNiAtMTAKLTIwIC0xOSAtMzAgLTE5IC0xMSAwIC0yMCAtNCAtMjAgLTEwIDAgLTYgNzAgLTEwIDE5MCAtMTAgMTIwIDAgMTkwIDQgMTkwIDEwCjAgNiAtMTEgMTAgLTI0IDEwIC0xNCAwIC0zNiAxMCAtNTAgMjMgLTE1IDEyIC0xMDYgMTU1IC0yMDQgMzE3IGwtMTc3IDI5NQotMTQ4IDMgYy0xMDAgMiAtMTQ2IC0xIC0xNDIgLTh6IG0yNTggLTM5OCBjLTM1IC0yIC05MiAtMiAtMTI3IDAgbC02NCAzIDYwCjExMyA2MCAxMTMgNjcgLTExMyA2NyAtMTEzIC02MyAtM3oiLz4KPC9nPgo8L3N2Zz4K",GU="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI4LjMuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCA4ODYgNjk4IiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA4ODYgNjk4OyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+Cgkuc3Qwe2ZpbGw6IzkxODQ3RTt9Cjwvc3R5bGU+CjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik04NDAuMDEsNDEuMDFjLTM2LjcxLTMxLjU2LTEwOC45NC01Ny45Ny0yNDQuNi00LjU2Yy0yMC40Nyw4LjA2LTQxLjQ2LDE3LjU3LTYyLjc1LDI4LjM2CgljMTkuMzgtNC42Niw0MzEuNTItMTAxLDE3NS42MSwxOTkuNDJsLTAuMDQsMGMtMjUuODUsMzUuNS01Ny44Miw3Mi4wOC05NC40MiwxMDcuOTdsLTMyLjcyLTI4LjE0bC02LjQ0LDE0MS43NmwxNjQuODQtNS41NwoJbC00NC4zNC0zOC4xMmM2NS41NC02My43NCwxMTcuODUtMTI5Ljk0LDE1MC4yMi0xOTAuNzdDOTA3LjQ0LDEzNC42OSw4NzYuNzEsNzIuNTcsODQwLjAxLDQxLjAxeiIvPgo8cGF0aCBjbGFzcz0ic3QwIiBkPSJNNTYyLjE3LDQyNS42N2MtNjQuNDcsNDYuMi0xMzIuNjcsODYuMjItMTk4LjQzLDExNi43NmMtMC4wOSwwLjA0LTAuMTcsMC4wOC0wLjI1LDAuMTMKCUMtMTkuMjcsNzMwLjcyLDczLjg2LDQ0MS4xMyw4OC4wNyw0MDEuNDVsLTIuMDktMS41MWMtMTQuNjcsMTcuOTMtMjcuNiwzNS42MS0zOC41Myw1Mi44NEMtMjQuNCw1NjYsMTEuMTYsNjI2LjI3LDUzLjY0LDY1Ni44OQoJYzQyLjQ4LDMwLjYzLDEyNi4wNyw1Ni4yNSwyODMuMDUsNC40M2M5OS0zMi42OSwyMDguNTgtODkuNywzMTAuMDYtMTYxLjE5bC04My43Ny0wLjQ2TDU2Mi4xNyw0MjUuNjd6Ii8+CjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik0yMTIuOSwxOTcuNzRjMCwzNS41NC0yNS43Myw1Mi44MS00MS45OCw1Mi44MXYxLjAxYzIwLjY1LDAsNDYuMzcsMTUuOTEsNDYuMzcsNTEuNDUKCWMwLDM3LjkxLTM0LjE5LDYzLjk4LTgzLjYxLDYzLjk4Yy00My42NywwLTcxLjA5LTE3LjI3LTgzLjk1LTU0Ljg0bDQyLjMxLTE4Ljk2YzQuNzQsMjQuMzcsMTcuMjYsMzYuMjIsNDEuOTgsMzYuMjIKCWMyMy43LDAsMzcuOTEtMTIuODcsMzcuNTctMzIuNWMtMC4zNC0yMC45OS0xMy4yLTI4Ljc4LTM5Ljk0LTI4Ljc4aC0xMS4xN3YtMzIuNWg5LjQ4YzI0LjM3LDAsMzYuNTYtOS44MiwzNi41Ni0yOS43OQoJYzAuMzQtMjAuNjUtMTEuNTEtMzEuNDgtMzEuODItMzEuNDhjLTIwLjY1LDAtMzMuODUsMTAuODMtMzYuOSwzMS44MmwtNDEuNjQtMTUuMjNjOC44LTM2LjksNDAuNjItNTQuMTYsODAuNTYtNTQuMTYKCUMxODUuODIsMTM2LjgxLDIxMi45LDE2Mi41NCwyMTIuOSwxOTcuNzR6Ii8+CjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik0zOTYuOTgsMTg1LjU2bC0zOS4yNywxOC4yOGMtNS40Mi0xNy42LTE3LjI2LTI4LjQzLTM4LjkzLTI4LjQzYy0yOC43OCwwLTQ5LjA4LDMwLjgtNDkuMDgsNzYuMTZ2NS43NmgxLjAxCgljNy40NS0yMy4wMiwzMS4xNC0zMy41MSw1Ni44Ny0zMy41MWM0Mi45OSwwLDczLjEyLDI3LjQyLDczLjEyLDcwLjQxYzAsNDQuMzQtMzAuOCw3Mi43OC04Mi42LDcyLjc4CgljLTU4LjIzLDAtOTAuMzgtNDIuOTktOTAuMzgtMTE1LjA5YzAtNzcuNTIsNDAuNjItMTE1LjA5LDk0LjExLTExNS4wOUMzNTcuNzEsMTM2LjgxLDM4NC4xMiwxNTAuMzUsMzk2Ljk4LDE4NS41NnogTTI4MC41MywyOTMuNTQKCWMwLDIyLjM0LDE1LjIzLDM2LjIyLDM4LjI1LDM2LjIyYzI0LjAzLDAsMzcuOTEtMTMuMiwzNy45MS0zNi4yMmMwLTIyLTEzLjg4LTM1LjU0LTM3LjkxLTM1LjU0CglDMjk1Ljc2LDI1OCwyODAuNTMsMjcyLjIyLDI4MC41MywyOTMuNTR6Ii8+CjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik00MTQuNzgsMjUxLjkxYzAtNzUuNDksMzAuMTMtMTE1LjA5LDg5LjM3LTExNS4wOXM4OS4zNywzOS42LDg5LjM3LDExNS4wOVM1NjMuMzgsMzY3LDUwNC4xNSwzNjcKCVM0MTQuNzgsMzI3LjM5LDQxNC43OCwyNTEuOTF6IE01NDYuOCwyNTEuOTFjMC01My4xNS0xMy44OC03Ny41Mi00Mi42NS03Ny41MmMtMjguNzcsMC00Mi42NSwyNC4zNy00Mi42NSw3Ny41MgoJYzAsNTMuMTUsMTMuODgsNzcuNTIsNDIuNjUsNzcuNTJDNTMyLjkyLDMyOS40Myw1NDYuOCwzMDUuMDUsNTQ2LjgsMjUxLjkxeiIvPgo8cGF0aCBjbGFzcz0ic3QwIiBkPSJNNTg4LjIsMTI4LjEzYzAtMTguNjMsMTMuNzgtMzIuMDIsMzIuOTktMzIuMDJjMTkuMjEsMCwzMi45OSwxMy4zOSwzMi45OSwzMi4wMnMtMTMuNzgsMzIuMDItMzIuOTksMzIuMDIKCUM2MDEuOTcsMTYwLjE0LDU4OC4yLDE0Ni43Niw1ODguMiwxMjguMTN6IE02NDAuNTksMTI4LjEzYzAtMTEuMjUtOC4xNS0xOS40LTE5LjQtMTkuNHMtMTkuNCw4LjE1LTE5LjQsMTkuNHM4LjE1LDE5LjQsMTkuNCwxOS40CglTNjQwLjU5LDEzOS4zOCw2NDAuNTksMTI4LjEzeiIvPgo8L3N2Zz4K",HU="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciICB2aWV3Qm94PSIwIDAgNjQgNjQiIHdpZHRoPSI0OHB4IiBoZWlnaHQ9IjQ4cHgiPjxwYXRoIGQ9Ik0gMTYgMTQgQyAxNS40ODggMTQgMTQuOTc2OTM4IDE0LjE5NDkzNyAxNC41ODU5MzggMTQuNTg1OTM4IEMgMTMuODA0OTM3IDE1LjM2NjkzNyAxMy44MDQ5MzcgMTYuNjMzMDYzIDE0LjU4NTkzOCAxNy40MTQwNjIgTCAyOS4xNzE4NzUgMzIgTCAxNC41ODU5MzggNDYuNTg1OTM4IEMgMTMuODA0OTM4IDQ3LjM2NjkzOCAxMy44MDQ5MzcgNDguNjMzMDYzIDE0LjU4NTkzOCA0OS40MTQwNjIgQyAxNC45NzY5MzcgNDkuODA1MDYyIDE1LjQ4OCA1MCAxNiA1MCBDIDE2LjUxMiA1MCAxNy4wMjMwNjIgNDkuODA1MDYyIDE3LjQxNDA2MiA0OS40MTQwNjIgTCAzMiAzNC44MjgxMjUgTCA0Ni41ODU5MzggNDkuNDE0MDYyIEMgNDcuMzY2OTM4IDUwLjE5NTA2MyA0OC42MzMwNjMgNTAuMTk1MDYyIDQ5LjQxNDA2MiA0OS40MTQwNjIgQyA1MC4xOTUwNjMgNDguNjMzMDYyIDUwLjE5NTA2MiA0Ny4zNjY5MzcgNDkuNDE0MDYyIDQ2LjU4NTkzOCBMIDM0LjgyODEyNSAzMiBMIDQ5LjQxNDA2MiAxNy40MTQwNjIgQyA1MC4xOTUwNjMgMTYuNjMzMDYzIDUwLjE5NTA2MiAxNS4zNjY5MzggNDkuNDE0MDYyIDE0LjU4NTkzOCBDIDQ4LjYzMzA2MiAxMy44MDQ5MzggNDcuMzY2OTM3IDEzLjgwNDkzOCA0Ni41ODU5MzggMTQuNTg1OTM4IEwgMzIgMjkuMTcxODc1IEwgMTcuNDE0MDYyIDE0LjU4NTkzOCBDIDE3LjAyMzA2MiAxNC4xOTQ5MzggMTYuNTEyIDE0IDE2IDE0IHoiLz48L3N2Zz4=",iO="";function VU({snapCameraTo:r}){const e=Object.keys(Wc).map(s=>({label:Wc[s],isDisabled:!0})),[t,n]=Ue.useState(),i=s=>{n(s),r(s)};return Te.jsx("div",{className:"sprie-3d-snap-button-block",children:e.map((s,o)=>Te.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(Wc[s.label])},children:s.label},o))})}function jU({frameName:r,removeDefaultLensFromLensList:e,customEvent:t,apiService:n,frameList:i,lensList:s,orbitalList:o,showOrbitalList:l,viewerOnly:h,domService:u,ThreeDConfigurator:d,dataVariants:A,dataLenses:p,dataOrbitals:g,firstDitaVariant:m,modelLoading:E,setModelLoading:_,currentProject:v=ls.Customizer}){const[C,x]=Ue.useState(0),[w,B]=Ue.useState(),[T,S]=Ue.useState(),[D,R]=Ue.useState(),[M,L]=Ue.useState(),[P,F]=Ue.useState(!1);Ue.useState(!1),Ue.useState(!1);const[z,J]=Ue.useState(a0?P?35:30:P?28:25),[q,ne]=Ue.useState(a0?10:8),[j,te]=Ue.useState(),[W,U]=Ue.useState(),[H,Z]=Ue.useState(),[G,oe]=Ue.useState(!1),[pe,Ae]=Ue.useState("placeholder"),[ge,Re]=Ue.useState(0),Fe=Ue.useRef(null),st=Ue.useRef(),ut=Ue.useRef(null);st.current=u;const mt={variantId:0,variantName:"defaultName",variantPrice:0,priceCurrency:"defaultCurrency",variantSku:"lens-default",polarized:"No",available:!0};let X,h0,pt;const At=he=>{st.current&&(st.current.snapCameraToPos(he),et(Br[`ChangedView${he}`]))},qe=he=>he==null?void 0:he.customisation.find(ke=>ke.type==="Lens"),Mt=(he,Oe)=>{var Se,ue;if(!Oe)return;if(he.sku.includes("lens-default"))return mt;const ke=(Se=Oe.metadata.find(ve=>ve.key==="baseCurve"))==null?void 0:Se.value;let ht="variantId";ke==="2B"?ht="2bVariantId":ke==="6B"&&(ht="6bVariantId");const $=(ue=he.metadata.find(ve=>ve.key===ht))==null?void 0:ue.value;return $?p==null?void 0:p.find(ve=>ve.variantId===Number.parseInt($,10)):p==null?void 0:p.find(ve=>ve.variantSku===he.sku)},Ye=async(he,Oe)=>{if(he._id===(T==null?void 0:T._id)&&!Oe||!st.current)return;const ke=qe(he)??(s==null?void 0:s[0]),ht=v===ls.Lancier,$=he._id!==(T==null?void 0:T._id);let Se;if(ht&&$&&ke){const ue=(s==null?void 0:s.find(ve=>ve.sku===ke.sku||ve._id===ke._id))??ke;Se=ue,R(ue),U(Mt(ue,he))}else Se=D??ke;_(!0),st.current.changeFrame(he,[Se,M]).then(()=>{_(!1)}),S(he),te(A==null?void 0:A.find(ue=>ue.variantSku===he.sku)),et(`${Br.ChangedFrame}${he.name}`)},Q=async he=>{var ue;if(!st.current||he===D)return;const Oe=he.sku.includes("lens-default"),ke=qe(T),ht=D??ke,$=!ht||ht.sku.includes("lens-default"),Se=se();if(!ke&&Oe?(_(!0),st.current.changeLens([he,M],!0,T).then(()=>{_(!1)})):!ke&&!Oe?$?(_(!0),st.current.changeLens([he,M],!0,T).then(()=>{_(!1)})):st.current.changeLens([he,M],!1,T):ke&&Oe?st.current.changeLens([ke,M],!1,T):$?(_(!0),st.current.changeLens([he,M],!0,T).then(()=>{_(!1)})):st.current.changeLens([he,M],!1,T),he.sku.includes("lens-default"))U(mt),et(`${Br.ChangedLens}${mt.variantName}`);else{const ve=(ue=he.metadata.find(Be=>Be.key===Se))==null?void 0:ue.value,De=p==null?void 0:p.find(Be=>Be.variantId===Number.parseInt(ve));U(De),et(`${Br.ChangedLens}${he.name}. Price will increase by ${W==null?void 0:W.variantPrice} ${W==null?void 0:W.priceCurrency}`)}R(he)},k=async he=>{st.current&&he!==M&&(_(!0),await st.current.changeOrbital(he).then(()=>{Z(g==null?void 0:g.find(Oe=>Oe.variantSku===he.sku)),_(!1)}),L(he),et(`${Br.ChangedOrbital}${he.name}`))},se=()=>{var ke;if(!T)return;const he=(ke=T.metadata.find(ht=>ht.key==="baseCurve"))==null?void 0:ke.value;let Oe="variantId";return he==="2B"?Oe="2bVariantId":he==="6B"&&(Oe="6bVariantId"),Oe},ye=T?qe(T):void 0,Ee=!l&&!D&&ye&&s?s.find(he=>he.sku===ye.sku||he._id===ye._id):void 0,_e=Ue.useMemo(()=>{if(D)return;const he=Ee;if(!(!he||!T))return Mt(he,T)},[D,Ee,T,p]),Ge=D??Ee,Le=()=>{let he=0,Oe=0;j&&(he=j.variantPrice);const ke=W??_e;return ke&&(Oe=ke.variantPrice),he+Oe},Ve=he=>{oe(he)},gt=he=>{Ae(he)},we=()=>{var he,Oe;a0?(he=document.querySelector('[id$="main-laser-etch-popover"]'))==null||he.setAttribute("open",""):(Oe=document.querySelector('[id$="main-laser-etch-drawer"]'))==null||Oe.setAttribute("open","")},Pe=()=>{if(l&&!H||!(T&&Ge)||T.name.toLowerCase().includes("default")||Ge.name.toLowerCase().includes("default"))return;const he=T.metadata.find(it=>it.key==="variantId"),Oe=T.metadata.find(it=>it.key==="baseCurve");let ke="variantId";Oe&&Oe.value==="2B"?ke="2bVariantId":Oe&&Oe.value==="6B"&&(ke="6bVariantId");const ht=Ge.metadata.find(it=>it.key===ke),$=he?Number(he.value):null,Se=ht?Number(ht.value):null,ue=H!=null&&H.variantId?Number(H.variantId):null,ve={frameIdentifier:$,lensIdentifier:Se,orbitalIdentifier:ue};t.emitEvent("onAddToCart",ve);const De=new Date().getTime(),Be=[];if(Se&&ht){const it={id:Se,quantity:1,properties:{_uniqueTimestamp:De}};Be.push(it)}if(ue&&(H!=null&&H.variantId)){const it={id:ue,quantity:1,properties:{_uniqueTimestamp:De}};Be.push(it)}if(G){const it={id:44745490890985,quantity:1,properties:{_uniqueTimestamp:De}};Be.push(it)}if(he){const it={id:$,quantity:1,properties:G?{_uniqueTimestamp:De,customText:pe}:{_uniqueTimestamp:De}};Be.push(it)}n.HandleShopifyAddToCart(Be,De)},nt=()=>{var he,Oe;a0?(he=document.querySelector(".popover.hidden-lap-and-up.popover-full"))==null||he.removeAttribute("open"):(Oe=document.querySelector(".drawer.drawer--full.hidden-phone.lens-customizer"))==null||Oe.removeAttribute("open")};Ue.useEffect(()=>{J(a0?P?35:30:P?28:25)},[P]),Ue.useEffect(()=>{i&&(l?i&&!X&&(X=i==null?void 0:i.find(he=>he.sku==="7806-G-SMK-PLD-52-Zx"),S(X)):(X=i==null?void 0:i.find(he=>he.available),S(X),te(A==null?void 0:A.find(he=>he.variantSku===X.sku))))},[i]),Ue.useEffect(()=>{if(!(!T||!s)){if(l)s&&!D&&(h0=s.find(he=>he._id==="65111d718d4c652ece493034"),Q(h0)),o&&!M&&(pt=o.find(he=>he._id==="660c1c0231c23bd36b188fd4"),k(pt));else if(!D){const he=T.customisation.find(Oe=>Oe.type==="Lens");he&&!he.sku.includes("lens-default")?e():he||console.log("no custom lens found")}}},[T,s]),Ue.useEffect(()=>{te(m)},[m]),Ue.useEffect(()=>{},[G,pe]),Ue.useEffect(()=>{Re(Le())},[j,W,_e]);const et=he=>{ut.current&&(ut.current.textContent=he)};return Te.jsxs("section",{id:"sprie-config-main-container",ref:Fe,children:[!h&&Te.jsxs("header",{id:"sprie-config-main-header",style:{height:`${q}%`},children:[Te.jsxs("div",{id:"sprie-config-header-content",children:[Te.jsx("img",{src:zU,alt:"dita-logo",width:97,height:20}),Te.jsxs("p",{style:{margin:"0"},className:"sprie-config-mainHeader-frameName",children:[r," CUSTOMIZER"]})]}),Te.jsx("button",{className:"sprie-config-main-header-close",onClick:nt,"aria-label":"close frame customizer",children:Te.jsx("img",{src:HU,alt:"close",style:{width:"2rem",height:"2rem"}})})]}),Te.jsx("span",{className:"sprie-config-sr-only",ref:ut,"aria-live":"assertive"}),Te.jsxs("section",{tabIndex:0,"aria-label":"3D viewer",onFocus:()=>et(Br.EnteredViewer),id:"sprie-config-viewer-container",style:{height:`${h?100:100-(z+q+(a0?8.5:0))}%`},children:[!h&&Te.jsx("img",{src:GU,alt:"360deg-logo",width:44,height:34}),!h&&Te.jsx(VU,{snapCameraTo:At}),Te.jsx("div",{style:{width:"100%",height:"100%"},id:"holder-canvas"}),E&&Te.jsx("div",{className:"sprie-config-loadingFrame sprie-config-loadingFrame--viewerOverlay",children:Te.jsx("div",{className:"sprie-config-loader"})})]}),!h&&Te.jsxs("section",{id:"Sprie-config-Cust-block",style:{height:`${z}%`},children:[Te.jsxs(OU,{setShowAddToCart:F,setSelectedChild:x,setSectionEntered:B,children:[Te.jsx(NU,{modelLoading:E,frameList:i,selectedFrame:T,isSelected:C===0,onChangeFrame:Ye,heading:"SELECT FRAME COLOR",paletteEntered:w===0}),l&&Te.jsx(QU,{orbitalList:o,selectedOrbital:M,modelLoading:E,isSelected:C===1,onChangeOrbital:k,heading:"SELECT ORBITAL COLOR",paletteEntered:w===1}),Te.jsx(PU,{modelLoading:E,lensList:s,selectedLens:Ge,selectedDitaLens:W??_e,isSelected:C===(l?2:1),paletteEntered:w===(l?2:1),onChangeLens:Q,heading:"SELECT LENS COLOR"}),Te.jsx(UU,{heading:"LASER ENGRAVING",isSelected:C===(l?3:2),paletteEntered:w===(l?3:2),onEngravingLinkClicked:we,onChecked:Ve,onTextAdded:gt})]}),Te.jsxs("div",{className:"sprie-config-price-block",children:[Te.jsx("p",{id:"sprie-config-price-text",style:{bottom:a0?"100%":"",margin:"0 0.8rem 0.5rem 0"},children:`${ge}.00 ${j==null?void 0:j.priceCurrency} `}),!a0&&P&&Te.jsx(ov,{conditionRequired:!0,onButtonClick:Pe}),P&&Te.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."})]}),a0&&P&&Te.jsx("div",{style:{position:"absolute",bottom:"0%",width:"100%"},children:Te.jsx(ov,{conditionRequired:!0,onButtonClick:Pe})})]})]})}function WU({apiService:r,sku:e,events:t,viewerOnly:n=!1,lensSku:i,appControlService:s,apiKey:o}){var te;const l=Ue.useRef(),[h,u]=Ue.useState(null),[d,A]=Ue.useState(!1),p=(h==null?void 0:h.frameName)||"",g=(h==null?void 0:h.frameList)||null,m=(h==null?void 0:h.lensList)||null,E=(h==null?void 0:h.orbitalList)||null,[_,v]=Ue.useState(!1),[C,x]=Ue.useState(ls.Customizer),[w,B]=Ue.useState(void 0),[T,S]=Ue.useState(void 0),[D,R]=Ue.useState(void 0),M=Ue.useRef(void 0),L=Ue.useRef(void 0);Ue.useEffect(()=>{M.current=D},[D]),Ue.useEffect(()=>{L.current=T},[T]);const P=!0,F=async()=>{var U,H;l.current||(l.current=new av,await((U=l.current)==null?void 0:U.Init(o)));const W=await((H=l.current)==null?void 0:H.getInstance({containerId:"holder-canvas"}));B(W)},z=async(W,U)=>{var H,Z;if(w){A(!0),await new Promise(G=>requestAnimationFrame(()=>G()));try{if(_)await w.changeFrame(W,W==null?void 0:W.customisation);else{await w.loadFrame({containerId:"holder-canvas",data:{assetDetails:W,customisation:W==null?void 0:W.customisation,viewerOnly:U}}),v(!0);const G=((H=W.variants)==null?void 0:H.find(oe=>oe.sku===W.sku))??((Z=W.variants)==null?void 0:Z[0]);G&&R(G)}}finally{await new Promise(G=>requestAnimationFrame(()=>requestAnimationFrame(()=>G()))),A(!1)}}},J=async(W,U)=>{var pe,Ae;const H=(pe=M.current)==null?void 0:pe.sku,Z=(Ae=L.current)==null?void 0:Ae.sku,G=!!(W&&W!==H),oe=!!(U&&U!==Z);if(!(!G&&!oe)){A(!0),await new Promise(ge=>requestAnimationFrame(()=>ge()));try{if(G){const ge=oe?m==null?void 0:m.find(Re=>U.includes(Re.sku)):void 0;await ne(W,ge)}else await q(U)}finally{await new Promise(ge=>requestAnimationFrame(()=>requestAnimationFrame(()=>ge()))),A(!1)}}},q=async W=>{if(!w)return;const U=m==null?void 0:m.find(Z=>W.includes(Z.sku)||Z.sku===W);if(!U){console.log("Lens not found in Sprie Catalogue : ",W);return}const H=M.current??(g==null?void 0:g[0]);await w.changeLens([U,void 0],!1,H),S(U),L.current=U},ne=async(W,U)=>{if(!w)return;const H=g==null?void 0:g.find(Z=>W.includes(Z.sku));if(!H){console.log("Frame variant not found in Sprie Catalogue : ",W);return}await w.changeFrame(H,[U||L.current,void 0]),R(H),M.current=H,U&&(S(U),L.current=U)},j=()=>{if(!m||C!==ls.Lancier||!m.some(U=>U.sku.includes("lens-default")))return;const W=m.filter(U=>!U.sku.includes("lens-default"));u({...h,lensList:W})};return Ue.useEffect(()=>(s.registerChangeRxConfiguration((W,U)=>J(W,U)),()=>s.reset()),[s,w,m,g]),Ue.useEffect(()=>((async()=>await F())(),()=>{l.current=void 0}),[r,e]),Ue.useEffect(()=>((async()=>{var Z,G;if(!w)return;e.includes("7806")&&e.endsWith("x")&&(e="7806-G-SMK-PLD-52-Zx");const W=await r.FetchAssetBySKUOrBarcode({sku:e,barcode:null}),U=((Z=W==null?void 0:W.customisation)==null?void 0:Z.filter(oe=>oe.type==="Orbital").length)>0,H=W!=null&&W.group.name.toLowerCase().includes("lsa")?ls.Lancier:i?ls.RxViewer:ls.Customizer;if(x(H),n)if(i){const oe=await r.FetchCustomisationList("Lens",!U,H),pe=(G=oe==null?void 0:oe.data)==null?void 0:G.find(Fe=>i.includes(Fe.sku)),Ae=[...(W==null?void 0:W.customisation)??[]],ge=Ae.findIndex(Fe=>Fe.type==="Lens");ge!==-1?Ae[ge]=pe:Ae.push(pe);const Re={...W,customisation:Ae};await z(Re,n),S(pe),u({frameList:W==null?void 0:W.variants,lensList:oe==null?void 0:oe.data,orbitalList:null,frameName:W==null?void 0:W.group.name,showOrbitals:!1,domService:w,dataVariants:null,dataLenses:null,dataOrbitals:null})}else await z(W,n),u({frameList:W==null?void 0:W.variants,lensList:null,orbitalList:null,frameName:W==null?void 0:W.group.name,showOrbitals:!1,domService:w,dataVariants:null,dataLenses:null,dataOrbitals:null});else{const oe=await r.FetchCustomisationList("Lens",!U,H),pe=await r.FetchCustomisationList("Orbital",!U,H);let Ae=await r.PopulateDataList("data-variants");Ae==null||Ae.forEach(Re=>{var st;let Fe=(st=W==null?void 0:W.variants)==null?void 0:st.find(ut=>ut.sku===Re.variantSku);Fe?Fe.available=Re.available:Re.available=P});let ge=W==null?void 0:W.variants;ge==null||ge.forEach(Re=>{(Ae==null?void 0:Ae.find(st=>st.variantSku===Re.sku))||(Re.available=P)}),await z(W,n),u({frameList:W==null?void 0:W.variants,lensList:oe==null?void 0:oe.data,orbitalList:pe==null?void 0:pe.data,frameName:W==null?void 0:W.group.name,showOrbitals:U,domService:w,dataVariants:Ae,dataLenses:await r.PopulateDataList("data-lenses"),dataOrbitals:await r.PopulateDataList("data-orbital")})}})(),()=>{l.current=void 0}),[w]),Te.jsxs(Te.Fragment,{children:[!n&&(!g||!m)&&Te.jsxs("div",{children:[Te.jsx("span",{id:"sprie-config-loader-srtext",className:"sprie-config-sr-only",children:"Loading frame customiser"}),Te.jsx("div",{className:"sprie-config-loadingBox","aria-labelledby":"sprie-config-loader-srtext",children:"Loading..."})]}),Te.jsx(jU,{customEvent:t,frameName:p,apiService:r,frameList:g,lensList:m,orbitalList:E,showOrbitalList:(h==null?void 0:h.showOrbitals)||!1,viewerOnly:n,ThreeDConfigurator:l.current,domService:h==null?void 0:h.domService,dataVariants:h==null?void 0:h.dataVariants,dataLenses:h==null?void 0:h.dataLenses,dataOrbitals:h==null?void 0:h.dataOrbitals,firstDitaVariant:(te=h==null?void 0:h.dataVariants)==null?void 0:te.find(W=>W.variantSku==e),removeDefaultLensFromLensList:j,modelLoading:d,setModelLoading:A,currentProject:C})]})}var Wh={},lv={exports:{}},Vr={},Yh={exports:{}},qh={};/**
4701
+ Press enter to `+(l?"configure your optional custom engraving. Add to cart button is now present at the end of this section.":"select or press tab for next.")}),Te.jsxs("div",{tabIndex:0,style:{height:"30%",alignContent:"center"},"aria-labelledby":"sprie-config-step-selector",onKeyDown:p,ref:h,children:[Te.jsx(FU,{nextSlide:A,previousSlide:d,currentIndex:i,stepsName:u,isLastStep:l}),Te.jsx(kU,{totalSteps:u==null?void 0:u.length,currentStep:i+1})]}),Te.jsx("div",{className:"carousel-container",style:{paddingTop:a0?"":"1rem"},children:o.map((m,E)=>Te.jsx("div",{className:"carousel-item",style:{transform:`translateX(-${i*100}%)`},children:m},E))})]})}const nO="";function ov({conditionRequired:r,onButtonClick:e}){const[t,n]=ke.useState(!1),i=ke.useRef(null),s=ke.useRef(null);return ke.useEffect(()=>{s.current&&(s.current.disabled=!t)},[t]),ke.useEffect(()=>{i.current&&(i.current.style.display=r?"flex":"none"),s.current&&(s.current.disabled=r)},[r]),Te.jsxs("div",{className:"sprie-config-add-to-cart-block",children:[Te.jsxs("label",{htmlFor:"Sprie-Config-return-policy-checkbox",id:"Sprie-Config-return-policy-label",ref:i,style:{display:"none"},children:[Te.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}),Te.jsx("p",{id:"sprie-config-return-policy-desc",children:"I agree this customized Item cannot be returned or exchanged."})]}),Te.jsx("button",{className:"sprie-config-add-to-cart-btn",ref:s,onClick:e,children:"ADD TO CART"})]})}function QU({orbitalList:r,selectedOrbital:e,modelLoading:t,isSelected:n,paletteEntered:i,onChangeOrbital:s}){const o=ke.useRef(null),l=ke.useRef(null),h=()=>{o.current&&(o.current.textContent=Br.EnteredOrbitalsListSection)};return ke.useEffect(()=>{i&&l.current&&l.current.querySelectorAll(".sprie-config-palette-img-box")[0].firstChild.focus()},[i]),Te.jsxs("div",{className:"sprie-config-palette",ref:l,style:{display:n?"flex":"none",padding:"0 3rem",gap:a0?"3rem":"5rem"},children:[Te.jsx("span",{className:"sprie-config-sr-only","aria-live":"assertive",ref:o}),r==null?void 0:r.map(u=>Te.jsxs("div",{className:"sprie-config-palette-img-box",children:[Te.jsx("button",{"aria-labelledby":(e==null?void 0:e._id)===u._id?"sprie-config-orbitalName":"",style:{border:"0",cursor:t?"default":"pointer",width:a0?45:60,height:a0?45:60},onClick:()=>s(u),onFocus:h,disabled:t,children:Te.jsx("img",{"aria-label":`Select orbital ${u.name}`,src:u.thumbnail,alt:u.name+"image",className:`sprie-config-image ${a0?"mobile-view":""}`,style:{border:(e==null?void 0:e._id)===u._id?"2px solid #9d9b9c":"0",borderRadius:"50%",padding:"1px"}})}),Te.jsxs("p",{className:"sprie-config-palette-img-text",style:{bottom:"-1.5rem"},children:[Te.jsx("span",{className:"sprie-config-palette-imgName",children:u.name}),Te.jsx("span",{id:"sprie-config-orbitalName",className:"sprie-config-sr-only",children:`Selected orbital ${u.name}`})]})]},u._id))]})}const zU="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/Pgo8IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDIwMDEwOTA0Ly9FTiIKICJodHRwOi8vd3d3LnczLm9yZy9UUi8yMDAxL1JFQy1TVkctMjAwMTA5MDQvRFREL3N2ZzEwLmR0ZCI+CjxzdmcgdmVyc2lvbj0iMS4wIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiB3aWR0aD0iMzIwLjAwMDAwMHB0IiBoZWlnaHQ9IjY2LjAwMDAwMHB0IiB2aWV3Qm94PSIwIDAgMzIwLjAwMDAwMCA2Ni4wMDAwMDAiCiBwcmVzZXJ2ZUFzcGVjdFJhdGlvPSJ4TWlkWU1pZCBtZWV0Ij4KCjxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAuMDAwMDAwLDY2LjAwMDAwMCkgc2NhbGUoMC4xMDAwMDAsLTAuMTAwMDAwKSIKZmlsbD0iIzAwMDAwMCIgc3Ryb2tlPSJub25lIj4KPHBhdGggZD0iTTAgNjUxIGMwIC02IDkgLTExIDIxIC0xMSAxMSAwIDI5IC01IDQwIC0xMCAxOCAtMTAgMTkgLTI0IDE5IC0zMDAKMCAtMjc2IC0xIC0yOTAgLTE5IC0zMDAgLTExIC01IC0yOSAtMTAgLTQwIC0xMCAtMTIgMCAtMjEgLTQgLTIxIC0xMCAwIC0xNAo0NDUgLTEzIDUxMiAxIDEwNyAyMyAxOTAgODUgMjM5IDE3OSAyMCAzNyAyNCA2MCAyNCAxMzUgMCA3OCAtNCA5NyAtMjggMTQ3Ci0zNCA3MCAtMTAwIDEzMCAtMTc2IDE2MCAtNTIgMjEgLTc1IDIzIC0zMTMgMjYgLTE4MCAyIC0yNTggMCAtMjU4IC03eiBtNDcwCi0zNiBjMTUgLTggMzggLTI3IDQ5IC00MSAyMCAtMjUgMjEgLTM5IDIxIC0yMzggMCAtMTk0IC0yIC0yMTQgLTIwIC0yNDQgLTExCi0xOCAtMzYgLTQwIC01NSAtNDggLTQ2IC0xOSAtMTM1IC0xOCAtMTYzIDIgLTIyIDE1IC0yMiAxNyAtMjIgMzAwIGwwIDI4NCA4MAowIGM1MiAwIDkxIC01IDExMCAtMTV6Ii8+CjxwYXRoIGQ9Ik05ODAgNjUwIGMwIC01IDExIC0xMCAyNCAtMTAgNTUgMCA1NiAtNyA1NiAtMzEwIDAgLTMwMyAtMSAtMzEwIC01NgotMzEwIC0xMyAwIC0yNCAtNCAtMjQgLTEwIDAgLTYgNjcgLTEwIDE4MCAtMTAgMTEzIDAgMTgwIDQgMTgwIDEwIDAgNiAtMTEgMTAKLTIzIDEwIC0xMyAwIC0zMSA4IC00MCAxOCAtMTUgMTYgLTE3IDUyIC0xNyAyOTQgMCAyNTQgMSAyNzYgMTggMjkxIDEwIDEwIDI4CjE3IDQwIDE3IDEyIDAgMjIgNSAyMiAxMCAwIDYgLTY3IDEwIC0xODAgMTAgLTExMyAwIC0xODAgLTQgLTE4MCAtMTB6Ii8+CjxwYXRoIGQ9Ik0xNTI2IDYwMSBjLTI1IC0zMyAtNDYgLTY0IC00NiAtNzAgMCAtNiAyNCA1IDU0IDI0IDUzIDM0IDE1OSA3NQoxOTQgNzUgMTAgMCAyOCAtMTAgNDAgLTIzIDIxIC0yMyAyMiAtMzAgMjIgLTI4OSAwIC0yODkgLTIgLTI5OCAtNTYgLTI5OCAtMTMKMCAtMjQgLTQgLTI0IC0xMCAwIC02IDY3IC0xMCAxODAgLTEwIDExMyAwIDE4MCA0IDE4MCAxMCAwIDYgLTExIDEwIC0yNCAxMAotNTQgMCAtNTYgOSAtNTYgMjk0IDAgMjUxIDEgMjY1IDIxIDI5MCAxMSAxNCAzMCAyNiA0MiAyNiAzNyAtMSAxNTMgLTQ2IDIwMQotNzggMjUgLTE3IDQ2IC0yNyA0NiAtMjEgMCA2IC0yMSAzNyAtNDYgNzAgbC00NyA1OSAtMzE3IDAgLTMxNyAwIC00NyAtNTl6Ii8+CjxwYXRoIGQ9Ik0yNDU1IDY1MCBjMyAtNSAxNSAtMTAgMjYgLTEwIDMwIDAgNjUgLTI3IDk3IC03NiBsMjkgLTQzIC05MCAtMTc4CmMtMTM2IC0yNzAgLTE2MyAtMzEzIC0xOTggLTMyMCAtNTkgLTExIC0yNiAtMjMgNjYgLTIzIDg5IDAgMTIxIDExIDc1IDI1IC0yOQo5IC0yNiA1NSAxMCAxMjYgbDMxIDYwIDE1MSAtMyAxNTEgLTMgMzkgLTczIGMzMCAtNTkgMzYgLTc3IDI4IC05MyAtNiAtMTAKLTIwIC0xOSAtMzAgLTE5IC0xMSAwIC0yMCAtNCAtMjAgLTEwIDAgLTYgNzAgLTEwIDE5MCAtMTAgMTIwIDAgMTkwIDQgMTkwIDEwCjAgNiAtMTEgMTAgLTI0IDEwIC0xNCAwIC0zNiAxMCAtNTAgMjMgLTE1IDEyIC0xMDYgMTU1IC0yMDQgMzE3IGwtMTc3IDI5NQotMTQ4IDMgYy0xMDAgMiAtMTQ2IC0xIC0xNDIgLTh6IG0yNTggLTM5OCBjLTM1IC0yIC05MiAtMiAtMTI3IDAgbC02NCAzIDYwCjExMyA2MCAxMTMgNjcgLTExMyA2NyAtMTEzIC02MyAtM3oiLz4KPC9nPgo8L3N2Zz4K",GU="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI4LjMuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCA4ODYgNjk4IiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA4ODYgNjk4OyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+Cgkuc3Qwe2ZpbGw6IzkxODQ3RTt9Cjwvc3R5bGU+CjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik04NDAuMDEsNDEuMDFjLTM2LjcxLTMxLjU2LTEwOC45NC01Ny45Ny0yNDQuNi00LjU2Yy0yMC40Nyw4LjA2LTQxLjQ2LDE3LjU3LTYyLjc1LDI4LjM2CgljMTkuMzgtNC42Niw0MzEuNTItMTAxLDE3NS42MSwxOTkuNDJsLTAuMDQsMGMtMjUuODUsMzUuNS01Ny44Miw3Mi4wOC05NC40MiwxMDcuOTdsLTMyLjcyLTI4LjE0bC02LjQ0LDE0MS43NmwxNjQuODQtNS41NwoJbC00NC4zNC0zOC4xMmM2NS41NC02My43NCwxMTcuODUtMTI5Ljk0LDE1MC4yMi0xOTAuNzdDOTA3LjQ0LDEzNC42OSw4NzYuNzEsNzIuNTcsODQwLjAxLDQxLjAxeiIvPgo8cGF0aCBjbGFzcz0ic3QwIiBkPSJNNTYyLjE3LDQyNS42N2MtNjQuNDcsNDYuMi0xMzIuNjcsODYuMjItMTk4LjQzLDExNi43NmMtMC4wOSwwLjA0LTAuMTcsMC4wOC0wLjI1LDAuMTMKCUMtMTkuMjcsNzMwLjcyLDczLjg2LDQ0MS4xMyw4OC4wNyw0MDEuNDVsLTIuMDktMS41MWMtMTQuNjcsMTcuOTMtMjcuNiwzNS42MS0zOC41Myw1Mi44NEMtMjQuNCw1NjYsMTEuMTYsNjI2LjI3LDUzLjY0LDY1Ni44OQoJYzQyLjQ4LDMwLjYzLDEyNi4wNyw1Ni4yNSwyODMuMDUsNC40M2M5OS0zMi42OSwyMDguNTgtODkuNywzMTAuMDYtMTYxLjE5bC04My43Ny0wLjQ2TDU2Mi4xNyw0MjUuNjd6Ii8+CjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik0yMTIuOSwxOTcuNzRjMCwzNS41NC0yNS43Myw1Mi44MS00MS45OCw1Mi44MXYxLjAxYzIwLjY1LDAsNDYuMzcsMTUuOTEsNDYuMzcsNTEuNDUKCWMwLDM3LjkxLTM0LjE5LDYzLjk4LTgzLjYxLDYzLjk4Yy00My42NywwLTcxLjA5LTE3LjI3LTgzLjk1LTU0Ljg0bDQyLjMxLTE4Ljk2YzQuNzQsMjQuMzcsMTcuMjYsMzYuMjIsNDEuOTgsMzYuMjIKCWMyMy43LDAsMzcuOTEtMTIuODcsMzcuNTctMzIuNWMtMC4zNC0yMC45OS0xMy4yLTI4Ljc4LTM5Ljk0LTI4Ljc4aC0xMS4xN3YtMzIuNWg5LjQ4YzI0LjM3LDAsMzYuNTYtOS44MiwzNi41Ni0yOS43OQoJYzAuMzQtMjAuNjUtMTEuNTEtMzEuNDgtMzEuODItMzEuNDhjLTIwLjY1LDAtMzMuODUsMTAuODMtMzYuOSwzMS44MmwtNDEuNjQtMTUuMjNjOC44LTM2LjksNDAuNjItNTQuMTYsODAuNTYtNTQuMTYKCUMxODUuODIsMTM2LjgxLDIxMi45LDE2Mi41NCwyMTIuOSwxOTcuNzR6Ii8+CjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik0zOTYuOTgsMTg1LjU2bC0zOS4yNywxOC4yOGMtNS40Mi0xNy42LTE3LjI2LTI4LjQzLTM4LjkzLTI4LjQzYy0yOC43OCwwLTQ5LjA4LDMwLjgtNDkuMDgsNzYuMTZ2NS43NmgxLjAxCgljNy40NS0yMy4wMiwzMS4xNC0zMy41MSw1Ni44Ny0zMy41MWM0Mi45OSwwLDczLjEyLDI3LjQyLDczLjEyLDcwLjQxYzAsNDQuMzQtMzAuOCw3Mi43OC04Mi42LDcyLjc4CgljLTU4LjIzLDAtOTAuMzgtNDIuOTktOTAuMzgtMTE1LjA5YzAtNzcuNTIsNDAuNjItMTE1LjA5LDk0LjExLTExNS4wOUMzNTcuNzEsMTM2LjgxLDM4NC4xMiwxNTAuMzUsMzk2Ljk4LDE4NS41NnogTTI4MC41MywyOTMuNTQKCWMwLDIyLjM0LDE1LjIzLDM2LjIyLDM4LjI1LDM2LjIyYzI0LjAzLDAsMzcuOTEtMTMuMiwzNy45MS0zNi4yMmMwLTIyLTEzLjg4LTM1LjU0LTM3LjkxLTM1LjU0CglDMjk1Ljc2LDI1OCwyODAuNTMsMjcyLjIyLDI4MC41MywyOTMuNTR6Ii8+CjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik00MTQuNzgsMjUxLjkxYzAtNzUuNDksMzAuMTMtMTE1LjA5LDg5LjM3LTExNS4wOXM4OS4zNywzOS42LDg5LjM3LDExNS4wOVM1NjMuMzgsMzY3LDUwNC4xNSwzNjcKCVM0MTQuNzgsMzI3LjM5LDQxNC43OCwyNTEuOTF6IE01NDYuOCwyNTEuOTFjMC01My4xNS0xMy44OC03Ny41Mi00Mi42NS03Ny41MmMtMjguNzcsMC00Mi42NSwyNC4zNy00Mi42NSw3Ny41MgoJYzAsNTMuMTUsMTMuODgsNzcuNTIsNDIuNjUsNzcuNTJDNTMyLjkyLDMyOS40Myw1NDYuOCwzMDUuMDUsNTQ2LjgsMjUxLjkxeiIvPgo8cGF0aCBjbGFzcz0ic3QwIiBkPSJNNTg4LjIsMTI4LjEzYzAtMTguNjMsMTMuNzgtMzIuMDIsMzIuOTktMzIuMDJjMTkuMjEsMCwzMi45OSwxMy4zOSwzMi45OSwzMi4wMnMtMTMuNzgsMzIuMDItMzIuOTksMzIuMDIKCUM2MDEuOTcsMTYwLjE0LDU4OC4yLDE0Ni43Niw1ODguMiwxMjguMTN6IE02NDAuNTksMTI4LjEzYzAtMTEuMjUtOC4xNS0xOS40LTE5LjQtMTkuNHMtMTkuNCw4LjE1LTE5LjQsMTkuNHM4LjE1LDE5LjQsMTkuNCwxOS40CglTNjQwLjU5LDEzOS4zOCw2NDAuNTksMTI4LjEzeiIvPgo8L3N2Zz4K",HU="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciICB2aWV3Qm94PSIwIDAgNjQgNjQiIHdpZHRoPSI0OHB4IiBoZWlnaHQ9IjQ4cHgiPjxwYXRoIGQ9Ik0gMTYgMTQgQyAxNS40ODggMTQgMTQuOTc2OTM4IDE0LjE5NDkzNyAxNC41ODU5MzggMTQuNTg1OTM4IEMgMTMuODA0OTM3IDE1LjM2NjkzNyAxMy44MDQ5MzcgMTYuNjMzMDYzIDE0LjU4NTkzOCAxNy40MTQwNjIgTCAyOS4xNzE4NzUgMzIgTCAxNC41ODU5MzggNDYuNTg1OTM4IEMgMTMuODA0OTM4IDQ3LjM2NjkzOCAxMy44MDQ5MzcgNDguNjMzMDYzIDE0LjU4NTkzOCA0OS40MTQwNjIgQyAxNC45NzY5MzcgNDkuODA1MDYyIDE1LjQ4OCA1MCAxNiA1MCBDIDE2LjUxMiA1MCAxNy4wMjMwNjIgNDkuODA1MDYyIDE3LjQxNDA2MiA0OS40MTQwNjIgTCAzMiAzNC44MjgxMjUgTCA0Ni41ODU5MzggNDkuNDE0MDYyIEMgNDcuMzY2OTM4IDUwLjE5NTA2MyA0OC42MzMwNjMgNTAuMTk1MDYyIDQ5LjQxNDA2MiA0OS40MTQwNjIgQyA1MC4xOTUwNjMgNDguNjMzMDYyIDUwLjE5NTA2MiA0Ny4zNjY5MzcgNDkuNDE0MDYyIDQ2LjU4NTkzOCBMIDM0LjgyODEyNSAzMiBMIDQ5LjQxNDA2MiAxNy40MTQwNjIgQyA1MC4xOTUwNjMgMTYuNjMzMDYzIDUwLjE5NTA2MiAxNS4zNjY5MzggNDkuNDE0MDYyIDE0LjU4NTkzOCBDIDQ4LjYzMzA2MiAxMy44MDQ5MzggNDcuMzY2OTM3IDEzLjgwNDkzOCA0Ni41ODU5MzggMTQuNTg1OTM4IEwgMzIgMjkuMTcxODc1IEwgMTcuNDE0MDYyIDE0LjU4NTkzOCBDIDE3LjAyMzA2MiAxNC4xOTQ5MzggMTYuNTEyIDE0IDE2IDE0IHoiLz48L3N2Zz4=",iO="";function VU({snapCameraTo:r}){const e=Object.keys(Wc).map(s=>({label:Wc[s],isDisabled:!0})),[t,n]=ke.useState(),i=s=>{n(s),r(s)};return Te.jsx("div",{className:"sprie-3d-snap-button-block",children:e.map((s,o)=>Te.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(Wc[s.label])},children:s.label},o))})}function jU({frameName:r,removeDefaultLensFromLensList:e,customEvent:t,apiService:n,frameList:i,lensList:s,orbitalList:o,showOrbitalList:l,viewerOnly:h,domService:u,ThreeDConfigurator:d,dataVariants:A,dataLenses:p,dataOrbitals:g,firstDitaVariant:m,modelLoading:E,setModelLoading:_,currentProject:v=ls.Customizer}){const[C,x]=ke.useState(0),[w,B]=ke.useState(),[T,S]=ke.useState(),[D,R]=ke.useState(),[M,L]=ke.useState(),[P,F]=ke.useState(!1);ke.useState(!1),ke.useState(!1);const[z,J]=ke.useState(a0?P?35:30:P?28:25),[q,ne]=ke.useState(a0?10:8),[j,te]=ke.useState(),[W,U]=ke.useState(),[H,Z]=ke.useState(),[G,oe]=ke.useState(!1),[pe,Ae]=ke.useState("placeholder"),[ge,Re]=ke.useState(0),Oe=ke.useRef(null),st=ke.useRef(),ut=ke.useRef(null);st.current=u;const mt={variantId:0,variantName:"defaultName",variantPrice:0,priceCurrency:"defaultCurrency",variantSku:"lens-default",polarized:"No",available:!0};let X,h0,pt;const At=he=>{st.current&&(st.current.snapCameraToPos(he),et(Br[`ChangedView${he}`]))},qe=he=>he==null?void 0:he.customisation.find(Fe=>Fe.type==="Lens"),Mt=(he,Pe)=>{var Se,ue;if(!Pe)return;if(he.sku.includes("lens-default"))return mt;const Fe=(Se=Pe.metadata.find(ve=>ve.key==="baseCurve"))==null?void 0:Se.value;let ht="variantId";Fe==="2B"?ht="2bVariantId":Fe==="6B"&&(ht="6bVariantId");const $=(ue=he.metadata.find(ve=>ve.key===ht))==null?void 0:ue.value;return $?p==null?void 0:p.find(ve=>ve.variantId===Number.parseInt($,10)):p==null?void 0:p.find(ve=>ve.variantSku===he.sku)},Ye=async(he,Pe)=>{if(he._id===(T==null?void 0:T._id)&&!Pe||!st.current)return;const Fe=qe(he)??(s==null?void 0:s[0]),ht=v===ls.Lancier,$=he._id!==(T==null?void 0:T._id);let Se;if(ht&&$&&Fe){const ue=(s==null?void 0:s.find(ve=>ve.sku===Fe.sku||ve._id===Fe._id))??Fe;Se=ue,R(ue),U(Mt(ue,he))}else Se=D??Fe;_(!0),st.current.changeFrame(he,[Se,M]).then(()=>{_(!1)}),S(he),te(A==null?void 0:A.find(ue=>ue.variantSku===he.sku)),et(`${Br.ChangedFrame}${he.name}`)},Q=async he=>{var ue;if(!st.current||he===D)return;const Pe=he.sku.includes("lens-default"),Fe=qe(T),ht=D??Fe,$=!ht||ht.sku.includes("lens-default"),Se=se();if(!Fe&&Pe?(_(!0),st.current.changeLens([he,M],!0,T).then(()=>{_(!1)})):!Fe&&!Pe?$?(_(!0),st.current.changeLens([he,M],!0,T).then(()=>{_(!1)})):st.current.changeLens([he,M],!1,T):Fe&&Pe?st.current.changeLens([Fe,M],!1,T):$?(_(!0),st.current.changeLens([he,M],!0,T).then(()=>{_(!1)})):st.current.changeLens([he,M],!1,T),he.sku.includes("lens-default"))U(mt),et(`${Br.ChangedLens}${mt.variantName}`);else{const ve=(ue=he.metadata.find(Be=>Be.key===Se))==null?void 0:ue.value,De=p==null?void 0:p.find(Be=>Be.variantId===Number.parseInt(ve));U(De),et(`${Br.ChangedLens}${he.name}. Price will increase by ${W==null?void 0:W.variantPrice} ${W==null?void 0:W.priceCurrency}`)}R(he)},k=async he=>{st.current&&he!==M&&(_(!0),await st.current.changeOrbital(he).then(()=>{Z(g==null?void 0:g.find(Pe=>Pe.variantSku===he.sku)),_(!1)}),L(he),et(`${Br.ChangedOrbital}${he.name}`))},se=()=>{var Fe;if(!T)return;const he=(Fe=T.metadata.find(ht=>ht.key==="baseCurve"))==null?void 0:Fe.value;let Pe="variantId";return he==="2B"?Pe="2bVariantId":he==="6B"&&(Pe="6bVariantId"),Pe},ye=T?qe(T):void 0,Ee=!l&&!D&&ye&&s?s.find(he=>he.sku===ye.sku||he._id===ye._id):void 0,_e=ke.useMemo(()=>{if(D)return;const he=Ee;if(!(!he||!T))return Mt(he,T)},[D,Ee,T,p]),Ge=D??Ee,Le=()=>{let he=0,Pe=0;j&&(he=j.variantPrice);const Fe=W??_e;return Fe&&(Pe=Fe.variantPrice),he+Pe},Ve=he=>{oe(he)},gt=he=>{Ae(he)},we=()=>{var he,Pe;a0?(he=document.querySelector('[id$="main-laser-etch-popover"]'))==null||he.setAttribute("open",""):(Pe=document.querySelector('[id$="main-laser-etch-drawer"]'))==null||Pe.setAttribute("open","")},Ue=()=>{if(l&&!H||!(T&&Ge)||T.name.toLowerCase().includes("default")||Ge.name.toLowerCase().includes("default"))return;const he=T.metadata.find(it=>it.key==="variantId"),Pe=T.metadata.find(it=>it.key==="baseCurve");let Fe="variantId";Pe&&Pe.value==="2B"?Fe="2bVariantId":Pe&&Pe.value==="6B"&&(Fe="6bVariantId");const ht=Ge.metadata.find(it=>it.key===Fe),$=he?Number(he.value):null,Se=ht?Number(ht.value):null,ue=H!=null&&H.variantId?Number(H.variantId):null,ve={frameIdentifier:$,lensIdentifier:Se,orbitalIdentifier:ue};t.emitEvent("onAddToCart",ve);const De=new Date().getTime(),Be=[];if(Se&&ht){const it={id:Se,quantity:1,properties:{_uniqueTimestamp:De}};Be.push(it)}if(ue&&(H!=null&&H.variantId)){const it={id:ue,quantity:1,properties:{_uniqueTimestamp:De}};Be.push(it)}if(G){const it={id:44745490890985,quantity:1,properties:{_uniqueTimestamp:De}};Be.push(it)}if(he){const it={id:$,quantity:1,properties:G?{_uniqueTimestamp:De,customText:pe}:{_uniqueTimestamp:De}};Be.push(it)}n.HandleShopifyAddToCart(Be,De)},nt=()=>{var he,Pe;a0?(he=document.querySelector(".popover.hidden-lap-and-up.popover-full"))==null||he.removeAttribute("open"):(Pe=document.querySelector(".drawer.drawer--full.hidden-phone.lens-customizer"))==null||Pe.removeAttribute("open")};ke.useEffect(()=>{J(a0?P?35:30:P?28:25)},[P]),ke.useEffect(()=>{i&&(l?i&&!X&&(X=i==null?void 0:i.find(he=>he.sku==="7806-G-SMK-PLD-52-Zx"),S(X)):(X=i==null?void 0:i.find(he=>he.available),S(X),te(A==null?void 0:A.find(he=>he.variantSku===X.sku))))},[i]),ke.useEffect(()=>{if(!(!T||!s)){if(l)s&&!D&&(h0=s.find(he=>he._id==="65111d718d4c652ece493034"),Q(h0)),o&&!M&&(pt=o.find(he=>he._id==="660c1c0231c23bd36b188fd4"),k(pt));else if(!D){const he=T.customisation.find(Pe=>Pe.type==="Lens");he&&!he.sku.includes("lens-default")?e():he||(R(s.find(Pe=>Pe.sku==="lens-default")),U(p==null?void 0:p.find(Pe=>Pe.variantSku==="lens-default")))}}},[T,s]),ke.useEffect(()=>{te(m)},[m]),ke.useEffect(()=>{},[G,pe]),ke.useEffect(()=>{Re(Le())},[j,W,_e]);const et=he=>{ut.current&&(ut.current.textContent=he)};return Te.jsxs("section",{id:"sprie-config-main-container",ref:Oe,children:[!h&&Te.jsxs("header",{id:"sprie-config-main-header",style:{height:`${q}%`},children:[Te.jsxs("div",{id:"sprie-config-header-content",children:[Te.jsx("img",{src:zU,alt:"dita-logo",width:97,height:20}),Te.jsxs("p",{style:{margin:"0"},className:"sprie-config-mainHeader-frameName",children:[r," CUSTOMIZER"]})]}),Te.jsx("button",{className:"sprie-config-main-header-close",onClick:nt,"aria-label":"close frame customizer",children:Te.jsx("img",{src:HU,alt:"close",style:{width:"2rem",height:"2rem"}})})]}),Te.jsx("span",{className:"sprie-config-sr-only",ref:ut,"aria-live":"assertive"}),Te.jsxs("section",{tabIndex:0,"aria-label":"3D viewer",onFocus:()=>et(Br.EnteredViewer),id:"sprie-config-viewer-container",style:{height:`${h?100:100-(z+q+(a0?8.5:0))}%`},children:[!h&&Te.jsx("img",{src:GU,alt:"360deg-logo",width:44,height:34}),!h&&Te.jsx(VU,{snapCameraTo:At}),Te.jsx("div",{style:{width:"100%",height:"100%"},id:"holder-canvas"}),E&&Te.jsx("div",{className:"sprie-config-loadingFrame sprie-config-loadingFrame--viewerOverlay",children:Te.jsx("div",{className:"sprie-config-loader"})})]}),!h&&Te.jsxs("section",{id:"Sprie-config-Cust-block",style:{height:`${z}%`},children:[Te.jsxs(OU,{setShowAddToCart:F,setSelectedChild:x,setSectionEntered:B,children:[Te.jsx(NU,{modelLoading:E,frameList:i,selectedFrame:T,isSelected:C===0,onChangeFrame:Ye,heading:"SELECT FRAME COLOR",paletteEntered:w===0}),l&&Te.jsx(QU,{orbitalList:o,selectedOrbital:M,modelLoading:E,isSelected:C===1,onChangeOrbital:k,heading:"SELECT ORBITAL COLOR",paletteEntered:w===1}),Te.jsx(PU,{modelLoading:E,lensList:s,selectedLens:Ge,selectedDitaLens:W??_e,isSelected:C===(l?2:1),paletteEntered:w===(l?2:1),onChangeLens:Q,heading:"SELECT LENS COLOR"}),Te.jsx(UU,{heading:"LASER ENGRAVING",isSelected:C===(l?3:2),paletteEntered:w===(l?3:2),onEngravingLinkClicked:we,onChecked:Ve,onTextAdded:gt})]}),Te.jsxs("div",{className:"sprie-config-price-block",children:[Te.jsx("p",{id:"sprie-config-price-text",style:{bottom:a0?"100%":"",margin:"0 0.8rem 0.5rem 0"},children:`${ge}.00 ${j==null?void 0:j.priceCurrency} `}),!a0&&P&&Te.jsx(ov,{conditionRequired:!0,onButtonClick:Ue}),P&&Te.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."})]}),a0&&P&&Te.jsx("div",{style:{position:"absolute",bottom:"0%",width:"100%"},children:Te.jsx(ov,{conditionRequired:!0,onButtonClick:Ue})})]})]})}function WU({apiService:r,sku:e,events:t,viewerOnly:n=!1,lensSku:i,appControlService:s,apiKey:o}){var te;const l=ke.useRef(),[h,u]=ke.useState(null),[d,A]=ke.useState(!1),p=(h==null?void 0:h.frameName)||"",g=(h==null?void 0:h.frameList)||null,m=(h==null?void 0:h.lensList)||null,E=(h==null?void 0:h.orbitalList)||null,[_,v]=ke.useState(!1),[C,x]=ke.useState(ls.Customizer),[w,B]=ke.useState(void 0),[T,S]=ke.useState(void 0),[D,R]=ke.useState(void 0),M=ke.useRef(void 0),L=ke.useRef(void 0);ke.useEffect(()=>{M.current=D},[D]),ke.useEffect(()=>{L.current=T},[T]);const P=!0,F=async()=>{var U,H;l.current||(l.current=new av,await((U=l.current)==null?void 0:U.Init(o)));const W=await((H=l.current)==null?void 0:H.getInstance({containerId:"holder-canvas"}));B(W)},z=async(W,U)=>{var H,Z;if(w){A(!0),await new Promise(G=>requestAnimationFrame(()=>G()));try{if(_)await w.changeFrame(W,W==null?void 0:W.customisation);else{await w.loadFrame({containerId:"holder-canvas",data:{assetDetails:W,customisation:W==null?void 0:W.customisation,viewerOnly:U}}),v(!0);const G=((H=W.variants)==null?void 0:H.find(oe=>oe.sku===W.sku))??((Z=W.variants)==null?void 0:Z[0]);G&&R(G)}}finally{await new Promise(G=>requestAnimationFrame(()=>requestAnimationFrame(()=>G()))),A(!1)}}},J=async(W,U)=>{var pe,Ae;const H=(pe=M.current)==null?void 0:pe.sku,Z=(Ae=L.current)==null?void 0:Ae.sku,G=!!(W&&W!==H),oe=!!(U&&U!==Z);if(!(!G&&!oe)){A(!0),await new Promise(ge=>requestAnimationFrame(()=>ge()));try{if(G){const ge=oe?m==null?void 0:m.find(Re=>U.includes(Re.sku)):void 0;await ne(W,ge)}else await q(U)}finally{await new Promise(ge=>requestAnimationFrame(()=>requestAnimationFrame(()=>ge()))),A(!1)}}},q=async W=>{if(!w)return;const U=m==null?void 0:m.find(Z=>W.includes(Z.sku)||Z.sku===W);if(!U){console.log("Lens not found in Sprie Catalogue : ",W);return}const H=M.current??(g==null?void 0:g[0]);await w.changeLens([U,void 0],!1,H),S(U),L.current=U},ne=async(W,U)=>{if(!w)return;const H=g==null?void 0:g.find(Z=>W.includes(Z.sku));if(!H){console.log("Frame variant not found in Sprie Catalogue : ",W);return}await w.changeFrame(H,[U||L.current,void 0]),R(H),M.current=H,U&&(S(U),L.current=U)},j=()=>{if(!m||C!==ls.Lancier||!m.some(U=>U.sku.includes("lens-default")))return;const W=m.filter(U=>!U.sku.includes("lens-default"));u({...h,lensList:W})};return ke.useEffect(()=>(s.registerChangeRxConfiguration((W,U)=>J(W,U)),()=>s.reset()),[s,w,m,g]),ke.useEffect(()=>((async()=>await F())(),()=>{l.current=void 0}),[r,e]),ke.useEffect(()=>((async()=>{var Z,G;if(!w)return;e.includes("7806")&&e.endsWith("x")&&(e="7806-G-SMK-PLD-52-Zx");const W=await r.FetchAssetBySKUOrBarcode({sku:e,barcode:null}),U=((Z=W==null?void 0:W.customisation)==null?void 0:Z.filter(oe=>oe.type==="Orbital").length)>0,H=W!=null&&W.group.name.toLowerCase().includes("lsa")?ls.Lancier:i?ls.RxViewer:ls.Customizer;if(x(H),n)if(i){const oe=await r.FetchCustomisationList("Lens",!U,H),pe=(G=oe==null?void 0:oe.data)==null?void 0:G.find(Oe=>i.includes(Oe.sku)),Ae=[...(W==null?void 0:W.customisation)??[]],ge=Ae.findIndex(Oe=>Oe.type==="Lens");ge!==-1?Ae[ge]=pe:Ae.push(pe);const Re={...W,customisation:Ae};await z(Re,n),S(pe),u({frameList:W==null?void 0:W.variants,lensList:oe==null?void 0:oe.data,orbitalList:null,frameName:W==null?void 0:W.group.name,showOrbitals:!1,domService:w,dataVariants:null,dataLenses:null,dataOrbitals:null})}else await z(W,n),u({frameList:W==null?void 0:W.variants,lensList:null,orbitalList:null,frameName:W==null?void 0:W.group.name,showOrbitals:!1,domService:w,dataVariants:null,dataLenses:null,dataOrbitals:null});else{const oe=await r.FetchCustomisationList("Lens",!U,H),pe=await r.FetchCustomisationList("Orbital",!U,H);let Ae=await r.PopulateDataList("data-variants");Ae==null||Ae.forEach(Re=>{var st;let Oe=(st=W==null?void 0:W.variants)==null?void 0:st.find(ut=>ut.sku===Re.variantSku);Oe?Oe.available=Re.available:Re.available=P});let ge=W==null?void 0:W.variants;ge==null||ge.forEach(Re=>{(Ae==null?void 0:Ae.find(st=>st.variantSku===Re.sku))||(Re.available=P)}),await z(W,n),u({frameList:W==null?void 0:W.variants,lensList:oe==null?void 0:oe.data,orbitalList:pe==null?void 0:pe.data,frameName:W==null?void 0:W.group.name,showOrbitals:U,domService:w,dataVariants:Ae,dataLenses:await r.PopulateDataList("data-lenses"),dataOrbitals:await r.PopulateDataList("data-orbital")})}})(),()=>{l.current=void 0}),[w]),Te.jsxs(Te.Fragment,{children:[!n&&(!g||!m)&&Te.jsxs("div",{children:[Te.jsx("span",{id:"sprie-config-loader-srtext",className:"sprie-config-sr-only",children:"Loading frame customiser"}),Te.jsx("div",{className:"sprie-config-loadingBox","aria-labelledby":"sprie-config-loader-srtext",children:"Loading..."})]}),Te.jsx(jU,{customEvent:t,frameName:p,apiService:r,frameList:g,lensList:m,orbitalList:E,showOrbitalList:(h==null?void 0:h.showOrbitals)||!1,viewerOnly:n,ThreeDConfigurator:l.current,domService:h==null?void 0:h.domService,dataVariants:h==null?void 0:h.dataVariants,dataLenses:h==null?void 0:h.dataLenses,dataOrbitals:h==null?void 0:h.dataOrbitals,firstDitaVariant:(te=h==null?void 0:h.dataVariants)==null?void 0:te.find(W=>W.variantSku==e),removeDefaultLensFromLensList:j,modelLoading:d,setModelLoading:A,currentProject:C})]})}var Wh={},lv={exports:{}},Vr={},Yh={exports:{}},qh={};/**
4702
4702
  * @license React
4703
4703
  * scheduler.production.min.js
4704
4704
  *
@@ -4714,11 +4714,11 @@ struct BVH {
4714
4714
  *
4715
4715
  * This source code is licensed under the MIT license found in the
4716
4716
  * LICENSE file in the root directory of this source tree.
4717
- */var hv;function XU(){if(hv)return Vr;hv=1;var r=Ue,e=qU();function t(a){for(var c="https://reactjs.org/docs/error-decoder.html?invariant="+a,f=1;f<arguments.length;f++)c+="&args[]="+encodeURIComponent(arguments[f]);return"Minified React error #"+a+"; visit "+c+" 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,c){o(a,c),o(a+"Capture",c)}function o(a,c){for(i[a]=c,a=0;a<c.length;a++)n.add(c[a])}var l=!(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,c,f,y){if(f!==null&&f.type===0)return!1;switch(typeof c){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 m(a,c,f,y){if(c===null||typeof c>"u"||g(a,c,f,y))return!0;if(y)return!1;if(f!==null)switch(f.type){case 3:return!c;case 4:return c===!1;case 5:return isNaN(c);case 6:return isNaN(c)||1>c}return!1}function E(a,c,f,y,I,b,N){this.acceptsBooleans=c===2||c===3||c===4,this.attributeName=y,this.attributeNamespace=I,this.mustUseProperty=f,this.propertyName=a,this.type=c,this.sanitizeURL=b,this.removeEmptyString=N}var _={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){_[a]=new E(a,0,!1,a,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var c=a[0];_[c]=new E(c,1,!1,a[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(a){_[a]=new E(a,2,!1,a.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){_[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){_[a]=new E(a,3,!1,a.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(a){_[a]=new E(a,3,!0,a,null,!1,!1)}),["capture","download"].forEach(function(a){_[a]=new E(a,4,!1,a,null,!1,!1)}),["cols","rows","size","span"].forEach(function(a){_[a]=new E(a,6,!1,a,null,!1,!1)}),["rowSpan","start"].forEach(function(a){_[a]=new E(a,5,!1,a.toLowerCase(),null,!1,!1)});var v=/[\-:]([a-z])/g;function C(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 c=a.replace(v,C);_[c]=new E(c,1,!1,a,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a){var c=a.replace(v,C);_[c]=new E(c,1,!1,a,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(a){var c=a.replace(v,C);_[c]=new E(c,1,!1,a,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(a){_[a]=new E(a,1,!1,a.toLowerCase(),null,!1,!1)}),_.xlinkHref=new E("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(a){_[a]=new E(a,1,!1,a.toLowerCase(),null,!0,!0)});function x(a,c,f,y){var I=_.hasOwnProperty(c)?_[c]:null;(I!==null?I.type!==0:y||!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(m(c,f,I,y)&&(f=null),y||I===null?p(c)&&(f===null?a.removeAttribute(c):a.setAttribute(c,""+f)):I.mustUseProperty?a[I.propertyName]=f===null?I.type===3?!1:"":f:(c=I.attributeName,y=I.attributeNamespace,f===null?a.removeAttribute(c):(I=I.type,f=I===3||I===4&&f===!0?"":""+f,y?a.setAttributeNS(y,c,f):a.setAttribute(c,f))))}var w=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,B=Symbol.for("react.element"),T=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),D=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),M=Symbol.for("react.provider"),L=Symbol.for("react.context"),P=Symbol.for("react.forward_ref"),F=Symbol.for("react.suspense"),z=Symbol.for("react.suspense_list"),J=Symbol.for("react.memo"),q=Symbol.for("react.lazy"),ne=Symbol.for("react.offscreen"),j=Symbol.iterator;function te(a){return a===null||typeof a!="object"?null:(a=j&&a[j]||a["@@iterator"],typeof a=="function"?a:null)}var W=Object.assign,U;function H(a){if(U===void 0)try{throw Error()}catch(f){var c=f.stack.trim().match(/\n( *(at )?)/);U=c&&c[1]||""}return`
4717
+ */var hv;function XU(){if(hv)return Vr;hv=1;var r=ke,e=qU();function t(a){for(var c="https://reactjs.org/docs/error-decoder.html?invariant="+a,f=1;f<arguments.length;f++)c+="&args[]="+encodeURIComponent(arguments[f]);return"Minified React error #"+a+"; visit "+c+" 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,c){o(a,c),o(a+"Capture",c)}function o(a,c){for(i[a]=c,a=0;a<c.length;a++)n.add(c[a])}var l=!(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,c,f,y){if(f!==null&&f.type===0)return!1;switch(typeof c){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 m(a,c,f,y){if(c===null||typeof c>"u"||g(a,c,f,y))return!0;if(y)return!1;if(f!==null)switch(f.type){case 3:return!c;case 4:return c===!1;case 5:return isNaN(c);case 6:return isNaN(c)||1>c}return!1}function E(a,c,f,y,I,b,N){this.acceptsBooleans=c===2||c===3||c===4,this.attributeName=y,this.attributeNamespace=I,this.mustUseProperty=f,this.propertyName=a,this.type=c,this.sanitizeURL=b,this.removeEmptyString=N}var _={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){_[a]=new E(a,0,!1,a,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var c=a[0];_[c]=new E(c,1,!1,a[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(a){_[a]=new E(a,2,!1,a.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){_[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){_[a]=new E(a,3,!1,a.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(a){_[a]=new E(a,3,!0,a,null,!1,!1)}),["capture","download"].forEach(function(a){_[a]=new E(a,4,!1,a,null,!1,!1)}),["cols","rows","size","span"].forEach(function(a){_[a]=new E(a,6,!1,a,null,!1,!1)}),["rowSpan","start"].forEach(function(a){_[a]=new E(a,5,!1,a.toLowerCase(),null,!1,!1)});var v=/[\-:]([a-z])/g;function C(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 c=a.replace(v,C);_[c]=new E(c,1,!1,a,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a){var c=a.replace(v,C);_[c]=new E(c,1,!1,a,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(a){var c=a.replace(v,C);_[c]=new E(c,1,!1,a,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(a){_[a]=new E(a,1,!1,a.toLowerCase(),null,!1,!1)}),_.xlinkHref=new E("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(a){_[a]=new E(a,1,!1,a.toLowerCase(),null,!0,!0)});function x(a,c,f,y){var I=_.hasOwnProperty(c)?_[c]:null;(I!==null?I.type!==0:y||!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(m(c,f,I,y)&&(f=null),y||I===null?p(c)&&(f===null?a.removeAttribute(c):a.setAttribute(c,""+f)):I.mustUseProperty?a[I.propertyName]=f===null?I.type===3?!1:"":f:(c=I.attributeName,y=I.attributeNamespace,f===null?a.removeAttribute(c):(I=I.type,f=I===3||I===4&&f===!0?"":""+f,y?a.setAttributeNS(y,c,f):a.setAttribute(c,f))))}var w=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,B=Symbol.for("react.element"),T=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),D=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),M=Symbol.for("react.provider"),L=Symbol.for("react.context"),P=Symbol.for("react.forward_ref"),F=Symbol.for("react.suspense"),z=Symbol.for("react.suspense_list"),J=Symbol.for("react.memo"),q=Symbol.for("react.lazy"),ne=Symbol.for("react.offscreen"),j=Symbol.iterator;function te(a){return a===null||typeof a!="object"?null:(a=j&&a[j]||a["@@iterator"],typeof a=="function"?a:null)}var W=Object.assign,U;function H(a){if(U===void 0)try{throw Error()}catch(f){var c=f.stack.trim().match(/\n( *(at )?)/);U=c&&c[1]||""}return`
4718
4718
  `+U+a}var Z=!1;function G(a,c){if(!a||Z)return"";Z=!0;var f=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(c)if(c=function(){throw Error()},Object.defineProperty(c.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(c,[])}catch(fe){var y=fe}Reflect.construct(a,[],c)}else{try{c.call()}catch(fe){y=fe}a.call(c.prototype)}else{try{throw Error()}catch(fe){y=fe}a()}}catch(fe){if(fe&&y&&typeof fe.stack=="string"){for(var I=fe.stack.split(`
4719
4719
  `),b=y.stack.split(`
4720
4720
  `),N=I.length-1,Y=b.length-1;1<=N&&0<=Y&&I[N]!==b[Y];)Y--;for(;1<=N&&0<=Y;N--,Y--)if(I[N]!==b[Y]){if(N!==1||Y!==1)do if(N--,Y--,0>Y||I[N]!==b[Y]){var K=`
4721
- `+I[N].replace(" at new "," at ");return a.displayName&&K.includes("<anonymous>")&&(K=K.replace("<anonymous>",a.displayName)),K}while(1<=N&&0<=Y);break}}}finally{Z=!1,Error.prepareStackTrace=f}return(a=a?a.displayName||a.name:"")?H(a):""}function oe(a){switch(a.tag){case 5:return H(a.type);case 16:return H("Lazy");case 13:return H("Suspense");case 19:return H("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 S:return"Fragment";case T:return"Portal";case R:return"Profiler";case D:return"StrictMode";case F:return"Suspense";case z:return"SuspenseList"}if(typeof a=="object")switch(a.$$typeof){case L:return(a.displayName||"Context")+".Consumer";case M:return(a._context.displayName||"Context")+".Provider";case P:var c=a.render;return a=a.displayName,a||(a=c.displayName||c.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case J:return c=a.displayName||null,c!==null?c:pe(a.type)||"Memo";case q:c=a._payload,a=a._init;try{return pe(a(c))}catch{}}return null}function Ae(a){var c=a.type;switch(a.tag){case 24:return"Cache";case 9:return(c.displayName||"Context")+".Consumer";case 10:return(c._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return a=c.render,a=a.displayName||a.name||"",c.displayName||(a!==""?"ForwardRef("+a+")":"ForwardRef");case 7:return"Fragment";case 5:return c;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return pe(c);case 8:return c===D?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof c=="function")return c.displayName||c.name||null;if(typeof c=="string")return c}return null}function ge(a){switch(typeof a){case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function Re(a){var c=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(c==="checkbox"||c==="radio")}function Fe(a){var c=Re(a)?"checked":"value",f=Object.getOwnPropertyDescriptor(a.constructor.prototype,c),y=""+a[c];if(!a.hasOwnProperty(c)&&typeof f<"u"&&typeof f.get=="function"&&typeof f.set=="function"){var I=f.get,b=f.set;return Object.defineProperty(a,c,{configurable:!0,get:function(){return I.call(this)},set:function(N){y=""+N,b.call(this,N)}}),Object.defineProperty(a,c,{enumerable:f.enumerable}),{getValue:function(){return y},setValue:function(N){y=""+N},stopTracking:function(){a._valueTracker=null,delete a[c]}}}}function st(a){a._valueTracker||(a._valueTracker=Fe(a))}function ut(a){if(!a)return!1;var c=a._valueTracker;if(!c)return!0;var f=c.getValue(),y="";return a&&(y=Re(a)?a.checked?"true":"false":a.value),a=y,a!==f?(c.setValue(a),!0):!1}function mt(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 X(a,c){var f=c.checked;return W({},c,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:f??a._wrapperState.initialChecked})}function h0(a,c){var f=c.defaultValue==null?"":c.defaultValue,y=c.checked!=null?c.checked:c.defaultChecked;f=ge(c.value!=null?c.value:f),a._wrapperState={initialChecked:y,initialValue:f,controlled:c.type==="checkbox"||c.type==="radio"?c.checked!=null:c.value!=null}}function pt(a,c){c=c.checked,c!=null&&x(a,"checked",c,!1)}function At(a,c){pt(a,c);var f=ge(c.value),y=c.type;if(f!=null)y==="number"?(f===0&&a.value===""||a.value!=f)&&(a.value=""+f):a.value!==""+f&&(a.value=""+f);else if(y==="submit"||y==="reset"){a.removeAttribute("value");return}c.hasOwnProperty("value")?Mt(a,c.type,f):c.hasOwnProperty("defaultValue")&&Mt(a,c.type,ge(c.defaultValue)),c.checked==null&&c.defaultChecked!=null&&(a.defaultChecked=!!c.defaultChecked)}function qe(a,c,f){if(c.hasOwnProperty("value")||c.hasOwnProperty("defaultValue")){var y=c.type;if(!(y!=="submit"&&y!=="reset"||c.value!==void 0&&c.value!==null))return;c=""+a._wrapperState.initialValue,f||c===a.value||(a.value=c),a.defaultValue=c}f=a.name,f!==""&&(a.name=""),a.defaultChecked=!!a._wrapperState.initialChecked,f!==""&&(a.name=f)}function Mt(a,c,f){(c!=="number"||mt(a.ownerDocument)!==a)&&(f==null?a.defaultValue=""+a._wrapperState.initialValue:a.defaultValue!==""+f&&(a.defaultValue=""+f))}var Ye=Array.isArray;function Q(a,c,f,y){if(a=a.options,c){c={};for(var I=0;I<f.length;I++)c["$"+f[I]]=!0;for(f=0;f<a.length;f++)I=c.hasOwnProperty("$"+a[f].value),a[f].selected!==I&&(a[f].selected=I),I&&y&&(a[f].defaultSelected=!0)}else{for(f=""+ge(f),c=null,I=0;I<a.length;I++){if(a[I].value===f){a[I].selected=!0,y&&(a[I].defaultSelected=!0);return}c!==null||a[I].disabled||(c=a[I])}c!==null&&(c.selected=!0)}}function k(a,c){if(c.dangerouslySetInnerHTML!=null)throw Error(t(91));return W({},c,{value:void 0,defaultValue:void 0,children:""+a._wrapperState.initialValue})}function se(a,c){var f=c.value;if(f==null){if(f=c.children,c=c.defaultValue,f!=null){if(c!=null)throw Error(t(92));if(Ye(f)){if(1<f.length)throw Error(t(93));f=f[0]}c=f}c==null&&(c=""),f=c}a._wrapperState={initialValue:ge(f)}}function ye(a,c){var f=ge(c.value),y=ge(c.defaultValue);f!=null&&(f=""+f,f!==a.value&&(a.value=f),c.defaultValue==null&&a.defaultValue!==f&&(a.defaultValue=f)),y!=null&&(a.defaultValue=""+y)}function Ee(a){var c=a.textContent;c===a._wrapperState.initialValue&&c!==""&&c!==null&&(a.value=c)}function _e(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 Ge(a,c){return a==null||a==="http://www.w3.org/1999/xhtml"?_e(c):a==="http://www.w3.org/2000/svg"&&c==="foreignObject"?"http://www.w3.org/1999/xhtml":a}var Le,Ve=function(a){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(c,f,y,I){MSApp.execUnsafeLocalFunction(function(){return a(c,f,y,I)})}:a}(function(a,c){if(a.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in a)a.innerHTML=c;else{for(Le=Le||document.createElement("div"),Le.innerHTML="<svg>"+c.valueOf().toString()+"</svg>",c=Le.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;c.firstChild;)a.appendChild(c.firstChild)}});function gt(a,c){if(c){var f=a.firstChild;if(f&&f===a.lastChild&&f.nodeType===3){f.nodeValue=c;return}}a.textContent=c}var we={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},Pe=["Webkit","ms","Moz","O"];Object.keys(we).forEach(function(a){Pe.forEach(function(c){c=c+a.charAt(0).toUpperCase()+a.substring(1),we[c]=we[a]})});function nt(a,c,f){return c==null||typeof c=="boolean"||c===""?"":f||typeof c!="number"||c===0||we.hasOwnProperty(a)&&we[a]?(""+c).trim():c+"px"}function et(a,c){a=a.style;for(var f in c)if(c.hasOwnProperty(f)){var y=f.indexOf("--")===0,I=nt(f,c[f],y);f==="float"&&(f="cssFloat"),y?a.setProperty(f,I):a[f]=I}}var he=W({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 Oe(a,c){if(c){if(he[a]&&(c.children!=null||c.dangerouslySetInnerHTML!=null))throw Error(t(137,a));if(c.dangerouslySetInnerHTML!=null){if(c.children!=null)throw Error(t(60));if(typeof c.dangerouslySetInnerHTML!="object"||!("__html"in c.dangerouslySetInnerHTML))throw Error(t(61))}if(c.style!=null&&typeof c.style!="object")throw Error(t(62))}}function ke(a,c){if(a.indexOf("-")===-1)return typeof c.is=="string";switch(a){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ht=null;function $(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var Se=null,ue=null,ve=null;function De(a){if(a=D2(a)){if(typeof Se!="function")throw Error(t(280));var c=a.stateNode;c&&(c=mu(c),Se(a.stateNode,a.type,c))}}function Be(a){ue?ve?ve.push(a):ve=[a]:ue=a}function it(){if(ue){var a=ue,c=ve;if(ve=ue=null,De(a),c)for(a=0;a<c.length;a++)De(c[a])}}function jt(a,c){return a(c)}function y0(){}var Rt=!1;function lr(a,c,f){if(Rt)return a(c,f);Rt=!0;try{return jt(a,c,f)}finally{Rt=!1,(ue!==null||ve!==null)&&(y0(),it())}}function cr(a,c){var f=a.stateNode;if(f===null)return null;var y=mu(f);if(y===null)return null;f=y[c];e:switch(c){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(y=!y.disabled)||(a=a.type,y=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!y;break e;default:a=!1}if(a)return null;if(f&&typeof f!="function")throw Error(t(231,c,typeof f));return f}var Xi=!1;if(l)try{var m0={};Object.defineProperty(m0,"passive",{get:function(){Xi=!0}}),window.addEventListener("test",m0,m0),window.removeEventListener("test",m0,m0)}catch{Xi=!1}function $0(a,c,f,y,I,b,N,Y,K){var fe=Array.prototype.slice.call(arguments,3);try{c.apply(f,fe)}catch(Ie){this.onError(Ie)}}var Tn=!1,Ji=null,Wa=!1,zs=null,Xc={onError:function(a){Tn=!0,Ji=a}};function I1(a,c,f,y,I,b,N,Y,K){Tn=!1,Ji=null,$0.apply(Xc,arguments)}function Jc(a,c,f,y,I,b,N,Y,K){if(I1.apply(this,arguments),Tn){if(Tn){var fe=Ji;Tn=!1,Ji=null}else throw Error(t(198));Wa||(Wa=!0,zs=fe)}}function mi(a){var c=a,f=a;if(a.alternate)for(;c.return;)c=c.return;else{a=c;do c=a,c.flags&4098&&(f=c.return),a=c.return;while(a)}return c.tag===3?f:null}function Kc(a){if(a.tag===13){var c=a.memoizedState;if(c===null&&(a=a.alternate,a!==null&&(c=a.memoizedState)),c!==null)return c.dehydrated}return null}function Zc(a){if(mi(a)!==a)throw Error(t(188))}function Zh(a){var c=a.alternate;if(!c){if(c=mi(a),c===null)throw Error(t(188));return c!==a?null:a}for(var f=a,y=c;;){var I=f.return;if(I===null)break;var b=I.alternate;if(b===null){if(y=I.return,y!==null){f=y;continue}break}if(I.child===b.child){for(b=I.child;b;){if(b===f)return Zc(I),a;if(b===y)return Zc(I),c;b=b.sibling}throw Error(t(188))}if(f.return!==y.return)f=I,y=b;else{for(var N=!1,Y=I.child;Y;){if(Y===f){N=!0,f=I,y=b;break}if(Y===y){N=!0,y=I,f=b;break}Y=Y.sibling}if(!N){for(Y=b.child;Y;){if(Y===f){N=!0,f=b,y=I;break}if(Y===y){N=!0,y=b,f=I;break}Y=Y.sibling}if(!N)throw Error(t(189))}}if(f.alternate!==y)throw Error(t(190))}if(f.tag!==3)throw Error(t(188));return f.stateNode.current===f?a:c}function $c(a){return a=Zh(a),a!==null?eu(a):null}function eu(a){if(a.tag===5||a.tag===6)return a;for(a=a.child;a!==null;){var c=eu(a);if(c!==null)return c;a=a.sibling}return null}var tu=e.unstable_scheduleCallback,O=e.unstable_cancelCallback,ie=e.unstable_shouldYield,de=e.unstable_requestPaint,le=e.unstable_now,re=e.unstable_getCurrentPriorityLevel,Ce=e.unstable_ImmediatePriority,He=e.unstable_UserBlockingPriority,Qe=e.unstable_NormalPriority,Ze=e.unstable_LowPriority,dt=e.unstable_IdlePriority,ct=null,rt=null;function Dt(a){if(rt&&typeof rt.onCommitFiberRoot=="function")try{rt.onCommitFiberRoot(ct,a,void 0,(a.current.flags&128)===128)}catch{}}var Et=Math.clz32?Math.clz32:Wt,E0=Math.log,Ft=Math.LN2;function Wt(a){return a>>>=0,a===0?32:31-(E0(a)/Ft|0)|0}var tt=64,L0=4194304;function cn(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 vr(a,c){var f=a.pendingLanes;if(f===0)return 0;var y=0,I=a.suspendedLanes,b=a.pingedLanes,N=f&268435455;if(N!==0){var Y=N&~I;Y!==0?y=cn(Y):(b&=N,b!==0&&(y=cn(b)))}else N=f&~I,N!==0?y=cn(N):b!==0&&(y=cn(b));if(y===0)return 0;if(c!==0&&c!==y&&!(c&I)&&(I=y&-y,b=c&-c,I>=b||I===16&&(b&4194240)!==0))return c;if(y&4&&(y|=f&16),c=a.entangledLanes,c!==0)for(a=a.entanglements,c&=y;0<c;)f=31-Et(c),I=1<<f,y|=a[f],c&=~I;return y}function Gs(a,c){switch(a){case 1:case 2:case 4:return c+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return c+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function br(a,c){for(var f=a.suspendedLanes,y=a.pingedLanes,I=a.expirationTimes,b=a.pendingLanes;0<b;){var N=31-Et(b),Y=1<<N,K=I[N];K===-1?(!(Y&f)||Y&y)&&(I[N]=Gs(Y,c)):K<=c&&(a.expiredLanes|=Y),b&=~Y}}function Ki(a){return a=a.pendingLanes&-1073741825,a!==0?a:a&1073741824?1073741824:0}function Xt(){var a=tt;return tt<<=1,!(tt&4194240)&&(tt=64),a}function _r(a){for(var c=[],f=0;31>f;f++)c.push(a);return c}function er(a,c,f){a.pendingLanes|=c,c!==536870912&&(a.suspendedLanes=0,a.pingedLanes=0),a=a.eventTimes,c=31-Et(c),a[c]=f}function z0(a,c){var f=a.pendingLanes&~c;a.pendingLanes=c,a.suspendedLanes=0,a.pingedLanes=0,a.expiredLanes&=c,a.mutableReadLanes&=c,a.entangledLanes&=c,c=a.entanglements;var y=a.eventTimes;for(a=a.expirationTimes;0<f;){var I=31-Et(f),b=1<<I;c[I]=0,y[I]=-1,a[I]=-1,f&=~b}}function Rr(a,c){var f=a.entangledLanes|=c;for(a=a.entanglements;f;){var y=31-Et(f),I=1<<y;I&c|a[y]&c&&(a[y]|=c),f&=~I}}var Lt=0;function vi(a){return a&=-a,1<a?4<a?a&268435455?16:536870912:4:1}var Sv,$h,Tv,Bv,bv,e5=!1,ru=[],Hs=null,Vs=null,js=null,g2=new Map,m2=new Map,Ws=[],Ak="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 Rv(a,c){switch(a){case"focusin":case"focusout":Hs=null;break;case"dragenter":case"dragleave":Vs=null;break;case"mouseover":case"mouseout":js=null;break;case"pointerover":case"pointerout":g2.delete(c.pointerId);break;case"gotpointercapture":case"lostpointercapture":m2.delete(c.pointerId)}}function v2(a,c,f,y,I,b){return a===null||a.nativeEvent!==b?(a={blockedOn:c,domEventName:f,eventSystemFlags:y,nativeEvent:b,targetContainers:[I]},c!==null&&(c=D2(c),c!==null&&$h(c)),a):(a.eventSystemFlags|=y,c=a.targetContainers,I!==null&&c.indexOf(I)===-1&&c.push(I),a)}function gk(a,c,f,y,I){switch(c){case"focusin":return Hs=v2(Hs,a,c,f,y,I),!0;case"dragenter":return Vs=v2(Vs,a,c,f,y,I),!0;case"mouseover":return js=v2(js,a,c,f,y,I),!0;case"pointerover":var b=I.pointerId;return g2.set(b,v2(g2.get(b)||null,a,c,f,y,I)),!0;case"gotpointercapture":return b=I.pointerId,m2.set(b,v2(m2.get(b)||null,a,c,f,y,I)),!0}return!1}function Dv(a){var c=Ya(a.target);if(c!==null){var f=mi(c);if(f!==null){if(c=f.tag,c===13){if(c=Kc(f),c!==null){a.blockedOn=c,bv(a.priority,function(){Tv(f)});return}}else if(c===3&&f.stateNode.current.memoizedState.isDehydrated){a.blockedOn=f.tag===3?f.stateNode.containerInfo:null;return}}}a.blockedOn=null}function nu(a){if(a.blockedOn!==null)return!1;for(var c=a.targetContainers;0<c.length;){var f=r5(a.domEventName,a.eventSystemFlags,c[0],a.nativeEvent);if(f===null){f=a.nativeEvent;var y=new f.constructor(f.type,f);ht=y,f.target.dispatchEvent(y),ht=null}else return c=D2(f),c!==null&&$h(c),a.blockedOn=f,!1;c.shift()}return!0}function Lv(a,c,f){nu(a)&&f.delete(c)}function mk(){e5=!1,Hs!==null&&nu(Hs)&&(Hs=null),Vs!==null&&nu(Vs)&&(Vs=null),js!==null&&nu(js)&&(js=null),g2.forEach(Lv),m2.forEach(Lv)}function _2(a,c){a.blockedOn===c&&(a.blockedOn=null,e5||(e5=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,mk)))}function y2(a){function c(I){return _2(I,a)}if(0<ru.length){_2(ru[0],a);for(var f=1;f<ru.length;f++){var y=ru[f];y.blockedOn===a&&(y.blockedOn=null)}}for(Hs!==null&&_2(Hs,a),Vs!==null&&_2(Vs,a),js!==null&&_2(js,a),g2.forEach(c),m2.forEach(c),f=0;f<Ws.length;f++)y=Ws[f],y.blockedOn===a&&(y.blockedOn=null);for(;0<Ws.length&&(f=Ws[0],f.blockedOn===null);)Dv(f),f.blockedOn===null&&Ws.shift()}var M1=w.ReactCurrentBatchConfig,iu=!0;function vk(a,c,f,y){var I=Lt,b=M1.transition;M1.transition=null;try{Lt=1,t5(a,c,f,y)}finally{Lt=I,M1.transition=b}}function _k(a,c,f,y){var I=Lt,b=M1.transition;M1.transition=null;try{Lt=4,t5(a,c,f,y)}finally{Lt=I,M1.transition=b}}function t5(a,c,f,y){if(iu){var I=r5(a,c,f,y);if(I===null)_5(a,c,y,su,f),Rv(a,y);else if(gk(I,a,c,f,y))y.stopPropagation();else if(Rv(a,y),c&4&&-1<Ak.indexOf(a)){for(;I!==null;){var b=D2(I);if(b!==null&&Sv(b),b=r5(a,c,f,y),b===null&&_5(a,c,y,su,f),b===I)break;I=b}I!==null&&y.stopPropagation()}else _5(a,c,y,null,f)}}var su=null;function r5(a,c,f,y){if(su=null,a=$(y),a=Ya(a),a!==null)if(c=mi(a),c===null)a=null;else if(f=c.tag,f===13){if(a=Kc(c),a!==null)return a;a=null}else if(f===3){if(c.stateNode.current.memoizedState.isDehydrated)return c.tag===3?c.stateNode.containerInfo:null;a=null}else c!==a&&(a=null);return su=a,null}function Nv(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(re()){case Ce:return 1;case He:return 4;case Qe:case Ze:return 16;case dt:return 536870912;default:return 16}default:return 16}}var Ys=null,n5=null,au=null;function Pv(){if(au)return au;var a,c=n5,f=c.length,y,I="value"in Ys?Ys.value:Ys.textContent,b=I.length;for(a=0;a<f&&c[a]===I[a];a++);var N=f-a;for(y=1;y<=N&&c[f-y]===I[b-y];y++);return au=I.slice(a,1<y?1-y:void 0)}function ou(a){var c=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&c===13&&(a=13)):a=c,a===10&&(a=13),32<=a||a===13?a:0}function lu(){return!0}function Uv(){return!1}function un(a){function c(f,y,I,b,N){this._reactName=f,this._targetInst=I,this.type=y,this.nativeEvent=b,this.target=N,this.currentTarget=null;for(var Y in a)a.hasOwnProperty(Y)&&(f=a[Y],this[Y]=f?f(b):b[Y]);return this.isDefaultPrevented=(b.defaultPrevented!=null?b.defaultPrevented:b.returnValue===!1)?lu:Uv,this.isPropagationStopped=Uv,this}return W(c.prototype,{preventDefault:function(){this.defaultPrevented=!0;var f=this.nativeEvent;f&&(f.preventDefault?f.preventDefault():typeof f.returnValue!="unknown"&&(f.returnValue=!1),this.isDefaultPrevented=lu)},stopPropagation:function(){var f=this.nativeEvent;f&&(f.stopPropagation?f.stopPropagation():typeof f.cancelBubble!="unknown"&&(f.cancelBubble=!0),this.isPropagationStopped=lu)},persist:function(){},isPersistent:lu}),c}var S1={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},i5=un(S1),E2=W({},S1,{view:0,detail:0}),yk=un(E2),s5,a5,x2,cu=W({},E2,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:l5,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!==x2&&(x2&&a.type==="mousemove"?(s5=a.screenX-x2.screenX,a5=a.screenY-x2.screenY):a5=s5=0,x2=a),s5)},movementY:function(a){return"movementY"in a?a.movementY:a5}}),kv=un(cu),Ek=W({},cu,{dataTransfer:0}),xk=un(Ek),wk=W({},E2,{relatedTarget:0}),o5=un(wk),Ck=W({},S1,{animationName:0,elapsedTime:0,pseudoElement:0}),Ik=un(Ck),Mk=W({},S1,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),Sk=un(Mk),Tk=W({},S1,{data:0}),Fv=un(Tk),Bk={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},bk={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"},Rk={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Dk(a){var c=this.nativeEvent;return c.getModifierState?c.getModifierState(a):(a=Rk[a])?!!c[a]:!1}function l5(){return Dk}var Lk=W({},E2,{key:function(a){if(a.key){var c=Bk[a.key]||a.key;if(c!=="Unidentified")return c}return a.type==="keypress"?(a=ou(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?bk[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:l5,charCode:function(a){return a.type==="keypress"?ou(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?ou(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),Nk=un(Lk),Pk=W({},cu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ov=un(Pk),Uk=W({},E2,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:l5}),kk=un(Uk),Fk=W({},S1,{propertyName:0,elapsedTime:0,pseudoElement:0}),Ok=un(Fk),Qk=W({},cu,{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}),zk=un(Qk),Gk=[9,13,27,32],c5=l&&"CompositionEvent"in window,w2=null;l&&"documentMode"in document&&(w2=document.documentMode);var Hk=l&&"TextEvent"in window&&!w2,Qv=l&&(!c5||w2&&8<w2&&11>=w2),zv=String.fromCharCode(32),Gv=!1;function Hv(a,c){switch(a){case"keyup":return Gk.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Vv(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var T1=!1;function Vk(a,c){switch(a){case"compositionend":return Vv(c);case"keypress":return c.which!==32?null:(Gv=!0,zv);case"textInput":return a=c.data,a===zv&&Gv?null:a;default:return null}}function jk(a,c){if(T1)return a==="compositionend"||!c5&&Hv(a,c)?(a=Pv(),au=n5=Ys=null,T1=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1<c.char.length)return c.char;if(c.which)return String.fromCharCode(c.which)}return null;case"compositionend":return Qv&&c.locale!=="ko"?null:c.data;default:return null}}var Wk={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 jv(a){var c=a&&a.nodeName&&a.nodeName.toLowerCase();return c==="input"?!!Wk[a.type]:c==="textarea"}function Wv(a,c,f,y){Be(y),c=pu(c,"onChange"),0<c.length&&(f=new i5("onChange","change",null,f,y),a.push({event:f,listeners:c}))}var C2=null,I2=null;function Yk(a){u_(a,0)}function uu(a){var c=L1(a);if(ut(c))return a}function qk(a,c){if(a==="change")return c}var Yv=!1;if(l){var u5;if(l){var h5="oninput"in document;if(!h5){var qv=document.createElement("div");qv.setAttribute("oninput","return;"),h5=typeof qv.oninput=="function"}u5=h5}else u5=!1;Yv=u5&&(!document.documentMode||9<document.documentMode)}function Xv(){C2&&(C2.detachEvent("onpropertychange",Jv),I2=C2=null)}function Jv(a){if(a.propertyName==="value"&&uu(I2)){var c=[];Wv(c,I2,a,$(a)),lr(Yk,c)}}function Xk(a,c,f){a==="focusin"?(Xv(),C2=c,I2=f,C2.attachEvent("onpropertychange",Jv)):a==="focusout"&&Xv()}function Jk(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return uu(I2)}function Kk(a,c){if(a==="click")return uu(c)}function Zk(a,c){if(a==="input"||a==="change")return uu(c)}function $k(a,c){return a===c&&(a!==0||1/a===1/c)||a!==a&&c!==c}var Yn=typeof Object.is=="function"?Object.is:$k;function M2(a,c){if(Yn(a,c))return!0;if(typeof a!="object"||a===null||typeof c!="object"||c===null)return!1;var f=Object.keys(a),y=Object.keys(c);if(f.length!==y.length)return!1;for(y=0;y<f.length;y++){var I=f[y];if(!h.call(c,I)||!Yn(a[I],c[I]))return!1}return!0}function Kv(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function Zv(a,c){var f=Kv(a);a=0;for(var y;f;){if(f.nodeType===3){if(y=a+f.textContent.length,a<=c&&y>=c)return{node:f,offset:c-a};a=y}e:{for(;f;){if(f.nextSibling){f=f.nextSibling;break e}f=f.parentNode}f=void 0}f=Kv(f)}}function $v(a,c){return a&&c?a===c?!0:a&&a.nodeType===3?!1:c&&c.nodeType===3?$v(a,c.parentNode):"contains"in a?a.contains(c):a.compareDocumentPosition?!!(a.compareDocumentPosition(c)&16):!1:!1}function e_(){for(var a=window,c=mt();c instanceof a.HTMLIFrameElement;){try{var f=typeof c.contentWindow.location.href=="string"}catch{f=!1}if(f)a=c.contentWindow;else break;c=mt(a.document)}return c}function d5(a){var c=a&&a.nodeName&&a.nodeName.toLowerCase();return c&&(c==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||c==="textarea"||a.contentEditable==="true")}function eF(a){var c=e_(),f=a.focusedElem,y=a.selectionRange;if(c!==f&&f&&f.ownerDocument&&$v(f.ownerDocument.documentElement,f)){if(y!==null&&d5(f)){if(c=y.start,a=y.end,a===void 0&&(a=c),"selectionStart"in f)f.selectionStart=c,f.selectionEnd=Math.min(a,f.value.length);else if(a=(c=f.ownerDocument||document)&&c.defaultView||window,a.getSelection){a=a.getSelection();var I=f.textContent.length,b=Math.min(y.start,I);y=y.end===void 0?b:Math.min(y.end,I),!a.extend&&b>y&&(I=y,y=b,b=I),I=Zv(f,b);var N=Zv(f,y);I&&N&&(a.rangeCount!==1||a.anchorNode!==I.node||a.anchorOffset!==I.offset||a.focusNode!==N.node||a.focusOffset!==N.offset)&&(c=c.createRange(),c.setStart(I.node,I.offset),a.removeAllRanges(),b>y?(a.addRange(c),a.extend(N.node,N.offset)):(c.setEnd(N.node,N.offset),a.addRange(c)))}}for(c=[],a=f;a=a.parentNode;)a.nodeType===1&&c.push({element:a,left:a.scrollLeft,top:a.scrollTop});for(typeof f.focus=="function"&&f.focus(),f=0;f<c.length;f++)a=c[f],a.element.scrollLeft=a.left,a.element.scrollTop=a.top}}var tF=l&&"documentMode"in document&&11>=document.documentMode,B1=null,f5=null,S2=null,p5=!1;function t_(a,c,f){var y=f.window===f?f.document:f.nodeType===9?f:f.ownerDocument;p5||B1==null||B1!==mt(y)||(y=B1,"selectionStart"in y&&d5(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}),S2&&M2(S2,y)||(S2=y,y=pu(f5,"onSelect"),0<y.length&&(c=new i5("onSelect","select",null,c,f),a.push({event:c,listeners:y}),c.target=B1)))}function hu(a,c){var f={};return f[a.toLowerCase()]=c.toLowerCase(),f["Webkit"+a]="webkit"+c,f["Moz"+a]="moz"+c,f}var b1={animationend:hu("Animation","AnimationEnd"),animationiteration:hu("Animation","AnimationIteration"),animationstart:hu("Animation","AnimationStart"),transitionend:hu("Transition","TransitionEnd")},A5={},r_={};l&&(r_=document.createElement("div").style,"AnimationEvent"in window||(delete b1.animationend.animation,delete b1.animationiteration.animation,delete b1.animationstart.animation),"TransitionEvent"in window||delete b1.transitionend.transition);function du(a){if(A5[a])return A5[a];if(!b1[a])return a;var c=b1[a],f;for(f in c)if(c.hasOwnProperty(f)&&f in r_)return A5[a]=c[f];return a}var n_=du("animationend"),i_=du("animationiteration"),s_=du("animationstart"),a_=du("transitionend"),o_=new Map,l_="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 qs(a,c){o_.set(a,c),s(c,[a])}for(var g5=0;g5<l_.length;g5++){var m5=l_[g5],rF=m5.toLowerCase(),nF=m5[0].toUpperCase()+m5.slice(1);qs(rF,"on"+nF)}qs(n_,"onAnimationEnd"),qs(i_,"onAnimationIteration"),qs(s_,"onAnimationStart"),qs("dblclick","onDoubleClick"),qs("focusin","onFocus"),qs("focusout","onBlur"),qs(a_,"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 T2="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(" "),iF=new Set("cancel close invalid load scroll toggle".split(" ").concat(T2));function c_(a,c,f){var y=a.type||"unknown-event";a.currentTarget=f,Jc(y,c,void 0,a),a.currentTarget=null}function u_(a,c){c=(c&4)!==0;for(var f=0;f<a.length;f++){var y=a[f],I=y.event;y=y.listeners;e:{var b=void 0;if(c)for(var N=y.length-1;0<=N;N--){var Y=y[N],K=Y.instance,fe=Y.currentTarget;if(Y=Y.listener,K!==b&&I.isPropagationStopped())break e;c_(I,Y,fe),b=K}else for(N=0;N<y.length;N++){if(Y=y[N],K=Y.instance,fe=Y.currentTarget,Y=Y.listener,K!==b&&I.isPropagationStopped())break e;c_(I,Y,fe),b=K}}}if(Wa)throw a=zs,Wa=!1,zs=null,a}function t0(a,c){var f=c[I5];f===void 0&&(f=c[I5]=new Set);var y=a+"__bubble";f.has(y)||(h_(c,a,2,!1),f.add(y))}function v5(a,c,f){var y=0;c&&(y|=4),h_(f,a,y,c)}var fu="_reactListening"+Math.random().toString(36).slice(2);function B2(a){if(!a[fu]){a[fu]=!0,n.forEach(function(f){f!=="selectionchange"&&(iF.has(f)||v5(f,!1,a),v5(f,!0,a))});var c=a.nodeType===9?a:a.ownerDocument;c===null||c[fu]||(c[fu]=!0,v5("selectionchange",!1,c))}}function h_(a,c,f,y){switch(Nv(c)){case 1:var I=vk;break;case 4:I=_k;break;default:I=t5}f=I.bind(null,c,f,a),I=void 0,!Xi||c!=="touchstart"&&c!=="touchmove"&&c!=="wheel"||(I=!0),y?I!==void 0?a.addEventListener(c,f,{capture:!0,passive:I}):a.addEventListener(c,f,!0):I!==void 0?a.addEventListener(c,f,{passive:I}):a.addEventListener(c,f,!1)}function _5(a,c,f,y,I){var b=y;if(!(c&1)&&!(c&2)&&y!==null)e:for(;;){if(y===null)return;var N=y.tag;if(N===3||N===4){var Y=y.stateNode.containerInfo;if(Y===I||Y.nodeType===8&&Y.parentNode===I)break;if(N===4)for(N=y.return;N!==null;){var K=N.tag;if((K===3||K===4)&&(K=N.stateNode.containerInfo,K===I||K.nodeType===8&&K.parentNode===I))return;N=N.return}for(;Y!==null;){if(N=Ya(Y),N===null)return;if(K=N.tag,K===5||K===6){y=b=N;continue e}Y=Y.parentNode}}y=y.return}lr(function(){var fe=b,Ie=$(f),Me=[];e:{var xe=o_.get(a);if(xe!==void 0){var je=i5,Je=a;switch(a){case"keypress":if(ou(f)===0)break e;case"keydown":case"keyup":je=Nk;break;case"focusin":Je="focus",je=o5;break;case"focusout":Je="blur",je=o5;break;case"beforeblur":case"afterblur":je=o5;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":je=kv;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":je=xk;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":je=kk;break;case n_:case i_:case s_:je=Ik;break;case a_:je=Ok;break;case"scroll":je=yk;break;case"wheel":je=zk;break;case"copy":case"cut":case"paste":je=Sk;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":je=Ov}var Ke=(c&4)!==0,x0=!Ke&&a==="scroll",ae=Ke?xe!==null?xe+"Capture":null:xe;Ke=[];for(var ee=fe,ce;ee!==null;){ce=ee;var be=ce.stateNode;if(ce.tag===5&&be!==null&&(ce=be,ae!==null&&(be=cr(ee,ae),be!=null&&Ke.push(b2(ee,be,ce)))),x0)break;ee=ee.return}0<Ke.length&&(xe=new je(xe,Je,null,f,Ie),Me.push({event:xe,listeners:Ke}))}}if(!(c&7)){e:{if(xe=a==="mouseover"||a==="pointerover",je=a==="mouseout"||a==="pointerout",xe&&f!==ht&&(Je=f.relatedTarget||f.fromElement)&&(Ya(Je)||Je[Zi]))break e;if((je||xe)&&(xe=Ie.window===Ie?Ie:(xe=Ie.ownerDocument)?xe.defaultView||xe.parentWindow:window,je?(Je=f.relatedTarget||f.toElement,je=fe,Je=Je?Ya(Je):null,Je!==null&&(x0=mi(Je),Je!==x0||Je.tag!==5&&Je.tag!==6)&&(Je=null)):(je=null,Je=fe),je!==Je)){if(Ke=kv,be="onMouseLeave",ae="onMouseEnter",ee="mouse",(a==="pointerout"||a==="pointerover")&&(Ke=Ov,be="onPointerLeave",ae="onPointerEnter",ee="pointer"),x0=je==null?xe:L1(je),ce=Je==null?xe:L1(Je),xe=new Ke(be,ee+"leave",je,f,Ie),xe.target=x0,xe.relatedTarget=ce,be=null,Ya(Ie)===fe&&(Ke=new Ke(ae,ee+"enter",Je,f,Ie),Ke.target=ce,Ke.relatedTarget=x0,be=Ke),x0=be,je&&Je)t:{for(Ke=je,ae=Je,ee=0,ce=Ke;ce;ce=R1(ce))ee++;for(ce=0,be=ae;be;be=R1(be))ce++;for(;0<ee-ce;)Ke=R1(Ke),ee--;for(;0<ce-ee;)ae=R1(ae),ce--;for(;ee--;){if(Ke===ae||ae!==null&&Ke===ae.alternate)break t;Ke=R1(Ke),ae=R1(ae)}Ke=null}else Ke=null;je!==null&&d_(Me,xe,je,Ke,!1),Je!==null&&x0!==null&&d_(Me,x0,Je,Ke,!0)}}e:{if(xe=fe?L1(fe):window,je=xe.nodeName&&xe.nodeName.toLowerCase(),je==="select"||je==="input"&&xe.type==="file")var $e=qk;else if(jv(xe))if(Yv)$e=Zk;else{$e=Jk;var at=Xk}else(je=xe.nodeName)&&je.toLowerCase()==="input"&&(xe.type==="checkbox"||xe.type==="radio")&&($e=Kk);if($e&&($e=$e(a,fe))){Wv(Me,$e,f,Ie);break e}at&&at(a,xe,fe),a==="focusout"&&(at=xe._wrapperState)&&at.controlled&&xe.type==="number"&&Mt(xe,"number",xe.value)}switch(at=fe?L1(fe):window,a){case"focusin":(jv(at)||at.contentEditable==="true")&&(B1=at,f5=fe,S2=null);break;case"focusout":S2=f5=B1=null;break;case"mousedown":p5=!0;break;case"contextmenu":case"mouseup":case"dragend":p5=!1,t_(Me,f,Ie);break;case"selectionchange":if(tF)break;case"keydown":case"keyup":t_(Me,f,Ie)}var ot;if(c5)e:{switch(a){case"compositionstart":var ft="onCompositionStart";break e;case"compositionend":ft="onCompositionEnd";break e;case"compositionupdate":ft="onCompositionUpdate";break e}ft=void 0}else T1?Hv(a,f)&&(ft="onCompositionEnd"):a==="keydown"&&f.keyCode===229&&(ft="onCompositionStart");ft&&(Qv&&f.locale!=="ko"&&(T1||ft!=="onCompositionStart"?ft==="onCompositionEnd"&&T1&&(ot=Pv()):(Ys=Ie,n5="value"in Ys?Ys.value:Ys.textContent,T1=!0)),at=pu(fe,ft),0<at.length&&(ft=new Fv(ft,a,null,f,Ie),Me.push({event:ft,listeners:at}),ot?ft.data=ot:(ot=Vv(f),ot!==null&&(ft.data=ot)))),(ot=Hk?Vk(a,f):jk(a,f))&&(fe=pu(fe,"onBeforeInput"),0<fe.length&&(Ie=new Fv("onBeforeInput","beforeinput",null,f,Ie),Me.push({event:Ie,listeners:fe}),Ie.data=ot))}u_(Me,c)})}function b2(a,c,f){return{instance:a,listener:c,currentTarget:f}}function pu(a,c){for(var f=c+"Capture",y=[];a!==null;){var I=a,b=I.stateNode;I.tag===5&&b!==null&&(I=b,b=cr(a,f),b!=null&&y.unshift(b2(a,b,I)),b=cr(a,c),b!=null&&y.push(b2(a,b,I))),a=a.return}return y}function R1(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5);return a||null}function d_(a,c,f,y,I){for(var b=c._reactName,N=[];f!==null&&f!==y;){var Y=f,K=Y.alternate,fe=Y.stateNode;if(K!==null&&K===y)break;Y.tag===5&&fe!==null&&(Y=fe,I?(K=cr(f,b),K!=null&&N.unshift(b2(f,K,Y))):I||(K=cr(f,b),K!=null&&N.push(b2(f,K,Y)))),f=f.return}N.length!==0&&a.push({event:c,listeners:N})}var sF=/\r\n?/g,aF=/\u0000|\uFFFD/g;function f_(a){return(typeof a=="string"?a:""+a).replace(sF,`
4721
+ `+I[N].replace(" at new "," at ");return a.displayName&&K.includes("<anonymous>")&&(K=K.replace("<anonymous>",a.displayName)),K}while(1<=N&&0<=Y);break}}}finally{Z=!1,Error.prepareStackTrace=f}return(a=a?a.displayName||a.name:"")?H(a):""}function oe(a){switch(a.tag){case 5:return H(a.type);case 16:return H("Lazy");case 13:return H("Suspense");case 19:return H("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 S:return"Fragment";case T:return"Portal";case R:return"Profiler";case D:return"StrictMode";case F:return"Suspense";case z:return"SuspenseList"}if(typeof a=="object")switch(a.$$typeof){case L:return(a.displayName||"Context")+".Consumer";case M:return(a._context.displayName||"Context")+".Provider";case P:var c=a.render;return a=a.displayName,a||(a=c.displayName||c.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case J:return c=a.displayName||null,c!==null?c:pe(a.type)||"Memo";case q:c=a._payload,a=a._init;try{return pe(a(c))}catch{}}return null}function Ae(a){var c=a.type;switch(a.tag){case 24:return"Cache";case 9:return(c.displayName||"Context")+".Consumer";case 10:return(c._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return a=c.render,a=a.displayName||a.name||"",c.displayName||(a!==""?"ForwardRef("+a+")":"ForwardRef");case 7:return"Fragment";case 5:return c;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return pe(c);case 8:return c===D?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof c=="function")return c.displayName||c.name||null;if(typeof c=="string")return c}return null}function ge(a){switch(typeof a){case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function Re(a){var c=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(c==="checkbox"||c==="radio")}function Oe(a){var c=Re(a)?"checked":"value",f=Object.getOwnPropertyDescriptor(a.constructor.prototype,c),y=""+a[c];if(!a.hasOwnProperty(c)&&typeof f<"u"&&typeof f.get=="function"&&typeof f.set=="function"){var I=f.get,b=f.set;return Object.defineProperty(a,c,{configurable:!0,get:function(){return I.call(this)},set:function(N){y=""+N,b.call(this,N)}}),Object.defineProperty(a,c,{enumerable:f.enumerable}),{getValue:function(){return y},setValue:function(N){y=""+N},stopTracking:function(){a._valueTracker=null,delete a[c]}}}}function st(a){a._valueTracker||(a._valueTracker=Oe(a))}function ut(a){if(!a)return!1;var c=a._valueTracker;if(!c)return!0;var f=c.getValue(),y="";return a&&(y=Re(a)?a.checked?"true":"false":a.value),a=y,a!==f?(c.setValue(a),!0):!1}function mt(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 X(a,c){var f=c.checked;return W({},c,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:f??a._wrapperState.initialChecked})}function h0(a,c){var f=c.defaultValue==null?"":c.defaultValue,y=c.checked!=null?c.checked:c.defaultChecked;f=ge(c.value!=null?c.value:f),a._wrapperState={initialChecked:y,initialValue:f,controlled:c.type==="checkbox"||c.type==="radio"?c.checked!=null:c.value!=null}}function pt(a,c){c=c.checked,c!=null&&x(a,"checked",c,!1)}function At(a,c){pt(a,c);var f=ge(c.value),y=c.type;if(f!=null)y==="number"?(f===0&&a.value===""||a.value!=f)&&(a.value=""+f):a.value!==""+f&&(a.value=""+f);else if(y==="submit"||y==="reset"){a.removeAttribute("value");return}c.hasOwnProperty("value")?Mt(a,c.type,f):c.hasOwnProperty("defaultValue")&&Mt(a,c.type,ge(c.defaultValue)),c.checked==null&&c.defaultChecked!=null&&(a.defaultChecked=!!c.defaultChecked)}function qe(a,c,f){if(c.hasOwnProperty("value")||c.hasOwnProperty("defaultValue")){var y=c.type;if(!(y!=="submit"&&y!=="reset"||c.value!==void 0&&c.value!==null))return;c=""+a._wrapperState.initialValue,f||c===a.value||(a.value=c),a.defaultValue=c}f=a.name,f!==""&&(a.name=""),a.defaultChecked=!!a._wrapperState.initialChecked,f!==""&&(a.name=f)}function Mt(a,c,f){(c!=="number"||mt(a.ownerDocument)!==a)&&(f==null?a.defaultValue=""+a._wrapperState.initialValue:a.defaultValue!==""+f&&(a.defaultValue=""+f))}var Ye=Array.isArray;function Q(a,c,f,y){if(a=a.options,c){c={};for(var I=0;I<f.length;I++)c["$"+f[I]]=!0;for(f=0;f<a.length;f++)I=c.hasOwnProperty("$"+a[f].value),a[f].selected!==I&&(a[f].selected=I),I&&y&&(a[f].defaultSelected=!0)}else{for(f=""+ge(f),c=null,I=0;I<a.length;I++){if(a[I].value===f){a[I].selected=!0,y&&(a[I].defaultSelected=!0);return}c!==null||a[I].disabled||(c=a[I])}c!==null&&(c.selected=!0)}}function k(a,c){if(c.dangerouslySetInnerHTML!=null)throw Error(t(91));return W({},c,{value:void 0,defaultValue:void 0,children:""+a._wrapperState.initialValue})}function se(a,c){var f=c.value;if(f==null){if(f=c.children,c=c.defaultValue,f!=null){if(c!=null)throw Error(t(92));if(Ye(f)){if(1<f.length)throw Error(t(93));f=f[0]}c=f}c==null&&(c=""),f=c}a._wrapperState={initialValue:ge(f)}}function ye(a,c){var f=ge(c.value),y=ge(c.defaultValue);f!=null&&(f=""+f,f!==a.value&&(a.value=f),c.defaultValue==null&&a.defaultValue!==f&&(a.defaultValue=f)),y!=null&&(a.defaultValue=""+y)}function Ee(a){var c=a.textContent;c===a._wrapperState.initialValue&&c!==""&&c!==null&&(a.value=c)}function _e(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 Ge(a,c){return a==null||a==="http://www.w3.org/1999/xhtml"?_e(c):a==="http://www.w3.org/2000/svg"&&c==="foreignObject"?"http://www.w3.org/1999/xhtml":a}var Le,Ve=function(a){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(c,f,y,I){MSApp.execUnsafeLocalFunction(function(){return a(c,f,y,I)})}:a}(function(a,c){if(a.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in a)a.innerHTML=c;else{for(Le=Le||document.createElement("div"),Le.innerHTML="<svg>"+c.valueOf().toString()+"</svg>",c=Le.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;c.firstChild;)a.appendChild(c.firstChild)}});function gt(a,c){if(c){var f=a.firstChild;if(f&&f===a.lastChild&&f.nodeType===3){f.nodeValue=c;return}}a.textContent=c}var we={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},Ue=["Webkit","ms","Moz","O"];Object.keys(we).forEach(function(a){Ue.forEach(function(c){c=c+a.charAt(0).toUpperCase()+a.substring(1),we[c]=we[a]})});function nt(a,c,f){return c==null||typeof c=="boolean"||c===""?"":f||typeof c!="number"||c===0||we.hasOwnProperty(a)&&we[a]?(""+c).trim():c+"px"}function et(a,c){a=a.style;for(var f in c)if(c.hasOwnProperty(f)){var y=f.indexOf("--")===0,I=nt(f,c[f],y);f==="float"&&(f="cssFloat"),y?a.setProperty(f,I):a[f]=I}}var he=W({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 Pe(a,c){if(c){if(he[a]&&(c.children!=null||c.dangerouslySetInnerHTML!=null))throw Error(t(137,a));if(c.dangerouslySetInnerHTML!=null){if(c.children!=null)throw Error(t(60));if(typeof c.dangerouslySetInnerHTML!="object"||!("__html"in c.dangerouslySetInnerHTML))throw Error(t(61))}if(c.style!=null&&typeof c.style!="object")throw Error(t(62))}}function Fe(a,c){if(a.indexOf("-")===-1)return typeof c.is=="string";switch(a){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ht=null;function $(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var Se=null,ue=null,ve=null;function De(a){if(a=D2(a)){if(typeof Se!="function")throw Error(t(280));var c=a.stateNode;c&&(c=mu(c),Se(a.stateNode,a.type,c))}}function Be(a){ue?ve?ve.push(a):ve=[a]:ue=a}function it(){if(ue){var a=ue,c=ve;if(ve=ue=null,De(a),c)for(a=0;a<c.length;a++)De(c[a])}}function jt(a,c){return a(c)}function y0(){}var Rt=!1;function lr(a,c,f){if(Rt)return a(c,f);Rt=!0;try{return jt(a,c,f)}finally{Rt=!1,(ue!==null||ve!==null)&&(y0(),it())}}function cr(a,c){var f=a.stateNode;if(f===null)return null;var y=mu(f);if(y===null)return null;f=y[c];e:switch(c){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(y=!y.disabled)||(a=a.type,y=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!y;break e;default:a=!1}if(a)return null;if(f&&typeof f!="function")throw Error(t(231,c,typeof f));return f}var Xi=!1;if(l)try{var m0={};Object.defineProperty(m0,"passive",{get:function(){Xi=!0}}),window.addEventListener("test",m0,m0),window.removeEventListener("test",m0,m0)}catch{Xi=!1}function $0(a,c,f,y,I,b,N,Y,K){var fe=Array.prototype.slice.call(arguments,3);try{c.apply(f,fe)}catch(Ie){this.onError(Ie)}}var Tn=!1,Ji=null,Wa=!1,zs=null,Xc={onError:function(a){Tn=!0,Ji=a}};function I1(a,c,f,y,I,b,N,Y,K){Tn=!1,Ji=null,$0.apply(Xc,arguments)}function Jc(a,c,f,y,I,b,N,Y,K){if(I1.apply(this,arguments),Tn){if(Tn){var fe=Ji;Tn=!1,Ji=null}else throw Error(t(198));Wa||(Wa=!0,zs=fe)}}function mi(a){var c=a,f=a;if(a.alternate)for(;c.return;)c=c.return;else{a=c;do c=a,c.flags&4098&&(f=c.return),a=c.return;while(a)}return c.tag===3?f:null}function Kc(a){if(a.tag===13){var c=a.memoizedState;if(c===null&&(a=a.alternate,a!==null&&(c=a.memoizedState)),c!==null)return c.dehydrated}return null}function Zc(a){if(mi(a)!==a)throw Error(t(188))}function Zh(a){var c=a.alternate;if(!c){if(c=mi(a),c===null)throw Error(t(188));return c!==a?null:a}for(var f=a,y=c;;){var I=f.return;if(I===null)break;var b=I.alternate;if(b===null){if(y=I.return,y!==null){f=y;continue}break}if(I.child===b.child){for(b=I.child;b;){if(b===f)return Zc(I),a;if(b===y)return Zc(I),c;b=b.sibling}throw Error(t(188))}if(f.return!==y.return)f=I,y=b;else{for(var N=!1,Y=I.child;Y;){if(Y===f){N=!0,f=I,y=b;break}if(Y===y){N=!0,y=I,f=b;break}Y=Y.sibling}if(!N){for(Y=b.child;Y;){if(Y===f){N=!0,f=b,y=I;break}if(Y===y){N=!0,y=b,f=I;break}Y=Y.sibling}if(!N)throw Error(t(189))}}if(f.alternate!==y)throw Error(t(190))}if(f.tag!==3)throw Error(t(188));return f.stateNode.current===f?a:c}function $c(a){return a=Zh(a),a!==null?eu(a):null}function eu(a){if(a.tag===5||a.tag===6)return a;for(a=a.child;a!==null;){var c=eu(a);if(c!==null)return c;a=a.sibling}return null}var tu=e.unstable_scheduleCallback,O=e.unstable_cancelCallback,ie=e.unstable_shouldYield,de=e.unstable_requestPaint,le=e.unstable_now,re=e.unstable_getCurrentPriorityLevel,Ce=e.unstable_ImmediatePriority,He=e.unstable_UserBlockingPriority,Qe=e.unstable_NormalPriority,Ze=e.unstable_LowPriority,dt=e.unstable_IdlePriority,ct=null,rt=null;function Dt(a){if(rt&&typeof rt.onCommitFiberRoot=="function")try{rt.onCommitFiberRoot(ct,a,void 0,(a.current.flags&128)===128)}catch{}}var Et=Math.clz32?Math.clz32:Wt,E0=Math.log,Ft=Math.LN2;function Wt(a){return a>>>=0,a===0?32:31-(E0(a)/Ft|0)|0}var tt=64,L0=4194304;function cn(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 vr(a,c){var f=a.pendingLanes;if(f===0)return 0;var y=0,I=a.suspendedLanes,b=a.pingedLanes,N=f&268435455;if(N!==0){var Y=N&~I;Y!==0?y=cn(Y):(b&=N,b!==0&&(y=cn(b)))}else N=f&~I,N!==0?y=cn(N):b!==0&&(y=cn(b));if(y===0)return 0;if(c!==0&&c!==y&&!(c&I)&&(I=y&-y,b=c&-c,I>=b||I===16&&(b&4194240)!==0))return c;if(y&4&&(y|=f&16),c=a.entangledLanes,c!==0)for(a=a.entanglements,c&=y;0<c;)f=31-Et(c),I=1<<f,y|=a[f],c&=~I;return y}function Gs(a,c){switch(a){case 1:case 2:case 4:return c+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return c+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function br(a,c){for(var f=a.suspendedLanes,y=a.pingedLanes,I=a.expirationTimes,b=a.pendingLanes;0<b;){var N=31-Et(b),Y=1<<N,K=I[N];K===-1?(!(Y&f)||Y&y)&&(I[N]=Gs(Y,c)):K<=c&&(a.expiredLanes|=Y),b&=~Y}}function Ki(a){return a=a.pendingLanes&-1073741825,a!==0?a:a&1073741824?1073741824:0}function Xt(){var a=tt;return tt<<=1,!(tt&4194240)&&(tt=64),a}function _r(a){for(var c=[],f=0;31>f;f++)c.push(a);return c}function er(a,c,f){a.pendingLanes|=c,c!==536870912&&(a.suspendedLanes=0,a.pingedLanes=0),a=a.eventTimes,c=31-Et(c),a[c]=f}function z0(a,c){var f=a.pendingLanes&~c;a.pendingLanes=c,a.suspendedLanes=0,a.pingedLanes=0,a.expiredLanes&=c,a.mutableReadLanes&=c,a.entangledLanes&=c,c=a.entanglements;var y=a.eventTimes;for(a=a.expirationTimes;0<f;){var I=31-Et(f),b=1<<I;c[I]=0,y[I]=-1,a[I]=-1,f&=~b}}function Rr(a,c){var f=a.entangledLanes|=c;for(a=a.entanglements;f;){var y=31-Et(f),I=1<<y;I&c|a[y]&c&&(a[y]|=c),f&=~I}}var Lt=0;function vi(a){return a&=-a,1<a?4<a?a&268435455?16:536870912:4:1}var Sv,$h,Tv,Bv,bv,e5=!1,ru=[],Hs=null,Vs=null,js=null,g2=new Map,m2=new Map,Ws=[],Ak="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 Rv(a,c){switch(a){case"focusin":case"focusout":Hs=null;break;case"dragenter":case"dragleave":Vs=null;break;case"mouseover":case"mouseout":js=null;break;case"pointerover":case"pointerout":g2.delete(c.pointerId);break;case"gotpointercapture":case"lostpointercapture":m2.delete(c.pointerId)}}function v2(a,c,f,y,I,b){return a===null||a.nativeEvent!==b?(a={blockedOn:c,domEventName:f,eventSystemFlags:y,nativeEvent:b,targetContainers:[I]},c!==null&&(c=D2(c),c!==null&&$h(c)),a):(a.eventSystemFlags|=y,c=a.targetContainers,I!==null&&c.indexOf(I)===-1&&c.push(I),a)}function gk(a,c,f,y,I){switch(c){case"focusin":return Hs=v2(Hs,a,c,f,y,I),!0;case"dragenter":return Vs=v2(Vs,a,c,f,y,I),!0;case"mouseover":return js=v2(js,a,c,f,y,I),!0;case"pointerover":var b=I.pointerId;return g2.set(b,v2(g2.get(b)||null,a,c,f,y,I)),!0;case"gotpointercapture":return b=I.pointerId,m2.set(b,v2(m2.get(b)||null,a,c,f,y,I)),!0}return!1}function Dv(a){var c=Ya(a.target);if(c!==null){var f=mi(c);if(f!==null){if(c=f.tag,c===13){if(c=Kc(f),c!==null){a.blockedOn=c,bv(a.priority,function(){Tv(f)});return}}else if(c===3&&f.stateNode.current.memoizedState.isDehydrated){a.blockedOn=f.tag===3?f.stateNode.containerInfo:null;return}}}a.blockedOn=null}function nu(a){if(a.blockedOn!==null)return!1;for(var c=a.targetContainers;0<c.length;){var f=r5(a.domEventName,a.eventSystemFlags,c[0],a.nativeEvent);if(f===null){f=a.nativeEvent;var y=new f.constructor(f.type,f);ht=y,f.target.dispatchEvent(y),ht=null}else return c=D2(f),c!==null&&$h(c),a.blockedOn=f,!1;c.shift()}return!0}function Lv(a,c,f){nu(a)&&f.delete(c)}function mk(){e5=!1,Hs!==null&&nu(Hs)&&(Hs=null),Vs!==null&&nu(Vs)&&(Vs=null),js!==null&&nu(js)&&(js=null),g2.forEach(Lv),m2.forEach(Lv)}function _2(a,c){a.blockedOn===c&&(a.blockedOn=null,e5||(e5=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,mk)))}function y2(a){function c(I){return _2(I,a)}if(0<ru.length){_2(ru[0],a);for(var f=1;f<ru.length;f++){var y=ru[f];y.blockedOn===a&&(y.blockedOn=null)}}for(Hs!==null&&_2(Hs,a),Vs!==null&&_2(Vs,a),js!==null&&_2(js,a),g2.forEach(c),m2.forEach(c),f=0;f<Ws.length;f++)y=Ws[f],y.blockedOn===a&&(y.blockedOn=null);for(;0<Ws.length&&(f=Ws[0],f.blockedOn===null);)Dv(f),f.blockedOn===null&&Ws.shift()}var M1=w.ReactCurrentBatchConfig,iu=!0;function vk(a,c,f,y){var I=Lt,b=M1.transition;M1.transition=null;try{Lt=1,t5(a,c,f,y)}finally{Lt=I,M1.transition=b}}function _k(a,c,f,y){var I=Lt,b=M1.transition;M1.transition=null;try{Lt=4,t5(a,c,f,y)}finally{Lt=I,M1.transition=b}}function t5(a,c,f,y){if(iu){var I=r5(a,c,f,y);if(I===null)_5(a,c,y,su,f),Rv(a,y);else if(gk(I,a,c,f,y))y.stopPropagation();else if(Rv(a,y),c&4&&-1<Ak.indexOf(a)){for(;I!==null;){var b=D2(I);if(b!==null&&Sv(b),b=r5(a,c,f,y),b===null&&_5(a,c,y,su,f),b===I)break;I=b}I!==null&&y.stopPropagation()}else _5(a,c,y,null,f)}}var su=null;function r5(a,c,f,y){if(su=null,a=$(y),a=Ya(a),a!==null)if(c=mi(a),c===null)a=null;else if(f=c.tag,f===13){if(a=Kc(c),a!==null)return a;a=null}else if(f===3){if(c.stateNode.current.memoizedState.isDehydrated)return c.tag===3?c.stateNode.containerInfo:null;a=null}else c!==a&&(a=null);return su=a,null}function Nv(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(re()){case Ce:return 1;case He:return 4;case Qe:case Ze:return 16;case dt:return 536870912;default:return 16}default:return 16}}var Ys=null,n5=null,au=null;function Pv(){if(au)return au;var a,c=n5,f=c.length,y,I="value"in Ys?Ys.value:Ys.textContent,b=I.length;for(a=0;a<f&&c[a]===I[a];a++);var N=f-a;for(y=1;y<=N&&c[f-y]===I[b-y];y++);return au=I.slice(a,1<y?1-y:void 0)}function ou(a){var c=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&c===13&&(a=13)):a=c,a===10&&(a=13),32<=a||a===13?a:0}function lu(){return!0}function Uv(){return!1}function un(a){function c(f,y,I,b,N){this._reactName=f,this._targetInst=I,this.type=y,this.nativeEvent=b,this.target=N,this.currentTarget=null;for(var Y in a)a.hasOwnProperty(Y)&&(f=a[Y],this[Y]=f?f(b):b[Y]);return this.isDefaultPrevented=(b.defaultPrevented!=null?b.defaultPrevented:b.returnValue===!1)?lu:Uv,this.isPropagationStopped=Uv,this}return W(c.prototype,{preventDefault:function(){this.defaultPrevented=!0;var f=this.nativeEvent;f&&(f.preventDefault?f.preventDefault():typeof f.returnValue!="unknown"&&(f.returnValue=!1),this.isDefaultPrevented=lu)},stopPropagation:function(){var f=this.nativeEvent;f&&(f.stopPropagation?f.stopPropagation():typeof f.cancelBubble!="unknown"&&(f.cancelBubble=!0),this.isPropagationStopped=lu)},persist:function(){},isPersistent:lu}),c}var S1={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},i5=un(S1),E2=W({},S1,{view:0,detail:0}),yk=un(E2),s5,a5,x2,cu=W({},E2,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:l5,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!==x2&&(x2&&a.type==="mousemove"?(s5=a.screenX-x2.screenX,a5=a.screenY-x2.screenY):a5=s5=0,x2=a),s5)},movementY:function(a){return"movementY"in a?a.movementY:a5}}),kv=un(cu),Ek=W({},cu,{dataTransfer:0}),xk=un(Ek),wk=W({},E2,{relatedTarget:0}),o5=un(wk),Ck=W({},S1,{animationName:0,elapsedTime:0,pseudoElement:0}),Ik=un(Ck),Mk=W({},S1,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),Sk=un(Mk),Tk=W({},S1,{data:0}),Fv=un(Tk),Bk={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},bk={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"},Rk={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Dk(a){var c=this.nativeEvent;return c.getModifierState?c.getModifierState(a):(a=Rk[a])?!!c[a]:!1}function l5(){return Dk}var Lk=W({},E2,{key:function(a){if(a.key){var c=Bk[a.key]||a.key;if(c!=="Unidentified")return c}return a.type==="keypress"?(a=ou(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?bk[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:l5,charCode:function(a){return a.type==="keypress"?ou(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?ou(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),Nk=un(Lk),Pk=W({},cu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ov=un(Pk),Uk=W({},E2,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:l5}),kk=un(Uk),Fk=W({},S1,{propertyName:0,elapsedTime:0,pseudoElement:0}),Ok=un(Fk),Qk=W({},cu,{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}),zk=un(Qk),Gk=[9,13,27,32],c5=l&&"CompositionEvent"in window,w2=null;l&&"documentMode"in document&&(w2=document.documentMode);var Hk=l&&"TextEvent"in window&&!w2,Qv=l&&(!c5||w2&&8<w2&&11>=w2),zv=String.fromCharCode(32),Gv=!1;function Hv(a,c){switch(a){case"keyup":return Gk.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Vv(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var T1=!1;function Vk(a,c){switch(a){case"compositionend":return Vv(c);case"keypress":return c.which!==32?null:(Gv=!0,zv);case"textInput":return a=c.data,a===zv&&Gv?null:a;default:return null}}function jk(a,c){if(T1)return a==="compositionend"||!c5&&Hv(a,c)?(a=Pv(),au=n5=Ys=null,T1=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1<c.char.length)return c.char;if(c.which)return String.fromCharCode(c.which)}return null;case"compositionend":return Qv&&c.locale!=="ko"?null:c.data;default:return null}}var Wk={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 jv(a){var c=a&&a.nodeName&&a.nodeName.toLowerCase();return c==="input"?!!Wk[a.type]:c==="textarea"}function Wv(a,c,f,y){Be(y),c=pu(c,"onChange"),0<c.length&&(f=new i5("onChange","change",null,f,y),a.push({event:f,listeners:c}))}var C2=null,I2=null;function Yk(a){u_(a,0)}function uu(a){var c=L1(a);if(ut(c))return a}function qk(a,c){if(a==="change")return c}var Yv=!1;if(l){var u5;if(l){var h5="oninput"in document;if(!h5){var qv=document.createElement("div");qv.setAttribute("oninput","return;"),h5=typeof qv.oninput=="function"}u5=h5}else u5=!1;Yv=u5&&(!document.documentMode||9<document.documentMode)}function Xv(){C2&&(C2.detachEvent("onpropertychange",Jv),I2=C2=null)}function Jv(a){if(a.propertyName==="value"&&uu(I2)){var c=[];Wv(c,I2,a,$(a)),lr(Yk,c)}}function Xk(a,c,f){a==="focusin"?(Xv(),C2=c,I2=f,C2.attachEvent("onpropertychange",Jv)):a==="focusout"&&Xv()}function Jk(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return uu(I2)}function Kk(a,c){if(a==="click")return uu(c)}function Zk(a,c){if(a==="input"||a==="change")return uu(c)}function $k(a,c){return a===c&&(a!==0||1/a===1/c)||a!==a&&c!==c}var Yn=typeof Object.is=="function"?Object.is:$k;function M2(a,c){if(Yn(a,c))return!0;if(typeof a!="object"||a===null||typeof c!="object"||c===null)return!1;var f=Object.keys(a),y=Object.keys(c);if(f.length!==y.length)return!1;for(y=0;y<f.length;y++){var I=f[y];if(!h.call(c,I)||!Yn(a[I],c[I]))return!1}return!0}function Kv(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function Zv(a,c){var f=Kv(a);a=0;for(var y;f;){if(f.nodeType===3){if(y=a+f.textContent.length,a<=c&&y>=c)return{node:f,offset:c-a};a=y}e:{for(;f;){if(f.nextSibling){f=f.nextSibling;break e}f=f.parentNode}f=void 0}f=Kv(f)}}function $v(a,c){return a&&c?a===c?!0:a&&a.nodeType===3?!1:c&&c.nodeType===3?$v(a,c.parentNode):"contains"in a?a.contains(c):a.compareDocumentPosition?!!(a.compareDocumentPosition(c)&16):!1:!1}function e_(){for(var a=window,c=mt();c instanceof a.HTMLIFrameElement;){try{var f=typeof c.contentWindow.location.href=="string"}catch{f=!1}if(f)a=c.contentWindow;else break;c=mt(a.document)}return c}function d5(a){var c=a&&a.nodeName&&a.nodeName.toLowerCase();return c&&(c==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||c==="textarea"||a.contentEditable==="true")}function eF(a){var c=e_(),f=a.focusedElem,y=a.selectionRange;if(c!==f&&f&&f.ownerDocument&&$v(f.ownerDocument.documentElement,f)){if(y!==null&&d5(f)){if(c=y.start,a=y.end,a===void 0&&(a=c),"selectionStart"in f)f.selectionStart=c,f.selectionEnd=Math.min(a,f.value.length);else if(a=(c=f.ownerDocument||document)&&c.defaultView||window,a.getSelection){a=a.getSelection();var I=f.textContent.length,b=Math.min(y.start,I);y=y.end===void 0?b:Math.min(y.end,I),!a.extend&&b>y&&(I=y,y=b,b=I),I=Zv(f,b);var N=Zv(f,y);I&&N&&(a.rangeCount!==1||a.anchorNode!==I.node||a.anchorOffset!==I.offset||a.focusNode!==N.node||a.focusOffset!==N.offset)&&(c=c.createRange(),c.setStart(I.node,I.offset),a.removeAllRanges(),b>y?(a.addRange(c),a.extend(N.node,N.offset)):(c.setEnd(N.node,N.offset),a.addRange(c)))}}for(c=[],a=f;a=a.parentNode;)a.nodeType===1&&c.push({element:a,left:a.scrollLeft,top:a.scrollTop});for(typeof f.focus=="function"&&f.focus(),f=0;f<c.length;f++)a=c[f],a.element.scrollLeft=a.left,a.element.scrollTop=a.top}}var tF=l&&"documentMode"in document&&11>=document.documentMode,B1=null,f5=null,S2=null,p5=!1;function t_(a,c,f){var y=f.window===f?f.document:f.nodeType===9?f:f.ownerDocument;p5||B1==null||B1!==mt(y)||(y=B1,"selectionStart"in y&&d5(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}),S2&&M2(S2,y)||(S2=y,y=pu(f5,"onSelect"),0<y.length&&(c=new i5("onSelect","select",null,c,f),a.push({event:c,listeners:y}),c.target=B1)))}function hu(a,c){var f={};return f[a.toLowerCase()]=c.toLowerCase(),f["Webkit"+a]="webkit"+c,f["Moz"+a]="moz"+c,f}var b1={animationend:hu("Animation","AnimationEnd"),animationiteration:hu("Animation","AnimationIteration"),animationstart:hu("Animation","AnimationStart"),transitionend:hu("Transition","TransitionEnd")},A5={},r_={};l&&(r_=document.createElement("div").style,"AnimationEvent"in window||(delete b1.animationend.animation,delete b1.animationiteration.animation,delete b1.animationstart.animation),"TransitionEvent"in window||delete b1.transitionend.transition);function du(a){if(A5[a])return A5[a];if(!b1[a])return a;var c=b1[a],f;for(f in c)if(c.hasOwnProperty(f)&&f in r_)return A5[a]=c[f];return a}var n_=du("animationend"),i_=du("animationiteration"),s_=du("animationstart"),a_=du("transitionend"),o_=new Map,l_="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 qs(a,c){o_.set(a,c),s(c,[a])}for(var g5=0;g5<l_.length;g5++){var m5=l_[g5],rF=m5.toLowerCase(),nF=m5[0].toUpperCase()+m5.slice(1);qs(rF,"on"+nF)}qs(n_,"onAnimationEnd"),qs(i_,"onAnimationIteration"),qs(s_,"onAnimationStart"),qs("dblclick","onDoubleClick"),qs("focusin","onFocus"),qs("focusout","onBlur"),qs(a_,"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 T2="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(" "),iF=new Set("cancel close invalid load scroll toggle".split(" ").concat(T2));function c_(a,c,f){var y=a.type||"unknown-event";a.currentTarget=f,Jc(y,c,void 0,a),a.currentTarget=null}function u_(a,c){c=(c&4)!==0;for(var f=0;f<a.length;f++){var y=a[f],I=y.event;y=y.listeners;e:{var b=void 0;if(c)for(var N=y.length-1;0<=N;N--){var Y=y[N],K=Y.instance,fe=Y.currentTarget;if(Y=Y.listener,K!==b&&I.isPropagationStopped())break e;c_(I,Y,fe),b=K}else for(N=0;N<y.length;N++){if(Y=y[N],K=Y.instance,fe=Y.currentTarget,Y=Y.listener,K!==b&&I.isPropagationStopped())break e;c_(I,Y,fe),b=K}}}if(Wa)throw a=zs,Wa=!1,zs=null,a}function t0(a,c){var f=c[I5];f===void 0&&(f=c[I5]=new Set);var y=a+"__bubble";f.has(y)||(h_(c,a,2,!1),f.add(y))}function v5(a,c,f){var y=0;c&&(y|=4),h_(f,a,y,c)}var fu="_reactListening"+Math.random().toString(36).slice(2);function B2(a){if(!a[fu]){a[fu]=!0,n.forEach(function(f){f!=="selectionchange"&&(iF.has(f)||v5(f,!1,a),v5(f,!0,a))});var c=a.nodeType===9?a:a.ownerDocument;c===null||c[fu]||(c[fu]=!0,v5("selectionchange",!1,c))}}function h_(a,c,f,y){switch(Nv(c)){case 1:var I=vk;break;case 4:I=_k;break;default:I=t5}f=I.bind(null,c,f,a),I=void 0,!Xi||c!=="touchstart"&&c!=="touchmove"&&c!=="wheel"||(I=!0),y?I!==void 0?a.addEventListener(c,f,{capture:!0,passive:I}):a.addEventListener(c,f,!0):I!==void 0?a.addEventListener(c,f,{passive:I}):a.addEventListener(c,f,!1)}function _5(a,c,f,y,I){var b=y;if(!(c&1)&&!(c&2)&&y!==null)e:for(;;){if(y===null)return;var N=y.tag;if(N===3||N===4){var Y=y.stateNode.containerInfo;if(Y===I||Y.nodeType===8&&Y.parentNode===I)break;if(N===4)for(N=y.return;N!==null;){var K=N.tag;if((K===3||K===4)&&(K=N.stateNode.containerInfo,K===I||K.nodeType===8&&K.parentNode===I))return;N=N.return}for(;Y!==null;){if(N=Ya(Y),N===null)return;if(K=N.tag,K===5||K===6){y=b=N;continue e}Y=Y.parentNode}}y=y.return}lr(function(){var fe=b,Ie=$(f),Me=[];e:{var xe=o_.get(a);if(xe!==void 0){var je=i5,Je=a;switch(a){case"keypress":if(ou(f)===0)break e;case"keydown":case"keyup":je=Nk;break;case"focusin":Je="focus",je=o5;break;case"focusout":Je="blur",je=o5;break;case"beforeblur":case"afterblur":je=o5;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":je=kv;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":je=xk;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":je=kk;break;case n_:case i_:case s_:je=Ik;break;case a_:je=Ok;break;case"scroll":je=yk;break;case"wheel":je=zk;break;case"copy":case"cut":case"paste":je=Sk;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":je=Ov}var Ke=(c&4)!==0,x0=!Ke&&a==="scroll",ae=Ke?xe!==null?xe+"Capture":null:xe;Ke=[];for(var ee=fe,ce;ee!==null;){ce=ee;var be=ce.stateNode;if(ce.tag===5&&be!==null&&(ce=be,ae!==null&&(be=cr(ee,ae),be!=null&&Ke.push(b2(ee,be,ce)))),x0)break;ee=ee.return}0<Ke.length&&(xe=new je(xe,Je,null,f,Ie),Me.push({event:xe,listeners:Ke}))}}if(!(c&7)){e:{if(xe=a==="mouseover"||a==="pointerover",je=a==="mouseout"||a==="pointerout",xe&&f!==ht&&(Je=f.relatedTarget||f.fromElement)&&(Ya(Je)||Je[Zi]))break e;if((je||xe)&&(xe=Ie.window===Ie?Ie:(xe=Ie.ownerDocument)?xe.defaultView||xe.parentWindow:window,je?(Je=f.relatedTarget||f.toElement,je=fe,Je=Je?Ya(Je):null,Je!==null&&(x0=mi(Je),Je!==x0||Je.tag!==5&&Je.tag!==6)&&(Je=null)):(je=null,Je=fe),je!==Je)){if(Ke=kv,be="onMouseLeave",ae="onMouseEnter",ee="mouse",(a==="pointerout"||a==="pointerover")&&(Ke=Ov,be="onPointerLeave",ae="onPointerEnter",ee="pointer"),x0=je==null?xe:L1(je),ce=Je==null?xe:L1(Je),xe=new Ke(be,ee+"leave",je,f,Ie),xe.target=x0,xe.relatedTarget=ce,be=null,Ya(Ie)===fe&&(Ke=new Ke(ae,ee+"enter",Je,f,Ie),Ke.target=ce,Ke.relatedTarget=x0,be=Ke),x0=be,je&&Je)t:{for(Ke=je,ae=Je,ee=0,ce=Ke;ce;ce=R1(ce))ee++;for(ce=0,be=ae;be;be=R1(be))ce++;for(;0<ee-ce;)Ke=R1(Ke),ee--;for(;0<ce-ee;)ae=R1(ae),ce--;for(;ee--;){if(Ke===ae||ae!==null&&Ke===ae.alternate)break t;Ke=R1(Ke),ae=R1(ae)}Ke=null}else Ke=null;je!==null&&d_(Me,xe,je,Ke,!1),Je!==null&&x0!==null&&d_(Me,x0,Je,Ke,!0)}}e:{if(xe=fe?L1(fe):window,je=xe.nodeName&&xe.nodeName.toLowerCase(),je==="select"||je==="input"&&xe.type==="file")var $e=qk;else if(jv(xe))if(Yv)$e=Zk;else{$e=Jk;var at=Xk}else(je=xe.nodeName)&&je.toLowerCase()==="input"&&(xe.type==="checkbox"||xe.type==="radio")&&($e=Kk);if($e&&($e=$e(a,fe))){Wv(Me,$e,f,Ie);break e}at&&at(a,xe,fe),a==="focusout"&&(at=xe._wrapperState)&&at.controlled&&xe.type==="number"&&Mt(xe,"number",xe.value)}switch(at=fe?L1(fe):window,a){case"focusin":(jv(at)||at.contentEditable==="true")&&(B1=at,f5=fe,S2=null);break;case"focusout":S2=f5=B1=null;break;case"mousedown":p5=!0;break;case"contextmenu":case"mouseup":case"dragend":p5=!1,t_(Me,f,Ie);break;case"selectionchange":if(tF)break;case"keydown":case"keyup":t_(Me,f,Ie)}var ot;if(c5)e:{switch(a){case"compositionstart":var ft="onCompositionStart";break e;case"compositionend":ft="onCompositionEnd";break e;case"compositionupdate":ft="onCompositionUpdate";break e}ft=void 0}else T1?Hv(a,f)&&(ft="onCompositionEnd"):a==="keydown"&&f.keyCode===229&&(ft="onCompositionStart");ft&&(Qv&&f.locale!=="ko"&&(T1||ft!=="onCompositionStart"?ft==="onCompositionEnd"&&T1&&(ot=Pv()):(Ys=Ie,n5="value"in Ys?Ys.value:Ys.textContent,T1=!0)),at=pu(fe,ft),0<at.length&&(ft=new Fv(ft,a,null,f,Ie),Me.push({event:ft,listeners:at}),ot?ft.data=ot:(ot=Vv(f),ot!==null&&(ft.data=ot)))),(ot=Hk?Vk(a,f):jk(a,f))&&(fe=pu(fe,"onBeforeInput"),0<fe.length&&(Ie=new Fv("onBeforeInput","beforeinput",null,f,Ie),Me.push({event:Ie,listeners:fe}),Ie.data=ot))}u_(Me,c)})}function b2(a,c,f){return{instance:a,listener:c,currentTarget:f}}function pu(a,c){for(var f=c+"Capture",y=[];a!==null;){var I=a,b=I.stateNode;I.tag===5&&b!==null&&(I=b,b=cr(a,f),b!=null&&y.unshift(b2(a,b,I)),b=cr(a,c),b!=null&&y.push(b2(a,b,I))),a=a.return}return y}function R1(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5);return a||null}function d_(a,c,f,y,I){for(var b=c._reactName,N=[];f!==null&&f!==y;){var Y=f,K=Y.alternate,fe=Y.stateNode;if(K!==null&&K===y)break;Y.tag===5&&fe!==null&&(Y=fe,I?(K=cr(f,b),K!=null&&N.unshift(b2(f,K,Y))):I||(K=cr(f,b),K!=null&&N.push(b2(f,K,Y)))),f=f.return}N.length!==0&&a.push({event:c,listeners:N})}var sF=/\r\n?/g,aF=/\u0000|\uFFFD/g;function f_(a){return(typeof a=="string"?a:""+a).replace(sF,`
4722
4722
  `).replace(aF,"")}function Au(a,c,f){if(c=f_(c),f_(a)!==c&&f)throw Error(t(425))}function gu(){}var y5=null,E5=null;function x5(a,c){return a==="textarea"||a==="noscript"||typeof c.children=="string"||typeof c.children=="number"||typeof c.dangerouslySetInnerHTML=="object"&&c.dangerouslySetInnerHTML!==null&&c.dangerouslySetInnerHTML.__html!=null}var w5=typeof setTimeout=="function"?setTimeout:void 0,oF=typeof clearTimeout=="function"?clearTimeout:void 0,p_=typeof Promise=="function"?Promise:void 0,lF=typeof queueMicrotask=="function"?queueMicrotask:typeof p_<"u"?function(a){return p_.resolve(null).then(a).catch(cF)}:w5;function cF(a){setTimeout(function(){throw a})}function C5(a,c){var f=c,y=0;do{var I=f.nextSibling;if(a.removeChild(f),I&&I.nodeType===8)if(f=I.data,f==="/$"){if(y===0){a.removeChild(I),y2(c);return}y--}else f!=="$"&&f!=="$?"&&f!=="$!"||y++;f=I}while(f);y2(c)}function Xs(a){for(;a!=null;a=a.nextSibling){var c=a.nodeType;if(c===1||c===3)break;if(c===8){if(c=a.data,c==="$"||c==="$!"||c==="$?")break;if(c==="/$")return null}}return a}function A_(a){a=a.previousSibling;for(var c=0;a;){if(a.nodeType===8){var f=a.data;if(f==="$"||f==="$!"||f==="$?"){if(c===0)return a;c--}else f==="/$"&&c++}a=a.previousSibling}return null}var D1=Math.random().toString(36).slice(2),_i="__reactFiber$"+D1,R2="__reactProps$"+D1,Zi="__reactContainer$"+D1,I5="__reactEvents$"+D1,uF="__reactListeners$"+D1,hF="__reactHandles$"+D1;function Ya(a){var c=a[_i];if(c)return c;for(var f=a.parentNode;f;){if(c=f[Zi]||f[_i]){if(f=c.alternate,c.child!==null||f!==null&&f.child!==null)for(a=A_(a);a!==null;){if(f=a[_i])return f;a=A_(a)}return c}a=f,f=a.parentNode}return null}function D2(a){return a=a[_i]||a[Zi],!a||a.tag!==5&&a.tag!==6&&a.tag!==13&&a.tag!==3?null:a}function L1(a){if(a.tag===5||a.tag===6)return a.stateNode;throw Error(t(33))}function mu(a){return a[R2]||null}var M5=[],N1=-1;function Js(a){return{current:a}}function r0(a){0>N1||(a.current=M5[N1],M5[N1]=null,N1--)}function Zt(a,c){N1++,M5[N1]=a.current,a.current=c}var Ks={},yr=Js(Ks),jr=Js(!1),qa=Ks;function P1(a,c){var f=a.type.contextTypes;if(!f)return Ks;var y=a.stateNode;if(y&&y.__reactInternalMemoizedUnmaskedChildContext===c)return y.__reactInternalMemoizedMaskedChildContext;var I={},b;for(b in f)I[b]=c[b];return y&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=c,a.__reactInternalMemoizedMaskedChildContext=I),I}function Wr(a){return a=a.childContextTypes,a!=null}function vu(){r0(jr),r0(yr)}function g_(a,c,f){if(yr.current!==Ks)throw Error(t(168));Zt(yr,c),Zt(jr,f)}function m_(a,c,f){var y=a.stateNode;if(c=c.childContextTypes,typeof y.getChildContext!="function")return f;y=y.getChildContext();for(var I in y)if(!(I in c))throw Error(t(108,Ae(a)||"Unknown",I));return W({},f,y)}function _u(a){return a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||Ks,qa=yr.current,Zt(yr,a),Zt(jr,jr.current),!0}function v_(a,c,f){var y=a.stateNode;if(!y)throw Error(t(169));f?(a=m_(a,c,qa),y.__reactInternalMemoizedMergedChildContext=a,r0(jr),r0(yr),Zt(yr,a)):r0(jr),Zt(jr,f)}var $i=null,yu=!1,S5=!1;function __(a){$i===null?$i=[a]:$i.push(a)}function dF(a){yu=!0,__(a)}function Zs(){if(!S5&&$i!==null){S5=!0;var a=0,c=Lt;try{var f=$i;for(Lt=1;a<f.length;a++){var y=f[a];do y=y(!0);while(y!==null)}$i=null,yu=!1}catch(I){throw $i!==null&&($i=$i.slice(a+1)),tu(Ce,Zs),I}finally{Lt=c,S5=!1}}return null}var U1=[],k1=0,Eu=null,xu=0,Bn=[],bn=0,Xa=null,es=1,ts="";function Ja(a,c){U1[k1++]=xu,U1[k1++]=Eu,Eu=a,xu=c}function y_(a,c,f){Bn[bn++]=es,Bn[bn++]=ts,Bn[bn++]=Xa,Xa=a;var y=es;a=ts;var I=32-Et(y)-1;y&=~(1<<I),f+=1;var b=32-Et(c)+I;if(30<b){var N=I-I%5;b=(y&(1<<N)-1).toString(32),y>>=N,I-=N,es=1<<32-Et(c)+I|f<<I|y,ts=b+a}else es=1<<b|f<<I|y,ts=a}function T5(a){a.return!==null&&(Ja(a,1),y_(a,1,0))}function B5(a){for(;a===Eu;)Eu=U1[--k1],U1[k1]=null,xu=U1[--k1],U1[k1]=null;for(;a===Xa;)Xa=Bn[--bn],Bn[bn]=null,ts=Bn[--bn],Bn[bn]=null,es=Bn[--bn],Bn[bn]=null}var hn=null,dn=null,o0=!1,qn=null;function E_(a,c){var f=Nn(5,null,null,0);f.elementType="DELETED",f.stateNode=c,f.return=a,c=a.deletions,c===null?(a.deletions=[f],a.flags|=16):c.push(f)}function x_(a,c){switch(a.tag){case 5:var f=a.type;return c=c.nodeType!==1||f.toLowerCase()!==c.nodeName.toLowerCase()?null:c,c!==null?(a.stateNode=c,hn=a,dn=Xs(c.firstChild),!0):!1;case 6:return c=a.pendingProps===""||c.nodeType!==3?null:c,c!==null?(a.stateNode=c,hn=a,dn=null,!0):!1;case 13:return c=c.nodeType!==8?null:c,c!==null?(f=Xa!==null?{id:es,overflow:ts}:null,a.memoizedState={dehydrated:c,treeContext:f,retryLane:1073741824},f=Nn(18,null,null,0),f.stateNode=c,f.return=a,a.child=f,hn=a,dn=null,!0):!1;default:return!1}}function b5(a){return(a.mode&1)!==0&&(a.flags&128)===0}function R5(a){if(o0){var c=dn;if(c){var f=c;if(!x_(a,c)){if(b5(a))throw Error(t(418));c=Xs(f.nextSibling);var y=hn;c&&x_(a,c)?E_(y,f):(a.flags=a.flags&-4097|2,o0=!1,hn=a)}}else{if(b5(a))throw Error(t(418));a.flags=a.flags&-4097|2,o0=!1,hn=a}}}function w_(a){for(a=a.return;a!==null&&a.tag!==5&&a.tag!==3&&a.tag!==13;)a=a.return;hn=a}function wu(a){if(a!==hn)return!1;if(!o0)return w_(a),o0=!0,!1;var c;if((c=a.tag!==3)&&!(c=a.tag!==5)&&(c=a.type,c=c!=="head"&&c!=="body"&&!x5(a.type,a.memoizedProps)),c&&(c=dn)){if(b5(a))throw C_(),Error(t(418));for(;c;)E_(a,c),c=Xs(c.nextSibling)}if(w_(a),a.tag===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(t(317));e:{for(a=a.nextSibling,c=0;a;){if(a.nodeType===8){var f=a.data;if(f==="/$"){if(c===0){dn=Xs(a.nextSibling);break e}c--}else f!=="$"&&f!=="$!"&&f!=="$?"||c++}a=a.nextSibling}dn=null}}else dn=hn?Xs(a.stateNode.nextSibling):null;return!0}function C_(){for(var a=dn;a;)a=Xs(a.nextSibling)}function F1(){dn=hn=null,o0=!1}function D5(a){qn===null?qn=[a]:qn.push(a)}var fF=w.ReactCurrentBatchConfig;function L2(a,c,f){if(a=f.ref,a!==null&&typeof a!="function"&&typeof a!="object"){if(f._owner){if(f=f._owner,f){if(f.tag!==1)throw Error(t(309));var y=f.stateNode}if(!y)throw Error(t(147,a));var I=y,b=""+a;return c!==null&&c.ref!==null&&typeof c.ref=="function"&&c.ref._stringRef===b?c.ref:(c=function(N){var Y=I.refs;N===null?delete Y[b]:Y[b]=N},c._stringRef=b,c)}if(typeof a!="string")throw Error(t(284));if(!f._owner)throw Error(t(290,a))}return a}function Cu(a,c){throw a=Object.prototype.toString.call(c),Error(t(31,a==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":a))}function I_(a){var c=a._init;return c(a._payload)}function M_(a){function c(ae,ee){if(a){var ce=ae.deletions;ce===null?(ae.deletions=[ee],ae.flags|=16):ce.push(ee)}}function f(ae,ee){if(!a)return null;for(;ee!==null;)c(ae,ee),ee=ee.sibling;return null}function y(ae,ee){for(ae=new Map;ee!==null;)ee.key!==null?ae.set(ee.key,ee):ae.set(ee.index,ee),ee=ee.sibling;return ae}function I(ae,ee){return ae=aa(ae,ee),ae.index=0,ae.sibling=null,ae}function b(ae,ee,ce){return ae.index=ce,a?(ce=ae.alternate,ce!==null?(ce=ce.index,ce<ee?(ae.flags|=2,ee):ce):(ae.flags|=2,ee)):(ae.flags|=1048576,ee)}function N(ae){return a&&ae.alternate===null&&(ae.flags|=2),ae}function Y(ae,ee,ce,be){return ee===null||ee.tag!==6?(ee=w6(ce,ae.mode,be),ee.return=ae,ee):(ee=I(ee,ce),ee.return=ae,ee)}function K(ae,ee,ce,be){var $e=ce.type;return $e===S?Ie(ae,ee,ce.props.children,be,ce.key):ee!==null&&(ee.elementType===$e||typeof $e=="object"&&$e!==null&&$e.$$typeof===q&&I_($e)===ee.type)?(be=I(ee,ce.props),be.ref=L2(ae,ee,ce),be.return=ae,be):(be=qu(ce.type,ce.key,ce.props,null,ae.mode,be),be.ref=L2(ae,ee,ce),be.return=ae,be)}function fe(ae,ee,ce,be){return ee===null||ee.tag!==4||ee.stateNode.containerInfo!==ce.containerInfo||ee.stateNode.implementation!==ce.implementation?(ee=C6(ce,ae.mode,be),ee.return=ae,ee):(ee=I(ee,ce.children||[]),ee.return=ae,ee)}function Ie(ae,ee,ce,be,$e){return ee===null||ee.tag!==7?(ee=io(ce,ae.mode,be,$e),ee.return=ae,ee):(ee=I(ee,ce),ee.return=ae,ee)}function Me(ae,ee,ce){if(typeof ee=="string"&&ee!==""||typeof ee=="number")return ee=w6(""+ee,ae.mode,ce),ee.return=ae,ee;if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case B:return ce=qu(ee.type,ee.key,ee.props,null,ae.mode,ce),ce.ref=L2(ae,null,ee),ce.return=ae,ce;case T:return ee=C6(ee,ae.mode,ce),ee.return=ae,ee;case q:var be=ee._init;return Me(ae,be(ee._payload),ce)}if(Ye(ee)||te(ee))return ee=io(ee,ae.mode,ce,null),ee.return=ae,ee;Cu(ae,ee)}return null}function xe(ae,ee,ce,be){var $e=ee!==null?ee.key:null;if(typeof ce=="string"&&ce!==""||typeof ce=="number")return $e!==null?null:Y(ae,ee,""+ce,be);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case B:return ce.key===$e?K(ae,ee,ce,be):null;case T:return ce.key===$e?fe(ae,ee,ce,be):null;case q:return $e=ce._init,xe(ae,ee,$e(ce._payload),be)}if(Ye(ce)||te(ce))return $e!==null?null:Ie(ae,ee,ce,be,null);Cu(ae,ce)}return null}function je(ae,ee,ce,be,$e){if(typeof be=="string"&&be!==""||typeof be=="number")return ae=ae.get(ce)||null,Y(ee,ae,""+be,$e);if(typeof be=="object"&&be!==null){switch(be.$$typeof){case B:return ae=ae.get(be.key===null?ce:be.key)||null,K(ee,ae,be,$e);case T:return ae=ae.get(be.key===null?ce:be.key)||null,fe(ee,ae,be,$e);case q:var at=be._init;return je(ae,ee,ce,at(be._payload),$e)}if(Ye(be)||te(be))return ae=ae.get(ce)||null,Ie(ee,ae,be,$e,null);Cu(ee,be)}return null}function Je(ae,ee,ce,be){for(var $e=null,at=null,ot=ee,ft=ee=0,nr=null;ot!==null&&ft<ce.length;ft++){ot.index>ft?(nr=ot,ot=null):nr=ot.sibling;var Pt=xe(ae,ot,ce[ft],be);if(Pt===null){ot===null&&(ot=nr);break}a&&ot&&Pt.alternate===null&&c(ae,ot),ee=b(Pt,ee,ft),at===null?$e=Pt:at.sibling=Pt,at=Pt,ot=nr}if(ft===ce.length)return f(ae,ot),o0&&Ja(ae,ft),$e;if(ot===null){for(;ft<ce.length;ft++)ot=Me(ae,ce[ft],be),ot!==null&&(ee=b(ot,ee,ft),at===null?$e=ot:at.sibling=ot,at=ot);return o0&&Ja(ae,ft),$e}for(ot=y(ae,ot);ft<ce.length;ft++)nr=je(ot,ae,ft,ce[ft],be),nr!==null&&(a&&nr.alternate!==null&&ot.delete(nr.key===null?ft:nr.key),ee=b(nr,ee,ft),at===null?$e=nr:at.sibling=nr,at=nr);return a&&ot.forEach(function(oa){return c(ae,oa)}),o0&&Ja(ae,ft),$e}function Ke(ae,ee,ce,be){var $e=te(ce);if(typeof $e!="function")throw Error(t(150));if(ce=$e.call(ce),ce==null)throw Error(t(151));for(var at=$e=null,ot=ee,ft=ee=0,nr=null,Pt=ce.next();ot!==null&&!Pt.done;ft++,Pt=ce.next()){ot.index>ft?(nr=ot,ot=null):nr=ot.sibling;var oa=xe(ae,ot,Pt.value,be);if(oa===null){ot===null&&(ot=nr);break}a&&ot&&oa.alternate===null&&c(ae,ot),ee=b(oa,ee,ft),at===null?$e=oa:at.sibling=oa,at=oa,ot=nr}if(Pt.done)return f(ae,ot),o0&&Ja(ae,ft),$e;if(ot===null){for(;!Pt.done;ft++,Pt=ce.next())Pt=Me(ae,Pt.value,be),Pt!==null&&(ee=b(Pt,ee,ft),at===null?$e=Pt:at.sibling=Pt,at=Pt);return o0&&Ja(ae,ft),$e}for(ot=y(ae,ot);!Pt.done;ft++,Pt=ce.next())Pt=je(ot,ae,ft,Pt.value,be),Pt!==null&&(a&&Pt.alternate!==null&&ot.delete(Pt.key===null?ft:Pt.key),ee=b(Pt,ee,ft),at===null?$e=Pt:at.sibling=Pt,at=Pt);return a&&ot.forEach(function(WF){return c(ae,WF)}),o0&&Ja(ae,ft),$e}function x0(ae,ee,ce,be){if(typeof ce=="object"&&ce!==null&&ce.type===S&&ce.key===null&&(ce=ce.props.children),typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case B:e:{for(var $e=ce.key,at=ee;at!==null;){if(at.key===$e){if($e=ce.type,$e===S){if(at.tag===7){f(ae,at.sibling),ee=I(at,ce.props.children),ee.return=ae,ae=ee;break e}}else if(at.elementType===$e||typeof $e=="object"&&$e!==null&&$e.$$typeof===q&&I_($e)===at.type){f(ae,at.sibling),ee=I(at,ce.props),ee.ref=L2(ae,at,ce),ee.return=ae,ae=ee;break e}f(ae,at);break}else c(ae,at);at=at.sibling}ce.type===S?(ee=io(ce.props.children,ae.mode,be,ce.key),ee.return=ae,ae=ee):(be=qu(ce.type,ce.key,ce.props,null,ae.mode,be),be.ref=L2(ae,ee,ce),be.return=ae,ae=be)}return N(ae);case T:e:{for(at=ce.key;ee!==null;){if(ee.key===at)if(ee.tag===4&&ee.stateNode.containerInfo===ce.containerInfo&&ee.stateNode.implementation===ce.implementation){f(ae,ee.sibling),ee=I(ee,ce.children||[]),ee.return=ae,ae=ee;break e}else{f(ae,ee);break}else c(ae,ee);ee=ee.sibling}ee=C6(ce,ae.mode,be),ee.return=ae,ae=ee}return N(ae);case q:return at=ce._init,x0(ae,ee,at(ce._payload),be)}if(Ye(ce))return Je(ae,ee,ce,be);if(te(ce))return Ke(ae,ee,ce,be);Cu(ae,ce)}return typeof ce=="string"&&ce!==""||typeof ce=="number"?(ce=""+ce,ee!==null&&ee.tag===6?(f(ae,ee.sibling),ee=I(ee,ce),ee.return=ae,ae=ee):(f(ae,ee),ee=w6(ce,ae.mode,be),ee.return=ae,ae=ee),N(ae)):f(ae,ee)}return x0}var O1=M_(!0),S_=M_(!1),Iu=Js(null),Mu=null,Q1=null,L5=null;function N5(){L5=Q1=Mu=null}function P5(a){var c=Iu.current;r0(Iu),a._currentValue=c}function U5(a,c,f){for(;a!==null;){var y=a.alternate;if((a.childLanes&c)!==c?(a.childLanes|=c,y!==null&&(y.childLanes|=c)):y!==null&&(y.childLanes&c)!==c&&(y.childLanes|=c),a===f)break;a=a.return}}function z1(a,c){Mu=a,L5=Q1=null,a=a.dependencies,a!==null&&a.firstContext!==null&&(a.lanes&c&&(Yr=!0),a.firstContext=null)}function Rn(a){var c=a._currentValue;if(L5!==a)if(a={context:a,memoizedValue:c,next:null},Q1===null){if(Mu===null)throw Error(t(308));Q1=a,Mu.dependencies={lanes:0,firstContext:a}}else Q1=Q1.next=a;return c}var Ka=null;function k5(a){Ka===null?Ka=[a]:Ka.push(a)}function T_(a,c,f,y){var I=c.interleaved;return I===null?(f.next=f,k5(c)):(f.next=I.next,I.next=f),c.interleaved=f,rs(a,y)}function rs(a,c){a.lanes|=c;var f=a.alternate;for(f!==null&&(f.lanes|=c),f=a,a=a.return;a!==null;)a.childLanes|=c,f=a.alternate,f!==null&&(f.childLanes|=c),f=a,a=a.return;return f.tag===3?f.stateNode:null}var $s=!1;function F5(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function B_(a,c){a=a.updateQueue,c.updateQueue===a&&(c.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,effects:a.effects})}function ns(a,c){return{eventTime:a,lane:c,tag:0,payload:null,callback:null,next:null}}function ea(a,c,f){var y=a.updateQueue;if(y===null)return null;if(y=y.shared,Nt&2){var I=y.pending;return I===null?c.next=c:(c.next=I.next,I.next=c),y.pending=c,rs(a,f)}return I=y.interleaved,I===null?(c.next=c,k5(y)):(c.next=I.next,I.next=c),y.interleaved=c,rs(a,f)}function Su(a,c,f){if(c=c.updateQueue,c!==null&&(c=c.shared,(f&4194240)!==0)){var y=c.lanes;y&=a.pendingLanes,f|=y,c.lanes=f,Rr(a,f)}}function b_(a,c){var f=a.updateQueue,y=a.alternate;if(y!==null&&(y=y.updateQueue,f===y)){var I=null,b=null;if(f=f.firstBaseUpdate,f!==null){do{var N={eventTime:f.eventTime,lane:f.lane,tag:f.tag,payload:f.payload,callback:f.callback,next:null};b===null?I=b=N:b=b.next=N,f=f.next}while(f!==null);b===null?I=b=c:b=b.next=c}else I=b=c;f={baseState:y.baseState,firstBaseUpdate:I,lastBaseUpdate:b,shared:y.shared,effects:y.effects},a.updateQueue=f;return}a=f.lastBaseUpdate,a===null?f.firstBaseUpdate=c:a.next=c,f.lastBaseUpdate=c}function Tu(a,c,f,y){var I=a.updateQueue;$s=!1;var b=I.firstBaseUpdate,N=I.lastBaseUpdate,Y=I.shared.pending;if(Y!==null){I.shared.pending=null;var K=Y,fe=K.next;K.next=null,N===null?b=fe:N.next=fe,N=K;var Ie=a.alternate;Ie!==null&&(Ie=Ie.updateQueue,Y=Ie.lastBaseUpdate,Y!==N&&(Y===null?Ie.firstBaseUpdate=fe:Y.next=fe,Ie.lastBaseUpdate=K))}if(b!==null){var Me=I.baseState;N=0,Ie=fe=K=null,Y=b;do{var xe=Y.lane,je=Y.eventTime;if((y&xe)===xe){Ie!==null&&(Ie=Ie.next={eventTime:je,lane:0,tag:Y.tag,payload:Y.payload,callback:Y.callback,next:null});e:{var Je=a,Ke=Y;switch(xe=c,je=f,Ke.tag){case 1:if(Je=Ke.payload,typeof Je=="function"){Me=Je.call(je,Me,xe);break e}Me=Je;break e;case 3:Je.flags=Je.flags&-65537|128;case 0:if(Je=Ke.payload,xe=typeof Je=="function"?Je.call(je,Me,xe):Je,xe==null)break e;Me=W({},Me,xe);break e;case 2:$s=!0}}Y.callback!==null&&Y.lane!==0&&(a.flags|=64,xe=I.effects,xe===null?I.effects=[Y]:xe.push(Y))}else je={eventTime:je,lane:xe,tag:Y.tag,payload:Y.payload,callback:Y.callback,next:null},Ie===null?(fe=Ie=je,K=Me):Ie=Ie.next=je,N|=xe;if(Y=Y.next,Y===null){if(Y=I.shared.pending,Y===null)break;xe=Y,Y=xe.next,xe.next=null,I.lastBaseUpdate=xe,I.shared.pending=null}}while(1);if(Ie===null&&(K=Me),I.baseState=K,I.firstBaseUpdate=fe,I.lastBaseUpdate=Ie,c=I.shared.interleaved,c!==null){I=c;do N|=I.lane,I=I.next;while(I!==c)}else b===null&&(I.shared.lanes=0);eo|=N,a.lanes=N,a.memoizedState=Me}}function R_(a,c,f){if(a=c.effects,c.effects=null,a!==null)for(c=0;c<a.length;c++){var y=a[c],I=y.callback;if(I!==null){if(y.callback=null,y=f,typeof I!="function")throw Error(t(191,I));I.call(y)}}}var N2={},yi=Js(N2),P2=Js(N2),U2=Js(N2);function Za(a){if(a===N2)throw Error(t(174));return a}function O5(a,c){switch(Zt(U2,c),Zt(P2,a),Zt(yi,N2),a=c.nodeType,a){case 9:case 11:c=(c=c.documentElement)?c.namespaceURI:Ge(null,"");break;default:a=a===8?c.parentNode:c,c=a.namespaceURI||null,a=a.tagName,c=Ge(c,a)}r0(yi),Zt(yi,c)}function G1(){r0(yi),r0(P2),r0(U2)}function D_(a){Za(U2.current);var c=Za(yi.current),f=Ge(c,a.type);c!==f&&(Zt(P2,a),Zt(yi,f))}function Q5(a){P2.current===a&&(r0(yi),r0(P2))}var d0=Js(0);function Bu(a){for(var c=a;c!==null;){if(c.tag===13){var f=c.memoizedState;if(f!==null&&(f=f.dehydrated,f===null||f.data==="$?"||f.data==="$!"))return c}else if(c.tag===19&&c.memoizedProps.revealOrder!==void 0){if(c.flags&128)return c}else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===a)break;for(;c.sibling===null;){if(c.return===null||c.return===a)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}var z5=[];function G5(){for(var a=0;a<z5.length;a++)z5[a]._workInProgressVersionPrimary=null;z5.length=0}var bu=w.ReactCurrentDispatcher,H5=w.ReactCurrentBatchConfig,$a=0,f0=null,G0=null,tr=null,Ru=!1,k2=!1,F2=0,pF=0;function Er(){throw Error(t(321))}function V5(a,c){if(c===null)return!1;for(var f=0;f<c.length&&f<a.length;f++)if(!Yn(a[f],c[f]))return!1;return!0}function j5(a,c,f,y,I,b){if($a=b,f0=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,bu.current=a===null||a.memoizedState===null?vF:_F,a=f(y,I),k2){b=0;do{if(k2=!1,F2=0,25<=b)throw Error(t(301));b+=1,tr=G0=null,c.updateQueue=null,bu.current=yF,a=f(y,I)}while(k2)}if(bu.current=Nu,c=G0!==null&&G0.next!==null,$a=0,tr=G0=f0=null,Ru=!1,c)throw Error(t(300));return a}function W5(){var a=F2!==0;return F2=0,a}function Ei(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return tr===null?f0.memoizedState=tr=a:tr=tr.next=a,tr}function Dn(){if(G0===null){var a=f0.alternate;a=a!==null?a.memoizedState:null}else a=G0.next;var c=tr===null?f0.memoizedState:tr.next;if(c!==null)tr=c,G0=a;else{if(a===null)throw Error(t(310));G0=a,a={memoizedState:G0.memoizedState,baseState:G0.baseState,baseQueue:G0.baseQueue,queue:G0.queue,next:null},tr===null?f0.memoizedState=tr=a:tr=tr.next=a}return tr}function O2(a,c){return typeof c=="function"?c(a):c}function Y5(a){var c=Dn(),f=c.queue;if(f===null)throw Error(t(311));f.lastRenderedReducer=a;var y=G0,I=y.baseQueue,b=f.pending;if(b!==null){if(I!==null){var N=I.next;I.next=b.next,b.next=N}y.baseQueue=I=b,f.pending=null}if(I!==null){b=I.next,y=y.baseState;var Y=N=null,K=null,fe=b;do{var Ie=fe.lane;if(($a&Ie)===Ie)K!==null&&(K=K.next={lane:0,action:fe.action,hasEagerState:fe.hasEagerState,eagerState:fe.eagerState,next:null}),y=fe.hasEagerState?fe.eagerState:a(y,fe.action);else{var Me={lane:Ie,action:fe.action,hasEagerState:fe.hasEagerState,eagerState:fe.eagerState,next:null};K===null?(Y=K=Me,N=y):K=K.next=Me,f0.lanes|=Ie,eo|=Ie}fe=fe.next}while(fe!==null&&fe!==b);K===null?N=y:K.next=Y,Yn(y,c.memoizedState)||(Yr=!0),c.memoizedState=y,c.baseState=N,c.baseQueue=K,f.lastRenderedState=y}if(a=f.interleaved,a!==null){I=a;do b=I.lane,f0.lanes|=b,eo|=b,I=I.next;while(I!==a)}else I===null&&(f.lanes=0);return[c.memoizedState,f.dispatch]}function q5(a){var c=Dn(),f=c.queue;if(f===null)throw Error(t(311));f.lastRenderedReducer=a;var y=f.dispatch,I=f.pending,b=c.memoizedState;if(I!==null){f.pending=null;var N=I=I.next;do b=a(b,N.action),N=N.next;while(N!==I);Yn(b,c.memoizedState)||(Yr=!0),c.memoizedState=b,c.baseQueue===null&&(c.baseState=b),f.lastRenderedState=b}return[b,y]}function L_(){}function N_(a,c){var f=f0,y=Dn(),I=c(),b=!Yn(y.memoizedState,I);if(b&&(y.memoizedState=I,Yr=!0),y=y.queue,X5(k_.bind(null,f,y,a),[a]),y.getSnapshot!==c||b||tr!==null&&tr.memoizedState.tag&1){if(f.flags|=2048,Q2(9,U_.bind(null,f,y,I,c),void 0,null),rr===null)throw Error(t(349));$a&30||P_(f,c,I)}return I}function P_(a,c,f){a.flags|=16384,a={getSnapshot:c,value:f},c=f0.updateQueue,c===null?(c={lastEffect:null,stores:null},f0.updateQueue=c,c.stores=[a]):(f=c.stores,f===null?c.stores=[a]:f.push(a))}function U_(a,c,f,y){c.value=f,c.getSnapshot=y,F_(c)&&O_(a)}function k_(a,c,f){return f(function(){F_(c)&&O_(a)})}function F_(a){var c=a.getSnapshot;a=a.value;try{var f=c();return!Yn(a,f)}catch{return!0}}function O_(a){var c=rs(a,1);c!==null&&Zn(c,a,1,-1)}function Q_(a){var c=Ei();return typeof a=="function"&&(a=a()),c.memoizedState=c.baseState=a,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:O2,lastRenderedState:a},c.queue=a,a=a.dispatch=mF.bind(null,f0,a),[c.memoizedState,a]}function Q2(a,c,f,y){return a={tag:a,create:c,destroy:f,deps:y,next:null},c=f0.updateQueue,c===null?(c={lastEffect:null,stores:null},f0.updateQueue=c,c.lastEffect=a.next=a):(f=c.lastEffect,f===null?c.lastEffect=a.next=a:(y=f.next,f.next=a,a.next=y,c.lastEffect=a)),a}function z_(){return Dn().memoizedState}function Du(a,c,f,y){var I=Ei();f0.flags|=a,I.memoizedState=Q2(1|c,f,void 0,y===void 0?null:y)}function Lu(a,c,f,y){var I=Dn();y=y===void 0?null:y;var b=void 0;if(G0!==null){var N=G0.memoizedState;if(b=N.destroy,y!==null&&V5(y,N.deps)){I.memoizedState=Q2(c,f,b,y);return}}f0.flags|=a,I.memoizedState=Q2(1|c,f,b,y)}function G_(a,c){return Du(8390656,8,a,c)}function X5(a,c){return Lu(2048,8,a,c)}function H_(a,c){return Lu(4,2,a,c)}function V_(a,c){return Lu(4,4,a,c)}function j_(a,c){if(typeof c=="function")return a=a(),c(a),function(){c(null)};if(c!=null)return a=a(),c.current=a,function(){c.current=null}}function W_(a,c,f){return f=f!=null?f.concat([a]):null,Lu(4,4,j_.bind(null,c,a),f)}function J5(){}function Y_(a,c){var f=Dn();c=c===void 0?null:c;var y=f.memoizedState;return y!==null&&c!==null&&V5(c,y[1])?y[0]:(f.memoizedState=[a,c],a)}function q_(a,c){var f=Dn();c=c===void 0?null:c;var y=f.memoizedState;return y!==null&&c!==null&&V5(c,y[1])?y[0]:(a=a(),f.memoizedState=[a,c],a)}function X_(a,c,f){return $a&21?(Yn(f,c)||(f=Xt(),f0.lanes|=f,eo|=f,a.baseState=!0),c):(a.baseState&&(a.baseState=!1,Yr=!0),a.memoizedState=f)}function AF(a,c){var f=Lt;Lt=f!==0&&4>f?f:4,a(!0);var y=H5.transition;H5.transition={};try{a(!1),c()}finally{Lt=f,H5.transition=y}}function J_(){return Dn().memoizedState}function gF(a,c,f){var y=ia(a);if(f={lane:y,action:f,hasEagerState:!1,eagerState:null,next:null},K_(a))Z_(c,f);else if(f=T_(a,c,f,y),f!==null){var I=Lr();Zn(f,a,y,I),$_(f,c,y)}}function mF(a,c,f){var y=ia(a),I={lane:y,action:f,hasEagerState:!1,eagerState:null,next:null};if(K_(a))Z_(c,I);else{var b=a.alternate;if(a.lanes===0&&(b===null||b.lanes===0)&&(b=c.lastRenderedReducer,b!==null))try{var N=c.lastRenderedState,Y=b(N,f);if(I.hasEagerState=!0,I.eagerState=Y,Yn(Y,N)){var K=c.interleaved;K===null?(I.next=I,k5(c)):(I.next=K.next,K.next=I),c.interleaved=I;return}}catch{}finally{}f=T_(a,c,I,y),f!==null&&(I=Lr(),Zn(f,a,y,I),$_(f,c,y))}}function K_(a){var c=a.alternate;return a===f0||c!==null&&c===f0}function Z_(a,c){k2=Ru=!0;var f=a.pending;f===null?c.next=c:(c.next=f.next,f.next=c),a.pending=c}function $_(a,c,f){if(f&4194240){var y=c.lanes;y&=a.pendingLanes,f|=y,c.lanes=f,Rr(a,f)}}var Nu={readContext:Rn,useCallback:Er,useContext:Er,useEffect:Er,useImperativeHandle:Er,useInsertionEffect:Er,useLayoutEffect:Er,useMemo:Er,useReducer:Er,useRef:Er,useState:Er,useDebugValue:Er,useDeferredValue:Er,useTransition:Er,useMutableSource:Er,useSyncExternalStore:Er,useId:Er,unstable_isNewReconciler:!1},vF={readContext:Rn,useCallback:function(a,c){return Ei().memoizedState=[a,c===void 0?null:c],a},useContext:Rn,useEffect:G_,useImperativeHandle:function(a,c,f){return f=f!=null?f.concat([a]):null,Du(4194308,4,j_.bind(null,c,a),f)},useLayoutEffect:function(a,c){return Du(4194308,4,a,c)},useInsertionEffect:function(a,c){return Du(4,2,a,c)},useMemo:function(a,c){var f=Ei();return c=c===void 0?null:c,a=a(),f.memoizedState=[a,c],a},useReducer:function(a,c,f){var y=Ei();return c=f!==void 0?f(c):c,y.memoizedState=y.baseState=c,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:c},y.queue=a,a=a.dispatch=gF.bind(null,f0,a),[y.memoizedState,a]},useRef:function(a){var c=Ei();return a={current:a},c.memoizedState=a},useState:Q_,useDebugValue:J5,useDeferredValue:function(a){return Ei().memoizedState=a},useTransition:function(){var a=Q_(!1),c=a[0];return a=AF.bind(null,a[1]),Ei().memoizedState=a,[c,a]},useMutableSource:function(){},useSyncExternalStore:function(a,c,f){var y=f0,I=Ei();if(o0){if(f===void 0)throw Error(t(407));f=f()}else{if(f=c(),rr===null)throw Error(t(349));$a&30||P_(y,c,f)}I.memoizedState=f;var b={value:f,getSnapshot:c};return I.queue=b,G_(k_.bind(null,y,b,a),[a]),y.flags|=2048,Q2(9,U_.bind(null,y,b,f,c),void 0,null),f},useId:function(){var a=Ei(),c=rr.identifierPrefix;if(o0){var f=ts,y=es;f=(y&~(1<<32-Et(y)-1)).toString(32)+f,c=":"+c+"R"+f,f=F2++,0<f&&(c+="H"+f.toString(32)),c+=":"}else f=pF++,c=":"+c+"r"+f.toString(32)+":";return a.memoizedState=c},unstable_isNewReconciler:!1},_F={readContext:Rn,useCallback:Y_,useContext:Rn,useEffect:X5,useImperativeHandle:W_,useInsertionEffect:H_,useLayoutEffect:V_,useMemo:q_,useReducer:Y5,useRef:z_,useState:function(){return Y5(O2)},useDebugValue:J5,useDeferredValue:function(a){var c=Dn();return X_(c,G0.memoizedState,a)},useTransition:function(){var a=Y5(O2)[0],c=Dn().memoizedState;return[a,c]},useMutableSource:L_,useSyncExternalStore:N_,useId:J_,unstable_isNewReconciler:!1},yF={readContext:Rn,useCallback:Y_,useContext:Rn,useEffect:X5,useImperativeHandle:W_,useInsertionEffect:H_,useLayoutEffect:V_,useMemo:q_,useReducer:q5,useRef:z_,useState:function(){return q5(O2)},useDebugValue:J5,useDeferredValue:function(a){var c=Dn();return G0===null?c.memoizedState=a:X_(c,G0.memoizedState,a)},useTransition:function(){var a=q5(O2)[0],c=Dn().memoizedState;return[a,c]},useMutableSource:L_,useSyncExternalStore:N_,useId:J_,unstable_isNewReconciler:!1};function Xn(a,c){if(a&&a.defaultProps){c=W({},c),a=a.defaultProps;for(var f in a)c[f]===void 0&&(c[f]=a[f]);return c}return c}function K5(a,c,f,y){c=a.memoizedState,f=f(y,c),f=f==null?c:W({},c,f),a.memoizedState=f,a.lanes===0&&(a.updateQueue.baseState=f)}var Pu={isMounted:function(a){return(a=a._reactInternals)?mi(a)===a:!1},enqueueSetState:function(a,c,f){a=a._reactInternals;var y=Lr(),I=ia(a),b=ns(y,I);b.payload=c,f!=null&&(b.callback=f),c=ea(a,b,I),c!==null&&(Zn(c,a,I,y),Su(c,a,I))},enqueueReplaceState:function(a,c,f){a=a._reactInternals;var y=Lr(),I=ia(a),b=ns(y,I);b.tag=1,b.payload=c,f!=null&&(b.callback=f),c=ea(a,b,I),c!==null&&(Zn(c,a,I,y),Su(c,a,I))},enqueueForceUpdate:function(a,c){a=a._reactInternals;var f=Lr(),y=ia(a),I=ns(f,y);I.tag=2,c!=null&&(I.callback=c),c=ea(a,I,y),c!==null&&(Zn(c,a,y,f),Su(c,a,y))}};function ey(a,c,f,y,I,b,N){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(y,b,N):c.prototype&&c.prototype.isPureReactComponent?!M2(f,y)||!M2(I,b):!0}function ty(a,c,f){var y=!1,I=Ks,b=c.contextType;return typeof b=="object"&&b!==null?b=Rn(b):(I=Wr(c)?qa:yr.current,y=c.contextTypes,b=(y=y!=null)?P1(a,I):Ks),c=new c(f,b),a.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=Pu,a.stateNode=c,c._reactInternals=a,y&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=I,a.__reactInternalMemoizedMaskedChildContext=b),c}function ry(a,c,f,y){a=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(f,y),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(f,y),c.state!==a&&Pu.enqueueReplaceState(c,c.state,null)}function Z5(a,c,f,y){var I=a.stateNode;I.props=f,I.state=a.memoizedState,I.refs={},F5(a);var b=c.contextType;typeof b=="object"&&b!==null?I.context=Rn(b):(b=Wr(c)?qa:yr.current,I.context=P1(a,b)),I.state=a.memoizedState,b=c.getDerivedStateFromProps,typeof b=="function"&&(K5(a,c,b,f),I.state=a.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof I.getSnapshotBeforeUpdate=="function"||typeof I.UNSAFE_componentWillMount!="function"&&typeof I.componentWillMount!="function"||(c=I.state,typeof I.componentWillMount=="function"&&I.componentWillMount(),typeof I.UNSAFE_componentWillMount=="function"&&I.UNSAFE_componentWillMount(),c!==I.state&&Pu.enqueueReplaceState(I,I.state,null),Tu(a,f,I,y),I.state=a.memoizedState),typeof I.componentDidMount=="function"&&(a.flags|=4194308)}function H1(a,c){try{var f="",y=c;do f+=oe(y),y=y.return;while(y);var I=f}catch(b){I=`
4723
4723
  Error generating stack: `+b.message+`
4724
- `+b.stack}return{value:a,source:c,stack:I,digest:null}}function $5(a,c,f){return{value:a,source:null,stack:f??null,digest:c??null}}function e6(a,c){try{console.error(c.value)}catch(f){setTimeout(function(){throw f})}}var EF=typeof WeakMap=="function"?WeakMap:Map;function ny(a,c,f){f=ns(-1,f),f.tag=3,f.payload={element:null};var y=c.value;return f.callback=function(){Gu||(Gu=!0,A6=y),e6(a,c)},f}function iy(a,c,f){f=ns(-1,f),f.tag=3;var y=a.type.getDerivedStateFromError;if(typeof y=="function"){var I=c.value;f.payload=function(){return y(I)},f.callback=function(){e6(a,c)}}var b=a.stateNode;return b!==null&&typeof b.componentDidCatch=="function"&&(f.callback=function(){e6(a,c),typeof y!="function"&&(ra===null?ra=new Set([this]):ra.add(this));var N=c.stack;this.componentDidCatch(c.value,{componentStack:N!==null?N:""})}),f}function sy(a,c,f){var y=a.pingCache;if(y===null){y=a.pingCache=new EF;var I=new Set;y.set(c,I)}else I=y.get(c),I===void 0&&(I=new Set,y.set(c,I));I.has(f)||(I.add(f),a=PF.bind(null,a,c,f),c.then(a,a))}function ay(a){do{var c;if((c=a.tag===13)&&(c=a.memoizedState,c=c!==null?c.dehydrated!==null:!0),c)return a;a=a.return}while(a!==null);return null}function oy(a,c,f,y,I){return a.mode&1?(a.flags|=65536,a.lanes=I,a):(a===c?a.flags|=65536:(a.flags|=128,f.flags|=131072,f.flags&=-52805,f.tag===1&&(f.alternate===null?f.tag=17:(c=ns(-1,1),c.tag=2,ea(f,c,1))),f.lanes|=1),a)}var xF=w.ReactCurrentOwner,Yr=!1;function Dr(a,c,f,y){c.child=a===null?S_(c,null,f,y):O1(c,a.child,f,y)}function ly(a,c,f,y,I){f=f.render;var b=c.ref;return z1(c,I),y=j5(a,c,f,y,b,I),f=W5(),a!==null&&!Yr?(c.updateQueue=a.updateQueue,c.flags&=-2053,a.lanes&=~I,is(a,c,I)):(o0&&f&&T5(c),c.flags|=1,Dr(a,c,y,I),c.child)}function cy(a,c,f,y,I){if(a===null){var b=f.type;return typeof b=="function"&&!x6(b)&&b.defaultProps===void 0&&f.compare===null&&f.defaultProps===void 0?(c.tag=15,c.type=b,uy(a,c,b,y,I)):(a=qu(f.type,null,y,c,c.mode,I),a.ref=c.ref,a.return=c,c.child=a)}if(b=a.child,!(a.lanes&I)){var N=b.memoizedProps;if(f=f.compare,f=f!==null?f:M2,f(N,y)&&a.ref===c.ref)return is(a,c,I)}return c.flags|=1,a=aa(b,y),a.ref=c.ref,a.return=c,c.child=a}function uy(a,c,f,y,I){if(a!==null){var b=a.memoizedProps;if(M2(b,y)&&a.ref===c.ref)if(Yr=!1,c.pendingProps=y=b,(a.lanes&I)!==0)a.flags&131072&&(Yr=!0);else return c.lanes=a.lanes,is(a,c,I)}return t6(a,c,f,y,I)}function hy(a,c,f){var y=c.pendingProps,I=y.children,b=a!==null?a.memoizedState:null;if(y.mode==="hidden")if(!(c.mode&1))c.memoizedState={baseLanes:0,cachePool:null,transitions:null},Zt(j1,fn),fn|=f;else{if(!(f&1073741824))return a=b!==null?b.baseLanes|f:f,c.lanes=c.childLanes=1073741824,c.memoizedState={baseLanes:a,cachePool:null,transitions:null},c.updateQueue=null,Zt(j1,fn),fn|=a,null;c.memoizedState={baseLanes:0,cachePool:null,transitions:null},y=b!==null?b.baseLanes:f,Zt(j1,fn),fn|=y}else b!==null?(y=b.baseLanes|f,c.memoizedState=null):y=f,Zt(j1,fn),fn|=y;return Dr(a,c,I,f),c.child}function dy(a,c){var f=c.ref;(a===null&&f!==null||a!==null&&a.ref!==f)&&(c.flags|=512,c.flags|=2097152)}function t6(a,c,f,y,I){var b=Wr(f)?qa:yr.current;return b=P1(c,b),z1(c,I),f=j5(a,c,f,y,b,I),y=W5(),a!==null&&!Yr?(c.updateQueue=a.updateQueue,c.flags&=-2053,a.lanes&=~I,is(a,c,I)):(o0&&y&&T5(c),c.flags|=1,Dr(a,c,f,I),c.child)}function fy(a,c,f,y,I){if(Wr(f)){var b=!0;_u(c)}else b=!1;if(z1(c,I),c.stateNode===null)ku(a,c),ty(c,f,y),Z5(c,f,y,I),y=!0;else if(a===null){var N=c.stateNode,Y=c.memoizedProps;N.props=Y;var K=N.context,fe=f.contextType;typeof fe=="object"&&fe!==null?fe=Rn(fe):(fe=Wr(f)?qa:yr.current,fe=P1(c,fe));var Ie=f.getDerivedStateFromProps,Me=typeof Ie=="function"||typeof N.getSnapshotBeforeUpdate=="function";Me||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(Y!==y||K!==fe)&&ry(c,N,y,fe),$s=!1;var xe=c.memoizedState;N.state=xe,Tu(c,y,N,I),K=c.memoizedState,Y!==y||xe!==K||jr.current||$s?(typeof Ie=="function"&&(K5(c,f,Ie,y),K=c.memoizedState),(Y=$s||ey(c,f,Y,y,xe,K,fe))?(Me||typeof N.UNSAFE_componentWillMount!="function"&&typeof N.componentWillMount!="function"||(typeof N.componentWillMount=="function"&&N.componentWillMount(),typeof N.UNSAFE_componentWillMount=="function"&&N.UNSAFE_componentWillMount()),typeof N.componentDidMount=="function"&&(c.flags|=4194308)):(typeof N.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=y,c.memoizedState=K),N.props=y,N.state=K,N.context=fe,y=Y):(typeof N.componentDidMount=="function"&&(c.flags|=4194308),y=!1)}else{N=c.stateNode,B_(a,c),Y=c.memoizedProps,fe=c.type===c.elementType?Y:Xn(c.type,Y),N.props=fe,Me=c.pendingProps,xe=N.context,K=f.contextType,typeof K=="object"&&K!==null?K=Rn(K):(K=Wr(f)?qa:yr.current,K=P1(c,K));var je=f.getDerivedStateFromProps;(Ie=typeof je=="function"||typeof N.getSnapshotBeforeUpdate=="function")||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(Y!==Me||xe!==K)&&ry(c,N,y,K),$s=!1,xe=c.memoizedState,N.state=xe,Tu(c,y,N,I);var Je=c.memoizedState;Y!==Me||xe!==Je||jr.current||$s?(typeof je=="function"&&(K5(c,f,je,y),Je=c.memoizedState),(fe=$s||ey(c,f,fe,y,xe,Je,K)||!1)?(Ie||typeof N.UNSAFE_componentWillUpdate!="function"&&typeof N.componentWillUpdate!="function"||(typeof N.componentWillUpdate=="function"&&N.componentWillUpdate(y,Je,K),typeof N.UNSAFE_componentWillUpdate=="function"&&N.UNSAFE_componentWillUpdate(y,Je,K)),typeof N.componentDidUpdate=="function"&&(c.flags|=4),typeof N.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof N.componentDidUpdate!="function"||Y===a.memoizedProps&&xe===a.memoizedState||(c.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||Y===a.memoizedProps&&xe===a.memoizedState||(c.flags|=1024),c.memoizedProps=y,c.memoizedState=Je),N.props=y,N.state=Je,N.context=K,y=fe):(typeof N.componentDidUpdate!="function"||Y===a.memoizedProps&&xe===a.memoizedState||(c.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||Y===a.memoizedProps&&xe===a.memoizedState||(c.flags|=1024),y=!1)}return r6(a,c,f,y,b,I)}function r6(a,c,f,y,I,b){dy(a,c);var N=(c.flags&128)!==0;if(!y&&!N)return I&&v_(c,f,!1),is(a,c,b);y=c.stateNode,xF.current=c;var Y=N&&typeof f.getDerivedStateFromError!="function"?null:y.render();return c.flags|=1,a!==null&&N?(c.child=O1(c,a.child,null,b),c.child=O1(c,null,Y,b)):Dr(a,c,Y,b),c.memoizedState=y.state,I&&v_(c,f,!0),c.child}function py(a){var c=a.stateNode;c.pendingContext?g_(a,c.pendingContext,c.pendingContext!==c.context):c.context&&g_(a,c.context,!1),O5(a,c.containerInfo)}function Ay(a,c,f,y,I){return F1(),D5(I),c.flags|=256,Dr(a,c,f,y),c.child}var n6={dehydrated:null,treeContext:null,retryLane:0};function i6(a){return{baseLanes:a,cachePool:null,transitions:null}}function gy(a,c,f){var y=c.pendingProps,I=d0.current,b=!1,N=(c.flags&128)!==0,Y;if((Y=N)||(Y=a!==null&&a.memoizedState===null?!1:(I&2)!==0),Y?(b=!0,c.flags&=-129):(a===null||a.memoizedState!==null)&&(I|=1),Zt(d0,I&1),a===null)return R5(c),a=c.memoizedState,a!==null&&(a=a.dehydrated,a!==null)?(c.mode&1?a.data==="$!"?c.lanes=8:c.lanes=1073741824:c.lanes=1,null):(N=y.children,a=y.fallback,b?(y=c.mode,b=c.child,N={mode:"hidden",children:N},!(y&1)&&b!==null?(b.childLanes=0,b.pendingProps=N):b=Xu(N,y,0,null),a=io(a,y,f,null),b.return=c,a.return=c,b.sibling=a,c.child=b,c.child.memoizedState=i6(f),c.memoizedState=n6,a):s6(c,N));if(I=a.memoizedState,I!==null&&(Y=I.dehydrated,Y!==null))return wF(a,c,N,y,Y,I,f);if(b){b=y.fallback,N=c.mode,I=a.child,Y=I.sibling;var K={mode:"hidden",children:y.children};return!(N&1)&&c.child!==I?(y=c.child,y.childLanes=0,y.pendingProps=K,c.deletions=null):(y=aa(I,K),y.subtreeFlags=I.subtreeFlags&14680064),Y!==null?b=aa(Y,b):(b=io(b,N,f,null),b.flags|=2),b.return=c,y.return=c,y.sibling=b,c.child=y,y=b,b=c.child,N=a.child.memoizedState,N=N===null?i6(f):{baseLanes:N.baseLanes|f,cachePool:null,transitions:N.transitions},b.memoizedState=N,b.childLanes=a.childLanes&~f,c.memoizedState=n6,y}return b=a.child,a=b.sibling,y=aa(b,{mode:"visible",children:y.children}),!(c.mode&1)&&(y.lanes=f),y.return=c,y.sibling=null,a!==null&&(f=c.deletions,f===null?(c.deletions=[a],c.flags|=16):f.push(a)),c.child=y,c.memoizedState=null,y}function s6(a,c){return c=Xu({mode:"visible",children:c},a.mode,0,null),c.return=a,a.child=c}function Uu(a,c,f,y){return y!==null&&D5(y),O1(c,a.child,null,f),a=s6(c,c.pendingProps.children),a.flags|=2,c.memoizedState=null,a}function wF(a,c,f,y,I,b,N){if(f)return c.flags&256?(c.flags&=-257,y=$5(Error(t(422))),Uu(a,c,N,y)):c.memoizedState!==null?(c.child=a.child,c.flags|=128,null):(b=y.fallback,I=c.mode,y=Xu({mode:"visible",children:y.children},I,0,null),b=io(b,I,N,null),b.flags|=2,y.return=c,b.return=c,y.sibling=b,c.child=y,c.mode&1&&O1(c,a.child,null,N),c.child.memoizedState=i6(N),c.memoizedState=n6,b);if(!(c.mode&1))return Uu(a,c,N,null);if(I.data==="$!"){if(y=I.nextSibling&&I.nextSibling.dataset,y)var Y=y.dgst;return y=Y,b=Error(t(419)),y=$5(b,y,void 0),Uu(a,c,N,y)}if(Y=(N&a.childLanes)!==0,Yr||Y){if(y=rr,y!==null){switch(N&-N){case 4:I=2;break;case 16:I=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:I=32;break;case 536870912:I=268435456;break;default:I=0}I=I&(y.suspendedLanes|N)?0:I,I!==0&&I!==b.retryLane&&(b.retryLane=I,rs(a,I),Zn(y,a,I,-1))}return E6(),y=$5(Error(t(421))),Uu(a,c,N,y)}return I.data==="$?"?(c.flags|=128,c.child=a.child,c=UF.bind(null,a),I._reactRetry=c,null):(a=b.treeContext,dn=Xs(I.nextSibling),hn=c,o0=!0,qn=null,a!==null&&(Bn[bn++]=es,Bn[bn++]=ts,Bn[bn++]=Xa,es=a.id,ts=a.overflow,Xa=c),c=s6(c,y.children),c.flags|=4096,c)}function my(a,c,f){a.lanes|=c;var y=a.alternate;y!==null&&(y.lanes|=c),U5(a.return,c,f)}function a6(a,c,f,y,I){var b=a.memoizedState;b===null?a.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:y,tail:f,tailMode:I}:(b.isBackwards=c,b.rendering=null,b.renderingStartTime=0,b.last=y,b.tail=f,b.tailMode=I)}function vy(a,c,f){var y=c.pendingProps,I=y.revealOrder,b=y.tail;if(Dr(a,c,y.children,f),y=d0.current,y&2)y=y&1|2,c.flags|=128;else{if(a!==null&&a.flags&128)e:for(a=c.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&my(a,f,c);else if(a.tag===19)my(a,f,c);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===c)break e;for(;a.sibling===null;){if(a.return===null||a.return===c)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}y&=1}if(Zt(d0,y),!(c.mode&1))c.memoizedState=null;else switch(I){case"forwards":for(f=c.child,I=null;f!==null;)a=f.alternate,a!==null&&Bu(a)===null&&(I=f),f=f.sibling;f=I,f===null?(I=c.child,c.child=null):(I=f.sibling,f.sibling=null),a6(c,!1,I,f,b);break;case"backwards":for(f=null,I=c.child,c.child=null;I!==null;){if(a=I.alternate,a!==null&&Bu(a)===null){c.child=I;break}a=I.sibling,I.sibling=f,f=I,I=a}a6(c,!0,f,null,b);break;case"together":a6(c,!1,null,null,void 0);break;default:c.memoizedState=null}return c.child}function ku(a,c){!(c.mode&1)&&a!==null&&(a.alternate=null,c.alternate=null,c.flags|=2)}function is(a,c,f){if(a!==null&&(c.dependencies=a.dependencies),eo|=c.lanes,!(f&c.childLanes))return null;if(a!==null&&c.child!==a.child)throw Error(t(153));if(c.child!==null){for(a=c.child,f=aa(a,a.pendingProps),c.child=f,f.return=c;a.sibling!==null;)a=a.sibling,f=f.sibling=aa(a,a.pendingProps),f.return=c;f.sibling=null}return c.child}function CF(a,c,f){switch(c.tag){case 3:py(c),F1();break;case 5:D_(c);break;case 1:Wr(c.type)&&_u(c);break;case 4:O5(c,c.stateNode.containerInfo);break;case 10:var y=c.type._context,I=c.memoizedProps.value;Zt(Iu,y._currentValue),y._currentValue=I;break;case 13:if(y=c.memoizedState,y!==null)return y.dehydrated!==null?(Zt(d0,d0.current&1),c.flags|=128,null):f&c.child.childLanes?gy(a,c,f):(Zt(d0,d0.current&1),a=is(a,c,f),a!==null?a.sibling:null);Zt(d0,d0.current&1);break;case 19:if(y=(f&c.childLanes)!==0,a.flags&128){if(y)return vy(a,c,f);c.flags|=128}if(I=c.memoizedState,I!==null&&(I.rendering=null,I.tail=null,I.lastEffect=null),Zt(d0,d0.current),y)break;return null;case 22:case 23:return c.lanes=0,hy(a,c,f)}return is(a,c,f)}var _y,o6,yy,Ey;_y=function(a,c){for(var f=c.child;f!==null;){if(f.tag===5||f.tag===6)a.appendChild(f.stateNode);else if(f.tag!==4&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===c)break;for(;f.sibling===null;){if(f.return===null||f.return===c)return;f=f.return}f.sibling.return=f.return,f=f.sibling}},o6=function(){},yy=function(a,c,f,y){var I=a.memoizedProps;if(I!==y){a=c.stateNode,Za(yi.current);var b=null;switch(f){case"input":I=X(a,I),y=X(a,y),b=[];break;case"select":I=W({},I,{value:void 0}),y=W({},y,{value:void 0}),b=[];break;case"textarea":I=k(a,I),y=k(a,y),b=[];break;default:typeof I.onClick!="function"&&typeof y.onClick=="function"&&(a.onclick=gu)}Oe(f,y);var N;f=null;for(fe in I)if(!y.hasOwnProperty(fe)&&I.hasOwnProperty(fe)&&I[fe]!=null)if(fe==="style"){var Y=I[fe];for(N in Y)Y.hasOwnProperty(N)&&(f||(f={}),f[N]="")}else fe!=="dangerouslySetInnerHTML"&&fe!=="children"&&fe!=="suppressContentEditableWarning"&&fe!=="suppressHydrationWarning"&&fe!=="autoFocus"&&(i.hasOwnProperty(fe)?b||(b=[]):(b=b||[]).push(fe,null));for(fe in y){var K=y[fe];if(Y=I!=null?I[fe]:void 0,y.hasOwnProperty(fe)&&K!==Y&&(K!=null||Y!=null))if(fe==="style")if(Y){for(N in Y)!Y.hasOwnProperty(N)||K&&K.hasOwnProperty(N)||(f||(f={}),f[N]="");for(N in K)K.hasOwnProperty(N)&&Y[N]!==K[N]&&(f||(f={}),f[N]=K[N])}else f||(b||(b=[]),b.push(fe,f)),f=K;else fe==="dangerouslySetInnerHTML"?(K=K?K.__html:void 0,Y=Y?Y.__html:void 0,K!=null&&Y!==K&&(b=b||[]).push(fe,K)):fe==="children"?typeof K!="string"&&typeof K!="number"||(b=b||[]).push(fe,""+K):fe!=="suppressContentEditableWarning"&&fe!=="suppressHydrationWarning"&&(i.hasOwnProperty(fe)?(K!=null&&fe==="onScroll"&&t0("scroll",a),b||Y===K||(b=[])):(b=b||[]).push(fe,K))}f&&(b=b||[]).push("style",f);var fe=b;(c.updateQueue=fe)&&(c.flags|=4)}},Ey=function(a,c,f,y){f!==y&&(c.flags|=4)};function z2(a,c){if(!o0)switch(a.tailMode){case"hidden":c=a.tail;for(var f=null;c!==null;)c.alternate!==null&&(f=c),c=c.sibling;f===null?a.tail=null:f.sibling=null;break;case"collapsed":f=a.tail;for(var y=null;f!==null;)f.alternate!==null&&(y=f),f=f.sibling;y===null?c||a.tail===null?a.tail=null:a.tail.sibling=null:y.sibling=null}}function xr(a){var c=a.alternate!==null&&a.alternate.child===a.child,f=0,y=0;if(c)for(var I=a.child;I!==null;)f|=I.lanes|I.childLanes,y|=I.subtreeFlags&14680064,y|=I.flags&14680064,I.return=a,I=I.sibling;else for(I=a.child;I!==null;)f|=I.lanes|I.childLanes,y|=I.subtreeFlags,y|=I.flags,I.return=a,I=I.sibling;return a.subtreeFlags|=y,a.childLanes=f,c}function IF(a,c,f){var y=c.pendingProps;switch(B5(c),c.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return xr(c),null;case 1:return Wr(c.type)&&vu(),xr(c),null;case 3:return y=c.stateNode,G1(),r0(jr),r0(yr),G5(),y.pendingContext&&(y.context=y.pendingContext,y.pendingContext=null),(a===null||a.child===null)&&(wu(c)?c.flags|=4:a===null||a.memoizedState.isDehydrated&&!(c.flags&256)||(c.flags|=1024,qn!==null&&(v6(qn),qn=null))),o6(a,c),xr(c),null;case 5:Q5(c);var I=Za(U2.current);if(f=c.type,a!==null&&c.stateNode!=null)yy(a,c,f,y,I),a.ref!==c.ref&&(c.flags|=512,c.flags|=2097152);else{if(!y){if(c.stateNode===null)throw Error(t(166));return xr(c),null}if(a=Za(yi.current),wu(c)){y=c.stateNode,f=c.type;var b=c.memoizedProps;switch(y[_i]=c,y[R2]=b,a=(c.mode&1)!==0,f){case"dialog":t0("cancel",y),t0("close",y);break;case"iframe":case"object":case"embed":t0("load",y);break;case"video":case"audio":for(I=0;I<T2.length;I++)t0(T2[I],y);break;case"source":t0("error",y);break;case"img":case"image":case"link":t0("error",y),t0("load",y);break;case"details":t0("toggle",y);break;case"input":h0(y,b),t0("invalid",y);break;case"select":y._wrapperState={wasMultiple:!!b.multiple},t0("invalid",y);break;case"textarea":se(y,b),t0("invalid",y)}Oe(f,b),I=null;for(var N in b)if(b.hasOwnProperty(N)){var Y=b[N];N==="children"?typeof Y=="string"?y.textContent!==Y&&(b.suppressHydrationWarning!==!0&&Au(y.textContent,Y,a),I=["children",Y]):typeof Y=="number"&&y.textContent!==""+Y&&(b.suppressHydrationWarning!==!0&&Au(y.textContent,Y,a),I=["children",""+Y]):i.hasOwnProperty(N)&&Y!=null&&N==="onScroll"&&t0("scroll",y)}switch(f){case"input":st(y),qe(y,b,!0);break;case"textarea":st(y),Ee(y);break;case"select":case"option":break;default:typeof b.onClick=="function"&&(y.onclick=gu)}y=I,c.updateQueue=y,y!==null&&(c.flags|=4)}else{N=I.nodeType===9?I:I.ownerDocument,a==="http://www.w3.org/1999/xhtml"&&(a=_e(f)),a==="http://www.w3.org/1999/xhtml"?f==="script"?(a=N.createElement("div"),a.innerHTML="<script><\/script>",a=a.removeChild(a.firstChild)):typeof y.is=="string"?a=N.createElement(f,{is:y.is}):(a=N.createElement(f),f==="select"&&(N=a,y.multiple?N.multiple=!0:y.size&&(N.size=y.size))):a=N.createElementNS(a,f),a[_i]=c,a[R2]=y,_y(a,c,!1,!1),c.stateNode=a;e:{switch(N=ke(f,y),f){case"dialog":t0("cancel",a),t0("close",a),I=y;break;case"iframe":case"object":case"embed":t0("load",a),I=y;break;case"video":case"audio":for(I=0;I<T2.length;I++)t0(T2[I],a);I=y;break;case"source":t0("error",a),I=y;break;case"img":case"image":case"link":t0("error",a),t0("load",a),I=y;break;case"details":t0("toggle",a),I=y;break;case"input":h0(a,y),I=X(a,y),t0("invalid",a);break;case"option":I=y;break;case"select":a._wrapperState={wasMultiple:!!y.multiple},I=W({},y,{value:void 0}),t0("invalid",a);break;case"textarea":se(a,y),I=k(a,y),t0("invalid",a);break;default:I=y}Oe(f,I),Y=I;for(b in Y)if(Y.hasOwnProperty(b)){var K=Y[b];b==="style"?et(a,K):b==="dangerouslySetInnerHTML"?(K=K?K.__html:void 0,K!=null&&Ve(a,K)):b==="children"?typeof K=="string"?(f!=="textarea"||K!=="")&&gt(a,K):typeof K=="number"&&gt(a,""+K):b!=="suppressContentEditableWarning"&&b!=="suppressHydrationWarning"&&b!=="autoFocus"&&(i.hasOwnProperty(b)?K!=null&&b==="onScroll"&&t0("scroll",a):K!=null&&x(a,b,K,N))}switch(f){case"input":st(a),qe(a,y,!1);break;case"textarea":st(a),Ee(a);break;case"option":y.value!=null&&a.setAttribute("value",""+ge(y.value));break;case"select":a.multiple=!!y.multiple,b=y.value,b!=null?Q(a,!!y.multiple,b,!1):y.defaultValue!=null&&Q(a,!!y.multiple,y.defaultValue,!0);break;default:typeof I.onClick=="function"&&(a.onclick=gu)}switch(f){case"button":case"input":case"select":case"textarea":y=!!y.autoFocus;break e;case"img":y=!0;break e;default:y=!1}}y&&(c.flags|=4)}c.ref!==null&&(c.flags|=512,c.flags|=2097152)}return xr(c),null;case 6:if(a&&c.stateNode!=null)Ey(a,c,a.memoizedProps,y);else{if(typeof y!="string"&&c.stateNode===null)throw Error(t(166));if(f=Za(U2.current),Za(yi.current),wu(c)){if(y=c.stateNode,f=c.memoizedProps,y[_i]=c,(b=y.nodeValue!==f)&&(a=hn,a!==null))switch(a.tag){case 3:Au(y.nodeValue,f,(a.mode&1)!==0);break;case 5:a.memoizedProps.suppressHydrationWarning!==!0&&Au(y.nodeValue,f,(a.mode&1)!==0)}b&&(c.flags|=4)}else y=(f.nodeType===9?f:f.ownerDocument).createTextNode(y),y[_i]=c,c.stateNode=y}return xr(c),null;case 13:if(r0(d0),y=c.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(o0&&dn!==null&&c.mode&1&&!(c.flags&128))C_(),F1(),c.flags|=98560,b=!1;else if(b=wu(c),y!==null&&y.dehydrated!==null){if(a===null){if(!b)throw Error(t(318));if(b=c.memoizedState,b=b!==null?b.dehydrated:null,!b)throw Error(t(317));b[_i]=c}else F1(),!(c.flags&128)&&(c.memoizedState=null),c.flags|=4;xr(c),b=!1}else qn!==null&&(v6(qn),qn=null),b=!0;if(!b)return c.flags&65536?c:null}return c.flags&128?(c.lanes=f,c):(y=y!==null,y!==(a!==null&&a.memoizedState!==null)&&y&&(c.child.flags|=8192,c.mode&1&&(a===null||d0.current&1?H0===0&&(H0=3):E6())),c.updateQueue!==null&&(c.flags|=4),xr(c),null);case 4:return G1(),o6(a,c),a===null&&B2(c.stateNode.containerInfo),xr(c),null;case 10:return P5(c.type._context),xr(c),null;case 17:return Wr(c.type)&&vu(),xr(c),null;case 19:if(r0(d0),b=c.memoizedState,b===null)return xr(c),null;if(y=(c.flags&128)!==0,N=b.rendering,N===null)if(y)z2(b,!1);else{if(H0!==0||a!==null&&a.flags&128)for(a=c.child;a!==null;){if(N=Bu(a),N!==null){for(c.flags|=128,z2(b,!1),y=N.updateQueue,y!==null&&(c.updateQueue=y,c.flags|=4),c.subtreeFlags=0,y=f,f=c.child;f!==null;)b=f,a=y,b.flags&=14680066,N=b.alternate,N===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=N.childLanes,b.lanes=N.lanes,b.child=N.child,b.subtreeFlags=0,b.deletions=null,b.memoizedProps=N.memoizedProps,b.memoizedState=N.memoizedState,b.updateQueue=N.updateQueue,b.type=N.type,a=N.dependencies,b.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),f=f.sibling;return Zt(d0,d0.current&1|2),c.child}a=a.sibling}b.tail!==null&&le()>W1&&(c.flags|=128,y=!0,z2(b,!1),c.lanes=4194304)}else{if(!y)if(a=Bu(N),a!==null){if(c.flags|=128,y=!0,f=a.updateQueue,f!==null&&(c.updateQueue=f,c.flags|=4),z2(b,!0),b.tail===null&&b.tailMode==="hidden"&&!N.alternate&&!o0)return xr(c),null}else 2*le()-b.renderingStartTime>W1&&f!==1073741824&&(c.flags|=128,y=!0,z2(b,!1),c.lanes=4194304);b.isBackwards?(N.sibling=c.child,c.child=N):(f=b.last,f!==null?f.sibling=N:c.child=N,b.last=N)}return b.tail!==null?(c=b.tail,b.rendering=c,b.tail=c.sibling,b.renderingStartTime=le(),c.sibling=null,f=d0.current,Zt(d0,y?f&1|2:f&1),c):(xr(c),null);case 22:case 23:return y6(),y=c.memoizedState!==null,a!==null&&a.memoizedState!==null!==y&&(c.flags|=8192),y&&c.mode&1?fn&1073741824&&(xr(c),c.subtreeFlags&6&&(c.flags|=8192)):xr(c),null;case 24:return null;case 25:return null}throw Error(t(156,c.tag))}function MF(a,c){switch(B5(c),c.tag){case 1:return Wr(c.type)&&vu(),a=c.flags,a&65536?(c.flags=a&-65537|128,c):null;case 3:return G1(),r0(jr),r0(yr),G5(),a=c.flags,a&65536&&!(a&128)?(c.flags=a&-65537|128,c):null;case 5:return Q5(c),null;case 13:if(r0(d0),a=c.memoizedState,a!==null&&a.dehydrated!==null){if(c.alternate===null)throw Error(t(340));F1()}return a=c.flags,a&65536?(c.flags=a&-65537|128,c):null;case 19:return r0(d0),null;case 4:return G1(),null;case 10:return P5(c.type._context),null;case 22:case 23:return y6(),null;case 24:return null;default:return null}}var Fu=!1,wr=!1,SF=typeof WeakSet=="function"?WeakSet:Set,Xe=null;function V1(a,c){var f=a.ref;if(f!==null)if(typeof f=="function")try{f(null)}catch(y){v0(a,c,y)}else f.current=null}function l6(a,c,f){try{f()}catch(y){v0(a,c,y)}}var xy=!1;function TF(a,c){if(y5=iu,a=e_(),d5(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 I=y.anchorOffset,b=y.focusNode;y=y.focusOffset;try{f.nodeType,b.nodeType}catch{f=null;break e}var N=0,Y=-1,K=-1,fe=0,Ie=0,Me=a,xe=null;t:for(;;){for(var je;Me!==f||I!==0&&Me.nodeType!==3||(Y=N+I),Me!==b||y!==0&&Me.nodeType!==3||(K=N+y),Me.nodeType===3&&(N+=Me.nodeValue.length),(je=Me.firstChild)!==null;)xe=Me,Me=je;for(;;){if(Me===a)break t;if(xe===f&&++fe===I&&(Y=N),xe===b&&++Ie===y&&(K=N),(je=Me.nextSibling)!==null)break;Me=xe,xe=Me.parentNode}Me=je}f=Y===-1||K===-1?null:{start:Y,end:K}}else f=null}f=f||{start:0,end:0}}else f=null;for(E5={focusedElem:a,selectionRange:f},iu=!1,Xe=c;Xe!==null;)if(c=Xe,a=c.child,(c.subtreeFlags&1028)!==0&&a!==null)a.return=c,Xe=a;else for(;Xe!==null;){c=Xe;try{var Je=c.alternate;if(c.flags&1024)switch(c.tag){case 0:case 11:case 15:break;case 1:if(Je!==null){var Ke=Je.memoizedProps,x0=Je.memoizedState,ae=c.stateNode,ee=ae.getSnapshotBeforeUpdate(c.elementType===c.type?Ke:Xn(c.type,Ke),x0);ae.__reactInternalSnapshotBeforeUpdate=ee}break;case 3:var ce=c.stateNode.containerInfo;ce.nodeType===1?ce.textContent="":ce.nodeType===9&&ce.documentElement&&ce.removeChild(ce.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(t(163))}}catch(be){v0(c,c.return,be)}if(a=c.sibling,a!==null){a.return=c.return,Xe=a;break}Xe=c.return}return Je=xy,xy=!1,Je}function G2(a,c,f){var y=c.updateQueue;if(y=y!==null?y.lastEffect:null,y!==null){var I=y=y.next;do{if((I.tag&a)===a){var b=I.destroy;I.destroy=void 0,b!==void 0&&l6(c,f,b)}I=I.next}while(I!==y)}}function Ou(a,c){if(c=c.updateQueue,c=c!==null?c.lastEffect:null,c!==null){var f=c=c.next;do{if((f.tag&a)===a){var y=f.create;f.destroy=y()}f=f.next}while(f!==c)}}function c6(a){var c=a.ref;if(c!==null){var f=a.stateNode;switch(a.tag){case 5:a=f;break;default:a=f}typeof c=="function"?c(a):c.current=a}}function wy(a){var c=a.alternate;c!==null&&(a.alternate=null,wy(c)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(c=a.stateNode,c!==null&&(delete c[_i],delete c[R2],delete c[I5],delete c[uF],delete c[hF])),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 Cy(a){return a.tag===5||a.tag===3||a.tag===4}function Iy(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||Cy(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 u6(a,c,f){var y=a.tag;if(y===5||y===6)a=a.stateNode,c?f.nodeType===8?f.parentNode.insertBefore(a,c):f.insertBefore(a,c):(f.nodeType===8?(c=f.parentNode,c.insertBefore(a,f)):(c=f,c.appendChild(a)),f=f._reactRootContainer,f!=null||c.onclick!==null||(c.onclick=gu));else if(y!==4&&(a=a.child,a!==null))for(u6(a,c,f),a=a.sibling;a!==null;)u6(a,c,f),a=a.sibling}function h6(a,c,f){var y=a.tag;if(y===5||y===6)a=a.stateNode,c?f.insertBefore(a,c):f.appendChild(a);else if(y!==4&&(a=a.child,a!==null))for(h6(a,c,f),a=a.sibling;a!==null;)h6(a,c,f),a=a.sibling}var ur=null,Jn=!1;function ta(a,c,f){for(f=f.child;f!==null;)My(a,c,f),f=f.sibling}function My(a,c,f){if(rt&&typeof rt.onCommitFiberUnmount=="function")try{rt.onCommitFiberUnmount(ct,f)}catch{}switch(f.tag){case 5:wr||V1(f,c);case 6:var y=ur,I=Jn;ur=null,ta(a,c,f),ur=y,Jn=I,ur!==null&&(Jn?(a=ur,f=f.stateNode,a.nodeType===8?a.parentNode.removeChild(f):a.removeChild(f)):ur.removeChild(f.stateNode));break;case 18:ur!==null&&(Jn?(a=ur,f=f.stateNode,a.nodeType===8?C5(a.parentNode,f):a.nodeType===1&&C5(a,f),y2(a)):C5(ur,f.stateNode));break;case 4:y=ur,I=Jn,ur=f.stateNode.containerInfo,Jn=!0,ta(a,c,f),ur=y,Jn=I;break;case 0:case 11:case 14:case 15:if(!wr&&(y=f.updateQueue,y!==null&&(y=y.lastEffect,y!==null))){I=y=y.next;do{var b=I,N=b.destroy;b=b.tag,N!==void 0&&(b&2||b&4)&&l6(f,c,N),I=I.next}while(I!==y)}ta(a,c,f);break;case 1:if(!wr&&(V1(f,c),y=f.stateNode,typeof y.componentWillUnmount=="function"))try{y.props=f.memoizedProps,y.state=f.memoizedState,y.componentWillUnmount()}catch(Y){v0(f,c,Y)}ta(a,c,f);break;case 21:ta(a,c,f);break;case 22:f.mode&1?(wr=(y=wr)||f.memoizedState!==null,ta(a,c,f),wr=y):ta(a,c,f);break;default:ta(a,c,f)}}function Sy(a){var c=a.updateQueue;if(c!==null){a.updateQueue=null;var f=a.stateNode;f===null&&(f=a.stateNode=new SF),c.forEach(function(y){var I=kF.bind(null,a,y);f.has(y)||(f.add(y),y.then(I,I))})}}function Kn(a,c){var f=c.deletions;if(f!==null)for(var y=0;y<f.length;y++){var I=f[y];try{var b=a,N=c,Y=N;e:for(;Y!==null;){switch(Y.tag){case 5:ur=Y.stateNode,Jn=!1;break e;case 3:ur=Y.stateNode.containerInfo,Jn=!0;break e;case 4:ur=Y.stateNode.containerInfo,Jn=!0;break e}Y=Y.return}if(ur===null)throw Error(t(160));My(b,N,I),ur=null,Jn=!1;var K=I.alternate;K!==null&&(K.return=null),I.return=null}catch(fe){v0(I,c,fe)}}if(c.subtreeFlags&12854)for(c=c.child;c!==null;)Ty(c,a),c=c.sibling}function Ty(a,c){var f=a.alternate,y=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:if(Kn(c,a),xi(a),y&4){try{G2(3,a,a.return),Ou(3,a)}catch(Ke){v0(a,a.return,Ke)}try{G2(5,a,a.return)}catch(Ke){v0(a,a.return,Ke)}}break;case 1:Kn(c,a),xi(a),y&512&&f!==null&&V1(f,f.return);break;case 5:if(Kn(c,a),xi(a),y&512&&f!==null&&V1(f,f.return),a.flags&32){var I=a.stateNode;try{gt(I,"")}catch(Ke){v0(a,a.return,Ke)}}if(y&4&&(I=a.stateNode,I!=null)){var b=a.memoizedProps,N=f!==null?f.memoizedProps:b,Y=a.type,K=a.updateQueue;if(a.updateQueue=null,K!==null)try{Y==="input"&&b.type==="radio"&&b.name!=null&&pt(I,b),ke(Y,N);var fe=ke(Y,b);for(N=0;N<K.length;N+=2){var Ie=K[N],Me=K[N+1];Ie==="style"?et(I,Me):Ie==="dangerouslySetInnerHTML"?Ve(I,Me):Ie==="children"?gt(I,Me):x(I,Ie,Me,fe)}switch(Y){case"input":At(I,b);break;case"textarea":ye(I,b);break;case"select":var xe=I._wrapperState.wasMultiple;I._wrapperState.wasMultiple=!!b.multiple;var je=b.value;je!=null?Q(I,!!b.multiple,je,!1):xe!==!!b.multiple&&(b.defaultValue!=null?Q(I,!!b.multiple,b.defaultValue,!0):Q(I,!!b.multiple,b.multiple?[]:"",!1))}I[R2]=b}catch(Ke){v0(a,a.return,Ke)}}break;case 6:if(Kn(c,a),xi(a),y&4){if(a.stateNode===null)throw Error(t(162));I=a.stateNode,b=a.memoizedProps;try{I.nodeValue=b}catch(Ke){v0(a,a.return,Ke)}}break;case 3:if(Kn(c,a),xi(a),y&4&&f!==null&&f.memoizedState.isDehydrated)try{y2(c.containerInfo)}catch(Ke){v0(a,a.return,Ke)}break;case 4:Kn(c,a),xi(a);break;case 13:Kn(c,a),xi(a),I=a.child,I.flags&8192&&(b=I.memoizedState!==null,I.stateNode.isHidden=b,!b||I.alternate!==null&&I.alternate.memoizedState!==null||(p6=le())),y&4&&Sy(a);break;case 22:if(Ie=f!==null&&f.memoizedState!==null,a.mode&1?(wr=(fe=wr)||Ie,Kn(c,a),wr=fe):Kn(c,a),xi(a),y&8192){if(fe=a.memoizedState!==null,(a.stateNode.isHidden=fe)&&!Ie&&a.mode&1)for(Xe=a,Ie=a.child;Ie!==null;){for(Me=Xe=Ie;Xe!==null;){switch(xe=Xe,je=xe.child,xe.tag){case 0:case 11:case 14:case 15:G2(4,xe,xe.return);break;case 1:V1(xe,xe.return);var Je=xe.stateNode;if(typeof Je.componentWillUnmount=="function"){y=xe,f=xe.return;try{c=y,Je.props=c.memoizedProps,Je.state=c.memoizedState,Je.componentWillUnmount()}catch(Ke){v0(y,f,Ke)}}break;case 5:V1(xe,xe.return);break;case 22:if(xe.memoizedState!==null){Ry(Me);continue}}je!==null?(je.return=xe,Xe=je):Ry(Me)}Ie=Ie.sibling}e:for(Ie=null,Me=a;;){if(Me.tag===5){if(Ie===null){Ie=Me;try{I=Me.stateNode,fe?(b=I.style,typeof b.setProperty=="function"?b.setProperty("display","none","important"):b.display="none"):(Y=Me.stateNode,K=Me.memoizedProps.style,N=K!=null&&K.hasOwnProperty("display")?K.display:null,Y.style.display=nt("display",N))}catch(Ke){v0(a,a.return,Ke)}}}else if(Me.tag===6){if(Ie===null)try{Me.stateNode.nodeValue=fe?"":Me.memoizedProps}catch(Ke){v0(a,a.return,Ke)}}else if((Me.tag!==22&&Me.tag!==23||Me.memoizedState===null||Me===a)&&Me.child!==null){Me.child.return=Me,Me=Me.child;continue}if(Me===a)break e;for(;Me.sibling===null;){if(Me.return===null||Me.return===a)break e;Ie===Me&&(Ie=null),Me=Me.return}Ie===Me&&(Ie=null),Me.sibling.return=Me.return,Me=Me.sibling}}break;case 19:Kn(c,a),xi(a),y&4&&Sy(a);break;case 21:break;default:Kn(c,a),xi(a)}}function xi(a){var c=a.flags;if(c&2){try{e:{for(var f=a.return;f!==null;){if(Cy(f)){var y=f;break e}f=f.return}throw Error(t(160))}switch(y.tag){case 5:var I=y.stateNode;y.flags&32&&(gt(I,""),y.flags&=-33);var b=Iy(a);h6(a,b,I);break;case 3:case 4:var N=y.stateNode.containerInfo,Y=Iy(a);u6(a,Y,N);break;default:throw Error(t(161))}}catch(K){v0(a,a.return,K)}a.flags&=-3}c&4096&&(a.flags&=-4097)}function BF(a,c,f){Xe=a,By(a)}function By(a,c,f){for(var y=(a.mode&1)!==0;Xe!==null;){var I=Xe,b=I.child;if(I.tag===22&&y){var N=I.memoizedState!==null||Fu;if(!N){var Y=I.alternate,K=Y!==null&&Y.memoizedState!==null||wr;Y=Fu;var fe=wr;if(Fu=N,(wr=K)&&!fe)for(Xe=I;Xe!==null;)N=Xe,K=N.child,N.tag===22&&N.memoizedState!==null?Dy(I):K!==null?(K.return=N,Xe=K):Dy(I);for(;b!==null;)Xe=b,By(b),b=b.sibling;Xe=I,Fu=Y,wr=fe}by(a)}else I.subtreeFlags&8772&&b!==null?(b.return=I,Xe=b):by(a)}}function by(a){for(;Xe!==null;){var c=Xe;if(c.flags&8772){var f=c.alternate;try{if(c.flags&8772)switch(c.tag){case 0:case 11:case 15:wr||Ou(5,c);break;case 1:var y=c.stateNode;if(c.flags&4&&!wr)if(f===null)y.componentDidMount();else{var I=c.elementType===c.type?f.memoizedProps:Xn(c.type,f.memoizedProps);y.componentDidUpdate(I,f.memoizedState,y.__reactInternalSnapshotBeforeUpdate)}var b=c.updateQueue;b!==null&&R_(c,b,y);break;case 3:var N=c.updateQueue;if(N!==null){if(f=null,c.child!==null)switch(c.child.tag){case 5:f=c.child.stateNode;break;case 1:f=c.child.stateNode}R_(c,N,f)}break;case 5:var Y=c.stateNode;if(f===null&&c.flags&4){f=Y;var K=c.memoizedProps;switch(c.type){case"button":case"input":case"select":case"textarea":K.autoFocus&&f.focus();break;case"img":K.src&&(f.src=K.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(c.memoizedState===null){var fe=c.alternate;if(fe!==null){var Ie=fe.memoizedState;if(Ie!==null){var Me=Ie.dehydrated;Me!==null&&y2(Me)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(t(163))}wr||c.flags&512&&c6(c)}catch(xe){v0(c,c.return,xe)}}if(c===a){Xe=null;break}if(f=c.sibling,f!==null){f.return=c.return,Xe=f;break}Xe=c.return}}function Ry(a){for(;Xe!==null;){var c=Xe;if(c===a){Xe=null;break}var f=c.sibling;if(f!==null){f.return=c.return,Xe=f;break}Xe=c.return}}function Dy(a){for(;Xe!==null;){var c=Xe;try{switch(c.tag){case 0:case 11:case 15:var f=c.return;try{Ou(4,c)}catch(K){v0(c,f,K)}break;case 1:var y=c.stateNode;if(typeof y.componentDidMount=="function"){var I=c.return;try{y.componentDidMount()}catch(K){v0(c,I,K)}}var b=c.return;try{c6(c)}catch(K){v0(c,b,K)}break;case 5:var N=c.return;try{c6(c)}catch(K){v0(c,N,K)}}}catch(K){v0(c,c.return,K)}if(c===a){Xe=null;break}var Y=c.sibling;if(Y!==null){Y.return=c.return,Xe=Y;break}Xe=c.return}}var bF=Math.ceil,Qu=w.ReactCurrentDispatcher,d6=w.ReactCurrentOwner,Ln=w.ReactCurrentBatchConfig,Nt=0,rr=null,N0=null,hr=0,fn=0,j1=Js(0),H0=0,H2=null,eo=0,zu=0,f6=0,V2=null,qr=null,p6=0,W1=1/0,ss=null,Gu=!1,A6=null,ra=null,Hu=!1,na=null,Vu=0,j2=0,g6=null,ju=-1,Wu=0;function Lr(){return Nt&6?le():ju!==-1?ju:ju=le()}function ia(a){return a.mode&1?Nt&2&&hr!==0?hr&-hr:fF.transition!==null?(Wu===0&&(Wu=Xt()),Wu):(a=Lt,a!==0||(a=window.event,a=a===void 0?16:Nv(a.type)),a):1}function Zn(a,c,f,y){if(50<j2)throw j2=0,g6=null,Error(t(185));er(a,f,y),(!(Nt&2)||a!==rr)&&(a===rr&&(!(Nt&2)&&(zu|=f),H0===4&&sa(a,hr)),Xr(a,y),f===1&&Nt===0&&!(c.mode&1)&&(W1=le()+500,yu&&Zs()))}function Xr(a,c){var f=a.callbackNode;br(a,c);var y=vr(a,a===rr?hr:0);if(y===0)f!==null&&O(f),a.callbackNode=null,a.callbackPriority=0;else if(c=y&-y,a.callbackPriority!==c){if(f!=null&&O(f),c===1)a.tag===0?dF(Ny.bind(null,a)):__(Ny.bind(null,a)),lF(function(){!(Nt&6)&&Zs()}),f=null;else{switch(vi(y)){case 1:f=Ce;break;case 4:f=He;break;case 16:f=Qe;break;case 536870912:f=dt;break;default:f=Qe}f=Gy(f,Ly.bind(null,a))}a.callbackPriority=c,a.callbackNode=f}}function Ly(a,c){if(ju=-1,Wu=0,Nt&6)throw Error(t(327));var f=a.callbackNode;if(Y1()&&a.callbackNode!==f)return null;var y=vr(a,a===rr?hr:0);if(y===0)return null;if(y&30||y&a.expiredLanes||c)c=Yu(a,y);else{c=y;var I=Nt;Nt|=2;var b=Uy();(rr!==a||hr!==c)&&(ss=null,W1=le()+500,ro(a,c));do try{LF();break}catch(Y){Py(a,Y)}while(1);N5(),Qu.current=b,Nt=I,N0!==null?c=0:(rr=null,hr=0,c=H0)}if(c!==0){if(c===2&&(I=Ki(a),I!==0&&(y=I,c=m6(a,I))),c===1)throw f=H2,ro(a,0),sa(a,y),Xr(a,le()),f;if(c===6)sa(a,y);else{if(I=a.current.alternate,!(y&30)&&!RF(I)&&(c=Yu(a,y),c===2&&(b=Ki(a),b!==0&&(y=b,c=m6(a,b))),c===1))throw f=H2,ro(a,0),sa(a,y),Xr(a,le()),f;switch(a.finishedWork=I,a.finishedLanes=y,c){case 0:case 1:throw Error(t(345));case 2:no(a,qr,ss);break;case 3:if(sa(a,y),(y&130023424)===y&&(c=p6+500-le(),10<c)){if(vr(a,0)!==0)break;if(I=a.suspendedLanes,(I&y)!==y){Lr(),a.pingedLanes|=a.suspendedLanes&I;break}a.timeoutHandle=w5(no.bind(null,a,qr,ss),c);break}no(a,qr,ss);break;case 4:if(sa(a,y),(y&4194240)===y)break;for(c=a.eventTimes,I=-1;0<y;){var N=31-Et(y);b=1<<N,N=c[N],N>I&&(I=N),y&=~b}if(y=I,y=le()-y,y=(120>y?120:480>y?480:1080>y?1080:1920>y?1920:3e3>y?3e3:4320>y?4320:1960*bF(y/1960))-y,10<y){a.timeoutHandle=w5(no.bind(null,a,qr,ss),y);break}no(a,qr,ss);break;case 5:no(a,qr,ss);break;default:throw Error(t(329))}}}return Xr(a,le()),a.callbackNode===f?Ly.bind(null,a):null}function m6(a,c){var f=V2;return a.current.memoizedState.isDehydrated&&(ro(a,c).flags|=256),a=Yu(a,c),a!==2&&(c=qr,qr=f,c!==null&&v6(c)),a}function v6(a){qr===null?qr=a:qr.push.apply(qr,a)}function RF(a){for(var c=a;;){if(c.flags&16384){var f=c.updateQueue;if(f!==null&&(f=f.stores,f!==null))for(var y=0;y<f.length;y++){var I=f[y],b=I.getSnapshot;I=I.value;try{if(!Yn(b(),I))return!1}catch{return!1}}}if(f=c.child,c.subtreeFlags&16384&&f!==null)f.return=c,c=f;else{if(c===a)break;for(;c.sibling===null;){if(c.return===null||c.return===a)return!0;c=c.return}c.sibling.return=c.return,c=c.sibling}}return!0}function sa(a,c){for(c&=~f6,c&=~zu,a.suspendedLanes|=c,a.pingedLanes&=~c,a=a.expirationTimes;0<c;){var f=31-Et(c),y=1<<f;a[f]=-1,c&=~y}}function Ny(a){if(Nt&6)throw Error(t(327));Y1();var c=vr(a,0);if(!(c&1))return Xr(a,le()),null;var f=Yu(a,c);if(a.tag!==0&&f===2){var y=Ki(a);y!==0&&(c=y,f=m6(a,y))}if(f===1)throw f=H2,ro(a,0),sa(a,c),Xr(a,le()),f;if(f===6)throw Error(t(345));return a.finishedWork=a.current.alternate,a.finishedLanes=c,no(a,qr,ss),Xr(a,le()),null}function _6(a,c){var f=Nt;Nt|=1;try{return a(c)}finally{Nt=f,Nt===0&&(W1=le()+500,yu&&Zs())}}function to(a){na!==null&&na.tag===0&&!(Nt&6)&&Y1();var c=Nt;Nt|=1;var f=Ln.transition,y=Lt;try{if(Ln.transition=null,Lt=1,a)return a()}finally{Lt=y,Ln.transition=f,Nt=c,!(Nt&6)&&Zs()}}function y6(){fn=j1.current,r0(j1)}function ro(a,c){a.finishedWork=null,a.finishedLanes=0;var f=a.timeoutHandle;if(f!==-1&&(a.timeoutHandle=-1,oF(f)),N0!==null)for(f=N0.return;f!==null;){var y=f;switch(B5(y),y.tag){case 1:y=y.type.childContextTypes,y!=null&&vu();break;case 3:G1(),r0(jr),r0(yr),G5();break;case 5:Q5(y);break;case 4:G1();break;case 13:r0(d0);break;case 19:r0(d0);break;case 10:P5(y.type._context);break;case 22:case 23:y6()}f=f.return}if(rr=a,N0=a=aa(a.current,null),hr=fn=c,H0=0,H2=null,f6=zu=eo=0,qr=V2=null,Ka!==null){for(c=0;c<Ka.length;c++)if(f=Ka[c],y=f.interleaved,y!==null){f.interleaved=null;var I=y.next,b=f.pending;if(b!==null){var N=b.next;b.next=I,y.next=N}f.pending=y}Ka=null}return a}function Py(a,c){do{var f=N0;try{if(N5(),bu.current=Nu,Ru){for(var y=f0.memoizedState;y!==null;){var I=y.queue;I!==null&&(I.pending=null),y=y.next}Ru=!1}if($a=0,tr=G0=f0=null,k2=!1,F2=0,d6.current=null,f===null||f.return===null){H0=1,H2=c,N0=null;break}e:{var b=a,N=f.return,Y=f,K=c;if(c=hr,Y.flags|=32768,K!==null&&typeof K=="object"&&typeof K.then=="function"){var fe=K,Ie=Y,Me=Ie.tag;if(!(Ie.mode&1)&&(Me===0||Me===11||Me===15)){var xe=Ie.alternate;xe?(Ie.updateQueue=xe.updateQueue,Ie.memoizedState=xe.memoizedState,Ie.lanes=xe.lanes):(Ie.updateQueue=null,Ie.memoizedState=null)}var je=ay(N);if(je!==null){je.flags&=-257,oy(je,N,Y,b,c),je.mode&1&&sy(b,fe,c),c=je,K=fe;var Je=c.updateQueue;if(Je===null){var Ke=new Set;Ke.add(K),c.updateQueue=Ke}else Je.add(K);break e}else{if(!(c&1)){sy(b,fe,c),E6();break e}K=Error(t(426))}}else if(o0&&Y.mode&1){var x0=ay(N);if(x0!==null){!(x0.flags&65536)&&(x0.flags|=256),oy(x0,N,Y,b,c),D5(H1(K,Y));break e}}b=K=H1(K,Y),H0!==4&&(H0=2),V2===null?V2=[b]:V2.push(b),b=N;do{switch(b.tag){case 3:b.flags|=65536,c&=-c,b.lanes|=c;var ae=ny(b,K,c);b_(b,ae);break e;case 1:Y=K;var ee=b.type,ce=b.stateNode;if(!(b.flags&128)&&(typeof ee.getDerivedStateFromError=="function"||ce!==null&&typeof ce.componentDidCatch=="function"&&(ra===null||!ra.has(ce)))){b.flags|=65536,c&=-c,b.lanes|=c;var be=iy(b,Y,c);b_(b,be);break e}}b=b.return}while(b!==null)}Fy(f)}catch($e){c=$e,N0===f&&f!==null&&(N0=f=f.return);continue}break}while(1)}function Uy(){var a=Qu.current;return Qu.current=Nu,a===null?Nu:a}function E6(){(H0===0||H0===3||H0===2)&&(H0=4),rr===null||!(eo&268435455)&&!(zu&268435455)||sa(rr,hr)}function Yu(a,c){var f=Nt;Nt|=2;var y=Uy();(rr!==a||hr!==c)&&(ss=null,ro(a,c));do try{DF();break}catch(I){Py(a,I)}while(1);if(N5(),Nt=f,Qu.current=y,N0!==null)throw Error(t(261));return rr=null,hr=0,H0}function DF(){for(;N0!==null;)ky(N0)}function LF(){for(;N0!==null&&!ie();)ky(N0)}function ky(a){var c=zy(a.alternate,a,fn);a.memoizedProps=a.pendingProps,c===null?Fy(a):N0=c,d6.current=null}function Fy(a){var c=a;do{var f=c.alternate;if(a=c.return,c.flags&32768){if(f=MF(f,c),f!==null){f.flags&=32767,N0=f;return}if(a!==null)a.flags|=32768,a.subtreeFlags=0,a.deletions=null;else{H0=6,N0=null;return}}else if(f=IF(f,c,fn),f!==null){N0=f;return}if(c=c.sibling,c!==null){N0=c;return}N0=c=a}while(c!==null);H0===0&&(H0=5)}function no(a,c,f){var y=Lt,I=Ln.transition;try{Ln.transition=null,Lt=1,NF(a,c,f,y)}finally{Ln.transition=I,Lt=y}return null}function NF(a,c,f,y){do Y1();while(na!==null);if(Nt&6)throw Error(t(327));f=a.finishedWork;var I=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(z0(a,b),a===rr&&(N0=rr=null,hr=0),!(f.subtreeFlags&2064)&&!(f.flags&2064)||Hu||(Hu=!0,Gy(Qe,function(){return Y1(),null})),b=(f.flags&15990)!==0,f.subtreeFlags&15990||b){b=Ln.transition,Ln.transition=null;var N=Lt;Lt=1;var Y=Nt;Nt|=4,d6.current=null,TF(a,f),Ty(f,a),eF(E5),iu=!!y5,E5=y5=null,a.current=f,BF(f),de(),Nt=Y,Lt=N,Ln.transition=b}else a.current=f;if(Hu&&(Hu=!1,na=a,Vu=I),b=a.pendingLanes,b===0&&(ra=null),Dt(f.stateNode),Xr(a,le()),c!==null)for(y=a.onRecoverableError,f=0;f<c.length;f++)I=c[f],y(I.value,{componentStack:I.stack,digest:I.digest});if(Gu)throw Gu=!1,a=A6,A6=null,a;return Vu&1&&a.tag!==0&&Y1(),b=a.pendingLanes,b&1?a===g6?j2++:(j2=0,g6=a):j2=0,Zs(),null}function Y1(){if(na!==null){var a=vi(Vu),c=Ln.transition,f=Lt;try{if(Ln.transition=null,Lt=16>a?16:a,na===null)var y=!1;else{if(a=na,na=null,Vu=0,Nt&6)throw Error(t(331));var I=Nt;for(Nt|=4,Xe=a.current;Xe!==null;){var b=Xe,N=b.child;if(Xe.flags&16){var Y=b.deletions;if(Y!==null){for(var K=0;K<Y.length;K++){var fe=Y[K];for(Xe=fe;Xe!==null;){var Ie=Xe;switch(Ie.tag){case 0:case 11:case 15:G2(8,Ie,b)}var Me=Ie.child;if(Me!==null)Me.return=Ie,Xe=Me;else for(;Xe!==null;){Ie=Xe;var xe=Ie.sibling,je=Ie.return;if(wy(Ie),Ie===fe){Xe=null;break}if(xe!==null){xe.return=je,Xe=xe;break}Xe=je}}}var Je=b.alternate;if(Je!==null){var Ke=Je.child;if(Ke!==null){Je.child=null;do{var x0=Ke.sibling;Ke.sibling=null,Ke=x0}while(Ke!==null)}}Xe=b}}if(b.subtreeFlags&2064&&N!==null)N.return=b,Xe=N;else e:for(;Xe!==null;){if(b=Xe,b.flags&2048)switch(b.tag){case 0:case 11:case 15:G2(9,b,b.return)}var ae=b.sibling;if(ae!==null){ae.return=b.return,Xe=ae;break e}Xe=b.return}}var ee=a.current;for(Xe=ee;Xe!==null;){N=Xe;var ce=N.child;if(N.subtreeFlags&2064&&ce!==null)ce.return=N,Xe=ce;else e:for(N=ee;Xe!==null;){if(Y=Xe,Y.flags&2048)try{switch(Y.tag){case 0:case 11:case 15:Ou(9,Y)}}catch($e){v0(Y,Y.return,$e)}if(Y===N){Xe=null;break e}var be=Y.sibling;if(be!==null){be.return=Y.return,Xe=be;break e}Xe=Y.return}}if(Nt=I,Zs(),rt&&typeof rt.onPostCommitFiberRoot=="function")try{rt.onPostCommitFiberRoot(ct,a)}catch{}y=!0}return y}finally{Lt=f,Ln.transition=c}}return!1}function Oy(a,c,f){c=H1(f,c),c=ny(a,c,1),a=ea(a,c,1),c=Lr(),a!==null&&(er(a,1,c),Xr(a,c))}function v0(a,c,f){if(a.tag===3)Oy(a,a,f);else for(;c!==null;){if(c.tag===3){Oy(c,a,f);break}else if(c.tag===1){var y=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof y.componentDidCatch=="function"&&(ra===null||!ra.has(y))){a=H1(f,a),a=iy(c,a,1),c=ea(c,a,1),a=Lr(),c!==null&&(er(c,1,a),Xr(c,a));break}}c=c.return}}function PF(a,c,f){var y=a.pingCache;y!==null&&y.delete(c),c=Lr(),a.pingedLanes|=a.suspendedLanes&f,rr===a&&(hr&f)===f&&(H0===4||H0===3&&(hr&130023424)===hr&&500>le()-p6?ro(a,0):f6|=f),Xr(a,c)}function Qy(a,c){c===0&&(a.mode&1?(c=L0,L0<<=1,!(L0&130023424)&&(L0=4194304)):c=1);var f=Lr();a=rs(a,c),a!==null&&(er(a,c,f),Xr(a,f))}function UF(a){var c=a.memoizedState,f=0;c!==null&&(f=c.retryLane),Qy(a,f)}function kF(a,c){var f=0;switch(a.tag){case 13:var y=a.stateNode,I=a.memoizedState;I!==null&&(f=I.retryLane);break;case 19:y=a.stateNode;break;default:throw Error(t(314))}y!==null&&y.delete(c),Qy(a,f)}var zy;zy=function(a,c,f){if(a!==null)if(a.memoizedProps!==c.pendingProps||jr.current)Yr=!0;else{if(!(a.lanes&f)&&!(c.flags&128))return Yr=!1,CF(a,c,f);Yr=!!(a.flags&131072)}else Yr=!1,o0&&c.flags&1048576&&y_(c,xu,c.index);switch(c.lanes=0,c.tag){case 2:var y=c.type;ku(a,c),a=c.pendingProps;var I=P1(c,yr.current);z1(c,f),I=j5(null,c,y,a,I,f);var b=W5();return c.flags|=1,typeof I=="object"&&I!==null&&typeof I.render=="function"&&I.$$typeof===void 0?(c.tag=1,c.memoizedState=null,c.updateQueue=null,Wr(y)?(b=!0,_u(c)):b=!1,c.memoizedState=I.state!==null&&I.state!==void 0?I.state:null,F5(c),I.updater=Pu,c.stateNode=I,I._reactInternals=c,Z5(c,y,a,f),c=r6(null,c,y,!0,b,f)):(c.tag=0,o0&&b&&T5(c),Dr(null,c,I,f),c=c.child),c;case 16:y=c.elementType;e:{switch(ku(a,c),a=c.pendingProps,I=y._init,y=I(y._payload),c.type=y,I=c.tag=OF(y),a=Xn(y,a),I){case 0:c=t6(null,c,y,a,f);break e;case 1:c=fy(null,c,y,a,f);break e;case 11:c=ly(null,c,y,a,f);break e;case 14:c=cy(null,c,y,Xn(y.type,a),f);break e}throw Error(t(306,y,""))}return c;case 0:return y=c.type,I=c.pendingProps,I=c.elementType===y?I:Xn(y,I),t6(a,c,y,I,f);case 1:return y=c.type,I=c.pendingProps,I=c.elementType===y?I:Xn(y,I),fy(a,c,y,I,f);case 3:e:{if(py(c),a===null)throw Error(t(387));y=c.pendingProps,b=c.memoizedState,I=b.element,B_(a,c),Tu(c,y,null,f);var N=c.memoizedState;if(y=N.element,b.isDehydrated)if(b={element:y,isDehydrated:!1,cache:N.cache,pendingSuspenseBoundaries:N.pendingSuspenseBoundaries,transitions:N.transitions},c.updateQueue.baseState=b,c.memoizedState=b,c.flags&256){I=H1(Error(t(423)),c),c=Ay(a,c,y,f,I);break e}else if(y!==I){I=H1(Error(t(424)),c),c=Ay(a,c,y,f,I);break e}else for(dn=Xs(c.stateNode.containerInfo.firstChild),hn=c,o0=!0,qn=null,f=S_(c,null,y,f),c.child=f;f;)f.flags=f.flags&-3|4096,f=f.sibling;else{if(F1(),y===I){c=is(a,c,f);break e}Dr(a,c,y,f)}c=c.child}return c;case 5:return D_(c),a===null&&R5(c),y=c.type,I=c.pendingProps,b=a!==null?a.memoizedProps:null,N=I.children,x5(y,I)?N=null:b!==null&&x5(y,b)&&(c.flags|=32),dy(a,c),Dr(a,c,N,f),c.child;case 6:return a===null&&R5(c),null;case 13:return gy(a,c,f);case 4:return O5(c,c.stateNode.containerInfo),y=c.pendingProps,a===null?c.child=O1(c,null,y,f):Dr(a,c,y,f),c.child;case 11:return y=c.type,I=c.pendingProps,I=c.elementType===y?I:Xn(y,I),ly(a,c,y,I,f);case 7:return Dr(a,c,c.pendingProps,f),c.child;case 8:return Dr(a,c,c.pendingProps.children,f),c.child;case 12:return Dr(a,c,c.pendingProps.children,f),c.child;case 10:e:{if(y=c.type._context,I=c.pendingProps,b=c.memoizedProps,N=I.value,Zt(Iu,y._currentValue),y._currentValue=N,b!==null)if(Yn(b.value,N)){if(b.children===I.children&&!jr.current){c=is(a,c,f);break e}}else for(b=c.child,b!==null&&(b.return=c);b!==null;){var Y=b.dependencies;if(Y!==null){N=b.child;for(var K=Y.firstContext;K!==null;){if(K.context===y){if(b.tag===1){K=ns(-1,f&-f),K.tag=2;var fe=b.updateQueue;if(fe!==null){fe=fe.shared;var Ie=fe.pending;Ie===null?K.next=K:(K.next=Ie.next,Ie.next=K),fe.pending=K}}b.lanes|=f,K=b.alternate,K!==null&&(K.lanes|=f),U5(b.return,f,c),Y.lanes|=f;break}K=K.next}}else if(b.tag===10)N=b.type===c.type?null:b.child;else if(b.tag===18){if(N=b.return,N===null)throw Error(t(341));N.lanes|=f,Y=N.alternate,Y!==null&&(Y.lanes|=f),U5(N,f,c),N=b.sibling}else N=b.child;if(N!==null)N.return=b;else for(N=b;N!==null;){if(N===c){N=null;break}if(b=N.sibling,b!==null){b.return=N.return,N=b;break}N=N.return}b=N}Dr(a,c,I.children,f),c=c.child}return c;case 9:return I=c.type,y=c.pendingProps.children,z1(c,f),I=Rn(I),y=y(I),c.flags|=1,Dr(a,c,y,f),c.child;case 14:return y=c.type,I=Xn(y,c.pendingProps),I=Xn(y.type,I),cy(a,c,y,I,f);case 15:return uy(a,c,c.type,c.pendingProps,f);case 17:return y=c.type,I=c.pendingProps,I=c.elementType===y?I:Xn(y,I),ku(a,c),c.tag=1,Wr(y)?(a=!0,_u(c)):a=!1,z1(c,f),ty(c,y,I),Z5(c,y,I,f),r6(null,c,y,!0,a,f);case 19:return vy(a,c,f);case 22:return hy(a,c,f)}throw Error(t(156,c.tag))};function Gy(a,c){return tu(a,c)}function FF(a,c,f,y){this.tag=a,this.key=f,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=y,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Nn(a,c,f,y){return new FF(a,c,f,y)}function x6(a){return a=a.prototype,!(!a||!a.isReactComponent)}function OF(a){if(typeof a=="function")return x6(a)?1:0;if(a!=null){if(a=a.$$typeof,a===P)return 11;if(a===J)return 14}return 2}function aa(a,c){var f=a.alternate;return f===null?(f=Nn(a.tag,c,a.key,a.mode),f.elementType=a.elementType,f.type=a.type,f.stateNode=a.stateNode,f.alternate=a,a.alternate=f):(f.pendingProps=c,f.type=a.type,f.flags=0,f.subtreeFlags=0,f.deletions=null),f.flags=a.flags&14680064,f.childLanes=a.childLanes,f.lanes=a.lanes,f.child=a.child,f.memoizedProps=a.memoizedProps,f.memoizedState=a.memoizedState,f.updateQueue=a.updateQueue,c=a.dependencies,f.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},f.sibling=a.sibling,f.index=a.index,f.ref=a.ref,f}function qu(a,c,f,y,I,b){var N=2;if(y=a,typeof a=="function")x6(a)&&(N=1);else if(typeof a=="string")N=5;else e:switch(a){case S:return io(f.children,I,b,c);case D:N=8,I|=8;break;case R:return a=Nn(12,f,c,I|2),a.elementType=R,a.lanes=b,a;case F:return a=Nn(13,f,c,I),a.elementType=F,a.lanes=b,a;case z:return a=Nn(19,f,c,I),a.elementType=z,a.lanes=b,a;case ne:return Xu(f,I,b,c);default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case M:N=10;break e;case L:N=9;break e;case P:N=11;break e;case J:N=14;break e;case q:N=16,y=null;break e}throw Error(t(130,a==null?a:typeof a,""))}return c=Nn(N,f,c,I),c.elementType=a,c.type=y,c.lanes=b,c}function io(a,c,f,y){return a=Nn(7,a,y,c),a.lanes=f,a}function Xu(a,c,f,y){return a=Nn(22,a,y,c),a.elementType=ne,a.lanes=f,a.stateNode={isHidden:!1},a}function w6(a,c,f){return a=Nn(6,a,null,c),a.lanes=f,a}function C6(a,c,f){return c=Nn(4,a.children!==null?a.children:[],a.key,c),c.lanes=f,c.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},c}function QF(a,c,f,y,I){this.tag=c,this.containerInfo=a,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=_r(0),this.expirationTimes=_r(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=_r(0),this.identifierPrefix=y,this.onRecoverableError=I,this.mutableSourceEagerHydrationData=null}function I6(a,c,f,y,I,b,N,Y,K){return a=new QF(a,c,f,Y,K),c===1?(c=1,b===!0&&(c|=8)):c=0,b=Nn(3,null,null,c),a.current=b,b.stateNode=a,b.memoizedState={element:y,isDehydrated:f,cache:null,transitions:null,pendingSuspenseBoundaries:null},F5(b),a}function zF(a,c,f){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:T,key:y==null?null:""+y,children:a,containerInfo:c,implementation:f}}function Hy(a){if(!a)return Ks;a=a._reactInternals;e:{if(mi(a)!==a||a.tag!==1)throw Error(t(170));var c=a;do{switch(c.tag){case 3:c=c.stateNode.context;break e;case 1:if(Wr(c.type)){c=c.stateNode.__reactInternalMemoizedMergedChildContext;break e}}c=c.return}while(c!==null);throw Error(t(171))}if(a.tag===1){var f=a.type;if(Wr(f))return m_(a,f,c)}return c}function Vy(a,c,f,y,I,b,N,Y,K){return a=I6(f,y,!0,a,I,b,N,Y,K),a.context=Hy(null),f=a.current,y=Lr(),I=ia(f),b=ns(y,I),b.callback=c??null,ea(f,b,I),a.current.lanes=I,er(a,I,y),Xr(a,y),a}function Ju(a,c,f,y){var I=c.current,b=Lr(),N=ia(I);return f=Hy(f),c.context===null?c.context=f:c.pendingContext=f,c=ns(b,N),c.payload={element:a},y=y===void 0?null:y,y!==null&&(c.callback=y),a=ea(I,c,N),a!==null&&(Zn(a,I,N,b),Su(a,I,N)),N}function Ku(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 jy(a,c){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var f=a.retryLane;a.retryLane=f!==0&&f<c?f:c}}function M6(a,c){jy(a,c),(a=a.alternate)&&jy(a,c)}function GF(){return null}var Wy=typeof reportError=="function"?reportError:function(a){console.error(a)};function S6(a){this._internalRoot=a}Zu.prototype.render=S6.prototype.render=function(a){var c=this._internalRoot;if(c===null)throw Error(t(409));Ju(a,c,null,null)},Zu.prototype.unmount=S6.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var c=a.containerInfo;to(function(){Ju(null,a,null,null)}),c[Zi]=null}};function Zu(a){this._internalRoot=a}Zu.prototype.unstable_scheduleHydration=function(a){if(a){var c=Bv();a={blockedOn:null,target:a,priority:c};for(var f=0;f<Ws.length&&c!==0&&c<Ws[f].priority;f++);Ws.splice(f,0,a),f===0&&Dv(a)}};function T6(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function $u(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11&&(a.nodeType!==8||a.nodeValue!==" react-mount-point-unstable "))}function Yy(){}function HF(a,c,f,y,I){if(I){if(typeof y=="function"){var b=y;y=function(){var fe=Ku(N);b.call(fe)}}var N=Vy(c,y,a,0,null,!1,!1,"",Yy);return a._reactRootContainer=N,a[Zi]=N.current,B2(a.nodeType===8?a.parentNode:a),to(),N}for(;I=a.lastChild;)a.removeChild(I);if(typeof y=="function"){var Y=y;y=function(){var fe=Ku(K);Y.call(fe)}}var K=I6(a,0,!1,null,null,!1,!1,"",Yy);return a._reactRootContainer=K,a[Zi]=K.current,B2(a.nodeType===8?a.parentNode:a),to(function(){Ju(c,K,f,y)}),K}function e3(a,c,f,y,I){var b=f._reactRootContainer;if(b){var N=b;if(typeof I=="function"){var Y=I;I=function(){var K=Ku(N);Y.call(K)}}Ju(c,N,a,I)}else N=HF(f,c,a,I,y);return Ku(N)}Sv=function(a){switch(a.tag){case 3:var c=a.stateNode;if(c.current.memoizedState.isDehydrated){var f=cn(c.pendingLanes);f!==0&&(Rr(c,f|1),Xr(c,le()),!(Nt&6)&&(W1=le()+500,Zs()))}break;case 13:to(function(){var y=rs(a,1);if(y!==null){var I=Lr();Zn(y,a,1,I)}}),M6(a,1)}},$h=function(a){if(a.tag===13){var c=rs(a,134217728);if(c!==null){var f=Lr();Zn(c,a,134217728,f)}M6(a,134217728)}},Tv=function(a){if(a.tag===13){var c=ia(a),f=rs(a,c);if(f!==null){var y=Lr();Zn(f,a,c,y)}M6(a,c)}},Bv=function(){return Lt},bv=function(a,c){var f=Lt;try{return Lt=a,c()}finally{Lt=f}},Se=function(a,c,f){switch(c){case"input":if(At(a,f),c=f.name,f.type==="radio"&&c!=null){for(f=a;f.parentNode;)f=f.parentNode;for(f=f.querySelectorAll("input[name="+JSON.stringify(""+c)+'][type="radio"]'),c=0;c<f.length;c++){var y=f[c];if(y!==a&&y.form===a.form){var I=mu(y);if(!I)throw Error(t(90));ut(y),At(y,I)}}}break;case"textarea":ye(a,f);break;case"select":c=f.value,c!=null&&Q(a,!!f.multiple,c,!1)}},jt=_6,y0=to;var VF={usingClientEntryPoint:!1,Events:[D2,L1,mu,Be,it,_6]},W2={findFiberByHostInstance:Ya,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},jF={bundleType:W2.bundleType,version:W2.version,rendererPackageName:W2.rendererPackageName,rendererConfig:W2.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:w.ReactCurrentDispatcher,findHostInstanceByFiber:function(a){return a=$c(a),a===null?null:a.stateNode},findFiberByHostInstance:W2.findFiberByHostInstance||GF,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var t3=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!t3.isDisabled&&t3.supportsFiber)try{ct=t3.inject(jF),rt=t3}catch{}}return Vr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=VF,Vr.createPortal=function(a,c){var f=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!T6(c))throw Error(t(200));return zF(a,c,null,f)},Vr.createRoot=function(a,c){if(!T6(a))throw Error(t(299));var f=!1,y="",I=Wy;return c!=null&&(c.unstable_strictMode===!0&&(f=!0),c.identifierPrefix!==void 0&&(y=c.identifierPrefix),c.onRecoverableError!==void 0&&(I=c.onRecoverableError)),c=I6(a,1,!1,null,null,f,!1,y,I),a[Zi]=c.current,B2(a.nodeType===8?a.parentNode:a),new S6(c)},Vr.findDOMNode=function(a){if(a==null)return null;if(a.nodeType===1)return a;var c=a._reactInternals;if(c===void 0)throw typeof a.render=="function"?Error(t(188)):(a=Object.keys(a).join(","),Error(t(268,a)));return a=$c(c),a=a===null?null:a.stateNode,a},Vr.flushSync=function(a){return to(a)},Vr.hydrate=function(a,c,f){if(!$u(c))throw Error(t(200));return e3(null,a,c,!0,f)},Vr.hydrateRoot=function(a,c,f){if(!T6(a))throw Error(t(405));var y=f!=null&&f.hydratedSources||null,I=!1,b="",N=Wy;if(f!=null&&(f.unstable_strictMode===!0&&(I=!0),f.identifierPrefix!==void 0&&(b=f.identifierPrefix),f.onRecoverableError!==void 0&&(N=f.onRecoverableError)),c=Vy(c,null,a,1,f??null,I,!1,b,N),a[Zi]=c.current,B2(a),y)for(a=0;a<y.length;a++)f=y[a],I=f._getVersion,I=I(f._source),c.mutableSourceEagerHydrationData==null?c.mutableSourceEagerHydrationData=[f,I]:c.mutableSourceEagerHydrationData.push(f,I);return new Zu(c)},Vr.render=function(a,c,f){if(!$u(c))throw Error(t(200));return e3(null,a,c,!1,f)},Vr.unmountComponentAtNode=function(a){if(!$u(a))throw Error(t(40));return a._reactRootContainer?(to(function(){e3(null,null,a,!1,function(){a._reactRootContainer=null,a[Zi]=null})}),!0):!1},Vr.unstable_batchedUpdates=_6,Vr.unstable_renderSubtreeIntoContainer=function(a,c,f,y){if(!$u(f))throw Error(t(200));if(a==null||a._reactInternals===void 0)throw Error(t(38));return e3(a,c,f,!1,y)},Vr.version="18.3.1-next-f1338f8080-20240426",Vr}function dv(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(dv)}catch(r){console.error(r)}}dv(),lv.exports=XU();var JU=lv.exports,fv=JU;Wh.createRoot=fv.createRoot,Wh.hydrateRoot=fv.hydrateRoot;class KU{constructor({apiKey:e,apiService:t,events:n,appControlService:i}){wt(this,"targetElement");wt(this,"apiService");wt(this,"events");wt(this,"htmlTarget");wt(this,"appControlService");wt(this,"apiKey");this.apiKey=e,this.apiService=t,this.events=n,this.appControlService=i}mount(e,t,n){if(!this.targetElement){const s=t.customId??"dita-3dconfig-element",o=document.getElementById(s);if(!o)throw new Error(`Element not found with id => '${s}' `);this.htmlTarget=o,this.htmlTarget.style.height="100%",this.htmlTarget.style.width="100%",this.targetElement=Wh.createRoot(document.getElementById(s))}const i=q2.createElement(WU,{apiKey:this.apiKey,apiService:this.apiService,events:this.events,sku:e,viewerOnly:t.viewerOnly,lensSku:n??void 0,appControlService:this.appControlService});this.targetElement.render(i)}unmount(){this.targetElement&&(this.appControlService.reset(),this.targetElement.unmount(),this.targetElement=void 0,this.htmlTarget&&(this.htmlTarget.style.height="0px",this.htmlTarget.style.width="auto"))}}var Xh={exports:{}},C1=typeof Reflect=="object"?Reflect:null,pv=C1&&typeof C1.apply=="function"?C1.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)},Yc;C1&&typeof C1.ownKeys=="function"?Yc=C1.ownKeys:Object.getOwnPropertySymbols?Yc=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Yc=function(e){return Object.getOwnPropertyNames(e)};function ZU(r){console&&console.warn&&console.warn(r)}var Av=Number.isNaN||function(e){return e!==e};function Vt(){Vt.init.call(this)}Xh.exports=Vt,Xh.exports.once=rk,Vt.EventEmitter=Vt,Vt.prototype._events=void 0,Vt.prototype._eventsCount=0,Vt.prototype._maxListeners=void 0;var gv=10;function qc(r){if(typeof r!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r)}Object.defineProperty(Vt,"defaultMaxListeners",{enumerable:!0,get:function(){return gv},set:function(r){if(typeof r!="number"||r<0||Av(r))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+r+".");gv=r}}),Vt.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},Vt.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||Av(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 mv(r){return r._maxListeners===void 0?Vt.defaultMaxListeners:r._maxListeners}Vt.prototype.getMaxListeners=function(){return mv(this)},Vt.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var i=e==="error",s=this._events;if(s!==void 0)i=i&&s.error===void 0;else if(!i)return!1;if(i){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var l=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw l.context=o,l}var h=s[e];if(h===void 0)return!1;if(typeof h=="function")pv(h,this,t);else for(var u=h.length,d=xv(h,u),n=0;n<u;++n)pv(d[n],this,t);return!0};function vv(r,e,t,n){var i,s,o;if(qc(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=mv(r),i>0&&o.length>i&&!o.warned){o.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=r,l.type=e,l.count=o.length,ZU(l)}return r}Vt.prototype.addListener=function(e,t){return vv(this,e,t,!1)},Vt.prototype.on=Vt.prototype.addListener,Vt.prototype.prependListener=function(e,t){return vv(this,e,t,!0)};function $U(){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 _v(r,e,t){var n={fired:!1,wrapFn:void 0,target:r,type:e,listener:t},i=$U.bind(n);return i.listener=t,n.wrapFn=i,i}Vt.prototype.once=function(e,t){return qc(t),this.on(e,_v(this,e,t)),this},Vt.prototype.prependOnceListener=function(e,t){return qc(t),this.prependListener(e,_v(this,e,t)),this},Vt.prototype.removeListener=function(e,t){var n,i,s,o,l;if(qc(t),i=this._events,i===void 0)return this;if(n=i[e],n===void 0)return this;if(n===t||n.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,n.listener||t));else if(typeof n!="function"){for(s=-1,o=n.length-1;o>=0;o--)if(n[o]===t||n[o].listener===t){l=n[o].listener,s=o;break}if(s<0)return this;s===0?n.shift():ek(n,s),n.length===1&&(i[e]=n[0]),i.removeListener!==void 0&&this.emit("removeListener",e,l||t)}return this},Vt.prototype.off=Vt.prototype.removeListener,Vt.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 yv(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?tk(i):xv(i,i.length)}Vt.prototype.listeners=function(e){return yv(this,e,!0)},Vt.prototype.rawListeners=function(e){return yv(this,e,!1)},Vt.listenerCount=function(r,e){return typeof r.listenerCount=="function"?r.listenerCount(e):Ev.call(r,e)},Vt.prototype.listenerCount=Ev;function Ev(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}Vt.prototype.eventNames=function(){return this._eventsCount>0?Yc(this._events):[]};function xv(r,e){for(var t=new Array(e),n=0;n<e;++n)t[n]=r[n];return t}function ek(r,e){for(;e+1<r.length;e++)r[e]=r[e+1];r.pop()}function tk(r){for(var e=new Array(r.length),t=0;t<e.length;++t)e[t]=r[t].listener||r[t];return e}function rk(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))}wv(r,e,s,{once:!0}),e!=="error"&&nk(r,i,{once:!0})})}function nk(r,e,t){typeof r.on=="function"&&wv(r,"error",e,t)}function wv(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 ik=Xh.exports;const A2=class A2 extends ik.EventEmitter{emitEvent(e,t){Object.keys(A2.EVENTS).includes(e)&&this.emit(A2.EVENTS[e],t)}};wt(A2,"EVENTS",{onAddToCart:"add-to-cart"});let Jh=A2;const sk={getCartUrl:((Iv=window.Shopify)==null?void 0:Iv.routes.root)+"cart.js",addToCartUrl:((Mv=window.Shopify)==null?void 0:Mv.routes.root)+"cart/add.js"},Cv=Object.freeze(sk);class ak{constructor(e){wt(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()}}class ok{constructor(){wt(this,"changeRxConfigurationHandler",null)}registerChangeRxConfiguration(e){this.changeRxConfigurationHandler=e}async changeRxConfiguration(e,t){var n;await((n=this.changeRxConfigurationHandler)==null?void 0:n.call(this,e,t))}reset(){this.changeRxConfigurationHandler=null}}const{log:lk,error:ck}=console,uk=(...r)=>{ck("❌ 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&",dk={addToCartUrl:Cv.addToCartUrl,getCartUrl:Cv.getCartUrl};let Kh=!1;const fk={config:Pn,log:lk,logErr:uk,metaData:{appVersion:aE,previewUrlPrams:hk,targetClassName:"sprie-embed-element"}};class pk{constructor(){wt(this,"sdkService");wt(this,"apiService");wt(this,"uiService");wt(this,"events");wt(this,"appControlService");this.events=new Jh,this.apiService=new lE(new sE,new ak(dk)),this.appControlService=new ok,this.sdkService=new cE(fk),this.uiService=new KU({apiKey:this.sdkService.apiKey,apiService:this.apiService,events:this.events,appControlService:this.appControlService}),this.sdkService.Init().then(e=>{Kh=e})}isReadyToLoad(){return Kh}load(e,t){Kh?this.loadOnAuth(e,t):this.waitForAllReady(this.isReadyToLoad,()=>this.loadOnAuth(e,t),e,t)}loadOnAuth(e,t){this.uiService.unmount(),this.uiService.mount(e,{viewerOnly:!1,customId:t})}loadViewerOnly(e,t,n){this.uiService.unmount(),this.uiService.mount(e,{viewerOnly:!0,customId:t},n)}async changeRxConfiguration(e,t){await this.appControlService.changeRxConfiguration(e,t)}unload(){this.uiService.unmount()}waitForAllReady(e,t,n,i){e()?t(n,i):setTimeout(()=>{this.waitForAllReady(e,t,n,i)},200)}}window.ditaConfigurator=new pk})();
4724
+ `+b.stack}return{value:a,source:c,stack:I,digest:null}}function $5(a,c,f){return{value:a,source:null,stack:f??null,digest:c??null}}function e6(a,c){try{console.error(c.value)}catch(f){setTimeout(function(){throw f})}}var EF=typeof WeakMap=="function"?WeakMap:Map;function ny(a,c,f){f=ns(-1,f),f.tag=3,f.payload={element:null};var y=c.value;return f.callback=function(){Gu||(Gu=!0,A6=y),e6(a,c)},f}function iy(a,c,f){f=ns(-1,f),f.tag=3;var y=a.type.getDerivedStateFromError;if(typeof y=="function"){var I=c.value;f.payload=function(){return y(I)},f.callback=function(){e6(a,c)}}var b=a.stateNode;return b!==null&&typeof b.componentDidCatch=="function"&&(f.callback=function(){e6(a,c),typeof y!="function"&&(ra===null?ra=new Set([this]):ra.add(this));var N=c.stack;this.componentDidCatch(c.value,{componentStack:N!==null?N:""})}),f}function sy(a,c,f){var y=a.pingCache;if(y===null){y=a.pingCache=new EF;var I=new Set;y.set(c,I)}else I=y.get(c),I===void 0&&(I=new Set,y.set(c,I));I.has(f)||(I.add(f),a=PF.bind(null,a,c,f),c.then(a,a))}function ay(a){do{var c;if((c=a.tag===13)&&(c=a.memoizedState,c=c!==null?c.dehydrated!==null:!0),c)return a;a=a.return}while(a!==null);return null}function oy(a,c,f,y,I){return a.mode&1?(a.flags|=65536,a.lanes=I,a):(a===c?a.flags|=65536:(a.flags|=128,f.flags|=131072,f.flags&=-52805,f.tag===1&&(f.alternate===null?f.tag=17:(c=ns(-1,1),c.tag=2,ea(f,c,1))),f.lanes|=1),a)}var xF=w.ReactCurrentOwner,Yr=!1;function Dr(a,c,f,y){c.child=a===null?S_(c,null,f,y):O1(c,a.child,f,y)}function ly(a,c,f,y,I){f=f.render;var b=c.ref;return z1(c,I),y=j5(a,c,f,y,b,I),f=W5(),a!==null&&!Yr?(c.updateQueue=a.updateQueue,c.flags&=-2053,a.lanes&=~I,is(a,c,I)):(o0&&f&&T5(c),c.flags|=1,Dr(a,c,y,I),c.child)}function cy(a,c,f,y,I){if(a===null){var b=f.type;return typeof b=="function"&&!x6(b)&&b.defaultProps===void 0&&f.compare===null&&f.defaultProps===void 0?(c.tag=15,c.type=b,uy(a,c,b,y,I)):(a=qu(f.type,null,y,c,c.mode,I),a.ref=c.ref,a.return=c,c.child=a)}if(b=a.child,!(a.lanes&I)){var N=b.memoizedProps;if(f=f.compare,f=f!==null?f:M2,f(N,y)&&a.ref===c.ref)return is(a,c,I)}return c.flags|=1,a=aa(b,y),a.ref=c.ref,a.return=c,c.child=a}function uy(a,c,f,y,I){if(a!==null){var b=a.memoizedProps;if(M2(b,y)&&a.ref===c.ref)if(Yr=!1,c.pendingProps=y=b,(a.lanes&I)!==0)a.flags&131072&&(Yr=!0);else return c.lanes=a.lanes,is(a,c,I)}return t6(a,c,f,y,I)}function hy(a,c,f){var y=c.pendingProps,I=y.children,b=a!==null?a.memoizedState:null;if(y.mode==="hidden")if(!(c.mode&1))c.memoizedState={baseLanes:0,cachePool:null,transitions:null},Zt(j1,fn),fn|=f;else{if(!(f&1073741824))return a=b!==null?b.baseLanes|f:f,c.lanes=c.childLanes=1073741824,c.memoizedState={baseLanes:a,cachePool:null,transitions:null},c.updateQueue=null,Zt(j1,fn),fn|=a,null;c.memoizedState={baseLanes:0,cachePool:null,transitions:null},y=b!==null?b.baseLanes:f,Zt(j1,fn),fn|=y}else b!==null?(y=b.baseLanes|f,c.memoizedState=null):y=f,Zt(j1,fn),fn|=y;return Dr(a,c,I,f),c.child}function dy(a,c){var f=c.ref;(a===null&&f!==null||a!==null&&a.ref!==f)&&(c.flags|=512,c.flags|=2097152)}function t6(a,c,f,y,I){var b=Wr(f)?qa:yr.current;return b=P1(c,b),z1(c,I),f=j5(a,c,f,y,b,I),y=W5(),a!==null&&!Yr?(c.updateQueue=a.updateQueue,c.flags&=-2053,a.lanes&=~I,is(a,c,I)):(o0&&y&&T5(c),c.flags|=1,Dr(a,c,f,I),c.child)}function fy(a,c,f,y,I){if(Wr(f)){var b=!0;_u(c)}else b=!1;if(z1(c,I),c.stateNode===null)ku(a,c),ty(c,f,y),Z5(c,f,y,I),y=!0;else if(a===null){var N=c.stateNode,Y=c.memoizedProps;N.props=Y;var K=N.context,fe=f.contextType;typeof fe=="object"&&fe!==null?fe=Rn(fe):(fe=Wr(f)?qa:yr.current,fe=P1(c,fe));var Ie=f.getDerivedStateFromProps,Me=typeof Ie=="function"||typeof N.getSnapshotBeforeUpdate=="function";Me||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(Y!==y||K!==fe)&&ry(c,N,y,fe),$s=!1;var xe=c.memoizedState;N.state=xe,Tu(c,y,N,I),K=c.memoizedState,Y!==y||xe!==K||jr.current||$s?(typeof Ie=="function"&&(K5(c,f,Ie,y),K=c.memoizedState),(Y=$s||ey(c,f,Y,y,xe,K,fe))?(Me||typeof N.UNSAFE_componentWillMount!="function"&&typeof N.componentWillMount!="function"||(typeof N.componentWillMount=="function"&&N.componentWillMount(),typeof N.UNSAFE_componentWillMount=="function"&&N.UNSAFE_componentWillMount()),typeof N.componentDidMount=="function"&&(c.flags|=4194308)):(typeof N.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=y,c.memoizedState=K),N.props=y,N.state=K,N.context=fe,y=Y):(typeof N.componentDidMount=="function"&&(c.flags|=4194308),y=!1)}else{N=c.stateNode,B_(a,c),Y=c.memoizedProps,fe=c.type===c.elementType?Y:Xn(c.type,Y),N.props=fe,Me=c.pendingProps,xe=N.context,K=f.contextType,typeof K=="object"&&K!==null?K=Rn(K):(K=Wr(f)?qa:yr.current,K=P1(c,K));var je=f.getDerivedStateFromProps;(Ie=typeof je=="function"||typeof N.getSnapshotBeforeUpdate=="function")||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(Y!==Me||xe!==K)&&ry(c,N,y,K),$s=!1,xe=c.memoizedState,N.state=xe,Tu(c,y,N,I);var Je=c.memoizedState;Y!==Me||xe!==Je||jr.current||$s?(typeof je=="function"&&(K5(c,f,je,y),Je=c.memoizedState),(fe=$s||ey(c,f,fe,y,xe,Je,K)||!1)?(Ie||typeof N.UNSAFE_componentWillUpdate!="function"&&typeof N.componentWillUpdate!="function"||(typeof N.componentWillUpdate=="function"&&N.componentWillUpdate(y,Je,K),typeof N.UNSAFE_componentWillUpdate=="function"&&N.UNSAFE_componentWillUpdate(y,Je,K)),typeof N.componentDidUpdate=="function"&&(c.flags|=4),typeof N.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof N.componentDidUpdate!="function"||Y===a.memoizedProps&&xe===a.memoizedState||(c.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||Y===a.memoizedProps&&xe===a.memoizedState||(c.flags|=1024),c.memoizedProps=y,c.memoizedState=Je),N.props=y,N.state=Je,N.context=K,y=fe):(typeof N.componentDidUpdate!="function"||Y===a.memoizedProps&&xe===a.memoizedState||(c.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||Y===a.memoizedProps&&xe===a.memoizedState||(c.flags|=1024),y=!1)}return r6(a,c,f,y,b,I)}function r6(a,c,f,y,I,b){dy(a,c);var N=(c.flags&128)!==0;if(!y&&!N)return I&&v_(c,f,!1),is(a,c,b);y=c.stateNode,xF.current=c;var Y=N&&typeof f.getDerivedStateFromError!="function"?null:y.render();return c.flags|=1,a!==null&&N?(c.child=O1(c,a.child,null,b),c.child=O1(c,null,Y,b)):Dr(a,c,Y,b),c.memoizedState=y.state,I&&v_(c,f,!0),c.child}function py(a){var c=a.stateNode;c.pendingContext?g_(a,c.pendingContext,c.pendingContext!==c.context):c.context&&g_(a,c.context,!1),O5(a,c.containerInfo)}function Ay(a,c,f,y,I){return F1(),D5(I),c.flags|=256,Dr(a,c,f,y),c.child}var n6={dehydrated:null,treeContext:null,retryLane:0};function i6(a){return{baseLanes:a,cachePool:null,transitions:null}}function gy(a,c,f){var y=c.pendingProps,I=d0.current,b=!1,N=(c.flags&128)!==0,Y;if((Y=N)||(Y=a!==null&&a.memoizedState===null?!1:(I&2)!==0),Y?(b=!0,c.flags&=-129):(a===null||a.memoizedState!==null)&&(I|=1),Zt(d0,I&1),a===null)return R5(c),a=c.memoizedState,a!==null&&(a=a.dehydrated,a!==null)?(c.mode&1?a.data==="$!"?c.lanes=8:c.lanes=1073741824:c.lanes=1,null):(N=y.children,a=y.fallback,b?(y=c.mode,b=c.child,N={mode:"hidden",children:N},!(y&1)&&b!==null?(b.childLanes=0,b.pendingProps=N):b=Xu(N,y,0,null),a=io(a,y,f,null),b.return=c,a.return=c,b.sibling=a,c.child=b,c.child.memoizedState=i6(f),c.memoizedState=n6,a):s6(c,N));if(I=a.memoizedState,I!==null&&(Y=I.dehydrated,Y!==null))return wF(a,c,N,y,Y,I,f);if(b){b=y.fallback,N=c.mode,I=a.child,Y=I.sibling;var K={mode:"hidden",children:y.children};return!(N&1)&&c.child!==I?(y=c.child,y.childLanes=0,y.pendingProps=K,c.deletions=null):(y=aa(I,K),y.subtreeFlags=I.subtreeFlags&14680064),Y!==null?b=aa(Y,b):(b=io(b,N,f,null),b.flags|=2),b.return=c,y.return=c,y.sibling=b,c.child=y,y=b,b=c.child,N=a.child.memoizedState,N=N===null?i6(f):{baseLanes:N.baseLanes|f,cachePool:null,transitions:N.transitions},b.memoizedState=N,b.childLanes=a.childLanes&~f,c.memoizedState=n6,y}return b=a.child,a=b.sibling,y=aa(b,{mode:"visible",children:y.children}),!(c.mode&1)&&(y.lanes=f),y.return=c,y.sibling=null,a!==null&&(f=c.deletions,f===null?(c.deletions=[a],c.flags|=16):f.push(a)),c.child=y,c.memoizedState=null,y}function s6(a,c){return c=Xu({mode:"visible",children:c},a.mode,0,null),c.return=a,a.child=c}function Uu(a,c,f,y){return y!==null&&D5(y),O1(c,a.child,null,f),a=s6(c,c.pendingProps.children),a.flags|=2,c.memoizedState=null,a}function wF(a,c,f,y,I,b,N){if(f)return c.flags&256?(c.flags&=-257,y=$5(Error(t(422))),Uu(a,c,N,y)):c.memoizedState!==null?(c.child=a.child,c.flags|=128,null):(b=y.fallback,I=c.mode,y=Xu({mode:"visible",children:y.children},I,0,null),b=io(b,I,N,null),b.flags|=2,y.return=c,b.return=c,y.sibling=b,c.child=y,c.mode&1&&O1(c,a.child,null,N),c.child.memoizedState=i6(N),c.memoizedState=n6,b);if(!(c.mode&1))return Uu(a,c,N,null);if(I.data==="$!"){if(y=I.nextSibling&&I.nextSibling.dataset,y)var Y=y.dgst;return y=Y,b=Error(t(419)),y=$5(b,y,void 0),Uu(a,c,N,y)}if(Y=(N&a.childLanes)!==0,Yr||Y){if(y=rr,y!==null){switch(N&-N){case 4:I=2;break;case 16:I=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:I=32;break;case 536870912:I=268435456;break;default:I=0}I=I&(y.suspendedLanes|N)?0:I,I!==0&&I!==b.retryLane&&(b.retryLane=I,rs(a,I),Zn(y,a,I,-1))}return E6(),y=$5(Error(t(421))),Uu(a,c,N,y)}return I.data==="$?"?(c.flags|=128,c.child=a.child,c=UF.bind(null,a),I._reactRetry=c,null):(a=b.treeContext,dn=Xs(I.nextSibling),hn=c,o0=!0,qn=null,a!==null&&(Bn[bn++]=es,Bn[bn++]=ts,Bn[bn++]=Xa,es=a.id,ts=a.overflow,Xa=c),c=s6(c,y.children),c.flags|=4096,c)}function my(a,c,f){a.lanes|=c;var y=a.alternate;y!==null&&(y.lanes|=c),U5(a.return,c,f)}function a6(a,c,f,y,I){var b=a.memoizedState;b===null?a.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:y,tail:f,tailMode:I}:(b.isBackwards=c,b.rendering=null,b.renderingStartTime=0,b.last=y,b.tail=f,b.tailMode=I)}function vy(a,c,f){var y=c.pendingProps,I=y.revealOrder,b=y.tail;if(Dr(a,c,y.children,f),y=d0.current,y&2)y=y&1|2,c.flags|=128;else{if(a!==null&&a.flags&128)e:for(a=c.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&my(a,f,c);else if(a.tag===19)my(a,f,c);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===c)break e;for(;a.sibling===null;){if(a.return===null||a.return===c)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}y&=1}if(Zt(d0,y),!(c.mode&1))c.memoizedState=null;else switch(I){case"forwards":for(f=c.child,I=null;f!==null;)a=f.alternate,a!==null&&Bu(a)===null&&(I=f),f=f.sibling;f=I,f===null?(I=c.child,c.child=null):(I=f.sibling,f.sibling=null),a6(c,!1,I,f,b);break;case"backwards":for(f=null,I=c.child,c.child=null;I!==null;){if(a=I.alternate,a!==null&&Bu(a)===null){c.child=I;break}a=I.sibling,I.sibling=f,f=I,I=a}a6(c,!0,f,null,b);break;case"together":a6(c,!1,null,null,void 0);break;default:c.memoizedState=null}return c.child}function ku(a,c){!(c.mode&1)&&a!==null&&(a.alternate=null,c.alternate=null,c.flags|=2)}function is(a,c,f){if(a!==null&&(c.dependencies=a.dependencies),eo|=c.lanes,!(f&c.childLanes))return null;if(a!==null&&c.child!==a.child)throw Error(t(153));if(c.child!==null){for(a=c.child,f=aa(a,a.pendingProps),c.child=f,f.return=c;a.sibling!==null;)a=a.sibling,f=f.sibling=aa(a,a.pendingProps),f.return=c;f.sibling=null}return c.child}function CF(a,c,f){switch(c.tag){case 3:py(c),F1();break;case 5:D_(c);break;case 1:Wr(c.type)&&_u(c);break;case 4:O5(c,c.stateNode.containerInfo);break;case 10:var y=c.type._context,I=c.memoizedProps.value;Zt(Iu,y._currentValue),y._currentValue=I;break;case 13:if(y=c.memoizedState,y!==null)return y.dehydrated!==null?(Zt(d0,d0.current&1),c.flags|=128,null):f&c.child.childLanes?gy(a,c,f):(Zt(d0,d0.current&1),a=is(a,c,f),a!==null?a.sibling:null);Zt(d0,d0.current&1);break;case 19:if(y=(f&c.childLanes)!==0,a.flags&128){if(y)return vy(a,c,f);c.flags|=128}if(I=c.memoizedState,I!==null&&(I.rendering=null,I.tail=null,I.lastEffect=null),Zt(d0,d0.current),y)break;return null;case 22:case 23:return c.lanes=0,hy(a,c,f)}return is(a,c,f)}var _y,o6,yy,Ey;_y=function(a,c){for(var f=c.child;f!==null;){if(f.tag===5||f.tag===6)a.appendChild(f.stateNode);else if(f.tag!==4&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===c)break;for(;f.sibling===null;){if(f.return===null||f.return===c)return;f=f.return}f.sibling.return=f.return,f=f.sibling}},o6=function(){},yy=function(a,c,f,y){var I=a.memoizedProps;if(I!==y){a=c.stateNode,Za(yi.current);var b=null;switch(f){case"input":I=X(a,I),y=X(a,y),b=[];break;case"select":I=W({},I,{value:void 0}),y=W({},y,{value:void 0}),b=[];break;case"textarea":I=k(a,I),y=k(a,y),b=[];break;default:typeof I.onClick!="function"&&typeof y.onClick=="function"&&(a.onclick=gu)}Pe(f,y);var N;f=null;for(fe in I)if(!y.hasOwnProperty(fe)&&I.hasOwnProperty(fe)&&I[fe]!=null)if(fe==="style"){var Y=I[fe];for(N in Y)Y.hasOwnProperty(N)&&(f||(f={}),f[N]="")}else fe!=="dangerouslySetInnerHTML"&&fe!=="children"&&fe!=="suppressContentEditableWarning"&&fe!=="suppressHydrationWarning"&&fe!=="autoFocus"&&(i.hasOwnProperty(fe)?b||(b=[]):(b=b||[]).push(fe,null));for(fe in y){var K=y[fe];if(Y=I!=null?I[fe]:void 0,y.hasOwnProperty(fe)&&K!==Y&&(K!=null||Y!=null))if(fe==="style")if(Y){for(N in Y)!Y.hasOwnProperty(N)||K&&K.hasOwnProperty(N)||(f||(f={}),f[N]="");for(N in K)K.hasOwnProperty(N)&&Y[N]!==K[N]&&(f||(f={}),f[N]=K[N])}else f||(b||(b=[]),b.push(fe,f)),f=K;else fe==="dangerouslySetInnerHTML"?(K=K?K.__html:void 0,Y=Y?Y.__html:void 0,K!=null&&Y!==K&&(b=b||[]).push(fe,K)):fe==="children"?typeof K!="string"&&typeof K!="number"||(b=b||[]).push(fe,""+K):fe!=="suppressContentEditableWarning"&&fe!=="suppressHydrationWarning"&&(i.hasOwnProperty(fe)?(K!=null&&fe==="onScroll"&&t0("scroll",a),b||Y===K||(b=[])):(b=b||[]).push(fe,K))}f&&(b=b||[]).push("style",f);var fe=b;(c.updateQueue=fe)&&(c.flags|=4)}},Ey=function(a,c,f,y){f!==y&&(c.flags|=4)};function z2(a,c){if(!o0)switch(a.tailMode){case"hidden":c=a.tail;for(var f=null;c!==null;)c.alternate!==null&&(f=c),c=c.sibling;f===null?a.tail=null:f.sibling=null;break;case"collapsed":f=a.tail;for(var y=null;f!==null;)f.alternate!==null&&(y=f),f=f.sibling;y===null?c||a.tail===null?a.tail=null:a.tail.sibling=null:y.sibling=null}}function xr(a){var c=a.alternate!==null&&a.alternate.child===a.child,f=0,y=0;if(c)for(var I=a.child;I!==null;)f|=I.lanes|I.childLanes,y|=I.subtreeFlags&14680064,y|=I.flags&14680064,I.return=a,I=I.sibling;else for(I=a.child;I!==null;)f|=I.lanes|I.childLanes,y|=I.subtreeFlags,y|=I.flags,I.return=a,I=I.sibling;return a.subtreeFlags|=y,a.childLanes=f,c}function IF(a,c,f){var y=c.pendingProps;switch(B5(c),c.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return xr(c),null;case 1:return Wr(c.type)&&vu(),xr(c),null;case 3:return y=c.stateNode,G1(),r0(jr),r0(yr),G5(),y.pendingContext&&(y.context=y.pendingContext,y.pendingContext=null),(a===null||a.child===null)&&(wu(c)?c.flags|=4:a===null||a.memoizedState.isDehydrated&&!(c.flags&256)||(c.flags|=1024,qn!==null&&(v6(qn),qn=null))),o6(a,c),xr(c),null;case 5:Q5(c);var I=Za(U2.current);if(f=c.type,a!==null&&c.stateNode!=null)yy(a,c,f,y,I),a.ref!==c.ref&&(c.flags|=512,c.flags|=2097152);else{if(!y){if(c.stateNode===null)throw Error(t(166));return xr(c),null}if(a=Za(yi.current),wu(c)){y=c.stateNode,f=c.type;var b=c.memoizedProps;switch(y[_i]=c,y[R2]=b,a=(c.mode&1)!==0,f){case"dialog":t0("cancel",y),t0("close",y);break;case"iframe":case"object":case"embed":t0("load",y);break;case"video":case"audio":for(I=0;I<T2.length;I++)t0(T2[I],y);break;case"source":t0("error",y);break;case"img":case"image":case"link":t0("error",y),t0("load",y);break;case"details":t0("toggle",y);break;case"input":h0(y,b),t0("invalid",y);break;case"select":y._wrapperState={wasMultiple:!!b.multiple},t0("invalid",y);break;case"textarea":se(y,b),t0("invalid",y)}Pe(f,b),I=null;for(var N in b)if(b.hasOwnProperty(N)){var Y=b[N];N==="children"?typeof Y=="string"?y.textContent!==Y&&(b.suppressHydrationWarning!==!0&&Au(y.textContent,Y,a),I=["children",Y]):typeof Y=="number"&&y.textContent!==""+Y&&(b.suppressHydrationWarning!==!0&&Au(y.textContent,Y,a),I=["children",""+Y]):i.hasOwnProperty(N)&&Y!=null&&N==="onScroll"&&t0("scroll",y)}switch(f){case"input":st(y),qe(y,b,!0);break;case"textarea":st(y),Ee(y);break;case"select":case"option":break;default:typeof b.onClick=="function"&&(y.onclick=gu)}y=I,c.updateQueue=y,y!==null&&(c.flags|=4)}else{N=I.nodeType===9?I:I.ownerDocument,a==="http://www.w3.org/1999/xhtml"&&(a=_e(f)),a==="http://www.w3.org/1999/xhtml"?f==="script"?(a=N.createElement("div"),a.innerHTML="<script><\/script>",a=a.removeChild(a.firstChild)):typeof y.is=="string"?a=N.createElement(f,{is:y.is}):(a=N.createElement(f),f==="select"&&(N=a,y.multiple?N.multiple=!0:y.size&&(N.size=y.size))):a=N.createElementNS(a,f),a[_i]=c,a[R2]=y,_y(a,c,!1,!1),c.stateNode=a;e:{switch(N=Fe(f,y),f){case"dialog":t0("cancel",a),t0("close",a),I=y;break;case"iframe":case"object":case"embed":t0("load",a),I=y;break;case"video":case"audio":for(I=0;I<T2.length;I++)t0(T2[I],a);I=y;break;case"source":t0("error",a),I=y;break;case"img":case"image":case"link":t0("error",a),t0("load",a),I=y;break;case"details":t0("toggle",a),I=y;break;case"input":h0(a,y),I=X(a,y),t0("invalid",a);break;case"option":I=y;break;case"select":a._wrapperState={wasMultiple:!!y.multiple},I=W({},y,{value:void 0}),t0("invalid",a);break;case"textarea":se(a,y),I=k(a,y),t0("invalid",a);break;default:I=y}Pe(f,I),Y=I;for(b in Y)if(Y.hasOwnProperty(b)){var K=Y[b];b==="style"?et(a,K):b==="dangerouslySetInnerHTML"?(K=K?K.__html:void 0,K!=null&&Ve(a,K)):b==="children"?typeof K=="string"?(f!=="textarea"||K!=="")&&gt(a,K):typeof K=="number"&&gt(a,""+K):b!=="suppressContentEditableWarning"&&b!=="suppressHydrationWarning"&&b!=="autoFocus"&&(i.hasOwnProperty(b)?K!=null&&b==="onScroll"&&t0("scroll",a):K!=null&&x(a,b,K,N))}switch(f){case"input":st(a),qe(a,y,!1);break;case"textarea":st(a),Ee(a);break;case"option":y.value!=null&&a.setAttribute("value",""+ge(y.value));break;case"select":a.multiple=!!y.multiple,b=y.value,b!=null?Q(a,!!y.multiple,b,!1):y.defaultValue!=null&&Q(a,!!y.multiple,y.defaultValue,!0);break;default:typeof I.onClick=="function"&&(a.onclick=gu)}switch(f){case"button":case"input":case"select":case"textarea":y=!!y.autoFocus;break e;case"img":y=!0;break e;default:y=!1}}y&&(c.flags|=4)}c.ref!==null&&(c.flags|=512,c.flags|=2097152)}return xr(c),null;case 6:if(a&&c.stateNode!=null)Ey(a,c,a.memoizedProps,y);else{if(typeof y!="string"&&c.stateNode===null)throw Error(t(166));if(f=Za(U2.current),Za(yi.current),wu(c)){if(y=c.stateNode,f=c.memoizedProps,y[_i]=c,(b=y.nodeValue!==f)&&(a=hn,a!==null))switch(a.tag){case 3:Au(y.nodeValue,f,(a.mode&1)!==0);break;case 5:a.memoizedProps.suppressHydrationWarning!==!0&&Au(y.nodeValue,f,(a.mode&1)!==0)}b&&(c.flags|=4)}else y=(f.nodeType===9?f:f.ownerDocument).createTextNode(y),y[_i]=c,c.stateNode=y}return xr(c),null;case 13:if(r0(d0),y=c.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(o0&&dn!==null&&c.mode&1&&!(c.flags&128))C_(),F1(),c.flags|=98560,b=!1;else if(b=wu(c),y!==null&&y.dehydrated!==null){if(a===null){if(!b)throw Error(t(318));if(b=c.memoizedState,b=b!==null?b.dehydrated:null,!b)throw Error(t(317));b[_i]=c}else F1(),!(c.flags&128)&&(c.memoizedState=null),c.flags|=4;xr(c),b=!1}else qn!==null&&(v6(qn),qn=null),b=!0;if(!b)return c.flags&65536?c:null}return c.flags&128?(c.lanes=f,c):(y=y!==null,y!==(a!==null&&a.memoizedState!==null)&&y&&(c.child.flags|=8192,c.mode&1&&(a===null||d0.current&1?H0===0&&(H0=3):E6())),c.updateQueue!==null&&(c.flags|=4),xr(c),null);case 4:return G1(),o6(a,c),a===null&&B2(c.stateNode.containerInfo),xr(c),null;case 10:return P5(c.type._context),xr(c),null;case 17:return Wr(c.type)&&vu(),xr(c),null;case 19:if(r0(d0),b=c.memoizedState,b===null)return xr(c),null;if(y=(c.flags&128)!==0,N=b.rendering,N===null)if(y)z2(b,!1);else{if(H0!==0||a!==null&&a.flags&128)for(a=c.child;a!==null;){if(N=Bu(a),N!==null){for(c.flags|=128,z2(b,!1),y=N.updateQueue,y!==null&&(c.updateQueue=y,c.flags|=4),c.subtreeFlags=0,y=f,f=c.child;f!==null;)b=f,a=y,b.flags&=14680066,N=b.alternate,N===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=N.childLanes,b.lanes=N.lanes,b.child=N.child,b.subtreeFlags=0,b.deletions=null,b.memoizedProps=N.memoizedProps,b.memoizedState=N.memoizedState,b.updateQueue=N.updateQueue,b.type=N.type,a=N.dependencies,b.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),f=f.sibling;return Zt(d0,d0.current&1|2),c.child}a=a.sibling}b.tail!==null&&le()>W1&&(c.flags|=128,y=!0,z2(b,!1),c.lanes=4194304)}else{if(!y)if(a=Bu(N),a!==null){if(c.flags|=128,y=!0,f=a.updateQueue,f!==null&&(c.updateQueue=f,c.flags|=4),z2(b,!0),b.tail===null&&b.tailMode==="hidden"&&!N.alternate&&!o0)return xr(c),null}else 2*le()-b.renderingStartTime>W1&&f!==1073741824&&(c.flags|=128,y=!0,z2(b,!1),c.lanes=4194304);b.isBackwards?(N.sibling=c.child,c.child=N):(f=b.last,f!==null?f.sibling=N:c.child=N,b.last=N)}return b.tail!==null?(c=b.tail,b.rendering=c,b.tail=c.sibling,b.renderingStartTime=le(),c.sibling=null,f=d0.current,Zt(d0,y?f&1|2:f&1),c):(xr(c),null);case 22:case 23:return y6(),y=c.memoizedState!==null,a!==null&&a.memoizedState!==null!==y&&(c.flags|=8192),y&&c.mode&1?fn&1073741824&&(xr(c),c.subtreeFlags&6&&(c.flags|=8192)):xr(c),null;case 24:return null;case 25:return null}throw Error(t(156,c.tag))}function MF(a,c){switch(B5(c),c.tag){case 1:return Wr(c.type)&&vu(),a=c.flags,a&65536?(c.flags=a&-65537|128,c):null;case 3:return G1(),r0(jr),r0(yr),G5(),a=c.flags,a&65536&&!(a&128)?(c.flags=a&-65537|128,c):null;case 5:return Q5(c),null;case 13:if(r0(d0),a=c.memoizedState,a!==null&&a.dehydrated!==null){if(c.alternate===null)throw Error(t(340));F1()}return a=c.flags,a&65536?(c.flags=a&-65537|128,c):null;case 19:return r0(d0),null;case 4:return G1(),null;case 10:return P5(c.type._context),null;case 22:case 23:return y6(),null;case 24:return null;default:return null}}var Fu=!1,wr=!1,SF=typeof WeakSet=="function"?WeakSet:Set,Xe=null;function V1(a,c){var f=a.ref;if(f!==null)if(typeof f=="function")try{f(null)}catch(y){v0(a,c,y)}else f.current=null}function l6(a,c,f){try{f()}catch(y){v0(a,c,y)}}var xy=!1;function TF(a,c){if(y5=iu,a=e_(),d5(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 I=y.anchorOffset,b=y.focusNode;y=y.focusOffset;try{f.nodeType,b.nodeType}catch{f=null;break e}var N=0,Y=-1,K=-1,fe=0,Ie=0,Me=a,xe=null;t:for(;;){for(var je;Me!==f||I!==0&&Me.nodeType!==3||(Y=N+I),Me!==b||y!==0&&Me.nodeType!==3||(K=N+y),Me.nodeType===3&&(N+=Me.nodeValue.length),(je=Me.firstChild)!==null;)xe=Me,Me=je;for(;;){if(Me===a)break t;if(xe===f&&++fe===I&&(Y=N),xe===b&&++Ie===y&&(K=N),(je=Me.nextSibling)!==null)break;Me=xe,xe=Me.parentNode}Me=je}f=Y===-1||K===-1?null:{start:Y,end:K}}else f=null}f=f||{start:0,end:0}}else f=null;for(E5={focusedElem:a,selectionRange:f},iu=!1,Xe=c;Xe!==null;)if(c=Xe,a=c.child,(c.subtreeFlags&1028)!==0&&a!==null)a.return=c,Xe=a;else for(;Xe!==null;){c=Xe;try{var Je=c.alternate;if(c.flags&1024)switch(c.tag){case 0:case 11:case 15:break;case 1:if(Je!==null){var Ke=Je.memoizedProps,x0=Je.memoizedState,ae=c.stateNode,ee=ae.getSnapshotBeforeUpdate(c.elementType===c.type?Ke:Xn(c.type,Ke),x0);ae.__reactInternalSnapshotBeforeUpdate=ee}break;case 3:var ce=c.stateNode.containerInfo;ce.nodeType===1?ce.textContent="":ce.nodeType===9&&ce.documentElement&&ce.removeChild(ce.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(t(163))}}catch(be){v0(c,c.return,be)}if(a=c.sibling,a!==null){a.return=c.return,Xe=a;break}Xe=c.return}return Je=xy,xy=!1,Je}function G2(a,c,f){var y=c.updateQueue;if(y=y!==null?y.lastEffect:null,y!==null){var I=y=y.next;do{if((I.tag&a)===a){var b=I.destroy;I.destroy=void 0,b!==void 0&&l6(c,f,b)}I=I.next}while(I!==y)}}function Ou(a,c){if(c=c.updateQueue,c=c!==null?c.lastEffect:null,c!==null){var f=c=c.next;do{if((f.tag&a)===a){var y=f.create;f.destroy=y()}f=f.next}while(f!==c)}}function c6(a){var c=a.ref;if(c!==null){var f=a.stateNode;switch(a.tag){case 5:a=f;break;default:a=f}typeof c=="function"?c(a):c.current=a}}function wy(a){var c=a.alternate;c!==null&&(a.alternate=null,wy(c)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(c=a.stateNode,c!==null&&(delete c[_i],delete c[R2],delete c[I5],delete c[uF],delete c[hF])),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 Cy(a){return a.tag===5||a.tag===3||a.tag===4}function Iy(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||Cy(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 u6(a,c,f){var y=a.tag;if(y===5||y===6)a=a.stateNode,c?f.nodeType===8?f.parentNode.insertBefore(a,c):f.insertBefore(a,c):(f.nodeType===8?(c=f.parentNode,c.insertBefore(a,f)):(c=f,c.appendChild(a)),f=f._reactRootContainer,f!=null||c.onclick!==null||(c.onclick=gu));else if(y!==4&&(a=a.child,a!==null))for(u6(a,c,f),a=a.sibling;a!==null;)u6(a,c,f),a=a.sibling}function h6(a,c,f){var y=a.tag;if(y===5||y===6)a=a.stateNode,c?f.insertBefore(a,c):f.appendChild(a);else if(y!==4&&(a=a.child,a!==null))for(h6(a,c,f),a=a.sibling;a!==null;)h6(a,c,f),a=a.sibling}var ur=null,Jn=!1;function ta(a,c,f){for(f=f.child;f!==null;)My(a,c,f),f=f.sibling}function My(a,c,f){if(rt&&typeof rt.onCommitFiberUnmount=="function")try{rt.onCommitFiberUnmount(ct,f)}catch{}switch(f.tag){case 5:wr||V1(f,c);case 6:var y=ur,I=Jn;ur=null,ta(a,c,f),ur=y,Jn=I,ur!==null&&(Jn?(a=ur,f=f.stateNode,a.nodeType===8?a.parentNode.removeChild(f):a.removeChild(f)):ur.removeChild(f.stateNode));break;case 18:ur!==null&&(Jn?(a=ur,f=f.stateNode,a.nodeType===8?C5(a.parentNode,f):a.nodeType===1&&C5(a,f),y2(a)):C5(ur,f.stateNode));break;case 4:y=ur,I=Jn,ur=f.stateNode.containerInfo,Jn=!0,ta(a,c,f),ur=y,Jn=I;break;case 0:case 11:case 14:case 15:if(!wr&&(y=f.updateQueue,y!==null&&(y=y.lastEffect,y!==null))){I=y=y.next;do{var b=I,N=b.destroy;b=b.tag,N!==void 0&&(b&2||b&4)&&l6(f,c,N),I=I.next}while(I!==y)}ta(a,c,f);break;case 1:if(!wr&&(V1(f,c),y=f.stateNode,typeof y.componentWillUnmount=="function"))try{y.props=f.memoizedProps,y.state=f.memoizedState,y.componentWillUnmount()}catch(Y){v0(f,c,Y)}ta(a,c,f);break;case 21:ta(a,c,f);break;case 22:f.mode&1?(wr=(y=wr)||f.memoizedState!==null,ta(a,c,f),wr=y):ta(a,c,f);break;default:ta(a,c,f)}}function Sy(a){var c=a.updateQueue;if(c!==null){a.updateQueue=null;var f=a.stateNode;f===null&&(f=a.stateNode=new SF),c.forEach(function(y){var I=kF.bind(null,a,y);f.has(y)||(f.add(y),y.then(I,I))})}}function Kn(a,c){var f=c.deletions;if(f!==null)for(var y=0;y<f.length;y++){var I=f[y];try{var b=a,N=c,Y=N;e:for(;Y!==null;){switch(Y.tag){case 5:ur=Y.stateNode,Jn=!1;break e;case 3:ur=Y.stateNode.containerInfo,Jn=!0;break e;case 4:ur=Y.stateNode.containerInfo,Jn=!0;break e}Y=Y.return}if(ur===null)throw Error(t(160));My(b,N,I),ur=null,Jn=!1;var K=I.alternate;K!==null&&(K.return=null),I.return=null}catch(fe){v0(I,c,fe)}}if(c.subtreeFlags&12854)for(c=c.child;c!==null;)Ty(c,a),c=c.sibling}function Ty(a,c){var f=a.alternate,y=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:if(Kn(c,a),xi(a),y&4){try{G2(3,a,a.return),Ou(3,a)}catch(Ke){v0(a,a.return,Ke)}try{G2(5,a,a.return)}catch(Ke){v0(a,a.return,Ke)}}break;case 1:Kn(c,a),xi(a),y&512&&f!==null&&V1(f,f.return);break;case 5:if(Kn(c,a),xi(a),y&512&&f!==null&&V1(f,f.return),a.flags&32){var I=a.stateNode;try{gt(I,"")}catch(Ke){v0(a,a.return,Ke)}}if(y&4&&(I=a.stateNode,I!=null)){var b=a.memoizedProps,N=f!==null?f.memoizedProps:b,Y=a.type,K=a.updateQueue;if(a.updateQueue=null,K!==null)try{Y==="input"&&b.type==="radio"&&b.name!=null&&pt(I,b),Fe(Y,N);var fe=Fe(Y,b);for(N=0;N<K.length;N+=2){var Ie=K[N],Me=K[N+1];Ie==="style"?et(I,Me):Ie==="dangerouslySetInnerHTML"?Ve(I,Me):Ie==="children"?gt(I,Me):x(I,Ie,Me,fe)}switch(Y){case"input":At(I,b);break;case"textarea":ye(I,b);break;case"select":var xe=I._wrapperState.wasMultiple;I._wrapperState.wasMultiple=!!b.multiple;var je=b.value;je!=null?Q(I,!!b.multiple,je,!1):xe!==!!b.multiple&&(b.defaultValue!=null?Q(I,!!b.multiple,b.defaultValue,!0):Q(I,!!b.multiple,b.multiple?[]:"",!1))}I[R2]=b}catch(Ke){v0(a,a.return,Ke)}}break;case 6:if(Kn(c,a),xi(a),y&4){if(a.stateNode===null)throw Error(t(162));I=a.stateNode,b=a.memoizedProps;try{I.nodeValue=b}catch(Ke){v0(a,a.return,Ke)}}break;case 3:if(Kn(c,a),xi(a),y&4&&f!==null&&f.memoizedState.isDehydrated)try{y2(c.containerInfo)}catch(Ke){v0(a,a.return,Ke)}break;case 4:Kn(c,a),xi(a);break;case 13:Kn(c,a),xi(a),I=a.child,I.flags&8192&&(b=I.memoizedState!==null,I.stateNode.isHidden=b,!b||I.alternate!==null&&I.alternate.memoizedState!==null||(p6=le())),y&4&&Sy(a);break;case 22:if(Ie=f!==null&&f.memoizedState!==null,a.mode&1?(wr=(fe=wr)||Ie,Kn(c,a),wr=fe):Kn(c,a),xi(a),y&8192){if(fe=a.memoizedState!==null,(a.stateNode.isHidden=fe)&&!Ie&&a.mode&1)for(Xe=a,Ie=a.child;Ie!==null;){for(Me=Xe=Ie;Xe!==null;){switch(xe=Xe,je=xe.child,xe.tag){case 0:case 11:case 14:case 15:G2(4,xe,xe.return);break;case 1:V1(xe,xe.return);var Je=xe.stateNode;if(typeof Je.componentWillUnmount=="function"){y=xe,f=xe.return;try{c=y,Je.props=c.memoizedProps,Je.state=c.memoizedState,Je.componentWillUnmount()}catch(Ke){v0(y,f,Ke)}}break;case 5:V1(xe,xe.return);break;case 22:if(xe.memoizedState!==null){Ry(Me);continue}}je!==null?(je.return=xe,Xe=je):Ry(Me)}Ie=Ie.sibling}e:for(Ie=null,Me=a;;){if(Me.tag===5){if(Ie===null){Ie=Me;try{I=Me.stateNode,fe?(b=I.style,typeof b.setProperty=="function"?b.setProperty("display","none","important"):b.display="none"):(Y=Me.stateNode,K=Me.memoizedProps.style,N=K!=null&&K.hasOwnProperty("display")?K.display:null,Y.style.display=nt("display",N))}catch(Ke){v0(a,a.return,Ke)}}}else if(Me.tag===6){if(Ie===null)try{Me.stateNode.nodeValue=fe?"":Me.memoizedProps}catch(Ke){v0(a,a.return,Ke)}}else if((Me.tag!==22&&Me.tag!==23||Me.memoizedState===null||Me===a)&&Me.child!==null){Me.child.return=Me,Me=Me.child;continue}if(Me===a)break e;for(;Me.sibling===null;){if(Me.return===null||Me.return===a)break e;Ie===Me&&(Ie=null),Me=Me.return}Ie===Me&&(Ie=null),Me.sibling.return=Me.return,Me=Me.sibling}}break;case 19:Kn(c,a),xi(a),y&4&&Sy(a);break;case 21:break;default:Kn(c,a),xi(a)}}function xi(a){var c=a.flags;if(c&2){try{e:{for(var f=a.return;f!==null;){if(Cy(f)){var y=f;break e}f=f.return}throw Error(t(160))}switch(y.tag){case 5:var I=y.stateNode;y.flags&32&&(gt(I,""),y.flags&=-33);var b=Iy(a);h6(a,b,I);break;case 3:case 4:var N=y.stateNode.containerInfo,Y=Iy(a);u6(a,Y,N);break;default:throw Error(t(161))}}catch(K){v0(a,a.return,K)}a.flags&=-3}c&4096&&(a.flags&=-4097)}function BF(a,c,f){Xe=a,By(a)}function By(a,c,f){for(var y=(a.mode&1)!==0;Xe!==null;){var I=Xe,b=I.child;if(I.tag===22&&y){var N=I.memoizedState!==null||Fu;if(!N){var Y=I.alternate,K=Y!==null&&Y.memoizedState!==null||wr;Y=Fu;var fe=wr;if(Fu=N,(wr=K)&&!fe)for(Xe=I;Xe!==null;)N=Xe,K=N.child,N.tag===22&&N.memoizedState!==null?Dy(I):K!==null?(K.return=N,Xe=K):Dy(I);for(;b!==null;)Xe=b,By(b),b=b.sibling;Xe=I,Fu=Y,wr=fe}by(a)}else I.subtreeFlags&8772&&b!==null?(b.return=I,Xe=b):by(a)}}function by(a){for(;Xe!==null;){var c=Xe;if(c.flags&8772){var f=c.alternate;try{if(c.flags&8772)switch(c.tag){case 0:case 11:case 15:wr||Ou(5,c);break;case 1:var y=c.stateNode;if(c.flags&4&&!wr)if(f===null)y.componentDidMount();else{var I=c.elementType===c.type?f.memoizedProps:Xn(c.type,f.memoizedProps);y.componentDidUpdate(I,f.memoizedState,y.__reactInternalSnapshotBeforeUpdate)}var b=c.updateQueue;b!==null&&R_(c,b,y);break;case 3:var N=c.updateQueue;if(N!==null){if(f=null,c.child!==null)switch(c.child.tag){case 5:f=c.child.stateNode;break;case 1:f=c.child.stateNode}R_(c,N,f)}break;case 5:var Y=c.stateNode;if(f===null&&c.flags&4){f=Y;var K=c.memoizedProps;switch(c.type){case"button":case"input":case"select":case"textarea":K.autoFocus&&f.focus();break;case"img":K.src&&(f.src=K.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(c.memoizedState===null){var fe=c.alternate;if(fe!==null){var Ie=fe.memoizedState;if(Ie!==null){var Me=Ie.dehydrated;Me!==null&&y2(Me)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(t(163))}wr||c.flags&512&&c6(c)}catch(xe){v0(c,c.return,xe)}}if(c===a){Xe=null;break}if(f=c.sibling,f!==null){f.return=c.return,Xe=f;break}Xe=c.return}}function Ry(a){for(;Xe!==null;){var c=Xe;if(c===a){Xe=null;break}var f=c.sibling;if(f!==null){f.return=c.return,Xe=f;break}Xe=c.return}}function Dy(a){for(;Xe!==null;){var c=Xe;try{switch(c.tag){case 0:case 11:case 15:var f=c.return;try{Ou(4,c)}catch(K){v0(c,f,K)}break;case 1:var y=c.stateNode;if(typeof y.componentDidMount=="function"){var I=c.return;try{y.componentDidMount()}catch(K){v0(c,I,K)}}var b=c.return;try{c6(c)}catch(K){v0(c,b,K)}break;case 5:var N=c.return;try{c6(c)}catch(K){v0(c,N,K)}}}catch(K){v0(c,c.return,K)}if(c===a){Xe=null;break}var Y=c.sibling;if(Y!==null){Y.return=c.return,Xe=Y;break}Xe=c.return}}var bF=Math.ceil,Qu=w.ReactCurrentDispatcher,d6=w.ReactCurrentOwner,Ln=w.ReactCurrentBatchConfig,Nt=0,rr=null,N0=null,hr=0,fn=0,j1=Js(0),H0=0,H2=null,eo=0,zu=0,f6=0,V2=null,qr=null,p6=0,W1=1/0,ss=null,Gu=!1,A6=null,ra=null,Hu=!1,na=null,Vu=0,j2=0,g6=null,ju=-1,Wu=0;function Lr(){return Nt&6?le():ju!==-1?ju:ju=le()}function ia(a){return a.mode&1?Nt&2&&hr!==0?hr&-hr:fF.transition!==null?(Wu===0&&(Wu=Xt()),Wu):(a=Lt,a!==0||(a=window.event,a=a===void 0?16:Nv(a.type)),a):1}function Zn(a,c,f,y){if(50<j2)throw j2=0,g6=null,Error(t(185));er(a,f,y),(!(Nt&2)||a!==rr)&&(a===rr&&(!(Nt&2)&&(zu|=f),H0===4&&sa(a,hr)),Xr(a,y),f===1&&Nt===0&&!(c.mode&1)&&(W1=le()+500,yu&&Zs()))}function Xr(a,c){var f=a.callbackNode;br(a,c);var y=vr(a,a===rr?hr:0);if(y===0)f!==null&&O(f),a.callbackNode=null,a.callbackPriority=0;else if(c=y&-y,a.callbackPriority!==c){if(f!=null&&O(f),c===1)a.tag===0?dF(Ny.bind(null,a)):__(Ny.bind(null,a)),lF(function(){!(Nt&6)&&Zs()}),f=null;else{switch(vi(y)){case 1:f=Ce;break;case 4:f=He;break;case 16:f=Qe;break;case 536870912:f=dt;break;default:f=Qe}f=Gy(f,Ly.bind(null,a))}a.callbackPriority=c,a.callbackNode=f}}function Ly(a,c){if(ju=-1,Wu=0,Nt&6)throw Error(t(327));var f=a.callbackNode;if(Y1()&&a.callbackNode!==f)return null;var y=vr(a,a===rr?hr:0);if(y===0)return null;if(y&30||y&a.expiredLanes||c)c=Yu(a,y);else{c=y;var I=Nt;Nt|=2;var b=Uy();(rr!==a||hr!==c)&&(ss=null,W1=le()+500,ro(a,c));do try{LF();break}catch(Y){Py(a,Y)}while(1);N5(),Qu.current=b,Nt=I,N0!==null?c=0:(rr=null,hr=0,c=H0)}if(c!==0){if(c===2&&(I=Ki(a),I!==0&&(y=I,c=m6(a,I))),c===1)throw f=H2,ro(a,0),sa(a,y),Xr(a,le()),f;if(c===6)sa(a,y);else{if(I=a.current.alternate,!(y&30)&&!RF(I)&&(c=Yu(a,y),c===2&&(b=Ki(a),b!==0&&(y=b,c=m6(a,b))),c===1))throw f=H2,ro(a,0),sa(a,y),Xr(a,le()),f;switch(a.finishedWork=I,a.finishedLanes=y,c){case 0:case 1:throw Error(t(345));case 2:no(a,qr,ss);break;case 3:if(sa(a,y),(y&130023424)===y&&(c=p6+500-le(),10<c)){if(vr(a,0)!==0)break;if(I=a.suspendedLanes,(I&y)!==y){Lr(),a.pingedLanes|=a.suspendedLanes&I;break}a.timeoutHandle=w5(no.bind(null,a,qr,ss),c);break}no(a,qr,ss);break;case 4:if(sa(a,y),(y&4194240)===y)break;for(c=a.eventTimes,I=-1;0<y;){var N=31-Et(y);b=1<<N,N=c[N],N>I&&(I=N),y&=~b}if(y=I,y=le()-y,y=(120>y?120:480>y?480:1080>y?1080:1920>y?1920:3e3>y?3e3:4320>y?4320:1960*bF(y/1960))-y,10<y){a.timeoutHandle=w5(no.bind(null,a,qr,ss),y);break}no(a,qr,ss);break;case 5:no(a,qr,ss);break;default:throw Error(t(329))}}}return Xr(a,le()),a.callbackNode===f?Ly.bind(null,a):null}function m6(a,c){var f=V2;return a.current.memoizedState.isDehydrated&&(ro(a,c).flags|=256),a=Yu(a,c),a!==2&&(c=qr,qr=f,c!==null&&v6(c)),a}function v6(a){qr===null?qr=a:qr.push.apply(qr,a)}function RF(a){for(var c=a;;){if(c.flags&16384){var f=c.updateQueue;if(f!==null&&(f=f.stores,f!==null))for(var y=0;y<f.length;y++){var I=f[y],b=I.getSnapshot;I=I.value;try{if(!Yn(b(),I))return!1}catch{return!1}}}if(f=c.child,c.subtreeFlags&16384&&f!==null)f.return=c,c=f;else{if(c===a)break;for(;c.sibling===null;){if(c.return===null||c.return===a)return!0;c=c.return}c.sibling.return=c.return,c=c.sibling}}return!0}function sa(a,c){for(c&=~f6,c&=~zu,a.suspendedLanes|=c,a.pingedLanes&=~c,a=a.expirationTimes;0<c;){var f=31-Et(c),y=1<<f;a[f]=-1,c&=~y}}function Ny(a){if(Nt&6)throw Error(t(327));Y1();var c=vr(a,0);if(!(c&1))return Xr(a,le()),null;var f=Yu(a,c);if(a.tag!==0&&f===2){var y=Ki(a);y!==0&&(c=y,f=m6(a,y))}if(f===1)throw f=H2,ro(a,0),sa(a,c),Xr(a,le()),f;if(f===6)throw Error(t(345));return a.finishedWork=a.current.alternate,a.finishedLanes=c,no(a,qr,ss),Xr(a,le()),null}function _6(a,c){var f=Nt;Nt|=1;try{return a(c)}finally{Nt=f,Nt===0&&(W1=le()+500,yu&&Zs())}}function to(a){na!==null&&na.tag===0&&!(Nt&6)&&Y1();var c=Nt;Nt|=1;var f=Ln.transition,y=Lt;try{if(Ln.transition=null,Lt=1,a)return a()}finally{Lt=y,Ln.transition=f,Nt=c,!(Nt&6)&&Zs()}}function y6(){fn=j1.current,r0(j1)}function ro(a,c){a.finishedWork=null,a.finishedLanes=0;var f=a.timeoutHandle;if(f!==-1&&(a.timeoutHandle=-1,oF(f)),N0!==null)for(f=N0.return;f!==null;){var y=f;switch(B5(y),y.tag){case 1:y=y.type.childContextTypes,y!=null&&vu();break;case 3:G1(),r0(jr),r0(yr),G5();break;case 5:Q5(y);break;case 4:G1();break;case 13:r0(d0);break;case 19:r0(d0);break;case 10:P5(y.type._context);break;case 22:case 23:y6()}f=f.return}if(rr=a,N0=a=aa(a.current,null),hr=fn=c,H0=0,H2=null,f6=zu=eo=0,qr=V2=null,Ka!==null){for(c=0;c<Ka.length;c++)if(f=Ka[c],y=f.interleaved,y!==null){f.interleaved=null;var I=y.next,b=f.pending;if(b!==null){var N=b.next;b.next=I,y.next=N}f.pending=y}Ka=null}return a}function Py(a,c){do{var f=N0;try{if(N5(),bu.current=Nu,Ru){for(var y=f0.memoizedState;y!==null;){var I=y.queue;I!==null&&(I.pending=null),y=y.next}Ru=!1}if($a=0,tr=G0=f0=null,k2=!1,F2=0,d6.current=null,f===null||f.return===null){H0=1,H2=c,N0=null;break}e:{var b=a,N=f.return,Y=f,K=c;if(c=hr,Y.flags|=32768,K!==null&&typeof K=="object"&&typeof K.then=="function"){var fe=K,Ie=Y,Me=Ie.tag;if(!(Ie.mode&1)&&(Me===0||Me===11||Me===15)){var xe=Ie.alternate;xe?(Ie.updateQueue=xe.updateQueue,Ie.memoizedState=xe.memoizedState,Ie.lanes=xe.lanes):(Ie.updateQueue=null,Ie.memoizedState=null)}var je=ay(N);if(je!==null){je.flags&=-257,oy(je,N,Y,b,c),je.mode&1&&sy(b,fe,c),c=je,K=fe;var Je=c.updateQueue;if(Je===null){var Ke=new Set;Ke.add(K),c.updateQueue=Ke}else Je.add(K);break e}else{if(!(c&1)){sy(b,fe,c),E6();break e}K=Error(t(426))}}else if(o0&&Y.mode&1){var x0=ay(N);if(x0!==null){!(x0.flags&65536)&&(x0.flags|=256),oy(x0,N,Y,b,c),D5(H1(K,Y));break e}}b=K=H1(K,Y),H0!==4&&(H0=2),V2===null?V2=[b]:V2.push(b),b=N;do{switch(b.tag){case 3:b.flags|=65536,c&=-c,b.lanes|=c;var ae=ny(b,K,c);b_(b,ae);break e;case 1:Y=K;var ee=b.type,ce=b.stateNode;if(!(b.flags&128)&&(typeof ee.getDerivedStateFromError=="function"||ce!==null&&typeof ce.componentDidCatch=="function"&&(ra===null||!ra.has(ce)))){b.flags|=65536,c&=-c,b.lanes|=c;var be=iy(b,Y,c);b_(b,be);break e}}b=b.return}while(b!==null)}Fy(f)}catch($e){c=$e,N0===f&&f!==null&&(N0=f=f.return);continue}break}while(1)}function Uy(){var a=Qu.current;return Qu.current=Nu,a===null?Nu:a}function E6(){(H0===0||H0===3||H0===2)&&(H0=4),rr===null||!(eo&268435455)&&!(zu&268435455)||sa(rr,hr)}function Yu(a,c){var f=Nt;Nt|=2;var y=Uy();(rr!==a||hr!==c)&&(ss=null,ro(a,c));do try{DF();break}catch(I){Py(a,I)}while(1);if(N5(),Nt=f,Qu.current=y,N0!==null)throw Error(t(261));return rr=null,hr=0,H0}function DF(){for(;N0!==null;)ky(N0)}function LF(){for(;N0!==null&&!ie();)ky(N0)}function ky(a){var c=zy(a.alternate,a,fn);a.memoizedProps=a.pendingProps,c===null?Fy(a):N0=c,d6.current=null}function Fy(a){var c=a;do{var f=c.alternate;if(a=c.return,c.flags&32768){if(f=MF(f,c),f!==null){f.flags&=32767,N0=f;return}if(a!==null)a.flags|=32768,a.subtreeFlags=0,a.deletions=null;else{H0=6,N0=null;return}}else if(f=IF(f,c,fn),f!==null){N0=f;return}if(c=c.sibling,c!==null){N0=c;return}N0=c=a}while(c!==null);H0===0&&(H0=5)}function no(a,c,f){var y=Lt,I=Ln.transition;try{Ln.transition=null,Lt=1,NF(a,c,f,y)}finally{Ln.transition=I,Lt=y}return null}function NF(a,c,f,y){do Y1();while(na!==null);if(Nt&6)throw Error(t(327));f=a.finishedWork;var I=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(z0(a,b),a===rr&&(N0=rr=null,hr=0),!(f.subtreeFlags&2064)&&!(f.flags&2064)||Hu||(Hu=!0,Gy(Qe,function(){return Y1(),null})),b=(f.flags&15990)!==0,f.subtreeFlags&15990||b){b=Ln.transition,Ln.transition=null;var N=Lt;Lt=1;var Y=Nt;Nt|=4,d6.current=null,TF(a,f),Ty(f,a),eF(E5),iu=!!y5,E5=y5=null,a.current=f,BF(f),de(),Nt=Y,Lt=N,Ln.transition=b}else a.current=f;if(Hu&&(Hu=!1,na=a,Vu=I),b=a.pendingLanes,b===0&&(ra=null),Dt(f.stateNode),Xr(a,le()),c!==null)for(y=a.onRecoverableError,f=0;f<c.length;f++)I=c[f],y(I.value,{componentStack:I.stack,digest:I.digest});if(Gu)throw Gu=!1,a=A6,A6=null,a;return Vu&1&&a.tag!==0&&Y1(),b=a.pendingLanes,b&1?a===g6?j2++:(j2=0,g6=a):j2=0,Zs(),null}function Y1(){if(na!==null){var a=vi(Vu),c=Ln.transition,f=Lt;try{if(Ln.transition=null,Lt=16>a?16:a,na===null)var y=!1;else{if(a=na,na=null,Vu=0,Nt&6)throw Error(t(331));var I=Nt;for(Nt|=4,Xe=a.current;Xe!==null;){var b=Xe,N=b.child;if(Xe.flags&16){var Y=b.deletions;if(Y!==null){for(var K=0;K<Y.length;K++){var fe=Y[K];for(Xe=fe;Xe!==null;){var Ie=Xe;switch(Ie.tag){case 0:case 11:case 15:G2(8,Ie,b)}var Me=Ie.child;if(Me!==null)Me.return=Ie,Xe=Me;else for(;Xe!==null;){Ie=Xe;var xe=Ie.sibling,je=Ie.return;if(wy(Ie),Ie===fe){Xe=null;break}if(xe!==null){xe.return=je,Xe=xe;break}Xe=je}}}var Je=b.alternate;if(Je!==null){var Ke=Je.child;if(Ke!==null){Je.child=null;do{var x0=Ke.sibling;Ke.sibling=null,Ke=x0}while(Ke!==null)}}Xe=b}}if(b.subtreeFlags&2064&&N!==null)N.return=b,Xe=N;else e:for(;Xe!==null;){if(b=Xe,b.flags&2048)switch(b.tag){case 0:case 11:case 15:G2(9,b,b.return)}var ae=b.sibling;if(ae!==null){ae.return=b.return,Xe=ae;break e}Xe=b.return}}var ee=a.current;for(Xe=ee;Xe!==null;){N=Xe;var ce=N.child;if(N.subtreeFlags&2064&&ce!==null)ce.return=N,Xe=ce;else e:for(N=ee;Xe!==null;){if(Y=Xe,Y.flags&2048)try{switch(Y.tag){case 0:case 11:case 15:Ou(9,Y)}}catch($e){v0(Y,Y.return,$e)}if(Y===N){Xe=null;break e}var be=Y.sibling;if(be!==null){be.return=Y.return,Xe=be;break e}Xe=Y.return}}if(Nt=I,Zs(),rt&&typeof rt.onPostCommitFiberRoot=="function")try{rt.onPostCommitFiberRoot(ct,a)}catch{}y=!0}return y}finally{Lt=f,Ln.transition=c}}return!1}function Oy(a,c,f){c=H1(f,c),c=ny(a,c,1),a=ea(a,c,1),c=Lr(),a!==null&&(er(a,1,c),Xr(a,c))}function v0(a,c,f){if(a.tag===3)Oy(a,a,f);else for(;c!==null;){if(c.tag===3){Oy(c,a,f);break}else if(c.tag===1){var y=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof y.componentDidCatch=="function"&&(ra===null||!ra.has(y))){a=H1(f,a),a=iy(c,a,1),c=ea(c,a,1),a=Lr(),c!==null&&(er(c,1,a),Xr(c,a));break}}c=c.return}}function PF(a,c,f){var y=a.pingCache;y!==null&&y.delete(c),c=Lr(),a.pingedLanes|=a.suspendedLanes&f,rr===a&&(hr&f)===f&&(H0===4||H0===3&&(hr&130023424)===hr&&500>le()-p6?ro(a,0):f6|=f),Xr(a,c)}function Qy(a,c){c===0&&(a.mode&1?(c=L0,L0<<=1,!(L0&130023424)&&(L0=4194304)):c=1);var f=Lr();a=rs(a,c),a!==null&&(er(a,c,f),Xr(a,f))}function UF(a){var c=a.memoizedState,f=0;c!==null&&(f=c.retryLane),Qy(a,f)}function kF(a,c){var f=0;switch(a.tag){case 13:var y=a.stateNode,I=a.memoizedState;I!==null&&(f=I.retryLane);break;case 19:y=a.stateNode;break;default:throw Error(t(314))}y!==null&&y.delete(c),Qy(a,f)}var zy;zy=function(a,c,f){if(a!==null)if(a.memoizedProps!==c.pendingProps||jr.current)Yr=!0;else{if(!(a.lanes&f)&&!(c.flags&128))return Yr=!1,CF(a,c,f);Yr=!!(a.flags&131072)}else Yr=!1,o0&&c.flags&1048576&&y_(c,xu,c.index);switch(c.lanes=0,c.tag){case 2:var y=c.type;ku(a,c),a=c.pendingProps;var I=P1(c,yr.current);z1(c,f),I=j5(null,c,y,a,I,f);var b=W5();return c.flags|=1,typeof I=="object"&&I!==null&&typeof I.render=="function"&&I.$$typeof===void 0?(c.tag=1,c.memoizedState=null,c.updateQueue=null,Wr(y)?(b=!0,_u(c)):b=!1,c.memoizedState=I.state!==null&&I.state!==void 0?I.state:null,F5(c),I.updater=Pu,c.stateNode=I,I._reactInternals=c,Z5(c,y,a,f),c=r6(null,c,y,!0,b,f)):(c.tag=0,o0&&b&&T5(c),Dr(null,c,I,f),c=c.child),c;case 16:y=c.elementType;e:{switch(ku(a,c),a=c.pendingProps,I=y._init,y=I(y._payload),c.type=y,I=c.tag=OF(y),a=Xn(y,a),I){case 0:c=t6(null,c,y,a,f);break e;case 1:c=fy(null,c,y,a,f);break e;case 11:c=ly(null,c,y,a,f);break e;case 14:c=cy(null,c,y,Xn(y.type,a),f);break e}throw Error(t(306,y,""))}return c;case 0:return y=c.type,I=c.pendingProps,I=c.elementType===y?I:Xn(y,I),t6(a,c,y,I,f);case 1:return y=c.type,I=c.pendingProps,I=c.elementType===y?I:Xn(y,I),fy(a,c,y,I,f);case 3:e:{if(py(c),a===null)throw Error(t(387));y=c.pendingProps,b=c.memoizedState,I=b.element,B_(a,c),Tu(c,y,null,f);var N=c.memoizedState;if(y=N.element,b.isDehydrated)if(b={element:y,isDehydrated:!1,cache:N.cache,pendingSuspenseBoundaries:N.pendingSuspenseBoundaries,transitions:N.transitions},c.updateQueue.baseState=b,c.memoizedState=b,c.flags&256){I=H1(Error(t(423)),c),c=Ay(a,c,y,f,I);break e}else if(y!==I){I=H1(Error(t(424)),c),c=Ay(a,c,y,f,I);break e}else for(dn=Xs(c.stateNode.containerInfo.firstChild),hn=c,o0=!0,qn=null,f=S_(c,null,y,f),c.child=f;f;)f.flags=f.flags&-3|4096,f=f.sibling;else{if(F1(),y===I){c=is(a,c,f);break e}Dr(a,c,y,f)}c=c.child}return c;case 5:return D_(c),a===null&&R5(c),y=c.type,I=c.pendingProps,b=a!==null?a.memoizedProps:null,N=I.children,x5(y,I)?N=null:b!==null&&x5(y,b)&&(c.flags|=32),dy(a,c),Dr(a,c,N,f),c.child;case 6:return a===null&&R5(c),null;case 13:return gy(a,c,f);case 4:return O5(c,c.stateNode.containerInfo),y=c.pendingProps,a===null?c.child=O1(c,null,y,f):Dr(a,c,y,f),c.child;case 11:return y=c.type,I=c.pendingProps,I=c.elementType===y?I:Xn(y,I),ly(a,c,y,I,f);case 7:return Dr(a,c,c.pendingProps,f),c.child;case 8:return Dr(a,c,c.pendingProps.children,f),c.child;case 12:return Dr(a,c,c.pendingProps.children,f),c.child;case 10:e:{if(y=c.type._context,I=c.pendingProps,b=c.memoizedProps,N=I.value,Zt(Iu,y._currentValue),y._currentValue=N,b!==null)if(Yn(b.value,N)){if(b.children===I.children&&!jr.current){c=is(a,c,f);break e}}else for(b=c.child,b!==null&&(b.return=c);b!==null;){var Y=b.dependencies;if(Y!==null){N=b.child;for(var K=Y.firstContext;K!==null;){if(K.context===y){if(b.tag===1){K=ns(-1,f&-f),K.tag=2;var fe=b.updateQueue;if(fe!==null){fe=fe.shared;var Ie=fe.pending;Ie===null?K.next=K:(K.next=Ie.next,Ie.next=K),fe.pending=K}}b.lanes|=f,K=b.alternate,K!==null&&(K.lanes|=f),U5(b.return,f,c),Y.lanes|=f;break}K=K.next}}else if(b.tag===10)N=b.type===c.type?null:b.child;else if(b.tag===18){if(N=b.return,N===null)throw Error(t(341));N.lanes|=f,Y=N.alternate,Y!==null&&(Y.lanes|=f),U5(N,f,c),N=b.sibling}else N=b.child;if(N!==null)N.return=b;else for(N=b;N!==null;){if(N===c){N=null;break}if(b=N.sibling,b!==null){b.return=N.return,N=b;break}N=N.return}b=N}Dr(a,c,I.children,f),c=c.child}return c;case 9:return I=c.type,y=c.pendingProps.children,z1(c,f),I=Rn(I),y=y(I),c.flags|=1,Dr(a,c,y,f),c.child;case 14:return y=c.type,I=Xn(y,c.pendingProps),I=Xn(y.type,I),cy(a,c,y,I,f);case 15:return uy(a,c,c.type,c.pendingProps,f);case 17:return y=c.type,I=c.pendingProps,I=c.elementType===y?I:Xn(y,I),ku(a,c),c.tag=1,Wr(y)?(a=!0,_u(c)):a=!1,z1(c,f),ty(c,y,I),Z5(c,y,I,f),r6(null,c,y,!0,a,f);case 19:return vy(a,c,f);case 22:return hy(a,c,f)}throw Error(t(156,c.tag))};function Gy(a,c){return tu(a,c)}function FF(a,c,f,y){this.tag=a,this.key=f,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=y,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Nn(a,c,f,y){return new FF(a,c,f,y)}function x6(a){return a=a.prototype,!(!a||!a.isReactComponent)}function OF(a){if(typeof a=="function")return x6(a)?1:0;if(a!=null){if(a=a.$$typeof,a===P)return 11;if(a===J)return 14}return 2}function aa(a,c){var f=a.alternate;return f===null?(f=Nn(a.tag,c,a.key,a.mode),f.elementType=a.elementType,f.type=a.type,f.stateNode=a.stateNode,f.alternate=a,a.alternate=f):(f.pendingProps=c,f.type=a.type,f.flags=0,f.subtreeFlags=0,f.deletions=null),f.flags=a.flags&14680064,f.childLanes=a.childLanes,f.lanes=a.lanes,f.child=a.child,f.memoizedProps=a.memoizedProps,f.memoizedState=a.memoizedState,f.updateQueue=a.updateQueue,c=a.dependencies,f.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},f.sibling=a.sibling,f.index=a.index,f.ref=a.ref,f}function qu(a,c,f,y,I,b){var N=2;if(y=a,typeof a=="function")x6(a)&&(N=1);else if(typeof a=="string")N=5;else e:switch(a){case S:return io(f.children,I,b,c);case D:N=8,I|=8;break;case R:return a=Nn(12,f,c,I|2),a.elementType=R,a.lanes=b,a;case F:return a=Nn(13,f,c,I),a.elementType=F,a.lanes=b,a;case z:return a=Nn(19,f,c,I),a.elementType=z,a.lanes=b,a;case ne:return Xu(f,I,b,c);default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case M:N=10;break e;case L:N=9;break e;case P:N=11;break e;case J:N=14;break e;case q:N=16,y=null;break e}throw Error(t(130,a==null?a:typeof a,""))}return c=Nn(N,f,c,I),c.elementType=a,c.type=y,c.lanes=b,c}function io(a,c,f,y){return a=Nn(7,a,y,c),a.lanes=f,a}function Xu(a,c,f,y){return a=Nn(22,a,y,c),a.elementType=ne,a.lanes=f,a.stateNode={isHidden:!1},a}function w6(a,c,f){return a=Nn(6,a,null,c),a.lanes=f,a}function C6(a,c,f){return c=Nn(4,a.children!==null?a.children:[],a.key,c),c.lanes=f,c.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},c}function QF(a,c,f,y,I){this.tag=c,this.containerInfo=a,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=_r(0),this.expirationTimes=_r(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=_r(0),this.identifierPrefix=y,this.onRecoverableError=I,this.mutableSourceEagerHydrationData=null}function I6(a,c,f,y,I,b,N,Y,K){return a=new QF(a,c,f,Y,K),c===1?(c=1,b===!0&&(c|=8)):c=0,b=Nn(3,null,null,c),a.current=b,b.stateNode=a,b.memoizedState={element:y,isDehydrated:f,cache:null,transitions:null,pendingSuspenseBoundaries:null},F5(b),a}function zF(a,c,f){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:T,key:y==null?null:""+y,children:a,containerInfo:c,implementation:f}}function Hy(a){if(!a)return Ks;a=a._reactInternals;e:{if(mi(a)!==a||a.tag!==1)throw Error(t(170));var c=a;do{switch(c.tag){case 3:c=c.stateNode.context;break e;case 1:if(Wr(c.type)){c=c.stateNode.__reactInternalMemoizedMergedChildContext;break e}}c=c.return}while(c!==null);throw Error(t(171))}if(a.tag===1){var f=a.type;if(Wr(f))return m_(a,f,c)}return c}function Vy(a,c,f,y,I,b,N,Y,K){return a=I6(f,y,!0,a,I,b,N,Y,K),a.context=Hy(null),f=a.current,y=Lr(),I=ia(f),b=ns(y,I),b.callback=c??null,ea(f,b,I),a.current.lanes=I,er(a,I,y),Xr(a,y),a}function Ju(a,c,f,y){var I=c.current,b=Lr(),N=ia(I);return f=Hy(f),c.context===null?c.context=f:c.pendingContext=f,c=ns(b,N),c.payload={element:a},y=y===void 0?null:y,y!==null&&(c.callback=y),a=ea(I,c,N),a!==null&&(Zn(a,I,N,b),Su(a,I,N)),N}function Ku(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 jy(a,c){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var f=a.retryLane;a.retryLane=f!==0&&f<c?f:c}}function M6(a,c){jy(a,c),(a=a.alternate)&&jy(a,c)}function GF(){return null}var Wy=typeof reportError=="function"?reportError:function(a){console.error(a)};function S6(a){this._internalRoot=a}Zu.prototype.render=S6.prototype.render=function(a){var c=this._internalRoot;if(c===null)throw Error(t(409));Ju(a,c,null,null)},Zu.prototype.unmount=S6.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var c=a.containerInfo;to(function(){Ju(null,a,null,null)}),c[Zi]=null}};function Zu(a){this._internalRoot=a}Zu.prototype.unstable_scheduleHydration=function(a){if(a){var c=Bv();a={blockedOn:null,target:a,priority:c};for(var f=0;f<Ws.length&&c!==0&&c<Ws[f].priority;f++);Ws.splice(f,0,a),f===0&&Dv(a)}};function T6(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function $u(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11&&(a.nodeType!==8||a.nodeValue!==" react-mount-point-unstable "))}function Yy(){}function HF(a,c,f,y,I){if(I){if(typeof y=="function"){var b=y;y=function(){var fe=Ku(N);b.call(fe)}}var N=Vy(c,y,a,0,null,!1,!1,"",Yy);return a._reactRootContainer=N,a[Zi]=N.current,B2(a.nodeType===8?a.parentNode:a),to(),N}for(;I=a.lastChild;)a.removeChild(I);if(typeof y=="function"){var Y=y;y=function(){var fe=Ku(K);Y.call(fe)}}var K=I6(a,0,!1,null,null,!1,!1,"",Yy);return a._reactRootContainer=K,a[Zi]=K.current,B2(a.nodeType===8?a.parentNode:a),to(function(){Ju(c,K,f,y)}),K}function e3(a,c,f,y,I){var b=f._reactRootContainer;if(b){var N=b;if(typeof I=="function"){var Y=I;I=function(){var K=Ku(N);Y.call(K)}}Ju(c,N,a,I)}else N=HF(f,c,a,I,y);return Ku(N)}Sv=function(a){switch(a.tag){case 3:var c=a.stateNode;if(c.current.memoizedState.isDehydrated){var f=cn(c.pendingLanes);f!==0&&(Rr(c,f|1),Xr(c,le()),!(Nt&6)&&(W1=le()+500,Zs()))}break;case 13:to(function(){var y=rs(a,1);if(y!==null){var I=Lr();Zn(y,a,1,I)}}),M6(a,1)}},$h=function(a){if(a.tag===13){var c=rs(a,134217728);if(c!==null){var f=Lr();Zn(c,a,134217728,f)}M6(a,134217728)}},Tv=function(a){if(a.tag===13){var c=ia(a),f=rs(a,c);if(f!==null){var y=Lr();Zn(f,a,c,y)}M6(a,c)}},Bv=function(){return Lt},bv=function(a,c){var f=Lt;try{return Lt=a,c()}finally{Lt=f}},Se=function(a,c,f){switch(c){case"input":if(At(a,f),c=f.name,f.type==="radio"&&c!=null){for(f=a;f.parentNode;)f=f.parentNode;for(f=f.querySelectorAll("input[name="+JSON.stringify(""+c)+'][type="radio"]'),c=0;c<f.length;c++){var y=f[c];if(y!==a&&y.form===a.form){var I=mu(y);if(!I)throw Error(t(90));ut(y),At(y,I)}}}break;case"textarea":ye(a,f);break;case"select":c=f.value,c!=null&&Q(a,!!f.multiple,c,!1)}},jt=_6,y0=to;var VF={usingClientEntryPoint:!1,Events:[D2,L1,mu,Be,it,_6]},W2={findFiberByHostInstance:Ya,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},jF={bundleType:W2.bundleType,version:W2.version,rendererPackageName:W2.rendererPackageName,rendererConfig:W2.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:w.ReactCurrentDispatcher,findHostInstanceByFiber:function(a){return a=$c(a),a===null?null:a.stateNode},findFiberByHostInstance:W2.findFiberByHostInstance||GF,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var t3=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!t3.isDisabled&&t3.supportsFiber)try{ct=t3.inject(jF),rt=t3}catch{}}return Vr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=VF,Vr.createPortal=function(a,c){var f=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!T6(c))throw Error(t(200));return zF(a,c,null,f)},Vr.createRoot=function(a,c){if(!T6(a))throw Error(t(299));var f=!1,y="",I=Wy;return c!=null&&(c.unstable_strictMode===!0&&(f=!0),c.identifierPrefix!==void 0&&(y=c.identifierPrefix),c.onRecoverableError!==void 0&&(I=c.onRecoverableError)),c=I6(a,1,!1,null,null,f,!1,y,I),a[Zi]=c.current,B2(a.nodeType===8?a.parentNode:a),new S6(c)},Vr.findDOMNode=function(a){if(a==null)return null;if(a.nodeType===1)return a;var c=a._reactInternals;if(c===void 0)throw typeof a.render=="function"?Error(t(188)):(a=Object.keys(a).join(","),Error(t(268,a)));return a=$c(c),a=a===null?null:a.stateNode,a},Vr.flushSync=function(a){return to(a)},Vr.hydrate=function(a,c,f){if(!$u(c))throw Error(t(200));return e3(null,a,c,!0,f)},Vr.hydrateRoot=function(a,c,f){if(!T6(a))throw Error(t(405));var y=f!=null&&f.hydratedSources||null,I=!1,b="",N=Wy;if(f!=null&&(f.unstable_strictMode===!0&&(I=!0),f.identifierPrefix!==void 0&&(b=f.identifierPrefix),f.onRecoverableError!==void 0&&(N=f.onRecoverableError)),c=Vy(c,null,a,1,f??null,I,!1,b,N),a[Zi]=c.current,B2(a),y)for(a=0;a<y.length;a++)f=y[a],I=f._getVersion,I=I(f._source),c.mutableSourceEagerHydrationData==null?c.mutableSourceEagerHydrationData=[f,I]:c.mutableSourceEagerHydrationData.push(f,I);return new Zu(c)},Vr.render=function(a,c,f){if(!$u(c))throw Error(t(200));return e3(null,a,c,!1,f)},Vr.unmountComponentAtNode=function(a){if(!$u(a))throw Error(t(40));return a._reactRootContainer?(to(function(){e3(null,null,a,!1,function(){a._reactRootContainer=null,a[Zi]=null})}),!0):!1},Vr.unstable_batchedUpdates=_6,Vr.unstable_renderSubtreeIntoContainer=function(a,c,f,y){if(!$u(f))throw Error(t(200));if(a==null||a._reactInternals===void 0)throw Error(t(38));return e3(a,c,f,!1,y)},Vr.version="18.3.1-next-f1338f8080-20240426",Vr}function dv(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(dv)}catch(r){console.error(r)}}dv(),lv.exports=XU();var JU=lv.exports,fv=JU;Wh.createRoot=fv.createRoot,Wh.hydrateRoot=fv.hydrateRoot;class KU{constructor({apiKey:e,apiService:t,events:n,appControlService:i}){wt(this,"targetElement");wt(this,"apiService");wt(this,"events");wt(this,"htmlTarget");wt(this,"appControlService");wt(this,"apiKey");this.apiKey=e,this.apiService=t,this.events=n,this.appControlService=i}mount(e,t,n){if(!this.targetElement){const s=t.customId??"dita-3dconfig-element",o=document.getElementById(s);if(!o)throw new Error(`Element not found with id => '${s}' `);this.htmlTarget=o,this.htmlTarget.style.height="100%",this.htmlTarget.style.width="100%",this.targetElement=Wh.createRoot(document.getElementById(s))}const i=q2.createElement(WU,{apiKey:this.apiKey,apiService:this.apiService,events:this.events,sku:e,viewerOnly:t.viewerOnly,lensSku:n??void 0,appControlService:this.appControlService});this.targetElement.render(i)}unmount(){this.targetElement&&(this.appControlService.reset(),this.targetElement.unmount(),this.targetElement=void 0,this.htmlTarget&&(this.htmlTarget.style.height="0px",this.htmlTarget.style.width="auto"))}}var Xh={exports:{}},C1=typeof Reflect=="object"?Reflect:null,pv=C1&&typeof C1.apply=="function"?C1.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)},Yc;C1&&typeof C1.ownKeys=="function"?Yc=C1.ownKeys:Object.getOwnPropertySymbols?Yc=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Yc=function(e){return Object.getOwnPropertyNames(e)};function ZU(r){console&&console.warn&&console.warn(r)}var Av=Number.isNaN||function(e){return e!==e};function Vt(){Vt.init.call(this)}Xh.exports=Vt,Xh.exports.once=rk,Vt.EventEmitter=Vt,Vt.prototype._events=void 0,Vt.prototype._eventsCount=0,Vt.prototype._maxListeners=void 0;var gv=10;function qc(r){if(typeof r!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r)}Object.defineProperty(Vt,"defaultMaxListeners",{enumerable:!0,get:function(){return gv},set:function(r){if(typeof r!="number"||r<0||Av(r))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+r+".");gv=r}}),Vt.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},Vt.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||Av(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 mv(r){return r._maxListeners===void 0?Vt.defaultMaxListeners:r._maxListeners}Vt.prototype.getMaxListeners=function(){return mv(this)},Vt.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var i=e==="error",s=this._events;if(s!==void 0)i=i&&s.error===void 0;else if(!i)return!1;if(i){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var l=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw l.context=o,l}var h=s[e];if(h===void 0)return!1;if(typeof h=="function")pv(h,this,t);else for(var u=h.length,d=xv(h,u),n=0;n<u;++n)pv(d[n],this,t);return!0};function vv(r,e,t,n){var i,s,o;if(qc(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=mv(r),i>0&&o.length>i&&!o.warned){o.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=r,l.type=e,l.count=o.length,ZU(l)}return r}Vt.prototype.addListener=function(e,t){return vv(this,e,t,!1)},Vt.prototype.on=Vt.prototype.addListener,Vt.prototype.prependListener=function(e,t){return vv(this,e,t,!0)};function $U(){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 _v(r,e,t){var n={fired:!1,wrapFn:void 0,target:r,type:e,listener:t},i=$U.bind(n);return i.listener=t,n.wrapFn=i,i}Vt.prototype.once=function(e,t){return qc(t),this.on(e,_v(this,e,t)),this},Vt.prototype.prependOnceListener=function(e,t){return qc(t),this.prependListener(e,_v(this,e,t)),this},Vt.prototype.removeListener=function(e,t){var n,i,s,o,l;if(qc(t),i=this._events,i===void 0)return this;if(n=i[e],n===void 0)return this;if(n===t||n.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,n.listener||t));else if(typeof n!="function"){for(s=-1,o=n.length-1;o>=0;o--)if(n[o]===t||n[o].listener===t){l=n[o].listener,s=o;break}if(s<0)return this;s===0?n.shift():ek(n,s),n.length===1&&(i[e]=n[0]),i.removeListener!==void 0&&this.emit("removeListener",e,l||t)}return this},Vt.prototype.off=Vt.prototype.removeListener,Vt.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 yv(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?tk(i):xv(i,i.length)}Vt.prototype.listeners=function(e){return yv(this,e,!0)},Vt.prototype.rawListeners=function(e){return yv(this,e,!1)},Vt.listenerCount=function(r,e){return typeof r.listenerCount=="function"?r.listenerCount(e):Ev.call(r,e)},Vt.prototype.listenerCount=Ev;function Ev(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}Vt.prototype.eventNames=function(){return this._eventsCount>0?Yc(this._events):[]};function xv(r,e){for(var t=new Array(e),n=0;n<e;++n)t[n]=r[n];return t}function ek(r,e){for(;e+1<r.length;e++)r[e]=r[e+1];r.pop()}function tk(r){for(var e=new Array(r.length),t=0;t<e.length;++t)e[t]=r[t].listener||r[t];return e}function rk(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))}wv(r,e,s,{once:!0}),e!=="error"&&nk(r,i,{once:!0})})}function nk(r,e,t){typeof r.on=="function"&&wv(r,"error",e,t)}function wv(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 ik=Xh.exports;const A2=class A2 extends ik.EventEmitter{emitEvent(e,t){Object.keys(A2.EVENTS).includes(e)&&this.emit(A2.EVENTS[e],t)}};wt(A2,"EVENTS",{onAddToCart:"add-to-cart"});let Jh=A2;const sk={getCartUrl:((Iv=window.Shopify)==null?void 0:Iv.routes.root)+"cart.js",addToCartUrl:((Mv=window.Shopify)==null?void 0:Mv.routes.root)+"cart/add.js"},Cv=Object.freeze(sk);class ak{constructor(e){wt(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()}}class ok{constructor(){wt(this,"changeRxConfigurationHandler",null)}registerChangeRxConfiguration(e){this.changeRxConfigurationHandler=e}async changeRxConfiguration(e,t){var n;await((n=this.changeRxConfigurationHandler)==null?void 0:n.call(this,e,t))}reset(){this.changeRxConfigurationHandler=null}}const{log:lk,error:ck}=console,uk=(...r)=>{ck("❌ 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&",dk={addToCartUrl:Cv.addToCartUrl,getCartUrl:Cv.getCartUrl};let Kh=!1;const fk={config:Pn,log:lk,logErr:uk,metaData:{appVersion:aE,previewUrlPrams:hk,targetClassName:"sprie-embed-element"}};class pk{constructor(){wt(this,"sdkService");wt(this,"apiService");wt(this,"uiService");wt(this,"events");wt(this,"appControlService");this.events=new Jh,this.apiService=new lE(new sE,new ak(dk)),this.appControlService=new ok,this.sdkService=new cE(fk),this.uiService=new KU({apiKey:this.sdkService.apiKey,apiService:this.apiService,events:this.events,appControlService:this.appControlService}),this.sdkService.Init().then(e=>{Kh=e})}isReadyToLoad(){return Kh}load(e,t){Kh?this.loadOnAuth(e,t):this.waitForAllReady(this.isReadyToLoad,()=>this.loadOnAuth(e,t),e,t)}loadOnAuth(e,t){this.uiService.unmount(),this.uiService.mount(e,{viewerOnly:!1,customId:t})}loadViewerOnly(e,t,n){this.uiService.unmount(),this.uiService.mount(e,{viewerOnly:!0,customId:t},n)}async changeRxConfiguration(e,t){await this.appControlService.changeRxConfiguration(e,t)}unload(){this.uiService.unmount()}waitForAllReady(e,t,n,i){e()?t(n,i):setTimeout(()=>{this.waitForAllReady(e,t,n,i)},200)}}window.ditaConfigurator=new pk})();