1import{ck as Dm,cl as Ts,d as Mt,a as ae,f as ht,k as Qe,t as _n,am as ev,i as Ce,w as Be,s as On,j as xt,b as Ar,g as Ot,n as ws,e as re,cm as Om,r as mt,m as Ze,c as Xe,F as en,l as Hn,p as Wt,ar as kh,b4 as Um,Q as Fm,A as tv,z as jt,u as nv,o as Di,y as Ji,x as ma,au as Kn,D as iv,cn as rv,b3 as ga,co as sv,a4 as av,h as Bm,cp as ov,aG as As,aD as km,aZ as Vh,a_ as lv,at as Qt,a0 as xs,cq as to,ap as yt,q as cv,b1 as uv,cr as hv,aR as mf,aF as gf,aL as dv,cs as fv,W as pv}from"./kbcImT7M.js";import{g as zn,a as Vm,b as zm,k as Cs,m as At,_ as Ia,c as Pa,i as Nr,d as Cr,h as ys,n as bs,K as _f,e as Bs,f as ks,u as Vs,N as mv,r as Hm,Q as Gm,j as Wm,q as vf,p as gv}from"./jKyE1myA.js";import{_ as ml}from"./GhP7qsbw.js";import{_ as _v,u as vv}from"./B7p1VhNU.js";import{_ as zh}from"./BVmj9Ju9.js";import{k as xv}from"./DrRBuq8P.js";import{u as yv}from"./DfHjIPqB.js";var bv=Object.create,Xm=Object.defineProperty,Sv=Object.getOwnPropertyDescriptor,Mv=Object.getOwnPropertyNames,Ev=Object.getPrototypeOf,Tv=Object.prototype.hasOwnProperty,wv=(i,e)=>()=>(e||i((e={exports:{}}).exports,e),e.exports),Av=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(var r=Mv(e),s=0,a=r.length,o;s<a;s++)o=r[s],!Tv.call(i,o)&&o!==t&&Xm(i,o,{get:(l=>e[l]).bind(null,o),enumerable:!(n=Sv(e,o))||n.enumerable});return i},Cv=(i,e,t)=>(t=i!=null?bv(Ev(i)):{},Av(Xm(t,"default",{value:i,enumerable:!0}),i));const qm=typeof navigator<"u",Le=typeof window<"u"?window:typeof globalThis<"u"?globalThis:typeof global<"u"?global:{};typeof Le.chrome<"u"&&Le.chrome.devtools;qm&&(Le.self,Le.top);typeof navigator<"u"&&navigator.userAgent?.toLowerCase().includes("electron");var Rv=Cv(wv(((i,e)=>{e.exports=n;function t(s){return s instanceof Buffer?Buffer.from(s):new s.constructor(s.buffer.slice(),s.byteOffset,s.length)}function n(s){if(s=s||{},s.circles)return r(s);const a=new Map;if(a.set(Date,h=>new Date(h)),a.set(Map,(h,d)=>new Map(l(Array.from(h),d))),a.set(Set,(h,d)=>new Set(l(Array.from(h),d))),s.constructorHandlers)for(const h of s.constructorHandlers)a.set(h[0],h[1]);let o=null;return s.proto?u:c;function l(h,d){const f=Object.keys(h),p=new Array(f.length);for(let _=0;_<f.length;_++){const g=f[_],m=h[g];typeof m!="object"||m===null?p[g]=m:m.constructor!==Object&&(o=a.get(m.constructor))?p[g]=o(m,d):ArrayBuffer.isView(m)?p[g]=t(m):p[g]=d(m)}return p}function c(h){if(typeof h!="object"||h===null)return h;if(Array.isArray(h))return l(h,c);if(h.constructor!==Object&&(o=a.get(h.constructor)))return o(h,c);const d={};for(const f in h){if(Object.hasOwnProperty.call(h,f)===!1)continue;const p=h[f];typeof p!="object"||p===null?d[f]=p:p.constructor!==Object&&(o=a.get(p.constructor))?d[f]=o(p,c):ArrayBuffer.isView(p)?d[f]=t(p):d[f]=c(p)}return d}function u(h){if(typeof h!="object"||h===null)return h;if(Array.isArray(h))return l(h,u);if(h.constructor!==Object&&(o=a.get(h.constructor)))return o(h,u);const d={};for(const f in h){const p=h[f];typeof p!="object"||p===null?d[f]=p:p.constructor!==Object&&(o=a.get(p.constructor))?d[f]=o(p,u):ArrayBuffer.isView(p)?d[f]=t(p):d[f]=u(p)}return d}}function r(s){const a=[],o=[],l=new Map;if(l.set(Date,f=>new Date(f)),l.set(Map,(f,p)=>new Map(u(Array.from(f),p))),l.set(Set,(f,p)=>new Set(u(Array.from(f),p))),s.constructorHandlers)for(const f of s.constructorHandlers)l.set(f[0],f[1]);let c=null;return s.proto?d:h;function u(f,p){const _=Object.keys(f),g=new Array(_.length);for(let m=0;m<_.length;m++){const v=_[m],b=f[v];if(typeof b!="object"||b===null)g[v]=b;else if(b.constructor!==Object&&(c=l.get(b.constructor)))g[v]=c(b,p);else if(ArrayBuffer.isView(b))g[v]=t(b);else{const y=a.indexOf(b);y!==-1?g[v]=o[y]:g[v]=p(b)}}return g}function h(f){if(typeof f!="object"||f===null)return f;if(Array.isArray(f))return u(f,h);if(f.constructor!==Object&&(c=l.get(f.constructor)))return c(f,h);const p={};a.push(f),o.push(p);for(const _ in f){if(Object.hasOwnProperty.call(f,_)===!1)continue;const g=f[_];if(typeof g!="object"||g===null)p[_]=g;else if(g.constructor!==Object&&(c=l.get(g.constructor)))p[_]=c(g,h);else if(ArrayBuffer.isView(g))p[_]=t(g);else{const m=a.indexOf(g);m!==-1?p[_]=o[m]:p[_]=h(g)}}return a.pop(),o.pop(),p}function d(f){if(typeof f!="object"||f===null)return f;if(Array.isArray(f))return u(f,d);if(f.constructor!==Object&&(c=l.get(f.constructor)))return c(f,d);const p={};a.push(f),o.push(p);for(const _ in f){const g=f[_];if(typeof g!="object"||g===null)p[_]=g;else if(g.constructor!==Object&&(c=l.get(g.constructor)))p[_]=c(g,d);else if(ArrayBuffer.isView(g))p[_]=t(g);else{const m=a.indexOf(g);m!==-1?p[_]=o[m]:p[_]=d(g)}}return a.pop(),o.pop(),p}}}))());const Iv=/(?:^|[-_/])(\w)/g;function Pv(i,e){return e?e.toUpperCase():""}function Lv(i){return i&&`${i}`.replace(Iv,Pv)}function Nv(i,e){let t=i.replace(/^[a-z]:/i,"").replace(/\\/g,"/");t.endsWith(`index${e}`)&&(t=t.replace(`/index${e}`,e));const n=t.lastIndexOf("/"),r=t.substring(n+1);{const s=r.lastIndexOf(e);return r.substring(0,s)}}const xf=(0,Rv.default)({circles:!0});var Dv=Object.create,$m=Object.defineProperty,Ov=Object.getOwnPropertyDescriptor,Uv=Object.getOwnPropertyNames,Fv=Object.getPrototypeOf,Bv=Object.prototype.hasOwnProperty,Ym=(i,e)=>()=>(e||i((e={exports:{}}).exports,e),e.exports),kv=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(var r=Uv(e),s=0,a=r.length,o;s<a;s++)o=r[s],!Bv.call(i,o)&&o!==t&&$m(i,o,{get:(l=>e[l]).bind(null,o),enumerable:!(n=Ov(e,o))||n.enumerable});return i},Vv=(i,e,t)=>(t=i!=null?Dv(Fv(i)):{},kv($m(t,"default",{value:i,enumerable:!0}),i));function zv(i){if(typeof i=="function")return i.displayName||i.name||i.__VUE_DEVTOOLS_COMPONENT_GUSSED_NAME__||"";const e=i.name||i._componentTag||i.__VUE_DEVTOOLS_COMPONENT_GUSSED_NAME__||i.__name;
1return e==="index"&&i.__file?.endsWith("index.vue")?"":e}function Hv(i){const e=i.__file;if(e)return Lv(Nv(e,".vue"))}function yf(i,e){return i.type.__VUE_DEVTOOLS_COMPONENT_GUSSED_NAME__=e,e}function Hh(i){if(i.__VUE_DEVTOOLS_NEXT_APP_RECORD__)return i.__VUE_DEVTOOLS_NEXT_APP_RECORD__;if(i.root)return i.appContext.app.__VUE_DEVTOOLS_NEXT_APP_RECORD__}function Zm(i){const e=i.subTree?.type,t=Hh(i);return t?t?.types?.Fragment===e:!1}function vc(i){const e=zv(i?.type||{});if(e)return e;if(i?.root===i)return"Root";for(const n in i.parent?.type?.components)if(i.parent.type.components[n]===i?.type)return yf(i,n);for(const n in i.appContext?.components)if(i.appContext.components[n]===i?.type)return yf(i,n);const t=Hv(i?.type||{});return t||"Anonymous Component"}function Gv(i){return`${i?.appContext?.app?.__VUE_DEVTOOLS_NEXT_APP_RECORD_ID__??0}:${i===i?.root?"root":i.uid}`}function ih(i,e){return e=e||`${i.id}:root`,i.instanceMap.get(e)||i.instanceMap.get(":root")}function Wv(){const i={top:0,bottom:0,left:0,right:0,get width(){return i.right-i.left},get height(){return i.bottom-i.top}};return i}let go;function Xv(i){return go||(go=document.createRange()),go.selectNode(i),go.getBoundingClientRect()}function qv(i){const e=Wv();if(!i.children)return e;for(let t=0,n=i.children.length;t<n;t++){const r=i.children[t];let s;if(r.component)s=Dr(r.component);else if(r.el){const a=r.el;a.nodeType===1||a.getBoundingClientRect?s=a.getBoundingClientRect():a.nodeType===3&&a.data.trim()&&(s=Xv(a))}s&&$v(e,s)}return e}function $v(i,e){return(!i.top||e.top<i.top)&&(i.top=e.top),(!i.bottom||e.bottom>i.bottom)&&(i.bottom=e.bottom),(!i.left||e.left<i.left)&&(i.left
1=e.left),(!i.right||e.right>i.right)&&(i.right=e.right),i}const bf={top:0,left:0,right:0,bottom:0,width:0,height:0};function Dr(i){const e=i.subTree.el;return typeof window>"u"?bf:Zm(i)?qv(i.subTree):e?.nodeType===1?e?.getBoundingClientRect():i.subTree.component?Dr(i.subTree.component):bf}function Gh(i){return Zm(i)?Yv(i.subTree):i.subTree?[i.subTree.el]:[]}function Yv(i){if(!i.children)return[];const e=[];return i.children.forEach(t=>{t.component?e.push(...Gh(t.component)):t?.el&&e.push(t.el)}),e}const Km="__vue-devtools-component-inspector__",Jm="__vue-devtools-component-inspector__card__",jm="__vue-devtools-component-inspector__name__",Qm="__vue-devtools-component-inspector__indicator__",eg={display:"block",zIndex:2147483640,position:"fixed",backgroundColor:"#42b88325",border:"1px solid #42b88350",borderRadius:"5px",transition:"all 0.1s ease-in",pointerEvents:"none"},Zv={fontFamily:"Arial, Helvetica, sans-serif",padding:"5px 8px",borderRadius:"4px",textAlign:"left",position:"absolute",left:0,color:"#e9e9e9",fontSize:"14px",fontWeight:600,lineHeight:"24px",backgroundColor:"#42b883",boxShadow:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1)"},Kv={display:"inline-block",fontWeight:400,fontStyle:"normal",fontSize:"12px",opacity:.7};function zs(){return document.getElementById(Km)}function Jv(){return document.getElementById(Jm)}function jv(){return document.getElementById(Qm)}function Qv(){return document.getElementById(jm)}function Wh(i){return{left:`${Math.round(i.left*100)/100}px`,top:`${Math.round(i.top*100)/100}px`,width:`${Math.round(i.width*100)/100}px`,height:`${Math.round(i.height*100)/100}px`}}function Xh(i){const e=document.createElement("div");e.id=i.elementId??Km,Object.assign(e.style,{...eg,...Wh(i.bounds),...i.style});const t=document.createElement("span");t.id=Jm,Object.assign(t.style,{...Zv,top:i.bounds.top<35?0:"-35px"});const n=document.createElement("span");n.id=jm,n.innerHTML=`<${i.name}> `;const r=document.createElement("i");return r.id=Qm,r.innerHTML=`${Math.round(i.bounds.width*100)/100} x ${Math.round(i.bounds.height*100)/100}`,Object.assign(r.style,Kv),t.appendChild(n),t.appendChild(r),e.appendChild(t),document.body.appendChild(e),e}function qh(i){const e=zs(),t=Jv(),n=Qv(),r=jv();e&&(Object.assign(e.style,{...eg,...Wh(i.bounds)}),Object.assign(t.style,{top:i.bounds.top<35?0:"-35px"}),n.innerHTML=`<${i.name}> `,r.innerHTML=`${Math.round(i.bounds.width*100)/100} x ${Math.round(i.bounds.height*100)/100}`)}function ex(i){const e=Dr(i);if(!e.width&&!e.height)return;const t=vc(i);zs()?qh({bounds:e,name:t}):Xh({bounds:e,name:t})}function tg(){const i=zs();i&&(i.style.display="none")}let rh=null;function sh(i){const e=i.target;if(e){const t=e.__vueParentComponent;if(t&&(rh=t,t.vnode.el)){const n=Dr(t),r=vc(t);zs()?qh({bounds:n,name:r}):Xh({bounds:n,name:r})}}}function tx(i,e){i.preventDefault(),i.stopPropagation(),rh&&e(Gv(rh))}let gl=null;function nx(){tg(),window.removeEventListener("mouseover",sh),window.removeEventListener("click",gl,!0),gl=null}function ix(){return window.addEventListener("mouseover",sh),new Promise(i=>{function e(t){t.preventDefault(),t.stopPropagation(),tx(t,n=>{window.removeEventListener("click",e,!0),gl=null,window.removeEventListener("mouseover",sh);const r=zs();r&&(r.style.display="none"),i(JSON.stringify({id:n}))})}gl=e,window.addEventListener("click",e,!0)})}function rx(i){const e=ih(mn.value,i.id);if(e){const[t]=Gh(e);if(typeof t.scrollIntoView=="function")t.scrollIntoView({behavior:"smooth"});else{const n=Dr(e),r=document.createElement("div"),s={...Wh(n),position:"absolute"};Object.assign(r.style,s),document.body.appendChild(r),r.scrollIntoView({behavior:"smooth"}),setTimeout(()=>{document.body.removeChild(r)},2e3)}setTimeout(()=>{const n=Dr(e);if(n.width||n.height){const r=vc(e),s=zs();s?qh({...i,name:r,bounds:n}):Xh({...i,name:r,bounds:n}),setTimeout(()=>{s&&(s.style.display="none")},1500)}},1200)}}Le.__VUE_DEVTOOLS_COMPONENT_INSPECTOR_ENABLED__??=!0;function sx(i){let e=0;const t=setInterval(()=>{Le.__VUE_INSPECTOR__&&(clearInterval(t),e+=30,i()),e>=5e3&&clearInterval(t)},30)}function ax(){const i=Le.__VUE_INSPECTOR__,e=i.openInEditor;i.openInEditor=async(...t)=>{i.disable(),e(...t)}}function ox(){return new Promise(i=>{function e(){ax(),i(Le.__VUE_INSPECTOR__)}Le.__VUE_INSPECTOR__?e():sx(()=>{e()})})}let _l=(function(i){return i.SKIP="__v_skip",i.IS_REACTIVE="__v_isReactive",i.IS_READONLY="__v_isReadonly",i.IS_SHALLOW="__v_isShallow",i.RAW="__v_raw",i})({});function lx(i){return!!(i&&i[_l.IS_READONLY])}function ng(i){return lx(i)?ng(i[_l.RAW]):!!(i&&i[_l.IS_REACTIVE])}function au(i){return!!(i&&i.__v_isRef===!0)}function ha(i){const e=i&&i[_l.RAW];return e?ha(e):i}var cx=class{constructor(){this.refEditor=new ux}set(i,e,t,n){const r=Array.isArray(e)?e:e.split(".");for(;r.length>1;){const o=r.shift();i instanceof Map?i=i.get(o):i instanceof Set?i=Array.from(i.values())[o]:i=i[o],this.refEditor.isRef(i)&&(i=this.refEditor.get(i))}const s=r[0],a=this.refEditor.get(i)[s];n?n(i,s,t):this.refEditor.isRef(a)?this.refEditor.set(a,t):i[s]=t}get(i,e){const t=Array.isArray(e)?e:e.split(".");for(let n=0;n<t.length;n++)if(i instanceof Map?i=i.get(t[n]):i=i[t[n]],this.refEditor.isRef(i)&&(i=this.refEditor.get(i)),!i)return;return i}has(i,e,t=!1){if(typeof i>"u")return!1;const n=Array.isArray(e)?e.slice():e.split("."),r=t?2:1;for(;i&&n.length>r;){const s=n.shift();i=i[s],this.refEditor.isRef(i)&&(i=this.refEditor.get(i))}return i!=null&&Object.prototype.hasOwnProperty.call(i,n[0])}createDefaultSetCallback(i){return(e,t,n)=>{if((i.remove||i.newKey)&&(Array.isArray(e)?e.splice(t,1):ha(e)instanceof Map?e.delete(t):ha(e)instanceof Set?e.delete(Array.from(e.values())[t]):Reflect.deleteProperty(e,t)),!i.remove){const r=e[i.newKey||t];this.refEditor.isRef(r)?this.refEditor.set(r,n):ha(e)instanceof Map?e.set(i.newKey||t,n):ha(e)instanceof Set?e.add(n):e[i.newKey||t]=n}}}},ux=class{set(i,e){if(au(i))i.value=e;else{if(i instanceof Set&&Array.isArray(e)){i.clear(),e.forEach(r=>i.add(r));return}const t=Object.keys(e);if(i instanceof Map){const r=new Set(i.keys());t.forEach(s=>{i.set(s,Reflect.get(e,s)),r.delete(s)}),r.forEach(s=>i.delete(s));return}const n=new Set(Object.keys(i));t.forEach(r=>{Reflect.set(i,r,Reflect.get(e,r)),n.delete(r)}
1),n.forEach(r=>Reflect.deleteProperty(i,r))}}get(i){return au(i)?i.value:i}isRef(i){return au(i)||ng(i)}};const hx="__VUE_DEVTOOLS_KIT_TIMELINE_LAYERS_STATE__";function dx(){if(typeof window>"u"||!qm||typeof localStorage>"u"||localStorage===null)return{recordingState:!1,mouseEventEnabled:!1,keyboardEventEnabled:!1,componentEventEnabled:!1,performanceEventEnabled:!1,selected:""};const i=typeof localStorage.getItem<"u"?localStorage.getItem(hx):null;return i?JSON.parse(i):{recordingState:!1,mouseEventEnabled:!1,keyboardEventEnabled:!1,componentEventEnabled:!1,performanceEventEnabled:!1,selected:""}}Le.__VUE_DEVTOOLS_KIT_TIMELINE_LAYERS??=[];const fx=new Proxy(Le.__VUE_DEVTOOLS_KIT_TIMELINE_LAYERS,{get(i,e,t){return Reflect.get(i,e,t)}});function px(i,e){$t.timelineLayersState[e.id]=!1,fx.push({...i,descriptorId:e.id,appRecord:Hh(e.app)})}Le.__VUE_DEVTOOLS_KIT_INSPECTOR__??=[];const $h=new Proxy(Le.__VUE_DEVTOOLS_KIT_INSPECTOR__,{get(i,e,t){return Reflect.get(i,e,t)}}),ig=Ts(()=>{Hs.hooks.callHook(Rr.SEND_INSPECTOR_TO_CLIENT,rg())});function mx(i,e){$h.push({options:i,descriptor:e,treeFilterPlaceholder:i.treeFilterPlaceholder??"Search tree...",stateFilterPlaceholder:i.stateFilterPlaceholder??"Search state...",treeFilter:"",selectedNodeId:"",appRecord:Hh(e.app)}),ig()}function rg(){return $h.filter(i=>i.descriptor.app===mn.value.app).filter(i=>i.descriptor.id!=="components").map(i=>{const e=i.descriptor,t=i.options;return{id:t.id,label:t.label,logo:e.logo,icon:`custom-ic-baseline-${t?.icon?.replace(/_/g,"-")}`,packageName:e.packageName,homepage:e.homepage,pluginId:e.id}})}function cl(i,e){return $h.find(t=>t.options.id===i&&(e?t.descriptor.app===e:!0))}let cn=(function(i){return i.VISIT_COMPONENT_TREE="visitComponentTree",i.INSPECT_COMPONENT="inspectComponent",i.EDIT_COMPONENT_STATE="editComponentState",i.GET_INSPECTOR_TREE="getInspectorTree",i.GET_INSPECTOR_STATE="getInspectorState",i.EDIT_INSPECTOR_STATE="editInspectorState",i.INSPECT_TIMELINE_EVENT="inspectTimelineEvent",i.TIMELINE_CLEARED="timelineCleared",i.SET_PLUGIN_SETTINGS="setPluginSettings",i})({}),Nt=(function(i){return i.ADD_INSPECTOR="addInspector",i.SEND_INSPECTOR_TREE="sendInspectorTree",i.SEND_INSPECTOR_STATE="sendInspectorState",i.CUSTOM_INSPECTOR_SELECT_NODE="customInspectorSelectNode",i.TIMELINE_LAYER_ADDED="timelineLayerAdded",i.TIMELINE_EVENT_ADDED="timelineEventAdded",i.GET_COMPONENT_INSTANCES="getComponentInstances",i.GET_COMPONENT_BOUNDS="getComponentBounds",i.GET_COMPONENT_NAME="getComponentName",i.COMPONENT_HIGHLIGHT="componentHighlight",i.COMPONENT_UNHIGHLIGHT="componentUnhighlight",i})({}),Rr=(function(i){return i.SEND_INSPECTOR_TREE_TO_CLIENT="sendInspectorTreeToClient",i.SEND_INSPECTOR_STATE_TO_CLIENT="sendInspectorStateToClient",i.SEND_TIMELINE_EVENT_TO_CLIENT="sendTimelineEventToClient",i.SEND_INSPECTOR_TO_CLIENT="sendInspectorToClient",i.SEND_ACTIVE_APP_UNMOUNTED_TO_CLIENT="sendActiveAppUpdatedToClient",i.DEVTOOLS_STATE_UPDATED="devtoolsStateUpdated",i.DEVTOOLS_CONNECTED_UPDATED="devtoolsConnectedUpdated",i.ROUTER_INFO_UPDATED="routerInfoUpdated",i})({});function gx(){const i=Dm();i.hook(Nt.ADD_INSPECTOR,({inspector:n,plugin:r})=>{mx(n,r.descriptor)});const e=Ts(async({inspectorId:n,plugin:r})=>{if(!n||!r?.descriptor?.app||$t.highPerfModeEnabled)return;const s=cl(n,r.descriptor.app),a={app:r.descriptor.app,inspectorId:n,filter:s?.treeFilter||"",rootNodes:[]};await new Promise(o=>{i.callHookWith(async l=>{await Promise.all(l.map(c=>c(a))),o()},cn.GET_INSPECTOR_TREE)}),i.callHookWith(async o=>{await Promise.all(o.map(l=>l({inspectorId:n,rootNodes:a.rootNodes})))},Rr.SEND_INSPECTOR_TREE_TO_CLIENT)},120);i.hook(Nt.SEND_INSPECTOR_TREE,e);const t=Ts(async({inspectorId:n,plugin:r})=>{if(!n||!r?.descriptor?.app||$t.highPerfModeEnabled)return;const s=cl(n,r.descriptor.app),a={app:r.descriptor.app,inspectorId:n,nodeId:s?.selectedNodeId||"",state:null},o={currentTab:`custom-inspector:${n}`};a.nodeId&&await new Promise(l=>{i.callHookWith(async c=>{await Promise.all(c.map(u=>u(a,o))),l()},cn.GET_INSPECTOR_STATE)}),i.callHookWith(async l=>{await Promise.all(l.map(c=>c({inspectorId:n,nodeId:a.nodeId,state:a.state})))},Rr.SEND_INSPECTOR_STATE_TO_CLIENT)},120);return i.hook(Nt.SEND_INSPECTOR_STATE,t),i.hook(Nt.CUSTOM_INSPECTOR_SELECT_NODE,({inspectorId:n,nodeId:r,plugin:s})=>{const a=cl(n,s.descriptor.app);a&&(a.selectedNodeId=r)}),i.hook(Nt.TIMELINE_LAYER_ADDED,({options:n,plugin:r})=>{px(n,r.descriptor)}),i.hook(Nt.TIMELINE_EVENT_ADDED,({options:n,plugin:r})=>{$t.highPerfModeEnabled||!$t.timelineLayersState?.[r.descriptor.id]&&!["performance","component-event","keyboard","mouse"].includes(n.layerId)||i.callHookWith(async s=>{await Promise.all(s.map(a=>a(n)))},Rr.SEND_TIMELINE_EVENT_TO_CLIENT)}),i.hook(Nt.GET_COMPONENT_INSTANCES,async({app:n})=>{const r=n.__VUE_DEVTOOLS_NEXT_APP_RECORD__;if(!r)return null;const s=r.id.toString();return[...r.instanceMap].filter(([a])=>a.split(":")[0]===s).map(([,a])=>a)}),i.hook(Nt.GET_COMPONENT_BOUNDS,async({instance:n})=>Dr(n)),i.hook(Nt.GET_COMPONENT_NAME,({instance:n})=>vc(n)),i.hook(Nt.COMPONENT_HIGHLIGHT,({uid:n})=>{const r=mn.value.instanceMap.get(n);r&&ex(r)}),i.hook(Nt.COMPONENT_UNHIGHLIGHT,()=>{tg()}),i}Le.__VUE_DEVTOOLS_KIT_APP_RECORDS__??=[];Le.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__??={};Le.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD_ID__??="";Le.__VUE_DEVTOOLS_KIT_CUSTOM_TABS__??=[];Le.__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__??=[];const _a="__VUE_DEVTOOLS_KIT_GLOBAL_STATE__";function _x(){return{connected:!1,clientConnected:!1,vitePluginDetected:!0,appRecords:[],activeAppRecordId:"",tabs:[],commands:[],highPerfModeEnabled:!0,devtoolsClientDetected:{},perfUniqueGroupId:0,timelineLayersState:dx()}}Le[_a]??=_x();const vx=Ts(i=>{Hs.hooks.callHook(Rr.DEVTOOLS_STATE_UPDATED,{state:i})});Ts((i,e)=>{Hs.hooks.callHook(Rr.DEVTOOLS_CONNECTED_UPDATED,{state:i,oldState:e})});const xc=new Proxy(Le.__VUE_DEVTOOLS_KIT_APP_RECORDS__,{get(i,e,t){return e==="value"?Le.__VUE_DEVTOOLS_KIT_APP_RECORDS__:Le.__VUE_DEVTOOLS_KIT_APP_RECORDS__[e]}}),mn=new Proxy(Le.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__,{get(i,e,t){return e==="value"?Le.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__:e==="id"?Le.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD_ID__:Le.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__[e]}});function sg(){vx({...Le[_a],appRecords:xc.value,activeAppRecordId:mn.id,tabs:Le.__VUE_DEVTOOLS_KIT_CUSTOM_TABS__,commands:Le.__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__})}function xx(i){Le.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD__=i,sg()}function yx(i){Le.__VUE_DEVTOOLS_KIT_ACTIVE_APP_RECORD_ID__=i,sg()}const $t=new Proxy(Le[_a],{get(i,e){return e==="appRecords"?xc:e==="activeAppRecordId"?mn.id:e==="tabs"?Le.__VUE_DEVTOOLS_KIT_CUSTOM_TABS__:e==="commands"?Le.__VUE_DEVTOOLS_KIT_CUSTOM_COMMANDS__:Le[_a][e]},deleteProperty(i,e){return delete i[e],!0},set(i,e,t){return i[e]=t,Le[_a][e]=t,!0}});function bx(i={}){const{file:e,host:t,baseUrl:n=window.location.origin,line:r=0,column:s=0}=i;if(e){if(t==="chrome-extension"){const a=e.replace(/\\/g,"\\\\"),o=window.VUE_DEVTOOLS_CONFIG?.openInEditorHost??"/";fetch(`${o}__open-in-editor?file=${encodeURI(e)}`).then(l=>{if(!l.ok){const c=`Opening component ${a} failed`;console.log(`%c${c}`,"color:red")}})}else if($t.vitePluginDetected){const a=Le.__VUE_DEVTOOLS_OPEN_IN_EDITOR_BASE_URL__??n;Le.__VUE_INSPECTOR__.openInEditor(a,e,r,s)}}}Le.__VUE_DEVTOOLS_KIT_PLUGIN_BUFFER__??=[];const Yh=new Proxy(Le.__VUE_DEVTOOLS_KIT_PLUGIN_BUFFER__,{get(i,e,t){return Reflect.get(i,e,t)}});function ah(i){const e={};
1return Object.keys(i).forEach(t=>{e[t]=i[t].defaultValue}),e}function Zh(i){return`__VUE_DEVTOOLS_NEXT_PLUGIN_SETTINGS__${i}__`}function Sx(i){return(Yh.find(e=>e[0].id===i&&!!e[0]?.settings)?.[0]??null)?.settings??null}function ag(i,e){const t=Zh(i);if(t){const n=localStorage.getItem(t);if(n)return JSON.parse(n)}return ah(i?(Yh.find(n=>n[0].id===i)?.[0]??null)?.settings??{}:e)}function Mx(i,e){const t=Zh(i);localStorage.getItem(t)||localStorage.setItem(t,JSON.stringify(ah(e)))}function Ex(i,e,t){const n=Zh(i),r=localStorage.getItem(n),s=JSON.parse(r||"{}"),a={...s,[e]:t};localStorage.setItem(n,JSON.stringify(a)),Hs.hooks.callHookWith(o=>{o.forEach(l=>l({pluginId:i,key:e,oldValue:s[e],newValue:t,settings:a}))},cn.SET_PLUGIN_SETTINGS)}let Nn=(function(i){return i.APP_INIT="app:init",i.APP_UNMOUNT="app:unmount",i.COMPONENT_UPDATED="component:updated",i.COMPONENT_ADDED="component:added",i.COMPONENT_REMOVED="component:removed",i.COMPONENT_EMIT="component:emit",i.PERFORMANCE_START="perf:start",i.PERFORMANCE_END="perf:end",i.ADD_ROUTE="router:add-route",i.REMOVE_ROUTE="router:remove-route",i.RENDER_TRACKED="render:tracked",i.RENDER_TRIGGERED="render:triggered",i.APP_CONNECTED="app:connected",i.SETUP_DEVTOOLS_PLUGIN="devtools-plugin:setup",i})({});const Dn=Le.__VUE_DEVTOOLS_HOOK??=Dm(),Tx={vueAppInit(i){Dn.hook(Nn.APP_INIT,i)},vueAppUnmount(i){Dn.hook(Nn.APP_UNMOUNT,i)},vueAppConnected(i){Dn.hook(Nn.APP_CONNECTED,i)},componentAdded(i){return Dn.hook(Nn.COMPONENT_ADDED,i)},componentEmit(i){return Dn.hook(Nn.COMPONENT_EMIT,i)},componentUpdated(i){return Dn.hook(Nn.COMPONENT_UPDATED,i)},componentRemoved(i){return Dn.hook(Nn.COMPONENT_REMOVED,i)},setupDevtoolsPlugin(i){Dn.hook(Nn.SETUP_DEVTOOLS_PLUGIN,i)},perfStart(i){return Dn.hook(Nn.PERFORMANCE_START,i)},perfEnd(i){return Dn.hook(Nn.PERFORMANCE_END,i)}},og={on:Tx,setupDevToolsPlugin(i,e){return Dn.callHook(Nn.SETUP_DEVTOOLS_PLUGIN,i,e)}};var wx=class{constructor({plugin:i,ctx:e}){this.hooks=e.hooks,this.plugin=i}get on(){return{visitComponentTree:i=>{this.hooks.hook(cn.VISIT_COMPONENT_TREE,i)},inspectComponent:i=>{this.hooks.hook(cn.INSPECT_COMPONENT,i)},editComponentState:i=>{this.hooks.hook(cn.EDIT_COMPONENT_STATE,i)},getInspectorTree:i=>{this.hooks.hook(cn.GET_INSPECTOR_TREE,i)},getInspectorState:i=>{this.hooks.hook(cn.GET_INSPECTOR_STATE,i)},editInspectorState:i=>{this.hooks.hook(cn.EDIT_INSPECTOR_STATE,i)},inspectTimelineEvent:i=>{this.hooks.hook(cn.INSPECT_TIMELINE_EVENT,i)},timelineCleared:i=>{this.hooks.hook(cn.TIMELINE_CLEARED,i)},setPluginSettings:i=>{this.hooks.hook(cn.SET_PLUGIN_SETTINGS,i)}}}notifyComponentUpdate(i){if($t.highPerfModeEnabled)return;const e=rg().find(t=>t.packageName===this.plugin.descriptor.packageName);if(e?.id){if(i){const t=[i.appContext.app,i.uid,i.parent?.uid,i];Dn.callHook(Nn.COMPONENT_UPDATED,...t)}else Dn.callHook(Nn.COMPONENT_UPDATED);this.hooks.callHook(Nt.SEND_INSPECTOR_STATE,{inspectorId:e.id,plugin:this.plugin})}}addInspector(i){this.hooks.callHook(Nt.ADD_INSPECTOR,{inspector:i,plugin:this.plugin}),this.plugin.descriptor.settings&&Mx(i.id,this.plugin.descriptor.settings)}sendInspectorTree(i){$t.highPerfModeEnabled||this.hooks.callHook(Nt.SEND_INSPECTOR_TREE,{inspectorId:i,plugin:this.plugin})}sendInspectorState(i){$t.highPerfModeEnabled||this.hooks.callHook(Nt.SEND_INSPECTOR_STATE,{inspectorId:i,plugin:this.plugin})}selectInspectorNode(i,e){this.hooks.callHook(Nt.CUSTOM_INSPECTOR_SELECT_NODE,{inspectorId:i,nodeId:e,plugin:this.plugin})}visitComponentTree(i){return this.hooks.callHook(cn.VISIT_COMPONENT_TREE,i)}now(){return $t.highPerfModeEnabled?0:Date.now()}addTimelineLayer(i){this.hooks.callHook(Nt.TIMELINE_LAYER_ADDED,{options:i,plugin:this.plugin})}addTimelineEvent(i){$t.highPerfModeEnabled||this.hooks.callHook(Nt.TIMELINE_EVENT_ADDED,{options:i,plugin:this.plugin})}getSettings(i){return ag(i??this.plugin.descriptor.id,this.plugin.descriptor.settings)}getComponentInstances(i){return this.hooks.callHook(Nt.GET_COMPONENT_INSTANCES,{app:i})}getComponentBounds(i){return this.hooks.callHook(Nt.GET_COMPONENT_BOUNDS,{instance:i})}getComponentName(i){return this.hooks.callHook(Nt.GET_COMPONENT_NAME,{instance:i})}highlightElement(i){const e=i.__VUE_DEVTOOLS_NEXT_UID__;return this.hooks.callHook(Nt.COMPONENT_HIGHLIGHT,{uid:e})}unhighlightElement(){return this.hooks.callHook(Nt.COMPONENT_UNHIGHLIGHT)}};const Ax=wx,Cx="__vue_devtool_undefined__",Rx="__vue_devtool_infinity__",Ix="__vue_devtool_negative_infinity__",Px="__vue_devtool_nan__",Lx={[Cx]:"undefined",[Px]:"NaN",[Rx]:"Infinity",[Ix]:"-Infinity"};Object.entries(Lx).reduce((i,[e,t])=>(i[t]=e,i),{});Le.__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__??=new Set;function Nx(i,e){return og.setupDevToolsPlugin(i,e)}function Dx(i,e){const[t,n]=i;if(t.app!==e)return;const r=new Ax({plugin:{setupFn:n,descriptor:t},ctx:Hs});t.packageName==="vuex"&&r.on.editInspectorState(s=>{r.sendInspectorState(s.inspectorId)}),n(r)}function lg(i,e){Le.__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__.has(i)||$t.highPerfModeEnabled&&!e?.inspectingComponent||(Le.__VUE_DEVTOOLS_KIT__REGISTERED_PLUGIN_APPS__.add(i),Yh.forEach(t=>{Dx(t,i)}))}const vl="__VUE_DEVTOOLS_ROUTER__",La="__VUE_DEVTOOLS_ROUTER_INFO__";Le[La]??={currentRoute:null,routes:[]};Le[vl]??={};new Proxy(Le[La],{get(i,e){return Le[La][e]}});new Proxy(Le[vl],{get(i,e){if(e==="value")return Le[vl]}});function Ox(i){const e=new Map;return(i?.getRoutes()||[]).filter(t=>!e.has(t.path)&&e.set(t.path,1))}function Kh(i){return i.map(e=>{let{path:t,name:n,children:r,meta:s}=e;return r?.length&&(r=Kh(r)),{path:t,name:n,children:r,meta:s}})}function Ux(i){if(i){const{fullPath:e,hash:t,href:n,path:r,name:s,matched:a,params:o,query:l}=i;return{fullPath:e,hash:t,href:n,path:r,name:s,params:o,query:l,matched:Kh(a)}}return i}function Fx(i,e){function t(){const n=i.app?.config.globalProperties.$router,r=Ux(n?.currentRoute.value),s=Kh(Ox(n)),a=console.warn;console.warn=()=>{},Le[La]={currentRoute:r?xf(r):{},routes:xf(s)},Le[vl]=n,console.warn=a}t(),og.on.componentUpdated(Ts(()=>{e.value?.app===i.app&&(t(),!$t.highPerfModeEnabled&&Hs.hooks.callHook(Rr.ROUTER_INFO_UPDATED,{state:Le[La]}))},200))}
1function Bx(i){return{async getInspectorTree(e){const t={...e,app:mn.value.app,rootNodes:[]};return await new Promise(n=>{i.callHookWith(async r=>{await Promise.all(r.map(s=>s(t))),n()},cn.GET_INSPECTOR_TREE)}),t.rootNodes},async getInspectorState(e){const t={...e,app:mn.value.app,state:null},n={currentTab:`custom-inspector:${e.inspectorId}`};return await new Promise(r=>{i.callHookWith(async s=>{await Promise.all(s.map(a=>a(t,n))),r()},cn.GET_INSPECTOR_STATE)}),t.state},editInspectorState(e){const t=new cx,n={...e,app:mn.value.app,set:(r,s=e.path,a=e.state.value,o)=>{t.set(r,s,a,o||t.createDefaultSetCallback(e.state))}};i.callHookWith(r=>{r.forEach(s=>s(n))},cn.EDIT_INSPECTOR_STATE)},sendInspectorState(e){const t=cl(e);i.callHook(Nt.SEND_INSPECTOR_STATE,{inspectorId:e,plugin:{descriptor:t.descriptor,setupFn:()=>({})}})},inspectComponentInspector(){return ix()},cancelInspectComponentInspector(){return nx()},getComponentRenderCode(e){const t=ih(mn.value,e);if(t)return typeof t?.type!="function"?t.render.toString():t.type.toString()},scrollToComponent(e){return rx({id:e})},openInEditor:bx,getVueInspector:ox,toggleApp(e,t){const n=xc.value.find(r=>r.id===e);n&&(yx(e),xx(n),Fx(n,mn),ig(),lg(n.app,t))},inspectDOM(e){const t=ih(mn.value,e);if(t){const[n]=Gh(t);n&&(Le.__VUE_DEVTOOLS_INSPECT_DOM_TARGET__=n)}},updatePluginSettings(e,t,n){Ex(e,t,n)},getPluginSettings(e){return{options:Sx(e),values:ag(e)}}}}Le.__VUE_DEVTOOLS_ENV__??={vitePluginDetected:!1};const Sf=gx();Le.__VUE_DEVTOOLS_KIT_CONTEXT__??={hooks:Sf,get state(){return{...$t,activeAppRecordId:mn.id,activeAppRecord:mn.value,appRecords:xc.value}},api:Bx(Sf)};const Hs=Le.__VUE_DEVTOOLS_KIT_CONTEXT__;var kx=Ym(((i,e)=>{(function(t){var n={Ã:"A",Ã:"A",Ã:"A",Ã:"A",Ã:"Ae",Ã
:"A",Ã:"AE",Ã:"C",Ã:"E",Ã:"E",Ã:"E",Ã:"E",Ã:"I",Ã:"I",Ã:"I",Ã:"I",Ã:"D",Ã:"N",Ã:"O",Ã:"O",Ã:"O",Ã:"O",Ã:"Oe",Å:"O",Ã:"O",Ã:"U",Ã:"U",Ã:"U",Ã:"Ue",Ű:"U",Ã:"Y",Ã:"TH",Ã:"ss",à :"a",á:"a",â:"a",ã:"a",ä:"ae",Ã¥:"a",æ:"ae",ç:"c",è:"e",é:"e",ê:"e",ë:"e",ì:"i",Ã:"i",î:"i",ï:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"oe",Å:"o",ø:"o",ù:"u",ú:"u",û:"u",ü:"ue",ű:"u",ý:"y",þ:"th",ÿ:"y","áº":"SS",ا:"a",Ø£:"a",Ø¥:"i",Ø¢:"aa",ؤ:"u",ئ:"e",Ø¡:"a",ب:"b",ت:"t",Ø«:"th",ج:"j",Ø:"h",Ø®:"kh",د:"d",ذ:"th",ر:"r",ز:"z",س:"s",Ø´:"sh",ص:"s",ض:"dh",Ø·:"t",ظ:"z",ع:"a",غ:"gh",Ù:"f",Ù:"q",Ù:"k",Ù:"l",Ù
:"m",Ù:"n",Ù:"h",Ù:"w",Ù:"y",Ù:"a",Ø©:"h",ï»»:"la",ï»·:"laa",ﻹ:"lai",ﻵ:"laa",Ú¯:"g",Ú:"ch",Ù¾:"p",Ú:"zh",Ú©:"k",Û:"y","Ù":"a","Ù":"an","Ù":"e","Ù":"en","Ù":"u","Ù":"on","Ù":"","Ù ":"0","Ù¡":"1","Ù¢":"2","Ù£":"3","Ù¤":"4","Ù¥":"5","Ù¦":"6","Ù§":"7","Ù¨":"8","Ù©":"9","Û°":"0","Û±":"1","Û²":"2","Û³":"3","Û´":"4","Ûµ":"5","Û¶":"6","Û·":"7","Û¸":"8","Û¹":"9",á:"k",á:"kh",á:"g",á:"ga",á:"ng",á
:"s",á:"sa",á:"z","á
á»":"za",á:"ny",á:"t",á:"ta",á:"d",á:"da",á:"na",á:"t",á:"ta",á:"d",á:"da",á:"n",á:"p",á:"pa",á:"b",á:"ba",á:"m",á:"y",á:"ya",á:"l",á:"w",á:"th",á:"h",á :"la",á¡:"a","á¼":"y","á»":"ya","á½":"w","á¼á½":"yw","á»á½":"ywa","á¾":"h",á§:"e","á":"-e",á£:"i",á¤:"-i",á:"u",á¦:"-u",á©:"aw","áá¼á±á¬":"aw",áª:"aw","á":"0","á":"1","á":"2","á":"3","á":"4","á
":"5","á":"6","á":"7","á":"8","á":"9","á¹":"","á·":"","á¸":"",Ä:"c",Ä:"d",Ä:"e",Å:"n",Å:"r",Å¡:"s",Å¥:"t",ů:"u",ž:"z",Ä:"C",Ä:"D",Ä:"E",Å:"N",Å:"R",Å :"S",Ť:"T",Å®:"U",Ž:"Z",Þ:"h",Þ:"sh",Þ:"n",Þ:"r",Þ:"b",Þ
:"lh",Þ:"k",Þ:"a",Þ:"v",Þ:"m",Þ:"f",Þ:"dh",Þ:"th",Þ:"l",Þ:"g",Þ:"gn",Þ:"s",Þ:"d",Þ:"z",Þ:"t",Þ:"y",Þ:"p",Þ:"j",Þ:"ch",Þ:"tt",Þ:"hh",Þ:"kh",Þ:"th",Þ:"z",Þ:"sh",Þ:"s",Þ:"d",Þ :"t",Þ¡:"z",Þ¢:"a",Þ£:"gh",Þ¤:"q",Þ¥:"w","Þ¦":"a","Þ§":"aa","Þ¨":"i","Þ©":"ee","Þª":"u","Þ«":"oo","Þ¬":"e","Þ":"ey","Þ®":"o","Þ¯":"oa","Þ°":"",á:"a",á:"b",á:"g",á:"d",á:"e",á:"v",á:"z",á:"t",á:"i",á:"k",á:"l",á:"m",á:"n",á:"o",á:"p",á:"zh",á :"r",á¡:"s",á¢:"t",á£:"u",á¤:"p",á¥:"k",á¦:"gh",á§:"q",á¨:"sh",á©:"ch",áª:"ts",á«:"dz",á¬:"ts",á:"ch",á®:"kh",á¯:"j",á°:"h",α:"a",β:"v",γ:"g",δ:"d",ε:"e",ζ:"z",η:"i",θ:"th",ι:"i",κ:"k",λ:"l",μ:"m",ν:"n",ξ:"ks",ο:"o",Ï:"p",Ï:"r",Ï:"s",Ï:"t",Ï
:"y",Ï:"f",Ï:"x",Ï:"ps",Ï:"o",ά:"a",Î:"e",ί:"i",Ï:"o",Ï:"y",ή:"i",Ï:"o",Ï:"s",Ï:"i",ΰ:"y",Ï:"y",Î:"i",Î:"A",Î:"B",Î:"G",Î:"D",Î:"E",Î:"Z",Î:"I",Î:"TH",Î:"I",Î:"K",Î:"L",Î:"M",Î:"N",Î:"KS",Î:"O",Î :"P",Ρ:"R",Σ:"S",Τ:"T",Î¥:"Y",Φ:"F",Χ:"X",Ψ:"PS",Ω:"O",Î:"A",Î:"E",Î:"I",Î:"O",Î:"Y",Î:"I",Î:"O",Ϊ:"I",Ϋ:"Y",Ä:"a",Ä:"e",Ä£:"g",Ä«:"i",Ä·:"k",ļ:"l",Å:"n",Å«:"u",Ä:"A",Ä:"E",Ä¢:"G",Ī:"I",Ķ:"k",Ä»:"L",Å
:"N",Ū:"U",Ð:"Kj",Ñ:"kj",Ð:"Lj",Ñ:"lj",Ð:"Nj",Ñ:"nj",ТÑ:"Ts",ÑÑ:"ts",Ä
:"a",Ä:"c",Ä:"e",Å:"l",Å:"n",Å:"s",ź:"z",ż:"z",Ä:"A",Ä:"C",Ä:"E",Å:"L",Å:"N",Å:"S",Ź:"Z",Å»:"Z",Ð:"Ye",Ð:"I",Ð:"Yi",Ò:"G",Ñ:"ye",Ñ:"i",Ñ:"yi",Ò:"g",Ä:"a",Ä:"A",È:"s",È:"S",È:"t",È:"T",Å£:"t",Å¢:"T",а:"a",б:"b",в:"v",г:"g",д:"d",е:"e",Ñ:"yo",ж:"zh",з:"z",и:"i",й:"i",к:"k",л:"l",м:"m",н:"n",о:"o",п:"p",Ñ:"r",Ñ:"s",Ñ:"t",Ñ:"u",Ñ:"f",Ñ
:"kh",Ñ:"c",Ñ:"ch",Ñ:"sh",Ñ:"sh",Ñ:"",Ñ:"y",Ñ:"",Ñ:"e",Ñ:"yu",Ñ:"ya",Ð:"A",Ð:"B",Ð:"V",Ð:"G",Ð:"D",Ð:"E",Ð:"Yo",Ð:"Zh",Ð:"Z",Ð:"I",Ð:"I",Ð:"K",Ð:"L",Ð:"M",Ð:"N",Ð:"O",Ð:"P",Ð :"R",С:"S",Т:"T",У:"U",Ф:"F",Ð¥:"Kh",Ц:"C",Ч:"Ch",Ш:"Sh",Щ:"Sh",Ъ:"",Ы:"Y",Ь:"",Ð:"E",Ю:"Yu",Я:"Ya",Ñ:"dj",Ñ:"j",Ñ:"c",Ñ:"dz",Ð:"Dj",Ð:"j",Ð:"C",Ð:"Dz",ľ:"l",ĺ:"l",Å:"r",Ľ:"L",Ĺ:"L",Å:"R",Å:"s",Å:"S",ı:"i",İ:"I",Ä:"g",Ä:"G",ả:"a",Ả:"A",á
1º³:"a",Ẳ:"A",ẩ:"a",Ẩ:"A",Ä:"d",Ä:"D",ẹ:"e",Ẹ:"E",ẽ:"e",Ẽ:"E",ẻ:"e",Ẻ:"E",ế:"e",Ế:"E",á»:"e",á»:"E",á»:"e",á»:"E",á»
:"e",á»:"E",á»:"e",á»:"E",á»:"o",á»:"o",á»:"o",á»:"o",á»:"O",á»:"o",á»:"O",á»:"o",á»:"O",á»:"o",á»:"O",á»:"o",á»:"O",Æ¡:"o",Æ :"O",á»:"o",á»:"O",á»:"o",á»:"O",ợ:"o",Ợ:"O",ỡ:"o",á» :"O",á»:"o",á»:"o",á»:"i",á»:"I",Ä©:"i",Ĩ:"I",á»:"i",á»:"i",á»§:"u",Ủ:"U",ụ:"u",Ụ:"U",Å©:"u",Ũ:"U",ư:"u",Ư:"U",ứ:"u",Ứ:"U",ừ:"u",Ừ:"U",á»±:"u",á»°:"U",ữ:"u",á»®:"U",á»:"u",Ử:"ư",á»·:"y",á»¶:"y",ỳ:"y",Ỳ:"Y",ỵ:"y",á»´:"Y",ỹ:"y",Ỹ:"Y",ạ:"a",Ạ:"A",ấ:"a",Ấ:"A",ầ:"a",Ầ:"A",áº:"a",Ậ:"A",ẫ:"a",Ẫ:"A",ắ:"a",Ắ:"A",ằ:"a",Ằ:"A",ặ:"a",Ặ:"A",ẵ:"a",Ẵ:"A","âª":"0","â ":"1","â¡":"2","â¢":"3","â£":"4","â¤":"5","â¥":"6","â¦":"7","â§":"8","â¨":"9","â©":"10","âª":"11","â«":"12","â¬":"13","â":"14","â®":"15","â¯":"16","â°":"17","â±":"18","â²":"18","â³":"18","âµ":"1","â¶":"2","â·":"3","â¸":"4","â¹":"5","âº":"6","â»":"7","â¼":"8","â½":"9","â¾":"10","â¿":"0","â«":"11","â¬":"12","â":"13","â®":"14","â¯":"15","â°":"16","â±":"17","â²":"18","â³":"19","â´":"20","â¶":"A","â·":"B","â¸":"C","â¹":"D","âº":"E","â»":"F","â¼":"G","â½":"H","â¾":"I","â¿":"J","â":"K","â":"L","â":"M","â":"N","â":"O","â
":"P","â":"Q","â":"R","â":"S","â":"T","â":"U","â":"V","â":"W","â":"X","â":"Y","â":"Z","â":"a","â":"b","â":"c","â":"d","â":"e","â":"f","â":"g","â":"h","â":"i","â":"j","â":"k","â":"l","â":"m","â":"n","â":"o","â":"p","â ":"q","â¡":"r","â¢":"s","â£":"t","â¤":"u","â¦":"v","â¥":"w","â§":"x","â¨":"y","â©":"z","â":'"',"â":'"',"â":"'","â":"'","â":"d",Æ:"f","â¢":"(TM)","©":"(C)",Å:"oe",Å:"OE","®":"(R)","â ":"+","â ":"(SM)","â¦":"...","Ë":"o",º:"o",ª:"a","â¢":"*","á":",","á":".",$:"USD","â¬":"EUR","â¢":"BRN","â£":"FRF","£":"GBP","â¤":"ITL","â¦":"NGN","â§":"ESP","â©":"KRW","âª":"ILS","â«":"VND","â":"LAK","â®":"MNT","â¯":"GRD","â±":"ARS","â²":"PYG","â³":"ARA","â´":"UAH","âµ":"GHS","¢":"cent","Â¥":"CNY",å
:"CNY",å:"YEN","ï·¼":"IRR","â ":"EWE","฿":"THB","â¨":"INR","â¹":"INR","â°":"PF","âº":"TRY","Ø":"AFN","â¼":"AZN",лв:"BGN","á":"KHR","â¡":"CRC","â¸":"KZT",ден:"MKD",zÅ:"PLN","â½":"RUB","â¾":"GEL"},r=["áº","Þ°"],s={"á¬":"a","á«":"a","á±":"e","á²":"e","á":"i","á®":"i","áá¯":"o","á¯":"u","á°":"u","á±á«ááº":"aung","á±á¬":"aw","á±á¬áº":"aw","á±á«":"aw","á±á«áº":"aw","áº":"áº","ááº":"et","áá¯ááº":"aik","á±á¬ááº":"auk","ááº":"in","áá¯ááº":"aing","á±á¬ááº":"aung","á
áº":"it","ááº":"i","ááº":"at","áááº":"eik","á¯ááº":"ok","á½ááº":"ut","á±ááº":"it","ááº":"d","áá¯ááº":"ok","á¯ááº":"ait","ááº":"an","á¬ááº":"an","áááº":"ein","á¯ááº":"on","á½ááº":"un","ááº":"at","áááº":"eik","á¯ááº":"ok","á½ááº":"ut","ááºá¯ááº":"nub","ááº":"an","áááº":"ein","á¯ááº":"on","á½ááº":"un","ááº":"e","áá¯ááº":"ol","ááº":"in","á¶":"an","áá¶":"ein","á¯á¶":"on","Þ¦ÞÞ°":"ah","Þ¦ÞÞ°":"ah"},a={en:{},az:{ç:"c",É:"e",Ä:"g",ı:"i",ö:"o",Å:"s",ü:"u",Ã:"C",Æ:"E",Ä:"G",İ:"I",Ã:"O",Å:"S",Ã:"U"},cs:{Ä:"c",Ä:"d",Ä:"e",Å:"n",Å:"r",Å¡:"s",Å¥:"t",ů:"u",ž:"z",Ä:"C",Ä:"D",Ä:"E",Å:"N",Å:"R",Å :"S",Ť:"T",Å®:"U",Ž:"Z"},fi:{ä:"a",Ã:"A",ö:"o",Ã:"O"},hu:{ä:"a",Ã:"A",ö:"o",Ã:"O",ü:"u",Ã:"U",ű:"u",Ű:"U"},lt:{Ä
:"a",Ä:"c",Ä:"e",Ä:"e",į:"i",Å¡:"s",ų:"u",Å«:"u",ž:"z",Ä:"A",Ä:"C",Ä:"E",Ä:"E",Ä®:"I",Å :"S",Ų:"U",Ū:"U"},lv:{Ä:"a",Ä:"c",Ä:"e",Ä£:"g",Ä«:"i",Ä·:"k",ļ:"l",Å:"n",Å¡:"s",Å«:"u",ž:"z",Ä:"A",Ä:"C",Ä:"E",Ä¢:"G",Ī:"i",Ķ:"k",Ä»:"L",Å
:"N",Å :"S",Ū:"u",Ž:"Z"},pl:{Ä
:"a",Ä:"c",Ä:"e",Å:"l",Å:"n",ó:"o",Å:"s",ź:"z",ż:"z",Ä:"A",Ä:"C",Ä:"e",Å:"L",Å:"N",Ã:"O",Å:"S",Ź:"Z",Å»:"Z"},sv:{ä:"a",Ã:"A",ö:"o",Ã:"O"},sk:{ä:"a",Ã:"A"},sr:{Ñ:"lj",Ñ:"nj",Ð:"Lj",Ð:"Nj",Ä:"dj",Ä:"Dj"},tr:{Ã:"U",Ã:"O",ü:"u",ö:"o"}},o={ar:{"â":"delta","â":"la-nihaya","â¥":"hob","&":"wa","|":"aw","<":"aqal-men",">":"akbar-men","â":"majmou","¤":"omla"},az:{},ca:{"â":"delta","â":"infinit","â¥":"amor","&":"i","|":"o","<":"menys que",">":"mes que","â":"suma dels","¤":"moneda"},cs:{"â":"delta","â":"nekonecno","â¥":"laska","&":"a","|":"nebo","<":"mensi nez",">":"vetsi nez","â":"soucet","¤":"mena"},de:{"â":"delta","â":"unendlich","â¥":"Liebe","&":"und","|":"oder","<":"kleiner als",">":"groesser als","â":"Summe von","¤":"Waehrung"},dv:{"â":"delta","â":"kolunulaa","â¥":"loabi","&":"aai","|":"noonee","<":"ah vure kuda",">":"ah vure bodu","â":"jumula","¤":"faisaa"},en:{"â":"delta","â":"infinity","â¥":"love","&":"and","|":"or","<":"less than",">":"greater than","â":"sum","¤":"currency"},es:{"â":"delta","â":"infinito","â¥":"amor","&":"y","|":"u","<":"menos que",">":"mas que","â":"suma de los","¤":"moneda"},fa:{"â":"delta","â":"bi-nahayat","â¥":"eshgh","&":"va","|":"ya","<":"kamtar-az",">":"bishtar-az","â":"majmooe","¤":"vahed"},fi:{"â":"delta","â":"aarettomyys","â¥":"rakkaus","&":"ja","|":"tai","<":"pienempi kuin",">":"suurempi kuin","â":"summa","¤":"valuutta"},fr:{"â":"delta","â":"infiniment","â¥":"Amour","&":"et","|":"ou","<":"moins que",">":"superieure a","â":"somme des","¤":"monnaie"},ge:{"â":"delta","â":"usasruloba","â¥":"siqvaruli","&":"da","|":"an","<":"naklebi",">":"meti","â":"jami","¤":"valuta"},gr:{},hu:{"â":"delta","â":"vegtelen","â¥":"szerelem","&":"es","|":"vagy","<":"kisebb mint",">":"nagyobb mint","â":"szumma","¤":"penznem"},it:{"â":"delta","â":"infinito","â¥":"amore","&":"e","|":"o","<":"minore di",">":"maggiore di","â":"somma","¤":"moneta"},lt:{"â":"delta","â":"begalybe","â¥":"meile","&":"ir","|":"ar","<":"maziau nei",">":"daugiau nei","â":"suma","¤":"valiuta"},lv:{"â":"delta","â":"bezgaliba","â¥":"milestiba","&":"un","|":"vai","<":"mazak neka",">":"lielaks neka","â":"summa","¤":"valuta"},my:{"â":"kwahkhyaet","â":"asaonasme","â¥":"akhyait","&":"nhin","|":"tho","<":"ngethaw",">":"kyithaw","â":"paungld","¤":"ngwekye"},mk:{},nl:{"â":"delta","â":"oneindig","â¥":"liefde","&":"en","|":"of","<":"kleiner dan",">":"groter dan","â":"som","¤":"valuta"},pl:{"â":"delta","â":"nieskonczonosc","â¥":"milosc","&":"i","|":"lub","<":"mniejsze niz",">":"wieksze niz","â":"suma","¤":"waluta"},pt:{"â":"delta","â":"infinito","â¥":"amor","&":"e","|":"ou","<":"menor que",">":"maior que","â":"soma","¤":"moeda"},ro:{"â":"delta","â":"infinit","â¥":"dragoste","&":"si","|":"sau","<":"mai mic ca",">":"mai mare ca","â":"suma","¤":"valuta"},ru:{"â":"delta","â":"beskonechno","â¥":"lubov","&":"i","|":"ili","<":"menshe",">":"bolshe","â":"summa","¤":"valjuta"},sk:{"â":"delta","â":"nekonecno","â¥":"laska","&":"a","|":"alebo","<":"menej ako",">":"viac ako","â":"sucet","¤":"mena"},sr:{},tr:{"â":"delta","â":"sonsuzluk","â¥":"ask","&":"ve","|":"veya","<":"kucuktur",">":"buyuktur","â":"toplam","¤":"para birimi"},uk:{"â":"delta","â":"bezkinechnist","â¥":"lubov","&":"i","|":"abo","<":"menshe",">":"bilshe","â":"suma","¤":"valjuta"},vn:{"â":"delta","â":"vo cuc","â¥":"yeu","&":"va","|":"hoac","<":"nho hon",">":"lon hon","â":"tong","¤":"tien te"}},l=[";","?",":","@","&","=","+","$",",","/"].join(""),c=[";","?",":","@","&","=","+","$",","].join(""),u=[".","!","~","*","'","(",")"].join(""),h=function(g,m){var v="-",b="",y="",T=!0,S={},R,x,M,A,I,N,U,k,L,F,O,X,$,te,ue="";if(typeof g!="string")return"";if(typeof m=="string"&&(v=m),U=o.en,k=a.en,typeof m=="object"){R=m.maintainCase||!1,S=m.custom&&typeof m.custom=="object"?m.custom:S,M=+m.truncate>
11&&m.truncate||!1,A=m.uric||!1,I=m.uricNoSlash||!1,N=m.mark||!1,T=!(m.symbols===!1||m.lang===!1),v=m.separator||v,A&&(ue+=l),I&&(ue+=c),N&&(ue+=u),U=m.lang&&o[m.lang]&&T?o[m.lang]:T?o.en:{},k=m.lang&&a[m.lang]?a[m.lang]:m.lang===!1||m.lang===!0?{}:a.en,m.titleCase&&typeof m.titleCase.length=="number"&&Array.prototype.toString.call(m.titleCase)?(m.titleCase.forEach(function(xe){S[xe+""]=xe+""}),x=!0):x=!!m.titleCase,m.custom&&typeof m.custom.length=="number"&&Array.prototype.toString.call(m.custom)&&m.custom.forEach(function(xe){S[xe+""]=xe+""}),Object.keys(S).forEach(function(xe){var He;xe.length>1?He=new RegExp("\\b"+f(xe)+"\\b","gi"):He=new RegExp(f(xe),"gi"),g=g.replace(He,S[xe])});for(O in S)ue+=O}for(ue+=v,ue=f(ue),g=g.replace(/(^\s+|\s+$)/g,""),$=!1,te=!1,F=0,X=g.length;F<X;F++)O=g[F],p(O,S)?$=!1:k[O]?(O=$&&k[O].match(/[A-Za-z0-9]/)?" "+k[O]:k[O],$=!1):O in n?(F+1<X&&r.indexOf(g[F+1])>=0?(y+=O,O=""):te===!0?(O=s[y]+n[O],y=""):O=$&&n[O].match(/[A-Za-z0-9]/)?" "+n[O]:n[O],$=!1,te=!1):O in s?(y+=O,O="",F===X-1&&(O=s[y]),te=!0):U[O]&&!(A&&l.indexOf(O)!==-1)&&!(I&&c.indexOf(O)!==-1)?(O=$||b.substr(-1).match(/[A-Za-z0-9]/)?v+U[O]:U[O],O+=g[F+1]!==void 0&&g[F+1].match(/[A-Za-z0-9]/)?v:"",$=!0):(te===!0?(O=s[y]+O,y="",te=!1):$&&(/[A-Za-z0-9]/.test(O)||b.substr(-1).match(/A-Za-z0-9]/))&&(O=" "+O),$=!1),b+=O.replace(new RegExp("[^\\w\\s"+ue+"_-]","g"),v);return x&&(b=b.replace(/(\w)(\S*)/g,function(xe,He,Ke){var qe=He.toUpperCase()+(Ke!==null?Ke:"");return Object.keys(S).indexOf(qe.toLowerCase())<0?qe:qe.toLowerCase()})),b=b.replace(/\s+/g,v).replace(new RegExp("\\"+v+"+","g"),v).replace(new RegExp("(^\\"+v+"+|\\"+v+"+$)","g"),""),M&&b.length>M&&(L=b.charAt(M)===v,b=b.slice(0,M),L||(b=b.slice(0,b.lastIndexOf(v)))),!R&&!x&&(b=b.toLowerCase()),b},d=function(g){return function(v){return h(v,g)}},f=function(g){return g.replace(/[-\\^$*+?.()|[\]{}\/]/g,"\\$&")},p=function(_,g){for(var m in g)if(g[m]===_)return!0};if(typeof e<"u"&&e.exports)e.exports=h,e.exports.createSlug=d;else if(typeof define<"u"&&define.amd)define([],function(){return h});else try{if(t.getSlug||t.createSlug)throw"speakingurl: globals exists /(getSlug|createSlug)/";t.getSlug=h,t.createSlug=d}catch{}})(i)}));Ym(((i,e)=>{e.exports=kx()}))();Le.__VUE_DEVTOOLS_NEXT_APP_RECORD_INFO__??={id:0,appIds:new Set};function Vx(i){$t.highPerfModeEnabled=i??!$t.highPerfModeEnabled,!i&&mn.value&&lg(mn.value.app)}function zx(i){$t.devtoolsClientDetected={...$t.devtoolsClientDetected,...i},Vx(!Object.values($t.devtoolsClientDetected).some(Boolean))}Le.__VUE_DEVTOOLS_UPDATE_CLIENT_DETECTED__??=zx;var Hx=class{constructor(){this.keyToValue=new Map,this.valueToKey=new Map}set(i,e){this.keyToValue.set(i,e),this.valueToKey.set(e,i)}getByKey(i){return this.keyToValue.get(i)}getByValue(i){return this.valueToKey.get(i)}clear(){this.keyToValue.clear(),this.valueToKey.clear()}},cg=class{constructor(i){this.generateIdentifier=i,this.kv=new Hx}register(i,e){this.kv.getByValue(i)||(e||(e=this.generateIdentifier(i)),this.kv.set(e,i))}clear(){this.kv.clear()}getIdentifier(i){return this.kv.getByValue(i)}getValue(i){return this.kv.getByKey(i)}},Gx=class extends cg{constructor(){super(i=>i.name),this.classToAllowedProps=new Map}register(i,e){typeof e=="object"?(e.allowProps&&this.classToAllowedProps.set(i,e.allowProps),super.register(i,e.identifier)):super.register(i,e)}getAllowedProps(i){return this.classToAllowedProps.get(i)}};function Wx(i){if("values"in Object)return Object.values(i);const e=[];for(const t in i)i.hasOwnProperty(t)&&e.push(i[t]);return e}function Xx(i,e){const t=Wx(i);if("find"in t)return t.find(e);const n=t;for(let r=0;r<n.length;r++){const s=n[r];if(e(s))return s}}function Rs(i,e){Object.entries(i).forEach(([t,n])=>e(n,t))}function ul(i,e){return i.indexOf(e)!==-1}function Mf(i,e){for(let t=0;t<i.length;t++){const n=i[t];if(e(n))return n}}var qx=class{constructor(){this.transfomers={}}register(i){this.transfomers[i.name]=i}findApplicable(i){return Xx(this.transfomers,e=>e.isApplicable(i))}findByName(i){return this.transfomers[i]}};const $x=i=>Object.prototype.toString.call(i).slice(8,-1),ug=i=>typeof i>"u",Yx=i=>i===null,Na=i=>typeof i!="object"||i===null||i===Object.prototype?!1:Object.getPrototypeOf(i)===null?!0:Object.getPrototypeOf(i)===Object.prototype,oh=i=>Na(i)&&Object.keys(i).length===0,ji=i=>Array.isArray(i),Zx=i=>typeof i=="string",Kx=i=>typeof i=="number"&&!isNaN(i),Jx=i=>typeof i=="boolean",jx=i=>i instanceof RegExp,Da=i=>i instanceof Map,Oa=i=>i instanceof Set,hg=i=>$x(i)==="Symbol",Qx=i=>i instanceof Date&&!isNaN(i.valueOf()),ey=i=>i instanceof Error,Ef=i=>typeof i=="number"&&isNaN(i),ty=i=>Jx(i)||Yx(i)||ug(i)||Kx(i)||Zx(i)||hg(i),ny=i=>typeof i=="bigint",iy=i=>i===1/0||i===-1/0,ry=i=>ArrayBuffer.isView(i)&&!(i instanceof DataView),sy=i=>i instanceof URL,dg=i=>i.replace(/\./g,"\\."),ou=i=>i.map(String).map(dg).join("."),va=i=>{const e=[];let t="";for(let r=0;r<i.length;r++){let s=i.charAt(r);if(s==="\\"&&i.charAt(r+1)==="."){t+=".",r++;continue}if(s==="."){e.push(t),t="";continue}t+=s}const n=t;return e.push(n),e};function oi(i,e,t,n){return{isApplicable:i,annotation:e,transform:t,untransform:n}}const fg=[oi(ug,"undefined",()=>null,()=>{}),oi(ny,"bigint",i=>i.toString(),i=>typeof BigInt<"u"?BigInt(i):(console.error("Please add a BigInt polyfill."),i)),oi(Qx,"Date",i=>i.toISOString(),i=>new Date(i)),oi(ey,"Error",(i,e)=>{const t={name:i.name,message:i.message};return e.allowedErrorProps.forEach(n=>{t[n]=i[n]}),t},(i,e)=>{const t=new Error(i.message);return t.name=i.name,t.stack=i.stack,e.allowedErrorProps.forEach(n=>{t[n]=i[n]}),t}),oi(jx,"regexp",i=>""+i,i=>{const e=i.slice(1,i.lastIndexOf("/")),t=i.slice(i.lastIndexOf("/")+1);return new RegExp(e,t)}),oi(Oa,"set",i=>[...i.values()],i=>new Set(i)),oi(Da,"map",i=>[...i.entries()],i=>new Map(i)),oi(i=>Ef(i)||iy(i),"number",i=>Ef(i)?"NaN":i>0?"Infinity":"-Infinity",Number),oi(i=>i===0&&1/i===-1/0,"number",()=>"-0",Number),oi(sy,"URL",i=>i.toString(),i=>new URL(i))];function yc(i,e,t,n){return{isApplicable:i,annotation:e,transform:t,untransform:n}}const pg=yc((i,e)=>hg(i)?!!e.symbolRegistry.getIdentifier(i):!1,(i,e)=>["symbol",e.symbolRegistry.getIdentifier(i)],i=>i.description,(i,e,t)=>{const n=t.symbolRegistry.getValue(e[1]);
1if(!n)throw new Error("Trying to deserialize unknown symbol");return n}),ay=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce((i,e)=>(i[e.name]=e,i),{}),mg=yc(ry,i=>["typed-array",i.constructor.name],i=>[...i],(i,e)=>{const t=ay[e[1]];if(!t)throw new Error("Trying to deserialize unknown typed array");return new t(i)});function gg(i,e){return i?.constructor?!!e.classRegistry.getIdentifier(i.constructor):!1}const _g=yc(gg,(i,e)=>["class",e.classRegistry.getIdentifier(i.constructor)],(i,e)=>{const t=e.classRegistry.getAllowedProps(i.constructor);if(!t)return{...i};const n={};return t.forEach(r=>{n[r]=i[r]}),n},(i,e,t)=>{const n=t.classRegistry.getValue(e[1]);if(!n)throw new Error(`Trying to deserialize unknown class '${e[1]}' - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564`);return Object.assign(Object.create(n.prototype),i)}),vg=yc((i,e)=>!!e.customTransformerRegistry.findApplicable(i),(i,e)=>["custom",e.customTransformerRegistry.findApplicable(i).name],(i,e)=>e.customTransformerRegistry.findApplicable(i).serialize(i),(i,e,t)=>{const n=t.customTransformerRegistry.findByName(e[1]);if(!n)throw new Error("Trying to deserialize unknown custom value");return n.deserialize(i)}),oy=[_g,pg,vg,mg],Tf=(i,e)=>{const t=Mf(oy,r=>r.isApplicable(i,e));if(t)return{value:t.transform(i,e),type:t.annotation(i,e)};const n=Mf(fg,r=>r.isApplicable(i,e));if(n)return{value:n.transform(i,e),type:n.annotation}},xg={};fg.forEach(i=>{xg[i.annotation]=i});const ly=(i,e,t)=>{if(ji(e))switch(e[0]){case"symbol":return pg.untransform(i,e,t);case"class":return _g.untransform(i,e,t);case"custom":return vg.untransform(i,e,t);case"typed-array":return mg.untransform(i,e,t);default:throw new Error("Unknown transformation: "+e)}else{const n=xg[e];if(!n)throw new Error("Unknown transformation: "+e);return n.untransform(i,t)}},fs=(i,e)=>{if(e>i.size)throw new Error("index out of bounds");const t=i.keys();for(;e>0;)t.next(),e--;return t.next().value};function yg(i){if(ul(i,"__proto__"))throw new Error("__proto__ is not allowed as a property");if(ul(i,"prototype"))throw new Error("prototype is not allowed as a property");if(ul(i,"constructor"))throw new Error("constructor is not allowed as a property")}const cy=(i,e)=>{yg(e);for(let t=0;t<e.length;t++){const n=e[t];if(Oa(i))i=fs(i,+n);else if(Da(i)){const r=+n,s=+e[++t]==0?"key":"value",a=fs(i,r);switch(s){case"key":i=a;break;case"value":i=i.get(a);break}}else i=i[n]}return i},lh=(i,e,t)=>{if(yg(e),e.length===0)return t(i);let n=i;for(let s=0;s<e.length-1;s++){const a=e[s];if(ji(n)){const o=+a;n=n[o]}else if(Na(n))n=n[a];else if(Oa(n)){const o=+a;n=fs(n,o)}else if(Da(n)){if(s===e.length-2)break;const o=+a,l=+e[++s]==0?"key":"value",c=fs(n,o);switch(l){case"key":n=c;break;case"value":n=n.get(c);break}}}const r=e[e.length-1];if(ji(n)?n[+r]=t(n[+r]):Na(n)&&(n[r]=t(n[r])),Oa(n)){const s=fs(n,+r),a=t(s);s!==a&&(n.delete(s),n.add(a))}if(Da(n)){const s=+e[e.length-2],a=fs(n,s);switch(+r==0?"key":"value"){case"key":{const o=t(a);n.set(o,n.get(a)),o!==a&&n.delete(a);break}case"value":n.set(a,t(n.get(a)));break}}return i};function ch(i,e,t=[]){if(!i)return;if(!ji(i)){Rs(i,(s,a)=>
1ch(s,e,[...t,...va(a)]));return}const[n,r]=i;r&&Rs(r,(s,a)=>{ch(s,e,[...t,...va(a)])}),e(n,t)}function uy(i,e,t){return ch(e,(n,r)=>{i=lh(i,r,s=>ly(s,n,t))}),i}function hy(i,e){function t(n,r){const s=cy(i,va(r));n.map(va).forEach(a=>{i=lh(i,a,()=>s)})}if(ji(e)){const[n,r]=e;n.forEach(s=>{i=lh(i,va(s),()=>i)}),r&&Rs(r,t)}else Rs(e,t);return i}const dy=(i,e)=>Na(i)||ji(i)||Da(i)||Oa(i)||gg(i,e);function fy(i,e,t){const n=t.get(i);n?n.push(e):t.set(i,[e])}function py(i,e){const t={};let n;return i.forEach(r=>{if(r.length<=1)return;e||(r=r.map(o=>o.map(String)).sort((o,l)=>o.length-l.length));const[s,...a]=r;s.length===0?n=a.map(ou):t[ou(s)]=a.map(ou)}),n?oh(t)?[n]:[n,t]:oh(t)?void 0:t}const bg=(i,e,t,n,r=[],s=[],a=new Map)=>{const o=ty(i);if(!o){fy(i,r,e);const f=a.get(i);if(f)return n?{transformedValue:null}:f}if(!dy(i,t)){const f=Tf(i,t),p=f?{transformedValue:f.value,annotations:[f.type]}:{transformedValue:i};return o||a.set(i,p),p}if(ul(s,i))return{transformedValue:null};const l=Tf(i,t),c=l?.value??i,u=ji(c)?[]:{},h={};Rs(c,(f,p)=>
1{if(p==="__proto__"||p==="constructor"||p==="prototype")throw new Error(`Detected property ${p}. This is a prototype pollution risk, please remove it from your object.`);const _=bg(f,e,t,n,[...r,p],[...s,i],a);u[p]=_.transformedValue,ji(_.annotations)?h[p]=_.annotations:Na(_.annotations)&&Rs(_.annotations,(g,m)=>{h[dg(p)+"."+m]=g})});const d=oh(h)?{transformedValue:u,annotations:l?[l.type]:void 0}:{transformedValue:u,annotations:l?[l.type,h]:h};return o||a.set(i,d),d};function Sg(i){return Object.prototype.toString.call(i).slice(8,-1)}function wf(i){return Sg(i)==="Array"}function my(i){if(Sg(i)!=="Object")return!1;const e=Object.getPrototypeOf(i);return!!e&&e.constructor===Object&&e===Object.prototype}function gy(i,e,t,n,r){const s={}.propertyIsEnumerable.call(n,e)?"enumerable":"nonenumerable";s==="enumerable"&&(i[e]=t),r&&s==="nonenumerable"&&Object.defineProperty(i,e,{value:t,enumerable:!1,writable:!0,configurable:!0})}function uh(i,e={}){if(wf(i))return i.map(r=>uh(r,e));if(!my(i))return i;const t=Object.getOwnPropertyNames(i),n=Object.getOwnPropertySymbols(i);return[...t,...n].reduce((r,s)=>{if(wf(e.props)&&!e.props.includes(s))return r;const a=i[s];return gy(r,s,uh(a,e),i,e.nonenumerable),r},{})}var Pt=class{constructor({dedupe:i=!1}={}){this.classRegistry=new Gx,this.symbolRegistry=new cg(e=>e.description??""),this.customTransformerRegistry=new qx,this.allowedErrorProps=[],this.dedupe=i}serialize(i){const e=new Map,t=bg(i,e,this,this.dedupe),n={json:t.transformedValue};t.annotations&&(n.meta={...n.meta,values:t.annotations});const r=py(e,this.dedupe);return r&&(n.meta={...n.meta,referentialEqualities:r}),n}deserialize(i){const{json:e,meta:t}=i;let n=uh(e);return t?.values&&(n=uy(n,t.values,this)),t?.referentialEqualities&&(n=hy(n,t.referentialEqualities)),n}stringify(i){return JSON.stringify(this.serialize(i))}parse(i){return this.deserialize(JSON.parse(i))}registerClass(i,e){this.classRegistry.register(i,e)}registerSymbol(i,e){this.symbolRegistry.register(i,e)}registerCustom(i,e){this.customTransformerRegistry.register({name:e,...i})}allowErrorProps(...i){this.allowedErrorProps.push(...i)}};Pt.defaultInstance=new Pt;Pt.serialize=Pt.defaultInstance.serialize.bind(Pt.defaultInstance);Pt.deserialize=Pt.defaultInstance.deserialize.bind(Pt.defaultInstance);Pt.stringify=Pt.defaultInstance.stringify.bind(Pt.defaultInstance);Pt.parse=Pt.defaultInstance.parse.bind(Pt.defaultInstance);Pt.registerClass=Pt.defaultInstance.registerClass.bind(Pt.defaultInstance);Pt.registerSymbol=Pt.defaultInstance.registerSymbol.bind(Pt.defaultInstance);Pt.registerCustom=Pt.defaultInstance.registerCustom.bind(Pt.defaultInstance);Pt.allowErrorProps=Pt.defaultInstance.allowErrorProps.bind(Pt.defaultInstance);Le.__VUE_DEVTOOLS_KIT_MESSAGE_CHANNELS__??=[];Le.__VUE_DEVTOOLS_KIT_RPC_CLIENT__??=null;Le.__VUE_DEVTOOLS_KIT_RPC_SERVER__??=null;Le.__VUE_DEVTOOLS_KIT_VITE_RPC_CLIENT__??=null;Le.__VUE_DEVTOOLS_KIT_VITE_RPC_SERVER__??=null;Le.__VUE_DEVTOOLS_KIT_BROADCAST_RPC_SERVER__??=null;const _y={class:"flex items-center gap-7 text-active-primary"},vy=["aria-label"],xy={key:0,class:"flex items-center gap-7"},yy=Mt({name:"MdsLogo",__name:"logo",props:{ariaLabel:{default:"Adyen Logo"},tag:{default:""}},setup(i){return(e,t)=>(ae(),ht("span",_y,[(ae(),ht("svg",{width:"80",height:"26",viewBox:"0 0 80 26",fill:"currentColor",role:"img",xmlns:"http://www.w3.org/2000/svg","aria-label":e.ariaLabel},[Qe("title",null,_n(e.ariaLabel),1),t[0]||(t[0]=ev('<path d="M0 5.83333H11.6667C12.9558 5.83333 14 6.8775 14 8.16667V19.8333H2.33333C1.04417 19.8333 0 18.7892 0 17.5V11.6667H5.83333V16.3333H8.16667V9.33333H0V5.83333Z"></path><path d="M65.3334 5.83333V19.8333H71.1667V9.33333H73.5V19.8333H79.3334V8.16667C79.3334 6.8775 78.2892 5.83333 77 5.83333H65.3334Z"></path><path d="M32.6666 25.6667H44.3333C45.6225 25.6667 46.6666 24.6225 46.6666 23.3333V5.83333H40.8333V16.3333H38.5V5.83333H32.6666V17.5C32.6666 18.7892 33.7108 19.8333 35 19.8333H40.8333V22.1667H32.6666V25.6667Z"></path><path d="M63 19.8333H51.3333C50.0442 19.8333 49 18.7892 49 17.5V5.83333H60.6667C61.9558 5.83333 63 6.8775 63 8.16667V14H57.1667V9.33333H54.8333V16.3333H63V19.8333Z"></path>
1<path d="M30.3334 0V19.8333H18.6667C17.3775 19.8333 16.3334 18.7892 16.3334 17.5V8.16667C16.3334 6.8775 17.3775 5.83333 18.6667 5.83333H22.1667V16.3333H24.5V0H30.3334Z"></path>',5))],8,vy)),e.tag?(ae(),ht("span",xy,[t[1]||(t[1]=Qe("span",{"aria-hidden":"true",class:"h-15 w-1.5 bg-current"},null,-1)),Ce(zn,{variant:"mono",class:"text-main-solid"},{default:Be(()=>[On(_n(e.tag),1)]),_:1})])):xt("",!0)]))}}),VP=Mt({name:"MdsPageLayout",__name:"page-layout",props:{withHeaderPadding:{type:Boolean,default:!1}},setup(i){return(e,t)=>(ae(),ht("div",{class:"[--header-height:var(--sm)] md:[--header-height:var(--md)] lg:pointer:[--header-height:var(--lg)]",style:ws(re(Om))},[Ar(e.$slots,"header"),Qe("main",{class:Ot(["flex min-h-svh w-full flex-col",{"pt-(--header-height)":e.withHeaderPadding}])},[Ar(e.$slots,"default")],2),Ar(e.$slots,"footer")],4))}}),by={class:"sticky top-(--top-offset) self-start max-lg:hidden lg:col-span-4 lg:col-start-2"},Sy={"aria-label":"Locale switcher",class:"col-span-4"},My={class:"flex flex-col items-start gap-m"},Ey={class:"absolute top-(--grid-margin) right-(--grid-margin) left-(--grid-margin) max-lg:flex max-lg:items-center max-lg:justify-between"},Ty=Mt({name:"MdsFooterLocaleSwitcher",__name:"locale-switcher",props:{isOpen:{type:Boolean},activeLocale:{},localeSwitcher:{}},emits:["close"],setup(i,{emit:e}){const t=e,n=mt(null),r=Ze(()=>n.value?.scrollContainer??null),{scrollY:s}=Vm({container:r}),a=zm(s,[0,100],[1,0]),o={lg:"1.0546875rem",xl:"1.5rem"},l={"--pb-offset":`calc(50vh - var(--grid-margin) - ${o.lg})`,"--pb-offset-xl":`calc(50vh - var(--grid-margin) - ${o.xl})`},c={"--top-offset":"calc(50vh - var(--grid-margin))"},u={"--grid-width":"calc(100% + var(--grid-margin) * 2)"};return(h,d)=>(ae(),Xe(_v,{ref_key:"modalRef",ref:n,"is-open":h.isOpen,animation:"slide-up","data-theme":"light",onClose:d[1]||(d[1]=f=>
1t("close"))},{default:Be(()=>[Ce(Cs,{class:"relative w-full max-lg:pt-268 max-lg:pb-80 lg:-ml-(--grid-margin) lg:w-(--grid-width) lg:pt-(--top-offset) lg:pb-(--pb-offset) xl:pb-(--pb-offset-xl) 3xl:ml-auto",style:ws({...l,...c,...u})},{default:Be(()=>[Qe("div",by,[Ce(zn,{variant:"dangerouslyNotResponsive:Heading-S-To-Heading-M"},{default:Be(()=>[On(_n(h.localeSwitcher.title),1)]),_:1})]),Qe("nav",Sy,[Qe("ul",My,[(ae(!0),ht(en,null,Hn(h.localeSwitcher.items,(f,p)=>(ae(),Xe(re(At).li,{key:f.code,initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{...re(Wt),delay:-re(Wt).duration*.25+(h.localeSwitcher.items.length-1-p)*.03}},{default:Be(()=>[Ce(Ia,{href:f.href,class:Ot(["flex transition-colors",{"text-main-solid":f.code===h.activeLocale,"text-main-contrast-secondary hover:text-main-solid":f.code!==h.activeLocale}]),"tracking-data":{componentName:"MdsFooter",text:f.label,title:"Footer Locale Switcher"},onClick:d[0]||(d[0]=_=>t("close"))},{default:Be(()=>[Ce(zn,{variant:"dangerouslyNotResponsive:Heading-S-To-Heading-M"},{default:Be(()=>[On(_n(f.label),1)]),_:2},1024)]),_:2},1032,["href","class","tracking-data"])]),_:2},1032,["transition"]))),128))])])]),_:1},8,["style"]),Qe("div",Ey,[Ce(re(At).div,{style:ws({opacity:re(a)})},{default:Be(()=>[Ce(zn,{variant:"dangerouslyNotResponsive:Heading-S-To-Heading-M",class:"lg:hidden"},{default:Be(()=>[On(_n(h.localeSwitcher.title),1)]),_:1})]),_:1},8,["style"]),d[2]||(d[2]=Qe("div",{class:"size-l"},null,-1))])]),_:1},8,["is-open"]))}}),wy={class:"flex flex-col gap-y-15 max-lg:hidden"},Ay={class:"flex flex-col lg:hidden"},Cy={class:"pt-3xs pb-m"},Af=Mt({name:"MdsFooterNavigationColumn",__name:"navigation-column",props:{group:{}},setup(i){const e=mt(i.group.defaultExpanded??!1),t=()=>{e.value=!e.value};return(n,r)=>(ae(),ht("div",null,[Qe("div",wy,[Ce(Pa,{variant:"mono",text:n.group.label,"eyebrow-variant":"secondary"},null,8,["text"]),Ce(ml,{items:n.group.items,orientation:"vertical","tracking-data":{componentName:"MdsFooter",title:"Footer",text:n.group.label}},null,8,["items","tracking-data"])]),Qe("div",Ay,[Qe("button",{class:"ds-focusable flex items-center justify-between py-8 lg:hidden",onClick:t},[Ce(Pa,{variant:"mono",text:n.group.label,"eyebrow-variant":"secondary"},null,8,["text"]),Ce(re(At).span,{animate:{rotate:e.value?180:0},class:Ot(["block size-xs transition-colors duration-300 lg:hidden",[e.value?"text-active-primary":"text-main-contrast-primary"]])},{default:Be(()=>[Ce(Nr,{category:"Arrows",name:"ChevronDown"})]),_:1},8,["animate","class"])]),Ce(re(Cr),null,{default:Be(()=>[e.value?(ae(),Xe(re(At).div,{key:0,animate:{height:e.value?"auto":0,opacity:e.value?1:0},initial:{height:0,opacity:0},exit:{height:0,opacity:0,transition:{...re(Wt),duration:.3}}},{default:Be(()=>[Qe("div",Cy,[Ce(ml,{items:n.group.items,orientation:"vertical","tracking-data":{text:n.group.label,componentName:"MdsFooter",title:"Footer Mobile",level:2},variants:{hidden:{opacity:0,y:-10},show:{opacity:e.value?1:0,y:e.value?0:-10}}},null,8,["items","tracking-data","variants"])])]),_:1},8,["animate","exit"])):xt("",!0)]),_:1})])]))}}),Ry={class:"relative z-2 pt-2xl"},Iy={key:0,class:"col-span-full flex flex-col items-start gap-20 pt-72 md:gap-24 md:pt-88 lg:col-span-4 lg:col-start-7 lg:row-start-1 lg:pt-0"},Py={class:"relative z-2 col-span-full flex items-end justify-between"},Ly={class:"hidden items-end gap-s lg:flex"},Ny={class:"relative z-2 flex flex-col items-start justify-between gap-s gap-y-2xs sm:w-full sm:flex-row lg:w-fit"},Dy={class:"flex gap-1"},Zs="MdsFooter",Oy="dark",zP=Mt({name:Zs,__name:"footer",props:{navigationPrimary:{},navigationSecondary:{},socialLinks:{},newsletterLink:{},localeSwitcher:{},activeLocale:{}},setup(i){const e=new Date().getFullYear(),t=mt(!1),n=()=>{t.value=!t.value};return(r,s)=>(ae(),ht(en,null,[Qe("footer",{ref:"footerRef","data-theme":Oy,class:"relative flex min-h-svh w-full flex-col justify-between gap-4xl bg-main-surface text-main-solid md:gap-298 xl:gap-362"},[Qe("nav",Ry,[Ce(Cs,{class:"gap-y-0 lg:gap-y-m"},{default:Be(()=>[(ae(!0),ht(en,null,Hn(r.navigationPrimary,a=>(ae(),Xe(Af,{key:a.id,group:a,class:"col-span-full lg:col-span-3"},null,8,["group"]))),128)),Ce(Af,{group:r.navigationSecondary,class:"col-span-full lg:hidden"},null,8,["group"]),r.newsletterLink?.href?(ae(),ht("div",Iy,[r.newsletterLink.description?(ae(),Xe(Pa,{key:0,variant:"mono",text:r.newsletterLink.description,"eyebrow-variant":"secondary","start-
1delay":.1},null,8,["text"])):xt("",!0),Ce(ys,{is:"a",href:r.newsletterLink.href,label:r.newsletterLink.label,"tracking-data":{componentName:Zs,text:r.newsletterLink.label,title:"Footer Newsletter"},variant:"secondary"},null,8,["href","label","tracking-data"])])):xt("",!0)]),_:1})]),Ce(Cs,{class:"relative pb-s"},{default:Be(()=>[Ar(r.$slots,"secondary-footer"),Qe("div",Py,[Qe("div",Ly,[Ce(ml,{items:r.navigationSecondary.items,orientation:"horizontal","link-variant":"mono","tracking-data":{componentName:Zs},"menu-a11y":!0,class:"text-main-solid"},null,8,["items","tracking-data"]),Ce(Pa,{variant:"mono",text:`© ${re(e)} Adyen`,"text-class":"text-main-contrast-primary","start-delay":.1},null,8,["text"])]),Qe("div",Ny,[Qe("div",Dy,[(ae(!0),ht(en,null,Hn(r.socialLinks,a=>(ae(),Xe(ys,{is:"a",key:a.icon.name,href:a.href,target:"_blank","aria-label":a.ariaLabel,icon:a.icon,variant:"secondary","tracking-data":{componentName:Zs,text:a.ariaLabel,title:"Footer Social"}},null,8,["href","aria-label","icon","tracking-data"]))),128))]),Ce(ys,{label:r.localeSwitcher.items.find(a=>a.code===r.activeLocale)?.label,icon:{category:"Various",name:"Globe"},variant:"secondary","tracking-data":{componentName:Zs,text:r.localeSwitcher.items.find(a=>a.code===r.activeLocale)?.label,title:"Footer Locale Switcher"},onClick:n},null,8,["label","tracking-data"])])]),Ar(r.$slots,"legal-disclaimer")]),_:3})],512),Ce(Ty,{"is-open":t.value,"locale-switcher":r.localeSwitcher,"active-locale":r.activeLocale,onClose:s[0]||(s[0]=a=>t.value=!1)},null,8,["is-open","locale-switcher","active-locale"])],64))}}),Cf={mobile:1.25,desktop:1.5};function Jh(i){return"toLabel"in i||"items"in i&&"text"in i}function jh(i){return"items"in i&&!("text"in i)}function Mg(i){return"href"in i&&!!i.href}function Zn(i){return jh(i)||Jh(i)}function no(i){return jh(i)?"progressive":Jh(i)?"single":"direct"}function Qh(i){return jh(i)?i.items:Jh(i)?[i]:[]}function xl(i,e,t){return t&&e?`${i} > ${e} > ${t}`:e?`${i} > ${e}`:i}const Uy=Mt({name:"MdsHeaderBackButton",__name:"back-button",props:{items:{},active:{},activeTopic:{default:""}},emits:["click"],setup(i){const e={initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0}},t=Ze(()=>i.items.find(s=>s.id===i.active)),n=Ze(()=>{const s=t.value;if(s)return i.activeTopic?Qh(s).find(o=>o.id===i.activeTopic)?.label??s.label:s.label}),r=Ze(()=>{const s=t.value;return s?i.activeTopic?`Back to ${s.label}`:"Back to main menu":"Back"});return(s,a)=>(ae(),Xe(re(At).div,{variants:e,initial:"initial",animate:"animate",exit:"exit",class:"flex"},{default:Be(()=>[Ce(bs,{is:"button",variant:"link-m",label:n.value,"aria-label":r.value,icon:{category:"Arrows",name:"ChevronLeft"},"tracking-data":{componentName:"MdsHeaderNavigation",text:n.value},onClick:a[0]||(a[0]=o=>s.$emit("click"))},{default:Be(()=>[On(_n(n.value),1)]),_:1},8,["label","aria-label","tracking-data"])]),_:1}))}}),Fy={class:"relative flex h-full"},By=["aria-label"],ky=Mt({name:"MdsHeaderBurgerMenu",__name:"burger-menu",props:{isOpen:{type:Boolean},label:{}},emits:["click"],setup(i){return(e,t)=>(ae(),ht("div",Fy,[Qe("button",{class:"flex items-center px-s text-main-solid dark:text-main-surface","aria-label":e.label,onClick:t[0]||(t[0]=n=>e.$emit("click"))},[Ce(Nr,{category:e.isOpen?"Interface":"Interface-16",name:e.isOpen?"Cross":"MenuSmall"},null,8,["category","name"])],8,By)]))}}),Rf=Mt({name:"MdsHeaderLogo",__name:"logo",props:{href:{default:"/"},logoTag:{default:""}},setup(i){const e={initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0}};return(t,n)=>(ae(),Xe(re(At).div,{layout:"",variants:e,initial:!1,animate:"animate",exit:"exit",class:"flex"},{default:Be(()=>[Ce(Ia,{href:t.href,"aria-label":"Go to homepage",class:"flex","tracking-data":{componentName:"MdsHeaderLogo",text:"logo",id:"logo"}},{default:Be(()=>[Ce(yy,{tag:t.logoTag},null,8,["tag"])]),_:1},8,["href"])]),_:1}))}}),ed=Symbol("headerMenuFocus");function Vy(){const i=new Map;let e=null;return{register(t,n){i.set(t,n),e===t&&(e=null,n())},unregister(t){i.delete(t),e===t&&(e=null)},focusInitial(t){const n=i.get(t);if(n){n();return}e=t}}}const zy=Mt({name:"MdsHeaderNavigationItem",__name:"item",props:{item:{},index:{},activeItem:{},trackingData:{}},emits:["mouseenter","mouseleave","focusin","focusout","toggle-submenu"],setup(i,{emit:e}){const t=Ze(()=>Zn(i.item)),n=Ze(()=>no(i.item)),r=Ze(()=>Mg(i.item)?i.item.href:null),s=e,a=kh(ed,null),o=()=>{if(t.value){if(c.value){s("toggle-submenu","");return}s("toggle-submenu",i.item.id),a?.focusInitial(i.item.id)}},l=Ze(()=>i.activeItem!==""),c=Ze(()=>i.activeItem===i.item.id);return(u,h)=>(ae(),ht("li",null,[(ae(),Xe(Fm(t.value?"button":Ia),{"aria-controls":t.value?`menu-${u.item.id}`:void 0,"aria-expanded":t.value?c.value?"true":"false":void 0,"aria-haspopup":t.value?"menu":void 0,class:Ot(["ds-focusable flex items-center gap-3xs p-2xs text-current transition-opacity focus-visible:opacity-100 max-md:hidden",l.value?c.value?"opacity-100":"opacity-(--color-black-1800-opacity) group-hover:opacity-(--color-black-1800-opacity) hover:opacity-100":"group-hover:opacity-(--color-black-1800-opacity) hover:opacity-100",u.index===0&&"-ml-2xs"]),href:r.value,role:t.value?"menuitem":void 0,"tracking-data":t.value?void 0:{componentName:"MdsHeaderNavigation",text:u.item.label,level:1},"data-track-component-name":t.value?"MdsHeaderNavigation":void 0,"data-track-text":t.value?u.trackingData.text:void 0,"data-track-level":t.value?1:void 0,"data-track-navigation-mode":t.value?n.value:void 0,onFocusin:h[0]||(h[0]=d=>u.$emit("focusin")),onFocusout:h[1]||(h[1]=d=>u.$emit("focusout")),onMouseenter:h[2]||(h[2]=d=>u.$emit("mouseenter")),onMouseleave:h[3]||(h[3]=d=>u.$emit("mouseleave")),onKeydown:Um(o,["enter"])},{default:Be(()=>[Ce(zn,{is:"span",variant:"link-m"},{default:Be(()=>[On(_n(u.item.label),1)]),_:1})]),_:1},40,["aria-controls","aria-expanded","aria-haspopup","class","href","role","tracking-data","data-track-component-name","data-track-text","data-track-level","data-track-navigation-mode"]))]))}}),Hy={role:"menubar","aria-label":"Main navigation",class:"flex items-center"},Gy=Mt({name:"MdsHeaderNavigation",__name:"navigation",props:{items:{},active:{}},emits:["update:active"],setup(i,{emit:e}){const t=e,n=s=>{const a=i.items[s];a&&Zn(a)?t("update:active",a.id):t("update:active","")},r=s=>{t("update:active",s)};return(s,a)=>(ae(),Xe(re(At).nav,{initial:{opacity:0}
1,animate:{opacity:1,transition:{duration:.2,delay:.1,ease:"linear"}},exit:{opacity:0,transition:{duration:.1,delay:0,ease:"linear"}},class:"group noscript:opacity-100!"},{default:Be(()=>[Qe("ul",Hy,[(ae(!0),ht(en,null,Hn(s.items,(o,l)=>(ae(),Xe(zy,{key:o.id,item:o,index:l,"active-item":s.active,"tracking-data":{componentName:"MdsHeaderNavigation",text:o.label},onMouseenter:c=>n(l),onToggleSubmenu:r},null,8,["item","index","active-item","tracking-data","onMouseenter"]))),128))])]),_:1}))}}),Wy={class:"relative hidden h-full 3xl:mr-(--container-max-width-px-gap) lg:pointer:flex 3xl:touch:mr-0"},Xy={class:"flex items-center pr-s"},qy=["aria-label"],$y=Mt({name:"MdsHeaderSecondaryNavigation",__name:"secondary",props:{isReduced:{type:Boolean},isTransparent:{type:Boolean},isActive:{type:Boolean},secondary:{}},emits:["update:search"],setup(i){return(e,t)=>(ae(),ht("div",Wy,[Qe("div",Xy,[e.secondary.search||e.secondary.account?(ae(),Xe(re(At).div,{key:0,animate:{opacity:e.isReduced?0:1},class:"group flex items-center"},{default:Be(()=>[e.secondary.search?.label?(ae(),ht("button",{key:0,"aria-label":e.secondary.search.label,class:"ds-focusable px-s py-2xs text-current transition-opacity duration-200 group-hover:opacity-(--color-black-1800-opacity) hover:opacity-100","data-track-component-name":"MdsHeaderNavigation","data-track-text":"search","data-track-id":"search","data-track-level":"1",onClick:t[0]||(t[0]=n=>e.$emit("update:search",!0))},[Ce(Nr,{category:"Interface",name:"Search"})],8,qy)):xt("",!0),Ce(zh,{orientation:"vertical",variant:e.isTransparent&&!e.isActive?"secondary":"primary"},null,8,["variant"]),e.secondary.account?.href?(ae(),Xe(Ia,{key:1,href:e.secondary.account.href,"aria-label":e.secondary.account.label,class:"ds-focusable px-s py-2xs text-current transition-opacity duration-200 group-hover:opacity-(--color-black-1800-opacity) hover:opacity-100","tracking-data":{componentName:"MdsHeaderNavigation",text:"login",id:"login",level:1}},{default:Be(()=>[Ce(Nr,{category:"Interface",name:"PersonCircle"})]),_:1},8,["href","aria-label"])):xt("",!0)]),_:1},8,["animate"])):xt("",!0),e.secondary.contact?.href?(ae(),Xe(ys,{key:1,is:"a",class:Ot(["pointer-events-auto",{"focus-visible:outline-white":e.isTransparent&&!e.isActive}]),href:e.secondary.contact.href,label:e.secondary.contact.label,"tracking-data":{componentName:"MdsHeaderNavigation",text:e.secondary.contact.label,id:"contact",level:1}},null,8,["href","label","tracking-data","class"])):xt("",!0),e.secondary.link?.url?(ae(),Xe(Ia,{key:2,href:e.secondary.link.url,class:"ds-focusable px-s py-2xs text-current transition-opacity duration-200 group-hover:opacity-(--color-black-1800-opacity) hover:opacity-100","tracking-data":{componentName:"MdsHeaderNavigation",text:e.secondary.link.title,level:1}},{default:Be(()=>[Ce(zn,{is:"span",variant:"link-m"},{default:Be(()=>[On(_n(e.secondary.link.title),1)]),_:1})]),_:1},8,["href","tracking-data"])):xt("",!0)])]))}}),Yy={class:"relative flex items-center"},Zy={class:"pointer-events-auto hidden lg:pointer:flex"},Ky={class:"relative grid lg:pointer:hidden"},Jy={class:"hidden items-center gap-s lg:pointer:flex"},jy={class:"grid grid-cols-1 grid-rows-1 items-center"},Qy=Mt({name:"MdsHeaderElement",__name:"element",props:{items:{},state:{},secondary:{},isInstantAnimation:{type:Boolean,default:!1},logoTag:{default:""},logoHref:{}},emits:["update:active","update:activeTopic","update:mobile","update:reduced","update:direction","update:search"],setup(i,{emit:e}){const t=e,n=()=>{if(i.state.activeTopic){t("update:activeTopic","");return}t("update:active","")},r=Bs(ks),s=r.greaterOrEqual("lg"),a=r.greaterOrEqual("xl"),o=Ze(()=>a.value?Cf.desktop:Cf.mobile),l=Ze(()=>i.state.reduced&&i.state.active===""),c=Ze(()=>!i.state.transparent&&!l.value||i.state.active!==""),u=Ze(()=>!s.value&&i.state.mobile),h=()=>{i.state.mobile&&t("update:active",""),t("update:mobile",!i.state.mobile)},d=()=>{if(s.value){if(i.state.active!=="")return;t("update:direction","up"),t("update:reduced",!1)}},f=mt(null);_f(f,"mouseenter",d),_f(f,"focusin",d),vv(()=>i.state.active!==""||i.state.mobile);const p=()=>{t("update:active","")};return(_,g)=>(ae(),ht("header",{class:Ot(["absolute z-200 flex h-(--header-height) items-center justify-between bg-white [--reduced-y:calc(var(--base-spacing)*0.25)] xl:[--reduced-y:calc(var(--base-spacing)*0.5)] n
1oscript:transform-none! noscript:opacity-100! lg:pointer:bg-transparent 3xl:touch:right-(--container-max-width-px) 3xl:touch:left-(--container-max-width-px)",[_.state.fixedLayout?"top-(--grid-margin) right-(--grid-margin) left-(--grid-margin) rounded-m lg:pointer:top-0 lg:pointer:right-0 lg:pointer:left-0":"top-0 right-0 left-0",_.state.search||_.state.reduced?"pointer-events-auto lg:pointer-events-none":"pointer-events-auto",_.state.search?"opacity-0":"opacity-100",l.value?"lg:translate-y-(--reduced-y)":_.state.hidden?"-translate-y-full":"translate-y-0",_.isInstantAnimation?"duration-0":"motion-transition"]]),tabindex:"0",onKeydown:Um(p,["escape"])},[Qe("div",{class:Ot(["absolute inset-0 hidden overflow-clip lg:pointer:flex",[_.state.fixedLayout&&"rounded-m lg:pointer:rounded-none","transition-transform motion-transition",c.value?"translate-y-0":"-translate-y-full"]])},[Qe("div",{class:Ot(["absolute inset-0 flex bg-white",["transition-transform motion-transition",c.value?"translate-y-0":"-translate-y-12"]])},null,2)],2),_.state.position==="fixed"?(ae(),ht("div",{key:0,class:Ot(["absolute inset-0 rounded-m border border-black-200 transition-opacity lg:pointer:hidden",u.value?"opacity-0 duration-100":"duration-400 delay-200"])},null,2)):xt("",!0),Qe("div",{class:Ot(["absolute -right-(--grid-margin) bottom-0 -left-(--grid-margin) border-b border-black-200 lg:pointer:hidden",u.value?"opacity-100 duration-100 delay-200":"opacity-0"])},null,2),Qe("div",{ref_key:"menuHoverRegion",ref:f,class:Ot(["relative flex h-full items-center md:h-48 3xl:ml-(--container-max-width-px-gap) 3xl:touch:ml-0",["motion-transition",l.value?"lg:translate-x-s":""]])},[Ce(re(Cr),null,{default:Be(()=>[l.value?(ae(),Xe(re(At).div,{key:0,initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0},transition:{...re(Wt)},class:"absolute top-0 right-0 bottom-0 left-0 hidden w-177 rounded-m border border-black-200 bg-white lg:flex xl:w-193"},null,8,["transition"])):xt("",!0)]),_:1}),Qe("div",Yy,[Ce(re(At).div,{class:"relative flex min-h-full items-center gap-s px-s",animate:{x:_.state.position==="fixed"&&u.value&&_.state.fixedLayout?`-${o.value}rem`:0}},{default:Be(()=>[Qe("div",Zy,[Ce(Rf,{"logo-tag":_.logoTag,href:_.logoHref},null,8,["logo-tag","href"])]),Qe("div",Ky,[Ce(re(At).div,{class:"relative flex area noscript:opacity-100!",initial:{opacity:0},animate:{opacity:_.state.active!==""?0:1,transition:{...re(Wt),delay:_.state.active!==""?0:.2}},exit:{opacity:0}},{default:Be(()=>[Ce(Rf,{"logo-tag":_.logoTag,href:_.logoHref},null,8,["logo-tag","href"])]),_:1},8,["animate"]),Ce(re(Cr),null,{default:Be(()=>[_.state.active!==""?(ae(),Xe(re(At).div,{key:0,class:"relative flex area",initial:{opacity:0},animate:{opacity:1,transition:{...re(Wt),delay:.2}},exit:{opacity:0}},{default:Be(()=>[Ce(Uy,{active:_.state.active,"active-topic":_.state.activeTopic,items:_.items,onClick:n},null,8,["active","active-topic","items"])]),_:1},8,["animate"])):xt("",!0)]),_:1})]),Qe("div",Jy,[Ce(zh,{orientation:"vertical",class:"max-md:hidden",variant:_.state.transparent&&!_.state.active?"secondary":"primary"},null,8,["variant"]),Qe("div",jy,[Ce(re(Cr),{mode:"wait",initial:!1},{default:Be(()=>[l.value?(ae(),Xe(re(At).button,{key:"menu-button",initial:{opacity:0}
1,animate:{opacity:1,transition:{duration:.2,delay:.05,ease:"linear"}},exit:{opacity:0,transition:{duration:.1,delay:0,ease:"linear"}},class:"pointer-events-auto col-start-1 row-start-1 hidden items-center lg:flex"},{default:Be(()=>[Ce(Nr,{category:"Interface",name:"Menu"})]),_:1})):(ae(),Xe(Gy,{key:"navigation",items:_.items,active:_.state.active,class:"col-start-1 row-start-1 transition-colors duration-300 ease-linear max-md:hidden","onUpdate:active":g[0]||(g[0]=m=>_.$emit("update:active",m))},null,8,["items","active"]))]),_:1})])])]),_:1},8,["animate"])])],2),Ce(re(At).div,{class:"relative flex h-full lg:pointer:hidden",animate:{x:_.state.position==="fixed"&&u.value&&_.state.fixedLayout?`${o.value}rem`:0}},{default:Be(()=>[Ce(ky,{"is-open":_.state.mobile,label:_.state.mobile?"Close Menu":"Open Menu",onClick:h},null,8,["is-open","label"])]),_:1},8,["animate"]),Ce($y,{"is-reduced":l.value,"is-transparent":_.state.transparent,"is-active":_.state.active!=="",secondary:_.secondary,"onUpdate:search":g[1]||(g[1]=m=>_.$emit("update:search",m))},null,8,["is-reduced","is-transparent","is-active","secondary"])],34))}}),eb=Mt({name:"MdsHeaderPointerBackground",__name:"background",props:{state:{},height:{},vars:{}},setup(i){const e=Bs(ks),t=Ze(()=>i.state.transparent?i.vars[e.active().value]:0),n=Ze(()=>{const r=i.height+t.value;return r?r/100:1});return(r,s)=>(ae(),Xe(re(At).div,{class:Ot(["absolute right-0 left-0 hidden h-100 origin-top transform-[scaleY(0)] bg-white will-change-transform lg:pointer:flex",[r.state.transparent?"top-0":"top-(--header-height)"]]),initial:{scaleY:0},animate:{scaleY:n.value},exit:{scaleY:0},transition:{...re(Wt)}},null,8,["class","animate","transition"]))}}),tb={class:"flex items-center gap-2xs transition-opacity duration-200 group-focus-within:opacity-100 group-hover:opacity-100 lg:pointer:opacity-0"},Eg=Mt({name:"MdsHeaderItemsCategories",__name:"categories",props:{categories:{},trackingData:{}},setup(i){function e(n){return n.items.map(r=>({id:r.id,label:r.title,href:r.url,description:r.text,nuxt:r.nuxt}))}const t=Vs();return(n,r)=>(ae(),Xe(re(At).div,{initial:{opacity:0}
1,animate:{opacity:1,transition:{...re(Wt),delay:re(t)?0:.05}},class:"flex flex-col gap-l"},{default:Be(()=>[(ae(!0),ht(en,null,Hn(n.categories,(s,a)=>(ae(),Xe(re(At).div,{key:s.label,role:"group","aria-label":s.label,initial:{opacity:re(t)?1:0,filter:re(t)?"none":"blur(2px)"},animate:{opacity:1,filter:"none",transition:{...re(Wt),delay:re(t)?0:a*.175}},class:"flex flex-col gap-m md:gap-s"},{default:Be(()=>[Ce(Pa,{variant:"mono",text:s.label,"eyebrow-variant":"secondary","start-delay":re(t)?0:a*.175},null,8,["text","start-delay"]),Ce(ml,{items:e(s),orientation:"vertical","link-variant":"link-l","menu-a11y":!0,"tracking-data":{componentName:"MdsHeaderNavigation",level:n.trackingData.level??2,text:`${n.trackingData.text} > ${s.label}`},"class-names":{listItem:"flex-col lg:pointer:flex-row lg:pointer:items-center gap-y-2xs",link:"touch:py-0!"},class:"max-lg:gap-y-s touch:gap-y-s","delay-children":re(t)?0:.1+a*.175,"stagger-children":re(t)?0:.04,variants:{hidden:{opacity:0,y:3},show:{opacity:1,y:0}}},{default:Be(({item:o})=>[Qe("div",tb,[Ce(zh,{orientation:"vertical",class:"hidden lg:pointer:flex"}),Ce(zn,{variant:"body",class:"text-black-1900"},{default:Be(()=>[On(_n(o.description),1)]),_:2},1024)])]),_:2},1032,["items","tracking-data","delay-children","stagger-children"])]),_:2},1032,["aria-label","initial","animate"]))),128))]),_:1},8,["animate"]))}}),nb=["aria-pressed","data-track-component-name","data-track-text","data-track-level","data-track-id","data-navigation-topic"],ib={class:"flex items-center justify-between gap-3xs md:justify-start"},rb={key:1,class:"flex w-full flex-col gap-s"},hh=Mt({name:"MdsHeaderNavigationTopic",__name:"topic",props:{topic:{},interactive:{type:Boolean,default:!1},selected:{type:Boolean,default:!1},hasActiveTopic:{type:Boolean,default:!1},shouldClickToSelect:{type:Boolean,default:!1},trackingData:{}},emits:["select"],setup(i,{emit:e}){const t=Bs(ks),n=e,r=t.greaterOrEqual("lg"),s=Ze(()=>i.hasActiveTopic&&!i.selected),a=()=>{i.shouldClickToSelect||r.value&&o()},o=()=>{n("select",i.topic.id)},l=c=>{i.shouldClickToSelect||c.target===c.currentTarget&&o()};return(c,u)=>(ae(),Xe(re(At).div,{initial:{opacity:0}
1,animate:{opacity:1,transition:{...re(Wt),delay:.1}},exit:{opacity:0},class:Ot(["flex flex-col gap-s",c.interactive?"w-full md:pr-l":"max-w-325"])},{default:Be(()=>[c.interactive?(ae(),ht("button",{key:0,type:"button",class:Ot(["ds-focusable flex w-full flex-col gap-s text-left transition-opacity",[!c.hasActiveTopic&&"opacity-100",c.hasActiveTopic&&c.selected&&"opacity-100",s.value&&"opacity-(--color-black-1800-opacity)"]]),"aria-pressed":c.selected?"true":"false",role:"menuitem","data-track-component-name":c.trackingData.componentName,"data-track-text":c.trackingData.text,"data-track-level":c.trackingData.level,"data-track-id":c.topic.id,"data-navigation-topic":c.topic.id,onClick:tv(o,["prevent"]),onMouseenter:a,onFocusin:l},[Qe("div",ib,[Ce(zn,{is:"span",variant:"link-l",class:Ot([c.selected||!c.hasActiveTopic?"text-black":"text-current/45"])},{default:Be(()=>[On(_n(c.topic.label),1)]),_:1},8,["class"]),Ce(Nr,{category:"Arrows",name:"ChevronRight",class:Ot(["mt-2 shrink-0",[c.selected?"text-green":s.value?"text-current/45":"text-black"]])},null,8,["class"])]),Ce(zn,{variant:"body",class:Ot([s.value?"text-current/45":"text-black-1900"])},{default:Be(()=>[On(_n(c.topic.text),1)]),_:1},8,["class"])],42,nb)):(ae(),ht("div",rb,[Ce(zn,{is:"h2",variant:"heading-s",class:"text-black"},{default:Be(()=>[On(_n(c.topic.label),1)]),_:1}),Ce(zn,{variant:"body",class:"text-black-1900"},{default:Be(()=>[On(_n(c.topic.text),1)]),_:1})]))]),_:1},8,["animate","class"]))}}),sb={class:"relative h-auto w-full"},ab={class:"flex w-full flex-col gap-l"},ob=Mt({name:"MdsHeaderPointerContent",__name:"content",props:{item:{},notEnoughSpaceAtBottom:{type:Boolean},activeTopic:{}},emits:["update:activeTopic"],setup(i,{emit:e}){const t=e,n=Ze(()=>Qh(i.item)),r=Ze(()=>no(i.item)),s=Ze(()=>r.value==="progressive"),a=Ze(()=>s.value?n.value.find(d=>d.id===i.activeTopic):n.value[0]),o=Ze(()=>!!a.value?.items?.length),l=Ze(()=>{const d=a.value;return d?s.value?{text:xl(i.item.label,d.label),level:3}:{text:i.item.label,level:2}:{text:i.item.label}}),c=d=>{t("update:activeTopic",d)};jt(()=>i.item.id,(d,f)=>{f!==void 0&&t("update:activeTopic","")});const u={"--max-container-height":"calc(100vh - var(--header-height) - var(--spacing) * 72)"},h=Vs();return(d,f)=>(ae(),ht("div",sb,[Ce(Cs,{class:"w-full items-start pt-xl pb-2xl"},{default:Be(()=>[Qe("div",{class:Ot(["col-span-4 flex flex-col",s.value?"gap-2xl":"md:max-w-325"])},[s.value?(ae(!0),ht(en,{key:0},Hn(n.value,p=>(ae(),Xe(hh,{key:p.id,topic:p,interactive:"",selected:d.activeTopic===p.id,"has-active-topic":!!d.activeTopic,"should-click-to-select":n.value.length>1,"tracking-data":{componentName:"MdsHeaderNavigation",text:re(xl)(d.item.label,p.label),level:2,id:p.id},onSelect:c},null,8,["topic","selected","has-active-topic","should-click-to-select","tracking-data"]))),128)):a.value?(ae(),Xe(hh,{key:1,topic:a.value,"tracking-data":{componentName:"MdsHeaderNavigation",text:d.item.label,level:1}},null,8,["topic","tracking-data"])):xt("",!0)],2),o.value?(ae(),ht("div",{key:0,class:Ot(["col-span-8 flex h-fit max-h-(--max-container-height)",{"overflow-y-auto":d.notEnoughSpaceAtBottom}]),style:u},[Qe("div",ab,[a.value?.items?(ae(),Xe(Eg,{key:`${d.item.id}-${a.value.id}-categories`,categories:a.value.items,"tracking-data":l.value},null,8,["categories","tracking-data"])):xt("",!0),a.value?.href&&a.value?.toLabel?(ae(),Xe(re(At).div,{key:`${d.item.id}-${a.value.id}-toLabel`,initial:{opacity:re(h)?1:0,filter:re(h)?"none":"blur(2px)"},animate:{opacity:1,filter:"none",transition:{...re(Wt),delay:re(h)?0:(a.value.items.length+1)*.175}},class:"flex"},{default:Be(()=>[Ce(bs,{label:a.value.toLabel,href:a.value.href,variant:"link-m",icon:{category:"Arrows",name:"ArrowRight"},"icon-position":"right","tracking-data":{componentName:"MdsHeaderNavigation",text:a.value.toLabel}},null,8,["label","href","tracking-data"])]),_:1},8,["initial","animate"])):xt("",!0)])],2)):xt("",!0)]),_:1})]))}}),lb=["id","aria-label"],cb={class:"relative flex w-full"},ub=Mt({name:"MdsHeaderPointerSubMenus",__name:"sub-menu",props:{active:{},item:{},notEnoughSpaceAtBottom:{type:Boolean},activeTopic:{}},emits:["close","height-change","update:activeTopic","panel-leave"],setup(i,{expose:e,emit:t}){const n=nv("el"),{height:r}=mv(n),s=t;function a(){return no(i.item)==="progressive"}function o(){return n.value?Array.from(n.value.querySelectorAll("[data-navigation-topic]")):[]}function l(){return n.value?Array.from(n.value.querySelectorAll('a[role="menuitem"]')):[]}function c(){return n.value?a()?[...o(),...l()]:Array.from(n.value.querySelectorAll('[role="menuitem"]')):[]}function u(x){const M=c(),A=x?M.indexOf(x):-1;M.forEach((I,N)=>{I.setAttribute("tabindex",N===A?"0":"-1")})}function h(){if(!n.value)return;const x=c();if(x.length===0)return;const M=document.activeElement,A=M&&x.includes(M)?M:null;if(A){u(A);return}const I=i.activeTopic?x.find(N=>N.dataset.navigationTopic===i.activeTopic):void 0;u(I??x[0])}function d(x){const M=x.dataset.navigationTopic;M&&s("update:activeTopic",M)}function f(){const x=o().find(M=>M.dataset.navigationTopic===i.activeTopic);x?.focus(),u(x)}function p(){ma(()=>{const x=l()[0];x?.focus(),u(x)})}function _(){document.querySelector(`[aria-controls="menu-${i.active}"]`)?.focus()}function g(x,M,A){const I=x.indexOf(M);if(I<0)return;const N=(I+A+x.length)%x.length,U=x[N];U?.focus(),u(U)}function m(){if(a()){const x=o()[0];x?.dataset.navigationTopic&&s("update:activeTopic",x.dataset.navigationTopic)}ma(()=>{h();const x=a()?o()[0]:c()[0];x?.focus(),u(x)})}e({focusFirstMenuItem:m});const v=kh(ed,null);Di(()=>{v?.register(i.active,m)}),Ji(()=>{v?.unregister(i.active)});function b(x,M){const A=o(),I=l(),N=M.hasAttribute("data-navigation-topic"),U=M.tagName==="A";
1if(x.shiftKey){if(U){x.preventDefault();const k=I.indexOf(M);if(k<=0){f();return}const L=I[k-1];L?.focus(),u(L);return}if(N){const k=A.indexOf(M);if(k<=0){x.preventDefault(),_(),s("close");return}x.preventDefault();const L=A[k-1];L?.focus(),A.length===1&&d(L),u(L)}return}if(N){if(x.preventDefault(),A.length===1&&d(M),I.length>0){p();return}const k=A.indexOf(M),L=A[k+1];if(L){L.focus(),A.length===1&&d(L),u(L);return}s("close");return}if(U){const k=I.indexOf(M);if(k>=I.length-1){s("close");return}x.preventDefault();const L=I[k+1];L?.focus(),u(L)}}function y(x,M,A){if(x.shiftKey&&M===0){x.preventDefault(),_(),s("close");return}if(!x.shiftKey&&M===A.length-1){s("close");return}if(x.preventDefault(),x.shiftKey){const N=A[M-1];N?.focus(),u(N);return}const I=A[M+1];I?.focus(),u(I)}function T(x){if(x.key==="Escape"){_(),s("close"),x.preventDefault();return}const M=c();if(M.length===0)return;const A=document.activeElement;if(!A||!M.includes(A))return;const I=M.indexOf(A),N=A.hasAttribute("data-navigation-topic"),U=A.tagName==="A";
1switch(x.key){case"Tab":{if(a()){b(x,A);break}y(x,I,M);break}case"ArrowDown":{if(x.preventDefault(),a()&&N){g(o(),A,1);break}if(a()&&U){g(l(),A,1);break}g(M,A,1);break}case"ArrowUp":{if(x.preventDefault(),a()&&N){g(o(),A,-1);break}if(a()&&U){g(l(),A,-1);break}g(M,A,-1);break}case"ArrowRight":{if(!a()||!N)break;x.preventDefault(),d(A),p();break}case"ArrowLeft":{if(!a()||!U)break;x.preventDefault(),f();break}case"Home":{x.preventDefault();const k=M[0];k?.focus(),u(k);break}case"End":{x.preventDefault();const k=M[M.length-1];k?.focus(),u(k);break}case"Enter":case" ":{if(!N&&!U)break;if(x.preventDefault(),A.click(),N&&a()){p();break}U&&s("close");break}default:if(x.key.length===1&&!x.ctrlKey&&!x.metaKey&&!x.altKey){const k=x.key.toLowerCase(),L=a()&&U?l():a()&&N?o():M,F=L.indexOf(A),O=F<0?0:F+1;for(let X=0;X<L.length;X++){const $=(O+X)%L.length;if((L[$].textContent??"").trim().toLowerCase().startsWith(k)){x.preventDefault(),L[$]?.focus(),u(L[$]);break}}}}}function S(x){if(!n.value)return;const M=x.relatedTarget;if(M&&n.value.contains(M))return;const A=document.querySelector('[data-component="header"]');M&&A?.contains(M)||s("panel-leave")}let R=null;return jt(()=>i.active,x=>{R&&(clearTimeout(R),R=null),x&&(R=setTimeout(h,200))}),jt(()=>i.activeTopic,()=>{ma(()=>h())}),jt(r,x=>{x>0&&s("height-change",x)}),(x,M)=>(ae(),ht("nav",{id:`menu-${x.active}`,ref:"el",role:"menu","aria-label":`${x.item.label} menu`,tabindex:"-1",class:"pointer-events-auto absolute top-(--header-height) right-0 left-0 z-10 hidden items-center overflow-clip lg:pointer:flex",onKeydownCapture:T,onFocusout:S,onMouseleave:S},[Qe("div",cb,[(ae(),Xe(ob,{key:`sub-menu-content-${x.active}`,item:x.item,"not-enough-space-at-bottom":x.notEnoughSpaceAtBottom,"active-topic":x.activeTopic,"onUpdate:activeTopic":M[0]||(M[0]=A=>x.$emit("update:activeTopic",A))},null,8,["item","not-enough-space-at-bottom","active-topic"]))])],40,lb))}}),hb=Mt({name:"MdsHeaderPointer",__name:"pointer",props:{state:{},items:{},vars:{}},emits:["update:active","update:activeTopic"],setup(i,{emit:e}){const t=Vs(),n=mt(!1),r=Hm(),s=Bs(ks),a=e,o=Ze(()=>i.items.find(f=>f.id===i.state.active)),l=()=>{a("update:activeTopic",""),a("update:active",""),h.value=0},c=f=>{a("update:activeTopic",f)};jt(()=>i.state.active,()=>{if(o.value?.items?.length===1){a("update:activeTopic",o.value.items[0]?.id);return}a("update:activeTopic","")});const u=mt(0),h=mt(0),d=f=>{u.value=f,h.value=Math.max(h.value,f)};return Kn(()=>{if(typeof window>"u")return;const f=s.active().value,p=i.vars[f],g=r.height.value-p-150;n.value=h.value>=g}),(f,p)=>(ae(),ht(en,null,[Ce(re(Cr),null,{default:Be(()=>[f.state.active!==""?(ae(),Xe(re(At).div,{key:0,"aria-hidden":"true",initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0,pointerEvents:"none",transition:{...re(Wt),duration:re(t)?0:1.5}},transition:re(Wt),class:"pointer-events-auto fixed inset-0 hidden bg-black/20 backdrop-blur-l lg:pointer:flex",onMouseenter:l,onClick:l},null,8,["exit","transition"])):xt("",!0),f.state.active!==""?(ae(),Xe(eb,{key:1,vars:f.vars,state:f.state,height:u.value},null,8,["vars","state","height"])):xt("",!0)]),_:1}),f.state.active!==""&&o.value?(ae(),Xe(ub,{key:`desktop-${f.state.active}`,active:f.state.active,item:o.value,"active-topic":f.state.activeTopic,"not-enough-space-at-bottom":n.value,onHeightChange:d,onClose:l,"onUpdate:activeTopic":c,onPanelLeave:l},null,8,["active","item","active-topic","not-enough-space-at-bottom"])):xt("",!0),Ce(re(Cr),null,{default:Be(()=>[f.state.active!==""&&n.value?(ae(),Xe(re(At).div,{key:0,initial:{opacity:0},animate:{opacity:1,transition:{...re(Wt),delay:re(Wt).duration*.5}},exit:{opacity:0,transition:{...re(Wt),duration:re(Wt).duration*.3}},class:"pointer-events-auto absolute top-[calc(var(--header-height)+var(--grid-margin)*0.5)] right-(--grid-margin) z-10"},{default:Be(()=>[Ce(ys,{"aria-label":"Close",variant:"secondary",icon:{category:"Interface",name:"Cross"},"tracking-data":{componentName:"MdsHeaderPointer",text:"Close"},onClick:l})]),_:1},8,["animate","exit"])):xt("",!0)]),_:1})],64))}}),db={class:"flex flex-col items-start gap-s"},fb=Mt({name:"MdsHeaderTouchMainMenu",__name:"main-menu",props:{items:{},active:{default:""},secondary:{}},emits:["update:active","update:activeTopic","update:search"],setup(i,{emit:e}){const t=e,n={initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0}},r=a=>Mg(a)?a.href:null,s=a=>{t("update:active",a),t("update:activeTopic","")};return(a,o)=>(ae(),Xe(re(At).div,{class:"flex h-full flex-col justify-between gap-2xl",variants:n,initial:"initial",animate:"animate",exit:"exit"},{default:Be(()=>[Ce(re(At).nav,{role:"menu","aria-label":"Main menu",variants:{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}},class:"flex w-full flex-col px-(--grid-margin) py-[calc(var(--grid-margin)*0.5)]"},{default:Be(()=>[(ae(!0),ht(en,null,Hn(a.items,(l,c)=>(ae(),Xe(Fm(re(Zn)(l)?re(At).button:re(At).a),{key:`nav-item-${l.label}`,animate:{opacity:1},"aria-controls":re(Zn)(l)?`menu-${l.id}`:void 0,"aria-expanded":re(Zn)(l)?a.active===l.id?"true":"false":void 0,"aria-haspopup":re(Zn)(l)?"menu":void 0,"data-track-component-name":"MdsHeaderNavigation","data-track-text":l.label,"data-track-level":"1","data-track-navigation-mode":re(Zn)(l)?re(no)(l):void 0,href:re(Zn)(l)?null:r(l),initial:{opacity:0},role:re(Zn)(l)?"menuitem":void 0,variants:{initial:{y:40,opacity:0,filter:"blur(3px)"},animate:{y:0,opacity:1,filter:"none",transition:{...re(Wt),delay:.275+c*.07}},exit:{y:0,opacity:0}},class:"flex w-full items-center justify-between py-[calc(var(--grid-margin)*0.5)]",onClick:u=>re(Zn)(l)?s(l.id):null},{default:Be(()=>[Ce(zn,{is:"span",variant:"link-l"},{default:Be(()=>[On(_n(l.label),1)]),_:2},1024),re(Zn)(l)?(ae(),Xe(Nr,{key:0,category:"Arrows",name:"ChevronRight"})):xt("",!0)]),_:2},1032,["aria-controls","aria-expanded","aria-haspopup","data-track-text","data-track-navigation-mode","href","role","variants","onClick"]))),128))]),_:1}),Ce(re(At).div,{variants:{initial:{opacity:0}
1,animate:{opacity:1,transition:{...re(Wt),delay:.25}},exit:{opacity:0}},class:"flex flex-col gap-s border-t border-t-black-200 p-(--grid-margin)"},{default:Be(()=>[Qe("div",db,[a.secondary.search?.label?(ae(),Xe(bs,{key:0,is:"button",label:a.secondary.search.label,icon:{category:"Interface",name:"Search"},"tracking-data":{componentName:"MdsHeaderNavigation",text:"search",id:"search",level:1},onClick:o[0]||(o[0]=l=>a.$emit("update:search",!0))},null,8,["label"])):xt("",!0),a.secondary.account?.href?(ae(),Xe(bs,{key:1,is:"a",href:a.secondary.account.href,label:a.secondary.account.label,icon:{category:"Interface",name:"PersonCircle"},"tracking-data":{componentName:"MdsHeaderNavigation",text:"login",id:"login",level:1}},null,8,["href","label"])):xt("",!0)]),a.secondary.contact?.href?(ae(),Xe(ys,{key:0,is:"a",href:a.secondary.contact.href,label:a.secondary.contact.label,"tracking-data":{componentName:"MdsHeaderNavigation",text:a.secondary.contact.label,id:"contact",level:1}},null,8,["href","label","tracking-data"])):xt("",!0),a.secondary.link?.url?(ae(),Xe(bs,{key:1,href:a.secondary.link.url,label:a.secondary.link.title,"tracking-data":{componentName:"MdsHeaderNavigation",text:a.secondary.link.title,level:1}},null,8,["href","label","tracking-data"])):xt("",!0)]),_:1},8,["variants"])]),_:1}))}}),pb=["id","aria-label"],mb=Mt({name:"MdsHeaderTouchSubMenu",__name:"sub-menu",props:{items:{},active:{},activeTopic:{}},emits:["update:activeTopic"],setup(i,{emit:e}){const t=e,n=u=>{t("update:activeTopic",u)},r=Ze(()=>i.items.find(u=>u.id===i.active)),s=Ze(()=>r.value?Qh(r.value):[]),a=Ze(()=>r.value?no(r.value)==="progressive":!1),o=Ze(()=>{if(r.value)return a.value?s.value.find(u=>u.id===i.activeTopic):s.value[0]}),l=Ze(()=>!r.value||!o.value?{text:r.value?.label??""}:a.value?{text:xl(r.value.label,o.value.label),level:3}:{text:r.value.label,level:2}),c=Vs();return(u,h)=>r.value?(ae(),ht("nav",{key:0,id:`menu-${r.value.id}`,role:"menu","aria-label":`${r.value.label} menu`,class:"flex w-full flex-col gap-l p-(--grid-margin)"},[a.value&&!u.activeTopic?(ae(!0),ht(en,{key:0},Hn(s.value,d=>(ae(),Xe(hh,{key:d.id,topic:d,interactive:"",selected:u.activeTopic===d.id,"has-active-topic":!!u.activeTopic,"should-click-to-select":"","tracking-data":{componentName:"MdsHeaderNavigation",text:re(xl)(r.value.label,d.label),level:2,id:d.id},onSelect:n},null,8,["topic","selected","has-active-topic","tracking-data"]))),128)):o.value?.items?(ae(),ht(en,{key:1},[(ae(),Xe(Eg,{key:`${r.value.id}-${o.value.id}-categories`,categories:o.value.items,"tracking-data":l.value},null,8,["categories","tracking-data"])),o.value?.href&&o.value?.toLabel?(ae(),Xe(re(At).div,{key:`${r.value.id}-${o.value.id}-toLabel`,initial:{opacity:re(c)?1:0,filter:re(c)?"none":"blur(2px)"},animate:{opacity:1,filter:"none",transition:{...re(Wt),delay:re(c)?0:(o.value.items.length+1)*.175}},class:"flex"},{default:Be(()=>[Ce(bs,{label:o.value.toLabel,href:o.value.href,variant:"link-m",icon:{category:"Arrows",name:"ArrowRight"},"icon-position":"right","tracking-data":{componentName:"MdsHeaderNavigation",text:o.value.toLabel}},null,8,["label","href","tracking-data"])]),_:1}
1,8,["initial","animate"])):xt("",!0)],64)):xt("",!0)],8,pb)):xt("",!0)}}),gb={class:"relative size-full overflow-y-auto"},_b={class:"col-span-full"},vb=Mt({name:"MdsHeaderTouch",__name:"touch",props:{position:{},open:{type:Boolean},items:{},active:{},activeTopic:{},secondary:{}},emits:["update:active","update:activeTopic","update:search"],setup(i){const e={initial:{y:"-100%"},animate:{y:"0%"},exit:{y:"-100%"}};return(t,n)=>(ae(),Xe(re(Cr),null,{default:Be(()=>[t.open?(ae(),Xe(re(At).div,{key:0,variants:e,initial:"initial",animate:"animate",exit:"exit",transition:{...re(Wt)},class:Ot(["pointer-events-auto fixed top-0 right-0 left-0 h-full bg-white text-black lg:pointer:hidden",t.position==="fixed"?"pt-[calc(var(--header-height)+var(--grid-margin))]":"pt-(--header-height)"])},{default:Be(()=>[Qe("div",gb,[Ce(Cs,{class:"h-full px-0"},{default:Be(()=>[Qe("div",_b,[t.active===""?(ae(),Xe(fb,{key:0,items:t.items,secondary:t.secondary,active:t.active,"onUpdate:active":n[0]||(n[0]=r=>t.$emit("update:active",r)),"onUpdate:activeTopic":n[1]||(n[1]=r=>t.$emit("update:activeTopic",r)),"onUpdate:search":n[2]||(n[2]=r=>t.$emit("update:search",r))},null,8,["items","secondary","active"])):(ae(),Xe(mb,{key:1,items:t.items,active:t.active,"active-topic":t.activeTopic,"onUpdate:activeTopic":n[3]||(n[3]=r=>t.$emit("update:activeTopic",r))},null,8,["items","active","active-topic"]))])]),_:1})])]),_:1},8,["transition","class"])):xt("",!0)]),_:1}))}}),xb=Mt({name:"MdsHeaderMenu",__name:"menu",props:{items:{},state:{},secondary:{},vars:{}},emits:["update:active","update:activeTopic","update:search"],setup(i){const t=Bs(ks).greaterOrEqual("lg"),n=Gm("(hover: hover) and (pointer: fine)"),r=Ze(()=>t.value&&n.value);return(s,a)=>!r.value&&s.state.mobile?(ae(),Xe(vb,{key:0,position:s.state.position,open:s.state.mobile,active:s.state.active,"active-topic":s.state.activeTopic,items:s.items,secondary:s.secondary,"onUpdate:active":a[0]||(a[0]=o=>s.$emit("update:active",o)),"onUpdate:activeTopic":a[1]||(a[1]=o=>s.$emit("update:activeTopic",o)),"onUpdate:search":a[2]||(a[2]=o=>s.$emit("update:search",o))},null,8,["position","open","active","active-topic","items","secondary"])):(ae(),Xe(hb,{key:1,vars:s.vars,state:s.state,items:s.items,"onUpdate:active":a[3]||(a[3]=o=>s.$emit("update:active",o)),"onUpdate:activeTopic":a[4]||(a[4]=o=>s.$emit("update:activeTopic",o))},null,8,["vars","state","items"]))}}),yb=["data-theme"],If=10,HP=Mt({name:"MdsHeaderNavigation",__name:"header",props:{position:{default:"fixed"},items:{},secondary:{},allowTransparent:{type:Boolean,default:!1},logoTag:{default:""},logoHref:{},instantReduction:{type:Boolean,default:!1}},setup(i){const e=i.instantReduction?0:2.5,t=Hm(),n=Bs(ks),r=n.active(),s=n.greaterOrEqual("lg"),a=Gm("(hover: hover) and (pointer: fine)"),o=Ze(()=>s.value&&a.value),l=mt(!1),c=mt(!1),u=rv;ga(ed,Vy());const h=iv({mobile:!1,position:i.position,direction:"down",hidden:!1,reduced:!1,transparent:i.allowTransparent,active:"",activeTopic:"",search:!1,fixedLayout:i.position==="fixed"}),d=Ze(()=>h.mobile&&!s.value),{scrollY:f}=Vm();let p=0;const _=Ze(()=>h.transparent&&!h.active&&!d.value?"dark":"light"),g=Ze(()=>{const y=h.position==="fixed"?"fixed":"absolute",T=h.search?"opacity-0":"opacity-100",R=h.active===""&&!d.value&&h.transparent?"text-black-3200-rgba md:text-white":"text-black-3200-rgba";return[y,T,R]});function m(y){h.transparent=i.allowTransparent&&o.value&&y}Di(()=>{m(window.scrollY<t.height.value-80)});const v=Ze(()=>s.value&&a.value?"lg":n.greaterOrEqual("md").value?"md":"sm");Wm(f,"change",function(T){const S=T-(f?.getPrevious()??0),R=S>0,x=S<0,M=Math.abs(T-p);R&&h.direction==="up"&&M>If||x&&h.direction==="down"&&M>If*4?(h.direction=R?"down":"up",p=T):(R&&h.direction==="down"||x&&h.direction==="up")&&(p=T);const I=u[v.value],N=i.position==="fixed"&&T>=t.height.value*e&&h.direction==="down",U=i.position==="absolute"&&(h.direction==="up"||T>=I)?"fixed":"absolute";c.value=h.position==="absolute"&&U==="fixed",h.reduced=N,h.hidden=i.position==="absolute"&&T>=I&&h.direction==="down",h.position=i.position==="fixed"?"fixed":U,h.hidden?document.documentElement.classList.add("header-hidden"):document.documentElement.classList.remove("header-hidden"),l.value=T<t.height.value-80}),jt(r,function(){m(window.scrollY<t.height.value-80)}),jt(l,function(T){m(T)}),jt(()=>i.allowTransparent,y=>{if(!y){h.transparent=!1;return}m(l.value)});const b=(y,T)=>{h[y]=T};return(y,T)=>(ae(),ht(en,null,[Qe("div",{"data-component":"header","data-theme":_.value,class:Ot(["pointer-events-none top-0 right-0 left-0 z-100 h-dvh [--header-height:var(--sm)] md:[--header-height:var(--md)] lg:pointer:[--header-height:var(--lg)]",g.value]),style:ws(re(Om))},[Ce(Qy,{state:h,items:y.items,secondary:y.secondary,"is-instant-animation":c.value,"logo-tag":y.logoTag,"logo-href":y.logoHref,"onUpdate:active":T[0]||(T[0]=S=>b("active",S)),"onUpdate:activeTopic":T[1]||(T[1]=S=>b("activeTopic",S)),"onUpdate:mobile":T[2]||(T[2]=S=>b("mobile",S)),"onUpdate:reduced":T[3]||(T[3]=S=>
1b("reduced",S)),"onUpdate:direction":T[4]||(T[4]=S=>b("direction",S)),"onUpdate:search":T[5]||(T[5]=S=>b("search",S))},null,8,["state","items","secondary","is-instant-animation","logo-tag","logo-href"]),Ce(xb,{vars:re(u),state:h,items:y.items,secondary:y.secondary,"onUpdate:active":T[6]||(T[6]=S=>b("active",S)),"onUpdate:activeTopic":T[7]||(T[7]=S=>b("activeTopic",S)),"onUpdate:search":T[8]||(T[8]=S=>b("search",S))},null,8,["vars","state","items","secondary"])],14,yb),Ar(y.$slots,"search",{state:h,vars:re(u),onUpdateState:b})],64))}});function bb(i,e){return sv(e,function(t){return i[t]})}function Sb(i){return i==null?[]:bb(i,xv(i))}var Mb=Math.floor,Eb=Math.random;function Tb(i,e){return i+Mb(Eb()*(e-i+1))}function Tg(i){var e=i.length;return e?i[Tb(0,e-1)]:void 0}function wb(i){return Tg(Sb(i))}function wg(i){var e=av(i)?Tg:wb;return e(i)}const Ab={key:0,class:"pointer-events-none fixed inset-0 z-9000"},Cb=Mt({__name:"Guides",props:ov({isVisible:Boolean},{isVisible:!1}),setup(i){const e=mt(i.isVisible),t=n=>{(n.metaKey||n.ctrlKey)&&n.code==="KeyG"&&(n.preventDefault(),n.stopPropagation(),e.value=!e.value)};return Di(()=>{window.addEventListener("keydown",t,{capture:!0})}),Bm(()=>{window.removeEventListener("keydown",t,{capture:!0})}),(n,r)=>e.value?(ae(),ht("div",Ab,[Ce(re(Cs),{class:"h-full"},{default:Be(()=>[(ae(),ht(en,null,Hn(4,s=>Qe("div",{key:s,class:"col-span-1 flex h-full bg-red-1700 opacity-10 md:hidden"})),64)),(ae(),ht(en,null,Hn(12,s=>Qe("div",{key:s,class:"hidden h-full bg-red-1700 opacity-10 md:col-span-1 md:flex xl:hidden"})),64)),(ae(),ht(en,null,Hn(12,s=>Qe("div",{key:s,class:"hidden h-full bg-red-1700 opacity-10 xl:col-span-1 xl:flex"})),64))]),_:1})])):xt("",!0)}}),GP=Object.assign(Cb,{__name:"LayoutGuides"}),WP=i=>{const e=n=>{for(const r of n)if(r.type==="childList"){const s=[...r.addedNodes];s.length>0&&s.some(a=>a.textContent!=="")&&document.documentElement.setAttribute("data-scroll-lock",""),r.removedNodes.length>0&&document.documentElement.removeAttribute("data-scroll-lock")}};let t=null;Di(()=>{i.value&&(t=new MutationObserver(e),t.observe(i.value,{childList:!0}))}),Bm(()=>{t&&t.disconnect(),document.documentElement.removeAttribute("data-scroll-lock")})};const io="184",Rb={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},Ib={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},Ag=0,dh=1,Cg=2,Pb=3,Lb=0,xa=1,td=2,ps=3,Pi=0,yn=1,jn=2,pi=0,Ir=1,fh=2,ph=3,mh=4,Rg=5,Nb=6,qi=100,Ig=101,Pg=102,Lg=103,Ng=104,Dg=200,Og=201,Ug=202,Fg=203,
1yl=204,bl=205,Bg=206,kg=207,Vg=208,zg=209,Hg=210,Gg=211,Wg=212,Xg=213,qg=214,Sl=0,Ml=1,El=2,Or=3,Tl=4,wl=5,Al=6,Cl=7,ro=0,$g=1,Yg=2,ei=0,nd=1,id=2,rd=3,bc=4,sd=5,ad=6,od=7,gh="attached",Zg="detached",Sc=300,mi=301,Qi=302,ya=303,ba=304,Gs=306,Ua=1e3,An=1001,Fa=1002,Xt=1003,ld=1004,Db=1004,ms=1005,Ob=1005,Lt=1006,Sa=1007,Ub=1007,di=1008,Fb=1008,wn=1009,cd=1010,ud=1011,Is=1012,Mc=1013,Gn=1014,vn=1015,gi=1016,Ec=1017,Tc=1018,Ps=1020,hd=35902,dd=35899,fd=1021,pd=1022,xn=1023,_i=1026,$i=1027,wc=1028,so=1029,er=1030,Ac=1031,Bb=1032,Cc=1033,Ma=33776,Ea=33777,Ta=33778,wa=33779,Rl=35840,Il=35841,Pl=35842,Ll=35843,Nl=36196,Dl=37492,Ol=37496,Ul=37488,Fl=37489,Ba=37490,Bl=37491,kl=37808,Vl=37809,zl=37810,Hl=37811,Gl=37812,Wl=37813,Xl=37814,ql=37815,$l=37816,Yl=37817,Zl=37818,Kl=37819,Jl=37820,jl=37821,Ql=36492,ec=36494,tc=36495,nc=36283,ic=36284,ka=36285,rc=36286,Kg=2200,Jg=2201,jg=2202,Va=2300,sc=2301,hl=2302,_h=2303,Er=2400,Tr=2401,za=2402,Rc=2500,md=2501,kb=0,Vb=1,zb=2,Qg=3200,Hb=3201,Gb=3202,Wb=3203,Li=0,e_=1,Ci="",Tn="srgb",Ha="srgb-linear",Ga="linear",St="srgb",Xb="",qb="rg",$b="ga",Yb=0,yr=7680,Zb=7681,Kb=7682,Jb=7683,jb=34055,Qb=34056,eS=5386,tS=512,nS=513,iS=514,rS=515,sS=516,aS=517,oS=518,vh=519,t_=512,n_=513,i_=514,Ic=515,r_=516,s_=517,Pc=518,a_=519,Wa=35044,o_=35048,lS=35040,cS=35045,uS=35049,hS=35041,dS=35046,fS=35050,pS=35042,mS="100",xh="300 es",Un=2e3,Ur=2001,gS={COMPUTE:"compute",RENDER:"render"},_S={PERSPECTIVE:"perspective",LINEAR:"linear",FLAT:"flat"},vS={NORMAL:"normal",CENTROID:"centroid",SAMPLE:"sample",FIRST:"first",EITHER:"either"},xS={TEXTURE_COMPARE:"depthTextureCompare"};function yS(i){for(let e=i.length-1;e>=0;--e)if(i[e]>=65535)return!0;return!1}const bS={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function gs(i,e){return new bS[i](e)}function l_(i){return ArrayBuffer.isView(i)&&!(i instanceof DataView)}function Xa(i){return document.createElementNS("http://www.w3.org/1999/xhtml",i)}function c_(){const i=Xa("canvas");return i.style.display="block",i}const Pf={};let tr=null;function SS(i){tr=i}function MS(){return tr}function qa(...i){const e="THREE."+i.shift();tr?tr("log",e,...i):console.log(e,...i)}function u_(i){const e=i[0];if(typeof e=="string"&&e.startsWith("TSL:")){const t=i[1];t&&t.isStackTrace?i[0]+=" "+t.getLocation():i[1]='Stack trace not available. Enable "THREE.Node.captureStackTrace" to capture stack traces.'}return i}function _e(...i){i=u_(i);const e="THREE."+i.shift();if(tr)tr("warn",e,...i);else{const t=i[0];t&&t.isStackTrace?console.warn(t.getError(e)):console.warn(e,...i)}}function Oe(...i){i=u_(i);const e="THREE."+i.shift();if(tr)tr("error",e,...i);else{const t=i[0];t&&t.isStackTrace?console.error(t.getError(e)):console.error(e,...i)}}function ac(...i){const e=i.join(" ");e in Pf||(Pf[e]=!0,_e(...i))}function ES(i,e,t){return new Promise(function(n,r){function s(){switch(i.clientWaitSync(e,i.SYNC_FLUSH_COMMANDS_BIT,0)){case i.WAIT_FAILED:r();break;case i.TIMEOUT_EXPIRED:setTimeout(s,t);break;default:n()}}setTimeout(s,t)})}const TS={[Sl]:Ml,[El]:Al,[Tl]:Cl,[Or]:wl,[Ml]:Sl,[Al]:El,[Cl]:Tl,[wl]:Or};class ii{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){const n=this._listeners;return n===void 0?!1:n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){const n=this._listeners;if(n===void 0)return;const r=n[e];if(r!==void 0){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}}dispatchEvent(e){const t=this._listeners;if(t===void 0)return;const n=t[e.type];if(n!==void 0){e.target=this;const r=n.slice(0);for(let s=0,a=r.length;s<a;s++)r[s].call(this,e);e.target=null}}}const an=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","5
15","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];let Lf=1234567;const Pr=Math.PI/180,Ls=180/Math.PI;function Fn(){const i=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,n=Math.random()*4294967295|0;return(an[i&255]+an[i>>8&255]+an[i>>16&255]+an[i>>24&255]+"-"+an[e&255]+an[e>>8&255]+"-"+an[e>>16&15|64]+an[e>>24&255]+"-"+an[t&63|128]+an[t>>8&255]+"-"+an[t>>16&255]+an[t>>24&255]+an[n&255]+an[n>>8&255]+an[n>>16&255]+an[n>>24&255]).toLowerCase()}function $e(i,e,t){return Math.max(e,Math.min(t,i))}function gd(i,e){return(i%e+e)%e}function wS(i,e,t,n,r){return n+(i-e)*(r-n)/(t-e)}function AS(i,e,t){return i!==e?(t-i)/(e-i):0}function Aa(i,e,t){return(1-t)*i+t*e}function CS(i,e,t,n){return Aa(i,e,1-Math.exp(-t*n))}function RS(i,e=1){return e-Math.abs(gd(i,e*2)-e)}function IS(i,e,t){return i<=e?0:i>=t?1:(i=(i-e)/(t-e),i*i*(3-2*i))}function PS(i,e,t){return i<=e?0:i>=t?1:(i=(i-e)/(t-e),i*i*i*(i*(i*6-15)+10))}function LS(i,e){return i+Math.floor(Math.random()*(e-i+1))}function NS(i,e){return i+Math.random()*(e-i)}function DS(i){return i*(.5-Math.random())}function OS(i){i!==void 0&&(Lf=i);let e=Lf+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function US(i){return i*Pr}function FS(i){return i*Ls}function BS(i){return(i&i-1)===0&&i!==0}function kS(i){return Math.pow(2,Math.ceil(Math.log(i)/Math.LN2))}function VS(i){return Math.pow(2,Math.floor(Math.log(i)/Math.LN2))}function zS(i,e,t,n,r){const s=Math.cos,a=Math.sin,o=s(t/2),l=a(t/2),c=s((e+n)/2),u=a((e+n)/2),h=s((e-n)/2),d=a((e-n)/2),f=s((n-e)/2),p=a((n-e)/2);switch(r){case"XYX":i.set(o*u,l*h,l*d,o*c);break;case"YZY":i.set(l*d,o*u,l*h,o*c);break;case"ZXZ":i.set(l*h,l*d,o*u,o*c);break;case"XZX":i.set(o*u,l*p,l*f,o*c);break;case"YXY":i.set(l*f,o*u,l*p,o*c);break;case"ZYZ":i.set(l*p,l*f,o*u,o*c);break;default:_e("MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}function gn(i,e){switch(e.constructor){case Float32Array:return i;case Uint32Array:return i/4294967295;case Uint16Array:return i/65535;case Uint8Array:return i/255;case Int32Array:return Math.max(i/2147483647,-1);case Int16Array:return Math.max(i/32767,-1);case Int8Array:return Math.max(i/127,-1);default:throw new Error("Invalid component type.")}}function at(i,e){switch(e.constructor){case Float32Array:return i;case Uint32Array:return Math.round(i*4294967295);case Uint16Array:return Math.round(i*65535);case Uint8Array:return Math.round(i*255);case Int32Array:return Math.round(i*2147483647);case Int16Array:return Math.round(i*32767);case Int8Array:return Math.round(i*127);default:throw new Error("Invalid component type.")}}const h_={DEG2RAD:Pr,RAD2DEG:Ls,generateUUID:Fn,clamp:$e,euclideanModulo:gd,mapLinear:wS,inverseLerp:AS,lerp:Aa,damp:CS,pingpong:RS,smoothstep:IS,smootherstep:PS,randInt:LS,randFloat:NS,randFloatSpread:DS,seededRandom:OS,degToRad:US,radToDeg:FS,isPowerOfTwo:BS,ceilPowerOfTwo:kS,floorPowerOfTwo:VS,setQuaternionFromProperEuler:zS,normalize:at,denormalize:gn},tf=class tf{constructor(e=0,t=0){this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}
vendor: 39,685 bytes, line 1
1sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,n=this.y,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6],this.y=r[1]*t+r[4]*n+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=$e(this.x,e.x,t.x),this.y=$e(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=$e(this.x,e,t),this.y=$e(this.y,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar($e(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos($e(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const n=Math.cos(t),r=Math.sin(t),s=this.x-e.x,a=this.y-e.y;return this.x=s*n-a*r+e.x,this.y=s*r+a*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}};tf.prototype.isVector2=!0;let j=tf;class tn{constructor(e=0,t=0,n=0,r=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=r}static slerpFlat(e,t,n,r,s,a,o){let l=n[r+0],c=n[r+1],u=n[r+2],h=n[r+3],d=s[a+0],f=s[a+1],p=s[a+2],_=s[a+3];if(h!==_||l!==d||c!==f||u!==p){let g=l*d+c*f+u*p+h*_;g<0&&(d=-d,f=-f,p=-p,_=-_,g=-g);let m=1-o;if(g<.9995){const v=Math.acos(g),b=Math.sin(v);m=Math.sin(m*v)/b,o=Math.sin(o*v)/b,l=l*m+d*o,c=c*m+f*o,u=u*m+p*o,h=h*m+_*o}else{l=l*m+d*o,c=c*m+f*o,u=u*m+p*o,h=h*m+_*o;const v=1/Math.sqrt(l*l+c*c+u*u+h*h);l*=v,c*=v,u*=v,h*=v}}e[t]=l,e[t+1]=c,e[t+2]=u,e[t+3]=h}static multiplyQuaternionsFlat(e,t,n,r,s,a){const o=n[r],l=n[r+1],c=n[r+2],u=n[r+3],h=s[a],d=s[a+1],f=s[a+2],p=s[a+3];return e[t]=o*p+u*h+l*f-c*d,e[t+1]=l*p+u*d+c*h-o*f,e[t+2]=c*p+u*f+o*d-l*h,e[t+3]=u*p-o*h-l*d-c*f,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const n=e._x,r=e._y,s=e._z,a=e._order,o=Math.cos,l=Math.sin,c=o(n/2),u=o(r/2),h=o(s/2),d=l(n/2),f=l(r/2),p=l(s/2);switch(a){case"XYZ":this._x=d*u*h+c*f*p,this._y=c*f*h-d*u*p,this._z=c*u*p+d*f*h,this._w=c*u*h-d*f*p;break;case"YXZ":this._x=d*u*h+c*f*p,this._y=c*f*h-d*u*p,this._z=c*u*p-d*f*h,this._w=c*u*h+d*f*p;break;case"ZXY":this._x=d*u*h-c*f*p,this._y=c*f*h+d*u*p,this._z=c*u*p+d*f*h,this._w=c*u*h-d*f*p;break;case"ZYX":this._x=d*u*h-c*f*p,this._y=c*f*h+d*u*p,this._z=c*u*p-d*f*h,this._w=c*u*h+d*f*p;break;case"YZX":this._x=d*u*h+c*f*p,this._y=c*f*h+d*u*p,this._z=c*u*p-d*f*h,this._w=c*u*h-d*f*p;break;case"XZY":this._x=d*u*h-c*f*p,this._y=c*f*h-d*u*p,this._z=c*u*p+d*f*h,this._w=c*u*h+d*f*p;break;default:_e("Quaternion: .setFromEuler() encountered an unknown order: "+a)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const n=t/2,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,n=t[0],r=t[4],s=t[8],a=t[1],o=t[5],l=t[9],c=t[2],u=t[6],h=t[10],d=n+o+h;if(d>0){const f=.5/Math.sqrt(d+1);this._w=.25/f,this._x=(u-l)*f,this._y=(s-c)*f,this._z=(a-r)*f}else if(n>o&&n>h){const f=2*Math.sqrt(1+n-o-h);this._w=(u-l)/f,this._x=.25*f,this._y=(r+a)/f,this._z=(s+c)/f}else if(o>h){const f=2*Math.sqrt(1+o-n-h);this._w=(s-c)/f,this._x=(r+a)/f,this._y=.25*f,this._z=(l+u)/f}else{const f=2*Math.sqrt(1+h-n-o);this._w=(a-r)/f,this._x=(s+c)/f,this._y=(l+u)/f,this._z=.25*f}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<1e-8?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs($e(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(n===0)return this;const r=Math.min(1,t/n);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const n=e._x,r=e._y,s=e._z,a=e._w,o=t._x,l=t._y,c=t._z,u=t._w;return this._x=n*u+a*o+r*c-s*l,this._y=r*u+a*l+s*o-n*c,this._z=s*u+a*c+n*l-r*o,this._w=a*u-n*o-r*l-s*c,this._onChangeCallback(),this}slerp(e,t){let n=e._x,r=e._y,s=e._z,a=e._w,o=this.dot(e);o<0&&(n=-n,r=-r,s=-s,a=-a,o=-o);let l=1-t;if(o<.9995){const c=Math.acos(o),u=Math.sin(c);l=Math.sin(l*c)/u,t=Math.sin(t*c)/u,this._x=this._x*l+n*t,this._y=this._y*l+r*t,this._z=this._z*l+s*t,this._w=this._w*l+a*t,this._onChangeCallback()}else this._x=this._x*l+n*t,this._y=this._y*l+r*t,this._z=this._z*l+s*t,this._w=this._w*l+a*t,this.normalize();return this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),n=Math.random(),r=Math.sqrt(1-n),s=Math.sqrt(n);return this.set(r*Math.sin(e),r*Math.cos(e),s*Math.sin(t),s*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}const nf=class nf{constructor(e=0,t=0,n=0){this.x=e,this.y=t,this.z=n}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(Nf.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(Nf.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,n=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[3]*n+s[6]*r,this.y=s[1]*t+s[4]*n+s[7]*r,this.z=s[2]*t+s[5]*n+s[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,n=this.y,r=this.z,s=e.elements,a=1/(s[3]*t+s[7]*n+s[11]*r+s[15]);return this.x=(s[0]*t+s[4]*n+s[8]*r+s[12])*a,this.y=(s[1]*t+s[5]*n+s[9]*r+s[13])*a,this.z=(s[2]*t+s[6]*n+s[10]*r+s[14])*a,this}applyQuaternion(e){const t=this.x,n=this.y,r=this.z,s=e.x,a=e.y,o=e.z,l=e.w,c=2*(a*r-o*n),u=2*(o*t-s*r),h=2*(s*n-a*t);return this.x=t+l*c+a*h-o*u,this.y=n+l*u+o*c-s*h,this.z=r+l*h+s*u-a*c,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,n=this.y,r=this.z,s=e.elements;return this.x=s[0]*t+s[4]*n+s[8]*r,this.y=s[1]*t+s[5]*n+s[9]*r,this.z=s[2]*t+s[6]*n+s[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=$e(this.x,e.x,t.x),this.y=$e(this.y,e.y,t.y),this.z=$e(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=$e(this.x,e,t),this.y=$e(this.y,e,t),this.z=$e(this.z,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar($e(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const n=e.x,r=e.y,s=e.z,a=t.x,o=t.y,l=t.z;return this.x=r*l-s*o,this.y=s*a-n*l,this.z=n*o-r*a,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return lu.copy(this).projectOnVector(e),this.sub(lu)}reflect(e){return this.sub(lu.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos($e(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){const r=Math.sin(t)*e;return this.x=r*Math.sin(n),this.y=Math.cos(t)*e,this.z=r*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=r,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,t=Math.random()*2-1,n=Math.sqrt(1-t*t);return this.x=n*Math.cos(e),this.y=t,this.z=n*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}};nf.prototype.isVector3=!0;let P=nf;const lu=new P,Nf=new tn,rf=class rf{constructor(e,t,n,r,s,a,o,l,c){this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,n,r,s,a,o,l,c)}set(e,t,n,r,s,a,o,l,c){const u=this.elements;return u[0]=e,u[1]=r,u[2]=o,u[3]=t,u[4]=s,u[5]=l,u[6]=n,u[7]=a,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,r=t.elements,s=this.elements,a=n[0],o=n[3],l=n[6],c=n[1],u=n[4],h=n[7],d=n[2],f=n[5],p=n[8],_=r[0],g=r[3],m=r[6],v=r[1],b=r[4],y=r[7],T=r[2],S=r[5],R=r[8];return s[0]=a*_+o*v+l*T,s[3]=a*g+o*b+l*S,s[6]=a*m+o*y+l*R,s[1]=c*_+u*v+h*T,s[4]=c*g+u*b+h*S,s[7]=c*m+u*y+h*R,s[2]=d*_+f*v+p*T,s[5]=d*g+f*b+p*S,s[8]=d*m+f*y+p*R,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[1],r=e[2],s=e[3],a=e[4],o=e[5],l=e[6],c=e[7],u=e[8];return t*a*u-t*o*c-n*s*u+n*o*l+r*s*c-r*a*l}invert(){const e=this.elements,t=e[0],n=e[1],r=e[2],s=e[3],a=e[4],o=e[5],l=e[6],c=e[7],u=e[8],h=u*a-o*c,d=o*l-u*s,f=c*s-a*l,p=t*h+n*d+r*f;if(p===0)return this.set(0,0,0,0,0,0,0,0,0);const _=1/p;return e[0]=h*_,e[1]=(r*c-u*n)*_,e[2]=(o*n-r*a)*_,e[3]=d*_,e[4]=(u*t-r*l)*_,e[5]=(r*s-o*t)*_,e[6]=f*_,e[7]=(n*l-c*t)*_,e[8]=(a*t-n*s)*_,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,r,s,a,o){const l=Math.cos(s),c=Math.sin(s);return this.set(n*l,n*c,-n*(l*a+c*o)+a+e,-r*c,r*l,-r*(-c*a+l*o)+o+t,0,0,1),this}scale(e,t){return this.premultiply(cu.makeScale(e,t)),this}rotate(e){return this.premultiply(cu.makeRotation(-e)),this}translate(e,t){return this.premultiply(cu.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,n,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,n=e.elements;for(let r=0;r<9;r++)if(t[r]!==n[r])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}};rf.prototype.isMatrix3=!0;let tt=rf;const cu=new tt,Df=new tt().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),Of=new tt().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function HS(){const i={enabled:!0,workingColorSpace:Ha,spaces:{},convert:function(r,s,a){return this.enabled===!1||s===a||!s||!a||(this.spaces[s].transfer===St&&(r.r=Ii(r.r),r.g=Ii(r.g),r.b=Ii(r.b)),this.spaces[s].primaries!==this.spaces[a].primaries&&(r.applyMatrix3(this.spaces[s].toXYZ),r.applyMatrix3(this.spaces[a].fromXYZ)),this.spaces[a].transfer===St&&(r.r=Ss(r.r),r.g=Ss(r.g),r.b=Ss(r.b))),r},workingToColorSpace:function(r,s){return this.convert(r,this.workingColorSpace,s)},colorSpaceToWorking:function(r,s){return this.convert(r,s,this.workingColorSpace)},getPrimaries:function(r){return this.spaces[r].primaries},getTransfer:function(r){return r===Ci?Ga:this.spaces[r].transfer},getToneMappingMode:function(r){return this.spaces[r].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(r,s=this.workingColorSpace){return r.fromArray(this.spaces[s].luminanceCoefficients)},define:function(r){Object.assign(this.spaces,r)},_getMatrix:function(r,s,a){return r.copy(this.spaces[s].toXYZ).multiply(this.spaces[a].fromXYZ)},_getDrawingBufferColorSpace:function(r){return this.spaces[r].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(r=this.workingColorSpace){return this.spaces[r].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(r,s){return ac("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),i.workingToColorSpace(r,s)},toWorkingColorSpace:function(r,s){return ac("ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),i.colorSpaceToWorking(r,s)}},e=[.64,.33,.3,.6,.15,.06],t=[.2126,.7152,.0722],n=[.3127,.329];return i.define({[Ha]:{primaries:e,whitePoint:n,transfer:Ga,toXYZ:Df,fromXYZ:Of,luminanceCoefficients:t,workingColorSpaceConfig:{unpackColorSpace:Tn},outputColorSpaceConfig:{drawingBufferColorSpace:Tn}},[Tn]:{primaries:e,whitePoint:n,transfer:St,toXYZ:Df,fromXYZ:Of,luminanceCoefficients:t,outputColorSpaceConfig:{drawingBufferColorSpace:Tn}}}),i}const dt=HS();function Ii(i){return i<.04045?i*.0773993808:Math.pow(i*.9478672986+.0521327014,2.4)}function Ss(i){return i<.0031308?i*12.92:1.055*Math.pow(i,.41666)-.055}let qr;class d_{static getDataURL(e,t="image/png"){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let n;if(e instanceof HTMLCanvasElement)n=e;else{qr===void 0&&(qr=Xa("canvas")),qr.width=e.width,qr.height=e.height;const r=qr.getContext("2d");e instanceof ImageData?r.putImageData(e,0,0):r.drawImage(e,0,0,e.width,e.height),n=qr}return n.toDataURL(t)}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=Xa("canvas");t.width=e.width,t.height=e.height;const n=t.getContext("2d");n.drawImage(e,0,0,e.width,e.height);const r=n.getImageData(0,0,e.width,e.height),s=r.data;for(let a=0;a<s.length;a++)s[a]=Ii(s[a]/255)*255;return n.putImageData(r,0,0),t}else if(e.data){const t=e.data.slice(0);for(let n=0;n<t.length;n++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[n]=Math.floor(Ii(t[n]/255)*255):t[n]=Ii(t[n]);return{data:t,width:e.width,height:e.height}}else return _e("ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}let GS=0;class Yi{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:GS++}),this.uuid=Fn(),this.data=e,this.dataReady=!0,this.version=0}getSize(e){const t=this.data;return typeof HTMLVideoElement<"u"&&t instanceof HTMLVideoElement?e.set(t.videoWidth,t.videoHeight,0):typeof VideoFrame<"u"&&t instanceof VideoFrame?e.set(t.displayWidth,t.displayHeight,0):t!==null?e.set(t.width,t.height,t.depth||0):e.set(0,0,0),e}set needsUpdate(e){e===!0&&this.version++}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.images[this.uuid]!==void 0)return e.images[this.uuid];const n={uuid:this.uuid,url:""},r=this.data;if(r!==null){let s;if(Array.isArray(r)){s=[];for(let a=0,o=r.length;a<o;a++)r[a].isDataTexture?s.push(uu(r[a].image)):s.push(uu(r[a]))}else s=uu(r);n.url=s}return t||(e.images[this.uuid]=n),n}}function uu(i){return typeof HTMLImageElement<"u"&&i instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&i instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&i instanceof ImageBitmap?d_.getDataURL(i):i.data?{data:Array.from(i.data),width:i.width,height:i.height,type:i.data.constructor.name}:(_e("Texture: Unable to serialize Texture."),{})}let WS=0;const hu=new P;class Ft extends ii{constructor(e=Ft.DEFAULT_IMAGE,t=Ft.DEFAULT_MAPPING,n=An,r=An,s=Lt,a=di,o=xn,l=wn,c=Ft.DEFAULT_ANISOTROPY,u=Ci){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:WS++}),this.uuid=Fn(),this.name="",this.source=new Yi(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=n,this.wrapT=r,this.magFilter=s,this.minFilter=a,this.anisotropy=c,this.format=o,this.internalFormat=null,this.type=l,this.offset=new j(0,0),this.repeat=new j(1,1),this.center=new j(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new tt,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=u,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!(e&&e.depth&&e.depth>1),this.pmremVersion=0,this.normalized=!1}get width(){return this.source.getSize(hu).x}get height(){return this.source.getSize(hu).y}get depth(){return this.source.getSize(hu).z}get image(){return this.source.data}set image(e){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.normalized=e.normalized,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(const t in e){const n=e[t];if(n===void 0){_e(`Texture.setValues(): parameter '${t}' has value of undefined.`);continue}const r=this[t];if(r===void 0){_e(`Texture.setValues(): property '${t}' does not exist.`);continue}r&&n&&r.isVector2&&n.isVector2||r&&n&&r.isVector3&&n.isVector3||r&&n&&r.isMatrix3&&n.isMatrix3?r.copy(n):this[t]=n}}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const n={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,normalized:this.normalized,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==Sc)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Ua:e.x=e.x-Math.floor(e.x);break;case An:e.x=e.x<0?0:1;break;case Fa:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case Ua:e.y=e.y-Math.floor(e.y);break;case An:e.y=e.y<0?0:1;break;case Fa:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}Ft.DEFAULT_IMAGE=null;Ft.DEFAULT_MAPPING=Sc;Ft.DEFAULT_ANISOTROPY=1;const sf=class sf{constructor(e=0,t=0,n=0,r=1){this.x=e,this.y=t,this.z=n,this.w=r}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,r){return this.x=e,this.y=t,this.z=n,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,n=this.y,r=this.z,s=this.w,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*r+a[12]*s,this.y=a[1]*t+a[5]*n+a[9]*r+a[13]*s,this.z=a[2]*t+a[6]*n+a[10]*r+a[14]*s,this.w=a[3]*t+a[7]*n+a[11]*r+a[15]*s,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,r,s;const l=e.elements,c=l[0],u=l[4],h=l[8],d=l[1],f=l[5],p=l[9],_=l[2],g=l[6],m=l[10];if(Math.abs(u-d)<.01&&Math.abs(h-_)<.01&&Math.abs(p-g)<.01){if(Math.abs(u+d)<.1&&Math.abs(h+_)<.1&&Math.abs(p+g)<.1&&Math.abs(c+f+m-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const b=(c+1)/2,y=(f+1)/2,T=(m+1)/2,S=(u+d)/4,R=(h+_)/4,x=(p+g)/4;return b>y&&b>T?b<.01?(n=0,r=.707106781,s=.707106781):(n=Math.sqrt(b),r=S/n,s=R/n):y>T?y<.01?(n=.707106781,r=0,s=.707106781):(r=Math.sqrt(y),n=S/r,s=x/r):T<.01?(n=.707106781,r=.707106781,s=0):(s=Math.sqrt(T),n=R/s,r=x/s),this.set(n,r,s,t),this}let v=Math.sqrt((g-p)*(g-p)+(h-_)*(h-_)+(d-u)*(d-u));return Math.abs(v)<.001&&(v=1),this.x=(g-p)/v,this.y=(h-_)/v,this.z=(d-u)/v,this.w=Math.acos((c+f+m-1)/2),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=$e(this.x,e.x,t.x),this.y=$e(this.y,e.y,t.y),this.z=$e(this.z,e.z,t.z),this.w=$e(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=$e(this.x,e,t),this.y=$e(this.y,e,t),this.z=$e(this.z,e,t),this.w=$e(this.w,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar($e(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}};sf.prototype.isVector4=!0;let Et=sf;class _d extends ii{constructor(e=1,t=1,n={}){super(),n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Lt,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1},n),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=n.depth,this.scissor=new Et(0,0,e,t),this.scissorTest=!1,this.viewport=new Et(0,0,e,t),this.textures=[];const r={width:e,height:t,depth:n.depth},s=new Ft(r),a=n.count;for(let o=0;o<a;o++)this.textures[o]=s.clone(),this.textures[o].isRenderTargetTexture=!0,this.textures[o].renderTarget=this;this._setTextureOptions(n),this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.resolveDepthBuffer=n.resolveDepthBuffer,this.resolveStencilBuffer=n.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=n.depthTexture,this.samples=n.samples,this.multiview=n.multiview}_setTextureOptions(e={}){const t={minFilter:Lt,generateMipmaps:!1,flipY:!1,internalFormat:null};e.mapping!==void 0&&(t.mapping=e.mapping),e.wrapS!==void 0&&(t.wrapS=e.wrapS),e.wrapT!==void 0&&(t.wrapT=e.wrapT),e.wrapR!==void 0&&(t.wrapR=e.wrapR),e.magFilter!==void 0&&(t.magFilter=e.magFilter),e.minFilter!==void 0&&(t.minFilter=e.minFilter),e.format!==void 0&&(t.format=e.format),e.type!==void 0&&(t.type=e.type),e.anisotropy!==void 0&&(t.anisotropy=e.anisotropy),e.colorSpace!==void 0&&(t.colorSpace=e.colorSpace),e.flipY!==void 0&&(t.flipY=e.flipY),e.generateMipmaps!==void 0&&(t.generateMipmaps=e.generateMipmaps),e.internalFormat!==void 0&&(t.internalFormat=e.internalFormat);for(let n=0;n<this.textures.length;n++)this.textures[n].setValues(t)}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}set depthTexture(e){this._depthTexture!==null&&(this._depthTexture.renderTarget=null),e!==null&&(e.renderTarget=this),this._depthTexture=e}get depthTexture(){return this._depthTexture}setSize(e,t,n=1){if(this.width!==e||this.height!==t||this.depth!==n){this.width=e,this.height=t,this.depth=n;for(let r=0,s=this.textures.length;r<s;r++)this.textures[r].image.width=e,this.textures[r].image.height=t,this.textures[r].image.depth=n,this.textures[r].isData3DTexture!==!0&&(this.textures[r].isArrayTexture=this.textures[r].image.depth>1);this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let t=0,n=e.textures.length;t<n;t++){this.textures[t]=e.textures[t].clone(),this.textures[t].isRenderTargetTexture=!0,this.textures[t].renderTarget=this;const r=Object.assign({},e.textures[t].image);this.textures[t].source=new Yi(r)}return this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.resolveDepthBuffer=e.resolveDepthBuffer,this.resolveStencilBuffer=e.resolveStencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this.multiview=e.multiview,this}dispose(){this.dispatchEvent({type:"dispose"})}}class Bn extends _d{constructor(e=1,t=1,n={}){super(e,t,n),this.isWebGLRenderTarget=!0}}class Lc extends Ft{constructor(e=null,t=1,n=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:n,depth:r},this.magFilter=Xt,this.minFilter=Xt,this.wrapR=An,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class XS extends Bn{constructor(e=1,t=1,n=1,r={}){super(e,t,r),this.isWebGLArrayRenderTarget=!0,this.depth=n,this.texture=new Lc(null,e,t,n),this._setTextureOptions(r),this.texture.isRenderTargetTexture=!0}}class Nc extends Ft{constructor(e=null,t=1,n=1,r=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:n,depth:r},this.magFilter=Xt,this.minFilter=Xt,this.wrapR=An,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class qS extends Bn{constructor(e=1,t=1,n=1,r={}){super(e,t,r),this.isWebGL3DRenderTarget=!0,this.depth=n,this.texture=new Nc(null,e,t,n),this._setTextureOptions(r),this.texture.isRenderTargetTexture=!0}}const _c=class _c{constructor(e,t,n,r,s,a,o,l,c,u,h,d,f,p,_,g){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,n,r,s,a,o,l,c,u,h,d,f,p,_,g)}set(e,t,n,r,s,a,o,l,c,u,h,d,f,p,_,g){const m=this.elements;return m[0]=e,m[4]=t,m[8]=n,m[12]=r,m[1]=s,m[5]=a,m[9]=o,m[13]=l,m[2]=c,m[6]=u,m[10]=h,m[14]=d,m[3]=f,m[7]=p,m[11]=_,m[15]=g,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new _c().fromArray(this.elements)}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){const t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return this.determinant()===0?(e.set(1,0,0),t.set(0,1,0),n.set(0,0,1),this):(e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this)}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){if(e.determinant()===0)return this.identity();const t=this.elements,n=e.elements,r=1/$r.setFromMatrixColumn(e,0).length(),s=1/$r.setFromMatrixColumn(e,1).length(),a=1/$r.setFromMatrixColumn(e,2).length();return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=0,t[4]=n[4]*s,t[5]=n[5]*s,t[6]=n[6]*s,t[7]=0,t[8]=n[8]*a,t[9]=n[9]*a,t[10]=n[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,n=e.x,r=e.y,s=e.z,a=Math.cos(n),o=Math.sin(n),l=Math.cos(r),c=Math.sin(r),u=Math.cos(s),h=Math.sin(s);if(e.order==="XYZ"){const d=a*u,f=a*h,p=o*u,_=o*h;t[0]=l*u,t[4]=-l*h,t[8]=c,t[1]=f+p*c,t[5]=d-_*c,t[9]=-o*l,t[2]=_-d*c,t[6]=p+f*c,t[10]=a*l}else if(e.order==="YXZ"){const d=l*u,f=l*h,p=c*u,_=c*h;t[0]=d+_*o,t[4]=p*o-f,t[8]=a*c,t[1]=a*h,t[5]=a*u,t[9]=-o,t[2]=f*o-p,t[6]=_+d*o,t[10]=a*l}else if(e.order==="ZXY"){const d=l*u,f=l*h,p=c*u,_=c*h;t[0]=d-_*o,t[4]=-a*h,t[8]=p+f*o,t[1]=f+p*o,t[5]=a*u,t[9]=_-d*o,t[2]=-a*c,t[6]=o,t[10]=a*l}else if(e.order==="ZYX"){const d=a*u,f=a*h,p=o*u,_=o*h;t[0]=l*u,t[4]=p*c-f,t[8]=d*c+_,t[1]=l*h,t[5]=_*c+d,t[9]=f*c-p,t[2]=-c,t[6]=o*l,t[10]=a*l}else if(e.order==="YZX"){const d=a*l,f=a*c,p=o*l,_=o*c;t[0]=l*u,t[4]=_-d*h,t[8]=p*h+f,t[1]=h,t[5]=a*u,t[9]=-o*u,t[2]=-c*u,t[6]=f*h+p,t[10]=d-_*h}else if(e.order==="XZY"){const d=a*l,f=a*c,p=o*l,_=o*c;t[0]=l*u,t[4]=-h,t[8]=c*u,t[1]=d*h+_,t[5]=a*u,t[9]=f*h-p,t[2]=p*h-f,t[6]=o*u,t[10]=_*h+d}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose($S,e,YS)}lookAt(e,t,n){const r=this.elements;return Pn.subVectors(e,t),Pn.lengthSq()===0&&(Pn.z=1),Pn.normalize(),ki.crossVectors(n,Pn),ki.lengthSq()===0&&(Math.abs(n.z)===1?Pn.x+=1e-4:Pn.z+=1e-4,Pn.normalize(),ki.crossVectors(n,Pn)),ki.normalize(),_o.crossVectors(Pn,ki),r[0]=ki.x,r[4]=_o.x,r[8]=Pn.x,r[1]=ki.y,r[5]=_o.y,r[9]=Pn.y,r[2]=ki.z,r[6]=_o.z,r[10]=Pn.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,r=t.elements,s=this.elements,a=n[0],o=n[4],l=n[8],c=n[12],u=n[1],h=n[5],d=n[9],f=n[13],p=n[2],_=n[6],g=n[10],m=n[14],v=n[3],b=n[7],y=n[11],T=n[15],S=r[0],R=r[4],x=r[8],M=r[12],A=r[1],I=r[5],N=r[9],U=r[13],k=r[2],L=r[6],F=r[10],O=r[14],X=r[3],$=r[7],te=r[11],ue=r[15];
vendor: 4,345 bytes, line 1
1return s[0]=a*S+o*A+l*k+c*X,s[4]=a*R+o*I+l*L+c*$,s[8]=a*x+o*N+l*F+c*te,s[12]=a*M+o*U+l*O+c*ue,s[1]=u*S+h*A+d*k+f*X,s[5]=u*R+h*I+d*L+f*$,s[9]=u*x+h*N+d*F+f*te,s[13]=u*M+h*U+d*O+f*ue,s[2]=p*S+_*A+g*k+m*X,s[6]=p*R+_*I+g*L+m*$,s[10]=p*x+_*N+g*F+m*te,s[14]=p*M+_*U+g*O+m*ue,s[3]=v*S+b*A+y*k+T*X,s[7]=v*R+b*I+y*L+T*$,s[11]=v*x+b*N+y*F+T*te,s[15]=v*M+b*U+y*O+T*ue,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[4],r=e[8],s=e[12],a=e[1],o=e[5],l=e[9],c=e[13],u=e[2],h=e[6],d=e[10],f=e[14],p=e[3],_=e[7],g=e[11],m=e[15],v=l*f-c*d,b=o*f-c*h,y=o*d-l*h,T=a*f-c*u,S=a*d-l*u,R=a*h-o*u;return t*(_*v-g*b+m*y)-n*(p*v-g*T+m*S)+r*(p*b-_*T+m*R)-s*(p*y-_*S+g*R)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){const r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=n),this}invert(){const e=this.elements,t=e[0],n=e[1],r=e[2],s=e[3],a=e[4],o=e[5],l=e[6],c=e[7],u=e[8],h=e[9],d=e[10],f=e[11],p=e[12],_=e[13],g=e[14],m=e[15],v=t*o-n*a,b=t*l-r*a,y=t*c-s*a,T=n*l-r*o,S=n*c-s*o,R=r*c-s*l,x=u*_-h*p,M=u*g-d*p,A=u*m-f*p,I=h*g-d*_,N=h*m-f*_,U=d*m-f*g,k=v*U-b*N+y*I+T*A-S*M+R*x;if(k===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const L=1/k;return e[0]=(o*U-l*N+c*I)*L,e[1]=(r*N-n*U-s*I)*L,e[2]=(_*R-g*S+m*T)*L,e[3]=(d*S-h*R-f*T)*L,e[4]=(l*A-a*U-c*M)*L,e[5]=(t*U-r*A+s*M)*L,e[6]=(g*y-p*R-m*b)*L,e[7]=(u*R-d*y+f*b)*L,e[8]=(a*N-o*A+c*x)*L,e[9]=(n*A-t*N-s*x)*L,e[10]=(p*S-_*y+m*v)*L,e[11]=(h*y-u*S-f*v)*L,e[12]=(o*M-a*I-l*x)*L,e[13]=(t*I-n*M+r*x)*L,e[14]=(_*b-p*T-g*v)*L,e[15]=(u*T-h*b+d*v)*L,this}scale(e){const t=this.elements,n=e.x,r=e.y,s=e.z;return t[0]*=n,t[4]*=r,t[8]*=s,t[1]*=n,t[5]*=r,t[9]*=s,t[2]*=n,t[6]*=r,t[10]*=s,t[3]*=n,t[7]*=r,t[11]*=s,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,r))}makeTranslation(e,t,n){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const n=Math.cos(t),r=Math.sin(t),s=1-n,a=e.x,o=e.y,l=e.z,c=s*a,u=s*o;return this.set(c*a+n,c*o-r*l,c*l+r*o,0,c*o+r*l,u*o+n,u*l-r*a,0,c*l-r*o,u*l+r*a,s*l*l+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,r,s,a){return this.set(1,n,s,0,e,1,a,0,t,r,1,0,0,0,0,1),this}compose(e,t,n){const r=this.elements,s=t._x,a=t._y,o=t._z,l=t._w,c=s+s,u=a+a,h=o+o,d=s*c,f=s*u,p=s*h,_=a*u,g=a*h,m=o*h,v=l*c,b=l*u,y=l*h,T=n.x,S=n.y,R=n.z;return r[0]=(1-(_+m))*T,r[1]=(f+y)*T,r[2]=(p-b)*T,r[3]=0,r[4]=(f-y)*S,r[5]=(1-(d+m))*S,r[6]=(g+v)*S,r[7]=0,r[8]=(p+b)*R,r[9]=(g-v)*R,r[10]=(1-(d+_))*R,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,n){const r=this.elements;e.x=r[12],e.y=r[13],e.z=r[14];const s=this.determinant();if(s===0)return n.set(1,1,1),t.identity(),this;let a=$r.set(r[0],r[1],r[2]).length();const o=$r.set(r[4],r[5],r[6]).length(),l=$r.set(r[8],r[9],r[10]).length();s<0&&(a=-a),qn.copy(this);const c=1/a,u=1/o,h=1/l;return qn.elements[0]*=c,qn.elements[1]*=c,qn.elements[2]*=c,qn.elements[4]*=u,qn.elements[5]*=u,qn.elements[6]*=u,qn.elements[8]*=h,qn.elements[9]*=h,qn.elements[10]*=h,t.setFromRotationMatrix(qn),n.x=a,n.y=o,n.z=l,this}makePerspective(e,t,n,r,s,a,o=Un,l=!1){const c=this.elements,u=2*s/(t-e),h=2*s/(n-r),d=(t+e)/(t-e),f=(n+r)/(n-r);let p,_;if(l)p=s/(a-s),_=a*s/(a-s);else if(o===Un)p=-(a+s)/(a-s),_=-2*a*s/(a-s);else if(o===Ur)p=-a/(a-s),_=-a*s/(a-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);return c[0]=u,c[4]=0,c[8]=d,c[12]=0,c[1]=0,c[5]=h,c[9]=f,c[13]=0,c[2]=0,c[6]=0,c[10]=p,c[14]=_,c[3]=0,c[7]=0,c[11]=-1,c[15]=0,this}
vendor: 25,713 bytes, line 1
1makeOrthographic(e,t,n,r,s,a,o=Un,l=!1){const c=this.elements,u=2/(t-e),h=2/(n-r),d=-(t+e)/(t-e),f=-(n+r)/(n-r);let p,_;if(l)p=1/(a-s),_=a/(a-s);else if(o===Un)p=-2/(a-s),_=-(a+s)/(a-s);else if(o===Ur)p=-1/(a-s),_=-s/(a-s);else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);return c[0]=u,c[4]=0,c[8]=0,c[12]=d,c[1]=0,c[5]=h,c[9]=0,c[13]=f,c[2]=0,c[6]=0,c[10]=p,c[14]=_,c[3]=0,c[7]=0,c[11]=0,c[15]=1,this}equals(e){const t=this.elements,n=e.elements;for(let r=0;r<16;r++)if(t[r]!==n[r])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}};_c.prototype.isMatrix4=!0;let We=_c;const $r=new P,qn=new We,$S=new P(0,0,0),YS=new P(1,1,1),ki=new P,_o=new P,Pn=new P,Uf=new We,Ff=new tn;class ni{constructor(e=0,t=0,n=0,r=ni.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=n,this._order=r}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,r=this._order){return this._x=e,this._y=t,this._z=n,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){const r=e.elements,s=r[0],a=r[4],o=r[8],l=r[1],c=r[5],u=r[9],h=r[2],d=r[6],f=r[10];switch(t){case"XYZ":this._y=Math.asin($e(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-u,f),this._z=Math.atan2(-a,s)):(this._x=Math.atan2(d,c),this._z=0);break;case"YXZ":this._x=Math.asin(-$e(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(o,f),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-h,s),this._z=0);break;case"ZXY":this._x=Math.asin($e(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-h,f),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-$e(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(d,f),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-a,c));break;case"YZX":this._z=Math.asin($e(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-h,s)):(this._x=0,this._y=Math.atan2(o,f));break;case"XZY":this._z=Math.asin(-$e(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(o,s)):(this._x=Math.atan2(-u,f),this._y=0);break;default:_e("Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return Uf.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Uf,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return Ff.setFromEuler(this),this.setFromQuaternion(Ff,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}ni.DEFAULT_ORDER="XYZ";class ao{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!==0}isEnabled(e){return(this.mask&(1<<e|0))!==0}}let ZS=0;const Bf=new P,Yr=new tn,yi=new We,vo=new P,Ks=new P,KS=new P,JS=new tn,kf=new P(1,0,0),Vf=new P(0,1,0),zf=new P(0,0,1),Hf={type:"added"},jS={type:"removed"},Zr={type:"childadded",child:null},du={type:"childremoved",child:null};class pt extends ii{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:ZS++}),this.uuid=Fn(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=pt.DEFAULT_UP.clone();const e=new P,t=new ni,n=new tn,r=new P(1,1,1);function s(){n.setFromEuler(t,!1)}function a(){t.setFromQuaternion(n,void 0,!1)}t._onChange(s),n._onChange(a),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new We},normalMatrix:{value:new tt}}),this.matrix=new We,this.matrixWorld=new We,this.matrixAutoUpdate=pt.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=pt.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new ao,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.customDepthMaterial=void 0,this.customDistanceMaterial=void 0,this.static=!1,this.userData={},this.pivot=null}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return Yr.setFromAxisAngle(e,t),this.quaternion.multiply(Yr),this}rotateOnWorldAxis(e,t){return Yr.setFromAxisAngle(e,t),this.quaternion.premultiply(Yr),this}rotateX(e){return this.rotateOnAxis(kf,e)}rotateY(e){return this.rotateOnAxis(Vf,e)}rotateZ(e){return this.rotateOnAxis(zf,e)}translateOnAxis(e,t){return Bf.copy(e).applyQuaternion(this.quaternion),this.position.add(Bf.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(kf,e)}translateY(e){return this.translateOnAxis(Vf,e)}translateZ(e){return this.translateOnAxis(zf,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(yi.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?vo.copy(e):vo.set(e,t,n);const r=this.parent;this.updateWorldMatrix(!0,!1),Ks.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?yi.lookAt(Ks,vo,this.up):yi.lookAt(vo,Ks,this.up),this.quaternion.setFromRotationMatrix(yi),r&&(yi.extractRotation(r.matrixWorld),Yr.setFromRotationMatrix(yi),this.quaternion.premultiply(Yr.invert()))}add(e){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(Oe("Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(Hf),Zr.child=e,this.dispatchEvent(Zr),Zr.child=null):Oe("Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.remove(arguments[n]);return this}const t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(jS),du.child=e,this.dispatchEvent(du),du.child=null),this}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),yi.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),yi.multiply(e.parent.matrixWorld)),e.applyMatrix4(yi),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(Hf),Zr.child=e,this.dispatchEvent(Zr),Zr.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let n=0,r=this.children.length;n<r;n++){const a=this.children[n].getObjectByProperty(e,t);if(a!==void 0)return a}}getObjectsByProperty(e,t,n=[]){this[e]===t&&n.push(this);const r=this.children;for(let s=0,a=r.length;s<a;s++)r[s].getObjectsByProperty(e,t,n);return n}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Ks,e,KS),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Ks,JS,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].traverseVisible(e)}traverseAncestors(e){const t=this.parent;t!==null&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale);const e=this.pivot;if(e!==null){const t=e.x,n=e.y,r=e.z,s=this.matrix.elements;s[12]+=t-s[0]*t-s[4]*n-s[8]*r,s[13]+=n-s[1]*t-s[5]*n-s[9]*r,s[14]+=r-s[2]*t-s[6]*n-s[10]*r}this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);const t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].updateMatrixWorld(e)}updateWorldMatrix(e,t){const n=this.parent;if(e===!0&&n!==null&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),t===!0){const r=this.children;for(let s=0,a=r.length;s<a;s++)r[s].updateWorldMatrix(!1,!0)}}toJSON(e){const t=e===void 0||typeof e=="string",n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.7,type:"Object",generator:"Object3D.toJSON"});const r={};r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.castShadow===!0&&(r.castShadow=!0),this.receiveShadow===!0&&(r.receiveShadow=!0),this.visible===!1&&(r.visible=!1),this.frustumCulled===!1&&(r.frustumCulled=!1),this.renderOrder!==0&&(r.renderOrder=this.renderOrder),this.static!==!1&&(r.static=this.static),Object.keys(this.userData).length>0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),this.pivot!==null&&(r.pivot=this.pivot.toArray()),this.matrixAutoUpdate===!1&&(r.matrixAutoUpdate=!1),this.morphTargetDictionary!==void 0&&(r.morphTargetDictionary=Object.assign({},this.morphTargetDictionary)),this.morphTargetInfluences!==void 0&&(r.morphTargetInfluences=this.morphTargetInfluences.slice()),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type="BatchedMesh",r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.geometryInfo=this._geometryInfo.map(o=>({...o,boundingBox:o.boundingBox?o.boundingBox.toJSON():void 0,boundingSphere:o.boundingSphere?o.boundingSphere.toJSON():void 0})),r.instanceInfo=this._instanceInfo.map(o=>({...o})),r.availableInstanceIds=this._availableInstanceIds.slice(),r.availableGeometryIds=this._availableGeometryIds.slice(),r.nextIndexStart=this._nextIndexStart,r.nextVertexStart=this._nextVertexStart,r.geometryCount=this._geometryCount,r.maxInstanceCount=this._maxInstanceCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.matricesTexture=this._matricesTexture.toJSON(e),r.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(r.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(r.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(r.boundingBox=this.boundingBox.toJSON()));function s(o,l){return o[l.uuid]===void 0&&(o[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=s(e.geometries,this.geometry);const o=this.geometry.parameters;if(o!==void 0&&o.shapes!==void 0){const l=o.shapes;if(Array.isArray(l))for(let c=0,u=l.length;c<u;c++){const h=l[c];s(e.shapes,h)}else s(e.shapes,l)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(s(e.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const o=[];for(let l=0,c=this.material.length;l<c;l++)o.push(s(e.materials,this.material[l]));r.material=o}else r.material=s(e.materials,this.material);if(this.children.length>0){r.children=[];for(let o=0;o<this.children.length;o++)r.children.push(this.children[o].toJSON(e).object)}if(this.animations.length>0){r.animations=[];for(let o=0;o<this.animations.length;o++){const l=this.animations[o];r.animations.push(s(e.animations,l))}}if(t){const o=a(e.geometries),l=a(e.materials),c=a(e.textures),u=a(e.images),h=a(e.shapes),d=a(e.skeletons),f=a(e.animations),p=a(e.nodes);o.length>0&&(n.geometries=o),l.length>0&&(n.materials=l),c.length>0&&(n.textures=c),u.length>0&&(n.images=u),h.length>0&&(n.shapes=h),d.length>0&&(n.skeletons=d),f.length>0&&(n.animations=f),p.length>0&&(n.nodes=p)}return n.object=r,n;function a(o){const l=[];for(const c in o){const u=o[c];delete u.metadata,l.push(u)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.pivot=e.pivot!==null?e.pivot.clone():null,this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.static=e.static,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let n=0;n<e.children.length;n++){const r=e.children[n];this.add(r.clone())}return this}}pt.DEFAULT_UP=new P(0,1,0);pt.DEFAULT_MATRIX_AUTO_UPDATE=!0;pt.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;class _s extends pt{constructor(){super(),this.isGroup=!0,this.type="Group"}}const QS={type:"move"};class dl{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new _s,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new _s,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new P,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new P),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new _s,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new P,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new P,this._grip.eventsEnabled=!1),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const n of e.hand.values())this._getHandJoint(t,n)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,n){let r=null,s=null,a=null;const o=this._targetRay,l=this._grip,c=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(c&&e.hand){a=!0;for(const _ of e.hand.values()){const g=t.getJointPose(_,n),m=this._getHandJoint(c,_);g!==null&&(m.matrix.fromArray(g.transform.matrix),m.matrix.decompose(m.position,m.rotation,m.scale),m.matrixWorldNeedsUpdate=!0,m.jointRadius=g.radius),m.visible=g!==null}const u=c.joints["index-finger-tip"],h=c.joints["thumb-tip"],d=u.position.distanceTo(h.position),f=.02,p=.005;c.inputState.pinching&&d>f+p?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&d<=f-p&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,n),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1,l.eventsEnabled&&l.dispatchEvent({type:"gripUpdated",data:e,target:this})));o!==null&&(r=t.getPose(e.targetRaySpace,n),r===null&&s!==null&&(r=s),r!==null&&(o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,r.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(r.linearVelocity)):o.hasLinearVelocity=!1,r.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(r.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(QS)))}return o!==null&&(o.visible=r!==null),l!==null&&(l.visible=s!==null),c!==null&&(c.visible=a!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const n=new _s;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}}const f_={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Vi={h:0,s:0,l:0},xo={h:0,s:0,l:0};function fu(i,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?i+(e-i)*6*t:t<1/2?e:t<2/3?i+(e-i)*6*(2/3-t):i}class Ee{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,n)}set(e,t,n){if(t===void 0&&n===void 0){const r=e;r&&r.isColor?this.copy(r):typeof r=="number"?this.setHex(r):typeof r=="string"&&this.setStyle(r)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Tn){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,dt.colorSpaceToWorking(this,t),this}setRGB(e,t,n,r=dt.workingColorSpace){return this.r=e,this.g=t,this.b=n,dt.colorSpaceToWorking(this,r),this}setHSL(e,t,n,r=dt.workingColorSpace){if(e=gd(e,1),t=$e(t,0,1),n=$e(n,0,1),t===0)this.r=this.g=this.b=n;else{const s=n<=.5?n*(1+t):n+t-n*t,a=2*n-s;this.r=fu(a,s,e+1/3),this.g=fu(a,s,e),this.b=fu(a,s,e-1/3)}return dt.colorSpaceToWorking(this,r),this}setStyle(e,t=Tn){function n(s){s!==void 0&&parseFloat(s)<1&&_e("Color: Alpha component of "+e+" will be ignored.")}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let s;const a=r[1],o=r[2];switch(a){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,t);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,t);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,t);break;default:_e("Color: Unknown color model "+e)}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){const s=r[1],a=s.length;if(a===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,t);if(a===6)return this.setHex(parseInt(s,16),t);_e("Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=Tn){const n=f_[e.toLowerCase()];return n!==void 0?this.setHex(n,t):_e("Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=Ii(e.r),this.g=Ii(e.g),this.b=Ii(e.b),this}copyLinearToSRGB(e){return this.r=Ss(e.r),this.g=Ss(e.g),this.b=Ss(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Tn){return dt.workingToColorSpace(on.copy(this),e),Math.round($e(on.r*255,0,255))*65536+Math.round($e(on.g*255,0,255))*256+Math.round($e(on.b*255,0,255))}getHexString(e=Tn){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=dt.workingColorSpace){dt.workingToColorSpace(on.copy(this),t);const n=on.r,r=on.g,s=on.b,a=Math.max(n,r,s),o=Math.min(n,r,s);let l,c;const u=(o+a)/2;if(o===a)l=0,c=0;else{const h=a-o;switch(c=u<=.5?h/(a+o):h/(2-a-o),a){case n:l=(r-s)/h+(r<s?6:0);break;case r:l=(s-n)/h+2;break;case s:l=(n-r)/h+4;break}l/=6}return e.h=l,e.s=c,e.l=u,e}getRGB(e,t=dt.workingColorSpace){return dt.workingToColorSpace(on.copy(this),t),e.r=on.r,e.g=on.g,e.b=on.b,e}getStyle(e=Tn){dt.workingToColorSpace(on.copy(this),e);const t=on.r,n=on.g,r=on.b;return e!==Tn?`color(${e} ${t.toFixed(3)} ${n.toFixed(3)} ${r.toFixed(3)})`:`rgb(${Math.round(t*255)},${Math.round(n*255)},${Math.round(r*255)})`}offsetHSL(e,t,n){return this.getHSL(Vi),this.setHSL(Vi.h+e,Vi.s+t,Vi.l+n)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}
vendor: 4,953 bytes, line 1
1lerpColors(e,t,n){return this.r=e.r+(t.r-e.r)*n,this.g=e.g+(t.g-e.g)*n,this.b=e.b+(t.b-e.b)*n,this}lerpHSL(e,t){this.getHSL(Vi),e.getHSL(xo);const n=Aa(Vi.h,xo.h,t),r=Aa(Vi.s,xo.s,t),s=Aa(Vi.l,xo.l,t);return this.setHSL(n,r,s),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const t=this.r,n=this.g,r=this.b,s=e.elements;return this.r=s[0]*t+s[3]*n+s[6]*r,this.g=s[1]*t+s[4]*n+s[7]*r,this.b=s[2]*t+s[5]*n+s[8]*r,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const on=new Ee;Ee.NAMES=f_;class Dc{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new Ee(e),this.density=t}clone(){return new Dc(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class Oc{constructor(e,t=1,n=1e3){this.isFog=!0,this.name="",this.color=new Ee(e),this.near=t,this.far=n}clone(){return new Oc(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class Uc extends pt{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new ni,this.environmentIntensity=1,this.environmentRotation=new ni,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}}const $n=new P,bi=new P,pu=new P,Si=new P,Kr=new P,Jr=new P,Gf=new P,mu=new P,gu=new P,_u=new P,vu=new Et,xu=new Et,yu=new Et;class un{constructor(e=new P,t=new P,n=new P){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,r){r.subVectors(n,t),$n.subVectors(e,t),r.cross($n);const s=r.lengthSq();return s>0?r.multiplyScalar(1/Math.sqrt(s)):r.set(0,0,0)}static getBarycoord(e,t,n,r,s){$n.subVectors(r,t),bi.subVectors(n,t),pu.subVectors(e,t);const a=$n.dot($n),o=$n.dot(bi),l=$n.dot(pu),c=bi.dot(bi),u=bi.dot(pu),h=a*c-o*o;if(h===0)return s.set(0,0,0),null;const d=1/h,f=(c*l-o*u)*d,p=(a*u-o*l)*d;return s.set(1-f-p,p,f)}static containsPoint(e,t,n,r){return this.getBarycoord(e,t,n,r,Si)===null?!1:Si.x>=0&&Si.y>=0&&Si.x+Si.y<=1}static getInterpolation(e,t,n,r,s,a,o,l){return this.getBarycoord(e,t,n,r,Si)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(s,Si.x),l.addScaledVector(a,Si.y),l.addScaledVector(o,Si.z),l)}static getInterpolatedAttribute(e,t,n,r,s,a){return vu.setScalar(0),xu.setScalar(0),yu.setScalar(0),vu.fromBufferAttribute(e,t),xu.fromBufferAttribute(e,n),yu.fromBufferAttribute(e,r),a.setScalar(0),a.addScaledVector(vu,s.x),a.addScaledVector(xu,s.y),a.addScaledVector(yu,s.z),a}static isFrontFacing(e,t,n,r){return $n.subVectors(n,t),bi.subVectors(e,t),$n.cross(bi).dot(r)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,r){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,t,n,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,r),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return $n.subVectors(this.c,this.b),bi.subVectors(this.a,this.b),$n.cross(bi).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return un.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return un.getBarycoord(e,this.a,this.b,this.c,t)}
vendor: 10,706 bytes, line 1
1getInterpolation(e,t,n,r,s){return un.getInterpolation(e,this.a,this.b,this.c,t,n,r,s)}containsPoint(e){return un.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return un.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const n=this.a,r=this.b,s=this.c;let a,o;Kr.subVectors(r,n),Jr.subVectors(s,n),mu.subVectors(e,n);const l=Kr.dot(mu),c=Jr.dot(mu);if(l<=0&&c<=0)return t.copy(n);gu.subVectors(e,r);const u=Kr.dot(gu),h=Jr.dot(gu);if(u>=0&&h<=u)return t.copy(r);const d=l*h-u*c;if(d<=0&&l>=0&&u<=0)return a=l/(l-u),t.copy(n).addScaledVector(Kr,a);_u.subVectors(e,s);const f=Kr.dot(_u),p=Jr.dot(_u);if(p>=0&&f<=p)return t.copy(s);const _=f*c-l*p;if(_<=0&&c>=0&&p<=0)return o=c/(c-p),t.copy(n).addScaledVector(Jr,o);const g=u*p-f*h;if(g<=0&&h-u>=0&&f-p>=0)return Gf.subVectors(s,r),o=(h-u)/(h-u+(f-p)),t.copy(r).addScaledVector(Gf,o);const m=1/(g+_+d);return a=_*m,o=d*m,t.copy(n).addScaledVector(Kr,a).addScaledVector(Jr,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}class hn{constructor(e=new P(1/0,1/0,1/0),t=new P(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t+=3)this.expandByPoint(Yn.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,n=e.count;t<n;t++)this.expandByPoint(Yn.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const n=Yn.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);const n=e.geometry;if(n!==void 0){const s=n.getAttribute("position");if(t===!0&&s!==void 0&&e.isInstancedMesh!==!0)for(let a=0,o=s.count;a<o;a++)e.isMesh===!0?e.getVertexPosition(a,Yn):Yn.fromBufferAttribute(s,a),Yn.applyMatrix4(e.matrixWorld),this.expandByPoint(Yn);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),yo.copy(e.boundingBox)):(n.boundingBox===null&&n.computeBoundingBox(),yo.copy(n.boundingBox)),yo.applyMatrix4(e.matrixWorld),this.union(yo)}const r=e.children;for(let s=0,a=r.length;s<a;s++)this.expandByObject(r[s],t);return this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,Yn),Yn.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Js),bo.subVectors(this.max,Js),jr.subVectors(e.a,Js),Qr.subVectors(e.b,Js),es.subVectors(e.c,Js),zi.subVectors(Qr,jr),Hi.subVectors(es,Qr),or.subVectors(jr,es);let t=[0,-zi.z,zi.y,0,-Hi.z,Hi.y,0,-or.z,or.y,zi.z,0,-zi.x,Hi.z,0,-Hi.x,or.z,0,-or.x,-zi.y,zi.x,0,-Hi.y,Hi.x,0,-or.y,or.x,0];return!bu(t,jr,Qr,es,bo)||(t=[1,0,0,0,1,0,0,0,1],!bu(t,jr,Qr,es,bo))?!1:(So.crossVectors(zi,Hi),t=[So.x,So.y,So.z],bu(t,jr,Qr,es,bo))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Yn).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Yn).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(Mi[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Mi[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Mi[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Mi[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Mi[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Mi[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Mi[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Mi[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Mi),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}}const Mi=[new P,new P,new P,new P,new P,new P,new P,new P],Yn=new P,yo=new hn,jr=new P,Qr=new P,es=new P,zi=new P,Hi=new P,or=new P,Js=new P,bo=new P,So=new P,lr=new P;function bu(i,e,t,n,r){for(let s=0,a=i.length-3;s<=a;s+=3){lr.fromArray(i,s);const o=r.x*Math.abs(lr.x)+r.y*Math.abs(lr.y)+r.z*Math.abs(lr.z),l=e.dot(lr),c=t.dot(lr),u=n.dot(lr);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>o)return!1}return!0}const Ri=eM();function eM(){const i=new ArrayBuffer(4),e=new Float32Array(i),t=new Uint32Array(i),n=new Uint32Array(512),r=new Uint32Array(512);for(let l=0;l<256;++l){const c=l-127;c<-27?(n[l]=0,n[l|256]=32768,r[l]=24,r[l|256]=24):c<-14?(n[l]=1024>>-c-14,n[l|256]=1024>>-c-14|32768,r[l]=-c-1,r[l|256]=-c-1):c<=15?(n[l]=c+15<<10,n[l|256]=c+15<<10|32768,r[l]=13,r[l|256]=13):c<128?(n[l]=31744,n[l|256]=64512,r[l]=24,r[l|256]=24):(n[l]=31744,n[l|256]=64512,r[l]=13,r[l|256]=13)}const s=new Uint32Array(2048),a=new Uint32Array(64),o=new Uint32Array(64);for(let l=1;l<1024;++l){let c=l<<13,u=0;for(;(c&8388608)===0;)c<<=1,u-=8388608;c&=-8388609,u+=947912704,s[l]=c|u}for(let l=1024;l<2048;++l)s[l]=939524096+(l-1024<<13);for(let l=1;l<31;++l)a[l]=l<<23;a[31]=1199570944,a[32]=2147483648;for(let l=33;l<63;++l)a[l]=2147483648+(l-32<<23);a[63]=3347054592;for(let l=1;l<64;++l)l!==32&&(o[l]=1024);return{floatView:e,uint32View:t,baseTable:n,shiftTable:r,mantissaTable:s,exponentTable:a,offsetTable:o}}function En(i){Math.abs(i)>65504&&_e("DataUtils.toHalfFloat(): Value out of range."),i=$e(i,-65504,65504),Ri.floatView[0]=i;const e=Ri.uint32View[0],t=e>>23&511;return Ri.baseTable[t]+((e&8388607)>>Ri.shiftTable[t])}function da(i){const e=i>>10;return Ri.uint32View[0]=Ri.mantissaTable[Ri.offsetTable[e]+(i&1023)]+Ri.exponentTable[e],Ri.floatView[0]}class tM{static toHalfFloat(e){return En(e)}static fromHalfFloat(e){return da(e)}}const qt=new P,Mo=new j;let nM=0;class ut extends ii{constructor(e,t,n=!1){if(super(),Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:nM++}),this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=n,this.usage=Wa,this.updateRanges=[],this.gpuType=vn,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let r=0,s=this.itemSize;r<s;r++)this.array[e+r]=t.array[n+r];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,n=this.count;t<n;t++)Mo.fromBufferAttribute(this,t),Mo.applyMatrix3(e),this.setXY(t,Mo.x,Mo.y);else if(this.itemSize===3)for(let t=0,n=this.count;t<n;t++)qt.fromBufferAttribute(this,t),qt.applyMatrix3(e),this.setXYZ(t,qt.x,qt.y,qt.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)qt.fromBufferAttribute(this,t),qt.applyMatrix4(e),this.setXYZ(t,qt.x,qt.y,qt.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)qt.fromBufferAttribute(this,t),qt.applyNormalMatrix(e),this.setXYZ(t,qt.x,qt.y,qt.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)qt.fromBufferAttribute(this,t),qt.transformDirection(e),this.setXYZ(t,qt.x,qt.y,qt.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let n=this.array[e*this.itemSize+t];return this.normalized&&(n=gn(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=at(n,this.array)),this.array[e*this.itemSize+t]=n,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=gn(t,this.array)),t}setX(e,t){return this.normalized&&(t=at(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=gn(t,this.array)),t}setY(e,t){return this.normalized&&(t=at(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=gn(t,this.array)),t}setZ(e,t){return this.normalized&&(t=at(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=gn(t,this.array)),t}setW(e,t){return this.normalized&&(t=at(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=at(t,this.array),n=at(n,this.array)),this.array[e+0]=t,this.array[e+1]=n,this}setXYZ(e,t,n,r){return e*=this.itemSize,this.normalized&&(t=at(t,this.array),n=at(n,this.array),r=at(r,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this}
vendor: 5,686 bytes, line 1
1setXYZW(e,t,n,r,s){return e*=this.itemSize,this.normalized&&(t=at(t,this.array),n=at(n,this.array),r=at(r,this.array),s=at(s,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this.array[e+3]=s,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(e.name=this.name),this.usage!==Wa&&(e.usage=this.usage),e}dispose(){this.dispatchEvent({type:"dispose"})}}class iM extends ut{constructor(e,t,n){super(new Int8Array(e),t,n)}}class rM extends ut{constructor(e,t,n){super(new Uint8Array(e),t,n)}}class sM extends ut{constructor(e,t,n){super(new Uint8ClampedArray(e),t,n)}}class aM extends ut{constructor(e,t,n){super(new Int16Array(e),t,n)}}class vd extends ut{constructor(e,t,n){super(new Uint16Array(e),t,n)}}class oM extends ut{constructor(e,t,n){super(new Int32Array(e),t,n)}}class xd extends ut{constructor(e,t,n){super(new Uint32Array(e),t,n)}}class lM extends ut{constructor(e,t,n){super(new Uint16Array(e),t,n),this.isFloat16BufferAttribute=!0}getX(e){let t=da(this.array[e*this.itemSize]);return this.normalized&&(t=gn(t,this.array)),t}setX(e,t){return this.normalized&&(t=at(t,this.array)),this.array[e*this.itemSize]=En(t),this}getY(e){let t=da(this.array[e*this.itemSize+1]);return this.normalized&&(t=gn(t,this.array)),t}setY(e,t){return this.normalized&&(t=at(t,this.array)),this.array[e*this.itemSize+1]=En(t),this}getZ(e){let t=da(this.array[e*this.itemSize+2]);return this.normalized&&(t=gn(t,this.array)),t}setZ(e,t){return this.normalized&&(t=at(t,this.array)),this.array[e*this.itemSize+2]=En(t),this}getW(e){let t=da(this.array[e*this.itemSize+3]);return this.normalized&&(t=gn(t,this.array)),t}setW(e,t){return this.normalized&&(t=at(t,this.array)),this.array[e*this.itemSize+3]=En(t),this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=at(t,this.array),n=at(n,this.array)),this.array[e+0]=En(t),this.array[e+1]=En(n),this}setXYZ(e,t,n,r){return e*=this.itemSize,this.normalized&&(t=at(t,this.array),n=at(n,this.array),r=at(r,this.array)),this.array[e+0]=En(t),this.array[e+1]=En(n),this.array[e+2]=En(r),this}setXYZW(e,t,n,r,s){return e*=this.itemSize,this.normalized&&(t=at(t,this.array),n=at(n,this.array),r=at(r,this.array),s=at(s,this.array)),this.array[e+0]=En(t),this.array[e+1]=En(n),this.array[e+2]=En(r),this.array[e+3]=En(s),this}}class Pe extends ut{constructor(e,t,n){super(new Float32Array(e),t,n)}}const cM=new hn,js=new P,Su=new P;class nn{constructor(e=new P,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const n=this.center;t!==void 0?n.copy(t):cM.setFromPoints(e).getCenter(n);let r=0;for(let s=0,a=e.length;s<a;s++)r=Math.max(r,n.distanceToSquared(e[s]));return this.radius=Math.sqrt(r),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){const n=this.center.distanceToSquared(e);return t.copy(e),n>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;js.subVectors(e,this.center);const t=js.lengthSq();if(t>this.radius*this.radius){const n=Math.sqrt(t),r=(n-this.radius)*.5;this.center.addScaledVector(js,r/n),this.radius+=r}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(Su.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(js.copy(e.center).add(Su)),this.expandByPoint(js.copy(e.center).sub(Su))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(e){return this.radius=e.radius,this.center.fromArray(e.center),this}}let uM=0;const Vn=new We,Mu=new pt,ts=new P,Ln=new hn,Qs=new hn,Kt=new P;class et extends ii{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:uM++}),this.uuid=Fn(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=null,this.indirectOffset=0,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(yS(e)?xd:vd)(e,1):this.index=e,this}setIndirect(e,t=0){return this.indirect=e,this.indirectOffset=t,this}getIndirect(){return this.indirect}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}
vendor: 16,351 bytes, line 1
1addGroup(e,t,n=0){this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);const n=this.attributes.normal;if(n!==void 0){const s=new tt().getNormalMatrix(e);n.applyNormalMatrix(s),n.needsUpdate=!0}const r=this.attributes.tangent;return r!==void 0&&(r.transformDirection(e),r.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return Vn.makeRotationFromQuaternion(e),this.applyMatrix4(Vn),this}rotateX(e){return Vn.makeRotationX(e),this.applyMatrix4(Vn),this}rotateY(e){return Vn.makeRotationY(e),this.applyMatrix4(Vn),this}rotateZ(e){return Vn.makeRotationZ(e),this.applyMatrix4(Vn),this}translate(e,t,n){return Vn.makeTranslation(e,t,n),this.applyMatrix4(Vn),this}scale(e,t,n){return Vn.makeScale(e,t,n),this.applyMatrix4(Vn),this}lookAt(e){return Mu.lookAt(e),Mu.updateMatrix(),this.applyMatrix4(Mu.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(ts).negate(),this.translate(ts.x,ts.y,ts.z),this}setFromPoints(e){const t=this.getAttribute("position");if(t===void 0){const n=[];for(let r=0,s=e.length;r<s;r++){const a=e[r];n.push(a.x,a.y,a.z||0)}this.setAttribute("position",new Pe(n,3))}else{const n=Math.min(e.length,t.count);for(let r=0;r<n;r++){const s=e[r];t.setXYZ(r,s.x,s.y,s.z||0)}e.length>t.count&&_e("BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),t.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new hn);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){Oe("BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new P(-1/0,-1/0,-1/0),new P(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let n=0,r=t.length;n<r;n++){const s=t[n];Ln.setFromBufferAttribute(s),this.morphTargetsRelative?(Kt.addVectors(this.boundingBox.min,Ln.min),this.boundingBox.expandByPoint(Kt),Kt.addVectors(this.boundingBox.max,Ln.max),this.boundingBox.expandByPoint(Kt)):(this.boundingBox.expandByPoint(Ln.min),this.boundingBox.expandByPoint(Ln.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&Oe('BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new nn);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){Oe("BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new P,1/0);return}if(e){const n=this.boundingSphere.center;if(Ln.setFromBufferAttribute(e),t)for(let s=0,a=t.length;s<a;s++){const o=t[s];Qs.setFromBufferAttribute(o),this.morphTargetsRelative?(Kt.addVectors(Ln.min,Qs.min),Ln.expandByPoint(Kt),Kt.addVectors(Ln.max,Qs.max),Ln.expandByPoint(Kt)):(Ln.expandByPoint(Qs.min),Ln.expandByPoint(Qs.max))}Ln.getCenter(n);let r=0;for(let s=0,a=e.count;s<a;s++)Kt.fromBufferAttribute(e,s),r=Math.max(r,n.distanceToSquared(Kt));if(t)for(let s=0,a=t.length;s<a;s++){const o=t[s],l=this.morphTargetsRelative;for(let c=0,u=o.count;c<u;c++)Kt.fromBufferAttribute(o,c),l&&(ts.fromBufferAttribute(e,c),Kt.add(ts)),r=Math.max(r,n.distanceToSquared(Kt))}this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&Oe('BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,t=this.attributes;if(e===null||t.position===void 0||t.normal===void 0||t.uv===void 0){Oe("BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const n=t.position,r=t.normal,s=t.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new ut(new Float32Array(4*n.count),4));const a=this.getAttribute("tangent"),o=[],l=[];for(let x=0;x<n.count;x++)o[x]=new P,l[x]=new P;const c=new P,u=new P,h=new P,d=new j,f=new j,p=new j,_=new P,g=new P;function m(x,M,A){c.fromBufferAttribute(n,x),u.fromBufferAttribute(n,M),h.fromBufferAttribute(n,A),d.fromBufferAttribute(s,x),f.fromBufferAttribute(s,M),p.fromBufferAttribute(s,A),u.sub(c),h.sub(c),f.sub(d),p.sub(d);const I=1/(f.x*p.y-p.x*f.y);isFinite(I)&&(_.copy(u).multiplyScalar(p.y).addScaledVector(h,-f.y).multiplyScalar(I),g.copy(h).multiplyScalar(f.x).addScaledVector(u,-p.x).multiplyScalar(I),o[x].add(_),o[M].add(_),o[A].add(_),l[x].add(g),l[M].add(g),l[A].add(g))}let v=this.groups;v.length===0&&(v=[{start:0,count:e.count}]);for(let x=0,M=v.length;x<M;++x){const A=v[x],I=A.start,N=A.count;for(let U=I,k=I+N;U<k;U+=3)m(e.getX(U+0),e.getX(U+1),e.getX(U+2))}const b=new P,y=new P,T=new P,S=new P;function R(x){T.fromBufferAttribute(r,x),S.copy(T);const M=o[x];b.copy(M),b.sub(T.multiplyScalar(T.dot(M))).normalize(),y.crossVectors(S,M);const I=y.dot(l[x])<0?-1:1;a.setXYZW(x,b.x,b.y,b.z,I)}for(let x=0,M=v.length;x<M;++x){const A=v[x],I=A.start,N=A.count;for(let U=I,k=I+N;U<k;U+=3)R(e.getX(U+0)),R(e.getX(U+1)),R(e.getX(U+2))}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(t!==void 0){let n=this.getAttribute("normal");if(n===void 0)n=new ut(new Float32Array(t.count*3),3),this.setAttribute("normal",n);else for(let d=0,f=n.count;d<f;d++)n.setXYZ(d,0,0,0);const r=new P,s=new P,a=new P,o=new P,l=new P,c=new P,u=new P,h=new P;if(e)for(let d=0,f=e.count;d<f;d+=3){const p=e.getX(d+0),_=e.getX(d+1),g=e.getX(d+2);r.fromBufferAttribute(t,p),s.fromBufferAttribute(t,_),a.fromBufferAttribute(t,g),u.subVectors(a,s),h.subVectors(r,s),u.cross(h),o.fromBufferAttribute(n,p),l.fromBufferAttribute(n,_),c.fromBufferAttribute(n,g),o.add(u),l.add(u),c.add(u),n.setXYZ(p,o.x,o.y,o.z),n.setXYZ(_,l.x,l.y,l.z),n.setXYZ(g,c.x,c.y,c.z)}else for(let d=0,f=t.count;d<f;d+=3)r.fromBufferAttribute(t,d+0),s.fromBufferAttribute(t,d+1),a.fromBufferAttribute(t,d+2),u.subVectors(a,s),h.subVectors(r,s),u.cross(h),n.setXYZ(d+0,u.x,u.y,u.z),n.setXYZ(d+1,u.x,u.y,u.z),n.setXYZ(d+2,u.x,u.y,u.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let t=0,n=e.count;t<n;t++)Kt.fromBufferAttribute(e,t),Kt.normalize(),e.setXYZ(t,Kt.x,Kt.y,Kt.z)}toNonIndexed(){function e(o,l){const c=o.array,u=o.itemSize,h=o.normalized,d=new c.constructor(l.length*u);let f=0,p=0;for(let _=0,g=l.length;_<g;_++){o.isInterleavedBufferAttribute?f=l[_]*o.data.stride+o.offset:f=l[_]*u;for(let m=0;m<u;m++)d[p++]=c[f++]}return new ut(d,u,h)}if(this.index===null)return _e("BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new et,n=this.index.array,r=this.attributes;for(const o in r){const l=r[o],c=e(l,n);t.setAttribute(o,c)}const s=this.morphAttributes;for(const o in s){const l=[],c=s[o];for(let u=0,h=c.length;u<h;u++){const d=c[u],f=e(d,n);l.push(f)}t.morphAttributes[o]=l}t.morphTargetsRelative=this.morphTargetsRelative;const a=this.groups;for(let o=0,l=a.length;o<l;o++){const c=a[o];t.addGroup(c.start,c.count,c.materialIndex)}return t}toJSON(){const e={metadata:{version:4.7,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,this.name!==""&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const n=this.attributes;for(const l in n){const c=n[l];e.data.attributes[l]=c.toJSON(e.data)}const r={};let s=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],u=[];for(let h=0,d=c.length;h<d;h++){const f=c[h];u.push(f.toJSON(e.data))}u.length>0&&(r[l]=u,s=!0)}s&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));const o=this.boundingSphere;return o!==null&&(e.data.boundingSphere=o.toJSON()),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const n=e.index;n!==null&&this.setIndex(n.clone());const r=e.attributes;for(const c in r){const u=r[c];this.setAttribute(c,u.clone(t))}const s=e.morphAttributes;for(const c in s){const u=[],h=s[c];for(let d=0,f=h.length;d<f;d++)u.push(h[d].clone(t));this.morphAttributes[c]=u}this.morphTargetsRelative=e.morphTargetsRelative;const a=e.groups;for(let c=0,u=a.length;c<u;c++){const h=a[c];this.addGroup(h.start,h.count,h.materialIndex)}const o=e.boundingBox;o!==null&&(this.boundingBox=o.clone());const l=e.boundingSphere;return l!==null&&(this.boundingSphere=l.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}class Fc{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=Wa,this.updateRanges=[],this.version=0,this.uuid=Fn()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let r=0,s=this.stride;r<s;r++)this.array[e+r]=t.array[n+r];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Fn()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),n=new this.constructor(t,this.stride);return n.setUsage(this.usage),n}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Fn()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}const dn=new P;class Fr{constructor(e,t,n,r=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=e,this.itemSize=t,this.offset=n,this.normalized=r}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,n=this.data.count;t<n;t++)dn.fromBufferAttribute(this,t),dn.applyMatrix4(e),this.setXYZ(t,dn.x,dn.y,dn.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)dn.fromBufferAttribute(this,t),dn.applyNormalMatrix(e),this.setXYZ(t,dn.x,dn.y,dn.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)dn.fromBufferAttribute(this,t),dn.transformDirection(e),this.setXYZ(t,dn.x,dn.y,dn.z);return this}getComponent(e,t){let n=this.array[e*this.data.stride+this.offset+t];return this.normalized&&(n=gn(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=at(n,this.array)),this.data.array[e*this.data.stride+this.offset+t]=n,this}setX(e,t){return this.normalized&&(t=at(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=at(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=at(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=at(t,this.array)),this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){let t=this.data.array[e*this.data.stride+this.offset];return this.normalized&&(t=gn(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=gn(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=gn(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=gn(t,this.array)),t}setXY(e,t,n){return e=e*this.data.stride+this.offset,this.normalized&&(t=at(t,this.array),n=at(n,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this}setXYZ(e,t,n,r){return e=e*this.data.stride+this.offset,this.normalized&&(t=at(t,this.array),n=at(n,this.array),r=at(r,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=r,this}setXYZW(e,t,n,r,s){return e=e*this.data.stride+this.offset,this.normalized&&(t=at(t,this.array),n=at(n,this.array),r=at(r,this.array),s=at(s,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=r,this.data.array[e+3]=s,this}clone(e){if(e===void 0){qa("InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let n=0;n<this.count;n++){const r=n*this.data.stride+this.offset;for(let s=0;s<this.itemSize;s++)t.push(this.data.array[r+s])}return new ut(new this.array.constructor(t),this.itemSize,this.normalized)}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new Fr(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(e===void 0){qa("InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let n=0;n<this.count;n++){const r=n*this.data.stride+this.offset;for(let s=0;s<this.itemSize;s++)t.push(this.data.array[r+s])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}let hM=0;class rn extends ii{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:hM++}),this.uuid=Fn(),this.name="",this.type="Material",this.blending=Ir,this.side=Pi,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=yl,this.blendDst=bl,this.blendEquation=qi,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new Ee(0,0,0),this.blendAlpha=0,this.depthFunc=Or,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=vh,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=yr,this.stencilZFail=yr,this.stencilZPass=yr,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.allowOverride=!0,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const n=e[t];if(n===void 0){_e(`Material: parameter '${t}' has value of undefined.`);continue}const r=this[t];if(r===void 0){_e(`Material: '${t}' is not a property of THREE.${this.type}.`);continue}r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[t]=n}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const n={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};
vendor: 15,038 bytes, line 1
1n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen!==void 0&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(n.sheenColorMap=this.sheenColorMap.toJSON(e).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(n.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(e).uuid),this.dispersion!==void 0&&(n.dispersion=this.dispersion),this.iridescence!==void 0&&(n.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(n.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(n.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapRotation!==void 0&&(n.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==Ir&&(n.blending=this.blending),this.side!==Pi&&(n.side=this.side),this.vertexColors===!0&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=!0),this.blendSrc!==yl&&(n.blendSrc=this.blendSrc),this.blendDst!==bl&&(n.blendDst=this.blendDst),this.blendEquation!==qi&&(n.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(n.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(n.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(n.blendAlpha=this.blendAlpha),this.depthFunc!==Or&&(n.depthFunc=this.depthFunc),this.depthTest===!1&&(n.depthTest=this.depthTest),this.depthWrite===!1&&(n.depthWrite=this.depthWrite),this.colorWrite===!1&&(n.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(n.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==vh&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==yr&&(n.stencilFail=this.stencilFail),this.stencilZFail!==yr&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==yr&&(n.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(n.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaHash===!0&&(n.alphaHash=!0),this.alphaToCoverage===!0&&(n.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=!0),this.forceSinglePass===!0&&(n.forceSinglePass=!0),this.allowOverride===!1&&(n.allowOverride=!1),this.wireframe===!0&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=!0),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),this.fog===!1&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData);function r(s){const a=[];for(const o in s){const l=s[o];delete l.metadata,a.push(l)}return a}if(t){const s=r(e.textures),a=r(e.images);s.length>0&&(n.textures=s),a.length>0&&(n.images=a)}return n}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let n=null;if(t!==null){const r=t.length;n=new Array(r);for(let s=0;s!==r;++s)n[s]=t[s].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.allowOverride=e.allowOverride,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}class yd extends rn{constructor(e){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new Ee(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}let ns;const ea=new P,is=new P,rs=new P,ss=new j,ta=new j,p_=new We,Eo=new P,na=new P,To=new P,Wf=new j,Eu=new j,Xf=new j;class m_ extends pt{constructor(e=new yd){if(super(),this.isSprite=!0,this.type="Sprite",ns===void 0){ns=new et;const t=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),n=new Fc(t,5);ns.setIndex([0,1,2,0,2,3]),ns.setAttribute("position",new Fr(n,3,0,!1)),ns.setAttribute("uv",new Fr(n,2,3,!1))}this.geometry=ns,this.material=e,this.center=new j(.5,.5),this.count=1}raycast(e,t){e.camera===null&&Oe('Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),is.setFromMatrixScale(this.matrixWorld),p_.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),rs.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&is.multiplyScalar(-rs.z);const n=this.material.rotation;let r,s;n!==0&&(s=Math.cos(n),r=Math.sin(n));const a=this.center;wo(Eo.set(-.5,-.5,0),rs,a,is,r,s),wo(na.set(.5,-.5,0),rs,a,is,r,s),wo(To.set(.5,.5,0),rs,a,is,r,s),Wf.set(0,0),Eu.set(1,0),Xf.set(1,1);let o=e.ray.intersectTriangle(Eo,na,To,!1,ea);if(o===null&&(wo(na.set(-.5,.5,0),rs,a,is,r,s),Eu.set(0,1),o=e.ray.intersectTriangle(Eo,To,na,!1,ea),o===null))return;const l=e.ray.origin.distanceTo(ea);l<e.near||l>e.far||t.push({distance:l,point:ea.clone(),uv:un.getInterpolation(ea,Eo,na,To,Wf,Eu,Xf,new j),face:null,object:this})}copy(e,t){return super.copy(e,t),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}function wo(i,e,t,n,r,s){ss.subVectors(i,t).addScalar(.5).multiply(n),r!==void 0?(ta.x=s*ss.x-r*ss.y,ta.y=r*ss.x+s*ss.y):ta.copy(ss),i.copy(e),i.x+=ta.x,i.y+=ta.y,i.applyMatrix4(p_)}const Ao=new P,qf=new P;class g_ extends pt{constructor(){super(),this.isLOD=!0,this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let n=0,r=t.length;n<r;n++){const s=t[n];this.addLevel(s.object.clone(),s.distance,s.hysteresis)}return this.autoUpdate=e.autoUpdate,this}addLevel(e,t=0,n=0){t=Math.abs(t);const r=this.levels;let s;for(s=0;s<r.length&&!(t<r[s].distance);s++);return r.splice(s,0,{distance:t,hysteresis:n,object:e}),this.add(e),this}removeLevel(e){const t=this.levels;for(let n=0;n<t.length;n++)if(t[n].distance===e){const r=t.splice(n,1);return this.remove(r[0].object),!0}return!1}getCurrentLevel(){return this._currentLevel}getObjectForDistance(e){const t=this.levels;if(t.length>0){let n,r;for(n=1,r=t.length;n<r;n++){let s=t[n].distance;if(t[n].object.visible&&(s-=s*t[n].hysteresis),e<s)break}return t[n-1].object}return null}raycast(e,t){if(this.levels.length>0){Ao.setFromMatrixPosition(this.matrixWorld);const r=e.ray.origin.distanceTo(Ao);this.getObjectForDistance(r).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){Ao.setFromMatrixPosition(e.matrixWorld),qf.setFromMatrixPosition(this.matrixWorld);const n=Ao.distanceTo(qf)/e.zoom;t[0].object.visible=!0;let r,s;for(r=1,s=t.length;r<s;r++){let a=t[r].distance;if(t[r].object.visible&&(a-=a*t[r].hysteresis),n>=a)t[r-1].object.visible=!1,t[r].object.visible=!0;else break}for(this._currentLevel=r-1;r<s;r++)t[r].object.visible=!1}}toJSON(e){const t=super.toJSON(e);this.autoUpdate===!1&&(t.object.autoUpdate=!1),t.object.levels=[];const n=this.levels;for(let r=0,s=n.length;r<s;r++){const a=n[r];t.object.levels.push({object:a.object.uuid,distance:a.distance,hysteresis:a.hysteresis})}return t}}const Ei=new P,Tu=new P,Co=new P,Gi=new P,wu=new P,Ro=new P,Au=new P;class nr{constructor(e=new P,t=new P(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,Ei)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=Ei.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(Ei.copy(this.origin).addScaledVector(this.direction,t),Ei.distanceToSquared(e))}distanceSqToSegment(e,t,n,r){Tu.copy(e).add(t).multiplyScalar(.5),Co.copy(t).sub(e).normalize(),Gi.copy(this.origin).sub(Tu);const s=e.distanceTo(t)*.5,a=-this.direction.dot(Co),o=Gi.dot(this.direction),l=-Gi.dot(Co),c=Gi.lengthSq(),u=Math.abs(1-a*a);let h,d,f,p;if(u>0)if(h=a*l-o,d=a*o-l,p=s*u,h>=0)if(d>=-p)if(d<=p){const _=1/u;h*=_,d*=_,f=h*(h+a*d+2*o)+d*(a*h+d+2*l)+c}
vendor: 16,600 bytes, line 1
1else d=s,h=Math.max(0,-(a*d+o)),f=-h*h+d*(d+2*l)+c;else d=-s,h=Math.max(0,-(a*d+o)),f=-h*h+d*(d+2*l)+c;else d<=-p?(h=Math.max(0,-(-a*s+o)),d=h>0?-s:Math.min(Math.max(-s,-l),s),f=-h*h+d*(d+2*l)+c):d<=p?(h=0,d=Math.min(Math.max(-s,-l),s),f=d*(d+2*l)+c):(h=Math.max(0,-(a*s+o)),d=h>0?s:Math.min(Math.max(-s,-l),s),f=-h*h+d*(d+2*l)+c);else d=a>0?-s:s,h=Math.max(0,-(a*d+o)),f=-h*h+d*(d+2*l)+c;return n&&n.copy(this.origin).addScaledVector(this.direction,h),r&&r.copy(Tu).addScaledVector(Co,d),f}intersectSphere(e,t){Ei.subVectors(e.center,this.origin);const n=Ei.dot(this.direction),r=Ei.dot(Ei)-n*n,s=e.radius*e.radius;if(r>s)return null;const a=Math.sqrt(s-r),o=n-a,l=n+a;return l<0?null:o<0?this.at(l,t):this.at(o,t)}intersectsSphere(e){return e.radius<0?!1:this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){const n=this.distanceToPlane(e);return n===null?null:this.at(n,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,r,s,a,o,l;const c=1/this.direction.x,u=1/this.direction.y,h=1/this.direction.z,d=this.origin;return c>=0?(n=(e.min.x-d.x)*c,r=(e.max.x-d.x)*c):(n=(e.max.x-d.x)*c,r=(e.min.x-d.x)*c),u>=0?(s=(e.min.y-d.y)*u,a=(e.max.y-d.y)*u):(s=(e.max.y-d.y)*u,a=(e.min.y-d.y)*u),n>a||s>r||((s>n||isNaN(n))&&(n=s),(a<r||isNaN(r))&&(r=a),h>=0?(o=(e.min.z-d.z)*h,l=(e.max.z-d.z)*h):(o=(e.max.z-d.z)*h,l=(e.min.z-d.z)*h),n>l||o>r)||((o>n||n!==n)&&(n=o),(l<r||r!==r)&&(r=l),r<0)?null:this.at(n>=0?n:r,t)}intersectsBox(e){return this.intersectBox(e,Ei)!==null}intersectTriangle(e,t,n,r,s){wu.subVectors(t,e),Ro.subVectors(n,e),Au.crossVectors(wu,Ro);let a=this.direction.dot(Au),o;if(a>0){if(r)return null;o=1}else if(a<0)o=-1,a=-a;else return null;Gi.subVectors(this.origin,e);const l=o*this.direction.dot(Ro.crossVectors(Gi,Ro));if(l<0)return null;const c=o*this.direction.dot(wu.cross(Gi));if(c<0||l+c>a)return null;const u=-o*Gi.dot(Au);return u<0?null:this.at(u/a,s)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class Oi extends rn{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Ee(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new ni,this.combine=ro,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const $f=new We,cr=new nr,Io=new nn,Yf=new P,Po=new P,Lo=new P,No=new P,Cu=new P,Do=new P,Zf=new P,Oo=new P;class Dt extends pt{constructor(e=new et,t=new Oi){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.count=1,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){const t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){const r=t[n[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,a=r.length;s<a;s++){const o=r[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=s}}}}getVertexPosition(e,t){const n=this.geometry,r=n.attributes.position,s=n.morphAttributes.position,a=n.morphTargetsRelative;t.fromBufferAttribute(r,e);const o=this.morphTargetInfluences;if(s&&o){Do.set(0,0,0);for(let l=0,c=s.length;l<c;l++){const u=o[l],h=s[l];u!==0&&(Cu.fromBufferAttribute(h,e),a?Do.addScaledVector(Cu,u):Do.addScaledVector(Cu.sub(t),u))}t.add(Do)}return t}raycast(e,t){const n=this.geometry,r=this.material,s=this.matrixWorld;r!==void 0&&(n.boundingSphere===null&&n.computeBoundingSphere(),Io.copy(n.boundingSphere),Io.applyMatrix4(s),cr.copy(e.ray).recast(e.near),!(Io.containsPoint(cr.origin)===!1&&(cr.intersectSphere(Io,Yf)===null||cr.origin.distanceToSquared(Yf)>(e.far-e.near)**2))&&($f.copy(s).invert(),cr.copy(e.ray).applyMatrix4($f),!(n.boundingBox!==null&&cr.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(e,t,cr)))}_computeIntersections(e,t,n){let r;const s=this.geometry,a=this.material,o=s.index,l=s.attributes.position,c=s.attributes.uv,u=s.attributes.uv1,h=s.attributes.normal,d=s.groups,f=s.drawRange;if(o!==null)if(Array.isArray(a))for(let p=0,_=d.length;p<_;p++){const g=d[p],m=a[g.materialIndex],v=Math.max(g.start,f.start),b=Math.min(o.count,Math.min(g.start+g.count,f.start+f.count));for(let y=v,T=b;y<T;y+=3){const S=o.getX(y),R=o.getX(y+1),x=o.getX(y+2);r=Uo(this,m,e,n,c,u,h,S,R,x),r&&(r.faceIndex=Math.floor(y/3),r.face.materialIndex=g.materialIndex,t.push(r))}}else{const p=Math.max(0,f.start),_=Math.min(o.count,f.start+f.count);for(let g=p,m=_;g<m;g+=3){const v=o.getX(g),b=o.getX(g+1),y=o.getX(g+2);r=Uo(this,a,e,n,c,u,h,v,b,y),r&&(r.faceIndex=Math.floor(g/3),t.push(r))}}else if(l!==void 0)if(Array.isArray(a))for(let p=0,_=d.length;p<_;p++){const g=d[p],m=a[g.materialIndex],v=Math.max(g.start,f.start),b=Math.min(l.count,Math.min(g.start+g.count,f.start+f.count));for(let y=v,T=b;y<T;y+=3){const S=y,R=y+1,x=y+2;r=Uo(this,m,e,n,c,u,h,S,R,x),r&&(r.faceIndex=Math.floor(y/3),r.face.materialIndex=g.materialIndex,t.push(r))}}else{const p=Math.max(0,f.start),_=Math.min(l.count,f.start+f.count);for(let g=p,m=_;g<m;g+=3){const v=g,b=g+1,y=g+2;r=Uo(this,a,e,n,c,u,h,v,b,y),r&&(r.faceIndex=Math.floor(g/3),t.push(r))}}}}function dM(i,e,t,n,r,s,a,o){let l;if(e.side===yn?l=n.intersectTriangle(a,s,r,!0,o):l=n.intersectTriangle(r,s,a,e.side===Pi,o),l===null)return null;Oo.copy(o),Oo.applyMatrix4(i.matrixWorld);const c=t.ray.origin.distanceTo(Oo);return c<t.near||c>t.far?null:{distance:c,point:Oo.clone(),object:i}}function Uo(i,e,t,n,r,s,a,o,l,c){i.getVertexPosition(o,Po),i.getVertexPosition(l,Lo),i.getVertexPosition(c,No);const u=dM(i,e,t,n,Po,Lo,No,Zf);if(u){const h=new P;un.getBarycoord(Zf,Po,Lo,No,h),r&&(u.uv=un.getInterpolatedAttribute(r,o,l,c,h,new j)),s&&(u.uv1=un.getInterpolatedAttribute(s,o,l,c,h,new j)),a&&(u.normal=un.getInterpolatedAttribute(a,o,l,c,h,new P),u.normal.dot(n.direction)>0&&u.normal.multiplyScalar(-1));const d={a:o,b:l,c,normal:new P,materialIndex:0};un.getNormal(Po,Lo,No,d.normal),u.face=d,u.barycoord=h}return u}const ia=new Et,Kf=new Et,Jf=new Et,fM=new Et,jf=new We,Fo=new P,Ru=new nn,Qf=new We,Iu=new nr;class __ extends Dt{constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=gh,this.bindMatrix=new We,this.bindMatrixInverse=new We,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){const e=this.geometry;this.boundingBox===null&&(this.boundingBox=new hn),this.boundingBox.makeEmpty();const t=e.getAttribute("position");for(let n=0;n<t.count;n++)this.getVertexPosition(n,Fo),this.boundingBox.expandByPoint(Fo)}computeBoundingSphere(){const e=this.geometry;this.boundingSphere===null&&(this.boundingSphere=new nn),this.boundingSphere.makeEmpty();const t=e.getAttribute("position");for(let n=0;n<t.count;n++)this.getVertexPosition(n,Fo),this.boundingSphere.expandByPoint(Fo)}copy(e,t){return super.copy(e,t),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}raycast(e,t){const n=this.material,r=this.matrixWorld;n!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),Ru.copy(this.boundingSphere),Ru.applyMatrix4(r),e.ray.intersectsSphere(Ru)!==!1&&(Qf.copy(r).invert(),Iu.copy(e.ray).applyMatrix4(Qf),!(this.boundingBox!==null&&Iu.intersectsBox(this.boundingBox)===!1)&&this._computeIntersections(e,t,Iu)))}getVertexPosition(e,t){return super.getVertexPosition(e,t),this.applyBoneTransform(e,t),t}bind(e,t){this.skeleton=e,t===void 0&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const e=new Et,t=this.geometry.attributes.skinWeight;for(let n=0,r=t.count;n<r;n++){e.fromBufferAttribute(t,n);const s=1/e.manhattanLength();s!==1/0?e.multiplyScalar(s):e.set(1,0,0,0),t.setXYZW(n,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMode===gh?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===Zg?this.bindMatrixInverse.copy(this.bindMatrix).invert():_e("SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(e,t){const n=this.skeleton,r=this.geometry;Kf.fromBufferAttribute(r.attributes.skinIndex,e),Jf.fromBufferAttribute(r.attributes.skinWeight,e),t.isVector4?(ia.copy(t),t.set(0,0,0,0)):(ia.set(...t,1),t.set(0,0,0)),ia.applyMatrix4(this.bindMatrix);for(let s=0;s<4;s++){const a=Jf.getComponent(s);if(a!==0){const o=Kf.getComponent(s);jf.multiplyMatrices(n.bones[o].matrixWorld,n.boneInverses[o]),t.addScaledVector(fM.copy(ia).applyMatrix4(jf),a)}}return t.isVector4&&(t.w=ia.w),t.applyMatrix4(this.bindMatrixInverse)}}class bd extends pt{constructor(){super(),this.isBone=!0,this.type="Bone"}}class ti extends Ft{constructor(e=null,t=1,n=1,r,s,a,o,l,c=Xt,u=Xt,h,d){super(null,a,o,l,c,u,r,s,h,d),this.isDataTexture=!0,this.image={data:e,width:t,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const ep=new We,pM=new We;class Bc{constructor(e=[],t=[]){this.uuid=Fn(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.previousBoneMatrices=null,this.boneTexture=null,this.init()}init(){const e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(e.length*16),t.length===0)this.calculateInverses();else if(e.length!==t.length){_e("Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let n=0,r=this.bones.length;n<r;n++)this.boneInverses.push(new We)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){const n=new We;this.bones[e]&&n.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(n)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){const n=this.bones[e];n&&n.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){const n=this.bones[e];n&&(n.parent&&n.parent.isBone?(n.matrix.copy(n.parent.matrixWorld).invert(),n.matrix.multiply(n.matrixWorld)):n.matrix.copy(n.matrixWorld),n.matrix.decompose(n.position,n.quaternion,n.scale))}}update(){const e=this.bones,t=this.boneInverses,n=this.boneMatrices,r=this.boneTexture;for(let s=0,a=e.length;s<a;s++){const o=e[s]?e[s].matrixWorld:pM;ep.multiplyMatrices(o,t[s]),ep.toArray(n,s*16)}r!==null&&(r.needsUpdate=!0)}clone(){return new Bc(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(this.bones.length*4);e=Math.ceil(e/4)*4,e=Math.max(e,4);const t=new Float32Array(e*e*4);t.set(this.boneMatrices);const n=new ti(t,e,e,xn,vn);return n.needsUpdate=!0,this.boneMatrices=t,this.boneTexture=n,this}getBoneByName(e){for(let t=0,n=this.bones.length;t<n;t++){const r=this.bones[t];if(r.name===e)return r}}dispose(){this.boneTexture!==null&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let n=0,r=e.bones.length;n<r;n++){const s=e.bones[n];let a=t[s];a===void 0&&(_e("Skeleton: No bone found with UUID:",s),a=new bd),this.bones.push(a),this.boneInverses.push(new We().fromArray(e.boneInverses[n]))}return this.init(),this}toJSON(){const e={metadata:{version:4.7,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;const t=this.bones,n=this.boneInverses;for(let r=0,s=t.length;r<s;r++){const a=t[r];e.bones.push(a.uuid);const o=n[r];e.boneInverses.push(o.toArray())}return e}}class Ns extends ut{constructor(e,t,n,r=1){super(e,t,n),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=r}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){const e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}const as=new We,tp=new We,Bo=[],np=new hn,mM=new We,ra=new Dt,sa=new nn;class v_ extends Dt{constructor(e,t,n){super(e,t),this.isInstancedMesh=!0,this.instanceMatrix=new Ns(new Float32Array(n*16),16),this.previousInstanceMatrix=null,this.instanceColor=null,this.morphTexture=null,this.count=n,this.boundingBox=null,this.boundingSphere=null;for(let r=0;r<n;r++)this.setMatrixAt(r,mM)}computeBoundingBox(){const e=this.geometry,t=this.count;this.boundingBox===null&&(this.boundingBox=new hn),e.boundingBox===null&&e.computeBoundingBox(),this.boundingBox.makeEmpty();for(let n=0;n<t;n++)this.getMatrixAt(n,as),np.copy(e.boundingBox).applyMatrix4(as),this.boundingBox.union(np)}computeBoundingSphere(){const e=this.geometry,t=this.count;this.boundingSphere===null&&(this.boundingSphere=new nn),e.boundingSphere===null&&e.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(let n=0;n<t;n++)this.getMatrixAt(n,as),sa.copy(e.boundingSphere).applyMatrix4(as),this.boundingSphere.union(sa)}copy(e,t){return super.copy(e,t),this.instanceMatrix.copy(e.instanceMatrix),e.previousInstanceMatrix!==null&&(this.previousInstanceMatrix=e.previousInstanceMatrix.clone()),e.morphTexture!==null&&(this.morphTexture=e.morphTexture.clone()),e.instanceColor!==null&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}getColorAt(e,t){return this.instanceColor===null?t.setRGB(1,1,1):t.fromArray(this.instanceColor.array,e*3)}getMatrixAt(e,t){return t.fromArray(this.instanceMatrix.array,e*16)}getMorphAt(e,t){const n=t.morphTargetInfluences,r=this.morphTexture.source.data.data,s=n.length+1,a=e*s+1;for(let o=0;o<n.length;o++)n[o]=r[a+o]}raycast(e,t){const n=this.matrixWorld,r=this.count;if(ra.geometry=this.geometry,ra.material=this.material,ra.material!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),sa.copy(this.boundingSphere),sa.applyMatrix4(n),e.ray.intersectsSphere(sa)!==!1))for(let s=0;s<r;s++){this.getMatrixAt(s,as),tp.multiplyMatrices(n,as),ra.matrixWorld=tp,ra.raycast(e,Bo);for(let a=0,o=Bo.length;a<o;a++){const l=Bo[a];l.instanceId=s,l.object=this,t.push(l)}Bo.length=0}}setColorAt(e,t){return this.instanceColor===null&&(this.instanceColor=new Ns(new Float32Array(this.instanceMatrix.count*3).fill(1),3)),t.toArray(this.instanceColor.array,e*3),this}setMatrixAt(e,t){return t.toArray(this.instanceMatrix.array,e*16),this}setMorphAt(e,t){const n=t.morphTargetInfluences,r=n.length+1;this.morphTexture===null&&(this.morphTexture=new ti(new Float32Array(r*this.count),r,this.count,wc,vn));const s=this.morphTexture.source.data.data;let a=0;for(let c=0;c<n.length;c++)a+=n[c];const o=this.geometry.morphTargetsRelative?1:1-a,l=r*e;return s[l]=o,s.set(n,l+1),this}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"}),this.morphTexture!==null&&(this.morphTexture.dispose(),this.morphTexture=null)}}const Pu=new P,gM=new P,_M=new tt;class Ai{constructor(e=new P(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,n,r){return this.normal.set(e,t,n),this.constant=r,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}
1setFromCoplanarPoints(e,t,n){const r=Pu.subVectors(n,t).cross(gM.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t,n=!0){const r=e.delta(Pu),s=this.normal.dot(r);if(s===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const a=-(e.start.dot(this.normal)+this.constant)/s;return n===!0&&(a<0||a>1)?null:t.copy(e.start).addScaledVector(r,a)}intersectsLine(e){const t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const n=t||_M.getNormalMatrix(e),r=this.coplanarPoint(Pu).applyMatrix4(e),s=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(s),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const ur=new nn,vM=new j(.5,.5),ko=new P;class Ws{constructor(e=new Ai,t=new Ai,n=new Ai,r=new Ai,s=new Ai,a=new Ai){this.planes=[e,t,n,r,s,a]}set(e,t,n,r,s,a){const o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(n),o[3].copy(r),o[4].copy(s),o[5].copy(a),this}copy(e){const t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e,t=Un,n=!1){const r=this.planes,s=e.elements,a=s[0],o=s[1],l=s[2],c=s[3],u=s[4],h=s[5],d=s[6],f=s[7],p=s[8],_=s[9],g=s[10],m=s[11],v=s[12],b=s[13],y=s[14],T=s[15];if(r[0].setComponents(c-a,f-u,m-p,T-v).normalize(),r[1].setComponents(c+a,f+u,m+p,T+v).normalize(),r[2].setComponents(c+o,f+h,m+_,T+b).normalize(),r[3].setComponents(c-o,f-h,m-_,T-b).normalize(),n)r[4].setComponents(l,d,g,y).normalize(),r[5].setComponents(c-l,f-d,m-g,T-y).normalize();else if(r[4].setComponents(c-l,f-d,m-g,T-y).normalize(),t===Un)r[5].setComponents(c+l,f+d,m+g,T+y).normalize();else if(t===Ur)r[5].setComponents(l,d,g,y).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),ur.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),ur.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(ur)}intersectsSprite(e){ur.center.set(0,0,0);const t=vM.distanceTo(e.center);return ur.radius=.7071067811865476+t,ur.applyMatrix4(e.matrixWorld),this.intersectsSphere(ur)}intersectsSphere(e){const t=this.planes,n=e.center,r=-e.radius;for(let s=0;s<6;s++)if(t[s].distanceToPoint(n)<r)return!1;return!0}intersectsBox(e){const t=this.planes;for(let n=0;n<6;n++){const r=t[n];if(ko.x=r.normal.x>0?e.max.x:e.min.x,ko.y=r.normal.y>0?e.max.y:e.min.y,ko.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(ko)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}const li=new We,ci=new Ws;class kc{constructor(){this.coordinateSystem=Un}intersectsObject(e,t){if(!t.isArrayCamera||t.cameras.length===0)return!1;for(let n=0;n<t.cameras.length;n++){const r=t.cameras[n];if(li.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),ci.setFromProjectionMatrix(li,r.coordinateSystem,r.reversedDepth),ci.intersectsObject(e))return!0}return!1}intersectsSprite(e,t){if(!t||!t.cameras||t.cameras.length===0)return!1;for(let n=0;n<t.cameras.length;n++){const r=t.cameras[n];if(li.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),ci.setFromProjectionMatrix(li,r.coordinateSystem,r.reversedDepth),ci.intersectsSprite(e))return!0}return!1}intersectsSphere(e,t){if(!t||!t.cameras||t.cameras.length===0)return!1;for(let n=0;n<t.cameras.length;n++){const r=t.cameras[n];if(li.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),ci.setFromProjectionMatrix(li,r.coordinateSystem,r.reversedDepth),ci.intersectsSphere(e))return!0}return!1}intersectsBox(e,t){if(!t||!t.cameras||t.cameras.length===0)return!1;for(let n=0;n<t.cameras.length;n++){const r=t.cameras[n];if(li.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),ci.setFromProjectionMatrix(li,r.coordinateSystem,r.reversedDepth),ci.intersectsBox(e))return!0}return!1}containsPoint(e,t){if(!t||!t.cameras||t.cameras.length===0)return!1;for(let n=0;n<t.cameras.length;n++){const r=t.cameras[n];if(li.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),ci.setFromProjectionMatrix(li,r.coordinateSystem,r.reversedDepth),ci.containsPoint(e))return!0}return!1}clone(){return new kc}}function Lu(i,e){return i-e}function xM(i,e){return i.z-e.z}function yM(i,e){return e.z-i.z}class bM{constructor(){this.index=0,this.pool=[],this.list=[]}push(e,t,n,r){const s=this.pool,a=this.list;this.index>=s.length&&s.push({start:-1,count:-1,z:-1,index:-1});const o=s[this.index];a.push(o),this.index++,o.start=e,o.count=t,o.z=n,o.index=r}reset(){this.list.length=0,this.index=0}}const Sn=new We,SM=new Ee(1,1,1),ip=new Ws,MM=new kc,Vo=new hn,hr=new nn,aa=new P,rp=new P,EM=new P,Nu=new bM,ln=new Dt,zo=[];function TM(i,e,t=0){const n=e.itemSize;
1if(i.isInterleavedBufferAttribute||i.array.constructor!==e.array.constructor){const r=i.count;for(let s=0;s<r;s++)for(let a=0;a<n;a++)e.setComponent(s+t,a,i.getComponent(s,a))}else e.array.set(i.array,t*n);e.needsUpdate=!0}function dr(i,e){if(i.constructor!==e.constructor){const t=Math.min(i.length,e.length);for(let n=0;n<t;n++)e[n]=i[n]}else{const t=Math.min(i.length,e.length);e.set(new i.constructor(i.buffer,0,t))}}class x_ extends Dt{constructor(e,t,n=t*2,r){super(new et,r),this.isBatchedMesh=!0,this.perObjectFrustumCulled=!0,this.sortObjects=!0,this.boundingBox=null,this.boundingSphere=null,this.customSort=null,this._instanceInfo=[],this._geometryInfo=[],this._availableInstanceIds=[],this._availableGeometryIds=[],this._nextIndexStart=0,this._nextVertexStart=0,this._geometryCount=0,this._visibilityChanged=!0,this._geometryInitialized=!1,this._maxInstanceCount=e,this._maxVertexCount=t,this._maxIndexCount=n,this._multiDrawCounts=new Int32Array(e),this._multiDrawStarts=new Int32Array(e),this._multiDrawCount=0,this._matricesTexture=null,this._indirectTexture=null,this._colorsTexture=null,this._initMatricesTexture(),this._initIndirectTexture()}get maxInstanceCount(){return this._maxInstanceCount}get instanceCount(){return this._instanceInfo.length-this._availableInstanceIds.length}get unusedVertexCount(){return this._maxVertexCount-this._nextVertexStart}get unusedIndexCount(){return this._maxIndexCount-this._nextIndexStart}_initMatricesTexture(){let e=Math.sqrt(this._maxInstanceCount*4);e=Math.ceil(e/4)*4,e=Math.max(e,4);const t=new Float32Array(e*e*4),n=new ti(t,e,e,xn,vn);this._matricesTexture=n}_initIndirectTexture(){let e=Math.sqrt(this._maxInstanceCount);e=Math.ceil(e);const t=new Uint32Array(e*e),n=new ti(t,e,e,so,Gn);this._indirectTexture=n}_initColorsTexture(){let e=Math.sqrt(this._maxInstanceCount);e=Math.ceil(e);const t=new Float32Array(e*e*4).fill(1),n=new ti(t,e,e,xn,vn);
1n.colorSpace=dt.workingColorSpace,this._colorsTexture=n}_initializeGeometry(e){const t=this.geometry,n=this._maxVertexCount,r=this._maxIndexCount;if(this._geometryInitialized===!1){for(const s in e.attributes){const a=e.getAttribute(s),{array:o,itemSize:l,normalized:c}=a,u=new o.constructor(n*l),h=new ut(u,l,c);t.setAttribute(s,h)}if(e.getIndex()!==null){const s=n>65535?new Uint32Array(r):new Uint16Array(r);t.setIndex(new ut(s,1))}this._geometryInitialized=!0}}_validateGeometry(e){const t=this.geometry;if(!!e.getIndex()!=!!t.getIndex())throw new Error('THREE.BatchedMesh: All geometries must consistently have "index".');for(const n in t.attributes){if(!e.hasAttribute(n))throw new Error(`THREE.BatchedMesh: Added geometry missing "${n}". All geometries must have consistent attributes.`);const r=e.getAttribute(n),s=t.getAttribute(n);if(r.itemSize!==s.itemSize||r.normalized!==s.normalized)throw new Error("THREE.BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}validateInstanceId(e){const t=this._instanceInfo;if(e<0||e>=t.length||t[e].active===!1)throw new Error(`THREE.BatchedMesh: Invalid instanceId ${e}. Instance is either out of range or has been deleted.`)}validateGeometryId(e){const t=this._geometryInfo;if(e<0||e>=t.length||t[e].active===!1)throw new Error(`THREE.BatchedMesh: Invalid geometryId ${e}. Geometry is either out of range or has been deleted.`)}setCustomSort(e){return this.customSort=e,this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new hn);const e=this.boundingBox,t=this._instanceInfo;e.makeEmpty();for(let n=0,r=t.length;n<r;n++){if(t[n].active===!1)continue;const s=t[n].geometryIndex;this.getMatrixAt(n,Sn),this.getBoundingBoxAt(s,Vo).applyMatrix4(Sn),e.union(Vo)}}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new nn);const e=this.boundingSphere,t=this._instanceInfo;e.makeEmpty();for(let n=0,r=t.length;n<r;n++){if(t[n].active===!1)continue;const s=t[n].geometryIndex;this.getMatrixAt(n,Sn),this.getBoundingSphereAt(s,hr).applyMatrix4(Sn),e.union(hr)}}addInstance(e){if(this._instanceInfo.length>=this.maxInstanceCount&&this._availableInstanceIds.length===0)throw new Error("THREE.BatchedMesh: Maximum item count reached.");const n={visible:!0,active:!0,geometryIndex:e};let r=null;this._availableInstanceIds.length>0?(this._availableInstanceIds.sort(Lu),r=this._availableInstanceIds.shift(),this._instanceInfo[r]=n):(r=this._instanceInfo.length,this._instanceInfo.push(n));const s=this._matricesTexture;Sn.identity().toArray(s.image.data,r*16),s.needsUpdate=!0;const a=this._colorsTexture;return a&&(SM.toArray(a.image.data,r*4),a.needsUpdate=!0),this._visibilityChanged=!0,r}addGeometry(e,t=-1,n=-1){this._initializeGeometry(e),this._validateGeometry(e);const r={vertexStart:-1,vertexCount:-1,reservedVertexCount:-1,indexStart:-1,indexCount:-1,reservedIndexCount:-1,start:-1,count:-1,boundingBox:null,boundingSphere:null,active:!0},s=this._geometryInfo;r.vertexStart=this._nextVertexStart,r.reservedVertexCount=t===-1?e.getAttribute("position").count:t;const a=e.getIndex();if(a!==null&&(r.indexStart=this._nextIndexStart,r.reservedIndexCount=n===-1?a.count:n),r.indexStart!==-1&&r.indexStart+r.reservedIndexCount>this._maxIndexCount||r.vertexStart+r.reservedVertexCount>this._maxVertexCount)throw new Error("THREE.BatchedMesh: Reserved space request exceeds the maximum buffer size.");let l;return this._availableGeometryIds.length>0?(this._availableGeometryIds.sort(Lu),l=this._availableGeometryIds.shift(),s[l]=r):(l=this._geometryCount,this._geometryCount++,s.push(r)),this.setGeometryAt(l,e),this._nextIndexStart=r.indexStart+r.reservedIndexCount,this._nextVertexStart=r.vertexStart+r.reservedVertexCount,l}setGeometryAt(e,t){if(e>=this._geometryCount)throw new Error("THREE.BatchedMesh: Maximum geometry count reached.");this._validateGeometry(t);const n=this.geometry,r=n.getIndex()!==null,s=n.getIndex(),a=t.getIndex(),o=this._geometryInfo[e];if(r&&a.count>o.reservedIndexCount||t.attributes.position.count>o.reservedVertexCount)throw new Error("THREE.BatchedMesh: Reserved space not large enough for provided geometry.");const l=o.vertexStart,c=o.reservedVertexCount;o.vertexCount=t.getAttribute("position").count;for(const u in n.attributes){const h=t.getAttribute(u),d=n.getAttribute(u);TM(h,d,l);const f=h.itemSize;
1for(let p=h.count,_=c;p<_;p++){const g=l+p;for(let m=0;m<f;m++)d.setComponent(g,m,0)}d.needsUpdate=!0,d.addUpdateRange(l*f,c*f)}if(r){const u=o.indexStart,h=o.reservedIndexCount;o.indexCount=t.getIndex().count;for(let d=0;d<a.count;d++)s.setX(u+d,l+a.getX(d));for(let d=a.count,f=h;d<f;d++)s.setX(u+d,l);s.needsUpdate=!0,s.addUpdateRange(u,o.reservedIndexCount)}return o.start=r?o.indexStart:o.vertexStart,o.count=r?o.indexCount:o.vertexCount,o.boundingBox=null,t.boundingBox!==null&&(o.boundingBox=t.boundingBox.clone()),o.boundingSphere=null,t.boundingSphere!==null&&(o.boundingSphere=t.boundingSphere.clone()),this._visibilityChanged=!0,e}deleteGeometry(e){const t=this._geometryInfo;if(e>=t.length||t[e].active===!1)return this;const n=this._instanceInfo;for(let r=0,s=n.length;r<s;r++)n[r].active&&n[r].geometryIndex===e&&this.deleteInstance(r);return t[e].active=!1,this._availableGeometryIds.push(e),this._visibilityChanged=!0,this}deleteInstance(e){return this.validateInstanceId(e),this._instanceInfo[e].active=!1,this._availableInstanceIds.push(e),this._visibilityChanged=!0,this}optimize(){let e=0,t=0;const n=this._geometryInfo,r=n.map((a,o)=>o).sort((a,o)=>n[a].vertexStart-n[o].vertexStart),s=this.geometry;for(let a=0,o=n.length;a<o;a++){const l=r[a],c=n[l];if(c.active!==!1){if(s.index!==null){if(c.indexStart!==t){const{indexStart:u,vertexStart:h,reservedIndexCount:d}=c,f=s.index,p=f.array,_=e-h;for(let g=u;g<u+d;g++)p[g]=p[g]+_;f.array.copyWithin(t,u,u+d),f.addUpdateRange(t,d),f.needsUpdate=!0,c.indexStart=t}t+=c.reservedIndexCount}if(c.vertexStart!==e){const{vertexStart:u,reservedVertexCount:h}=c,d=s.attributes;for(const f in d){const p=d[f],{array:_,itemSize:g}=p;_.copyWithin(e*g,u*g,(u+h)*g),p.addUpdateRange(e*g,h*g),p.needsUpdate=!0}c.vertexStart=e}e+=c.reservedVertexCount,c.start=s.index?c.indexStart:c.vertexStart}}return this._nextIndexStart=t,this._nextVertexStart=e,this._visibilityChanged=!0,this}getBoundingBoxAt(e,t){if(e>=this._geometryCount)return null;const n=this.geometry,r=this._geometryInfo[e];if(r.boundingBox===null){const s=new hn,a=n.index,o=n.attributes.position;for(let l=r.start,c=r.start+r.count;l<c;l++){let u=l;a&&(u=a.getX(u)),s.expandByPoint(aa.fromBufferAttribute(o,u))}r.boundingBox=s}return t.copy(r.boundingBox),t}getBoundingSphereAt(e,t){if(e>=this._geometryCount)return null;const n=this.geometry,r=this._geometryInfo[e];if(r.boundingSphere===null){const s=new nn;this.getBoundingBoxAt(e,Vo),Vo.getCenter(s.center);const a=n.index,o=n.attributes.position;let l=0;for(let c=r.start,u=r.start+r.count;c<u;c++){let h=c;a&&(h=a.getX(h)),aa.fromBufferAttribute(o,h),l=Math.max(l,s.center.distanceToSquared(aa))}s.radius=Math.sqrt(l),r.boundingSphere=s}return t.copy(r.boundingSphere),t}setMatrixAt(e,t){this.validateInstanceId(e);const n=this._matricesTexture,r=this._matricesTexture.image.data;return t.toArray(r,e*16),n.needsUpdate=!0,this}getMatrixAt(e,t){return this.validateInstanceId(e),t.fromArray(this._matricesTexture.image.data,e*16)}setColorAt(e,t){return this.validateInstanceId(e),this._colorsTexture===null&&this._initColorsTexture(),t.toArray(this._colorsTexture.image.data,e*4),this._colorsTexture.needsUpdate=!0,this}getColorAt(e,t){return this.validateInstanceId(e),this._colorsTexture===null?t.isVector4?t.set(1,1,1,1):t.setRGB(1,1,1):t.fromArray(this._colorsTexture.image.data,e*4)}setVisibleAt(e,t){return this.validateInstanceId(e),this._instanceInfo[e].visible===t?this:(this._instanceInfo[e].visible=t,this._visibilityChanged=!0,this)}getVisibleAt(e){return this.validateInstanceId(e),this._instanceInfo[e].visible}setGeometryIdAt(e,t){return this.validateInstanceId(e),this.validateGeometryId(t),this._instanceInfo[e].geometryIndex=t,this}getGeometryIdAt(e){return this.validateInstanceId(e),this._instanceInfo[e].geometryIndex}getGeometryRangeAt(e,t={}){this.validateGeometryId(e);const n=this._geometryInfo[e];return t.vertexStart=n.vertexStart,t.vertexCount=n.vertexCount,t.reservedVertexCount=n.reservedVertexCount,t.indexStart=n.indexStart,t.indexCount=n.indexCount,t.reservedIndexCount=n.reservedIndexCount,t.start=n.start,t.count=n.count,t}setInstanceCount(e){const t=this._availableInstanceIds,n=this._instanceInfo;for(t.sort(Lu);t[t.length-1]===n.length-1;)n.pop(),t.pop();if(e<n.length)throw new Error(`BatchedMesh: Instance ids outside the range ${e} are being used. Cannot shrink instance count.`);const r=new Int32Array(e),s=new Int32Array(e);dr(this._multiDrawCounts,r),dr(this._multiDrawStarts,s),this._multiDrawCounts=r,this._multiDrawStarts=s,this._maxInstanceCount=e;const a=this._indirectTexture,o=this._matricesTexture,l=this._colorsTexture;a.dispose(),this._initIndirectTexture(),dr(a.image.data,this._indirectTexture.image.data),o.dispose(),this._initMatricesTexture(),dr(o.image.data,this._matricesTexture.image.data),l&&(l.dis
1pose(),this._initColorsTexture(),dr(l.image.data,this._colorsTexture.image.data))}setGeometrySize(e,t){const n=[...this._geometryInfo].filter(o=>o.active);if(Math.max(...n.map(o=>o.vertexStart+o.reservedVertexCount))>e)throw new Error(`BatchedMesh: Geometry vertex values are being used outside the range ${t}. Cannot shrink further.`);if(this.geometry.index&&Math.max(...n.map(l=>l.indexStart+l.reservedIndexCount))>t)throw new Error(`BatchedMesh: Geometry index values are being used outside the range ${t}. Cannot shrink further.`);const s=this.geometry;s.dispose(),this._maxVertexCount=e,this._maxIndexCount=t,this._geometryInitialized&&(this._geometryInitialized=!1,this.geometry=new et,this._initializeGeometry(s));const a=this.geometry;s.index&&dr(s.index.array,a.index.array);for(const o in s.attributes)dr(s.attributes[o].array,a.attributes[o].array)}raycast(e,t){const n=this._instanceInfo,r=this._geometryInfo,s=this.matrixWorld,a=this.geometry;ln.material=this.material,ln.geometry.index=a.index,ln.geometry.attributes=a.attributes,ln.geometry.boundingBox===null&&(ln.geometry.boundingBox=new hn),ln.geometry.boundingSphere===null&&(ln.geometry.boundingSphere=new nn);for(let o=0,l=n.length;o<l;o++){if(!n[o].visible||!n[o].active)continue;const c=n[o].geometryIndex,u=r[c];ln.geometry.setDrawRange(u.start,u.count),this.getMatrixAt(o,ln.matrixWorld).premultiply(s),this.getBoundingBoxAt(c,ln.geometry.boundingBox),this.getBoundingSphereAt(c,ln.geometry.boundingSphere),ln.raycast(e,zo);for(let h=0,d=zo.length;h<d;h++){const f=zo[h];f.object=this,f.batchId=o,t.push(f)}zo.length=0}ln.material=null,ln.geometry.index=null,ln.geometry.attributes={},ln.geometry.setDrawRange(0,1/0)}copy(e){return super.copy(e),this.geometry=e.geometry.clone(),this.perObjectFrustumCulled=e.perObjectFrustumCulled,this.sortObjects=e.sortObjects,this.boundingBox=e.boundingBox!==null?e.boundingBox.clone():null,this.boundingSphere=e.boundingSphere!==null?e.boundingSphere.clone():null,this._geometryInfo=e._geometryInfo.map(t=>({...t,boundingBox:t.boundingBox!==null?t.boundingBox.clone():null,boundingSphere:t.boundingSphere!==null?t.boundingSphere.clone():null})),this._instanceInfo=e._instanceInfo.map(t=>({...t})),this._availableInstanceIds=e._availableInstanceIds.slice(),this._availableGeometryIds=e._availableGeometryIds.slice(),this._nextIndexStart=e._nextIndexStart,this._nextVertexStart=e._nextVertexStart,this._geometryCount=e._geometryCount,this._maxInstanceCount=e._maxInstanceCount,this._maxVertexCount=e._maxVertexCount,this._maxIndexCount=e._maxIndexCount,this._geometryInitialized=e._geometryInitialized,this._multiDrawCounts=e._multiDrawCounts.slice(),this._multiDrawStarts=e._multiDrawStarts.slice(),this._indirectTexture=e._indirectTexture.clone(),this._indirectTexture.image.data=this._indirectTexture.image.data.slice(),this._matricesTexture=e._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.data.slice(),this._colorsTexture!==null&&(this._colorsTexture=e._colorsTexture.clone(),this._colorsTexture.image.data=this._colorsTexture.image.data.slice()),this}dispose(){this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this._indirectTexture.dispose(),this._indirectTexture=null,this._colorsTexture!==null&&(this._colorsTexture.dispose(),this._colorsTexture=null)}onBeforeRender(e,t,n,r,s){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;const a=r.getIndex();let o=a===null?1:a.array.BYTES_PER_ELEMENT,l=1;s.wireframe&&(l=2,o=r.attributes.position.count>65535?4:2);const c=this._instanceInfo,u=this._multiDrawStarts,h=this._multiDrawCounts,d=this._geometryInfo,f=this.perObjectFrustumCulled,p=this._indirectTexture,_=p.image.data,g=n.isArrayCamera?MM:ip;f&&!n.isArrayCamera&&(Sn.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse).multiply(this.matrixWorld),ip.setFromProjectionMatrix(Sn,n.coordinateSystem,n.reversedDepth));let m=0;if(this.sortObjects){Sn.copy(this.matrixWorld).invert(),aa.setFromMatrixPosition(n.matrixWorld).applyMatrix4(Sn),rp.set(0,0,-1).transformDirection(n.matrixWorld).transformDirection(Sn);for(let y=0,T=c.length;y<T;y++)if(c[y].visible&&c[y].active){const S=c[y].geometryIndex;this.getMatrixAt(y,Sn),this.getBoundingSphereAt(S,hr).applyMatrix4(Sn);let R=!1;if(f&&(R=!g.intersectsSphere(hr,n)),!R){const x=d[S],M=EM.subVectors(hr.center,aa).dot(rp);
1Nu.push(x.start,x.count,M,y)}}const v=Nu.list,b=this.customSort;b===null?v.sort(s.transparent?yM:xM):b.call(this,v,n);for(let y=0,T=v.length;y<T;y++){const S=v[y];u[m]=S.start*o*l,h[m]=S.count*l,_[m]=S.index,m++}Nu.reset()}else for(let v=0,b=c.length;v<b;v++)if(c[v].visible&&c[v].active){const y=c[v].geometryIndex;let T=!1;if(f&&(this.getMatrixAt(v,Sn),this.getBoundingSphereAt(y,hr).applyMatrix4(Sn),T=!g.intersectsSphere(hr,n)),!T){const S=d[y];u[m]=S.start*o*l,h[m]=S.count*l,_[m]=v,m++}}p.needsUpdate=!0,this._multiDrawCount=m,this._visibilityChanged=!1}onBeforeShadow(e,t,n,r,s,a){this.onBeforeRender(e,null,r,s,a)}}class bn extends rn{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new Ee(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}}const oc=new P,lc=new P,sp=new We,oa=new nr,Ho=new nn,Du=new P,ap=new P;class ir extends pt{constructor(e=new et,t=new bn){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,n=[0];for(let r=1,s=t.count;r<s;r++)oc.fromBufferAttribute(t,r-1),lc.fromBufferAttribute(t,r),n[r]=n[r-1],n[r]+=oc.distanceTo(lc);e.setAttribute("lineDistance",new Pe(n,1))}else _e("Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,t){const n=this.geometry,r=this.matrixWorld,s=e.params.Line.threshold,a=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),Ho.copy(n.boundingSphere),Ho.applyMatrix4(r),Ho.radius+=s,e.ray.intersectsSphere(Ho)===!1)return;sp.copy(r).invert(),oa.copy(e.ray).applyMatrix4(sp);const o=s/((this.scale.x+this.scale.y+this.scale.z)/3),l=o*o,c=this.isLineSegments?2:1,u=n.index,d=n.attributes.position;if(u!==null){const f=Math.max(0,a.start),p=Math.min(u.count,a.start+a.count);for(let _=f,g=p-1;_<g;_+=c){const m=u.getX(_),v=u.getX(_+1),b=Go(this,e,oa,l,m,v,_);b&&t.push(b)}if(this.isLineLoop){const _=u.getX(p-1),g=u.getX(f),m=Go(this,e,oa,l,_,g,p-1);m&&t.push(m)}}else{const f=Math.max(0,a.start),p=Math.min(d.count,a.start+a.count);for(let _=f,g=p-1;_<g;_+=c){const m=Go(this,e,oa,l,_,_+1,_);m&&t.push(m)}if(this.isLineLoop){const _=Go(this,e,oa,l,p-1,f,p-1);_&&t.push(_)}}}updateMorphTargets(){const t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){const r=t[n[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,a=r.length;s<a;s++){const o=r[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=s}}}}}function Go(i,e,t,n,r,s,a){const o=i.geometry.attributes.position;if(oc.fromBufferAttribute(o,r),lc.fromBufferAttribute(o,s),t.distanceSqToSegment(oc,lc,Du,ap)>n)return;Du.applyMatrix4(i.matrixWorld);const c=e.ray.origin.distanceTo(Du);if(!(c<e.near||c>e.far))return{distance:c,point:ap.clone().applyMatrix4(i.matrixWorld),index:a,face:null,faceIndex:null,barycoord:null,object:i}}const op=new P,lp=new P;class vi extends ir{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,n=[];for(let r=0,s=t.count;r<s;r+=2)op.fromBufferAttribute(t,r),lp.fromBufferAttribute(t,r+1),n[r]=r===0?0:n[r-1],n[r+1]=n[r]+op.distanceTo(lp);e.setAttribute("lineDistance",new Pe(n,1))}else _e("LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class y_ extends ir{constructor(e,t){super(e,t),this.isLineLoop=!0,this.type="LineLoop"}}class Sd extends rn{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new Ee(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}const cp=new We,yh=new nr,Wo=new nn,Xo=new P;class cc extends pt{constructor(e=new et,t=new Sd){super(),this.isPoints=!0,this.type="Points",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}raycast(e,t){const n=this.geometry,r=this.matrixWorld,s=e.params.Points.threshold,a=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),Wo.copy(n.boundingSphere),Wo.applyMatrix4(r),Wo.radius+=s,e.ray.intersectsSphere(Wo)===!1)return;cp.copy(r).invert(),yh.copy(e.ray).applyMatrix4(cp);const o=s/((this.scale.x+this.scale.y+this.scale.z)/3),l=o*o,c=n.index,h=n.attributes.position;if(c!==null){const d=Math.max(0,a.start),f=Math.min(c.count,a.start+a.count);for(let p=d,_=f;p<_;p++){const g=c.getX(p);Xo.fromBufferAttribute(h,g),up(Xo,g,l,r,e,t,this)}}else{const d=Math.max(0,a.start),f=Math.min(h.count,a.start+a.count);for(let p=d,_=f;p<_;p++)Xo.fromBufferAttribute(h,p),up(Xo,p,l,r,e,t,this)}}updateMorphTargets(){const t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){const r=t[n[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,a=r.length;s<a;s++){const o=r[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=s}}}}}function up(i,e,t,n,r,s,a){const o=yh.distanceSqToPoint(i);if(o<t){const l=new P;
1yh.closestPointToPoint(i,l),l.applyMatrix4(n);const c=r.ray.origin.distanceTo(l);if(c<r.near||c>r.far)return;s.push({distance:c,distanceToRay:Math.sqrt(o),point:l,index:e,face:null,faceIndex:null,barycoord:null,object:a})}}class b_ extends Ft{constructor(e,t,n,r,s=Lt,a=Lt,o,l,c){super(e,t,n,r,s,a,o,l,c),this.isVideoTexture=!0,this.generateMipmaps=!1,this._requestVideoFrameCallbackId=0;const u=this;function h(){u.needsUpdate=!0,u._requestVideoFrameCallbackId=e.requestVideoFrameCallback(h)}"requestVideoFrameCallback"in e&&(this._requestVideoFrameCallbackId=e.requestVideoFrameCallback(h))}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}dispose(){this._requestVideoFrameCallbackId!==0&&(this.source.data.cancelVideoFrameCallback(this._requestVideoFrameCallbackId),this._requestVideoFrameCallbackId=0),super.dispose()}}class wM extends b_{constructor(e,t,n,r,s,a,o,l){super({},e,t,n,r,s,a,o,l),this.isVideoFrameTexture=!0}update(){}clone(){return new this.constructor().copy(this)}setFrame(e){this.image=e,this.needsUpdate=!0}}class AM extends Ft{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=Xt,this.minFilter=Xt,this.generateMipmaps=!1,this.needsUpdate=!0}}class Vc extends Ft{constructor(e,t,n,r,s,a,o,l,c,u,h,d){super(null,a,o,l,c,u,r,s,h,d),this.isCompressedTexture=!0,this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class CM extends Vc{constructor(e,t,n,r,s,a){super(e,t,n,s,a),this.isCompressedArrayTexture=!0,this.image.depth=r,this.wrapR=An,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class RM extends Vc{constructor(e,t,n){super(void 0,e[0].width,e[0].height,t,n,mi),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class oo extends Ft{constructor(e=[],t=mi,n,r,s,a,o,l,c,u){super(e,t,n,r,s,a,o,l,c,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class IM extends Ft{constructor(e,t,n,r,s,a,o,l,c){super(e,t,n,r,s,a,o,l,c),this.isCanvasTexture=!0,this.needsUpdate=!0}}class PM extends Ft{constructor(e,t,n,r,s,a,o,l,c){super(e,t,n,r,s,a,o,l,c),this.isHTMLTexture=!0,this.generateMipmaps=!1,this.needsUpdate=!0;const u=e?e.parentNode:null;u!==null&&"requestPaint"in u&&(u.onpaint=()=>{this.needsUpdate=!0},u.requestPaint())}dispose(){const e=this.image?this.image.parentNode:null;e!==null&&"onpaint"in e&&(e.onpaint=null),super.dispose()}}class Br extends Ft{constructor(e,t,n=Gn,r,s,a,o=Xt,l=Xt,c,u=_i,h=1){if(u!==_i&&u!==$i)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");const d={width:e,height:t,depth:h};super(d,r,s,a,o,l,u,n,c),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new Yi(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}}class S_ extends Br{constructor(e,t=Gn,n=mi,r,s,a=Xt,o=Xt,l,c=_i){const u={width:e,height:e,depth:1},h=[u,u,u,u,u,u];super(e,e,t,n,r,s,a,o,l,c),this.image=h,this.isCubeDepthTexture=!0,this.isCubeTexture=!0}get images(){return this.image}set images(e){this.image=e}}class Md extends Ft{constructor(e=null){super(),this.sourceTexture=e,this.isExternalTexture=!0}copy(e){return super.copy(e),this.sourceTexture=e.sourceTexture,this}}class Vr extends et{constructor(e=1,t=1,n=1,r=1,s=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:r,heightSegments:s,depthSegments:a};const o=this;r=Math.floor(r),s=Math.floor(s),a=Math.floor(a);const l=[],c=[],u=[],h=[];let d=0,f=0;p("z","y","x",-1,-1,n,t,e,a,s,0),p("z","y","x",1,-1,n,t,-e,a,s,1),p("x","z","y",1,1,e,n,t,r,a,2),p("x","z","y",1,-1,e,n,-t,r,a,3),p("x","y","z",1,-1,e,t,n,r,s,4),p("x","y","z",-1,-1,e,t,-n,r,s,5),this.setIndex(l),this.setAttribute("position",new Pe(c,3)),this.setAttribute("normal",new Pe(u,3)),this.setAttribute("uv",new Pe(h,2));function p(_,g,m,v,b,y,T,S,R,x,M){const A=y/R,I=T/x,N=y/2,U=T/2,k=S/2,L=R+1,F=x+1;let O=0,X=0;const $=new P;for(let te=0;te<F;te++){const ue=te*I-U;for(let xe=0;xe<L;xe++){const He=xe*A-N;$[_]=He*v,$[g]=ue*b,$[m]=k,c.push($.x,$.y,$.z),$[_]=0,$[g]=0,$[m]=S>0?1:-1,u.push($.x,$.y,$.z),h.push(xe/R),h.push(1-te/x),O+=1}}for(let te=0;te<x;te++)for(let ue=0;ue<R;
1ue++){const xe=d+ue+L*te,He=d+ue+L*(te+1),Ke=d+(ue+1)+L*(te+1),qe=d+(ue+1)+L*te;l.push(xe,He,qe),l.push(He,Ke,qe),X+=6}o.addGroup(f,X,M),f+=X,d+=O}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Vr(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}class zc extends et{constructor(e=1,t=1,n=4,r=8,s=1){super(),this.type="CapsuleGeometry",this.parameters={radius:e,height:t,capSegments:n,radialSegments:r,heightSegments:s},t=Math.max(0,t),n=Math.max(1,Math.floor(n)),r=Math.max(3,Math.floor(r)),s=Math.max(1,Math.floor(s));const a=[],o=[],l=[],c=[],u=t/2,h=Math.PI/2*e,d=t,f=2*h+d,p=n*2+s,_=r+1,g=new P,m=new P;for(let v=0;v<=p;v++){let b=0,y=0,T=0,S=0;if(v<=n){const M=v/n,A=M*Math.PI/2;y=-u-e*Math.cos(A),T=e*Math.sin(A),S=-e*Math.cos(A),b=M*h}else if(v<=n+s){const M=(v-n)/s;y=-u+M*t,T=e,S=0,b=h+M*d}else{const M=(v-n-s)/n,A=M*Math.PI/2;y=u+e*Math.sin(A),T=e*Math.cos(A),S=e*Math.sin(A),b=h+d+M*h}const R=Math.max(0,Math.min(1,b/f));let x=0;v===0?x=.5/r:v===p&&(x=-.5/r);for(let M=0;M<=r;M++){const A=M/r,I=A*Math.PI*2,N=Math.sin(I),U=Math.cos(I);m.x=-T*U,m.y=y,m.z=T*N,o.push(m.x,m.y,m.z),g.set(-T*U,S,T*N),g.normalize(),l.push(g.x,g.y,g.z),c.push(A+x,R)}if(v>0){const M=(v-1)*_;for(let A=0;A<r;A++){const I=M+A,N=M+A+1,U=v*_+A,k=v*_+A+1;a.push(I,N,U),a.push(N,k,U)}}}this.setIndex(a),this.setAttribute("position",new Pe(o,3)),this.setAttribute("normal",new Pe(l,3)),this.setAttribute("uv",new Pe(c,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new zc(e.radius,e.height,e.capSegments,e.radialSegments,e.heightSegments)}}class Hc extends et{constructor(e=1,t=32,n=0,r=Math.PI*2){super(),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:r},t=Math.max(3,t);const s=[],a=[],o=[],l=[],c=new P,u=new j;a.push(0,0,0),o.push(0,0,1),l.push(.5,.5);for(let h=0,d=3;h<=t;h++,d+=3){const f=n+h/t*r;c.x=e*Math.cos(f),c.y=e*Math.sin(f),a.push(c.x,c.y,c.z),o.push(0,0,1),u.x=(a[d]/e+1)/2,u.y=(a[d+1]/e+1)/2,l.push(u.x,u.y)}for(let h=1;h<=t;h++)s.push(h,h+1,0);this.setIndex(s),this.setAttribute("position",new Pe(a,3)),this.setAttribute("normal",new Pe(o,3)),this.setAttribute("uv",new Pe(l,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Hc(e.radius,e.segments,e.thetaStart,e.thetaLength)}}class lo extends et{constructor(e=1,t=1,n=1,r=32,s=1,a=!1,o=0,l=Math.PI*2){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:r,heightSegments:s,openEnded:a,thetaStart:o,thetaLength:l};const c=this;r=Math.floor(r),s=Math.floor(s);const u=[],h=[],d=[],f=[];let p=0;const _=[],g=n/2;let m=0;v(),a===!1&&(e>0&&b(!0),t>0&&b(!1)),this.setIndex(u),this.setAttribute("position",new Pe(h,3)),this.setAttribute("normal",new Pe(d,3)),this.setAttribute("uv",new Pe(f,2));function v(){const y=new P,T=new P;let S=0;const R=(t-e)/n;for(let x=0;x<=s;x++){const M=[],A=x/s,I=A*(t-e)+e;for(let N=0;N<=r;N++){const U=N/r,k=U*l+o,L=Math.sin(k),F=Math.cos(k);T.x=I*L,T.y=-A*n+g,T.z=I*F,h.push(T.x,T.y,T.z),y.set(L,R,F).normalize(),d.push(y.x,y.y,y.z),f.push(U,1-A),M.push(p++)}_.push(M)}for(let x=0;x<r;x++)for(let M=0;M<s;M++){const A=_[M][x],I=_[M+1][x],N=_[M+1][x+1],U=_[M][x+1];(e>0||M!==0)&&(u.push(A,I,U),S+=3),(t>0||M!==s-1)&&(u.push(I,N,U),S+=3)}c.addGroup(m,S,0),m+=S}function b(y){const T=p,S=new j,R=new P;let x=0;const M=y===!0?e:t,A=y===!0?1:-1;for(let N=1;N<=r;N++)h.push(0,g*A,0),d.push(0,A,0),f.push(.5,.5),p++;const I=p;for(let N=0;N<=r;N++){const k=N/r*l+o,L=Math.cos(k),F=Math.sin(k);R.x=M*F,R.y=g*A,R.z=M*L,h.push(R.x,R.y,R.z),d.push(0,A,0),S.x=L*.5+.5,S.y=F*.5*A+.5,f.push(S.x,S.y),p++}for(let N=0;N<r;N++){const U=T+N,k=I+N;y===!0?u.push(k,k+1,U):u.push(k+1,k,U),x+=3}c.addGroup(m,x,y===!0?1:2),m+=x}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new lo(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class co extends lo{constructor(e=1,t=1,n=32,r=1,s=!1,a=0,o=Math.PI*2){super(0,e,t,n,r,s,a,o),this.type="C
1oneGeometry",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:r,openEnded:s,thetaStart:a,thetaLength:o}}static fromJSON(e){return new co(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class rr extends et{constructor(e=[],t=[],n=1,r=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:n,detail:r};const s=[],a=[];o(r),c(n),u(),this.setAttribute("position",new Pe(s,3)),this.setAttribute("normal",new Pe(s.slice(),3)),this.setAttribute("uv",new Pe(a,2)),r===0?this.computeVertexNormals():this.normalizeNormals();function o(v){const b=new P,y=new P,T=new P;for(let S=0;S<t.length;S+=3)f(t[S+0],b),f(t[S+1],y),f(t[S+2],T),l(b,y,T,v)}function l(v,b,y,T){const S=T+1,R=[];for(let x=0;x<=S;x++){R[x]=[];const M=v.clone().lerp(y,x/S),A=b.clone().lerp(y,x/S),I=S-x;for(let N=0;N<=I;N++)N===0&&x===S?R[x][N]=M:R[x][N]=M.clone().lerp(A,N/I)}for(let x=0;x<S;x++)for(let M=0;M<2*(S-x)-1;M++){const A=Math.floor(M/2);M%2===0?(d(R[x][A+1]),d(R[x+1][A]),d(R[x][A])):(d(R[x][A+1]),d(R[x+1][A+1]),d(R[x+1][A]))}}function c(v){const b=new P;for(let y=0;y<s.length;y+=3)b.x=s[y+0],b.y=s[y+1],b.z=s[y+2],b.normalize().multiplyScalar(v),s[y+0]=b.x,s[y+1]=b.y,s[y+2]=b.z}function u(){const v=new P;for(let b=0;b<s.length;b+=3){v.x=s[b+0],v.y=s[b+1],v.z=s[b+2];const y=g(v)/2/Math.PI+.5,T=m(v)/Math.PI+.5;a.push(y,1-T)}p(),h()}function h(){for(let v=0;v<a.length;v+=6){const b=a[v+0],y=a[v+2],T=a[v+4],S=Math.max(b,y,T),R=Math.min(b,y,T);S>.9&&R<.1&&(b<.2&&(a[v+0]+=1),y<.2&&(a[v+2]+=1),T<.2&&(a[v+4]+=1))}}function d(v){s.push(v.x,v.y,v.z)}function f(v,b){const y=v*3;b.x=e[y+0],b.y=e[y+1],b.z=e[y+2]}function p(){const v=new P,b=new P,y=new P,T=new P,S=new j,R=new j,x=new j;for(let M=0,A=0;M<s.length;M+=9,A+=6){v.set(s[M+0],s[M+1],s[M+2]),b.set(s[M+3],s[M+4],s[M+5]),y.set(s[M+6],s[M+7],s[M+8]),S.set(a[A+0],a[A+1]),R.set(a[A+2],a[A+3]),x.set(a[A+4],a[A+5]),T.copy(v).add(b).add(y).divideScalar(3);const I=g(T);_(S,A+0,v,I),_(R,A+2,b,I),_(x,A+4,y,I)}}function _(v,b,y,T){T<0&&v.x===1&&(a[b]=v.x-1),y.x===0&&y.z===0&&(a[b]=T/2/Math.PI+.5)}function g(v){return Math.atan2(v.z,-v.x)}function m(v){return Math.atan2(-v.y,Math.sqrt(v.x*v.x+v.z*v.z))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new rr(e.vertices,e.indices,e.radius,e.detail)}}class Gc extends rr{constructor(e=1,t=0){const n=(1+Math.sqrt(5))/2,r=1/n,s=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-r,-n,0,-r,n,0,r,-n,0,r,n,-r,-n,0,-r,n,0,r,-n,0,r,n,0,-n,0,-r,n,0,-r,-n,0,r,n,0,r],a=[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,
vendor: 10,111 bytes, line 1
119,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9];super(s,a,e,t),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new Gc(e.radius,e.detail)}}const qo=new P,$o=new P,Ou=new P,Yo=new un;class M_ extends et{constructor(e=null,t=1){if(super(),this.type="EdgesGeometry",this.parameters={geometry:e,thresholdAngle:t},e!==null){const r=Math.pow(10,4),s=Math.cos(Pr*t),a=e.getIndex(),o=e.getAttribute("position"),l=a?a.count:o.count,c=[0,0,0],u=["a","b","c"],h=new Array(3),d={},f=[];for(let p=0;p<l;p+=3){a?(c[0]=a.getX(p),c[1]=a.getX(p+1),c[2]=a.getX(p+2)):(c[0]=p,c[1]=p+1,c[2]=p+2);const{a:_,b:g,c:m}=Yo;if(_.fromBufferAttribute(o,c[0]),g.fromBufferAttribute(o,c[1]),m.fromBufferAttribute(o,c[2]),Yo.getNormal(Ou),h[0]=`${Math.round(_.x*r)},${Math.round(_.y*r)},${Math.round(_.z*r)}`,h[1]=`${Math.round(g.x*r)},${Math.round(g.y*r)},${Math.round(g.z*r)}`,h[2]=`${Math.round(m.x*r)},${Math.round(m.y*r)},${Math.round(m.z*r)}`,!(h[0]===h[1]||h[1]===h[2]||h[2]===h[0]))for(let v=0;v<3;v++){const b=(v+1)%3,y=h[v],T=h[b],S=Yo[u[v]],R=Yo[u[b]],x=`${y}_${T}`,M=`${T}_${y}`;M in d&&d[M]?(Ou.dot(d[M].normal)<=s&&(f.push(S.x,S.y,S.z),f.push(R.x,R.y,R.z)),d[M]=null):x in d||(d[x]={index0:c[v],index1:c[b],normal:Ou.clone()})}}for(const p in d)if(d[p]){const{index0:_,index1:g}=d[p];qo.fromBufferAttribute(o,_),$o.fromBufferAttribute(o,g),f.push(qo.x,qo.y,qo.z),f.push($o.x,$o.y,$o.z)}this.setAttribute("position",new Pe(f,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}class ri{constructor(){this.type="Curve",this.arcLengthDivisions=200,this.needsUpdate=!1,this.cacheArcLengths=null}getPoint(){_e("Curve: .getPoint() not implemented.")}getPointAt(e,t){const n=this.getUtoTmapping(e);return this.getPoint(n,t)}getPoints(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return t}getSpacedPoints(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let n,r=this.getPoint(0),s=0;t.push(0);for(let a=1;a<=e;a++)n=this.getPoint(a/e),s+=n.distanceTo(r),t.push(s),r=n;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t=null){const n=this.getLengths();let r=0;const s=n.length;let a;t?a=t:a=e*n[s-1];let o=0,l=s-1,c;for(;o<=l;)if(r=Math.floor(o+(l-o)/2),c=n[r]-a,c<0)o=r+1;else if(c>0)l=r-1;else{l=r;break}if(r=l,n[r]===a)return r/(s-1);const u=n[r],d=n[r+1]-u,f=(a-u)/d;return(r+f)/(s-1)}getTangent(e,t){let r=e-1e-4,s=e+1e-4;r<0&&(r=0),s>1&&(s=1);const a=this.getPoint(r),o=this.getPoint(s),l=t||(a.isVector2?new j:new P);return l.copy(o).sub(a).normalize(),l}getTangentAt(e,t){const n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e,t=!1){const n=new P,r=[],s=[],a=[],o=new P,l=new We;for(let f=0;f<=e;f++){const p=f/e;r[f]=this.getTangentAt(p,new P)}s[0]=new P,a[0]=new P;let c=Number.MAX_VALUE;const u=Math.abs(r[0].x),h=Math.abs(r[0].y),d=Math.abs(r[0].z);u<=c&&(c=u,n.set(1,0,0)),h<=c&&(c=h,n.set(0,1,0)),d<=c&&n.set(0,0,1),o.crossVectors(r[0],n).normalize(),s[0].crossVectors(r[0],o),a[0].crossVectors(r[0],s[0]);for(let f=1;f<=e;f++){if(s[f]=s[f-1].clone(),a[f]=a[f-1].clone(),o.crossVectors(r[f-1],r[f]),o.length()>Number.EPSILON){o.normalize();const p=Math.acos($e(r[f-1].dot(r[f]),-1,1));s[f].applyMatrix4(l.makeRotationAxis(o,p))}a[f].crossVectors(r[f],s[f])}if(t===!0){let f=Math.acos($e(s[0].dot(s[e]),-1,1));f/=e,r[0].dot(o.crossVectors(s[0],s[e]))>0&&(f=-f);for(let p=1;p<=e;p++)s[p].applyMatrix4(l.makeRotationAxis(r[p],f*p)),a[p].crossVectors(r[p],s[p])}return{tangents:r,normals:s,binormals:a}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.7,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class Wc extends ri{constructor(e=0,t=0,n=1,r=1,s=0,a=Math.PI*2,o=!1,l=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=r,this.aStartAngle=s,this.aEndAngle=a,this.aClockwise=o,this.aRotation=l}getPoint(e,t=new j){const n=t,r=Math.PI*2;let s=this.aEndAngle-this.aStartAngle;const a=Math.abs(s)<Number.EPSILON;for(;s<0;)s+=r;for(;s>r;)s-=r;s<Number.EPSILON&&(a?s=0:s=r),this.aClockwise===!0&&!a&&(s===r?s=-r:s=s-r);const o=this.aStartAngle+e*s;let l=this.aX+this.xRadius*Math.cos(o),c=this.aY+this.yRadius*Math.sin(o);if(this.aRotation!==0){const u=Math.cos(this.aRotation),h=Math.sin(this.aRotation),d=l-this.aX,f=c-this.aY;l=d*u-f*h+this.aX,c=d*h+f*u+this.aY}return n.set(l,c)}copy(e){return super.copy(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}toJSON(){const e=super.toJSON();return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e}fromJSON(e){return super.fromJSON(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}}class E_ extends Wc{constructor(e,t,n,r,s,a){super(e,t,n,n,r,s,a),this.isArcCurve=!0,this.type="ArcCurve"}}function Ed(){let i=0,e=0,t=0,n=0;function r(s,a,o,l){i=s,e=o,t=-3*s+3*a-2*o-l,n=2*s-2*a+o+l}return{initCatmullRom:function(s,a,o,l,c){r(a,o,c*(o-s),c*(l-a))},initNonuniformCatmullRom:function(s,a,o,l,c,u,h){let d=(a-s)/c-(o-s)/(c+u)+(o-a)/u,f=(o-a)/u-(l-a)/(u+h)+(l-o)/h;d*=u,f*=u,r(a,o,d,f)},calc:function(s){const a=s*s,o=a*s;return i+e*s+t*a+n*o}}}const hp=new P,dp=new P,Uu=new Ed,Fu=new Ed,Bu=new Ed;class T_ extends ri{constructor(e=[],t=!1,n="centripetal",r=.5){super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=e,this.closed=t,this.curveType=n,this.tension=r}getPoint(e,t=new P){const n=t,r=this.points,s=r.length,a=(s-(this.closed?0:1))*e;let o=Math.floor(a),l=a-o;this.closed?o+=o>0?0:(Math.floor(Math.abs(o)/s)+1)*s:l===0&&o===s-1&&(o=s-2,l=1);let c,u;this.closed||o>0?c=r[(o-1)%s]:(dp.subVectors(r[0],r[1]).add(r[0]),c=dp);const h=r[o%s],d=r[(o+1)%s];if(this.closed||o+2<s?u=r[(o+2)%s]:(hp.subVectors(r[s-1],r[s-2]).add(r[s-1]),u=hp),this.curveType==="centripetal"||this.curveType==="chordal"){const f=this.curveType==="chordal"?.5:.25;let p=Math.pow(c.distanceToSquared(h),f),_=Math.pow(h.distanceToSquared(d),f),g=Math.pow(d.distanceToSquared(u),f);_<1e-4&&(_=1),p<1e-4&&(p=_),g<1e-4&&(g=_),Uu.initNonuniformCatmullRom(c.x,h.x,d.x,u.x,p,_,g),Fu.initNonuniformCatmullRom(c.y,h.y,d.y,u.y,p,_,g),Bu.initNonuniformCatmullRom(c.z,h.z,d.z,u.z,p,_,g)}else this.curveType==="catmullrom"&&(Uu.initCatmullRom(c.x,h.x,d.x,u.x,this.tension),Fu.initCatmullRom(c.y,h.y,d.y,u.y,this.tension),Bu.initCatmullRom(c.z,h.z,d.z,u.z,this.tension));return n.set(Uu.calc(l),Fu.calc(l),Bu.calc(l)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const r=e.points[t];this.points.push(r.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++){const r=this.points[t];e.points.push(r.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const r=e.points[t];this.points.push(new P().fromArray(r))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}}function fp(i,e,t,n,r){const s=(n-e)*.5,a=(r-t)*.5,o=i*i,l=i*o;return(2*t-2*n+s+a)*l+(-3*t+3*n-2*s-a)*o+s*i+t}function LM(i,e){const t=1-i;return t*t*e}function NM(i,e){return 2*(1-i)*i*e}function DM(i,e){return i*i*e}function Ca(i,e,t,n){return LM(i,e)+NM(i,t)+DM(i,n)}function OM(i,e){const t=1-i;return t*t*t*e}function UM(i,e){const t=1-i;return 3*t*t*i*e}function FM(i,e){return 3*(1-i)*i*i*e}function BM(i,e){return i*i*i*e}function Ra(i,e,t,n,r){return OM(i,e)+UM(i,t)+FM(i,n)+BM(i,r)}class Td extends ri{constructor(e=new j,t=new j,n=new j,r=new j){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=n,this.v3=r}getPoint(e,t=new j){const n=t,r=this.v0,s=this.v1,a=this.v2,o=this.v3;return n.set(Ra(e,r.x,s.x,a.x,o.x),Ra(e,r.y,s.y,a.y,o.y)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}class w_ extends ri{constructor(e=new P,t=new P,n=new P,r=new P){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=n,this.v3=r}getPoint(e,t=new P){const n=t,r=this.v0,s=this.v1,a=this.v2,o=this.v3;return n.set(Ra(e,r.x,s.x,a.x,o.x),Ra(e,r.y,s.y,a.y,o.y),Ra(e,r.z,s.z,a.z,o.z)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}class wd extends ri{constructor(e=new j,t=new j){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e,t=new j){const n=t;return e===1?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n}getPointAt(e,t){return this.getPoint(e,t)}
vendor: 8,506 bytes, line 1
1getTangent(e,t=new j){return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class A_ extends ri{constructor(e=new P,t=new P){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=e,this.v2=t}getPoint(e,t=new P){const n=t;return e===1?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t=new P){return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class Ad extends ri{constructor(e=new j,t=new j,n=new j){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new j){const n=t,r=this.v0,s=this.v1,a=this.v2;return n.set(Ca(e,r.x,s.x,a.x),Ca(e,r.y,s.y,a.y)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class Cd extends ri{constructor(e=new P,t=new P,n=new P){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new P){const n=t,r=this.v0,s=this.v1,a=this.v2;return n.set(Ca(e,r.x,s.x,a.x),Ca(e,r.y,s.y,a.y),Ca(e,r.z,s.z,a.z)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class Rd extends ri{constructor(e=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=e}getPoint(e,t=new j){const n=t,r=this.points,s=(r.length-1)*e,a=Math.floor(s),o=s-a,l=r[a===0?a:a-1],c=r[a],u=r[a>r.length-2?r.length-1:a+1],h=r[a>r.length-3?r.length-1:a+2];return n.set(fp(o,l.x,c.x,u.x,h.x),fp(o,l.y,c.y,u.y,h.y)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const r=e.points[t];this.points.push(r.clone())}return this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++){const r=this.points[t];e.points.push(r.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const r=e.points[t];this.points.push(new j().fromArray(r))}return this}}var uc=Object.freeze({__proto__:null,ArcCurve:E_,CatmullRomCurve3:T_,CubicBezierCurve:Td,CubicBezierCurve3:w_,EllipseCurve:Wc,LineCurve:wd,LineCurve3:A_,QuadraticBezierCurve:Ad,QuadraticBezierCurve3:Cd,SplineCurve:Rd});class C_ extends ri{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){const e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);if(!e.equals(t)){const n=e.isVector2===!0?"LineCurve":"LineCurve3";this.curves.push(new uc[n](t,e))}return this}getPoint(e,t){const n=e*this.getLength(),r=this.getCurveLengths();let s=0;for(;s<r.length;){if(r[s]>=n){const a=r[s]-n,o=this.curves[s],l=o.getLength(),c=l===0?0:1-a/l;return o.getPointAt(c,t)}s++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let n=0,r=this.curves.length;n<r;n++)t+=this.curves[n].getLength(),e.push(t);return this.cacheLengths=e,e}getSpacedPoints(e=40){const t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return this.autoClose&&t.push(t[0]),t}getPoints(e=12){const t=[];let n;for(let r=0,s=this.curves;r<s.length;r++){const a=s[r],o=a.isEllipseCurve?e*2:a.isLineCurve||a.isLineCurve3?1:a.isSplineCurve?e*a.points.length:e,l=a.getPoints(o);for(let c=0;c<l.length;c++){const u=l[c];n&&n.equals(u)||(t.push(u),n=u)}}return this.autoClose&&t.length>1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,n=e.curves.length;t<n;t++){const r=e.curves[t];this.curves.push(r.clone())}return this.autoClose=e.autoClose,this}toJSON(){const e=super.toJSON();e.autoClose=this.autoClose,e.curves=[];for(let t=0,n=this.curves.length;t<n;t++){const r=this.curves[t];e.curves.push(r.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.autoClose=e.autoClose,this.curves=[];for(let t=0,n=e.curves.length;t<n;t++){const r=e.curves[t];this.curves.push(new uc[r.type]().fromJSON(r))}return this}}class hc extends C_{constructor(e){super(),this.type="Path",this.currentPoint=new j,e&&this.setFromPoints(e)}setFromPoints(e){this.moveTo(e[0].x,e[0].y);for(let t=1,n=e.length;t<n;t++)this.lineTo(e[t].x,e[t].y);return this}moveTo(e,t){return this.currentPoint.set(e,t),this}lineTo(e,t){const n=new wd(this.currentPoint.clone(),new j(e,t));return this.curves.push(n),this.currentPoint.set(e,t),this}quadraticCurveTo(e,t,n,r){const s=new Ad(this.currentPoint.clone(),new j(e,t),new j(n,r));return this.curves.push(s),this.currentPoint.set(n,r),this}bezierCurveTo(e,t,n,r,s,a){const o=new Td(this.currentPoint.clone(),new j(e,t),new j(n,r),new j(s,a));return this.curves.push(o),this.currentPoint.set(s,a),this}splineThru(e){const t=[this.currentPoint.clone()].concat(e),n=new Rd(t);return this.curves.push(n),this.currentPoint.copy(e[e.length-1]),this}arc(e,t,n,r,s,a){const o=this.currentPoint.x,l=this.currentPoint.y;return this.absarc(e+o,t+l,n,r,s,a),this}absarc(e,t,n,r,s,a){return this.absellipse(e,t,n,n,r,s,a),this}ellipse(e,t,n,r,s,a,o,l){const c=this.currentPoint.x,u=this.currentPoint.y;return this.absellipse(e+c,t+u,n,r,s,a,o,l),this}absellipse(e,t,n,r,s,a,o,l){const c=new Wc(e,t,n,r,s,a,o,l);if(this.curves.length>0){const h=c.getPoint(0);h.equals(this.currentPoint)||this.lineTo(h.x,h.y)}this.curves.push(c);const u=c.getPoint(1);return this.currentPoint.copy(u),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class Lr extends hc{constructor(e){super(e),this.uuid=Fn(),this.type="Shape",this.holes=[]}getPointsHoles(e){const t=[];for(let n=0,r=this.holes.length;n<r;n++)t[n]=this.holes[n].getPoints(e);return t}extractPoints(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}}copy(e){super.copy(e),this.holes=[];for(let t=0,n=e.holes.length;t<n;t++){const r=e.holes[t];this.holes.push(r.clone())}return this}toJSON(){const e=super.toJSON();e.uuid=this.uuid,e.holes=[];for(let t=0,n=this.holes.length;t<n;t++){const r=this.holes[t];e.holes.push(r.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.uuid=e.uuid,this.holes=[];for(let t=0,n=e.holes.length;t<n;t++){const r=e.holes[t];this.holes.push(new hc().fromJSON(r))}return this}}function kM(i,e,t=2){const n=e&&e.length,r=n?e[0]*t:i.length;let s=R_(i,0,r,t,!0);const a=[];if(!s||s.next===s.prev)return a;let o,l,c;if(n&&(s=WM(i,e,s,t)),i.length>80*t){o=i[0],l=i[1];let u=o,h=l;for(let d=t;d<r;d+=t){const f=i[d],p=i[d+1];f<o&&(o=f),p<l&&(l=p),f>u&&(u=f),p>h&&(h=p)}c=Math.max(u-o,h-l),c=c!==0?32767/c:0}return $a(s,a,t,o,l,c,0),a}function R_(i,e,t,n,r){let s;if(r===tE(i,e,t,n)>0)for(let a=e;a<t;a+=n)s=pp(a/n|0,i[a],i[a+1],s);else for(let a=t-n;a>=e;a-=n)s=pp(a/n|0,i[a],i[a+1],s);return s&&Ds(s,s.next)&&(Za(s),s=s.next),s}function kr(i,e){if(!i)return i;e||(e=i);let t=i,n;do if(n=!1,!t.steiner&&(Ds(t,t.next)||Ut(t.prev,t,t.next)===0)){if(Za(t),t=e=t.prev,t===t.next)break;n=!0}else t=t.next;while(n||t!==e);return e}function $a(i,e,t,n,r,s,a){if(!i)return;!a&&s&&ZM(i,n,r,s);let o=i;for(;i.prev!==i.next;){const l=i.prev,c=i.next;if(s?zM(i,n,r,s):VM(i)){e.push(l.i,i.i,c.i),Za(i),i=c.next,o=c.next;continue}if(i=c,i===o){a?a===1?(i=HM(kr(i),e),$a(i,e,t,n,r,s,2)):a===2&&GM(i,e,t,n,r,s
vendor: 4,299 bytes, line 1
1):$a(kr(i),e,t,n,r,s,1);break}}}function VM(i){const e=i.prev,t=i,n=i.next;if(Ut(e,t,n)>=0)return!1;const r=e.x,s=t.x,a=n.x,o=e.y,l=t.y,c=n.y,u=Math.min(r,s,a),h=Math.min(o,l,c),d=Math.max(r,s,a),f=Math.max(o,l,c);let p=n.next;for(;p!==e;){if(p.x>=u&&p.x<=d&&p.y>=h&&p.y<=f&&fa(r,o,s,l,a,c,p.x,p.y)&&Ut(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function zM(i,e,t,n){const r=i.prev,s=i,a=i.next;if(Ut(r,s,a)>=0)return!1;const o=r.x,l=s.x,c=a.x,u=r.y,h=s.y,d=a.y,f=Math.min(o,l,c),p=Math.min(u,h,d),_=Math.max(o,l,c),g=Math.max(u,h,d),m=bh(f,p,e,t,n),v=bh(_,g,e,t,n);let b=i.prevZ,y=i.nextZ;for(;b&&b.z>=m&&y&&y.z<=v;){if(b.x>=f&&b.x<=_&&b.y>=p&&b.y<=g&&b!==r&&b!==a&&fa(o,u,l,h,c,d,b.x,b.y)&&Ut(b.prev,b,b.next)>=0||(b=b.prevZ,y.x>=f&&y.x<=_&&y.y>=p&&y.y<=g&&y!==r&&y!==a&&fa(o,u,l,h,c,d,y.x,y.y)&&Ut(y.prev,y,y.next)>=0))return!1;y=y.nextZ}for(;b&&b.z>=m;){if(b.x>=f&&b.x<=_&&b.y>=p&&b.y<=g&&b!==r&&b!==a&&fa(o,u,l,h,c,d,b.x,b.y)&&Ut(b.prev,b,b.next)>=0)return!1;b=b.prevZ}for(;y&&y.z<=v;){if(y.x>=f&&y.x<=_&&y.y>=p&&y.y<=g&&y!==r&&y!==a&&fa(o,u,l,h,c,d,y.x,y.y)&&Ut(y.prev,y,y.next)>=0)return!1;y=y.nextZ}return!0}function HM(i,e){let t=i;do{const n=t.prev,r=t.next.next;!Ds(n,r)&&P_(n,t,t.next,r)&&Ya(n,r)&&Ya(r,n)&&(e.push(n.i,t.i,r.i),Za(t),Za(t.next),t=i=r),t=t.next}while(t!==i);return kr(t)}function GM(i,e,t,n,r,s){let a=i;do{let o=a.next.next;for(;o!==a.prev;){if(a.i!==o.i&&jM(a,o)){let l=L_(a,o);a=kr(a,a.next),l=kr(l,l.next),$a(a,e,t,n,r,s,0),$a(l,e,t,n,r,s,0);return}o=o.next}a=a.next}while(a!==i)}function WM(i,e,t,n){const r=[];for(let s=0,a=e.length;s<a;s++){const o=e[s]*n,l=s<a-1?e[s+1]*n:i.length,c=R_(i,o,l,n,!1);c===c.next&&(c.steiner=!0),r.push(JM(c))}r.sort(XM);for(let s=0;s<r.length;s++)t=qM(r[s],t);return t}function XM(i,e){let t=i.x-e.x;if(t===0&&(t=i.y-e.y,t===0)){const n=(i.next.y-i.y)/(i.next.x-i.x),r=(e.next.y-e.y)/(e.next.x-e.x);t=n-r}return t}function qM(i,e){const t=$M(i,e);if(!t)return e;const n=L_(t,i);return kr(n,n.next),kr(t,t.next)}function $M(i,e){let t=e;const n=i.x,r=i.y;let s=-1/0,a;if(Ds(i,t))return t;do{if(Ds(i,t.next))return t.next;if(r<=t.y&&r>=t.next.y&&t.next.y!==t.y){const h=t.x+(r-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(h<=n&&h>s&&(s=h,a=t.x<t.next.x?t:t.next,h===n))return a}t=t.next}while(t!==e);if(!a)return null;const o=a,l=a.x,c=a.y;let u=1/0;t=a;do{if(n>=t.x&&t.x>=l&&n!==t.x&&I_(r<c?n:s,r,l,c,r<c?s:n,r,t.x,t.y)){const h=Math.abs(r-t.y)/(n-t.x);Ya(t,i)&&(h<u||h===u&&(t.x>a.x||t.x===a.x&&YM(a,t)))&&(a=t,u=h)}t=t.next}while(t!==o);return a}function YM(i,e){return Ut(i.prev,i,e.prev)<0&&Ut(e.next,i,i.next)<0}function ZM(i,e,t,n){let r=i;do r.z===0&&(r.z=bh(r.x,r.y,e,t,n)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==i);r.prevZ.nextZ=null,r.prevZ=null,KM(r)}function KM(i){let e,t=1;do{let n=i,r;i=null;let s=null;for(e=0;n;){e++;let a=n,o=0;for(let c=0;c<t&&(o++,a=a.nextZ,!!a);c++);let l=t;for(;o>0||l>0&&a;)o!==0&&(l===0||!a||n.z<=a.z)?(r=n,n=n.nextZ,o--):(r=a,a=a.nextZ,l--),s?s.nextZ=r:i=r,r.prevZ=s,s=r;n=a}s.nextZ=null,t*=2}while(e>1);return i}function bh(i,e,t,n,r){return i=(i-t)*r|0,e=(e-n)*r|0,i=(i|i<<8)&16711935,i=(i|i<<4)&252645135,i=(i|i<<2)&858993459,i=(i|i<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,i|e<<1}function JM(i){let e=i,t=i;do(e.x<t.x||e.x===t.x&&e.y<t.y)&&(t=e),e=e.next;while(e!==i);return t}function I_(i,e,t,n,r,s,a,o){return(r-a)*(e-o)>=(i-a)*(s-o)&&(i-a)*(n-o)>=(t-a)*(e-o)&&(t-a)*(s-o)>=(r-a)*(n-o)}function fa(i,e,t,n,r,s,a,o){return!(i===a&&e===o)&&I_(i,e,t,n,r,s,a,o)}function jM(i,e){return i.next.i!==e.i&&i.prev.i!==e.i&&!QM(i,e)&&(Ya(i,e)&&Ya(e,i)&&eE(i,e)&&(Ut(i.prev,i,e.prev)||Ut(i,e.prev,e))||Ds(i,e)&&Ut(i.prev,i,i.next)>0&&Ut(e.prev,e,e.next)>0)}function Ut(i,e,t){return(e.y-i.y)*(t.x-e.x)-(e.x-i.x)*(t.y-e.y)}function Ds(i,e){return i.x===e.x&&i.y===e.y}function P_(i,e,t,n){const r=Ko(Ut(i,e,t)),s=Ko(Ut(i,e,n)),a=Ko(Ut(t,n,i)),o=Ko(Ut(t,n,e));return!!(r!==s&&a!==o||r===0&&Zo(i,t,e)||s===0&&Zo(i,n,e)||a===0&&Zo(t,i,n)||o===0&&Zo(t,e,n))}function Zo(i,e,t){return e.x<=Math.max(i.x,t.x)&&e.x>=Math.min(i.x,t.x)&&e.y<=Math.max(i.y,t.y)&&e.y>=Math.min(i.y,t.y)}function Ko(i){return i>0?1:i<0?-1:0}function QM(i,e){let t=i;do{if(t.i!==i.i&&t.next.i!==i.i&&t.i!==e.i&&t.next.i!==e.i&&P_(t,t.next,i,e))return!0;t=t.next}
1while(t!==i);return!1}function Ya(i,e){return Ut(i.prev,i,i.next)<0?Ut(i,e,i.next)>=0&&Ut(i,i.prev,e)>=0:Ut(i,e,i.prev)<0||Ut(i,i.next,e)<0}function eE(i,e){let t=i,n=!1;const r=(i.x+e.x)/2,s=(i.y+e.y)/2;do t.y>s!=t.next.y>s&&t.next.y!==t.y&&r<(t.next.x-t.x)*(s-t.y)/(t.next.y-t.y)+t.x&&(n=!n),t=t.next;while(t!==i);return n}function L_(i,e){const t=Sh(i.i,i.x,i.y),n=Sh(e.i,e.x,e.y),r=i.next,s=e.prev;return i.next=e,e.prev=i,t.next=r,r.prev=t,n.next=t,t.prev=n,s.next=n,n.prev=s,n}function pp(i,e,t,n){const r=Sh(i,e,t);return n?(r.next=n.next,r.prev=n,n.next.prev=r,n.next=r):(r.prev=r,r.next=r),r}function Za(i){i.next.prev=i.prev,i.prev.next=i.next,i.prevZ&&(i.prevZ.nextZ=i.nextZ),i.nextZ&&(i.nextZ.prevZ=i.prevZ)}function Sh(i,e,t){return{i,x:e,y:t,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function tE(i,e,t,n){let r=0;for(let s=e,a=t-n;s<t;s+=n)r+=(i[a]-i[s])*(i[s+1]+i[a+1]),a=s;return r}class nE{static triangulate(e,t,n=2){return kM(e,t,n)}}class Qn{static area(e){const t=e.length;let n=0;for(let r=t-1,s=0;s<t;r=s++)n+=e[r].x*e[s].y-e[s].x*e[r].y;return n*.5}static isClockWise(e){return Qn.area(e)<0}static triangulateShape(e,t){const n=[],r=[],s=[];mp(e),gp(n,e);let a=e.length;t.forEach(mp);for(let l=0;l<t.length;l++)r.push(a),a+=t[l].length,gp(n,t[l]);const o=nE.triangulate(n,r);for(let l=0;l<o.length;l+=3)s.push(o.slice(l,l+3));return s}}function mp(i){const e=i.length;e>2&&i[e-1].equals(i[0])&&i.pop()}function gp(i,e){for(let t=0;t<e.length;t++)i.push(e[t].x),i.push(e[t].y)}class Xc extends et{constructor(e=new Lr([new j(.5,.5),new j(-.5,.5),new j(-.5,-.5),new j(.5,-.5)]),t={}){super(),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},e=Array.isArray(e)?e:[e];const n=this,r=[],s=[];for(let o=0,l=e.length;o<l;o++){const c=e[o];a(c)}this.setAttribute("position",new Pe(r,3)),this.setAttribute("uv",new Pe(s,2)),this.computeVertexNormals();function a(o){const l=[],c=t.curveSegments!==void 0?t.curveSegments:12,u=t.steps!==void 0?t.steps:1,h=t.depth!==void 0?t.depth:1;let d=t.bevelEnabled!==void 0?t.bevelEnabled:!0,f=t.bevelThickness!==void 0?t.bevelThickness:.2,p=t.bevelSize!==void 0?t.bevelSize:f-.1,_=t.bevelOffset!==void 0?t.bevelOffset:0,g=t.bevelSegments!==void 0?t.bevelSegments:3;const m=t.extrudePath,v=t.UVGenerator!==void 0?t.UVGenerator:iE;let b,y=!1,T,S,R,x;if(m){b=m.getSpacedPoints(u),y=!0,d=!1;const Q=m.isCatmullRomCurve3?m.closed:!1;T=m.computeFrenetFrames(u,Q),S=new P,R=new P,x=new P}d||(g=0,f=0,p=0,_=0);const M=o.extractPoints(c);let A=M.shape;const I=M.holes;if(!Qn.isClockWise(A)){A=A.reverse();for(let Q=0,se=I.length;Q<se;Q++){const ee=I[Q];Qn.isClockWise(ee)&&(I[Q]=ee.reverse())}}function U(Q){const ee=10000000000000001e-36;let pe=Q[0];for(let ve=1;ve<=Q.length;ve++){const Je=ve%Q.length,D=Q[Je],nt=D.x-pe.x,Ue=D.y-pe.y,je=nt*nt+Ue*Ue,oe=Math.max(Math.abs(D.x),Math.abs(D.y),Math.abs(pe.x),Math.abs(pe.y)),bt=ee*oe*oe;if(je<=bt){Q.splice(Je,1),ve--;continue}pe=D}}U(A),I.forEach(U);const k=I.length,L=A;for(let Q=0;Q<k;Q++){const se=I[Q];A=A.concat(se)}function F(Q,se,ee){return se||Oe("ExtrudeGeometry: vec does not exist"),Q.clone().addScaledVector(se,ee)}const O=A.length;function X(Q,se,ee){let pe,ve,Je;const D=Q.x-se.x,nt=Q.y-se.y,Ue=ee.x-Q.x,je=ee.y-Q.y,oe=D*D+nt*nt,bt=D*je-nt*Ue;if(Math.abs(bt)>Number.EPSILON){const C=Math.sqrt(oe),E=Math.sqrt(Ue*Ue+je*je),z=se.x-nt/C,Z=se.y+D/C,ne=ee.x-je/E,ce=ee.y+Ue/E,fe=((ne-z)*je-(ce-Z)*Ue)/(D*je-nt*Ue);pe=z+D*fe-Q.x,ve=Z+nt*fe-Q.y;const q=pe*pe+ve*ve;if(q<=2)return new j(pe,ve);Je=Math.sqrt(q/2)}else{let C=!1;D>Number.EPSILON?Ue>Number.EPSILON&&(C=!0):D<-Number.EPSILON?Ue<-Number.EPSILON&&(C=!0):Math.sign(nt)===Math.sign(je)&&(C=!0),C?(pe=-nt,ve=D,Je=Math.sqrt(oe)):(pe=D,ve=nt,Je=Math.sqrt(oe/2))}return new j(pe/Je,ve/Je)}const $=[];for(let Q=0,se=L.length,ee=se-1,pe=Q+1;Q<se;Q++,ee++,pe++)ee===se&&(ee=0),pe===se&&(pe=0),$[Q]=X(L[Q],L[ee],L[pe]);const te=[];let ue,xe=$.concat();for(let Q=0,se=k;Q<se;Q++){const ee=I[Q];ue=[];for(let pe=0,ve=ee.length,Je=ve-1,D=pe+1;pe<ve;pe++,Je++,D++)Je===ve&&(Je=0),D===ve&&(D=0),ue[pe]=X(ee[pe],ee[Je],ee[D]);te.push(ue),xe=xe.concat(ue)}let He;if(g===0)He=Qn.triangulateShape(L,I);else{const Q=[],se=[];for(let ee=0;ee<g;ee++){const pe=ee/g,ve=f*Math.cos(pe*Math.PI/2),Je=p*Math.sin(pe*Math.PI/2)+_;for(let D=0,nt=L.length;D<nt;D++){const Ue=F(L[D],$[D],Je);De(Ue.x,Ue.y,-ve),pe===0&&Q.push(Ue)}for(let D=0,nt=k;D<nt;D++){const Ue=I[D];ue=te[D];const je=[];for(let oe=0,bt=Ue.length;oe<bt;oe++){const C=F(Ue[oe],ue[oe],Je);De(C.x,C.y,-ve),pe===0&&je.push(C)}pe===0&&se.push(je)}}He=Qn.triangulateShape(Q,se)}const Ke=He.length,qe=p+_;for(let Q=0;Q<O;Q++){const se=d?F(A[Q],xe[Q],qe):A[Q];
vendor: 18,912 bytes, lines 1-5
1y?(R.copy(T.normals[0]).multiplyScalar(se.x),S.copy(T.binormals[0]).multiplyScalar(se.y),x.copy(b[0]).add(R).add(S),De(x.x,x.y,x.z)):De(se.x,se.y,0)}for(let Q=1;Q<=u;Q++)for(let se=0;se<O;se++){const ee=d?F(A[se],xe[se],qe):A[se];y?(R.copy(T.normals[Q]).multiplyScalar(ee.x),S.copy(T.binormals[Q]).multiplyScalar(ee.y),x.copy(b[Q]).add(R).add(S),De(x.x,x.y,x.z)):De(ee.x,ee.y,h/u*Q)}for(let Q=g-1;Q>=0;Q--){const se=Q/g,ee=f*Math.cos(se*Math.PI/2),pe=p*Math.sin(se*Math.PI/2)+_;for(let ve=0,Je=L.length;ve<Je;ve++){const D=F(L[ve],$[ve],pe);De(D.x,D.y,h+ee)}for(let ve=0,Je=I.length;ve<Je;ve++){const D=I[ve];ue=te[ve];for(let nt=0,Ue=D.length;nt<Ue;nt++){const je=F(D[nt],ue[nt],pe);y?De(je.x,je.y+b[u-1].y,b[u-1].x+ee):De(je.x,je.y,h+ee)}}}K(),ye();function K(){const Q=r.length/3;if(d){let se=0,ee=O*se;for(let pe=0;pe<Ke;pe++){const ve=He[pe];Ne(ve[2]+ee,ve[1]+ee,ve[0]+ee)}se=u+g*2,ee=O*se;for(let pe=0;pe<Ke;pe++){const ve=He[pe];Ne(ve[0]+ee,ve[1]+ee,ve[2]+ee)}}else{for(let se=0;se<Ke;se++){const ee=He[se];Ne(ee[2],ee[1],ee[0])}for(let se=0;se<Ke;se++){const ee=He[se];Ne(ee[0]+O*u,ee[1]+O*u,ee[2]+O*u)}}n.addGroup(Q,r.length/3-Q,0)}function ye(){const Q=r.length/3;let se=0;le(L,se),se+=L.length;for(let ee=0,pe=I.length;ee<pe;ee++){const ve=I[ee];le(ve,se),se+=ve.length}n.addGroup(Q,r.length/3-Q,1)}function le(Q,se){let ee=Q.length;for(;--ee>=0;){const pe=ee;let ve=ee-1;ve<0&&(ve=Q.length-1);for(let Je=0,D=u+g*2;Je<D;Je++){const nt=O*Je,Ue=O*(Je+1),je=se+pe+nt,oe=se+ve+nt,bt=se+ve+Ue,C=se+pe+Ue;Ge(je,oe,bt,C)}}}function De(Q,se,ee){l.push(Q),l.push(se),l.push(ee)}function Ne(Q,se,ee){ft(Q),ft(se),ft(ee);const pe=r.length/3,ve=v.generateTopUV(n,r,pe-3,pe-2,pe-1);Ye(ve[0]),Ye(ve[1]),Ye(ve[2])}function Ge(Q,se,ee,pe){ft(Q),ft(se),ft(pe),ft(se),ft(ee),ft(pe);const ve=r.length/3,Je=v.generateSideWallUV(n,r,ve-6,ve-3,ve-2,ve-1);Ye(Je[0]),Ye(Je[1]),Ye(Je[3]),Ye(Je[1]),Ye(Je[2]),Ye(Je[3])}function ft(Q){r.push(l[Q*3+0]),r.push(l[Q*3+1]),r.push(l[Q*3+2])}function Ye(Q){s.push(Q.x),s.push(Q.y)}}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON(),t=this.parameters.shapes,n=this.parameters.options;return rE(t,n,e)}static fromJSON(e,t){const n=[];for(let s=0,a=e.shapes.length;s<a;s++){const o=t[e.shapes[s]];n.push(o)}const r=e.options.extrudePath;return r!==void 0&&(e.options.extrudePath=new uc[r.type]().fromJSON(r)),new Xc(n,e.options)}}const iE={generateTopUV:function(i,e,t,n,r){const s=e[t*3],a=e[t*3+1],o=e[n*3],l=e[n*3+1],c=e[r*3],u=e[r*3+1];return[new j(s,a),new j(o,l),new j(c,u)]},generateSideWallUV:function(i,e,t,n,r,s){const a=e[t*3],o=e[t*3+1],l=e[t*3+2],c=e[n*3],u=e[n*3+1],h=e[n*3+2],d=e[r*3],f=e[r*3+1],p=e[r*3+2],_=e[s*3],g=e[s*3+1],m=e[s*3+2];return Math.abs(o-u)<Math.abs(a-c)?[new j(a,1-l),new j(c,1-h),new j(d,1-p),new j(_,1-m)]:[new j(o,1-l),new j(u,1-h),new j(f,1-p),new j(g,1-m)]}};function rE(i,e,t){if(t.shapes=[],Array.isArray(i))for(let n=0,r=i.length;n<r;n++){const s=i[n];t.shapes.push(s.uuid)}else t.shapes.push(i.uuid);return t.options=Object.assign({},e),e.extrudePath!==void 0&&(t.options.extrudePath=e.extrudePath.toJSON()),t}class qc extends rr{constructor(e=1,t=0){const n=(1+Math.sqrt(5))/2,r=[-1,n,0,1,n,0,-1,-n,0,1,-n,0,0,-1,n,0,1,n,0,-1,-n,0,1,-n,n,0,-1,n,0,1,-n,0,-1,-n,0,1],s=[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1];super(r,s,e,t),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new qc(e.radius,e.detail)}}class $c extends et{constructor(e=[new j(0,-.5),new j(.5,0),new j(0,.5)],t=12,n=0,r=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:n,phiLength:r},t=Math.floor(t),r=$e(r,0,Math.PI*2);const s=[],a=[],o=[],l=[],c=[],u=1/t,h=new P,d=new j,f=new P,p=new P,_=new P;let g=0,m=0;for(let v=0;v<=e.length-1;v++)switch(v){case 0:g=e[v+1].x-e[v].x,m=e[v+1].y-e[v].y,f.x=m*1,f.y=-g,f.z=m*0,_.copy(f),f.normalize(),l.push(f.x,f.y,f.z);break;case e.length-1:l.push(_.x,_.y,_.z);break;default:g=e[v+1].x-e[v].x,m=e[v+1].y-e[v].y,f.x=m*1,f.y=-g,f.z=m*0,p.copy(f),f.x+=_.x,f.y+=_.y,f.z+=_.z,f.normalize(),l.push(f.x,f.y,f.z),_.copy(p)}for(let v=0;v<=t;v++){const b=n+v*u*r,y=Math.sin(b),T=Math.cos(b);for(let S=0;S<=e.length-1;S++){h.x=e[S].x*y,h.y=e[S].y,h.z=e[S].x*T,a.push(h.x,h.y,h.z),d.x=v/t,d.y=S/(e.length-1),o.push(d.x,d.y);const R=l[3*S+0]*y,x=l[3*S+1],M=l[3*S+0]*T;c.push(R,x,M)}}for(let v=0;v<t;v++)for(let b=0;b<e.length-1;b++){const y=b+v*e.length,T=y,S=y+e.length,R=y+e.length+1,x=y+1;s.push(T,S,x),s.push(R,x,S)}this.setIndex(s),this.setAttribute("position",new Pe(a,3)),this.setAttribute("uv",new Pe(o,2)),this.setAttribute("normal",new Pe(c,3))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new $c(e.points,e.segments,e.phiStart,e.phiLength)}}class uo extends rr{constructor(e=1,t=0){const n=[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],r=[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2];super(n,r,e,t),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new uo(e.radius,e.detail)}}class Xs extends et{constructor(e=1,t=1,n=1,r=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:r};const s=e/2,a=t/2,o=Math.floor(n),l=Math.floor(r),c=o+1,u=l+1,h=e/o,d=t/l,f=[],p=[],_=[],g=[];for(let m=0;m<u;m++){const v=m*d-a;for(let b=0;b<c;b++){const y=b*h-s;p.push(y,-v,0),_.push(0,0,1),g.push(b/o),g.push(1-m/l)}}for(let m=0;m<l;m++)for(let v=0;v<o;v++){const b=v+c*m,y=v+c*(m+1),T=v+1+c*(m+1),S=v+1+c*m;f.push(b,y,S),f.push(y,T,S)}this.setIndex(f),this.setAttribute("position",new Pe(p,3)),this.setAttribute("normal",new Pe(_,3)),this.setAttribute("uv",new Pe(g,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Xs(e.width,e.height,e.widthSegments,e.heightSegments)}}class Yc extends et{constructor(e=.5,t=1,n=32,r=1,s=0,a=Math.PI*2){super(),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:n,phiSegments:r,thetaStart:s,thetaLength:a},n=Math.max(3,n),r=Math.max(1,r);const o=[],l=[],c=[],u=[];let h=e;const d=(t-e)/r,f=new P,p=new j;for(let _=0;_<=r;_++){for(let g=0;g<=n;g++){const m=s+g/n*a;f.x=h*Math.cos(m),f.y=h*Math.sin(m),l.push(f.x,f.y,f.z),c.push(0,0,1),p.x=(f.x/t+1)/2,p.y=(f.y/t+1)/2,u.push(p.x,p.y)}h+=d}for(let _=0;_<r;_++){const g=_*(n+1);for(let m=0;m<n;m++){const v=m+g,b=v,y=v+n+1,T=v+n+2,S=v+1;o.push(b,y,S),o.push(y,T,S)}}this.setIndex(o),this.setAttribute("position",new Pe(l,3)),this.setAttribute("normal",new Pe(c,3)),this.setAttribute("uv",new Pe(u,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Yc(e.innerRadius,e.outerRadius,e.thetaSegments,e.phiSegments,e.thetaStart,e.thetaLength)}}class Zc extends et{constructor(e=new Lr([new j(0,.5),new j(-.5,-.5),new j(.5,-.5)]),t=12){super(),this.type="ShapeGeometry",this.parameters={shapes:e,curveSegments:t};const n=[],r=[],s=[],a=[];let o=0,l=0;if(Array.isArray(e)===!1)c(e);else for(let u=0;u<e.length;u++)c(e[u]),this.addGroup(o,l,u),o+=l,l=0;this.setIndex(n),this.setAttribute("position",new Pe(r,3)),this.setAttribute("normal",new Pe(s,3)),this.setAttribute("uv",new Pe(a,2));function c(u){const h=r.length/3,d=u.extractPoints(t);let f=d.shape;const p=d.holes;Qn.isClockWise(f)===!1&&(f=f.reverse());for(let g=0,m=p.length;g<m;g++){const v=p[g];Qn.isClockWise(v)===!0&&(p[g]=v.reverse())}const _=Qn.triangulateShape(f,p);for(let g=0,m=p.length;g<m;g++){const v=p[g];f=f.concat(v)}for(let g=0,m=f.length;g<m;g++){const v=f[g];r.push(v.x,v.y,0),s.push(0,0,1),a.push(v.x,v.y)}for(let g=0,m=_.length;g<m;g++){const v=_[g],b=v[0]+h,y=v[1]+h,T=v[2]+h;n.push(b,y,T),l+=3}}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON(),t=this.parameters.shapes;return sE(t,e)}static fromJSON(e,t){const n=[];for(let r=0,s=e.shapes.length;r<s;r++){const a=t[e.shapes[r]];n.push(a)}return new Zc(n,e.curveSegments)}}function sE(i,e){if(e.shapes=[],Array.isArray(i))for(let t=0,n=i.length;t<n;t++){const r=i[t];e.shapes.push(r.uuid)}else e.shapes.push(i.uuid);return e}class qs extends et{constructor(e=1,t=32,n=16,r=0,s=Math.PI*2,a=0,o=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:r,phiLength:s,thetaStart:a,thetaLength:o},t=Math.max(3,Math.floor(t)),n=Math.max(2,Math.floor(n));const l=Math.min(a+o,Math.PI);let c=0;const u=[],h=new P,d=new P,f=[],p=[],_=[],g=[];for(let m=0;m<=n;m++){const v=[],b=m/n;let y=0;m===0&&a===0?y=.5/t:m===n&&l===Math.PI&&(y=-.5/t);for(let T=0;T<=t;T++){const S=T/t;h.x=-e*Math.cos(r+S*s)*Math.sin(a+b*o),h.y=e*Math.cos(a+b*o),h.z=e*Math.sin(r+S*s)*Math.sin(a+b*o),p.push(h.x,h.y,h.z),d.copy(h).normalize(),_.push(d.x,d.y,d.z),g.push(S+y,1-b),v.push(c++)}u.push(v)}for(let m=0;m<n;m++)for(let v=0;v<t;v++){const b=u[m][v+1],y=u[m][v],T=u[m+1][v],S=u[m+1][v+1];(m!==0||a>0)&&f.push(b,y,S),(m!==n-1||l<Math.PI)&&f.push(y,T,S)}this.setIndex(f),this.setAttribute("position",new Pe(p,3)),this.setAttribute("normal",new Pe(_,3)),this.setAttribute("uv",new Pe(g,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new qs(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class Kc extends rr{constructor(e=1,t=0){const n=[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],r=[2,1,0,0,3,2,1,3,0,2,3,1];super(n,r,e,t),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new Kc(e.radius,e.detail)}}class Jc extends et{constructor(e=1,t=.4,n=12,r=48,s=Math.PI*2,a=0,o=Math.PI*2){super(),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:r,arc:s,thetaStart:a,thetaLength:o},n=Math.floor(n),r=Math.floor(r);const l=[],c=[],u=[],h=[],d=new P,f=new P,p=new P;for(let _=0;_<=n;_++){const g=a+_/n*o;for(let m=0;m<=r;m++){const v=m/r*s;f.x=(e+t*Math.cos(g))*Math.cos(v),f.y=(e+t*Math.cos(g))*Math.sin(v),f.z=t*Math.sin(g),c.push(f.x,f.y,f.z),d.x=e*Math.cos(v),d.y=e*Math.sin(v),p.subVectors(f,d).normalize(),u.push(p.x,p.y,p.z),h.push(m/r),h.push(_/n)}}for(let _=1;_<=n;_++)for(let g=1;g<=r;g++){const m=(r+1)*_+g-1,v=(r+1)*(_-1)+g-1,b=(r+1)*(_-1)+g,y=(r+1)*_+g;l.push(m,v,y),l.push(v,b,y)}this.setIndex(l),this.setAttribute("position",new Pe(c,3)),this.setAttribute("normal",new Pe(u,3)),this.setAttribute("uv",new Pe(h,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Jc(e.radius,e.tube,e.radialSegments,e.tubularSegments,e.arc)}}class jc extends et{constructor(e=1,t=.4,n=64,r=8,s=2,a=3){super(),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:n,radialSegments:r,p:s,q:a},n=Math.floor(n),r=Math.floor(r);const o=[],l=[],c=[],u=[],h=new P,d=new P,f=new P,p=new P,_=new P,g=new P,m=new P;for(let b=0;b<=n;++b){const y=b/n*s*Math.PI*2;v(y,s,a,e,f),v(y+.01,s,a,e,p),g.subVectors(p,f),m.addVectors(p,f),_.crossVectors(g,m),m.crossVectors(_,g),_.normalize(),m.normalize();for(let T=0;T<=r;++T){const S=T/r*Math.PI*2,R=-t*Math.cos(S),x=t*Math.sin(S);h.x=f.x+(R*m.x+x*_.x),h.y=f.y+(R*m.y+x*_.y),h.z=f.z+(R*m.z+x*_.z),l.push(h.x,h.y,h.z),d.subVectors(h,f).normalize(),c.push(d.x,d.y,d.z),u.push(b/n),u.push(T/r)}}for(let b=1;b<=n;b++)for(let y=1;y<=r;y++){const T=(r+1)*(b-1)+(y-1),S=(r+1)*b+(y-1),R=(r+1)*b+y,x=(r+1)*(b-1)+y;o.push(T,S,x),o.push(S,R,x)}this.setIndex(o),this.setAttribute("position",new Pe(l,3)),this.setAttribute("normal",new Pe(c,3)),this.setAttribute("uv",new Pe(u,2));function v(b,y,T,S,R){const x=Math.cos(b),M=Math.sin(b),A=T/y*b,I=Math.cos(A);R.x=S*(2+I)*.5*x,R.y=S*(2+I)*M*.5,R.z=S*Math.sin(A)*.5}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new jc(e.radius,e.tube,e.tubularSegments,e.radialSegments,e.p,e.q)}}class Qc extends et{constructor(e=new Cd(new P(-1,-1,0),new P(-1,1,0),new P(1,1,0)),t=64,n=1,r=8,s=!1){super(),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:n,radialSegments:r,closed:s};const a=e.computeFrenetFrames(t,s);this.tangents=a.tangents,this.normals=a.normals,this.binormals=a.binormals;const o=new P,l=new P,c=new j;let u=new P;const h=[],d=[],f=[],p=[];_(),this.setIndex(p),this.setAttribute("position",new Pe(h,3)),this.setAttribute("normal",new Pe(d,3)),this.setAttribute("uv",new Pe(f,2));function _(){for(let b=0;b<t;b++)g(b);g(s===!1?t:0),v(),m()}function g(b){u=e.getPointAt(b/t,u);const y=a.normals[b],T=a.binormals[b];for(let S=0;S<=r;S++){const R=S/r*Math.PI*2,x=Math.sin(R),M=-Math.cos(R);l.x=M*y.x+x*T.x,l.y=M*y.y+x*T.y,l.z=M*y.z+x*T.z,l.normalize(),d.push(l.x,l.y,l.z),o.x=u.x+n*l.x,o.y=u.y+n*l.y,o.z=u.z+n*l.z,h.push(o.x,o.y,o.z)}}function m(){for(let b=1;b<=t;b++)for(let y=1;y<=r;y++){const T=(r+1)*(b-1)+(y-1),S=(r+1)*b+(y-1),R=(r+1)*b+y,x=(r+1)*(b-1)+y;p.push(T,S,x),p.push(S,R,x)}}function v(){for(let b=0;b<=t;b++)for(let y=0;y<=r;y++)c.x=b/t,c.y=y/r,f.push(c.x,c.y)}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON();return e.path=this.parameters.path.toJSON(),e}static fromJSON(e){return new Qc(new uc[e.path.type]().fromJSON(e.path),e.tubularSegments,e.radius,e.radialSegments,e.closed)}}class N_ extends et{constructor(e=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:e},e!==null){const t=[],n=new Set,r=new P,s=new P;if(e.index!==null){const a=e.attributes.position,o=e.index;let l=e.groups;l.length===0&&(l=[{start:0,count:o.count,materialIndex:0}]);for(let c=0,u=l.length;c<u;++c){const h=l[c],d=h.start,f=h.count;for(let p=d,_=d+f;p<_;p+=3)for(let g=0;g<3;g++){const m=o.getX(p+g),v=o.getX(p+(g+1)%3);r.fromBufferAttribute(a,m),s.fromBufferAttribute(a,v),_p(r,s,n)===!0&&(t.push(r.x,r.y,r.z),t.push(s.x,s.y,s.z))}}}else{const a=e.attributes.position;for(let o=0,l=a.count/3;o<l;o++)for(let c=0;c<3;c++){const u=3*o+c,h=3*o+(c+1)%3;r.fromBufferAttribute(a,u),s.fromBufferAttribute(a,h),_p(r,s,n)===!0&&(t.push(r.x,r.y,r.z),t.push(s.x,s.y,s.z))}}this.setAttribute("position",new Pe(t,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}function _p(i,e,t){const n=`${i.x},${i.y},${i.z}-${e.x},${e.y},${e.z}`,r=`${e.x},${e.y},${e.z}-${i.x},${i.y},${i.z}`;return t.has(n)===!0||t.has(r)===!0?!1:(t.add(n),t.add(r),!0)}var vp=Object.freeze({__proto__:null,BoxGeometry:Vr,CapsuleGeometry:zc,CircleGeometry:Hc,ConeGeometry:co,CylinderGeometry:lo,DodecahedronGeometry:Gc,EdgesGeometry:M_,ExtrudeGeometry:Xc,IcosahedronGeometry:qc,LatheGeometry:$c,OctahedronGeometry:uo,PlaneGeometry:Xs,PolyhedronGeometry:rr,RingGeometry:Yc,ShapeGeometry:Zc,SphereGeometry:qs,TetrahedronGeometry:Kc,TorusGeometry:Jc,TorusKnotGeometry:jc,TubeGeometry:Qc,WireframeGeometry:N_});class D_ extends rn{constructor(e){super(),this.isShadowMaterial=!0,this.type="ShadowMaterial",this.color=new Ee(0),this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.fog=e.fog,this}}function Os(i){const e={};for(const t in i){e[t]={};for(const n in i[t]){const r=i[t][n];if(xp(r))r.isRenderTargetTexture?(_e("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[t][n]=null):e[t][n]=r.clone();else if(Array.isArray(r))if(xp(r[0])){const s=[];for(let a=0,o=r.length;a<o;a++)s[a]=r[a].clone();e[t][n]=s}else e[t][n]=r.slice();else e[t][n]=r}}return e}function fn(i){const e={};for(let t=0;t<i.length;t++){const n=Os(i[t]);for(const r in n)e[r]=n[r]}return e}function xp(i){return i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture||i.isQuaternion)}function aE(i){const e=[];for(let t=0;t<i.length;t++)e.push(i[t].clone());return e}function O_(i){const e=i.getRenderTarget();return e===null?i.outputColorSpace:e.isXRRenderTarget===!0?e.texture.colorSpace:dt.workingColorSpace}const U_={clone:Os,merge:fn};var oE=`void main() { 2 gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); 3}`,lE=`void main() { 4 gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 ); 5}`;class Cn extends rn{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=oE,this.fragmentShader=lE,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,e!==void 0&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=Os(e.uniforms),this.uniformsGroups=aE(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this.defaultAttributeValues=Object.assign({},e.defaultAttributeValues),this.index0AttributeName=e.index0AttributeName,this.uniformsNeedUpdate=e.uniformsNeedUpdate,this}toJSON(e){const t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(const r in this.uniforms){const a=this.uniforms[r].value;a&&a.isTexture?t.uniforms[r]={type:"t",value:a.toJSON(e).uuid}:a&&a.isColor?t.uniforms[r]={type:"c",value:a.getHex()}:a&&a.isVector2?t.uniforms[r]={type:"v2",value:a.toArray()}:a&&a.isVector3?t.uniforms[r]={type:"v3",value:a.toArray()}:a&&a.isVector4?t.uniforms[r]={type:"v4",value:a.toArray()}:a&&a.isMatrix3?t.uniforms[r]={type:"m3",value:a.toArray()}:a&&a.isMatrix4?t.uniforms[r]={type:"m4",value:a.toArray()}:t.uniforms[r]={value:a}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const n={};for(const r in this.extensions)this.extensions[r]===!0&&(n[r]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}}class Id extends Cn{constructor(e){super(e),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}class Pd extends rn{constructor(e){super(),this.isMeshStandardMaterial=!0,this.type="MeshStandardMaterial",this.defines={STANDARD:""},this.color=new Ee(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ee(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Li,this.normalScale=new j(1,
vendor: 4,939 bytes, line 5
51),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new ni,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class F_ extends Pd{constructor(e){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new j(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return $e(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(t){this.ior=(1+.4*t)/(1-.4*t)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new Ee(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new Ee(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new Ee(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._dispersion=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(e)}get anisotropy(){return this._anisotropy}set anisotropy(e){this._anisotropy>0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class B_ extends rn{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new Ee(16777215),this.specular=new Ee(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ee(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Li,this.normalScale=new j(1,
vendor: 4,145 bytes, line 5
51),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new ni,this.combine=ro,this.reflectivity=1,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.envMapIntensity=e.envMapIntensity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class k_ extends rn{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Ee(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ee(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Li,this.normalScale=new j(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}class V_ extends rn{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Li,this.normalScale=new j(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}}class z_ extends rn{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new Ee(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ee(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Li,this.normalScale=new j(1,
vendor: 4,558 bytes, line 5
51),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new ni,this.combine=ro,this.reflectivity=1,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.envMapIntensity=e.envMapIntensity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class Ld extends rn{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=Qg,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class Nd extends rn{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}class H_ extends rn{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Ee(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Li,this.normalScale=new j(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this.fog=e.fog,this}}class G_ extends bn{constructor(e){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}function wr(i,e){return!i||i.constructor===e?i:typeof e.BYTES_PER_ELEMENT=="number"?new e(i):Array.prototype.slice.call(i)}function W_(i){function e(r,s){return i[r]-i[s]}const t=i.length,n=new Array(t);for(let r=0;r!==t;++r)n[r]=r;return n.sort(e),n}function Mh(i,e,t){const n=i.length,r=new i.constructor(n);for(let s=0,a=0;a!==n;++s){const o=t[s]*e;for(let l=0;l!==e;++l)r[a++]=i[o+l]}return r}function Dd(i,e,t,n){let r=1,s=i[0];for(;s!==void 0&&s[n]===void 0;)s=i[r++];if(s===void 0)return;let a=s[n];if(a!==void 0)if(Array.isArray(a))do a=s[n],a!==void 0&&(e.push(s.time),t.push(...a)),s=i[r++];while(s!==void 0);else if(a.toArray!==void 0)do a=s[n],a!==void 0&&(e.push(s.time),a.toArray(t,t.length)),s=i[r++];while(s!==void 0);else do a=s[n],a!==void 0&&(e.push(s.time),t.push(a)),s=i[r++];while(s!==void 0)}
5function cE(i,e,t,n,r=30){const s=i.clone();s.name=e;const a=[];for(let l=0;l<s.tracks.length;++l){const c=s.tracks[l],u=c.getValueSize(),h=[],d=[];for(let f=0;f<c.times.length;++f){const p=c.times[f]*r;if(!(p<t||p>=n)){h.push(c.times[f]);for(let _=0;_<u;++_)d.push(c.values[f*u+_])}}h.length!==0&&(c.times=wr(h,c.times.constructor),c.values=wr(d,c.values.constructor),a.push(c))}s.tracks=a;let o=1/0;for(let l=0;l<s.tracks.length;++l)o>s.tracks[l].times[0]&&(o=s.tracks[l].times[0]);for(let l=0;l<s.tracks.length;++l)s.tracks[l].shift(-1*o);return s.resetDuration(),s}function uE(i,e=0,t=i,n=30){n<=0&&(n=30);const r=t.tracks.length,s=e/n;for(let a=0;a<r;++a){const o=t.tracks[a],l=o.ValueTypeName;if(l==="bool"||l==="string")continue;const c=i.tracks.find(function(m){return m.name===o.name&&m.ValueTypeName===l});if(c===void 0)continue;let u=0;const h=o.getValueSize();o.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(u=h/3);let d=0;const f=c.getValueSize();c.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(d=f/3);const p=o.times.length-1;let _;if(s<=o.times[0]){const m=u,v=h-u;_=o.values.slice(m,v)}else if(s>=o.times[p]){const m=p*h+u,v=m+h-u;_=o.values.slice(m,v)}else{const m=o.createInterpolant(),v=u,b=h-u;m.evaluate(s),_=m.resultBuffer.slice(v,b)}l==="quaternion"&&new tn().fromArray(_).normalize().conjugate().toArray(_);const g=c.times.length;for(let m=0;m<g;++m){const v=m*f+d;if(l==="quaternion")tn.multiplyQuaternionsFlat(c.values,v,_,0,c.values,v);else{const b=f-d*2;for(let y=0;y<b;++y)c.values[v+y]-=_[y]}}}return i.blendMode=md,i}class hE{static convertArray(e,t){return wr(e,t)}static isTypedArray(e){return l_(e)}static getKeyframeOrder(e){return W_(e)}static sortedArray(e,t,n){return Mh(e,t,n)}static flattenJSON(e,t,n,r){Dd(e,t,n,r)}static subclip(e,t,n,r,s=30){return cE(e,t,n,r,s)}static makeClipAdditive(e,t=0,n=e,r=30){return uE(e,t,n,r)}}class $s{constructor(e,t,n,r){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=r!==void 0?r:new t.constructor(n),this.sampleValues=t,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let n=this._cachedIndex,r=t[n],s=t[n-1];e:{t:{let a;n:{i:if(!(e<r)){for(let o=n+2;;){if(r===void 0){if(e<s)break i;return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}if(n===o)break;if(s=r,r=t[++n],e<r)break t}a=t.length;break n}if(!(e>=s)){const o=t[1];e<o&&(n=2,s=o);for(let l=n-2;;){if(s===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(n===l)break;if(r=s,s=t[--n-1],e>=s)break t}a=n,n=0;break n}break e}for(;n<a;){const o=n+a>>>1;e<t[o]?a=o:n=o+1}if(r=t[n],s=t[n-1],s===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(r===void 0)return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}this._cachedIndex=n,this.intervalChanged_(n,s,r)}return this.interpolate_(n,s,e,r)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,r=this.valueSize,s=e*r;for(let a=0;a!==r;++a)t[a]=n[s+a];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}class X_ extends $s{constructor(e,t,n,r){super(e,t,n,r),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:Er,endingEnd:Er}}intervalChanged_(e,t,n){const r=this.parameterPositions;let s=e-2,a=e+1,o=r[s],l=r[a];if(o===void 0)switch(this.getSettings_().endingStart){case Tr:s=e,o=2*t-n;break;case za:s=r.length-2,o=t+r[s]-r[s+1];break;default:s=e,o=n}if(l===void 0)switch(this.getSettings_().endingEnd){case Tr:a=e,l=2*n-t;break;case za:a=1,l=n+r[1]-r[0];break;default:a=e-1,l=t}const c=(n-t)*.5,u=this.valueSize;this._weightPrev=c/(t-o),this._weightNext=c/(l-n),this._offsetPrev=s*u,this._offsetNext=a*u}interpolate_(e,t,n,r){const s=this.resultBuffer,a=this.sampleValues,o=this.valueSize,l=e*o,c=l-o,u=this._offsetPrev,h=this._offsetNext,d=this._weightPrev,f=this._weightNext,p=(n-t)/(r-t),_=p*p,g=_*p,m=-d*g+2*d*_-d*p,v=(1+d)*g+(-1.5-2*d)*_+(-.5+d)*p+1,b=(-1-f)*g+(1.5+f)*_+.5*p,y=f*g-f*_;for(let T=0;T!==o;++T)s[T]=m*a[u+T]+v*a[c+T]+b*a[l+T]+y*a[h+T];return s}}class Od extends $s{constructor(e,t,n,r){super(e,t,n,r)}interpolate_(e,t,n,r){const s=this.resultBuffer,a=this.sampleValues,o=this.valueSize,l=e*o,c=l-o,u=(n-t)/(r-t),h=1-u;for(let d=0;d!==o;++d)s[d]=a[c+d]*h+a[l+d]*u;return s}}class q_ extends $s{constructor(e,t,n,r){super(e,t,n,r)}interpolate_(e){return this.copySampleValue_(e-1)}}class $_ extends $s{interpolate_(e,t,n,r){const s=this.resultBuffer,a=this.sampleValues,o=this.valueSize,l=e*o,c=l-o,u=this.settings||this.DefaultSettings_,h=u.inTangents,d=u.outTangents;if(!h||!d){const _=(n-t)/(r-t),g=1-_;for(let m=0;m!==o;++m)s[m]=a[c+m]*g+a[l+m]*_;return s}const f=o*2,p=e-1;for(let _=0;_!==o;++_){const g=a[c+_],m=a[l+_],v=p*f+_*2,b=d[v],y=d[v+1],T=e*f+_*2,S=h[T],R=h[T+1];let x=(n-t)/(r-t),M,A,I,N,U;for(let k=0;k<8;k++){M=x*x,A=M*x,I=1-x,N=I*I,U=N*I;const F=U*t+3*N*x*b+3*I*M*S+A*r-n;if(Math.abs(F)<1e-10)break;const O=3*N*(b-t)+6*I*x*(S-b)+3*M*(r-S);if(Math.abs(O)<1e-10)break;
vendor: 11,042 bytes, line 5
5x=x-F/O,x=Math.max(0,Math.min(1,x))}s[_]=U*g+3*N*x*y+3*I*M*R+A*m}return s}}class Wn{constructor(e,t,n,r){if(e===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(t===void 0||t.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=wr(t,this.TimeBufferType),this.values=wr(n,this.ValueBufferType),this.setInterpolation(r||this.DefaultInterpolation)}static toJSON(e){const t=e.constructor;let n;if(t.toJSON!==this.toJSON)n=t.toJSON(e);else{n={name:e.name,times:wr(e.times,Array),values:wr(e.values,Array)};const r=e.getInterpolation();r!==e.DefaultInterpolation&&(n.interpolation=r)}return n.type=e.ValueTypeName,n}InterpolantFactoryMethodDiscrete(e){return new q_(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new Od(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new X_(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodBezier(e){const t=new $_(this.times,this.values,this.getValueSize(),e);return this.settings&&(t.settings=this.settings),t}setInterpolation(e){let t;switch(e){case Va:t=this.InterpolantFactoryMethodDiscrete;break;case sc:t=this.InterpolantFactoryMethodLinear;break;case hl:t=this.InterpolantFactoryMethodSmooth;break;case _h:t=this.InterpolantFactoryMethodBezier;break}if(t===void 0){const n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(e!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(n);return _e("KeyframeTrack:",n),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Va;case this.InterpolantFactoryMethodLinear:return sc;case this.InterpolantFactoryMethodSmooth:return hl;case this.InterpolantFactoryMethodBezier:return _h}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){const t=this.times;for(let n=0,r=t.length;n!==r;++n)t[n]+=e}return this}scale(e){if(e!==1){const t=this.times;for(let n=0,r=t.length;n!==r;++n)t[n]*=e}return this}trim(e,t){const n=this.times,r=n.length;let s=0,a=r-1;for(;s!==r&&n[s]<e;)++s;for(;a!==-1&&n[a]>t;)--a;if(++a,s!==0||a!==r){s>=a&&(a=Math.max(a,1),s=a-1);const o=this.getValueSize();this.times=n.slice(s,a),this.values=this.values.slice(s*o,a*o)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(Oe("KeyframeTrack: Invalid value size in track.",this),e=!1);const n=this.times,r=this.values,s=n.length;s===0&&(Oe("KeyframeTrack: Track is empty.",this),e=!1);let a=null;for(let o=0;o!==s;o++){const l=n[o];if(typeof l=="number"&&isNaN(l)){Oe("KeyframeTrack: Time is not a valid number.",this,o,l),e=!1;break}if(a!==null&&a>l){Oe("KeyframeTrack: Out of order keys.",this,o,l,a),e=!1;break}a=l}if(r!==void 0&&l_(r))for(let o=0,l=r.length;o!==l;++o){const c=r[o];if(isNaN(c)){Oe("KeyframeTrack: Value is not a valid number.",this,o,c),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),n=this.getValueSize(),r=this.getInterpolation()===hl,s=e.length-1;let a=1;for(let o=1;o<s;++o){let l=!1;const c=e[o],u=e[o+1];if(c!==u&&(o!==1||c!==e[0]))if(r)l=!0;else{const h=o*n,d=h-n,f=h+n;for(let p=0;p!==n;++p){const _=t[h+p];if(_!==t[d+p]||_!==t[f+p]){l=!0;break}}}if(l){if(o!==a){e[a]=e[o];const h=o*n,d=a*n;for(let f=0;f!==n;++f)t[d+f]=t[h+f]}++a}}if(s>0){e[a]=e[s];for(let o=s*n,l=a*n,c=0;c!==n;++c)t[l+c]=t[o+c];++a}return a!==e.length?(this.times=e.slice(0,a),this.values=t.slice(0,a*n)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),n=this.constructor,r=new n(this.name,e,t);return r.createInterpolant=this.createInterpolant,r}}Wn.prototype.ValueTypeName="";Wn.prototype.TimeBufferType=Float32Array;Wn.prototype.ValueBufferType=Float32Array;Wn.prototype.DefaultInterpolation=sc;class zr extends Wn{constructor(e,t,n){super(e,t,n)}}zr.prototype.ValueTypeName="bool";zr.prototype.ValueBufferType=Array;zr.prototype.DefaultInterpolation=Va;zr.prototype.InterpolantFactoryMethodLinear=void 0;zr.prototype.InterpolantFactoryMethodSmooth=void 0;class Ud extends Wn{constructor(e,t,n,r){super(e,t,n,r)}}Ud.prototype.ValueTypeName="color";class Ka extends Wn{constructor(e,t,n,r){super(e,t,n,r)}}Ka.prototype.ValueTypeName="number";class Y_ extends $s{constructor(e,t,n,r){super(e,t,n,r)}interpolate_(e,t,n,r){const s=this.resultBuffer,a=this.sampleValues,o=this.valueSize,l=(n-t)/(r-t);let c=e*o;for(let u=c+o;c!==u;c+=4)tn.slerpFlat(s,0,a,c-o,a,c,l);return s}}class ho extends Wn{constructor(e,t,n,r){super(e,t,n,r)}InterpolantFactoryMethodLinear(e){return new Y_(this.times,this.values,this.getValueSize(),e)}}ho.prototype.ValueTypeName="quaternion";ho.prototype.InterpolantFactoryMethodSmooth=void 0;class Hr extends Wn{constructor(e,t,n){super(e,t,n)}}Hr.prototype.ValueTypeName="string";Hr.prototype.ValueBufferType=Array;Hr.prototype.DefaultInterpolation=Va;Hr.prototype.InterpolantFactoryMethodLinear=void 0;Hr.prototype.InterpolantFactoryMethodSmooth=void 0;class Ja extends Wn{constructor(e,t,n,r){super(e,t,n,r)}}Ja.prototype.ValueTypeName="vector";class ja{constructor(e="",t=-1,n=[],r=Rc){this.name=e,this.tracks=n,this.duration=t,this.blendMode=r,this.uuid=Fn(),this.userData={},this.duration<0&&this.resetDuration()}static parse(e){const t=[],n=e.tracks,r=1/(e.fps||1);for(let a=0,o=n.length;a!==o;++a)t.push(fE(n[a]).scale(r));const s=new this(e.name,e.duration,t,e.blendMode);return s.uuid=e.uuid,s.userData=JSON.parse(e.userData||"{}"),s}static toJSON(e){const t=[],n=e.tracks,r={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode,userData:JSON.stringify(e.userData)};for(let s=0,a=n.length;s!==a;++s)t.push(Wn.toJSON(n[s]));return r}static CreateFromMorphTargetSequence(e,t,n,r){const s=t.length,a=[];for(let o=0;o<s;o++){let l=[],c=[];l.push((o+s-1)%s,o,(o+1)%s),c.push(0,1,0);const u=W_(l);l=Mh(l,1,u),c=Mh(c,1,u),!r&&l[0]===0&&(l.push(s),c.push(c[0])),a.push(new Ka(".morphTargetInfluences["+t[o].name+"]",l,c).scale(1/n))}return new this(e,-1,a)}static findByName(e,t){let n=e;if(!Array.isArray(e)){const r=e;n=r.geometry&&r.geometry.animations||r.animations}for(let r=0;r<n.length;r++)if(n[r].name===t)return n[r];return null}static CreateClipsFromMorphTargetSequences(e,t,n){const r={},s=/^([\w-]*?)([\d]+)$/;for(let o=0,l=e.length;o<l;o++){const c=e[o],u=c.name.match(s);if(u&&u.length>1){const h=u[1];let d=r[h];d||(r[h]=d=[]),d.push(c)}}const a=[];for(const o in r)a.push(this.CreateFromMorphTargetSequence(o,r[o],t,n));return a}static parseAnimation(e,t){if(_e("AnimationClip: parseAnimation() is deprecated and will be removed with r185"),!e)return Oe("AnimationClip: No animation in JSONLoader data."),null;const n=function(h,d,f,p,_){if(f.length!==0){const g=[],m=[];Dd(f,g,m,p),g.length!==0&&_.push(new h(d,g,m))}},r=[],s=e.name||"default",a=e.fps||30,o=e.blendMode;let l=e.length||-1;const c=e.hierarchy||[];for(let h=0;h<c.length;h++){const d=c[h].keys;if(!(!d||d.length===0))if(d[0].morphTargets){const f={};let p;for(p=0;p<d.length;p++)if(d[p].morphTargets)for(let _=0;_<d[p].morphTargets.length;_++)f[d[p].morphTargets[_]]=-1;for(const _ in f){const g=[],m=[];for(let v=0;v!==d[p].morphTargets.length;++v){const b=d[p];g.push(b.time),m.push(b.morphTarget===_?1:0)}r.push(new Ka(".morphTargetInfluence["+_+"]",g,m))}l=f.length*a}else{const f=".bones["+t[h].name+"]";n(Ja,f+".position",d,"pos",r),n(ho,f+".quaternion",d,"rot",r),n(Ja,f+".scale",d,"scl",r)}}return r.length===0?null:new this(s,l,r,o)}resetDuration(){const e=this.tracks;let t=0;for(let n=0,r=e.length;n!==r;++n){const s=this.tracks[n];t=Math.max(t,s.times[s.times.length-1])}return this.duration=t,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let e=!0;for(let t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){const e=[];for(let n=0;n<this.tracks.length;n++)e.push(this.tracks[n].clone());const t=new this.constructor(this.name,this.duration,e,this.blendMode);return t.userData=JSON.parse(JSON.stringify(this.userData)),t}toJSON(){return this.constructor.toJSON(this)}}function dE(i){switch(i.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Ka;case"vector":case"vector2":case"vector3":case"vector4":return Ja;case"color":return Ud;case"quaternion":return ho;case"bool":case"boolean":return zr;case"string":return Hr}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+i)}function fE(i){if(i.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const e=dE(i.type);if(i.times===void 0){const t=[],n=[];Dd(i.keys,t,n,"value"),i.times=t,i.values=n}return e.parse!==void 0?e.parse(i):new e(i.name,i.times,i.values,i.interpolation)}const fi={enabled:!1,files:{},add:function(i,e){this.enabled!==!1&&(yp(i)||(this.files[i]=e))},get:function(i){if(this.enabled!==!1&&!yp(i))return this.files[i]},remove:function(i){delete this.files[i]},clear:function(){this.files={}}};function yp(i){try{const e=i.slice(i.indexOf(":")+1);return new URL(e).protocol==="blob:"}catch{return!1}}class Fd{constructor(e,t,n){const r=this;let s=!1,a=0,o=0,l;const c=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this._abortController=null,this.itemStart=function(u){o++,s===!1&&r.onStart!==void 0&&r.onStart(u,a,o),s=!0},this.itemEnd=function(u){a++,r.onProgress!==void 0&&r.onProgress(u,a,o),a===o&&(s=!1,r.onLoad!==void 0&&r.onLoad())},this.itemError=function(u){r.onError!==void 0&&r.onError(u)},this.resolveURL=function(u){return l?l(u):u},this.setURLModifier=function(u){return l=u,this},this.addHandler=function(u,h){return c.push(u,h),this},this.removeHandler=function(u){const h=c.indexOf(u);return h!==-1&&c.splice(h,2),this},this.getHandler=function(u){for(let h=0,d=c.length;h<d;h+=2){const f=c[h],p=c[h+1];if(f.global&&(f.lastIndex=0),f.test(u))return p}return null},this.abort=function(){return this.abortController.abort(),this._abortController=null,this}}get abortController(){return this._abortController||(this._abortController=new AbortController),this._abortController}}const Z_=new Fd;class Rn{constructor(e){this.manager=e!==void 0?e:Z_,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}load(){}loadAsync(e,t){const n=this;return new Promise(function(r,s){n.load(e,r,t,s)})}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}abort(){return this}}Rn.DEFAULT_MATERIAL_NAME="__DEFAULT";const Ti={};
5class pE extends Error{constructor(e,t){super(e),this.response=t}}class Ni extends Rn{constructor(e){super(e),this.mimeType="",this.responseType="",this._abortController=new AbortController}load(e,t,n,r){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=fi.get(`file:${e}`);if(s!==void 0){this.manager.itemStart(e),setTimeout(()=>{t&&t(s),this.manager.itemEnd(e)},0);return}if(Ti[e]!==void 0){Ti[e].push({onLoad:t,onProgress:n,onError:r});return}Ti[e]=[],Ti[e].push({onLoad:t,onProgress:n,onError:r});const a=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin",signal:typeof AbortSignal.any=="function"?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal}),o=this.mimeType,l=this.responseType;fetch(a).then(c=>{if(c.status===200||c.status===0){if(c.status===0&&_e("FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||c.body===void 0||c.body.getReader===void 0)return c;const u=Ti[e],h=c.body.getReader(),d=c.headers.get("X-File-Size")||c.headers.get("Content-Length"),f=d?parseInt(d):0,p=f!==0;let _=0;const g=new ReadableStream({start(m){v();function v(){h.read().then(({done:b,value:y})=>{if(b)m.close();else{_+=y.byteLength;const T=new ProgressEvent("progress",{lengthComputable:p,loaded:_,total:f});for(let S=0,R=u.length;S<R;S++){const x=u[S];x.onProgress&&x.onProgress(T)}m.enqueue(y),v()}},b=>{m.error(b)})}}});return new Response(g)}else throw new pE(`fetch for "${c.url}" responded with ${c.status}: ${c.statusText}`,c)}).then(c=>{switch(l){case"arraybuffer":return c.arrayBuffer();case"blob":return c.blob();case"document":return c.text().then(u=>new DOMParser().parseFromString(u,o));case"json":return c.json();default:if(o==="")return c.text();{const h=/charset="?([^;"\s]*)"?/i.exec(o),d=h&&h[1]?h[1].toLowerCase():void 0,f=new TextDecoder(d);return c.arrayBuffer().then(p=>f.decode(p))}}}).then(c=>{fi.add(`file:${e}`,c);const u=Ti[e];delete Ti[e];for(let h=0,d=u.length;h<d;h++){const f=u[h];f.onLoad&&f.onLoad(c)}}).catch(c=>{const u=Ti[e];if(u===void 0)throw this.manager.itemError(e),c;delete Ti[e];for(let h=0,d=u.length;h<d;h++){const f=u[h];f.onError&&f.onError(c)}this.manager.itemError(e)}).finally(()=>{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}}class mE extends Rn{constructor(e){super(e)}load(e,t,n,r){const s=this,a=new Ni(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(o){try{t(s.parse(JSON.parse(o)))}catch(l){r?r(l):Oe(l),s.manager.itemError(e)}},n,r)}parse(e){const t=[];for(let n=0;n<e.length;n++){const r=ja.parse(e[n]);t.push(r)}return t}}class gE extends Rn{constructor(e){super(e)}load(e,t,n,r){const s=this,a=[],o=new Vc,l=new Ni(this.manager);l.setPath(this.path),l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setWithCredentials(s.withCredentials);let c=0;function u(h){l.load(e[h],function(d){const f=s.parse(d,!0);a[h]={width:f.width,height:f.height,format:f.format,mipmaps:f.mipmaps},c+=1,c===6&&(f.mipmapCount===1&&(o.minFilter=Lt),o.image=a,o.format=f.format,o.needsUpdate=!0,t&&t(o))},n,r)}if(Array.isArray(e))for(let h=0,d=e.length;h<d;++h)u(h);else l.load(e,function(h){const d=s.parse(h,!0);if(d.isCubemap){const f=d.mipmaps.length/d.mipmapCount;for(let p=0;p<f;p++){a[p]={mipmaps:[]};for(let _=0;_<d.mipmapCount;_++)a[p].mipmaps.push(d.mipmaps[p*d.mipmapCount+_]),a[p].format=d.format,a[p].width=d.width,a[p].height=d.height}o.image=a}else o.image.width=d.width,o.image.height=d.height,o.mipmaps=d.mipmaps;d.mipmapCount===1&&(o.minFilter=Lt),o.format=d.format,o.needsUpdate=!0,t&&t(o)},n,r);return o}}const os=new WeakMap;class Qa extends Rn{constructor(e){super(e)}load(e,t,n,r){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,a=fi.get(`image:${e}`);if(a!==void 0){if(a.complete===!0)s.manager.itemStart(e),setTimeout(function(){t&&t(a),s.manager.itemEnd(e)},0);else{let h=os.get(a);h===void 0&&(h=[],os.set(a,h)),h.push({onLoad:t,onError:r})}return a}const o=Xa("img");function l(){u(),t&&t(this);const h=os.get(this)||[];for(let d=0;d<h.length;d++){const f=h[d];f.onLoad&&f.onLoad(this)}os.delete(this),s.manager.itemEnd(e)}function c(h){u(),r&&r(h),fi.remove(`image:${e}`);const d=os.get(this)||[];for(let f=0;f<d.length;f++){const p=d[f];p.onError&&p.onError(h)}os.delete(this),s.manager.itemError(e),s.manager.itemEnd(e)}function u(){o.removeEventListener("load",l,!1),o.removeEventListener("error",c,!1)}return o.addEventListener("load",l,!1),o.addEventListener("error",c,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(o.crossOrigin=this.crossOrigin),fi.add(`image:${e}`,o),s.manager.itemStart(e),o.src=e,o}}class _E extends Rn{constructor(e){super(e)}load(e,t,n,r){const s=new oo;
5s.colorSpace=Tn;const a=new Qa(this.manager);a.setCrossOrigin(this.crossOrigin),a.setPath(this.path);let o=0;function l(c){a.load(e[c],function(u){s.images[c]=u,o++,o===6&&(s.needsUpdate=!0,t&&t(s))},void 0,r)}for(let c=0;c<e.length;++c)l(c);return s}}class vE extends Rn{constructor(e){super(e)}load(e,t,n,r){const s=this,a=new ti,o=new Ni(this.manager);return o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setPath(this.path),o.setWithCredentials(s.withCredentials),o.load(e,function(l){let c;try{c=s.parse(l)}catch(u){r!==void 0?r(u):Oe(u);return}c.image!==void 0?a.image=c.image:c.data!==void 0&&(a.image.width=c.width,a.image.height=c.height,a.image.data=c.data),a.wrapS=c.wrapS!==void 0?c.wrapS:An,a.wrapT=c.wrapT!==void 0?c.wrapT:An,a.magFilter=c.magFilter!==void 0?c.magFilter:Lt,a.minFilter=c.minFilter!==void 0?c.minFilter:Lt,a.anisotropy=c.anisotropy!==void 0?c.anisotropy:1,c.colorSpace!==void 0&&(a.colorSpace=c.colorSpace),c.flipY!==void 0&&(a.flipY=c.flipY),c.format!==void 0&&(a.format=c.format),c.type!==void 0&&(a.type=c.type),c.mipmaps!==void 0&&(a.mipmaps=c.mipmaps,a.minFilter=di),c.mipmapCount===1&&(a.minFilter=Lt),c.generateMipmaps!==void 0&&(a.generateMipmaps=c.generateMipmaps),a.needsUpdate=!0,t&&t(a,c)},n,r),a}}class xE extends Rn{constructor(e){super(e)}load(e,t,n,r){const s=new Ft,a=new Qa(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(e,function(o){s.image=o,s.needsUpdate=!0,t!==void 0&&t(s)},n,r),s}}class sr extends pt{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new Ee(e),this.intensity=t}dispose(){this.dispatchEvent({type:"dispose"})}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,t}}class K_ extends sr{constructor(e,t,n){super(e,n),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(pt.DEFAULT_UP),this.updateMatrix(),this.groundColor=new Ee(t)}copy(e,t){return super.copy(e,t),this.groundColor.copy(e.groundColor),this}toJSON(e){const t=super.toJSON(e);return t.object.groundColor=this.groundColor.getHex(),t}}const ku=new We,bp=new P,Sp=new P;class Bd{constructor(e){this.camera=e,this.intensity=1,this.bias=0,this.biasNode=null,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new j(512,512),this.mapType=wn,this.map=null,this.mapPass=null,this.matrix=new We,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Ws,this._frameExtents=new j(1,1),this._viewportCount=1,this._viewports=[new Et(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,n=this.matrix;bp.setFromMatrixPosition(e.matrixWorld),t.position.copy(bp),Sp.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(Sp),t.updateMatrixWorld(),ku.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(ku,t.coordinateSystem,t.reversedDepth),t.coordinateSystem===Ur||t.reversedDepth?n.set(.5,0,0,.5,0,.5,0,.5,0,0,1,0,0,0,0,1):n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(ku)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.intensity=e.intensity,this.bias=e.bias,this.radius=e.radius,this.autoUpdate=e.autoUpdate,this.needsUpdate=e.needsUpdate,this.normalBias=e.normalBias,this.blurSamples=e.blurSamples,this.mapSize.copy(e.mapSize),this.biasNode=e.biasNode,this}clone(){return new this.constructor().copy(this)}toJSON(){const e={};return this.intensity!==1&&(e.intensity=this.intensity),this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}const Jo=new P,jo=new tn,ui=new P;class eu extends pt{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new We,this.projectionMatrix=new We,this.projectionMatrixInverse=new We,this.coordinateSystem=Un,this._reversedDepth=!1}get reversedDepth(){return this._reversedDepth}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorld.decompose(Jo,jo,ui),ui.x===1&&ui.y===1&&ui.z===1?this.matrixWorldInverse.copy(this.matrixWorld).invert():this.matrixWorldInverse.compose(Jo,jo,ui.set(1,1,1)).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorld.decompose(Jo,jo,ui),ui.x===1&&ui.y===1&&ui.z===1?this.matrixWorldInverse.copy(this.matrixWorld).invert():this.matrixWorldInverse.compose(Jo,jo,ui.set(1,1,1)).invert()}clone(){return new this.constructor().copy(this)}}const Wi=new P,Mp=new j,Ep=new j;class Jt extends eu{constructor(e=50,t=1,n=.1,r=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=r,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=Ls*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(Pr*.5*this.fov);return .5*this.getFilmHeight()/e}
vendor: 4,977 bytes, line 5
5getEffectiveFOV(){return Ls*2*Math.atan(Math.tan(Pr*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,n){Wi.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(Wi.x,Wi.y).multiplyScalar(-e/Wi.z),Wi.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(Wi.x,Wi.y).multiplyScalar(-e/Wi.z)}getViewSize(e,t){return this.getViewBounds(e,Mp,Ep),t.subVectors(Ep,Mp)}setViewOffset(e,t,n,r,s,a){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=s,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(Pr*.5*this.fov)/this.zoom,n=2*t,r=this.aspect*n,s=-.5*r;const a=this.view;if(this.view!==null&&this.view.enabled){const l=a.fullWidth,c=a.fullHeight;s+=a.offsetX*r/l,t-=a.offsetY*n/c,r*=a.width/l,n*=a.height/c}const o=this.filmOffset;o!==0&&(s+=e*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+r,t,t-n,e,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}class yE extends Bd{constructor(){super(new Jt(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1,this.aspect=1}updateMatrices(e){const t=this.camera,n=Ls*2*e.angle*this.focus,r=this.mapSize.width/this.mapSize.height*this.aspect,s=e.distance||t.far;(n!==t.fov||r!==t.aspect||s!==t.far)&&(t.fov=n,t.aspect=r,t.far=s,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class J_ extends sr{constructor(e,t,n=0,r=Math.PI/3,s=0,a=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(pt.DEFAULT_UP),this.updateMatrix(),this.target=new pt,this.distance=n,this.angle=r,this.penumbra=s,this.decay=a,this.map=null,this.shadow=new yE}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){super.dispose(),this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.map=e.map,this.shadow=e.shadow.clone(),this}toJSON(e){const t=super.toJSON(e);return t.object.distance=this.distance,t.object.angle=this.angle,t.object.decay=this.decay,t.object.penumbra=this.penumbra,t.object.target=this.target.uuid,this.map&&this.map.isTexture&&(t.object.map=this.map.toJSON(e).uuid),t.object.shadow=this.shadow.toJSON(),t}}class bE extends Bd{constructor(){super(new Jt(90,1,.5,500)),this.isPointLightShadow=!0}}class j_ extends sr{constructor(e,t,n=0,r=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=n,this.decay=r,this.shadow=new bE}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){super.dispose(),this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}toJSON(e){const t=super.toJSON(e);return t.object.distance=this.distance,t.object.decay=this.decay,t.object.shadow=this.shadow.toJSON(),t}}class fo extends eu{constructor(e=-1,t=1,n=1,r=-1,s=.1,a=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=r,this.near=s,this.far=a,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,n,r,s,a){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=s,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let s=n-e,a=n+e,o=r+t,l=r-t;if(this.view!==null&&this.view.enabled){const c=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=c*this.view.offsetX,a=s+c*this.view.width,o-=u*this.view.offsetY,l=o-u*this.view.height}
vendor: 19,276 bytes, line 5
5this.projectionMatrix.makeOrthographic(s,a,o,l,this.near,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}class SE extends Bd{constructor(){super(new fo(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class Q_ extends sr{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(pt.DEFAULT_UP),this.updateMatrix(),this.target=new pt,this.shadow=new SE}dispose(){super.dispose(),this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}toJSON(e){const t=super.toJSON(e);return t.object.shadow=this.shadow.toJSON(),t.object.target=this.target.uuid,t}}class e0 extends sr{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type="AmbientLight"}}class t0 extends sr{constructor(e,t,n=10,r=10){super(e,t),this.isRectAreaLight=!0,this.type="RectAreaLight",this.width=n,this.height=r}get power(){return this.intensity*this.width*this.height*Math.PI}set power(e){this.intensity=e/(this.width*this.height*Math.PI)}copy(e){return super.copy(e),this.width=e.width,this.height=e.height,this}toJSON(e){const t=super.toJSON(e);return t.object.width=this.width,t.object.height=this.height,t}}class kd{constructor(){this.isSphericalHarmonics3=!0,this.coefficients=[];for(let e=0;e<9;e++)this.coefficients.push(new P)}set(e){for(let t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this}zero(){for(let e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this}getAt(e,t){const n=e.x,r=e.y,s=e.z,a=this.coefficients;return t.copy(a[0]).multiplyScalar(.282095),t.addScaledVector(a[1],.488603*r),t.addScaledVector(a[2],.488603*s),t.addScaledVector(a[3],.488603*n),t.addScaledVector(a[4],1.092548*(n*r)),t.addScaledVector(a[5],1.092548*(r*s)),t.addScaledVector(a[6],.315392*(3*s*s-1)),t.addScaledVector(a[7],1.092548*(n*s)),t.addScaledVector(a[8],.546274*(n*n-r*r)),t}getIrradianceAt(e,t){const n=e.x,r=e.y,s=e.z,a=this.coefficients;return t.copy(a[0]).multiplyScalar(.886227),t.addScaledVector(a[1],2*.511664*r),t.addScaledVector(a[2],2*.511664*s),t.addScaledVector(a[3],2*.511664*n),t.addScaledVector(a[4],2*.429043*n*r),t.addScaledVector(a[5],2*.429043*r*s),t.addScaledVector(a[6],.743125*s*s-.247708),t.addScaledVector(a[7],2*.429043*n*s),t.addScaledVector(a[8],.429043*(n*n-r*r)),t}add(e){for(let t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this}addScaledSH(e,t){for(let n=0;n<9;n++)this.coefficients[n].addScaledVector(e.coefficients[n],t);return this}scale(e){for(let t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this}lerp(e,t){for(let n=0;n<9;n++)this.coefficients[n].lerp(e.coefficients[n],t);return this}equals(e){for(let t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0}copy(e){return this.set(e.coefficients)}clone(){return new this.constructor().copy(this)}fromArray(e,t=0){const n=this.coefficients;for(let r=0;r<9;r++)n[r].fromArray(e,t+r*3);return this}toArray(e=[],t=0){const n=this.coefficients;for(let r=0;r<9;r++)n[r].toArray(e,t+r*3);return e}static getBasisAt(e,t){const n=e.x,r=e.y,s=e.z;t[0]=.282095,t[1]=.488603*r,t[2]=.488603*s,t[3]=.488603*n,t[4]=1.092548*n*r,t[5]=1.092548*r*s,t[6]=.315392*(3*s*s-1),t[7]=1.092548*n*s,t[8]=.546274*(n*n-r*r)}}class n0 extends sr{constructor(e=new kd,t=1){super(void 0,t),this.isLightProbe=!0,this.sh=e}copy(e){return super.copy(e),this.sh.copy(e.sh),this}toJSON(e){const t=super.toJSON(e);return t.object.sh=this.sh.toArray(),t}}class tu extends Rn{constructor(e){super(e),this.textures={}}load(e,t,n,r){const s=this,a=new Ni(s.manager);a.setPath(s.path),a.setRequestHeader(s.requestHeader),a.setWithCredentials(s.withCredentials),a.load(e,function(o){try{t(s.parse(JSON.parse(o)))}catch(l){r?r(l):Oe(l),s.manager.itemError(e)}},n,r)}parse(e){const t=this.textures;function n(s){return t[s]===void 0&&_e("MaterialLoader: Undefined texture",s),t[s]}const r=this.createMaterialFromType(e.type);if(e.uuid!==void 0&&(r.uuid=e.uuid),e.name!==void 0&&(r.name=e.name),e.color!==void 0&&r.color!==void 0&&r.color.setHex(e.color),e.roughness!==void 0&&(r.roughness=e.roughness),e.metalness!==void 0&&(r.metalness=e.metalness),e.sheen!==void 0&&(r.sheen=e.sheen),e.sheenColor!==void 0&&(r.sheenColor=new Ee().setHex(e.sheenColor)),e.sheenRoughness!==void 0&&(r.sheenRoughness=e.sheenRoughness),e.emissive!==void 0&&r.emissive!==void 0&&r.emissive.setHex(e.emissive),e.specular!==void 0&&r.specular!==void 0&&r.specular.setHex(e.specular),e.specularIntensity!==void 0&&(r.specularIntensity=e.specularIntensity),e.specularColor!==void 0&&r.specularColor!==void 0&&r.specularColor.setHex(e.specularColor),e.shininess!==void 0&&(r.shininess=e.shininess),e.clearcoat!==void 0&&(r.clearcoat=e.clearcoat),e.clearcoatRoughness!==void 0&&(r.clearcoatRoughness=e.clearcoatRoughness),e.dispersion!==void 0&&(r.dispersion=e.dispersion),e.iridescence!==void 0&&(r.iridescence=e.iridescence),e.iridescenceIOR!==void 0&&(r.iridescenceIOR=e.iridescenceIOR),e.iridescenceThicknessRange!==void 0&&(r.iridescenceThicknessRange=e.iridescenceThicknessRange),e.transmission!==void 0&&(r.transmission=e.transmission),e.thickness!==void 0&&(r.thickness=e.thickness),e.attenuationDistance!==void 0&&(r.attenuationDistance=e.attenuationDistance),e.attenuationColor!==void 0&&r.attenuationColor!==void 0&&r.attenuationColor.setHex(e.attenuationColor),e.anisotropy!==void 0&&(r.anisotropy=e.anisotropy),e.anisotropyRotation!==void 0&&(r.anisotropyRotation=e.anisotropyRotation),e.fog!==void 0&&(r.fog=e.fog),e.flatShading!==void 0&&(r.flatShading=e.flatShading),e.blending!==void 0&&(r.blending=e.blending),e.combine!==void 0&&(r.combine=e.combine),e.side!==void 0&&(r.side=e.side),e.shadowSide!==void 0&&(r.shadowSide=e.shadowSide),e.opacity!==void 0&&(r.opacity=e.opacity),e.transparent!==void 0&&(r.transparent=e.transparent),e.alphaTest!==void 0&&(r.alphaTest=e.alphaTest),e.alphaHash!==void 0&&(r.alphaHash=e.alphaHash),e.depthFunc!==void 0&&(r.depthFunc=e.depthFunc),e.depthTest!==void 0&&(r.depthTest=e.depthTest),e.depthWrite!==void 0&&(r.depthWrite=e.depthWrite),e.colorWrite!==void 0&&(r.colorWrite=e.colorWrite),e.blendSrc!==void 0&&(r.blendSrc=e.blendSrc),e.blendDst!==void 0&&(r.blendDst=e.blendDst),e.blendEquation!==void 0&&(r.blendEquation=e.blendEquation),e.blendSrcAlpha!==void 0&&(r.blendSrcAlpha=e.blendSrcAlpha),e.blendDstAlpha!==void 0&&(r.blendDstAlpha=e.blendDstAlpha),e.blendEquationAlpha!==void 0&&(r.blendEquationAlpha=e.blendEquationAlpha),e.blendColor!==void 0&&r.blendColor!==void 0&&r.blendColor.setHex(e.blendColor),e.blendAlpha!==void 0&&(r.blendAlpha=e.blendAlpha),e.stencilWriteMask!==void 0&&(r.stencilWriteMask=e.stencilWriteMask),e.stencilFunc!==void 0&&(r.stencilFunc=e.stencilFunc),e.stencilRef!==void 0&&(r.stencilRef=e.stencilRef),e.stencilFuncMask!==void 0&&(r.stencilFuncMask=e.stencilFuncMask),e.stencilFail!==void 0&&(r.stencilFail=e.stencilFail),e.stencilZFail!==void 0&&(r.stencilZFail=e.stencilZFail),e.stencilZPass!==void 0&&(r.stencilZPass=e.stencilZPass),e.stencilWrite!==void 0&&(r.stencilWrite=e.stencilWrite),e.wireframe!==void 0&&(r.wireframe=e.wireframe),e.wireframeLinewidth!==void 0&&(r.wireframeLinewidth=e.wireframeLinewidth),e.wireframeLinecap!==void 0&&(r.wireframeLinecap=e.wireframeLinecap),e.wireframeLinejoin!==void 0&&(r.wireframeLinejoin=e.wireframeLinejoin),e.rotation!==void 0&&(r.rotation=e.rotation),e.linewidth!==void 0&&(r.linewidth=e.linewidth),e.dashSize!==void 0&&(r.dashSize=e.dashSize),e.gapSize!==void 0&&(r.gapSize=e.gapSize),e.scale!==void 0&&(r.scale=e.scale),e.polygonOffset!==void 0&&(r.polygonOffset=e.polygonOffset),e.polygonOffsetFactor!==void 0&&(r.polygonOffsetFactor=e.polygonOffsetFactor),e.polygonOffsetUnits!==void 0&&(r.polygonOffsetUnits=e.polygonOffsetUnits),e.dithering!==void 0&&(r.dithering=e.dithering),e.alphaToCoverage!==void 0&&(r.alphaToCoverage=e.alphaToCoverage),e.premultipliedAlpha!==void 0&&(r.premultipliedAlpha=e.premultipliedAlpha),e.forceSinglePass!==void 0&&(r.forceSinglePass=e.forceSinglePass),e.allowOverride!==void 0&&(r.allowOverride=e.allowOverride),e.visible!==void 0&&(r.visible=e.visible),e.toneMapped!==void 0&&(r.toneMapped=e.toneMapped),e.userData!==void 0&&(r.userData=e.userData),e.vertexColors!==void 0&&(typeof e.vertexColors=="number"?r.vertexColors=e.vertexColors>0:r.vertexColors=e.vertexColors),e.uniforms!==void 0)for(const s in e.uniforms){const a=e.uniforms[s];switch(r.uniforms[s]={},a.type){case"t":r.uniforms[s].value=n(a.value);break;case"c":r.uniforms[s].value=new Ee().setHex(a.value);break;case"v2":r.uniforms[s].value=new j().fromArray(a.value);break;case"v3":r.uniforms[s].value=new P().fromArray(a.value);break;case"v4":r.uniforms[s].value=new Et().fromArray(a.value);break;case"m3":r.uniforms[s].value=new tt().fromArray(a.value);break;case"m4":r.uniforms[s].value=new We().fromArray(a.value);break;default:r.uniforms[s].value=a.value}}if(e.defines!==void 0&&(r.defines=e.defines),e.vertexShader!==void 0&&(r.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(r.fragmentShader=e.fragmentShader),e.glslVersion!==void 0&&(r.glslVersion=e.glslVersion),e.extensions!==void 0)for(const s in e.extensions)r.extensions[s]=e.extensions[s];if(e.lights!==void 0&&(r.lights=e.lights),e.clipping!==void 0&&(r.clipping=e.clipping),e.size!==void 0&&(r.size=e.size),e.sizeAttenuation!==void 0&&(r.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(r.map=n(e.map)),e.matcap!==void 0&&(r.matcap=n(e.matcap)),e.alphaMap!==void 0&&(r.alphaMap=n(e.alphaMap)),e.bumpMap!==void 0&&(r.bumpMap=n(e.bumpMap)),e.bumpScale!==void 0&&(r.bumpScale=e.bumpScale),e.normalMap!==void 0&&(r.normalMap=n(e.normalMap)),e.normalMapType!==void 0&&(r.normalMapType=e.normalMapType),e.normalScale!==void 0){let s=e.normalScale;Array.isArray(s)===!1&&(s=[s,s]),r.normalScale=new j().fromArray(s)}return e.displacementMap!==void 0&&(r.displacementMap=n(e.displacementMap)),e.displacementScale!==void 0&&(r.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(r.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(r.roughnessMap=n(e.roughnessMap)),e.metalnessMap!==void 0&&(r.metalnessMap=n(e.metalnessMap)),e.emissiveMap!==void 0&&(r.emissiveMap=n(e.emissiveMap)),e.emissiveIntensity!==void 0&&(r.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(r.specularMap=n(e.specularMap)),e.specularIntensityMap!==void 0&&(r.specularIntensityMap=n(e.specularIntensityMap)),e.specularColorMap!==void 0&&(r.specularColorMap=n(e.specularColorMap)),e.envMap!==void 0&&(r.envMap=n(e.envMap)),e.envMapRotation!==void 0&&r.envMapRotation.fromArray(e.envMapRotation),e.envMapIntensity!==void 0&&(r.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(r.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(r.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(r.lightMap=n(e.lightMap)),e.lightMapIntensity!==void 0&&(r.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(r.aoMap=n(e.aoMap)),e.aoMapIntensity!==void 0&&(r.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(r.gradientMap=n(e.gradientMap)),e.clearcoatMap!==void 0&&(r.clearcoatMap=n(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(r.clearcoatRoughnessMap=n(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(r.clearcoatNormalMap=n(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(r.clearcoatNormalScale=new j().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(r.iridescenceMap=n(e.iridescenceMap)),e.iridescenceThicknessMap!==void 0&&(r.iridescenceThicknessMap=n(e.iridescenceThicknessMap)),e.transmissionMap!==void 0&&(r.transmissionMap=n(e.transmissionMap)),e.thicknessMap!==void 0&&(r.thicknessMap=n(e.thicknessMap)),e.anisotropyMap!==void 0&&(r.anisotropyMap=n(e.anisotropyMap)),e.sheenColorMap!==void 0&&(r.sheenColorMap=n(e.sheenColorMap)),e.sheenRoughnessMap!==void 0&&(r.sheenRoughnessMap=n(e.sheenRoughnessMap)),r}setTextures(e){return this.textures=e,this}createMaterialFromType(e){return tu.createMaterialFromType(e)}static createMaterialFromType(e){const t={ShadowMaterial:D_,SpriteMaterial:yd,RawShaderMaterial:Id,ShaderMaterial:Cn,PointsMaterial:Sd,MeshPhysicalMaterial:F_,MeshStandardMaterial:Pd,MeshPhongMaterial:B_,MeshToonMaterial:k_,MeshNormalMaterial:V_,MeshLambertMaterial:z_,MeshDepthMaterial:Ld,MeshDistanceMaterial:Nd,MeshBasicMaterial:Oi,MeshMatcapMaterial:H_,LineDashedMaterial:G_,LineBasicMaterial:bn,Material:rn};return new t[e]}}class Eh{static extractUrlBase(e){const t=e.lastIndexOf("/");return t===-1?"./":e.slice(0,t+1)}static resolveURL(e,t){return typeof e!="string"||e===""?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}}class i0 extends et{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}toJSON(){const e=super.toJSON();return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}class r0 extends Rn{constructor(e){super(e)}load(e,t,n,r){const s=this,a=new Ni(s.manager);a.setPath(s.path),a.setRequestHeader(s.requestHeader),a.setWithCredentials(s.withCredentials),a.load(e,function(o){try{t(s.parse(JSON.parse(o)))}catch(l){r?r(l):Oe(l),s.manager.itemError(e)}},n,r)}parse(e){const t={},n={};function r(f,p){if(t[p]!==void 0)return t[p];const g=f.interleavedBuffers[p],m=s(f,g.buffer),v=gs(g.type,m),b=new Fc(v,g.stride);return b.uuid=g.uuid,t[p]=b,b}function s(f,p){if(n[p]!==void 0)return n[p];const g=f.arrayBuffers[p],m=new Uint32Array(g).buffer;return n[p]=m,m}const a=e.isInstancedBufferGeometry?new i0:new et,o=e.data.index;if(o!==void 0){const f=gs(o.type,o.array);a.setIndex(new ut(f,1))}const l=e.data.attributes;for(const f in l){const p=l[f];let _;if(p.isInterleavedBufferAttribute){const g=r(e.data,p.data);_=new Fr(g,p.itemSize,p.offset,p.normalized)}else{const g=gs(p.type,p.array),m=p.isInstancedBufferAttribute?Ns:ut;_=new m(g,p.itemSize,p.normalized)}p.name!==void 0&&(_.name=p.name),p.usage!==void 0&&_.setUsage(p.usage),a.setAttribute(f,_)}const c=e.data.morphAttributes;if(c)for(const f in c){const p=c[f],_=[];for(let g=0,m=p.length;g<m;g++){const v=p[g];let b;if(v.isInterleavedBufferAttribute){const y=r(e.data,v.data);b=new Fr(y,v.itemSize,v.offset,v.normalized)}else{const y=gs(v.type,v.array);b=new ut(y,v.itemSize,v.normalized)}v.name!==void 0&&(b.name=v.name),_.push(b)}a.morphAttributes[f]=_}e.data.morphTargetsRelative&&(a.morphTargetsRelative=!0);const h=e.data.groups||e.data.drawcalls||e.data.offsets;if(h!==void 0)for(let f=0,p=h.length;f!==p;++f){const _=h[f];a.addGroup(_.start,_.count,_.materialIndex)}const d=e.data.boundingSphere;return d!==void 0&&(a.boundingSphere=new nn().fromJSON(d)),e.name&&(a.name=e.name),e.userData&&(a.userData=e.userData),a}}const Vu={};class ME extends Rn{constructor(e){super(e)}load(e,t,n,r){const s=this,a=this.path===""?Eh.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||a;const o=new Ni(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(l){let c=null;try{c=JSON.parse(l)}catch(h){r!==void 0&&r(h),Oe("ObjectLoader: Can't parse "+e+".",h.message);return}const u=c.metadata;if(u===void 0||u.type===void 0||u.type.toLowerCase()==="geometry"){r!==void 0&&r(new Error("THREE.ObjectLoader: Can't load "+e)),Oe("ObjectLoader: Can't load "+e);return}s.parse(c,t)},n,r)}async loadAsync(e,t){const n=this,r=this.path===""?Eh.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||r;const s=new Ni(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials);const a=await s.loadAsync(e,t);let o;try{o=JSON.parse(a)}catch(c){throw new Error("ObjectLoader: Can't parse "+e+". "+c.message)}const l=o.metadata;if(l===void 0||l.type===void 0||l.type.toLowerCase()==="geometry")throw new Error("THREE.ObjectLoader: Can't load "+e);return await n.parseAsync(o)}parse(e,t){const n=this.parseAnimations(e.animations),r=this.parseShapes(e.shapes),s=this.parseGeometries(e.geometries,r),a=this.parseImages(e.images,function(){t!==void 0&&t(c)}),o=this.parseTextures(e.textures,a),l=this.parseMaterials(e.materials,o),c=this.parseObject(e.object,s,l,o,n),u=this.parseSkeletons(e.skeletons,c);if(this.bindSkeletons(c,u),this.bindLightTargets(c),t!==void 0){let h=!1;for(const d in a)if(a[d].data instanceof HTMLImageElement){h=!0;break}h===!1&&t(c)}return c}async parseAsync(e){const t=this.parseAnimations(e.animations),n=this.parseShapes(e.shapes),r=this.parseGeometries(e.geometries,n),s=await this.parseImagesAsync(e.images),a=this.parseTextures(e.textures,s),o=this.parseMaterials(e.materials,a),l=this.parseObject(e.object,r,o,a,t),c=this.parseSkeletons(e.skeletons,l);return this.bindSkeletons(l,c),this.bindLightTargets(l),l}static registerGeometry(e,t){Vu[e]=t}parseShapes(e){const t={};if(e!==void 0)for(let n=0,r=e.length;n<r;n++){const s=new Lr().fromJSON(e[n]);t[s.uuid]=s}return t}parseSkeletons(e,t){const n={},r={};if(t.traverse(function(s){s.isBone&&(r[s.uuid]=s)}),e!==void 0)for(let s=0,a=e.length;s<a;s++){const o=new Bc().fromJSON(e[s],r);n[o.uuid]=o}return n}parseGeometries(e,t){const n={};if(e!==void 0){const r=new r0;for(let s=0,a=e.length;s<a;s++){let o;const l=e[s];switch(l.type){case"BufferGeometry":case"InstancedBufferGeometry":o=r.parse(l);break;default:l.type in vp?o=vp[l.type].fromJSON(l,t):l.type in Vu?o=Vu[l.type].fromJSON(l,t):_e(`ObjectLoader: Unknown geometry type "${l.type}". Use .registerGeometry() before starting the deserialization process.`)}o.uuid=l.uuid,l.name!==void 0&&(o.name=l.name),l.userData!==void 0&&(o.userData=l.userData),n[l.uuid]=o}}return n}parseMaterials(e,t){const n={},r={};if(e!==void 0){const s=new tu;s.setTextures(t);for(let a=0,o=e.length;a<o;a++){const l=e[a];n[l.uuid]===void 0&&(n[l.uuid]=s.parse(l)),r[l.uuid]=n[l.uuid]}}return r}parseAnimations(e){const t={};if(e!==void 0)for(let n=0;n<e.length;n++){const r=e[n],s=ja.parse(r);t[s.uuid]=s}return t}parseImages(e,t){const n=this,r={};let s;function a(l){return n.manager.itemStart(l),s.load(l,function(){n.manager.itemEnd(l)},void 0,function(){n.manager.itemError(l),n.manager.itemEnd(l)})}function o(l){if(typeof l=="string"){const c=l,u=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(c)?c:n.resourcePath+c;return a(u)}else return l.data?{data:gs(l.type,l.data),width:l.width,height:l.height}:null}if(e!==void 0&&e.length>0){const l=new Fd(t);s=new Qa(l),s.setCrossOrigin(this.crossOrigin);for(let c=0,u=e.length;c<u;c++){const h=e[c],d=h.url;if(Array.isArray(d)){const f=[];for(let p=0,_=d.length;p<_;p++){const g=d[p],m=o(g);m!==null&&(m instanceof HTMLImageElement?f.push(m):f.push(new ti(m.data,m.width,m.height)))}r[h.uuid]=new Yi(f)}else{const f=o(h.url);r[h.uuid]=new Yi(f)}}}return r}async parseImagesAsync(e){const t=this,n={};let r;
vendor: 8,621 bytes, line 5
5async function s(a){if(typeof a=="string"){const o=a,l=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(o)?o:t.resourcePath+o;return await r.loadAsync(l)}else return a.data?{data:gs(a.type,a.data),width:a.width,height:a.height}:null}if(e!==void 0&&e.length>0){r=new Qa(this.manager),r.setCrossOrigin(this.crossOrigin);for(let a=0,o=e.length;a<o;a++){const l=e[a],c=l.url;if(Array.isArray(c)){const u=[];for(let h=0,d=c.length;h<d;h++){const f=c[h],p=await s(f);p!==null&&(p instanceof HTMLImageElement?u.push(p):u.push(new ti(p.data,p.width,p.height)))}n[l.uuid]=new Yi(u)}else{const u=await s(l.url);n[l.uuid]=new Yi(u)}}}return n}parseTextures(e,t){function n(s,a){return typeof s=="number"?s:(_e("ObjectLoader.parseTexture: Constant should be in numeric form.",s),a[s])}const r={};if(e!==void 0)for(let s=0,a=e.length;s<a;s++){const o=e[s];o.image===void 0&&_e('ObjectLoader: No "image" specified for',o.uuid),t[o.image]===void 0&&_e("ObjectLoader: Undefined image",o.image);const l=t[o.image],c=l.data;let u;Array.isArray(c)?(u=new oo,c.length===6&&(u.needsUpdate=!0)):(c&&c.data?u=new ti:u=new Ft,c&&(u.needsUpdate=!0)),u.source=l,u.uuid=o.uuid,o.name!==void 0&&(u.name=o.name),o.mapping!==void 0&&(u.mapping=n(o.mapping,EE)),o.channel!==void 0&&(u.channel=o.channel),o.offset!==void 0&&u.offset.fromArray(o.offset),o.repeat!==void 0&&u.repeat.fromArray(o.repeat),o.center!==void 0&&u.center.fromArray(o.center),o.rotation!==void 0&&(u.rotation=o.rotation),o.wrap!==void 0&&(u.wrapS=n(o.wrap[0],Tp),u.wrapT=n(o.wrap[1],Tp)),o.format!==void 0&&(u.format=o.format),o.internalFormat!==void 0&&(u.internalFormat=o.internalFormat),o.type!==void 0&&(u.type=o.type),o.colorSpace!==void 0&&(u.colorSpace=o.colorSpace),o.minFilter!==void 0&&(u.minFilter=n(o.minFilter,wp)),o.magFilter!==void 0&&(u.magFilter=n(o.magFilter,wp)),o.anisotropy!==void 0&&(u.anisotropy=o.anisotropy),o.flipY!==void 0&&(u.flipY=o.flipY),o.generateMipmaps!==void 0&&(u.generateMipmaps=o.generateMipmaps),o.premultiplyAlpha!==void 0&&(u.premultiplyAlpha=o.premultiplyAlpha),o.unpackAlignment!==void 0&&(u.unpackAlignment=o.unpackAlignment),o.compareFunction!==void 0&&(u.compareFunction=o.compareFunction),o.normalized!==void 0&&(u.normalized=o.normalized),o.userData!==void 0&&(u.userData=o.userData),r[o.uuid]=u}return r}parseObject(e,t,n,r,s){let a;function o(d){return t[d]===void 0&&_e("ObjectLoader: Undefined geometry",d),t[d]}function l(d){if(d!==void 0){if(Array.isArray(d)){const f=[];for(let p=0,_=d.length;p<_;p++){const g=d[p];n[g]===void 0&&_e("ObjectLoader: Undefined material",g),f.push(n[g])}return f}return n[d]===void 0&&_e("ObjectLoader: Undefined material",d),n[d]}}function c(d){return r[d]===void 0&&_e("ObjectLoader: Undefined texture",d),r[d]}let u,h;switch(e.type){case"Scene":a=new Uc,e.background!==void 0&&(Number.isInteger(e.background)?a.background=new Ee(e.background):a.background=c(e.background)),e.environment!==void 0&&(a.environment=c(e.environment)),e.fog!==void 0&&(e.fog.type==="Fog"?a.fog=new Oc(e.fog.color,e.fog.near,e.fog.far):e.fog.type==="FogExp2"&&(a.fog=new Dc(e.fog.color,e.fog.density)),e.fog.name!==""&&(a.fog.name=e.fog.name)),e.backgroundBlurriness!==void 0&&(a.backgroundBlurriness=e.backgroundBlurriness),e.backgroundIntensity!==void 0&&(a.backgroundIntensity=e.backgroundIntensity),e.backgroundRotation!==void 0&&a.backgroundRotation.fromArray(e.backgroundRotation),e.environmentIntensity!==void 0&&(a.environmentIntensity=e.environmentIntensity),e.environmentRotation!==void 0&&a.environmentRotation.fromArray(e.environmentRotation);break;case"PerspectiveCamera":a=new Jt(e.fov,e.aspect,e.near,e.far),e.focus!==void 0&&(a.focus=e.focus),e.zoom!==void 0&&(a.zoom=e.zoom),e.filmGauge!==void 0&&(a.filmGauge=e.filmGauge),e.filmOffset!==void 0&&(a.filmOffset=e.filmOffset),e.view!==void 0&&(a.view=Object.assign({},e.view));break;case"OrthographicCamera":a=new fo(e.left,e.right,e.top,e.bottom,e.near,e.far),e.zoom!==void 0&&(a.zoom=e.zoom),e.view!==void 0&&(a.view=Object.assign({},e.view));break;case"AmbientLight":a=new e0(e.color,e.intensity);break;case"DirectionalLight":a=new Q_(e.color,e.intensity),a.target=e.target||"";break;case"PointLight":a=new j_(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":a=new t0(e.color,e.intensity,e.width,e.height);break;case"SpotLight":a=new J_(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay),a.target=e.target||"";break;case"HemisphereLight":a=new K_(e.color,e.groundColor,e.intensity);break;case"LightProbe":const d=new kd().fromArray(e.sh);a=new n0(d,e.intensity);break;case"SkinnedMesh":u=o(e.geometry),h=l(e.material),a=new __(u,h),e.bindMode!==void 0&&(a.bindMode=e.bindMode),e.bindMatrix!==void 0&&a.bindMatrix.fromArray(e.bindMatrix),e.skeleton!==void 0&&(a.skeleton=e.skeleton);break;case"Mesh":u=o(e.geometry),h=l(e.material),a=new Dt(u,h);break;case"InstancedMesh":u=o(e.geometry),h=l(e.material);const f=e.count,p=e.instanceMatrix,_=e.instanceColor;a=new v_(u,h,f),a.instanceMatrix=new Ns(new Float32Array(p.array),16),_!==void 0&&(a.instanceColor=new Ns(new Float32Array(_.array),_.itemSize));break;case"BatchedMesh":u=o(e.geometry),h=l(e.material),a=new x_(e.maxInstanceCount,e.maxVertexCount,e.maxIndexCount,h),a.geometry=u,a.perObjectFrustumCulled=e.perObjectFrustumCulled,a.sortObjects=e.sortObjects,a._drawRanges=e.drawRanges,a._reservedRanges=e.reservedRanges,a._geometryInfo=e.geometryInfo.map(g=>{let m=null,v=null;return g.boundingBox!==void 0&&(m=new hn().fromJSON(g.boundingBox)),g.boundingSphere!==void 0&&(v=new nn().fromJSON(g.boundingSphere)),{...g,boundingBox:m,boundingSphere:v}}),a._instanceInfo=e.instanceInfo,a._availableInstanceIds=e._availableInstanceIds,a._availableGeometryIds=e._availableGeometryIds,a._nextIndexStart=e.nextIndexStart,a._nextVertexStart=e.nextVertexStart,a._geometryCount=e.geometryCount,a._maxInstanceCount=e.maxInstanceCount,a._maxVertexCount=e.maxVertexCount,a._maxIndexCount=e.maxIndexCount,a._geometryInitialized=e.geometryInitialized,a._matricesTexture=c(e.matricesTexture.uuid),a._indirectTexture=c(e.indirectTexture.uuid),e.colorsTexture!==void 0&&(a._colorsTexture=c(e.colorsTexture.uuid)),e.boundingSphere!==void 0&&(a.boundingSphere=new nn().fromJSON(e.boundingSphere)),e.boundingBox!==void 0&&(a.boundingBox=new hn().fromJSON(e.boundingBox));break;case"LOD":a=new g_;break;case"Line":a=new ir(o(e.geometry),l(e.material));break;case"LineLoop":a=new y_(o(e.geometry),l(e.material));break;case"LineSegments":a=new vi(o(e.geometry),l(e.material));break;case"PointCloud":case"Points":a=new cc(o(e.geometry),l(e.material));break;case"Sprite":a=new m_(l(e.material));break;case"Group":a=new _s;break;case"Bone":a=new bd;break;default:a=new pt}if(a.uuid=e.uuid,e.name!==void 0&&(a.name=e.name),e.matrix!==void 0?(a.matrix.fromArray(e.matrix),e.matrixAutoUpdate!==void 0&&(a.matrixAutoUpdate=e.matrixAutoUpdate),a.matrixAutoUpdate&&a.matrix.decompose(a.position,a.quaternion,a.scale)):(e.position!==void 0&&a.position.fromArray(e.position),e.rotation!==void 0&&a.rotation.fromArray(e.rotation),e.quaternion!==void 0&&a.quaternion.fromArray(e.quaternion),e.scale!==void 0&&a.scale.fromArray(e.scale)),e.up!==void 0&&a.up.fromArray(e.up),e.pivot!==void 0&&(a.pivot=new P().fromArray(e.pivot)),e.morphTargetDictionary!==void 0&&(a.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),e.morphTargetInfluences!==void 0&&(a.morphTargetInfluences=e.morphTargetInfluences.slice()),e.castShadow!==void 0&&(a.castShadow=e.castShadow),e.receiveShadow!==void 0&&(a.receiveShadow=e.receiveShadow),e.shadow&&(e.shadow.intensity!==void 0&&(a.shadow.intensity=e.shadow.intensity),e.shadow.bias!==void 0&&(a.shadow.bias=e.shadow.bias),e.shadow.normalBias!==void 0&&(a.shadow.normalBias=e.shadow.normalBias),e.shadow.radius!==void 0&&(a.shadow.radius=e.shadow.radius),e.shadow.mapSize!==void 0&&a.shadow.mapSize.fromArray(e.shadow.mapSize),e.shadow.camera!==void 0&&(a.shadow.camera=this.parseObject(e.shadow.camera))),e.visible!==void 0&&(a.visible=e.visible),e.frustumCulled!==void 0&&(a.frustumCulled=e.frustumCulled),e.renderOrder!==void 0&&(a.renderOrder=e.renderOrder),e.static!==void 0&&(a.static=e.static),e.userData!==void 0&&(a.userData=e.userData),e.layers!==void 0&&(a.layers.mask=e.layers),e.children!==void 0){const d=e.children;for(let f=0;f<d.length;f++)a.add(this.parseObject(d[f],t,n,r,s))}if(e.animations!==void 0){const d=e.animations;for(let f=0;f<d.length;f++){const p=d[f];a.animations.push(s[p])}}if(e.type==="LOD"){e.autoUpdate!==void 0&&(a.autoUpdate=e.autoUpdate);const d=e.levels;for(let f=0;f<d.length;f++){const p=d[f],_=a.getObjectByProperty("uuid",p.object);
5_!==void 0&&a.addLevel(_,p.distance,p.hysteresis)}}return a}bindSkeletons(e,t){Object.keys(t).length!==0&&e.traverse(function(n){if(n.isSkinnedMesh===!0&&n.skeleton!==void 0){const r=t[n.skeleton];r===void 0?_e("ObjectLoader: No skeleton found with UUID:",n.skeleton):n.bind(r,n.bindMatrix)}})}bindLightTargets(e){e.traverse(function(t){if(t.isDirectionalLight||t.isSpotLight){const n=t.target,r=e.getObjectByProperty("uuid",n);r!==void 0?t.target=r:t.target=new pt}})}}const EE={UVMapping:Sc,CubeReflectionMapping:mi,CubeRefractionMapping:Qi,EquirectangularReflectionMapping:ya,EquirectangularRefractionMapping:ba,CubeUVReflectionMapping:Gs},Tp={RepeatWrapping:Ua,ClampToEdgeWrapping:An,MirroredRepeatWrapping:Fa},wp={NearestFilter:Xt,NearestMipmapNearestFilter:ld,NearestMipmapLinearFilter:ms,LinearFilter:Lt,LinearMipmapNearestFilter:Sa,LinearMipmapLinearFilter:di},zu=new WeakMap;class TE extends Rn{constructor(e){super(e),this.isImageBitmapLoader=!0,typeof createImageBitmap>"u"&&_e("ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&_e("ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"},this._abortController=new AbortController}setOptions(e){return this.options=e,this}load(e,t,n,r){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,a=fi.get(`image-bitmap:${e}`);if(a!==void 0){if(s.manager.itemStart(e),a.then){a.then(c=>{zu.has(a)===!0?(r&&r(zu.get(a)),s.manager.itemError(e),s.manager.itemEnd(e)):(t&&t(c),s.manager.itemEnd(e))});return}setTimeout(function(){t&&t(a),s.manager.itemEnd(e)},0);return}const o={};o.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",o.headers=this.requestHeader,o.signal=typeof AbortSignal.any=="function"?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal;const l=fetch(e,o).then(function(c){return c.blob()}).then(function(c){return createImageBitmap(c,Object.assign(s.options,{colorSpaceConversion:"none"}))}).then(function(c){fi.add(`image-bitmap:${e}`,c),t&&t(c),s.manager.itemEnd(e)}).catch(function(c){r&&r(c),zu.set(l,c),fi.remove(`image-bitmap:${e}`),s.manager.itemError(e),s.manager.itemEnd(e)});fi.add(`image-bitmap:${e}`,l),s.manager.itemStart(e)}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}}let Qo;class Vd{static getContext(){return Qo===void 0&&(Qo=new(window.AudioContext||window.webkitAudioContext)),Qo}static setContext(e){Qo=e}}class wE extends Rn{constructor(e){super(e)}load(e,t,n,r){const s=this,a=new Ni(this.manager);a.setResponseType("arraybuffer"),a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(l){try{const c=l.slice(0),u=Vd.getContext(),h=e+"#decode";s.manager.itemStart(h),u.decodeAudioData(c,function(d){t(d),s.manager.itemEnd(h)}).catch(function(d){o(d),s.manager.itemEnd(h)})}catch(c){o(c)}},n,r);function o(l){r?r(l):Oe(l),s.manager.itemError(e)}}}const Ap=new We,Cp=new We,fr=new We;class AE{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Jt,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Jt,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(e){const t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep,fr.copy(e.projectionMatrix);const r=t.eyeSep/2,s=r*t.near/t.focus,a=t.near*Math.tan(Pr*t.fov*.5)/t.zoom;let o,l;Cp.elements[12]=-r,Ap.elements[12]=r,o=-a*t.aspect+s,l=a*t.aspect+s,fr.elements[0]=2*t.near/(l-o),fr.elements[8]=(l+o)/(l-o),this.cameraL.projectionMatrix.copy(fr),o=-a*t.aspect-s,l=a*t.aspect-s,fr.elements[0]=2*t.near/(l-o),fr.elements[8]=(l+o)/(l-o),this.cameraR.projectionMatrix.copy(fr)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(Cp),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(Ap)}}const ls=-90,cs=1;class s0 extends pt{constructor(e,t,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;const r=new Jt(ls,cs,e,t);r.layers=this.layers,this.add(r);const s=new Jt(ls,cs,e,t);s.layers=this.layers,this.add(s);const a=new Jt(ls,cs,e,t);a.layers=this.layers,this.add(a);const o=new Jt(ls,cs,e,t);o.layers=this.layers,this.add(o);const l=new Jt(ls,cs,e,t);l.layers=this.layers,this.add(l);const c=new Jt(ls,cs,e,t);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[n,r,s,a,o,l]=t;for(const c of t)this.remove(c);if(e===Un)n.up.set(0,1,0),n.lookAt(1,0,0),r.up.set(0,1,0),r.lookAt(-1,0,0),s.up.set(0,0,-1),s.lookAt(0,1,0),a.up.set(0,0,1),a.lookAt(0,-1,0),o.up.set(0,1,0),o.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(e===Ur)n.up.set(0,-1,0),n.lookAt(-1,0,0),r.up.set(0,-1,0),r.lookAt(1,0,0),s.up.set(0,0,1),s.lookAt(0,1,0),a.up.set(0,0,-1),a.lookAt(0,-1,0),o.up.set(0,-1,0),o.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const c of t)this.add(c),c.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();const{renderTarget:n,activeMipmapLevel:r}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[s,a,o,l,c,u]=this.children,h=e.getRenderTarget(),d=e.getActiveCubeFace(),f=e.getActiveMipmapLevel(),p=e.xr.enabled;e.xr.enabled=!1;const _=n.texture.generateMipmaps;n.texture.generateMipmaps=!1;let g=!1;e.isWebGLRenderer===!0?g=e.state.buffers.depth.getReversed():g=e.reversedDepthBuffer,e.setRenderTarget(n,0,r),g&&e.autoClear===!1&&e.clearDepth(),e.render(t,s),e.setRenderTarget(n,1,r),g&&e.autoClear===!1&&e.clearDepth(),e.render(t,a),e.setRenderTarget(n,2,r),g&&e.autoClear===!1&&e.clearDepth(),e.render(t,o),e.setRenderTarget(n,3,r),g&&e.autoClear===!1&&e.clearDepth(),e.render(t,l),e.setRenderTarget(n,4,r),g&&e.autoClear===!1&&e.clearDepth(),e.render(t,c),n.texture.generateMipmaps=_,e.setRenderTarget(n,5,r),g&&e.autoClear===!1&&e.clearDepth(),e.render(t,u),e.setRenderTarget(h,d,f),e.xr.enabled=p,n.texture.needsPMREMUpdate=!0}}class a0 extends Jt{constructor(e=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=e}}class zd{constructor(){this._previousTime=0,this._currentTime=0,this._startTime=performance.now(),this._delta=0,this._elapsed=0,this._timescale=1,this._document=null,this._pageVisibilityHandler=null}connect(e){this._document=e,e.hidden!==void 0&&(this._pageVisibilityHandler=CE.bind(this),e.addEventListener("visibilitychange",this._pageVisibilityHandler,!1))}disconnect(){this._pageVisibilityHandler!==null&&(this._document.removeEventListener("visibilitychange",this._pageVisibilityHandler),this._pageVisibilityHandler=null),this._document=null}getDelta(){return this._delta/1e3}getElapsed(){return this._elapsed/1e3}getTimescale(){return this._timescale}setTimescale(e){return this._timescale=e,this}reset(){return this._currentTime=performance.now()-this._startTime,this}dispose(){this.disconnect()}update(e){return this._pageVisibilityHandler!==null&&this._document.hidden===!0?this._delta=0:(this._previousTime=this._currentTime,this._currentTime=(e!==void 0?e:performance.now())-this._startTime,this._delta=(this._currentTime-this._previousTime)*this._timescale,this._elapsed+=this._delta),this}}function CE(){this._document.hidden===!1&&this.reset()}
vendor: 14,627 bytes, line 5
5const pr=new P,Hu=new tn,RE=new P,mr=new P,gr=new P;class IE extends pt{constructor(){super(),this.type="AudioListener",this.context=Vd.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._timer=new zd}getInput(){return this.gain}removeFilter(){return this.filter!==null&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e),this._timer.update();const t=this.context.listener;if(this.timeDelta=this._timer.getDelta(),this.matrixWorld.decompose(pr,Hu,RE),mr.set(0,0,-1).applyQuaternion(Hu),gr.set(0,1,0).applyQuaternion(Hu),t.positionX){const n=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(pr.x,n),t.positionY.linearRampToValueAtTime(pr.y,n),t.positionZ.linearRampToValueAtTime(pr.z,n),t.forwardX.linearRampToValueAtTime(mr.x,n),t.forwardY.linearRampToValueAtTime(mr.y,n),t.forwardZ.linearRampToValueAtTime(mr.z,n),t.upX.linearRampToValueAtTime(gr.x,n),t.upY.linearRampToValueAtTime(gr.y,n),t.upZ.linearRampToValueAtTime(gr.z,n)}else t.setPosition(pr.x,pr.y,pr.z),t.setOrientation(mr.x,mr.y,mr.z,gr.x,gr.y,gr.z)}}class o0 extends pt{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(this.isPlaying===!0){_e("Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){_e("Audio: this Audio has no playback control.");return}this._startedAt=this.context.currentTime+e;const t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl===!1){_e("Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(e=0){if(this.hasPlaybackControl===!1){_e("Audio: this Audio has no playback control.");return}return this._progress=0,this.source!==null&&(this.source.stop(this.context.currentTime+e),this.source.onended=null),this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].connect(this.filters[e]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this._connected=!0,this}disconnect(){if(this._connected!==!1){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].disconnect(this.filters[e]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this._connected=!1,this}}getFilters(){return this.filters}setFilters(e){return e||(e=[]),this._connected===!0?(this.disconnect(),this.filters=e.slice(),this.connect()):this.filters=e.slice(),this}setDetune(e){return this.detune=e,this.isPlaying===!0&&this.source.detune!==void 0&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this}getDetune(){return this.detune}getFilter(){return this.getFilters()[0]}setFilter(e){return this.setFilters(e?[e]:[])}setPlaybackRate(e){if(this.hasPlaybackControl===!1){_e("Audio: this Audio has no playback control.");return}return this.playbackRate=e,this.isPlaying===!0&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this}getPlaybackRate(){return this.playbackRate}onEnded(){this.isPlaying=!1,this._progress=0}getLoop(){return this.hasPlaybackControl===!1?(_e("Audio: this Audio has no playback control."),!1):this.loop}setLoop(e){if(this.hasPlaybackControl===!1){_e("Audio: this Audio has no playback control.");return}return this.loop=e,this.isPlaying===!0&&(this.source.loop=this.loop),this}setLoopStart(e){return this.loopStart=e,this}setLoopEnd(e){return this.loopEnd=e,this}getVolume(){return this.gain.gain.value}setVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}copy(e,t){return super.copy(e,t),e.sourceType!=="buffer"?(_e("Audio: Audio source type cannot be copied."),this):(this.autoplay=e.autoplay,this.buffer=e.buffer,this.detune=e.detune,this.loop=e.loop,this.loopStart=e.loopStart,this.loopEnd=e.loopEnd,this.offset=e.offset,this.duration=e.duration,this.playbackRate=e.playbackRate,this.hasPlaybackControl=e.hasPlaybackControl,this.sourceType=e.sourceType,this.filters=e.filters.slice(),this)}clone(e){return new this.constructor(this.listener).copy(this,e)}}const _r=new P,Rp=new tn,PE=new P,vr=new P;class LE extends o0{constructor(e){super(e),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}connect(){return super.connect(),this.panner.connect(this.gain),this}disconnect(){return super.disconnect(),this.panner.disconnect(this.gain),this}getOutput(){return this.panner}getRefDistance(){return this.panner.refDistance}setRefDistance(e){return this.panner.refDistance=e,this}getRolloffFactor(){return this.panner.rolloffFactor}setRolloffFactor(e){return this.panner.rolloffFactor=e,this}getDistanceModel(){return this.panner.distanceModel}setDistanceModel(e){return this.panner.distanceModel=e,this}getMaxDistance(){return this.panner.maxDistance}setMaxDistance(e){return this.panner.maxDistance=e,this}setDirectionalCone(e,t,n){return this.panner.coneInnerAngle=e,this.panner.coneOuterAngle=t,this.panner.coneOuterGain=n,this}updateMatrixWorld(e){if(super.updateMatrixWorld(e),this.hasPlaybackControl===!0&&this.isPlaying===!1)return;this.matrixWorld.decompose(_r,Rp,PE),vr.set(0,0,1).applyQuaternion(Rp);const t=this.panner;if(t.positionX){const n=this.context.currentTime+this.listener.timeDelta;t.positionX.linearRampToValueAtTime(_r.x,n),t.positionY.linearRampToValueAtTime(_r.y,n),t.positionZ.linearRampToValueAtTime(_r.z,n),t.orientationX.linearRampToValueAtTime(vr.x,n),t.orientationY.linearRampToValueAtTime(vr.y,n),t.orientationZ.linearRampToValueAtTime(vr.z,n)}else t.setPosition(_r.x,_r.y,_r.z),t.setOrientation(vr.x,vr.y,vr.z)}}class NE{constructor(e,t=2048){this.analyser=e.context.createAnalyser(),this.analyser.fftSize=t,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)}getFrequencyData(){return this.analyser.getByteFrequencyData(this.data),this.data}getAverageFrequency(){let e=0;const t=this.getFrequencyData();for(let n=0;n<t.length;n++)e+=t[n];return e/t.length}}class l0{constructor(e,t,n){this.binding=e,this.valueSize=n;let r,s,a;switch(t){case"quaternion":r=this._slerp,s=this._slerpAdditive,a=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(n*6),this._workIndex=5;break;case"string":case"bool":r=this._select,s=this._select,a=this._setAdditiveIdentityOther,this.buffer=new Array(n*5);break;default:r=this._lerp,s=this._lerpAdditive,a=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(n*5)}this._mixBufferRegion=r,this._mixBufferRegionAdditive=s,this._setIdentity=a,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(e,t){const n=this.buffer,r=this.valueSize,s=e*r+r;let a=this.cumulativeWeight;if(a===0){for(let o=0;o!==r;++o)n[s+o]=n[o];a=t}else{a+=t;const o=t/a;this._mixBufferRegion(n,s,0,o,r)}this.cumulativeWeight=a}accumulateAdditive(e){const t=this.buffer,n=this.valueSize,r=n*this._addIndex;this.cumulativeWeightAdditive===0&&this._setIdentity(),this._mixBufferRegionAdditive(t,r,0,e,n),this.cumulativeWeightAdditive+=e}apply(e){const t=this.valueSize,n=this.buffer,r=e*t+t,s=this.cumulativeWeight,a=this.cumulativeWeightAdditive,o=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,s<1){const l=t*this._origIndex;this._mixBufferRegion(n,r,l,1-s,t)}a>0&&this._mixBufferRegionAdditive(n,r,this._addIndex*t,1,t);for(let l=t,c=t+t;l!==c;++l)if(n[l]!==n[l+t]){o.setValue(n,r);break}}saveOriginalState(){const e=this.binding,t=this.buffer,n=this.valueSize,r=n*this._origIndex;e.getValue(t,r);for(let s=n,a=r;s!==a;++s)t[s]=t[r+s%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let n=e;n<t;n++)this.buffer[n]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){const e=this._origIndex*this.valueSize,t=this._addIndex*this.valueSize;for(let n=0;n<this.valueSize;n++)this.buffer[t+n]=this.buffer[e+n]}_select(e,t,n,r,s){if(r>=.5)for(let a=0;a!==s;++a)e[t+a]=e[n+a]}_slerp(e,t,n,r){tn.slerpFlat(e,t,e,t,e,n,r)}_slerpAdditive(e,t,n,r,s){const a=this._workIndex*s;tn.multiplyQuaternionsFlat(e,a,e,t,e,n),tn.slerpFlat(e,t,e,t,e,a,r)}_lerp(e,t,n,r,s){const a=1-r;for(let o=0;o!==s;++o){const l=t+o;e[l]=e[l]*a+e[n+o]*r}}_lerpAdditive(e,t,n,r,s){for(let a=0;a!==s;++a){const o=t+a;e[o]=e[o]+e[n+a]*r}}}const Hd="\\[\\]\\.:\\/",DE=new RegExp("["+Hd+"]","g"),Gd="[^"+Hd+"]",OE="[^"+Hd.replace("\\.","")+"]",UE=/((?:WC+[\/:])*)/.source.replace("WC",Gd),FE=/(WCOD+)?/.source.replace("WCOD",OE),BE=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Gd),kE=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Gd),VE=new RegExp("^"+UE+FE+BE+kE+"$"),zE=["material","materials","bones","map"];class HE{constructor(e,t,n){const r=n||_t.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}getValue(e,t){this.bind();const n=this._targetGroup.nCachedObjects_,r=this._bindings[n];r!==void 0&&r.getValue(e,t)}setValue(e,t){const n=this._bindings;for(let r=this._targetGroup.nCachedObjects_,s=n.length;r!==s;++r)n[r].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}}class _t{constructor(e,t,n){this.path=t,this.parsedPath=n||_t.parseTrackName(t),this.node=_t.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,n){return e&&e.isAnimationObjectGroup?new _t.Composite(e,t,n):new _t(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(DE,"")}static parseTrackName(e){const t=VE.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},r=n.nodeName&&n.nodeName.lastIndexOf(".");if(r!==void 0&&r!==-1){const s=n.nodeName.substring(r+1);zE.indexOf(s)!==-1&&(n.nodeName=n.nodeName.substring(0,r),n.objectName=s)}if(n.propertyName===null||n.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const n=e.skeleton.getBoneByName(t);if(n!==void 0)return n}if(e.children){const n=function(s){for(let a=0;a<s.length;a++){const o=s[a];if(o.name===t||o.uuid===t)return o;const l=n(o.children);if(l)return l}return null},r=n(e.children);if(r)return r}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(e,t){const n=this.resolvedProperty;for(let r=0,s=n.length;r!==s;++r)e[t++]=n[r]}_getValue_arrayElement(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,t){this.resolvedProperty.toArray(e,t)}_setValue_direct(e,t){this.targetObject[this.propertyName]=e[t]}_setValue_direct_setNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,t){const n=this.resolvedProperty;for(let r=0,s=n.length;r!==s;++r)n[r]=e[t++]}_setValue_array_setNeedsUpdate(e,t){const n=this.resolvedProperty;for(let r=0,s=n.length;r!==s;++r)n[r]=e[t++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,t){const n=this.resolvedProperty;for(let r=0,s=n.length;r!==s;++r)n[r]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}_setValue_arrayElement_setNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,t){this.resolvedProperty.fromArray(e,t)}_setValue_fromArray_setNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}
5_setValue_fromArray_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,t){this.bind(),this.getValue(e,t)}_setValue_unbound(e,t){this.bind(),this.setValue(e,t)}bind(){let e=this.node;const t=this.parsedPath,n=t.objectName,r=t.propertyName;let s=t.propertyIndex;if(e||(e=_t.findNode(this.rootNode,t.nodeName),this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e){_e("PropertyBinding: No target node found for track: "+this.path+".");return}if(n){let c=t.objectIndex;switch(n){case"materials":if(!e.material){Oe("PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.materials){Oe("PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}e=e.material.materials;break;case"bones":if(!e.skeleton){Oe("PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}e=e.skeleton.bones;for(let u=0;u<e.length;u++)if(e[u].name===c){c=u;break}break;case"map":if("map"in e){e=e.map;break}if(!e.material){Oe("PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.map){Oe("PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);return}e=e.material.map;break;default:if(e[n]===void 0){Oe("PropertyBinding: Can not bind to objectName of node undefined.",this);return}e=e[n]}if(c!==void 0){if(e[c]===void 0){Oe("PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);return}e=e[c]}}const a=e[r];if(a===void 0){const c=t.nodeName;Oe("PropertyBinding: Trying to update property for track: "+c+"."+r+" but it wasn't found.",e);return}let o=this.Versioning.None;this.targetObject=e,e.isMaterial===!0?o=this.Versioning.NeedsUpdate:e.isObject3D===!0&&(o=this.Versioning.MatrixWorldNeedsUpdate);let l=this.BindingType.Direct;if(s!==void 0){if(r==="morphTargetInfluences"){if(!e.geometry){Oe("PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(!e.geometry.morphAttributes){Oe("PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}e.morphTargetDictionary[s]!==void 0&&(s=e.morphTargetDictionary[s])}l=this.BindingType.ArrayElement,this.resolvedProperty=a,this.propertyIndex=s}else a.fromArray!==void 0&&a.toArray!==void 0?(l=this.BindingType.HasFromToArray,this.resolvedProperty=a):Array.isArray(a)?(l=this.BindingType.EntireArray,this.resolvedProperty=a):this.propertyName=r;this.getValue=this.GetterByBindingType[l],this.setValue=this.SetterByBindingTypeAndVersioning[l][o]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}_t.Composite=HE;_t.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3};_t.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2};_t.prototype.GetterByBindingType=[_t.prototype._getValue_direct,_t.prototype._getValue_array,_t.prototype._getValue_arrayElement,_t.prototype._getValue_toArray];_t.prototype.SetterByBindingTypeAndVersioning=[[_t.prototype._setValue_direct,_t.prototype._setValue_direct_setNeedsUpdate,_t.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[_t.prototype._setValue_array,_t.prototype._setValue_array_setNeedsUpdate,_t.prototype._setValue_array_setMatrixWorldNeedsUpdate],[_t.prototype._setValue_arrayElement,_t.prototype._setValue_arrayElement_setNeedsUpdate,_t.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[_t.prototype._setValue_fromArray,_t.prototype._setValue_fromArray_setNeedsUpdate,_t.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class GE{constructor(){this.isAnimationObjectGroup=!0,this.uuid=Fn(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;const e={};this._indicesByUUID=e;for(let n=0,r=arguments.length;n!==r;++n)e[arguments[n].uuid]=n;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};const t=this;this.stats={objects:{get total(){return t._objects.length},get inUse(){return this.total-t.nCachedObjects_}},get bindingsPerObject(){return t._bindings.length}}}add(){const e=this._objects,t=this._indicesByUUID,n=this._paths,r=this._parsedPaths,s=this._bindings,a=s.length;let o,l=e.length,c=this.nCachedObjects_;for(let u=0,h=arguments.length;u!==h;++u){const d=arguments[u],f=d.uuid;let p=t[f];if(p===void 0){p=l++,t[f]=p,e.push(d);for(let _=0,g=a;_!==g;++_)s[_].push(new _t(d,n[_],r[_]))}else if(p<c){o=e[p];const _=--c,g=e[_];t[g.uuid]=p,e[p]=g,t[f]=_,e[_]=d;for(let m=0,v=a;m!==v;++m){const b=s[m],y=b[_];let T=b[p];b[p]=y,T===void 0&&(T=new _t(d,n[m],r[m])),b[_]=T}}else e[p]!==o&&Oe("AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastru
5cture when reloading scenes.")}this.nCachedObjects_=c}remove(){const e=this._objects,t=this._indicesByUUID,n=this._bindings,r=n.length;let s=this.nCachedObjects_;for(let a=0,o=arguments.length;a!==o;++a){const l=arguments[a],c=l.uuid,u=t[c];if(u!==void 0&&u>=s){const h=s++,d=e[h];t[d.uuid]=u,e[u]=d,t[c]=h,e[h]=l;for(let f=0,p=r;f!==p;++f){const _=n[f],g=_[h],m=_[u];_[u]=g,_[h]=m}}}this.nCachedObjects_=s}uncache(){const e=this._objects,t=this._indicesByUUID,n=this._bindings,r=n.length;let s=this.nCachedObjects_,a=e.length;for(let o=0,l=arguments.length;o!==l;++o){const c=arguments[o],u=c.uuid,h=t[u];if(h!==void 0)if(delete t[u],h<s){const d=--s,f=e[d],p=--a,_=e[p];t[f.uuid]=h,e[h]=f,t[_.uuid]=d,e[d]=_,e.pop();for(let g=0,m=r;g!==m;++g){const v=n[g],b=v[d],y=v[p];v[h]=b,v[d]=y,v.pop()}}else{const d=--a,f=e[d];d>0&&(t[f.uuid]=h),e[h]=f,e.pop();for(let p=0,_=r;p!==_;++p){const g=n[p];g[h]=g[d],g.pop()}}}this.nCachedObjects_=s}subscribe_(e,t){const n=this._bindingsIndicesByPath;let r=n[e];const s=this._bindings;if(r!==void 0)return s[r];const a=this._paths,o=this._parsedPaths,l=this._objects,c=l.length,u=this.nCachedObjects_,h=new Array(c);r=s.length,n[e]=r,a.push(e),o.push(t),s.push(h);for(let d=u,f=l.length;d!==f;++d){const p=l[d];h[d]=new _t(p,e,t)}return h}unsubscribe_(e){const t=this._bindingsIndicesByPath,n=t[e];if(n!==void 0){const r=this._paths,s=this._parsedPaths,a=this._bindings,o=a.length-1,l=a[o],c=e[o];t[c]=n,a[n]=l,a.pop(),s[n]=s[o],s.pop(),r[n]=r[o],r.pop()}}}class c0{constructor(e,t,n=null,r=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=n,this.blendMode=r;const s=t.tracks,a=s.length,o=new Array(a),l={endingStart:Er,endingEnd:Er};for(let c=0;c!==a;++c){const u=s[c].createInterpolant(null);o[c]=u,u.settings&&Object.assign(l,u.settings),u.settings=l}this._interpolantSettings=l,this._interpolants=o,this._propertyBindings=new Array(a),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=Jg,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,n=!1){if(e.fadeOut(t),this.fadeIn(t),n===!0){const r=this._clip.duration,s=e._clip.duration,a=s/r,o=r/s;e.warp(1,a,t),this.warp(o,1,t)}return this}crossFadeTo(e,t,n=!1){return e.crossFadeFrom(this,t,n)}stopFading(){const e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,n){const r=this._mixer,s=r.time,a=this.timeScale;let o=this._timeScaleInterpolant;o===null&&(o=r._lendControlInterpolant(),this._timeScaleInterpolant=o);const l=o.parameterPositions,c=o.sampleValues;return l[0]=s,l[1]=s+n,c[0]=e/a,c[1]=t/a,this}stopWarping(){const e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,n,r){if(!this.enabled){this._updateWeight(e);return}const s=this._startTime;if(s!==null){const l=(e-s)*n;l<0||n===0?t=0:(this._startTime=null,t=n*l)}t*=this._updateTimeScale(e);const a=this._updateTime(t),o=this._updateWeight(e);if(o>0){const l=this._interpolants,c=this._propertyBindings;switch(this.blendMode){case md:for(let u=0,h=l.length;u!==h;++u)l[u].evaluate(a),c[u].accumulateAdditive(o);break;case Rc:default:for(let u=0,h=l.length;u!==h;++u)l[u].evaluate(a),c[u].accumulate(r,o)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const n=this._weightInterpolant;if(n!==null){const r=n.evaluate(e)[0];t*=r,e>n.parameterPositions[1]&&(this.stopFading(),r===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const n=this._timeScaleInterpolant;if(n!==null){const r=n.evaluate(e)[0];t*=r,e>n.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,n=this.loop;let r=this.time+e,s=this._loopCount;const a=n===jg;if(e===0)return s===-1?r:a&&(s&1)===1?t-r:r;if(n===Kg){s===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(r>=t)r=t;else if(r<0)r=0;else{this.time=r;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(s===-1&&(e>=0?(s=0,this._setEndings(!0,this.repetitions===0,a)):this._setEndings(this.repetitions===0,!0,a)),r>=t||r<0){const o=Math.floor(r/t);r-=t*o,s+=Math.abs(o);const l=this.repetitions-s;if(l<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,r=e>0?t:0,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(l===1){const c=e<0;this._setEndings(c,!c,a)}else this._setEndings(!1,!1,a);this._loopCount=s,this.time=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:o})}}else this._loopCount=s,this.time=r;if(a&&(s&1)===1)return t-r}return r}
vendor: 9,066 bytes, line 5
5_setEndings(e,t,n){const r=this._interpolantSettings;n?(r.endingStart=Tr,r.endingEnd=Tr):(e?r.endingStart=this.zeroSlopeAtStart?Tr:Er:r.endingStart=za,t?r.endingEnd=this.zeroSlopeAtEnd?Tr:Er:r.endingEnd=za)}_scheduleFading(e,t,n){const r=this._mixer,s=r.time;let a=this._weightInterpolant;a===null&&(a=r._lendControlInterpolant(),this._weightInterpolant=a);const o=a.parameterPositions,l=a.sampleValues;return o[0]=s,l[0]=t,o[1]=s+e,l[1]=n,this}}const WE=new Float32Array(1);class XE extends ii{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}_bindAction(e,t){const n=e._localRoot||this._root,r=e._clip.tracks,s=r.length,a=e._propertyBindings,o=e._interpolants,l=n.uuid,c=this._bindingsByRootAndName;let u=c[l];u===void 0&&(u={},c[l]=u);for(let h=0;h!==s;++h){const d=r[h],f=d.name;let p=u[f];if(p!==void 0)++p.referenceCount,a[h]=p;else{if(p=a[h],p!==void 0){p._cacheIndex===null&&(++p.referenceCount,this._addInactiveBinding(p,l,f));continue}const _=t&&t._propertyBindings[h].binding.parsedPath;p=new l0(_t.create(n,f,_),d.ValueTypeName,d.getValueSize()),++p.referenceCount,this._addInactiveBinding(p,l,f),a[h]=p}o[h].resultBuffer=p.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const n=(e._localRoot||this._root).uuid,r=e._clip.uuid,s=this._actionsByClip[r];this._bindAction(e,s&&s.knownActions[0]),this._addInactiveAction(e,r,n)}const t=e._propertyBindings;for(let n=0,r=t.length;n!==r;++n){const s=t[n];s.useCount++===0&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let n=0,r=t.length;n!==r;++n){const s=t[n];--s.useCount===0&&(s.restoreOriginalState(),this._takeBackBinding(s))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){const t=e._cacheIndex;return t!==null&&t<this._nActiveActions}_addInactiveAction(e,t,n){const r=this._actions,s=this._actionsByClip;let a=s[t];if(a===void 0)a={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,s[t]=a;else{const o=a.knownActions;e._byClipCacheIndex=o.length,o.push(e)}e._cacheIndex=r.length,r.push(e),a.actionByRoot[n]=e}_removeInactiveAction(e){const t=this._actions,n=t[t.length-1],r=e._cacheIndex;n._cacheIndex=r,t[r]=n,t.pop(),e._cacheIndex=null;const s=e._clip.uuid,a=this._actionsByClip,o=a[s],l=o.knownActions,c=l[l.length-1],u=e._byClipCacheIndex;c._byClipCacheIndex=u,l[u]=c,l.pop(),e._byClipCacheIndex=null;const h=o.actionByRoot,d=(e._localRoot||this._root).uuid;delete h[d],l.length===0&&delete a[s],this._removeInactiveBindingsForAction(e)}_removeInactiveBindingsForAction(e){const t=e._propertyBindings;for(let n=0,r=t.length;n!==r;++n){const s=t[n];--s.referenceCount===0&&this._removeInactiveBinding(s)}}_lendAction(e){const t=this._actions,n=e._cacheIndex,r=this._nActiveActions++,s=t[r];e._cacheIndex=r,t[r]=e,s._cacheIndex=n,t[n]=s}_takeBackAction(e){const t=this._actions,n=e._cacheIndex,r=--this._nActiveActions,s=t[r];e._cacheIndex=r,t[r]=e,s._cacheIndex=n,t[n]=s}_addInactiveBinding(e,t,n){const r=this._bindingsByRootAndName,s=this._bindings;let a=r[t];a===void 0&&(a={},r[t]=a),a[n]=e,e._cacheIndex=s.length,s.push(e)}_removeInactiveBinding(e){const t=this._bindings,n=e.binding,r=n.rootNode.uuid,s=n.path,a=this._bindingsByRootAndName,o=a[r],l=t[t.length-1],c=e._cacheIndex;l._cacheIndex=c,t[c]=l,t.pop(),delete o[s],Object.keys(o).length===0&&delete a[r]}_lendBinding(e){const t=this._bindings,n=e._cacheIndex,r=this._nActiveBindings++,s=t[r];e._cacheIndex=r,t[r]=e,s._cacheIndex=n,t[n]=s}_takeBackBinding(e){const t=this._bindings,n=e._cacheIndex,r=--this._nActiveBindings,s=t[r];e._cacheIndex=r,t[r]=e,s._cacheIndex=n,t[n]=s}_lendControlInterpolant(){const e=this._controlInterpolants,t=this._nActiveControlInterpolants++;let n=e[t];return n===void 0&&(n=new Od(new Float32Array(2),new Float32Array(2),1,WE),n.__cacheIndex=t,e[t]=n),n}_takeBackControlInterpolant(e){const t=this._controlInterpolants,n=e.__cacheIndex,r=--this._nActiveControlInterpolants,s=t[r];e.__cacheIndex=r,t[r]=e,s.__cacheIndex=n,t[n]=s}clipAction(e,t,n){const r=t||this._root,s=r.uuid;let a=typeof e=="string"?ja.findByName(r,e):e;const o=a!==null?a.uuid:e,l=this._actionsByClip[o];let c=null;if(n===void 0&&(a!==null?n=a.blendMode:n=Rc),l!==void 0){const h=l.actionByRoot[s];if(h!==void 0&&h.blendMode===n)return h;c=l.knownActions[0],a===null&&(a=c._clip)}if(a===null)return null;const u=new c0(this,a,t,n);return this._bindAction(u,c),this._addInactiveAction(u,o,s),u}existingAction(e,t){const n=t||this._root,r=n.uuid,s=typeof e=="string"?ja.findByName(n,e):e,a=s?s.uuid:e,o=this._actionsByClip[a];return o!==void 0&&o.actionByRoot[r]||null}stopAllAction(){const e=this._actions,t=this._nActiveActions;for(let n=t-1;n>=0;--n)e[n].stop();return this}update(e){e*=this.timeScale;const t=this._actions,n=this._nActiveActions,r=this.time+=e,s=Math.sign(e),a=this._accuIndex^=1;for(let c=0;c!==n;++c)t[c]._update(r,e,s,a);const o=this._bindings,l=this._nActiveBindings;for(let c=0;c!==l;++c)o[c].apply(a);return this}setTime(e){this.time=0;for(let t=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(e)}getRoot(){return this._root}uncacheClip(e){const t=this._actions,n=e.uuid,r=this._actionsByClip,s=r[n];if(s!==void 0){const a=s.knownActions;for(let o=0,l=a.length;o!==l;++o){const c=a[o];this._deactivateAction(c);const u=c._cacheIndex,h=t[t.length-1];c._cacheIndex=null,c._byClipCacheIndex=null,h._cacheIndex=u,t[u]=h,t.pop(),this._removeInactiveBindingsForAction(c)}delete r[n]}}uncacheRoot(e){const t=e.uuid,n=this._actionsByClip;for(const a in n){const o=n[a].actionByRoot,l=o[t];l!==void 0&&(this._deactivateAction(l),this._removeInactiveAction(l))}const r=this._bindingsByRootAndName,s=r[t];if(s!==void 0)for(const a in s){const o=s[a];o.restoreOriginalState(),this._removeInactiveBinding(o)}}uncacheAction(e,t){const n=this.existingAction(e,t);n!==null&&(this._deactivateAction(n),this._removeInactiveAction(n))}}class qE extends _d{constructor(e=1,t=1,n=1,r={}){super(e,t,r),this.isRenderTarget3D=!0,this.depth=n,this.texture=new Nc(null,e,t,n),this._setTextureOptions(r),this.texture.isRenderTargetTexture=!0}}class Wd{constructor(e){this.value=e}clone(){return new Wd(this.value.clone===void 0?this.value:this.value.clone())}}let $E=0;class YE extends ii{constructor(){super(),this.isUniformsGroup=!0,Object.defineProperty(this,"id",{value:$E++}),this.name="",this.usage=Wa,this.uniforms=[]}add(e){return this.uniforms.push(e),this}remove(e){const t=this.uniforms.indexOf(e);return t!==-1&&this.uniforms.splice(t,1),this}setName(e){return this.name=e,this}setUsage(e){return this.usage=e,this}dispose(){this.dispatchEvent({type:"dispose"})}copy(e){this.name=e.name,this.usage=e.usage;const t=e.uniforms;this.uniforms.length=0;for(let n=0,r=t.length;n<r;n++){const s=Array.isArray(t[n])?t[n]:[t[n]];for(let a=0;a<s.length;a++)this.uniforms.push(s[a].clone())}return this}clone(){return new this.constructor().copy(this)}}class ZE extends Fc{constructor(e,t,n=1){super(e,t),this.isInstancedInterleavedBuffer=!0,this.meshPerAttribute=n}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}clone(e){const t=super.clone(e);return t.meshPerAttribute=this.meshPerAttribute,t}toJSON(e){const t=super.toJSON(e);return t.isInstancedInterleavedBuffer=!0,t.meshPerAttribute=this.meshPerAttribute,t}}class KE{constructor(e,t,n,r,s,a=!1){this.isGLBufferAttribute=!0,this.name="",this.buffer=e,this.type=t,this.itemSize=n,this.elementSize=r,this.count=s,this.normalized=a,this.version=0}set needsUpdate(e){e===!0&&this.version++}setBuffer(e){return this.buffer=e,this}setType(e,t){return this.type=e,this.elementSize=t,this}setItemSize(e){return this.itemSize=e,this}setCount(e){return this.count=e,this}}const Ip=new We;class u0{constructor(e,t,n=0,r=1/0){this.ray=new nr(e,t),this.near=n,this.far=r,this.camera=null,this.layers=new ao,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,t){t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):Oe("Raycaster:
5Unsupported camera type: "+t.type)}setFromXRController(e){return Ip.identity().extractRotation(e.matrixWorld),this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(Ip),this}intersectObject(e,t=!0,n=[]){return Th(e,this,n,t),n.sort(Pp),n}intersectObjects(e,t=!0,n=[]){for(let r=0,s=e.length;r<s;r++)Th(e[r],this,n,t);return n.sort(Pp),n}}function Pp(i,e){return i.distance-e.distance}function Th(i,e,t,n){let r=!0;if(i.layers.test(e.layers)&&i.raycast(e,t)===!1&&(r=!1),r===!0&&n===!0){const s=i.children;for(let a=0,o=s.length;a<o;a++)Th(s[a],e,t,!0)}}class h0{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1,_e("Clock: This module has been deprecated. Please use THREE.Timer instead.")}start(){this.startTime=performance.now(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=performance.now();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}class JE{constructor(e=1,t=0,n=0){this.radius=e,this.phi=t,this.theta=n}set(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){return this.phi=$e(this.phi,1e-6,Math.PI-1e-6),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,n){return this.radius=Math.sqrt(e*e+t*t+n*n),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,n),this.phi=Math.acos($e(t/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}class jE{constructor(e=1,t=0,n=0){this.radius=e,this.theta=t,this.y=n}set(e,t,n){return this.radius=e,this.theta=t,this.y=n,this}copy(e){return this.radius=e.radius,this.theta=e.theta,this.y=e.y,this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,n){return this.radius=Math.sqrt(e*e+n*n),this.theta=Math.atan2(e,n),this.y=t,this}clone(){return new this.constructor().copy(this)}}const af=class af{constructor(e,t,n,r){this.elements=[1,0,0,1],e!==void 0&&this.set(e,t,n,r)}identity(){return this.set(1,0,0,1),this}fromArray(e,t=0){for(let n=0;n<4;n++)this.elements[n]=e[n+t];return this}set(e,t,n,r){const s=this.elements;return s[0]=e,s[2]=t,s[1]=n,s[3]=r,this}};af.prototype.isMatrix2=!0;let wh=af;const Lp=new j;class QE{constructor(e=new j(1/0,1/0),t=new j(-1/0,-1/0)){this.isBox2=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const n=Lp.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}getCenter(e){return this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Lp).distanceTo(e)}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const Np=new P,el=new P,us=new P,hs=new P,Gu=new P,eT=new P,tT=new P;class nT{constructor(e=new P,t=new P){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){Np.subVectors(e,this.start),el.subVectors(this.end,this.start);const n=el.dot(el);if(n===0)return 0;let s=el.dot(Np)/n;
5return t&&(s=$e(s,0,1)),s}closestPointToPoint(e,t,n){const r=this.closestPointToPointParameter(e,t);return this.delta(n).multiplyScalar(r).add(this.start)}distanceSqToLine3(e,t=eT,n=tT){const r=10000000000000001e-32;let s,a;const o=this.start,l=e.start,c=this.end,u=e.end;us.subVectors(c,o),hs.subVectors(u,l),Gu.subVectors(o,l);const h=us.dot(us),d=hs.dot(hs),f=hs.dot(Gu);if(h<=r&&d<=r)return t.copy(o),n.copy(l),t.sub(n),t.dot(t);if(h<=r)s=0,a=f/d,a=$e(a,0,1);else{const p=us.dot(Gu);if(d<=r)a=0,s=$e(-p/h,0,1);else{const _=us.dot(hs),g=h*d-_*_;g!==0?s=$e((_*f-p*d)/g,0,1):s=0,a=(_*s+f)/d,a<0?(a=0,s=$e(-p/h,0,1)):a>1&&(a=1,s=$e((_-p)/h,0,1))}}return t.copy(o).addScaledVector(us,s),n.copy(l).addScaledVector(hs,a),t.distanceToSquared(n)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}const Dp=new P;class iT extends pt{constructor(e,t){super(),this.light=e,this.matrixAutoUpdate=!1,this.color=t,this.type="SpotLightHelper";const n=new et,r=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let a=0,o=1,l=32;a<l;a++,o++){const c=a/l*Math.PI*2,u=o/l*Math.PI*2;r.push(Math.cos(c),Math.sin(c),1,Math.cos(u),Math.sin(u),1)}n.setAttribute("position",new Pe(r,3));const s=new bn({fog:!1,toneMapped:!1});this.cone=new vi(n,s),this.add(this.cone),this.update()}dispose(){this.cone.geometry.dispose(),this.cone.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1),this.parent?(this.parent.updateWorldMatrix(!0),this.matrix.copy(this.parent.matrixWorld).invert().multiply(this.light.matrixWorld)):this.matrix.copy(this.light.matrixWorld),this.matrixWorld.copy(this.light.matrixWorld);const e=this.light.distance?this.light.distance:1e3,t=e*Math.tan(this.light.angle);this.cone.scale.set(t,t,e),Dp.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(Dp),this.color!==void 0?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}const Xi=new P,tl=new We,Wu=new We;class rT extends vi{constructor(e){const t=d0(e),n=new et,r=[],s=[];for(let c=0;c<t.length;c++){const u=t[c];u.parent&&u.parent.isBone&&(r.push(0,0,0),r.push(0,0,0),s.push(0,0,0),s.push(0,0,0))}n.setAttribute("position",new Pe(r,3)),n.setAttribute("color",new Pe(s,3));const a=new bn({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0});super(n,a),this.isSkeletonHelper=!0,this.type="SkeletonHelper",this.root=e,this.bones=t,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1;const o=new Ee(255),l=new Ee(65280);this.setColors(o,l)}updateMatrixWorld(e){const t=this.bones,n=this.geometry,r=n.getAttribute("position");Wu.copy(this.root.matrixWorld).invert();for(let s=0,a=0;s<t.length;s++){const o=t[s];o.parent&&o.parent.isBone&&(tl.multiplyMatrices(Wu,o.matrixWorld),Xi.setFromMatrixPosition(tl),r.setXYZ(a,Xi.x,Xi.y,Xi.z),tl.multiplyMatrices(Wu,o.parent.matrixWorld),Xi.setFromMatrixPosition(tl),r.setXYZ(a+1,Xi.x,Xi.y,Xi.z),a+=2)}n.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(e)}setColors(e,t){const r=this.geometry.getAttribute("color");for(let s=0;s<r.count;s+=2)r.setXYZ(s,e.r,e.g,e.b),r.setXYZ(s+1,t.r,t.g,t.b);return r.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}function d0(i){const e=[];i.isBone===!0&&e.push(i);for(let t=0;t<i.children.length;t++)e.push(...d0(i.children[t]));return e}class sT extends Dt{constructor(e,t,n){const r=new qs(t,4,2),s=new Oi({wireframe:!0,fog:!1,toneMapped:!1});super(r,s),this.light=e,this.color=n,this.type="PointLightHelper",this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}dispose(){this.geometry.dispose(),this.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.color!==void 0?this.material.color.set(this.color):this.material.color.copy(this.light.color)}}const aT=new P,Op=new Ee,Up=new Ee;class oT extends pt{constructor(e,t,n){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,this.type="HemisphereLightHelper";const r=new uo(t);r.rotateY(Math.PI*.5),this.material=new Oi({wireframe:!0,fog:!1,toneMapped:!1}),this.color===void 0&&(this.material.vertexColors=!0);const s=r.getAttribute("position"),a=new Float32Array(s.count*3);r.setAttribute("color",new ut(a,3)),this.add(new Dt(r,this.material)),this.update()}dispose(){this.children[0].geometry.dispose(),this.children[0].material.dispose()}update(){const e=this.children[0];if(this.color!==void 0)this.material.color.set(this.color);else{const t=e.geometry.getAttribute("color");Op.copy(this.light.color),Up.copy(this.light.groundColor);for(let n=0,r=t.count;n<r;n++){const s=n<r/2?Op:Up;t.setXYZ(n,s.r,s.g,s.b)}t.needsUpdate=!0}this.light.updateWorldMatrix(!0,!1),e.lookAt(aT.setFromMatrixPosition(this.light.matrixWorld).negate())}}class lT extends vi{constructor(e=10,t=10,n=4473924,r=8947848){n=new Ee(n),r=new Ee(r);const s=t/2,a=e/t,o=e/2,l=[],c=[];for(let d=0,f=0,p=-o;d<=t;
vendor: 2,839 bytes, line 5
5d++,p+=a){l.push(-o,0,p,o,0,p),l.push(p,0,-o,p,0,o);const _=d===s?n:r;_.toArray(c,f),f+=3,_.toArray(c,f),f+=3,_.toArray(c,f),f+=3,_.toArray(c,f),f+=3}const u=new et;u.setAttribute("position",new Pe(l,3)),u.setAttribute("color",new Pe(c,3));const h=new bn({vertexColors:!0,toneMapped:!1});super(u,h),this.type="GridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}class cT extends vi{constructor(e=10,t=16,n=8,r=64,s=4473924,a=8947848){s=new Ee(s),a=new Ee(a);const o=[],l=[];if(t>1)for(let h=0;h<t;h++){const d=h/t*(Math.PI*2),f=Math.sin(d)*e,p=Math.cos(d)*e;o.push(0,0,0),o.push(f,0,p);const _=h&1?s:a;l.push(_.r,_.g,_.b),l.push(_.r,_.g,_.b)}for(let h=0;h<n;h++){const d=h&1?s:a,f=e-e/n*h;for(let p=0;p<r;p++){let _=p/r*(Math.PI*2),g=Math.sin(_)*f,m=Math.cos(_)*f;o.push(g,0,m),l.push(d.r,d.g,d.b),_=(p+1)/r*(Math.PI*2),g=Math.sin(_)*f,m=Math.cos(_)*f,o.push(g,0,m),l.push(d.r,d.g,d.b)}}const c=new et;c.setAttribute("position",new Pe(o,3)),c.setAttribute("color",new Pe(l,3));const u=new bn({vertexColors:!0,toneMapped:!1});super(c,u),this.type="PolarGridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}const Fp=new P,nl=new P,Bp=new P;class uT extends pt{constructor(e,t,n){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,this.type="DirectionalLightHelper",t===void 0&&(t=1);let r=new et;r.setAttribute("position",new Pe([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));const s=new bn({fog:!1,toneMapped:!1});this.lightPlane=new ir(r,s),this.add(this.lightPlane),r=new et,r.setAttribute("position",new Pe([0,0,0,0,0,1],3)),this.targetLine=new ir(r,s),this.add(this.targetLine),this.update()}dispose(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1),Fp.setFromMatrixPosition(this.light.matrixWorld),nl.setFromMatrixPosition(this.light.target.matrixWorld),Bp.subVectors(nl,Fp),this.lightPlane.lookAt(nl),this.color!==void 0?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(nl),this.targetLine.scale.z=Bp.length()}}const il=new P,kt=new eu;class hT extends vi{constructor(e){const t=new et,n=new bn({color:16777215,vertexColors:!0,toneMapped:!1}),r=[],s=[],a={};o("n1","n2"),o("n2","n4"),o("n4","n3"),o("n3","n1"),o("f1","f2"),o("f2","f4"),o("f4","f3"),o("f3","f1"),o("n1","f1"),o("n2","f2"),o("n3","f3"),o("n4","f4"),o("p","n1"),o("p","n2"),o("p","n3"),o("p","n4"),o("u1","u2"),o("u2","u3"),o("u3","u1"),o("c","t"),o("p","c"),o("cn1","cn2"),o("cn3","cn4"),o("cf1","cf2"),o("cf3","cf4");function o(p,_){l(p),l(_)}
5function l(p){r.push(0,0,0),s.push(0,0,0),a[p]===void 0&&(a[p]=[]),a[p].push(r.length/3-1)}t.setAttribute("position",new Pe(r,3)),t.setAttribute("color",new Pe(s,3)),super(t,n),this.type="CameraHelper",this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=a,this.update();const c=new Ee(16755200),u=new Ee(16711680),h=new Ee(43775),d=new Ee(16777215),f=new Ee(3355443);this.setColors(c,u,h,d,f)}setColors(e,t,n,r,s){const o=this.geometry.getAttribute("color");return o.setXYZ(0,e.r,e.g,e.b),o.setXYZ(1,e.r,e.g,e.b),o.setXYZ(2,e.r,e.g,e.b),o.setXYZ(3,e.r,e.g,e.b),o.setXYZ(4,e.r,e.g,e.b),o.setXYZ(5,e.r,e.g,e.b),o.setXYZ(6,e.r,e.g,e.b),o.setXYZ(7,e.r,e.g,e.b),o.setXYZ(8,e.r,e.g,e.b),o.setXYZ(9,e.r,e.g,e.b),o.setXYZ(10,e.r,e.g,e.b),o.setXYZ(11,e.r,e.g,e.b),o.setXYZ(12,e.r,e.g,e.b),o.setXYZ(13,e.r,e.g,e.b),o.setXYZ(14,e.r,e.g,e.b),o.setXYZ(15,e.r,e.g,e.b),o.setXYZ(16,e.r,e.g,e.b),o.setXYZ(17,e.r,e.g,e.b),o.setXYZ(18,e.r,e.g,e.b),o.setXYZ(19,e.r,e.g,e.b),o.setXYZ(20,e.r,e.g,e.b),o.setXYZ(21,e.r,e.g,e.b),o.setXYZ(22,e.r,e.g,e.b),o.setXYZ(23,e.r,e.g,e.b),o.setXYZ(24,t.r,t.g,t.b),o.setXYZ(25,t.r,t.g,t.b),o.setXYZ(26,t.r,t.g,t.b),o.setXYZ(27,t.r,t.g,t.b),o.setXYZ(28,t.r,t.g,t.b),o.setXYZ(29,t.r,t.g,t.b),o.setXYZ(30,t.r,t.g,t.b),o.setXYZ(31,t.r,t.g,t.b),o.setXYZ(32,n.r,n.g,n.b),o.setXYZ(33,n.r,n.g,n.b),o.setXYZ(34,n.r,n.g,n.b),o.setXYZ(35,n.r,n.g,n.b),o.setXYZ(36,n.r,n.g,n.b),o.setXYZ(37,n.r,n.g,n.b),o.setXYZ(38,r.r,r.g,r.b),o.setXYZ(39,r.r,r.g,r.b),o.setXYZ(40,s.r,s.g,s.b),o.setXYZ(41,s.r,s.g,s.b),o.setXYZ(42,s.r,s.g,s.b),o.setXYZ(43,s.r,s.g,s.b),o.setXYZ(44,s.r,s.g,s.b),o.setXYZ(45,s.r,s.g,s.b),o.setXYZ(46,s.r,s.g,s.b),o.setXYZ(47,s.r,s.g,s.b),o.setXYZ(48,s.r,s.g,s.b),o.setXYZ(49,s.r,s.g,s.b),o.needsUpdate=!0,this}update(){const e=this.geometry,t=this.pointMap,n=1,r=1;let s,a;if(kt.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),this.camera.reversedDepth===!0)s=1,a=0;else if(this.camera.coordinateSystem===Un)s=-1,a=1;else if(this.camera.coordinateSystem===Ur)s=0,a=1;else throw new Error("THREE.CameraHelper.update(): Invalid coordinate system: "+this.camera.coordinateSystem);Gt("c",t,e,kt,0,0,s),Gt("t",t,e,kt,0,0,a),Gt("n1",t,e,kt,-n,-r,s),Gt("n2",t,e,kt,n,-r,s),Gt("n3",t,e,kt,-n,r,s),Gt("n4",t,e,kt,n,r,s),Gt("f1",t,e,kt,-n,-r,a),Gt("f2",t,e,kt,n,-r,a),Gt("f3",t,e,kt,-n,r,a),Gt("f4",t,e,kt,n,r,a),Gt("u1",t,e,kt,n*.7,r*1.1,s),Gt("u2",t,e,kt,-n*.7,r*1.1,s),Gt("u3",t,e,kt,0,r*2,s),Gt("cf1",t,e,kt,-n,0,a),Gt("cf2",t,e,kt,n,0,a),Gt("cf3",t,e,kt,0,-r,a),Gt("cf4",t,e,kt,0,r,a),Gt("cn1",t,e,kt,-n,0,s),Gt("cn2",t,e,kt,n,0,s),Gt("cn3",t,e,kt,0,-r,s),Gt("cn4",t,e,kt,0,r,s),e.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}function Gt(i,e,t,n,r,s,a){il.set(r,s,a).unproject(n);const o=e[i];if(o!==void 0){const l=t.getAttribute("position");for(let c=0,u=o.length;c<u;c++)l.setXYZ(o[c],il.x,il.y,il.z)}}const rl=new hn;class dT extends vi{constructor(e,t=16776960){const n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=new Float32Array(24),s=new et;s.setIndex(new ut(n,1)),s.setAttribute("position",new ut(r,3)),super(s,new bn({color:t,toneMapped:!1})),this.object=e,this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}update(){if(this.object!==void 0&&rl.setFromObject(this.object),rl.isEmpty())return;const e=rl.min,t=rl.max,n=this.geometry.attributes.position,r=n.array;r[0]=t.x,r[1]=t.y,r[2]=t.z,r[3]=e.x,r[4]=t.y,r[5]=t.z,r[6]=e.x,r[7]=e.y,r[8]=t.z,r[9]=t.x,r[10]=e.y,r[11]=t.z,r[12]=t.x,r[13]=t.y,r[14]=e.z,r[15]=e.x,r[16]=t.y,r[17]=e.z,r[18]=e.x,r[19]=e.y,r[20]=e.z,r[21]=t.x,r[22]=e.y,r[23]=e.z,n.needsUpdate=!0,this.geometry.computeBoundingSphere()}setFromObject(e){return this.object=e,this.update(),this}copy(e,t){return super.copy(e,t),this.object=e.object,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class fT extends vi{constructor(e,t=16776960){const n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=[1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],s=new et;s.setIndex(new ut(n,1)),s.setAttribute("position",new Pe(r,3)),super(s,new bn({color:t,toneMapped:!1})),this.box=e,this.type="Box3Helper",this.geometry.computeBoundingSphere()}updateMatrixWorld(e){const t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5),super.updateMatrixWorld(e))}dispose(){this.geometry.dispose(),this.material.dispose()}}class pT extends ir{constructor(e,t=1,n=16776960){const r=n,s=[1,-1,0,-1,1,0,-1,-1,0,1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],a=new et;a.setAttribute("position",new Pe(s,3)),a.computeBoundingSphere(),super(a,new bn({color:r,toneMapped:!1})),this.type="PlaneHelper",this.plane=e,this.size=t;const o=[1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],l=new et;l.setAttribute("position",new Pe(o,3)),l.computeBoundingSphere(),this.add(new Dt(l,new Oi({color:r,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1})))}updateMatrixWorld(e){this.position.set(0,0,0),this.scale.set(.5*this.size,.5*this.size,1),this.lookAt(this.plane.normal),this.translateZ(-this.plane.constant),super.updateMatrixWorld(e)}dispose(){this.geometry.dispose(),this.material.dispose(),this.children[0].geometry.dispose(),this.children[0].material.dispose()}}const kp=new P;let sl,Xu;class mT extends pt{constructor(e=new P(0,0,1),t=new P(0,0,0),n=1,r=16776960,s=n*.2,a=s*.2){super(),this.type="ArrowHelper",sl===void 0&&(sl=new et,sl.setAttribute("position",new Pe([0,0,0,0,1,0],3)),Xu=new co(.5,1,5,1),Xu.translate(0,-.5,0)),this.position.copy(t),this.line=new ir(sl,new bn({color:r,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new Dt(Xu,new Oi({color:r,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(n,s,a)}setDirection(e){if(e.y>.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{kp.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(kp,t)}}setLength(e,t=e*.2,n=t*.2){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(n,t,n),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class gT extends vi{constructor(e=1){const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],n=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],r=new et;r.setAttribute("position",new Pe(t,3)),r.setAttribute("color",new Pe(n,3));const s=new bn({vertexColors:!0,toneMapped:!1});super(r,s),this.type="AxesHelper"}
vendor: 10,194 bytes, lines 5-64
5setColors(e,t,n){const r=new Ee,s=this.geometry.attributes.color.array;return r.set(e),r.toArray(s,0),r.toArray(s,3),r.set(t),r.toArray(s,6),r.toArray(s,9),r.set(n),r.toArray(s,12),r.toArray(s,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class _T{constructor(){this.type="ShapePath",this.color=new Ee,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new hc,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,n,r){return this.currentPath.quadraticCurveTo(e,t,n,r),this}bezierCurveTo(e,t,n,r,s,a){return this.currentPath.bezierCurveTo(e,t,n,r,s,a),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function t(m){const v=[];for(let b=0,y=m.length;b<y;b++){const T=m[b],S=new Lr;S.curves=T.curves,v.push(S)}return v}function n(m,v){const b=v.length;let y=!1;for(let T=b-1,S=0;S<b;T=S++){let R=v[T],x=v[S],M=x.x-R.x,A=x.y-R.y;if(Math.abs(A)>Number.EPSILON){if(A<0&&(R=v[S],M=-M,x=v[T],A=-A),m.y<R.y||m.y>x.y)continue;if(m.y===R.y){if(m.x===R.x)return!0}else{const I=A*(m.x-R.x)-M*(m.y-R.y);if(I===0)return!0;if(I<0)continue;y=!y}}else{if(m.y!==R.y)continue;if(x.x<=m.x&&m.x<=R.x||R.x<=m.x&&m.x<=x.x)return!0}}return y}const r=Qn.isClockWise,s=this.subPaths;if(s.length===0)return[];let a,o,l;const c=[];if(s.length===1)return o=s[0],l=new Lr,l.curves=o.curves,c.push(l),c;let u=!r(s[0].getPoints());u=e?!u:u;const h=[],d=[];let f=[],p=0,_;d[p]=void 0,f[p]=[];for(let m=0,v=s.length;m<v;m++)o=s[m],_=o.getPoints(),a=r(_),a=e?!a:a,a?(!u&&d[p]&&p++,d[p]={s:new Lr,p:_},d[p].s.curves=o.curves,u&&p++,f[p]=[]):f[p].push({h:o,p:_[0]});if(!d[0])return t(s);if(d.length>1){let m=!1,v=0;for(let b=0,y=d.length;b<y;b++)h[b]=[];for(let b=0,y=d.length;b<y;b++){const T=f[b];for(let S=0;S<T.length;S++){const R=T[S];let x=!0;for(let M=0;M<d.length;M++)n(R.p,d[M].p)&&(b!==M&&v++,x?(x=!1,h[M].push(R)):m=!0);x&&h[b].push(R)}}v>0&&m===!1&&(f=h)}let g;for(let m=0,v=d.length;m<v;m++){l=d[m].s,c.push(l),g=f[m];for(let b=0,y=g.length;b<y;b++)l.holes.push(g[b].h)}return c}}class vT extends ii{constructor(e,t=null){super(),this.object=e,this.domElement=t,this.enabled=!0,this.state=-1,this.keys={},this.mouseButtons={LEFT:null,MIDDLE:null,RIGHT:null},this.touches={ONE:null,TWO:null}}connect(e){if(e===void 0){_e("Controls: connect() now requires an element.");return}this.domElement!==null&&this.disconnect(),this.domElement=e}disconnect(){}dispose(){}update(){}}function xT(i,e){const t=i.image&&i.image.width?i.image.width/i.image.height:1;return t>e?(i.repeat.x=1,i.repeat.y=t/e,i.offset.x=0,i.offset.y=(1-i.repeat.y)/2):(i.repeat.x=e/t,i.repeat.y=1,i.offset.x=(1-i.repeat.x)/2,i.offset.y=0),i}function yT(i,e){const t=i.image&&i.image.width?i.image.width/i.image.height:1;return t>e?(i.repeat.x=e/t,i.repeat.y=1,i.offset.x=(1-i.repeat.x)/2,i.offset.y=0):(i.repeat.x=1,i.repeat.y=t/e,i.offset.x=0,i.offset.y=(1-i.repeat.y)/2),i}function bT(i){return i.repeat.x=1,i.repeat.y=1,i.offset.x=0,i.offset.y=0,i}function Ah(i,e,t,n){const r=ST(n);switch(t){case fd:return i*e;case wc:return i*e/r.components*r.byteLength;case so:return i*e/r.components*r.byteLength;case er:return i*e*2/r.components*r.byteLength;case Ac:return i*e*2/r.components*r.byteLength;case pd:return i*e*3/r.components*r.byteLength;case xn:return i*e*4/r.components*r.byteLength;case Cc:return i*e*4/r.components*r.byteLength;case Ma:case Ea:return Math.floor((i+3)/4)*Math.floor((e+3)/4)*8;case Ta:case wa:return Math.floor((i+3)/4)*Math.floor((e+3)/4)*16;case Il:case Ll:return Math.max(i,16)*Math.max(e,8)/4;case Rl:case Pl:return Math.max(i,8)*Math.max(e,8)/2;case Nl:case Dl:case Ul:case Fl:return Math.floor((i+3)/4)*Math.floor((e+3)/4)*8;case Ol:case Ba:case Bl:return Math.floor((i+3)/4)*Math.floor((e+3)/4)*16;case kl:return Math.floor((i+3)/4)*Math.floor((e+3)/4)*16;case Vl:return Math.floor((i+4)/5)*Math.floor((e+3)/4)*16;case zl:return Math.floor((i+4)/5)*Math.floor((e+4)/5)*16;case Hl:return Math.floor((i+5)/6)*Math.floor((e+4)/5)*16;case Gl:return Math.floor((i+5)/6)*Math.floor((e+5)/6)*16;case Wl:return Math.floor((i+7)/8)*Math.floor((e+4)/5)*16;case Xl:return Math.floor((i+7)/8)*Math.floor((e+5)/6)*16;case ql:return Math.floor((i+7)/8)*Math.floor((e+7)/8)*16;case $l:return Math.floor((i+9)/10)*Math.floor((e+4)/5)*16;case Yl:return Math.floor((i+9)/10)*Math.floor((e+5)/6)*16;case Zl:return Math.floor((i+9)/10)*Math.floor((e+7)/8)*16;case Kl:return Math.floor((i+9)/10)*Math.floor((e+9)/10)*16;case Jl:return Math.floor((i+11)/12)*Math.floor((e+9)/10)*16;case jl:return Math.floor((i+11)/12)*Math.floor((e+11)/12)*16;case Ql:case ec:case tc:return Math.ceil(i/4)*Math.ceil(e/4)*16;case nc:case ic:return Math.ceil(i/4)*Math.ceil(e/4)*8;case ka:case rc:return Math.ceil(i/4)*Math.ceil(e/4)*16}throw new Error(`Unable to determine texture byte length for ${t} format.`)}function ST(i){switch(i){case wn:case cd:return{byteLength:1,components:1};case Is:case ud:case gi:return{byteLength:2,components:1};case Ec:case Tc:return{byteLength:2,components:4};case Gn:case Mc:case vn:return{byteLength:4,components:1};case hd:case dd:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${i}.`)}class MT{static contain(e,t){return xT(e,t)}static cover(e,t){return yT(e,t)}static fill(e){return bT(e)}static getByteLength(e,t,n,r){return Ah(e,t,n,r)}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:io}}));typeof window<"u"&&(window.__THREE__?_e("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=io);function f0(){let i=null,e=!1,t=null,n=null;function r(s,a){t(s,a),n=i.requestAnimationFrame(r)}return{start:function(){e!==!0&&t!==null&&i!==null&&(n=i.requestAnimationFrame(r),e=!0)},stop:function(){i!==null&&i.cancelAnimationFrame(n),e=!1},setAnimationLoop:function(s){t=s},setContext:function(s){i=s}}}function ET(i){const e=new WeakMap;function t(o,l){const c=o.array,u=o.usage,h=c.byteLength,d=i.createBuffer();i.bindBuffer(l,d),i.bufferData(l,c,u),o.onUploadCallback();let f;if(c instanceof Float32Array)f=i.FLOAT;else if(typeof Float16Array<"u"&&c instanceof Float16Array)f=i.HALF_FLOAT;else if(c instanceof Uint16Array)o.isFloat16BufferAttribute?f=i.HALF_FLOAT:f=i.UNSIGNED_SHORT;else if(c instanceof Int16Array)f=i.SHORT;else if(c instanceof Uint32Array)f=i.UNSIGNED_INT;else if(c instanceof Int32Array)f=i.INT;else if(c instanceof Int8Array)f=i.BYTE;else if(c instanceof Uint8Array)f=i.UNSIGNED_BYTE;else if(c instanceof Uint8ClampedArray)f=i.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+c);return{buffer:d,type:f,bytesPerElement:c.BYTES_PER_ELEMENT,version:o.version,size:h}}function n(o,l,c){const u=l.array,h=l.updateRanges;if(i.bindBuffer(c,o),h.length===0)i.bufferSubData(c,0,u);else{h.sort((f,p)=>f.start-p.start);let d=0;for(let f=1;f<h.length;f++){const p=h[d],_=h[f];_.start<=p.start+p.count+1?p.count=Math.max(p.count,_.start+_.count-p.start):(++d,h[d]=_)}h.length=d+1;for(let f=0,p=h.length;f<p;f++){const _=h[f];i.bufferSubData(c,_.start*u.BYTES_PER_ELEMENT,u,_.start,_.count)}l.clearUpdateRanges()}l.onUploadCallback()}function r(o){return o.isInterleavedBufferAttribute&&(o=o.data),e.get(o)}function s(o){o.isInterleavedBufferAttribute&&(o=o.data);const l=e.get(o);l&&(i.deleteBuffer(l.buffer),e.delete(o))}function a(o,l){if(o.isInterleavedBufferAttribute&&(o=o.data),o.isGLBufferAttribute){const u=e.get(o);(!u||u.version<o.version)&&e.set(o,{buffer:o.buffer,type:o.type,bytesPerElement:o.elementSize,version:o.version});return}const c=e.get(o);if(c===void 0)e.set(o,t(o,l));else if(c.version<o.version){if(c.size!==o.array.byteLength)throw new Error("THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.");n(c.buffer,o,l),c.version=o.version}}return{get:r,remove:s,update:a}}var TT=`#ifdef USE_ALPHAHASH 6 if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard; 7#endif`,wT=`#ifdef USE_ALPHAHASH 8 const float ALPHA_HASH_SCALE = 0.05; 9 float hash2D( vec2 value ) { 10 return fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) ); 11 } 12 float hash3D( vec3 value ) { 13 return hash2D( vec2( hash2D( value.xy ), value.z ) ); 14 } 15 float getAlphaHashThreshold( vec3 position ) { 16 float maxDeriv = max( 17 length( dFdx( position.xyz ) ), 18 length( dFdy( position.xyz ) ) 19 ); 20 float pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv ); 21 vec2 pixScales = vec2( 22 exp2( floor( log2( pixScale ) ) ), 23 exp2( ceil( log2( pixScale ) ) ) 24 ); 25 vec2 alpha = vec2( 26 hash3D( floor( pixScales.x * position.xyz ) ), 27 hash3D( floor( pixScales.y * position.xyz ) ) 28 ); 29 float lerpFactor = fract( log2( pixScale ) ); 30 float x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y; 31 float a = min( lerpFactor, 1.0 - lerpFactor ); 32 vec3 cases = vec3( 33 x * x / ( 2.0 * a * ( 1.0 - a ) ), 34 ( x - 0.5 * a ) / ( 1.0 - a ), 35 1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) ) 36 ); 37 float threshold = ( x < ( 1.0 - a ) ) 38 ? ( ( x < a ) ? cases.x : cases.y ) 39 : cases.z; 40 return clamp( threshold , 1.0e-6, 1.0 ); 41 } 42#endif`,AT=`#ifdef USE_ALPHAMAP 43 diffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g; 44#endif`,CT=`#ifdef USE_ALPHAMAP 45 uniform sampler2D alphaMap; 46#endif`,RT=`#ifdef USE_ALPHATEST 47 #ifdef ALPHA_TO_COVERAGE 48 diffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a ); 49 if ( diffuseColor.a == 0.0 ) discard; 50 #else 51 if ( diffuseColor.a < alphaTest ) discard; 52 #endif 53#endif`,IT=`#ifdef USE_ALPHATEST 54 uniform float alphaTest; 55#endif`,PT=`#ifdef USE_AOMAP 56 float ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0; 57 reflectedLight.indirectDiffuse *= ambientOcclusion; 58 #if defined( USE_CLEARCOAT ) 59 clearcoatSpecularIndirect *= ambientOcclusion; 60 #endif 61 #if defined( USE_SHEEN ) 62 sheenSpecularIndirect *= ambientOcclusion; 63 #endif 64 #if defined( USE_ENVMAP ) && defined( STANDARD )
65 float dotNV = saturate( dot( geometryNormal, geometryViewDir ) ); 66 reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness ); 67 #endif 68#endif`,LT=`#ifdef USE_AOMAP 69 uniform sampler2D aoMap; 70 uniform float aoMapIntensity; 71#endif`,NT=`#ifdef USE_BATCHING 72 #if ! defined( GL_ANGLE_multi_draw ) 73 #define gl_DrawID _gl_DrawID 74 uniform int _gl_DrawID; 75 #endif 76 uniform highp sampler2D batchingTexture; 77 uniform highp usampler2D batchingIdTexture; 78 mat4 getBatchingMatrix( const in float i ) { 79 int size = textureSize( batchingTexture, 0 ).x; 80 int j = int( i ) * 4; 81 int x = j % size; 82 int y = j / size; 83 vec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 ); 84 vec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 ); 85 vec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 ); 86 vec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 ); 87 return mat4( v1, v2, v3, v4 ); 88 } 89 float getIndirectIndex( const in int i ) { 90 int size = textureSize( batchingIdTexture, 0 ).x; 91 int x = i % size; 92 int y = i / size; 93 return float( texelFetch( batchingIdTexture, ivec2( x, y ), 0 ).r ); 94 } 95#endif 96#ifdef USE_BATCHING_COLOR 97 uniform sampler2D batchingColorTexture; 98 vec4 getBatchingColor( const in float i ) { 99 int size = textureSize( batchingColorTexture, 0 ).x; 100 int j = int( i ); 101 int x = j % size; 102 int y = j / size; 103 return texelFetch( batchingColorTexture, ivec2( x, y ), 0 ); 104 } 105#endif`,DT=`#ifdef USE_BATCHING 106 mat4 batchingMatrix = getBatchingMatrix( getIndirectIndex( gl_DrawID ) ); 107#endif`,OT=`vec3 transformed = vec3( position ); 108#ifdef USE_ALPHAHASH 109 vPosition = vec3( position ); 110#endif`,UT=`vec3 objectNormal = vec3( normal ); 111#ifdef USE_TANGENT 112 vec3 objectTangent = vec3( tangent.xyz ); 113#endif`,FT=`float G_BlinnPhong_Implicit( ) { 114 return 0.25; 115} 116float D_BlinnPhong( const in float shininess, const in float dotNH ) { 117 return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess ); 118} 119vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) { 120 vec3 halfDir = normalize( lightDir + viewDir ); 121 float dotNH = saturate( dot( normal, halfDir ) ); 122 float dotVH = saturate( dot( viewDir, halfDir ) ); 123 vec3 F = F_Schlick( specularColor, 1.0, dotVH ); 124 float G = G_BlinnPhong_Implicit( ); 125 float D = D_BlinnPhong( shininess, dotNH ); 126 return F * ( G * D ); 127} // validated`,BT=`#ifdef USE_IRIDESCENCE 128 const mat3 XYZ_TO_REC709 = mat3( 129 3.2404542, -0.9692660, 0.0556434, 130 -1.5371385, 1.8760108, -0.2040259, 131 -0.4985314, 0.0415560, 1.0572252 132 ); 133 vec3 Fresnel0ToIor( vec3 fresnel0 ) { 134 vec3 sqrtF0 = sqrt( fresnel0 ); 135 return ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 ); 136 } 137 vec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) { 138 return pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) ); 139 } 140 float IorToFresnel0( float transmittedIor, float incidentIor ) { 141 return pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor )); 142 } 143 vec3 evalSensitivity( float OPD, vec3 shift ) { 144 float phase = 2.0 * PI * OPD * 1.0e-9; 145 vec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 ); 146 vec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 ); 147 vec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 ); 148 vec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var ); 149 xyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) ); 150 xyz /= 1.0685e-7; 151 vec3 rgb = XYZ_TO_REC709 * xyz; 152 return rgb; 153 } 154 vec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) { 155 vec3 I; 156 float iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) ); 157 float sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) ); 158 float cosTheta2Sq = 1.0 - sinTheta2Sq; 159 if ( cosTheta2Sq < 0.0 ) { 160 return vec3( 1.0 ); 161 } 162 float cosTheta2 = sqrt( cosTheta2Sq ); 163 float R0 = IorToFresnel0( iridescenceIOR, outsideIOR );
164 float R12 = F_Schlick( R0, 1.0, cosTheta1 ); 165 float T121 = 1.0 - R12; 166 float phi12 = 0.0; 167 if ( iridescenceIOR < outsideIOR ) phi12 = PI; 168 float phi21 = PI - phi12; 169 vec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) ); vec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR ); 170 vec3 R23 = F_Schlick( R1, 1.0, cosTheta2 ); 171 vec3 phi23 = vec3( 0.0 ); 172 if ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI; 173 if ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI; 174 if ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI; 175 float OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2; 176 vec3 phi = vec3( phi21 ) + phi23; 177 vec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 ); 178 vec3 r123 = sqrt( R123 ); 179 vec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 ); 180 vec3 C0 = R12 + Rs; 181 I = C0; 182 vec3 Cm = Rs - T121; 183 for ( int m = 1; m <= 2; ++ m ) { 184 Cm *= r123; 185 vec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi ); 186 I += Cm * Sm; 187 } 188 return max( I, vec3( 0.0 ) ); 189 } 190#endif`,kT=`#ifdef USE_BUMPMAP 191 uniform sampler2D bumpMap; 192 uniform float bumpScale; 193 vec2 dHdxy_fwd() { 194 vec2 dSTdx = dFdx( vBumpMapUv ); 195 vec2 dSTdy = dFdy( vBumpMapUv ); 196 float Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x; 197 float dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll; 198 float dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll; 199 return vec2( dBx, dBy ); 200 } 201 vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) { 202 vec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) ); 203 vec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) ); 204 vec3 vN = surf_norm; 205 vec3 R1 = cross( vSigmaY, vN ); 206 vec3 R2 = cross( vN, vSigmaX ); 207 float fDet = dot( vSigmaX, R1 ) * faceDirection; 208 vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 ); 209 return normalize( abs( fDet ) * surf_norm - vGrad ); 210 } 211#endif`,VT=`#if NUM_CLIPPING_PLANES > 0 212 vec4 plane; 213 #ifdef ALPHA_TO_COVERAGE 214 float distanceToPlane, distanceGradient; 215 float clipOpacity = 1.0; 216 #pragma unroll_loop_start 217 for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { 218 plane = clippingPlanes[ i ]; 219 distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; 220 distanceGradient = fwidth( distanceToPlane ) / 2.0; 221 clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); 222 if ( clipOpacity == 0.0 ) discard; 223 } 224 #pragma unroll_loop_end 225 #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES 226 float unionClipOpacity = 1.0; 227 #pragma unroll_loop_start 228 for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { 229 plane = clippingPlanes[ i ]; 230 distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w; 231 distanceGradient = fwidth( distanceToPlane ) / 2.0; 232 unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane ); 233 } 234 #pragma unroll_loop_end 235 clipOpacity *= 1.0 - unionClipOpacity; 236 #endif 237 diffuseColor.a *= clipOpacity; 238 if ( diffuseColor.a == 0.0 ) discard; 239 #else 240 #pragma unroll_loop_start 241 for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { 242 plane = clippingPlanes[ i ]; 243 if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard; 244 } 245 #pragma unroll_loop_end 246 #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES 247 bool clipped = true; 248 #pragma unroll_loop_start 249 for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { 250 plane = clippingPlanes[ i ]; 251 clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped; 252 } 253 #pragma unroll_loop_end 254 if ( clipped ) discard; 255 #endif 256 #endif 257#endif`,zT=`#if NUM_CLIPPING_PLANES > 0 258 varying vec3 vClipPosition; 259 uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; 260#endif`,HT=`#if NUM_CLIPPING_PLANES > 0 261 varying vec3 vClipPosition; 262#endif`,GT=`#if NUM_CLIPPING_PLANES > 0 263 vClipPosition = - mvPosition.xyz; 264#endif`,WT=`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA ) 265 diffuseColor *= vColor; 266#endif`,XT=`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA ) 267 varying vec4 vColor; 268#endif`,qT=`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) 269 varying vec4 vColor; 270#endif`,$T=`#if defined( USE_COLOR ) || defined( USE_COLOR_ALPHA ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR ) 271 vColor = vec4( 1.0 ); 272#endif 273#ifdef USE_COLOR_ALPHA 274 vColor *= color; 275#elif defined( USE_COLOR ) 276 vColor.rgb *= color; 277#endif 278#ifdef USE_INSTANCING_COLOR 279 vColor.rgb *= instanceColor.rgb; 280#endif 281#ifdef USE_BATCHING_COLOR 282 vColor *= getBatchingColor( getIndirectIndex( gl_DrawID ) ); 283#endif`,YT=`#define PI 3.141592653589793 284#define PI2 6.283185307179586 285#define PI_HALF 1.5707963267948966 286#define RECIPROCAL_PI 0.3183098861837907 287#define RECIPROCAL_PI2 0.15915494309189535 288#define EPSILON 1e-6 289#ifndef saturate 290#define saturate( a ) clamp( a, 0.0, 1.0 ) 291#endif 292#define whiteComplement( a ) ( 1.0 - saturate( a ) ) 293float pow2( const in float x ) { return x*x; } 294vec3 pow2( const in vec3 x ) { return x*x; } 295float pow3( const in float x ) { return x*x*x; } 296float pow4( const in float x ) { float x2 = x*x; return x2*x2; } 297float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); } 298float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); } 299highp float rand( const in vec2 uv ) { 300 const highp float a = 12.9898, b = 78.233, c = 43758.5453; 301 highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI ); 302 return fract( sin( sn ) * c ); 303} 304#ifdef HIGH_PRECISION 305 float precisionSafeLength( vec3 v ) { return length( v ); } 306#else 307 float precisionSafeLength( vec3 v ) { 308 float maxComponent = max3( abs( v ) ); 309 return length( v / maxComponent ) * maxComponent; 310 } 311#endif 312struct IncidentLight { 313 vec3 color; 314 vec3 direction; 315 bool visible; 316}; 317struct ReflectedLight { 318 vec3 directDiffuse; 319 vec3 directSpecular; 320 vec3 indirectDiffuse; 321 vec3 indirectSpecular; 322}; 323#ifdef USE_ALPHAHASH 324 varying vec3 vPosition; 325#endif 326vec3 transformDirection( in vec3 dir, in mat4 matrix ) { 327 return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); 328} 329vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) { 330 return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz ); 331} 332bool isPerspectiveMatrix( mat4 m ) { 333 return m[ 2 ][ 3 ] == - 1.0; 334} 335vec2 equirectUv( in vec3 dir ) { 336 float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; 337 float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; 338 return vec2( u, v ); 339}
340vec3 BRDF_Lambert( const in vec3 diffuseColor ) { 341 return RECIPROCAL_PI * diffuseColor; 342} 343vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) { 344 float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); 345 return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); 346} 347float F_Schlick( const in float f0, const in float f90, const in float dotVH ) { 348 float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); 349 return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); 350} // validated`,ZT=`#ifdef ENVMAP_TYPE_CUBE_UV 351 #define cubeUV_minMipLevel 4.0 352 #define cubeUV_minTileSize 16.0 353 float getFace( vec3 direction ) { 354 vec3 absDirection = abs( direction ); 355 float face = - 1.0; 356 if ( absDirection.x > absDirection.z ) { 357 if ( absDirection.x > absDirection.y ) 358 face = direction.x > 0.0 ? 0.0 : 3.0; 359 else 360 face = direction.y > 0.0 ? 1.0 : 4.0; 361 } else { 362 if ( absDirection.z > absDirection.y ) 363 face = direction.z > 0.0 ? 2.0 : 5.0; 364 else 365 face = direction.y > 0.0 ? 1.0 : 4.0; 366 } 367 return face; 368 } 369 vec2 getUV( vec3 direction, float face ) { 370 vec2 uv; 371 if ( face == 0.0 ) { 372 uv = vec2( direction.z, direction.y ) / abs( direction.x ); 373 } else if ( face == 1.0 ) { 374 uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); 375 } else if ( face == 2.0 ) { 376 uv = vec2( - direction.x, direction.y ) / abs( direction.z ); 377 } else if ( face == 3.0 ) { 378 uv = vec2( - direction.z, direction.y ) / abs( direction.x ); 379 } else if ( face == 4.0 ) { 380 uv = vec2( - direction.x, direction.z ) / abs( direction.y ); 381 } else { 382 uv = vec2( direction.x, direction.y ) / abs( direction.z ); 383 } 384 return 0.5 * ( uv + 1.0 ); 385 } 386 vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) { 387 float face = getFace( direction ); 388 float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 ); 389 mipInt = max( mipInt, cubeUV_minMipLevel ); 390 float faceSize = exp2( mipInt ); 391 highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0; 392 if ( face > 2.0 ) { 393 uv.y += faceSize; 394 face -= 3.0; 395 } 396 uv.x += face * faceSize; 397 uv.x += filterInt * 3.0 * cubeUV_minTileSize; 398 uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize ); 399 uv.x *= CUBEUV_TEXEL_WIDTH; 400 uv.y *= CUBEUV_TEXEL_HEIGHT; 401 #ifdef texture2DGradEXT 402 return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb; 403 #else 404 return texture2D( envMap, uv ).rgb; 405 #endif 406 } 407 #define cubeUV_r0 1.0 408 #define cubeUV_m0 - 2.0 409 #define cubeUV_r1 0.8 410 #define cubeUV_m1 - 1.0 411 #define cubeUV_r4 0.4 412 #define cubeUV_m4 2.0 413 #define cubeUV_r5 0.305 414 #define cubeUV_m5 3.0 415 #define cubeUV_r6 0.21 416 #define cubeUV_m6 4.0 417 float roughnessToMip( float roughness ) { 418 float mip = 0.0; 419 if ( roughness >= cubeUV_r1 ) { 420 mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0; 421 } else if ( roughness >= cubeUV_r4 ) { 422 mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1; 423 } else if ( roughness >= cubeUV_r5 ) { 424 mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4; 425 } else if ( roughness >= cubeUV_r6 ) { 426 mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5; 427 } else { 428 mip = - 2.0 * log2( 1.16 * roughness ); } 429 return mip; 430 } 431 vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) { 432 float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP ); 433 float mipF = fract( mip ); 434 float mipInt = floor( mip ); 435 vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt ); 436 if ( mipF == 0.0 ) { 437 return vec4( color0, 1.0 ); 438 } else { 439 vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 ); 440 return vec4( mix( color0, color1, mipF ), 1.0 ); 441 } 442 } 443#endif`,KT=`vec3 transformedNormal = objectNormal; 444#ifdef USE_TANGENT 445 vec3 transformedTangent = objectTangent; 446#endif 447#ifdef USE_BATCHING 448 mat3 bm = mat3( batchingMatrix ); 449 transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) ); 450 transformedNormal = bm * transformedNormal; 451 #ifdef USE_TANGENT 452 transformedTangent = bm * transformedTangent; 453 #endif 454#endif 455#ifdef USE_INSTANCING 456 mat3 im = mat3( instanceMatrix ); 457 transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) ); 458 transformedNormal = im * transformedNormal; 459 #ifdef USE_TANGENT 460 transformedTangent = im * transformedTangent; 461 #endif 462#endif 463transformedNormal = normalMatrix * transformedNormal; 464#ifdef FLIP_SIDED 465 transformedNormal = - transformedNormal; 466#endif 467#ifdef USE_TANGENT 468 transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz; 469 #ifdef FLIP_SIDED 470 transformedTangent = - transformedTangent; 471 #endif 472#endif`,JT=`#ifdef USE_DISPLACEMENTMAP 473 uniform sampler2D displacementMap; 474 uniform float displacementScale; 475 uniform float displacementBias; 476#endif`,jT=`#ifdef USE_DISPLACEMENTMAP 477 transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + dis
477placementBias ); 478#endif`,QT=`#ifdef USE_EMISSIVEMAP 479 vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); 480 #ifdef DECODE_VIDEO_TEXTURE_EMISSIVE 481 emissiveColor = sRGBTransferEOTF( emissiveColor ); 482 #endif 483 totalEmissiveRadiance *= emissiveColor.rgb; 484#endif`,ew=`#ifdef USE_EMISSIVEMAP 485 uniform sampler2D emissiveMap; 486#endif`,tw="gl_FragColor = linearToOutputTexel( gl_FragColor );",nw=`vec4 LinearTransferOETF( in vec4 value ) { 487 return value; 488} 489vec4 sRGBTransferEOTF( in vec4 value ) { 490 return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a ); 491} 492vec4 sRGBTransferOETF( in vec4 value ) { 493 return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a ); 494}`,iw=`#ifdef USE_ENVMAP 495 #ifdef ENV_WORLDPOS 496 vec3 cameraToFrag; 497 if ( isOrthographic ) { 498 cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); 499 } else { 500 cameraToFrag = normalize( vWorldPosition - cameraPosition ); 501 } 502 vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); 503 #ifdef ENVMAP_MODE_REFLECTION 504 vec3 reflectVec = reflect( cameraToFrag, worldNormal ); 505 #else 506 vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio ); 507 #endif 508 #else 509 vec3 reflectVec = vReflect; 510 #endif 511 #ifdef ENVMAP_TYPE_CUBE 512 vec4 envColor = textureCube( envMap, envMapRotation * reflectVec ); 513 #ifdef ENVMAP_BLENDING_MULTIPLY 514 outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); 515 #elif defined( ENVMAP_BLENDING_MIX ) 516 outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); 517 #elif defined( ENVMAP_BLENDING_ADD ) 518 outgoingLight += envColor.xyz * specularStrength * reflectivity; 519 #endif 520 #endif 521#endif`,rw=`#ifdef USE_ENVMAP 522 uniform float envMapIntensity; 523 uniform mat3 envMapRotation; 524 #ifdef ENVMAP_TYPE_CUBE 525 uniform samplerCube envMap; 526 #else 527 uniform sampler2D envMap; 528 #endif 529#endif`,sw=`#ifdef USE_ENVMAP 530 uniform float reflectivity; 531 #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) 532 #define ENV_WORLDPOS 533 #endif 534 #ifdef ENV_WORLDPOS 535 varying vec3 vWorldPosition; 536 uniform float refractionRatio; 537 #else 538 varying vec3 vReflect; 539 #endif 540#endif`,aw=`#ifdef USE_ENVMAP 541 #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) 542 #define ENV_WORLDPOS 543 #endif 544 #ifdef ENV_WORLDPOS 545 546 varying vec3 vWorldPosition; 547 #else 548 varying vec3 vReflect; 549 uniform float refractionRatio; 550 #endif 551#endif`,ow=`#ifdef USE_ENVMAP 552 #ifdef ENV_WORLDPOS 553 vWorldPosition = worldPosition.xyz; 554 #else 555 vec3 cameraToVertex; 556 if ( isOrthographic ) { 557 cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); 558 } else {
559 cameraToVertex = normalize( worldPosition.xyz - cameraPosition ); 560 } 561 vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); 562 #ifdef ENVMAP_MODE_REFLECTION 563 vReflect = reflect( cameraToVertex, worldNormal ); 564 #else 565 vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); 566 #endif 567 #endif 568#endif`,lw=`#ifdef USE_FOG 569 vFogDepth = - mvPosition.z; 570#endif`,cw=`#ifdef USE_FOG 571 varying float vFogDepth; 572#endif`,uw=`#ifdef USE_FOG 573 #ifdef FOG_EXP2 574 float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth ); 575 #else 576 float fogFactor = smoothstep( fogNear, fogFar, vFogDepth ); 577 #endif 578 gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); 579#endif`,hw=`#ifdef USE_FOG 580 uniform vec3 fogColor; 581 varying float vFogDepth; 582 #ifdef FOG_EXP2 583 uniform float fogDensity; 584 #else 585 uniform float fogNear; 586 uniform float fogFar; 587 #endif 588#endif`,dw=`#ifdef USE_GRADIENTMAP 589 uniform sampler2D gradientMap; 590#endif 591vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { 592 float dotNL = dot( normal, lightDirection ); 593 vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 ); 594 #ifdef USE_GRADIENTMAP 595 return vec3( texture2D( gradientMap, coord ).r ); 596 #else 597 vec2 fw = fwidth( coord ) * 0.5; 598 return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) ); 599 #endif 600}`,fw=`#ifdef USE_LIGHTMAP 601 uniform sampler2D lightMap; 602 uniform float lightMapIntensity; 603#endif`,pw=`LambertMaterial material; 604material.diffuseColor = diffuseColor.rgb; 605material.specularStrength = specularStrength;`,mw=`varying vec3 vViewPosition; 606struct LambertMaterial { 607 vec3 diffuseColor; 608 float specularStrength; 609}; 610void RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { 611 float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); 612 vec3 irradiance = dotNL * directLight.color; 613 reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 614} 615void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { 616 reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 617} 618#define RE_Direct RE_Direct_Lambert 619#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,gw=`uniform bool receiveShadow; 620uniform vec3 ambientLightColor; 621#if defined( USE_LIGHT_PROBES ) 622 uniform vec3 lightProbe[ 9 ]; 623#endif 624vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { 625 float x = normal.x, y = normal.y, z = normal.z; 626 vec3 result = shCoefficients[ 0 ] * 0.886227; 627 result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; 628 result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; 629 result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; 630 result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; 631 result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; 632 result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); 633 result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; 634 result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); 635 return result; 636} 637vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) { 638 vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); 639 vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); 640 return irradiance; 641} 642vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { 643 vec3 irradiance = ambientLightColor; 644 return irradiance; 645} 646float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) { 647 float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 ); 648 if ( cutoffDistance > 0.0 ) { 649 distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); 650 } 651 return distanceFalloff; 652} 653float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) { 654 return smoothstep( coneCosine, penumbraCosine, angleCosine ); 655} 656#if NUM_DIR_LIGHTS > 0 657 struct DirectionalLight { 658 vec3 direction; 659 vec3 color; 660 }; 661 uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; 662 void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) { 663 light.color = directionalLight.color; 664 light.direction = directionalLight.direction; 665 light.visible = true; 666 } 667#endif 668#if NUM_POINT_LIGHTS > 0 669 struct PointLight { 670 vec3 position; 671 vec3 color; 672 float distance; 673 float decay; 674 }; 675 uniform PointLight pointLights[ NUM_POINT_LIGHTS ]; 676 void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) { 677 vec3 lVector = pointLight.position - geometryPosition; 678 light.direction = normalize( lVector ); 679 float lightDistance = length( lVector ); 680 light.color = pointLight.color; 681 light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay ); 682 light.visible = ( light.color != vec3( 0.0 ) ); 683 } 684#endif
685#if NUM_SPOT_LIGHTS > 0 686 struct SpotLight { 687 vec3 position; 688 vec3 direction; 689 vec3 color; 690 float distance; 691 float decay; 692 float coneCos; 693 float penumbraCos; 694 }; 695 uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ]; 696 void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) { 697 vec3 lVector = spotLight.position - geometryPosition; 698 light.direction = normalize( lVector ); 699 float angleCos = dot( light.direction, spotLight.direction ); 700 float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos ); 701 if ( spotAttenuation > 0.0 ) { 702 float lightDistance = length( lVector ); 703 light.color = spotLight.color * spotAttenuation; 704 light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay ); 705 light.visible = ( light.color != vec3( 0.0 ) ); 706 } else { 707 light.color = vec3( 0.0 ); 708 light.visible = false; 709 } 710 } 711#endif 712#if NUM_RECT_AREA_LIGHTS > 0 713 struct RectAreaLight { 714 vec3 color; 715 vec3 position; 716 vec3 halfWidth; 717 vec3 halfHeight; 718 }; 719 uniform sampler2D ltc_1; uniform sampler2D ltc_2; 720 uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ]; 721#endif 722#if NUM_HEMI_LIGHTS > 0 723 struct HemisphereLight { 724 vec3 direction; 725 vec3 skyColor; 726 vec3 groundColor; 727 }; 728 uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ]; 729 vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) { 730 float dotNL = dot( normal, hemiLight.direction ); 731 float hemiDiffuseWeight = 0.5 * dotNL + 0.5; 732 vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); 733 return irradiance; 734 } 735#endif 736#include <lightprobes_pars_fragment>`,_w=`#ifdef USE_ENVMAP 737 vec3 getIBLIrradiance( const in vec3 normal ) { 738 #ifdef ENVMAP_TYPE_CUBE_UV 739 vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); 740 vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 ); 741 return PI * envMapColor.rgb * envMapIntensity; 742 #else 743 return vec3( 0.0 ); 744 #endif 745 } 746 vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) { 747 #ifdef ENVMAP_TYPE_CUBE_UV 748 vec3 reflectVec = reflect( - viewDir, normal ); 749 reflectVec = normalize( mix( reflectVec, normal, pow4( roughness ) ) ); 750 reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); 751 vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness ); 752 return envMapColor.rgb * envMapIntensity; 753 #else 754 return vec3( 0.0 ); 755 #endif 756 } 757 #ifdef USE_ANISOTROPY 758 vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) { 759 #ifdef ENVMAP_TYPE_CUBE_UV 760 vec3 bentNormal = cross( bitangent, viewDir ); 761 bentNormal = normalize( cross( bentNormal, bitangent ) ); 762 bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) ); 763 return getIBLRadiance( viewDir, bentNormal, roughness ); 764 #else 765 return vec3( 0.0 ); 766 #endif 767 } 768 #endif 769#endif`,vw=`ToonMaterial material; 770material.diffuseColor = diffuseColor.rgb;`,xw=`varying vec3 vViewPosition; 771struct ToonMaterial { 772 vec3 diffuseColor; 773}; 774void RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { 775 vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color; 776 reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 777} 778void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { 779 reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 780} 781#define RE_Direct RE_Direct_Toon 782#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,yw=`BlinnPhongMaterial material; 783material.diffuseColor = diffuseColor.rgb; 784material.specularColor = specular; 785material.specularShininess = shininess; 786material.specularStrength = specularStrength;`,bw=`varying vec3 vViewPosition; 787struct BlinnPhongMaterial { 788 vec3 diffuseColor; 789 vec3 specularColor; 790 float specularShininess; 791 float specularStrength; 792}; 793void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {
794 float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); 795 vec3 irradiance = dotNL * directLight.color; 796 reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 797 reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength; 798} 799void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { 800 reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 801} 802#define RE_Direct RE_Direct_BlinnPhong 803#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,Sw=`PhysicalMaterial material; 804material.diffuseColor = diffuseColor.rgb; 805material.diffuseContribution = diffuseColor.rgb * ( 1.0 - metalnessFactor ); 806material.metalness = metalnessFactor; 807vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) ); 808float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); 809material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness; 810material.roughness = min( material.roughness, 1.0 ); 811#ifdef IOR 812 material.ior = ior; 813 #ifdef USE_SPECULAR 814 float specularIntensityFactor = specularIntensity; 815 vec3 specularColorFactor = specularColor; 816 #ifdef USE_SPECULAR_COLORMAP 817 specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb; 818 #endif 819 #ifdef USE_SPECULAR_INTENSITYMAP 820 specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a; 821 #endif 822 material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor ); 823 #else 824 float specularIntensityFactor = 1.0; 825 vec3 specularColorFactor = vec3( 1.0 ); 826 material.specularF90 = 1.0; 827 #endif 828 material.specularColor = min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor; 829 material.specularColorBlended = mix( material.specularColor, diffuseColor.rgb, metalnessFactor ); 830#else 831 material.specularColor = vec3( 0.04 ); 832 material.specularColorBlended = mix( material.specularColor, diffuseColor.rgb, metalnessFactor ); 833 material.specularF90 = 1.0; 834#endif 835#ifdef USE_CLEARCOAT 836 material.clearcoat = clearcoat; 837 material.clearcoatRoughness = clearcoatRoughness; 838 material.clearcoatF0 = vec3( 0.04 ); 839 material.clearcoatF90 = 1.0; 840 #ifdef USE_CLEARCOATMAP 841 material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x; 842 #endif 843 #ifdef USE_CLEARCOAT_ROUGHNESSMAP 844 material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y; 845 #endif 846 material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 ); 847 material.clearcoatRoughness += geometryRoughness; 848 material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 ); 849#endif 850#ifdef USE_DISPERSION 851 material.dispersion = dispersion; 852#endif 853#ifdef USE_IRIDESCENCE 854 material.iridescence = iridescence; 855 material.iridescenceIOR = iridescenceIOR; 856 #ifdef USE_IRIDESCENCEMAP 857 material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r; 858 #endif 859 #ifdef USE_IRIDESCENCE_THICKNESSMAP 860 material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum; 861 #else 862 material.iridescenceThickness = iridescenceThicknessMaximum; 863 #endif 864#endif 865#ifdef USE_SHEEN 866 material.sheenColor = sheenColor; 867 #ifdef USE_SHEEN_COLORMAP 868 material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb; 869 #endif 870 material.sheenRoughness = clamp( sheenRoughness, 0.0001, 1.0 ); 871 #ifdef USE_SHEEN_ROUGHNESSMAP 872 material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a; 873 #endif 874#endif 875#ifdef USE_ANISOTROPY 876 #ifdef USE_ANISOTROPYMAP 877 mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x ); 878 vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb; 879 vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b; 880 #else 881 vec2 anisotropyV = anisotropyVector; 882 #endif 883 material.anisotropy = length( anisotropyV ); 884 if( material.anisotropy == 0.0 ) { 885 anisotropyV = vec2( 1.0, 0.0 ); 886 } else { 887 anisotropyV /= material.anisotropy; 888 material.anisotropy = saturate( material.anisotropy ); 889 } 890 material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );
891 material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y; 892 material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y; 893#endif`,Mw=`uniform sampler2D dfgLUT; 894struct PhysicalMaterial { 895 vec3 diffuseColor; 896 vec3 diffuseContribution; 897 vec3 specularColor; 898 vec3 specularColorBlended; 899 float roughness; 900 float metalness; 901 float specularF90; 902 float dispersion; 903 #ifdef USE_CLEARCOAT 904 float clearcoat; 905 float clearcoatRoughness; 906 vec3 clearcoatF0; 907 float clearcoatF90; 908 #endif 909 #ifdef USE_IRIDESCENCE 910 float iridescence; 911 float iridescenceIOR; 912 float iridescenceThickness; 913 vec3 iridescenceFresnel; 914 vec3 iridescenceF0; 915 vec3 iridescenceFresnelDielectric; 916 vec3 iridescenceFresnelMetallic; 917 #endif 918 #ifdef USE_SHEEN 919 vec3 sheenColor; 920 float sheenRoughness; 921 #endif 922 #ifdef IOR 923 float ior; 924 #endif 925 #ifdef USE_TRANSMISSION 926 float transmission; 927 float transmissionAlpha; 928 float thickness; 929 float attenuationDistance; 930 vec3 attenuationColor; 931 #endif 932 #ifdef USE_ANISOTROPY 933 float anisotropy; 934 float alphaT; 935 vec3 anisotropyT; 936 vec3 anisotropyB; 937 #endif 938}; 939vec3 clearcoatSpecularDirect = vec3( 0.0 ); 940vec3 clearcoatSpecularIndirect = vec3( 0.0 ); 941vec3 sheenSpecularDirect = vec3( 0.0 ); 942vec3 sheenSpecularIndirect = vec3(0.0 ); 943vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) { 944 float x = clamp( 1.0 - dotVH, 0.0, 1.0 ); 945 float x2 = x * x; 946 float x5 = clamp( x * x2 * x2, 0.0, 0.9999 ); 947 return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 ); 948} 949float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) { 950 float a2 = pow2( alpha ); 951 float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); 952 float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); 953 return 0.5 / max( gv + gl, EPSILON ); 954} 955float D_GGX( const in float alpha, const in float dotNH ) { 956 float a2 = pow2( alpha ); 957 float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; 958 return RECIPROCAL_PI * a2 / pow2( denom ); 959} 960#ifdef USE_ANISOTROPY 961 float V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) { 962 float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) ); 963 float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) ); 964 return 0.5 / max( gv + gl, EPSILON )
vendor: 7,372 bytes, lines 964-1123
964; 965 } 966 float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) { 967 float a2 = alphaT * alphaB; 968 highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH ); 969 highp float v2 = dot( v, v ); 970 float w2 = a2 / v2; 971 return RECIPROCAL_PI * a2 * pow2 ( w2 ); 972 } 973#endif 974#ifdef USE_CLEARCOAT 975 vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) { 976 vec3 f0 = material.clearcoatF0; 977 float f90 = material.clearcoatF90; 978 float roughness = material.clearcoatRoughness; 979 float alpha = pow2( roughness ); 980 vec3 halfDir = normalize( lightDir + viewDir ); 981 float dotNL = saturate( dot( normal, lightDir ) ); 982 float dotNV = saturate( dot( normal, viewDir ) ); 983 float dotNH = saturate( dot( normal, halfDir ) ); 984 float dotVH = saturate( dot( viewDir, halfDir ) ); 985 vec3 F = F_Schlick( f0, f90, dotVH ); 986 float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); 987 float D = D_GGX( alpha, dotNH ); 988 return F * ( V * D ); 989 } 990#endif 991vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) { 992 vec3 f0 = material.specularColorBlended; 993 float f90 = material.specularF90; 994 float roughness = material.roughness; 995 float alpha = pow2( roughness ); 996 vec3 halfDir = normalize( lightDir + viewDir ); 997 float dotNL = saturate( dot( normal, lightDir ) ); 998 float dotNV = saturate( dot( normal, viewDir ) ); 999 float dotNH = saturate( dot( normal, halfDir ) ); 1000 float dotVH = saturate( dot( viewDir, halfDir ) ); 1001 vec3 F = F_Schlick( f0, f90, dotVH ); 1002 #ifdef USE_IRIDESCENCE 1003 F = mix( F, material.iridescenceFresnel, material.iridescence ); 1004 #endif 1005 #ifdef USE_ANISOTROPY 1006 float dotTL = dot( material.anisotropyT, lightDir ); 1007 float dotTV = dot( material.anisotropyT, viewDir ); 1008 float dotTH = dot( material.anisotropyT, halfDir ); 1009 float dotBL = dot( material.anisotropyB, lightDir ); 1010 float dotBV = dot( material.anisotropyB, viewDir ); 1011 float dotBH = dot( material.anisotropyB, halfDir ); 1012 float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL ); 1013 float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH ); 1014 #else 1015 float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); 1016 float D = D_GGX( alpha, dotNH ); 1017 #endif 1018 return F * ( V * D ); 1019} 1020vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) { 1021 const float LUT_SIZE = 64.0; 1022 const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE; 1023 const float LUT_BIAS = 0.5 / LUT_SIZE; 1024 float dotNV = saturate( dot( N, V ) ); 1025 vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) ); 1026 uv = uv * LUT_SCALE + LUT_BIAS; 1027 return uv; 1028} 1029float LTC_ClippedSphereFormFactor( const in vec3 f ) { 1030 float l = length( f ); 1031 return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 ); 1032} 1033vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) { 1034 float x = dot( v1, v2 ); 1035 float y = abs( x ); 1036 float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y; 1037 float b = 3.4175940 + ( 4.1616724 + y ) * y; 1038 float v = a / b; 1039 float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v; 1040 return cross( v1, v2 ) * theta_sintheta; 1041} 1042vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) { 1043 vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ]; 1044 vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ]; 1045 vec3 lightNormal = cross( v1, v2 ); 1046 if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 ); 1047 vec3 T1, T2; 1048 T1 = normalize( V - N * dot( V, N ) ); 1049 T2 = - cross( N, T1 ); 1050 mat3 mat = mInv * transpose( mat3( T1, T2, N ) ); 1051 vec3 coords[ 4 ]; 1052 coords[ 0 ] = mat * ( rectCoords[ 0 ] - P ); 1053 coords[ 1 ] = mat * ( rectCoords[ 1 ] - P ); 1054 coords[ 2 ] = mat * ( rectCoords[ 2 ] - P ); 1055 coords[ 3 ] = mat * ( rectCoords[ 3 ] - P ); 1056 coords[ 0 ] = normalize( coords[ 0 ] ); 1057 coords[ 1 ] = normalize( coords[ 1 ] ); 1058 coords[ 2 ] = normalize( coords[ 2 ] ); 1059 coords[ 3 ] = normalize( coords[ 3 ] ); 1060 vec3 vectorFormFactor = vec3( 0.0 ); 1061 vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] ); 1062 vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] ); 1063 vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] ); 1064 vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] ); 1065 float result = LTC_ClippedSphereFormFactor( vectorFormFactor ); 1066 return vec3( result ); 1067} 1068#if defined( USE_SHEEN ) 1069float D_Charlie( float roughness, float dotNH ) { 1070 float alpha = pow2( roughness ); 1071 float invAlpha = 1.0 / alpha; 1072 float cos2h = dotNH * dotNH; 1073 float sin2h = max( 1.0 - cos2h, 0.0078125 ); 1074 return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI ); 1075} 1076float V_Neubelt( float dotNV, float dotNL ) { 1077 return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) ); 1078} 1079vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) { 1080 vec3 halfDir = normalize( lightDir + viewDir ); 1081 float dotNL = saturate( dot( normal, lightDir ) ); 1082 float dotNV = saturate( dot( normal, viewDir ) ); 1083 float dotNH = saturate( dot( normal, halfDir ) ); 1084 float D = D_Charlie( sheenRoughness, dotNH ); 1085 float V = V_Neubelt( dotNV, dotNL ); 1086 return sheenColor * ( D * V ); 1087} 1088#endif 1089float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { 1090 float dotNV = saturate( dot( normal, viewDir ) ); 1091 float r2 = roughness * roughness; 1092 float rInv = 1.0 / ( roughness + 0.1 ); 1093 float a = -1.9362 + 1.0678 * roughness + 0.4573 * r2 - 0.8469 * rInv; 1094 float b = -0.6014 + 0.5538 * roughness - 0.4670 * r2 - 0.1255 * rInv; 1095 float DG = exp( a * dotNV + b ); 1096 return saturate( DG ); 1097} 1098vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) { 1099 float dotNV = saturate( dot( normal, viewDir ) ); 1100 vec2 fab = texture2D( dfgLUT, vec2( roughness, dotNV ) ).rg; 1101 return specularColor * fab.x + specularF90 * fab.y; 1102} 1103#ifdef USE_IRIDESCENCE 1104void computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { 1105#else 1106void computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { 1107#endif 1108 float dotNV = saturate( dot( normal, viewDir ) ); 1109 vec2 fab = texture2D( dfgLUT, vec2( roughness, dotNV ) ).rg; 1110 #ifdef USE_IRIDESCENCE 1111 vec3 Fr = mix( specularColor, iridescenceF0, iridescence ); 1112 #else 1113 vec3 Fr = specularColor; 1114 #endif 1115 vec3 FssEss = Fr * fab.x + specularF90 * fab.y; 1116 float Ess = fab.x + fab.y; 1117 float Ems = 1.0 - Ess; 1118 vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ); 1119 singleScatter += FssEss; 1120 multiScatter += Fms * Ems; 1121} 1122vec3 BRDF_GGX_Multiscatter( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) { 1123 vec3 singleScatter = BRDF_GGX( lightDir, viewDir, normal, material );
vendor: 8,354 bytes, lines 1124-1253
1124 float dotNL = saturate( dot( normal, lightDir ) ); 1125 float dotNV = saturate( dot( normal, viewDir ) ); 1126 vec2 dfgV = texture2D( dfgLUT, vec2( material.roughness, dotNV ) ).rg; 1127 vec2 dfgL = texture2D( dfgLUT, vec2( material.roughness, dotNL ) ).rg; 1128 vec3 FssEss_V = material.specularColorBlended * dfgV.x + material.specularF90 * dfgV.y; 1129 vec3 FssEss_L = material.specularColorBlended * dfgL.x + material.specularF90 * dfgL.y; 1130 float Ess_V = dfgV.x + dfgV.y; 1131 float Ess_L = dfgL.x + dfgL.y; 1132 float Ems_V = 1.0 - Ess_V; 1133 float Ems_L = 1.0 - Ess_L; 1134 vec3 Favg = material.specularColorBlended + ( 1.0 - material.specularColorBlended ) * 0.047619; 1135 vec3 Fms = FssEss_V * FssEss_L * Favg / ( 1.0 - Ems_V * Ems_L * Favg + EPSILON ); 1136 float compensationFactor = Ems_V * Ems_L; 1137 vec3 multiScatter = Fms * compensationFactor; 1138 return singleScatter + multiScatter; 1139} 1140#if NUM_RECT_AREA_LIGHTS > 0 1141 void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { 1142 vec3 normal = geometryNormal; 1143 vec3 viewDir = geometryViewDir; 1144 vec3 position = geometryPosition; 1145 vec3 lightPos = rectAreaLight.position; 1146 vec3 halfWidth = rectAreaLight.halfWidth; 1147 vec3 halfHeight = rectAreaLight.halfHeight; 1148 vec3 lightColor = rectAreaLight.color; 1149 float roughness = material.roughness; 1150 vec3 rectCoords[ 4 ]; 1151 rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight; 1152 rectCoords[ 2 ] = lightPos - halfWidth + halfHeight; 1153 rectCoords[ 3 ] = lightPos + halfWidth + halfHeight; 1154 vec2 uv = LTC_Uv( normal, viewDir, roughness ); 1155 vec4 t1 = texture2D( ltc_1, uv ); 1156 vec4 t2 = texture2D( ltc_2, uv ); 1157 mat3 mInv = mat3( 1158 vec3( t1.x, 0, t1.y ), 1159 vec3( 0, 1, 0 ), 1160 vec3( t1.z, 0, t1.w ) 1161 ); 1162 vec3 fresnel = ( material.specularColorBlended * t2.x + ( material.specularF90 - material.specularColorBlended ) * t2.y ); 1163 reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); 1164 reflectedLight.directDiffuse += lightColor * material.diffuseContribution * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); 1165 #ifdef USE_CLEARCOAT 1166 vec3 Ncc = geometryClearcoatNormal; 1167 vec2 uvClearcoat = LTC_Uv( Ncc, viewDir, material.clearcoatRoughness ); 1168 vec4 t1Clearcoat = texture2D( ltc_1, uvClearcoat ); 1169 vec4 t2Clearcoat = texture2D( ltc_2, uvClearcoat ); 1170 mat3 mInvClearcoat = mat3( 1171 vec3( t1Clearcoat.x, 0, t1Clearcoat.y ), 1172 vec3( 0, 1, 0 ), 1173 vec3( t1Clearcoat.z, 0, t1Clearcoat.w ) 1174 ); 1175 vec3 fresnelClearcoat = material.clearcoatF0 * t2Clearcoat.x + ( material.clearcoatF90 - material.clearcoatF0 ) * t2Clearcoat.y; 1176 clearcoatSpecularDirect += lightColor * fresnelClearcoat * LTC_Evaluate( Ncc, viewDir, position, mInvClearcoat, rectCoords ); 1177 #endif 1178 } 1179#endif 1180void RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { 1181 float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); 1182 vec3 irradiance = dotNL * directLight.color; 1183 #ifdef USE_CLEARCOAT 1184 float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) ); 1185 vec3 ccIrradiance = dotNLcc * directLight.color; 1186 clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material ); 1187 #endif 1188 #ifdef USE_SHEEN 1189 1190 sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness ); 1191 1192 float sheenAlbedoV = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ); 1193 float sheenAlbedoL = IBLSheenBRDF( geometryNormal, directLight.direction, material.sheenRoughness ); 1194 1195 float sheenEnergyComp = 1.0 - max3( material.sheenColor ) * max( sheenAlbedoV, sheenAlbedoL ); 1196 1197 irradiance *= sheenEnergyComp; 1198 1199 #endif 1200 reflectedLight.directSpecular += irradiance * BRDF_GGX_Multiscatter( directLight.direction, geometryViewDir, geometryNormal, material ); 1201 reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseContribution ); 1202} 1203void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { 1204 vec3 diffuse = irradiance * BRDF_Lambert( material.diffuseContribution ); 1205 #ifdef USE_SHEEN 1206 float sheenAlbedo = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ); 1207 float sheenEnergyComp = 1.0 - max3( material.sheenColor ) * sheenAlbedo; 1208 diffuse *= sheenEnergyComp; 1209 #endif 1210 reflectedLight.indirectDiffuse += diffuse; 1211} 1212void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) { 1213 #ifdef USE_CLEARCOAT 1214 clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness ); 1215 #endif 1216 #ifdef USE_SHEEN 1217 sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ) * RECIPROCAL_PI; 1218 #endif 1219 vec3 singleScatteringDielectric = vec3( 0.0 ); 1220 vec3 multiScatteringDielectric = vec3( 0.0 ); 1221 vec3 singleScatteringMetallic = vec3( 0.0 ); 1222 vec3 multiScatteringMetallic = vec3( 0.0 ); 1223 #ifdef USE_IRIDESCENCE 1224 computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnelDielectric, material.roughness, singleScatteringDielectric, multiScatteringDielectric ); 1225 computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.diffuseColor, material.specularF90, material.iridescence, material.iridescenceFresnelMetallic, material.roughness, singleScatteringMetallic, multiScatteringMetallic ); 1226 #else 1227 computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScatteringDielectric, multiScatteringDielectric ); 1228 computeMultiscattering( geometryNormal, geometryViewDir, material.diffuseColor, material.specularF90, material.roughness, singleScatteringMetallic, multiScatteringMetallic ); 1229 #endif 1230 vec3 singleScattering = mix( singleScatteringDielectric, singleScatteringMetallic, material.metalness ); 1231 vec3 multiScattering = mix( multiScatteringDielectric, multiScatteringMetallic, material.metalness ); 1232 vec3 totalScatteringDielectric = singleScatteringDielectric + multiScatteringDielectric; 1233 vec3 diffuse = material.diffuseContribution * ( 1.0 - totalScatteringDielectric ); 1234 vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; 1235 vec3 indirectSpecular = radiance * singleScattering; 1236 indirectSpecular += multiScattering * cosineWeightedIrradiance; 1237 vec3 indirectDiffuse = diffuse * cosineWeightedIrradiance; 1238 #ifdef USE_SHEEN 1239 float sheenAlbedo = IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ); 1240 float sheenEnergyComp = 1.0 - max3( material.sheenColor ) * sheenAlbedo; 1241 indirectSpecular *= sheenEnergyComp; 1242 indirectDiffuse *= sheenEnergyComp; 1243 #endif 1244 reflectedLight.indirectSpecular += indirectSpecular; 1245 reflectedLight.indirectDiffuse += indirectDiffuse; 1246} 1247#define RE_Direct RE_Direct_Physical 1248#define RE_Direct_RectArea RE_Direct_RectArea_Physical 1249#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical 1250#define RE_IndirectSpecular RE_IndirectSpecular_Physical 1251float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { 1252 return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); 1253}`,
1253Ew=` 1254vec3 geometryPosition = - vViewPosition; 1255vec3 geometryNormal = normal; 1256vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); 1257vec3 geometryClearcoatNormal = vec3( 0.0 ); 1258#ifdef USE_CLEARCOAT 1259 geometryClearcoatNormal = clearcoatNormal; 1260#endif 1261#ifdef USE_IRIDESCENCE 1262 float dotNVi = saturate( dot( normal, geometryViewDir ) ); 1263 if ( material.iridescenceThickness == 0.0 ) { 1264 material.iridescence = 0.0; 1265 } else { 1266 material.iridescence = saturate( material.iridescence ); 1267 } 1268 if ( material.iridescence > 0.0 ) { 1269 material.iridescenceFresnelDielectric = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor ); 1270 material.iridescenceFresnelMetallic = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.diffuseColor ); 1271 material.iridescenceFresnel = mix( material.iridescenceFresnelDielectric, material.iridescenceFresnelMetallic, material.metalness ); 1272 material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi ); 1273 } 1274#endif 1275IncidentLight directLight; 1276#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) 1277 PointLight pointLight; 1278 #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0 1279 PointLightShadow pointLightShadow; 1280 #endif 1281 #pragma unroll_loop_start 1282 for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { 1283 pointLight = pointLights[ i ]; 1284 getPointLightInfo( pointLight, geometryPosition, directLight ); 1285 #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) && ( defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_BASIC ) ) 1286 pointLightShadow = pointLightShadows[ i ]; 1287 directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; 1288 #endif 1289 RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); 1290 } 1291 #pragma unroll_loop_end 1292#endif 1293#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) 1294 SpotLight spotLight; 1295 vec4 spotColor; 1296 vec3 spotLightCoord; 1297 bool inSpotLightMap; 1298 #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0 1299 SpotLightShadow spotLightShadow; 1300 #endif 1301 #pragma unroll_loop_start 1302 for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { 1303 spotLight = spotLights[ i ]; 1304 getSpotLightInfo( spotLight, geometryPosition, directLight ); 1305 #if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) 1306 #define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX 1307 #elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) 1308 #define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS 1309 #else 1310 #define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) 1311 #endif 1312 #if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS ) 1313 spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w; 1314 inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) ); 1315 spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy ); 1316 directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color; 1317 #endif 1318 #undef SPOT_LIGHT_MAP_INDEX 1319 #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) 1320 spotLightShadow = spotLightShadows[ i ]; 1321 directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; 1322 #endif 1323 RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); 1324 } 1325 #pragma unroll_loop_end 1326#endif 1327#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) 1328 DirectionalLight directionalLight; 1329 #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0 1330 DirectionalLightShadow directionalLightShadow; 1331 #endif 1332 #pragma unroll_loop_start 1333 for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { 1334 directionalLight = directionalLights[ i ]; 1335 getDirectionalLightInfo( directionalLight, directLight ); 1336 #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) 1337 directionalLightShadow = directionalLightShadows[ i ]; 1338 directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; 1339 #endif 1340 RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); 1341 } 1342 #pragma unroll_loop_end 1343#endif 1344#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) 1345 RectAreaLight rectAreaLight; 1346 #pragma unroll_loop_start 1347 for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { 1348 rectAreaLight = rectAreaLights[ i ]; 1349 RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); 1350 } 1351 #pragma unroll_loop_end 1352#endif 1353#if defined( RE_IndirectDiffuse ) 1354 vec3 iblIrradiance = vec3( 0.0 ); 1355 vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); 1356 #if defined( USE_LIGHT_PROBES ) 1357 irradiance += getLightProbeIrradiance( lightProbe, geometryNormal ); 1358 #endif 1359 #if ( NUM_HEMI_LIGHTS > 0 ) 1360 #pragma unroll_loop_start 1361 for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { 1362 irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal ); 1363 } 1364 #pragma unroll_loop_end 1365 #endif 1366 #ifdef USE_LIGHT_PROBES_GRID 1367 vec3 probeWorldPos = ( ( vec4( geometryPosition, 1.0 ) - viewMatrix[ 3 ] ) * viewMatrix ).xyz; 1368 vec3 probeWorldNormal = inverseTransformDirection( geometryNormal, viewMatrix ); 1369 irradiance += getLightProbeGridIrradiance( probeWorldPos, probeWorldNormal ); 1370 #endif 1371#endif 1372#if defined( RE_IndirectSpecular ) 1373 vec3 radiance = vec3( 0.0 ); 1374 vec3 clearcoatRadiance = vec3( 0.0 ); 1375#endif`,Tw=`#if defined( RE_IndirectDiffuse ) 1376 #ifdef USE_LIGHTMAP 1377 vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); 1378 vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; 1379 irradiance += lightMapIrradiance; 1380 #endif 1381 #if defined( USE_ENVMAP ) && defined( ENVMAP_TYPE_CUBE_UV ) 1382 #if defined( STANDARD ) || defined( LAMBERT ) || defined( PHONG ) 1383 iblIrradiance += getIBLIrradiance( geometryNormal ); 1384 #endif 1385 #endif 1386#endif 1387#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) 1388 #ifdef USE_ANISOTROPY 1389 radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy ); 1390 #else 1391 radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness ); 1392 #endif 1393 #ifdef USE_CLEARCOAT 1394 clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness ); 1395 #endif 1396#endif`,ww=`#if defined( RE_IndirectDiffuse ) 1397 #if defined( LAMBERT ) || defined( PHONG ) 1398 irradiance += iblIrradiance; 1399 #endif 1400 RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); 1401#endif 1402#if defined( RE_IndirectSpecular ) 1403 RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); 1404#endif`,Aw=`#ifdef USE_LIGHT_PROBES_GRID 1405uniform highp sampler3D probesSH; 1406uniform vec3 probesMin; 1407uniform vec3 probesMax; 1408uniform vec3 probesResolution; 1409vec3 getLightProbeGridIrradiance( vec3 worldPos, vec3 worldNormal ) { 1410 vec3 res = probesResolution; 1411 vec3 gridRange = probesMax - probesMin; 1412 vec3 resMinusOne = res - 1.0; 1413 vec3 probeSpacing = gridRange / resMinusOne; 1414 vec3 samplePos = worldPos + worldNormal * probeSpacing * 0.5; 1415 vec3 uvw = clamp( ( samplePos - probesMin ) / gridRange, 0.0, 1.0 ); 1416 uvw = uvw * resMinusOne / res + 0.5 / res; 1417 float nz = res.z; 1418 float paddedSlices = nz + 2.0; 1419 float atlasDepth = 7.0 * paddedSlices; 1420 float uvZBase = uvw.z * nz + 1.0; 1421 vec4 s0 = texture( probesSH, vec3( uvw.xy, ( uvZBase ) / atlasDepth ) ); 1422 vec4 s1 = texture( probesSH, vec3( uvw.xy, ( uvZBase + paddedSlices ) / atlasDepth ) ); 1423 vec4 s2 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 2.0 * paddedSlices ) / atlasDepth ) ); 1424 vec4 s3 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 3.0 * paddedSlices ) / atlasDepth ) ); 1425 vec4 s4 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 4.0 * paddedSlices ) / atlasDepth ) ); 1426 vec4 s5 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 5.0 * paddedSlices ) / atlasDepth ) ); 1427 vec4 s6 = texture( probesSH, vec3( uvw.xy, ( uvZBase + 6.0 * paddedSlices ) / atlasDepth ) ); 1428 vec3 c0 = s0.xyz; 1429 vec3 c1 = vec3( s0.w, s1.xy ); 1430 vec3 c2 = vec3( s1.zw, s2.x ); 1431 vec3 c3 = s2.yzw; 1432 vec3 c4 = s3.xyz; 1433 vec3 c5 = vec3( s3.w, s4.xy ); 1434 vec3 c6 = vec3( s4.zw, s5.x ); 1435 vec3 c7 = s5.yzw; 1436 vec3 c8 = s6.xyz; 1437 float x = worldNormal.x, y = worldNormal.y, z = worldNormal.z; 1438 vec3 result = c0 * 0.886227; 1439 result += c1 * 2.0 * 0.511664 * y; 1440 result += c2 * 2.0 * 0.511664 * z; 1441 result += c3 * 2.0 * 0.511664 * x; 1442 result += c4 * 2.0 * 0.429043 * x * y; 1443 result += c5 * 2.0 * 0.429043 * y * z; 1444 result += c6 * ( 0.743125 * z * z - 0.247708 ); 1445 result += c7 * 2.0 * 0.429043 * x * z; 1446 result += c8 * 0.429043 * ( x * x - y * y ); 1447 return max( result, vec3( 0.0 ) ); 1448} 1449#endif`,Cw=`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER ) 1450 gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; 1451#endif`,Rw=`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER ) 1452 uniform float logDepthBufFC; 1453 varying float vFragDepth; 1454 varying float vIsPerspective; 1455#endif`,Iw=`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER 1456 varying float vFragDepth; 1457 varying float vIsPerspective; 1458#endif`,Pw=`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER 1459 vFragDepth = 1.0 + gl_Position.w; 1460 vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); 1461#endif`,Lw=`#ifdef USE_MAP 1462 vec4 sampledDiffuseColor = texture2D( map, vMapUv ); 1463 #ifdef DECODE_VIDEO_TEXTURE 1464 sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor ); 1465 #endif 1466 diffuseColor *= sampledDiffuseColor; 1467#endif`,Nw=`#ifdef USE_MAP 1468 uniform sampler2D map; 1469#endif`,Dw=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) 1470 #if defined( USE_POINTS_UV ) 1471 vec2 uv = vUv; 1472 #else 1473 vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; 1474 #endif 1475#endif 1476#ifdef USE_MAP 1477 diffuseColor *= texture2D( map, uv ); 1478#endif 1479#ifdef USE_ALPHAMAP 1480 diffuseColor.a *= texture2D( alphaMap, uv ).g; 1481#endif`,Ow=`#if defined( USE_POINTS_UV ) 1482 varying vec2 vUv; 1483#else 1484 #if defined( USE_MAP ) || defined( USE_ALPHAMAP ) 1485 uniform mat3 uvTransform; 1486 #endif 1487#endif 1488#ifdef USE_MAP 1489 uniform sampler2D map; 1490#endif 1491#ifdef USE_ALPHAMAP 1492 uniform sampler2D alphaMap; 1493#endif`,Uw=`float metalnessFactor = metalness; 1494#ifdef USE_METALNESSMAP 1495 vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); 1496 metalnessFactor *= texelMetalness.b; 1497#endif`,Fw=`#ifdef USE_METALNESSMAP 1498 uniform sampler2D metalnessMap; 1499#endif`,Bw=`#ifdef USE_INSTANCING_MORPH 1500 float morphTargetInfluences[ MORPHTARGETS_COUNT ]; 1501 float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r; 1502 for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { 1503 morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r; 1504 } 1505#endif`,kw=`#if defined( USE_MORPHCOLORS ) 1506 vColor *= morphTargetBaseInfluence; 1507 for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { 1508 #if defined( USE_COLOR_ALPHA ) 1509 if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ]; 1510 #elif defined( USE_COLOR ) 1511 if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; 1512 #endif 1513 } 1514#endif`,Vw=`#ifdef USE_MORPHNORMALS 1515 objectNormal *= morphTargetBaseInfluence; 1516 for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { 1517 if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ]; 1518 } 1519#endif`,zw=`#ifdef USE_MORPHTARGETS 1520 #ifndef USE_INSTANCING_MORPH 1521 uniform float morphTargetBaseInfluence; 1522 uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; 1523 #endif 1524 uniform sampler2DArray morphTargetsTexture; 1525 uniform ivec2 morphTargetsTextureSize; 1526 vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) { 1527 int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset; 1528 int y = texelIndex / morphTargetsTextureSize.x; 1529 int x = texelIndex - y * morphTargetsTextureSize.x; 1530 ivec3 morphUV = ivec3( x, y, morphTargetIndex ); 1531 return texelFetch( morphTargetsTexture, morphUV, 0 ); 1532 } 1533#endif`,Hw=`#ifdef USE_MORPHTARGETS 1534 transformed *= morphTargetBaseInfluence; 1535 for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { 1536 if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ]; 1537 } 1538#endif`,Gw=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; 1539#ifdef FLAT_SHADED 1540 vec3 fdx = dFdx( vViewPosition ); 1541 vec3 fdy = dFdy( vViewPosition ); 1542 vec3 normal = normalize( cross( fdx, fdy ) ); 1543#else 1544 vec3 normal = normalize( vNormal ); 1545 #ifdef DOUBLE_SIDED 1546 normal *= faceDirection; 1547 #endif 1548#endif 1549#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) 1550 #ifdef USE_TANGENT 1551 mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); 1552 #else 1553 mat3 tbn = getTangentFrame( - vViewPosition, normal, 1554 #if defined( USE_NORMALMAP ) 1555 vNormalMapUv 1556 #elif defined( USE_CLEARCOAT_NORMALMAP ) 1557 vClearcoatNormalMapUv 1558 #else 1559 vUv 1560 #endif 1561 ); 1562 #endif 1563 #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) 1564 tbn[0] *= faceDirection; 1565 tbn[1] *= faceDirection; 1566 #endif 1567#endif 1568#ifdef USE_CLEARCOAT_NORMALMAP 1569 #ifdef USE_TANGENT 1570 mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); 1571 #else 1572 mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv ); 1573 #endif 1574 #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) 1575 tbn2[0] *= faceDirection; 1576 tbn2[1] *= faceDirection; 1577 #endif 1578#endif 1579vec3 nonPerturbedNormal = normal;`,Ww=`#ifdef USE_NORMALMAP_OBJECTSPACE 1580 normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; 1581 #ifdef FLIP_SIDED 1582 normal = - normal; 1583 #endif 1584 #ifdef DOUBLE_SIDED 1585 normal = normal * faceDirection; 1586 #endif 1587 normal = normalize( normalMatrix * normal ); 1588#elif defined( USE_NORMALMAP_TANGENTSPACE ) 1589 vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; 1590 #if defined( USE_PACKED_NORMALMAP ) 1591 mapN = vec3( mapN.xy, sqrt( saturate( 1.0 - dot( mapN.xy, mapN.xy ) ) ) ); 1592 #endif 1593 mapN.xy *= normalScale; 1594 normal = normalize( tbn * mapN ); 1595#elif defined( USE_BUMPMAP )
1596 normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); 1597#endif`,Xw=`#ifndef FLAT_SHADED 1598 varying vec3 vNormal; 1599 #ifdef USE_TANGENT 1600 varying vec3 vTangent; 1601 varying vec3 vBitangent; 1602 #endif 1603#endif`,qw=`#ifndef FLAT_SHADED 1604 varying vec3 vNormal; 1605 #ifdef USE_TANGENT 1606 varying vec3 vTangent; 1607 varying vec3 vBitangent; 1608 #endif 1609#endif`,$w=`#ifndef FLAT_SHADED 1610 vNormal = normalize( transformedNormal ); 1611 #ifdef USE_TANGENT 1612 vTangent = normalize( transformedTangent ); 1613 vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); 1614 #endif 1615#endif`,Yw=`#ifdef USE_NORMALMAP 1616 uniform sampler2D normalMap; 1617 uniform vec2 normalScale; 1618#endif 1619#ifdef USE_NORMALMAP_OBJECTSPACE 1620 uniform mat3 normalMatrix; 1621#endif 1622#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) ) 1623 mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) { 1624 vec3 q0 = dFdx( eye_pos.xyz ); 1625 vec3 q1 = dFdy( eye_pos.xyz ); 1626 vec2 st0 = dFdx( uv.st ); 1627 vec2 st1 = dFdy( uv.st ); 1628 vec3 N = surf_norm; 1629 vec3 q1perp = cross( q1, N ); 1630 vec3 q0perp = cross( N, q0 ); 1631 vec3 T = q1perp * st0.x + q0perp * st1.x; 1632 vec3 B = q1perp * st0.y + q0perp * st1.y; 1633 float det = max( dot( T, T ), dot( B, B ) ); 1634 float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det ); 1635 return mat3( T * scale, B * scale, N ); 1636 } 1637#endif`,Zw=`#ifdef USE_CLEARCOAT 1638 vec3 clearcoatNormal = nonPerturbedNormal; 1639#endif`,Kw=`#ifdef USE_CLEARCOAT_NORMALMAP 1640 vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; 1641 clearcoatMapN.xy *= clearcoatNormalScale; 1642 clearcoatNormal = normalize( tbn2 * clearcoatMapN ); 1643#endif`,Jw=`#ifdef USE_CLEARCOATMAP 1644 uniform sampler2D clearcoatMap; 1645#endif 1646#ifdef USE_CLEARCOAT_NORMALMAP 1647 uniform sampler2D clearcoatNormalMap; 1648 uniform vec2 clearcoatNormalScale; 1649#endif 1650#ifdef USE_CLEARCOAT_ROUGHNESSMAP 1651 uniform sampler2D clearcoatRoughnessMap; 1652#endif`,jw=`#ifdef USE_IRIDESCENCEMAP 1653 uniform sampler2D iridescenceMap; 1654#endif 1655#ifdef USE_IRIDESCENCE_THICKNESSMAP 1656 uniform sampler2D iridescenceThicknessMap; 1657#endif`,Qw=`#ifdef OPAQUE 1658diffuseColor.a = 1.0; 1659#endif 1660#ifdef USE_TRANSMISSION 1661diffuseColor.a *= material.transmissionAlpha; 1662#endif 1663gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,eA=`vec3 packNormalToRGB( const in vec3 normal ) { 1664 return normalize( normal ) * 0.5 + 0.5; 1665} 1666vec3 unpackRGBToNormal( const in vec3 rgb ) { 1667 return 2.0 * rgb.xyz - 1.0; 1668} 1669const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.; 1670const float Inv255 = 1. / 255.; 1671const vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 ); 1672const vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g ); 1673const vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b ); 1674const vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a ); 1675vec4 packDepthToRGBA( const in float v ) { 1676 if( v <= 0.0 ) 1677 return vec4( 0., 0., 0., 0. ); 1678 if( v >= 1.0 ) 1679 return vec4( 1., 1., 1., 1. ); 1680 float vuf; 1681 float af = modf( v * PackFactors.a, vuf ); 1682 float bf = modf( vuf * ShiftRight8, vuf ); 1683 float gf = modf( vuf * ShiftRight8, vuf ); 1684 return vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af ); 1685} 1686vec3 packDepthToRGB( const in float v ) { 1687 if( v <= 0.0 ) 1688 return vec3( 0., 0., 0. ); 1689 if( v >= 1.0 ) 1690 return vec3( 1., 1., 1. ); 1691 float vuf; 1692 float bf = modf( v * PackFactors.b, vuf ); 1693 float gf = modf( vuf * ShiftRight8, vuf ); 1694 return vec3( vuf * Inv255, gf * PackUpscale, bf ); 1695} 1696vec2 packDepthToRG( const in float v ) { 1697 if( v <= 0.0 ) 1698 return vec2( 0., 0. ); 1699 if( v >= 1.0 ) 1700 return vec2( 1., 1. ); 1701 float vuf; 1702 float gf = modf( v * 256., vuf ); 1703 return vec2( vuf * Inv255, gf ); 1704} 1705float unpackRGBAToDepth( const in vec4 v ) { 1706 return dot( v, UnpackFactors4 ); 1707} 1708float unpackRGBToDepth( const in vec3 v ) { 1709 return dot( v, UnpackFactors3 ); 1710} 1711float unpackRGToDepth( const in vec2 v ) { 1712 return v.r * UnpackFactors2.r + v.g * UnpackFactors2.g; 1713} 1714vec4 pack2HalfToRGBA( const in vec2 v ) {
1715 vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) ); 1716 return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w ); 1717} 1718vec2 unpackRGBATo2Half( const in vec4 v ) { 1719 return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); 1720} 1721float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { 1722 return ( viewZ + near ) / ( near - far ); 1723} 1724float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) { 1725 #ifdef USE_REVERSED_DEPTH_BUFFER 1726 1727 return depth * ( far - near ) - far; 1728 #else 1729 return depth * ( near - far ) - near; 1730 #endif 1731} 1732float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { 1733 return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ ); 1734} 1735float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) { 1736 1737 #ifdef USE_REVERSED_DEPTH_BUFFER 1738 return ( near * far ) / ( ( near - far ) * depth - near ); 1739 #else 1740 return ( near * far ) / ( ( far - near ) * depth - far ); 1741 #endif 1742}`,tA=`#ifdef PREMULTIPLIED_ALPHA 1743 gl_FragColor.rgb *= gl_FragColor.a; 1744#endif`,nA=`vec4 mvPosition = vec4( transformed, 1.0 ); 1745#ifdef USE_BATCHING 1746 mvPosition = batchingMatrix * mvPosition; 1747#endif 1748#ifdef USE_INSTANCING 1749 mvPosition = instanceMatrix * mvPosition; 1750#endif 1751mvPosition = modelViewMatrix * mvPosition; 1752gl_Position = projectionMatrix * mvPosition;`,iA=`#ifdef DITHERING 1753 gl_FragColor.rgb = dithering( gl_FragColor.rgb ); 1754#endif`,rA=`#ifdef DITHERING 1755 vec3 dithering( vec3 color ) { 1756 float grid_position = rand( gl_FragCoord.xy ); 1757 vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); 1758 dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); 1759 return color + dither_shift_RGB; 1760 } 1761#endif`,sA=`float roughnessFactor = roughness; 1762#ifdef USE_ROUGHNESSMAP 1763 vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); 1764 roughnessFactor *= texelRoughness.g; 1765#endif`,aA=`#ifdef USE_ROUGHNESSMAP 1766 uniform sampler2D roughnessMap; 1767#endif`,oA=`#if NUM_SPOT_LIGHT_COORDS > 0 1768 varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; 1769#endif 1770#if NUM_SPOT_LIGHT_MAPS > 0 1771 uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ]; 1772#endif 1773#ifdef USE_SHADOWMAP 1774 #if NUM_DIR_LIGHT_SHADOWS > 0 1775 #if defined( SHADOWMAP_TYPE_PCF ) 1776 uniform sampler2DShadow directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; 1777 #else 1778 uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; 1779 #endif 1780 varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; 1781 struct DirectionalLightShadow { 1782 float shadowIntensity; 1783 float shadowBias; 1784 float shadowNormalBias; 1785 float shadowRadius; 1786 vec2 shadowMapSize; 1787 }; 1788 uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; 1789 #endif 1790 #if NUM_SPOT_LIGHT_SHADOWS > 0 1791 #if defined( SHADOWMAP_TYPE_PCF ) 1792 uniform sampler2DShadow spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; 1793 #else 1794 uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; 1795 #endif 1796 struct SpotLightShadow { 1797 float shadowIntensity; 1798 float shadowBias; 1799 float shadowNormalBias; 1800 float shadowRadius; 1801 vec2 shadowMapSize; 1802 }; 1803 uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; 1804 #endif 1805 #if NUM_POINT_LIGHT_SHADOWS > 0 1806 #if defined( SHADOWMAP_TYPE_PCF ) 1807 uniform samplerCubeShadow pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; 1808 #elif defined( SHADOWMAP_TYPE_BASIC ) 1809 uniform samplerCube pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; 1810 #endif 1811 varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; 1812 struct PointLightShadow { 1813 float shadowIntensity; 1814 float shadowBias; 1815 float shadowNormalBias; 1816 float shadowRadius; 1817 vec2 shadowMapSize; 1818 float shadowCameraNear; 1819 float shadowCameraFar; 1820 }; 1821 uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; 1822 #endif 1823 #if defined( SHADOWMAP_TYPE_PCF ) 1824 float interleavedGradientNoise( vec2 position ) { 1825 return fract( 52.9829189 * fract( dot( position, vec2( 0.06711056, 0.00583715 ) ) ) ); 1826 } 1827 vec2 vogelDiskSample( int sampleIndex, int samplesCount, float phi ) { 1828 const float goldenAngle = 2.399963229728653; 1829 float r = sqrt( ( float( sampleIndex ) + 0.5 ) / float( samplesCount ) ); 1830 float theta = float( sampleIndex ) * goldenAngle + phi; 1831 return vec2( cos( theta ), sin( theta ) ) * r; 1832 } 1833 #endif 1834 #if defined( SHADOWMAP_TYPE_PCF ) 1835 float getShadow( sampler2DShadow shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) { 1836 float shadow = 1.0; 1837 shadowCoord.xyz /= shadowCoord.w; 1838 shadowCoord.z += shadowBias; 1839 bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0; 1840 bool frustumTest = inFrustum && shadowCoord.z <= 1.0; 1841 if ( frustumTest ) { 1842 vec2 texelSize = vec2( 1.0 ) / shadowMapSize; 1843 float radius = shadowRadius * texelSize.x; 1844 float phi = interleavedGradientNoise( gl_FragCoord.xy ) * PI2; 1845 shadow = ( 1846 texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 0, 5, phi ) * radius, shadowCoord.z ) ) + 1847 texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 1, 5, phi ) * radius, shadowCoord.z ) ) + 1848 texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 2, 5, phi ) * radius, shadowCoord.z ) ) + 1849 texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 3, 5, phi ) * radius, shadowCoord.z ) ) + 1850 texture( shadowMap, vec3( shadowCoord.xy + vogelDiskSample( 4, 5, phi ) * radius, shadowCoord.z ) ) 1851 ) * 0.2; 1852 } 1853 return mix( 1.0, shadow, shadowIntensity ); 1854 } 1855 #elif defined( SHADOWMAP_TYPE_VSM ) 1856 float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) { 1857 float shadow = 1.0; 1858 shadowCoord.xyz /= shadowCoord.w; 1859 #ifdef USE_REVERSED_DEPTH_BUFFER 1860 shadowCoord.z -= shadowBias; 1861 #else 1862 shadowCoord.z += shadowBias; 1863 #endif 1864 bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0; 1865 bool frustumTest = inFrustum && shadowCoord.z <= 1.0; 1866 if ( frustumTest ) { 1867 vec2 distribution = texture2D( shadowMap, shadowCoord.xy ).rg; 1868 float mean = distribution.x; 1869 float variance = distribution.y * distribution.y; 1870 #ifdef USE_REVERSED_DEPTH_BUFFER 1871 float hard_shadow = step( mean, shadowCoord.z ); 1872 #else 1873 float hard_shadow = step( shadowCoord.z, mean ); 1874 #endif 1875 1876 if ( hard_shadow == 1.0 ) { 1877 shadow = 1.0; 1878 } else { 1879 variance = max( variance, 0.0000001 ); 1880 float d = shadowCoord.z - mean; 1881 float p_max = variance / ( variance + d * d ); 1882 p_max = clamp( ( p_max - 0.3 ) / 0.65, 0.0, 1.0 ); 1883 shadow = max( hard_shadow, p_max ); 1884 } 1885 } 1886 return mix( 1.0, shadow, shadowIntensity ); 1887 } 1888 #else 1889 float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) { 1890 float shadow = 1.0; 1891 shadowCoord.xyz /= shadowCoord.w; 1892 #ifdef USE_REVERSED_DEPTH_BUFFER 1893 shadowCoord.z -= shadowBias; 1894 #else 1895 shadowCoord.z += shadowBias; 1896 #endif 1897 bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0; 1898 bool frustumTest = inFrustum && shadowCoord.z <= 1.0; 1899 if ( frustumTest ) { 1900 float depth = texture2D( shadowMap, shadowCoord.xy ).r; 1901 #ifdef USE_REVERSED_DEPTH_BUFFER 1902 shadow = step( depth, shadowCoord.z ); 1903 #else 1904 shadow = step( shadowCoord.z, depth ); 1905 #endif 1906 } 1907 return mix( 1.0, shadow, shadowIntensity ); 1908 } 1909 #endif 1910 #if NUM_POINT_LIGHT_SHADOWS > 0 1911 #if defined( SHADOWMAP_TYPE_PCF ) 1912 float getPointShadow( samplerCubeShadow shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { 1913 float shadow = 1.0; 1914 vec3 lightToPosition = shadowCoord.xyz; 1915 vec3 bd3D = normalize( lightToPosition ); 1916 vec3 absVec = abs( lightToPosition ); 1917 float viewSpaceZ = max( max( absVec.x, absVec.y ), absVec.z ); 1918 if ( viewSpaceZ - shadowCameraFar <= 0.0 && viewSpaceZ - shadowCameraNear >= 0.0 ) { 1919 #ifdef USE_REVERSED_DEPTH_BUFFER 1920 float dp = ( shadowCameraNear * ( shadowCameraFar - viewSpaceZ ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) );
1921 dp -= shadowBias; 1922 #else 1923 float dp = ( shadowCameraFar * ( viewSpaceZ - shadowCameraNear ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) ); 1924 dp += shadowBias; 1925 #endif 1926 float texelSize = shadowRadius / shadowMapSize.x; 1927 vec3 absDir = abs( bd3D ); 1928 vec3 tangent = absDir.x > absDir.z ? vec3( 0.0, 1.0, 0.0 ) : vec3( 1.0, 0.0, 0.0 ); 1929 tangent = normalize( cross( bd3D, tangent ) ); 1930 vec3 bitangent = cross( bd3D, tangent ); 1931 float phi = interleavedGradientNoise( gl_FragCoord.xy ) * PI2; 1932 vec2 sample0 = vogelDiskSample( 0, 5, phi ); 1933 vec2 sample1 = vogelDiskSample( 1, 5, phi ); 1934 vec2 sample2 = vogelDiskSample( 2, 5, phi ); 1935 vec2 sample3 = vogelDiskSample( 3, 5, phi ); 1936 vec2 sample4 = vogelDiskSample( 4, 5, phi ); 1937 shadow = ( 1938 texture( shadowMap, vec4( bd3D + ( tangent * sample0.x + bitangent * sample0.y ) * texelSize, dp ) ) + 1939 texture( shadowMap, vec4( bd3D + ( tangent * sample1.x + bitangent * sample1.y ) * texelSize, dp ) ) + 1940 texture( shadowMap, vec4( bd3D + ( tangent * sample2.x + bitangent * sample2.y ) * texelSize, dp ) ) + 1941 texture( shadowMap, vec4( bd3D + ( tangent * sample3.x + bitangent * sample3.y ) * texelSize, dp ) ) + 1942 texture( shadowMap, vec4( bd3D + ( tangent * sample4.x + bitangent * sample4.y ) * texelSize, dp ) ) 1943 ) * 0.2; 1944 } 1945 return mix( 1.0, shadow, shadowIntensity ); 1946 } 1947 #elif defined( SHADOWMAP_TYPE_BASIC ) 1948 float getPointShadow( samplerCube shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { 1949 float shadow = 1.0; 1950 vec3 lightToPosition = shadowCoord.xyz; 1951 vec3 absVec = abs( lightToPosition ); 1952 float viewSpaceZ = max( max( absVec.x, absVec.y ), absVec.z ); 1953 if ( viewSpaceZ - shadowCameraFar <= 0.0 && viewSpaceZ - shadowCameraNear >= 0.0 ) { 1954 float dp = ( shadowCameraFar * ( viewSpaceZ - shadowCameraNear ) ) / ( viewSpaceZ * ( shadowCameraFar - shadowCameraNear ) ); 1955 dp += shadowBias; 1956 vec3 bd3D = normalize( lightToPosition ); 1957 float depth = textureCube( shadowMap, bd3D ).r; 1958 #ifdef USE_REVERSED_DEPTH_BUFFER 1959 depth = 1.0 - depth; 1960 #endif 1961 shadow = step( dp, depth ); 1962 } 1963 return mix( 1.0, shadow, shadowIntensity ); 1964 } 1965 #endif 1966 #endif 1967#endif`,lA=`#if NUM_SPOT_LIGHT_COORDS > 0 1968 uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; 1969 varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; 1970#endif 1971#ifdef USE_SHADOWMAP 1972 #if NUM_DIR_LIGHT_SHADOWS > 0 1973 uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; 1974 varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; 1975 struct DirectionalLightShadow { 1976 float shadowIntensity; 1977 float shadowBias; 1978 float shadowNormalBias; 1979 float shadowRadius; 1980 vec2 shadowMapSize; 1981 }; 1982 uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; 1983 #endif 1984 #if NUM_SPOT_LIGHT_SHADOWS > 0 1985 struct SpotLightShadow { 1986 float shadowIntensity; 1987 float shadowBias; 1988 float shadowNormalBias; 1989 float shadowRadius; 1990 vec2 shadowMapSize; 1991 }; 1992 uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; 1993 #endif 1994 #if NUM_POINT_LIGHT_SHADOWS > 0 1995 uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; 1996 varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; 1997 struct PointLightShadow { 1998 float shadowIntensity; 1999 float shadowBias; 2000 float shadowNormalBias; 2001 float shadowRadius; 2002 vec2 shadowMapSize; 2003 float shadowCameraNear; 2004 float shadowCameraFar; 2005 }; 2006 uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; 2007 #endif 2008#endif`,cA=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) 2009 #ifdef HAS_NORMAL 2010 vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); 2011 #else 2012 vec3 shadowWorldNormal = vec3( 0.0 ); 2013 #endif 2014 vec4 shadowWorldPosition; 2015#endif 2016#if defined( USE_SHADOWMAP ) 2017 #if NUM_DIR_LIGHT_SHADOWS > 0 2018 #pragma unroll_loop_start 2019 for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { 2020 shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 ); 2021 vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition; 2022 } 2023 #pragma unroll_loop_end 2024 #endif 2025 #if NUM_POINT_LIGHT_SHADOWS > 0 2026 #pragma unroll_loop_start 2027 for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { 2028 shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 ); 2029 vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition; 2030 } 2031 #pragma unroll_loop_end 2032 #endif 2033#endif
2034#if NUM_SPOT_LIGHT_COORDS > 0 2035 #pragma unroll_loop_start 2036 for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) { 2037 shadowWorldPosition = worldPosition; 2038 #if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) 2039 shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias; 2040 #endif 2041 vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition; 2042 } 2043 #pragma unroll_loop_end 2044#endif`,uA=`float getShadowMask() { 2045 float shadow = 1.0; 2046 #ifdef USE_SHADOWMAP 2047 #if NUM_DIR_LIGHT_SHADOWS > 0 2048 DirectionalLightShadow directionalLight; 2049 #pragma unroll_loop_start 2050 for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { 2051 directionalLight = directionalLightShadows[ i ]; 2052 shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; 2053 } 2054 #pragma unroll_loop_end 2055 #endif 2056 #if NUM_SPOT_LIGHT_SHADOWS > 0 2057 SpotLightShadow spotLight; 2058 #pragma unroll_loop_start 2059 for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { 2060 spotLight = spotLightShadows[ i ]; 2061 shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; 2062 } 2063 #pragma unroll_loop_end 2064 #endif 2065 #if NUM_POINT_LIGHT_SHADOWS > 0 && ( defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_BASIC ) ) 2066 PointLightShadow pointLight; 2067 #pragma unroll_loop_start 2068 for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { 2069 pointLight = pointLightShadows[ i ]; 2070 shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; 2071 } 2072 #pragma unroll_loop_end 2073 #endif 2074 #endif 2075 return shadow; 2076}`,hA=`#ifdef USE_SKINNING 2077 mat4 boneMatX = getBoneMatrix( skinIndex.x ); 2078 mat4 boneMatY = getBoneMatrix( skinIndex.y ); 2079 mat4 boneMatZ = getBoneMatrix( skinIndex.z ); 2080 mat4 boneMatW = getBoneMatrix( skinIndex.w ); 2081#endif`,dA=`#ifdef USE_SKINNING 2082 uniform mat4 bindMatrix; 2083 uniform mat4 bindMatrixInverse; 2084 uniform highp sampler2D boneTexture; 2085 mat4 getBoneMatrix( const in float i ) { 2086 int size = textureSize( boneTexture, 0 ).x; 2087 int j = int( i ) * 4; 2088 int x = j % size; 2089 int y = j / size; 2090 vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 ); 2091 vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 ); 2092 vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 ); 2093 vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 ); 2094 return mat4( v1, v2, v3, v4 ); 2095 } 2096#endif`,fA=`#ifdef USE_SKINNING 2097 vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); 2098 vec4 skinned = vec4( 0.0 ); 2099 skinned += boneMatX * skinVertex * skinWeight.x; 2100 skinned += boneMatY * skinVertex * skinWeight.y; 2101 skinned += boneMatZ * skinVertex * skinWeight.z; 2102 skinned += boneMatW * skinVertex * skinWeight.w; 2103 transformed = ( bindMatrixInverse * skinned ).xyz; 2104#endif`,pA=`#ifdef USE_SKINNING 2105 mat4 skinMatrix = mat4( 0.0 ); 2106 skinMatrix += skinWeight.x * boneMatX; 2107 skinMatrix += skinWeight.y * boneMatY; 2108 skinMatrix += skinWeight.z * boneMatZ; 2109 skinMatrix += skinWeight.w * boneMatW; 2110 skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix; 2111 objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz; 2112 #ifdef USE_TANGENT 2113 objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; 2114 #endif 2115#endif`,mA=`float specularStrength; 2116#ifdef USE_SPECULARMAP 2117 vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); 2118 specularStrength = texelSpecular.r; 2119#else 2120 specularStrength = 1.0; 2121#endif`,gA=`#ifdef USE_SPECULARMAP 2122 uniform sampler2D specularMap; 2123#endif`,_A=`#if defined( TONE_MAPPING ) 2124 gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); 2125#endif`,vA=`#ifndef saturate 2126#define saturate( a ) clamp( a, 0.0, 1.0 ) 2127#endif 2128uniform float toneMappingExposure; 2129vec3 LinearToneMapping( vec3 color ) { 2130 return saturate( toneMappingExposure * color ); 2131} 2132vec3 ReinhardToneMapping( vec3 color ) { 2133 color *= toneMappingExposure; 2134 return saturate( color / ( vec3( 1.0 ) + color ) ); 2135} 2136vec3 CineonToneMapping( vec3 color ) { 2137 color *= toneMappingExposure; 2138 color = max( vec3( 0.0 ), color - 0.004 ); 2139 return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); 2140} 2141vec3 RRTAndODTFit( vec3 v ) { 2142 vec3 a = v * ( v + 0.0245786 ) - 0.000090537; 2143 vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081; 2144 return a / b; 2145} 2146vec3 ACESFilmicToneMapping( vec3 color ) { 2147 const mat3 ACESInputMat = mat3( 2148 vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ), 2149 vec3( 0.04823, 0.01566, 0.83777 ) 2150 ); 2151 const mat3 ACESOutputMat = mat3( 2152 vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ), 2153 vec3( -0.07367, -0.00605, 1.07602 ) 2154 ); 2155 color *= toneMappingExposure / 0.6; 2156 color = ACESInputMat * color; 2157 color = RRTAndODTFit( color ); 2158 color = ACESOutputMat * color; 2159 return saturate( color ); 2160} 2161const mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3( 2162 vec3( 1.6605, - 0.1246, - 0.0182 ), 2163 vec3( - 0.5876, 1.1329, - 0.1006 ), 2164 vec3( - 0.0728, - 0.0083, 1.1187 ) 2165); 2166const mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3( 2167 vec3( 0.6274, 0.0691, 0.0164 ), 2168 vec3( 0.3293, 0.9195, 0.0880 ), 2169 vec3( 0.0433, 0.0113, 0.8956 ) 2170); 2171vec3 agxDefaultContrastApprox( vec3 x ) { 2172 vec3 x2 = x * x; 2173 vec3 x4 = x2 * x2; 2174 return + 15.5 * x4 * x2 2175 - 40.14 * x4 * x 2176 + 31.96 * x4 2177 - 6.868 * x2 * x 2178 + 0.4298 * x2 2179 + 0.1191 * x 2180 - 0.00232; 2181} 2182vec3 AgXToneMapping( vec3 color ) { 2183 const mat3 AgXInsetMatrix = mat3( 2184 vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ), 2185 vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ), 2186 vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 ) 2187 );
2188 const mat3 AgXOutsetMatrix = mat3( 2189 vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ), 2190 vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ), 2191 vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 ) 2192 ); 2193 const float AgxMinEv = - 12.47393; const float AgxMaxEv = 4.026069; 2194 color *= toneMappingExposure; 2195 color = LINEAR_SRGB_TO_LINEAR_REC2020 * color; 2196 color = AgXInsetMatrix * color; 2197 color = max( color, 1e-10 ); color = log2( color ); 2198 color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv ); 2199 color = clamp( color, 0.0, 1.0 ); 2200 color = agxDefaultContrastApprox( color ); 2201 color = AgXOutsetMatrix * color; 2202 color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) ); 2203 color = LINEAR_REC2020_TO_LINEAR_SRGB * color; 2204 color = clamp( color, 0.0, 1.0 ); 2205 return color; 2206} 2207vec3 NeutralToneMapping( vec3 color ) { 2208 const float StartCompression = 0.8 - 0.04; 2209 const float Desaturation = 0.15; 2210 color *= toneMappingExposure; 2211 float x = min( color.r, min( color.g, color.b ) ); 2212 float offset = x < 0.08 ? x - 6.25 * x * x : 0.04; 2213 color -= offset; 2214 float peak = max( color.r, max( color.g, color.b ) ); 2215 if ( peak < StartCompression ) return color; 2216 float d = 1. - StartCompression; 2217 float newPeak = 1. - d * d / ( peak + d - StartCompression ); 2218 color *= newPeak / peak; 2219 float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. ); 2220 return mix( color, vec3( newPeak ), g ); 2221} 2222vec3 CustomToneMapping( vec3 color ) { return color; }`,xA=`#ifdef USE_TRANSMISSION 2223 material.transmission = transmission; 2224 material.transmissionAlpha = 1.0; 2225 material.thickness = thickness; 2226 material.attenuationDistance = attenuationDistance; 2227 material.attenuationColor = attenuationColor; 2228 #ifdef USE_TRANSMISSIONMAP 2229 material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r; 2230 #endif 2231 #ifdef USE_THICKNESSMAP 2232 material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g; 2233 #endif 2234 vec3 pos = vWorldPosition; 2235 vec3 v = normalize( cameraPosition - pos ); 2236 vec3 n = inverseTransformDirection( normal, viewMatrix ); 2237 vec4 transmitted = getIBLVolumeRefraction( 2238 n, v, material.roughness, material.diffuseContribution, material.specularColorBlended, material.specularF90, 2239 pos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness, 2240 material.attenuationColor, material.attenuationDistance ); 2241 material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission ); 2242 totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission ); 2243#endif`,yA=`#ifdef USE_TRANSMISSION 2244 uniform float transmission; 2245 uniform float thickness; 2246 uniform float attenuationDistance; 2247 uniform vec3 attenuationColor; 2248 #ifdef USE_TRANSMISSIONMAP 2249 uniform sampler2D transmissionMap; 2250 #endif 2251 #ifdef USE_THICKNESSMAP 2252 uniform sampler2D thicknessMap; 2253 #endif 2254 uniform vec2 transmissionSamplerSize; 2255 uniform sampler2D transmissionSamplerMap; 2256 uniform mat4 modelMatrix; 2257 uniform mat4 projectionMatrix; 2258 varying vec3 vWorldPosition; 2259 float w0( float a ) { 2260 return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 ); 2261 } 2262 float w1( float a ) { 2263 return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 ); 2264 } 2265 float w2( float a ){ 2266 return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 ); 2267 } 2268 float w3( float a ) { 2269 return ( 1.0 / 6.0 ) * ( a * a * a ); 2270 } 2271 float g0( float a ) { 2272 return w0( a ) + w1( a ); 2273 } 2274 float g1( float a ) { 2275 return w2( a ) + w3( a ); 2276 } 2277 float h0( float a ) { 2278 return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) ); 2279 } 2280 float h1( float a ) { 2281 return 1.0 + w3( a ) / ( w2( a ) + w3( a ) ); 2282 } 2283 vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) { 2284 uv = uv * texelSize.zw + 0.5; 2285 vec2 iuv = floor( uv ); 2286 vec2 fuv = fract( uv ); 2287 float g0x = g0( fuv.x ); 2288 float g1x = g1( fuv.x ); 2289 float h0x = h0( fuv.x ); 2290 float h1x = h1( fuv.x ); 2291 float h0y = h0( fuv.y ); 2292 float h1y = h1( fuv.y ); 2293 vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; 2294 vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; 2295 vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; 2296 vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; 2297 return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) + 2298 g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) ); 2299 } 2300 vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) { 2301 vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) ); 2302 vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) ); 2303 vec2 fLodSizeInv = 1.0 / fLodSize; 2304 vec2 cLodSizeInv = 1.0 / cLodSize; 2305 vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) ); 2306 vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) ); 2307 return mix( fSample, cSample, fract( lod ) ); 2308 } 2309 vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) { 2310 vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior ); 2311 vec3 modelScale; 2312 modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) ); 2313 modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) ); 2314 modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) ); 2315 return normalize( refractionVector ) * thickness * modelScale; 2316 } 2317 float applyIorToRoughness( const in float roughness, const in float ior ) { 2318 return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 ); 2319 } 2320 vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) { 2321 float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior ); 2322 return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod ); 2323 } 2324 vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) { 2325 if ( isinf( attenuationDistance ) ) { 2326 return vec3( 1.0 ); 2327 } else { 2328 vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance; 2329 vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance; 2330 } 2331 } 2332 vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor, 2333 const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix, 2334 const in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness, 2335 const in vec3 attenuationColor, const in float attenuationDistance ) { 2336 vec4 transmittedLight; 2337 vec3 transmittance; 2338 #ifdef USE_DISPERSION 2339 float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion; 2340 vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread ); 2341 for ( int i = 0; i < 3; i ++ ) { 2342 vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix ); 2343 vec3 refractedRayExit = position + transmissionRay; 2344 vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); 2345 vec2 refractionCoords = ndcPos.xy / ndcPos.w; 2346 refractionCoords += 1.0; 2347 refractionCoords /= 2.0; 2348 vec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] ); 2349 transmittedLight[ i ] = transmissionSample[ i ]; 2350 transmittedLight.a += transmissionSample.a; 2351 transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ]; 2352 } 2353 transmittedLight.a /= 3.0; 2354 #else 2355 vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix ); 2356 vec3 refractedRayExit = position + transmissionRay; 2357 vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); 2358 vec2 refractionCoords = ndcPos.xy / ndcPos.w; 2359 refractionCoords += 1.0; 2360 refractionCoords /= 2.0; 2361 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior ); 2362 transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance ); 2363 #endif 2364 vec3 attenuatedColor = transmittance * transmittedLight.rgb; 2365 vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness ); 2366 float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0; 2367 return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor ); 2368 } 2369#endif`,bA=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) 2370 varying vec2 vUv; 2371#endif 2372#ifdef USE_MAP 2373 varying vec2 vMapUv; 2374#endif 2375#ifdef USE_ALPHAMAP
2376 varying vec2 vAlphaMapUv; 2377#endif 2378#ifdef USE_LIGHTMAP 2379 varying vec2 vLightMapUv; 2380#endif 2381#ifdef USE_AOMAP 2382 varying vec2 vAoMapUv; 2383#endif 2384#ifdef USE_BUMPMAP 2385 varying vec2 vBumpMapUv; 2386#endif 2387#ifdef USE_NORMALMAP 2388 varying vec2 vNormalMapUv; 2389#endif 2390#ifdef USE_EMISSIVEMAP 2391 varying vec2 vEmissiveMapUv; 2392#endif 2393#ifdef USE_METALNESSMAP 2394 varying vec2 vMetalnessMapUv; 2395#endif 2396#ifdef USE_ROUGHNESSMAP 2397 varying vec2 vRoughnessMapUv; 2398#endif 2399#ifdef USE_ANISOTROPYMAP 2400 varying vec2 vAnisotropyMapUv; 2401#endif 2402#ifdef USE_CLEARCOATMAP 2403 varying vec2 vClearcoatMapUv; 2404#endif 2405#ifdef USE_CLEARCOAT_NORMALMAP 2406 varying vec2 vClearcoatNormalMapUv; 2407#endif 2408#ifdef USE_CLEARCOAT_ROUGHNESSMAP 2409 varying vec2 vClearcoatRoughnessMapUv; 2410#endif 2411#ifdef USE_IRIDESCENCEMAP 2412 varying vec2 vIridescenceMapUv; 2413#endif 2414#ifdef USE_IRIDESCENCE_THICKNESSMAP 2415 varying vec2 vIridescenceThicknessMapUv; 2416#endif 2417#ifdef USE_SHEEN_COLORMAP 2418 varying vec2 vSheenColorMapUv; 2419#endif 2420#ifdef USE_SHEEN_ROUGHNESSMAP 2421 varying vec2 vSheenRoughnessMapUv; 2422#endif 2423#ifdef USE_SPECULARMAP 2424 varying vec2 vSpecularMapUv; 2425#endif 2426#ifdef USE_SPECULAR_COLORMAP 2427 varying vec2 vSpecularColorMapUv; 2428#endif 2429#ifdef USE_SPECULAR_INTENSITYMAP 2430 varying vec2 vSpecularIntensityMapUv; 2431#endif 2432#ifdef USE_TRANSMISSIONMAP 2433 uniform mat3 transmissionMapTransform; 2434 varying vec2 vTransmissionMapUv; 2435#endif 2436#ifdef USE_THICKNESSMAP 2437 uniform mat3 thicknessMapTransform; 2438 varying vec2 vThicknessMapUv; 2439#endif`,SA=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) 2440 varying vec2 vUv; 2441#endif 2442#ifdef USE_MAP 2443 uniform mat3 mapTransform; 2444 varying vec2 vMapUv; 2445#endif 2446#ifdef USE_ALPHAMAP 2447 uniform mat3 alphaMapTransform; 2448 varying vec2 vAlphaMapUv; 2449#endif 2450#ifdef USE_LIGHTMAP 2451 uniform mat3 lightMapTransform; 2452 varying vec2 vLightMapUv; 2453#endif 2454#ifdef USE_AOMAP 2455 uniform mat3 aoMapTransform; 2456 varying vec2 vAoMapUv; 2457#endif 2458#ifdef USE_BUMPMAP 2459 uniform mat3 bumpMapTransform; 2460 varying vec2 vBumpMapUv; 2461#endif 2462#ifdef USE_NORMALMAP 2463 uniform mat3 normalMapTransform; 2464 varying vec2 vNormalMapUv; 2465#endif 2466#ifdef USE_DISPLACEMENTMAP 2467 uniform mat3 displacementMapTransform; 2468 varying vec2 vDisplacementMapUv; 2469#endif 2470#ifdef USE_EMISSIVEMAP 2471 uniform mat3 emissiveMapTransform; 2472 varying vec2 vEmissiveMapUv; 2473#endif 2474#ifdef USE_METALNESSMAP 2475 uniform mat3 metalnessMapTransform; 2476 varying vec2 vMetalnessMapUv; 2477#endif 2478#ifdef USE_ROUGHNESSMAP 2479 uniform mat3 roughnessMapTransform; 2480 varying vec2 vRoughnessMapUv; 2481#endif 2482#ifdef USE_ANISOTROPYMAP 2483 uniform mat3 anisotropyMapTransform; 2484 varying vec2 vAnisotropyMapUv; 2485#endif 2486#ifdef USE_CLEARCOATMAP 2487 uniform mat3 clearcoatMapTransform; 2488 varying vec2 vClearcoatMapUv; 2489#endif 2490#ifdef USE_CLEARCOAT_NORMALMAP 2491 uniform mat3 clearcoatNormalMapTransform; 2492 varying vec2 vClearcoatNormalMapUv; 2493#endif 2494#ifdef USE_CLEARCOAT_ROUGHNESSMAP 2495 uniform mat3 clearcoatRoughnessMapTransform; 2496 varying vec2 vClearcoatRoughnessMapUv; 2497#endif 2498#ifdef USE_SHEEN_COLORMAP 2499 uniform mat3 sheenColorMapTransform; 2500 varying vec2 vSheenColorMapUv; 2501#endif 2502#ifdef USE_SHEEN_ROUGHNESSMAP 2503 uniform mat3 sheenRoughnessMapTransform; 2504 varying vec2 vSheenRoughnessMapUv; 2505#endif 2506#ifdef USE_IRIDESCENCEMAP 2507 uniform mat3 iridescenceMapTransform; 2508 varying vec2 vIridescenceMapUv; 2509#endif 2510#ifdef USE_IRIDESCENCE_THICKNESSMAP 2511 uniform mat3 iridescenceThicknessMapTransform; 2512 varying vec2 vIridescenceThicknessMapUv; 2513#endif 2514#ifdef USE_SPECULARMAP 2515 uniform mat3 specularMapTransform; 2516 varying vec2 vSpecularMapUv; 2517#endif 2518#ifdef USE_SPECULAR_COLORMAP 2519 uniform mat3 specularColorMapTransform; 2520 varying vec2 vSpecularColorMapUv; 2521#endif 2522#ifdef USE_SPECULAR_INTENSITYMAP 2523 uniform mat3 specularIntensityMapTransform; 2524 varying vec2 vSpecularIntensityMapUv; 2525#endif 2526#ifdef USE_TRANSMISSIONMAP 2527 uniform mat3 transmissionMapTransform; 2528 varying vec2 vTransmissionMapUv; 2529#endif 2530#ifdef USE_THICKNESSMAP 2531 uniform mat3 thicknessMapTransform; 2532 varying vec2 vThicknessMapUv; 2533#endif`,MA=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) 2534 vUv = vec3( uv, 1 ).xy; 2535#endif 2536#ifdef USE_MAP 2537 vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy; 2538#endif 2539#ifdef USE_ALPHAMAP 2540 vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy; 2541#endif 2542#ifdef USE_LIGHTMAP 2543 vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy; 2544#endif 2545#ifdef USE_AOMAP 2546 vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy; 2547#endif 2548#ifdef USE_BUMPMAP 2549 vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy; 2550#endif 2551#ifdef USE_NORMALMAP 2552 vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy; 2553#endif 2554#ifdef USE_DISPLACEMENTMAP 2555 vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy; 2556#endif 2557#ifdef USE_EMISSIVEMAP 2558 vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy; 2559#endif 2560#ifdef USE_METALNESSMAP 2561 vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy; 2562#endif 2563#ifdef USE_ROUGHNESSMAP 2564 vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy; 2565#endif 2566#ifdef USE_ANISOTROPYMAP 2567 vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy; 2568#endif 2569#ifdef USE_CLEARCOATMAP 2570 vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy; 2571#endif 2572#ifdef USE_CLEARCOAT_NORMALMAP 2573 vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy; 2574#endif 2575#ifdef USE_CLEARCOAT_ROUGHNESSMAP 2576 vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy; 2577#endif
2578#ifdef USE_IRIDESCENCEMAP 2579 vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy; 2580#endif 2581#ifdef USE_IRIDESCENCE_THICKNESSMAP 2582 vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy; 2583#endif 2584#ifdef USE_SHEEN_COLORMAP 2585 vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy; 2586#endif 2587#ifdef USE_SHEEN_ROUGHNESSMAP 2588 vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy; 2589#endif 2590#ifdef USE_SPECULARMAP 2591 vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy; 2592#endif 2593#ifdef USE_SPECULAR_COLORMAP 2594 vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy; 2595#endif 2596#ifdef USE_SPECULAR_INTENSITYMAP 2597 vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy; 2598#endif 2599#ifdef USE_TRANSMISSIONMAP 2600 vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy; 2601#endif 2602#ifdef USE_THICKNESSMAP 2603 vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy; 2604#endif`,EA=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 2605 vec4 worldPosition = vec4( transformed, 1.0 ); 2606 #ifdef USE_BATCHING 2607 worldPosition = batchingMatrix * worldPosition; 2608 #endif 2609 #ifdef USE_INSTANCING 2610 worldPosition = instanceMatrix * worldPosition; 2611 #endif 2612 worldPosition = modelMatrix * worldPosition; 2613#endif`;const TA=`varying vec2 vUv; 2614uniform mat3 uvTransform; 2615void main() { 2616 vUv = ( uvTransform * vec3( uv, 1 ) ).xy; 2617 gl_Position = vec4( position.xy, 1.0, 1.0 ); 2618}`,wA=`uniform sampler2D t2D; 2619uniform float backgroundIntensity; 2620varying vec2 vUv; 2621void main() { 2622 vec4 texColor = texture2D( t2D, vUv ); 2623 #ifdef DECODE_VIDEO_TEXTURE 2624 texColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w ); 2625 #endif 2626 texColor.rgb *= backgroundIntensity; 2627 gl_FragColor = texColor; 2628 #include <tonemapping_fragment> 2629 #include <colorspace_fragment> 2630}`,AA=`varying vec3 vWorldDirection; 2631#include <common> 2632void main() { 2633 vWorldDirection = transformDirection( position, modelMatrix ); 2634 #include <begin_vertex> 2635 #include <project_vertex> 2636 gl_Position.z = gl_Position.w; 2637}`,CA=`#ifdef ENVMAP_TYPE_CUBE 2638 uniform samplerCube envMap; 2639#elif defined( ENVMAP_TYPE_CUBE_UV ) 2640 uniform sampler2D envMap; 2641#endif 2642uniform float backgroundBlurriness; 2643uniform float backgroundIntensity; 2644uniform mat3 backgroundRotation; 2645varying vec3 vWorldDirection; 2646#include <cube_uv_reflection_fragment> 2647void main() { 2648 #ifdef ENVMAP_TYPE_CUBE 2649 vec4 texColor = textureCube( envMap, backgroundRotation * vWorldDirection ); 2650 #elif defined( ENVMAP_TYPE_CUBE_UV ) 2651 vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness ); 2652 #else 2653 vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 ); 2654 #endif 2655 texColor.rgb *= backgroundIntensity; 2656 gl_FragColor = texColor; 2657 #include <tonemapping_fragment> 2658 #include <colorspace_fragment> 2659}`,RA=`varying vec3 vWorldDirection; 2660#include <common> 2661void main() { 2662 vWorldDirection = transformDirection( position, modelMatrix ); 2663 #include <begin_vertex> 2664 #include <project_vertex> 2665 gl_Position.z = gl_Position.w; 2666}`,IA=`uniform samplerCube tCube; 2667uniform float tFlip; 2668uniform float opacity; 2669varying vec3 vWorldDirection; 2670void main() { 2671 vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) ); 2672 gl_FragColor = texColor; 2673 gl_FragColor.a *= opacity; 2674 #include <tonemapping_fragment> 2675 #include <colorspace_fragment> 2676}`,PA=`#include <common> 2677#include <batching_pars_vertex> 2678#include <uv_pars_vertex> 2679#include <displacementmap_pars_vertex> 2680#include <morphtarget_pars_vertex> 2681#include <skinning_pars_vertex> 2682#include <logdepthbuf_pars_vertex> 2683#include <clipping_planes_pars_vertex> 2684varying vec2 vHighPrecisionZW; 2685void main() { 2686 #include <uv_vertex> 2687 #include <batching_vertex> 2688 #include <skinbase_vertex> 2689 #include <morphinstance_vertex> 2690 #ifdef USE_DISPLACEMENTMAP 2691 #include <beginnormal_vertex> 2692 #include <morphnormal_vertex> 2693 #include <skinnormal_vertex> 2694 #endif 2695 #include <begin_vertex> 2696 #include <morphtarget_vertex> 2697 #include <skinning_vertex> 2698 #include <displacementmap_vertex> 2699 #include <project_vertex> 2700 #include <logdepthbuf_vertex> 2701 #include <clipping_planes_vertex> 2702 vHighPrecisionZW = gl_Position.zw; 2703}`,LA=`#if DEPTH_PACKING == 3200 2704 uniform float opacity; 2705#endif 2706#include <common> 2707#include <packing> 2708#include <uv_pars_fragment> 2709#include <map_pars_fragment> 2710#include <alphamap_pars_fragment> 2711#include <alphatest_pars_fragment> 2712#include <alphahash_pars_fragment> 2713#include <logdepthbuf_pars_fragment> 2714#include <clipping_planes_pars_fragment> 2715varying vec2 vHighPrecisionZW; 2716void main() { 2717 vec4 diffuseColor = vec4( 1.0 ); 2718 #include <clipping_planes_fragment> 2719 #if DEPTH_PACKING == 3200 2720 diffuseColor.a = opacity; 2721 #endif 2722 #include <map_fragment> 2723 #include <alphamap_fragment> 2724 #include <alphatest_fragment> 2725 #include <alphahash_fragment> 2726 #include <logdepthbuf_fragment> 2727 #ifdef USE_REVERSED_DEPTH_BUFFER 2728 float fragCoordZ = vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ]; 2729 #else 2730 float fragCoordZ = 0.5 * vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ] + 0.5; 2731 #endif 2732 #if DEPTH_PACKING == 3200 2733 gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); 2734 #elif DEPTH_PACKING == 3201 2735 gl_FragColor = packDepthToRGBA( fragCoordZ ); 2736 #elif DEPTH_PACKING == 3202 2737 gl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 ); 2738 #elif DEPTH_PACKING == 3203 2739 gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 ); 2740 #endif 2741}`,NA=`#define DISTANCE 2742varying vec3 vWorldPosition; 2743#include <common> 2744#include <batching_pars_vertex> 2745#include <uv_pars_vertex> 2746#include <displacementmap_pars_vertex> 2747#include <morphtarget_pars_vertex> 2748#include <skinning_pars_vertex> 2749#include <clipping_planes_pars_vertex> 2750void main() { 2751 #include <uv_vertex> 2752 #include <batching_vertex> 2753 #include <skinbase_vertex> 2754 #include <morphinstance_vertex> 2755 #ifdef USE_DISPLACEMENTMAP 2756 #include <beginnormal_vertex> 2757 #include <morphnormal_vertex> 2758 #include <skinnormal_vertex> 2759 #endif 2760 #include <begin_vertex> 2761 #include <morphtarget_vertex> 2762 #include <skinning_vertex> 2763 #include <displacementmap_vertex> 2764 #include <project_vertex> 2765 #include <worldpos_vertex> 2766 #include <clipping_planes_vertex> 2767 vWorldPosition = worldPosition.xyz; 2768}`,DA=`#define DISTANCE 2769uniform vec3 referencePosition; 2770uniform float nearDistance; 2771uniform float farDistance; 2772varying vec3 vWorldPosition; 2773#include <common> 2774#include <uv_pars_fragment> 2775#include <map_pars_fragment> 2776#include <alphamap_pars_fragment> 2777#include <alphatest_pars_fragment> 2778#include <alphahash_pars_fragment> 2779#include <clipping_planes_pars_fragment> 2780void main () { 2781 vec4 diffuseColor = vec4( 1.0 ); 2782 #include <clipping_planes_fragment> 2783 #include <map_fragment> 2784 #include <alphamap_fragment> 2785 #include <alphatest_fragment> 2786 #include <alphahash_fragment> 2787 float dist = length( vWorldPosition - referencePosition ); 2788 dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); 2789 dist = saturate( dist ); 2790 gl_FragColor = vec4( dist, 0.0, 0.0, 1.0 ); 2791}`,OA=`varying vec3 vWorldDirection; 2792#include <common> 2793void main() { 2794 vWorldDirection = transformDirection( position, modelMatrix ); 2795 #include <begin_vertex> 2796 #include <project_vertex> 2797}`,UA=`uniform sampler2D tEquirect; 2798varying vec3 vWorldDirection; 2799#include <common> 2800void main() { 2801 vec3 direction = normalize( vWorldDirection ); 2802 vec2 sampleUV = equirectUv( direction ); 2803 gl_FragColor = texture2D( tEquirect, sampleUV ); 2804 #include <tonemapping_fragment> 2805 #include <colorspace_fragment> 2806}`,FA=`uniform float scale; 2807attribute float lineDistance; 2808varying float vLineDistance; 2809#include <common> 2810#include <uv_pars_vertex> 2811#include <color_pars_vertex> 2812#include <fog_pars_vertex> 2813#include <morphtarget_pars_vertex> 2814#include <logdepthbuf_pars_vertex> 2815#include <clipping_planes_pars_vertex> 2816void main() { 2817 vLineDistance = scale * lineDistance; 2818 #include <uv_vertex> 2819 #include <color_vertex> 2820 #include <morphinstance_vertex> 2821 #include <morphcolor_vertex> 2822 #include <begin_vertex> 2823 #include <morphtarget_vertex> 2824 #include <project_vertex> 2825 #include <logdepthbuf_vertex> 2826 #include <clipping_planes_vertex> 2827 #include <fog_vertex> 2828}`,BA=`uniform vec3 diffuse; 2829uniform float opacity; 2830uniform float dashSize; 2831uniform float totalSize; 2832varying float vLineDistance; 2833#include <common> 2834#include <color_pars_fragment> 2835#include <uv_pars_fragment> 2836#include <map_pars_fragment> 2837#include <fog_pars_fragment> 2838#include <logdepthbuf_pars_fragment> 2839#include <clipping_planes_pars_fragment> 2840void main() { 2841 vec4 diffuseColor = vec4( diffuse, opacity ); 2842 #include <clipping_planes_fragment> 2843 if ( mod( vLineDistance, totalSize ) > dashSize ) { 2844 discard; 2845 } 2846 vec3 outgoingLight = vec3( 0.0 ); 2847 #include <logdepthbuf_fragment> 2848 #include <map_fragment> 2849 #include <color_fragment> 2850 outgoingLight = diffuseColor.rgb; 2851 #include <opaque_fragment> 2852 #include <tonemapping_fragment> 2853 #include <colorspace_fragment> 2854 #include <fog_fragment> 2855 #include <premultiplied_alpha_fragment> 2856}`,kA=`#include <common> 2857#include <batching_pars_vertex> 2858#include <uv_pars_vertex> 2859#include <envmap_pars_vertex> 2860#include <color_pars_vertex> 2861#include <fog_pars_vertex> 2862#include <morphtarget_pars_vertex> 2863#include <skinning_pars_vertex> 2864#include <logdepthbuf_pars_vertex> 2865#include <clipping_planes_pars_vertex> 2866void main() { 2867 #include <uv_vertex> 2868 #include <color_vertex> 2869 #include <morphinstance_vertex> 2870 #include <morphcolor_vertex> 2871 #include <batching_vertex> 2872 #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING ) 2873 #include <beginnormal_vertex> 2874 #include <morphnormal_vertex> 2875 #include <skinbase_vertex> 2876 #include <skinnormal_vertex> 2877 #include <defaultnormal_vertex> 2878 #endif 2879 #include <begin_vertex> 2880 #include <morphtarget_vertex> 2881 #include <skinning_vertex> 2882 #include <project_vertex> 2883 #include <logdepthbuf_vertex> 2884 #include <clipping_planes_vertex> 2885 #include <worldpos_vertex> 2886 #include <envmap_vertex> 2887 #include <fog_vertex> 2888}`,VA=`uniform vec3 diffuse; 2889uniform float opacity; 2890#ifndef FLAT_SHADED 2891 varying vec3 vNormal; 2892#endif 2893#include <common> 2894#include <dithering_pars_fragment> 2895#include <color_pars_fragment> 2896#include <uv_pars_fragment> 2897#include <map_pars_fragment> 2898#include <alphamap_pars_fragment> 2899#include <alphatest_pars_fragment> 2900#include <alphahash_pars_fragment> 2901#include <aomap_pars_fragment> 2902#include <lightmap_pars_fragment> 2903#include <envmap_common_pars_fragment> 2904#include <envmap_pars_fragment> 2905#include <fog_pars_fragment> 2906#include <specularmap_pars_fragment> 2907#include <logdepthbuf_pars_fragment> 2908#include <clipping_planes_pars_fragment> 2909void main() { 2910 vec4 diffuseColor = vec4( diffuse, opacity ); 2911 #include <clipping_planes_fragment> 2912 #include <logdepthbuf_fragment> 2913 #include <map_fragment> 2914 #include <color_fragment> 2915 #include <alphamap_fragment> 2916 #include <alphatest_fragment> 2917 #include <alphahash_fragment> 2918 #include <specularmap_fragment> 2919 ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); 2920 #ifdef USE_LIGHTMAP 2921 vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); 2922 reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI; 2923 #else 2924 reflectedLight.indirectDiffuse += vec3( 1.0 ); 2925 #endif 2926 #include <aomap_fragment> 2927 reflectedLight.indirectDiffuse *= diffuseColor.rgb; 2928 vec3 outgoingLight = reflectedLight.indirectDiffuse; 2929 #include <envmap_fragment> 2930 #include <opaque_fragment> 2931 #include <tonemapping_fragment> 2932 #include <colorspace_fragment> 2933 #include <fog_fragment> 2934 #include <premultiplied_alpha_fragment> 2935 #include <dithering_fragment> 2936}`,zA=`#define LAMBERT 2937varying vec3 vViewPosition; 2938#include <common> 2939#include <batching_pars_vertex> 2940#include <uv_pars_vertex> 2941#include <displacementmap_pars_vertex> 2942#include <envmap_pars_vertex> 2943#include <color_pars_vertex> 2944#include <fog_pars_vertex> 2945#include <normal_pars_vertex> 2946#include <morphtarget_pars_vertex> 2947#include <skinning_pars_vertex> 2948#include <shadowmap_pars_vertex> 2949#include <logdepthbuf_pars_vertex> 2950#include <clipping_planes_pars_vertex> 2951void main() { 2952 #include <uv_vertex> 2953 #include <color_vertex> 2954 #include <morphinstance_vertex> 2955 #include <morphcolor_vertex> 2956 #include <batching_vertex> 2957 #include <beginnormal_vertex> 2958 #include <morphnormal_vertex> 2959 #include <skinbase_vertex> 2960 #include <skinnormal_vertex> 2961 #include <defaultnormal_vertex> 2962 #include <normal_vertex> 2963 #include <begin_vertex> 2964 #include <morphtarget_vertex> 2965 #include <skinning_vertex> 2966 #include <displacementmap_vertex> 2967 #include <project_vertex> 2968 #include <logdepthbuf_vertex> 2969 #include <clipping_planes_vertex> 2970 vViewPosition = - mvPosition.xyz; 2971 #include <worldpos_vertex> 2972 #include <envmap_vertex> 2973 #include <shadowmap_vertex> 2974 #include <fog_vertex> 2975}`,HA=`#define LAMBERT 2976uniform vec3 diffuse; 2977uniform vec3 emissive; 2978uniform float opacity; 2979#include <common> 2980#include <dithering_pars_fragment> 2981#include <color_pars_fragment> 2982#include <uv_pars_fragment> 2983#include <map_pars_fragment> 2984#include <alphamap_pars_fragment> 2985#include <alphatest_pars_fragment> 2986#include <alphahash_pars_fragment> 2987#include <aomap_pars_fragment> 2988#include <lightmap_pars_fragment> 2989#include <emissivemap_pars_fragment> 2990#include <cube_uv_reflection_fragment> 2991#include <envmap_common_pars_fragment> 2992#include <envmap_pars_fragment> 2993#include <envmap_physical_pars_fragment> 2994#include <fog_pars_fragment> 2995#include <bsdfs> 2996#include <lights_pars_begin> 2997#include <normal_pars_fragment> 2998#include <lights_lambert_pars_fragment> 2999#include <shadowmap_pars_fragment> 3000#include <bumpmap_pars_fragment> 3001#include <normalmap_pars_fragment> 3002#include <specularmap_pars_fragment> 3003#include <logdepthbuf_pars_fragment> 3004#include <clipping_planes_pars_fragment> 3005void main() { 3006 vec4 diffuseColor = vec4( diffuse, opacity ); 3007 #include <clipping_planes_fragment> 3008 ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); 3009 vec3 totalEmissiveRadiance = emissive; 3010 #include <logdepthbuf_fragment> 3011 #include <map_fragment> 3012 #include <color_fragment> 3013 #include <alphamap_fragment> 3014 #include <alphatest_fragment> 3015 #include <alphahash_fragment> 3016 #include <specularmap_fragment> 3017 #include <normal_fragment_begin> 3018 #include <normal_fragment_maps> 3019 #include <emissivemap_fragment> 3020 #include <lights_lambert_fragment> 3021 #include <lights_fragment_begin> 3022 #include <lights_fragment_maps> 3023 #include <lights_fragment_end> 3024 #include <aomap_fragment> 3025 vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; 3026 #include <envmap_fragment> 3027 #include <opaque_fragment> 3028 #include <tonemapping_fragment> 3029 #include <colorspace_fragment> 3030 #include <fog_fragment> 3031 #include <premultiplied_alpha_fragment> 3032 #include <dithering_fragment> 3033}`,GA=`#define MATCAP 3034varying vec3 vViewPosition; 3035#include <common> 3036#include <batching_pars_vertex> 3037#include <uv_pars_vertex> 3038#include <color_pars_vertex> 3039#include <displacementmap_pars_vertex> 3040#include <fog_pars_vertex> 3041#include <normal_pars_vertex> 3042#include <morphtarget_pars_vertex> 3043#include <skinning_pars_vertex> 3044#include <logdepthbuf_pars_vertex> 3045#include <clipping_planes_pars_vertex> 3046void main() { 3047 #include <uv_vertex> 3048 #include <color_vertex> 3049 #include <morphinstance_vertex> 3050 #include <morphcolor_vertex> 3051 #include <batching_vertex> 3052 #include <beginnormal_vertex> 3053 #include <morphnormal_vertex> 3054 #include <skinbase_vertex> 3055 #include <skinnormal_vertex> 3056 #include <defaultnormal_vertex> 3057 #include <normal_vertex> 3058 #include <begin_vertex> 3059 #include <morphtarget_vertex> 3060 #include <skinning_vertex> 3061 #include <displacementmap_vertex> 3062 #include <project_vertex> 3063 #include <logdepthbuf_vertex> 3064 #include <clipping_planes_vertex> 3065 #include <fog_vertex> 3066 vViewPosition = - mvPosition.xyz; 3067}`,WA=`#define MATCAP 3068uniform vec3 diffuse; 3069uniform float opacity; 3070uniform sampler2D matcap; 3071varying vec3 vViewPosition; 3072#include <common> 3073#include <dithering_pars_fragment> 3074#include <color_pars_fragment> 3075#include <uv_pars_fragment> 3076#include <map_pars_fragment> 3077#include <alphamap_pars_fragment> 3078#include <alphatest_pars_fragment> 3079#include <alphahash_pars_fragment> 3080#include <fog_pars_fragment> 3081#include <normal_pars_fragment> 3082#include <bumpmap_pars_fragment> 3083#include <normalmap_pars_fragme
3083nt> 3084#include <logdepthbuf_pars_fragment> 3085#include <clipping_planes_pars_fragment> 3086void main() { 3087 vec4 diffuseColor = vec4( diffuse, opacity ); 3088 #include <clipping_planes_fragment> 3089 #include <logdepthbuf_fragment> 3090 #include <map_fragment> 3091 #include <color_fragment> 3092 #include <alphamap_fragment> 3093 #include <alphatest_fragment> 3094 #include <alphahash_fragment> 3095 #include <normal_fragment_begin> 3096 #include <normal_fragment_maps> 3097 vec3 viewDir = normalize( vViewPosition ); 3098 vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); 3099 vec3 y = cross( viewDir, x ); 3100 vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; 3101 #ifdef USE_MATCAP 3102 vec4 matcapColor = texture2D( matcap, uv ); 3103 #else 3104 vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 ); 3105 #endif 3106 vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb; 3107 #include <opaque_fragment> 3108 #include <tonemapping_fragment> 3109 #include <colorspace_fragment> 3110 #include <fog_fragment> 3111 #include <premultiplied_alpha_fragment> 3112 #include <dithering_fragment> 3113}`,XA=`#define NORMAL 3114#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) 3115 varying vec3 vViewPosition; 3116#endif 3117#include <common> 3118#include <batching_pars_vertex> 3119#include <uv_pars_vertex> 3120#include <displacementmap_pars_vertex> 3121#include <normal_pars_vertex> 3122#include <morphtarget_pars_vertex> 3123#include <skinning_pars_vertex> 3124#include <logdepthbuf_pars_vertex> 3125#include <clipping_planes_pars_vertex> 3126void main() { 3127 #include <uv_vertex> 3128 #include <batching_vertex> 3129 #include <beginnormal_vertex> 3130 #include <morphinstance_vertex> 3131 #include <morphnormal_vertex> 3132 #include <skinbase_vertex> 3133 #include <skinnormal_vertex> 3134 #include <defaultnormal_vertex> 3135 #include <normal_vertex> 3136 #include <begin_vertex> 3137 #include <morphtarget_vertex> 3138 #include <skinning_vertex> 3139 #include <displacementmap_vertex> 3140 #include <project_vertex> 3141 #include <logdepthbuf_vertex> 3142 #include <clipping_planes_vertex> 3143#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) 3144 vViewPosition = - mvPosition.xyz; 3145#endif 3146}`,qA=`#define NORMAL 3147uniform float opacity; 3148#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) 3149 varying vec3 vViewPosition; 3150#endif 3151#include <uv_pars_fragment> 3152#include <normal_pars_fragment> 3153#include <bumpmap_pars_fragment> 3154#include <normalmap_pars_fragment> 3155#include <logdepthbuf_pars_fragment> 3156#include <clipping_planes_pars_fragment> 3157void main() { 3158 vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity ); 3159 #include <clipping_planes_fragment> 3160 #include <logdepthbuf_fragment> 3161 #include <normal_fragment_begin> 3162 #include <normal_fragment_maps> 3163 gl_FragColor = vec4( normalize( normal ) * 0.5 + 0.5, diffuseColor.a ); 3164 #ifdef OPAQUE 3165 gl_FragColor.a = 1.0; 3166 #endif 3167}`,$A=`#define PHONG 3168varying vec3 vViewPosition; 3169#include <common> 3170#include <batching_pars_vertex> 3171#include <uv_pars_vertex> 3172#include <displacementmap_pars_vertex> 3173#include <envmap_pars_vertex> 3174#include <color_pars_vertex> 3175#include <fog_pars_vertex> 3176#include <normal_pars_vertex> 3177#include <morphtarget_pars_vertex> 3178#include <skinning_pars_vertex> 3179#include <shadowmap_pars_vertex> 3180#include <logdepthbuf_pars_vertex> 3181#include <clipping_planes_pars_vertex> 3182void main() { 3183 #include <uv_vertex> 3184 #include <color_vertex> 3185 #include <morphcolor_vertex> 3186 #include <batching_vertex> 3187 #include <beginnormal_vertex> 3188 #include <morphinstance_vertex> 3189 #include <morphnormal_vertex> 3190 #include <skinbase_vertex> 3191 #include <skinnormal_vertex> 3192 #include <defaultnormal_vertex> 3193 #include <normal_vertex> 3194 #include <begin_vertex> 3195 #include <morphtarget_vertex> 3196 #include <skinning_vertex> 3197 #include <displacementmap_vertex> 3198 #include <project_vertex> 3199 #include <logdepthbuf_vertex> 3200 #include <clipping_planes_vertex> 3201 vViewPosition = - mvPosition.xyz; 3202 #include <worldpos_vertex> 3203 #include <envmap_vertex> 3204 #include <shadowmap_vertex> 3205 #include <fog_vertex> 3206}`,YA=`#define PHONG 3207uniform vec3 diffuse; 3208uniform vec3 emissive; 3209uniform vec3 specular; 3210uniform float shininess; 3211uniform float opacity; 3212#include <common> 3213#include <dithering_pars_fragment> 3214#include <color_pars_fragment> 3215#include <uv_pars_fragment> 3216#include <map_pars_fragment> 3217#include <alphamap_pars_fragment> 3218#include <alphatest_pars_fragment> 3219#include <alphahash_pars_fragment> 3220#include <aomap_pars_fragment> 3221#include <lightmap_pars_fragment> 3222#include <emissivemap_pars_fragment> 3223#include <cube_uv_reflection_fragment> 3224#include <envmap_common_pars_fragment> 3225#include <envmap_pars_fragment> 3226#include <envmap_physical_pars_fragment> 3227#include <fog_pars_fragment> 3228#include <bsdfs> 3229#include <lights_pars_begin> 3230#include <normal_pars_fragment> 3231#include <lights_phong_pars_fragment> 3232#include <shadowmap_pars_fragment> 3233#include <bumpmap_pars_fragment> 3234#include <normalmap_pars_fragment> 3235#include <specularmap_pars_fragment> 3236#include <logdepthbuf_pars_fragment> 3237#include <clipping_planes_pars_fragment> 3238void main() { 3239 vec4 diffuseColor = vec4( diffuse, opacity ); 3240 #include <clipping_planes_fragment> 3241 ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); 3242 vec3 totalEmissiveRadiance = emissive; 3243 #include <logdepthbuf_fragment> 3244 #include <map_fragment> 3245 #include <color_fragment> 3246 #include <alphamap_fragment> 3247 #include <alphatest_fragment> 3248 #include <alphahash_fragment> 3249 #include <specularmap_fragment> 3250 #include <normal_fragment_begin> 3251 #include <normal_fragment_maps> 3252 #include <emissivemap_fragment> 3253 #include <lights_phong_fragment> 3254 #include <lights_fragment_begin> 3255 #include <lights_fragment_maps> 3256 #include <lights_fragment_end> 3257 #include <aomap_fragment> 3258 vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; 3259 #include <envmap_fragment> 3260 #include <opaque_fragment> 3261 #include <tonemapping_fragment> 3262 #include <colorspace_fragment> 3263 #include <fog_fragment> 3264 #include <premultiplied_alpha_fragment> 3265 #include <dithering_fragment> 3266}`,ZA=`#define STANDARD 3267varying vec3 vViewPosition; 3268#ifdef USE_TRANSMISSION 3269 varying vec3 vWorldPosition; 3270#endif 3271#include <common> 3272#include <batching_pars_vertex> 3273#include <uv_pars_vertex> 3274#include <displacementmap_pars_vertex> 3275#include <color_pars_vertex> 3276#include <fog_pars_vertex> 3277#include <normal_pars_vertex> 3278#include <morphtarget_pars_vertex> 3279#include <skinning_pars_vertex> 3280#include <shadowmap_pars_vertex> 3281#include <logdepthbuf_pars_vertex> 3282#include <clipping_planes_pars_vertex> 3283void main() { 3284 #include <uv_vertex> 3285 #include <color_vertex> 3286 #include <morphinstance_vertex> 3287 #include <morphcolor_vertex> 3288 #include <batching_vertex> 3289 #include <beginnormal_vertex> 3290 #include <morphnormal_vertex> 3291 #include <skinbase_vertex> 3292 #include <skinnormal_vertex> 3293 #include <defaultnormal_vertex> 3294 #include <normal_vertex> 3295 #include <begin_vertex> 3296 #include <morphtarget_vertex> 3297 #include <skinning_vertex> 3298 #include <displacementmap_vertex> 3299 #include <project_vertex> 3300 #include <logdepthbuf_vertex> 3301 #include <clipping_planes_vertex> 3302 vViewPosition = - mvPosition.xyz; 3303 #include <worldpos_vertex> 3304 #include <shadowmap_vertex> 3305 #include <fog_vertex> 3306#ifdef USE_TRANSMISSION 3307 vWorldPosition = worldPosition.xyz; 3308#endif 3309}`,KA=`#define STANDARD 3310#ifdef PHYSICAL 3311 #define IOR 3312 #define USE_SPECULAR 3313#endif 3314uniform vec3 diffuse; 3315uniform vec3 emissive; 3316uniform float roughness; 3317uniform float metalness; 3318uniform float opacity; 3319#ifdef IOR 3320 uniform float ior; 3321#endif 3322#ifdef USE_SPECULAR 3323 uniform float specularIntensity; 3324 uniform vec3 specularColor; 3325 #ifdef USE_SPECULAR_COLORMAP 3326 uniform sampler2D specularColorMap; 3327 #endif 3328 #ifdef USE_SPECULAR_INTENSITYMAP 3329 uniform sampler2D specularIntensityMap; 3330 #endif 3331#endif 3332#ifdef USE_CLEARCOAT 3333 uniform float clearcoat; 3334 uniform float clearcoatRoughness; 3335#endif 3336#ifdef USE_DISPERSION 3337 uniform float dispersion; 3338#endif
3339#ifdef USE_IRIDESCENCE 3340 uniform float iridescence; 3341 uniform float iridescenceIOR; 3342 uniform float iridescenceThicknessMinimum; 3343 uniform float iridescenceThicknessMaximum; 3344#endif 3345#ifdef USE_SHEEN 3346 uniform vec3 sheenColor; 3347 uniform float sheenRoughness; 3348 #ifdef USE_SHEEN_COLORMAP 3349 uniform sampler2D sheenColorMap; 3350 #endif 3351 #ifdef USE_SHEEN_ROUGHNESSMAP 3352 uniform sampler2D sheenRoughnessMap; 3353 #endif 3354#endif 3355#ifdef USE_ANISOTROPY 3356 uniform vec2 anisotropyVector; 3357 #ifdef USE_ANISOTROPYMAP 3358 uniform sampler2D anisotropyMap; 3359 #endif 3360#endif 3361varying vec3 vViewPosition; 3362#include <common> 3363#include <dithering_pars_fragment> 3364#include <color_pars_fragment> 3365#include <uv_pars_fragment> 3366#include <map_pars_fragment> 3367#include <alphamap_pars_fragment> 3368#include <alphatest_pars_fragment> 3369#include <alphahash_pars_fragment> 3370#include <aomap_pars_fragment> 3371#include <lightmap_pars_fragment> 3372#include <emissivemap_pars_fragment> 3373#include <iridescence_fragment> 3374#include <cube_uv_reflection_fragment> 3375#include <envmap_common_pars_fragment> 3376#include <envmap_physical_pars_fragment> 3377#include <fog_pars_fragment> 3378#include <lights_pars_begin> 3379#include <normal_pars_fragment> 3380#include <lights_physical_pars_fragment> 3381#include <transmission_pars_fragment> 3382#include <shadowmap_pars_fragment> 3383#include <bumpmap_pars_fragment> 3384#include <normalmap_pars_fragment> 3385#include <clearcoat_pars_fragment> 3386#include <iridescence_pars_fragment> 3387#include <roughnessmap_pars_fragment> 3388#include <metalnessmap_pars_fragment> 3389#include <logdepthbuf_pars_fragment> 3390#include <clipping_planes_pars_fragment> 3391void main() { 3392 vec4 diffuseColor = vec4( diffuse, opacity ); 3393 #include <clipping_planes_fragment> 3394 ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); 3395 vec3 totalEmissiveRadiance = emissive; 3396 #include <logdepthbuf_fragment> 3397 #include <map_fragment> 3398 #include <color_fragment> 3399 #include <alphamap_fragment> 3400 #include <alphatest_fragment> 3401 #include <alphahash_fragment> 3402 #include <roughnessmap_fragment> 3403 #include <metalnessmap_fragment> 3404 #include <normal_fragment_begin> 3405 #include <normal_fragment_maps> 3406 #include <clearcoat_normal_fragment_begin> 3407 #include <clearcoat_normal_fragment_maps> 3408 #include <emissivemap_fragment> 3409 #include <lights_physical_fragment> 3410 #include <lights_fragment_begin> 3411 #include <lights_fragment_maps> 3412 #include <lights_fragment_end> 3413 #include <aomap_fragment> 3414 vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; 3415 vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; 3416 #include <transmission_fragment> 3417 vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance; 3418 #ifdef USE_SHEEN 3419 3420 outgoingLight = outgoingLight + sheenSpecularDirect + sheenSpecularIndirect; 3421 3422 #endif 3423 #ifdef USE_CLEARCOAT 3424 float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) ); 3425 vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc ); 3426 outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat; 3427 #endif 3428 #include <opaque_fragment> 3429 #include <tonemapping_fragment> 3430 #include <colorspace_fragment> 3431 #include <fog_fragment> 3432 #include <premultiplied_alpha_fragment> 3433 #include <dithering_fragment> 3434}`,JA=`#define TOON 3435varying vec3 vViewPosition; 3436#include <common> 3437#include <batching_pars_vertex> 3438#include <uv_pars_vertex> 3439#include <displacementmap_pars_vertex> 3440#include <color_pars_vertex> 3441#include <fog_pars_vertex> 3442#include <normal_pars_vertex> 3443#include <morphtarget_pars_vertex> 3444#include <skinning_pars_vertex> 3445#include <shadowmap_pars_vertex> 3446#include <logdepthbuf_pars_vertex> 3447#include <clipping_planes_pars_vertex> 3448void main() { 3449 #include <uv_vertex> 3450 #include <color_vertex> 3451 #include <morphinstance_vertex> 3452 #include <morphcolor_vertex> 3453 #include <batching_vertex> 3454 #include <beginnormal_vertex> 3455 #include <morphnormal_vertex> 3456 #include <skinbase_vertex> 3457 #include <skinnormal_vertex> 3458 #include <defaultnormal_vertex> 3459 #include <normal_vertex> 3460 #include <begin_vertex> 3461 #include <morphtarget_vertex> 3462 #include <skinning_vertex> 3463 #include <displacementmap_vertex> 3464 #include <project_vertex> 3465 #include <logdepthbuf_vertex> 3466 #include <clipping_planes_vertex> 3467 vViewPosition = - mvPosition.xyz; 3468 #include <worldpos_vertex> 3469 #include <shadowmap_vertex> 3470 #include <fog_vertex> 3471}`,jA=`#define TOON 3472uniform vec3 diffuse; 3473uniform vec3 emissive; 3474uniform float opacity; 3475#include <common> 3476#include <dithering_pars_fragment> 3477#include <color_pars_fragment> 3478#include <uv_pars_fragment> 3479#include <map_pars_fragment> 3480#include <alphamap_pars_fragment> 3481#include <alphatest_pars_fragment> 3482#include <alphahash_pars_fragment> 3483#include <aomap_pars_fragment> 3484#include <lightmap_pars_fragment> 3485#include <emissivemap_pars_fragment> 3486#include <gradientmap_pars_fragment> 3487#include <fog_pars_fragment> 3488#include <bsdfs> 3489#include <lights_pars_begin> 3490#include <normal_pars_fragment> 3491#include <lights_toon_pars_fragment> 3492#include <shadowmap_pars_fragment> 3493#include <bumpmap_pars_fragment> 3494#include <normalmap_pars_fragment> 3495#include <logdepthbuf_pars_fragment> 3496#include <clipping_planes_pars_fragment> 3497void main() { 3498 vec4 diffuseColor = vec4( diffuse, opacity ); 3499 #include <clipping_planes_fragment> 3500 ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); 3501 vec3 totalEmissiveRadiance = emissive; 3502 #include <logdepthbuf_fragment> 3503 #include <map_fragment> 3504 #include <color_fragment> 3505 #include <alphamap_fragment> 3506 #include <alphatest_fragment> 3507 #include <alphahash_fragment> 3508 #include <normal_fragment_begin> 3509 #include <normal_fragment_maps> 3510 #include <emissivemap_fragment> 3511 #include <lights_toon_fragment> 3512 #include <lights_fragment_begin> 3513 #include <lights_fragment_maps> 3514 #include <lights_fragment_end> 3515 #include <aomap_fragment> 3516 vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; 3517 #include <opaque_fragment> 3518 #include <tonemapping_fragment> 3519 #include <colorspace_fragment> 3520 #include <fog_fragment> 3521 #include <premultiplied_alpha_fragment> 3522 #include <dithering_fragment> 3523}`,QA=`uniform float size; 3524uniform float scale; 3525#include <common> 3526#include <color_pars_vertex> 3527#include <fog_pars_vertex> 3528#include <morphtarget_pars_vertex> 3529#include <logdepthbuf_pars_vertex> 3530#include <clipping_planes_pars_vertex> 3531#ifdef USE_POINTS_UV 3532 varying vec2 vUv; 3533 uniform mat3 uvTransform; 3534#endif 3535void main() { 3536 #ifdef USE_POINTS_UV 3537 vUv = ( uvTransform * vec3( uv, 1 ) ).xy; 3538 #endif 3539 #include <color_vertex> 3540 #include <morphinstance_vertex> 3541 #include <morphcolor_vertex> 3542 #include <begin_vertex> 3543 #include <morphtarget_vertex> 3544 #include <project_vertex> 3545 gl_PointSize = size; 3546 #ifdef USE_SIZEATTENUATION 3547 bool isPerspective = isPerspectiveMatrix( projectionMatrix ); 3548 if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); 3549 #endif 3550 #include <logdepthbuf_vertex> 3551 #include <clipping_planes_vertex> 3552 #include <worldpos_vertex> 3553 #include <fog_vertex> 3554}`,e1=`uniform vec3 diffuse; 3555uniform float opacity; 3556#include <common> 3557#include <color_pars_fragment> 3558#include <map_particle_pars_fragment> 3559#include <alphatest_pars_fragment> 3560#include <alphahash_pars_fragment> 3561#include <fog_pars_fragment> 3562#include <logdepthbuf_pars_fragment> 3563#include <clipping_planes_pars_fragment> 3564void main() { 3565 vec4 diffuseColor = vec4( diffuse, opacity ); 3566 #include <clipping_planes_fragment> 3567 vec3 outgoingLight = vec3( 0.0 ); 3568 #include <logdepthbuf_fragment> 3569 #include <map_particle_fragment> 3570 #include <color_fragment> 3571 #include <alphatest_fragment> 3572 #include <alphahash_fragment> 3573 outgoingLight = diffuseColor.rgb; 3574 #include <opaque_fragment> 3575 #include <tonemapping_fragment> 3576 #include <colorspace_fragment> 3577 #include <fog_fragment> 3578 #include <premultiplied_alpha_fragment> 3579}`,t1=`#include <common> 3580#include <batching_pars_vertex> 3581#include <fog_pars_vertex> 3582#include <morphtarget_pars_vertex> 3583#include <skinning_pars_vertex> 3584#include <logdepthbuf_pars_vertex> 3585#include <shadowmap_pars_vertex> 3586void main() { 3587 #include <batching_vertex> 3588 #include <beginnormal_vertex> 3589 #include <morphinstance_vertex> 3590 #include <morphnormal_vertex> 3591 #include <skinbase_vertex> 3592 #include <skinnormal_vertex> 3593 #include <defaultnormal_vertex> 3594 #include <begin_vertex> 3595 #include <morphtarget_vertex> 3596 #include <skinning_vertex> 3597 #include <project_vertex> 3598 #include <logdepthbuf_vertex> 3599 #include <worldpos_vertex> 3600 #include <shadowmap_vertex> 3601 #include <fog_vertex> 3602}`,n1=`uniform vec3 color; 3603uniform float opacity; 3604#include <common> 3605#include <fog_pars_fragment> 3606#include <bsdfs> 3607#include <lights_pars_begin> 3608#include <logdepthbuf_pars_fragment> 3609#include <shadowmap_pars_fragment> 3610#include <shadowmask_pars_fragment> 3611void main() { 3612 #include <logdepthbuf_fragment> 3613 gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); 3614 #include <tonemapping_fragment> 3615 #include <colorspace_fragment> 3616 #include <fog_fragment> 3617 #include <premultiplied_alpha_fragment> 3618}`,i1=`uniform float rotation; 3619uniform vec2 center; 3620#include <common> 3621#include <uv_pars_vertex> 3622#include <fog_pars_vertex> 3623#include <logdepthbuf_pars_vertex> 3624#include <clipping_planes_pars_vertex> 3625void main() { 3626 #include <uv_vertex> 3627 vec4 mvPosition = modelViewMatrix[ 3 ]; 3628 vec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) ); 3629 #ifndef USE_SIZEATTENUATION 3630 bool isPerspective = isPerspectiveMatrix( projectionMatrix ); 3631 if ( isPerspective ) scale *= - mvPosition.z; 3632 #endif 3633 vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; 3634 vec2 rotatedPosition; 3635 rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; 3636 rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; 3637 mvPosition.xy += rotatedPosition; 3638 gl_Position = projectionMatrix * mvPosition; 3639 #include <logdepthbuf_vertex> 3640 #include <clipping_planes_vertex> 3641 #include <fog_vertex> 3642}`,r1=`uniform vec3 diffuse; 3643uniform float opacity; 3644#include <common> 3645#include <uv_pars_fragment> 3646#include <map_pars_fragment> 3647#include <alphamap_pars_fragment> 3648#include <alphatest_pars_fragment> 3649#include <alphahash_pars_fragment> 3650#include <fog_pars_fragment> 3651#include <logdepthbuf_pars_fragment> 3652#include <clipping_planes_pars_fragment> 3653void main() { 3654 vec4 diffuseColor = vec4( diffuse, opacity ); 3655 #include <clipping_planes_fragment> 3656 vec3 outgoingLight = vec3( 0.0 ); 3657 #include <logdepthbuf_fragment> 3658 #include <map_fragment> 3659 #include <alphamap_fragment> 3660 #include <alphatest_fragment> 3661 #include <alphahash_fragment> 3662 outgoingLight = diffuseColor.rgb; 3663 #include <opaque_fragment> 3664 #include <tonemapping_fragment> 3665 #include <colorspace_fragment> 3666 #include <fog_fragment> 3667}`,lt={alphahash_fragment:TT,alphahash_pars_fragment:wT,alphamap_fragment:AT,alphamap_pars_fragment:CT,alphatest_fragment:RT,alphatest_pars_fragment:IT,aomap_fragment:PT,aomap_pars_fragment:LT,batching_pars_vertex:NT,batching_vertex:DT,begin_vertex:OT,beginnormal_vertex:UT,bsdfs:FT,iridescence_fragment:BT,bumpmap_pars_fragment:kT,clipping_planes_fragment:VT,clipping_planes_pars_fragment:zT,clipping_planes_pars_vertex:HT,clipping_planes_vertex:GT,color_fragment:WT,color_pars_fragment:XT,color_pars_vertex:qT,color_vertex:$T,common:YT,cube_uv_reflection_fragment:ZT,defaultnormal_vertex:KT,displacementmap_pars_vertex:JT,displacementmap_vertex:jT,emissivemap_fragment:QT,emissivemap_pars_fragment:ew,c
vendor: 11,687 bytes, line 3667
3667olorspace_fragment:tw,colorspace_pars_fragment:nw,envmap_fragment:iw,envmap_common_pars_fragment:rw,envmap_pars_fragment:sw,envmap_pars_vertex:aw,envmap_physical_pars_fragment:_w,envmap_vertex:ow,fog_vertex:lw,fog_pars_vertex:cw,fog_fragment:uw,fog_pars_fragment:hw,gradientmap_pars_fragment:dw,lightmap_pars_fragment:fw,lights_lambert_fragment:pw,lights_lambert_pars_fragment:mw,lights_pars_begin:gw,lights_toon_fragment:vw,lights_toon_pars_fragment:xw,lights_phong_fragment:yw,lights_phong_pars_fragment:bw,lights_physical_fragment:Sw,lights_physical_pars_fragment:Mw,lights_fragment_begin:Ew,lights_fragment_maps:Tw,lights_fragment_end:ww,lightprobes_pars_fragment:Aw,logdepthbuf_fragment:Cw,logdepthbuf_pars_fragment:Rw,logdepthbuf_pars_vertex:Iw,logdepthbuf_vertex:Pw,map_fragment:Lw,map_pars_fragment:Nw,map_particle_fragment:Dw,map_particle_pars_fragment:Ow,metalnessmap_fragment:Uw,metalnessmap_pars_fragment:Fw,morphinstance_vertex:Bw,morphcolor_vertex:kw,morphnormal_vertex:Vw,morphtarget_pars_vertex:zw,morphtarget_vertex:Hw,normal_fragment_begin:Gw,normal_fragment_maps:Ww,normal_pars_fragment:Xw,normal_pars_vertex:qw,normal_vertex:$w,normalmap_pars_fragment:Yw,clearcoat_normal_fragment_begin:Zw,clearcoat_normal_fragment_maps:Kw,clearcoat_pars_fragment:Jw,iridescence_pars_fragment:jw,opaque_fragment:Qw,packing:eA,premultiplied_alpha_fragment:tA,project_vertex:nA,dithering_fragment:iA,dithering_pars_fragment:rA,roughnessmap_fragment:sA,roughnessmap_pars_fragment:aA,shadowmap_pars_fragment:oA,shadowmap_pars_vertex:lA,shadowmap_vertex:cA,shadowmask_pars_fragment:uA,skinbase_vertex:hA,skinning_pars_vertex:dA,skinning_vertex:fA,skinnormal_vertex:pA,specularmap_fragment:mA,specularmap_pars_fragment:gA,tonemapping_fragment:_A,tonemapping_pars_fragment:vA,transmission_fragment:xA,transmission_pars_fragment:yA,uv_pars_fragment:bA,uv_pars_vertex:SA,uv_vertex:MA,worldpos_vertex:EA,background_vert:TA,background_frag:wA,backgroundCube_vert:AA,backgroundCube_frag:CA,cube_vert:RA,cube_frag:IA,depth_vert:PA,depth_frag:LA,distance_vert:NA,distance_frag:DA,equirect_vert:OA,equirect_frag:UA,linedashed_vert:FA,linedashed_frag:BA,meshbasic_vert:kA,meshbasic_frag:VA,meshlambert_vert:zA,meshlambert_frag:HA,meshmatcap_vert:GA,meshmatcap_frag:WA,meshnormal_vert:XA,meshnormal_frag:qA,meshphong_vert:$A,meshphong_frag:YA,meshphysical_vert:ZA,meshphysical_frag:KA,meshtoon_vert:JA,meshtoon_frag:jA,points_vert:QA,points_frag:e1,shadow_vert:t1,shadow_frag:n1,sprite_vert:i1,sprite_frag:r1},be={common:{diffuse:{value:new Ee(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new tt},alphaMap:{value:null},alphaMapTransform:{value:new tt},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new tt}},envmap:{envMap:{value:null},envMapRotation:{value:new tt},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98},dfgLUT:{value:null}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new tt}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new tt}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new tt},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new tt},normalScale:{value:new j(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new tt},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new tt}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new tt}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new tt}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Ee(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null},probesSH:{value:null},probesMin:{value:new P},probesMax:{value:new P},probesResolution:{value:new P}},points:{diffuse:{value:new Ee(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new tt},alphaTest:{value:0},uvTransform:{value:new tt}},sprite:{diffuse:{value:new Ee(16777215)},opacity:{value:1},center:{value:new j(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new tt},alphaMap:{value:null},alphaMapTransform:{value:new tt},alphaTest:{value:0}}},Jn={basic:{uniforms:fn([be.common,be.specularmap,be.envmap,be.aomap,be.lightmap,be.fog]),vertexShader:lt.meshbasic_vert,fragmentShader:lt.meshbasic_frag},lambert:{uniforms:fn([be.common,be.specularmap,be.envmap,be.aomap,be.lightmap,be.emissivemap,be.bumpmap,be.normalmap,be.displacementmap,be.fog,be.lights,{emissive:{value:new Ee(0)},envMapIntensity:{value:1}}]),vertexShader:lt.meshlambert_vert,fragmentShader:lt.meshlambert_frag},phong:{uniforms:fn([be.common,be.specularmap,be.envmap,be.aomap,be.lightmap,be.emissivemap,be.bumpmap,be.normalmap,be.displacementmap,be.fog,be.lights,{emissive:{value:new Ee(0)},specular:{value:new Ee(1118481)},shininess:{value:30},envMapIntensity:{value:1}}]),vertexShader:lt.meshphong_vert,fragmentShader:lt.meshphong_frag},standard:{uniforms:fn([be.common,be.envmap,be.aomap,be.lightmap,be.emissivemap,be.bumpmap,be.normalmap,be.displacementmap,be.roughnessmap,be.metalnessmap,be.fog,be.lights,{emissive:{value:new Ee(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:lt.meshphysical_vert,fragmentShader:lt.meshphysical_frag},toon:{uniforms:fn([be.common,be.aomap,be.lightmap,be.emissivemap,be.bumpmap,be.normalmap,be.displacementmap,be.gradientmap,be.fog,be.lights,{emissive:{value:new Ee(0)}}]),vertexShader:lt.meshtoon_vert,fragmentShader:lt.meshtoon_frag},matcap:{uniforms:fn([be.common,be.bumpmap,be.normalmap,be.displacementmap,be.fog,{matcap:{value:null}}]),vertexShader:lt.meshmatcap_vert,fragmentShader:lt.meshmatcap_frag},points:{uniforms:fn([be.points,be.fog]),vertexShader:lt.points_vert,fragmentShader:lt.points_frag},dashed:{uniforms:fn([be.common,be.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:lt.linedashed_vert,fragmentShader:lt.linedashed_frag},depth:{uniforms:fn([be.common,be.displacementmap]),vertexShader:lt.depth_vert,fragmentShader:lt.depth_frag},normal:{uniforms:fn([be.common,be.bumpmap,be.normalmap,be.displacementmap,{opacity:{value:1}}]),vertexShader:lt.meshnormal_vert,fragmentShader:lt.meshnormal_frag},sprite:{uniforms:fn([be.sprite,be.fog]),vertexShader:lt.sprite_vert,fragmentShader:lt.sprite_frag},background:{uniforms:{uvTransform:{value:new tt},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:lt.background_vert,fragmentShader:lt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new tt}},vertexShader:lt.backgroundCube_vert,fragmentShader:lt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:lt.cube_vert,fragmentShader:lt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:lt.equirect_vert,fragmentShader:lt.equirect_frag},distance:{uniforms:fn([be.common,be.displacementmap,{referencePosition:{value:new P},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:lt.distance_vert,fragmentShader:lt.distance_frag},shadow:{uniforms:fn([be.lights,be.fog,{color:{value:new Ee(0)},opacity:{value:1}}]),vertexShader:lt.shadow_vert,fragmentShader:lt.shadow_frag}};Jn.physical={uniforms:fn([Jn.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new tt},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new tt},clearcoatNormalScale:{value:new j(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new tt},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new tt},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new tt},sheen:{value:0},sheenColor:{value:new Ee(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new tt},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new tt},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new tt},transmissionSamplerSize:{value:new j},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new tt},attenuationDistance:{value:0},attenuationColor:{value:new Ee(0)},specularColor:{value:new Ee(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new tt},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new tt},anisotropyVector:{value:new j},anisotropyMap:{value:null},anisotropyMapTransform:{value:new tt}}]),vertexShader:lt.meshphysical_vert,fragmentShader:lt.meshphysical_frag};const al={r:0,b:0,g:0},s1=new We,p0=new tt;p0.set(-1,0,0,0,1,0,0,0,1);function a1(i,e,t,n,r,s){const a=new Ee(0);let o=r===!0?0:1,l,c,u=null,h=0,d=null;function f(v){let b=v.isScene===!0?v.background:null;if(b&&b.isTexture){const y=v.backgroundBlurriness>0;b=e.get(b,y)}return b}function p(v){let b=!1;const y=f(v);y===null?g(a,o):y&&y.isColor&&(g(y,1),b=!0);const T=i.xr.getEnvironmentBlendMode();T==="additive"?t.buffers.color.setClear(0,0,0,1,s):T==="alpha-blend"&&t.buffers.color.setClear(0,0,0,0,s),(i.autoClear||b)&&(t.buffers.depth.setTest(!0),t.buffers.depth.setMask(!0),t.buffers.color.setMask(!0),i.clear(i.autoClearColor,i.autoClearDepth,i.autoClearStencil))}function _(v,b){const y=f(b);y&&(y.isCubeTexture||y.mapping===Gs)?(c===void 0&&(c=new Dt(new Vr(1,1,1),new Cn({name:"BackgroundCubeMaterial",uniforms:Os(Jn.backgroundCube.uniforms),vertexShader:Jn.backgroundCube.vertexShader,fragmentShader:Jn.backgroundCube.fragmentShader,side:yn,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),c.geometry.deleteAttribute("normal"),c.geometry.deleteAttribute("uv"),c.onBeforeRender=function(T,S,R){this.matrixWorld.copyPosition(R.matrixWorld)},Object.defineProperty(c.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),n.update(c)),c.material.uniforms.envMap.value=y,c.material.uniforms.backgroundBlurriness.value=b.backgroundBlurriness,c.material.uniforms.backgroundIntensity.value=b.backgroundIntensity,c.material.uniforms.backgroundRotation.value.setFromMatrix4(s1.makeRotationFromEuler(b.backgroundRotation)).transpose(),y.isCubeTexture&&y.isRenderTargetTexture===!1&&c.material.uniforms.backgroundRotation.value.premultiply(
vendor: 23,110 bytes, lines 3667-3846
3667p0),c.material.toneMapped=dt.getTransfer(y.colorSpace)!==St,(u!==y||h!==y.version||d!==i.toneMapping)&&(c.material.needsUpdate=!0,u=y,h=y.version,d=i.toneMapping),c.layers.enableAll(),v.unshift(c,c.geometry,c.material,0,0,null)):y&&y.isTexture&&(l===void 0&&(l=new Dt(new Xs(2,2),new Cn({name:"BackgroundMaterial",uniforms:Os(Jn.background.uniforms),vertexShader:Jn.background.vertexShader,fragmentShader:Jn.background.fragmentShader,side:Pi,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),l.geometry.deleteAttribute("normal"),Object.defineProperty(l.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(l)),l.material.uniforms.t2D.value=y,l.material.uniforms.backgroundIntensity.value=b.backgroundIntensity,l.material.toneMapped=dt.getTransfer(y.colorSpace)!==St,y.matrixAutoUpdate===!0&&y.updateMatrix(),l.material.uniforms.uvTransform.value.copy(y.matrix),(u!==y||h!==y.version||d!==i.toneMapping)&&(l.material.needsUpdate=!0,u=y,h=y.version,d=i.toneMapping),l.layers.enableAll(),v.unshift(l,l.geometry,l.material,0,0,null))}function g(v,b){v.getRGB(al,O_(i)),t.buffers.color.setClear(al.r,al.g,al.b,b,s)}function m(){c!==void 0&&(c.geometry.dispose(),c.material.dispose(),c=void 0),l!==void 0&&(l.geometry.dispose(),l.material.dispose(),l=void 0)}return{getClearColor:function(){return a},setClearColor:function(v,b=1){a.set(v),o=b,g(a,o)},getClearAlpha:function(){return o},setClearAlpha:function(v){o=v,g(a,o)},render:p,addToRenderList:_,dispose:m}}function o1(i,e){const t=i.getParameter(i.MAX_VERTEX_ATTRIBS),n={},r=d(null);let s=r,a=!1;function o(I,N,U,k,L){let F=!1;const O=h(I,k,U,N);s!==O&&(s=O,c(s.object)),F=f(I,k,U,L),F&&p(I,k,U,L),L!==null&&e.update(L,i.ELEMENT_ARRAY_BUFFER),(F||a)&&(a=!1,y(I,N,U,k),L!==null&&i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,e.get(L).buffer))}function l(){return i.createVertexArray()}function c(I){return i.bindVertexArray(I)}function u(I){return i.deleteVertexArray(I)}function h(I,N,U,k){const L=k.wireframe===!0;let F=n[N.id];F===void 0&&(F={},n[N.id]=F);const O=I.isInstancedMesh===!0?I.id:0;let X=F[O];X===void 0&&(X={},F[O]=X);let $=X[U.id];$===void 0&&($={},X[U.id]=$);let te=$[L];return te===void 0&&(te=d(l()),$[L]=te),te}function d(I){const N=[],U=[],k=[];for(let L=0;L<t;L++)N[L]=0,U[L]=0,k[L]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:N,enabledAttributes:U,attributeDivisors:k,object:I,attributes:{},index:null}}function f(I,N,U,k){const L=s.attributes,F=N.attributes;let O=0;const X=U.getAttributes();for(const $ in X)if(X[$].location>=0){const ue=L[$];let xe=F[$];if(xe===void 0&&($==="instanceMatrix"&&I.instanceMatrix&&(xe=I.instanceMatrix),$==="instanceColor"&&I.instanceColor&&(xe=I.instanceColor)),ue===void 0||ue.attribute!==xe||xe&&ue.data!==xe.data)return!0;O++}return s.attributesNum!==O||s.index!==k}function p(I,N,U,k){const L={},F=N.attributes;let O=0;const X=U.getAttributes();for(const $ in X)if(X[$].location>=0){let ue=F[$];ue===void 0&&($==="instanceMatrix"&&I.instanceMatrix&&(ue=I.instanceMatrix),$==="instanceColor"&&I.instanceColor&&(ue=I.instanceColor));const xe={};xe.attribute=ue,ue&&ue.data&&(xe.data=ue.data),L[$]=xe,O++}s.attributes=L,s.attributesNum=O,s.index=k}function _(){const I=s.newAttributes;for(let N=0,U=I.length;N<U;N++)I[N]=0}function g(I){m(I,0)}function m(I,N){const U=s.newAttributes,k=s.enabledAttributes,L=s.attributeDivisors;U[I]=1,k[I]===0&&(i.enableVertexAttribArray(I),k[I]=1),L[I]!==N&&(i.vertexAttribDivisor(I,N),L[I]=N)}function v(){const I=s.newAttributes,N=s.enabledAttributes;for(let U=0,k=N.length;U<k;U++)N[U]!==I[U]&&(i.disableVertexAttribArray(U),N[U]=0)}function b(I,N,U,k,L,F,O){O===!0?i.vertexAttribIPointer(I,N,U,L,F):i.vertexAttribPointer(I,N,U,k,L,F)}function y(I,N,U,k){_();const L=k.attributes,F=U.getAttributes(),O=N.defaultAttributeValues;for(const X in F){const $=F[X];if($.location>=0){let te=L[X];if(te===void 0&&(X==="instanceMatrix"&&I.instanceMatrix&&(te=I.instanceMatrix),X==="instanceColor"&&I.instanceColor&&(te=I.instanceColor)),te!==void 0){const ue=te.normalized,xe=te.itemSize,He=e.get(te);if(He===void 0)continue;const Ke=He.buffer,qe=He.type,K=He.bytesPerElement,ye=qe===i.INT||qe===i.UNSIGNED_INT||te.gpuType===Mc;if(te.isInterleavedBufferAttribute){const le=te.data,De=le.stride,Ne=te.offset;if(le.isInstancedInterleavedBuffer){for(let Ge=0;Ge<$.locationSize;Ge++)m($.location+Ge,le.meshPerAttribute);I.isInstancedMesh!==!0&&k._maxInstanceCount===void 0&&(k._maxInstanceCount=le.meshPerAttribute*le.count)}else for(let Ge=0;Ge<$.locationSize;Ge++)g($.location+Ge);i.bindBuffer(i.ARRAY_BUFFER,Ke);for(let Ge=0;Ge<$.locationSize;Ge++)b($.location+Ge,xe/$.locationSize,qe,ue,De*K,(Ne+xe/$.locationSize*Ge)*K,ye)}else{if(te.isInstancedBufferAttribute){for(let le=0;le<$.locationSize;le++)m($.location+le,te.meshPerAttribute);I.isInstancedMesh!==!0&&k._maxInstanceCount===void 0&&(k._maxInstanceCount=te.meshPerAttribute*te.count)}else for(let le=0;le<$.locationSize;le++)g($.location+le);i.bindBuffer(i.ARRAY_BUFFER,Ke);for(let le=0;le<$.locationSize;le++)b($.location+le,xe/$.locationSize,qe,ue,xe*K,xe/$.locationSize*le*K,ye)}}else if(O!==void 0){const ue=O[X];if(ue!==void 0)switch(ue.length){case 2:i.vertexAttrib2fv($.location,ue);break;case 3:i.vertexAttrib3fv($.location,ue);break;case 4:i.vertexAttrib4fv($.location,ue);break;default:i.vertexAttrib1fv($.location,ue)}}}}v()}function T(){M();for(const I in n){const N=n[I];for(const U in N){const k=N[U];for(const L in k){const F=k[L];for(const O in F)u(F[O].object),delete F[O];delete k[L]}}delete n[I]}}function S(I){if(n[I.id]===void 0)return;const N=n[I.id];for(const U in N){const k=N[U];for(const L in k){const F=k[L];for(const O in F)u(F[O].object),delete F[O];delete k[L]}}delete n[I.id]}function R(I){for(const N in n){const U=n[N];for(const k in U){const L=U[k];if(L[I.id]===void 0)continue;const F=L[I.id];for(const O in F)u(F[O].object),delete F[O];delete L[I.id]}}}function x(I){for(const N in n){const U=n[N],k=I.isInstancedMesh===!0?I.id:0,L=U[k];if(L!==void 0){for(const F in L){const O=L[F];for(const X in O)u(O[X].object),delete O[X];delete L[F]}delete U[k],Object.keys(U).length===0&&delete n[N]}}}function M(){A(),a=!0,s!==r&&(s=r,c(s.object))}function A(){r.geometry=null,r.program=null,r.wireframe=!1}return{setup:o,reset:M,resetDefaultState:A,dispose:T,releaseStatesOfGeometry:S,releaseStatesOfObject:x,releaseStatesOfProgram:R,initAttributes:_,enableAttribute:g,disableUnusedAttributes:v}}function l1(i,e,t){let n;function r(l){n=l}function s(l,c){i.drawArrays(n,l,c),t.update(c,n,1)}function a(l,c,u){u!==0&&(i.drawArraysInstanced(n,l,c,u),t.update(c,n,u))}function o(l,c,u){if(u===0)return;e.get("WEBGL_multi_draw").multiDrawArraysWEBGL(n,l,0,c,0,u);let d=0;for(let f=0;f<u;f++)d+=c[f];t.update(d,n,1)}this.setMode=r,this.render=s,this.renderInstances=a,this.renderMultiDraw=o}function c1(i,e,t,n){let r;function s(){if(r!==void 0)return r;if(e.has("EXT_texture_filter_anisotropic")===!0){const R=e.get("EXT_texture_filter_anisotropic");r=i.getParameter(R.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else r=0;return r}function a(R){return!(R!==xn&&n.convert(R)!==i.getParameter(i.IMPLEMENTATION_COLOR_READ_FORMAT))}function o(R){const x=R===gi&&(e.has("EXT_color_buffer_half_float")||e.has("EXT_color_buffer_float"));return!(R!==wn&&n.convert(R)!==i.getParameter(i.IMPLEMENTATION_COLOR_READ_TYPE)&&R!==vn&&!x)}function l(R){if(R==="highp"){if(i.getShaderPrecisionFormat(i.VERTEX_SHADER,i.HIGH_FLOAT).precision>0&&i.getShaderPrecisionFormat(i.FRAGMENT_SHADER,i.HIGH_FLOAT).precision>0)return"highp";R="mediump"}return R==="mediump"&&i.getShaderPrecisionFormat(i.VERTEX_SHADER,i.MEDIUM_FLOAT).precision>0&&i.getShaderPrecisionFormat(i.FRAGMENT_SHADER,i.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let c=t.precision!==void 0?t.precision:"highp";const u=l(c);u!==c&&(_e("WebGLRenderer:",c,"not supported, using",u,"instead."),c=u);const h=t.logarithmicDepthBuffer===!0,d=t.reversedDepthBuffer===!0&&e.has("EXT_clip_control");t.reversedDepthBuffer===!0&&d===!1&&_e("WebGLRenderer: Unable to use reversed depth buffer due to missing EXT_clip_control extension. Fallback to default depth buffer.");const f=i.getParameter(i.MAX_TEXTURE_IMAGE_UNITS),p=i.getParameter(i.MAX_VERTEX_TEXTURE_IMAGE_UNITS),_=i.getParameter(i.MAX_TEXTURE_SIZE),g=i.getParameter(i.MAX_CUBE_MAP_TEXTURE_SIZE),m=i.getParameter(i.MAX_VERTEX_ATTRIBS),v=i.getParameter(i.MAX_VERTEX_UNIFORM_VECTORS),b=i.getParameter(i.MAX_VARYING_VECTORS),y=i.getParameter(i.MAX_FRAGMENT_UNIFORM_VECTORS),T=i.getParameter(i.MAX_SAMPLES),S=i.getParameter(i.SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:s,getMaxPrecision:l,textureFormatReadable:a,textureTypeReadable:o,precision:c,logarithmicDepthBuffer:h,reversedDepthBuffer:d,maxTextures:f,maxVertexTextures:p,maxTextureSize:_,maxCubemapSize:g,maxAttributes:m,maxVertexUniforms:v,maxVaryings:b,maxFragmentUniforms:y,maxSamples:T,samples:S}}function u1(i){const e=this;let t=null,n=0,r=!1,s=!1;const a=new Ai,o=new tt,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(h,d){const f=h.length!==0||d||n!==0||r;return r=d,n=h.length,f},this.beginShadows=function(){s=!0,u(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(h,d){t=u(h,d,0)},this.setState=function(h,d,f){const p=h.clippingPlanes,_=h.clipIntersection,g=h.clipShadows,m=i.get(h);if(!r||p===null||p.length===0||s&&!g)s?u(null):c();else{const v=s?0:n,b=v*4;let y=m.clippingState||null;l.value=y,y=u(p,d,b,f);for(let T=0;T!==b;++T)y[T]=t[T];m.clippingState=y,this.numIntersection=_?this.numPlanes:0,this.numPlanes+=v}};function c(){l.value!==t&&(l.value=t,l.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function u(h,d,f,p){const _=h!==null?h.length:0;let g=null;if(_!==0){if(g=l.value,p!==!0||g===null){const m=f+_*4,v=d.matrixWorldInverse;o.getNormalMatrix(v),(g===null||g.length<m)&&(g=new Float32Array(m));for(let b=0,y=f;b!==_;++b,y+=4)a.copy(h[b]).applyMatrix4(v,o),a.normal.toArray(g,y),g[y+3]=a.constant}l.value=g,l.needsUpdate=!0}return e.numPlanes=_,e.numIntersection=0,g}}const Zi=4,Vp=[.125,.215,.35,.446,.526,.582],Sr=20,h1=256,la=new fo,zp=new Ee;let qu=null,$u=0,Yu=0,Zu=!1;const d1=new P;class Ch{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._sizeLods=[],this._sigmas=[],this._lodMeshes=[],this._backgroundBox=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._blurMaterial=null,this._ggxMaterial=null}fromScene(e,t=0,n=.1,r=100,s={}){const{size:a=256,position:o=d1}=s;qu=this._renderer.getRenderTarget(),$u=this._renderer.getActiveCubeFace(),Yu=this._renderer.getActiveMipmapLevel(),Zu=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(a);const l=this._allocateTargets();return l.depthBuffer=!0,this._sceneToCubeUV(e,n,r,l,o),t>0&&this._blur(l,0,0,t),this._applyPMREM(l),this._cleanup(l),l}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=Wp(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=Gp(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose(),this._backgroundBox!==null&&(this._backgroundBox.geometry.dispose(),this._backgroundBox.material.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._ggxMaterial!==null&&this._ggxMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodMeshes.length;e++)this._lodMeshes[e].geometry.dispose()}_cleanup(e){this._renderer.setRenderTarget(qu,$u,Yu),this._renderer.xr.enabled=Zu,e.scissorTest=!1,ds(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===mi||e.mapping===Qi?this._setSize(e.image.length===0?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),qu=this._renderer.getRenderTarget(),$u=this._renderer.getActiveCubeFace(),Yu=this._renderer.getActiveMipmapLevel(),Zu=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:Lt,minFilter:Lt,generateMipmaps:!1,type:gi,format:xn,colorSpace:Ha,depthBuffer:!1},r=Hp(e,t,n);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=Hp(e,t,n);const{_lodMax:s}=this;({lodMeshes:this._lodMeshes,sizeLods:this._sizeLods,sigmas:this._sigmas}=f1(s)),this._blurMaterial=m1(s,e,t),this._ggxMaterial=p1(s,e,t)}return r}_compileMaterial(e){const t=new Dt(new et,e);this._renderer.compile(t,la)}_sceneToCubeUV(e,t,n,r,s){const l=new Jt(90,1,t,n),c=[1,-1,1,1,1,1],u=[1,1,1,-1,-1,-1],h=this._renderer,d=h.autoClear,f=h.toneMapping;h.getClearColor(zp),h.toneMapping=ei,h.autoClear=!1,h.state.buffers.depth.getReversed()&&(h.setRenderTarget(r),h.clearDepth(),h.setRenderTarget(null)),this._backgroundBox===null&&(this._backgroundBox=new Dt(new Vr,new Oi({name:"PMREM.Background",side:yn,depthWrite:!1,depthTest:!1})));const _=this._backgroundBox,g=_.material;let m=!1;const v=e.background;v?v.isColor&&(g.color.copy(v),e.background=null,m=!0):(g.color.copy(zp),m=!0);for(let b=0;b<6;b++){const y=b%3;y===0?(l.up.set(0,c[b],0),l.position.set(s.x,s.y,s.z),l.lookAt(s.x+u[b],s.y,s.z)):y===1?(l.up.set(0,0,c[b]),l.position.set(s.x,s.y,s.z),l.lookAt(s.x,s.y+u[b],s.z)):(l.up.set(0,c[b],0),l.position.set(s.x,s.y,s.z),l.lookAt(s.x,s.y,s.z+u[b]));const T=this._cubeSize;ds(r,y*T,b>2?T:0,T,T),h.setRenderTarget(r),m&&h.render(_,l),h.render(e,l)}h.toneMapping=f,h.autoClear=d,e.background=v}_textureToCubeUV(e,t){const n=this._renderer,r=e.mapping===mi||e.mapping===Qi;r?(this._cubemapMaterial===null&&(this._cubemapMaterial=Wp()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=Gp());const s=r?this._cubemapMaterial:this._equirectMaterial,a=this._lodMeshes[0];a.material=s;const o=s.uniforms;o.envMap.value=e;const l=this._cubeSize;ds(t,0,0,3*l,2*l),n.setRenderTarget(t),n.render(a,la)}_applyPMREM(e){const t=this._renderer,n=t.autoClear;t.autoClear=!1;const r=this._lodMeshes.length;for(let s=1;s<r;s++)this._applyGGXFilter(e,s-1,s);t.autoClear=n}_applyGGXFilter(e,t,n){const r=this._renderer,s=this._pingPongRenderTarget,a=this._ggxMaterial,o=this._lodMeshes[n];o.material=a;const l=a.uniforms,c=n/(this._lodMeshes.length-1),u=t/(this._lodMeshes.length-1),h=Math.sqrt(c*c-u*u),d=0+c*1.25,f=h*d,{_lodMax:p}=this,_=this._sizeLods[n],g=3*_*(n>p-Zi?n-p+Zi:0),m=4*(this._cubeSize-_);l.envMap.value=e.texture,l.roughness.value=f,l.mipInt.value=p-t,ds(s,g,m,3*_,2*_),r.setRenderTarget(s),r.render(o,la),l.envMap.value=s.texture,l.roughness.value=0,l.mipInt.value=p-n,ds(e,g,m,3*_,2*_),r.setRenderTarget(e),r.render(o,la)}_blur(e,t,n,r,s){const a=this._pingPongRenderTarget;this._halfBlur(e,a,t,n,r,"latitudinal",s),this._halfBlur(a,e,n,n,r,"longitudinal",s)}_halfBlur(e,t,n,r,s,a,o){const l=this._renderer,c=this._blurMaterial;a!=="latitudinal"&&a!=="longitudinal"&&Oe("blur direction must be either latitudinal or longitudinal!");const u=3,h=this._lodMeshes[r];h.material=c;const d=c.uniforms,f=this._sizeLods[n]-1,p=isFinite(s)?Math.PI/(2*f):2*Math.PI/(2*Sr-1),_=s/p,g=isFinite(s)?1+Math.floor(u*_):Sr;g>Sr&&_e(`sigmaRadians, ${s}, is too large and will clip, as it requested ${g} samples when the maximum is set to ${Sr}`);const m=[];let v=0;for(let R=0;R<Sr;++R){const x=R/_,M=Math.exp(-x*x/2);m.push(M),R===0?v+=M:R<g&&(v+=2*M)}for(let R=0;R<m.length;R++)m[R]=m[R]/v;d.envMap.value=e.texture,d.samples.value=g,d.weights.value=m,d.latitudinal.value=a==="latitudinal",o&&(d.poleAxis.value=o);const{_lodMax:b}=this;d.dTheta.value=p,d.mipInt.value=b-n;const y=this._sizeLods[r],T=3*y*(r>b-Zi?r-b+Zi:0),S=4*(this._cubeSize-y);ds(t,T,S,3*y,2*y),l.setRenderTarget(t),l.render(h,la)}}function f1(i){const e=[],t=[],n=[];let r=i;const s=i-Zi+1+Vp.length;for(let a=0;a<s;a++){const o=Math.pow(2,r);e.push(o);let l=1/o;a>i-Zi?l=Vp[a-i+Zi-1]:a===0&&(l=0),t.push(l);const c=1/(o-2),u=-c,h=1+c,d=[u,u,h,u,h,h,u,u,h,h,u,h],f=6,p=6,_=3,g=2,m=1,v=new Float32Array(_*p*f),b=new Float32Array(g*p*f),y=new Float32Array(m*p*f);for(let S=0;S<f;S++){const R=S%3*2/3-1,x=S>2?0:-1,M=[R,x,0,R+2/3,x,0,R+2/3,x+1,0,R,x,0,R+2/3,x+1,0,R,x+1,0];v.set(M,_*p*S),b.set(d,g*p*S);const A=[S,S,S,S,S,S];y.set(A,m*p*S)}const T=new et;T.setAttribute("position",new ut(v,_)),T.setAttribute("uv",new ut(b,g)),T.setAttribute("faceIndex",new ut(y,m)),n.push(new Dt(T,null)),r>Zi&&r--}return{lodMeshes:n,sizeLods:e,sigmas:t}}function Hp(i,e,t){const n=new Bn(i,e,t);return n.texture.mapping=Gs,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function ds(i,e,t,n,r){i.viewport.set(e,t,n,r),i.scissor.set(e,t,n,r)}function p1(i,e,t){return new Cn({name:"PMREMGGXConvolution",defines:{GGX_SAMPLES:h1,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${i}.0`},uniforms:{envMap:{value:null},roughness:{value:0},mipInt:{value:0}},vertexShader:nu(),fragmentShader:` 3668 3669 precision highp float; 3670 precision highp int; 3671 3672 varying vec3 vOutputDirection; 3673 3674 uniform sampler2D envMap; 3675 uniform float roughness; 3676 uniform float mipInt; 3677 3678 #define ENVMAP_TYPE_CUBE_UV 3679 #include <cube_uv_reflection_fragment> 3680 3681 #define PI 3.14159265359 3682 3683 // Van der Corput radical inverse 3684 float radicalInverse_VdC(uint bits) { 3685 bits = (bits << 16u) | (bits >> 16u); 3686 bits = ((bits & 0x55555555u) << 1u) | ((bits & 0xAAAAAAAAu) >> 1u); 3687 bits = ((bits & 0x33333333u) << 2u) | ((bits & 0xCCCCCCCCu) >> 2u); 3688 bits = ((bits & 0x0F0F0F0Fu) << 4u) | ((bits & 0xF0F0F0F0u) >> 4u); 3689 bits = ((bits & 0x00FF00FFu) << 8u) | ((bits & 0xFF00FF00u) >> 8u); 3690 return float(bits) * 2.3283064365386963e-10; // / 0x100000000 3691 } 3692 3693 // Hammersley sequence 3694 vec2 hammersley(uint i, uint N) { 3695 return vec2(float(i) / float(N), radicalInverse_VdC(i)); 3696 } 3697 3698 // GGX VNDF importance sampling (Eric Heitz 2018) 3699 // "Sampling the GGX Distribution of Visible Normals" 3700 // https://jcgt.org/published/0007/04/01/ 3701 vec3 importanceSampleGGX_VNDF(vec2 Xi, vec3 V, float roughness) { 3702 float alpha = roughness * roughness; 3703 3704 // Section 4.1: Orthonormal basis 3705 vec3 T1 = vec3(1.0, 0.0, 0.0); 3706 vec3 T2 = cross(V, T1); 3707 3708 // Section 4.2: Parameterization of projected area 3709 float r = sqrt(Xi.x); 3710 float phi = 2.0 * PI * Xi.y; 3711 float t1 = r * cos(phi); 3712 float t2 = r * sin(phi); 3713 float s = 0.5 * (1.0 + V.z); 3714 t2 = (1.0 - s) * sqrt(1.0 - t1 * t1) + s * t2; 3715 3716 // Section 4.3: Reprojection onto hemisphere 3717 vec3 Nh = t1 * T1 + t2 * T2 + sqrt(max(0.0, 1.0 - t1 * t1 - t2 * t2)) * V; 3718 3719 // Section 3.4: Transform back to ellipsoid configuration 3720 return normalize(vec3(alpha * Nh.x, alpha * Nh.y, max(0.0, Nh.z))); 3721 } 3722 3723 void main() { 3724 vec3 N = normalize(vOutputDirection); 3725 vec3 V = N; // Assume view direction equals normal for pre-filtering 3726 3727 vec3 prefilteredColor = vec3(0.0); 3728 float totalWeight = 0.0; 3729 3730 // For very low roughness, just sample the environment directly 3731 if (roughness < 0.001) { 3732 gl_FragColor = vec4(bilinearCubeUV(envMap, N, mipInt), 1.0); 3733 return; 3734 } 3735 3736 // Tangent space basis for VNDF sampling 3737 vec3 up = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0); 3738 vec3 tangent = normalize(cross(up, N)); 3739 vec3 bitangent = cross(N, tangent); 3740 3741 for(uint i = 0u; i < uint(GGX_SAMPLES); i++) { 3742 vec2 Xi = hammersley(i, uint(GGX_SAMPLES)); 3743 3744 // For PMREM, V = N, so in tangent space V is always (0, 0, 1) 3745 vec3 H_tangent = importanceSampleGGX_VNDF(Xi, vec3(0.0, 0.0, 1.0), roughness); 3746 3747 // Transform H back to world space 3748 vec3 H = normalize(tangent * H_tangent.x + bitangent * H_tangent.y + N * H_tangent.z); 3749 vec3 L = normalize(2.0 * dot(V, H) * H - V); 3750 3751 float NdotL = max(dot(N, L), 0.0); 3752 3753 if(NdotL > 0.0) { 3754 // Sample environment at fixed mip level 3755 // VNDF importance sampling handles the distribution filtering 3756 vec3 sampleColor = bilinearCubeUV(envMap, L, mipInt); 3757 3758 // Weight by NdotL for the split-sum approximation 3759 // VNDF PDF naturally accounts for the visible microfacet distribution 3760 prefilteredColor += sampleColor * NdotL; 3761 totalWeight += NdotL; 3762 } 3763 } 3764 3765 if (totalWeight > 0.0) { 3766 prefilteredColor = prefilteredColor / totalWeight; 3767 } 3768 3769 gl_FragColor = vec4(prefilteredColor, 1.0); 3770 } 3771 `,blending:pi,depthTest:!1,depthWrite:!1})}function m1(i,e,t){const n=new Float32Array(Sr),r=new P(0,1,0);return new Cn({name:"SphericalGaussianBlur",defines:{n:Sr,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${i}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r}},vertexShader:nu(),fragmentShader:` 3772 3773 precision mediump float; 3774 precision mediump int; 3775 3776 varying vec3 vOutputDirection; 3777 3778 uniform sampler2D envMap; 3779 uniform int samples; 3780 uniform float weights[ n ]; 3781 uniform bool latitudinal; 3782 uniform float dTheta; 3783 uniform float mipInt; 3784 uniform vec3 poleAxis; 3785 3786 #define ENVMAP_TYPE_CUBE_UV 3787 #include <cube_uv_reflection_fragment> 3788 3789 vec3 getSample( float theta, vec3 axis ) { 3790 3791 float cosTheta = cos( theta ); 3792 // Rodrigues' axis-angle rotation 3793 vec3 sampleDirection = vOutputDirection * cosTheta 3794 + cross( axis, vOutputDirection ) * sin( theta ) 3795 + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); 3796 3797 return bilinearCubeUV( envMap, sampleDirection, mipInt ); 3798 3799 } 3800 3801 void main() { 3802 3803 vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); 3804 3805 if ( all( equal( axis, vec3( 0.0 ) ) ) ) { 3806 3807 axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); 3808 3809 } 3810 3811 axis = normalize( axis ); 3812 3813 gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); 3814 gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); 3815 3816 for ( int i = 1; i < n; i++ ) { 3817 3818 if ( i >= samples ) { 3819 3820 break; 3821 3822 } 3823 3824 float theta = dTheta * float( i ); 3825 gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); 3826 gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); 3827 3828 } 3829 3830 } 3831 `,blending:pi,depthTest:!1,depthWrite:!1})}function Gp(){return new Cn({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:nu(),fragmentShader:` 3832 3833 precision mediump float; 3834 precision mediump int; 3835 3836 varying vec3 vOutputDirection; 3837 3838 uniform sampler2D envMap; 3839 3840 #include <common> 3841 3842 void main() { 3843 3844 vec3 outputDirection = normalize( vOutputDirection ); 3845 vec2 uv = equirectUv( outputDirection ); 3846
3847 gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); 3848 3849 } 3850 `,blending:pi,depthTest:!1,depthWrite:!1})}function Wp(){return new Cn({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:nu(),fragmentShader:` 3851 3852 precision mediump float; 3853 precision mediump int; 3854 3855 uniform float flipEnvMap; 3856 3857 varying vec3 vOutputDirection; 3858 3859 uniform samplerCube envMap; 3860 3861 void main() { 3862 3863 gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); 3864 3865 } 3866 `,blending:pi,depthTest:!1,depthWrite:!1})}function nu(){return` 3867 3868 precision mediump float; 3869 precision mediump int; 3870 3871 attribute float faceIndex; 3872 3873 varying vec3 vOutputDirection; 3874 3875 // RH coordinate system; PMREM face-indexing convention 3876 vec3 getDirection( vec2 uv, float face ) { 3877 3878 uv = 2.0 * uv - 1.0; 3879 3880 vec3 direction = vec3( uv, 1.0 ); 3881 3882 if ( face == 0.0 ) { 3883 3884 direction = direction.zyx; // ( 1, v, u ) pos x 3885 3886 } else if ( face == 1.0 ) { 3887 3888 direction = direction.xzy; 3889 direction.xz *= -1.0; // ( -u, 1, -v ) pos y 3890 3891 } else if ( face == 2.0 ) { 3892 3893 direction.x *= -1.0; // ( -u, v, 1 ) pos z 3894 3895 } else if ( face == 3.0 ) { 3896 3897 direction = direction.zyx; 3898 direction.xz *= -1.0; // ( -1, v, -u ) neg x 3899 3900 } else if ( face == 4.0 ) { 3901 3902 direction = direction.xzy; 3903 direction.xy *= -1.0; // ( -u, -1, v ) neg y 3904 3905 } else if ( face == 5.0 ) { 3906 3907 direction.z *= -1.0; // ( u, v, -1 ) neg z 3908 3909 } 3910 3911 return direction; 3912 3913 } 3914 3915 void main() { 3916 3917 vOutputDirection = getDirection( uv, faceIndex ); 3918 gl_Position = vec4( position, 1.0 ); 3919 3920 } 3921 `}class Xd extends Bn{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const n={width:e,height:e,depth:1},r=[n,n,n,n,n,n];this.texture=new oo(r),this._setTextureOptions(t),this.texture.isRenderTargetTexture=!0}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const n={uniforms:{tEquirect:{value:null}},vertexShader:` 3922 3923 varying vec3 vWorldDirection; 3924 3925 vec3 transformDirection( in vec3 dir, in mat4 matrix ) { 3926 3927 return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); 3928 3929 } 3930 3931 void main() { 3932 3933 vWorldDirection = transformDirection( position, modelMatrix ); 3934 3935 #include <begin_vertex> 3936 #include <project_vertex> 3937 3938 } 3939 `,fragmentShader:` 3940 3941 uniform sampler2D tEquirect; 3942 3943 varying vec3 vWorldDirection; 3944 3945 #include <common> 3946 3947 void main() { 3948 3949 vec3 direction = normalize( vWorldDirection ); 3950 3951 vec2 sampleUV = equirectUv( direction ); 3952 3953 gl_FragColor = texture2D( tEquirect, sampleUV ); 3954 3955 } 3956 `},r=new Vr(5,5,5),s=new Cn({name:"CubemapFromEquirect",uniforms:Os(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:yn,blending:pi});s.uniforms.tEquirect.value=t;const a=new Dt(r,s),o=t.minFilter;return t.minFilter===di&&(t.minFilter=Lt),new s0(1,10,this).update(e,a),t.minFilter=o,a.geometry.dispose(),a.material.dispose(),this}clear(e,t=!0,n=!0,r=!0){const s=e.getRenderTarget();for(let a=0;a<6;a++)e.setRenderTarget(this,a),e.clear(t,n,r);e.setRenderTarget(s)}}function g1(i){let e=new WeakMap,t=new WeakMap,n=null;function r(d,f=!1){return d==null?null:f?a(d):s(d)}function s(d){if(d&&d.isTexture){const f=d.mapping;if(f===ya||f===ba)if(e.has(d)){const p=e.get(d).texture;return o(p,d.mapping)}else{const p=d.image;if(p&&p.height>0){const _=new Xd(p.height);return _.fromEquirectangularTexture(i,d),e.set(d,_),d.addEventListener("dispose",c),o(_.texture,d.mapping)}else return null}}return d}function a(d){if(d&&d.isTexture){const f=d.mapping,p=f===ya||f===ba,_=f===mi||f===Qi;if(p||_){let g=t.get(d);const m=g!==void 0?g.texture.pmremVersion:0;if(d.isRenderTargetTexture&&d.pmremVersion!==m)return n===null&&(n=new Ch(i)),g=p?n.fromEquirectangular(d,g):n.fromCubemap(d,g),g.texture.pmremVersion=d.pmremVersion,t.set(d,g),g.texture;if(g!==void 0)return g.texture;{const v=d.image;return p&&v&&v.height>0||_&&v&&l(v)?(n===null&&(n=new Ch(i)),g=p?n.fromEquirectangular(d):n.fromCubemap(d),g.texture.pmremVersion=d.pmremVersion,t.set(d,g),d.addEventListener("dispose",u),g.texture):null}}}return d}
vendor: 23,150 bytes, lines 3956-4037
3956function o(d,f){return f===ya?d.mapping=mi:f===ba&&(d.mapping=Qi),d}function l(d){let f=0;const p=6;for(let _=0;_<p;_++)d[_]!==void 0&&f++;return f===p}function c(d){const f=d.target;f.removeEventListener("dispose",c);const p=e.get(f);p!==void 0&&(e.delete(f),p.dispose())}function u(d){const f=d.target;f.removeEventListener("dispose",u);const p=t.get(f);p!==void 0&&(t.delete(f),p.dispose())}function h(){e=new WeakMap,t=new WeakMap,n!==null&&(n.dispose(),n=null)}return{get:r,dispose:h}}function _1(i){const e={};function t(n){if(e[n]!==void 0)return e[n];const r=i.getExtension(n);return e[n]=r,r}return{has:function(n){return t(n)!==null},init:function(){t("EXT_color_buffer_float"),t("WEBGL_clip_cull_distance"),t("OES_texture_float_linear"),t("EXT_color_buffer_half_float"),t("WEBGL_multisampled_render_to_texture"),t("WEBGL_render_shared_exponent")},get:function(n){const r=t(n);return r===null&&ac("WebGLRenderer: "+n+" extension not supported."),r}}}function v1(i,e,t,n){const r={},s=new WeakMap;function a(h){const d=h.target;d.index!==null&&e.remove(d.index);for(const p in d.attributes)e.remove(d.attributes[p]);d.removeEventListener("dispose",a),delete r[d.id];const f=s.get(d);f&&(e.remove(f),s.delete(d)),n.releaseStatesOfGeometry(d),d.isInstancedBufferGeometry===!0&&delete d._maxInstanceCount,t.memory.geometries--}function o(h,d){return r[d.id]===!0||(d.addEventListener("dispose",a),r[d.id]=!0,t.memory.geometries++),d}function l(h){const d=h.attributes;for(const f in d)e.update(d[f],i.ARRAY_BUFFER)}function c(h){const d=[],f=h.index,p=h.attributes.position;let _=0;if(p===void 0)return;if(f!==null){const v=f.array;_=f.version;for(let b=0,y=v.length;b<y;b+=3){const T=v[b+0],S=v[b+1],R=v[b+2];d.push(T,S,S,R,R,T)}}else{const v=p.array;_=p.version;for(let b=0,y=v.length/3-1;b<y;b+=3){const T=b+0,S=b+1,R=b+2;d.push(T,S,S,R,R,T)}}const g=new(p.count>=65535?xd:vd)(d,1);g.version=_;const m=s.get(h);m&&e.remove(m),s.set(h,g)}function u(h){const d=s.get(h);if(d){const f=h.index;f!==null&&d.version<f.version&&c(h)}else c(h);return s.get(h)}return{get:o,update:l,getWireframeAttribute:u}}function x1(i,e,t){let n;function r(h){n=h}let s,a;function o(h){s=h.type,a=h.bytesPerElement}function l(h,d){i.drawElements(n,d,s,h*a),t.update(d,n,1)}function c(h,d,f){f!==0&&(i.drawElementsInstanced(n,d,s,h*a,f),t.update(d,n,f))}function u(h,d,f){if(f===0)return;e.get("WEBGL_multi_draw").multiDrawElementsWEBGL(n,d,0,s,h,0,f);let _=0;for(let g=0;g<f;g++)_+=d[g];t.update(_,n,1)}this.setMode=r,this.setIndex=o,this.render=l,this.renderInstances=c,this.renderMultiDraw=u}function y1(i){const e={geometries:0,textures:0},t={frame:0,calls:0,triangles:0,points:0,lines:0};function n(s,a,o){switch(t.calls++,a){case i.TRIANGLES:t.triangles+=o*(s/3);break;case i.LINES:t.lines+=o*(s/2);break;case i.LINE_STRIP:t.lines+=o*(s-1);break;case i.LINE_LOOP:t.lines+=o*s;break;case i.POINTS:t.points+=o*s;break;default:Oe("WebGLInfo: Unknown draw mode:",a);break}}function r(){t.calls=0,t.triangles=0,t.points=0,t.lines=0}return{memory:e,render:t,programs:null,autoReset:!0,reset:r,update:n}}function b1(i,e,t){const n=new WeakMap,r=new Et;function s(a,o,l){const c=a.morphTargetInfluences,u=o.morphAttributes.position||o.morphAttributes.normal||o.morphAttributes.color,h=u!==void 0?u.length:0;let d=n.get(o);if(d===void 0||d.count!==h){let M=function(){R.dispose(),n.delete(o),o.removeEventListener("dispose",M)};d!==void 0&&d.texture.dispose();const f=o.morphAttributes.position!==void 0,p=o.morphAttributes.normal!==void 0,_=o.morphAttributes.color!==void 0,g=o.morphAttributes.position||[],m=o.morphAttributes.normal||[],v=o.morphAttributes.color||[];let b=0;f===!0&&(b=1),p===!0&&(b=2),_===!0&&(b=3);let y=o.attributes.position.count*b,T=1;y>e.maxTextureSize&&(T=Math.ceil(y/e.maxTextureSize),y=e.maxTextureSize);const S=new Float32Array(y*T*4*h),R=new Lc(S,y,T,h);R.type=vn,R.needsUpdate=!0;const x=b*4;for(let A=0;A<h;A++){const I=g[A],N=m[A],U=v[A],k=y*T*4*A;for(let L=0;L<I.count;L++){const F=L*x;f===!0&&(r.fromBufferAttribute(I,L),S[k+F+0]=r.x,S[k+F+1]=r.y,S[k+F+2]=r.z,S[k+F+3]=0),p===!0&&(r.fromBufferAttribute(N,L),S[k+F+4]=r.x,S[k+F+5]=r.y,S[k+F+6]=r.z,S[k+F+7]=0),_===!0&&(r.fromBufferAttribute(U,L),S[k+F+8]=r.x,S[k+F+9]=r.y,S[k+F+10]=r.z,S[k+F+11]=U.itemSize===4?r.w:1)}}d={count:h,texture:R,size:new j(y,T)},n.set(o,d),o.addEventListener("dispose",M)}if(a.isInstancedMesh===!0&&a.morphTexture!==null)l.getUniforms().setValue(i,"morphTexture",a.morphTexture,t);else{let f=0;for(let _=0;_<c.length;_++)f+=c[_];const p=o.morphTargetsRelative?1:1-f;l.getUniforms().setValue(i,"morphTargetBaseInfluence",p),l.getUniforms().setValue(i,"morphTargetInfluences",c)}l.getUniforms().setValue(i,"morphTargetsTexture",d.texture,t),l.getUniforms().setValue(i,"morphTargetsTextureSize",d.size)}return{update:s}}function S1(i,e,t,n,r){let s=new WeakMap;function a(c){const u=r.render.frame,h=c.geometry,d=e.get(c,h);if(s.get(d)!==u&&(e.update(d),s.set(d,u)),c.isInstancedMesh&&(c.hasEventListener("dispose",l)===!1&&c.addEventListener("dispose",l),s.get(c)!==u&&(t.update(c.instanceMatrix,i.ARRAY_BUFFER),c.instanceColor!==null&&t.update(c.instanceColor,i.ARRAY_BUFFER),s.set(c,u))),c.isSkinnedMesh){const f=c.skeleton;s.get(f)!==u&&(f.update(),s.set(f,u))}return d}function o(){s=new WeakMap}function l(c){const u=c.target;u.removeEventListener("dispose",l),n.releaseStatesOfObject(u),t.remove(u.instanceMatrix),u.instanceColor!==null&&t.remove(u.instanceColor)}return{update:a,dispose:o}}const M1={[nd]:"LINEAR_TONE_MAPPING",[id]:"REINHARD_TONE_MAPPING",[rd]:"CINEON_TONE_MAPPING",[bc]:"ACES_FILMIC_TONE_MAPPING",[ad]:"AGX_TONE_MAPPING",[od]:"NEUTRAL_TONE_MAPPING",[sd]:"CUSTOM_TONE_MAPPING"};function E1(i,e,t,n,r){const s=new Bn(e,t,{type:i,depthBuffer:n,stencilBuffer:r,depthTexture:n?new Br(e,t):void 0}),a=new Bn(e,t,{type:gi,depthBuffer:!1,stencilBuffer:!1}),o=new et;o.setAttribute("position",new Pe([-1,3,0,-1,-1,0,3,-1,0],3)),o.setAttribute("uv",new Pe([0,2,0,0,2,0],2));const l=new Id({uniforms:{tDiffuse:{value:null}},vertexShader:` 3957 precision highp float; 3958 3959 uniform mat4 modelViewMatrix; 3960 uniform mat4 projectionMatrix; 3961 3962 attribute vec3 position; 3963 attribute vec2 uv; 3964 3965 varying vec2 vUv; 3966 3967 void main() { 3968 vUv = uv; 3969 gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); 3970 }`,fragmentShader:` 3971 precision highp float; 3972 3973 uniform sampler2D tDiffuse; 3974 3975 varying vec2 vUv; 3976 3977 #include <tonemapping_pars_fragment> 3978 #include <colorspace_pars_fragment> 3979 3980 void main() { 3981 gl_FragColor = texture2D( tDiffuse, vUv ); 3982 3983 #ifdef LINEAR_TONE_MAPPING 3984 gl_FragColor.rgb = LinearToneMapping( gl_FragColor.rgb ); 3985 #elif defined( REINHARD_TONE_MAPPING ) 3986 gl_FragColor.rgb = ReinhardToneMapping( gl_FragColor.rgb ); 3987 #elif defined( CINEON_TONE_MAPPING ) 3988 gl_FragColor.rgb = CineonToneMapping( gl_FragColor.rgb ); 3989 #elif defined( ACES_FILMIC_TONE_MAPPING ) 3990 gl_FragColor.rgb = ACESFilmicToneMapping( gl_FragColor.rgb ); 3991 #elif defined( AGX_TONE_MAPPING ) 3992 gl_FragColor.rgb = AgXToneMapping( gl_FragColor.rgb ); 3993 #elif defined( NEUTRAL_TONE_MAPPING ) 3994 gl_FragColor.rgb = NeutralToneMapping( gl_FragColor.rgb ); 3995 #elif defined( CUSTOM_TONE_MAPPING ) 3996 gl_FragColor.rgb = CustomToneMapping( gl_FragColor.rgb ); 3997 #endif 3998 3999 #ifdef SRGB_TRANSFER 4000 gl_FragColor = sRGBTransferOETF( gl_FragColor ); 4001 #endif 4002 }`,depthTest:!1,depthWrite:!1}),c=new Dt(o,l),u=new fo(-1,1,1,-1,0,1);let h=null,d=null,f=!1,p,_=null,g=[],m=!1;this.setSize=function(v,b){s.setSize(v,b),a.setSize(v,b);for(let y=0;y<g.length;y++){const T=g[y];T.setSize&&T.setSize(v,b)}},this.setEffects=function(v){g=v,m=g.length>0&&g[0].isRenderPass===!0;const b=s.width,y=s.height;for(let T=0;T<g.length;T++){const S=g[T];S.setSize&&S.setSize(b,y)}},this.begin=function(v,b){if(f||v.toneMapping===ei&&g.length===0)return!1;if(_=b,b!==null){const y=b.width,T=b.height;(s.width!==y||s.height!==T)&&this.setSize(y,T)}return m===!1&&v.setRenderTarget(s),p=v.toneMapping,v.toneMapping=ei,!0},this.hasRenderPass=function(){return m},this.end=function(v,b){v.toneMapping=p,f=!0;let y=s,T=a;for(let S=0;S<g.length;S++){const R=g[S];if(R.enabled!==!1&&(R.render(v,T,y,b),R.needsSwap!==!1)){const x=y;y=T,T=x}}if(h!==v.outputColorSpace||d!==v.toneMapping){h=v.outputColorSpace,d=v.toneMapping,l.defines={},dt.getTransfer(h)===St&&(l.defines.SRGB_TRANSFER="");const S=M1[d];S&&(l.defines[S]=""),l.needsUpdate=!0}l.uniforms.tDiffuse.value=y.texture,v.setRenderTarget(_),v.render(c,u),_=null,f=!1},this.isCompositing=function(){return f},this.dispose=function(){s.depthTexture&&s.depthTexture.dispose(),s.dispose(),a.dispose(),o.dispose(),l.dispose()}}const m0=new Ft,Rh=new Br(1,1),g0=new Lc,_0=new Nc,v0=new oo,Xp=[],qp=[],$p=new Float32Array(16),Yp=new Float32Array(9),Zp=new Float32Array(4);function Ys(i,e,t){const n=i[0];if(n<=0||n>0)return i;const r=e*t;let s=Xp[r];if(s===void 0&&(s=new Float32Array(r),Xp[r]=s),e!==0){n.toArray(s,0);for(let a=1,o=0;a!==e;++a)o+=t,i[a].toArray(s,o)}return s}function Yt(i,e){if(i.length!==e.length)return!1;for(let t=0,n=i.length;t<n;t++)if(i[t]!==e[t])return!1;return!0}function Zt(i,e){for(let t=0,n=e.length;t<n;t++)i[t]=e[t]}function iu(i,e){let t=qp[e];t===void 0&&(t=new Int32Array(e),qp[e]=t);for(let n=0;n!==e;++n)t[n]=i.allocateTextureUnit();return t}function T1(i,e){const t=this.cache;t[0]!==e&&(i.uniform1f(this.addr,e),t[0]=e)}function w1(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(i.uniform2f(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(Yt(t,e))return;i.uniform2fv(this.addr,e),Zt(t,e)}}function A1(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(i.uniform3f(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else if(e.r!==void 0)(t[0]!==e.r||t[1]!==e.g||t[2]!==e.b)&&(i.uniform3f(this.addr,e.r,e.g,e.b),t[0]=e.r,t[1]=e.g,t[2]=e.b);else{if(Yt(t,e))return;i.uniform3fv(this.addr,e),Zt(t,e)}}function C1(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(i.uniform4f(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(Yt(t,e))return;i.uniform4fv(this.addr,e),Zt(t,e)}}function R1(i,e){const t=this.cache,n=e.elements;if(n===void 0){if(Yt(t,e))return;i.uniformMatrix2fv(this.addr,!1,e),Zt(t,e)}else{if(Yt(t,n))return;Zp.set(n),i.uniformMatrix2fv(this.addr,!1,Zp),Zt(t,n)}}function I1(i,e){const t=this.cache,n=e.elements;if(n===void 0){if(Yt(t,e))return;i.uniformMatrix3fv(this.addr,!1,e),Zt(t,e)}else{if(Yt(t,n))return;Yp.set(n),i.uniformMatrix3fv(this.addr,!1,Yp),Zt(t,n)}}function P1(i,e){const t=this.cache,n=e.elements;if(n===void 0){if(Yt(t,e))return;i.uniformMatrix4fv(this.addr,!1,e),Zt(t,e)}else{if(Yt(t,n))return;$p.set(n),i.uniformMatrix4fv(this.addr,!1,$p),Zt(t,n)}}function L1(i,e){const t=this.cache;t[0]!==e&&(i.uniform1i(this.addr,e),t[0]=e)}function N1(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(i.uniform2i(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(Yt(t,e))return;i.uniform2iv(this.addr,e),Zt(t,e)}}function D1(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(i.uniform3i(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(Yt(t,e))return;i.uniform3iv(this.addr,e),Zt(t,e)}}function O1(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(i.uniform4i(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(Yt(t,e))return;i.uniform4iv(this.addr,e),Zt(t,e)}}function U1(i,e){const t=this.cache;t[0]!==e&&(i.uniform1ui(this.addr,e),t[0]=e)}function F1(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(i.uniform2ui(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(Yt(t,e))return;i.uniform2uiv(this.addr,e),Zt(t,e)}}function B1(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(i.uniform3ui(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(Yt(t,e))return;i.uniform3uiv(this.addr,e),Zt(t,e)}}function k1(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(i.uniform4ui(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(Yt(t,e))return;i.uniform4uiv(this.addr,e),Zt(t,e)}}function V1(i,e,t){const n=this.cache,r=t.allocateTextureUnit();n[0]!==r&&(i.uniform1i(this.addr,r),n[0]=r);let s;this.type===i.SAMPLER_2D_SHADOW?(Rh.compareFunction=t.isReversedDepthBuffer()?Pc:Ic,s=Rh):s=m0,t.setTexture2D(e||s,r)}function z1(i,e,t){const n=this.cache,r=t.allocateTextureUnit();n[0]!==r&&(i.uniform1i(this.addr,r),n[0]=r),t.setTexture3D(e||_0,r)}function H1(i,e,t){const n=this.cache,r=t.allocateTextureUnit();n[0]!==r&&(i.uniform1i(this.addr,r),n[0]=r),t.setTextureCube(e||v0,r)}function G1(i,e,t){const n=this.cache,r=t.allocateTextureUnit();n[0]!==r&&(i.uniform1i(this.addr,r),n[0]=r),t.setTexture2DArray(e||g0,r)}function W1(i){switch(i){case 5126:return T1;case 35664:return w1;case 35665:return A1;case 35666:return C1;case 35674:return R1;case 35675:return I1;case 35676:return P1;case 5124:case 35670:return L1;case 35667:case 35671:return N1;case 35668:case 35672:return D1;case 35669:case 35673:return O1;case 5125:return U1;case 36294:return F1;case 36295:return B1;case 36296:return k1;case 35678:case 36198:case 36298:case 36306:case 35682:return V1;case 35679:case 36299:case 36307:return z1;case 35680:case 36300:case 36308:case 36293:return H1;case 36289:case 36303:case 36311:case 36292:return G1}}function X1(i,e){i.uniform1fv(this.addr,e)}function q1(i,e){const t=Ys(e,this.size,2);i.uniform2fv(this.addr,t)}function $1(i,e){const t=Ys(e,this.size,3);i.uniform3fv(this.addr,t)}function Y1(i,e){const t=Ys(e,this.size,4);i.uniform4fv(this.addr,t)}function Z1(i,e){const t=Ys(e,this.size,4);i.uniformMatrix2fv(this.addr,!1,t)}function K1(i,e){const t=Ys(e,this.size,9);i.uniformMatrix3fv(this.addr,!1,t)}function J1(i,e){const t=Ys(e,this.size,16);i.uniformMatrix4fv(this.addr,!1,t)}function j1(i,e){i.uniform1iv(this.addr,e)}function Q1(i,e){i.uniform2iv(this.addr,e)}function eC(i,e){i.uniform3iv(this.addr,e)}function tC(i,e){i.uniform4iv(this.addr,e)}function nC(i,e){i.uniform1uiv(this.addr,e)}function iC(i,e){i.uniform2uiv(this.addr,e)}function rC(i,e){i.uniform3uiv(this.addr,e)}function sC(i,e){i.uniform4uiv(this.addr,e)}function aC(i,e,t){const n=this.cache,r=e.length,s=iu(t,r);Yt(n,s)||(i.uniform1iv(this.addr,s),Zt(n,s));let a;this.type===i.SAMPLER_2D_SHADOW?a=Rh:a=m0;for(let o=0;o!==r;++o)t.setTexture2D(e[o]||a,s[o])}function oC(i,e,t){const n=this.cache,r=e.length,s=iu(t,r);Yt(n,s)||(i.uniform1iv(this.addr,s),Zt(n,s));for(let a=0;a!==r;++a)t.setTexture3D(e[a]||_0,s[a])}function lC(i,e,t){const n=this.cache,r=e.length,s=iu(t,r);Yt(n,s)||(i.uniform1iv(this.addr,s),Zt(n,s));for(let a=0;a!==r;++a)t.setTextureCube(e[a]||v0,s[a])}function cC(i,e,t){const n=this.cache,r=e.length,s=iu(t,r);Yt(n,s)||(i.uniform1iv(this.addr,s),Zt(n,s));for(let a=0;a!==r;++a)t.setTexture2DArray(e[a]||g0,s[a])}function uC(i){switch(i){case 5126:return X1;case 35664:return q1;case 35665:return $1;case 35666:return Y1;case 35674:return Z1;case 35675:return K1;case 35676:return J1;case 5124:case 35670:return j1;case 35667:case 35671:return Q1;case 35668:case 35672:return eC;case 35669:case 35673:return tC;case 5125:return nC;case 36294:return iC;case 36295:return rC;case 36296:return sC;case 35678:case 36198:case 36298:case 36306:case 35682:return aC;case 35679:case 36299:case 36307:return oC;case 35680:case 36300:case 36308:case 36293:return lC;case 36289:case 36303:case 36311:case 36292:return cC}}class hC{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.setValue=W1(t.type)}}class dC{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.size=t.size,this.setValue=uC(t.type)}}class fC{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,t,n){const r=this.seq;for(let s=0,a=r.length;s!==a;++s){const o=r[s];o.setValue(e,t[o.id],n)}}}const Ku=/(\w+)(\])?(\[|\.)?/g;function Kp(i,e){i.seq.push(e),i.map[e.id]=e}function pC(i,e,t){const n=i.name,r=n.length;for(Ku.lastIndex=0;;){const s=Ku.exec(n),a=Ku.lastIndex;let o=s[1];const l=s[2]==="]",c=s[3];if(l&&(o=o|0),c===void 0||c==="["&&a+2===r){Kp(t,c===void 0?new hC(o,i,e):new dC(o,i,e));break}else{let h=t.map[o];h===void 0&&(h=new fC(o),Kp(t,h)),t=h}}}class fl{constructor(e,t){this.seq=[],this.map={};const n=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let a=0;a<n;++a){const o=e.getActiveUniform(t,a),l=e.getUniformLocation(t,o.name);pC(o,l,this)}const r=[],s=[];for(const a of this.seq)a.type===e.SAMPLER_2D_SHADOW||a.type===e.SAMPLER_CUBE_SHADOW||a.type===e.SAMPLER_2D_ARRAY_SHADOW?r.push(a):s.push(a);r.length>0&&(this.seq=r.concat(s))}setValue(e,t,n,r){const s=this.map[t];s!==void 0&&s.setValue(e,n,r)}setOptional(e,t,n){const r=t[n];r!==void 0&&this.setValue(e,n,r)}static upload(e,t,n,r){for(let s=0,a=t.length;s!==a;++s){const o=t[s],l=n[o.id];l.needsUpdate!==!1&&o.setValue(e,l.value,r)}}static seqWithValue(e,t){const n=[];for(let r=0,s=e.length;r!==s;++r){const a=e[r];a.id in t&&n.push(a)}return n}}function Jp(i,e,t){const n=i.createShader(e);return i.shaderSource(n,t),i.compileShader(n),n}const mC=37297;let gC=0;function _C(i,e){const t=i.split(` 4003`),n=[],r=Math.max(e-6,0),s=Math.min(e+6,t.length);for(let a=r;a<s;a++){const o=a+1;n.push(`${o===e?">":" "} ${o}: ${t[a]}`)}return n.join(` 4004`)}const jp=new tt;function vC(i){dt._getMatrix(jp,dt.workingColorSpace,i);const e=`mat3( ${jp.elements.map(t=>t.toFixed(4))} )`;switch(dt.getTransfer(i)){case Ga:return[e,"LinearTransferOETF"];case St:return[e,"sRGBTransferOETF"];default:return _e("WebGLProgram: Unsupported color space: ",i),[e,"LinearTransferOETF"]}}function Qp(i,e,t){const n=i.getShaderParameter(e,i.COMPILE_STATUS),s=(i.getShaderInfoLog(e)||"").trim();if(n&&s==="")return"";const a=/ERROR: 0:(\d+)/.exec(s);if(a){const o=parseInt(a[1]);return t.toUpperCase()+` 4005 4006`+s+` 4007 4008`+_C(i.getShaderSource(e),o)}else return s}function xC(i,e){const t=vC(e);return[`vec4 ${i}( vec4 value ) {`,` return ${t[1]}( vec4( value.rgb * ${t[0]}, value.a ) );`,"}"].join(` 4009`)}const yC={[nd]:"Linear",[id]:"Reinhard",[rd]:"Cineon",[bc]:"ACESFilmic",[ad]:"AgX",[od]:"Neutral",[sd]:"Custom"};function bC(i,e){const t=yC[e];return t===void 0?(_e("WebGLProgram: Unsupported toneMapping:",e),"vec3 "+i+"( vec3 color ) { return LinearToneMapping( color ); }"):"vec3 "+i+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}const ol=new P;function SC(){dt.getLuminanceCoefficients(ol);const i=ol.x.toFixed(4),e=ol.y.toFixed(4),t=ol.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",` const vec3 weights = vec3( ${i}, ${e}, ${t} );`," return dot( weights, rgb );","}"].join(` 4010`)}function MC(i){return[i.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",i.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(pa).join(` 4011`)}function EC(i){const e=[];for(const t in i){const n=i[t];n!==!1&&e.push("#define "+t+" "+n)}return e.join(` 4012`)}function TC(i,e){const t={},n=i.getProgramParameter(e,i.ACTIVE_ATTRIBUTES);for(let r=0;r<n;r++){const s=i.getActiveAttrib(e,r),a=s.name;let o=1;s.type===i.FLOAT_MAT2&&(o=2),s.type===i.FLOAT_MAT3&&(o=3),s.type===i.FLOAT_MAT4&&(o=4),t[a]={type:s.type,location:i.getAttribLocation(e,a),locationSize:o}}return t}function pa(i){return i!==""}function em(i,e){const t=e.numSpotLightShadows+e.numSpotLightMaps-e.numSpotLightShadowsWithMaps;return i.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,e.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,t).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,e.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function tm(i,e){return i.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const wC=/^[ \t]*#include +<([\w\d./]+)>/gm;function Ih(i){return i.replace(wC,CC)}const AC=new Map;function CC(i,e){let t=lt[e];if(t===void 0){const n=AC.get(e);if(n!==void 0)t=lt[n],_e('WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,n);else throw new Error("Can not resolve #include <"+e+">")}return Ih(t)}const RC=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function nm(i){return i.replace(RC,IC)}function IC(i,e,t,n){let r="";for(let s=parseInt(e);s<parseInt(t);s++)r+=n.replace(/\[\s*i\s*\]/g,"[ "+s+" ]").replace(/UNROLLED_LOOP_INDEX/g,s);return r}function im(i){let e=`precision ${i.precision} float; 4013 precision ${i.precision} int; 4014 precision ${i.precision} sampler2D; 4015 precision ${i.precision} samplerCube; 4016 precision ${i.precision} sampler3D; 4017 precision ${i.precision} sampler2DArray; 4018 precision ${i.precision} sampler2DShadow; 4019 precision ${i.precision} samplerCubeShadow; 4020 precision ${i.precision} sampler2DArrayShadow; 4021 precision ${i.precision} isampler2D; 4022 precision ${i.precision} isampler3D; 4023 precision ${i.precision} isamplerCube; 4024 precision ${i.precision} isampler2DArray; 4025 precision ${i.precision} usampler2D; 4026 precision ${i.precision} usampler3D; 4027 precision ${i.precision} usamplerCube; 4028 precision ${i.precision} usampler2DArray; 4029 `;return i.precision==="highp"?e+=` 4030#define HIGH_PRECISION`:i.precision==="mediump"?e+=` 4031#define MEDIUM_PRECISION`:i.precision==="lowp"&&(e+=` 4032#define LOW_PRECISION`),e}const PC={[xa]:"SHADOWMAP_TYPE_PCF",[ps]:"SHADOWMAP_TYPE_VSM"};function LC(i){return PC[i.shadowMapType]||"SHADOWMAP_TYPE_BASIC"}const NC={[mi]:"ENVMAP_TYPE_CUBE",[Qi]:"ENVMAP_TYPE_CUBE",[Gs]:"ENVMAP_TYPE_CUBE_UV"};function DC(i){return i.envMap===!1?"ENVMAP_TYPE_CUBE":NC[i.envMapMode]||"ENVMAP_TYPE_CUBE"}const OC={[Qi]:"ENVMAP_MODE_REFRACTION"};function UC(i){return i.envMap===!1?"ENVMAP_MODE_REFLECTION":OC[i.envMapMode]||"ENVMAP_MODE_REFLECTION"}const FC={[ro]:"ENVMAP_BLENDING_MULTIPLY",[$g]:"ENVMAP_BLENDING_MIX",[Yg]:"ENVMAP_BLENDING_ADD"};function BC(i){return i.envMap===!1?"ENVMAP_BLENDING_NONE":FC[i.combine]||"ENVMAP_BLENDING_NONE"}function kC(i){const e=i.envMapCubeUVHeight;if(e===null)return null;const t=Math.log2(e)-2,n=1/e;return{texelWidth:1/(3*Math.max(Math.pow(2,t),112)),texelHeight:n,maxMip:t}}function VC(i,e,t,n){const r=i.getContext(),s=t.defines;let a=t.vertexShader,o=t.fragmentShader;const l=LC(t),c=DC(t),u=UC(t),h=BC(t),d=kC(t),f=MC(t),p=EC(s),_=r.createProgram();let g,m,v=t.glslVersion?"#version "+t.glslVersion+` 4033`:"";t.isRawShaderMaterial?(g=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,p].filter(pa).join(` 4034`),g.length>0&&(g+=` 4035`),m=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,p].filter(pa).join(` 4036`),m.length>0&&(m+=` 4037`)):(g=[im(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,p,t.extensionCl
vendor: 6,566 bytes, lines 4037-4039
4037ipCullDistance?"#define USE_CLIP_DISTANCE":"",t.batching?"#define USE_BATCHING":"",t.batchingColor?"#define USE_BATCHING_COLOR":"",t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.instancingMorph?"#define USE_INSTANCING_MORPH":"",t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+u:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.displacementMap?"#define USE_DISPLACEMENTMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.mapUv?"#define MAP_UV "+t.mapUv:"",t.alphaMapUv?"#define ALPHAMAP_UV "+t.alphaMapUv:"",t.lightMapUv?"#define LIGHTMAP_UV "+t.lightMapUv:"",t.aoMapUv?"#define AOMAP_UV "+t.aoMapUv:"",t.emissiveMapUv?"#define EMISSIVEMAP_UV "+t.emissiveMapUv:"",t.bumpMapUv?"#define BUMPMAP_UV "+t.bumpMapUv:"",t.normalMapUv?"#define NORMALMAP_UV "+t.normalMapUv:"",t.displacementMapUv?"#define DISPLACEMENTMAP_UV "+t.displacementMapUv:"",t.metalnessMapUv?"#define METALNESSMAP_UV "+t.metalnessMapUv:"",t.roughnessMapUv?"#define ROUGHNESSMAP_UV "+t.roughnessMapUv:"",t.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+t.anisotropyMapUv:"",t.clearcoatMapUv?"#define CLEARCOATMAP_UV "+t.clearcoatMapUv:"",t.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+t.clearcoatNormalMapUv:"",t.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+t.clearcoatRoughnessMapUv:"",t.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+t.iridescenceMapUv:"",t.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+t.iridescenceThicknessMapUv:"",t.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+t.sheenColorMapUv:"",t.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+t.sheenRoughnessMapUv:"",t.specularMapUv?"#define SPECULARMAP_UV "+t.specularMapUv:"",t.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+t.specularColorMapUv:"",t.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+t.specularIntensityMapUv:"",t.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+t.transmissionMapUv:"",t.thicknessMapUv?"#define THICKNESSMAP_UV "+t.thicknessMapUv:"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexNormals?"#define HAS_NORMAL":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.morphColors?"#define USE_MORPHCOLORS":"",t.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+t.morphTextureStride:"",t.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.logarithmicDepthBuffer?"#define USE_LOGARITHMIC_DEPTH_BUFFER":"",t.reversedDepthBuffer?"#define USE_REVERSED_DEPTH_BUFFER":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH"," uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` 4038`].filter(pa).join(` 4039`),m=[im(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,p,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+c:"",t.envMap?"#define "+u:"",t.envMap?"#define "+h:"",d?"#define CUBEUV_TEXEL_WIDTH "+d.texelWidth:"",d?"#define CUBEUV_TEXEL_HEIGHT "+d.texelHeight:"",d?"#define CUBEUV_MAX_MIP "+d.maxMip+".0":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.packedNormalMap?"#define USE_PACKED_NORMALMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.dispersion?"#define USE_DISPERSION":"",t.iridescence?"#define USE_IR
4039IDESCENCE":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor?"#define USE_COLOR":"",t.vertexAlphas||t.batchingColor?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.numLightProbeGrids>0?"#define USE_LIGHT_PROBES_GRID":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",t.logarithmicDepthBuffer?"#define USE_LOGARITHMIC_DEPTH_BUFFER":"",t.reversedDepthBuffer?"#define USE_REVERSED_DEPTH_BUFFER":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==ei?"#define TONE_MAPPING":"",t.toneMapping!==ei?lt.tonemapping_pars_fragment:"",t.toneMapping!==ei?bC("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",lt.colorspace_pars_fragment,xC("linearToOutputTexel",t.outputColorSpace),SC(),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` 4040`].filter(pa).join(` 4041`)),a=Ih(a),a=em(a,t),a=tm(a,t),o=Ih(o),o=em(o,t),o=tm(o,t),a=nm(a),o=nm(o),t.isRawShaderMaterial!==!0&&(v=`#version 300 es 4042`,g=[f,"#define attribute in","#define varying out","#define texture2D texture"].join(` 4043`)+` 4044`+g,m=["#define varying in",t.glslVersion===xh?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===xh?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(` 4045`)+` 4046`+m);const b=v+g+a,y=v+m+o,T=Jp(r,r.VERTEX_SHADER,b),S=Jp(r,r.FRAGMENT_SHADER,y);r.attachShader(_,T),r.attachShader(_,S),t.index0AttributeName!==void 0?r.bindAttribLocation(_,0,t.index0AttributeName):t.morphTargets===!0&&r.bindAttribLocation(_,0,"position"),r.linkProgram(_);function R(I){if(i.debug.checkShaderErrors){const N=r.getProgramInfoLog(_)||"",U=r.getShaderInfoLog(T)||"",k=r.getShaderInfoLog(S)||"",L=N.trim(),F=U.trim(),O=k.trim();let X=!0,$=!0;if(r.getProgramParameter(_,r.LINK_STATUS)===!1)if(X=!1,typeof i.debug.onShaderError=="function")i.debug.onShaderError(r,_,T,S);else{const te=Qp(r,T,"vertex"),ue=Qp(r,S,"fragment");Oe("THREE.WebGLProgram: Shader Error "+r.getError()+" - VALIDATE_STATUS "+r.getProgramParameter(_,r.VALIDATE_STATUS)+` 4047 4048Material Name: `+I.name+` 4049Material Type: `+I.type+` 4050 4051Program Info Log: `+L+` 4052`+te+` 4053`+ue)}else L!==""?_e("WebGLProgram: Program Info Log:",L):(F===""||O==="")&&($=!1);$&&(I.diagnostics={runnable:X,programLog:L,vertexShader:{log:F,prefix:g},fragmentShader:{log:O,prefix:m}})}r.deleteShader(T),r.deleteShader(S),x=new fl(r,_),M=TC(r,_)}let x;this.getUniforms=function(){return x===void 0&&R(this),x};let M;this.getAttributes=function(){return M===void 0&&R(this),M};let A=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return A===!1&&(A=r.getProgramParameter(_,mC)),A},this.destroy=function(){n.releaseStatesOfProgram(this),r.deleteProgram(_),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=gC++,this.cacheKey=e,this.usedTimes=1,this.program=_,this.vertexShader=T,this.fragmentShader=S,this}let zC=0;class HC{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,n=e.fragmentShader,r=this._getShaderStage(t),s=this._getShaderStage(n),a=this._getShaderCacheForMaterial(e);return a.has(r)===!1&&(a.add(r),r.usedTimes++),a.has(s)===!1&&(a.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 GC(e),t.set(e,n)),n}}class GC{constructor(e){this.id=zC++,this.code=e,this.usedTimes=0}}function WC(i){return i===er||i===Ba||i===ka}
vendor: 19,525 bytes, line 4053
4053function XC(i,e,t,n,r,s){const a=new ao,o=new HC,l=new Set,c=[],u=new Map,h=n.logarithmicDepthBuffer;let d=n.precision;const f={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distance",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 p(x){return l.add(x),x===0?"uv":`uv${x}`}function _(x,M,A,I,N,U){const k=I.fog,L=N.geometry,F=x.isMeshStandardMaterial||x.isMeshLambertMaterial||x.isMeshPhongMaterial?I.environment:null,O=x.isMeshStandardMaterial||x.isMeshLambertMaterial&&!x.envMap||x.isMeshPhongMaterial&&!x.envMap,X=e.get(x.envMap||F,O),$=X&&X.mapping===Gs?X.image.height:null,te=f[x.type];x.precision!==null&&(d=n.getMaxPrecision(x.precision),d!==x.precision&&_e("WebGLProgram.getParameters:",x.precision,"not supported, using",d,"instead."));const ue=L.morphAttributes.position||L.morphAttributes.normal||L.morphAttributes.color,xe=ue!==void 0?ue.length:0;let He=0;L.morphAttributes.position!==void 0&&(He=1),L.morphAttributes.normal!==void 0&&(He=2),L.morphAttributes.color!==void 0&&(He=3);let Ke,qe,K,ye;if(te){const rt=Jn[te];Ke=rt.vertexShader,qe=rt.fragmentShader}else Ke=x.vertexShader,qe=x.fragmentShader,o.update(x),K=o.getVertexShaderID(x),ye=o.getFragmentShaderID(x);const le=i.getRenderTarget(),De=i.state.buffers.depth.getReversed(),Ne=N.isInstancedMesh===!0,Ge=N.isBatchedMesh===!0,ft=!!x.map,Ye=!!x.matcap,Q=!!X,se=!!x.aoMap,ee=!!x.lightMap,pe=!!x.bumpMap,ve=!!x.normalMap,Je=!!x.displacementMap,D=!!x.emissiveMap,nt=!!x.metalnessMap,Ue=!!x.roughnessMap,je=x.anisotropy>0,oe=x.clearcoat>0,bt=x.dispersion>0,C=x.iridescence>0,E=x.sheen>0,z=x.transmission>0,Z=je&&!!x.anisotropyMap,ne=oe&&!!x.clearcoatMap,ce=oe&&!!x.clearcoatNormalMap,fe=oe&&!!x.clearcoatRoughnessMap,q=C&&!!x.iridescenceMap,J=C&&!!x.iridescenceThicknessMap,Te=E&&!!x.sheenColorMap,Re=E&&!!x.sheenRoughnessMap,me=!!x.specularMap,he=!!x.specularColorMap,it=!!x.specularIntensityMap,ot=z&&!!x.transmissionMap,vt=z&&!!x.thicknessMap,B=!!x.gradientMap,de=!!x.alphaMap,Y=x.alphaTest>0,we=!!x.alphaHash,ge=!!x.extensions;let ie=ei;x.toneMapped&&(le===null||le.isXRRenderTarget===!0)&&(ie=i.toneMapping);const ke={shaderID:te,shaderType:x.type,shaderName:x.name,vertexShader:Ke,fragmentShader:qe,defines:x.defines,customVertexShaderID:K,customFragmentShaderID:ye,isRawShaderMaterial:x.isRawShaderMaterial===!0,glslVersion:x.glslVersion,precision:d,batching:Ge,batchingColor:Ge&&N._colorsTexture!==null,instancing:Ne,instancingColor:Ne&&N.instanceColor!==null,instancingMorph:Ne&&N.morphTexture!==null,outputColorSpace:le===null?i.outputColorSpace:le.isXRRenderTarget===!0?le.texture.colorSpace:dt.workingColorSpace,alphaToCoverage:!!x.alphaToCoverage,map:ft,matcap:Ye,envMap:Q,envMapMode:Q&&X.mapping,envMapCubeUVHeight:$,aoMap:se,lightMap:ee,bumpMap:pe,normalMap:ve,displacementMap:Je,emissiveMap:D,normalMapObjectSpace:ve&&x.normalMapType===e_,normalMapTangentSpace:ve&&x.normalMapType===Li,packedNormalMap:ve&&x.normalMapType===Li&&WC(x.normalMap.format),metalnessMap:nt,roughnessMap:Ue,anisotropy:je,anisotropyMap:Z,clearcoat:oe,clearcoatMap:ne,clearcoatNormalMap:ce,clearcoatRoughnessMap:fe,dispersion:bt,iridescence:C,iridescenceMap:q,iridescenceThicknessMap:J,sheen:E,sheenColorMap:Te,sheenRoughnessMap:Re,specularMap:me,specularColorMap:he,specularIntensityMap:it,transmission:z,transmissionMap:ot,thicknessMap:vt,gradientMap:B,opaque:x.transparent===!1&&x.blending===Ir&&x.alphaToCoverage===!1,alphaMap:de,alphaTest:Y,alphaHash:we,combine:x.combine,mapUv:ft&&p(x.map.channel),aoMapUv:se&&p(x.aoMap.channel),lightMapUv:ee&&p(x.lightMap.channel),bumpMapUv:pe&&p(x.bumpMap.channel),normalMapUv:ve&&p(x.normalMap.channel),displacementMapUv:Je&&p(x.displacementMap.channel),emissiveMapUv:D&&p(x.emissiveMap.channel),metalnessMapUv:nt&&p(x.metalnessMap.channel),roughnessMapUv:Ue&&p(x.roughnessMap.channel),anisotropyMapUv:Z&&p(x.anisotropyMap.channel),clearcoatMapUv:ne&&p(x.clearcoatMap.channel),clearcoatNormalMapUv:ce&&p(x.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:fe&&p(x.clearcoatRoughnessMap.channel),iridescenceMapUv:q&&p(x.iridescenceMap.channel),iridescenceThicknessMapUv:J&&p(x.iridescenceThicknessMap.channel),sheenColorMapUv:Te&&p(x.sheenColorMap.channel),sheenRoughnessMapUv:Re&&p(x.sheenRoughnessMap.channel),specularMapUv:me&&p(x.specularMap.channel),specularColorMapUv:he&&p(x.specularColorMap.channel),specularIntensityMapUv:it&&p(x.specularIntensityMap.channel),transmissionMapUv:ot&&p(x.transmissionMap.channel),thicknessMapUv:vt&&p(x.thicknessMap.channel),alphaMapUv:de&&p(x.alphaMap.channel),vertexTangents:!!L.attributes.tangent&&(ve||je),vertexNormals:!!L.attributes.normal,vertexColors:x.vertexColors,vertexAlphas:x.vertexColors===!0&&!!L.attributes.color&&L.attributes.color.itemSize===4,pointsUvs:N.isPoints===!0&&!!L.attributes.uv&&(ft||de),fog:!!k,useFog:x.fog===!0,fogExp2:!!k&&k.isFogExp2,flatShading:x.wireframe===!1&&(x.flatShading===!0||L.attributes.normal===void 0&&ve===!1&&(x.isMeshLambertMaterial||x.isMeshPhongMaterial||x.isMeshStandardMaterial||x.isMeshPhysicalMaterial)),sizeAttenuation:x.sizeAttenuation===!0,logarithmicDepthBuffer:h,reversedDepthBuffer:De,skinning:N.isSkinnedMesh===!0,morphTargets:L.morphAttributes.position!==void 0,morphNormals:L.morphAttributes.normal!==void 0,morphColors:L.morphAttributes.color!==void 0,morphTargetsCount:xe,morphTextureStride:He,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,numLightProbeGrids:U.length,numClippingPlanes:s.numPlanes,numClipIntersection:s.numIntersection,dithering:x.dithering,shadowMapEnabled:i.shadowMap.enabled&&A.length>0,shadowMapType:i.shadowMap.type,toneMapping:ie,decodeVideoTexture:ft&&x.map.isVideoTexture===!0&&dt.getTransfer(x.map.colorSpace)===St,decodeVideoTextureEmissive:D&&x.emissiveMap.isVideoTexture===!0&&dt.getTransfer(x.emissiveMap.colorSpace)===St,premultipliedAlpha:x.premultipliedAlpha,doubleSided:x.side===jn,flipSided:x.side===yn,useDepthPacking:x.depthPacking>=0,depthPacking:x.depthPacking||0,index0AttributeName:x.index0AttributeName,extensionClipCullDistance:ge&&x.extensions.clipCullDistance===!0&&t.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(ge&&x.extensions.multiDraw===!0||Ge)&&t.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:t.has("KHR_parallel_shader_compile"),customProgramCacheKey:x.customProgramCacheKey()};return ke.vertexUv1s=l.has(1),ke.vertexUv2s=l.has(2),ke.vertexUv3s=l.has(3),l.clear(),ke}function g(x){const M=[];if(x.shaderID?M.push(x.shaderID):(M.push(x.customVertexShaderID),M.push(x.customFragmentShaderID)),x.defines!==void 0)for(const A in x.defines)M.push(A),M.push(x.defines[A]);return x.isRawShaderMaterial===!1&&(m(M,x),v(M,x),M.push(i.outputColorSpace)),M.push(x.customProgramCacheKey),M.join()}function m(x,M){x.push(M.precision),x.push(M.outputColorSpace),x.push(M.envMapMode),x.push(M.envMapCubeUVHeight),x.push(M.mapUv),x.push(M.alphaMapUv),x.push(M.lightMapUv),x.push(M.aoMapUv),x.push(M.bumpMapUv),x.push(M.normalMapUv),x.push(M.displacementMapUv),x.push(M.emissiveMapUv),x.push(M.metalnessMapUv),x.push(M.roughnessMapUv),x.push(M.anisotropyMapUv),x.push(M.clearcoatMapUv),x.push(M.clearcoatNormalMapUv),x.push(M.clearcoatRoughnessMapUv),x.push(M.iridescenceMapUv),x.push(M.iridescenceThicknessMapUv),x.push(M.sheenColorMapUv),x.push(M.sheenRoughnessMapUv),x.push(M.specularMapUv),x.push(M.specularColorMapUv),x.push(M.specularIntensityMapUv),x.push(M.transmissionMapUv),x.push(M.thicknessMapUv),x.push(M.combine),x.push(M.fogExp2),x.push(M.sizeAttenuation),x.push(M.morphTargetsCount),x.push(M.morphAttributeCount),x.push(M.numDirLights),x.push(M.numPointLights),x.push(M.numSpotLights),x.push(M.numSpotLightMaps),x.push(M.numHemiLights),x.push(M.numRectAreaLights),x.push(M.numDirLightShadows),x.push(M.numPointLightShadows),x.push(M.numSpotLightShadows),x.push(M.numSpotLightShadowsWithMaps),x.push(M.numLightProbes),x.push(M.shadowMapType),x.push(M.toneMapping),x.push(M.numClippingPlanes),x.push(M.numClipIntersection),x.push(M.depthPacking)}function v(x,M){a.disableAll(),M.instancing&&a.enable(0),M.instancingColor&&a.enable(1),M.instancingMorph&&a.enable(2),M.matcap&&a.enable(3),M.envMap&&a.enable(4),M.normalMapObjectSpace&&a.enable(5),M.normalMapTangentSpace&&a.enable(6),M.clearcoat&&a.enable(7),M.iridescence&&a.enable(8),M.alphaTest&&a.enable(9),M.vertexColors&&a.enable(10),M.vertexAlphas&&a.enable(11),M.vertexUv1s&&a.enable(12),M.vertexUv2s&&a.enable(13),M.vertexUv3s&&a.enable(14),M.vertexTangents&&a.enable(15),M.anisotropy&&a.enable(16),M.alphaHash&&a.enable(17),M.batching&&a.enable(18),M.dispersion&&a.enable(19),M.batchingColor&&a.enable(20),M.gradientMap&&a.enable(21),M.packedNormalMap&&a.enable(22),M.vertexNormals&&a.enable(23),x.push(a.mask),a.disableAll(),M.fog&&a.enable(0),M.useFog&&a.enable(1),M.flatShading&&a.enable(2),M.logarithmicDepthBuffer&&a.enable(3),M.reversedDepthBuffer&&a.enable(4),M.skinning&&a.enable(5),M.morphTargets&&a.enable(6),M.morphNormals&&a.enable(7),M.morphColors&&a.enable(8),M.premultipliedAlpha&&a.enable(9),M.shadowMapEnabled&&a.enable(10),M.doubleSided&&a.enable(11),M.flipSided&&a.enable(12),M.useDepthPacking&&a.enable(13),M.dithering&&a.enable(14),M.transmission&&a.enable(15),M.sheen&&a.enable(16),M.opaque&&a.enable(17),M.pointsUvs&&a.enable(18),M.decodeVideoTexture&&a.enable(19),M.decodeVideoTextureEmissive&&a.enable(20),M.alphaToCoverage&&a.enable(21),M.numLightProbeGrids>0&&a.enable(22),x.push(a.mask)}function b(x){const M=f[x.type];let A;if(M){const I=Jn[M];A=U_.clone(I.uniforms)}else A=x.uniforms;return A}function y(x,M){let A=u.get(M);return A!==void 0?++A.usedTimes:(A=new VC(i,M,x,r),c.push(A),u.set(M,A)),A}function T(x){if(--x.usedTimes===0){const M=c.indexOf(x);c[M]=c[c.length-1],c.pop(),u.delete(x.cacheKey),x.destroy()}}function S(x){o.remove(x)}function R(){o.dispose()}return{getParameters:_,getProgramCacheKey:g,getUniforms:b,acquireProgram:y,releaseProgram:T,releaseShaderCache:S,programs:c,dispose:R}}function qC(){let i=new WeakMap;function e(a){return i.has(a)}function t(a){let o=i.get(a);return o===void 0&&(o={},i.set(a,o)),o}function n(a){i.delete(a)}function r(a,o,l){i.get(a)[o]=l}function s(){i=new WeakMap}return{has:e,get:t,remove:n,update:r,dispose:s}}function $C(i,e){return i.groupOrder!==e.groupOrder?i.groupOrder-e.groupOrder:i.renderOrder!==e.renderOrder?i.renderOrder-e.renderOrder:i.material.id!==e.material.id?i.material.id-e.material.id:i.materialVariant!==e.materialVariant?i.materialVariant-e.materialVariant:i.z!==e.z?i.z-e.z:i.id-e.id}function rm(i,e){return i.groupOrder!==e.groupOrder?i.groupOrder-e.groupOrder:i.renderOrder!==e.renderOrder?i.renderOrder-e.renderOrder:i.z!==e.z?e.z-i.z:i.id-e.id}function sm(){const i=[];let e=0;const t=[],n=[],r=[];function s(){e=0,t.length=0,n.length=0,r.length=0}function a(d){let f=0;return d.isInstancedMesh&&(f+=2),d.isSkinnedMesh&&(f+=1),f}function o(d,f,p,_,g,m){let v=i[e];return v===void 0?(v={id:d.id,object:d,geometry:f,material:p,materialVariant:a(d),groupOrder:_,renderOrder:d.renderOrder,z:g,group:m},i[e]=v):(v.id=d.id,v.object=d,v.geometry=f,v.material=p,v.materialVariant=a(d),v.groupOrder=_,v.renderOrder=d.renderOrder,v.z=g,v.group=m),e++,v}function l(d,f,p,_,g,m){const v=o(d,f,p,_,g,m);p.transmission>0?n.push(v):p.transparent===!0?r.push(v):t.push(v)}function c(d,f,p,_,g,m){const v=o(d,f,p,_,g,m);p.transmission>0?n.unshift(v):p.transparent===!0?r.unshift(v):t.unshift(v)}function u(d,f){t.length>1&&t.sort(d||$C),n.length>1&&n.sort(f||rm),r.length>1&&r.sort(f||rm)}function h(){for(let d=e,f=i.length;d<f;d++){const p=i[d];if(p.id===null)break;p.id=null,p.object=null,p.geometry=null,p.material=null,p.group=null}}return{opaque:t,transmissive:n,transparent:r,init:s,push:l,unshift:c,finish:h,sort:u}}function YC(){let i=new WeakMap;function e(n,r){const s=i.get(n);let a;return s===void 0?(a=new sm,i.set(n,[a])):r>=s.length?(a=new sm,s.push(a)):a=s[r],a}function t(){i=new WeakMap}return{get:e,dispose:t}}function ZC(){const i={};return{get:function(e){if(i[e.id]!==void 0)return i[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new P,color:new Ee};break;case"SpotLight":t={position:new P,direction:new P,color:new Ee,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new P,color:new Ee,distance:0,decay:0};break;case"HemisphereLight":t={direction:new P,skyColor:new Ee,groundColor:new Ee};break;case"RectAreaLight":t={color:new Ee,position:new P,halfWidth:new P,halfHeight:new P};break}return i[e.id]=t,t}}}function KC(){const i={};return{get:function(e){if(i[e.id]!==void 0)return i[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new j};break;case"SpotLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new j};break;case"PointLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new j,shadowCameraNear:1,shadowCameraFar:1e3};break}return i[e.id]=t,t}}}let JC=0;function jC(i,e){return(e.castShadow?2:0)-(i.castShadow?2:0)+(e.map?1:0)-(i.map?1:0)}function QC(i){const e=new ZC,t=KC(),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 c=0;c<9;c++)n.probe.push(new P);const r=new P,s=new We,a=new We;function o(c){let u=0,h=0,d=0;for(let M=0;M<9;M++)n.probe[M].set(0,0,0);let f=0,p=0,_=0,g=0,m=0,v=0,b=0,y=0,T=0,S=0,R=0;c.sort(jC);for(let M=0,A=c.length;M<A;M++){const I=c[M],N=I.color,U=I.intensity,k=I.distance;let L=null;if(I.shadow&&I.shadow.map&&(I.shadow.map.texture.format===er?L=I.shadow.map.texture:L=I.shadow.map.depthTexture||I.shadow.map.texture),I.isAmbientLight)u+=N.r*U,h+=N.g*U,d+=N.b*U;else if(I.isLightProbe){for(let F=0;F<9;F++)n.probe[F].addScaledVector(I.sh.coefficients[F],U);R++}else if(I.isDirectionalLight){const F=e.get(I);if(F.color.copy(I.color).multiplyScalar(I.intensity),I.castShadow){const O=I.shadow,X=t.get(I);X.shadowIntensity=O.intensity,X.shadowBias=O.bias,X.shadowNormalBias=O.normalBias,X.shadowRadius=O.radius,X.shadowMapSize=O.mapSize,n.directionalShadow[f]=X,n.directionalShadowMap[f]=L,n.directionalShadowMatrix[f]=I.shadow.matrix,v++}n.directional[f]=F,f++}else if(I.isSpotLight){const F=e.get(I);F.position.setFromMatrixPosition(I.matrixWorld),F.color.copy(N).multiplyScalar(U),F.distance=k,F.coneCos=Math.cos(I.angle),F.penumbraCos=Math.cos(I.angle*(1-I.penumbra)),F.decay=I.decay,n.spot[_]=F;const O=I.shadow;if(I.map&&(n.spotLightMap[T]=I.map,T++,O.updateMatrices(I),I.castShadow&&S++),n.spotLightMatrix[_]=O.matrix,I.castShadow){const X=t.get(I);X.shadowIntensity=O.intensity,X.shadowBias=O.bias,X.shadowNormalBias=O.normalBias,X.shadowRadius=O.radius,X.shadowMapSize=O.mapSize,n.spotShadow[_]=X,n.spotShadowMap[_]=L,y++}_++}else if(I.isRectAreaLight){const F=e.get(I);F.color.copy(N).multiplyScalar(U),F.halfWidth.set(I.width*.5,0,0),F.halfHeight.set(0,I.height*.5,0),n.rectArea[g]=F,g++}else if(I.isPointLight){const F=e.get(I);if(F.color.copy(I.color).multiplyScalar(I.intensity),F.distance=I.distance,F.decay=I.decay,I.castShadow){const O=I.shadow,X=t.get(I);X.shadowIntensity=O.intensity,X.shadowBias=O.bias,X.shadowNormalBias=O.normalBias,X.shadowRadius=O.radius,X.shadowMapSize=O.mapSize,X.shadowCameraNear=O.camera.near,X.shadowCameraFar=O.camera.far,n.pointShadow[p]=X,n.pointShadowMap[p]=L,n.pointShadowMatrix[p]=I.shadow.matrix,b++}n.point[p]=F,p++}else if(I.isHemisphereLight){const F=e.get(I);F.skyColor.copy(I.color).multiplyScalar(U),F.groundColor.copy(I.groundColor).multiplyScalar(U),n.hemi[m]=F,m++}}g>0&&(i.has("OES_texture_float_linear")===!0?(n.rectAreaLTC1=be.LTC_FLOAT_1,n.rectAreaLTC2=be.LTC_FLOAT_2):(n.rectAreaLTC1=be.LTC_HALF_1,n.rectAreaLTC2=be.LTC_HALF_2)),n.ambient[0]=u,n.ambient[1]=h,n.ambient[2]=d;const x=n.hash;(x.directionalLength!==f||x.pointLength!==p||x.spotLength!==_||x.rectAreaLength!==g||x.hemiLength!==m||x.numDirectionalShadows!==v||x.numPointShadows!==b||x.numSpotShadows!==y||x.numSpotMaps!==T||x.numLightProbes!==R)&&(n.directional.length=f,n.spot.length=_,n.rectArea.length=g,n.point.length=p,n.hemi.length=m,n.directionalShadow.length=v,n.directionalShadowMap.length=v,n.pointShadow.length=b,n.pointShadowMap.length=b,n.spotShadow.length=y,n.spotShadowMap.length=y,n.directionalShadowMatrix.length=v,n.pointShadowMatrix.length=b,n.spotLightMatrix.length=y+T-S,n.spotLightMap.length=T,n.numSpotLightShadowsWithMaps=S,n.numLightProbes=R,x.directionalLength=f,x.pointLength=p,x.spotLength=_,x.rectAreaLength=g,x.hemiLength=m,x.numDirectionalShadows=v,x.numPointShadows=b,x.numSpotShadows=y,x.numSpotMaps=T,x.numLightProbes=R,n.version=JC++)}function l(c,u){let h=0,d=0,f=0,p=0,_=0;const g=u.matrixWorldInverse;for(let m=0,v=c.length;m<v;m++){const b=c[m];if(b.isDirectionalLight){const y=n.directional[h];y.direction.setFromMatrixPosition(b.matrixWorld),r.setFromMatrixPosition(b.target.matrixWorld),y.direction.sub(r),y.direction.transformDirection(g),h++}else if(b.isSpotLight){const y=n.spot[f];y.position.setFromMatrixPosition(b.matrixWorld),y.position.applyMatrix4(g),y.direction.setFromMatrixPosition(b.matrixWorld),r.setFromMatrixPosition(b.target.matrixWorld),y.direction.sub(r),y.direction.transformDirection(g),f++}else if(b.isRectAreaLight){const y=n.rectArea[p];y.position.setFromMatrixPosition(b.matrixWorld),y.position.applyMatrix4(g),a.identity(),s.copy(b.matrixWorld),s.premultiply(g),a.extractRotation(s),y.halfWidth.set(b.width*.5,0,0),y.halfHeight.set(0,b.height*.5,0),y.halfWidth.applyMatrix4(a),y.halfHeight.applyMatrix4(a),p++}else if(b.isPointLight){const y=n.point[d];y.position.setFromMatrixPosition(b.matrixWorld),y.position.applyMatrix4(g),d++}else if(b.isHemisphereLight){const y=n.hemi[_];y.direction.setFromMatrixPosition(b.matrixWorld),y.direction.transformDirection(g),_++}}}return{setup:o,setupView:l,state:n}}function am(i){const e=new QC(i),t=[],n=[],r=[];function s(d){h.camera=d,t.length=0,n.length=0,r.length=0}function a(d){t.push(d)}function o(d){n.push(d)}function l(d){r.push(d)}function c(){e.setup(t)}function u(d){e.setupView(t,d)}const h={lightsArray:t,shadowsArray:n,lightProbeGridArray:r,camera:null,lights:e,transmissionRenderTarget:{},textureUnits:0};return{init:s,state:h,setupLights:c,setupLightsView:u,pushLight:a,pushShadow:o,pushLightProbeGrid:l}}function eR(i){let e=new WeakMap;function t(r,s=0){const a=e.get(r);let o;return a===void 0?(o=new am(i),e.set(r,[o])):s>=a.length?(o=new am(i),a.push(o)):o=a[s],o}
vendor: 4,126 bytes, lines 4053-4080
4053function n(){e=new WeakMap}return{get:t,dispose:n}}const tR=`void main() { 4054 gl_Position = vec4( position, 1.0 ); 4055}`,nR=`uniform sampler2D shadow_pass; 4056uniform vec2 resolution; 4057uniform float radius; 4058void main() { 4059 const float samples = float( VSM_SAMPLES ); 4060 float mean = 0.0; 4061 float squared_mean = 0.0; 4062 float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 ); 4063 float uvStart = samples <= 1.0 ? 0.0 : - 1.0; 4064 for ( float i = 0.0; i < samples; i ++ ) { 4065 float uvOffset = uvStart + i * uvStride; 4066 #ifdef HORIZONTAL_PASS 4067 vec2 distribution = texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ).rg; 4068 mean += distribution.x; 4069 squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; 4070 #else 4071 float depth = texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ).r; 4072 mean += depth; 4073 squared_mean += depth * depth; 4074 #endif 4075 } 4076 mean = mean / samples; 4077 squared_mean = squared_mean / samples; 4078 float std_dev = sqrt( max( 0.0, squared_mean - mean * mean ) ); 4079 gl_FragColor = vec4( mean, std_dev, 0.0, 1.0 ); 4080}`,iR=[new P(1,0,0),new P(-1,0,0),new P(0,1,0),new P(0,-1,0),new P(0,0,1),new P(0,0,-1)],rR=[new P(0,-1,0),new P(0,-1,0),new P(0,0,1),new P(0,0,-1),new P(0,-1,0),new P(0,-1,0)],om=new We,ca=new P,Ju=new P;function sR(i,e,t){let n=new Ws;const r=new j,s=new j,a=new Et,o=new Ld,l=new Nd,c={},u=t.maxTextureSize,h={[Pi]:yn,[yn]:Pi,[jn]:jn},d=new Cn({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new j},radius:{value:4}},vertexShader:tR,fragmentShader:nR}),f=d.clone();f.defines.HORIZONTAL_PASS=1;const p=new et;p.setAttribute("position",new ut(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const _=new Dt(p,d),g=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=xa;let m=this.type;this.render=function(S,R,x){if(g.enabled===!1||g.autoUpdate===!1&&g.needsUpdate===!1||S.length===0)return;this.type===td&&(_e("WebGLShadowMap: PCFSoftShadowMap has been deprecated. Using PCFShadowMap instead."),this.type=xa);const M=i.getRenderTarget(),A=i.getActiveCubeFace(),I=i.getActiveMipmapLevel(),N=i.state;N.setBlending(pi),N.buffers.depth.getReversed()===!0?N.buffers.color.setClear(0,0,0,0):N.buffers.color.setClear(1,1,1,1),N.buffers.depth.setTest(!0),N.setScissorTest(!1);const U=m!==this.type;U&&R.traverse(function(k){k.material&&(Array.isArray(k.material)?k.material.forEach(L=>L.needsUpdate=!0):k.material.needsUpdate=!0)});for(let k=0,L=S.length;k<L;k++){const F=S[k],O=F.shadow;if(O===void 0){_e("WebGLShadowMap:",F,"has no shadow.");continue}if(O.autoUpdate===!1&&O.needsUpdate===!1)continue;r.copy(O.mapSize);const X=O.getFrameExtents();r.multiply(X),s.copy(O.mapSize),(r.x>u||r.y>u)&&(r.x>u&&(s.x=Math.floor(u/X.x),r.x=s.x*X.x,O.mapSize.x=s.x),r.y>u&&(s.y=Math.floor(u/X.y),r.y=s.y*X.y,O.mapSize.y=s.y));const $=i.state.buffers.depth.getReversed();if(O.camera._reversedDepth=$,O.map===null||U===!0){if(O.map!==null&&(O.map.depthTexture!==null&&(O.map.depthTexture.dispose(),O.map.depthTexture=null),O.map.dispose()),this.type===ps){if(F.isPointLight){_e("WebGLShadowMap: VSM shadow maps are not supported for PointLights. Use PCF or BasicShadowMap instead.");continue}O.map=new Bn(r.x,r.y,{format:er,type:gi,minFilter:Lt,magFilter:Lt,generateMipmaps:!1}),O.map.texture.name=F.name+".shadowMap",O.map.depthTexture=new Br(r.x,r.y,vn),O.map.depthTexture.name=F.name+".shadowMapDepth",O.map.depthTexture.format=_i,O.map.depthTexture.compareFunction=null,O.map.depthTexture.minFilter=Xt,O.map.depthTexture.magFilter=Xt}else F.isPointLight?(O.map=new Xd(r.x),O.map.depthTexture=new S_(r.x,Gn)):(O.map=new Bn(r.x,r.y),O.map.depthTexture=new Br(r.x,r.y,Gn)),O.map.depthTexture.name=F.name+".shadowMap",O.map.depthTexture.format=_i,this.type===xa?(O.map.depthTexture.compareFunction=$?Pc:Ic,O.map.depthTexture.minFilter=Lt,O.map.depthTexture.magFilter=Lt):(O.map.depthTexture.compareFunction=null,O.map.depthTexture.minFilter=Xt,O.map.depthTexture.magFilter=Xt);O.camera.updateProjectionMatrix()}const te=O.map.isWebGLCubeRenderTarget?6:1;for(let ue=0;ue<te;
vendor: 6,322 bytes, line 4080
4080ue++){if(O.map.isWebGLCubeRenderTarget)i.setRenderTarget(O.map,ue),i.clear();else{ue===0&&(i.setRenderTarget(O.map),i.clear());const xe=O.getViewport(ue);a.set(s.x*xe.x,s.y*xe.y,s.x*xe.z,s.y*xe.w),N.viewport(a)}if(F.isPointLight){const xe=O.camera,He=O.matrix,Ke=F.distance||xe.far;Ke!==xe.far&&(xe.far=Ke,xe.updateProjectionMatrix()),ca.setFromMatrixPosition(F.matrixWorld),xe.position.copy(ca),Ju.copy(xe.position),Ju.add(iR[ue]),xe.up.copy(rR[ue]),xe.lookAt(Ju),xe.updateMatrixWorld(),He.makeTranslation(-ca.x,-ca.y,-ca.z),om.multiplyMatrices(xe.projectionMatrix,xe.matrixWorldInverse),O._frustum.setFromProjectionMatrix(om,xe.coordinateSystem,xe.reversedDepth)}else O.updateMatrices(F);n=O.getFrustum(),y(R,x,O.camera,F,this.type)}O.isPointLightShadow!==!0&&this.type===ps&&v(O,x),O.needsUpdate=!1}m=this.type,g.needsUpdate=!1,i.setRenderTarget(M,A,I)};function v(S,R){const x=e.update(_);d.defines.VSM_SAMPLES!==S.blurSamples&&(d.defines.VSM_SAMPLES=S.blurSamples,f.defines.VSM_SAMPLES=S.blurSamples,d.needsUpdate=!0,f.needsUpdate=!0),S.mapPass===null&&(S.mapPass=new Bn(r.x,r.y,{format:er,type:gi})),d.uniforms.shadow_pass.value=S.map.depthTexture,d.uniforms.resolution.value=S.mapSize,d.uniforms.radius.value=S.radius,i.setRenderTarget(S.mapPass),i.clear(),i.renderBufferDirect(R,null,x,d,_,null),f.uniforms.shadow_pass.value=S.mapPass.texture,f.uniforms.resolution.value=S.mapSize,f.uniforms.radius.value=S.radius,i.setRenderTarget(S.map),i.clear(),i.renderBufferDirect(R,null,x,f,_,null)}function b(S,R,x,M){let A=null;const I=x.isPointLight===!0?S.customDistanceMaterial:S.customDepthMaterial;if(I!==void 0)A=I;else if(A=x.isPointLight===!0?l:o,i.localClippingEnabled&&R.clipShadows===!0&&Array.isArray(R.clippingPlanes)&&R.clippingPlanes.length!==0||R.displacementMap&&R.displacementScale!==0||R.alphaMap&&R.alphaTest>0||R.map&&R.alphaTest>0||R.alphaToCoverage===!0){const N=A.uuid,U=R.uuid;let k=c[N];k===void 0&&(k={},c[N]=k);let L=k[U];L===void 0&&(L=A.clone(),k[U]=L,R.addEventListener("dispose",T)),A=L}if(A.visible=R.visible,A.wireframe=R.wireframe,M===ps?A.side=R.shadowSide!==null?R.shadowSide:R.side:A.side=R.shadowSide!==null?R.shadowSide:h[R.side],A.alphaMap=R.alphaMap,A.alphaTest=R.alphaToCoverage===!0?.5:R.alphaTest,A.map=R.map,A.clipShadows=R.clipShadows,A.clippingPlanes=R.clippingPlanes,A.clipIntersection=R.clipIntersection,A.displacementMap=R.displacementMap,A.displacementScale=R.displacementScale,A.displacementBias=R.displacementBias,A.wireframeLinewidth=R.wireframeLinewidth,A.linewidth=R.linewidth,x.isPointLight===!0&&A.isMeshDistanceMaterial===!0){const N=i.properties.get(A);N.light=x}return A}function y(S,R,x,M,A){if(S.visible===!1)return;if(S.layers.test(R.layers)&&(S.isMesh||S.isLine||S.isPoints)&&(S.castShadow||S.receiveShadow&&A===ps)&&(!S.frustumCulled||n.intersectsObject(S))){S.modelViewMatrix.multiplyMatrices(x.matrixWorldInverse,S.matrixWorld);const U=e.update(S),k=S.material;if(Array.isArray(k)){const L=U.groups;for(let F=0,O=L.length;F<O;F++){const X=L[F],$=k[X.materialIndex];if($&&$.visible){const te=b(S,$,M,A);S.onBeforeShadow(i,S,R,x,U,te,X),i.renderBufferDirect(x,null,U,te,S,X),S.onAfterShadow(i,S,R,x,U,te,X)}}}else if(k.visible){const L=b(S,k,M,A);S.onBeforeShadow(i,S,R,x,U,L,null),i.renderBufferDirect(x,null,U,L,S,null),S.onAfterShadow(i,S,R,x,U,L,null)}}const N=S.children;for(let U=0,k=N.length;U<k;U++)y(N[U],R,x,M,A)}function T(S){S.target.removeEventListener("dispose",T);for(const x in c){const M=c[x],A=S.target.uuid;A in M&&(M[A].dispose(),delete M[A])}}}function aR(i,e){function t(){let B=!1;const de=new Et;let Y=null;const we=new Et(0,0,0,0);return{setMask:function(ge){Y!==ge&&!B&&(i.colorMask(ge,ge,ge,ge),Y=ge)},setLocked:function(ge){B=ge},setClear:function(ge,ie,ke,rt,Vt){Vt===!0&&(ge*=rt,ie*=rt,ke*=rt),de.set(ge,ie,ke,rt),we.equals(de)===!1&&(i.clearColor(ge,ie,ke,rt),we.copy(de))},reset:function(){B=!1,Y=null,we.set(-1,0,0,0)}}}function n(){let B=!1,de=!1,Y=null,we=null,ge=null;return{setReversed:function(ie){if(de!==ie){const ke=e.get("EXT_clip_control");ie?ke.clipControlEXT(ke.LOWER_LEFT_EXT,ke.ZERO_TO_ONE_EXT):ke.clipControlEXT(ke.LOWER_LEFT_EXT,ke.NEGATIVE_ONE_TO_ONE_EXT),de=ie;const rt=ge;ge=null,this.setClear(rt)}},getReversed:function(){return de},setTest:function(ie){ie?le(i.DEPTH_TEST):De(i.DEPTH_TEST)},setMask:function(ie){Y!==ie&&!B&&(i.depthMask(ie),Y=ie)},setFunc:function(ie){if(de&&(ie=TS[ie]),we!==ie){switch(ie){case Sl:i.depthFunc(i.NEVER);break;case Ml:i.depthFunc(i.ALWAYS);break;case El:i.depthFunc(i.LESS);break;case Or:i.depthFunc(i.LEQUAL);break;case Tl:i.depthFunc(i.EQUAL);break;case wl:i.depthFunc(i.GEQUAL);break;case Al:i.depthFunc(i.GREATER);break;case Cl:i.depthFunc(i.NOTEQUAL);break;default:i.depthFunc(i.LEQUAL)}we=ie}},setLocked:function(ie){B=ie},setClear:function(ie){ge!==ie&&(ge=ie,de&&(ie=1-ie),i.clearDepth(ie))},reset:function(){B=!1,Y=null,we=null,ge=null,de=!1}}}function r(){let B=!1,de=null,Y=null,we=null,ge=null,ie=null,ke=null,rt=null,Vt=null;return{setTest:function(Tt){B||(Tt?le(i.STENCIL_TEST):De(i.STENCIL_TEST))},setMask:function(Tt){de!==Tt&&!B&&(i.stencilMask(Tt),de=Tt)},setFunc:function(Tt,xi,si){(Y!==Tt||we!==xi||ge!==si)&&(i.stencilFunc(Tt,xi,si),Y=Tt,we=xi,ge=si)},setOp:function(Tt,xi,si){(ie!==Tt||ke!==xi||rt!==si)&&(i.stencilOp(Tt,xi,si),ie=Tt,ke=xi,rt=si)},setLocked:function(Tt){B=Tt},setClear:function(Tt){Vt!==Tt&&(i.clearStencil(Tt),Vt=Tt)},reset:function(){B=!1,de=null,Y=null,we=null,ge=null,ie=null,ke=null,rt=null,Vt=null}}}const s=new t,a=new n,o=new r,l=new WeakMap,c=new WeakMap;let u={},h={},d={},f=new WeakMap,p=[],_=null,g=!1,m=null,v=null,b=null,y=null,T=null,S=null,R=null,x=new Ee(0,0,0),M=0,A=!1,I=null,N=null,U=null,k=null,L=null;const F=i.getParameter(i.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let O=!1,X=0;const $=i.getParameter(i.VERSION);$.indexOf("WebGL")!==-1?(X=parseFloat(/^WebGL (\d)/.exec($)[1]),O=X>=1):$.indexOf("OpenGL ES")!==-1&&(X=parseFloat(/^OpenGL ES (\d)/.exec($)[1]),O=X>=2);let te=null,ue={};const xe=i.getParameter(i.SCISSOR_BOX),He=i.getParameter(i.VIEWPORT),Ke=new Et().fromArray(xe),qe=new Et().fromArray(He);function K(B,de,Y,we){const ge=new Uint8Array(4),ie=i.createTexture();i.bindTexture(B,ie),i.texParameteri(B,i.TEXTURE_MIN_FILTER,i.NEAREST),i.texParameteri(B,i.TEXTURE_MAG_FILTER,i.NEAREST);for(let ke=0;ke<Y;
vendor: 12,004 bytes, line 4080
4080ke++)B===i.TEXTURE_3D||B===i.TEXTURE_2D_ARRAY?i.texImage3D(de,0,i.RGBA,1,1,we,0,i.RGBA,i.UNSIGNED_BYTE,ge):i.texImage2D(de+ke,0,i.RGBA,1,1,0,i.RGBA,i.UNSIGNED_BYTE,ge);return ie}const ye={};ye[i.TEXTURE_2D]=K(i.TEXTURE_2D,i.TEXTURE_2D,1),ye[i.TEXTURE_CUBE_MAP]=K(i.TEXTURE_CUBE_MAP,i.TEXTURE_CUBE_MAP_POSITIVE_X,6),ye[i.TEXTURE_2D_ARRAY]=K(i.TEXTURE_2D_ARRAY,i.TEXTURE_2D_ARRAY,1,1),ye[i.TEXTURE_3D]=K(i.TEXTURE_3D,i.TEXTURE_3D,1,1),s.setClear(0,0,0,1),a.setClear(1),o.setClear(0),le(i.DEPTH_TEST),a.setFunc(Or),pe(!1),ve(dh),le(i.CULL_FACE),se(pi);function le(B){u[B]!==!0&&(i.enable(B),u[B]=!0)}function De(B){u[B]!==!1&&(i.disable(B),u[B]=!1)}function Ne(B,de){return d[B]!==de?(i.bindFramebuffer(B,de),d[B]=de,B===i.DRAW_FRAMEBUFFER&&(d[i.FRAMEBUFFER]=de),B===i.FRAMEBUFFER&&(d[i.DRAW_FRAMEBUFFER]=de),!0):!1}function Ge(B,de){let Y=p,we=!1;if(B){Y=f.get(de),Y===void 0&&(Y=[],f.set(de,Y));const ge=B.textures;if(Y.length!==ge.length||Y[0]!==i.COLOR_ATTACHMENT0){for(let ie=0,ke=ge.length;ie<ke;ie++)Y[ie]=i.COLOR_ATTACHMENT0+ie;Y.length=ge.length,we=!0}}else Y[0]!==i.BACK&&(Y[0]=i.BACK,we=!0);we&&i.drawBuffers(Y)}function ft(B){return _!==B?(i.useProgram(B),_=B,!0):!1}const Ye={[qi]:i.FUNC_ADD,[Ig]:i.FUNC_SUBTRACT,[Pg]:i.FUNC_REVERSE_SUBTRACT};Ye[Lg]=i.MIN,Ye[Ng]=i.MAX;const Q={[Dg]:i.ZERO,[Og]:i.ONE,[Ug]:i.SRC_COLOR,[yl]:i.SRC_ALPHA,[Hg]:i.SRC_ALPHA_SATURATE,[Vg]:i.DST_COLOR,[Bg]:i.DST_ALPHA,[Fg]:i.ONE_MINUS_SRC_COLOR,[bl]:i.ONE_MINUS_SRC_ALPHA,[zg]:i.ONE_MINUS_DST_COLOR,[kg]:i.ONE_MINUS_DST_ALPHA,[Gg]:i.CONSTANT_COLOR,[Wg]:i.ONE_MINUS_CONSTANT_COLOR,[Xg]:i.CONSTANT_ALPHA,[qg]:i.ONE_MINUS_CONSTANT_ALPHA};function se(B,de,Y,we,ge,ie,ke,rt,Vt,Tt){if(B===pi){g===!0&&(De(i.BLEND),g=!1);return}if(g===!1&&(le(i.BLEND),g=!0),B!==Rg){if(B!==m||Tt!==A){if((v!==qi||T!==qi)&&(i.blendEquation(i.FUNC_ADD),v=qi,T=qi),Tt)switch(B){case Ir:i.blendFuncSeparate(i.ONE,i.ONE_MINUS_SRC_ALPHA,i.ONE,i.ONE_MINUS_SRC_ALPHA);break;case fh:i.blendFunc(i.ONE,i.ONE);break;case ph:i.blendFuncSeparate(i.ZERO,i.ONE_MINUS_SRC_COLOR,i.ZERO,i.ONE);break;case mh:i.blendFuncSeparate(i.DST_COLOR,i.ONE_MINUS_SRC_ALPHA,i.ZERO,i.ONE);break;default:Oe("WebGLState: Invalid blending: ",B);break}else switch(B){case Ir:i.blendFuncSeparate(i.SRC_ALPHA,i.ONE_MINUS_SRC_ALPHA,i.ONE,i.ONE_MINUS_SRC_ALPHA);break;case fh:i.blendFuncSeparate(i.SRC_ALPHA,i.ONE,i.ONE,i.ONE);break;case ph:Oe("WebGLState: SubtractiveBlending requires material.premultipliedAlpha = true");break;case mh:Oe("WebGLState: MultiplyBlending requires material.premultipliedAlpha = true");break;default:Oe("WebGLState: Invalid blending: ",B);break}b=null,y=null,S=null,R=null,x.set(0,0,0),M=0,m=B,A=Tt}return}ge=ge||de,ie=ie||Y,ke=ke||we,(de!==v||ge!==T)&&(i.blendEquationSeparate(Ye[de],Ye[ge]),v=de,T=ge),(Y!==b||we!==y||ie!==S||ke!==R)&&(i.blendFuncSeparate(Q[Y],Q[we],Q[ie],Q[ke]),b=Y,y=we,S=ie,R=ke),(rt.equals(x)===!1||Vt!==M)&&(i.blendColor(rt.r,rt.g,rt.b,Vt),x.copy(rt),M=Vt),m=B,A=!1}function ee(B,de){B.side===jn?De(i.CULL_FACE):le(i.CULL_FACE);let Y=B.side===yn;de&&(Y=!Y),pe(Y),B.blending===Ir&&B.transparent===!1?se(pi):se(B.blending,B.blendEquation,B.blendSrc,B.blendDst,B.blendEquationAlpha,B.blendSrcAlpha,B.blendDstAlpha,B.blendColor,B.blendAlpha,B.premultipliedAlpha),a.setFunc(B.depthFunc),a.setTest(B.depthTest),a.setMask(B.depthWrite),s.setMask(B.colorWrite);const we=B.stencilWrite;o.setTest(we),we&&(o.setMask(B.stencilWriteMask),o.setFunc(B.stencilFunc,B.stencilRef,B.stencilFuncMask),o.setOp(B.stencilFail,B.stencilZFail,B.stencilZPass)),D(B.polygonOffset,B.polygonOffsetFactor,B.polygonOffsetUnits),B.alphaToCoverage===!0?le(i.SAMPLE_ALPHA_TO_COVERAGE):De(i.SAMPLE_ALPHA_TO_COVERAGE)}function pe(B){I!==B&&(B?i.frontFace(i.CW):i.frontFace(i.CCW),I=B)}function ve(B){B!==Ag?(le(i.CULL_FACE),B!==N&&(B===dh?i.cullFace(i.BACK):B===Cg?i.cullFace(i.FRONT):i.cullFace(i.FRONT_AND_BACK))):De(i.CULL_FACE),N=B}function Je(B){B!==U&&(O&&i.lineWidth(B),U=B)}function D(B,de,Y){B?(le(i.POLYGON_OFFSET_FILL),(k!==de||L!==Y)&&(k=de,L=Y,a.getReversed()&&(de=-de),i.polygonOffset(de,Y))):De(i.POLYGON_OFFSET_FILL)}function nt(B){B?le(i.SCISSOR_TEST):De(i.SCISSOR_TEST)}function Ue(B){B===void 0&&(B=i.TEXTURE0+F-1),te!==B&&(i.activeTexture(B),te=B)}function je(B,de,Y){Y===void 0&&(te===null?Y=i.TEXTURE0+F-1:Y=te);let we=ue[Y];we===void 0&&(we={type:void 0,texture:void 0},ue[Y]=we),(we.type!==B||we.texture!==de)&&(te!==Y&&(i.activeTexture(Y),te=Y),i.bindTexture(B,de||ye[B]),we.type=B,we.texture=de)}function oe(){const B=ue[te];B!==void 0&&B.type!==void 0&&(i.bindTexture(B.type,null),B.type=void 0,B.texture=void 0)}function bt(){try{i.compressedTexImage2D(...arguments)}catch(B){Oe("WebGLState:",B)}}function C(){try{i.compressedTexImage3D(...arguments)}catch(B){Oe("WebGLState:",B)}}function E(){try{i.texSubImage2D(...arguments)}catch(B){Oe("WebGLState:",B)}}function z(){try{i.texSubImage3D(...arguments)}catch(B){Oe("WebGLState:",B)}}function Z(){try{i.compressedTexSubImage2D(...arguments)}catch(B){Oe("WebGLState:",B)}}function ne(){try{i.compressedTexSubImage3D(...arguments)}catch(B){Oe("WebGLState:",B)}}function ce(){try{i.texStorage2D(...arguments)}catch(B){Oe("WebGLState:",B)}}function fe(){try{i.texStorage3D(...arguments)}catch(B){Oe("WebGLState:",B)}}function q(){try{i.texImage2D(...arguments)}catch(B){Oe("WebGLState:",B)}}function J(){try{i.texImage3D(...arguments)}catch(B){Oe("WebGLState:",B)}}function Te(B){return h[B]!==void 0?h[B]:i.getParameter(B)}function Re(B,de){h[B]!==de&&(i.pixelStorei(B,de),h[B]=de)}function me(B){Ke.equals(B)===!1&&(i.scissor(B.x,B.y,B.z,B.w),Ke.copy(B))}function he(B){qe.equals(B)===!1&&(i.viewport(B.x,B.y,B.z,B.w),qe.copy(B))}function it(B,de){let Y=c.get(de);Y===void 0&&(Y=new WeakMap,c.set(de,Y));let we=Y.get(B);we===void 0&&(we=i.getUniformBlockIndex(de,B.name),Y.set(B,we))}function ot(B,de){const we=c.get(de).get(B);l.get(de)!==we&&(i.uniformBlockBinding(de,we,B.__bindingPointIndex),l.set(de,we))}function vt(){i.disable(i.BLEND),i.disable(i.CULL_FACE),i.disable(i.DEPTH_TEST),i.disable(i.POLYGON_OFFSET_FILL),i.disable(i.SCISSOR_TEST),i.disable(i.STENCIL_TEST),i.disable(i.SAMPLE_ALPHA_TO_COVERAGE),i.blendEquation(i.FUNC_ADD),i.blendFunc(i.ONE,i.ZERO),i.blendFuncSeparate(i.ONE,i.ZERO,i.ONE,i.ZERO),i.blendColor(0,0,0,0),i.colorMask(!0,!0,!0,!0),i.clearColor(0,0,0,0),i.depthMask(!0),i.depthFunc(i.LESS),a.setReversed(!1),i.clearDepth(1),i.stencilMask(4294967295),i.stencilFunc(i.ALWAYS,0,4294967295),i.stencilOp(i.KEEP,i.KEEP,i.KEEP),i.clearStencil(0),i.cullFace(i.BACK),i.frontFace(i.CCW),i.polygonOffset(0,0),i.activeTexture(i.TEXTURE0),i.bindFramebuffer(i.FRAMEBUFFER,null),i.bindFramebuffer(i.DRAW_FRAMEBUFFER,null),i.bindFramebuffer(i.READ_FRAMEBUFFER,null),i.useProgram(null),i.lineWidth(1),i.scissor(0,0,i.canvas.width,i.canvas.height),i.viewport(0,0,i.canvas.width,i.canvas.height),i.pixelStorei(i.PACK_ALIGNMENT,4),i.pixelStorei(i.UNPACK_ALIGNMENT,4),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_COLORSPACE_CONVERSION_WEBGL,i.BROWSER_DEFAULT_WEBGL),i.pixelStorei(i.PACK_ROW_LENGTH,0),i.pixelStorei(i.PACK_SKIP_PIXELS,0),i.pixelStorei(i.PACK_SKIP_ROWS,0),i.pixelStorei(i.UNPACK_ROW_LENGTH,0),i.pixelStorei(i.UNPACK_IMAGE_HEIGHT,0),i.pixelStorei(i.UNPACK_SKIP_PIXELS,0),i.pixelStorei(i.UNPACK_SKIP_ROWS,0),i.pixelStorei(i.UNPACK_SKIP_IMAGES,0),u={},h={},te=null,ue={},d={},f=new WeakMap,p=[],_=null,g=!1,m=null,v=null,b=null,y=null,T=null,S=null,R=null,x=new Ee(0,0,0),M=0,A=!1,I=null,N=null,U=null,k=null,L=null,Ke.set(0,0,i.canvas.width,i.canvas.height),qe.set(0,0,i.canvas.width,i.canvas.height),s.reset(),a.reset(),o.reset()}return{buffers:{color:s,depth:a,stencil:o},enable:le,disable:De,bindFramebuffer:Ne,drawBuffers:Ge,useProgram:ft,setBlending:se,setMaterial:ee,setFlipSided:pe,setCullFace:ve,setLineWidth:Je,setPolygonOffset:D,setScissorTest:nt,activeTexture:Ue,bindTexture:je,unbindTexture:oe,compressedTexImage2D:bt,compressedTexImage3D:C,texImage2D:q,texImage3D:J,pixelStorei:Re,getParameter:Te,updateUBOMapping:it,uniformBlockBinding:ot,texStorage2D:ce,texStorage3D:fe,texSubImage2D:E,texSubImage3D:z,compressedTexSubImage2D:Z,compressedTexSubImage3D:ne,scissor:me,viewport:he,reset:vt}}function oR(i,e,t,n,r,s,a){const o=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,l=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),c=new j,u=new WeakMap,h=new Set;let d;const f=new WeakMap;let p=!1;try{p=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function _(C,E){return p?new OffscreenCanvas(C,E):Xa("canvas")}function g(C,E,z){let Z=1;const ne=bt(C);if((ne.width>z||ne.height>z)&&(Z=z/Math.max(ne.width,ne.height)),Z<1)if(typeof HTMLImageElement<"u"&&C instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&C instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&C instanceof ImageBitmap||typeof VideoFrame<"u"&&C instanceof VideoFrame){const ce=Math.floor(Z*ne.width),fe=Math.floor(Z*ne.height);d===void 0&&(d=_(ce,fe));const q=E?_(ce,fe):d;return q.width=ce,q.height=fe,q.getContext("2d").drawImage(C,0,0,ce,fe),_e("WebGLRenderer: Texture has been resized from ("+ne.width+"x"+ne.height+") to ("+ce+"x"+fe+")."),q}else return"data"in C&&_e("WebGLRenderer: Image in DataTexture is too big ("+ne.width+"x"+ne.height+")."),C;return C}function m(C){return C.generateMipmaps}function v(C){i.generateMipmap(C)}function b(C){return C.isWebGLCubeRenderTarget?i.TEXTURE_CUBE_MAP:C.isWebGL3DRenderTarget?i.TEXTURE_3D:C.isWebGLArrayRenderTarget||C.isCompressedArrayTexture?i.TEXTURE_2D_ARRAY:i.TEXTURE_2D}function y(C,E,z,Z,ne,ce=!1){if(C!==null){if(i[C]!==void 0)return i[C];_e("WebGLRenderer: Attempt to use non-existing WebGL internal format '"+C+"'")}let fe;Z&&(fe=e.get("EXT_texture_norm16"),fe||_e("WebGLRenderer: Unable to use normalized textures without EXT_texture_norm16 extension"));let q=E;if(E===i.RED&&(z===i.FLOAT&&(q=i.R32F),z===i.HALF_FLOAT&&(q=i.R16F),z===i.UNSIGNED_BYTE&&(q=i.R8),z===i.UNSIGNED_SHORT&&fe&&(q=fe.R16_EXT),z===i.SHORT&&fe&&(q=fe.R16_SNORM_EXT)),E===i.RED_INTEGER&&(z===i.UNSIGNED_BYTE&&(q=i.R8UI),z===i.UNSIGNED_SHORT&&(q=i.R16UI),z===i.UNSIGNED_INT&&(q=i.R32UI),z===i.BYTE&&(q=i.R8I),z===i.SHORT&&(q=i.R16I),z===i.INT&&(q=i.R32I)),E===i.RG&&(z===i.FLOAT&&(q=i.RG32F),z===i.HALF_FLOAT&&(q=i.RG16F),z===i.UNSIGNED_BYTE&&(q=i.RG8),z===i.UNSIGNED_SHORT&&fe&&(q=fe.RG16_EXT),z===i.SHORT&&fe&&(q=fe.RG16_SNORM_EXT)),E===i.RG_INTEGER&&(z===i.UNSIGNED_BYTE&&(q=i.RG8UI),z===i.UNSIGNED_SHORT&&(q=i.RG16UI),z===i.UNSIGNED_INT&&(q=i.RG32UI),z===i.BYTE&&(q=i.RG8I),z===i.SHORT&&(q=i.RG16I),z===i.INT&&(q=i.RG32I)),E===i.RGB_INTEGER&&(z===i.UNSIGNED_BYTE&&(q=i.RGB8UI),z===i.UNSIGNED_SHORT&&(q=i.RGB16UI),z===i.UNSIGNED_INT&&(q=i.RGB32UI),z===i.BYTE&&(q=i.RGB8I),z===i.SHORT&&(q=i.RGB16I),z===i.INT&&(q=i.RGB32I)),E===i.RGBA_INTEGER&&(z===i.UNSIGNED_BYTE&&(q=i.RGBA8UI),z===i.UNSIGNED_SHORT&&(q=i.RGBA16UI),z===i.UNSIGNED_INT&&(q=i.RGBA32UI),z===i.BYTE&&(q=i.RGBA8I),z===i.SHORT&&(q=i.RGBA16I),z===i.INT&&(q=i.RGBA32I)),E===i.RGB&&(z===i.UNSIGNED_SHORT&&fe&&(q=fe.RGB16_EXT),z===i.SHORT&&fe&&(q=fe.RGB16_SNORM_EXT),z===i.UNSIGNED_INT_5_9_9_9_REV&&(q=i.RGB9_E5),z===i.UNSIGNED_INT_10F_11F_11F_REV&&(q=i.R11F_G11F_B10F)),E===i.RGBA){const J=ce?Ga:dt.getTransfer(ne);z===i.FLOAT&&(q=i.RGBA32F),z===i.HALF_FLOAT&&(q=i.RGBA16F),z===i.UNSIGNED_BYTE&&(q=J===St?i.SRGB8_ALPHA8:i.RGBA8),z===i.UNSIGNED_SHORT&&fe&&(q=fe.RGBA16_EXT),z===i.SHORT&&fe&&(q=fe.RGBA16_SNORM_EXT),z===i.UNSIGNED_SHORT_4_4_4_4&&(q=i.RGBA4),z===i.UNSIGNED_SHORT_5_5_5_1&&(q=i.RGB5_A1)}return(q===i.R16F||q===i.R32F||q===i.RG16F||q===i.RG32F||q===i.RGBA16F||q===i.RGBA32F)&&e.get("EXT_color_buffer_float"),q}function T(C,E){let z;return C?E===null||E===Gn||E===Ps?z=i.DEPTH24_STENCIL8:E===vn?z=i.DEPTH32F_STENCIL8:E===Is&&(z=i.DEPTH24_STENCIL8,_e("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):E===null||E===Gn||E===Ps?z=i.DEPTH_COMPONENT24:E===v
vendor: 5,661 bytes, line 4080
4080n?z=i.DEPTH_COMPONENT32F:E===Is&&(z=i.DEPTH_COMPONENT16),z}function S(C,E){return m(C)===!0||C.isFramebufferTexture&&C.minFilter!==Xt&&C.minFilter!==Lt?Math.log2(Math.max(E.width,E.height))+1:C.mipmaps!==void 0&&C.mipmaps.length>0?C.mipmaps.length:C.isCompressedTexture&&Array.isArray(C.image)?E.mipmaps.length:1}function R(C){const E=C.target;E.removeEventListener("dispose",R),M(E),E.isVideoTexture&&u.delete(E),E.isHTMLTexture&&h.delete(E)}function x(C){const E=C.target;E.removeEventListener("dispose",x),I(E)}function M(C){const E=n.get(C);if(E.__webglInit===void 0)return;const z=C.source,Z=f.get(z);if(Z){const ne=Z[E.__cacheKey];ne.usedTimes--,ne.usedTimes===0&&A(C),Object.keys(Z).length===0&&f.delete(z)}n.remove(C)}function A(C){const E=n.get(C);i.deleteTexture(E.__webglTexture);const z=C.source,Z=f.get(z);delete Z[E.__cacheKey],a.memory.textures--}function I(C){const E=n.get(C);if(C.depthTexture&&(C.depthTexture.dispose(),n.remove(C.depthTexture)),C.isWebGLCubeRenderTarget)for(let Z=0;Z<6;Z++){if(Array.isArray(E.__webglFramebuffer[Z]))for(let ne=0;ne<E.__webglFramebuffer[Z].length;ne++)i.deleteFramebuffer(E.__webglFramebuffer[Z][ne]);else i.deleteFramebuffer(E.__webglFramebuffer[Z]);E.__webglDepthbuffer&&i.deleteRenderbuffer(E.__webglDepthbuffer[Z])}else{if(Array.isArray(E.__webglFramebuffer))for(let Z=0;Z<E.__webglFramebuffer.length;Z++)i.deleteFramebuffer(E.__webglFramebuffer[Z]);else i.deleteFramebuffer(E.__webglFramebuffer);if(E.__webglDepthbuffer&&i.deleteRenderbuffer(E.__webglDepthbuffer),E.__webglMultisampledFramebuffer&&i.deleteFramebuffer(E.__webglMultisampledFramebuffer),E.__webglColorRenderbuffer)for(let Z=0;Z<E.__webglColorRenderbuffer.length;Z++)E.__webglColorRenderbuffer[Z]&&i.deleteRenderbuffer(E.__webglColorRenderbuffer[Z]);E.__webglDepthRenderbuffer&&i.deleteRenderbuffer(E.__webglDepthRenderbuffer)}const z=C.textures;for(let Z=0,ne=z.length;Z<ne;Z++){const ce=n.get(z[Z]);ce.__webglTexture&&(i.deleteTexture(ce.__webglTexture),a.memory.textures--),n.remove(z[Z])}n.remove(C)}let N=0;function U(){N=0}function k(){return N}function L(C){N=C}function F(){const C=N;return C>=r.maxTextures&&_e("WebGLTextures: Trying to use "+C+" texture units while this GPU supports only "+r.maxTextures),N+=1,C}function O(C){const E=[];return E.push(C.wrapS),E.push(C.wrapT),E.push(C.wrapR||0),E.push(C.magFilter),E.push(C.minFilter),E.push(C.anisotropy),E.push(C.internalFormat),E.push(C.format),E.push(C.type),E.push(C.generateMipmaps),E.push(C.premultiplyAlpha),E.push(C.flipY),E.push(C.unpackAlignment),E.push(C.colorSpace),E.join()}function X(C,E){const z=n.get(C);if(C.isVideoTexture&&je(C),C.isRenderTargetTexture===!1&&C.isExternalTexture!==!0&&C.version>0&&z.__version!==C.version){const Z=C.image;if(Z===null)_e("WebGLRenderer: Texture marked for update but no image data found.");else if(Z.complete===!1)_e("WebGLRenderer: Texture marked for update but image is incomplete");else{De(z,C,E);return}}else C.isExternalTexture&&(z.__webglTexture=C.sourceTexture?C.sourceTexture:null);t.bindTexture(i.TEXTURE_2D,z.__webglTexture,i.TEXTURE0+E)}function $(C,E){const z=n.get(C);if(C.isRenderTargetTexture===!1&&C.version>0&&z.__version!==C.version){De(z,C,E);return}else C.isExternalTexture&&(z.__webglTexture=C.sourceTexture?C.sourceTexture:null);t.bindTexture(i.TEXTURE_2D_ARRAY,z.__webglTexture,i.TEXTURE0+E)}function te(C,E){const z=n.get(C);if(C.isRenderTargetTexture===!1&&C.version>0&&z.__version!==C.version){De(z,C,E);return}t.bindTexture(i.TEXTURE_3D,z.__webglTexture,i.TEXTURE0+E)}function ue(C,E){const z=n.get(C);if(C.isCubeDepthTexture!==!0&&C.version>0&&z.__version!==C.version){Ne(z,C,E);return}t.bindTexture(i.TEXTURE_CUBE_MAP,z.__webglTexture,i.TEXTURE0+E)}const xe={[Ua]:i.REPEAT,[An]:i.CLAMP_TO_EDGE,[Fa]:i.MIRRORED_REPEAT},He={[Xt]:i.NEAREST,[ld]:i.NEAREST_MIPMAP_NEAREST,[ms]:i.NEAREST_MIPMAP_LINEAR,[Lt]:i.LINEAR,[Sa]:i.LINEAR_MIPMAP_NEAREST,[di]:i.LINEAR_MIPMAP_LINEAR},Ke={[t_]:i.NEVER,[a_]:i.ALWAYS,[n_]:i.LESS,[Ic]:i.LEQUAL,[i_]:i.EQUAL,[Pc]:i.GEQUAL,[r_]:i.GREATER,[s_]:i.NOTEQUAL};function qe(C,E){if(E.type===vn&&e.has("OES_texture_float_linear")===!1&&(E.magFilter===Lt||E.magFilter===Sa||E.magFilter===ms||E.magFilter===di||E.minFilter===Lt||E.minFilter===Sa||E.minFilter===ms||E.minFilter===di)&&_e("WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),i.texParameteri(C,i.TEXTURE_WRAP_S,xe[E.wrapS]),i.texParameteri(C,i.TEXTURE_WRAP_T,xe[E.wrapT]),(C===i.TEXTURE_3D||C===i.TEXTURE_2D_ARRAY)&&i.texParameteri(C,i.TEXTURE_WRAP_R,xe[E.wrapR]),i.texParameteri(C,i.TEXTURE_MAG_FILTER,He[E.magFilter]),i.texParameteri(C,i.TEXTURE_MIN_FILTER,He[E.minFilter]),E.compareFunction&&(i.texParameteri(C,i.TEXTURE_COMPARE_MODE,i.COMPARE_REF_TO_TEXTURE),i.texParameteri(C,i.TEXTURE_COMPARE_FUNC,Ke[E.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(E.magFilter===Xt||E.minFilter!==ms&&E.minFilter!==di||E.type===vn&&e.has("OES_texture_float_linear")===!1)return;if(E.anisotropy>1||n.get(E).__currentAnisotropy){const z=e.get("EXT_texture_filter_anisotropic");i.texParameterf(C,z.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(E.anisotropy,r.getMaxAnisotropy())),n.get(E).__currentAnisotropy=E.anisotropy}}}function K(C,E){let z=!1;C.__webglInit===void 0&&(C.__webglInit=!0,E.addEventListener("dispose",R));const Z=E.source;let ne=f.get(Z);ne===void 0&&(ne={},f.set(Z,ne));const ce=O(E);if(ce!==C.__cacheKey){ne[ce]===void 0&&(ne[ce]={texture:i.createTexture(),usedTimes:0},a.memory.textures++,z=!0),ne[ce].usedTimes++;const fe=ne[C.__cacheKey];fe!==void 0&&(ne[C.__cacheKey].usedTimes--,fe.usedTimes===0&&A(E)),C.__c
vendor: 6,440 bytes, line 4080
4080acheKey=ce,C.__webglTexture=ne[ce].texture}return z}function ye(C,E,z){return Math.floor(Math.floor(C/z)/E)}function le(C,E,z,Z){const ce=C.updateRanges;if(ce.length===0)t.texSubImage2D(i.TEXTURE_2D,0,0,0,E.width,E.height,z,Z,E.data);else{ce.sort((Re,me)=>Re.start-me.start);let fe=0;for(let Re=1;Re<ce.length;Re++){const me=ce[fe],he=ce[Re],it=me.start+me.count,ot=ye(he.start,E.width,4),vt=ye(me.start,E.width,4);he.start<=it+1&&ot===vt&&ye(he.start+he.count-1,E.width,4)===ot?me.count=Math.max(me.count,he.start+he.count-me.start):(++fe,ce[fe]=he)}ce.length=fe+1;const q=t.getParameter(i.UNPACK_ROW_LENGTH),J=t.getParameter(i.UNPACK_SKIP_PIXELS),Te=t.getParameter(i.UNPACK_SKIP_ROWS);t.pixelStorei(i.UNPACK_ROW_LENGTH,E.width);for(let Re=0,me=ce.length;Re<me;Re++){const he=ce[Re],it=Math.floor(he.start/4),ot=Math.ceil(he.count/4),vt=it%E.width,B=Math.floor(it/E.width),de=ot,Y=1;t.pixelStorei(i.UNPACK_SKIP_PIXELS,vt),t.pixelStorei(i.UNPACK_SKIP_ROWS,B),t.texSubImage2D(i.TEXTURE_2D,0,vt,B,de,Y,z,Z,E.data)}C.clearUpdateRanges(),t.pixelStorei(i.UNPACK_ROW_LENGTH,q),t.pixelStorei(i.UNPACK_SKIP_PIXELS,J),t.pixelStorei(i.UNPACK_SKIP_ROWS,Te)}}function De(C,E,z){let Z=i.TEXTURE_2D;(E.isDataArrayTexture||E.isCompressedArrayTexture)&&(Z=i.TEXTURE_2D_ARRAY),E.isData3DTexture&&(Z=i.TEXTURE_3D);const ne=K(C,E),ce=E.source;t.bindTexture(Z,C.__webglTexture,i.TEXTURE0+z);const fe=n.get(ce);if(ce.version!==fe.__version||ne===!0){if(t.activeTexture(i.TEXTURE0+z),(typeof ImageBitmap<"u"&&E.image instanceof ImageBitmap)===!1){const Y=dt.getPrimaries(dt.workingColorSpace),we=E.colorSpace===Ci?null:dt.getPrimaries(E.colorSpace),ge=E.colorSpace===Ci||Y===we?i.NONE:i.BROWSER_DEFAULT_WEBGL;t.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,E.flipY),t.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,E.premultiplyAlpha),t.pixelStorei(i.UNPACK_COLORSPACE_CONVERSION_WEBGL,ge)}t.pixelStorei(i.UNPACK_ALIGNMENT,E.unpackAlignment);let J=g(E.image,!1,r.maxTextureSize);J=oe(E,J);const Te=s.convert(E.format,E.colorSpace),Re=s.convert(E.type);let me=y(E.internalFormat,Te,Re,E.normalized,E.colorSpace,E.isVideoTexture);qe(Z,E);let he;const it=E.mipmaps,ot=E.isVideoTexture!==!0,vt=fe.__version===void 0||ne===!0,B=ce.dataReady,de=S(E,J);if(E.isDepthTexture)me=T(E.format===$i,E.type),vt&&(ot?t.texStorage2D(i.TEXTURE_2D,1,me,J.width,J.height):t.texImage2D(i.TEXTURE_2D,0,me,J.width,J.height,0,Te,Re,null));else if(E.isDataTexture)if(it.length>0){ot&&vt&&t.texStorage2D(i.TEXTURE_2D,de,me,it[0].width,it[0].height);for(let Y=0,we=it.length;Y<we;Y++)he=it[Y],ot?B&&t.texSubImage2D(i.TEXTURE_2D,Y,0,0,he.width,he.height,Te,Re,he.data):t.texImage2D(i.TEXTURE_2D,Y,me,he.width,he.height,0,Te,Re,he.data);E.generateMipmaps=!1}else ot?(vt&&t.texStorage2D(i.TEXTURE_2D,de,me,J.width,J.height),B&&le(E,J,Te,Re)):t.texImage2D(i.TEXTURE_2D,0,me,J.width,J.height,0,Te,Re,J.data);else if(E.isCompressedTexture)if(E.isCompressedArrayTexture){ot&&vt&&t.texStorage3D(i.TEXTURE_2D_ARRAY,de,me,it[0].width,it[0].height,J.depth);for(let Y=0,we=it.length;Y<we;Y++)if(he=it[Y],E.format!==xn)if(Te!==null)if(ot){if(B)if(E.layerUpdates.size>0){const ge=Ah(he.width,he.height,E.format,E.type);for(const ie of E.layerUpdates){const ke=he.data.subarray(ie*ge/he.data.BYTES_PER_ELEMENT,(ie+1)*ge/he.data.BYTES_PER_ELEMENT);t.compressedTexSubImage3D(i.TEXTURE_2D_ARRAY,Y,0,0,ie,he.width,he.height,1,Te,ke)}E.clearLayerUpdates()}else t.compressedTexSubImage3D(i.TEXTURE_2D_ARRAY,Y,0,0,0,he.width,he.height,J.depth,Te,he.data)}else t.compressedTexImage3D(i.TEXTURE_2D_ARRAY,Y,me,he.width,he.height,J.depth,0,he.data,0,0);else _e("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else ot?B&&t.texSubImage3D(i.TEXTURE_2D_ARRAY,Y,0,0,0,he.width,he.height,J.depth,Te,Re,he.data):t.texImage3D(i.TEXTURE_2D_ARRAY,Y,me,he.width,he.height,J.depth,0,Te,Re,he.data)}else{ot&&vt&&t.texStorage2D(i.TEXTURE_2D,de,me,it[0].width,it[0].height);for(let Y=0,we=it.length;Y<we;Y++)he=it[Y],E.format!==xn?Te!==null?ot?B&&t.compressedTexSubImage2D(i.TEXTURE_2D,Y,0,0,he.width,he.height,Te,he.data):t.compressedTexImage2D(i.TEXTURE_2D,Y,me,he.width,he.height,0,he.data):_e("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):ot?B&&t.texSubImage2D(i.TEXTURE_2D,Y,0,0,he.width,he.height,Te,Re,he.data):t.texImage2D(i.TEXTURE_2D,Y,me,he.width,he.height,0,Te,Re,he.data)}else if(E.isDataArrayTexture)if(ot){if(vt&&t.texStorage3D(i.TEXTURE_2D_ARRAY,de,me,J.width,J.height,J.depth),B)if(E.layerUpdates.size>0){const Y=Ah(J.width,J.height,E.format,E.type);for(const we of E.layerUpdates){const ge=J.data.subarray(we*Y/J.data.BYTES_PER_ELEMENT,(we+1)*Y/J.data.BYTES_PER_ELEMENT);t.texSubImage3D(i.TEXTURE_2D_ARRAY,0,0,0,we,J.width,J.height,1,Te,Re,ge)}E.clearLayerUpdates()}else t.texSubImage3D(i.TEXTURE_2D_ARRAY,0,0,0,0,J.width,J.height,J.depth,Te,Re,J.data)}else t.texImage3D(i.TEXTURE_2D_ARRAY,0,me,J.width,J.height,J.depth,0,Te,Re,J.data);else if(E.isData3DTexture)ot?(vt&&t.texStorage3D(i.TEXTURE_3D,de,me,J.width,J.height,J.depth),B&&t.texSubImage3D(i.TEXTURE_3D,0,0,0,0,J.width,J.height,J.depth,Te,Re,J.data)):t.texImage3D(i.TEXTURE_3D,0,me,J.width,J.height,J.depth,0,Te,Re,J.data);else if(E.isFramebufferTexture){if(vt)if(ot)t.texStorage2D(i.TEXTURE_2D,de,me,J.width,J.height);else{let Y=J.width,we=J.height;for(let ge=0;ge<de;ge++)t.texImage2D(i.TEXTURE_2D,ge,me,Y,we,0,Te,Re,null),Y>>=1,we>>=1}}else if(E.isHTMLTexture){if("texElementImage2D"in i){const Y=i.canvas;if(Y.hasAttribute("layoutsubtree")||Y.setAttribute("layoutsubtree","true"),J.parentNode!==Y){Y.appendChild(J),h.add(E),Y.onpaint=rt=>{const Vt=rt.changedElements;for(const Tt of h)Vt.includes(Tt.image)&&(Tt.needsUpdate=!0)},Y.requestPaint();return}const we=0,ge=i.RGBA,ie=i.RGBA,ke=i.UNSIGNED_BYTE;i.texElementImage2D(i.TEXTURE_2D,we,ge,ie,ke,J),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE)}}else if(it.length>0){if(ot&&vt){const Y=bt(it[0]);t.texStorage2D(i.TEXTURE_2D,de,me,Y.width,Y.height)}for(let Y=0,we=it.length;Y<we;Y++)he=it[Y],ot?B&&t.texSubImage2D(i.TEXTURE_2D,Y,0,0,Te,Re,he):t.texImage2D(i.TEXTURE_2D,Y,me,Te,Re,he);E.generateMipmaps=!1}else if(ot){if(vt){const Y=bt(J);t.texStorage2D(i.TEXTURE_2D,de,me,Y.width,Y.height)}B&&t.texSubImage2D(i.TEXTURE_2D,0,0,0,Te,Re,J)}else t.texImage2D(i.TEXTURE_2D,0,me,Te,Re,J);
vendor: 28,966 bytes, lines 4080-4104
4080m(E)&&v(Z),fe.__version=ce.version,E.onUpdate&&E.onUpdate(E)}C.__version=E.version}function Ne(C,E,z){if(E.image.length!==6)return;const Z=K(C,E),ne=E.source;t.bindTexture(i.TEXTURE_CUBE_MAP,C.__webglTexture,i.TEXTURE0+z);const ce=n.get(ne);if(ne.version!==ce.__version||Z===!0){t.activeTexture(i.TEXTURE0+z);const fe=dt.getPrimaries(dt.workingColorSpace),q=E.colorSpace===Ci?null:dt.getPrimaries(E.colorSpace),J=E.colorSpace===Ci||fe===q?i.NONE:i.BROWSER_DEFAULT_WEBGL;t.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,E.flipY),t.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,E.premultiplyAlpha),t.pixelStorei(i.UNPACK_ALIGNMENT,E.unpackAlignment),t.pixelStorei(i.UNPACK_COLORSPACE_CONVERSION_WEBGL,J);const Te=E.isCompressedTexture||E.image[0].isCompressedTexture,Re=E.image[0]&&E.image[0].isDataTexture,me=[];for(let ie=0;ie<6;ie++)!Te&&!Re?me[ie]=g(E.image[ie],!0,r.maxCubemapSize):me[ie]=Re?E.image[ie].image:E.image[ie],me[ie]=oe(E,me[ie]);const he=me[0],it=s.convert(E.format,E.colorSpace),ot=s.convert(E.type),vt=y(E.internalFormat,it,ot,E.normalized,E.colorSpace),B=E.isVideoTexture!==!0,de=ce.__version===void 0||Z===!0,Y=ne.dataReady;let we=S(E,he);qe(i.TEXTURE_CUBE_MAP,E);let ge;if(Te){B&&de&&t.texStorage2D(i.TEXTURE_CUBE_MAP,we,vt,he.width,he.height);for(let ie=0;ie<6;ie++){ge=me[ie].mipmaps;for(let ke=0;ke<ge.length;ke++){const rt=ge[ke];E.format!==xn?it!==null?B?Y&&t.compressedTexSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+ie,ke,0,0,rt.width,rt.height,it,rt.data):t.compressedTexImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+ie,ke,vt,rt.width,rt.height,0,rt.data):_e("WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):B?Y&&t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+ie,ke,0,0,rt.width,rt.height,it,ot,rt.data):t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+ie,ke,vt,rt.width,rt.height,0,it,ot,rt.data)}}}else{if(ge=E.mipmaps,B&&de){ge.length>0&&we++;const ie=bt(me[0]);t.texStorage2D(i.TEXTURE_CUBE_MAP,we,vt,ie.width,ie.height)}for(let ie=0;ie<6;ie++)if(Re){B?Y&&t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+ie,0,0,0,me[ie].width,me[ie].height,it,ot,me[ie].data):t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+ie,0,vt,me[ie].width,me[ie].height,0,it,ot,me[ie].data);for(let ke=0;ke<ge.length;ke++){const Vt=ge[ke].image[ie].image;B?Y&&t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+ie,ke+1,0,0,Vt.width,Vt.height,it,ot,Vt.data):t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+ie,ke+1,vt,Vt.width,Vt.height,0,it,ot,Vt.data)}}else{B?Y&&t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+ie,0,0,0,it,ot,me[ie]):t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+ie,0,vt,it,ot,me[ie]);for(let ke=0;ke<ge.length;ke++){const rt=ge[ke];B?Y&&t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+ie,ke+1,0,0,it,ot,rt.image[ie]):t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+ie,ke+1,vt,it,ot,rt.image[ie])}}}m(E)&&v(i.TEXTURE_CUBE_MAP),ce.__version=ne.version,E.onUpdate&&E.onUpdate(E)}C.__version=E.version}function Ge(C,E,z,Z,ne,ce){const fe=s.convert(z.format,z.colorSpace),q=s.convert(z.type),J=y(z.internalFormat,fe,q,z.normalized,z.colorSpace),Te=n.get(E),Re=n.get(z);if(Re.__renderTarget=E,!Te.__hasExternalTextures){const me=Math.max(1,E.width>>ce),he=Math.max(1,E.height>>ce);ne===i.TEXTURE_3D||ne===i.TEXTURE_2D_ARRAY?t.texImage3D(ne,ce,J,me,he,E.depth,0,fe,q,null):t.texImage2D(ne,ce,J,me,he,0,fe,q,null)}t.bindFramebuffer(i.FRAMEBUFFER,C),Ue(E)?o.framebufferTexture2DMultisampleEXT(i.FRAMEBUFFER,Z,ne,Re.__webglTexture,0,nt(E)):(ne===i.TEXTURE_2D||ne>=i.TEXTURE_CUBE_MAP_POSITIVE_X&&ne<=i.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&i.framebufferTexture2D(i.FRAMEBUFFER,Z,ne,Re.__webglTexture,ce),t.bindFramebuffer(i.FRAMEBUFFER,null)}function ft(C,E,z){if(i.bindRenderbuffer(i.RENDERBUFFER,C),E.depthBuffer){const Z=E.depthTexture,ne=Z&&Z.isDepthTexture?Z.type:null,ce=T(E.stencilBuffer,ne),fe=E.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT;Ue(E)?o.renderbufferStorageMultisampleEXT(i.RENDERBUFFER,nt(E),ce,E.width,E.height):z?i.renderbufferStorageMultisample(i.RENDERBUFFER,nt(E),ce,E.width,E.height):i.renderbufferStorage(i.RENDERBUFFER,ce,E.width,E.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,fe,i.RENDERBUFFER,C)}else{const Z=E.textures;for(let ne=0;ne<Z.length;ne++){const ce=Z[ne],fe=s.convert(ce.format,ce.colorSpace),q=s.convert(ce.type),J=y(ce.internalFormat,fe,q,ce.normalized,ce.colorSpace);Ue(E)?o.renderbufferStorageMultisampleEXT(i.RENDERBUFFER,nt(E),J,E.width,E.height):z?i.renderbufferStorageMultisample(i.RENDERBUFFER,nt(E),J,E.width,E.height):i.renderbufferStorage(i.RENDERBUFFER,J,E.width,E.height)}}i.bindRenderbuffer(i.RENDERBUFFER,null)}function Ye(C,E,z){const Z=E.isWebGLCubeRenderTarget===!0;if(t.bindFramebuffer(i.FRAMEBUFFER,C),!(E.depthTexture&&E.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");const ne=n.get(E.depthTexture);if(ne.__renderTarget=E,(!ne.__webglTexture||E.depthTexture.image.width!==E.width||E.depthTexture.image.height!==E.height)&&(E.depthTexture.image.width=E.width,E.depthTexture.image.height=E.height,E.depthTexture.needsUpdate=!0),Z){if(ne.__webglInit===void 0&&(ne.__webglInit=!0,E.depthTexture.addEventListener("dispose",R)),ne.__webglTexture===void 0){ne.__webglTexture=i.createTexture(),t.bindTexture(i.TEXTURE_CUBE_MAP,ne.__webglTexture),qe(i.TEXTURE_CUBE_MAP,E.depthTexture);const Te=s.convert(E.depthTexture.format),Re=s.convert(E.depthTexture.type);let me;E.depthTexture.format===_i?me=i.DEPTH_COMPONENT24:E.depthTexture.format===$i&&(me=i.DEPTH24_STENCIL8);for(let he=0;he<6;he++)i.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+he,0,me,E.width,E.height,0,Te,Re,null)}}else X(E.depthTexture,0);const ce=ne.__webglTexture,fe=nt(E),q=Z?i.TEXTURE_CUBE_MAP_POSITIVE_X+z:i.TEXTURE_2D,J=E.depthTexture.format===$i?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT;if(E.depthTexture.format===_i)Ue(E)?o.framebufferTexture2DMultisampleEXT(i.FRAMEBUFFER,J,q,ce,0,fe):i.framebufferTexture2D(i.FRAMEBUFFER,J,q,ce,0);else if(E.depthTexture.format===$i)Ue(E)?o.framebufferTexture2DMultisampleEXT(i.FRAMEBUFFER,J,q,ce,0,fe):i.framebufferTexture2D(i.FRAMEBUFFER,J,q,ce,0);else throw new Error("Unknown depthTexture format")}function Q(C){const E=n.get(C),z=C.isWebGLCubeRenderTarget===!0;if(E.__boundDepthTexture!==C.depthTexture){const Z=C.depthTexture;if(E.__depthDisposeCallback&&E.__depthDisposeCallback(),Z){const ne=()=>{delete E.__boundDepthTexture,delete E.__depthDisposeCallback,Z.removeEventListener("dispose",ne)};Z.addEventListener("dispose",ne),E.__depthDisposeCallback=ne}E.__boundDepthTexture=Z}if(C.depthTexture&&!E.__autoAllocateDepthBuffer)if(z)for(let Z=0;Z<6;Z++)Ye(E.__webglFramebuffer[Z],C,Z);else{const Z=C.texture.mipmaps;Z&&Z.length>0?Ye(E.__webglFramebuffer[0],C,0):Ye(E.__webglFramebuffer,C,0)}else if(z){E.__webglDepthbuffer=[];for(let Z=0;Z<6;Z++)if(t.bindFramebuffer(i.FRAMEBUFFER,E.__webglFramebuffer[Z]),E.__webglDepthbuffer[Z]===void 0)E.__webglDepthbuffer[Z]=i.createRenderbuffer(),ft(E.__webglDepthbuffer[Z],C,!1);else{const ne=C.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,ce=E.__webglDepthbuffer[Z];i.bindRenderbuffer(i.RENDERBUFFER,ce),i.framebufferRenderbuffer(i.FRAMEBUFFER,ne,i.RENDERBUFFER,ce)}}else{const Z=C.texture.mipmaps;if(Z&&Z.length>0?t.bindFramebuffer(i.FRAMEBUFFER,E.__webglFramebuffer[0]):t.bindFramebuffer(i.FRAMEBUFFER,E.__webglFramebuffer),E.__webglDepthbuffer===void 0)E.__webglDepthbuffer=i.createRenderbuffer(),ft(E.__webglDepthbuffer,C,!1);else{const ne=C.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,ce=E.__webglDepthbuffer;i.bindRenderbuffer(i.RENDERBUFFER,ce),i.framebufferRenderbuffer(i.FRAMEBUFFER,ne,i.RENDERBUFFER,ce)}}t.bindFramebuffer(i.FRAMEBUFFER,null)}function se(C,E,z){const Z=n.get(C);E!==void 0&&Ge(Z.__webglFramebuffer,C,C.texture,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,0),z!==void 0&&Q(C)}function ee(C){const E=C.texture,z=n.get(C),Z=n.get(E);C.addEventListener("dispose",x);const ne=C.textures,ce=C.isWebGLCubeRenderTarget===!0,fe=ne.length>1;if(fe||(Z.__webglTexture===void 0&&(Z.__webglTexture=i.createTexture()),Z.__version=E.version,a.memory.textures++),ce){z.__webglFramebuffer=[];for(let q=0;q<6;q++)if(E.mipmaps&&E.mipmaps.length>0){z.__webglFramebuffer[q]=[];for(let J=0;J<E.mipmaps.length;J++)z.__webglFramebuffer[q][J]=i.createFramebuffer()}else z.__webglFramebuffer[q]=i.createFramebuffer()}else{if(E.mipmaps&&E.mipmaps.length>0){z.__webglFramebuffer=[];for(let q=0;q<E.mipmaps.length;q++)z.__webglFramebuffer[q]=i.createFramebuffer()}else z.__webglFramebuffer=i.createFramebuffer();if(fe)for(let q=0,J=ne.length;q<J;q++){const Te=n.get(ne[q]);Te.__webglTexture===void 0&&(Te.__webglTexture=i.createTexture(),a.memory.textures++)}if(C.samples>0&&Ue(C)===!1){z.__webglMultisampledFramebuffer=i.createFramebuffer(),z.__webglColorRenderbuffer=[],t.bindFramebuffer(i.FRAMEBUFFER,z.__webglMultisampledFramebuffer);for(let q=0;q<ne.length;q++){const J=ne[q];z.__webglColorRenderbuffer[q]=i.createRenderbuffer(),i.bindRenderbuffer(i.RENDERBUFFER,z.__webglColorRenderbuffer[q]);const Te=s.convert(J.format,J.colorSpace),Re=s.convert(J.type),me=y(J.internalFormat,Te,Re,J.normalized,J.colorSpace,C.isXRRenderTarget===!0),he=nt(C);i.renderbufferStorageMultisample(i.RENDERBUFFER,he,me,C.width,C.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0+q,i.RENDERBUFFER,z.__webglColorRenderbuffer[q])}i.bindRenderbuffer(i.RENDERBUFFER,null),C.depthBuffer&&(z.__webglDepthRenderbuffer=i.createRenderbuffer(),ft(z.__webglDepthRenderbuffer,C,!0)),t.bindFramebuffer(i.FRAMEBUFFER,null)}}if(ce){t.bindTexture(i.TEXTURE_CUBE_MAP,Z.__webglTexture),qe(i.TEXTURE_CUBE_MAP,E);for(let q=0;q<6;q++)if(E.mipmaps&&E.mipmaps.length>0)for(let J=0;J<E.mipmaps.length;J++)Ge(z.__webglFramebuffer[q][J],C,E,i.COLOR_ATTACHMENT0,i.TEXTURE_CUBE_MAP_POSITIVE_X+q,J);else Ge(z.__webglFramebuffer[q],C,E,i.COLOR_ATTACHMENT0,i.TEXTURE_CUBE_MAP_POSITIVE_X+q,0);m(E)&&v(i.TEXTURE_CUBE_MAP),t.unbindTexture()}else if(fe){for(let q=0,J=ne.length;q<J;q++){const Te=ne[q],Re=n.get(Te);let me=i.TEXTURE_2D;(C.isWebGL3DRenderTarget||C.isWebGLArrayRenderTarget)&&(me=C.isWebGL3DRenderTarget?i.TEXTURE_3D:i.TEXTURE_2D_ARRAY),t.bindTexture(me,Re.__webglTexture),qe(me,Te),Ge(z.__webglFramebuffer,C,Te,i.COLOR_ATTACHMENT0+q,me,0),m(Te)&&v(me)}t.unbindTexture()}else{let q=i.TEXTURE_2D;if((C.isWebGL3DRenderTarget||C.isWebGLArrayRenderTarget)&&(q=C.isWebGL3DRenderTarget?i.TEXTURE_3D:i.TEXTURE_2D_ARRAY),t.bindTexture(q,Z.__webglTexture),qe(q,E),E.mipmaps&&E.mipmaps.length>0)for(let J=0;J<E.mipmaps.length;J++)Ge(z.__webglFramebuffer[J],C,E,i.COLOR_ATTACHMENT0,q,J);else Ge(z.__webglFramebuffer,C,E,i.COLOR_ATTACHMENT0,q,0);m(E)&&v(q),t.unbindTexture()}C.depthBuffer&&Q(C)}function pe(C){const E=C.textures;for(let z=0,Z=E.length;z<Z;z++){const ne=E[z];if(m(ne)){const ce=b(C),fe=n.get(ne).__webglTexture;t.bindTexture(ce,fe),v(ce),t.unbindTexture()}}}const ve=[],Je=[];function D(C){if(C.samples>0){if(Ue(C)===!1){const E=C.textures,z=C.width,Z=C.height;let ne=i.COLOR_BUFFER_BIT;const ce=C.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,fe=n.get(C),q=E.length>1;if(q)for(let Te=0;Te<E.length;Te++)t.bindFramebuffer(i.FRAMEBUFFER,fe.__webglMultisampledFramebuffer),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0+Te,i.RENDERBUFFER,null),t.bindFramebuffer(i.FRAMEBUFFER,fe.__webglFramebuffer),i.framebufferTexture2D(i.DRAW_FRAMEBUFFER,i.COLOR_ATTACHMENT0+Te,i.TEXTURE_2D,null,0);t.bindFramebuffer(i.READ_FRAMEBUFFER,fe.__webglMultisampledFramebuffer);const J=C.texture.mipmaps;J&&J.length>0?t.bindFramebuffer(i.DRAW_FRAMEBUFFER,fe.__webglFramebuffer[0]):t.bindFramebuffer(i.DRAW_FRAMEBUFFER,fe.__webglFramebuffer);for(let Te=0;Te<E.length;Te++){if(C.resolveDepthBuffer&&(C.depthBuffer&&(ne|=i.DEPTH_BUFFER_BIT),C.stencilBuffer&&C.resolveStencilBuffer&&(ne|=i.STENCIL_BUFFER_BIT)),q){i.framebufferRenderbuffer(i.READ_FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.RENDERBUFFER,fe.__webglColorRenderbuffer[Te]);const Re=n.get(E[Te]).__webglTexture;i.framebufferTexture2D(i.DRAW_FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,Re,0)}i.blitFramebuffer(0,0,z,Z,0,0,z,Z,ne,i.NEAREST),l===!0&&(ve.length=0,Je.length=0,ve.push(i.COLOR_ATTACHMENT0+Te),C.depthBuffer&&C.resolveDepthBuffer===!1&&(ve.push(ce),Je.push(ce),i.invalidateFramebuffer(i.DRAW_FRAMEBUFFER,Je)),i.invalidateFramebuffer(i.READ_FRAMEBUFFER,ve))}if(t.bindFramebuffer(i.READ_FRAMEBUFFER,null),t.bindFramebuffer(i.DRAW_FRAMEBUFFER,null),q)for(let Te=0;Te<E.length;Te++){t.bindFramebuffer(i.FRAMEBUFFER,fe.__webglMultisampledFramebuffer),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0+Te,i.RENDERBUFFER,fe.__webglColorRenderbuffer[Te]);const Re=n.get(E[Te]).__webglTexture;t.bindFramebuffer(i.FRAMEBUFFER,fe.__webglFramebuffer),i.framebufferTexture2D(i.DRAW_FRAMEBUFFER,i.COLOR_ATTACHMENT0+Te,i.TEXTURE_2D,Re,0)}t.bindFramebuffer(i.DRAW_FRAMEBUFFER,fe.__webglMultisampledFramebuffer)}else if(C.depthBuffer&&C.resolveDepthBuffer===!1&&l){const E=C.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT;i.invalidateFramebuffer(i.DRAW_FRAMEBUFFER,[E])}}}function nt(C){return Math.min(r.maxSamples,C.samples)}function Ue(C){const E=n.get(C);return C.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&E.__useRenderToTexture!==!1}function je(C){const E=a.render.frame;u.get(C)!==E&&(u.set(C,E),C.update())}function oe(C,E){const z=C.colorSpace,Z=C.format,ne=C.type;return C.isCompressedTexture===!0||C.isVideoTexture===!0||z!==Ha&&z!==Ci&&(dt.getTransfer(z)===St?(Z!==xn||ne!==wn)&&_e("WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):Oe("WebGLTextures: Unsupported texture color space:",z)),E}function bt(C){return typeof HTMLImageElement<"u"&&C instanceof HTMLImageElement?(c.width=C.naturalWidth||C.width,c.height=C.naturalHeight||C.height):typeof VideoFrame<"u"&&C instanceof VideoFrame?(c.width=C.displayWidth,c.height=C.displayHeight):(c.width=C.width,c.height=C.height),c}this.allocateTextureUnit=F,this.resetTextureUnits=U,this.getTextureUnits=k,this.setTextureUnits=L,this.setTexture2D=X,this.setTexture2DArray=$,this.setTexture3D=te,this.setTextureCube=ue,this.rebindTextures=se,this.setupRenderTarget=ee,this.updateRenderTargetMipmap=pe,this.updateMultisampleRenderTarget=D,this.setupDepthRenderbuffer=Q,this.setupFrameBufferTexture=Ge,this.useMultisampledRTT=Ue,this.isReversedDepthBuffer=function(){return t.buffers.depth.getReversed()}}function x0(i,e){function t(n,r=Ci){let s;const a=dt.getTransfer(r);if(n===wn)return i.UNSIGNED_BYTE;if(n===Ec)return i.UNSIGNED_SHORT_4_4_4_4;if(n===Tc)return i.UNSIGNED_SHORT_5_5_5_1;if(n===hd)return i.UNSIGNED_INT_5_9_9_9_REV;if(n===dd)return i.UNSIGNED_INT_10F_11F_11F_REV;if(n===cd)return i.BYTE;if(n===ud)return i.SHORT;if(n===Is)return i.UNSIGNED_SHORT;if(n===Mc)return i.INT;if(n===Gn)return i.UNSIGNED_INT;if(n===vn)return i.FLOAT;if(n===gi)return i.HALF_FLOAT;if(n===fd)return i.ALPHA;if(n===pd)return i.RGB;if(n===xn)return i.RGBA;if(n===_i)return i.DEPTH_COMPONENT;if(n===$i)return i.DEPTH_STENCIL;if(n===wc)return i.RED;if(n===so)return i.RED_INTEGER;if(n===er)return i.RG;if(n===Ac)return i.RG_INTEGER;if(n===Cc)return i.RGBA_INTEGER;if(n===Ma||n===Ea||n===Ta||n===wa)if(a===St)if(s=e.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(n===Ma)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===Ea)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===Ta)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===wa)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=e.get("WEBGL_compressed_texture_s3tc"),s!==null){if(n===Ma)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===Ea)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===Ta)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===wa)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(n===Rl||n===Il||n===Pl||n===Ll)if(s=e.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(n===Rl)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===Il)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===Pl)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===Ll)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(n===Nl||n===Dl||n===Ol||n===Ul||n===Fl||n===Ba||n===Bl)if(s=e.get("WEBGL_compressed_texture_etc"),s!==null){if(n===Nl||n===Dl)return a===St?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(n===Ol)return a===St?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC;if(n===Ul)return s.COMPRESSED_R11_EAC;if(n===Fl)return s.COMPRESSED_SIGNED_R11_EAC;if(n===Ba)return s.COMPRESSED_RG11_EAC;if(n===Bl)return s.COMPRESSED_SIGNED_RG11_EAC}else return null;if(n===kl||n===Vl||n===zl||n===Hl||n===Gl||n===Wl||n===Xl||n===ql||n===$l||n===Yl||n===Zl||n===Kl||n===Jl||n===jl)if(s=e.get("WEBGL_compressed_texture_astc"),s!==null){if(n===kl)return a===St?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===Vl)return a===St?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===zl)return a===St?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===Hl)return a===St?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===Gl)return a===St?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===Wl)return a===St?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===Xl)return a===St?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===ql)return a===St?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===$l)return a===St?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===Yl)return a===St?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===Zl)return a===St?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===Kl)return a===St?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===Jl)return a===St?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===jl)return a===St?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(n===Ql||n===ec||n===tc)if(s=e.get("EXT_texture_compression_bptc"),s!==null){if(n===Ql)return a===St?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===ec)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===tc)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(n===nc||n===ic||n===ka||n===rc)if(s=e.get("EXT_texture_compression_rgtc"),s!==null){if(n===nc)return s.COMPRESSED_RED_RGTC1_EXT;if(n===ic)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===ka)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===rc)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return n===Ps?i.UNSIGNED_INT_24_8:i[n]!==void 0?i[n]:null}return{convert:t}}const lR=` 4081void main() { 4082 4083 gl_Position = vec4( position, 1.0 ); 4084 4085}`,cR=` 4086uniform sampler2DArray depthColor; 4087uniform float depthWidth; 4088uniform float depthHeight; 4089 4090void main() { 4091 4092 vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight ); 4093 4094 if ( coord.x >= 1.0 ) { 4095 4096 gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r; 4097 4098 } else { 4099 4100 gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r; 4101 4102 } 4103 4104}`;class uR{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t){if(this.texture===null){const n=new Md(e.texture);(e.depthNear!==t.depthNear||e.depthFar!==t.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=n}}getMesh(e){if(this.texture!==null&&this.mesh===null){const t=e.cameras[0].viewport,n=new Cn({vertexShader:lR,fragmentShader:cR,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new Dt(new Xs(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class hR extends ii{constructor(e,t){super();const n=this;let r=null,s=1,a=null,o="local-floor",l=1,c=null,u=null,h=null,d=null,f=null,p=null;const _=typeof XRWebGLBinding<"u",g=new uR,m={},v=t.getContextAttributes();let b=null,y=null;const T=[],S=[],R=new j;let x=null;const M=new Jt;M.viewport=new Et;const A=new Jt;A.viewport=new Et;const I=[M,A],N=new a0;let U=null,k=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(K){let ye=T[K];return ye===void 0&&(ye=new dl,T[K]=ye),ye.getTargetRaySpace()},this.getControllerGrip=function(K){let ye=T[K];return ye===void 0&&(ye=new dl,T[K]=ye),ye.getGripSpace()},this.getHand=function(K){let ye=T[K];return ye===void 0&&(ye=new dl,T[K]=ye),ye.getHandSpace()};function L(K){const ye=S.indexOf(K.inputSource);if(ye===-1)return;const le=T[ye];le!==void 0&&(le.update(K.inputSource,K.frame,c||a),le.dispatchEvent({type:K.type,data:K.inputSource}))}function F(){r.removeEventListener("select",L),r.removeEventListener("selectstart",L),r.removeEventListener("selectend",L),r.removeEventListener("squeeze",L),r.removeEventListener("squeezestart",L),r.removeEventListener("squeezeend",L),r.removeEventListener("end",F),r.removeEventListener("inputsourceschange",O);for(let K=0;K<T.length;K++){const ye=S[K];ye!==null&&(S[K]=null,T[K].disconnect(ye))}U=null,k=null,g.reset();for(const K in m)delete m[K];e.setRenderTarget(b),f=null,d=null,h=null,r=null,y=null,qe.stop(),n.isPresenting=!1,e.setPixelRatio(x),e.setSize(R.width,R.height,!1),n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(K){s=K,n.isPresenting===!0&&_e("WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(K){o=K,n.isPresenting===!0&&_e("WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return c||a},this.setReferenceSpace=function(K){c=K},this.getBaseLayer=function(){return d!==null?d:f},this.getBinding=function(){return h===null&&_&&(h=new XRWebGLBinding(r,t)),h},this.getFrame=function(){return p},this.getSession=function(){return r},this.setSession=async function(K){if(r=K,r!==null){if(b=e.getRenderTarget(),r.addEventListener("select",L),r.addEventListener("selectstart",L),r.addEventListener("selectend",L),r.addEventListener("squeeze",L),r.addEventListener("squeezestart",L),r.addEventListener("squeezeend",L),r.addEventListener("end",F),r.addEventListener("inputsourceschange",O),v.xrCompatible!==!0&&await t.makeXRCompatible(),x=e.getPixelRatio(),e.getSize(R),_&&"createProjectionLayer"in XRWebGLBinding.prototype){let le=null,De=null,Ne=null;v.depth&&(Ne=v.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,le=v.stencil?$i:_i,De=v.stencil?Ps:Gn);const Ge={colorFormat:t.RGBA8,depthFormat:Ne,scaleFactor:s};h=this.getBinding(),d=h.createProjectionLayer(Ge),r.updateRenderState({layers:[d]}),e.setPixelRatio(1),e.setSize(d.textureWidth,d.textureHeight,!1),y=new Bn(d.textureWidth,d.textureHeight,{format:xn,type:wn,depthTexture:new Br(d.textureWidth,d.textureHeight,De,void 0,void 0,void 0,void 0,void 0,void 0,le),stencilBuffer:v.stencil,colorSpace:e.outputColorSpace,samples:v.antialias?4:0,resolveDepthBuffer:d.ignoreDepthValues===!1,resolveStencilBuffer:d.ignoreDepthValues===!1})}else{const le={antialias:v.antialias,alpha:!0,depth:v.depth,stencil:v.stencil,framebufferScaleFactor:s};f=new XRWebGLLayer(r,t,le),r.updateRenderState({baseLayer:f}),e.setPixelRatio(1),e.setSize(f.framebufferWidth,f.framebufferHeight,!1),y=new Bn(f.framebufferWidth,f.framebufferHeight,{format:xn,type:wn,colorSpace:e.outputColorSpace,stencilBuffer:v.stencil,resolveDepthBuffer:f.ignoreDepthValues===!1,resolveStencilBuffer:f.ignoreDepthValues===!1})}y.isXRRenderTarget=!0,this.setFoveation(l),c=null,a=await r.requestReferenceSpace(o),qe.setContext(r),qe.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(r!==null)return r.environmentBlendMode},this.getDepthTexture=function(){return g.getDepthTexture()};function O(K){for(let ye=0;ye<K.removed.length;ye++){const le=K.removed[ye],De=S.indexOf(le);De>=0&&(S[De]=null,T[De].disconnect(le))}for(let ye=0;ye<K.added.length;ye++){const le=K.added[ye];let De=S.indexOf(le);if(De===-1){for(let Ge=0;Ge<T.length;Ge++)if(Ge>=S.length){S.push(le),De=Ge;break}else if(S[Ge]===null){S[Ge]=le,De=Ge;break}if(De===-1)break}const Ne=T[De];Ne&&Ne.connect(le)}}const X=new P,$=new P;function te(K,ye,le){X.setFromMatrixPosition(ye.matrixWorld),$.setFromMatrixPosition(le.matrixWorld);const De=X.distanceTo($),Ne=ye.projectionMatrix.elements,Ge=le.projectionMatrix.elements,ft=Ne[14]/(Ne[10]-1),Ye=Ne[14]/(Ne[10]+1),Q=(Ne[9]+1)/Ne[5],se=(Ne[9]-1)/Ne[5],ee=(Ne[8]-1)/Ne[0],pe=(Ge[8]+1)/Ge[0],ve=ft*ee,Je=ft*pe,D=De/(-ee+pe),nt=D*-ee;if(ye.matrixWorld.decompose(K.position,K.quaternion,K.scale),K.translateX(nt),K.translateZ(D),K.matrixWorld.compose(K.position,K.quaternion,K.scale),K.matrixWorldInverse.copy(K.matrixWorld).invert(),Ne[10]===-1)K.projectionMatrix.copy(ye.projectionMatrix),K.projectionMatrixInverse.copy(ye.projectionMatrixInverse);else{const Ue=ft+D,je=Ye+D,oe=ve-nt,bt=Je+(De-nt),C=Q*Ye/je*Ue,E=se*Ye/je*Ue;K.projectionMatrix.makePerspective(oe,bt,C,E,Ue,je),K.projectionMatrixInverse.copy(K.projectionMatrix).invert()}}function ue(K,ye){ye===null?K.matrixWorld.copy(K.matrix):K.matrixWorld.multiplyMatrices(ye.matrixWorld,K.matrix),K.matrixWorldInverse.copy(K.matrixWorld).invert()}this.updateCamera=function(K){if(r===null)return;let ye=K.near,le=K.far;g.texture!==null&&(g.depthNear>0&&(ye=g.depthNear),g.depthFar>0&&(le=g.depthFar)),N.near=A.near=M.near=ye,N.far=A.far=M.far=le,(U!==N.near||k!==N.far)&&(r.updateRenderState({depthNear:N.near,depthFar:N.far}),U=N.near,k=N.far),N.layers.mask=K.layers.mask|6,M.layers.mask=N.layers.mask&-5,A.layers.mask=N.layers.mask&-3;const De=K.parent,Ne=N.cameras;ue(N,De);for(let Ge=0;Ge<Ne.length;Ge++)ue(Ne[Ge],De);Ne.length===2?te(N,M,A):N.projectionMatrix.copy(M.projectionMatrix),xe(K,N,De)};function xe(K,ye,le){le===null?K.matrix.copy(ye.matrixWorld):(K.matrix.copy(le.matrixWorld),K.matrix.invert(),K.matrix.multiply(ye.matrixWorld)),K.matrix.decompose(K.position,K.quaternion,K.scale),K.updateMatrixWorld(!0),K.projectionMatrix.copy(ye.projectionMatrix),K.projectionMatrixInverse.copy(ye.projectionMatrixInverse),K.isPerspectiveCamera&&(K.fov=Ls*2*Math.atan(1/K.projectionMatrix.elements[5]),K.zoom=1)}this.getCamera=function(){return N},this.getFoveation=function(){if(!(d===null&&f===null))return l},this.setFoveation=function(K){l=K,d!==null&&(d.fixedFoveation=K),f!==null&&f.fixedFoveation!==void 0&&(f.fixedFoveation=K)},this.hasDepthSensing=function(){return g.texture!==null},this.getDepthSensingMesh=function(){return g.getMesh(N)},this.getCameraTexture=function(K){return m[K]};let He=null;function Ke(K,ye){if(u=ye.getViewerPose(c||a),p=ye,u!==null){const le=u.views;f!==null&&(e.setRenderTargetFramebuffer(y,f.framebuffer),e.setRenderTarget(y));let De=!1;le.length!==N.cameras.length&&(N.cameras.length=0,De=!0);for(let Ye=0;Ye<le.length;Ye++){const Q=le[Ye];let se=null;if(f!==null)se=f.getViewport(Q);else{const pe=h.getViewSubImage(d,Q);se=pe.viewport,Ye===0&&(e.setRenderTargetTextures(y,pe.colorTexture,pe.depthStencilTexture),e.setRenderTarget(y))}let ee=I[Ye];ee===void 0&&(ee=new Jt,ee.layers.enable(Ye),ee.viewport=new Et,I[Ye]=ee),ee.matrix.fromArray(Q.transform.matrix),ee.matrix.decompose(ee.position,ee.quaternion,ee.scale),ee.projectionMatrix.fromArray(Q.projectionMatrix),ee.projectionMatrixInverse.copy(ee.projectionMatrix).invert(),ee.viewport.set(se.x,se.y,se.width,se.height),Ye===0&&(N.matrix.copy(ee.matrix),N.matrix.decompose(N.position,N.quaternion,N.scale)),De===!0&&N.cameras.push(ee)}const Ne=r.enabledFeatures;if(Ne&&Ne.includes("depth-sensing")&&r.depthUsage=="gpu-optimized"&&_){h=n.getBinding();const Ye=h.getDepthInformation(le[0]);Ye&&Ye.isValid&&Ye.texture&&g.init(Ye,r.renderState)}if(Ne&&Ne.includes("camera-access")&&_){e.state.unbindTexture(),h=n.getBinding();for(let Ye=0;Ye<le.length;Ye++){const Q=le[Ye].camera;if(Q){let se=m[Q];se||(se=new Md,m[Q]=se);const ee=h.getCameraImage(Q);se.sourceTexture=ee}}}}for(let le=0;le<T.length;le++){const De=S[le],Ne=T[le];De!==null&&Ne!==void 0&&Ne.update(De,ye,c||a)}He&&He(K,ye),ye.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:ye}),p=null}const qe=new f0;qe.setAnimationLoop(Ke),this.setAnimationLoop=function(K){He=K},this.dispose=function(){}}}const dR=new We,y0=new tt;y0.set(-1,0,0,0,1,0,0,0,1);function fR(i,e){function t(g,m){g.matrixAutoUpdate===!0&&g.updateMatrix(),m.value.copy(g.matrix)}function n(g,m){m.color.getRGB(g.fogColor.value,O_(i)),m.isFog?(g.fogNear.value=m.near,g.fogFar.value=m.far):m.isFogExp2&&(g.fogDensity.value=m.density)}function r(g,m,v,b,y){m.isNodeMaterial?m.uniformsNeedUpdate=!1:m.isMeshBasicMaterial?s(g,m):m.isMeshLambertMaterial?(s(g,m),m.envMap&&(g.envMapIntensity.value=m.envMapIntensity)):m.isMeshToonMaterial?(s(g,m),h(g,m)):m.isMeshPhongMaterial?(s(g,m),u(g,m),m.envMap&&(g.envMapIntensity.value=m.envMapIntensity)):m.isMeshStandardMaterial?(s(g,m),d(g,m),m.isMeshPhysicalMaterial&&f(g,m,y)):m.isMeshMat
vendor: 2,136 bytes, line 4104
4104capMaterial?(s(g,m),p(g,m)):m.isMeshDepthMaterial?s(g,m):m.isMeshDistanceMaterial?(s(g,m),_(g,m)):m.isMeshNormalMaterial?s(g,m):m.isLineBasicMaterial?(a(g,m),m.isLineDashedMaterial&&o(g,m)):m.isPointsMaterial?l(g,m,v,b):m.isSpriteMaterial?c(g,m):m.isShadowMaterial?(g.color.value.copy(m.color),g.opacity.value=m.opacity):m.isShaderMaterial&&(m.uniformsNeedUpdate=!1)}function s(g,m){g.opacity.value=m.opacity,m.color&&g.diffuse.value.copy(m.color),m.emissive&&g.emissive.value.copy(m.emissive).multiplyScalar(m.emissiveIntensity),m.map&&(g.map.value=m.map,t(m.map,g.mapTransform)),m.alphaMap&&(g.alphaMap.value=m.alphaMap,t(m.alphaMap,g.alphaMapTransform)),m.bumpMap&&(g.bumpMap.value=m.bumpMap,t(m.bumpMap,g.bumpMapTransform),g.bumpScale.value=m.bumpScale,m.side===yn&&(g.bumpScale.value*=-1)),m.normalMap&&(g.normalMap.value=m.normalMap,t(m.normalMap,g.normalMapTransform),g.normalScale.value.copy(m.normalScale),m.side===yn&&g.normalScale.value.negate()),m.displacementMap&&(g.displacementMap.value=m.displacementMap,t(m.displacementMap,g.displacementMapTransform),g.displacementScale.value=m.displacementScale,g.displacementBias.value=m.displacementBias),m.emissiveMap&&(g.emissiveMap.value=m.emissiveMap,t(m.emissiveMap,g.emissiveMapTransform)),m.specularMap&&(g.specularMap.value=m.specularMap,t(m.specularMap,g.specularMapTransform)),m.alphaTest>0&&(g.alphaTest.value=m.alphaTest);const v=e.get(m),b=v.envMap,y=v.envMapRotation;b&&(g.envMap.value=b,g.envMapRotation.value.setFromMatrix4(dR.makeRotationFromEuler(y)).transpose(),b.isCubeTexture&&b.isRenderTargetTexture===!1&&g.envMapRotation.value.premultiply(y0),g.reflectivity.value=m.reflectivity,g.ior.value=m.ior,g.refractionRatio.value=m.refractionRatio),m.lightMap&&(g.lightMap.value=m.lightMap,g.lightMapIntensity.value=m.lightMapIntensity,t(m.lightMap,g.lightMapTransform)),m.aoMap&&(g.aoMap.value=m.aoMap,g.aoMapIntensity.value=m.aoMapIntensity,t(m.aoMap,g.aoMapTransform))}function a(g,m){g.diffuse.value.copy(m.color),g.opacity.value=m.opacity,m.map&&(g.map.value=m.map,t(m.map,g.mapTransform))}function o(g,m){g.dashSize.value=m.dashSize,g.totalSize.value=m.dashSize
vendor: 5,385 bytes, line 4104
4104+m.gapSize,g.scale.value=m.scale}function l(g,m,v,b){g.diffuse.value.copy(m.color),g.opacity.value=m.opacity,g.size.value=m.size*v,g.scale.value=b*.5,m.map&&(g.map.value=m.map,t(m.map,g.uvTransform)),m.alphaMap&&(g.alphaMap.value=m.alphaMap,t(m.alphaMap,g.alphaMapTransform)),m.alphaTest>0&&(g.alphaTest.value=m.alphaTest)}function c(g,m){g.diffuse.value.copy(m.color),g.opacity.value=m.opacity,g.rotation.value=m.rotation,m.map&&(g.map.value=m.map,t(m.map,g.mapTransform)),m.alphaMap&&(g.alphaMap.value=m.alphaMap,t(m.alphaMap,g.alphaMapTransform)),m.alphaTest>0&&(g.alphaTest.value=m.alphaTest)}function u(g,m){g.specular.value.copy(m.specular),g.shininess.value=Math.max(m.shininess,1e-4)}function h(g,m){m.gradientMap&&(g.gradientMap.value=m.gradientMap)}function d(g,m){g.metalness.value=m.metalness,m.metalnessMap&&(g.metalnessMap.value=m.metalnessMap,t(m.metalnessMap,g.metalnessMapTransform)),g.roughness.value=m.roughness,m.roughnessMap&&(g.roughnessMap.value=m.roughnessMap,t(m.roughnessMap,g.roughnessMapTransform)),m.envMap&&(g.envMapIntensity.value=m.envMapIntensity)}function f(g,m,v){g.ior.value=m.ior,m.sheen>0&&(g.sheenColor.value.copy(m.sheenColor).multiplyScalar(m.sheen),g.sheenRoughness.value=m.sheenRoughness,m.sheenColorMap&&(g.sheenColorMap.value=m.sheenColorMap,t(m.sheenColorMap,g.sheenColorMapTransform)),m.sheenRoughnessMap&&(g.sheenRoughnessMap.value=m.sheenRoughnessMap,t(m.sheenRoughnessMap,g.sheenRoughnessMapTransform))),m.clearcoat>0&&(g.clearcoat.value=m.clearcoat,g.clearcoatRoughness.value=m.clearcoatRoughness,m.clearcoatMap&&(g.clearcoatMap.value=m.clearcoatMap,t(m.clearcoatMap,g.clearcoatMapTransform)),m.clearcoatRoughnessMap&&(g.clearcoatRoughnessMap.value=m.clearcoatRoughnessMap,t(m.clearcoatRoughnessMap,g.clearcoatRoughnessMapTransform)),m.clearcoatNormalMap&&(g.clearcoatNormalMap.value=m.clearcoatNormalMap,t(m.clearcoatNormalMap,g.clearcoatNormalMapTransform),g.clearcoatNormalScale.value.copy(m.clearcoatNormalScale),m.side===yn&&g.clearcoatNormalScale.value.negate())),m.dispersion>0&&(g.dispersion.value=m.dispersion),m.iridescence>0&&(g.iridescence.value=m.iridescence,g.iridescenceIOR.value=m.iridescenceIOR,g.iridescenceThicknessMinimum.value=m.iridescenceThicknessRange[0],g.iridescenceThicknessMaximum.value=m.iridescenceThicknessRange[1],m.iridescenceMap&&(g.iridescenceMap.value=m.iridescenceMap,t(m.iridescenceMap,g.iridescenceMapTransform)),m.iridescenceThicknessMap&&(g.iridescenceThicknessMap.value=m.iridescenceThicknessMap,t(m.iridescenceThicknessMap,g.iridescenceThicknessMapTransform))),m.transmission>0&&(g.transmission.value=m.transmission,g.transmissionSamplerMap.value=v.texture,g.transmissionSamplerSize.value.set(v.width,v.height),m.transmissionMap&&(g.transmissionMap.value=m.transmissionMap,t(m.transmissionMap,g.transmissionMapTransform)),g.thickness.value=m.thickness,m.thicknessMap&&(g.thicknessMap.value=m.thicknessMap,t(m.thicknessMap,g.thicknessMapTransform)),g.attenuationDistance.value=m.attenuationDistance,g.attenuationColor.value.copy(m.attenuationColor)),m.anisotropy>0&&(g.anisotropyVector.value.set(m.anisotropy*Math.cos(m.anisotropyRotation),m.anisotropy*Math.sin(m.anisotropyRotation)),m.anisotropyMap&&(g.anisotropyMap.value=m.anisotropyMap,t(m.anisotropyMap,g.anisotropyMapTransform))),g.specularIntensity.value=m.specularIntensity,g.specularColor.value.copy(m.specularColor),m.specularColorMap&&(g.specularColorMap.value=m.specularColorMap,t(m.specularColorMap,g.specularColorMapTransform)),m.specularIntensityMap&&(g.specularIntensityMap.value=m.specularIntensityMap,t(m.specularIntensityMap,g.specularIntensityMapTransform))}function p(g,m){m.matcap&&(g.matcap.value=m.matcap)}function _(g,m){const v=e.get(m).light;g.referencePosition.value.setFromMatrixPosition(v.matrixWorld),g.nearDistance.value=v.shadow.camera.near,g.farDistance.value=v.shadow.camera.far}return{refreshFogUniforms:n,refreshMaterialUniforms:r}}function pR(i,e,t,n){let r={},s={},a=[];const o=i.getParameter(i.MAX_UNIFORM_BUFFER_BINDINGS);function l(v,b){const y=b.program;n.uniformBlockBinding(v,y)}function c(v,b){let y=r[v.id];y===void 0&&(p(v),y=u(v),r[v.id]=y,v.addEventListener("dispose",g));const T=b.program;n.updateUBOMapping(v,T);const S=e.render.frame;s[v.id]!==S&&(d(v),s[v.id]=S)}function u(v){const b=h();v.__bindingPointIndex=b;const y=i.createBuffer(),T=v.__size,S=v.usage;return i.bindBuffer(i.UNIFORM_BUFFER,y),i.bufferData(i.UNIFORM_BUFFER,T,S),i.bindBuffer(i.UNIFORM_BUFFER,null),i.bindBufferBase(i.UNIFORM_BUFFER,b,y),y}function h(){for(let v=0;v<o;v++)if(a.indexOf(v)===-1)return a.push(v),v;return Oe("WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function d(v){const b=r[v.id],y=v.uniforms,T=v.__cache;i.bindBuffer(i.UNIFORM_BUFFER,b);for(let S=0,R=y.length;S<R;S++){const x=Array.isArray(y[S])?y[S]:[y[S]];for(let M=0,A=x.length;M<A;M++){const I=x[M];if(f(I,S,M,T)===!0){const N=I.__offset,U=Array.isArray(I.value)?I.value:[I.value];let k=0;for(let L=0;L<U.length;L++){const F=U[L],O=_(F);typeof F=="number"||typeof F=="boolean"?(I.__data[0]=F,i.bufferSubData(i.UNIFORM_BUFFER,N+k,I.__data)):F.isMatrix3?(I.__data[0]=F.elements[0],I.__data[1]=F.elements[1],I.__data[2]=F.elements[2],I.__data[3]=0,I.__data[4]=F.elements[3],I.__data[5]=F.elements[4],I.__data[6]=F.elements[5],I.__data[7]=0,I.__data[8]=F.elements[6],I.__data[9]=F.elements[7],I.__data[10]=
4104F.elements[8],I.__data[11]=0):ArrayBuffer.isView(F)?I.__data.set(new F.constructor(F.buffer,F.byteOffset,I.__data.length)):(F.toArray(I.__data,k),k+=O.storage/Float32Array.BYTES_PER_ELEMENT)}i.bufferSubData(i.UNIFORM_BUFFER,N,I.__data)}}}i.bindBuffer(i.UNIFORM_BUFFER,null)}function f(v,b,y,T){const S=v.value,R=b+"_"+y;if(T[R]===void 0)return typeof S=="number"||typeof S=="boolean"?T[R]=S:ArrayBuffer.isView(S)?T[R]=S.slice():T[R]=S.clone(),!0;{const x=T[R];if(typeof S=="number"||typeof S=="boolean"){if(x!==S)return T[R]=S,!0}else{if(ArrayBuffer.isView(S))return!0;if(x.equals(S)===!1)return x.copy(S),!0}}return!1}function p(v){const b=v.uniforms;let y=0;const T=16;for(let R=0,x=b.length;R<x;R++){const M=Array.isArray(b[R])?b[R]:[b[R]];for(let A=0,I=M.length;A<I;A++){const N=M[A],U=Array.isArray(N.value)?N.value:[N.value];for(let k=0,L=U.length;k<L;k++){const F=U[k],O=_(F),X=y%T,$=X%O.boundary,te=X+$;y+=$,te!==0&&T-te<O.storage&&(y+=T-te),N.__data=new Float32Array(O.storage/Float32Array.BYTES_PER_ELEMENT),N.__offset=y,y+=O.storage}}}const S=y%T;return S>0&&(y+=T-S),v.__size=y,v.__cache={},this}function _(v){const b={boundary:0,storage:0};return typeof v=="number"||typeof v=="boolean"?(b.boundary=4,b.storage=4):v.isVector2?(b.boundary=8,b.storage=8):v.isVector3||v.isColor?(b.boundary=16,b.storage=12):v.isVector4?(b.boundary=16,b.storage=16):v.isMatrix3?(b.boundary=48,b.storage=48):v.isMatrix4?(b.boundary=64,b.storage=64):v.isTexture?_e("WebGLRenderer: Texture samplers can not be part of an uniforms group."):ArrayBuffer.isView(v)?(b.boundary=16,b.storage=v.byteLength):_e("WebGLRenderer: Unsupported uniform value type.",v),b}function g(v){const b=v.target;b.removeEventListener("dispose",g);const y=a.indexOf(b.__bindingPointIndex);a.splice(y,1),i.deleteBuffer(r[b.id]),delete r[b.id],delete s[b.id]}function m(){for(const v in r)i.deleteBuffer(r[v]);a=[],r={},s={}}return{bind:l,update:c,dispose:m}}const mR=new Uint16Array([12469,15057,12620,14925,13266,14620,13807,14376,14323,13990,14545,13625,14713,13328,14840,12882,14931,12528,14996,12233,15039,11829,15066,11525,15080,11295,15085,10976,15082,10705,15073,10495,13880,14564,13898,14542,13977,14430,14158,14124,14393,13732,14556,13410,14702,12996,14814,12596,14891,12291,14937,11834,14957,11489,14958,11194,14943,10803,14921,10506,14893,10278,14858,9960,14484,14039,14487,14025,14499,13941,14524,13740,14574,13468,14654,13106,14743,12678,14818,12344,14867,11893,14889,11509,14893,11180,14881,10751,14852,10428,14812,10128,14765,9754,14712,9466,14764,13480,14764,13475,14766,13440,14766,13347,14769,13070,14786,12713,14816,12387,14844,11957,14860,11549,14868,11215,14855,10751,14825,10403,14782,10044,14729,9651,14666,9352,14599,9029,14967,12835,14966,12831,14963,12804,14954,12723,14936,12564,14917,12347,14900,11958,14886,11569,14878,11247,14859,10765,14828,10401,14784,10011,14727,9600,14660,9289,14586,8893,14508,8533,15111,12234,15110,12234,15104,12216,15092,12156,15067,12010,15028,11776,14981,11500,
vendor: 17,734 bytes, line 4104
410414942,11205,14902,10752,14861,10393,14812,9991,14752,9570,14682,9252,14603,8808,14519,8445,14431,8145,15209,11449,15208,11451,15202,11451,15190,11438,15163,11384,15117,11274,15055,10979,14994,10648,14932,10343,14871,9936,14803,9532,14729,9218,14645,8742,14556,8381,14461,8020,14365,7603,15273,10603,15272,10607,15267,10619,15256,10631,15231,10614,15182,10535,15118,10389,15042,10167,14963,9787,14883,9447,14800,9115,14710,8665,14615,8318,14514,7911,14411,7507,14279,7198,15314,9675,15313,9683,15309,9712,15298,9759,15277,9797,15229,9773,15166,9668,15084,9487,14995,9274,14898,8910,14800,8539,14697,8234,14590,7790,14479,7409,14367,7067,14178,6621,15337,8619,15337,8631,15333,8677,15325,8769,15305,8871,15264,8940,15202,8909,15119,8775,15022,8565,14916,8328,14804,8009,14688,7614,14569,7287,14448,6888,14321,6483,14088,6171,15350,7402,15350,7419,15347,7480,15340,7613,15322,7804,15287,7973,15229,8057,15148,8012,15046,7846,14933,7611,14810,7357,14682,7069,14552,6656,14421,6316,14251,5948,14007,5528,15356,5942,15356,5977,15353,6119,15348,6294,15332,6551,15302,6824,15249,7044,15171,7122,15070,7050,14949,6861,14818,6611,14679,6349,14538,6067,14398,5651,14189,5311,13935,4958,15359,4123,15359,4153,15356,4296,15353,4646,15338,5160,15311,5508,15263,5829,15188,6042,15088,6094,14966,6001,14826,5796,14678,5543,14527,5287,14377,4985,14133,4586,13869,4257,15360,1563,15360,1642,15358,2076,15354,2636,15341,3350,15317,4019,15273,4429,15203,4732,15105,4911,14981,4932,14836,4818,14679,4621,14517,4386,14359,4156,14083,3795,13808,3437,15360,122,15360,137,15358,285,15355,636,15344,1274,15322,2177,15281,2765,15215,3223,15120,3451,14995,3569,14846,3567,14681,3466,14511,3305,14344,3121,14037,2800,13753,2467,15360,0,15360,1,15359,21,15355,89,15346,253,15325,479,15287,796,15225,1148,15133,1492,15008,1749,14856,1882,14685,1886,14506,1783,14324,1608,13996,1398,13702,1183]);let hi=null;function gR(){return hi===null&&(hi=new ti(mR,16,16,er,gi),hi.name="DFG_LUT",hi.minFilter=Lt,hi.magFilter=Lt,hi.wrapS=An,hi.wrapT=An,hi.generateMipmaps=!1,hi.needsUpdate=!0),hi}class qd{constructor(e={}){const{canvas:t=c_(),context:n=null,depth:r=!0,stencil:s=!1,alpha:a=!1,antialias:o=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:u="default",failIfMajorPerformanceCaveat:h=!1,reversedDepthBuffer:d=!1,outputBufferType:f=wn}=e;this.isWebGLRenderer=!0;let p;if(n!==null){if(typeof WebGLRenderingContext<"u"&&n instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");p=n.getContextAttributes().alpha}else p=a;const _=f,g=new Set([Cc,Ac,so]),m=new Set([wn,Gn,Is,Ps,Ec,Tc]),v=new Uint32Array(4),b=new Int32Array(4),y=new P;let T=null,S=null;const R=[],x=[];let M=null;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.toneMapping=ei,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const A=this;let I=!1,N=null;this._outputColorSpace=Tn;let U=0,k=0,L=null,F=-1,O=null;const X=new Et,$=new Et;let te=null;const ue=new Ee(0);let xe=0,He=t.width,Ke=t.height,qe=1,K=null,ye=null;const le=new Et(0,0,He,Ke),De=new Et(0,0,He,Ke);let Ne=!1;const Ge=new Ws;let ft=!1,Ye=!1;const Q=new We,se=new P,ee=new Et,pe={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let ve=!1;function Je(){return L===null?qe:1}let D=n;function nt(w,V){return t.getContext(w,V)}try{const w={alpha:!0,depth:r,stencil:s,antialias:o,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:u,failIfMajorPerformanceCaveat:h};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${io}`),t.addEventListener("webglcontextlost",ie,!1),t.addEventListener("webglcontextrestored",ke,!1),t.addEventListener("webglcontextcreationerror",rt,!1),D===null){const V="webgl2";if(D=nt(V,w),D===null)throw nt(V)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(w){throw Oe("WebGLRenderer: "+w.message),w}let Ue,je,oe,bt,C,E,z,Z,ne,ce,fe,q,J,Te,Re,me,he,it,ot,vt,B,de,Y;function we(){Ue=new _1(D),Ue.init(),B=new x0(D,Ue),je=new c1(D,Ue,e,B),oe=new aR(D,Ue),je.reversedDepthBuffer&&d&&oe.buffers.depth.setReversed(!0),bt=new y1(D),C=new qC,E=new oR(D,Ue,oe,C,je,B,bt),z=new g1(A),Z=new ET(D),de=new o1(D,Z),ne=new v1(D,Z,bt,de),ce=new S1(D,ne,Z,de,bt),it=new b1(D,je,E),Re=new u1(C),fe=new XC(A,z,Ue,je,de,Re),q=new fR(A,C),J=new YC,Te=new eR(Ue),he=new a1(A,z,oe,ce,p,l),me=new sR(A,ce,je),Y=new pR(D,bt,je,oe),ot=new l1(D,Ue,bt),vt=new x1(D,Ue,bt),bt.programs=fe.programs,A.capabilities=je,A.extensions=Ue,A.properties=C,A.renderLists=J,A.shadowMap=me,A.state=oe,A.info=bt}we(),_!==wn&&(M=new E1(_,t.width,t.height,r,s));const ge=new hR(A,D);this.xr=ge,this.getContext=function(){return D},this.getContextAttributes=function(){return D.getContextAttributes()},this.forceContextLoss=function(){const w=Ue.get("WEBGL_lose_context");w&&w.loseContext()},this.forceContextRestore=function(){const w=Ue.get("WEBGL_lose_context");w&&w.restoreContext()},this.getPixelRatio=function(){return qe},this.setPixelRatio=function(w){w!==void 0&&(qe=w,this.setSize(He,Ke,!1))},this.getSize=function(w){return w.set(He,Ke)},this.setSize=function(w,V,W=!0){if(ge.isPresenting){_e("WebGLRenderer: Can't change size while VR device is presenting.");return}He=w,Ke=V,t.width=Math.floor(w*qe),t.height=Math.floor(V*qe),W===!0&&(t.style.width=w+"px",t.style.height=V+"px"),M!==null&&M.setSize(t.width,t.height),this.setViewport(0,0,w,V)},this.getDrawingBufferSize=function(w){return w.set(He*qe,Ke*qe).floor()},this.setDrawingBufferSize=function(w,V,W){He=w,Ke=V,qe=W,t.width=Math.floor(w*W),t.height=Math.floor(V*W),this.setViewport(0,0,w,V)},this.setEffects=function(w){if(_===wn){Oe("THREE.WebGLRenderer: setEffects() requires outputBufferType set to HalfFloatType or FloatType.");return}if(w){for(let V=0;V<w.length;V++)if(w[V].isOutputPass===!0){_e("THREE.WebGLRenderer: OutputPass is not needed in setEffects(). Tone mapping and color space conversion are applied automatically.");break}}M.setEffects(w||[])},this.getCurrentViewport=function(w){return w.copy(X)},this.getViewport=function(w){return w.copy(le)},this.setViewport=function(w,V,W,H){w.isVector4?le.set(w.x,w.y,w.z,w.w):le.set(w,V,W,H),oe.viewport(X.copy(le).multiplyScalar(qe).round())},this.getScissor=function(w){return w.copy(De)},this.setScissor=function(w,V,W,H){w.isVector4?De.set(w.x,w.y,w.z,w.w):De.set(w,V,W,H),oe.scissor($.copy(De).multiplyScalar(qe).round())},this.getScissorTest=function(){return Ne},this.setScissorTest=function(w){oe.setScissorTest(Ne=w)},this.setOpaqueSort=function(w){K=w},this.setTransparentSort=function(w){ye=w},this.getClearColor=function(w){return w.copy(he.getClearColor())},this.setClearColor=function(){he.setClearColor(...arguments)},this.getClearAlpha=function(){return he.getClearAlpha()},this.setClearAlpha=function(){he.setClearAlpha(...arguments)},this.clear=function(w=!0,V=!0,W=!0){let H=0;if(w){let G=!1;if(L!==null){const Me=L.texture.format;G=g.has(Me)}if(G){const Me=L.texture.type,Ie=m.has(Me),Se=he.getClearColor(),Fe=he.getClearAlpha(),Ve=Se.r,st=Se.g,ct=Se.b;Ie?(v[0]=Ve,v[1]=st,v[2]=ct,v[3]=Fe,D.clearBufferuiv(D.COLOR,0,v)):(b[0]=Ve,b[1]=st,b[2]=ct,b[3]=Fe,D.clearBufferiv(D.COLOR,0,b))}else H|=D.COLOR_BUFFER_BIT}V&&(H|=D.DEPTH_BUFFER_BIT,this.state.buffers.depth.setMask(!0)),W&&(H|=D.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),H!==0&&D.clear(H)},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.setNodesHandler=function(w){w.setRenderer(this),N=w},this.dispose=function(){t.removeEventListener("webglcontextlost",ie,!1),t.removeEventListener("webglcontextrestored",ke,!1),t.removeEventListener("webglcontextcreationerror",rt,!1),he.dispose(),J.dispose(),Te.dispose(),C.dispose(),z.dispose(),ce.dispose(),de.dispose(),Y.dispose(),fe.dispose(),ge.dispose(),ge.removeEventListener("sessionstart",of),ge.removeEventListener("sessionend",lf),ar.stop()};function ie(w){w.preventDefault(),qa("WebGLRenderer: Context Lost."),I=!0}function ke(){qa("WebGLRenderer: Context Restored."),I=!1;const w=bt.autoReset,V=me.enabled,W=me.autoUpdate,H=me.needsUpdate,G=me.type;we(),bt.autoReset=w,me.enabled=V,me.autoUpdate=W,me.needsUpdate=H,me.type=G}function rt(w){Oe("WebGLRenderer: A WebGL context could not be created. Reason: ",w.statusMessage)}function Vt(w){const V=w.target;V.removeEventListener("dispose",Vt),Tt(V)}function Tt(w){xi(w),C.remove(w)}function xi(w){const V=C.get(w).programs;V!==void 0&&(V.forEach(function(W){fe.releaseProgram(W)}),w.isShaderMaterial&&fe.releaseShaderCache(w))}this.renderBufferDirect=function(w,V,W,H,G,Me){V===null&&(V=pe);const Ie=G.isMesh&&G.matrixWorld.determinant()<0,Se=Y0(w,V,W,H,G);oe.setMaterial(H,Ie);let Fe=W.index,Ve=1;if(H.wireframe===!0){if(Fe=ne.getWireframeAttribute(W),Fe===void 0)return;Ve=2}const st=W.drawRange,ct=W.attributes.position;let ze=st.start*Ve,wt=(st.start+st.count)*Ve;Me!==null&&(ze=Math.max(ze,Me.start*Ve),wt=Math.min(wt,(Me.start+Me.count)*Ve)),Fe!==null?(ze=Math.max(ze,0),wt=Math.min(wt,Fe.count)):ct!=null&&(ze=Math.max(ze,0),wt=Math.min(wt,ct.count));const zt=wt-ze;if(zt<0||zt===1/0)return;de.setup(G,H,Se,W,Fe);let Bt,Ct=ot;if(Fe!==null&&(Bt=Z.get(Fe),Ct=vt,Ct.setIndex(Bt)),G.isMesh)H.wireframe===!0?(oe.setLineWidth(H.wireframeLinewidth*Je()),Ct.setMode(D.LINES)):Ct.setMode(D.TRIANGLES);else if(G.isLine){let sn=H.linewidth;sn===void 0&&(sn=1),oe.setLineWidth(sn*Je()),G.isLineSegments?Ct.setMode(D.LINES):G.isLineLoop?Ct.setMode(D.LINE_LOOP):Ct.setMode(D.LINE_STRIP)}else G.isPoints?Ct.setMode(D.POINTS):G.isSprite&&Ct.setMode(D.TRIANGLES);if(G.isBatchedMesh)if(Ue.get("WEBGL_multi_draw"))Ct.renderMultiDraw(G._multiDrawStarts,G._multiDrawCounts,G._multiDrawCount);else{const sn=G._multiDrawStarts,Ae=G._multiDrawCounts,In=G._multiDrawCount,gt=Fe?Z.get(Fe).bytesPerElement:1,kn=C.get(H).currentProgram.getUniforms();for(let ai=0;ai<In;ai++)kn.setValue(D,"_gl_DrawID",ai),Ct.render(sn[ai]/gt,Ae[ai])}else if(G.isInstancedMesh)Ct.renderInstances(ze,zt,G.count);else if(W.isInstancedBufferGeometry){const sn=W._maxInstanceCount!==void 0?W._maxInstanceCount:1/0,Ae=Math.min(W.instanceCount,sn);Ct.renderInstances(ze,zt,Ae)}else Ct.render(ze,zt)};function si(w,V,W){w.transparent===!0&&w.side===jn&&w.forceSinglePass===!1?(w.side=yn,w.needsUpdate=!0,mo(w,V,W),w.side=Pi,w.needsUpdate=!0,mo(w,V,W),w.side=jn):mo(w,V,W)}this.compile=function(w,V,W=null){W===null&&(W=w),S=Te.get(W),S.init(V),x.push(S),W.traverseVisible(function(G){G.isLight&&G.layers.test(V.layers)&&(S.pushLight(G),G.castShadow&&S.pushShadow(G))}),w!==W&&w.traverseVisible(function(G){G.isLight&&G.layers.test(V.layers)&&(S.pushLight(G),G.castShadow&&S.pushShadow(G))}),S.setupLights();const H=new Set;return w.traverse(function(G){if(!(G.isMesh||G.isPoints||G.isLine||G.isSprite))return;const Me=G.material;if(Me)if(Array.isArray(Me))for(let Ie=0;Ie<Me.length;Ie++){const Se=Me[Ie];si(Se,W,G),H.add(Se)}else si(Me,W,G),H.add(Me)}),S=x.pop(),H},this.compileAsync=function(w,V,W=null){const H=this.compile(w,V,W);return new Promise(G=>{function Me(){if(H.forEach(function(Ie){C.get(Ie).currentProgram.isReady()&&H.delete(Ie)}),H.size===0){G(w);return}setTimeout(Me,10)}Ue.get("KHR_parallel_shader_compile")!==null?Me():setTimeout(Me,10)})};let ru=null;function q0(w){ru&&ru(w)}function of(){ar.stop()}function lf(){ar.start()}const ar=new f0;ar.setAnimationLoop(q0),typeof self<"u"&&ar.setContext(self),this.setAnimationLoop=function(w){ru=w,ge.setAnimationLoop(w),w===null?ar.stop():ar.start()},ge.addEventListener("sessionstart",of),ge.addEventListener("sessionend",lf),this.render=function(w,V){if(V!==void 0&&V.isCamera!==!0){Oe("WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(I===!0)return;N!==null&&N.renderStart(w,V);const W=ge.enabled===!0&&ge.isPresenting===!0,H=M!==null&&(L===null||W)&&M.begin(A,L);if(w.matrixWorldAutoUpdate===!0&&w.updateMatrixWorld(),V.parent===null&&V.matrixWorldAutoUpdate===!0&&V.updateMatrixWorld(),ge.enabled===!0&&ge.isPresenting===!0&&(M===null||M.isCompositing()===!1)&&(ge.cameraAutoUpdate===!0&&ge.updateCamera(V),V=ge.getCamera()),w.isScene===!0&&w.onBeforeRender(A,w,V,L),S=Te.get(w,x.length),S.init(V),S.state.textureUnits=E.getTextureUnits(),x.push(S),Q.multiplyMatrices(V.projectionMatrix,V.matrixWorldInverse),Ge.setFromProjectionMatrix(Q,Un,V.reversedDepth),Ye=this.localClippingEnabled,ft=Re.init(this.clippingPlanes,Ye),T=J.get(w,R.length),T.init(),R.push(T),ge.enabled===!0&&ge.isPresenting===!0){const Ie=A.xr.getDepthSensingMesh();Ie!==null&&su(Ie,V,-1/0,A.sortObjects)}su(w,V,0,A.sortObjects),T.finish(),A.sortObjects===!0&&T.sort(K,ye),ve=ge.enabled===!1||ge.isPresenting===!1||ge.hasDepthSensing()===!1,ve&&he.addToRenderList(T,w),this.info.render.frame++,ft===!0&&Re.beginShadows();const G=S.state.shadowsArray;if(me.render(G,w,V),ft===!0&&Re.endShadows(),this.info.autoReset===!0&&this.info.reset(),(H&&M.hasRenderPass())===!1){const Ie=T.opaque,Se=T.transmissive;if(S.setupLights(),V.isArrayCamera){const Fe=V.cameras;if(Se.length>0)for(let Ve=0,st=Fe.length;Ve<st;Ve++){const ct=Fe[Ve];uf(Ie,Se,w,ct)}ve&&he.render(w);for(let Ve=0,st=Fe.length;Ve<st;Ve++){const ct=Fe[Ve];cf(T,w,ct,ct.viewport)}}else Se.length>0&&uf(Ie,Se,w,V),ve&&he.render(w),cf(T,w,V)}L!==null&&k===0&&(E.updateMultisampleRenderTarget(L),E.updateRenderTargetMipmap(L)),H&&M.end(A),w.isScene===!0&&w.onAfterRender(A,w,V),de.resetDefaultState(),F=-1,O=null,x.pop(),x.length>0?(S=x[x.length-1],E.setTextureUnits(S.state.textureUnits),ft===!0&&Re.setGlobalState(A.clippingPlanes,S.state.camera)):S=null,R.pop(),R.length>0?T=R[R.length-1]:T=null,N!==null&&N.renderEnd()};function su(w,V,W,H){if(w.visible===!1)return;if(w.layers.test(V.layers)){if(w.isGroup)W=w.renderOrder;else if(w.isLOD)w.autoUpdate===!0&&w.update(V);else if(w.isLightProbeGrid)S.pushLightProbeGrid(w);else if(w.isLight)S.pushLight(w),w.castShadow&&S.pushShadow(w);else if(w.isSprite){if(!w.frustumCulled||Ge.intersectsSprite(w)){H&&ee.setFromMatrixPosition(w.matrixWorld).applyMatrix4(Q);const Ie=ce.update(w),Se=w.material;Se.visible&&T.push(w,Ie,Se,W,ee.z,null)}}else if((w.isMesh||w.isLine||w.isPoints)&&(!w.frustumCulled||Ge.intersectsObject(w))){const Ie=ce.update(w),Se=w.material;if(H&&(w.boundingSphere!==void 0?(w.boundingSphere===null&&w.computeBoundingSphere(),ee.copy(w.boundingSphere.center)):(Ie.boundingSphere===null&&Ie.computeBoundingSphere(),ee.copy(Ie.boundingSphere.center)),ee.applyMatrix4(w.matrixWorld).applyMatrix4(Q)),Array.isArray(Se)){const Fe=Ie.groups;for(let Ve=0,st=Fe.length;Ve<st;Ve++){const ct=Fe[Ve],ze=Se[ct.materialIndex];ze&&ze.visible&&T.push(w,Ie,ze,W,ee.z,ct)}}else Se.visible&&T.push(w,Ie,Se,W,ee.z,null)}}const Me=w.children;for(let Ie=0,Se=Me.length;Ie<Se;Ie++)su(Me[Ie],V,W,H)}function cf(w,V,W,H){const{opaque:G,transmissive:Me,transparent:Ie}=w;S.setupLightsView(W),ft===!0&&Re.setGlobalState(A.clippingPlanes,W),H&&oe.viewport(X.copy(H)),G.length>0&&po(G,V,W),Me.length>0&&po(Me,V,W),Ie.length>0&&po(Ie,V,W),oe.buffers.depth.setTest(!0),oe.buffers.depth.setMask(!0),oe.buffers.color.setMask(!0),oe.setPolygonOffset(!1)}function uf(w,V,W,H){if((W.isScene===!0?W.overrideMaterial:null)!==null)return;if(S.state.transmissionRenderTarget[H.id]===void 0){const ze=Ue.has("EXT_color_buffer_half_float")||Ue.has("EXT_color_buffer_float");S.state.transmissionRenderTarget[H.id]=new Bn(1,1,{generateMipmaps:!0,type:ze?gi:wn,minFilter:di,samples:Math.max(4,je.samples),stencilBuffer:s,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:dt.workingColorSpace})}const Me=S.state.transmissionRenderTarget[H.id],Ie=H.viewport||X;Me.setSize(Ie.z*A.transmissionResolutionScale,Ie.w*A.transmissionResolutionScale);const Se=A.getRenderTarget(),Fe=A.getActiveCubeFace(),Ve=A.getActiveMipmapLevel();A.setRenderTarget(Me),A.getClearColor(ue),xe=A.getClearAlpha(),xe<1&&A.setClearColor(16777215,.5),A.clear(),ve&&he.render(W);const st=A.toneMapping;A.toneMapping=ei;const ct=H.viewport;if(H.viewport!==void 0&&(H.viewport=void 0),S.setupLightsView(H),ft===!0&&Re.setGlobalState(A.clippingPlanes,H),po(w,W,H),E.updateMultisampleRenderTarget(Me),E.updateRenderTargetMipmap(Me),Ue.has("WEBGL_multisampled_render_to_texture")===!1){let ze=!1;for(let wt=0,zt=V.length;wt<zt;wt++){const Bt=V[wt],{object:Ct,geometry:sn,material:Ae,group:In}=Bt;if(Ae.side===jn&&Ct.layers.test(H.layers)){const gt=Ae.side;Ae.side=yn,Ae.needsUpdate=!0,hf(Ct,W,H,sn,Ae,In),Ae.side=gt,Ae.needsUpdate=!0,ze=!0}}ze===!0&&(E.updateMultisampleRenderTarget(Me),E.updateRenderTargetMipmap(Me))}A.setRenderTarget(Se,Fe,Ve),A.setClearColor(ue,xe),ct!==void 0&&(H.viewport=ct),A.toneMapping=st}function po(w,V,W){const H=V.isScene===!0?V.overrideMaterial:null;for(let G=0,Me=w.length;G<Me;G++){const Ie=w[G],{object:Se,geometry:Fe,group:Ve}=Ie;let st=Ie.material;st.allowOverride===!0&&H!==null&&(st=H),Se.layers.test(W.layers)&&hf(Se,V,W,Fe,st,Ve)}}function hf(w,V,W,H,G,Me){w.onBeforeRender(A,V,W,H,G,Me),w.modelViewMatrix.multiplyMatrices(W.matrixWorldInverse,w.matrixWorld),w.normalMatrix.getNormalMatrix(w.modelViewMatrix),G.onBeforeRender(A,V,W,H,w,Me),G.transparent===!0&&G.side===jn&&G.forceSinglePass===!1?(G.side=yn,G.needsUpdate=!0,A.renderBufferDirect(W,V,H,G,w,Me),G.side=Pi,G.needsUpdate=!0,A.renderBufferDirect(W,V,H,G,w,Me),G.side=jn):A.renderBufferDirect(W,V,H,G,w,Me),w.onAfterRender(A,V,W,H,G,Me)}function mo(w,V,W){V.isScene!==!0&&(V=pe);const H=C.get(w),G=S.state.lights,Me=S.state.shadowsArray,Ie=G.state.ver
vendor: 4,866 bytes, line 4104
4104sion,Se=fe.getParameters(w,G.state,Me,V,W,S.state.lightProbeGridArray),Fe=fe.getProgramCacheKey(Se);let Ve=H.programs;H.environment=w.isMeshStandardMaterial||w.isMeshLambertMaterial||w.isMeshPhongMaterial?V.environment:null,H.fog=V.fog;const st=w.isMeshStandardMaterial||w.isMeshLambertMaterial&&!w.envMap||w.isMeshPhongMaterial&&!w.envMap;H.envMap=z.get(w.envMap||H.environment,st),H.envMapRotation=H.environment!==null&&w.envMap===null?V.environmentRotation:w.envMapRotation,Ve===void 0&&(w.addEventListener("dispose",Vt),Ve=new Map,H.programs=Ve);let ct=Ve.get(Fe);if(ct!==void 0){if(H.currentProgram===ct&&H.lightsStateVersion===Ie)return ff(w,Se),ct}else Se.uniforms=fe.getUniforms(w),N!==null&&w.isNodeMaterial&&N.build(w,W,Se),w.onBeforeCompile(Se,A),ct=fe.acquireProgram(Se,Fe),Ve.set(Fe,ct),H.uniforms=Se.uniforms;const ze=H.uniforms;return(!w.isShaderMaterial&&!w.isRawShaderMaterial||w.clipping===!0)&&(ze.clippingPlanes=Re.uniform),ff(w,Se),H.needsLights=K0(w),H.lightsStateVersion=Ie,H.needsLights&&(ze.ambientLightColor.value=G.state.ambient,ze.lightProbe.value=G.state.probe,ze.directionalLights.value=G.state.directional,ze.directionalLightShadows.value=G.state.directionalShadow,ze.spotLights.value=G.state.spot,ze.spotLightShadows.value=G.state.spotShadow,ze.rectAreaLights.value=G.state.rectArea,ze.ltc_1.value=G.state.rectAreaLTC1,ze.ltc_2.value=G.state.rectAreaLTC2,ze.pointLights.value=G.state.point,ze.pointLightShadows.value=G.state.pointShadow,ze.hemisphereLights.value=G.state.hemi,ze.directionalShadowMatrix.value=G.state.directionalShadowMatrix,ze.spotLightMatrix.value=G.state.spotLightMatrix,ze.spotLightMap.value=G.state.spotLightMap,ze.pointShadowMatrix.value=G.state.pointShadowMatrix),H.lightProbeGrid=S.state.lightProbeGridArray.length>0,H.currentProgram=ct,H.uniformsList=null,ct}function df(w){if(w.uniformsList===null){const V=w.currentProgram.getUniforms();w.uniformsList=fl.seqWithValue(V.seq,w.uniforms)}return w.uniformsList}function ff(w,V){const W=C.get(w);W.outputColorSpace=V.outputColorSpace,W.batching=V.batching,W.batchingColor=V.batchingColor,W.instancing=V.instancing,W.instancingColor=V.instancingColor,W.instancingMorph=V.instancingMorph,W.skinning=V.skinning,W.morphTargets=V.morphTargets,W.morphNormals=V.morphNormals,W.morphColors=V.morphColors,W.morphTargetsCount=V.morphTargetsCount,W.numClippingPlanes=V.numClippingPlanes,W.numIntersection=V.numClipIntersection,W.vertexAlphas=V.vertexAlphas,W.vertexTangents=V.vertexTangents,W.toneMapping=V.toneMapping}function $0(w,V){if(w.length===0)return null;if(w.length===1)return w[0].texture!==null?w[0]:null;y.setFromMatrixPosition(V.matrixWorld);for(let W=0,H=w.length;W<H;W++){const G=w[W];if(G.texture!==null&&G.boundingBox.containsPoint(y))return G}return null}function Y0(w,V,W,H,G){V.isScene!==!0&&(V=pe),E.resetTextureUnits();const Me=V.fog,Ie=H.isMeshStandardMaterial||H.isMeshLambertMaterial||H.isMeshPhongMaterial?V.environment:null,Se=L===null?A.outputColorSpace:L.isXRRenderTarget===!0?L.texture.colorSpace:dt.workingColorSpace,Fe=H.isMeshStandardMaterial||H.isMeshLambertMaterial&&!H.envMap||H.isMeshPhongMaterial&&!H.envMap,Ve=z.get(H.envMap||Ie,Fe),st=H.vertexColors===!0&&!!W.attributes.color&&W.attributes.color.itemSize===4,ct=!!W.attributes.tangent&&(!!H.normalMap||H.anisotropy>0),ze=!!W.morphAttributes.position,wt=!!W.morphAttributes.normal,zt=!!W.morphAttributes.color;let Bt=ei;H.toneMapped&&(L===null||L.isXRRenderTarget===!0)&&(Bt=A.toneMapping);const Ct=W.morphAttributes.position||W.morphAttributes.normal||W.morphAttributes.color,sn=Ct!==void 0?Ct.length:0,Ae=C.get(H),In=S.state.lights;if(ft===!0&&(Ye===!0||w!==O)){const It=w===O&&H.id===F;Re.setState(H,w,It)}let gt=!1;H.version===Ae.__version?(Ae.needsLights&&Ae.lightsStateVersion!==In.state.version||Ae.outputColorSpace!==Se||G.isBatchedMesh&&Ae.batching===!1||!G.isBatchedMesh&&Ae.batching===!0||G.isBatchedMesh&&Ae.batchingColor===!0&&G.colorTexture===null||G.isBatchedMesh&&Ae.batchingColor===!1&&G.colorTexture!==null||G.isInstancedMesh&&Ae.instancing===!1||!G.isInstancedMesh&&Ae.instancing===!0||G.isSkinnedMesh&&Ae.skinning===!1||!G.isSkinnedMesh&&Ae.skinning===!0||G.isInstancedMesh&&Ae.instancingColor===!0&&G.instanceColor===null||G.isInstancedMesh&&Ae.instancingColor===!1&&G.instanceColor!==null||G.isInstancedMesh&&Ae.instancingMorph===!0&&G.morphTexture===null||G.isInstancedMesh&&Ae.instancingMorph===!1&&G.morphTexture!==null||Ae.envMap!==Ve||H.fog===!0&&Ae.fog!==Me||Ae.numClippingPlanes!==void 0&&(Ae.numClippingPlanes!==Re.numPlanes||Ae.numIntersection!==Re.numIntersection)||Ae.vertexAlphas!==st||Ae.vertexTangents!==ct||Ae.morphTargets!==ze||Ae.morphNormals!==wt||Ae.morphColors!==zt||Ae.toneMapping!==Bt||Ae.morphTargetsCount!==sn||!!Ae.lightProbeGrid!=S.state.lightProbeGridArray.length>0)&&(gt=!0):(gt=!0,Ae.__version=H.version);let kn=Ae.currentProgram;
4104gt===!0&&(kn=mo(H,V,G),N&&H.isNodeMaterial&&N.onUpdateProgram(H,kn,Ae));let ai=!1,Ui=!1,Wr=!1;const Rt=kn.getUniforms(),Ht=Ae.uniforms;if(oe.useProgram(kn.program)&&(ai=!0,Ui=!0,Wr=!0),H.id!==F&&(F=H.id,Ui=!0),Ae.needsLights){const It=$0(S.state.lightProbeGridArray,G);Ae.lightProbeGrid!==It&&(Ae.lightProbeGrid=It,Ui=!0)}if(ai||O!==w){oe.buffers.depth.getReversed()&&w.reversedDepth!==!0&&(w._reversedDepth=!0,w.updateProjectionMatrix()),Rt.setValue(D,"projectionMatrix",w.projectionMatrix),Rt.setValue(D,"viewMatrix",w.matrixWorldInverse);const Bi=Rt.map.cameraPosition;Bi!==void 0&&Bi.setValue(D,se.setFromMatrixPosition(w.matrixWorld)),je.logarithmicDepthBuffer&&Rt.setValue(D,"logDepthBufFC",2/(Math.log(w.far+1)/Math.LN2)),(H.isMeshPhongMaterial||H.isMeshToonMaterial||H.isMeshLambertMaterial||H.isMeshBasicMaterial||H.isMeshStandardMaterial||H.isShaderMaterial)&&Rt.setValue(D,"isOrthographic",w.isOrthographicCamera===!0),O!==w&&(O=w,Ui=!0,Wr=!0)}if(Ae.needsLights&&(In.state.directionalShadowMap.length>0&&Rt.setValue(D,"directionalShadowMap",In.state.directionalShadowMap,E),In.state.spotShadowMap.length>0&&Rt.setValue(D,"spotShadowMap",In.state.spotShadowMap,E),In.state.pointShadowMap.length>0&&Rt.setValue(D,"pointShadowMap",In.state.pointShadowMap,E)),G.isSkinnedMesh){Rt.setOptional(D,G,"bindMatrix"),Rt.setOptional(D,G,"bindMatrixInverse");const It=G.skeleton;It&&(It.boneTexture===null&&It.computeBoneTexture(),Rt.setValue(D,"boneTexture",It.boneTexture,E))}G.isBatchedMesh&&(Rt.setOptional(D,G,"batchingTexture"),Rt.setValue(D,"batchingTexture",G._matricesTexture,E),Rt.setOptional(D,G,"batchingIdTexture"),Rt.setValue(D,"batchingIdTexture",G._indirectTexture,E),Rt.setOptional(D,G,"batchingColorTexture"),G._colorsTexture!==null&&Rt.setValue(D,"batchingColorTexture",G._colorsTexture,E));const Fi=W.morphAttributes;if((Fi.position!==void 0||Fi.normal!==void 0||Fi.color!==void 0)&&it.update(G,W,kn),(Ui||Ae.receiveShadow!==G.receiveShadow)&&(Ae.receiveShadow=G.receiveShadow,Rt.setValue(D,"receiveShadow",G.receiveShadow)),(H.isMeshStandardMaterial||H.isMeshLambertMaterial||H.isMeshPhongMaterial)&&H.envMap===null&&V.environment!==null&&(Ht.envMapIntensity.value=V.environmentIntensity),Ht.dfgLUT!==void 0&&(Ht.dfgLUT.value=gR()),Ui){if(Rt.setValue(D,"toneMappingExposure",A.toneMappingExposure),Ae.needsLights&&Z0(Ht,Wr),Me&&H.fog===!0&&q.refreshFogUniforms(Ht,Me),q.refreshMaterialUniforms(Ht,H,qe,Ke,S.state.transmissionRenderTarget[w.id]),Ae.needsLights&&Ae.lightProbeGrid){const It=Ae.lightProbeGrid;Ht.probesSH.value=It.texture,Ht.probesMin.value.copy(It.boundingBox.min),Ht.probesMax.value.copy(It.boundingBox.max),Ht.probesResolution.value.copy(It.resolution)}fl.upload(D,df(Ae),Ht,E)}if(H.isShaderMaterial&&H.uniformsNeedUpdate===!0&&(fl.upload(D,df(Ae),Ht,E),H.uniformsNeedUpdate=!1),H.isSpriteMaterial&&Rt.setValue(D,"center",G.center),Rt.setValue(D,"modelViewMatrix",G.modelViewMatrix),Rt.setValue(D,"normalMatrix",G.normalMatrix),Rt.setValue(D,"modelMatrix",G.matrixWorld),H.uniformsGroups!==void 0){const It=H.uniformsGroups;for(let Bi=0,Xr=It.length;Bi<Xr;Bi++){const pf=It[Bi];Y.update(pf,kn),Y.bind(pf,kn)}}return kn}function Z0(w,V){w.ambientLightColor.needsUpdate=V,w.lightProbe.needsUpdate=V,w.directionalLights.needsUpdate=V,w.directionalLightShadows.needsUpdate=V,w.pointLights.needsUpdate=V,w.pointLightShadows.needsUpdate=V,w.spotLights.needsUpdate=V,w.spotLightShadows.needsUpdate=V,w.rectAreaLights.needsUpdate=V,w.hemisphereLights.needsUpdate=V}function K0(w){return w.isMeshLambertMaterial||w.isMeshToonMaterial||w.isMeshPhongMaterial||w.isMeshStandardMaterial||w.isShadowMaterial||w.isShaderMaterial&&w.lights===!0}this.getActiveCubeFace=function(){return U},this.getActiveMipmapLevel=function(){return k},this.getRenderTarget=function(){return L},this.setRenderTargetTextures=function(w,V,W){const H=C.get(w);H.__autoAllocateDepthBuffer=w.resolveDepthBuffer===!1,H.__autoAllocateDepthBuffer===!1&&(H.__useRenderToTexture=!1),C.get(w.texture).__webglTexture=V,C.get(w.depthTexture).__webglTexture=H.__autoAllocateDepthBuffer?void 0:W,H.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(w,V){const W=C.get(w);W.__webglFramebuffer=V,W.__useDefaultFramebuffer=V===void 0};const J0=D.createFramebuffer();this.setRenderTarget=function(w,V=0,W=0){L=w,U=V,k=W;let H=null,G=!1,Me=!1;if(w){const Se=C.get(w);if(Se.__useDefaultFramebuffer!==void 0){oe.bindFramebuffer(D.FRAMEBUFFER,Se.__webglFramebuffer),X.copy(w.viewport),$.copy(w.scissor),te=w.scissorTest,oe.viewport(X),oe.scissor($),oe.setScissorTest(te),F=-1;return}else if(Se.__webglFramebuffer===void 0)E.setupRenderTarget(w);else if(Se.__hasExternalTextures)E.rebindTextures(w,C.get(w.texture).__webglTexture,C.get(w.depthTexture).__webglTexture);else if(w.depthBuffer){const st=w.depthTexture;if(Se.__boundDepthTexture!==st){if(st!==null&&C.has(st)&&(w.width!==st.image.width||w.height!==st.image.height))throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");E.setupDepthRenderbuffer(w)}}const Fe=w.texture;(Fe.isData3DTexture||Fe.isDataArrayTexture||Fe.isCompressedArrayTexture)&&(Me=!0);const Ve=C.get(w).__webglFramebuffer;
vendor: 9,311 bytes, line 4104
4104w.isWebGLCubeRenderTarget?(Array.isArray(Ve[V])?H=Ve[V][W]:H=Ve[V],G=!0):w.samples>0&&E.useMultisampledRTT(w)===!1?H=C.get(w).__webglMultisampledFramebuffer:Array.isArray(Ve)?H=Ve[W]:H=Ve,X.copy(w.viewport),$.copy(w.scissor),te=w.scissorTest}else X.copy(le).multiplyScalar(qe).floor(),$.copy(De).multiplyScalar(qe).floor(),te=Ne;if(W!==0&&(H=J0),oe.bindFramebuffer(D.FRAMEBUFFER,H)&&oe.drawBuffers(w,H),oe.viewport(X),oe.scissor($),oe.setScissorTest(te),G){const Se=C.get(w.texture);D.framebufferTexture2D(D.FRAMEBUFFER,D.COLOR_ATTACHMENT0,D.TEXTURE_CUBE_MAP_POSITIVE_X+V,Se.__webglTexture,W)}else if(Me){const Se=V;for(let Fe=0;Fe<w.textures.length;Fe++){const Ve=C.get(w.textures[Fe]);D.framebufferTextureLayer(D.FRAMEBUFFER,D.COLOR_ATTACHMENT0+Fe,Ve.__webglTexture,W,Se)}}else if(w!==null&&W!==0){const Se=C.get(w.texture);D.framebufferTexture2D(D.FRAMEBUFFER,D.COLOR_ATTACHMENT0,D.TEXTURE_2D,Se.__webglTexture,W)}F=-1},this.readRenderTargetPixels=function(w,V,W,H,G,Me,Ie,Se=0){if(!(w&&w.isWebGLRenderTarget)){Oe("WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let Fe=C.get(w).__webglFramebuffer;if(w.isWebGLCubeRenderTarget&&Ie!==void 0&&(Fe=Fe[Ie]),Fe){oe.bindFramebuffer(D.FRAMEBUFFER,Fe);try{const Ve=w.textures[Se],st=Ve.format,ct=Ve.type;if(w.textures.length>1&&D.readBuffer(D.COLOR_ATTACHMENT0+Se),!je.textureFormatReadable(st)){Oe("WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!je.textureTypeReadable(ct)){Oe("WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}V>=0&&V<=w.width-H&&W>=0&&W<=w.height-G&&D.readPixels(V,W,H,G,B.convert(st),B.convert(ct),Me)}finally{const Ve=L!==null?C.get(L).__webglFramebuffer:null;oe.bindFramebuffer(D.FRAMEBUFFER,Ve)}}},this.readRenderTargetPixelsAsync=async function(w,V,W,H,G,Me,Ie,Se=0){if(!(w&&w.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let Fe=C.get(w).__webglFramebuffer;if(w.isWebGLCubeRenderTarget&&Ie!==void 0&&(Fe=Fe[Ie]),Fe)if(V>=0&&V<=w.width-H&&W>=0&&W<=w.height-G){oe.bindFramebuffer(D.FRAMEBUFFER,Fe);const Ve=w.textures[Se],st=Ve.format,ct=Ve.type;if(w.textures.length>1&&D.readBuffer(D.COLOR_ATTACHMENT0+Se),!je.textureFormatReadable(st))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!je.textureTypeReadable(ct))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const ze=D.createBuffer();D.bindBuffer(D.PIXEL_PACK_BUFFER,ze),D.bufferData(D.PIXEL_PACK_BUFFER,Me.byteLength,D.STREAM_READ),D.readPixels(V,W,H,G,B.convert(st),B.convert(ct),0);const wt=L!==null?C.get(L).__webglFramebuffer:null;oe.bindFramebuffer(D.FRAMEBUFFER,wt);const zt=D.fenceSync(D.SYNC_GPU_COMMANDS_COMPLETE,0);return D.flush(),await ES(D,zt,4),D.bindBuffer(D.PIXEL_PACK_BUFFER,ze),D.getBufferSubData(D.PIXEL_PACK_BUFFER,0,Me),D.deleteBuffer(ze),D.deleteSync(zt),Me}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(w,V=null,W=0){const H=Math.pow(2,-W),G=Math.floor(w.image.width*H),Me=Math.floor(w.image.height*H),Ie=V!==null?V.x:0,Se=V!==null?V.y:0;E.setTexture2D(w,0),D.copyTexSubImage2D(D.TEXTURE_2D,W,0,0,Ie,Se,G,Me),oe.unbindTexture()};const j0=D.createFramebuffer(),Q0=D.createFramebuffer();this.copyTextureToTexture=function(w,V,W=null,H=null,G=0,Me=0){let Ie,Se,Fe,Ve,st,ct,ze,wt,zt;const Bt=w.isCompressedTexture?w.mipmaps[Me]:w.image;if(W!==null)Ie=W.max.x-W.min.x,Se=W.max.y-W.min.y,Fe=W.isBox3?W.max.z-W.min.z:1,Ve=W.min.x,st=W.min.y,ct=W.isBox3?W.min.z:0;else{const Ht=Math.pow(2,-G);Ie=Math.floor(Bt.width*Ht),Se=Math.floor(Bt.height*Ht),w.isDataArrayTexture?Fe=Bt.depth:w.isData3DTexture?Fe=Math.floor(Bt.depth*Ht):Fe=1,Ve=0,st=0,ct=0}H!==null?(ze=H.x,wt=H.y,zt=H.z):(ze=0,wt=0,zt=0);const Ct=B.convert(V.format),sn=B.convert(V.type);let Ae;V.isData3DTexture?(E.setTexture3D(V,0),Ae=D.TEXTURE_3D):V.isDataArrayTexture||V.isCompressedArrayTexture?(E.setTexture2DArray(V,0),Ae=D.TEXTURE_2D_ARRAY):(E.setTexture2D(V,0),Ae=D.TEXTURE_2D),oe.activeTexture(D.TEXTURE0),oe.pixelStorei(D.UNPACK_FLIP_Y_WEBGL,V.flipY),oe.pixelStorei(D.UNPACK_PREMULTIPLY_ALPHA_WEBGL,V.premultiplyAlpha),oe.pixelStorei(D.UNPACK_ALIGNMENT,V.unpackAlignment);const In=oe.getParameter(D.UNPACK_ROW_LENGTH),gt=oe.getParameter(D.UNPACK_IMAGE_HEIGHT),kn=oe.getParameter(D.UNPACK_SKIP_PIXELS),ai=oe.getParameter(D.UNPACK_SKIP_ROWS),Ui=oe.getParameter(D.UNPACK_SKIP_IMAGES);oe.pixelStorei(D.UNPACK_ROW_LENGTH,Bt.width),oe.pixelStorei(D.UNPACK_IMAGE_HEIGHT,Bt.height),oe.pixelStorei(D.UNPACK_SKIP_PIXELS,Ve),oe.pixelStorei(D.UNPACK_SKIP_ROWS,st),oe.pixelStorei(D.UNPACK_SKIP_IMAGES,ct);const Wr=w.isDataArrayTexture||w.isData3DTexture,Rt=V.isDataArrayTexture||V.isData3DTexture;if(w.isDepthTexture){const Ht=C.get(w),Fi=C.get(V),It=C.get(Ht.__renderTarget),Bi=C.get(Fi.__renderTarget);oe.bindFramebuffer(D.READ_FRAMEBUFFER,It.__webglFramebuffer),oe.bindFramebuffer(D.DRAW_FRAMEBUFFER,Bi.__webglFramebuffer);for(let Xr=0;Xr<Fe;Xr++)Wr&&(D.framebufferTextureLayer(D.READ_FRAMEBUFFER,D.COLOR_ATTACHMENT0,C.get(w).__webglTexture,G,ct+Xr),D.framebufferTextureLayer(D.DRAW_FRAMEBUFFER,D.COLOR_ATTACHMENT0,C.get(V).__webglTexture,Me,zt+Xr)),D.blitFramebuffer(Ve,st,Ie,Se,ze,wt,Ie,Se,D.DEPTH_BUFFER_BIT,D.NEAREST);oe.bindFramebuffer(D.READ_FRAMEBUFFER,null),oe.bindFramebuffer(D.DRAW_FRAMEBUFFER,null)}else if(G!==0||w.isRenderTargetTexture||C.has(w)){const Ht=C.get(w),Fi=C.get(V);oe.bindFramebuffer(D.READ_FRAMEBUFFER,j0),oe.bindFramebuffer(D.DRAW_FRAMEBUFFER,Q0);for(let It=0;It<Fe;It++)Wr?D.framebufferTextureLayer(D.READ_FRAMEBUFFER,D.COLOR_ATTACHMENT0,Ht.__webglTexture,G,ct+It):D.framebufferTexture2D(D.READ_FRAMEBUFFER,D.COLOR_ATTACHMENT0,D.TEXTURE_2D,Ht.__webglTexture,G),Rt?D.framebufferTextureLayer(D.DRAW_FRAMEBUFFER,D.COLOR_ATTACHMENT0,Fi.__webglTexture,Me,zt+It):D.framebufferTexture2D(D.DRAW_FRAMEBUFFER,D.COLOR_ATTACHMENT0,D.TEXTURE_2D,Fi.__webglTexture,Me),G!==0?D.blitFramebuffer(Ve,st,Ie,Se,ze,wt,Ie,Se,D.COLOR_BUFFER_BIT,D.NEAREST):Rt?D.copyTexSubImage3D(Ae,Me,ze,wt,zt+It,Ve,st,Ie,Se):D.copyTexSubImage2D(Ae,Me,ze,wt,Ve,st,Ie,Se);oe.bindFramebuffer(D.READ_FRAMEBUFFER,null),oe.bindFramebuffer(D.DRAW_FRAMEBUFFER,null)}else Rt?w.isDataTexture||w.isData3DTexture?D.texSubImage3D(Ae,Me,ze,wt,zt,Ie,Se,Fe,Ct,sn,Bt.data):V.isCompressedArrayTexture?D.compressedTexSubImage3D(Ae,Me,ze,wt,zt,Ie,Se,Fe,Ct,Bt.data):D.texSubImage3D(Ae,Me,ze,wt,zt,Ie,Se,Fe,Ct,sn,Bt):w.isDataTexture?D.texSubImage2D(D.TEXTURE_2D,Me,ze,wt,Ie,Se,Ct,sn,Bt.data):w.isCompressedTexture?D.compressedTexSubImage2D(D.TEXTURE_2D,Me,ze,wt,Bt.width,Bt.height,Ct,Bt.data):D.texSubImage2D(D.TEXTURE_2D,Me,ze,wt,Ie,Se,Ct,sn,Bt);oe.pixelStorei(D.UNPACK_ROW_LENGTH,In),oe.pixelStorei(D.UNPACK_IMAGE_HEIGHT,gt),oe.pixelStorei(D.UNPACK_SKIP_PIXELS,kn),oe.pixelStorei(D.UNPACK_SKIP_ROWS,ai),oe.pixelStorei(D.UNPACK_SKIP_IMAGES,Ui),Me===0&&V.generateMipmaps&&D.generateMipmap(Ae),oe.unbindTexture()},this.initRenderTarget=function(w){C.get(w).__webglFramebuffer===void 0&&E.setupRenderTarget(w)},this.initTexture=function(w){w.isCubeTexture?E.setTextureCube(w,0):w.isData3DTexture?E.setTexture3D(w,0):w.isDataArrayTexture||w.isCompressedArrayTexture?E.setTexture2DArray(w,0):E.setTexture2D(w,0),oe.unbindTexture()},this.resetState=function(){U=0,k=0,L=null,oe.reset(),de.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Un}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=dt._getDrawingBufferColorSpace(e),t.unpackColorSpace=dt._getUnpackColorSpace()}}const _R=Object.freeze(Object.defineProperty({__proto__:null,ACESFilmicToneMapping:bc,AddEquation:qi,AddOperation:Yg,AdditiveAnimationBlendMode:md,AdditiveBlending:fh,AgXToneMapping:ad,AlphaFormat:fd,AlwaysCompare:a_,AlwaysDepth:Ml,AlwaysStencilFunc:vh,AmbientLight:e0,AnimationAction:c0,AnimationClip:ja,AnimationLoader:mE,AnimationMixer:XE,AnimationObjectGroup:GE,AnimationUtils:hE,ArcCurve:E_,ArrayCamera:a0,ArrowHelper:mT,AttachedBindMode:gh,Audio:o0,AudioAnalyser:NE,AudioContext:Vd,AudioListener:IE,AudioLoader:wE,AxesHelper:gT,BackSide:yn,BasicDepthPacking:Qg,BasicShadowMap:Lb,BatchedMesh:x_,BezierInterpolant:$_,Bone:bd,BooleanKeyframeTrack:zr,Box2:QE,Box3:hn,Box3Helper:fT,BoxGeometry:Vr,BoxHelper:dT,BufferAttribute:ut,BufferGeometry:et,BufferGeometryLoader:r0,ByteType:cd,Cache:fi,Camera:eu,CameraHelper:hT,CanvasTexture:IM,CapsuleGeometry:zc,CatmullRomCurve3:T_,CineonToneMapping:rd,CircleGeometry:Hc,ClampToEdgeWrapping:An,Clock:h0,Color:Ee,ColorKeyframeTrack:Ud,ColorManagement:dt,Compatibility:xS,CompressedArrayTexture:CM,CompressedCubeTexture:RM,CompressedTexture:Vc,CompressedTextureLoader:gE,ConeGeometry:co,ConstantAlphaFactor:Xg,ConstantColorFactor:Gg,Controls:vT,CubeCamera:s0,CubeDepthTexture:S_,CubeReflectionMapping:mi,CubeRefractionMapping:Qi,CubeTexture:oo,CubeTextureLoader:_E,CubeUVReflectionMapping:Gs,Cub
4104icBezierCurve:Td,CubicBezierCurve3:w_,CubicInterpolant:X_,CullFaceBack:dh,CullFaceFront:Cg,CullFaceFrontBack:Pb,CullFaceNone:Ag,Curve:ri,CurvePath:C_,CustomBlending:Rg,CustomToneMapping:sd,CylinderGeometry:lo,Cylindrical:jE,Data3DTexture:Nc,DataArrayTexture:Lc,DataTexture:ti,DataTextureLoader:vE,DataUtils:tM,DecrementStencilOp:Jb,DecrementWrapStencilOp:Qb,DefaultLoadingManager:Z_,DepthFormat:_i,DepthStencilFormat:$i,DepthTexture:Br,DetachedBindMode:Zg,DirectionalLight:Q_,DirectionalLightHelper:uT,DiscreteInterpolant:q_,DodecahedronGeometry:Gc,DoubleSide:jn,DstAlphaFactor:Bg,DstColorFactor:Vg,DynamicCopyUsage:fS,DynamicDrawUsage:o_,DynamicReadUsage:uS,EdgesGeometry:M_,EllipseCurve:Wc,EqualCompare:i_,EqualDepth:Tl,EqualStencilFunc:iS,EquirectangularReflectionMapping:ya,EquirectangularRefractionMapping:ba,Euler:ni,EventDispatcher:ii,ExternalTexture:Md,ExtrudeGeometry:Xc,FileLoader:Ni,Float16BufferAttribute:lM,Float32BufferAttribute:Pe,FloatType:vn,Fog:Oc,FogExp2:Dc,FramebufferTexture:AM,FrontSide:Pi,Frustum:Ws,FrustumArray:kc,GLBufferAttribute:KE,GLSL1:mS,GLSL3:xh,GreaterCompare:r_,GreaterDepth:Al,GreaterEqualCompare:Pc,GreaterEqualDepth:wl,GreaterEqualStencilFunc:oS,GreaterStencilFunc:sS,GridHelper:lT,Group:_s,HTMLTexture:PM,HalfFloatType:gi,HemisphereLight:K_,HemisphereLightHelper:oT,IcosahedronGeometry:qc,ImageBitmapLoader:TE,ImageLoader:Qa,ImageUtils:d_,IncrementStencilOp:Kb,IncrementWrapStencilOp:jb,InstancedBufferAttribute:Ns,InstancedBufferGeometry:i0,InstancedInterleavedBuffer:ZE,InstancedMesh:v_,Int16BufferAttribute:aM,Int32BufferAttribute:oM,Int8BufferAttribute:iM,IntType:Mc,InterleavedBuffer:Fc,InterleavedBufferAttribute:Fr,Interpolant:$s,InterpolateBezier:_h,InterpolateDiscrete:Va,InterpolateLinear:sc,InterpolateSmooth:hl,InterpolationSamplingMode:vS,InterpolationSamplingType:_S,InvertStencilOp:eS,KeepStencilOp:yr,KeyframeTrack:Wn,LOD:g_,LatheGeometry:$c,Layers:ao,LessCompare:n_,LessDepth:El,LessEqualCompare:Ic,LessEqualDepth:Or,LessEqualStencilFunc:rS,LessStencilFunc:nS,Light:sr,LightProbe:n0,Line:ir,Line3:nT,LineBasicMaterial:bn,LineCurve:wd,LineCurve3:A_,LineDashedMaterial:G_,LineLoop:y_,LineSegments:vi,LinearFilter:Lt,LinearInterpolant:Od,LinearMipMapLinearFilter:Fb,LinearMipMapNearestFilter:Ub,LinearMipmapLinearFilter:di,LinearMipmapNearestFilter:Sa,LinearSRGBColorSpace:Ha,LinearToneMapping:nd,LinearTransfer:Ga,Loader:Rn,LoaderUtils:Eh,LoadingManager:Fd,LoopOnce:Kg,LoopPingPong:jg,LoopRepeat:Jg,MOUSE:Rb,Material:rn,MaterialBlending:Nb,MaterialLoader:tu,MathUtils:h_,Matrix2:wh,Matrix3:tt,Matrix4:We,MaxEquation:Ng,Mesh:Dt,MeshBasicMaterial:Oi,MeshDepthMaterial:Ld,MeshDistanceMaterial:Nd,MeshLambertMaterial:z_,MeshMatcapMaterial:H_,MeshNormalMaterial:V_,MeshPhongMaterial:B_,MeshPhysicalMaterial:F_,MeshStandardMaterial:Pd,MeshToonMaterial:k_,MinEquation:Lg,MirroredRepeatWrapping:Fa,MixOperation:$g,MultiplyBlending:mh,MultiplyOperation:ro,NearestFilter:Xt,NearestMipMapLinearFilter:Ob,NearestMipMapNearestFilter:Db,NearestMipmapLinearFilter:ms,NearestMipmapNearestFilter:ld,NeutralToneMapping:od,NeverCompare:t_,NeverDepth:Sl,NeverStencilFunc:tS,NoBlending:pi,NoColorSpace:Ci,NoNormalPacking:Xb,NoToneMapping:ei,NormalAnimationBlendMode:Rc,NormalBlending:Ir,NormalGAPacking:$b,NormalRGPacking:qb,NotEqualCompare:s_,NotEqualDepth:Cl,NotEqualStencilFunc:aS,NumberKeyframeTrack:Ka,Object3D:pt,ObjectLoader:ME,ObjectSpaceNormalMap:e_,OctahedronGeometry:uo,OneFactor:Og,OneMinusConstantAlphaFactor:qg,OneMinusConstantColorFactor:Wg,OneMinusDstAlphaFactor:kg,OneMinusDstColorFactor:zg,OneMinusSrcAlphaFactor:bl,OneMinusSrcColorFactor:Fg,OrthographicCamera:fo,PCFShadowMap:xa,PCFSoftShadowMap:td,PMREMGenerator:Ch,Path:hc,PerspectiveCamera:Jt,Plane:Ai,PlaneGeometry:Xs,PlaneHelper:pT,PointLight:j_,PointLightHelper:sT,Points:cc,PointsMaterial:Sd,PolarGridHelper:cT,PolyhedronGeometry:rr,PositionalAudio:LE,PropertyBinding:_t,PropertyMixer:l0,QuadraticBezierCurve:Ad,QuadraticBezierCurve3:Cd,Quaternion:tn,QuaternionKeyframeTrack:ho,QuaternionLinearInterpolant:Y_,R11_EAC_Format:Ul,RED_GREEN_RGTC2_Format:ka,RED_RGTC1_Format:nc,REVISION:io,RG11_EAC_Format:Ba,RGBADepthPacking:Hb,RGBAFormat:xn,RGBAIntegerFormat:Cc,RGBA_ASTC_10x10_Format:Kl,RGBA_ASTC_10x5_Format:$l,RGBA_ASTC_10x6_Format:Yl,RGBA_ASTC_10x8_Format:Zl,RGBA_ASTC_12x10_Format:Jl,RGBA_ASTC_12x12_Format:jl,RGBA_ASTC_4x4_Format:kl,RGBA_ASTC_5x4_Format:Vl,RGBA_ASTC_5x5_Format:zl,RGBA_ASTC_6x5_Format:Hl,RGBA_ASTC_6x6_Format:Gl,RGBA_ASTC_8x5_Format:Wl,RGBA_ASTC_8x6_Format:Xl,RGBA_ASTC_8x8_Format:ql,RGBA_BPTC_Format:Ql,RGBA_ETC2_EAC_Format:Ol,RGBA_PVRTC_2BPPV1_Format:Ll,RGBA_PVRTC_4BPPV1_Format:Pl,RGBA_S3TC_DXT1_Format:Ea,RGBA_S3TC_DXT3_Format:Ta,RGBA_S3TC_DXT5_Format:wa,RGBDepthPacking:Gb,RGBFormat:pd,RGBIntegerFormat:Bb,RGB_BPTC_SIGNED_Format:ec,RGB_BPTC_UNSIGNED_Format:tc,RGB_ETC1_Format:Nl,RGB_ETC2_Format:Dl,RGB_PVRTC_2BPPV1_Format:Il,RGB_PVRTC_4BPPV1_Format:Rl,RGB_S3TC_DXT1_Format:Ma,RGDepthPacking:Wb,RGFormat:er,RGIntegerFormat:Ac,RawShaderMaterial:Id,Ray:nr,Raycaster:u0,RectAreaLight:t0,RedFormat:wc,RedIntegerFormat:so,Re
4104inhardToneMapping:id,RenderTarget:_d,RenderTarget3D:qE,RepeatWrapping:Ua,ReplaceStencilOp:Zb,ReverseSubtractEquation:Pg,RingGeometry:Yc,SIGNED_R11_EAC_Format:Fl,SIGNED_RED_GREEN_RGTC2_Format:rc,SIGNED_RED_RGTC1_Format:ic,SIGNED_RG11_EAC_Format:Bl,SRGBColorSpace:Tn,SRGBTransfer:St,Scene:Uc,ShaderChunk:lt,ShaderLib:Jn,ShaderMaterial:Cn,ShadowMaterial:D_,Shape:Lr,ShapeGeometry:Zc,ShapePath:_T,ShapeUtils:Qn,ShortType:ud,Skeleton:Bc,SkeletonHelper:rT,SkinnedMesh:__,Source:Yi,Sphere:nn,SphereGeometry:qs,Spherical:JE,SphericalHarmonics3:kd,SplineCurve:Rd,SpotLight:J_,SpotLightHelper:iT,Sprite:m_,SpriteMaterial:yd,SrcAlphaFactor:yl,SrcAlphaSaturateFactor:Hg,SrcColorFactor:Ug,StaticCopyUsage:dS,StaticDrawUsage:Wa,StaticReadUsage:cS,StereoCamera:AE,StreamCopyUsage:pS,StreamDrawUsage:lS,StreamReadUsage:hS,StringKeyframeTrack:Hr,SubtractEquation:Ig,SubtractiveBlending:ph,TOUCH:Ib,TangentSpaceNormalMap:Li,TetrahedronGeometry:Kc,Texture:Ft,TextureLoader:xE,TextureUtils:MT,Timer:zd,TimestampQuery:gS,TorusGeometry:Jc,TorusKnotGeometry:jc,Triangle:un,TriangleFanDrawMode:zb,TriangleStripDrawMode:Vb,TrianglesDrawMode:kb,TubeGeometry:Qc,UVMapping:Sc,Uint16BufferAttribute:vd,Uint32BufferAttribute:xd,Uint8BufferAttribute:rM,Uint8ClampedBufferAttribute:sM,Uniform:Wd,UniformsGroup:YE,UniformsLib:be,UniformsUtils:U_,UnsignedByteType:wn,UnsignedInt101111Type:dd,UnsignedInt248Type:Ps,UnsignedInt5999Type:hd,UnsignedIntType:Gn,UnsignedShort4444Type:Ec,UnsignedShort5551Type:Tc,UnsignedShortType:Is,VSMShadowMap:ps,Vector2:j,Vector3:P,Vector4:Et,VectorKeyframeTrack:Ja,VideoFrameTexture:wM,VideoTexture:b_,WebGL3DRenderTarget:qS,WebGLArrayRenderTarget:XS,WebGLCoordinateSystem:Un,WebGLCubeRenderTarget:Xd,WebGLRenderTarget:Bn,WebGLRenderer:qd,WebGLUtils:x0,WebGPUCoordinateSystem:Ur,WebXRController:dl,WireframeGeometry:N_,WrapAroundEnding:za,ZeroCurvatureEnding:Er,ZeroFactor:Dg,ZeroSlopeEnding:Tr,ZeroStencilOp:Yb,createCanvasElement:c_,error:Oe,getConsoleFunction:MS,log:qa,setConsoleFunction:SS,warn:_e,warnOnce:ac},Symbol.toStringTag,{value:"Module"}));function Us(i,e){return Vh()?(lv(i,e),!0):!1}function Ms(){const i=new Set,e=s=>{i.delete(s)};return{on:s=>{i.add(s);const a=()=>e(s);return Us(a),{off:a}},off:e,trigger:(...s)=>Promise.all(Array.from(i).map(a=>a(...s))),clear:()=>{i.clear()}}}const Es=new WeakMap,b0=(...i)=>{var e;const t=i[0],n=(e=As())===null||e===void 0?void 0:e.proxy,r=n??Vh();if(r==null&&!km())throw new Error("injectLocal must be called in setup");return r&&Es.has(r)&&t in Es.get(r)?Es.get(r)[t]:kh(...i)};function vR(i,e){var t;const n=(t=As())===null||t===void 0?void 0:t.proxy,r=n??Vh();if(r==null)throw new Error("provideLocal must be called in setup");Es.has(r)||Es.set(r,Object.create(null));const s=Es.get(r);return s[i]=e,ga(i,e)}function xR(i,e){const t=e?.injectionKey||Symbol(i.name||"InjectionState"),n=e?.defaultValue;return[(...a)=>{const o=i(...a);return vR(t,o),o},()=>b0(t,n)]}const dc=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const yR=Object.prototype.toString,bR=i=>yR.call(i)==="[object Object]",fc=()=>{};function SR(i,e){function t(...n){return new Promise((r,s)=>{Promise.resolve(i(()=>e.apply(this,n),{fn:e,thisArg:this,args:n})).then(r).catch(s)})}return t}function MR(i,e={}){let t,n,r=fc;const s=l=>{clearTimeout(l),r(),r=fc};let a;return l=>{const c=yt(i),u=yt(e.maxWait);return t&&s(t),c<=0||u!==void 0&&u<=0?(n&&(s(n),n=void 0),Promise.resolve(l())):new Promise((h,d)=>{r=e.rejectOnCancel?d:h,a=l,u&&!n&&(n=setTimeout(()=>{t&&s(t),n=void 0,h(a())},u)),t=setTimeout(()=>{n&&s(n),n=void 0,h(l())},c)})}}function ER(i,e=!1,t="Timeout"){return new Promise((n,r)=>{e?setTimeout(r,i,t):setTimeout(n,i)})}function lm(i){return i.endsWith("rem")?Number.parseFloat(i)*16:Number.parseFloat(i)}function pl(i){return Array.isArray(i)?i:[i]}function TR(i){return As()}function wR(i,e=200,t={}){return SR(MR(e,t),i)}function cm(i,e=200,t={}){const n=mt(yt(i)),r=wR(()=>{n.value=i.value},e,t);return jt(i,()=>r()),to(n)}function S0(i,e=!0,t){TR()?Di(i,t):e?i():ma(i)}function um(i,e=1e3,t={}){const{immediate:n=!0,immediateCallback:r=!1}=t;let s=null;const a=Qt(!1);function o(){s&&(clearInterval(s),s=null)}function l(){a.value=!1,o()}function c(){const u=yt(e);u<=0||(a.value=!0,r&&i(),o(),a.value&&(s=setInterval(i,u)))}return n&&dc&&c(),(xs(e)||typeof e=="function")&&Us(jt(e,()=>{a.value&&dc&&c()})),Us(l),{isActive:to(a),pause:l,resume:c}}function AR(i,e,t={}){const{immediate:n=!0,immediateCallback:r=!1}=t,s=Qt(!1);let a;function o(){a&&(clearTimeout(a),a=void 0)}function l(){s.value=!1,o()}function c(...u){r&&i(),o(),s.value=!0,a=setTimeout(()=>{s.value=!1,a=void 0,i(...u)},yt(e))}return n&&(s.value=!0,dc&&c()),Us(l),{isPending:to(s),start:c,stop:l}}function CR(i=1e3,e={}){const{controls:t=!1,callback:n}=e,r=AR(n??fc,i,e),s=Ze(()=>!r.isPending.value);return t?{ready:s,...r}:s}function M0(i,e,t){return jt(i,e,{...t,immediate:!0})}const Gr=dc?window:void 0;function Ki(i){var e;const t=yt(i);return(e=t?.$el)!==null&&e!==void 0?e:t}function Ph(...i){const e=(n,r,s,a)=>(n.addEventListener(r,s,a),()=>n.removeEventListener(r,s,a)),t=Ze(()=>{const n=pl(yt(i[0])).filter(r=>r!=null);return n.every(r=>typeof r!="string")?n:void 0});return M0(()=>{var n,r;return[(n=(r=t.value)===null||r===void 0?void 0:r.map(s=>Ki(s)))!==null&&n!==void 0?n:[Gr].filter(s=>s!=null),pl(yt(t.value?i[1]:i[0])),pl(re(t.value?i[2]:i[1])),yt(t.value?i[3]:i[2])]},([n,r,s,a],o,l)=>{if(!n?.length||!r?.length||!s?.length)return;const c=bR(a)?{...a}:a,u=n.flatMap(h=>r.flatMap(d=>s.map(f=>e(h,d,f,c))));l(()=>{u.forEach(h=>h())})},{flush:"post"})}function RR(){const i=Qt(!1),e=As();return e&&Di(()=>{i.value=!0},e),i}function $d(i){const e=RR();return Ze(()=>(e.value,!!i()))}function Yd(i,e={}){const{immediate:t=!0,fpsLimit:n=null,window:r=Gr,once:s=!1}=e,a=Qt(!1),o=Ze(()=>{const f=yt(n);return f?1e3/f:null});let l=0,c=null;function u(f){if(!a.value||!r)return;l||(l=f);const p=f-l;if(o.value&&p<o.value){c=r.requestAnimationFrame(u);return}if(l=f,i({delta:p,timestamp:f}),s){a.value=!1,c=null;return}c=r.requestAnimationFrame(u)}function h(){!a.value&&r&&(a.value=!0,l=0,c=r.requestAnimationFrame(u))}function d(){a.value=!1,c!=null&&r&&(r.cancelAnimationFrame(c),c=null)}return t&&h(),Us(d),{isActive:to(a),pause:d,resume:h}}const IR=Symbol("vueuse-ssr-width");function PR(){const i=km()?b0(IR,null):null;return typeof i=="number"?i:void 0}function E0(i,e={}){const{window:t=Gr,ssrWidth:n=PR()}=e,r=$d(()=>t&&"matchMedia"in t&&typeof t.matchMedia=="function"),s=Qt(typeof n=="number"),a=Qt(),o=Qt(!1),l=c=>{o.value=c.matches};return Kn(()=>
4104{if(s.value){s.value=!r.value,o.value=yt(i).split(",").some(c=>{const u=c.includes("not all"),h=c.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),d=c.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);let f=!!(h||d);return h&&f&&(f=n>=lm(h[1])),d&&f&&(f=n<=lm(d[1])),u?!f:f});return}r.value&&(a.value=t.matchMedia(yt(i)),o.value=a.value.matches)}),Ph(a,"change",l,{passive:!0}),Ze(()=>o.value)}function LR(i={}){const{window:e=Gr}=i,t=Qt(1),n=E0(()=>`(resolution: ${t.value}dppx)`,i);let r=fc;return e&&(r=M0(n,()=>t.value=e.devicePixelRatio)),{pixelRatio:to(t),stop:r}}function NR(i,e,t={}){const{window:n=Gr,...r}=t;let s;const a=$d(()=>n&&"ResizeObserver"in n),o=()=>{s&&(s.disconnect(),s=void 0)},l=jt(Ze(()=>{const u=yt(i);return Array.isArray(u)?u.map(h=>Ki(h)):[Ki(u)]}),u=>{if(o(),a.value&&n){s=new ResizeObserver(e);for(const h of u)h&&s.observe(h,r)}},{immediate:!0,flush:"post"}),c=()=>{o(),l()};return Us(c),{isSupported:a,stop:c}}function DR(i,e={width:0,height:0},t={}){const{window:n=Gr,box:r="content-box"}=t,s=Ze(()=>{var h;return(h=Ki(i))===null||h===void 0||(h=h.namespaceURI)===null||h===void 0?void 0:h.includes("svg")}),a=Qt(e.width),o=Qt(e.height),{stop:l}=NR(i,([h])=>{const d=r==="border-box"?h.borderBoxSize:r==="content-box"?h.contentBoxSize:h.devicePixelContentBoxSize;if(n&&s.value){const f=Ki(i);if(f){const p=f.getBoundingClientRect();a.value=p.width,o.value=p.height}}else if(d){const f=pl(d);a.value=f.reduce((p,{inlineSize:_})=>p+_,0),o.value=f.reduce((p,{blockSize:_})=>p+_,0)}else a.value=h.contentRect.width,o.value=h.contentRect.height},t);S0(()=>{const h=Ki(i);h&&(a.value="offsetWidth"in h?h.offsetWidth:e.width,o.value="offsetHeight"in h?h.offsetHeight:e.height)});const c=jt(()=>Ki(i),h=>{a.value=h?e.width:0,o.value=h?e.height:0});function u(){l(),c()}return{width:a,height:o,stop:u}}function OR(i){var e;const t=Qt(0);if(typeof performance>"u")return t;const n=(e=i?.every)!==null&&e!==void 0?e:10;let r=performance.now(),s=0;return Yd(()=>{if(s+=1,s>=n){const a=performance.now(),o=a-r;t.value=Math.round(1e3/(o/s)),r=a,s=0}}),t}function UR(i){if("interval"in i||"immediate"in i||"immediateCallback"in i){const{interval:e=1e3,immediate:t,immediateCallback:n}=i;return r=>um(r,e,{immediate:t,immediateCallback:n})}return um}function FR(i={}){const e=Qt(),t=$d(()=>typeof performance<"u"&&"memory"in performance);if(t.value){const{scheduler:n=UR}=i;n(()=>{e.value=performance.memory})}return{isSupported:t,memory:e}}function BR(i={}){const{window:e=Gr,initialWidth:t=Number.POSITIVE_INFINITY,initialHeight:n=Number.POSITIVE_INFINITY,listenOrientation:r=!0,includeScrollbar:s=!0,type:a="inner"}=i,o=Qt(t),l=Qt(n),c=()=>{if(e)if(a==="outer")o.value=e.outerWidth,l.value=e.outerHeight;else if(a==="visual"&&e.visualViewport){const{width:h,height:d,scale:f}
4104=e.visualViewport;o.value=Math.round(h*f),l.value=Math.round(d*f)}else s?(o.value=e.innerWidth,l.value=e.innerHeight):(o.value=e.document.documentElement.clientWidth,l.value=e.document.documentElement.clientHeight)};c(),S0(c);const u={passive:!0};return Ph("resize",c,u),e&&a==="visual"&&e.visualViewport&&Ph(e.visualViewport,"resize",c,u),r&&jt(E0("(orientation: portrait)"),()=>c()),{width:o,height:l}}function hm(i){var e;const t=((e=i?.replace(/([A-Z])+/g,kR))==null?void 0:e.split(/(?=[A-Z])|[\.\-\s_]/).map(n=>n.toLowerCase()))??[];return t.length===0?"":t.length===1?t[0]:t.reduce((n,r)=>`${n}${r.charAt(0).toUpperCase()}${r.slice(1)}`)}function kR(i){if(!i||i.length===0)return"";const e=i.toLowerCase();return e.substring(0,1).toUpperCase()+e.substring(1,e.length)}new Map(Object.entries({Ã:"Ae",Ã:"D",Ã:"O",Ã:"Th",Ã:"ss",æ:"ae",ð:"d",ø:"o",þ:"th",Ä:"D",Ä:"d",Ħ:"H",ħ:"h",ı:"i",IJ:"IJ",ij:"ij",ĸ:"k",Ä¿:"L",Å:"l",Å:"L",Å:"l",Å:"'n",Å:"N",Å:"n",Å:"Oe",Å:"oe",Ŧ:"T",ŧ:"t",Å¿:"s"}));function T0(i,e){if(Object.is(i,e))return!0;if(i instanceof Date&&e instanceof Date)return i.getTime()===e.getTime();if(i instanceof RegExp&&e instanceof RegExp)return i.toString()===e.toString();if(typeof i!="object"||i===null||typeof e!="object"||e===null)return!1;const t=Reflect.ownKeys(i),n=Reflect.ownKeys(e);if(t.length!==n.length)return!1;for(let r=0;r<t.length;r++)if(!Reflect.has(e,t[r])||!T0(i[t[r]],e[t[r]]))return!1;return!0}function Mr(i){return typeof i=="function"}function w0(i){return typeof i=="number"&&!Number.isNaN(i)}function Zd(i){return VR(i,"[object Object]")}function Kd(i){return typeof i=="string"}function VR(i,e){return Object.prototype.toString.call(i)===e}function Lh(i){return typeof i>"u"}class zR{nativeEvent;NONE=0;CAPTURING_PHASE=1;AT_TARGET=2;BUBBLING_PHASE=3;relatedTarget=null;get altKey(){return this.getFromNative("altKey",!1)}get button(){return this.getFromNative("button",0)}get buttons(){return this.getFromNative("buttons",0)}get clientX(){return this.getFromNative("clientX",0)}get clientY(){return this.getFromNative("clientY",0)}get ctrlKey(){return this.getFromNative("ctrlKey",!1)}get layerX(){return this.getFromNative("layerX",0)}get layerY(){return this.getFromNative("layerY",0)}get metaKey(){return this.getFromNative("metaKey",!1)}get movementX(){return this.getFromNative("movementX",0)}get movementY(){return this.getFromNative("movementY",0)}get offsetX(){return this.getFromNative("offsetX",0)}get offsetY(){return this.getFromNative("offsetY",0)}get pageX(){return this.getFromNative("pageX",0)}get pageY(){return this.getFromNative("pageY",0)}get screenX(){return this.getFromNative("screenX",0)}get screenY(){return this.getFromNative("screenY",0)}get shiftKey(){return this.getFromNative("shiftKey",!1)}get x(){return this.getFromNative("x",0)}get y(){return this.getFromNative("y",0)}get detail(){return this.getFromNative("detail",0)}get view(){return this.getFromNative("view",null)}get which(){return this.getFromNative("which",0)}get cancelBubble(){return this.getFromNative("cancelBubble",!1)}get composed(){return this.getFromNative("composed",!1)}get eventPhase(){return this.getFromNative("eventPhase",0)}get isTrusted(){return this.getFromNative("isTrusted",!1)}get returnValue(){return this.getFromNative("returnValue",!1)}get timeStamp(){return this.getFromNative("timeStamp",0)}get cancelable(){return this.getFromNative("cancelable",!1)}get defaultPrevented(){return this.getFromNative("defaultPrevented",!1)}constructor(e){this.nativeEvent=e}getFromNative(e,t){return e in this.nativeEvent?this.nativeEvent[e]:t}}const ju=new P;class pn extends zR{type;bubbles;internalPointer;intersection;camera;currentObject;object;propagationState;get pointerId(){return this.internalPointer.id}get pointerType(){return this.internalPointer.type}get pointerState(){return this.internalPointer.state}get distance(){return this.intersection.distance}get distanceToRay(){return this.intersection.distanceToRay}get point(){return this.intersection.point}get index(){return this.intersection.index}get face(){return this.intersection.face}get faceIndex(){return this.intersection.faceIndex}get uv(){return this.intersection.uv}get uv1(){return this.intersection.uv1}get normal(){return this.intersection.normal}get instanceId(){return this.intersection.instanceId}get pointOnLine(){return this.intersection.pointOnLine}get batchId(){return this.intersection.batchId}get pointerPosition(){return this.intersection.pointerPosition}get pointerQuaternion(){return this.intersection.pointerQuaternion}get pointOnFace(){return this.intersection.pointOnFace}get localPoint(){return this.intersection.localPoint}get details(){return this.intersection.details}get target(){return this.object}
4104get currentTarget(){return this.currentObject}get eventObject(){return this.currentObject}get srcElement(){return this.currentObject}_pointer;get pointer(){return this._pointer==null&&(ju.copy(this.intersection.point).project(this.camera),this._pointer=new j(ju.x,ju.y)),this._pointer}_ray;get ray(){if(this._ray!=null)return this._ray;switch(this.intersection.details.type){case"screen-ray":case"ray":case"sphere":return this._ray=new nr(this.intersection.pointerPosition,new P(0,0,-1).applyQuaternion(this.intersection.pointerQuaternion));case"lines":return this._ray=new nr(this.intersection.details.line.start,this.intersection.details.line.end.clone().sub(this.intersection.details.line.start).normalize())}}_intersections=[];get intersections(){return this._intersections==null&&(this._intersections=[{...this.intersection,eventObject:this.currentObject}]),this._intersections}_unprojectedPoint;get unprojectedPoint(){if(this._unprojectedPoint==null){const e=this.pointer;this._unprojectedPoint=new P(e.x,e.y,0).unproject(this.camera)}return this._unprojectedPoint}get stopped(){return this.propagationState.stoppedImmediate||this.prop
4104agationState.stopped}get stoppedImmediate(){return this.propagationState.stoppedImmediate}get delta(){throw new Error("not supported")}constructor(e,t,n,r,s,a,o=s.object,l=o,c={stopped:!t,stoppedImmediate:!1}){super(n),this.type=e,this.bubbles=t,this.internalPointer=r,this.intersection=s,this.camera=a,this.currentObject=o,this.object=l,this.propagationState=c}stopPropagation(){this.propagationState.stopped=!0}stopImmediatePropagation(){this.propagationState.stoppedImmediate=!0}retarget(e){return new pn(this.type,this.bubbles,this.nativeEvent,this.internalPointer,this.intersection,this.camera,e,this.target,this.propagationState)}}class pc extends pn{get deltaX(){return this.nativeEvent.deltaX}get deltaY(){return this.nativeEvent.deltaY}get deltaZ(){return this.nativeEvent.deltaZ}constructor(e,t,n,r,s,a){super("wheel",!0,e,t,n,r,s,a)}retarget(e){return new pc(this.nativeEvent,this.internalPointer,this.intersection,this.camera,e,this.target)}}function Mn(i){A0(i,i.currentObject)}function A0(i,e){if(e==null)return;const t=GR(e,i.type);if(t!=null&&t.length>0){const n=i.retarget(e),r=t.length;for(let s=0;s<r&&!n.stoppedImmediate;s++)t[s](n)}i.stopped||A0(i,e.parent)}const C0={click:"onClick",contextmenu:"onContextMenu",dblclick:"onDoubleClick",pointercancel:"onPointerCancel",pointerdown:"onPointerDown",pointerenter:"onPointerEnter",pointerleave:"onPointerLeave",pointermove:"onPointerMove",pointerout:"onPointerOut",pointerover:"onPointerOver",pointerup:"onPointerUp",wheel:"onWheel"},HR=Object.keys(C0);function GR(i,e){if(i._listeners!=null&&e in i._listeners)return i._listeners[e];let t;if(i.isVoidObject&&e==="click"&&i.parent?.__r3f!=null&&(t=i.parent.__r3f.root.getState().onPointerMissed),i.__r3f!=null&&(t=i.__r3f.handlers[C0[e]]),t!=null)return[t]}const WR=1e10,XR=new qs(WR),dm=new Map;function R0(i){let e=dm.get(i);return e==null&&(e=new Dt(XR),e.isVoidObject=!0,e.parent=i,e.pointerEventsOrder=-1/0,dm.set(i,e)),e}function qR(i,e,t){const n=e.normal??e.face?.normal;return n==null?!1:(i.setFromNormalAndCoplanarPoint(n,e.localPoint),i.applyMatrix4(t),!0)}function $R(i,e,t){if(e==="none"||e==="listener"&&!i)return!1;if(t==="all")return!0;if(typeof t=="function")return({id:s,type:a,state:o})=>t(s,a,o);let n,r;return"deny"in t?(r=!0,n=t.deny):(r=!1,n=t.allow),Array.isArray(n)?s=>fm(n.includes(s.type),r):s=>fm(n===s.type,r)}function fm(i,e){return e?!i:i}function I0(i,e,t,n=!1,r,s,a){const o=n||YR(i,e),l=e.pointerEvents??r,c=l??e.defaultPointerEvents??"listener",u=e.pointerEventsType??s??"all",h=e.pointerEventsOrder??a??0,d=$R(o,c,u),f=t.length;if(f===1)(d===!0||typeof d=="function"&&d(t[0]))&&Qu(t[0],e,c,u,h);else if(d===!0)for(let g=0;g<f;g++)Qu(t[g],e,c,u,h);else if(typeof d=="function")for(let g=0;g<f;g++){const m=t[g];d(m)&&Qu(m,e,c,u,h)}if(e.children.length===0||e.intersectChildren===!1)return;const p=e.interactableDescendants??e.children,_=p.length;for(let g=0;g<_;g++)I0(i,p[g],t,o,l,u,h)}function YR(i,e){if(e.ancestorsHaveListeners||i==="pointer"&&e.ancestorsHavePointerListeners||i==="wheel"&&e.ancestorsHaveWheelListeners||e.__r3f!=null&&e.__r3f?.eventCount>0&&(i==="wheel"&&e.__r3f.handlers.onWheel!=null||i==="pointer"&&Object.keys(e.__r3f.handlers).some(r=>r!="onWheel")))return!0;if(e._listeners==null)return!1;if(i==="wheel"){const r=e._listeners.wheel;return r!=null&&r.length>0}const t=Object.entries(e._listeners),n=t.length;for(let r=0;r<n;r++){const s=t[r];if(s[0]!=="wheel"&&HR.includes(s[0])&&s[1]!=null&&s[1].length>0)return!0}return!1}function Qu({intersector:i,options:e},t,n,r,s){e.filter?.(t,n,r,s)!==!1&&i.executeIntersection(t,s)}function ZR(i,e,{customSort:t=KR}={},n){let r,s,a;const o=i.length;for(let l=0;l<o;l++){const c=i[l],u=e?.[l];(r==null||t(c,u,r,s)<0)&&(a=l,r=c,s=u)}return a}function KR(i,e=0,t,n=0){return e!=n?n-e:i.distance-t.distance}const pm=1e7;function JR(i,e,t,n,r,s=0){const a=e.direction.clone().multiplyScalar(pm),o=pm;return{distance:o+s,object:R0(i),point:a,normal:e.origin.clone().sub(a).normalize(),details:t(a,o),pointerPosition:n,pointerQuaternion:r,pointOnFace:a,localPoint:a}}function jR(i,e,t){for(;t>0;)i.push(e),--t}const eh=Symbol("buttonsDownTime"),QR=Symbol("buttonsClickTime");globalThis.pointerEventspointerMap??=new Map;pt.prototype.setPointerCapture=function(i){Jd(i)?.setCapture(this)};pt.prototype.releasePointerCapture=function(i){const e=Jd(i);e==null||!e.hasCaptured(this)||e.setCapture(void 0)};pt.prototype.hasPointerCapture=function(i){return Jd(i)?.hasCaptured(this)??!1};function Jd(i){return globalThis.pointerEventspointerMap?.get(i)}class eI{id;type;state;intersector;getCamera;onMoveCommited;parentSetPointerCapture;parentReleasePointerCapture;options;prevIntersection;intersection;prevEnabled=!0;enabled=!0;wheelIntersection;pointerEntered=[];pointerEnteredHelper=[];pointerCapture;buttonsDownTime=new Map;buttonsDown=new Set;wasMoved=!1;onFirstMove=[];constructor(e,t,n,r,s,a,o,l,c={}){this.id=e,this.type=t,this.state=n,this.intersector=r,this.getCamera=s,this.onMoveCommited=a,this.parentSetPointerCapture=o,this.parentReleasePointerCapture=l,this.options=c,globalThis.pointerEventspointerMap?.set(e,this)}getPointerCapture(){return this.pointerCapture}hasCaptured(e){return this.pointerCapture?.object===e}setCapture(e){this.pointerCapture?.object!==e&&(this.clearPointerCapture(),e!=null&&this.intersection!=null&&(this.pointerCapture={object:e,intersection:this.intersection},this.parentSetPointerCapture?.()))}getButtonsDown(){return this.buttonsDown}getIntersection(){return this.intersection}getEnabled(){return this.enabled}setEnabled(e,t,n=!0){this.enabled!==e&&(!e&&this.pointerCapture!=null&&this.clearPointerCapture(),this.enabled=e,n&&this.commit(t,!1))}computeIntersection(e,t,n){return this.pointerCapture!=null?this.intersector.intersectPointerCapture(this.pointerCapture,n):(this.intersector.startIntersection(n),I0(e,t,[this]),this.intersector.finalizeIntersection(t))}setIntersection(e){this.intersection=e}commit(e,t){const n=this.getCamera(),r=this.prevEnabled?this.prevIntersection:void 0,s=this.enabled?this.intersection:void 0;
4104r!=null&&r.object!=s?.object&&Mn(new pn("pointerout",!0,e,this,r,n));const a=this.pointerEntered;this.pointerEntered=[],this.pointerEnteredHelper.length=0,P0(s?.object,this.pointerEntered,a,this.pointerEnteredHelper);const o=a.length;for(let l=0;l<o;l++){const c=a[l];Mn(new pn("pointerleave",!1,e,this,r,n,c))}s!=null&&r?.object!=s.object&&Mn(new pn("pointerover",!0,e,this,s,n));for(let l=this.pointerEnteredHelper.length-1;l>=0;l--){const c=this.pointerEnteredHelper[l];Mn(new pn("pointerenter",!1,e,this,s,n,c))}if(t&&s!=null&&Mn(new pn("pointermove",!0,e,this,s,n)),this.prevIntersection=this.intersection,this.prevEnabled=this.enabled,!this.wasMoved&&this.intersector.isReady()){this.wasMoved=!0;const l=this.onFirstMove.length;for(let c=0;c<l;c++)this.onFirstMove[c](n);this.onFirstMove.length=0}this.onMoveCommited?.(this)}move(e,t){this.intersection=this.computeIntersection("pointer",e,t),this.commit(t,!0)}over(e,t){this.wasMoved||(this.intersection=this.computeIntersection("pointer",e,t),this.commit(t,!1))}emitMove(e){this.intersection!=null&&Mn(new pn("pointermove",!0,e,this,this.intersection,this.getCamera()))}down(e){if(this.buttonsDown.add(e.button),!this.enabled)return;if(!this.wasMoved){this.onFirstMove.push(this.down.bind(this,e));return}if(this.intersection==null)return;Mn(new pn("pointerdown",!0,e,this,this.intersection,this.getCamera()));const{object:t}=this.intersection;t[eh]??=new Map,t[eh].set(e.button,e.timeStamp),this.buttonsDownTime.set(e.button,e.timeStamp)}up(e){if(this.buttonsDown.delete(e.button),!this.enabled)return;if(!this.wasMoved){this.onFirstMove.push(this.up.bind(this,e));return}if(this.intersection==null)return;const{clickThesholdMs:t,contextMenuButton:n=2,dblClickThresholdMs:r=500,clickThresholdMs:s=t??300}=this.options;this.clearPointerCapture();
4104const a=tI(this.buttonsDownTime,this.intersection.object[eh],e.button,e.timeStamp,s),o=this.getCamera();if(a&&e.button===n&&Mn(new pn("contextmenu",!0,e,this,this.intersection,o)),Mn(new pn("pointerup",!0,e,this,this.intersection,o)),!a||e.button===n)return;Mn(new pn("click",!0,e,this,this.intersection,o));const{object:l}=this.intersection,c=l[QR]??=new Map,u=c.get(e.button);if(u==null||e.timeStamp-u>r){c.set(e.button,e.timeStamp);return}Mn(new pn("dblclick",!0,e,this,this.intersection,o)),c.delete(e.button)}cancel(e){this.buttonsDown.clear(),this.buttonsDownTime.clear(),this.clearPointerCapture(),this.onFirstMove.length=0,!(!this.enabled||!this.wasMoved||this.intersection==null)&&Mn(new pn("pointercancel",!0,e,this,this.intersection,this.getCamera()))}wheel(e,t,n=!1){if(!this.enabled)return;if(!this.wasMoved&&n){this.onFirstMove.push(this.wheel.bind(this,e,t,n));return}n||(this.wheelIntersection=this.computeIntersection("wheel",e,t));const r=n?this.intersection:this.wheelIntersection;r!=null&&Mn(new pc(t,this,r,this.getCamera()))}emitWheel(e,t=!1){if(!this.enabled)return;if(!this.wasMoved&&t){this.onFirstMove.push(this.emitWheel.bind(this,e,t));return}const n=t?this.intersection:this.wheelIntersection;n!=null&&Mn(new pc(e,this,n,this.getCamera()))}exit(e){(this.buttonsDown.size>0||this.pointerCapture!=null)&&this.cancel(e),this.wasMoved&&(this.intersection=void 0,this.commit(e,!1)),this.onFirstMove.length=0,this.wasMoved=!1}clearPointerCapture(){this.pointerCapture!=null&&(this.parentReleasePointerCapture?.(),this.pointerCapture=void 0)}}function P0(i,e,t,n){if(i==null)return;const r=t.indexOf(i);r!=-1?t.splice(r,1):n.push(i),e.push(i),P0(i.parent,e,t,n)}function tI(i,e,t,n,r){if(e==null)return!1;const s=e.get(t);return!(s==null||n-s>r||s!=i.get(t))}const ua=new un,th=new un,mm=new j,gm=new j,_m=new j,nh=new P,nI=new We,ll=new P;function iI(i,e,t){ll.copy(e).applyMatrix4(nI.copy(t.matrixWorld).invert());const n=t.geometry.attributes.uv;if(n==null||!(n instanceof ut))return!1;let r;return rI(t,(s,a,o)=>{t.getVertexPosition(s,ua.a),t.getVertexPosition(a,ua.b),t.getVertexPosition(o,ua.c);const l=ua.closestPointToPoint(ll,nh).distanceTo(ll);r!=null&&l>=r||(r=l,th.copy(ua),mm.fromBufferAttribute(n,s),gm.fromBufferAttribute(n,a),_m.fromBufferAttribute(n,o))}),r==null?!1:(th.closestPointToPoint(ll,nh),th.getInterpolation(nh,mm,gm,_m,i),!0)}function rI(i,e){const t=i.geometry.drawRange;if(i.geometry.index!=null){const a=i.geometry.index,o=Math.max(0,t.start),l=
4104Math.min(a.count,t.start+t.count);for(let c=o;c<l;c+=3)e(a.getX(c),a.getX(c+1),a.getX(c+2));return}const n=i.geometry.attributes.position;if(n==null)return;const r=Math.max(0,t.start),s=Math.min(n.count,t.start+t.count);for(let a=r;a<s;a+=3)e(a,a+1,a+2)}new We;const vm=new We,sI=new P,xm=new j,aI=new P;class oI{prepareTransformation;options;raycaster=new u0;cameraQuaternion=new tn;fromPosition=new P;fromQuaternion=new tn;coords=new j;viewPlane=new Ai;intersects=[];pointerEventsOrders=[];constructor(e,t){this.prepareTransformation=e,this.options=t}isReady(){return!0}intersectPointerCapture({intersection:e,object:t},n){const r=e.details;if(r.type!="screen-ray")throw new Error(`unable to process a pointer capture of type "${e.details.type}" with a camera ray intersector`);if(!this.startIntersection(n))return e;this.viewPlane.constant-=r.distanceViewPlane;const s=this.raycaster.ray.intersectPlane(this.viewPlane,new P);if(s==null)return e;e.object.updateWorldMatrix(!0,!1),qR(this.viewPlane,e,e.object.matrixWorld);let a=e.uv;return e.object instanceof Dt&&iI(xm,s,e.object)&&(a=xm.clone()),{...e,details:{...r,direction:this.raycaster.ray.direction.clone(),screenPoint:this.coords.clone()},uv:a,object:t,point:s,pointOnFace:s,pointerPosition:this.raycaster.ray.origin.clone(),pointerQuaternion:this.cameraQuaternion.clone()}}startIntersection(e){const t=this.prepareTransformation(e,this.coords);return t==null?!1:(t.updateWorldMatrix(!0,!1),t.matrixWorld.decompose(this.fromPosition,this.fromQuaternion,sI),this.raycaster.setFromCamera(this.coords,t),this.viewPlane.setFromNormalAndCoplanarPoint(t.getWorldDirection(aI),this.raycaster.ray.origin),!0)}executeIntersection(e,t){const n=this.intersects.length;e.raycast(this.raycaster,this.intersects),jR(this.pointerEventsOrders,t,this.intersects.length-n)}finalizeIntersection(e){const t=this.fromPosition.clone(),n=this.cameraQuaternion.clone(),r=this.raycaster.ray.direction.clone(),s=ZR(this.intersects,this.pointerEventsOrders,this.options),a=s==null?void 0:this.intersects[s];return this.intersects.length=0,this.pointerEventsOrders.length=0,a==null?JR(e,this.raycaster.ray,(o,l)=>({type:"screen-ray",distanceViewPlane:l,screenPoint:this.coords.clone(),direction:r}),t,n):(a.object.updateWorldMatrix(!0,!1),vm.copy(a.object.matrixWorld).invert(),Object.assign(a,{details:{type:"screen-ray",distanceViewPlane:this.viewPlane.distanceToPoint(a.point),screenPoint:this.coords.clone(),direction:r},pointOnFace:a.point,pointerPosition:t,pointerQuaternion:n,localPoint:a.point.clone().applyMatrix4(vm)}))}}new We;new We;let lI=23412;function cI(){return lI++}function uI(i,e,t){if(!(e instanceof globalThis.MouseEvent))return t.set(0,0);const{width:n,height:r,top:s,left:a}=i.getBoundingClientRect(),o=e.clientX-a,l=e.clientY-s;return t.set(o/n*2-1,-(l/r)*2+1)}function hI(i,e,t,n){return dI(i,typeof e=="function"?e:()=>e,t,uI.bind(null,i),i.setPointerCapture.bind(i),r=>{i.hasPointerCapture(r)&&i.releasePointerCapture(r)},{pointerTypePrefix:"screen-",...n})}function dI(i,e,t,n,r,s,a={}){const o=a?.forwardPointerCapture??!0,l=new Map,c=a.pointerTypePrefix??"forward-",u=(x,M)=>{let A=l.get(x.pointerId);return A!=null||(A=new eI(cI(),`${c}${x.pointerType}`,x.pointerState,new oI((I,N)=>(n(I,N),e()),a),e,void 0,o?r.bind(null,x.pointerId):void 0,o?s.bind(null,x.pointerId):void 0,a),M!="move"&&M!="wheel"&&(A.setIntersection(A.computeIntersection("pointer",t,x)),A.commit(x,!1)),l.set(x.pointerId,A)),A},h=new Map,d=new Map,f=[],p=[],_=(x,M,A)=>{switch(x){case"move":A.move(t,M);return;case"over":A.move(t,M);return;case"wheel":A.wheel(t,M);return;case"cancel":A.cancel(M);return;case"down":if(!ym(M))return;A.down(M);return;case"up":if(!ym(M))return;A.up(M);return;case"exit":d.delete(A),h.delete(A),A.exit(M);return}},g=(x,M)=>{const A=u(M,x);x==="move"&&d.set(A,M),x==="wheel"&&h.set(A,M),a.batchEvents??!0?p.push({type:x,event:M}):_(x,M,A)},m=g.bind(null,"move"),v=g.bind(null,"over"),b=g.bind(null,"cancel"),y=g.bind(null,"down"),T=g.bind(null,"up"),S=g.bind(null,"wheel"),R=g.bind(null,"exit");return i.addEventListener("pointermove",m),i.addEventListener("pointerover",v),i.addEventListener("pointercancel",b),i.addEventListener("pointerdown",y),i.addEventListener("pointerup",T),i.addEventListener("wheel",S),i.addEventListener("pointerleave",R),{destroy(){i.removeEventListener("pointermove",m),i.removeEventListener("pointerover",v),i.removeEventListener("pointercancel",b),i.removeEventListener("pointerdown",y),i.removeEventListener("pointerup",T),i.removeEventListener("wheel",S),i.removeEventListener("pointerleave",R),d.clear(),h.clear()},update(){const x=p.length;for(let M=0;M<x;M++){const{type:A,event:I}=p[M],N=u(I,A);if(A==="move"&&(f.push(N),d.get(N)!=I)){N.emitMove(I);continue}if(A==="wheel"&&h.get(N)!=I){N.emitWheel(I);continue}_(A,I,N)}if(p.length=0,a.intersectEveryFrame??!1)for(const[M,A]of d.entries())f.includes(M)||M.move(t,A);f.length=0}}}function ym(i){return i.button!=null}var fI={},pI="5.8.3";function mI(i){const e=Object.create(null);for(const t of i.split(","))e[t]=1;return t=>t in e}const gI="html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot",_I=mI(gI),Xn=i=>e=>Zd(e)&&i in e&&!!e[i],Nh=Xn("isObject3D"),L0=Xn("isMesh"),N0=Xn("isCamera"),vI=Xn("isOrthographicCamera"),D0=Xn("isPerspectiveCamera"),O0=Xn("isColor"),xI=i=>Kd(i)||w0(i)||O0(i),bm=i=>i instanceof ao,U0=Xn("isBufferGeometry"),F0=Xn("isMaterial"),yI=Xn("isLight"),B0=Xn("isFog"),jd=Xn("isScene"),Dh=i=>i!==null&&typeof i=="object"&&"set"in i&&typeof i.set=="function",bI=i=>Dh(i)&&"copy"in i&&typeof i.copy=="function",SI=i=>!!i?.constructor,vs=i=>N0(i)||vI(i)||D0(i),MI=i=>Nh(i)||U0(i)||F0(i)||B0(i),EI=Xn("isPrimitive"),TI=i=>MI(i)&&"__tres"in i,k0=(i,e)=>{let t=0;for(let n=0;n<i.length;n++)e(i[n],n)&&(i[t]=i[n],t++);return i.length=t,i};function wI(){try{const i="production";if(i)return i}catch{}return"production"}wI();const mc="[TresJS â² â â] ";function Sm(...i){typeof i[0]=="string"?i[0]=mc+i[0]:i.unshift(mc),console.error(...i)}function AI(...i){typeof i[0]=="string"?i[0]=mc+i[0]:i.unshift(mc),console.warn(...i)}function Mm(i){(t=>"map"in t&&!!t.map)(i)&&i.map.dispose(),i.dispose()}function V0(i){if(i.parent&&i.removeFromParent?.(),delete i.__tres,[...i.children].forEac
4104h(e=>V0(e)),!(i instanceof Uc)){const e=i;i&&i.dispose?.(),e.geometry&&e.geometry.dispose(),Array.isArray(e.material)?e.material.forEach(t=>Mm(t)):e.material&&Mm(e.material)}}function gc(i,e){let t=i;if(e.includes("-")){const n=e.split("-");let r=n.shift();for(;t&&n.length;)r in t?(t=t[r],r=n.shift()):r=Em(r,n.shift());return{target:t,key:Em(r,...n)}}else return{target:t,key:e}}function Em(...i){return i.map((e,t)=>t===0?e:e.charAt(0).toUpperCase()+e.slice(1)).join("")}function CI(i,e,t){const n=/-\d+$/;if(Kd(t)){if(n.test(t)){const{target:a,key:o}=gc(i,t.replace(n,""));if(!Array.isArray(a[o])){const l=a[o],c=[];c.__tresDetach=()=>{c.every(u=>Lh(u))&&(a[o]=l)},a[o]=c}}const{target:r,key:s}=gc(i,t);e.__tres.previousAttach=r[s],r[s]=Fs(e)}else e.__tres.previousAttach=t(i,e)}function RI(i,e,t){if(Kd(t)){const{target:n,key:r}=gc(i,t),s=e.__tres.previousAttach;s===void 0?delete n[r]:n[r]=s,"__tresDetach"in n&&n.__tresDetach()}else e.__tres?.previousAttach?.(i,e);delete e.__tres?.previousAttach}function br(i,e,t){const n=i;return n.__tres={type:"unknown",root:t,memoizedProps:{},objects:[],parent:null,previousAttach:null,...e},n.__tres.attach||(F0(n)?n.__tres.attach="material":U0(n)?n.__tres.attach="geometry":B0(n)&&(n.__tres.attach="fog")),n}function Oh(i){const e=i?.__tres?.root;e?.renderer&&e.renderer.canBeInvalidated.value&&e.renderer.invalidate()}function II(i,e,t,n,r){const s=[...e.__tres.objects],a=Fs(e);if(i=Fs(i),a===i)return!0;const o=br(i,e.__tres??{},r),l=e.parent??e.__tres.parent??null,c={...e.__tres.memoizedProps};delete c.object;for(const u of s)z0(u,r),H0(u,r);a.__tres.objects=[],n.remove(e);for(const[u,h]of Object.entries(c))n.patchProp(o,u,o[u],h);t(i),n.insert(e,l);for(const u of s)n.insert(u,e);return!0}function Fs(i){if(EI(i)){const e=i;return e.object.__tres=e.__tres,e.object}else return i}function z0(i,e){const t=i.__tres?.parent||e.scene.value;i.__tres&&(i.__tres.parent=null),t&&t.__tres&&"objects"in t.__tres&&k0(t.__tres.objects,n=>n!==i),i.__tres?.attach?RI(t,i,i.__tres.attach):(i.parent?.remove?.(Fs(i)),i.parent=null)}function H0(i,e){i.traverse?.(t=>{vs(t)&&e.camera.deregisterCamera(t)}),vs(i)&&e.camera.deregisterCamera(i),Oh(i)}const PI=({sizes:i})=>{const e=mt([]),t=Ze(()=>e.value[0]),n=a=>{const o=N0(a)?a:e.value.find(l=>l.uuid===a);o&&(e.value=[o,...e.value.filter(({uuid:l})=>l!==o.uuid)])},r=(a,o=!1)=>{e.value.some(({uuid:l})=>l===a.uuid)||(e.value.push(a),o&&n(a.uuid))},s=a=>{e.value=e.value.filter(({uuid:o})=>o!==a.uuid)};return Kn(()=>{i.aspectRatio.value&&e.value.forEach(a=>{D0(a)&&(a.aspect=i.aspectRatio.value,a.updateProjectionMatrix())})}),{activeCamera:t,cameras:e,registerCamera:r,deregisterCamera:s,setActiveCamera:n}},Uh=mt({}),Fh=i=>Object.assign(Uh.value,i),LI=(i,e,t)=>{if(!Mr(i.setPixelRatio))return;let n=0;if(t&&Array.isArray(t)&&t.length>=2){const[r,s]=t;n=h_.clamp(e,r,s)}else w0(t)?n=t:n=e;n!==i.getPixelRatio?.()&&i.setPixelRatio(n)},NI=Number.parseInt(io.replace("dev","")),DI=179;function OI(){if(NI>=DI){const i=new zd;return{getDelta:()=>i.getDelta(),getElapsed:()=>i.getElapsed(),update:()=>i.update(),start:()=>{typeof document<"u"&&i.connect(document)},stop:()=>i.disconnect()}}else{const i=new h0;return{getDelta:()=>i.getDelta(),getElapsed:()=>i.elapsedTime,update:()=>{},start:()=>i.start(),stop:()=>i.stop()}}}const UI=(i,{fpsLimit:e}={})=>{const t=OI(),n={before:Ms(),after:Ms()},{pause:r,resume:s,isActive:a}=Yd(()=>
4104{t.update();const c={delta:t.getDelta(),elapsed:t.getElapsed()};n.before.trigger(c),i(),n.after.trigger(c)},{immediate:!1,fpsLimit:e});return{start:()=>{t.start(),s()},stop:()=>{t.stop(),r()},isActive:a,onBeforeLoop:n.before.on,onLoop:n.after.on}};var FI=class extends Error{name="TresRendererError";constructor(i,e,t){super(i,t),this.code=e}};function BI({scene:i,canvas:e,options:t,fpsLimit:n,contextParts:{sizes:r,camera:s}}){const o=Mr(t.renderer)?t.renderer({sizes:r,scene:i,camera:s,canvas:e}):new qd({...t,canvas:Ki(e)}),l=mt(yt(t.renderMode)==="manual"?0:1),c=60,u=Ze(()=>yt(t.renderMode)==="on-demand"&&l.value===0),h=()=>i.value.traverse(U=>{U instanceof Dt&&U.material instanceof rn&&(U.material.needsUpdate=!0)}),d=(U=1)=>{u.value&&(l.value=Math.min(c,l.value+U))},f=()=>{if(yt(t.renderMode)!=="manual")throw new Error("advance can only be called in manual render mode.");l.value=1},p=()=>{yt(t.renderMode)==="on-demand"&&d()},_=Ze(()=>yt(t.renderMode)==="always"),g=U=>Zd(U)&&"isRenderer"in U&&!!U.isRenderer,m=Ms(),v=Ms();let b=!1;const y=mt(!1),T=mt(null),S=async()=>{try{g(o)&&await o.init(),y.value=!0}catch(U){const k=new FI(U instanceof Error?U.message:"Unknown error","INITIALIZATION_FAILED",{cause:U instanceof Error?U:void 0});T.value=k,console.error(`[TresJS] Renderer initialization failed. This may occur if: 4105 - WebGPU is not supported by your browser 4106 - GPU is not available or lacks required features 4107 - GPU drivers are outdated 4108Error details: ${k.message}`,k),v.trigger(k)}},R=Ms(),x=()=>{l.value=_.value?1:Math.max(0,l.value-1),R.trigger(o)};let M=U=>{s.activeCamera.value&&(o.render(i.value,s.activeCamera.value),U())};const A=U=>{M=U},I=UI(()=>{l.value&&M(x)},{fpsLimit:n});m.on(()=>{y.value&&I.start()}),jt([r.width,r.height,y],()=>{y.value&&(o.setSize(r.width.value,r.height.value),!b&&o.domElement.width&&o.domElement.height&&(b=!0,ma(()=>{m.trigger(o)})),p())},{immediate:!0}),Kn(()=>{y.value&&LI(o,r.pixelRatio.value,yt(t.dpr))}),S(),yt(t.renderMode)==="on-demand"&&d(),yt(t.renderMode)==="manual"&&CR(100,{callback:f});const N=Ze(()=>{const U=yt(t.clearColor),k=yt(t.clearAlpha),L=typeof U=="string"&&U.length===9&&U.startsWith("#");return L&&k!==void 0&&AI(`clearColor with alpha (e.g. ${U}) and clearAlpha cannot both be set, using clearColor as source of truth`),L?{alpha:Number.parseInt(U.slice(7,9),16)/255,color:U.slice(0,7)}:{alpha:k,color:U}});return Kn(()=>{if(!y.value)return;const U=N.value;U.color===void 0||U.alpha===void 0||o.setClearColor(U.color,U.alpha)}),Kn(()=>{if(!y.value)return;const U=t.toneMapping;U&&(o.toneMapping=U)}),Kn(()=>{if(!y.value)return;const U=t.toneMappingExposure;U&&(o.toneMappingExposure=U)}),Kn(()=>{if(!y.value)return;const U=t.outputColorSpace;U&&(o.outputColorSpace=U)}),Kn(()=>{if(!y.value)return;const U=t.shadows;U!==void 0&&(o.shadowMap.enabled=U,h())}),Kn(()=>{if(!y.value)return;const U=t.shadowMapType;U!==void 0&&(o.shadowMap.type=U,h())}),Ji(()=>{o.dispose(),"forceContextLoss"in o&&o.forceContextLoss()}),{loop:I,instance:o,advance:f,onReady:m.on,onRender:R.on,onError:v.on,invalidate:d,canBeInvalidated:u,mode:yt(t.renderMode),replaceRenderFunction:A,isInitialized:y,error:T}}function kI(i,e,t=10){const{pixelRatio:n}=LR(),r=yt(i)?BR():DR(Ze(()=>yt(e).parentElement)),s=gf(cm(r.width,t)),a=gf(cm(r.height,t));return{width:s,height:a,pixelRatio:n,aspectRatio:Ze(()=>s.value/a.value)}}function VI({canvas:i,contextParts:{scene:e,camera:t,renderer:n}}){const{update:r,destroy:s}=hI(yt(i),()=>yt(t.activeCamera),e.value),{off:a}=n.loop.onLoop(r);Ji(s),Ji(a);const o=R0(e.value),l=Ms();return o.addEventListener("click",l.trigger),{onPointerMissed:l.on}}const zI="useTres",[HI]=xR(({scene:i,canvas:e,fpsLimit:t,windowSize:n,rendererOptions:r})=>{const s=Qt(i),a=kI(n,e),o=PI({sizes:a}),l=BI({scene:s,canvas:e,options:r,fpsLimit:t,contextParts:{sizes:a,camera:o}}),c=VI({canvas:e,contextParts:{scene:s,camera:o,renderer:l}}),u={sizes:a,scene:s,camera:o,renderer:l,controls:mt(null),extend:Fh,events:c};return u.scene.value.__tres={root:u,objects:[],isUnmounting:!1},u},{injectionKey:"useTres"});function GI(i,e={},t={}){let n=i;const r=a=>{n=a};let s=new Proxy({},{});return s=new Proxy({},{has(a,o){return o in e||o in n},get(a,o,l){return o in e?e[o](n):n[o]},set(a,o,l){return t[o]?t[o](l,n,s,r):n[o]=l,!0}}),s}const WI=["onClick","onContextmenu","onPointermove","onPointerenter","onPointerleave","onPointerover","onPointerout","onDblclick","onPointerdown","onPointerup","onPointercancel","onLostpointercapture","onWheel"],XI={onClick:"click",onContextmenu:"contextmenu",onPointermove:"pointermove",onPointerenter:"pointerenter",onPointerleave:"pointerleave",onPointerover:"pointerover",onPointerout:"pointerout",onDblclick:"dblclick",onPointerdown:"pointerdown",onPointerup:"pointerup",onPointercancel:"pointercancel",onLostpointercapture:"lostpointercapture",onWheel:"wheel"},Tm=i=>WI.includes(i),wm=Symbol("tresTextNode"),Am=Symbol("tresComment"),qI=({context:i,options:e={primitivePrefix:""}})=>{const t=i.scene.value,n=()=>
4108{if(!t?.__tres?.isUnmounting)return{[wm]:!0,__tres:{parent:null}}},r=()=>({[Am]:!0,__tres:{parent:null}}),s=p=>!!p&&typeof p=="object"&&wm in p,a=p=>!!p&&typeof p=="object"&&Am in p;function o(p,_,g,m){if(m||(m={}),m.args||(m.args=[]),_I(p))return null;p.includes("-")&&(p=p.replace(/-([a-z])/g,(y,T)=>T.toUpperCase()).replace(/^[a-z]/,y=>y.toUpperCase()));let v=p.replace("Tres",""),b;if(p===`${e?.primitivePrefix??""}primitive`){(!Zd(m.object)||xs(m.object))&&Sm("Tres primitives need an 'object' prop, whose value is an object or shallowRef<object>"),v=m.object.type;const y={};b=GI(m.object,{object:T=>T,isPrimitive:()=>!0,__tres:()=>y},{object:(T,S,R,x)=>{II(T,R,x,{patchProp:u,remove:c,insert:l},i)},__tres:T=>{Object.assign(y,T)}})}else{const y=Uh.value[v];y||Sm(`${v} is not defined on the THREE namespace. Use extend to add it to the catalog.`),b=new y(...m.args)}return b?(vs(b)&&(m?.position||b.position.set(3,3,3),m?.lookAt||b.lookAt(0,0,0)),b=br(b,{...TI(b)?b.__tres:{},type:v,memoizedProps:m,primitive:p==="primitive",attach:m.attach},i),b):null}function l(p,_,g){if(!p)return;if(_=_||t,s(p)||a(p)){const b=_.__tres?_:br(_,{},i);if(p.__tres.parent=b,b.__tres.objects){const y=g?b.__tres.objects.findIndex(T=>T===g):-1;y>=0?b.__tres.objects.splice(y,0,p):b.__tres.objects.push(p)}return}const m=p.__tres?p:br(p,{},i),v=_.__tres?_:br(_,{},i);if(p=Fs(m),_=Fs(v),vs(p)&&i.camera?.registerCamera(p),m.__tres.attach?CI(v,m,m.__tres.attach):Nh(p)&&Nh(v)&&(v.add(p),p.dispatchEvent({type:"added"})),m.__tres.parent=v,v.__tres.objects&&!v.__tres.objects.includes(m)){const b=g?v.__tres.objects.findIndex(y=>y===g):-1;~b?v.__tres.objects.splice(b,0,m):v.__tres.objects.push(m)}}function c(p,_){if(!p)return;if(s(p)||a(p)){const b=p.__tres.parent;b?.__tres?.objects&&k0(b.__tres.objects,y=>y!==p),p.__tres.parent=null;return}_=Lh(_)?"default":_;const g=p.__tres?.dispose;Lh(g)||(g===null?_=!1:_=g);const m=p.__tres?.primitive,v=_==="default"?!m:!!_;
4108if(p.__tres&&"objects"in p.__tres&&[...p.__tres.objects].forEach(b=>c(b,_)),v&&p.children&&[...p.children].forEach(b=>c(b,_)),z0(p,i),H0(p,i),v&&!jd(p)){if(Mr(_))_(p);else if(Mr(p.dispose))try{p.dispose()}catch{}}"__tres"in p&&delete p.__tres}function u(p,_,g,m){if(!p)return;let v=p;const b=_;if(p.__tres&&(p.__tres.memoizedProps[_]=m),_==="attach"){const R=p.__tres?.parent||p.parent;c(p),br(p,{attach:m},i),R&&l(p,R);return}if(_==="dispose"){p.__tres||(p=br(p,{},i)),p.__tres.dispose=m;return}Tm(_)&&Mr(m)&&p.addEventListener(XI[_],m);let y=hm(b),T=v?.[y];if(b==="args"){const R=p,x=g??[],M=m??[],A=p.__tres?.type||p.type;if(A&&x.length&&!T0(x,M)){const I=new Uh.value[A](...m),N=Object.getOwnPropertyDescriptors(I);Object.entries(N).forEach(([U,k])=>{if(!(!k.writable&&!k.set)&&U in R)try{R[U]=I[U]}catch(L){console.warn(`Could not set property ${U} on ${A}:`,L)}}),v=R}return}if(v.type==="BufferGeometry"){if(b==="args")return;v.setAttribute(hm(b),new ut(...m));return}if(b.includes("-")&&T===void 0){const R=gc(v,b);if(T=R.target,v=R.target,y=R.key,T&&y){T[y]=m,vs(p)&&p.updateProjectionMatrix(),Oh(p);return}}let S=m;if(S===""&&(S=!0),Mr(T)){Tm(_)||(Array.isArray(S)?p[y](...S):p[y](S)),y.startsWith("on")&&Mr(S)&&(v[y]=S);return}bm(T)&&bm(S)?T.mask=S.mask:O0(T)&&xI(S)?T.set(S):bI(T)&&SI(S)&&T.constructor===S.constructor?T.copy(S):Dh(T)&&Array.isArray(S)?"fromArray"in T&&typeof T.fromArray=="function"?T.fromArray(S):T.set(...S):Dh(T)&&typeof S=="number"?"setScalar"in T&&typeof T.setScalar=="function"?T.setScalar(S):T.set(S):v[y]=S,vs(p)&&p.updateProjectionMatrix(),Oh(p)}function h(p){return p?.__tres?.parent||null}function d(p){if(!p||!("__tres"in p))return null;const _=h(p)?.__tres?.objects||[],g=_.findIndex(m=>m===p);return g<0||g>=_.length-1?null:_[g+1]}const f=()=>{};return{insert:l,remove:c,createElement:o,patchProp:u,parentNode:h,createText:n,createComment:r,setText:f,setElementText:f,nextSibling:d,querySelector:f,setScopeId:f,cloneNode:f,insertStaticContent:f}},Qd=new Map,Cm=i=>Qd.get(i),$I=(i,e)=>{Qd.set(i,e)},YI=i=>Qd.delete(i),ZI=["asset-load"];var KI=class{subscribers=new Set;messageQueue=[];maxQueueSize=100;send(i,e){const t={type:i,data:e,timestamp:Date.now()};this.subscribers.size>0?this.subscribers.forEach(n=>n(t)):ZI.includes(i)&&this.queueMessage(t)}queueMessage(i){this.messageQueue.push(i),this.messageQueue.length>this.maxQueueSize&&this.messageQueue.shift()}flushQueue(){this.messageQueue.length===0||this.subscribers.size===0||(this.messageQueue.forEach(i=>{this.subscribers.forEach(e=>e(i))}),this.messageQueue=[])}subscribe(i){return this.subscribers.add(i),this.flushQueue(),()=>{this.subscribers.delete(i)}}get hasSubscribers(){return this.subscribers.size>0}get queueSize(){return this.messageQueue.length}clearQueue(){this.messageQueue=[]}};function JI(i,e){const t=`â² â â${i}`;typeof Rm=="function"?Rm(t,e):console.log(t)}function Rm(i,e){throw new Error(i+e)}function ef(i){let e=0;return i.traverse(t=>{if(L0(t)&&t.type!=="HightlightMesh"){const n=t.geometry,r=n.attributes.position.count*3*Float32Array.BYTES_PER_ELEMENT,s=n.index?n.index.count*Uint32Array.BYTES_PER_ELEMENT:0,a=n.attributes.normal?n.attributes.normal.count*3*Float32Array.BYTES_PER_ELEMENT:0,o=n.attributes.uv?n.attributes.uv.count*2*Float32Array.BYTES_PER_ELEMENT:0,l=r+s+a+o;e+=l}}),e}function Im(i,e,t){i.push(e),i.length>t&&i.shift()}function jI(i){return(i/1024).toFixed(2)}function QI(i){if(!i)return;typeof window<"u"&&!window.__TRES__DEVTOOLS__&&(window.__TRES__DEVTOOLS__=new KI);const e={maxFrames:160,fps:{value:0,accumulator:[]},memory:{currentMem:0,allocatedMem:0,accumulator:[]}},t=100,n=OR({every:t}),{isSupported:r,memory:s}=FR({}),a=160;let o=performance.now(),l=0;const c=1,u=({timestamp:d})=>{i.scene.value&&(e.memory.allocatedMem=ef(i.scene.value)),d-o>=t&&(o=d,Im(e.fps.accumulator,n.value,a),e.fps.value=n.value,r.value&&s.value?.usedJSHeapSize&&(Im(e.memory.accumulator,s.value.usedJSHeapSize/1024/1024,a),e.memory.accumulator.length>0&&(e.memory.currentMem=e.memory.accumulator.reduce((f,p)=>f+p,0)/e.memory.accumulator.length)))},{pause:h}=Yd(({delta:d})=>{window.__TRES__DEVTOOLS__&&(u({timestamp:performance.now()}),l+=d,l>
4108=c&&(window.__TRES__DEVTOOLS__.send("context",i),window.__TRES__DEVTOOLS__.send("performance",e),l=0))},{immediate:!0});Ji(()=>{h()})}const G0=(i,e)=>{if(i.uuid===e)return i;for(const t of i.children){const n=G0(t,e);if(n)return n}};var eP=class extends Dt{type="HightlightMesh";createTime;constructor(...i){super(...i),this.createTime=Date.now()}onBeforeRender(){const i=(Date.now()-this.createTime)/1e3,e=1+.07*Math.sin(2.5*i);this.scale.set(e,e,e)}};const W0=i=>{const e={id:`scene-${i.uuid}`,label:i.type,children:[],tags:[]};i.name!==""&&e.tags.push({label:i.name,textColor:5750629,backgroundColor:15793395});const t=ef(i);return t>0&&e.tags.push({label:`${jI(t)} KB`,textColor:15707189,backgroundColor:16775644,tooltip:"Memory usage"}),i.type.includes("Light")&&(yI(i)&&e.tags.push({label:`${i.intensity}`,textColor:9738662,backgroundColor:16316922,tooltip:"Intensity"}),e.tags.push({label:`#${new Ee(i.color).getHexString()}`,textColor:9738662,backgroundColor:16316922,tooltip:"Color"})),i.type.includes("Camera")&&(e.tags.push({label:`${i.fov}°`,textColor:9738662,backgroundColor:16316922,tooltip:"Field of view"}),e.tags.push({label:`x: ${Math.round(i.position.x)} y: ${Math.round(i.position.y)} z: ${Math.round(i.position.z)}`,textColor:9738662,backgroundColor:16316922,tooltip:"Position"})),e};function tP(i,e,t=""){return{id:`context-${e}-${t?`${t}.${i}`:i}`,label:i,children:[],tags:[]}}function X0(i,e,t=""){i.children.forEach(n=>{if(n.type==="HightlightMesh"||t&&!n.type.includes(t)&&!n.name.includes(t))return;const r=W0(n);e.children.push(r),X0(n,r,t)})}function Bh(i,e,t=new WeakSet,n=0,r=4,s,a=""){if(n>=r||!i||t.has(i))return;const o=n===0?i?.scene?.value?.uuid||Math.random().toString(36).slice(2,11):s;t.add(i),Object.entries(i).forEach(([l,c])=>{if(l.startsWith("_")||typeof c=="function")return;const u=a?`${a}.${l}`:l,h=tP(l,o,a);l!=="scene"&&(xs(c)?(h.tags.push({label:`Ref<${typeof c.value}>`,textColor:4372611,backgroundColor:15793395}),c.value&&typeof c.value=="object"?Bh(c.value,h,t,n+1,r,o,u):h.label=`${l}: ${JSON.stringify(c.value)}`):c&&typeof c=="object"&&!Array.isArray(c)?Object.keys(c).length>0?t.has(c)?h.tags.push({label:"Circular",textColor:16711680,backgroundColor:16773360}):Bh(c,h,t,n+1,r,o,u):h.label=`${l}: {}`:Array.isArray(c)?(h.label=`${l}: Array(${c.length})`,h.tags.push({label:`length: ${c.length}`,textColor:9738662,backgroundColor:16316922})):h.label=`${l}: ${JSON.stringify(c)}`,e.children.push(h))})}const nP=i=>e=>{if(e.inspectorId===eo){const t=W0(i.scene.value);X0(i.scene.value,t,e.filter);const n={id:"context-root",label:"Context",children:[],tags:[]};Bh(i,n),e.rootNodes=[t,n]}},iP=(i,{highlightMesh:e,prevInstance:t})=>n=>{if(n.inspectorId!==eo)return;const r=new Oi({color:11003607,transparent:!0,opacity:.2,depthTest:!1,side:jn});if(n.nodeId.includes("scene")){const s=n.nodeId.match(/^scene-(.+)$/),a=s?s[1]:null;if(!a)return;const[o]=i.scene.value.getObjectsByProperty("uuid",a);if(!o)return;if(t&&e&&e.parent&&t.remove(e),L0(o)){const l=new eP(o.geometry.clone(),r);o.add(l),e=l,t=o}if(n.state={object:Object.entries(o).map(([l,c])=>l==="children"?{key:l,value:c.filter(u=>u.type!=="HightlightMesh")}:{key:l,value:c,editable:!0}).filter(({key:l})=>l!=="parent")},jd(o)){const l={...n.state,state:[{key:"Scene Info",value:{objects:o.children.length,memory:ef(o),calls:i.renderer.instance.info.render.calls,triangles:i.renderer.instance.info.render.triangles,points:i.renderer.instance.info.render.points,lines:i.renderer.instance.info.render.lines}}]};"programs"in i.renderer.instance.info&&l.state.push({key:"Programs",value:i.renderer.instance.info.programs?.map(c=>({...c,programName:c.name}))}),n.state=l}}else if(n.nodeId.includes("context")){const s=n.nodeId.match(/^context-([^-]+(?:-[^-]+)*)-(.+)$/),a=s?s[2]:"context";if(!a||a==="context"){n.state={object:Object.entries(i).filter(([c])=>!c.startsWith("_")&&c!=="parent").map(([c,u])=>({key:c,value:xs(u)?u.value:u,editable:!1}))};return}const o=a.split(".");let l=i;for(const c of o){if(!l||typeof l!="object")break;l=xs(l[c])?l[c].value:l[c]}l!==void 0&&(n.state={object:Object.entries(l).filter(([c])=>!c.startsWith("_")&&c!=="parent").map(([c,u])=>xs(u)?{key:c,value:u.value,editable:!1}:typeof u=="function"?{key:c,value:"Æ()",editable:!1}:u&&typeof u=="object"?{key:c,value:Array.isArray(u)?`Array(${u.length})`:"Object",editable:!1}:{key:c,value:u,editable:!1})})}},rP=(i,e,t,n)=>{const r=G0(i,e);if(!r){console.warn("Object with UUID not found in the scene.");return}let s=r;for(let o=0;o<t.length-1;o++)if(s[t[o]]!==void 0)s=s[t[o]];
4108else{console.warn(`Property path is not valid: ${t.join(".")}`);return}const a=t[t.length-1];s[a]!==void 0?s[a]=n:console.warn(`Property path is not valid: ${t.join(".")}`)},sP=i=>e=>{if(e.inspectorId===eo&&e.nodeId.includes("scene")){const t=e.nodeId.match(/^scene-(.+)$/),n=t?t[1]:null;if(!n)return;rP(i.scene.value,n,e.path,e.state.value)}},eo="tres:inspector";function aP(i,e){const t={id:"dev.esm.tres",label:"TresJS ðª",logo:"https://raw.githubusercontent.com/Tresjs/tres/main/public/favicon.svg",packageName:"tresjs",homepage:"https://docs.tresjs.org",app:i},n=null,r=null;QI(e),Nx(t,s=>{typeof s.now!="function"&&JI("You seem to be using an outdated version of Vue Devtools. Are you still using the Beta release instead of the stable one? You can find the links at https://devtools.vuejs.org/guide/installation.html."),s.addInspector({id:eo,label:"TresJS ðª",icon:"account_tree",treeFilterPlaceholder:"Search instances"}),setInterval(()=>{s.sendInspectorTree(eo)},1e3),setInterval(()=>{s.notifyComponentUpdate()},5e3),s.on.getInspectorTree(nP(e)),s.on.getInspectorState(iP(e,{highlightMesh:n,prevInstance:r})),s.on.editInspectorState(sP(e))})}var oP=Mt({__name:"Context",props:{camera:{type:null,required:!1},windowSize:{type:Boolean,required:!1},fpsLimit:{type:Number,required:!1},enableProvideBridge:{type:Boolean,required:!1},customRendererOptions:{type:Object,required:!1},antialias:{type:Boolean,required:!1},stencil:{type:Boolean,required:!1},depth:{type:Boolean,required:!1},precision:{type:String,required:!1},logarithmicDepthBuffer:{type:Boolean,required:!1},preserveDrawingBuffer:{type:Boolean,required:!1},powerPreference:{type:null,required:!1},alpha:{type:Boolean,required:!1},premultipliedAlpha:{type:Boolean,required:!1},failIfMajorPerformanceCaveat:{type:Boolean,required:!1},clearColor:{type:[Object,String,Number],required:!1},clearAlpha:{type:Number,required:!1},shadows:{type:Boolean,required:!1},toneMapping:{type:null,required:!1},shadowMapType:{type:null,required:!1},useLegacyLights:{type:Boolean,required:!1},outputColorSpace:{type:null,required:!1},toneMappingExposure:{type:Number,required:!1},renderMode:{type:String,required:!1},dpr:{type:[Number,Array],required:!1},renderer:{type:Function,required:!1},canvas:{type:null,required:!0}},emits:["ready","error","pointermissed","render","beforeLoop","loop","click","contextmenu","pointermove","pointerenter","pointerleave","pointerover","pointerout","dblclick","pointerdown","pointerup","pointercancel","lostpointercapture","wheel"],setup(i,{expose:e,emit:t}){const n=i,r=t,s=uv(),a=Qt(new Uc),o=As();Fh(_R);const l=(y,T)=>Mt({setup(){const S=As()?.appContext;S&&(S.app=o?.appContext.app);const R={};function x(M){M&&(M.parent&&x(M.parent),M.provides&&Object.assign(R,M.provides))}return o?.parent&&n.enableProvideBridge&&(x(o.parent),Reflect.ownKeys(R).forEach(M=>{ga(M,R[M])})),ga(zI,y),ga("extend",Fh),typeof window<"u"&&S?.app&&aP(S?.app,y),()=>(T.value,mf(en,null,s.default?.()??[]))}}),c=y=>{const T=n.canvas;if(Cm(T))return;const S=mt(0),R=l(y,S),x=hv(qI({context:y,options:n.customRendererOptions}));x.render(mf(R),a.value),$I(T,{renderer:x,internalComponent:R,hmrTick:S,context:y})},u=(y,T=!1)=>{V0(y.scene.value),T&&(y.renderer.instance.dispose(),y.renderer.instance instanceof qd&&(y.renderer.instance.renderLists.dispose(),y.renderer.instance.forceContextLoss())),a.value.__tres={root:y,objects:[],isUnmounting:!0}},h=Qt(HI({scene:a.value,canvas:n.canvas,fpsLimit:()=>n.fpsLimit??1/0,windowSize:n.windowSize??!1,rendererOptions:n}));e({context:h,dispose:()=>u(h.value,!0)});const d=()=>{const y=Cm(n.canvas);if(!y)return;(S=>jd(S)&&"__tres"in S)(a.value)&&(a.value.__tres.isUnmounting=!0),y.renderer.render(null,a.value),u(h.value),YI(n.canvas)},{camera:f,renderer:p}=h.value,{registerCamera:_,cameras:g,activeCamera:m,deregisterCamera:v}=f,b=()=>{const y=new Jt(45,window.innerWidth/window.innerHeight,.1,1e3);y.position.set(3,3,3),y.lookAt(0,0,0),_(y);const T=Kn(()=>{g.value.length>=2&&(y.removeFromParent(),v(y),T?.())})};return h.value.events.onPointerMissed(y=>{r("pointermissed",y)}),jt(()=>n.camera,(y,T)=>{y&&_(yt(y),!0),T&&(yt(T).removeFromParent(),v(yt(T)))},{immediate:!0}),p.onRender(()=>{h.value&&r("render",h.value)}),p.loop.onLoop(y=>{h.value&&r("loop",{...h.value,...y})}),p.loop.onBeforeLoop(y=>{h.value&&r("beforeLoop",{...h.value,...y})}),p.onReady(()=>{c(h.value),r("ready",h.value),m.value||b()}),p.onError(y=>{r("error",y)}),Di(async()=>{await ER(3e3),(!h.value.sizes.width||!h.value.sizes.height.value)&&console.warn("TresCanvas: The canvas has no area, so nothing can be rendered. Set it manually on the parent element or use the prop windowSize.")}),Ji(d),()=>{}}}),lP=oP;const cP=["data-scene","data-tres"];var uP=Mt({__name:"TresCanvas",props:{camera:{type:null,required:!1},windowSize:{type:Boolean,required:!1,default:void 0},fpsLimit:{type:Number,required:!1},enableProvideBridge:{type:Boolean,required:!1,default:!0},customRendererOptions:{type:Object,required:!1},antialias:{type:Boolean,required:!1,default:!0},stencil:{type:Boolean,required:!1,default:void 0},depth:{type:Boolean,required:!1,default:void 0},precision:{type:String,required:!1},logarithmicDepthBuffer:{type:Boolean,required:!1,default:void 0},preserveDrawingBuffer:{type:Boolean,required:!1,default:void 0},powerPreference:{type:null,required:!1},alpha:{type:Boolean,required:!1,default:void 0},premultipliedAlpha:{type:Boolean,required:!1},failIfMajorPerformanceCaveat:{type:Boolean,required:!1,default:void 0},clearColor:{type:[Object,String,Number],required:!1,default:"#000000"},clearAlpha:{type:Number,required:!1,default:1},shadows:{type:Boolean,required:!1,default:void 0},toneMapping:{type:null,required:!1,default:bc},shadowMapType:{type:null,required:!1,default:td},useLegacyLights:{type:Boolean,required:!1,default:void 0},outputColorSpace:{type:null,required:!1},toneMappingExposure:{type:Number,required:!1},renderMode:{type:String,required:!1,default:"always"},dpr:{type:[Number,Array],required:!1},renderer:{type:Function,required:!1}},emits:["ready","error","pointermissed","render","beforeLoop","loop","click","contextmenu","pointermove","pointerenter","pointerleave","pointerover","pointerout","dblclick","pointerdown","pointerup","pointercancel","lostpointercapture","wheel"],setup(i,{expose:e,emit:t}){const n=i,r=t,s=mt(),a=Qt();return e({get context(){return a.value?.context},dispose:()=>a.value?.dispose()}),(o,l)=>(ae(),ht("canvas",{ref_key:"canvasRef",ref:s,"data-scene":a.value?.context?.scene.value.uuid,class:Ot(o.$attrs.class),"data-tres":`tresjs ${re(pI)}`,style:ws({display:"block",width:"100%",height:"100%",position:i.windowSize?"fixed":"relative",top:0,left:0,pointerEvents:"auto",touchAction:"none",...o.$attrs.style})}
4108,[s.value?(ae(),Xe(lP,cv({key:0,ref_key:"contextRef",ref:a,canvas:s.value},n,{onReady:l[0]||(l[0]=c=>r("ready",c)),onError:l[1]||(l[1]=c=>r("error",c)),onPointermissed:l[2]||(l[2]=c=>r("pointermissed",c)),onRender:l[3]||(l[3]=c=>r("render",c)),onBeforeLoop:l[4]||(l[4]=c=>r("beforeLoop",c)),onLoop:l[5]||(l[5]=c=>r("loop",c)),onClick:l[6]||(l[6]=c=>r("click",c)),onContextmenu:l[7]||(l[7]=c=>r("contextmenu",c)),onPointermove:l[8]||(l[8]=c=>r("pointermove",c)),onPointerenter:l[9]||(l[9]=c=>r("pointerenter",c)),onPointerleave:l[10]||(l[10]=c=>r("pointerleave",c)),onPointerover:l[11]||(l[11]=c=>r("pointerover",c)),onPointerout:l[12]||(l[12]=c=>r("pointerout",c)),onDblclick:l[13]||(l[13]=c=>r("dblclick",c)),onPointerdown:l[14]||(l[14]=c=>r("pointerdown",c)),onPointerup:l[15]||(l[15]=c=>r("pointerup",c)),onPointercancel:l[16]||(l[16]=c=>r("pointercancel",c)),onLostpointercapture:l[17]||(l[17]=c=>r("lostpointercapture",c)),onWheel:l[18]||(l[18]=c=>r("wheel",c))}),{default:Be(()=>[Ar(o.$slots,"default")]),_:3},16,["canvas"])):xt("v-if",!0)],14,cP))}}),hP=uP;const dP=`uniform float uTime; 4109uniform float uAspect; 4110uniform float uScrollOffset; 4111uniform vec2 uMouseNDC; 4112uniform float uInfluence; 4113uniform vec3 uBaseColor; 4114 4115attribute float aInitialAngle; 4116attribute float aDistance; 4117// this can probably go 4118attribute float aBaseZ; 4119 4120varying vec3 vColor; 4121 4122const float ATTRACTION_RANGE_NDC = 0.4; 4123const float MAGNETIC_RANGE_NDC = 0.05; 4124const float ATTRACTION_STRENGTH_NDC = 0.08; 4125const float SCROLL_OFFSET_STRENGTH = 0.2; 4126 4127// these can be passed in 4128const float ROTATION_SPEED = 0.0003; 4129const float TIME_MULTIPLIER = -(1000.0 / 16.6) * ROTATION_SPEED; 4130const float PARTICLE_SIZE = 4.5; 4131 4132void main() { 4133 vColor = uBaseColor; 4134 float distanceWithScroll = aDistance + uScrollOffset * SCROLL_OFFSET_STRENGTH; 4135 float angularSpeed = aDistance * TIME_MULTIPLIER; 4136 float currentAngle = aInitialAngle - angularSpeed * uTime; 4137 4138 vec3 localPos; 4139 localPos.x = cos(currentAngle) * distanceWithScroll; 4140 localPos.y = sin(currentAngle) * distanceWithScroll * uAspect; 4141 localPos.z = aBaseZ; 4142 4143 vec4 worldPos = modelMatrix * vec4(localPos, 1.0); 4144 vec4 viewPos = viewMatrix * worldPos; 4145 vec4 projectedPos = projectionMatrix * viewPos; 4146 vec3 ndc = projectedPos.xyz / projectedPos.w; 4147 4148 vec3 finalNdc = ndc; 4149 4150 if (uInfluence > 0.0) { 4151 // extracting camera aspect ratio from projection matrix 4152 float cameraAspect = projectionMatrix[1][1] / projectionMatrix[0][0]; 4153 4154 vec2 particleToMouse = uMouseNDC - ndc.xy; 4155 particleToMouse.x *= cameraAspect; 4156 float distToMouse = length(particleToMouse); 4157 4158 if (distToMouse > 0.0 && distToMouse < ATTRACTION_RANGE_NDC) { 4159 vec2 dirNorm = normalize(particleToMouse); 4160 float outerRatio = (distToMouse - MAGNETIC_RANGE_NDC) / (ATTRACTION_RANGE_NDC - MAGNETIC_RANGE_NDC); 4161 float attractionForce = (1.0 - outerRatio) * ATTRACTION_STRENGTH_NDC; 4162 4163 float forceStrength = min(attractionForce, distToMouse - MAGNETIC_RANGE_NDC) * uInfluence; 4164 finalNdc.xy += (dirNorm / vec2(cameraAspect, 1.0)) * forceStrength; 4165 } 4166 } 4167 4168 gl_Position = vec4(finalNdc.xy * projectedPos.w, projectedPos.z, projectedPos.w); 4169 gl_PointSize = PARTICLE_SIZE; 4170}`,Pm=`varying vec3 vColor; 4171 4172void main() { 4173 gl_FragColor = vec4(vColor, 1.0); 4174 #include <tonemapping_fragment> 4175 #include <colorspace_fragment> 4176} 4177`,fP=`uniform vec3 uBaseColor; 4178uniform vec3 uHighlightBaseColor; 4179uniform vec3 uHoverColor; 4180uniform float uTime; 4181uniform float uAspect; 4182uniform float uScrollOffset; 4183 4184attribute float aDistance; 4185attribute float aInitialAngle; 4186attribute float aBaseZ; 4187attribute float aHover; 4188 4189varying vec3 vColor; 4190 4191const float SCROLL_OFFSET_STRENGTH = 0.2; 4192const float ROTATION_SPEED = 0.0003; 4193const float TIME_MULTIPLIER = -(1000.0 / 16.6) * ROTATION_SPEED; 4194const float MIN_PARTICLE_SIZE = 0.0045; 4195const float MAX_PARTICLE_SIZE = 0.01; 4196 4197void main() { 4198 float distanceWithScroll = aDistance + uScrollOffset * SCROLL_OFFSET_STRENGTH; 4199 float angularSpeed = aDistance * TIME_MULTIPLIER; 4200 float currentAngle = aInitialAngle - angularSpeed * uTime; 4201 vec3 localPosition = vec3( 4202 cos(currentAngle) * distanceWithScroll, 4203 sin(currentAngle) * distanceWithScroll * uAspect, 4204 aBaseZ 4205 ); 4206 4207 vColor = mix(uHighlightBaseColor, uHoverColor, aHover); 4208
4209 vec4 viewPosition = modelViewMatrix * vec4(localPosition, 1.0); 4210 gl_Position = projectionMatrix * viewPosition; 4211 gl_PointSize = mix(MIN_PARTICLE_SIZE, MAX_PARTICLE_SIZE, aHover) * (1000.0 / -viewPosition.z); 4212}`,pP=["object"],mP=["object"],gP="#53616D",_P="#5C6874",vP="#00D16A",xr=3e3,wi=200,xP=3e-4,yP=Mt({__name:"footer-globe-particles",props:{aspect:{}},setup(i,{expose:e}){const t=Math.PI*2,n=dv(.1,1,.35,1),r=["$","â¬","Â¥","£"],s=mt(null),a=mt(null),o=mt(null),l=new et,c=new et,u=new Ee(gP),h=new Float32Array(xr*3),d=new Float32Array(xr),f=new Float32Array(xr),p=new Float32Array(xr),_=new Float32Array(xr),g=new Float32Array(wi*3),m=new Float32Array(wi),v=new Float32Array(wi),b=new Float32Array(wi),y=new Float32Array(wi),T=new Array(wi),S=new Float32Array(wi),R=-60.24096385542168*xP,x=Math.PI*(3-Math.sqrt(5)),M=(F,O,X,$,te)=>(F-O)/(X-O)*(te-$)+$;for(let F=0;F<xr;F++){const O=M(n(Math.random()),0,1,.55,1),X=t/xr*F,$=O*R,te=Math.random()*.2;d[F]=O,f[F]=X,p[F]=$,_[F]=te,h[F*3]=Math.cos(X)*O*i.aspect,h[F*3+1]=Math.sin(X)*O,h[F*3+2]=te}l.setAttribute("position",new ut(h,3)),l.setAttribute("aDistance",new ut(d,1)),l.setAttribute("aInitialAngle",new ut(f,1)),l.setAttribute("aBaseZ",new ut(_,1));for(let F=0;F<wi;F++){const O=(F+.5)/wi,X=.55,$=1,te=Math.sqrt(X*X+O*($*$-X*X)),ue=F*x%t,xe=te*R,He=.2+Math.random()*.1;m[F]=te,v[F]=ue,b[F]=xe,y[F]=He;const Ke=M(Math.pow(Math.random(),2.5),0,1,10,1e4);T[F]=`${wg(r)}${Math.round(Ke)}.00`,g[F*3]=Math.cos(ue)*te,g[F*3+1]=Math.sin(ue)*te*i.aspect,g[F*3+2]=He}c.setAttribute("position",new ut(g,3)),c.setAttribute("aDistance",new ut(m,1)),c.setAttribute("aInitialAngle",new ut(v,1)),c.setAttribute("aBaseZ",new ut(y,1));const A=new ut(S,1).setUsage(o_);c.setAttribute("aHover",A);const I={uTime:{value:0},uAspect:{value:i.aspect},uScrollOffset:{value:0},uMouseNDC:{value:new j},uInfluence:{value:0},uBaseColor:{value:u},uHighlightBaseColor:{value:new Ee(_P)},uHoverColor:{value:new Ee(vP)}},N=new Cn({uniforms:I,vertexShader:dP,fragmentShader:Pm,transparent:!0}),U=new Cn({uniforms:I,vertexShader:fP,fragmentShader:Pm}),k=new cc(l,N),L=new cc(c,U);return L.frustumCulled=!1,e({baseParticles:s,highlightParticles:a,baseMaterial:N,baseDistances:d,baseInitialAngles:f,baseAngularSpeeds:p,baseZs:_,hlDistances:m,rotatingGroup:o,hlInitialAngles:v,hlAngularSpeeds:b,hlZs:y,hlHoverAttribute:A,hlLabels:T}),(F,O)=>(ae(),ht("TresGroup",{ref_key:"rotatingGroupRef",ref:o},[Qe("primitive",{ref_key:"baseParticlesRef",ref:s,object:re(k)},null,8,pP),Qe("primitive",{ref_key:"highlightParticlesRef",ref:a,object:re(L)},null,8,mP)],512))}}),bP=Object.assign(yP,{__name:"CanvasFooterGlobeParticles"}),SP=2,MP=50,Lm=.5,EP=Mt({__name:"scramble-text-overlay",props:{text:{},x:{},y:{},isHovered:{type:Boolean}},emits:["complete"],setup(i,{emit:e}){const t=i,n=e,r=mt(""),s=mt(!1),a="!@#$%^&*():{};[]|,.<>/?".split(""),o=mt(0);let l=null,c=null;const u=()=>{const _=o.value*t.text.length*2,g=t.text.split("").map((m,v)=>_/SP>v?m:wg(a)).join("");r.value=g},h=()=>{c||(u(),c=fv(u,MP))},d=()=>{c&&(clearInterval(c),c=null)},f=()=>{s.value=!0,h(),l&&l.stop(),l=vf(o.value,1,{duration:Lm,ease:"easeOut",onUpdate:_=>{o.value=_},onComplete:()=>{d(),r.value=t.text}})},p=()=>{h(),l&&l.stop(),l=vf(o.value,0,{duration:Lm,ease:"easeInOut",onUpdate:_=>{o.value=_},onComplete:()=>{d(),r.value="",s.value=!1,setTimeout(()=>n("complete"),300)}})};return Di(()=>{f()}),jt(()=>t.isHovered,_=>{_?f():p()}),Ji(()=>{l&&l.stop(),d()}),(_,g)=>(ae(),ht("div",{class:Ot(["absolute whitespace-nowrap text-xs font-mono px-2 py-1 rounded-sm text-[--color-black-1900] transition-opacity duration-300 pointer-events-none z-10 shadow-sm bg-[--color-green-900]",s.value?"visible":"invisible"]),style:ws({left:_.x+"%",top:_.y+"%",transform:"translate(5px, -50%)"})},_n(r.value),7))}}),TP=Object.assign(EP,{__name:"CanvasScrambleTextOverlay"}),wP={stiffness:100,damping:30,restDelta:.001};function AP(i,e){const t=e?.reducedMotionValue,n=Vs(),r=gv(0),s=yv(i,wP);return Wm(s,"change",a=>{n.value||r.set(a)}),jt(n,a=>{r.set(a?t:s.get())},{immediate:!0}),r}const CP=["position","look-at","rotate-z"],RP={class:"pointer-events-none absolute inset-0 overflow-hidden"},IP=.2,PP=.05,Nm=.08,LP=Mt({__name:"footer-globe",props:{scrollYProgress:{}},setup(i){const e=mt(null),t=mt(null),n=mt(new j),r=mt(!1),s=mt(0),a=new P,o=new Set,l=new Set,c=mt(!1),u=mt(!0),h=Vs(),d=Ze(()=>c.value&&u.value&&!h.value);let f=null;const p=mt(new Map),_=AP(i.scrollYProgress,{reducedMotionValue:1}),g=zm(_,[0,1],[1,0]),m=L=>{const F=e.value;if(!F)return;const O=F.getBoundingClientRect(),X=L.clientY>=O.top&&L.clientY<=O.bottom;if(r.value=X,X){const $=(L.clientX-O.left)/O.width,te=(L.clientY-O.top)/O.height;n.value.x=$*2-1,n.value.y=-(te*2)+1}},v=()=>{r.value=!1},b=()=>{u.value=document.visibilityState==="visible"};Di(()=>{e.value?.addEventListener("mousemove",m,{passive:!0}),e.value?.addEventListener("mouseleave",v),b(),document.addEventListener("visibilitychange",b),e.value&&"IntersectionObserver"in window?(f=new IntersectionObserver(([L])=>{c.value=L?.isIntersecting??!1},{threshold:.01}),f.observe(e.value)):c.value=!0}),Ji(()=>{e.value?.removeEventListener("mousemove",m),e.value?.removeEventListener("mouseleave",v),document.removeEventListener("visibilitychange",b),f?.disconnect()});
4212const y={current:new P,target:new P,lerp:L=>.03*(L/16.6)},T=mt(null);let S=0;const R=L=>(L+1)/2*100,x=L=>{const F=Math.max(L.aspect*.35,1);return T.value=F,F},M=(L,F)=>{!t.value||o.has(L)===F||(F?o.add(L):o.delete(L),l.add(L))},A=()=>{const L=t.value;if(L)for(const F of[...l]){const O=L.hlHoverAttribute.array[F],X=o.has(F)?1:0,$=O+(X-O)*.15;L.hlHoverAttribute.array[F]=Math.abs(X-$)<.001?X:$,L.hlHoverAttribute.addUpdateRange(F,1),L.hlHoverAttribute.needsUpdate=!0,L.hlHoverAttribute.array[F]===X&&l.delete(F)}},I=()=>{for(const L of[...o])M(L,!1);for(const L of p.value.values())L.isHovered&&(L.isHovered=!1)},N=({delta:L,camera:F})=>{if(!d.value)return;const O=F?.activeCamera?.value;if(!O)return;const X=Math.min(L,1/30);S+=X;const $=x(O),te=g.get(),ue=r.value?1:0,xe=.05*(L*1e3/16.6);s.value+=(ue-s.value)*Math.min(xe,1),s.value=Math.max(0,Math.min(1,s.value)),t.value?.baseMaterial?.uniforms&&(t.value.baseMaterial.uniforms.uMouseNDC.value.copy(n.value),t.value.baseMaterial.uniforms.uInfluence.value=s.value,t.value.baseMaterial.uniforms.uScrollOffset.value=te,t.value.baseMaterial.uniforms.uAspect.value=$,t.value.baseMaterial.uniforms.uTime.value=S);const He=t.value?.rotatingGroup;He&&(y.target.y=n.value.y*Nm*s.value,y.target.x=n.value.x*Nm*s.value,y.current=y.current.lerp(y.target,y.lerp(X*1e3)),He.rotation.y=y.current.y,He.rotation.x=y.current.x);const Ke=t.value;if(!Ke)return;if(!r.value){I(),A();return}const qe=Ke.highlightParticles,K=Ke.hlDistances,ye=Ke.hlInitialAngles,le=Ke.hlAngularSpeeds,De=Ke.hlZs;for(let Ne=0;Ne<K.length;Ne++){const Ge=K[Ne]+te*IP,ft=ye[Ne]-le[Ne]*S,Ye=De[Ne];a.set(Math.cos(ft)*Ge,Math.sin(ft)*Ge*$,Ye),a.applyMatrix4(qe.matrixWorld),a.project(O);const Q=(a.x-n.value.x)*O.aspect,se=a.y-n.value.y,ee=Math.hypot(Q,se)<PP&&s.value>0;if(M(Ne,ee),ee&&typeof Ke.hlLabels[Ne]<"u"){const pe=p.value.get(Ne);pe?(pe.x=R(a.x),pe.y=R(-a.y),pe.isHovered=!0):p.value.set(Ne,{id:Ne,x:R(a.x),y:R(-a.y),text:Ke.hlLabels[Ne],isHovered:!0})}else if(p.value.has(Ne)){const pe=p.value.get(Ne);pe.isHovered=!1,pe.x=R(a.x),pe.y=R(-a.y)}}A()},U=new P(.78,0,1.1),k=new P(.78,0,0);return(L,F)=>(ae(),ht("div",{ref_key:"containerRef",ref:e,"aria-hidden":"true",class:"relative h-full"},[Ce(re(hP),{"clear-color":"#011222",onLoop:N},{default:Be(()=>[Qe("TresPerspectiveCamera",{position:re(U),"look-at":re(k),"rotate-z":Math.PI*-.5},null,8,CP),T.value?(ae(),Xe(bP,{key:0,ref_key:"childRef",ref:t,aspect:T.value},null,8,["aspect"])):xt("",!0)]),_:1}),Qe("div",RP,[(ae(!0),ht(en,null,Hn(Array.from(p.value.values()),O=>(ae(),Xe(TP,{key:O.id,text:O.text,x:O.x,y:O.y,"is-hovered":O.isHovered,style:{"background-color":"#001222",color:"#5C6874"},onComplete:X=>p.value.delete(O.id)},null,8,["text","x","y","is-hovered","onComplete"]))),128))])],512))}}),XP=Object.assign(pv(LP,[["__scopeId","data-v-f7b3ef45"]]),{__name:"CanvasFooterGlobe"});export{XP as F,zP as _,HP as a,VP as b,GP as c,WP as u};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.